diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusRequest.Converters.g.cs new file mode 100644 index 00000000000..07fff609b5e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.AsyncSearch.Json; + +public sealed partial class AsyncSearchStatusRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusRequest.g.cs index d4fb5f65fde..4f445b98070 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusRequest.g.cs @@ -34,35 +34,6 @@ public sealed partial class AsyncSearchStatusRequestParameters : Elastic.Transpo public Elastic.Clients.Elasticsearch.Duration? KeepAlive { get => Q("keep_alive"); set => Q("keep_alive", value); } } -internal sealed partial class AsyncSearchStatusRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get the async search status. @@ -84,7 +55,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.AsyncSearch.Json.AsyncSearchStatusRequestConverter))] public sealed partial class AsyncSearchStatusRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.Converters.g.cs new file mode 100644 index 00000000000..9125e838548 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.Converters.g.cs @@ -0,0 +1,162 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.AsyncSearch.Json; + +public 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 Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClusters = default; + LocalJsonValue propCompletionStatus = default; + LocalJsonValue propCompletionTime = default; + LocalJsonValue propCompletionTimeInMillis = default; + LocalJsonValue propExpirationTime = default; + LocalJsonValue propExpirationTimeInMillis = default; + LocalJsonValue propId = default; + LocalJsonValue propIsPartial = default; + LocalJsonValue propIsRunning = default; + LocalJsonValue propShards = default; + LocalJsonValue propStartTime = default; + LocalJsonValue propStartTimeInMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClusters.TryReadProperty(ref reader, options, PropClusters, null)) + { + continue; + } + + if (propCompletionStatus.TryReadProperty(ref reader, options, PropCompletionStatus, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCompletionTime.TryReadProperty(ref reader, options, PropCompletionTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propCompletionTimeInMillis.TryReadProperty(ref reader, options, PropCompletionTimeInMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propExpirationTime.TryReadProperty(ref reader, options, PropExpirationTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propExpirationTimeInMillis.TryReadProperty(ref reader, options, PropExpirationTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIsPartial.TryReadProperty(ref reader, options, PropIsPartial, null)) + { + continue; + } + + if (propIsRunning.TryReadProperty(ref reader, options, PropIsRunning, null)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (propStartTime.TryReadProperty(ref reader, options, PropStartTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + 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, Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClusters, value.Clusters, null, null); + writer.WriteProperty(options, PropCompletionStatus, value.CompletionStatus, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCompletionTime, value.CompletionTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropCompletionTimeInMillis, value.CompletionTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropExpirationTime, value.ExpirationTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropExpirationTimeInMillis, value.ExpirationTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIsPartial, value.IsPartial, null, null); + writer.WriteProperty(options, PropIsRunning, value.IsRunning, null, null); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteProperty(options, PropStartTime, value.StartTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.g.cs index 7bd62350c9e..9610d6a9a60 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.g.cs @@ -23,145 +23,7 @@ namespace Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClusters = default; - LocalJsonValue propCompletionStatus = default; - LocalJsonValue propCompletionTime = default; - LocalJsonValue propCompletionTimeInMillis = default; - LocalJsonValue propExpirationTime = default; - LocalJsonValue propExpirationTimeInMillis = default; - LocalJsonValue propId = default; - LocalJsonValue propIsPartial = default; - LocalJsonValue propIsRunning = default; - LocalJsonValue propShards = default; - LocalJsonValue propStartTime = default; - LocalJsonValue propStartTimeInMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClusters.TryReadProperty(ref reader, options, PropClusters, null)) - { - continue; - } - - if (propCompletionStatus.TryReadProperty(ref reader, options, PropCompletionStatus, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCompletionTime.TryReadProperty(ref reader, options, PropCompletionTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propCompletionTimeInMillis.TryReadProperty(ref reader, options, PropCompletionTimeInMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propExpirationTime.TryReadProperty(ref reader, options, PropExpirationTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propExpirationTimeInMillis.TryReadProperty(ref reader, options, PropExpirationTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIsPartial.TryReadProperty(ref reader, options, PropIsPartial, null)) - { - continue; - } - - if (propIsRunning.TryReadProperty(ref reader, options, PropIsRunning, null)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (propStartTime.TryReadProperty(ref reader, options, PropStartTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - 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, Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClusters, value.Clusters, null, null); - writer.WriteProperty(options, PropCompletionStatus, value.CompletionStatus, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCompletionTime, value.CompletionTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropCompletionTimeInMillis, value.CompletionTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropExpirationTime, value.ExpirationTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropExpirationTimeInMillis, value.ExpirationTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIsPartial, value.IsPartial, null, null); - writer.WriteProperty(options, PropIsRunning, value.IsRunning, null, null); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteProperty(options, PropStartTime, value.StartTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.AsyncSearch.Json.AsyncSearchStatusResponseConverter))] public sealed partial class AsyncSearchStatusResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchRequest.Converters.g.cs new file mode 100644 index 00000000000..e9d0cc96cf0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.AsyncSearch.Json; + +public sealed partial class DeleteAsyncSearchRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchRequest.g.cs index 0d1d5481707..bab954971b2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class DeleteAsyncSearchRequestParameters : Elastic.Transpo { } -internal sealed partial class DeleteAsyncSearchRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete an async search. @@ -66,7 +37,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If the Elasticsearch security features are enabled, the deletion of a specific async search is restricted to: the authenticated user that submitted the original search request; users that have the cancel_task cluster privilege. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.AsyncSearch.Json.DeleteAsyncSearchRequestConverter))] public sealed partial class DeleteAsyncSearchRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.Converters.g.cs new file mode 100644 index 00000000000..f6d7fdb59c0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.AsyncSearch.Json; + +public 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 Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.g.cs index 2607a4672c7..51ae2d0428e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.AsyncSearch.Json.DeleteAsyncSearchResponseConverter))] public sealed partial class DeleteAsyncSearchResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchRequest.Converters.g.cs new file mode 100644 index 00000000000..927f5029662 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.AsyncSearch.Json; + +public sealed partial class GetAsyncSearchRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchRequest.g.cs index e68424ae83f..20667989cd0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchRequest.g.cs @@ -53,35 +53,6 @@ public sealed partial class GetAsyncSearchRequestParameters : Elastic.Transport. public Elastic.Clients.Elasticsearch.Duration? WaitForCompletionTimeout { get => Q("wait_for_completion_timeout"); set => Q("wait_for_completion_timeout", value); } } -internal sealed partial class GetAsyncSearchRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get async search results. @@ -91,7 +62,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If the Elasticsearch security features are enabled, access to the results of a specific async search is restricted to the user or API key that submitted it. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.AsyncSearch.Json.GetAsyncSearchRequestConverter))] public partial class GetAsyncSearchRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.Converters.g.cs new file mode 100644 index 00000000000..fb882a6fb99 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.Converters.g.cs @@ -0,0 +1,160 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.AsyncSearch.Json; + +public 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 Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCompletionTime = default; + LocalJsonValue propCompletionTimeInMillis = default; + LocalJsonValue propExpirationTime = default; + LocalJsonValue propExpirationTimeInMillis = default; + LocalJsonValue propId = default; + LocalJsonValue propIsPartial = default; + LocalJsonValue propIsRunning = default; + LocalJsonValue> propResponse = default; + LocalJsonValue propStartTime = default; + LocalJsonValue propStartTimeInMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCompletionTime.TryReadProperty(ref reader, options, PropCompletionTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propCompletionTimeInMillis.TryReadProperty(ref reader, options, PropCompletionTimeInMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propExpirationTime.TryReadProperty(ref reader, options, PropExpirationTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propExpirationTimeInMillis.TryReadProperty(ref reader, options, PropExpirationTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIsPartial.TryReadProperty(ref reader, options, PropIsPartial, null)) + { + continue; + } + + if (propIsRunning.TryReadProperty(ref reader, options, PropIsRunning, null)) + { + continue; + } + + if (propResponse.TryReadProperty(ref reader, options, PropResponse, null)) + { + continue; + } + + if (propStartTime.TryReadProperty(ref reader, options, PropStartTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + 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, Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCompletionTime, value.CompletionTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropCompletionTimeInMillis, value.CompletionTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropExpirationTime, value.ExpirationTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropExpirationTimeInMillis, value.ExpirationTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIsPartial, value.IsPartial, null, null); + writer.WriteProperty(options, PropIsRunning, value.IsRunning, null, null); + writer.WriteProperty(options, PropResponse, value.Response, null, null); + writer.WriteProperty(options, PropStartTime, value.StartTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteEndObject(); + } +} + +public sealed partial class GetAsyncSearchResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(GetAsyncSearchResponse<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + 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)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.g.cs index 5be849a793b..9d379a1f20d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.g.cs @@ -23,143 +23,7 @@ namespace Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCompletionTime = default; - LocalJsonValue propCompletionTimeInMillis = default; - LocalJsonValue propExpirationTime = default; - LocalJsonValue propExpirationTimeInMillis = default; - LocalJsonValue propId = default; - LocalJsonValue propIsPartial = default; - LocalJsonValue propIsRunning = default; - LocalJsonValue> propResponse = default; - LocalJsonValue propStartTime = default; - LocalJsonValue propStartTimeInMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCompletionTime.TryReadProperty(ref reader, options, PropCompletionTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propCompletionTimeInMillis.TryReadProperty(ref reader, options, PropCompletionTimeInMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propExpirationTime.TryReadProperty(ref reader, options, PropExpirationTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propExpirationTimeInMillis.TryReadProperty(ref reader, options, PropExpirationTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIsPartial.TryReadProperty(ref reader, options, PropIsPartial, null)) - { - continue; - } - - if (propIsRunning.TryReadProperty(ref reader, options, PropIsRunning, null)) - { - continue; - } - - if (propResponse.TryReadProperty(ref reader, options, PropResponse, null)) - { - continue; - } - - if (propStartTime.TryReadProperty(ref reader, options, PropStartTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - 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, Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCompletionTime, value.CompletionTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropCompletionTimeInMillis, value.CompletionTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropExpirationTime, value.ExpirationTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropExpirationTimeInMillis, value.ExpirationTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIsPartial, value.IsPartial, null, null); - writer.WriteProperty(options, PropIsRunning, value.IsRunning, null, null); - writer.WriteProperty(options, PropResponse, value.Response, null, null); - writer.WriteProperty(options, PropStartTime, value.StartTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - 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<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - 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)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchResponseConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.AsyncSearch.Json.GetAsyncSearchResponseConverterFactory))] public sealed partial class GetAsyncSearchResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.Converters.g.cs new file mode 100644 index 00000000000..7a9650930eb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.Converters.g.cs @@ -0,0 +1,343 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.AsyncSearch.Json; + +public sealed partial class SubmitAsyncSearchRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + 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 Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAggregations = default; + LocalJsonValue propCollapse = default; + LocalJsonValue?> propDocvalueFields = default; + LocalJsonValue propExplain = default; + LocalJsonValue?> propExt = default; + LocalJsonValue?> propFields = default; + LocalJsonValue propFrom = default; + LocalJsonValue propHighlight = default; + LocalJsonValue>?> propIndicesBoost = default; + LocalJsonValue?> propKnn = default; + LocalJsonValue propMinScore = default; + LocalJsonValue propPit = default; + LocalJsonValue propPostFilter = default; + LocalJsonValue propProfile = default; + LocalJsonValue propQuery = default; + LocalJsonValue?> propRescore = default; + LocalJsonValue?> propRuntimeMappings = default; + LocalJsonValue?> propScriptFields = default; + LocalJsonValue?> propSearchAfter = default; + LocalJsonValue propSeqNoPrimaryTerm = default; + LocalJsonValue propSize = default; + LocalJsonValue propSlice = default; + LocalJsonValue?> propSort = default; + LocalJsonValue propSource = default; + LocalJsonValue?> propStats = default; + LocalJsonValue propStoredFields = default; + LocalJsonValue propSuggest = default; + LocalJsonValue propTerminateAfter = default; + LocalJsonValue propTimeout = default; + LocalJsonValue propTrackScores = default; + LocalJsonValue propTrackTotalHits = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)) || propAggregations.TryReadProperty(ref reader, options, PropAggregations1, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propCollapse.TryReadProperty(ref reader, options, PropCollapse, null)) + { + continue; + } + + if (propDocvalueFields.TryReadProperty(ref reader, options, PropDocvalueFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propExplain.TryReadProperty(ref reader, options, PropExplain, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propExt.TryReadProperty(ref reader, options, PropExt, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propFrom.TryReadProperty(ref reader, options, PropFrom, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propHighlight.TryReadProperty(ref reader, options, PropHighlight, null)) + { + continue; + } + + if (propIndicesBoost.TryReadProperty(ref reader, options, PropIndicesBoost, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null)))) + { + continue; + } + + if (propKnn.TryReadProperty(ref reader, options, PropKnn, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPit.TryReadProperty(ref reader, options, PropPit, null)) + { + continue; + } + + if (propPostFilter.TryReadProperty(ref reader, options, PropPostFilter, null)) + { + continue; + } + + if (propProfile.TryReadProperty(ref reader, options, PropProfile, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propRescore.TryReadProperty(ref reader, options, PropRescore, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propScriptFields.TryReadProperty(ref reader, options, PropScriptFields, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propSearchAfter.TryReadProperty(ref reader, options, PropSearchAfter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propSeqNoPrimaryTerm.TryReadProperty(ref reader, options, PropSeqNoPrimaryTerm, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSlice.TryReadProperty(ref reader, options, PropSlice, null)) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (propStats.TryReadProperty(ref reader, options, PropStats, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStoredFields.TryReadProperty(ref reader, options, PropStoredFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propSuggest.TryReadProperty(ref reader, options, PropSuggest, null)) + { + continue; + } + + if (propTerminateAfter.TryReadProperty(ref reader, options, PropTerminateAfter, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeout.TryReadProperty(ref reader, options, PropTimeout, null)) + { + continue; + } + + if (propTrackScores.TryReadProperty(ref reader, options, PropTrackScores, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTrackTotalHits.TryReadProperty(ref reader, options, PropTrackTotalHits, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + 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, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropCollapse, value.Collapse, null, null); + writer.WriteProperty(options, PropDocvalueFields, value.DocvalueFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropExplain, value.Explain, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropExt, value.Ext, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFrom, value.From, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropHighlight, value.Highlight, null, null); + writer.WriteProperty(options, PropIndicesBoost, value.IndicesBoost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null))); + writer.WriteProperty(options, PropKnn, value.Knn, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPit, value.Pit, null, null); + writer.WriteProperty(options, PropPostFilter, value.PostFilter, null, null); + writer.WriteProperty(options, PropProfile, value.Profile, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropRescore, value.Rescore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropScriptFields, value.ScriptFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropSearchAfter, value.SearchAfter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSeqNoPrimaryTerm, value.SeqNoPrimaryTerm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSlice, value.Slice, null, null); + writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteProperty(options, PropStats, value.Stats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStoredFields, value.StoredFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropSuggest, value.Suggest, null, null); + writer.WriteProperty(options, PropTerminateAfter, value.TerminateAfter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeout, value.Timeout, null, null); + writer.WriteProperty(options, PropTrackScores, value.TrackScores, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTrackTotalHits, value.TrackTotalHits, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.g.cs index b1ad3f5c19c..14873b213fd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.g.cs @@ -232,325 +232,6 @@ public sealed partial class SubmitAsyncSearchRequestParameters : Elastic.Transpo public Elastic.Clients.Elasticsearch.Duration? WaitForCompletionTimeout { get => Q("wait_for_completion_timeout"); set => Q("wait_for_completion_timeout", value); } } -internal sealed partial class SubmitAsyncSearchRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - 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 Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAggregations = default; - LocalJsonValue propCollapse = default; - LocalJsonValue?> propDocvalueFields = default; - LocalJsonValue propExplain = default; - LocalJsonValue?> propExt = default; - LocalJsonValue?> propFields = default; - LocalJsonValue propFrom = default; - LocalJsonValue propHighlight = default; - LocalJsonValue>?> propIndicesBoost = default; - LocalJsonValue?> propKnn = default; - LocalJsonValue propMinScore = default; - LocalJsonValue propPit = default; - LocalJsonValue propPostFilter = default; - LocalJsonValue propProfile = default; - LocalJsonValue propQuery = default; - LocalJsonValue?> propRescore = default; - LocalJsonValue?> propRuntimeMappings = default; - LocalJsonValue?> propScriptFields = default; - LocalJsonValue?> propSearchAfter = default; - LocalJsonValue propSeqNoPrimaryTerm = default; - LocalJsonValue propSize = default; - LocalJsonValue propSlice = default; - LocalJsonValue?> propSort = default; - LocalJsonValue propSource = default; - LocalJsonValue?> propStats = default; - LocalJsonValue propStoredFields = default; - LocalJsonValue propSuggest = default; - LocalJsonValue propTerminateAfter = default; - LocalJsonValue propTimeout = default; - LocalJsonValue propTrackScores = default; - LocalJsonValue propTrackTotalHits = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)) || propAggregations.TryReadProperty(ref reader, options, PropAggregations1, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propCollapse.TryReadProperty(ref reader, options, PropCollapse, null)) - { - continue; - } - - if (propDocvalueFields.TryReadProperty(ref reader, options, PropDocvalueFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propExplain.TryReadProperty(ref reader, options, PropExplain, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propExt.TryReadProperty(ref reader, options, PropExt, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propFrom.TryReadProperty(ref reader, options, PropFrom, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propHighlight.TryReadProperty(ref reader, options, PropHighlight, null)) - { - continue; - } - - if (propIndicesBoost.TryReadProperty(ref reader, options, PropIndicesBoost, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null)))) - { - continue; - } - - if (propKnn.TryReadProperty(ref reader, options, PropKnn, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPit.TryReadProperty(ref reader, options, PropPit, null)) - { - continue; - } - - if (propPostFilter.TryReadProperty(ref reader, options, PropPostFilter, null)) - { - continue; - } - - if (propProfile.TryReadProperty(ref reader, options, PropProfile, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propRescore.TryReadProperty(ref reader, options, PropRescore, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propScriptFields.TryReadProperty(ref reader, options, PropScriptFields, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propSearchAfter.TryReadProperty(ref reader, options, PropSearchAfter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propSeqNoPrimaryTerm.TryReadProperty(ref reader, options, PropSeqNoPrimaryTerm, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSlice.TryReadProperty(ref reader, options, PropSlice, null)) - { - continue; - } - - if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (propStats.TryReadProperty(ref reader, options, PropStats, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStoredFields.TryReadProperty(ref reader, options, PropStoredFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propSuggest.TryReadProperty(ref reader, options, PropSuggest, null)) - { - continue; - } - - if (propTerminateAfter.TryReadProperty(ref reader, options, PropTerminateAfter, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeout.TryReadProperty(ref reader, options, PropTimeout, null)) - { - continue; - } - - if (propTrackScores.TryReadProperty(ref reader, options, PropTrackScores, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTrackTotalHits.TryReadProperty(ref reader, options, PropTrackTotalHits, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - 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, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropCollapse, value.Collapse, null, null); - writer.WriteProperty(options, PropDocvalueFields, value.DocvalueFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropExplain, value.Explain, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropExt, value.Ext, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFrom, value.From, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropHighlight, value.Highlight, null, null); - writer.WriteProperty(options, PropIndicesBoost, value.IndicesBoost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null))); - writer.WriteProperty(options, PropKnn, value.Knn, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPit, value.Pit, null, null); - writer.WriteProperty(options, PropPostFilter, value.PostFilter, null, null); - writer.WriteProperty(options, PropProfile, value.Profile, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropRescore, value.Rescore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropScriptFields, value.ScriptFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropSearchAfter, value.SearchAfter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSeqNoPrimaryTerm, value.SeqNoPrimaryTerm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSlice, value.Slice, null, null); - writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteProperty(options, PropStats, value.Stats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStoredFields, value.StoredFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropSuggest, value.Suggest, null, null); - writer.WriteProperty(options, PropTerminateAfter, value.TerminateAfter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeout, value.Timeout, null, null); - writer.WriteProperty(options, PropTrackScores, value.TrackScores, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTrackTotalHits, value.TrackTotalHits, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Run an async search. @@ -566,7 +247,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The maximum allowed size for a stored async search response can be set by changing the search.max_async_search_response_size cluster level setting. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.AsyncSearch.Json.SubmitAsyncSearchRequestConverter))] public partial class SubmitAsyncSearchRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchResponse.Converters.g.cs new file mode 100644 index 00000000000..23f19053d3f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchResponse.Converters.g.cs @@ -0,0 +1,160 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.AsyncSearch.Json; + +public 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 Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCompletionTime = default; + LocalJsonValue propCompletionTimeInMillis = default; + LocalJsonValue propExpirationTime = default; + LocalJsonValue propExpirationTimeInMillis = default; + LocalJsonValue propId = default; + LocalJsonValue propIsPartial = default; + LocalJsonValue propIsRunning = default; + LocalJsonValue> propResponse = default; + LocalJsonValue propStartTime = default; + LocalJsonValue propStartTimeInMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCompletionTime.TryReadProperty(ref reader, options, PropCompletionTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propCompletionTimeInMillis.TryReadProperty(ref reader, options, PropCompletionTimeInMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propExpirationTime.TryReadProperty(ref reader, options, PropExpirationTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propExpirationTimeInMillis.TryReadProperty(ref reader, options, PropExpirationTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIsPartial.TryReadProperty(ref reader, options, PropIsPartial, null)) + { + continue; + } + + if (propIsRunning.TryReadProperty(ref reader, options, PropIsRunning, null)) + { + continue; + } + + if (propResponse.TryReadProperty(ref reader, options, PropResponse, null)) + { + continue; + } + + if (propStartTime.TryReadProperty(ref reader, options, PropStartTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + 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, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCompletionTime, value.CompletionTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropCompletionTimeInMillis, value.CompletionTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropExpirationTime, value.ExpirationTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropExpirationTimeInMillis, value.ExpirationTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIsPartial, value.IsPartial, null, null); + writer.WriteProperty(options, PropIsRunning, value.IsRunning, null, null); + writer.WriteProperty(options, PropResponse, value.Response, null, null); + writer.WriteProperty(options, PropStartTime, value.StartTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteEndObject(); + } +} + +public sealed partial class SubmitAsyncSearchResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(SubmitAsyncSearchResponse<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + 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)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchResponse.g.cs index b51614893b3..30bbe4819ab 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchResponse.g.cs @@ -23,143 +23,7 @@ namespace Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCompletionTime = default; - LocalJsonValue propCompletionTimeInMillis = default; - LocalJsonValue propExpirationTime = default; - LocalJsonValue propExpirationTimeInMillis = default; - LocalJsonValue propId = default; - LocalJsonValue propIsPartial = default; - LocalJsonValue propIsRunning = default; - LocalJsonValue> propResponse = default; - LocalJsonValue propStartTime = default; - LocalJsonValue propStartTimeInMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCompletionTime.TryReadProperty(ref reader, options, PropCompletionTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propCompletionTimeInMillis.TryReadProperty(ref reader, options, PropCompletionTimeInMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propExpirationTime.TryReadProperty(ref reader, options, PropExpirationTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propExpirationTimeInMillis.TryReadProperty(ref reader, options, PropExpirationTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIsPartial.TryReadProperty(ref reader, options, PropIsPartial, null)) - { - continue; - } - - if (propIsRunning.TryReadProperty(ref reader, options, PropIsRunning, null)) - { - continue; - } - - if (propResponse.TryReadProperty(ref reader, options, PropResponse, null)) - { - continue; - } - - if (propStartTime.TryReadProperty(ref reader, options, PropStartTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - 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, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCompletionTime, value.CompletionTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropCompletionTimeInMillis, value.CompletionTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropExpirationTime, value.ExpirationTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropExpirationTimeInMillis, value.ExpirationTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIsPartial, value.IsPartial, null, null); - writer.WriteProperty(options, PropIsRunning, value.IsRunning, null, null); - writer.WriteProperty(options, PropResponse, value.Response, null, null); - writer.WriteProperty(options, PropStartTime, value.StartTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - 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<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - 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)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponseConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.AsyncSearch.Json.SubmitAsyncSearchResponseConverterFactory))] public sealed partial class SubmitAsyncSearchResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/BulkRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/BulkRequest.g.cs index b1772c8d64e..d0da2b9aacf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/BulkRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/BulkRequest.g.cs @@ -1413,4 +1413,4 @@ public Elastic.Clients.Elasticsearch.BulkRequestDescriptor RequestCon Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; return this; } -} +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/BulkResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/BulkResponse.Converters.g.cs new file mode 100644 index 00000000000..88c02e66c27 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/BulkResponse.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class 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 PropItems = System.Text.Json.JsonEncodedText.Encode("items"); + private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); + + public override Elastic.Clients.Elasticsearch.BulkResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propErrors = default; + LocalJsonValue propIngestTook = default; + LocalJsonValue> propItems = default; + LocalJsonValue propTook = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propErrors.TryReadProperty(ref reader, options, PropErrors, null)) + { + continue; + } + + if (propIngestTook.TryReadProperty(ref reader, options, PropIngestTook, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propItems.TryReadProperty(ref reader, options, PropItems, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propTook.TryReadProperty(ref reader, options, PropTook, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.BulkResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Errors = propErrors.Value, + IngestTook = propIngestTook.Value, + Items = propItems.Value, + Took = propTook.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.BulkResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropErrors, value.Errors, null, null); + writer.WriteProperty(options, PropIngestTook, value.IngestTook, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropItems, value.Items, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTook, value.Took, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/BulkResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/BulkResponse.g.cs index c93dabef493..92e581942ea 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/BulkResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/BulkResponse.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -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 PropItems = System.Text.Json.JsonEncodedText.Encode("items"); - private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); - - public override Elastic.Clients.Elasticsearch.BulkResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propErrors = default; - LocalJsonValue propIngestTook = default; - LocalJsonValue> propItems = default; - LocalJsonValue propTook = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propErrors.TryReadProperty(ref reader, options, PropErrors, null)) - { - continue; - } - - if (propIngestTook.TryReadProperty(ref reader, options, PropIngestTook, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propItems.TryReadProperty(ref reader, options, PropItems, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propTook.TryReadProperty(ref reader, options, PropTook, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.BulkResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Errors = propErrors.Value, - IngestTook = propIngestTook.Value, - Items = propItems.Value, - Took = propTook.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.BulkResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropErrors, value.Errors, null, null); - writer.WriteProperty(options, PropIngestTook, value.IngestTook, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropItems, value.Items, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTook, value.Took, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.BulkResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.BulkResponseConverter))] public partial class BulkResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClearScrollRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClearScrollRequest.Converters.g.cs new file mode 100644 index 00000000000..f53d7a3fb05 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClearScrollRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ClearScrollRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropScrollId = System.Text.Json.JsonEncodedText.Encode("scroll_id"); + + public override Elastic.Clients.Elasticsearch.ClearScrollRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propScrollId = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propScrollId.TryReadProperty(ref reader, options, PropScrollId, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ClearScrollRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ScrollId = propScrollId.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ClearScrollRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropScrollId, value.ScrollId, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClearScrollRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClearScrollRequest.g.cs index d12e46cd088..551db5d0dec 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClearScrollRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClearScrollRequest.g.cs @@ -27,52 +27,13 @@ public sealed partial class ClearScrollRequestParameters : Elastic.Transport.Req { } -internal sealed partial class ClearScrollRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropScrollId = System.Text.Json.JsonEncodedText.Encode("scroll_id"); - - public override Elastic.Clients.Elasticsearch.ClearScrollRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propScrollId = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propScrollId.TryReadProperty(ref reader, options, PropScrollId, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ClearScrollRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ScrollId = propScrollId.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ClearScrollRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropScrollId, value.ScrollId, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Clear a scrolling search. /// Clear the search context and results for a scrolling search. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ClearScrollRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ClearScrollRequestConverter))] public sealed partial class ClearScrollRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClearScrollResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClearScrollResponse.Converters.g.cs new file mode 100644 index 00000000000..7ef525039f3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClearScrollResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public 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 Elastic.Clients.Elasticsearch.ClearScrollResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propNumFreed = default; + LocalJsonValue propSucceeded = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNumFreed.TryReadProperty(ref reader, options, PropNumFreed, null)) + { + continue; + } + + if (propSucceeded.TryReadProperty(ref reader, options, PropSucceeded, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ClearScrollResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + NumFreed = propNumFreed.Value, + Succeeded = propSucceeded.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ClearScrollResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNumFreed, value.NumFreed, null, null); + writer.WriteProperty(options, PropSucceeded, value.Succeeded, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClearScrollResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClearScrollResponse.g.cs index 23428595c6d..646e2d055cb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClearScrollResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClearScrollResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -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 Elastic.Clients.Elasticsearch.ClearScrollResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propNumFreed = default; - LocalJsonValue propSucceeded = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNumFreed.TryReadProperty(ref reader, options, PropNumFreed, null)) - { - continue; - } - - if (propSucceeded.TryReadProperty(ref reader, options, PropSucceeded, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ClearScrollResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - NumFreed = propNumFreed.Value, - Succeeded = propSucceeded.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ClearScrollResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNumFreed, value.NumFreed, null, null); - writer.WriteProperty(options, PropSucceeded, value.Succeeded, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ClearScrollResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ClearScrollResponseConverter))] public sealed partial class ClearScrollResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClosePointInTimeRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClosePointInTimeRequest.Converters.g.cs new file mode 100644 index 00000000000..48dbf9d9f22 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClosePointInTimeRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ClosePointInTimeRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + + public override Elastic.Clients.Elasticsearch.ClosePointInTimeRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ClosePointInTimeRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ClosePointInTimeRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClosePointInTimeRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClosePointInTimeRequest.g.cs index 0b5a601afbd..792108d6d2d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClosePointInTimeRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClosePointInTimeRequest.g.cs @@ -27,45 +27,6 @@ public sealed partial class ClosePointInTimeRequestParameters : Elastic.Transpor { } -internal sealed partial class ClosePointInTimeRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - - public override Elastic.Clients.Elasticsearch.ClosePointInTimeRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ClosePointInTimeRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ClosePointInTimeRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Close a point in time. @@ -75,7 +36,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// However, keeping points in time has a cost; close them as soon as they are no longer required for search requests. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ClosePointInTimeRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ClosePointInTimeRequestConverter))] public sealed partial class ClosePointInTimeRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClosePointInTimeResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClosePointInTimeResponse.Converters.g.cs new file mode 100644 index 00000000000..ace0191928f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClosePointInTimeResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public 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 Elastic.Clients.Elasticsearch.ClosePointInTimeResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propNumFreed = default; + LocalJsonValue propSucceeded = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNumFreed.TryReadProperty(ref reader, options, PropNumFreed, null)) + { + continue; + } + + if (propSucceeded.TryReadProperty(ref reader, options, PropSucceeded, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ClosePointInTimeResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + NumFreed = propNumFreed.Value, + Succeeded = propSucceeded.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ClosePointInTimeResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNumFreed, value.NumFreed, null, null); + writer.WriteProperty(options, PropSucceeded, value.Succeeded, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClosePointInTimeResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClosePointInTimeResponse.g.cs index 758ab425680..35ddcd48fe5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClosePointInTimeResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ClosePointInTimeResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -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 Elastic.Clients.Elasticsearch.ClosePointInTimeResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propNumFreed = default; - LocalJsonValue propSucceeded = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNumFreed.TryReadProperty(ref reader, options, PropNumFreed, null)) - { - continue; - } - - if (propSucceeded.TryReadProperty(ref reader, options, PropSucceeded, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ClosePointInTimeResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - NumFreed = propNumFreed.Value, - Succeeded = propSucceeded.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ClosePointInTimeResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNumFreed, value.NumFreed, null, null); - writer.WriteProperty(options, PropSucceeded, value.Succeeded, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ClosePointInTimeResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ClosePointInTimeResponseConverter))] public sealed partial class ClosePointInTimeResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/AllocationExplainRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/AllocationExplainRequest.Converters.g.cs new file mode 100644 index 00000000000..e5bc26e4afa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/AllocationExplainRequest.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class AllocationExplainRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCurrentNode = System.Text.Json.JsonEncodedText.Encode("current_node"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropPrimary = System.Text.Json.JsonEncodedText.Encode("primary"); + private static readonly System.Text.Json.JsonEncodedText PropShard = System.Text.Json.JsonEncodedText.Encode("shard"); + + public override Elastic.Clients.Elasticsearch.Cluster.AllocationExplainRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCurrentNode = default; + LocalJsonValue propIndex = default; + LocalJsonValue propPrimary = default; + LocalJsonValue propShard = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCurrentNode.TryReadProperty(ref reader, options, PropCurrentNode, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propPrimary.TryReadProperty(ref reader, options, PropPrimary, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propShard.TryReadProperty(ref reader, options, PropShard, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.AllocationExplainRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CurrentNode = propCurrentNode.Value, + Index = propIndex.Value, + Primary = propPrimary.Value, + Shard = propShard.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.AllocationExplainRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCurrentNode, value.CurrentNode, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropPrimary, value.Primary, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropShard, value.Shard, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/AllocationExplainRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/AllocationExplainRequest.g.cs index 7587f3187e9..1cd840acfe5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/AllocationExplainRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/AllocationExplainRequest.g.cs @@ -47,72 +47,6 @@ public sealed partial class AllocationExplainRequestParameters : Elastic.Transpo public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class AllocationExplainRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCurrentNode = System.Text.Json.JsonEncodedText.Encode("current_node"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropPrimary = System.Text.Json.JsonEncodedText.Encode("primary"); - private static readonly System.Text.Json.JsonEncodedText PropShard = System.Text.Json.JsonEncodedText.Encode("shard"); - - public override Elastic.Clients.Elasticsearch.Cluster.AllocationExplainRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCurrentNode = default; - LocalJsonValue propIndex = default; - LocalJsonValue propPrimary = default; - LocalJsonValue propShard = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCurrentNode.TryReadProperty(ref reader, options, PropCurrentNode, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propPrimary.TryReadProperty(ref reader, options, PropPrimary, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propShard.TryReadProperty(ref reader, options, PropShard, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.AllocationExplainRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CurrentNode = propCurrentNode.Value, - Index = propIndex.Value, - Primary = propPrimary.Value, - Shard = propShard.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.AllocationExplainRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCurrentNode, value.CurrentNode, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropPrimary, value.Primary, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropShard, value.Shard, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Explain the shard allocations. @@ -124,7 +58,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Refer to the linked documentation for examples of how to troubleshoot allocation issues using this API. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.AllocationExplainRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.AllocationExplainRequestConverter))] public sealed partial class AllocationExplainRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/AllocationExplainResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/AllocationExplainResponse.Converters.g.cs new file mode 100644 index 00000000000..8a6bfaffdee --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/AllocationExplainResponse.Converters.g.cs @@ -0,0 +1,279 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class 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 Elastic.Clients.Elasticsearch.Cluster.AllocationExplainResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllocateExplanation = default; + LocalJsonValue propAllocationDelay = default; + LocalJsonValue propAllocationDelayInMillis = default; + LocalJsonValue propCanAllocate = default; + LocalJsonValue propCanMoveToOtherNode = default; + LocalJsonValue propCanRebalanceCluster = default; + LocalJsonValue?> propCanRebalanceClusterDecisions = default; + LocalJsonValue propCanRebalanceToOtherNode = default; + LocalJsonValue?> propCanRemainDecisions = default; + LocalJsonValue propCanRemainOnCurrentNode = default; + LocalJsonValue propClusterInfo = default; + LocalJsonValue propConfiguredDelay = default; + LocalJsonValue propConfiguredDelayInMillis = default; + LocalJsonValue propCurrentNode = default; + LocalJsonValue propCurrentState = default; + LocalJsonValue propIndex = default; + LocalJsonValue propMoveExplanation = default; + LocalJsonValue?> propNodeAllocationDecisions = default; + LocalJsonValue propNote = default; + LocalJsonValue propPrimary = default; + LocalJsonValue propRebalanceExplanation = default; + LocalJsonValue propRemainingDelay = default; + LocalJsonValue propRemainingDelayInMillis = default; + LocalJsonValue propShard = default; + LocalJsonValue propUnassignedInfo = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllocateExplanation.TryReadProperty(ref reader, options, PropAllocateExplanation, null)) + { + continue; + } + + if (propAllocationDelay.TryReadProperty(ref reader, options, PropAllocationDelay, null)) + { + continue; + } + + if (propAllocationDelayInMillis.TryReadProperty(ref reader, options, PropAllocationDelayInMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propCanAllocate.TryReadProperty(ref reader, options, PropCanAllocate, static Elastic.Clients.Elasticsearch.Cluster.Decision? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCanMoveToOtherNode.TryReadProperty(ref reader, options, PropCanMoveToOtherNode, static Elastic.Clients.Elasticsearch.Cluster.Decision? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCanRebalanceCluster.TryReadProperty(ref reader, options, PropCanRebalanceCluster, static Elastic.Clients.Elasticsearch.Cluster.Decision? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCanRebalanceClusterDecisions.TryReadProperty(ref reader, options, PropCanRebalanceClusterDecisions, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propCanRebalanceToOtherNode.TryReadProperty(ref reader, options, PropCanRebalanceToOtherNode, static Elastic.Clients.Elasticsearch.Cluster.Decision? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCanRemainDecisions.TryReadProperty(ref reader, options, PropCanRemainDecisions, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propCanRemainOnCurrentNode.TryReadProperty(ref reader, options, PropCanRemainOnCurrentNode, static Elastic.Clients.Elasticsearch.Cluster.Decision? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propClusterInfo.TryReadProperty(ref reader, options, PropClusterInfo, null)) + { + continue; + } + + if (propConfiguredDelay.TryReadProperty(ref reader, options, PropConfiguredDelay, null)) + { + continue; + } + + if (propConfiguredDelayInMillis.TryReadProperty(ref reader, options, PropConfiguredDelayInMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propCurrentNode.TryReadProperty(ref reader, options, PropCurrentNode, null)) + { + continue; + } + + if (propCurrentState.TryReadProperty(ref reader, options, PropCurrentState, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propMoveExplanation.TryReadProperty(ref reader, options, PropMoveExplanation, null)) + { + continue; + } + + if (propNodeAllocationDecisions.TryReadProperty(ref reader, options, PropNodeAllocationDecisions, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propNote.TryReadProperty(ref reader, options, PropNote, null)) + { + continue; + } + + if (propPrimary.TryReadProperty(ref reader, options, PropPrimary, null)) + { + continue; + } + + if (propRebalanceExplanation.TryReadProperty(ref reader, options, PropRebalanceExplanation, null)) + { + continue; + } + + if (propRemainingDelay.TryReadProperty(ref reader, options, PropRemainingDelay, null)) + { + continue; + } + + if (propRemainingDelayInMillis.TryReadProperty(ref reader, options, PropRemainingDelayInMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propShard.TryReadProperty(ref reader, options, PropShard, null)) + { + continue; + } + + if (propUnassignedInfo.TryReadProperty(ref reader, options, PropUnassignedInfo, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.AllocationExplainResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + 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, Elastic.Clients.Elasticsearch.Cluster.AllocationExplainResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllocateExplanation, value.AllocateExplanation, null, null); + writer.WriteProperty(options, PropAllocationDelay, value.AllocationDelay, null, null); + writer.WriteProperty(options, PropAllocationDelayInMillis, value.AllocationDelayInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropCanAllocate, value.CanAllocate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Cluster.Decision? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCanMoveToOtherNode, value.CanMoveToOtherNode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Cluster.Decision? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCanRebalanceCluster, value.CanRebalanceCluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Cluster.Decision? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCanRebalanceClusterDecisions, value.CanRebalanceClusterDecisions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCanRebalanceToOtherNode, value.CanRebalanceToOtherNode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Cluster.Decision? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCanRemainDecisions, value.CanRemainDecisions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCanRemainOnCurrentNode, value.CanRemainOnCurrentNode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Cluster.Decision? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropClusterInfo, value.ClusterInfo, null, null); + writer.WriteProperty(options, PropConfiguredDelay, value.ConfiguredDelay, null, null); + writer.WriteProperty(options, PropConfiguredDelayInMillis, value.ConfiguredDelayInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropCurrentNode, value.CurrentNode, null, null); + writer.WriteProperty(options, PropCurrentState, value.CurrentState, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropMoveExplanation, value.MoveExplanation, null, null); + writer.WriteProperty(options, PropNodeAllocationDecisions, value.NodeAllocationDecisions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropNote, value.Note, null, null); + writer.WriteProperty(options, PropPrimary, value.Primary, null, null); + writer.WriteProperty(options, PropRebalanceExplanation, value.RebalanceExplanation, null, null); + writer.WriteProperty(options, PropRemainingDelay, value.RemainingDelay, null, null); + writer.WriteProperty(options, PropRemainingDelayInMillis, value.RemainingDelayInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropShard, value.Shard, null, null); + writer.WriteProperty(options, PropUnassignedInfo, value.UnassignedInfo, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/AllocationExplainResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/AllocationExplainResponse.g.cs index f06a745222c..486161d9621 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/AllocationExplainResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/AllocationExplainResponse.g.cs @@ -23,262 +23,7 @@ namespace Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.Cluster.AllocationExplainResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllocateExplanation = default; - LocalJsonValue propAllocationDelay = default; - LocalJsonValue propAllocationDelayInMillis = default; - LocalJsonValue propCanAllocate = default; - LocalJsonValue propCanMoveToOtherNode = default; - LocalJsonValue propCanRebalanceCluster = default; - LocalJsonValue?> propCanRebalanceClusterDecisions = default; - LocalJsonValue propCanRebalanceToOtherNode = default; - LocalJsonValue?> propCanRemainDecisions = default; - LocalJsonValue propCanRemainOnCurrentNode = default; - LocalJsonValue propClusterInfo = default; - LocalJsonValue propConfiguredDelay = default; - LocalJsonValue propConfiguredDelayInMillis = default; - LocalJsonValue propCurrentNode = default; - LocalJsonValue propCurrentState = default; - LocalJsonValue propIndex = default; - LocalJsonValue propMoveExplanation = default; - LocalJsonValue?> propNodeAllocationDecisions = default; - LocalJsonValue propNote = default; - LocalJsonValue propPrimary = default; - LocalJsonValue propRebalanceExplanation = default; - LocalJsonValue propRemainingDelay = default; - LocalJsonValue propRemainingDelayInMillis = default; - LocalJsonValue propShard = default; - LocalJsonValue propUnassignedInfo = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllocateExplanation.TryReadProperty(ref reader, options, PropAllocateExplanation, null)) - { - continue; - } - - if (propAllocationDelay.TryReadProperty(ref reader, options, PropAllocationDelay, null)) - { - continue; - } - - if (propAllocationDelayInMillis.TryReadProperty(ref reader, options, PropAllocationDelayInMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propCanAllocate.TryReadProperty(ref reader, options, PropCanAllocate, static Elastic.Clients.Elasticsearch.Cluster.Decision? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCanMoveToOtherNode.TryReadProperty(ref reader, options, PropCanMoveToOtherNode, static Elastic.Clients.Elasticsearch.Cluster.Decision? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCanRebalanceCluster.TryReadProperty(ref reader, options, PropCanRebalanceCluster, static Elastic.Clients.Elasticsearch.Cluster.Decision? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCanRebalanceClusterDecisions.TryReadProperty(ref reader, options, PropCanRebalanceClusterDecisions, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propCanRebalanceToOtherNode.TryReadProperty(ref reader, options, PropCanRebalanceToOtherNode, static Elastic.Clients.Elasticsearch.Cluster.Decision? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCanRemainDecisions.TryReadProperty(ref reader, options, PropCanRemainDecisions, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propCanRemainOnCurrentNode.TryReadProperty(ref reader, options, PropCanRemainOnCurrentNode, static Elastic.Clients.Elasticsearch.Cluster.Decision? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propClusterInfo.TryReadProperty(ref reader, options, PropClusterInfo, null)) - { - continue; - } - - if (propConfiguredDelay.TryReadProperty(ref reader, options, PropConfiguredDelay, null)) - { - continue; - } - - if (propConfiguredDelayInMillis.TryReadProperty(ref reader, options, PropConfiguredDelayInMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propCurrentNode.TryReadProperty(ref reader, options, PropCurrentNode, null)) - { - continue; - } - - if (propCurrentState.TryReadProperty(ref reader, options, PropCurrentState, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propMoveExplanation.TryReadProperty(ref reader, options, PropMoveExplanation, null)) - { - continue; - } - - if (propNodeAllocationDecisions.TryReadProperty(ref reader, options, PropNodeAllocationDecisions, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propNote.TryReadProperty(ref reader, options, PropNote, null)) - { - continue; - } - - if (propPrimary.TryReadProperty(ref reader, options, PropPrimary, null)) - { - continue; - } - - if (propRebalanceExplanation.TryReadProperty(ref reader, options, PropRebalanceExplanation, null)) - { - continue; - } - - if (propRemainingDelay.TryReadProperty(ref reader, options, PropRemainingDelay, null)) - { - continue; - } - - if (propRemainingDelayInMillis.TryReadProperty(ref reader, options, PropRemainingDelayInMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propShard.TryReadProperty(ref reader, options, PropShard, null)) - { - continue; - } - - if (propUnassignedInfo.TryReadProperty(ref reader, options, PropUnassignedInfo, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.AllocationExplainResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - 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, Elastic.Clients.Elasticsearch.Cluster.AllocationExplainResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllocateExplanation, value.AllocateExplanation, null, null); - writer.WriteProperty(options, PropAllocationDelay, value.AllocationDelay, null, null); - writer.WriteProperty(options, PropAllocationDelayInMillis, value.AllocationDelayInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropCanAllocate, value.CanAllocate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Cluster.Decision? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCanMoveToOtherNode, value.CanMoveToOtherNode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Cluster.Decision? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCanRebalanceCluster, value.CanRebalanceCluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Cluster.Decision? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCanRebalanceClusterDecisions, value.CanRebalanceClusterDecisions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCanRebalanceToOtherNode, value.CanRebalanceToOtherNode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Cluster.Decision? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCanRemainDecisions, value.CanRemainDecisions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCanRemainOnCurrentNode, value.CanRemainOnCurrentNode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Cluster.Decision? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropClusterInfo, value.ClusterInfo, null, null); - writer.WriteProperty(options, PropConfiguredDelay, value.ConfiguredDelay, null, null); - writer.WriteProperty(options, PropConfiguredDelayInMillis, value.ConfiguredDelayInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropCurrentNode, value.CurrentNode, null, null); - writer.WriteProperty(options, PropCurrentState, value.CurrentState, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropMoveExplanation, value.MoveExplanation, null, null); - writer.WriteProperty(options, PropNodeAllocationDecisions, value.NodeAllocationDecisions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropNote, value.Note, null, null); - writer.WriteProperty(options, PropPrimary, value.Primary, null, null); - writer.WriteProperty(options, PropRebalanceExplanation, value.RebalanceExplanation, null, null); - writer.WriteProperty(options, PropRemainingDelay, value.RemainingDelay, null, null); - writer.WriteProperty(options, PropRemainingDelayInMillis, value.RemainingDelayInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropShard, value.Shard, null, null); - writer.WriteProperty(options, PropUnassignedInfo, value.UnassignedInfo, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.AllocationExplainResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.AllocationExplainResponseConverter))] public sealed partial class AllocationExplainResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -308,29 +53,29 @@ internal AllocationExplainResponse(Elastic.Clients.Elasticsearch.Serialization.J public Elastic.Clients.Elasticsearch.Cluster.CurrentNode? CurrentNode { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string CurrentState { get; set; } +string CurrentState { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Index { get; set; } +string Index { get; set; } public string? MoveExplanation { get; set; } public System.Collections.Generic.IReadOnlyCollection? NodeAllocationDecisions { get; set; } public string? Note { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool Primary { get; set; } +bool Primary { get; set; } public string? RebalanceExplanation { get; set; } public Elastic.Clients.Elasticsearch.Duration? RemainingDelay { get; set; } public System.TimeSpan? RemainingDelayInMillis { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - int Shard { get; set; } +int Shard { get; set; } public Elastic.Clients.Elasticsearch.Cluster.UnassignedInformation? UnassignedInfo { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterInfoRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterInfoRequest.Converters.g.cs new file mode 100644 index 00000000000..b2abfbe2cb3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterInfoRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ClusterInfoRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Cluster.ClusterInfoRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ClusterInfoRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterInfoRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterInfoRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterInfoRequest.g.cs index 2ebeabf06a9..3e44f1b841e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterInfoRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterInfoRequest.g.cs @@ -27,42 +27,13 @@ public sealed partial class ClusterInfoRequestParameters : Elastic.Transport.Req { } -internal sealed partial class ClusterInfoRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Cluster.ClusterInfoRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ClusterInfoRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterInfoRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get cluster info. /// Returns basic information about the cluster. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ClusterInfoRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ClusterInfoRequestConverter))] public sealed partial class ClusterInfoRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterInfoResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterInfoResponse.Converters.g.cs new file mode 100644 index 00000000000..c737fcebd4b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterInfoResponse.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class 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 Elastic.Clients.Elasticsearch.Cluster.ClusterInfoResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClusterName = default; + LocalJsonValue propHttp = default; + LocalJsonValue propIngest = default; + LocalJsonValue propScript = default; + LocalJsonValue?> propThreadPool = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) + { + continue; + } + + if (propHttp.TryReadProperty(ref reader, options, PropHttp, null)) + { + continue; + } + + if (propIngest.TryReadProperty(ref reader, options, PropIngest, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propThreadPool.TryReadProperty(ref reader, options, PropThreadPool, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ClusterInfoResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClusterName = propClusterName.Value, + Http = propHttp.Value, + Ingest = propIngest.Value, + Script = propScript.Value, + ThreadPool = propThreadPool.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterInfoResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); + writer.WriteProperty(options, PropHttp, value.Http, null, null); + writer.WriteProperty(options, PropIngest, value.Ingest, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropThreadPool, value.ThreadPool, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterInfoResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterInfoResponse.g.cs index 8b21c9c519e..b724316b4ab 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterInfoResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterInfoResponse.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.Cluster.ClusterInfoResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClusterName = default; - LocalJsonValue propHttp = default; - LocalJsonValue propIngest = default; - LocalJsonValue propScript = default; - LocalJsonValue?> propThreadPool = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) - { - continue; - } - - if (propHttp.TryReadProperty(ref reader, options, PropHttp, null)) - { - continue; - } - - if (propIngest.TryReadProperty(ref reader, options, PropIngest, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propThreadPool.TryReadProperty(ref reader, options, PropThreadPool, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ClusterInfoResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClusterName = propClusterName.Value, - Http = propHttp.Value, - Ingest = propIngest.Value, - Script = propScript.Value, - ThreadPool = propThreadPool.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterInfoResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); - writer.WriteProperty(options, PropHttp, value.Http, null, null); - writer.WriteProperty(options, PropIngest, value.Ingest, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropThreadPool, value.ThreadPool, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ClusterInfoResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ClusterInfoResponseConverter))] public sealed partial class ClusterInfoResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -114,9 +39,9 @@ internal ClusterInfoResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCon public #if NET7_0_OR_GREATER - required +required #endif - string ClusterName { get; set; } +string ClusterName { get; set; } public Elastic.Clients.Elasticsearch.Nodes.Http? Http { get; set; } public Elastic.Clients.Elasticsearch.Nodes.Ingest? Ingest { get; set; } public Elastic.Clients.Elasticsearch.Nodes.Scripting? Script { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsRequest.Converters.g.cs new file mode 100644 index 00000000000..74e4706bdfb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ClusterStatsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Cluster.ClusterStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ClusterStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterStatsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsRequest.g.cs index 5daead7278a..f298c4f22e4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsRequest.g.cs @@ -42,42 +42,13 @@ public sealed partial class ClusterStatsRequestParameters : Elastic.Transport.Re public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class ClusterStatsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Cluster.ClusterStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ClusterStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterStatsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get cluster statistics. /// Get basic index metrics (shard numbers, store size, memory usage) and information about the current nodes that form the cluster (number, roles, os, jvm versions, memory usage, cpu and installed plugins). /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ClusterStatsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ClusterStatsRequestConverter))] public sealed partial class ClusterStatsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public ClusterStatsRequest(Elastic.Clients.Elasticsearch.NodeIds? nodeId) : base(r => r.Optional("node_id", nodeId)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsResponse.Converters.g.cs new file mode 100644 index 00000000000..994a51e8f09 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsResponse.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ClusterStatsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCcs = System.Text.Json.JsonEncodedText.Encode("ccs"); + 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 PropRepositories = System.Text.Json.JsonEncodedText.Encode("repositories"); + private static readonly System.Text.Json.JsonEncodedText PropSnapshots = System.Text.Json.JsonEncodedText.Encode("snapshots"); + 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 Elastic.Clients.Elasticsearch.Cluster.ClusterStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCcs = default; + LocalJsonValue propClusterName = default; + LocalJsonValue propClusterUuid = default; + LocalJsonValue propIndices = default; + LocalJsonValue propNodes = default; + LocalJsonValue propNodeStats = default; + LocalJsonValue>> propRepositories = default; + LocalJsonValue propSnapshots = default; + LocalJsonValue propStatus = default; + LocalJsonValue propTimestamp = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCcs.TryReadProperty(ref reader, options, PropCcs, null)) + { + continue; + } + + if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) + { + continue; + } + + if (propClusterUuid.TryReadProperty(ref reader, options, PropClusterUuid, null)) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) + { + continue; + } + + if (propNodes.TryReadProperty(ref reader, options, PropNodes, null)) + { + continue; + } + + if (propNodeStats.TryReadProperty(ref reader, options, PropNodeStats, null)) + { + continue; + } + + if (propRepositories.TryReadProperty(ref reader, options, PropRepositories, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)!)) + { + continue; + } + + if (propSnapshots.TryReadProperty(ref reader, options, PropSnapshots, null)) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, static Elastic.Clients.Elasticsearch.HealthStatus? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ClusterStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Ccs = propCcs.Value, + ClusterName = propClusterName.Value, + ClusterUuid = propClusterUuid.Value, + Indices = propIndices.Value, + Nodes = propNodes.Value, + NodeStats = propNodeStats.Value, + Repositories = propRepositories.Value, + Snapshots = propSnapshots.Value, + Status = propStatus.Value, + Timestamp = propTimestamp.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterStatsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCcs, value.Ccs, null, null); + writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); + writer.WriteProperty(options, PropClusterUuid, value.ClusterUuid, null, null); + writer.WriteProperty(options, PropIndices, value.Indices, null, null); + writer.WriteProperty(options, PropNodes, value.Nodes, null, null); + writer.WriteProperty(options, PropNodeStats, value.NodeStats, null, null); + writer.WriteProperty(options, PropRepositories, value.Repositories, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null))); + writer.WriteProperty(options, PropSnapshots, value.Snapshots, null, null); + writer.WriteProperty(options, PropStatus, value.Status, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.HealthStatus? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsResponse.g.cs index 55f07dcf43f..e3adef4794f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsResponse.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ClusterStatsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCcs = System.Text.Json.JsonEncodedText.Encode("ccs"); - 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 PropRepositories = System.Text.Json.JsonEncodedText.Encode("repositories"); - private static readonly System.Text.Json.JsonEncodedText PropSnapshots = System.Text.Json.JsonEncodedText.Encode("snapshots"); - 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 Elastic.Clients.Elasticsearch.Cluster.ClusterStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCcs = default; - LocalJsonValue propClusterName = default; - LocalJsonValue propClusterUuid = default; - LocalJsonValue propIndices = default; - LocalJsonValue propNodes = default; - LocalJsonValue propNodeStats = default; - LocalJsonValue>> propRepositories = default; - LocalJsonValue propSnapshots = default; - LocalJsonValue propStatus = default; - LocalJsonValue propTimestamp = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCcs.TryReadProperty(ref reader, options, PropCcs, null)) - { - continue; - } - - if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) - { - continue; - } - - if (propClusterUuid.TryReadProperty(ref reader, options, PropClusterUuid, null)) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) - { - continue; - } - - if (propNodes.TryReadProperty(ref reader, options, PropNodes, null)) - { - continue; - } - - if (propNodeStats.TryReadProperty(ref reader, options, PropNodeStats, null)) - { - continue; - } - - if (propRepositories.TryReadProperty(ref reader, options, PropRepositories, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)!)) - { - continue; - } - - if (propSnapshots.TryReadProperty(ref reader, options, PropSnapshots, null)) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, static Elastic.Clients.Elasticsearch.HealthStatus? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ClusterStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Ccs = propCcs.Value, - ClusterName = propClusterName.Value, - ClusterUuid = propClusterUuid.Value, - Indices = propIndices.Value, - Nodes = propNodes.Value, - NodeStats = propNodeStats.Value, - Repositories = propRepositories.Value, - Snapshots = propSnapshots.Value, - Status = propStatus.Value, - Timestamp = propTimestamp.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterStatsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCcs, value.Ccs, null, null); - writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); - writer.WriteProperty(options, PropClusterUuid, value.ClusterUuid, null, null); - writer.WriteProperty(options, PropIndices, value.Indices, null, null); - writer.WriteProperty(options, PropNodes, value.Nodes, null, null); - writer.WriteProperty(options, PropNodeStats, value.NodeStats, null, null); - writer.WriteProperty(options, PropRepositories, value.Repositories, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null))); - writer.WriteProperty(options, PropSnapshots, value.Snapshots, null, null); - writer.WriteProperty(options, PropStatus, value.Status, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.HealthStatus? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ClusterStatsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ClusterStatsResponseConverter))] public sealed partial class ClusterStatsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteComponentTemplateRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteComponentTemplateRequest.Converters.g.cs new file mode 100644 index 00000000000..9f02df4eaf5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteComponentTemplateRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class DeleteComponentTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Cluster.DeleteComponentTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.DeleteComponentTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.DeleteComponentTemplateRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteComponentTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteComponentTemplateRequest.g.cs index 640c6f2855b..802dca9a737 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteComponentTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteComponentTemplateRequest.g.cs @@ -42,42 +42,13 @@ public sealed partial class DeleteComponentTemplateRequestParameters : Elastic.T public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class DeleteComponentTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Cluster.DeleteComponentTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.DeleteComponentTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.DeleteComponentTemplateRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete component templates. /// Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.DeleteComponentTemplateRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.DeleteComponentTemplateRequestConverter))] public sealed partial class DeleteComponentTemplateRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteComponentTemplateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteComponentTemplateResponse.Converters.g.cs new file mode 100644 index 00000000000..302e641ea2a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteComponentTemplateResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class DeleteComponentTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.Cluster.DeleteComponentTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.DeleteComponentTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.DeleteComponentTemplateResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteComponentTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteComponentTemplateResponse.g.cs index a1405d1fc73..b7302d1345d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteComponentTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteComponentTemplateResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.Cluster.DeleteComponentTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.DeleteComponentTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.DeleteComponentTemplateResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.DeleteComponentTemplateResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.DeleteComponentTemplateResponseConverter))] public sealed partial class DeleteComponentTemplateResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteVotingConfigExclusionsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteVotingConfigExclusionsRequest.Converters.g.cs new file mode 100644 index 00000000000..e60f5390e00 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteVotingConfigExclusionsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class DeleteVotingConfigExclusionsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Cluster.DeleteVotingConfigExclusionsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.DeleteVotingConfigExclusionsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.DeleteVotingConfigExclusionsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteVotingConfigExclusionsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteVotingConfigExclusionsRequest.g.cs index 3903bdef781..69be4c0fcb9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteVotingConfigExclusionsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteVotingConfigExclusionsRequest.g.cs @@ -45,42 +45,13 @@ public sealed partial class DeleteVotingConfigExclusionsRequestParameters : Elas public bool? WaitForRemoval { get => Q("wait_for_removal"); set => Q("wait_for_removal", value); } } -internal sealed partial class DeleteVotingConfigExclusionsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Cluster.DeleteVotingConfigExclusionsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.DeleteVotingConfigExclusionsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.DeleteVotingConfigExclusionsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Clear cluster voting config exclusions. /// Remove master-eligible nodes from the voting configuration exclusion list. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.DeleteVotingConfigExclusionsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.DeleteVotingConfigExclusionsRequestConverter))] public sealed partial class DeleteVotingConfigExclusionsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteVotingConfigExclusionsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteVotingConfigExclusionsResponse.Converters.g.cs new file mode 100644 index 00000000000..a7d4f96cd9f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteVotingConfigExclusionsResponse.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class DeleteVotingConfigExclusionsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Cluster.DeleteVotingConfigExclusionsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.DeleteVotingConfigExclusionsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.DeleteVotingConfigExclusionsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteVotingConfigExclusionsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteVotingConfigExclusionsResponse.g.cs index 3e7bd003c15..6a90bcbbbb6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteVotingConfigExclusionsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/DeleteVotingConfigExclusionsResponse.g.cs @@ -23,36 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class DeleteVotingConfigExclusionsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Cluster.DeleteVotingConfigExclusionsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.DeleteVotingConfigExclusionsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.DeleteVotingConfigExclusionsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.DeleteVotingConfigExclusionsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.DeleteVotingConfigExclusionsResponseConverter))] public sealed partial class DeleteVotingConfigExclusionsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ExistsComponentTemplateRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ExistsComponentTemplateRequest.Converters.g.cs new file mode 100644 index 00000000000..5eecc5a0d71 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ExistsComponentTemplateRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ExistsComponentTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Cluster.ExistsComponentTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ExistsComponentTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ExistsComponentTemplateRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ExistsComponentTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ExistsComponentTemplateRequest.g.cs index d6220d81354..e1f1e3678e0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ExistsComponentTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ExistsComponentTemplateRequest.g.cs @@ -43,42 +43,13 @@ public sealed partial class ExistsComponentTemplateRequestParameters : Elastic.T public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class ExistsComponentTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Cluster.ExistsComponentTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ExistsComponentTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ExistsComponentTemplateRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Check component templates. /// Returns information about whether a particular component template exists. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ExistsComponentTemplateRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ExistsComponentTemplateRequestConverter))] public sealed partial class ExistsComponentTemplateRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ExistsComponentTemplateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ExistsComponentTemplateResponse.Converters.g.cs new file mode 100644 index 00000000000..e79f95ebc78 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ExistsComponentTemplateResponse.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ExistsComponentTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Cluster.ExistsComponentTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ExistsComponentTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ExistsComponentTemplateResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ExistsComponentTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ExistsComponentTemplateResponse.g.cs index c93632f0e74..bac79c824c5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ExistsComponentTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ExistsComponentTemplateResponse.g.cs @@ -23,36 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ExistsComponentTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Cluster.ExistsComponentTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ExistsComponentTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ExistsComponentTemplateResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ExistsComponentTemplateResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ExistsComponentTemplateResponseConverter))] public sealed partial class ExistsComponentTemplateResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetClusterSettingsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetClusterSettingsRequest.Converters.g.cs new file mode 100644 index 00000000000..d42bc4fe9b0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetClusterSettingsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class GetClusterSettingsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Cluster.GetClusterSettingsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.GetClusterSettingsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.GetClusterSettingsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetClusterSettingsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetClusterSettingsRequest.g.cs index 9e39fd42949..46cd3e954a9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetClusterSettingsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetClusterSettingsRequest.g.cs @@ -61,35 +61,6 @@ public sealed partial class GetClusterSettingsRequestParameters : Elastic.Transp public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class GetClusterSettingsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Cluster.GetClusterSettingsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.GetClusterSettingsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.GetClusterSettingsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get cluster-wide settings. @@ -98,7 +69,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// By default, it returns only settings that have been explicitly defined. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.GetClusterSettingsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.GetClusterSettingsRequestConverter))] public sealed partial class GetClusterSettingsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetClusterSettingsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetClusterSettingsResponse.Converters.g.cs new file mode 100644 index 00000000000..71fcc69531f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetClusterSettingsResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public 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 Elastic.Clients.Elasticsearch.Cluster.GetClusterSettingsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propDefaults = default; + LocalJsonValue> propPersistent = default; + LocalJsonValue> propTransient = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDefaults.TryReadProperty(ref reader, options, PropDefaults, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propPersistent.TryReadProperty(ref reader, options, PropPersistent, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (propTransient.TryReadProperty(ref reader, options, PropTransient, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.GetClusterSettingsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Defaults = propDefaults.Value, + Persistent = propPersistent.Value, + Transient = propTransient.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.GetClusterSettingsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDefaults, value.Defaults, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropPersistent, value.Persistent, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropTransient, value.Transient, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetClusterSettingsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetClusterSettingsResponse.g.cs index c997acb7a7f..c699c07dfe7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetClusterSettingsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetClusterSettingsResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.Cluster.GetClusterSettingsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propDefaults = default; - LocalJsonValue> propPersistent = default; - LocalJsonValue> propTransient = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDefaults.TryReadProperty(ref reader, options, PropDefaults, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propPersistent.TryReadProperty(ref reader, options, PropPersistent, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (propTransient.TryReadProperty(ref reader, options, PropTransient, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.GetClusterSettingsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Defaults = propDefaults.Value, - Persistent = propPersistent.Value, - Transient = propTransient.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.GetClusterSettingsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDefaults, value.Defaults, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropPersistent, value.Persistent, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropTransient, value.Transient, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.GetClusterSettingsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.GetClusterSettingsResponseConverter))] public sealed partial class GetClusterSettingsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetComponentTemplateRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetComponentTemplateRequest.Converters.g.cs new file mode 100644 index 00000000000..50306ae0e95 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetComponentTemplateRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class GetComponentTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Cluster.GetComponentTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.GetComponentTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.GetComponentTemplateRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetComponentTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetComponentTemplateRequest.g.cs index 6e51149c9d8..5bc384ee08c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetComponentTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetComponentTemplateRequest.g.cs @@ -63,42 +63,13 @@ public sealed partial class GetComponentTemplateRequestParameters : Elastic.Tran public System.Collections.Generic.ICollection? SettingsFilter { get => Q?>("settings_filter"); set => Q("settings_filter", value); } } -internal sealed partial class GetComponentTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Cluster.GetComponentTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.GetComponentTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.GetComponentTemplateRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get component templates. /// Get information about component templates. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.GetComponentTemplateRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.GetComponentTemplateRequestConverter))] public sealed partial class GetComponentTemplateRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetComponentTemplateRequest(Elastic.Clients.Elasticsearch.Name? name) : base(r => r.Optional("name", name)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetComponentTemplateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetComponentTemplateResponse.Converters.g.cs new file mode 100644 index 00000000000..56fb943785e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetComponentTemplateResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class GetComponentTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropComponentTemplates = System.Text.Json.JsonEncodedText.Encode("component_templates"); + + public override Elastic.Clients.Elasticsearch.Cluster.GetComponentTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propComponentTemplates = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propComponentTemplates.TryReadProperty(ref reader, options, PropComponentTemplates, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.GetComponentTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ComponentTemplates = propComponentTemplates.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.GetComponentTemplateResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropComponentTemplates, value.ComponentTemplates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetComponentTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetComponentTemplateResponse.g.cs index 2f2b18232f3..e2325c2bf5d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetComponentTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetComponentTemplateResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.Cluster.GetComponentTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propComponentTemplates = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propComponentTemplates.TryReadProperty(ref reader, options, PropComponentTemplates, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.GetComponentTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ComponentTemplates = propComponentTemplates.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.GetComponentTemplateResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropComponentTemplates, value.ComponentTemplates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.GetComponentTemplateResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.GetComponentTemplateResponseConverter))] public sealed partial class GetComponentTemplateResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal GetComponentTemplateResponse(Elastic.Clients.Elasticsearch.Serializatio public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection ComponentTemplates { get; set; } +System.Collections.Generic.IReadOnlyCollection ComponentTemplates { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/HealthRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/HealthRequest.Converters.g.cs new file mode 100644 index 00000000000..98be530bd43 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/HealthRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class HealthRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Cluster.HealthRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.HealthRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.HealthRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/HealthRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/HealthRequest.g.cs index 65712d6b40d..f753be5d218 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/HealthRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/HealthRequest.g.cs @@ -103,35 +103,6 @@ public sealed partial class HealthRequestParameters : Elastic.Transport.RequestP public Elastic.Clients.Elasticsearch.HealthStatus? WaitForStatus { get => Q("wait_for_status"); set => Q("wait_for_status", value); } } -internal sealed partial class HealthRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Cluster.HealthRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.HealthRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.HealthRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get the cluster health status. @@ -150,7 +121,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The cluster status is controlled by the worst index status. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.HealthRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.HealthRequestConverter))] public sealed partial class HealthRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public HealthRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/HealthResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/HealthResponse.Converters.g.cs new file mode 100644 index 00000000000..8c5576abc7c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/HealthResponse.Converters.g.cs @@ -0,0 +1,225 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class 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 PropActiveShardsPercent = System.Text.Json.JsonEncodedText.Encode("active_shards_percent"); + 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 Elastic.Clients.Elasticsearch.Cluster.HealthResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propActivePrimaryShards = default; + LocalJsonValue propActiveShards = default; + LocalJsonValue propActiveShardsPercent = default; + LocalJsonValue propActiveShardsPercentAsNumber = default; + LocalJsonValue propClusterName = default; + LocalJsonValue propDelayedUnassignedShards = default; + LocalJsonValue?> propIndices = default; + LocalJsonValue propInitializingShards = default; + LocalJsonValue propNumberOfDataNodes = default; + LocalJsonValue propNumberOfInFlightFetch = default; + LocalJsonValue propNumberOfNodes = default; + LocalJsonValue propNumberOfPendingTasks = default; + LocalJsonValue propRelocatingShards = default; + LocalJsonValue propStatus = default; + LocalJsonValue propTaskMaxWaitingInQueue = default; + LocalJsonValue propTaskMaxWaitingInQueueMillis = default; + LocalJsonValue propTimedOut = default; + LocalJsonValue propUnassignedPrimaryShards = default; + LocalJsonValue propUnassignedShards = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propActivePrimaryShards.TryReadProperty(ref reader, options, PropActivePrimaryShards, null)) + { + continue; + } + + if (propActiveShards.TryReadProperty(ref reader, options, PropActiveShards, null)) + { + continue; + } + + if (propActiveShardsPercent.TryReadProperty(ref reader, options, PropActiveShardsPercent, null)) + { + continue; + } + + if (propActiveShardsPercentAsNumber.TryReadProperty(ref reader, options, PropActiveShardsPercentAsNumber, null)) + { + continue; + } + + if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) + { + continue; + } + + if (propDelayedUnassignedShards.TryReadProperty(ref reader, options, PropDelayedUnassignedShards, null)) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propInitializingShards.TryReadProperty(ref reader, options, PropInitializingShards, null)) + { + continue; + } + + if (propNumberOfDataNodes.TryReadProperty(ref reader, options, PropNumberOfDataNodes, null)) + { + continue; + } + + if (propNumberOfInFlightFetch.TryReadProperty(ref reader, options, PropNumberOfInFlightFetch, null)) + { + continue; + } + + if (propNumberOfNodes.TryReadProperty(ref reader, options, PropNumberOfNodes, null)) + { + continue; + } + + if (propNumberOfPendingTasks.TryReadProperty(ref reader, options, PropNumberOfPendingTasks, null)) + { + continue; + } + + if (propRelocatingShards.TryReadProperty(ref reader, options, PropRelocatingShards, null)) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (propTaskMaxWaitingInQueue.TryReadProperty(ref reader, options, PropTaskMaxWaitingInQueue, null)) + { + continue; + } + + if (propTaskMaxWaitingInQueueMillis.TryReadProperty(ref reader, options, PropTaskMaxWaitingInQueueMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, null)) + { + continue; + } + + if (propUnassignedPrimaryShards.TryReadProperty(ref reader, options, PropUnassignedPrimaryShards, null)) + { + continue; + } + + if (propUnassignedShards.TryReadProperty(ref reader, options, PropUnassignedShards, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.HealthResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ActivePrimaryShards = propActivePrimaryShards.Value, + ActiveShards = propActiveShards.Value, + ActiveShardsPercent = propActiveShardsPercent.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, Elastic.Clients.Elasticsearch.Cluster.HealthResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropActivePrimaryShards, value.ActivePrimaryShards, null, null); + writer.WriteProperty(options, PropActiveShards, value.ActiveShards, null, null); + writer.WriteProperty(options, PropActiveShardsPercent, value.ActiveShardsPercent, null, null); + writer.WriteProperty(options, PropActiveShardsPercentAsNumber, value.ActiveShardsPercentAsNumber, null, null); + writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); + writer.WriteProperty(options, PropDelayedUnassignedShards, value.DelayedUnassignedShards, null, null); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropInitializingShards, value.InitializingShards, null, null); + writer.WriteProperty(options, PropNumberOfDataNodes, value.NumberOfDataNodes, null, null); + writer.WriteProperty(options, PropNumberOfInFlightFetch, value.NumberOfInFlightFetch, null, null); + writer.WriteProperty(options, PropNumberOfNodes, value.NumberOfNodes, null, null); + writer.WriteProperty(options, PropNumberOfPendingTasks, value.NumberOfPendingTasks, null, null); + writer.WriteProperty(options, PropRelocatingShards, value.RelocatingShards, null, null); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteProperty(options, PropTaskMaxWaitingInQueue, value.TaskMaxWaitingInQueue, null, null); + writer.WriteProperty(options, PropTaskMaxWaitingInQueueMillis, value.TaskMaxWaitingInQueueMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, null); + writer.WriteProperty(options, PropUnassignedPrimaryShards, value.UnassignedPrimaryShards, null, null); + writer.WriteProperty(options, PropUnassignedShards, value.UnassignedShards, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/HealthResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/HealthResponse.g.cs index bdc87c8804b..45a34eeafff 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/HealthResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/HealthResponse.g.cs @@ -23,208 +23,7 @@ namespace Elastic.Clients.Elasticsearch.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 PropActiveShardsPercent = System.Text.Json.JsonEncodedText.Encode("active_shards_percent"); - 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 Elastic.Clients.Elasticsearch.Cluster.HealthResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propActivePrimaryShards = default; - LocalJsonValue propActiveShards = default; - LocalJsonValue propActiveShardsPercent = default; - LocalJsonValue propActiveShardsPercentAsNumber = default; - LocalJsonValue propClusterName = default; - LocalJsonValue propDelayedUnassignedShards = default; - LocalJsonValue?> propIndices = default; - LocalJsonValue propInitializingShards = default; - LocalJsonValue propNumberOfDataNodes = default; - LocalJsonValue propNumberOfInFlightFetch = default; - LocalJsonValue propNumberOfNodes = default; - LocalJsonValue propNumberOfPendingTasks = default; - LocalJsonValue propRelocatingShards = default; - LocalJsonValue propStatus = default; - LocalJsonValue propTaskMaxWaitingInQueue = default; - LocalJsonValue propTaskMaxWaitingInQueueMillis = default; - LocalJsonValue propTimedOut = default; - LocalJsonValue propUnassignedPrimaryShards = default; - LocalJsonValue propUnassignedShards = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propActivePrimaryShards.TryReadProperty(ref reader, options, PropActivePrimaryShards, null)) - { - continue; - } - - if (propActiveShards.TryReadProperty(ref reader, options, PropActiveShards, null)) - { - continue; - } - - if (propActiveShardsPercent.TryReadProperty(ref reader, options, PropActiveShardsPercent, null)) - { - continue; - } - - if (propActiveShardsPercentAsNumber.TryReadProperty(ref reader, options, PropActiveShardsPercentAsNumber, null)) - { - continue; - } - - if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) - { - continue; - } - - if (propDelayedUnassignedShards.TryReadProperty(ref reader, options, PropDelayedUnassignedShards, null)) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propInitializingShards.TryReadProperty(ref reader, options, PropInitializingShards, null)) - { - continue; - } - - if (propNumberOfDataNodes.TryReadProperty(ref reader, options, PropNumberOfDataNodes, null)) - { - continue; - } - - if (propNumberOfInFlightFetch.TryReadProperty(ref reader, options, PropNumberOfInFlightFetch, null)) - { - continue; - } - - if (propNumberOfNodes.TryReadProperty(ref reader, options, PropNumberOfNodes, null)) - { - continue; - } - - if (propNumberOfPendingTasks.TryReadProperty(ref reader, options, PropNumberOfPendingTasks, null)) - { - continue; - } - - if (propRelocatingShards.TryReadProperty(ref reader, options, PropRelocatingShards, null)) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (propTaskMaxWaitingInQueue.TryReadProperty(ref reader, options, PropTaskMaxWaitingInQueue, null)) - { - continue; - } - - if (propTaskMaxWaitingInQueueMillis.TryReadProperty(ref reader, options, PropTaskMaxWaitingInQueueMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, null)) - { - continue; - } - - if (propUnassignedPrimaryShards.TryReadProperty(ref reader, options, PropUnassignedPrimaryShards, null)) - { - continue; - } - - if (propUnassignedShards.TryReadProperty(ref reader, options, PropUnassignedShards, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.HealthResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ActivePrimaryShards = propActivePrimaryShards.Value, - ActiveShards = propActiveShards.Value, - ActiveShardsPercent = propActiveShardsPercent.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, Elastic.Clients.Elasticsearch.Cluster.HealthResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropActivePrimaryShards, value.ActivePrimaryShards, null, null); - writer.WriteProperty(options, PropActiveShards, value.ActiveShards, null, null); - writer.WriteProperty(options, PropActiveShardsPercent, value.ActiveShardsPercent, null, null); - writer.WriteProperty(options, PropActiveShardsPercentAsNumber, value.ActiveShardsPercentAsNumber, null, null); - writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); - writer.WriteProperty(options, PropDelayedUnassignedShards, value.DelayedUnassignedShards, null, null); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropInitializingShards, value.InitializingShards, null, null); - writer.WriteProperty(options, PropNumberOfDataNodes, value.NumberOfDataNodes, null, null); - writer.WriteProperty(options, PropNumberOfInFlightFetch, value.NumberOfInFlightFetch, null, null); - writer.WriteProperty(options, PropNumberOfNodes, value.NumberOfNodes, null, null); - writer.WriteProperty(options, PropNumberOfPendingTasks, value.NumberOfPendingTasks, null, null); - writer.WriteProperty(options, PropRelocatingShards, value.RelocatingShards, null, null); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteProperty(options, PropTaskMaxWaitingInQueue, value.TaskMaxWaitingInQueue, null, null); - writer.WriteProperty(options, PropTaskMaxWaitingInQueueMillis, value.TaskMaxWaitingInQueueMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, null); - writer.WriteProperty(options, PropUnassignedPrimaryShards, value.UnassignedPrimaryShards, null, null); - writer.WriteProperty(options, PropUnassignedShards, value.UnassignedShards, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.HealthResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.HealthResponseConverter))] public sealed partial class HealthResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PendingTasksRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PendingTasksRequest.Converters.g.cs new file mode 100644 index 00000000000..8f7f41bbd42 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PendingTasksRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class PendingTasksRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Cluster.PendingTasksRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.PendingTasksRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.PendingTasksRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PendingTasksRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PendingTasksRequest.g.cs index fba6492a0ac..a2529554eb2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PendingTasksRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PendingTasksRequest.g.cs @@ -42,35 +42,6 @@ public sealed partial class PendingTasksRequestParameters : Elastic.Transport.Re public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class PendingTasksRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Cluster.PendingTasksRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.PendingTasksRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.PendingTasksRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get the pending cluster tasks. @@ -82,7 +53,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// However, if a user-initiated task such as a create index command causes a cluster state update, the activity of this task might be reported by both task api and pending cluster tasks API. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.PendingTasksRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.PendingTasksRequestConverter))] public sealed partial class PendingTasksRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PendingTasksResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PendingTasksResponse.Converters.g.cs new file mode 100644 index 00000000000..1146fcb3921 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PendingTasksResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class PendingTasksResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropTasks = System.Text.Json.JsonEncodedText.Encode("tasks"); + + public override Elastic.Clients.Elasticsearch.Cluster.PendingTasksResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propTasks = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propTasks.TryReadProperty(ref reader, options, PropTasks, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.PendingTasksResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Tasks = propTasks.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.PendingTasksResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropTasks, value.Tasks, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PendingTasksResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PendingTasksResponse.g.cs index 01b43eacb90..7683fd6b08c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PendingTasksResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PendingTasksResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.Cluster.PendingTasksResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propTasks = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propTasks.TryReadProperty(ref reader, options, PropTasks, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.PendingTasksResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Tasks = propTasks.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.PendingTasksResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropTasks, value.Tasks, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.PendingTasksResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.PendingTasksResponseConverter))] public sealed partial class PendingTasksResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal PendingTasksResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCo public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Tasks { get; set; } +System.Collections.Generic.IReadOnlyCollection Tasks { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PostVotingConfigExclusionsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PostVotingConfigExclusionsRequest.Converters.g.cs new file mode 100644 index 00000000000..72c084cd2da --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PostVotingConfigExclusionsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class PostVotingConfigExclusionsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Cluster.PostVotingConfigExclusionsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.PostVotingConfigExclusionsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.PostVotingConfigExclusionsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PostVotingConfigExclusionsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PostVotingConfigExclusionsRequest.g.cs index d2bf6b682c6..60b2f7cff0a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PostVotingConfigExclusionsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PostVotingConfigExclusionsRequest.g.cs @@ -59,35 +59,6 @@ public sealed partial class PostVotingConfigExclusionsRequestParameters : Elasti public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PostVotingConfigExclusionsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Cluster.PostVotingConfigExclusionsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.PostVotingConfigExclusionsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.PostVotingConfigExclusionsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Update voting configuration exclusions. @@ -113,7 +84,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// They are not required when removing master-ineligible nodes or when removing fewer than half of the master-eligible nodes. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.PostVotingConfigExclusionsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.PostVotingConfigExclusionsRequestConverter))] public sealed partial class PostVotingConfigExclusionsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PostVotingConfigExclusionsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PostVotingConfigExclusionsResponse.Converters.g.cs new file mode 100644 index 00000000000..b7c80a42c74 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PostVotingConfigExclusionsResponse.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class PostVotingConfigExclusionsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Cluster.PostVotingConfigExclusionsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.PostVotingConfigExclusionsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.PostVotingConfigExclusionsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PostVotingConfigExclusionsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PostVotingConfigExclusionsResponse.g.cs index 8588bbc6dc4..67bb70abe6a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PostVotingConfigExclusionsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PostVotingConfigExclusionsResponse.g.cs @@ -23,36 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class PostVotingConfigExclusionsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Cluster.PostVotingConfigExclusionsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.PostVotingConfigExclusionsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.PostVotingConfigExclusionsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.PostVotingConfigExclusionsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.PostVotingConfigExclusionsResponseConverter))] public sealed partial class PostVotingConfigExclusionsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutComponentTemplateRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutComponentTemplateRequest.Converters.g.cs new file mode 100644 index 00000000000..1184baf09b3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutComponentTemplateRequest.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class PutComponentTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDeprecated = System.Text.Json.JsonEncodedText.Encode("deprecated"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); + private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Cluster.PutComponentTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDeprecated = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propTemplate = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDeprecated.TryReadProperty(ref reader, options, PropDeprecated, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.PutComponentTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Deprecated = propDeprecated.Value, + Meta = propMeta.Value, + Template = propTemplate.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.PutComponentTemplateRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDeprecated, value.Deprecated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropTemplate, value.Template, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutComponentTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutComponentTemplateRequest.g.cs index 4f174fde0b5..494b035e6d0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutComponentTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutComponentTemplateRequest.g.cs @@ -48,72 +48,6 @@ public sealed partial class PutComponentTemplateRequestParameters : Elastic.Tran public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class PutComponentTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDeprecated = System.Text.Json.JsonEncodedText.Encode("deprecated"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); - private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Cluster.PutComponentTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDeprecated = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propTemplate = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDeprecated.TryReadProperty(ref reader, options, PropDeprecated, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.PutComponentTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Deprecated = propDeprecated.Value, - Meta = propMeta.Value, - Template = propTemplate.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.PutComponentTemplateRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDeprecated, value.Deprecated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropTemplate, value.Template, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Create or update a component template. @@ -144,7 +78,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// To be applied, a component template must be included in an index template's composed_of list. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.PutComponentTemplateRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.PutComponentTemplateRequestConverter))] public sealed partial class PutComponentTemplateRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutComponentTemplateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutComponentTemplateResponse.Converters.g.cs new file mode 100644 index 00000000000..13122590d9e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutComponentTemplateResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class PutComponentTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.Cluster.PutComponentTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.PutComponentTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.PutComponentTemplateResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutComponentTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutComponentTemplateResponse.g.cs index b29b3251194..7874395f401 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutComponentTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutComponentTemplateResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.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 Elastic.Clients.Elasticsearch.Cluster.PutComponentTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.PutComponentTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.PutComponentTemplateResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.PutComponentTemplateResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.PutComponentTemplateResponseConverter))] public sealed partial class PutComponentTemplateResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CountRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CountRequest.Converters.g.cs new file mode 100644 index 00000000000..4a467d140dd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CountRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class CountRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + + public override Elastic.Clients.Elasticsearch.CountRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propQuery = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CountRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Query = propQuery.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CountRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CountRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CountRequest.g.cs index ca752f1edc1..9bf9e3aef7f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CountRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CountRequest.g.cs @@ -143,45 +143,6 @@ public sealed partial class CountRequestParameters : Elastic.Transport.RequestPa public long? TerminateAfter { get => Q("terminate_after"); set => Q("terminate_after", value); } } -internal sealed partial class CountRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - - public override Elastic.Clients.Elasticsearch.CountRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propQuery = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CountRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Query = propQuery.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CountRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Count search results. @@ -200,7 +161,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// This means that replicas increase the scalability of the count. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CountRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.CountRequestConverter))] public partial class CountRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public CountRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CountResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CountResponse.Converters.g.cs new file mode 100644 index 00000000000..460fff27f16 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CountResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class CountResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + + public override Elastic.Clients.Elasticsearch.CountResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propShards = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CountResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Shards = propShards.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CountResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CountResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CountResponse.g.cs index 27c0fe92886..7696c01cf0f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CountResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CountResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class CountResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - - public override Elastic.Clients.Elasticsearch.CountResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propShards = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CountResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Shards = propShards.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CountResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CountResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.CountResponseConverter))] public sealed partial class CountResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal CountResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstruct public #if NET7_0_OR_GREATER - required +required #endif - long Count { get; set; } +long Count { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; set; } +Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CreateRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CreateRequest.Converters.g.cs new file mode 100644 index 00000000000..0200a54732a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CreateRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class CreateRequestConverter : System.Text.Json.Serialization.JsonConverter> +{ + public override Elastic.Clients.Elasticsearch.CreateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.CreateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Document = reader.ReadValue(options, static TDocument (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CreateRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Document, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TDocument v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + } +} + +public sealed partial class CreateRequestConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(CreateRequest<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(CreateRequestConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CreateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CreateRequest.g.cs index 20b8dc88b88..48708252872 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CreateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CreateRequest.g.cs @@ -111,35 +111,6 @@ public sealed partial class CreateRequestParameters : Elastic.Transport.RequestP public Elastic.Clients.Elasticsearch.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } } -internal sealed partial class CreateRequestConverter : System.Text.Json.Serialization.JsonConverter> -{ - public override Elastic.Clients.Elasticsearch.CreateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.CreateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Document = reader.ReadValue(options, static TDocument (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CreateRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Document, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TDocument v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - } -} - -internal sealed partial class CreateRequestConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(CreateRequest<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(CreateRequestConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - /// /// /// Create a new document in the index. @@ -246,7 +217,7 @@ public override System.Text.Json.Serialization.JsonConverter CreateConverter(Sys /// The _shards section of the API response reveals the number of shard copies on which replication succeeded and failed. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CreateRequestConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.CreateRequestConverterFactory))] public sealed partial class CreateRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CreateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CreateResponse.Converters.g.cs new file mode 100644 index 00000000000..dd6ef4a388e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CreateResponse.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class CreateResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropForcedRefresh = System.Text.Json.JsonEncodedText.Encode("forced_refresh"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); + private static readonly System.Text.Json.JsonEncodedText PropPrimaryTerm = System.Text.Json.JsonEncodedText.Encode("_primary_term"); + private static readonly System.Text.Json.JsonEncodedText PropResult = System.Text.Json.JsonEncodedText.Encode("result"); + private static readonly System.Text.Json.JsonEncodedText PropSeqNo = System.Text.Json.JsonEncodedText.Encode("_seq_no"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("_version"); + + public override Elastic.Clients.Elasticsearch.CreateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propForcedRefresh = default; + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + LocalJsonValue propPrimaryTerm = default; + LocalJsonValue propResult = default; + LocalJsonValue propSeqNo = default; + LocalJsonValue propShards = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propForcedRefresh.TryReadProperty(ref reader, options, PropForcedRefresh, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propPrimaryTerm.TryReadProperty(ref reader, options, PropPrimaryTerm, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propResult.TryReadProperty(ref reader, options, PropResult, null)) + { + continue; + } + + if (propSeqNo.TryReadProperty(ref reader, options, PropSeqNo, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CreateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ForcedRefresh = propForcedRefresh.Value, + Id = propId.Value, + Index = propIndex.Value, + PrimaryTerm = propPrimaryTerm.Value, + Result = propResult.Value, + SeqNo = propSeqNo.Value, + Shards = propShards.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CreateResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropForcedRefresh, value.ForcedRefresh, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropPrimaryTerm, value.PrimaryTerm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropResult, value.Result, null, null); + writer.WriteProperty(options, PropSeqNo, value.SeqNo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CreateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CreateResponse.g.cs index dccc0dc7325..13ce9eb2e21 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CreateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CreateResponse.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class CreateResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropForcedRefresh = System.Text.Json.JsonEncodedText.Encode("forced_refresh"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); - private static readonly System.Text.Json.JsonEncodedText PropPrimaryTerm = System.Text.Json.JsonEncodedText.Encode("_primary_term"); - private static readonly System.Text.Json.JsonEncodedText PropResult = System.Text.Json.JsonEncodedText.Encode("result"); - private static readonly System.Text.Json.JsonEncodedText PropSeqNo = System.Text.Json.JsonEncodedText.Encode("_seq_no"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("_version"); - - public override Elastic.Clients.Elasticsearch.CreateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propForcedRefresh = default; - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - LocalJsonValue propPrimaryTerm = default; - LocalJsonValue propResult = default; - LocalJsonValue propSeqNo = default; - LocalJsonValue propShards = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propForcedRefresh.TryReadProperty(ref reader, options, PropForcedRefresh, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propPrimaryTerm.TryReadProperty(ref reader, options, PropPrimaryTerm, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propResult.TryReadProperty(ref reader, options, PropResult, null)) - { - continue; - } - - if (propSeqNo.TryReadProperty(ref reader, options, PropSeqNo, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CreateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ForcedRefresh = propForcedRefresh.Value, - Id = propId.Value, - Index = propIndex.Value, - PrimaryTerm = propPrimaryTerm.Value, - Result = propResult.Value, - SeqNo = propSeqNo.Value, - Shards = propShards.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CreateResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropForcedRefresh, value.ForcedRefresh, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropPrimaryTerm, value.PrimaryTerm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropResult, value.Result, null, null); - writer.WriteProperty(options, PropSeqNo, value.SeqNo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CreateResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.CreateResponseConverter))] public sealed partial class CreateResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/CcrStatsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/CcrStatsRequest.Converters.g.cs new file mode 100644 index 00000000000..4c2b657c329 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/CcrStatsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class CcrStatsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.CcrStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.CcrStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.CcrStatsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/CcrStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/CcrStatsRequest.g.cs index 5dcdcf2040b..8b2f7c8dc1f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/CcrStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/CcrStatsRequest.g.cs @@ -42,35 +42,6 @@ public sealed partial class CcrStatsRequestParameters : Elastic.Transport.Reques public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class CcrStatsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.CcrStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.CcrStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.CcrStatsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get cross-cluster replication stats. @@ -79,7 +50,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// This API returns stats about auto-following and the same shard-level stats as the get follower stats API. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.CcrStatsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.CcrStatsRequestConverter))] public sealed partial class CcrStatsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/CcrStatsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/CcrStatsResponse.Converters.g.cs new file mode 100644 index 00000000000..b36163ca726 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/CcrStatsResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class CcrStatsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAutoFollowStats = System.Text.Json.JsonEncodedText.Encode("auto_follow_stats"); + private static readonly System.Text.Json.JsonEncodedText PropFollowStats = System.Text.Json.JsonEncodedText.Encode("follow_stats"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.CcrStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAutoFollowStats = default; + LocalJsonValue propFollowStats = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAutoFollowStats.TryReadProperty(ref reader, options, PropAutoFollowStats, null)) + { + continue; + } + + if (propFollowStats.TryReadProperty(ref reader, options, PropFollowStats, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.CcrStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AutoFollowStats = propAutoFollowStats.Value, + FollowStats = propFollowStats.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.CcrStatsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAutoFollowStats, value.AutoFollowStats, null, null); + writer.WriteProperty(options, PropFollowStats, value.FollowStats, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/CcrStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/CcrStatsResponse.g.cs index c2d7f16dc72..3cc0a7a2e92 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/CcrStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/CcrStatsResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; -internal sealed partial class CcrStatsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAutoFollowStats = System.Text.Json.JsonEncodedText.Encode("auto_follow_stats"); - private static readonly System.Text.Json.JsonEncodedText PropFollowStats = System.Text.Json.JsonEncodedText.Encode("follow_stats"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.CcrStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAutoFollowStats = default; - LocalJsonValue propFollowStats = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAutoFollowStats.TryReadProperty(ref reader, options, PropAutoFollowStats, null)) - { - continue; - } - - if (propFollowStats.TryReadProperty(ref reader, options, PropFollowStats, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.CcrStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AutoFollowStats = propAutoFollowStats.Value, - FollowStats = propFollowStats.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.CcrStatsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAutoFollowStats, value.AutoFollowStats, null, null); - writer.WriteProperty(options, PropFollowStats, value.FollowStats, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.CcrStatsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.CcrStatsResponseConverter))] public sealed partial class CcrStatsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/DeleteAutoFollowPatternRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/DeleteAutoFollowPatternRequest.Converters.g.cs new file mode 100644 index 00000000000..e54f7ad3e74 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/DeleteAutoFollowPatternRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class DeleteAutoFollowPatternRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.DeleteAutoFollowPatternRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.DeleteAutoFollowPatternRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.DeleteAutoFollowPatternRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/DeleteAutoFollowPatternRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/DeleteAutoFollowPatternRequest.g.cs index 51836ebfb64..db654b9ea0a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/DeleteAutoFollowPatternRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/DeleteAutoFollowPatternRequest.g.cs @@ -35,35 +35,6 @@ public sealed partial class DeleteAutoFollowPatternRequestParameters : Elastic.T public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class DeleteAutoFollowPatternRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.DeleteAutoFollowPatternRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.DeleteAutoFollowPatternRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.DeleteAutoFollowPatternRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete auto-follow patterns. @@ -72,7 +43,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Delete a collection of cross-cluster replication auto-follow patterns. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.DeleteAutoFollowPatternRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.DeleteAutoFollowPatternRequestConverter))] public sealed partial class DeleteAutoFollowPatternRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/DeleteAutoFollowPatternResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/DeleteAutoFollowPatternResponse.Converters.g.cs new file mode 100644 index 00000000000..64d7a08b970 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/DeleteAutoFollowPatternResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class DeleteAutoFollowPatternResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.DeleteAutoFollowPatternResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.DeleteAutoFollowPatternResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.DeleteAutoFollowPatternResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/DeleteAutoFollowPatternResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/DeleteAutoFollowPatternResponse.g.cs index 86c6ac311ae..b50e256a6a6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/DeleteAutoFollowPatternResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/DeleteAutoFollowPatternResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; -internal sealed partial class DeleteAutoFollowPatternResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.DeleteAutoFollowPatternResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.DeleteAutoFollowPatternResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.DeleteAutoFollowPatternResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.DeleteAutoFollowPatternResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.DeleteAutoFollowPatternResponseConverter))] public sealed partial class DeleteAutoFollowPatternResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowInfoRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowInfoRequest.Converters.g.cs new file mode 100644 index 00000000000..618f023ce4f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowInfoRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class FollowInfoRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowInfoRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowInfoRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowInfoRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowInfoRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowInfoRequest.g.cs index cff1cbe2fef..e357454d8f8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowInfoRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowInfoRequest.g.cs @@ -35,35 +35,6 @@ public sealed partial class FollowInfoRequestParameters : Elastic.Transport.Requ public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class FollowInfoRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowInfoRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowInfoRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowInfoRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get follower information. @@ -73,7 +44,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// For example, the results include follower index names, leader index names, replication options, and whether the follower indices are active or paused. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowInfoRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.FollowInfoRequestConverter))] public sealed partial class FollowInfoRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowInfoResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowInfoResponse.Converters.g.cs new file mode 100644 index 00000000000..e8da133de04 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowInfoResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class FollowInfoResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFollowerIndices = System.Text.Json.JsonEncodedText.Encode("follower_indices"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowInfoResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propFollowerIndices = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFollowerIndices.TryReadProperty(ref reader, options, PropFollowerIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowInfoResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FollowerIndices = propFollowerIndices.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowInfoResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFollowerIndices, value.FollowerIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowInfoResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowInfoResponse.g.cs index 3328e7f610e..c822bc068c0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowInfoResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowInfoResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; -internal sealed partial class FollowInfoResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFollowerIndices = System.Text.Json.JsonEncodedText.Encode("follower_indices"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowInfoResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propFollowerIndices = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFollowerIndices.TryReadProperty(ref reader, options, PropFollowerIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowInfoResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FollowerIndices = propFollowerIndices.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowInfoResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFollowerIndices, value.FollowerIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowInfoResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.FollowInfoResponseConverter))] public sealed partial class FollowInfoResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal FollowInfoResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCons public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection FollowerIndices { get; set; } +System.Collections.Generic.IReadOnlyCollection FollowerIndices { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowRequest.Converters.g.cs new file mode 100644 index 00000000000..4f1c1a40bf3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowRequest.Converters.g.cs @@ -0,0 +1,180 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class FollowRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDataStreamName = System.Text.Json.JsonEncodedText.Encode("data_stream_name"); + private static readonly System.Text.Json.JsonEncodedText PropLeaderIndex = System.Text.Json.JsonEncodedText.Encode("leader_index"); + private static readonly System.Text.Json.JsonEncodedText PropMaxOutstandingReadRequests = System.Text.Json.JsonEncodedText.Encode("max_outstanding_read_requests"); + private static readonly System.Text.Json.JsonEncodedText PropMaxOutstandingWriteRequests = System.Text.Json.JsonEncodedText.Encode("max_outstanding_write_requests"); + private static readonly System.Text.Json.JsonEncodedText PropMaxReadRequestOperationCount = System.Text.Json.JsonEncodedText.Encode("max_read_request_operation_count"); + private static readonly System.Text.Json.JsonEncodedText PropMaxReadRequestSize = System.Text.Json.JsonEncodedText.Encode("max_read_request_size"); + private static readonly System.Text.Json.JsonEncodedText PropMaxRetryDelay = System.Text.Json.JsonEncodedText.Encode("max_retry_delay"); + private static readonly System.Text.Json.JsonEncodedText PropMaxWriteBufferCount = System.Text.Json.JsonEncodedText.Encode("max_write_buffer_count"); + private static readonly System.Text.Json.JsonEncodedText PropMaxWriteBufferSize = System.Text.Json.JsonEncodedText.Encode("max_write_buffer_size"); + private static readonly System.Text.Json.JsonEncodedText PropMaxWriteRequestOperationCount = System.Text.Json.JsonEncodedText.Encode("max_write_request_operation_count"); + private static readonly System.Text.Json.JsonEncodedText PropMaxWriteRequestSize = System.Text.Json.JsonEncodedText.Encode("max_write_request_size"); + private static readonly System.Text.Json.JsonEncodedText PropReadPollTimeout = System.Text.Json.JsonEncodedText.Encode("read_poll_timeout"); + private static readonly System.Text.Json.JsonEncodedText PropRemoteCluster = System.Text.Json.JsonEncodedText.Encode("remote_cluster"); + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDataStreamName = default; + LocalJsonValue propLeaderIndex = default; + LocalJsonValue propMaxOutstandingReadRequests = default; + LocalJsonValue propMaxOutstandingWriteRequests = default; + LocalJsonValue propMaxReadRequestOperationCount = default; + LocalJsonValue propMaxReadRequestSize = default; + LocalJsonValue propMaxRetryDelay = default; + LocalJsonValue propMaxWriteBufferCount = default; + LocalJsonValue propMaxWriteBufferSize = default; + LocalJsonValue propMaxWriteRequestOperationCount = default; + LocalJsonValue propMaxWriteRequestSize = default; + LocalJsonValue propReadPollTimeout = default; + LocalJsonValue propRemoteCluster = default; + LocalJsonValue propSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDataStreamName.TryReadProperty(ref reader, options, PropDataStreamName, null)) + { + continue; + } + + if (propLeaderIndex.TryReadProperty(ref reader, options, PropLeaderIndex, null)) + { + continue; + } + + if (propMaxOutstandingReadRequests.TryReadProperty(ref reader, options, PropMaxOutstandingReadRequests, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxOutstandingWriteRequests.TryReadProperty(ref reader, options, PropMaxOutstandingWriteRequests, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxReadRequestOperationCount.TryReadProperty(ref reader, options, PropMaxReadRequestOperationCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxReadRequestSize.TryReadProperty(ref reader, options, PropMaxReadRequestSize, null)) + { + continue; + } + + if (propMaxRetryDelay.TryReadProperty(ref reader, options, PropMaxRetryDelay, null)) + { + continue; + } + + if (propMaxWriteBufferCount.TryReadProperty(ref reader, options, PropMaxWriteBufferCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxWriteBufferSize.TryReadProperty(ref reader, options, PropMaxWriteBufferSize, null)) + { + continue; + } + + if (propMaxWriteRequestOperationCount.TryReadProperty(ref reader, options, PropMaxWriteRequestOperationCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxWriteRequestSize.TryReadProperty(ref reader, options, PropMaxWriteRequestSize, null)) + { + continue; + } + + if (propReadPollTimeout.TryReadProperty(ref reader, options, PropReadPollTimeout, null)) + { + continue; + } + + if (propRemoteCluster.TryReadProperty(ref reader, options, PropRemoteCluster, null)) + { + continue; + } + + if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DataStreamName = propDataStreamName.Value, + LeaderIndex = propLeaderIndex.Value, + MaxOutstandingReadRequests = propMaxOutstandingReadRequests.Value, + MaxOutstandingWriteRequests = propMaxOutstandingWriteRequests.Value, + MaxReadRequestOperationCount = propMaxReadRequestOperationCount.Value, + MaxReadRequestSize = propMaxReadRequestSize.Value, + MaxRetryDelay = propMaxRetryDelay.Value, + MaxWriteBufferCount = propMaxWriteBufferCount.Value, + MaxWriteBufferSize = propMaxWriteBufferSize.Value, + MaxWriteRequestOperationCount = propMaxWriteRequestOperationCount.Value, + MaxWriteRequestSize = propMaxWriteRequestSize.Value, + ReadPollTimeout = propReadPollTimeout.Value, + RemoteCluster = propRemoteCluster.Value, + Settings = propSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDataStreamName, value.DataStreamName, null, null); + writer.WriteProperty(options, PropLeaderIndex, value.LeaderIndex, null, null); + writer.WriteProperty(options, PropMaxOutstandingReadRequests, value.MaxOutstandingReadRequests, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxOutstandingWriteRequests, value.MaxOutstandingWriteRequests, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxReadRequestOperationCount, value.MaxReadRequestOperationCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxReadRequestSize, value.MaxReadRequestSize, null, null); + writer.WriteProperty(options, PropMaxRetryDelay, value.MaxRetryDelay, null, null); + writer.WriteProperty(options, PropMaxWriteBufferCount, value.MaxWriteBufferCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxWriteBufferSize, value.MaxWriteBufferSize, null, null); + writer.WriteProperty(options, PropMaxWriteRequestOperationCount, value.MaxWriteRequestOperationCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxWriteRequestSize, value.MaxWriteRequestSize, null, null); + writer.WriteProperty(options, PropReadPollTimeout, value.ReadPollTimeout, null, null); + writer.WriteProperty(options, PropRemoteCluster, value.RemoteCluster, null, null); + writer.WriteProperty(options, PropSettings, value.Settings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowRequest.g.cs index 6c44dc9c71a..ec7e5c0de96 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowRequest.g.cs @@ -43,162 +43,6 @@ public sealed partial class FollowRequestParameters : Elastic.Transport.RequestP public Elastic.Clients.Elasticsearch.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } } -internal sealed partial class FollowRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDataStreamName = System.Text.Json.JsonEncodedText.Encode("data_stream_name"); - private static readonly System.Text.Json.JsonEncodedText PropLeaderIndex = System.Text.Json.JsonEncodedText.Encode("leader_index"); - private static readonly System.Text.Json.JsonEncodedText PropMaxOutstandingReadRequests = System.Text.Json.JsonEncodedText.Encode("max_outstanding_read_requests"); - private static readonly System.Text.Json.JsonEncodedText PropMaxOutstandingWriteRequests = System.Text.Json.JsonEncodedText.Encode("max_outstanding_write_requests"); - private static readonly System.Text.Json.JsonEncodedText PropMaxReadRequestOperationCount = System.Text.Json.JsonEncodedText.Encode("max_read_request_operation_count"); - private static readonly System.Text.Json.JsonEncodedText PropMaxReadRequestSize = System.Text.Json.JsonEncodedText.Encode("max_read_request_size"); - private static readonly System.Text.Json.JsonEncodedText PropMaxRetryDelay = System.Text.Json.JsonEncodedText.Encode("max_retry_delay"); - private static readonly System.Text.Json.JsonEncodedText PropMaxWriteBufferCount = System.Text.Json.JsonEncodedText.Encode("max_write_buffer_count"); - private static readonly System.Text.Json.JsonEncodedText PropMaxWriteBufferSize = System.Text.Json.JsonEncodedText.Encode("max_write_buffer_size"); - private static readonly System.Text.Json.JsonEncodedText PropMaxWriteRequestOperationCount = System.Text.Json.JsonEncodedText.Encode("max_write_request_operation_count"); - private static readonly System.Text.Json.JsonEncodedText PropMaxWriteRequestSize = System.Text.Json.JsonEncodedText.Encode("max_write_request_size"); - private static readonly System.Text.Json.JsonEncodedText PropReadPollTimeout = System.Text.Json.JsonEncodedText.Encode("read_poll_timeout"); - private static readonly System.Text.Json.JsonEncodedText PropRemoteCluster = System.Text.Json.JsonEncodedText.Encode("remote_cluster"); - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDataStreamName = default; - LocalJsonValue propLeaderIndex = default; - LocalJsonValue propMaxOutstandingReadRequests = default; - LocalJsonValue propMaxOutstandingWriteRequests = default; - LocalJsonValue propMaxReadRequestOperationCount = default; - LocalJsonValue propMaxReadRequestSize = default; - LocalJsonValue propMaxRetryDelay = default; - LocalJsonValue propMaxWriteBufferCount = default; - LocalJsonValue propMaxWriteBufferSize = default; - LocalJsonValue propMaxWriteRequestOperationCount = default; - LocalJsonValue propMaxWriteRequestSize = default; - LocalJsonValue propReadPollTimeout = default; - LocalJsonValue propRemoteCluster = default; - LocalJsonValue propSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDataStreamName.TryReadProperty(ref reader, options, PropDataStreamName, null)) - { - continue; - } - - if (propLeaderIndex.TryReadProperty(ref reader, options, PropLeaderIndex, null)) - { - continue; - } - - if (propMaxOutstandingReadRequests.TryReadProperty(ref reader, options, PropMaxOutstandingReadRequests, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxOutstandingWriteRequests.TryReadProperty(ref reader, options, PropMaxOutstandingWriteRequests, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxReadRequestOperationCount.TryReadProperty(ref reader, options, PropMaxReadRequestOperationCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxReadRequestSize.TryReadProperty(ref reader, options, PropMaxReadRequestSize, null)) - { - continue; - } - - if (propMaxRetryDelay.TryReadProperty(ref reader, options, PropMaxRetryDelay, null)) - { - continue; - } - - if (propMaxWriteBufferCount.TryReadProperty(ref reader, options, PropMaxWriteBufferCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxWriteBufferSize.TryReadProperty(ref reader, options, PropMaxWriteBufferSize, null)) - { - continue; - } - - if (propMaxWriteRequestOperationCount.TryReadProperty(ref reader, options, PropMaxWriteRequestOperationCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxWriteRequestSize.TryReadProperty(ref reader, options, PropMaxWriteRequestSize, null)) - { - continue; - } - - if (propReadPollTimeout.TryReadProperty(ref reader, options, PropReadPollTimeout, null)) - { - continue; - } - - if (propRemoteCluster.TryReadProperty(ref reader, options, PropRemoteCluster, null)) - { - continue; - } - - if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DataStreamName = propDataStreamName.Value, - LeaderIndex = propLeaderIndex.Value, - MaxOutstandingReadRequests = propMaxOutstandingReadRequests.Value, - MaxOutstandingWriteRequests = propMaxOutstandingWriteRequests.Value, - MaxReadRequestOperationCount = propMaxReadRequestOperationCount.Value, - MaxReadRequestSize = propMaxReadRequestSize.Value, - MaxRetryDelay = propMaxRetryDelay.Value, - MaxWriteBufferCount = propMaxWriteBufferCount.Value, - MaxWriteBufferSize = propMaxWriteBufferSize.Value, - MaxWriteRequestOperationCount = propMaxWriteRequestOperationCount.Value, - MaxWriteRequestSize = propMaxWriteRequestSize.Value, - ReadPollTimeout = propReadPollTimeout.Value, - RemoteCluster = propRemoteCluster.Value, - Settings = propSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDataStreamName, value.DataStreamName, null, null); - writer.WriteProperty(options, PropLeaderIndex, value.LeaderIndex, null, null); - writer.WriteProperty(options, PropMaxOutstandingReadRequests, value.MaxOutstandingReadRequests, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxOutstandingWriteRequests, value.MaxOutstandingWriteRequests, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxReadRequestOperationCount, value.MaxReadRequestOperationCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxReadRequestSize, value.MaxReadRequestSize, null, null); - writer.WriteProperty(options, PropMaxRetryDelay, value.MaxRetryDelay, null, null); - writer.WriteProperty(options, PropMaxWriteBufferCount, value.MaxWriteBufferCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxWriteBufferSize, value.MaxWriteBufferSize, null, null); - writer.WriteProperty(options, PropMaxWriteRequestOperationCount, value.MaxWriteRequestOperationCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxWriteRequestSize, value.MaxWriteRequestSize, null, null); - writer.WriteProperty(options, PropReadPollTimeout, value.ReadPollTimeout, null, null); - writer.WriteProperty(options, PropRemoteCluster, value.RemoteCluster, null, null); - writer.WriteProperty(options, PropSettings, value.Settings, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create a follower. @@ -206,7 +50,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// When the API returns, the follower index exists and cross-cluster replication starts replicating operations from the leader index to the follower index. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.FollowRequestConverter))] public sealed partial class FollowRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowResponse.Converters.g.cs new file mode 100644 index 00000000000..f258001b889 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class FollowResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFollowIndexCreated = System.Text.Json.JsonEncodedText.Encode("follow_index_created"); + private static readonly System.Text.Json.JsonEncodedText PropFollowIndexShardsAcked = System.Text.Json.JsonEncodedText.Encode("follow_index_shards_acked"); + private static readonly System.Text.Json.JsonEncodedText PropIndexFollowingStarted = System.Text.Json.JsonEncodedText.Encode("index_following_started"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFollowIndexCreated = default; + LocalJsonValue propFollowIndexShardsAcked = default; + LocalJsonValue propIndexFollowingStarted = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFollowIndexCreated.TryReadProperty(ref reader, options, PropFollowIndexCreated, null)) + { + continue; + } + + if (propFollowIndexShardsAcked.TryReadProperty(ref reader, options, PropFollowIndexShardsAcked, null)) + { + continue; + } + + if (propIndexFollowingStarted.TryReadProperty(ref reader, options, PropIndexFollowingStarted, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FollowIndexCreated = propFollowIndexCreated.Value, + FollowIndexShardsAcked = propFollowIndexShardsAcked.Value, + IndexFollowingStarted = propIndexFollowingStarted.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFollowIndexCreated, value.FollowIndexCreated, null, null); + writer.WriteProperty(options, PropFollowIndexShardsAcked, value.FollowIndexShardsAcked, null, null); + writer.WriteProperty(options, PropIndexFollowingStarted, value.IndexFollowingStarted, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowResponse.g.cs index 27e39e69f74..9e29618f990 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; -internal sealed partial class FollowResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFollowIndexCreated = System.Text.Json.JsonEncodedText.Encode("follow_index_created"); - private static readonly System.Text.Json.JsonEncodedText PropFollowIndexShardsAcked = System.Text.Json.JsonEncodedText.Encode("follow_index_shards_acked"); - private static readonly System.Text.Json.JsonEncodedText PropIndexFollowingStarted = System.Text.Json.JsonEncodedText.Encode("index_following_started"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFollowIndexCreated = default; - LocalJsonValue propFollowIndexShardsAcked = default; - LocalJsonValue propIndexFollowingStarted = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFollowIndexCreated.TryReadProperty(ref reader, options, PropFollowIndexCreated, null)) - { - continue; - } - - if (propFollowIndexShardsAcked.TryReadProperty(ref reader, options, PropFollowIndexShardsAcked, null)) - { - continue; - } - - if (propIndexFollowingStarted.TryReadProperty(ref reader, options, PropIndexFollowingStarted, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FollowIndexCreated = propFollowIndexCreated.Value, - FollowIndexShardsAcked = propFollowIndexShardsAcked.Value, - IndexFollowingStarted = propIndexFollowingStarted.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFollowIndexCreated, value.FollowIndexCreated, null, null); - writer.WriteProperty(options, PropFollowIndexShardsAcked, value.FollowIndexShardsAcked, null, null); - writer.WriteProperty(options, PropIndexFollowingStarted, value.IndexFollowingStarted, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.FollowResponseConverter))] public sealed partial class FollowResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -96,17 +39,17 @@ internal FollowResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstruc public #if NET7_0_OR_GREATER - required +required #endif - bool FollowIndexCreated { get; set; } +bool FollowIndexCreated { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool FollowIndexShardsAcked { get; set; } +bool FollowIndexShardsAcked { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool IndexFollowingStarted { get; set; } +bool IndexFollowingStarted { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowStatsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowStatsRequest.Converters.g.cs new file mode 100644 index 00000000000..9959f1873be --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowStatsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class FollowStatsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowStatsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowStatsRequest.g.cs index 6c870091ac3..ffd58a03cb0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowStatsRequest.g.cs @@ -34,35 +34,6 @@ public sealed partial class FollowStatsRequestParameters : Elastic.Transport.Req public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class FollowStatsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowStatsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get follower stats. @@ -72,7 +43,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The API returns shard-level stats about the "following tasks" associated with each shard for the specified indices. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowStatsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.FollowStatsRequestConverter))] public sealed partial class FollowStatsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowStatsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowStatsResponse.Converters.g.cs new file mode 100644 index 00000000000..8363cff3f93 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowStatsResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class FollowStatsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propIndices = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Indices = propIndices.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowStatsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowStatsResponse.g.cs index f2736a8c53d..55646255dca 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/FollowStatsResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; -internal sealed partial class FollowStatsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propIndices = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Indices = propIndices.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowStatsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowStatsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.FollowStatsResponseConverter))] public sealed partial class FollowStatsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ForgetFollowerRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ForgetFollowerRequest.Converters.g.cs new file mode 100644 index 00000000000..a107ab25a5a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ForgetFollowerRequest.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class ForgetFollowerRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFollowerCluster = System.Text.Json.JsonEncodedText.Encode("follower_cluster"); + private static readonly System.Text.Json.JsonEncodedText PropFollowerIndex = System.Text.Json.JsonEncodedText.Encode("follower_index"); + private static readonly System.Text.Json.JsonEncodedText PropFollowerIndexUuid = System.Text.Json.JsonEncodedText.Encode("follower_index_uuid"); + private static readonly System.Text.Json.JsonEncodedText PropLeaderRemoteCluster = System.Text.Json.JsonEncodedText.Encode("leader_remote_cluster"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.ForgetFollowerRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFollowerCluster = default; + LocalJsonValue propFollowerIndex = default; + LocalJsonValue propFollowerIndexUuid = default; + LocalJsonValue propLeaderRemoteCluster = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFollowerCluster.TryReadProperty(ref reader, options, PropFollowerCluster, null)) + { + continue; + } + + if (propFollowerIndex.TryReadProperty(ref reader, options, PropFollowerIndex, null)) + { + continue; + } + + if (propFollowerIndexUuid.TryReadProperty(ref reader, options, PropFollowerIndexUuid, null)) + { + continue; + } + + if (propLeaderRemoteCluster.TryReadProperty(ref reader, options, PropLeaderRemoteCluster, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.ForgetFollowerRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FollowerCluster = propFollowerCluster.Value, + FollowerIndex = propFollowerIndex.Value, + FollowerIndexUuid = propFollowerIndexUuid.Value, + LeaderRemoteCluster = propLeaderRemoteCluster.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.ForgetFollowerRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFollowerCluster, value.FollowerCluster, null, null); + writer.WriteProperty(options, PropFollowerIndex, value.FollowerIndex, null, null); + writer.WriteProperty(options, PropFollowerIndexUuid, value.FollowerIndexUuid, null, null); + writer.WriteProperty(options, PropLeaderRemoteCluster, value.LeaderRemoteCluster, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ForgetFollowerRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ForgetFollowerRequest.g.cs index a3d3f4a5625..0333825fb4f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ForgetFollowerRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ForgetFollowerRequest.g.cs @@ -33,72 +33,6 @@ public sealed partial class ForgetFollowerRequestParameters : Elastic.Transport. public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class ForgetFollowerRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFollowerCluster = System.Text.Json.JsonEncodedText.Encode("follower_cluster"); - private static readonly System.Text.Json.JsonEncodedText PropFollowerIndex = System.Text.Json.JsonEncodedText.Encode("follower_index"); - private static readonly System.Text.Json.JsonEncodedText PropFollowerIndexUuid = System.Text.Json.JsonEncodedText.Encode("follower_index_uuid"); - private static readonly System.Text.Json.JsonEncodedText PropLeaderRemoteCluster = System.Text.Json.JsonEncodedText.Encode("leader_remote_cluster"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.ForgetFollowerRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFollowerCluster = default; - LocalJsonValue propFollowerIndex = default; - LocalJsonValue propFollowerIndexUuid = default; - LocalJsonValue propLeaderRemoteCluster = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFollowerCluster.TryReadProperty(ref reader, options, PropFollowerCluster, null)) - { - continue; - } - - if (propFollowerIndex.TryReadProperty(ref reader, options, PropFollowerIndex, null)) - { - continue; - } - - if (propFollowerIndexUuid.TryReadProperty(ref reader, options, PropFollowerIndexUuid, null)) - { - continue; - } - - if (propLeaderRemoteCluster.TryReadProperty(ref reader, options, PropLeaderRemoteCluster, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.ForgetFollowerRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FollowerCluster = propFollowerCluster.Value, - FollowerIndex = propFollowerIndex.Value, - FollowerIndexUuid = propFollowerIndexUuid.Value, - LeaderRemoteCluster = propLeaderRemoteCluster.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.ForgetFollowerRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFollowerCluster, value.FollowerCluster, null, null); - writer.WriteProperty(options, PropFollowerIndex, value.FollowerIndex, null, null); - writer.WriteProperty(options, PropFollowerIndexUuid, value.FollowerIndexUuid, null, null); - writer.WriteProperty(options, PropLeaderRemoteCluster, value.LeaderRemoteCluster, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Forget a follower. @@ -117,7 +51,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The only purpose of this API is to handle the case of failure to remove the following retention leases after the unfollow API is invoked. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.ForgetFollowerRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.ForgetFollowerRequestConverter))] public sealed partial class ForgetFollowerRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ForgetFollowerResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ForgetFollowerResponse.Converters.g.cs new file mode 100644 index 00000000000..f99b16852f4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ForgetFollowerResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class ForgetFollowerResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.ForgetFollowerResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propShards = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.ForgetFollowerResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Shards = propShards.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.ForgetFollowerResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ForgetFollowerResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ForgetFollowerResponse.g.cs index e3a0a2fc62d..6b430f05e2c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ForgetFollowerResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ForgetFollowerResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; -internal sealed partial class ForgetFollowerResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.ForgetFollowerResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propShards = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.ForgetFollowerResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Shards = propShards.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.ForgetFollowerResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.ForgetFollowerResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.ForgetFollowerResponseConverter))] public sealed partial class ForgetFollowerResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal ForgetFollowerResponse(Elastic.Clients.Elasticsearch.Serialization.Json public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; set; } +Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/GetAutoFollowPatternRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/GetAutoFollowPatternRequest.Converters.g.cs new file mode 100644 index 00000000000..163b7e8f120 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/GetAutoFollowPatternRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class GetAutoFollowPatternRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.GetAutoFollowPatternRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.GetAutoFollowPatternRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.GetAutoFollowPatternRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/GetAutoFollowPatternRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/GetAutoFollowPatternRequest.g.cs index 2ad171efd7e..7421c2e43fa 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/GetAutoFollowPatternRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/GetAutoFollowPatternRequest.g.cs @@ -35,35 +35,6 @@ public sealed partial class GetAutoFollowPatternRequestParameters : Elastic.Tran public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class GetAutoFollowPatternRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.GetAutoFollowPatternRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.GetAutoFollowPatternRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.GetAutoFollowPatternRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get auto-follow patterns. @@ -72,7 +43,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Get cross-cluster replication auto-follow patterns. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.GetAutoFollowPatternRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.GetAutoFollowPatternRequestConverter))] public sealed partial class GetAutoFollowPatternRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetAutoFollowPatternRequest(Elastic.Clients.Elasticsearch.Name? name) : base(r => r.Optional("name", name)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/GetAutoFollowPatternResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/GetAutoFollowPatternResponse.Converters.g.cs new file mode 100644 index 00000000000..ff5ec4f5350 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/GetAutoFollowPatternResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class GetAutoFollowPatternResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPatterns = System.Text.Json.JsonEncodedText.Encode("patterns"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.GetAutoFollowPatternResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propPatterns = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPatterns.TryReadProperty(ref reader, options, PropPatterns, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.GetAutoFollowPatternResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Patterns = propPatterns.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.GetAutoFollowPatternResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPatterns, value.Patterns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/GetAutoFollowPatternResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/GetAutoFollowPatternResponse.g.cs index cf963f54cb1..7b091c1bc97 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/GetAutoFollowPatternResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/GetAutoFollowPatternResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; -internal sealed partial class GetAutoFollowPatternResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPatterns = System.Text.Json.JsonEncodedText.Encode("patterns"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.GetAutoFollowPatternResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propPatterns = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPatterns.TryReadProperty(ref reader, options, PropPatterns, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.GetAutoFollowPatternResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Patterns = propPatterns.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.GetAutoFollowPatternResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPatterns, value.Patterns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.GetAutoFollowPatternResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.GetAutoFollowPatternResponseConverter))] public sealed partial class GetAutoFollowPatternResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal GetAutoFollowPatternResponse(Elastic.Clients.Elasticsearch.Serializatio public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Patterns { get; set; } +System.Collections.Generic.IReadOnlyCollection Patterns { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseAutoFollowPatternRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseAutoFollowPatternRequest.Converters.g.cs new file mode 100644 index 00000000000..c6b6ea75a5b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseAutoFollowPatternRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class PauseAutoFollowPatternRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseAutoFollowPatternRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseAutoFollowPatternRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseAutoFollowPatternRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseAutoFollowPatternRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseAutoFollowPatternRequest.g.cs index 5bc3e388ded..ff2a0d04a87 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseAutoFollowPatternRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseAutoFollowPatternRequest.g.cs @@ -35,35 +35,6 @@ public sealed partial class PauseAutoFollowPatternRequestParameters : Elastic.Tr public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class PauseAutoFollowPatternRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseAutoFollowPatternRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseAutoFollowPatternRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseAutoFollowPatternRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Pause an auto-follow pattern. @@ -79,7 +50,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Remote indices that were created while the pattern was paused will also be followed, unless they have been deleted or closed in the interim. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseAutoFollowPatternRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.PauseAutoFollowPatternRequestConverter))] public sealed partial class PauseAutoFollowPatternRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseAutoFollowPatternResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseAutoFollowPatternResponse.Converters.g.cs new file mode 100644 index 00000000000..9d2622e6df5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseAutoFollowPatternResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class PauseAutoFollowPatternResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseAutoFollowPatternResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseAutoFollowPatternResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseAutoFollowPatternResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseAutoFollowPatternResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseAutoFollowPatternResponse.g.cs index bb457f750c5..4db78bc0f29 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseAutoFollowPatternResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseAutoFollowPatternResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; -internal sealed partial class PauseAutoFollowPatternResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseAutoFollowPatternResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseAutoFollowPatternResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseAutoFollowPatternResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseAutoFollowPatternResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.PauseAutoFollowPatternResponseConverter))] public sealed partial class PauseAutoFollowPatternResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseFollowRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseFollowRequest.Converters.g.cs new file mode 100644 index 00000000000..4c5d2737ab4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseFollowRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class PauseFollowRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseFollowRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseFollowRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseFollowRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseFollowRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseFollowRequest.g.cs index 1c168128cc9..f7c7f0037b3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseFollowRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseFollowRequest.g.cs @@ -35,35 +35,6 @@ public sealed partial class PauseFollowRequestParameters : Elastic.Transport.Req public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class PauseFollowRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseFollowRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseFollowRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseFollowRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Pause a follower. @@ -75,7 +46,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// You can pause and resume a follower index to change the configuration of the following task. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseFollowRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.PauseFollowRequestConverter))] public sealed partial class PauseFollowRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseFollowResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseFollowResponse.Converters.g.cs new file mode 100644 index 00000000000..8c932136968 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseFollowResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class PauseFollowResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseFollowResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseFollowResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseFollowResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseFollowResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseFollowResponse.g.cs index 84966187fa8..2f423908a54 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseFollowResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PauseFollowResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; -internal sealed partial class PauseFollowResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseFollowResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseFollowResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseFollowResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.PauseFollowResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.PauseFollowResponseConverter))] public sealed partial class PauseFollowResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PutAutoFollowPatternRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PutAutoFollowPatternRequest.Converters.g.cs new file mode 100644 index 00000000000..9b6f12e992f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PutAutoFollowPatternRequest.Converters.g.cs @@ -0,0 +1,189 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class PutAutoFollowPatternRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFollowIndexPattern = System.Text.Json.JsonEncodedText.Encode("follow_index_pattern"); + private static readonly System.Text.Json.JsonEncodedText PropLeaderIndexExclusionPatterns = System.Text.Json.JsonEncodedText.Encode("leader_index_exclusion_patterns"); + private static readonly System.Text.Json.JsonEncodedText PropLeaderIndexPatterns = System.Text.Json.JsonEncodedText.Encode("leader_index_patterns"); + private static readonly System.Text.Json.JsonEncodedText PropMaxOutstandingReadRequests = System.Text.Json.JsonEncodedText.Encode("max_outstanding_read_requests"); + private static readonly System.Text.Json.JsonEncodedText PropMaxOutstandingWriteRequests = System.Text.Json.JsonEncodedText.Encode("max_outstanding_write_requests"); + private static readonly System.Text.Json.JsonEncodedText PropMaxReadRequestOperationCount = System.Text.Json.JsonEncodedText.Encode("max_read_request_operation_count"); + private static readonly System.Text.Json.JsonEncodedText PropMaxReadRequestSize = System.Text.Json.JsonEncodedText.Encode("max_read_request_size"); + private static readonly System.Text.Json.JsonEncodedText PropMaxRetryDelay = System.Text.Json.JsonEncodedText.Encode("max_retry_delay"); + private static readonly System.Text.Json.JsonEncodedText PropMaxWriteBufferCount = System.Text.Json.JsonEncodedText.Encode("max_write_buffer_count"); + private static readonly System.Text.Json.JsonEncodedText PropMaxWriteBufferSize = System.Text.Json.JsonEncodedText.Encode("max_write_buffer_size"); + private static readonly System.Text.Json.JsonEncodedText PropMaxWriteRequestOperationCount = System.Text.Json.JsonEncodedText.Encode("max_write_request_operation_count"); + private static readonly System.Text.Json.JsonEncodedText PropMaxWriteRequestSize = System.Text.Json.JsonEncodedText.Encode("max_write_request_size"); + private static readonly System.Text.Json.JsonEncodedText PropReadPollTimeout = System.Text.Json.JsonEncodedText.Encode("read_poll_timeout"); + private static readonly System.Text.Json.JsonEncodedText PropRemoteCluster = System.Text.Json.JsonEncodedText.Encode("remote_cluster"); + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.PutAutoFollowPatternRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFollowIndexPattern = default; + LocalJsonValue?> propLeaderIndexExclusionPatterns = default; + LocalJsonValue?> propLeaderIndexPatterns = default; + LocalJsonValue propMaxOutstandingReadRequests = default; + LocalJsonValue propMaxOutstandingWriteRequests = default; + LocalJsonValue propMaxReadRequestOperationCount = default; + LocalJsonValue propMaxReadRequestSize = default; + LocalJsonValue propMaxRetryDelay = default; + LocalJsonValue propMaxWriteBufferCount = default; + LocalJsonValue propMaxWriteBufferSize = default; + LocalJsonValue propMaxWriteRequestOperationCount = default; + LocalJsonValue propMaxWriteRequestSize = default; + LocalJsonValue propReadPollTimeout = default; + LocalJsonValue propRemoteCluster = default; + LocalJsonValue?> propSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFollowIndexPattern.TryReadProperty(ref reader, options, PropFollowIndexPattern, null)) + { + continue; + } + + if (propLeaderIndexExclusionPatterns.TryReadProperty(ref reader, options, PropLeaderIndexExclusionPatterns, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propLeaderIndexPatterns.TryReadProperty(ref reader, options, PropLeaderIndexPatterns, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propMaxOutstandingReadRequests.TryReadProperty(ref reader, options, PropMaxOutstandingReadRequests, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxOutstandingWriteRequests.TryReadProperty(ref reader, options, PropMaxOutstandingWriteRequests, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxReadRequestOperationCount.TryReadProperty(ref reader, options, PropMaxReadRequestOperationCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxReadRequestSize.TryReadProperty(ref reader, options, PropMaxReadRequestSize, null)) + { + continue; + } + + if (propMaxRetryDelay.TryReadProperty(ref reader, options, PropMaxRetryDelay, null)) + { + continue; + } + + if (propMaxWriteBufferCount.TryReadProperty(ref reader, options, PropMaxWriteBufferCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxWriteBufferSize.TryReadProperty(ref reader, options, PropMaxWriteBufferSize, null)) + { + continue; + } + + if (propMaxWriteRequestOperationCount.TryReadProperty(ref reader, options, PropMaxWriteRequestOperationCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxWriteRequestSize.TryReadProperty(ref reader, options, PropMaxWriteRequestSize, null)) + { + continue; + } + + if (propReadPollTimeout.TryReadProperty(ref reader, options, PropReadPollTimeout, null)) + { + continue; + } + + if (propRemoteCluster.TryReadProperty(ref reader, options, PropRemoteCluster, null)) + { + continue; + } + + if (propSettings.TryReadProperty(ref reader, options, PropSettings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.PutAutoFollowPatternRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FollowIndexPattern = propFollowIndexPattern.Value, + LeaderIndexExclusionPatterns = propLeaderIndexExclusionPatterns.Value, + LeaderIndexPatterns = propLeaderIndexPatterns.Value, + MaxOutstandingReadRequests = propMaxOutstandingReadRequests.Value, + MaxOutstandingWriteRequests = propMaxOutstandingWriteRequests.Value, + MaxReadRequestOperationCount = propMaxReadRequestOperationCount.Value, + MaxReadRequestSize = propMaxReadRequestSize.Value, + MaxRetryDelay = propMaxRetryDelay.Value, + MaxWriteBufferCount = propMaxWriteBufferCount.Value, + MaxWriteBufferSize = propMaxWriteBufferSize.Value, + MaxWriteRequestOperationCount = propMaxWriteRequestOperationCount.Value, + MaxWriteRequestSize = propMaxWriteRequestSize.Value, + ReadPollTimeout = propReadPollTimeout.Value, + RemoteCluster = propRemoteCluster.Value, + Settings = propSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.PutAutoFollowPatternRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFollowIndexPattern, value.FollowIndexPattern, null, null); + writer.WriteProperty(options, PropLeaderIndexExclusionPatterns, value.LeaderIndexExclusionPatterns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropLeaderIndexPatterns, value.LeaderIndexPatterns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMaxOutstandingReadRequests, value.MaxOutstandingReadRequests, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxOutstandingWriteRequests, value.MaxOutstandingWriteRequests, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxReadRequestOperationCount, value.MaxReadRequestOperationCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxReadRequestSize, value.MaxReadRequestSize, null, null); + writer.WriteProperty(options, PropMaxRetryDelay, value.MaxRetryDelay, null, null); + writer.WriteProperty(options, PropMaxWriteBufferCount, value.MaxWriteBufferCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxWriteBufferSize, value.MaxWriteBufferSize, null, null); + writer.WriteProperty(options, PropMaxWriteRequestOperationCount, value.MaxWriteRequestOperationCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxWriteRequestSize, value.MaxWriteRequestSize, null, null); + writer.WriteProperty(options, PropReadPollTimeout, value.ReadPollTimeout, null, null); + writer.WriteProperty(options, PropRemoteCluster, value.RemoteCluster, null, null); + writer.WriteProperty(options, PropSettings, value.Settings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PutAutoFollowPatternRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PutAutoFollowPatternRequest.g.cs index 401ebe53ea4..aab7d3eec3e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PutAutoFollowPatternRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PutAutoFollowPatternRequest.g.cs @@ -33,171 +33,6 @@ public sealed partial class PutAutoFollowPatternRequestParameters : Elastic.Tran public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class PutAutoFollowPatternRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFollowIndexPattern = System.Text.Json.JsonEncodedText.Encode("follow_index_pattern"); - private static readonly System.Text.Json.JsonEncodedText PropLeaderIndexExclusionPatterns = System.Text.Json.JsonEncodedText.Encode("leader_index_exclusion_patterns"); - private static readonly System.Text.Json.JsonEncodedText PropLeaderIndexPatterns = System.Text.Json.JsonEncodedText.Encode("leader_index_patterns"); - private static readonly System.Text.Json.JsonEncodedText PropMaxOutstandingReadRequests = System.Text.Json.JsonEncodedText.Encode("max_outstanding_read_requests"); - private static readonly System.Text.Json.JsonEncodedText PropMaxOutstandingWriteRequests = System.Text.Json.JsonEncodedText.Encode("max_outstanding_write_requests"); - private static readonly System.Text.Json.JsonEncodedText PropMaxReadRequestOperationCount = System.Text.Json.JsonEncodedText.Encode("max_read_request_operation_count"); - private static readonly System.Text.Json.JsonEncodedText PropMaxReadRequestSize = System.Text.Json.JsonEncodedText.Encode("max_read_request_size"); - private static readonly System.Text.Json.JsonEncodedText PropMaxRetryDelay = System.Text.Json.JsonEncodedText.Encode("max_retry_delay"); - private static readonly System.Text.Json.JsonEncodedText PropMaxWriteBufferCount = System.Text.Json.JsonEncodedText.Encode("max_write_buffer_count"); - private static readonly System.Text.Json.JsonEncodedText PropMaxWriteBufferSize = System.Text.Json.JsonEncodedText.Encode("max_write_buffer_size"); - private static readonly System.Text.Json.JsonEncodedText PropMaxWriteRequestOperationCount = System.Text.Json.JsonEncodedText.Encode("max_write_request_operation_count"); - private static readonly System.Text.Json.JsonEncodedText PropMaxWriteRequestSize = System.Text.Json.JsonEncodedText.Encode("max_write_request_size"); - private static readonly System.Text.Json.JsonEncodedText PropReadPollTimeout = System.Text.Json.JsonEncodedText.Encode("read_poll_timeout"); - private static readonly System.Text.Json.JsonEncodedText PropRemoteCluster = System.Text.Json.JsonEncodedText.Encode("remote_cluster"); - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.PutAutoFollowPatternRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFollowIndexPattern = default; - LocalJsonValue?> propLeaderIndexExclusionPatterns = default; - LocalJsonValue?> propLeaderIndexPatterns = default; - LocalJsonValue propMaxOutstandingReadRequests = default; - LocalJsonValue propMaxOutstandingWriteRequests = default; - LocalJsonValue propMaxReadRequestOperationCount = default; - LocalJsonValue propMaxReadRequestSize = default; - LocalJsonValue propMaxRetryDelay = default; - LocalJsonValue propMaxWriteBufferCount = default; - LocalJsonValue propMaxWriteBufferSize = default; - LocalJsonValue propMaxWriteRequestOperationCount = default; - LocalJsonValue propMaxWriteRequestSize = default; - LocalJsonValue propReadPollTimeout = default; - LocalJsonValue propRemoteCluster = default; - LocalJsonValue?> propSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFollowIndexPattern.TryReadProperty(ref reader, options, PropFollowIndexPattern, null)) - { - continue; - } - - if (propLeaderIndexExclusionPatterns.TryReadProperty(ref reader, options, PropLeaderIndexExclusionPatterns, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propLeaderIndexPatterns.TryReadProperty(ref reader, options, PropLeaderIndexPatterns, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propMaxOutstandingReadRequests.TryReadProperty(ref reader, options, PropMaxOutstandingReadRequests, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxOutstandingWriteRequests.TryReadProperty(ref reader, options, PropMaxOutstandingWriteRequests, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxReadRequestOperationCount.TryReadProperty(ref reader, options, PropMaxReadRequestOperationCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxReadRequestSize.TryReadProperty(ref reader, options, PropMaxReadRequestSize, null)) - { - continue; - } - - if (propMaxRetryDelay.TryReadProperty(ref reader, options, PropMaxRetryDelay, null)) - { - continue; - } - - if (propMaxWriteBufferCount.TryReadProperty(ref reader, options, PropMaxWriteBufferCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxWriteBufferSize.TryReadProperty(ref reader, options, PropMaxWriteBufferSize, null)) - { - continue; - } - - if (propMaxWriteRequestOperationCount.TryReadProperty(ref reader, options, PropMaxWriteRequestOperationCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxWriteRequestSize.TryReadProperty(ref reader, options, PropMaxWriteRequestSize, null)) - { - continue; - } - - if (propReadPollTimeout.TryReadProperty(ref reader, options, PropReadPollTimeout, null)) - { - continue; - } - - if (propRemoteCluster.TryReadProperty(ref reader, options, PropRemoteCluster, null)) - { - continue; - } - - if (propSettings.TryReadProperty(ref reader, options, PropSettings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.PutAutoFollowPatternRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FollowIndexPattern = propFollowIndexPattern.Value, - LeaderIndexExclusionPatterns = propLeaderIndexExclusionPatterns.Value, - LeaderIndexPatterns = propLeaderIndexPatterns.Value, - MaxOutstandingReadRequests = propMaxOutstandingReadRequests.Value, - MaxOutstandingWriteRequests = propMaxOutstandingWriteRequests.Value, - MaxReadRequestOperationCount = propMaxReadRequestOperationCount.Value, - MaxReadRequestSize = propMaxReadRequestSize.Value, - MaxRetryDelay = propMaxRetryDelay.Value, - MaxWriteBufferCount = propMaxWriteBufferCount.Value, - MaxWriteBufferSize = propMaxWriteBufferSize.Value, - MaxWriteRequestOperationCount = propMaxWriteRequestOperationCount.Value, - MaxWriteRequestSize = propMaxWriteRequestSize.Value, - ReadPollTimeout = propReadPollTimeout.Value, - RemoteCluster = propRemoteCluster.Value, - Settings = propSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.PutAutoFollowPatternRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFollowIndexPattern, value.FollowIndexPattern, null, null); - writer.WriteProperty(options, PropLeaderIndexExclusionPatterns, value.LeaderIndexExclusionPatterns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropLeaderIndexPatterns, value.LeaderIndexPatterns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMaxOutstandingReadRequests, value.MaxOutstandingReadRequests, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxOutstandingWriteRequests, value.MaxOutstandingWriteRequests, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxReadRequestOperationCount, value.MaxReadRequestOperationCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxReadRequestSize, value.MaxReadRequestSize, null, null); - writer.WriteProperty(options, PropMaxRetryDelay, value.MaxRetryDelay, null, null); - writer.WriteProperty(options, PropMaxWriteBufferCount, value.MaxWriteBufferCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxWriteBufferSize, value.MaxWriteBufferSize, null, null); - writer.WriteProperty(options, PropMaxWriteRequestOperationCount, value.MaxWriteRequestOperationCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxWriteRequestSize, value.MaxWriteRequestSize, null, null); - writer.WriteProperty(options, PropReadPollTimeout, value.ReadPollTimeout, null, null); - writer.WriteProperty(options, PropRemoteCluster, value.RemoteCluster, null, null); - writer.WriteProperty(options, PropSettings, value.Settings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - /// /// /// Create or update auto-follow patterns. @@ -210,7 +45,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// NOTE: Follower indices that were configured automatically before updating an auto-follow pattern will remain unchanged even if they do not match against the new patterns. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.PutAutoFollowPatternRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.PutAutoFollowPatternRequestConverter))] public sealed partial class PutAutoFollowPatternRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PutAutoFollowPatternResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PutAutoFollowPatternResponse.Converters.g.cs new file mode 100644 index 00000000000..4e50d6312f8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PutAutoFollowPatternResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class PutAutoFollowPatternResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.PutAutoFollowPatternResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.PutAutoFollowPatternResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.PutAutoFollowPatternResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PutAutoFollowPatternResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PutAutoFollowPatternResponse.g.cs index f2bbf830201..3155a31a500 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PutAutoFollowPatternResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/PutAutoFollowPatternResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; -internal sealed partial class PutAutoFollowPatternResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.PutAutoFollowPatternResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.PutAutoFollowPatternResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.PutAutoFollowPatternResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.PutAutoFollowPatternResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.PutAutoFollowPatternResponseConverter))] public sealed partial class PutAutoFollowPatternResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeAutoFollowPatternRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeAutoFollowPatternRequest.Converters.g.cs new file mode 100644 index 00000000000..6f51b7639cf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeAutoFollowPatternRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class ResumeAutoFollowPatternRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeAutoFollowPatternRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeAutoFollowPatternRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeAutoFollowPatternRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeAutoFollowPatternRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeAutoFollowPatternRequest.g.cs index d71daca75c5..277acda478a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeAutoFollowPatternRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeAutoFollowPatternRequest.g.cs @@ -35,35 +35,6 @@ public sealed partial class ResumeAutoFollowPatternRequestParameters : Elastic.T public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class ResumeAutoFollowPatternRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeAutoFollowPatternRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeAutoFollowPatternRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeAutoFollowPatternRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Resume an auto-follow pattern. @@ -74,7 +45,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Remote indices created while the pattern was paused will also be followed unless they have been deleted or closed in the interim. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeAutoFollowPatternRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.ResumeAutoFollowPatternRequestConverter))] public sealed partial class ResumeAutoFollowPatternRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeAutoFollowPatternResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeAutoFollowPatternResponse.Converters.g.cs new file mode 100644 index 00000000000..d187fcb9400 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeAutoFollowPatternResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class ResumeAutoFollowPatternResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeAutoFollowPatternResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeAutoFollowPatternResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeAutoFollowPatternResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeAutoFollowPatternResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeAutoFollowPatternResponse.g.cs index f56c55b444e..ef46e2db24b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeAutoFollowPatternResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeAutoFollowPatternResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; -internal sealed partial class ResumeAutoFollowPatternResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeAutoFollowPatternResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeAutoFollowPatternResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeAutoFollowPatternResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeAutoFollowPatternResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.ResumeAutoFollowPatternResponseConverter))] public sealed partial class ResumeAutoFollowPatternResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeFollowRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeFollowRequest.Converters.g.cs new file mode 100644 index 00000000000..2b824d24d0b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeFollowRequest.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class ResumeFollowRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxOutstandingReadRequests = System.Text.Json.JsonEncodedText.Encode("max_outstanding_read_requests"); + private static readonly System.Text.Json.JsonEncodedText PropMaxOutstandingWriteRequests = System.Text.Json.JsonEncodedText.Encode("max_outstanding_write_requests"); + private static readonly System.Text.Json.JsonEncodedText PropMaxReadRequestOperationCount = System.Text.Json.JsonEncodedText.Encode("max_read_request_operation_count"); + private static readonly System.Text.Json.JsonEncodedText PropMaxReadRequestSize = System.Text.Json.JsonEncodedText.Encode("max_read_request_size"); + private static readonly System.Text.Json.JsonEncodedText PropMaxRetryDelay = System.Text.Json.JsonEncodedText.Encode("max_retry_delay"); + private static readonly System.Text.Json.JsonEncodedText PropMaxWriteBufferCount = System.Text.Json.JsonEncodedText.Encode("max_write_buffer_count"); + private static readonly System.Text.Json.JsonEncodedText PropMaxWriteBufferSize = System.Text.Json.JsonEncodedText.Encode("max_write_buffer_size"); + private static readonly System.Text.Json.JsonEncodedText PropMaxWriteRequestOperationCount = System.Text.Json.JsonEncodedText.Encode("max_write_request_operation_count"); + private static readonly System.Text.Json.JsonEncodedText PropMaxWriteRequestSize = System.Text.Json.JsonEncodedText.Encode("max_write_request_size"); + private static readonly System.Text.Json.JsonEncodedText PropReadPollTimeout = System.Text.Json.JsonEncodedText.Encode("read_poll_timeout"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeFollowRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxOutstandingReadRequests = default; + LocalJsonValue propMaxOutstandingWriteRequests = default; + LocalJsonValue propMaxReadRequestOperationCount = default; + LocalJsonValue propMaxReadRequestSize = default; + LocalJsonValue propMaxRetryDelay = default; + LocalJsonValue propMaxWriteBufferCount = default; + LocalJsonValue propMaxWriteBufferSize = default; + LocalJsonValue propMaxWriteRequestOperationCount = default; + LocalJsonValue propMaxWriteRequestSize = default; + LocalJsonValue propReadPollTimeout = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxOutstandingReadRequests.TryReadProperty(ref reader, options, PropMaxOutstandingReadRequests, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxOutstandingWriteRequests.TryReadProperty(ref reader, options, PropMaxOutstandingWriteRequests, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxReadRequestOperationCount.TryReadProperty(ref reader, options, PropMaxReadRequestOperationCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxReadRequestSize.TryReadProperty(ref reader, options, PropMaxReadRequestSize, null)) + { + continue; + } + + if (propMaxRetryDelay.TryReadProperty(ref reader, options, PropMaxRetryDelay, null)) + { + continue; + } + + if (propMaxWriteBufferCount.TryReadProperty(ref reader, options, PropMaxWriteBufferCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxWriteBufferSize.TryReadProperty(ref reader, options, PropMaxWriteBufferSize, null)) + { + continue; + } + + if (propMaxWriteRequestOperationCount.TryReadProperty(ref reader, options, PropMaxWriteRequestOperationCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxWriteRequestSize.TryReadProperty(ref reader, options, PropMaxWriteRequestSize, null)) + { + continue; + } + + if (propReadPollTimeout.TryReadProperty(ref reader, options, PropReadPollTimeout, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeFollowRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxOutstandingReadRequests = propMaxOutstandingReadRequests.Value, + MaxOutstandingWriteRequests = propMaxOutstandingWriteRequests.Value, + MaxReadRequestOperationCount = propMaxReadRequestOperationCount.Value, + MaxReadRequestSize = propMaxReadRequestSize.Value, + MaxRetryDelay = propMaxRetryDelay.Value, + MaxWriteBufferCount = propMaxWriteBufferCount.Value, + MaxWriteBufferSize = propMaxWriteBufferSize.Value, + MaxWriteRequestOperationCount = propMaxWriteRequestOperationCount.Value, + MaxWriteRequestSize = propMaxWriteRequestSize.Value, + ReadPollTimeout = propReadPollTimeout.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeFollowRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxOutstandingReadRequests, value.MaxOutstandingReadRequests, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxOutstandingWriteRequests, value.MaxOutstandingWriteRequests, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxReadRequestOperationCount, value.MaxReadRequestOperationCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxReadRequestSize, value.MaxReadRequestSize, null, null); + writer.WriteProperty(options, PropMaxRetryDelay, value.MaxRetryDelay, null, null); + writer.WriteProperty(options, PropMaxWriteBufferCount, value.MaxWriteBufferCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxWriteBufferSize, value.MaxWriteBufferSize, null, null); + writer.WriteProperty(options, PropMaxWriteRequestOperationCount, value.MaxWriteRequestOperationCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxWriteRequestSize, value.MaxWriteRequestSize, null, null); + writer.WriteProperty(options, PropReadPollTimeout, value.ReadPollTimeout, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeFollowRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeFollowRequest.g.cs index 474e5aad32a..c92ea623a24 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeFollowRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeFollowRequest.g.cs @@ -33,126 +33,6 @@ public sealed partial class ResumeFollowRequestParameters : Elastic.Transport.Re public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class ResumeFollowRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxOutstandingReadRequests = System.Text.Json.JsonEncodedText.Encode("max_outstanding_read_requests"); - private static readonly System.Text.Json.JsonEncodedText PropMaxOutstandingWriteRequests = System.Text.Json.JsonEncodedText.Encode("max_outstanding_write_requests"); - private static readonly System.Text.Json.JsonEncodedText PropMaxReadRequestOperationCount = System.Text.Json.JsonEncodedText.Encode("max_read_request_operation_count"); - private static readonly System.Text.Json.JsonEncodedText PropMaxReadRequestSize = System.Text.Json.JsonEncodedText.Encode("max_read_request_size"); - private static readonly System.Text.Json.JsonEncodedText PropMaxRetryDelay = System.Text.Json.JsonEncodedText.Encode("max_retry_delay"); - private static readonly System.Text.Json.JsonEncodedText PropMaxWriteBufferCount = System.Text.Json.JsonEncodedText.Encode("max_write_buffer_count"); - private static readonly System.Text.Json.JsonEncodedText PropMaxWriteBufferSize = System.Text.Json.JsonEncodedText.Encode("max_write_buffer_size"); - private static readonly System.Text.Json.JsonEncodedText PropMaxWriteRequestOperationCount = System.Text.Json.JsonEncodedText.Encode("max_write_request_operation_count"); - private static readonly System.Text.Json.JsonEncodedText PropMaxWriteRequestSize = System.Text.Json.JsonEncodedText.Encode("max_write_request_size"); - private static readonly System.Text.Json.JsonEncodedText PropReadPollTimeout = System.Text.Json.JsonEncodedText.Encode("read_poll_timeout"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeFollowRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxOutstandingReadRequests = default; - LocalJsonValue propMaxOutstandingWriteRequests = default; - LocalJsonValue propMaxReadRequestOperationCount = default; - LocalJsonValue propMaxReadRequestSize = default; - LocalJsonValue propMaxRetryDelay = default; - LocalJsonValue propMaxWriteBufferCount = default; - LocalJsonValue propMaxWriteBufferSize = default; - LocalJsonValue propMaxWriteRequestOperationCount = default; - LocalJsonValue propMaxWriteRequestSize = default; - LocalJsonValue propReadPollTimeout = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxOutstandingReadRequests.TryReadProperty(ref reader, options, PropMaxOutstandingReadRequests, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxOutstandingWriteRequests.TryReadProperty(ref reader, options, PropMaxOutstandingWriteRequests, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxReadRequestOperationCount.TryReadProperty(ref reader, options, PropMaxReadRequestOperationCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxReadRequestSize.TryReadProperty(ref reader, options, PropMaxReadRequestSize, null)) - { - continue; - } - - if (propMaxRetryDelay.TryReadProperty(ref reader, options, PropMaxRetryDelay, null)) - { - continue; - } - - if (propMaxWriteBufferCount.TryReadProperty(ref reader, options, PropMaxWriteBufferCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxWriteBufferSize.TryReadProperty(ref reader, options, PropMaxWriteBufferSize, null)) - { - continue; - } - - if (propMaxWriteRequestOperationCount.TryReadProperty(ref reader, options, PropMaxWriteRequestOperationCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxWriteRequestSize.TryReadProperty(ref reader, options, PropMaxWriteRequestSize, null)) - { - continue; - } - - if (propReadPollTimeout.TryReadProperty(ref reader, options, PropReadPollTimeout, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeFollowRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxOutstandingReadRequests = propMaxOutstandingReadRequests.Value, - MaxOutstandingWriteRequests = propMaxOutstandingWriteRequests.Value, - MaxReadRequestOperationCount = propMaxReadRequestOperationCount.Value, - MaxReadRequestSize = propMaxReadRequestSize.Value, - MaxRetryDelay = propMaxRetryDelay.Value, - MaxWriteBufferCount = propMaxWriteBufferCount.Value, - MaxWriteBufferSize = propMaxWriteBufferSize.Value, - MaxWriteRequestOperationCount = propMaxWriteRequestOperationCount.Value, - MaxWriteRequestSize = propMaxWriteRequestSize.Value, - ReadPollTimeout = propReadPollTimeout.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeFollowRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxOutstandingReadRequests, value.MaxOutstandingReadRequests, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxOutstandingWriteRequests, value.MaxOutstandingWriteRequests, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxReadRequestOperationCount, value.MaxReadRequestOperationCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxReadRequestSize, value.MaxReadRequestSize, null, null); - writer.WriteProperty(options, PropMaxRetryDelay, value.MaxRetryDelay, null, null); - writer.WriteProperty(options, PropMaxWriteBufferCount, value.MaxWriteBufferCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxWriteBufferSize, value.MaxWriteBufferSize, null, null); - writer.WriteProperty(options, PropMaxWriteRequestOperationCount, value.MaxWriteRequestOperationCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxWriteRequestSize, value.MaxWriteRequestSize, null, null); - writer.WriteProperty(options, PropReadPollTimeout, value.ReadPollTimeout, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Resume a follower. @@ -162,7 +42,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// When this API returns, the follower index will resume fetching operations from the leader index. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeFollowRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.ResumeFollowRequestConverter))] public sealed partial class ResumeFollowRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeFollowResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeFollowResponse.Converters.g.cs new file mode 100644 index 00000000000..9a10c44eb22 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeFollowResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class ResumeFollowResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeFollowResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeFollowResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeFollowResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeFollowResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeFollowResponse.g.cs index f73f8315d12..3e5f13f4981 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeFollowResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/ResumeFollowResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; -internal sealed partial class ResumeFollowResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeFollowResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeFollowResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeFollowResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.ResumeFollowResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.ResumeFollowResponseConverter))] public sealed partial class ResumeFollowResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/UnfollowRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/UnfollowRequest.Converters.g.cs new file mode 100644 index 00000000000..5fc6d325fbe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/UnfollowRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class UnfollowRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.UnfollowRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.UnfollowRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.UnfollowRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/UnfollowRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/UnfollowRequest.g.cs index 8ad3f4cdf52..1e842769656 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/UnfollowRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/UnfollowRequest.g.cs @@ -35,35 +35,6 @@ public sealed partial class UnfollowRequestParameters : Elastic.Transport.Reques public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class UnfollowRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.UnfollowRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.UnfollowRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.UnfollowRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Unfollow an index. @@ -78,7 +49,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Currently cross-cluster replication does not support converting an existing regular index to a follower index. Converting a follower index to a regular index is an irreversible operation. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.UnfollowRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.UnfollowRequestConverter))] public sealed partial class UnfollowRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/UnfollowResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/UnfollowResponse.Converters.g.cs new file mode 100644 index 00000000000..3808725fc45 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/UnfollowResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class UnfollowResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.UnfollowResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.UnfollowResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.UnfollowResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/UnfollowResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/UnfollowResponse.g.cs index 5edf4922a63..e1940d29fdd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/UnfollowResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CrossClusterReplication/UnfollowResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; -internal sealed partial class UnfollowResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.UnfollowResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.UnfollowResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.UnfollowResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.UnfollowResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.UnfollowResponseConverter))] public sealed partial class UnfollowResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DanglingIndices/ListDanglingIndicesRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DanglingIndices/ListDanglingIndicesRequest.Converters.g.cs new file mode 100644 index 00000000000..81d5076580e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DanglingIndices/ListDanglingIndicesRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.DanglingIndices.Json; + +public sealed partial class ListDanglingIndicesRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.DanglingIndices.ListDanglingIndicesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.DanglingIndices.ListDanglingIndicesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DanglingIndices.ListDanglingIndicesRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DanglingIndices/ListDanglingIndicesRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DanglingIndices/ListDanglingIndicesRequest.g.cs index ed8bd29b0fc..f5188996e6f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DanglingIndices/ListDanglingIndicesRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DanglingIndices/ListDanglingIndicesRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class ListDanglingIndicesRequestParameters : Elastic.Trans { } -internal sealed partial class ListDanglingIndicesRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.DanglingIndices.ListDanglingIndicesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.DanglingIndices.ListDanglingIndicesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DanglingIndices.ListDanglingIndicesRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get the dangling indices. @@ -68,7 +39,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Use this API to list dangling indices, which you can then import or delete. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.DanglingIndices.ListDanglingIndicesRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.DanglingIndices.Json.ListDanglingIndicesRequestConverter))] public sealed partial class ListDanglingIndicesRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DanglingIndices/ListDanglingIndicesResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DanglingIndices/ListDanglingIndicesResponse.Converters.g.cs new file mode 100644 index 00000000000..01827a77e49 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DanglingIndices/ListDanglingIndicesResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.DanglingIndices.Json; + +public sealed partial class ListDanglingIndicesResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDanglingIndices = System.Text.Json.JsonEncodedText.Encode("dangling_indices"); + + public override Elastic.Clients.Elasticsearch.DanglingIndices.ListDanglingIndicesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propDanglingIndices = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDanglingIndices.TryReadProperty(ref reader, options, PropDanglingIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.DanglingIndices.ListDanglingIndicesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DanglingIndices = propDanglingIndices.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DanglingIndices.ListDanglingIndicesResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDanglingIndices, value.DanglingIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DanglingIndices/ListDanglingIndicesResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DanglingIndices/ListDanglingIndicesResponse.g.cs index 1acaa5d89a7..3bc251d8047 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DanglingIndices/ListDanglingIndicesResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DanglingIndices/ListDanglingIndicesResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.DanglingIndices; -internal sealed partial class ListDanglingIndicesResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDanglingIndices = System.Text.Json.JsonEncodedText.Encode("dangling_indices"); - - public override Elastic.Clients.Elasticsearch.DanglingIndices.ListDanglingIndicesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propDanglingIndices = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDanglingIndices.TryReadProperty(ref reader, options, PropDanglingIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.DanglingIndices.ListDanglingIndicesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DanglingIndices = propDanglingIndices.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DanglingIndices.ListDanglingIndicesResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDanglingIndices, value.DanglingIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.DanglingIndices.ListDanglingIndicesResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.DanglingIndices.Json.ListDanglingIndicesResponseConverter))] public sealed partial class ListDanglingIndicesResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal ListDanglingIndicesResponse(Elastic.Clients.Elasticsearch.Serialization public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection DanglingIndices { get; set; } +System.Collections.Generic.IReadOnlyCollection DanglingIndices { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRequest.Converters.g.cs new file mode 100644 index 00000000000..736e86dc6d7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRequest.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class DeleteByQueryRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxDocs = System.Text.Json.JsonEncodedText.Encode("max_docs"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + 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"); + + public override Elastic.Clients.Elasticsearch.DeleteByQueryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxDocs = default; + LocalJsonValue propQuery = default; + LocalJsonValue propSlice = default; + LocalJsonValue?> propSort = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxDocs.TryReadProperty(ref reader, options, PropMaxDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propSlice.TryReadProperty(ref reader, options, PropSlice, null)) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.DeleteByQueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxDocs = propMaxDocs.Value, + Query = propQuery.Value, + Slice = propSlice.Value, + Sort = propSort.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DeleteByQueryRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxDocs, value.MaxDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropSlice, value.Slice, null, null); + writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRequest.g.cs index fc4bda3ee80..5a951967d07 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRequest.g.cs @@ -187,13 +187,6 @@ public sealed partial class DeleteByQueryRequestParameters : Elastic.Transport.R /// public Elastic.Clients.Elasticsearch.Slices? Slices { get => Q("slices"); set => Q("slices", value); } - /// - /// - /// A comma-separated list of <field>:<direction> pairs. - /// - /// - public System.Collections.Generic.ICollection? Sort { get => Q?>("sort"); set => Q("sort", value); } - /// /// /// The specific tag of the request for logging and statistical purposes. @@ -248,63 +241,6 @@ public sealed partial class DeleteByQueryRequestParameters : Elastic.Transport.R public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } } -internal sealed partial class DeleteByQueryRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxDocs = System.Text.Json.JsonEncodedText.Encode("max_docs"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropSlice = System.Text.Json.JsonEncodedText.Encode("slice"); - - public override Elastic.Clients.Elasticsearch.DeleteByQueryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxDocs = default; - LocalJsonValue propQuery = default; - LocalJsonValue propSlice = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxDocs.TryReadProperty(ref reader, options, PropMaxDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propSlice.TryReadProperty(ref reader, options, PropSlice, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.DeleteByQueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxDocs = propMaxDocs.Value, - Query = propQuery.Value, - Slice = propSlice.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DeleteByQueryRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxDocs, value.MaxDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropSlice, value.Slice, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Delete documents. @@ -457,7 +393,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The get task status API will continue to list the delete by query task until this task checks that it has been cancelled and terminates itself. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.DeleteByQueryRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.DeleteByQueryRequestConverter))] public sealed partial class DeleteByQueryRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -658,13 +594,6 @@ internal DeleteByQueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonCo /// public Elastic.Clients.Elasticsearch.Slices? Slices { get => Q("slices"); set => Q("slices", value); } - /// - /// - /// A comma-separated list of <field>:<direction> pairs. - /// - /// - public System.Collections.Generic.ICollection? Sort { get => Q?>("sort"); set => Q("sort", value); } - /// /// /// The specific tag of the request for logging and statistical purposes. @@ -738,6 +667,13 @@ internal DeleteByQueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonCo /// /// public Elastic.Clients.Elasticsearch.SlicedScroll? Slice { get; set; } + + /// + /// + /// A sort object that specifies the order of deleted documents. + /// + /// + public System.Collections.Generic.ICollection? Sort { get; set; } } /// @@ -1199,28 +1135,6 @@ public Elastic.Clients.Elasticsearch.DeleteByQueryRequestDescriptor Slices(Syste return this; } - /// - /// - /// A comma-separated list of <field>:<direction> pairs. - /// - /// - public Elastic.Clients.Elasticsearch.DeleteByQueryRequestDescriptor Sort(System.Collections.Generic.ICollection? value) - { - Instance.Sort = value; - return this; - } - - /// - /// - /// A comma-separated list of <field>:<direction> pairs. - /// - /// - public Elastic.Clients.Elasticsearch.DeleteByQueryRequestDescriptor Sort(params string[] values) - { - Instance.Sort = [.. values]; - return this; - } - /// /// /// The specific tag of the request for logging and statistical purposes. @@ -1386,6 +1300,62 @@ public Elastic.Clients.Elasticsearch.DeleteByQueryRequestDescriptor Slice(Sys return this; } + /// + /// + /// A sort object that specifies the order of deleted documents. + /// + /// + public Elastic.Clients.Elasticsearch.DeleteByQueryRequestDescriptor Sort(System.Collections.Generic.ICollection? value) + { + Instance.Sort = value; + return this; + } + + /// + /// + /// A sort object that specifies the order of deleted documents. + /// + /// + public Elastic.Clients.Elasticsearch.DeleteByQueryRequestDescriptor Sort(params Elastic.Clients.Elasticsearch.SortOptions[] values) + { + Instance.Sort = [.. values]; + return this; + } + + /// + /// + /// A sort object that specifies the order of deleted documents. + /// + /// + public Elastic.Clients.Elasticsearch.DeleteByQueryRequestDescriptor Sort(params System.Action[] actions) + { + var items = new System.Collections.Generic.List(); + foreach (var action in actions) + { + items.Add(Elastic.Clients.Elasticsearch.SortOptionsDescriptor.Build(action)); + } + + Instance.Sort = items; + return this; + } + + /// + /// + /// A sort object that specifies the order of deleted documents. + /// + /// + public Elastic.Clients.Elasticsearch.DeleteByQueryRequestDescriptor Sort(params System.Action>[] actions) + { + var items = new System.Collections.Generic.List(); + foreach (var action in actions) + { + items.Add(Elastic.Clients.Elasticsearch.SortOptionsDescriptor.Build(action)); + } + + Instance.Sort = items; + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.DeleteByQueryRequest Build(System.Action action) { @@ -1895,28 +1865,6 @@ public Elastic.Clients.Elasticsearch.DeleteByQueryRequestDescriptor S return this; } - /// - /// - /// A comma-separated list of <field>:<direction> pairs. - /// - /// - public Elastic.Clients.Elasticsearch.DeleteByQueryRequestDescriptor Sort(System.Collections.Generic.ICollection? value) - { - Instance.Sort = value; - return this; - } - - /// - /// - /// A comma-separated list of <field>:<direction> pairs. - /// - /// - public Elastic.Clients.Elasticsearch.DeleteByQueryRequestDescriptor Sort(params string[] values) - { - Instance.Sort = [.. values]; - return this; - } - /// /// /// The specific tag of the request for logging and statistical purposes. @@ -2060,6 +2008,45 @@ public Elastic.Clients.Elasticsearch.DeleteByQueryRequestDescriptor S return this; } + /// + /// + /// A sort object that specifies the order of deleted documents. + /// + /// + public Elastic.Clients.Elasticsearch.DeleteByQueryRequestDescriptor Sort(System.Collections.Generic.ICollection? value) + { + Instance.Sort = value; + return this; + } + + /// + /// + /// A sort object that specifies the order of deleted documents. + /// + /// + public Elastic.Clients.Elasticsearch.DeleteByQueryRequestDescriptor Sort(params Elastic.Clients.Elasticsearch.SortOptions[] values) + { + Instance.Sort = [.. values]; + return this; + } + + /// + /// + /// A sort object that specifies the order of deleted documents. + /// + /// + public Elastic.Clients.Elasticsearch.DeleteByQueryRequestDescriptor Sort(params System.Action>[] actions) + { + var items = new System.Collections.Generic.List(); + foreach (var action in actions) + { + items.Add(Elastic.Clients.Elasticsearch.SortOptionsDescriptor.Build(action)); + } + + Instance.Sort = items; + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.DeleteByQueryRequest Build(System.Action> action) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryResponse.Converters.g.cs new file mode 100644 index 00000000000..7564291897b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryResponse.Converters.g.cs @@ -0,0 +1,198 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class DeleteByQueryResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBatches = System.Text.Json.JsonEncodedText.Encode("batches"); + private static readonly System.Text.Json.JsonEncodedText PropDeleted = System.Text.Json.JsonEncodedText.Encode("deleted"); + private static readonly System.Text.Json.JsonEncodedText PropFailures = System.Text.Json.JsonEncodedText.Encode("failures"); + private static readonly System.Text.Json.JsonEncodedText PropNoops = System.Text.Json.JsonEncodedText.Encode("noops"); + private static readonly System.Text.Json.JsonEncodedText PropRequestsPerSecond = System.Text.Json.JsonEncodedText.Encode("requests_per_second"); + private static readonly System.Text.Json.JsonEncodedText PropRetries = System.Text.Json.JsonEncodedText.Encode("retries"); + private static readonly System.Text.Json.JsonEncodedText PropSliceId = System.Text.Json.JsonEncodedText.Encode("slice_id"); + private static readonly System.Text.Json.JsonEncodedText PropTask = System.Text.Json.JsonEncodedText.Encode("task"); + private static readonly System.Text.Json.JsonEncodedText PropThrottled = System.Text.Json.JsonEncodedText.Encode("throttled"); + private static readonly System.Text.Json.JsonEncodedText PropThrottledMillis = System.Text.Json.JsonEncodedText.Encode("throttled_millis"); + private static readonly System.Text.Json.JsonEncodedText PropThrottledUntil = System.Text.Json.JsonEncodedText.Encode("throttled_until"); + private static readonly System.Text.Json.JsonEncodedText PropThrottledUntilMillis = System.Text.Json.JsonEncodedText.Encode("throttled_until_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); + private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + private static readonly System.Text.Json.JsonEncodedText PropVersionConflicts = System.Text.Json.JsonEncodedText.Encode("version_conflicts"); + + public override Elastic.Clients.Elasticsearch.DeleteByQueryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBatches = default; + LocalJsonValue propDeleted = default; + LocalJsonValue?> propFailures = default; + LocalJsonValue propNoops = default; + LocalJsonValue propRequestsPerSecond = default; + LocalJsonValue propRetries = default; + LocalJsonValue propSliceId = default; + LocalJsonValue propTask = default; + LocalJsonValue propThrottled = default; + LocalJsonValue propThrottledMillis = default; + LocalJsonValue propThrottledUntil = default; + LocalJsonValue propThrottledUntilMillis = default; + LocalJsonValue propTimedOut = default; + LocalJsonValue propTook = default; + LocalJsonValue propTotal = default; + LocalJsonValue propVersionConflicts = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBatches.TryReadProperty(ref reader, options, PropBatches, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDeleted.TryReadProperty(ref reader, options, PropDeleted, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFailures.TryReadProperty(ref reader, options, PropFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propNoops.TryReadProperty(ref reader, options, PropNoops, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRequestsPerSecond.TryReadProperty(ref reader, options, PropRequestsPerSecond, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRetries.TryReadProperty(ref reader, options, PropRetries, null)) + { + continue; + } + + if (propSliceId.TryReadProperty(ref reader, options, PropSliceId, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTask.TryReadProperty(ref reader, options, PropTask, null)) + { + continue; + } + + if (propThrottled.TryReadProperty(ref reader, options, PropThrottled, null)) + { + continue; + } + + if (propThrottledMillis.TryReadProperty(ref reader, options, PropThrottledMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propThrottledUntil.TryReadProperty(ref reader, options, PropThrottledUntil, null)) + { + continue; + } + + if (propThrottledUntilMillis.TryReadProperty(ref reader, options, PropThrottledUntilMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTook.TryReadProperty(ref reader, options, PropTook, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propVersionConflicts.TryReadProperty(ref reader, options, PropVersionConflicts, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.DeleteByQueryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Batches = propBatches.Value, + Deleted = propDeleted.Value, + Failures = propFailures.Value, + Noops = propNoops.Value, + RequestsPerSecond = propRequestsPerSecond.Value, + Retries = propRetries.Value, + SliceId = propSliceId.Value, + Task = propTask.Value, + Throttled = propThrottled.Value, + ThrottledMillis = propThrottledMillis.Value, + ThrottledUntil = propThrottledUntil.Value, + ThrottledUntilMillis = propThrottledUntilMillis.Value, + TimedOut = propTimedOut.Value, + Took = propTook.Value, + Total = propTotal.Value, + VersionConflicts = propVersionConflicts.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DeleteByQueryResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBatches, value.Batches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDeleted, value.Deleted, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFailures, value.Failures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropNoops, value.Noops, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRequestsPerSecond, value.RequestsPerSecond, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRetries, value.Retries, null, null); + writer.WriteProperty(options, PropSliceId, value.SliceId, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTask, value.Task, null, null); + writer.WriteProperty(options, PropThrottled, value.Throttled, null, null); + writer.WriteProperty(options, PropThrottledMillis, value.ThrottledMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropThrottledUntil, value.ThrottledUntil, null, null); + writer.WriteProperty(options, PropThrottledUntilMillis, value.ThrottledUntilMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTook, value.Took, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTotal, value.Total, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVersionConflicts, value.VersionConflicts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryResponse.g.cs index ff5cd28c6f5..1858a8d5d78 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryResponse.g.cs @@ -23,181 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class DeleteByQueryResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBatches = System.Text.Json.JsonEncodedText.Encode("batches"); - private static readonly System.Text.Json.JsonEncodedText PropDeleted = System.Text.Json.JsonEncodedText.Encode("deleted"); - private static readonly System.Text.Json.JsonEncodedText PropFailures = System.Text.Json.JsonEncodedText.Encode("failures"); - private static readonly System.Text.Json.JsonEncodedText PropNoops = System.Text.Json.JsonEncodedText.Encode("noops"); - private static readonly System.Text.Json.JsonEncodedText PropRequestsPerSecond = System.Text.Json.JsonEncodedText.Encode("requests_per_second"); - private static readonly System.Text.Json.JsonEncodedText PropRetries = System.Text.Json.JsonEncodedText.Encode("retries"); - private static readonly System.Text.Json.JsonEncodedText PropSliceId = System.Text.Json.JsonEncodedText.Encode("slice_id"); - private static readonly System.Text.Json.JsonEncodedText PropTask = System.Text.Json.JsonEncodedText.Encode("task"); - private static readonly System.Text.Json.JsonEncodedText PropThrottled = System.Text.Json.JsonEncodedText.Encode("throttled"); - private static readonly System.Text.Json.JsonEncodedText PropThrottledMillis = System.Text.Json.JsonEncodedText.Encode("throttled_millis"); - private static readonly System.Text.Json.JsonEncodedText PropThrottledUntil = System.Text.Json.JsonEncodedText.Encode("throttled_until"); - private static readonly System.Text.Json.JsonEncodedText PropThrottledUntilMillis = System.Text.Json.JsonEncodedText.Encode("throttled_until_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); - private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - private static readonly System.Text.Json.JsonEncodedText PropVersionConflicts = System.Text.Json.JsonEncodedText.Encode("version_conflicts"); - - public override Elastic.Clients.Elasticsearch.DeleteByQueryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBatches = default; - LocalJsonValue propDeleted = default; - LocalJsonValue?> propFailures = default; - LocalJsonValue propNoops = default; - LocalJsonValue propRequestsPerSecond = default; - LocalJsonValue propRetries = default; - LocalJsonValue propSliceId = default; - LocalJsonValue propTask = default; - LocalJsonValue propThrottled = default; - LocalJsonValue propThrottledMillis = default; - LocalJsonValue propThrottledUntil = default; - LocalJsonValue propThrottledUntilMillis = default; - LocalJsonValue propTimedOut = default; - LocalJsonValue propTook = default; - LocalJsonValue propTotal = default; - LocalJsonValue propVersionConflicts = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBatches.TryReadProperty(ref reader, options, PropBatches, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDeleted.TryReadProperty(ref reader, options, PropDeleted, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFailures.TryReadProperty(ref reader, options, PropFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propNoops.TryReadProperty(ref reader, options, PropNoops, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRequestsPerSecond.TryReadProperty(ref reader, options, PropRequestsPerSecond, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRetries.TryReadProperty(ref reader, options, PropRetries, null)) - { - continue; - } - - if (propSliceId.TryReadProperty(ref reader, options, PropSliceId, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTask.TryReadProperty(ref reader, options, PropTask, null)) - { - continue; - } - - if (propThrottled.TryReadProperty(ref reader, options, PropThrottled, null)) - { - continue; - } - - if (propThrottledMillis.TryReadProperty(ref reader, options, PropThrottledMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propThrottledUntil.TryReadProperty(ref reader, options, PropThrottledUntil, null)) - { - continue; - } - - if (propThrottledUntilMillis.TryReadProperty(ref reader, options, PropThrottledUntilMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTook.TryReadProperty(ref reader, options, PropTook, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propVersionConflicts.TryReadProperty(ref reader, options, PropVersionConflicts, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.DeleteByQueryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Batches = propBatches.Value, - Deleted = propDeleted.Value, - Failures = propFailures.Value, - Noops = propNoops.Value, - RequestsPerSecond = propRequestsPerSecond.Value, - Retries = propRetries.Value, - SliceId = propSliceId.Value, - Task = propTask.Value, - Throttled = propThrottled.Value, - ThrottledMillis = propThrottledMillis.Value, - ThrottledUntil = propThrottledUntil.Value, - ThrottledUntilMillis = propThrottledUntilMillis.Value, - TimedOut = propTimedOut.Value, - Took = propTook.Value, - Total = propTotal.Value, - VersionConflicts = propVersionConflicts.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DeleteByQueryResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBatches, value.Batches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDeleted, value.Deleted, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFailures, value.Failures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropNoops, value.Noops, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRequestsPerSecond, value.RequestsPerSecond, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRetries, value.Retries, null, null); - writer.WriteProperty(options, PropSliceId, value.SliceId, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTask, value.Task, null, null); - writer.WriteProperty(options, PropThrottled, value.Throttled, null, null); - writer.WriteProperty(options, PropThrottledMillis, value.ThrottledMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropThrottledUntil, value.ThrottledUntil, null, null); - writer.WriteProperty(options, PropThrottledUntilMillis, value.ThrottledUntilMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTook, value.Took, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTotal, value.Total, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropVersionConflicts, value.VersionConflicts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.DeleteByQueryResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.DeleteByQueryResponseConverter))] public sealed partial class DeleteByQueryResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRethrottleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRethrottleRequest.Converters.g.cs new file mode 100644 index 00000000000..c4565300fae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRethrottleRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class DeleteByQueryRethrottleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.DeleteByQueryRethrottleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.DeleteByQueryRethrottleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DeleteByQueryRethrottleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRethrottleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRethrottleRequest.g.cs index c2e17d4006d..5ed6555219e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRethrottleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRethrottleRequest.g.cs @@ -34,35 +34,6 @@ public sealed partial class DeleteByQueryRethrottleRequestParameters : Elastic.T public float? RequestsPerSecond { get => Q("requests_per_second"); set => Q("requests_per_second", value); } } -internal sealed partial class DeleteByQueryRethrottleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.DeleteByQueryRethrottleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.DeleteByQueryRethrottleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DeleteByQueryRethrottleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Throttle a delete by query operation. @@ -72,7 +43,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Rethrottling that speeds up the query takes effect immediately but rethrotting that slows down the query takes effect after completing the current batch to prevent scroll timeouts. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.DeleteByQueryRethrottleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.DeleteByQueryRethrottleRequestConverter))] public sealed partial class DeleteByQueryRethrottleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRethrottleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRethrottleResponse.Converters.g.cs new file mode 100644 index 00000000000..eb82bd2fb64 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRethrottleResponse.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class DeleteByQueryRethrottleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNodeFailures = System.Text.Json.JsonEncodedText.Encode("node_failures"); + private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); + private static readonly System.Text.Json.JsonEncodedText PropTaskFailures = System.Text.Json.JsonEncodedText.Encode("task_failures"); + private static readonly System.Text.Json.JsonEncodedText PropTasks = System.Text.Json.JsonEncodedText.Encode("tasks"); + + public override Elastic.Clients.Elasticsearch.DeleteByQueryRethrottleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propNodeFailures = default; + LocalJsonValue?> propNodes = default; + LocalJsonValue?> propTaskFailures = default; + LocalJsonValue propTasks = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNodeFailures.TryReadProperty(ref reader, options, PropNodeFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propTaskFailures.TryReadProperty(ref reader, options, PropTaskFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTasks.TryReadProperty(ref reader, options, PropTasks, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.DeleteByQueryRethrottleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + NodeFailures = propNodeFailures.Value, + Nodes = propNodes.Value, + TaskFailures = propTaskFailures.Value, + Tasks = propTasks.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DeleteByQueryRethrottleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNodeFailures, value.NodeFailures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropTaskFailures, value.TaskFailures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTasks, value.Tasks, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRethrottleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRethrottleResponse.g.cs index 3dd0f0cd7d3..44de48ef6bd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRethrottleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRethrottleResponse.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class DeleteByQueryRethrottleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNodeFailures = System.Text.Json.JsonEncodedText.Encode("node_failures"); - private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); - private static readonly System.Text.Json.JsonEncodedText PropTaskFailures = System.Text.Json.JsonEncodedText.Encode("task_failures"); - private static readonly System.Text.Json.JsonEncodedText PropTasks = System.Text.Json.JsonEncodedText.Encode("tasks"); - - public override Elastic.Clients.Elasticsearch.DeleteByQueryRethrottleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propNodeFailures = default; - LocalJsonValue?> propNodes = default; - LocalJsonValue?> propTaskFailures = default; - LocalJsonValue propTasks = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNodeFailures.TryReadProperty(ref reader, options, PropNodeFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propTaskFailures.TryReadProperty(ref reader, options, PropTaskFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTasks.TryReadProperty(ref reader, options, PropTasks, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.DeleteByQueryRethrottleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - NodeFailures = propNodeFailures.Value, - Nodes = propNodes.Value, - TaskFailures = propTaskFailures.Value, - Tasks = propTasks.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DeleteByQueryRethrottleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNodeFailures, value.NodeFailures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropTaskFailures, value.TaskFailures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTasks, value.Tasks, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.DeleteByQueryRethrottleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.DeleteByQueryRethrottleResponseConverter))] public sealed partial class DeleteByQueryRethrottleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteRequest.Converters.g.cs new file mode 100644 index 00000000000..1d282510458 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class DeleteRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.DeleteRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.DeleteRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DeleteRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteRequest.g.cs index a37c40e5f44..53c62dcdfbc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteRequest.g.cs @@ -92,35 +92,6 @@ public sealed partial class DeleteRequestParameters : Elastic.Transport.RequestP public Elastic.Clients.Elasticsearch.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } } -internal sealed partial class DeleteRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.DeleteRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.DeleteRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DeleteRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete a document. @@ -176,7 +147,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// It then gets redirected into the primary shard within that ID group and replicated (if needed) to shard replicas within that ID group. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.DeleteRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.DeleteRequestConverter))] public partial class DeleteRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteResponse.Converters.g.cs new file mode 100644 index 00000000000..d0621b4f2da --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteResponse.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class DeleteResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropForcedRefresh = System.Text.Json.JsonEncodedText.Encode("forced_refresh"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); + private static readonly System.Text.Json.JsonEncodedText PropPrimaryTerm = System.Text.Json.JsonEncodedText.Encode("_primary_term"); + private static readonly System.Text.Json.JsonEncodedText PropResult = System.Text.Json.JsonEncodedText.Encode("result"); + private static readonly System.Text.Json.JsonEncodedText PropSeqNo = System.Text.Json.JsonEncodedText.Encode("_seq_no"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("_version"); + + public override Elastic.Clients.Elasticsearch.DeleteResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propForcedRefresh = default; + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + LocalJsonValue propPrimaryTerm = default; + LocalJsonValue propResult = default; + LocalJsonValue propSeqNo = default; + LocalJsonValue propShards = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propForcedRefresh.TryReadProperty(ref reader, options, PropForcedRefresh, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propPrimaryTerm.TryReadProperty(ref reader, options, PropPrimaryTerm, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propResult.TryReadProperty(ref reader, options, PropResult, null)) + { + continue; + } + + if (propSeqNo.TryReadProperty(ref reader, options, PropSeqNo, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.DeleteResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ForcedRefresh = propForcedRefresh.Value, + Id = propId.Value, + Index = propIndex.Value, + PrimaryTerm = propPrimaryTerm.Value, + Result = propResult.Value, + SeqNo = propSeqNo.Value, + Shards = propShards.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DeleteResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropForcedRefresh, value.ForcedRefresh, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropPrimaryTerm, value.PrimaryTerm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropResult, value.Result, null, null); + writer.WriteProperty(options, PropSeqNo, value.SeqNo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteResponse.g.cs index 139eb39770e..6790f3fac43 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteResponse.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class DeleteResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropForcedRefresh = System.Text.Json.JsonEncodedText.Encode("forced_refresh"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); - private static readonly System.Text.Json.JsonEncodedText PropPrimaryTerm = System.Text.Json.JsonEncodedText.Encode("_primary_term"); - private static readonly System.Text.Json.JsonEncodedText PropResult = System.Text.Json.JsonEncodedText.Encode("result"); - private static readonly System.Text.Json.JsonEncodedText PropSeqNo = System.Text.Json.JsonEncodedText.Encode("_seq_no"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("_version"); - - public override Elastic.Clients.Elasticsearch.DeleteResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propForcedRefresh = default; - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - LocalJsonValue propPrimaryTerm = default; - LocalJsonValue propResult = default; - LocalJsonValue propSeqNo = default; - LocalJsonValue propShards = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propForcedRefresh.TryReadProperty(ref reader, options, PropForcedRefresh, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propPrimaryTerm.TryReadProperty(ref reader, options, PropPrimaryTerm, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propResult.TryReadProperty(ref reader, options, PropResult, null)) - { - continue; - } - - if (propSeqNo.TryReadProperty(ref reader, options, PropSeqNo, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.DeleteResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ForcedRefresh = propForcedRefresh.Value, - Id = propId.Value, - Index = propIndex.Value, - PrimaryTerm = propPrimaryTerm.Value, - Result = propResult.Value, - SeqNo = propSeqNo.Value, - Shards = propShards.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DeleteResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropForcedRefresh, value.ForcedRefresh, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropPrimaryTerm, value.PrimaryTerm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropResult, value.Result, null, null); - writer.WriteProperty(options, PropSeqNo, value.SeqNo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.DeleteResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.DeleteResponseConverter))] public sealed partial class DeleteResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteScriptRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteScriptRequest.Converters.g.cs new file mode 100644 index 00000000000..89e40f663ef --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteScriptRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class DeleteScriptRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.DeleteScriptRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.DeleteScriptRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DeleteScriptRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteScriptRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteScriptRequest.g.cs index 39fbf6bf0a2..f77effddc01 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteScriptRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteScriptRequest.g.cs @@ -44,42 +44,13 @@ public sealed partial class DeleteScriptRequestParameters : Elastic.Transport.Re public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class DeleteScriptRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.DeleteScriptRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.DeleteScriptRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DeleteScriptRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete a script or search template. /// Deletes a stored script or search template. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.DeleteScriptRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.DeleteScriptRequestConverter))] public sealed partial class DeleteScriptRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteScriptResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteScriptResponse.Converters.g.cs new file mode 100644 index 00000000000..f950b0cc134 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteScriptResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class DeleteScriptResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.DeleteScriptResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.DeleteScriptResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DeleteScriptResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteScriptResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteScriptResponse.g.cs index bf9ab594c16..b0048d47abe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteScriptResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteScriptResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class DeleteScriptResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.DeleteScriptResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.DeleteScriptResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DeleteScriptResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.DeleteScriptResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.DeleteScriptResponseConverter))] public sealed partial class DeleteScriptResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/DeletePolicyRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/DeletePolicyRequest.Converters.g.cs new file mode 100644 index 00000000000..f3d86d546e6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/DeletePolicyRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Enrich.Json; + +public sealed partial class DeletePolicyRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Enrich.DeletePolicyRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Enrich.DeletePolicyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.DeletePolicyRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/DeletePolicyRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/DeletePolicyRequest.g.cs index 3495de86f6e..f4edd54252a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/DeletePolicyRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/DeletePolicyRequest.g.cs @@ -33,42 +33,13 @@ public sealed partial class DeletePolicyRequestParameters : Elastic.Transport.Re public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class DeletePolicyRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Enrich.DeletePolicyRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Enrich.DeletePolicyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.DeletePolicyRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete an enrich policy. /// Deletes an existing enrich policy and its enrich index. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.DeletePolicyRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.Json.DeletePolicyRequestConverter))] public sealed partial class DeletePolicyRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/DeletePolicyResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/DeletePolicyResponse.Converters.g.cs new file mode 100644 index 00000000000..72823b54a1d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/DeletePolicyResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Enrich.Json; + +public sealed partial class DeletePolicyResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.Enrich.DeletePolicyResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Enrich.DeletePolicyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.DeletePolicyResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/DeletePolicyResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/DeletePolicyResponse.g.cs index 23e71f984c5..d473a062a42 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/DeletePolicyResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/DeletePolicyResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Enrich; -internal sealed partial class DeletePolicyResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.Enrich.DeletePolicyResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Enrich.DeletePolicyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.DeletePolicyResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.DeletePolicyResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.Json.DeletePolicyResponseConverter))] public sealed partial class DeletePolicyResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichStatsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichStatsRequest.Converters.g.cs new file mode 100644 index 00000000000..1b068d4140c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichStatsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Enrich.Json; + +public sealed partial class EnrichStatsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Enrich.EnrichStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Enrich.EnrichStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.EnrichStatsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichStatsRequest.g.cs index 50c3aefe116..26a0d2d669d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichStatsRequest.g.cs @@ -33,42 +33,13 @@ public sealed partial class EnrichStatsRequestParameters : Elastic.Transport.Req public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class EnrichStatsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Enrich.EnrichStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Enrich.EnrichStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.EnrichStatsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get enrich stats. /// Returns enrich coordinator statistics and information about enrich policies that are currently executing. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.EnrichStatsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.Json.EnrichStatsRequestConverter))] public sealed partial class EnrichStatsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichStatsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichStatsResponse.Converters.g.cs new file mode 100644 index 00000000000..f79cd744da6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichStatsResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Enrich.Json; + +public sealed partial class EnrichStatsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCacheStats = System.Text.Json.JsonEncodedText.Encode("cache_stats"); + private static readonly System.Text.Json.JsonEncodedText PropCoordinatorStats = System.Text.Json.JsonEncodedText.Encode("coordinator_stats"); + private static readonly System.Text.Json.JsonEncodedText PropExecutingPolicies = System.Text.Json.JsonEncodedText.Encode("executing_policies"); + + public override Elastic.Clients.Elasticsearch.Enrich.EnrichStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propCacheStats = default; + LocalJsonValue> propCoordinatorStats = default; + LocalJsonValue> propExecutingPolicies = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCacheStats.TryReadProperty(ref reader, options, PropCacheStats, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propCoordinatorStats.TryReadProperty(ref reader, options, PropCoordinatorStats, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propExecutingPolicies.TryReadProperty(ref reader, options, PropExecutingPolicies, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Enrich.EnrichStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CacheStats = propCacheStats.Value, + CoordinatorStats = propCoordinatorStats.Value, + ExecutingPolicies = propExecutingPolicies.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.EnrichStatsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCacheStats, value.CacheStats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCoordinatorStats, value.CoordinatorStats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropExecutingPolicies, value.ExecutingPolicies, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichStatsResponse.g.cs index 3925c38020c..52ed1c7778f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/EnrichStatsResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Enrich; -internal sealed partial class EnrichStatsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCacheStats = System.Text.Json.JsonEncodedText.Encode("cache_stats"); - private static readonly System.Text.Json.JsonEncodedText PropCoordinatorStats = System.Text.Json.JsonEncodedText.Encode("coordinator_stats"); - private static readonly System.Text.Json.JsonEncodedText PropExecutingPolicies = System.Text.Json.JsonEncodedText.Encode("executing_policies"); - - public override Elastic.Clients.Elasticsearch.Enrich.EnrichStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propCacheStats = default; - LocalJsonValue> propCoordinatorStats = default; - LocalJsonValue> propExecutingPolicies = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCacheStats.TryReadProperty(ref reader, options, PropCacheStats, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propCoordinatorStats.TryReadProperty(ref reader, options, PropCoordinatorStats, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propExecutingPolicies.TryReadProperty(ref reader, options, PropExecutingPolicies, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Enrich.EnrichStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CacheStats = propCacheStats.Value, - CoordinatorStats = propCoordinatorStats.Value, - ExecutingPolicies = propExecutingPolicies.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.EnrichStatsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCacheStats, value.CacheStats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCoordinatorStats, value.CoordinatorStats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropExecutingPolicies, value.ExecutingPolicies, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.EnrichStatsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.Json.EnrichStatsResponseConverter))] public sealed partial class EnrichStatsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/ExecutePolicyRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/ExecutePolicyRequest.Converters.g.cs new file mode 100644 index 00000000000..41854ce7fa4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/ExecutePolicyRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Enrich.Json; + +public sealed partial class ExecutePolicyRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Enrich.ExecutePolicyRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Enrich.ExecutePolicyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.ExecutePolicyRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/ExecutePolicyRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/ExecutePolicyRequest.g.cs index ad29b049f08..75459d21d78 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/ExecutePolicyRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/ExecutePolicyRequest.g.cs @@ -40,42 +40,13 @@ public sealed partial class ExecutePolicyRequestParameters : Elastic.Transport.R public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } } -internal sealed partial class ExecutePolicyRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Enrich.ExecutePolicyRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Enrich.ExecutePolicyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.ExecutePolicyRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Run an enrich policy. /// Create the enrich index for an existing enrich policy. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.ExecutePolicyRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.Json.ExecutePolicyRequestConverter))] public sealed partial class ExecutePolicyRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/ExecutePolicyResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/ExecutePolicyResponse.Converters.g.cs new file mode 100644 index 00000000000..229dfc645c0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/ExecutePolicyResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Enrich.Json; + +public sealed partial class ExecutePolicyResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + private static readonly System.Text.Json.JsonEncodedText PropTask = System.Text.Json.JsonEncodedText.Encode("task"); + + public override Elastic.Clients.Elasticsearch.Enrich.ExecutePolicyResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propStatus = default; + LocalJsonValue propTask = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (propTask.TryReadProperty(ref reader, options, PropTask, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Enrich.ExecutePolicyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Status = propStatus.Value, + Task = propTask.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.ExecutePolicyResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteProperty(options, PropTask, value.Task, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/ExecutePolicyResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/ExecutePolicyResponse.g.cs index b04a6dc08c8..c683a574df1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/ExecutePolicyResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/ExecutePolicyResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Enrich; -internal sealed partial class ExecutePolicyResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - private static readonly System.Text.Json.JsonEncodedText PropTask = System.Text.Json.JsonEncodedText.Encode("task"); - - public override Elastic.Clients.Elasticsearch.Enrich.ExecutePolicyResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propStatus = default; - LocalJsonValue propTask = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (propTask.TryReadProperty(ref reader, options, PropTask, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Enrich.ExecutePolicyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Status = propStatus.Value, - Task = propTask.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.ExecutePolicyResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteProperty(options, PropTask, value.Task, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.ExecutePolicyResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.Json.ExecutePolicyResponseConverter))] public sealed partial class ExecutePolicyResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/GetPolicyRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/GetPolicyRequest.Converters.g.cs new file mode 100644 index 00000000000..5c5f0e4c1e6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/GetPolicyRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Enrich.Json; + +public sealed partial class GetPolicyRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Enrich.GetPolicyRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Enrich.GetPolicyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.GetPolicyRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/GetPolicyRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/GetPolicyRequest.g.cs index 4ee0fe1f32f..ae95daef120 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/GetPolicyRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/GetPolicyRequest.g.cs @@ -33,42 +33,13 @@ public sealed partial class GetPolicyRequestParameters : Elastic.Transport.Reque public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class GetPolicyRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Enrich.GetPolicyRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Enrich.GetPolicyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.GetPolicyRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get an enrich policy. /// Returns information about an enrich policy. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.GetPolicyRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.Json.GetPolicyRequestConverter))] public sealed partial class GetPolicyRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetPolicyRequest(Elastic.Clients.Elasticsearch.Names? name) : base(r => r.Optional("name", name)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/GetPolicyResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/GetPolicyResponse.Converters.g.cs new file mode 100644 index 00000000000..7b33dc0cf48 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/GetPolicyResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Enrich.Json; + +public sealed partial class GetPolicyResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPolicies = System.Text.Json.JsonEncodedText.Encode("policies"); + + public override Elastic.Clients.Elasticsearch.Enrich.GetPolicyResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propPolicies = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPolicies.TryReadProperty(ref reader, options, PropPolicies, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Enrich.GetPolicyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Policies = propPolicies.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.GetPolicyResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPolicies, value.Policies, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/GetPolicyResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/GetPolicyResponse.g.cs index 898c94603f8..cf4b4943fe9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/GetPolicyResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/GetPolicyResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Enrich; -internal sealed partial class GetPolicyResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPolicies = System.Text.Json.JsonEncodedText.Encode("policies"); - - public override Elastic.Clients.Elasticsearch.Enrich.GetPolicyResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propPolicies = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPolicies.TryReadProperty(ref reader, options, PropPolicies, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Enrich.GetPolicyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Policies = propPolicies.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.GetPolicyResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPolicies, value.Policies, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.GetPolicyResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.Json.GetPolicyResponseConverter))] public sealed partial class GetPolicyResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal GetPolicyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConst public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Policies { get; set; } +System.Collections.Generic.IReadOnlyCollection Policies { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/PutPolicyRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/PutPolicyRequest.Converters.g.cs new file mode 100644 index 00000000000..abda7d1ca55 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/PutPolicyRequest.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Enrich.Json; + +public sealed partial class PutPolicyRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropGeoMatch = System.Text.Json.JsonEncodedText.Encode("geo_match"); + private static readonly System.Text.Json.JsonEncodedText PropMatch = System.Text.Json.JsonEncodedText.Encode("match"); + private static readonly System.Text.Json.JsonEncodedText PropRange = System.Text.Json.JsonEncodedText.Encode("range"); + + public override Elastic.Clients.Elasticsearch.Enrich.PutPolicyRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propGeoMatch = default; + LocalJsonValue propMatch = default; + LocalJsonValue propRange = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propGeoMatch.TryReadProperty(ref reader, options, PropGeoMatch, null)) + { + continue; + } + + if (propMatch.TryReadProperty(ref reader, options, PropMatch, null)) + { + continue; + } + + if (propRange.TryReadProperty(ref reader, options, PropRange, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Enrich.PutPolicyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + GeoMatch = propGeoMatch.Value, + Match = propMatch.Value, + Range = propRange.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.PutPolicyRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropGeoMatch, value.GeoMatch, null, null); + writer.WriteProperty(options, PropMatch, value.Match, null, null); + writer.WriteProperty(options, PropRange, value.Range, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/PutPolicyRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/PutPolicyRequest.g.cs index 81aa6a3c4f4..76c218766c9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/PutPolicyRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/PutPolicyRequest.g.cs @@ -33,70 +33,13 @@ public sealed partial class PutPolicyRequestParameters : Elastic.Transport.Reque public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class PutPolicyRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropGeoMatch = System.Text.Json.JsonEncodedText.Encode("geo_match"); - private static readonly System.Text.Json.JsonEncodedText PropMatch = System.Text.Json.JsonEncodedText.Encode("match"); - private static readonly System.Text.Json.JsonEncodedText PropRange = System.Text.Json.JsonEncodedText.Encode("range"); - - public override Elastic.Clients.Elasticsearch.Enrich.PutPolicyRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propGeoMatch = default; - LocalJsonValue propMatch = default; - LocalJsonValue propRange = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propGeoMatch.TryReadProperty(ref reader, options, PropGeoMatch, null)) - { - continue; - } - - if (propMatch.TryReadProperty(ref reader, options, PropMatch, null)) - { - continue; - } - - if (propRange.TryReadProperty(ref reader, options, PropRange, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Enrich.PutPolicyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - GeoMatch = propGeoMatch.Value, - Match = propMatch.Value, - Range = propRange.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.PutPolicyRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropGeoMatch, value.GeoMatch, null, null); - writer.WriteProperty(options, PropMatch, value.Match, null, null); - writer.WriteProperty(options, PropRange, value.Range, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create an enrich policy. /// Creates an enrich policy. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.PutPolicyRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.Json.PutPolicyRequestConverter))] public sealed partial class PutPolicyRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/PutPolicyResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/PutPolicyResponse.Converters.g.cs new file mode 100644 index 00000000000..e5c29efe9df --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/PutPolicyResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Enrich.Json; + +public sealed partial class PutPolicyResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.Enrich.PutPolicyResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Enrich.PutPolicyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.PutPolicyResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/PutPolicyResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/PutPolicyResponse.g.cs index fba8a52ecbf..b10648bace9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/PutPolicyResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Enrich/PutPolicyResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Enrich; -internal sealed partial class PutPolicyResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.Enrich.PutPolicyResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Enrich.PutPolicyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.PutPolicyResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.PutPolicyResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.Json.PutPolicyResponseConverter))] public sealed partial class PutPolicyResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlDeleteRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlDeleteRequest.Converters.g.cs new file mode 100644 index 00000000000..aeac9e0ed26 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlDeleteRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Eql.Json; + +public sealed partial class EqlDeleteRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlDeleteRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlDeleteRequest.g.cs index ee4b95c5aa9..343504c4034 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlDeleteRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlDeleteRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class EqlDeleteRequestParameters : Elastic.Transport.Reque { } -internal sealed partial class EqlDeleteRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete an async EQL search. @@ -63,7 +34,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The API also deletes results for the search. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Eql.EqlDeleteRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Eql.Json.EqlDeleteRequestConverter))] public sealed partial class EqlDeleteRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlDeleteResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlDeleteResponse.Converters.g.cs new file mode 100644 index 00000000000..8d37292392b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlDeleteResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Eql.Json; + +public sealed partial class EqlDeleteResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.Eql.EqlDeleteResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Eql.EqlDeleteResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Eql.EqlDeleteResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlDeleteResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlDeleteResponse.g.cs index 2d63f8986d1..dc7c605d63c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlDeleteResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlDeleteResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Eql; -internal sealed partial class EqlDeleteResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.Eql.EqlDeleteResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Eql.EqlDeleteResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Eql.EqlDeleteResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Eql.EqlDeleteResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Eql.Json.EqlDeleteResponseConverter))] public sealed partial class EqlDeleteResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlGetRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlGetRequest.Converters.g.cs new file mode 100644 index 00000000000..df1c807015d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlGetRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Eql.Json; + +public sealed partial class EqlGetRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Eql.EqlGetRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Eql.EqlGetRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Eql.EqlGetRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlGetRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlGetRequest.g.cs index 7394b9c2157..cce053f4805 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlGetRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlGetRequest.g.cs @@ -42,42 +42,13 @@ public sealed partial class EqlGetRequestParameters : Elastic.Transport.RequestP public Elastic.Clients.Elasticsearch.Duration? WaitForCompletionTimeout { get => Q("wait_for_completion_timeout"); set => Q("wait_for_completion_timeout", value); } } -internal sealed partial class EqlGetRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Eql.EqlGetRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Eql.EqlGetRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Eql.EqlGetRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get async EQL search results. /// Get the current status and available results for an async EQL search or a stored synchronous EQL search. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Eql.EqlGetRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Eql.Json.EqlGetRequestConverter))] public sealed partial class EqlGetRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlGetResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlGetResponse.Converters.g.cs new file mode 100644 index 00000000000..8965242cc1a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlGetResponse.Converters.g.cs @@ -0,0 +1,133 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Eql.Json; + +public sealed partial class EqlGetResponseConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropHits = System.Text.Json.JsonEncodedText.Encode("hits"); + 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 PropShardFailures = System.Text.Json.JsonEncodedText.Encode("shard_failures"); + private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); + private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); + + public override Elastic.Clients.Elasticsearch.Eql.EqlGetResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propHits = default; + LocalJsonValue propId = default; + LocalJsonValue propIsPartial = default; + LocalJsonValue propIsRunning = default; + LocalJsonValue?> propShardFailures = default; + LocalJsonValue propTimedOut = default; + LocalJsonValue propTook = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propHits.TryReadProperty(ref reader, options, PropHits, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIsPartial.TryReadProperty(ref reader, options, PropIsPartial, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIsRunning.TryReadProperty(ref reader, options, PropIsRunning, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propShardFailures.TryReadProperty(ref reader, options, PropShardFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTook.TryReadProperty(ref reader, options, PropTook, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Eql.EqlGetResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Hits = propHits.Value, + Id = propId.Value, + IsPartial = propIsPartial.Value, + IsRunning = propIsRunning.Value, + ShardFailures = propShardFailures.Value, + TimedOut = propTimedOut.Value, + Took = propTook.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Eql.EqlGetResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropHits, value.Hits, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIsPartial, value.IsPartial, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIsRunning, value.IsRunning, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropShardFailures, value.ShardFailures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTook, value.Took, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} + +public sealed partial class EqlGetResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(EqlGetResponse<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(EqlGetResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlGetResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlGetResponse.g.cs index 2a9c9acc61a..0fdf36bf121 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlGetResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlGetResponse.g.cs @@ -23,116 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Eql; -internal sealed partial class EqlGetResponseConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropHits = System.Text.Json.JsonEncodedText.Encode("hits"); - 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 PropShardFailures = System.Text.Json.JsonEncodedText.Encode("shard_failures"); - private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); - private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); - - public override Elastic.Clients.Elasticsearch.Eql.EqlGetResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propHits = default; - LocalJsonValue propId = default; - LocalJsonValue propIsPartial = default; - LocalJsonValue propIsRunning = default; - LocalJsonValue?> propShardFailures = default; - LocalJsonValue propTimedOut = default; - LocalJsonValue propTook = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propHits.TryReadProperty(ref reader, options, PropHits, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIsPartial.TryReadProperty(ref reader, options, PropIsPartial, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIsRunning.TryReadProperty(ref reader, options, PropIsRunning, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propShardFailures.TryReadProperty(ref reader, options, PropShardFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTook.TryReadProperty(ref reader, options, PropTook, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Eql.EqlGetResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Hits = propHits.Value, - Id = propId.Value, - IsPartial = propIsPartial.Value, - IsRunning = propIsRunning.Value, - ShardFailures = propShardFailures.Value, - TimedOut = propTimedOut.Value, - Took = propTook.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Eql.EqlGetResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropHits, value.Hits, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIsPartial, value.IsPartial, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIsRunning, value.IsRunning, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropShardFailures, value.ShardFailures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTook, value.Took, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -internal sealed partial class EqlGetResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(EqlGetResponse<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(EqlGetResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Eql.EqlGetResponseConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Eql.Json.EqlGetResponseConverterFactory))] public partial class EqlGetResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlSearchRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlSearchRequest.Converters.g.cs new file mode 100644 index 00000000000..8122bf0ca49 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlSearchRequest.Converters.g.cs @@ -0,0 +1,207 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Eql.Json; + +public sealed partial class EqlSearchRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowPartialSearchResults = System.Text.Json.JsonEncodedText.Encode("allow_partial_search_results"); + private static readonly System.Text.Json.JsonEncodedText PropAllowPartialSequenceResults = System.Text.Json.JsonEncodedText.Encode("allow_partial_sequence_results"); + private static readonly System.Text.Json.JsonEncodedText PropCaseSensitive = System.Text.Json.JsonEncodedText.Encode("case_sensitive"); + private static readonly System.Text.Json.JsonEncodedText PropEventCategoryField = System.Text.Json.JsonEncodedText.Encode("event_category_field"); + private static readonly System.Text.Json.JsonEncodedText PropFetchSize = System.Text.Json.JsonEncodedText.Encode("fetch_size"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropKeepAlive = System.Text.Json.JsonEncodedText.Encode("keep_alive"); + private static readonly System.Text.Json.JsonEncodedText PropKeepOnCompletion = System.Text.Json.JsonEncodedText.Encode("keep_on_completion"); + private static readonly System.Text.Json.JsonEncodedText PropMaxSamplesPerKey = System.Text.Json.JsonEncodedText.Encode("max_samples_per_key"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropResultPosition = System.Text.Json.JsonEncodedText.Encode("result_position"); + private static readonly System.Text.Json.JsonEncodedText PropRuntimeMappings = System.Text.Json.JsonEncodedText.Encode("runtime_mappings"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropTiebreakerField = System.Text.Json.JsonEncodedText.Encode("tiebreaker_field"); + private static readonly System.Text.Json.JsonEncodedText PropTimestampField = System.Text.Json.JsonEncodedText.Encode("timestamp_field"); + private static readonly System.Text.Json.JsonEncodedText PropWaitForCompletionTimeout = System.Text.Json.JsonEncodedText.Encode("wait_for_completion_timeout"); + + public override Elastic.Clients.Elasticsearch.Eql.EqlSearchRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowPartialSearchResults = default; + LocalJsonValue propAllowPartialSequenceResults = default; + LocalJsonValue propCaseSensitive = default; + LocalJsonValue propEventCategoryField = default; + LocalJsonValue propFetchSize = default; + LocalJsonValue?> propFields = default; + LocalJsonValue?> propFilter = default; + LocalJsonValue propKeepAlive = default; + LocalJsonValue propKeepOnCompletion = default; + LocalJsonValue propMaxSamplesPerKey = default; + LocalJsonValue propQuery = default; + LocalJsonValue propResultPosition = default; + LocalJsonValue?> propRuntimeMappings = default; + LocalJsonValue propSize = default; + LocalJsonValue propTiebreakerField = default; + LocalJsonValue propTimestampField = default; + LocalJsonValue propWaitForCompletionTimeout = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowPartialSearchResults.TryReadProperty(ref reader, options, PropAllowPartialSearchResults, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propAllowPartialSequenceResults.TryReadProperty(ref reader, options, PropAllowPartialSequenceResults, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCaseSensitive.TryReadProperty(ref reader, options, PropCaseSensitive, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEventCategoryField.TryReadProperty(ref reader, options, PropEventCategoryField, null)) + { + continue; + } + + if (propFetchSize.TryReadProperty(ref reader, options, PropFetchSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propKeepAlive.TryReadProperty(ref reader, options, PropKeepAlive, null)) + { + continue; + } + + if (propKeepOnCompletion.TryReadProperty(ref reader, options, PropKeepOnCompletion, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxSamplesPerKey.TryReadProperty(ref reader, options, PropMaxSamplesPerKey, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propResultPosition.TryReadProperty(ref reader, options, PropResultPosition, static Elastic.Clients.Elasticsearch.Eql.ResultPosition? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTiebreakerField.TryReadProperty(ref reader, options, PropTiebreakerField, null)) + { + continue; + } + + if (propTimestampField.TryReadProperty(ref reader, options, PropTimestampField, null)) + { + continue; + } + + if (propWaitForCompletionTimeout.TryReadProperty(ref reader, options, PropWaitForCompletionTimeout, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Eql.EqlSearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowPartialSearchResults = propAllowPartialSearchResults.Value, + AllowPartialSequenceResults = propAllowPartialSequenceResults.Value, + CaseSensitive = propCaseSensitive.Value, + EventCategoryField = propEventCategoryField.Value, + FetchSize = propFetchSize.Value, + Fields = propFields.Value, + Filter = propFilter.Value, + KeepAlive = propKeepAlive.Value, + KeepOnCompletion = propKeepOnCompletion.Value, + MaxSamplesPerKey = propMaxSamplesPerKey.Value, + Query = propQuery.Value, + ResultPosition = propResultPosition.Value, + RuntimeMappings = propRuntimeMappings.Value, + Size = propSize.Value, + TiebreakerField = propTiebreakerField.Value, + TimestampField = propTimestampField.Value, + WaitForCompletionTimeout = propWaitForCompletionTimeout.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Eql.EqlSearchRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowPartialSearchResults, value.AllowPartialSearchResults, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropAllowPartialSequenceResults, value.AllowPartialSequenceResults, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCaseSensitive, value.CaseSensitive, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEventCategoryField, value.EventCategoryField, null, null); + writer.WriteProperty(options, PropFetchSize, value.FetchSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropKeepAlive, value.KeepAlive, null, null); + writer.WriteProperty(options, PropKeepOnCompletion, value.KeepOnCompletion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxSamplesPerKey, value.MaxSamplesPerKey, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropResultPosition, value.ResultPosition, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Eql.ResultPosition? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTiebreakerField, value.TiebreakerField, null, null); + writer.WriteProperty(options, PropTimestampField, value.TimestampField, null, null); + writer.WriteProperty(options, PropWaitForCompletionTimeout, value.WaitForCompletionTimeout, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlSearchRequest.g.cs index 83a91bbe9da..a58336f781b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlSearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlSearchRequest.g.cs @@ -54,189 +54,6 @@ public sealed partial class EqlSearchRequestParameters : Elastic.Transport.Reque public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } } -internal sealed partial class EqlSearchRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowPartialSearchResults = System.Text.Json.JsonEncodedText.Encode("allow_partial_search_results"); - private static readonly System.Text.Json.JsonEncodedText PropAllowPartialSequenceResults = System.Text.Json.JsonEncodedText.Encode("allow_partial_sequence_results"); - private static readonly System.Text.Json.JsonEncodedText PropCaseSensitive = System.Text.Json.JsonEncodedText.Encode("case_sensitive"); - private static readonly System.Text.Json.JsonEncodedText PropEventCategoryField = System.Text.Json.JsonEncodedText.Encode("event_category_field"); - private static readonly System.Text.Json.JsonEncodedText PropFetchSize = System.Text.Json.JsonEncodedText.Encode("fetch_size"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropKeepAlive = System.Text.Json.JsonEncodedText.Encode("keep_alive"); - private static readonly System.Text.Json.JsonEncodedText PropKeepOnCompletion = System.Text.Json.JsonEncodedText.Encode("keep_on_completion"); - private static readonly System.Text.Json.JsonEncodedText PropMaxSamplesPerKey = System.Text.Json.JsonEncodedText.Encode("max_samples_per_key"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropResultPosition = System.Text.Json.JsonEncodedText.Encode("result_position"); - private static readonly System.Text.Json.JsonEncodedText PropRuntimeMappings = System.Text.Json.JsonEncodedText.Encode("runtime_mappings"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropTiebreakerField = System.Text.Json.JsonEncodedText.Encode("tiebreaker_field"); - private static readonly System.Text.Json.JsonEncodedText PropTimestampField = System.Text.Json.JsonEncodedText.Encode("timestamp_field"); - private static readonly System.Text.Json.JsonEncodedText PropWaitForCompletionTimeout = System.Text.Json.JsonEncodedText.Encode("wait_for_completion_timeout"); - - public override Elastic.Clients.Elasticsearch.Eql.EqlSearchRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowPartialSearchResults = default; - LocalJsonValue propAllowPartialSequenceResults = default; - LocalJsonValue propCaseSensitive = default; - LocalJsonValue propEventCategoryField = default; - LocalJsonValue propFetchSize = default; - LocalJsonValue?> propFields = default; - LocalJsonValue?> propFilter = default; - LocalJsonValue propKeepAlive = default; - LocalJsonValue propKeepOnCompletion = default; - LocalJsonValue propMaxSamplesPerKey = default; - LocalJsonValue propQuery = default; - LocalJsonValue propResultPosition = default; - LocalJsonValue?> propRuntimeMappings = default; - LocalJsonValue propSize = default; - LocalJsonValue propTiebreakerField = default; - LocalJsonValue propTimestampField = default; - LocalJsonValue propWaitForCompletionTimeout = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowPartialSearchResults.TryReadProperty(ref reader, options, PropAllowPartialSearchResults, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propAllowPartialSequenceResults.TryReadProperty(ref reader, options, PropAllowPartialSequenceResults, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCaseSensitive.TryReadProperty(ref reader, options, PropCaseSensitive, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEventCategoryField.TryReadProperty(ref reader, options, PropEventCategoryField, null)) - { - continue; - } - - if (propFetchSize.TryReadProperty(ref reader, options, PropFetchSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propKeepAlive.TryReadProperty(ref reader, options, PropKeepAlive, null)) - { - continue; - } - - if (propKeepOnCompletion.TryReadProperty(ref reader, options, PropKeepOnCompletion, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxSamplesPerKey.TryReadProperty(ref reader, options, PropMaxSamplesPerKey, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propResultPosition.TryReadProperty(ref reader, options, PropResultPosition, static Elastic.Clients.Elasticsearch.Eql.ResultPosition? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTiebreakerField.TryReadProperty(ref reader, options, PropTiebreakerField, null)) - { - continue; - } - - if (propTimestampField.TryReadProperty(ref reader, options, PropTimestampField, null)) - { - continue; - } - - if (propWaitForCompletionTimeout.TryReadProperty(ref reader, options, PropWaitForCompletionTimeout, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Eql.EqlSearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowPartialSearchResults = propAllowPartialSearchResults.Value, - AllowPartialSequenceResults = propAllowPartialSequenceResults.Value, - CaseSensitive = propCaseSensitive.Value, - EventCategoryField = propEventCategoryField.Value, - FetchSize = propFetchSize.Value, - Fields = propFields.Value, - Filter = propFilter.Value, - KeepAlive = propKeepAlive.Value, - KeepOnCompletion = propKeepOnCompletion.Value, - MaxSamplesPerKey = propMaxSamplesPerKey.Value, - Query = propQuery.Value, - ResultPosition = propResultPosition.Value, - RuntimeMappings = propRuntimeMappings.Value, - Size = propSize.Value, - TiebreakerField = propTiebreakerField.Value, - TimestampField = propTimestampField.Value, - WaitForCompletionTimeout = propWaitForCompletionTimeout.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Eql.EqlSearchRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowPartialSearchResults, value.AllowPartialSearchResults, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropAllowPartialSequenceResults, value.AllowPartialSequenceResults, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCaseSensitive, value.CaseSensitive, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEventCategoryField, value.EventCategoryField, null, null); - writer.WriteProperty(options, PropFetchSize, value.FetchSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropKeepAlive, value.KeepAlive, null, null); - writer.WriteProperty(options, PropKeepOnCompletion, value.KeepOnCompletion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxSamplesPerKey, value.MaxSamplesPerKey, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropResultPosition, value.ResultPosition, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Eql.ResultPosition? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTiebreakerField, value.TiebreakerField, null, null); - writer.WriteProperty(options, PropTimestampField, value.TimestampField, null, null); - writer.WriteProperty(options, PropWaitForCompletionTimeout, value.WaitForCompletionTimeout, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Get EQL search results. @@ -244,7 +61,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// EQL assumes each document in a data stream or index corresponds to an event. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Eql.EqlSearchRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Eql.Json.EqlSearchRequestConverter))] public sealed partial class EqlSearchRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlSearchResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlSearchResponse.Converters.g.cs new file mode 100644 index 00000000000..f7af053051e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlSearchResponse.Converters.g.cs @@ -0,0 +1,133 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Eql.Json; + +public sealed partial class EqlSearchResponseConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropHits = System.Text.Json.JsonEncodedText.Encode("hits"); + 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 PropShardFailures = System.Text.Json.JsonEncodedText.Encode("shard_failures"); + private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); + private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); + + public override Elastic.Clients.Elasticsearch.Eql.EqlSearchResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propHits = default; + LocalJsonValue propId = default; + LocalJsonValue propIsPartial = default; + LocalJsonValue propIsRunning = default; + LocalJsonValue?> propShardFailures = default; + LocalJsonValue propTimedOut = default; + LocalJsonValue propTook = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propHits.TryReadProperty(ref reader, options, PropHits, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIsPartial.TryReadProperty(ref reader, options, PropIsPartial, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIsRunning.TryReadProperty(ref reader, options, PropIsRunning, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propShardFailures.TryReadProperty(ref reader, options, PropShardFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTook.TryReadProperty(ref reader, options, PropTook, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Eql.EqlSearchResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Hits = propHits.Value, + Id = propId.Value, + IsPartial = propIsPartial.Value, + IsRunning = propIsRunning.Value, + ShardFailures = propShardFailures.Value, + TimedOut = propTimedOut.Value, + Took = propTook.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Eql.EqlSearchResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropHits, value.Hits, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIsPartial, value.IsPartial, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIsRunning, value.IsRunning, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropShardFailures, value.ShardFailures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTook, value.Took, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} + +public sealed partial class EqlSearchResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(EqlSearchResponse<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(EqlSearchResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlSearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlSearchResponse.g.cs index 8e2cd9cc93b..ef9c1ac84cb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlSearchResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/EqlSearchResponse.g.cs @@ -23,116 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Eql; -internal sealed partial class EqlSearchResponseConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropHits = System.Text.Json.JsonEncodedText.Encode("hits"); - 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 PropShardFailures = System.Text.Json.JsonEncodedText.Encode("shard_failures"); - private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); - private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); - - public override Elastic.Clients.Elasticsearch.Eql.EqlSearchResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propHits = default; - LocalJsonValue propId = default; - LocalJsonValue propIsPartial = default; - LocalJsonValue propIsRunning = default; - LocalJsonValue?> propShardFailures = default; - LocalJsonValue propTimedOut = default; - LocalJsonValue propTook = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propHits.TryReadProperty(ref reader, options, PropHits, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIsPartial.TryReadProperty(ref reader, options, PropIsPartial, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIsRunning.TryReadProperty(ref reader, options, PropIsRunning, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propShardFailures.TryReadProperty(ref reader, options, PropShardFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTook.TryReadProperty(ref reader, options, PropTook, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Eql.EqlSearchResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Hits = propHits.Value, - Id = propId.Value, - IsPartial = propIsPartial.Value, - IsRunning = propIsRunning.Value, - ShardFailures = propShardFailures.Value, - TimedOut = propTimedOut.Value, - Took = propTook.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Eql.EqlSearchResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropHits, value.Hits, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIsPartial, value.IsPartial, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIsRunning, value.IsRunning, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropShardFailures, value.ShardFailures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTook, value.Took, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -internal sealed partial class EqlSearchResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(EqlSearchResponse<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(EqlSearchResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Eql.EqlSearchResponseConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Eql.Json.EqlSearchResponseConverterFactory))] public sealed partial class EqlSearchResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/GetEqlStatusRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/GetEqlStatusRequest.Converters.g.cs new file mode 100644 index 00000000000..dbaf5980357 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/GetEqlStatusRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Eql.Json; + +public sealed partial class GetEqlStatusRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/GetEqlStatusRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/GetEqlStatusRequest.g.cs index 3ee7aa8f79f..6d96762ff0f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/GetEqlStatusRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/GetEqlStatusRequest.g.cs @@ -27,42 +27,13 @@ public sealed partial class GetEqlStatusRequestParameters : Elastic.Transport.Re { } -internal sealed partial class GetEqlStatusRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get the async EQL status. /// Get the current status for an async EQL search or a stored synchronous EQL search without returning results. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Eql.GetEqlStatusRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Eql.Json.GetEqlStatusRequestConverter))] public sealed partial class GetEqlStatusRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/GetEqlStatusResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/GetEqlStatusResponse.Converters.g.cs new file mode 100644 index 00000000000..8d0b621a243 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/GetEqlStatusResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Eql.Json; + +public sealed partial class GetEqlStatusResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCompletionStatus = System.Text.Json.JsonEncodedText.Encode("completion_status"); + 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 PropStartTimeInMillis = System.Text.Json.JsonEncodedText.Encode("start_time_in_millis"); + + public override Elastic.Clients.Elasticsearch.Eql.GetEqlStatusResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCompletionStatus = default; + LocalJsonValue propExpirationTimeInMillis = default; + LocalJsonValue propId = default; + LocalJsonValue propIsPartial = default; + LocalJsonValue propIsRunning = default; + LocalJsonValue propStartTimeInMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCompletionStatus.TryReadProperty(ref reader, options, PropCompletionStatus, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propExpirationTimeInMillis.TryReadProperty(ref reader, options, PropExpirationTimeInMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIsPartial.TryReadProperty(ref reader, options, PropIsPartial, null)) + { + continue; + } + + if (propIsRunning.TryReadProperty(ref reader, options, PropIsRunning, null)) + { + continue; + } + + if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Eql.GetEqlStatusResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CompletionStatus = propCompletionStatus.Value, + ExpirationTimeInMillis = propExpirationTimeInMillis.Value, + Id = propId.Value, + IsPartial = propIsPartial.Value, + IsRunning = propIsRunning.Value, + StartTimeInMillis = propStartTimeInMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Eql.GetEqlStatusResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCompletionStatus, value.CompletionStatus, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropExpirationTimeInMillis, value.ExpirationTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIsPartial, value.IsPartial, null, null); + writer.WriteProperty(options, PropIsRunning, value.IsRunning, null, null); + writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/GetEqlStatusResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/GetEqlStatusResponse.g.cs index d3f2094068f..ba880aefbdb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/GetEqlStatusResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Eql/GetEqlStatusResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Eql; -internal sealed partial class GetEqlStatusResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCompletionStatus = System.Text.Json.JsonEncodedText.Encode("completion_status"); - 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 PropStartTimeInMillis = System.Text.Json.JsonEncodedText.Encode("start_time_in_millis"); - - public override Elastic.Clients.Elasticsearch.Eql.GetEqlStatusResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCompletionStatus = default; - LocalJsonValue propExpirationTimeInMillis = default; - LocalJsonValue propId = default; - LocalJsonValue propIsPartial = default; - LocalJsonValue propIsRunning = default; - LocalJsonValue propStartTimeInMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCompletionStatus.TryReadProperty(ref reader, options, PropCompletionStatus, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propExpirationTimeInMillis.TryReadProperty(ref reader, options, PropExpirationTimeInMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIsPartial.TryReadProperty(ref reader, options, PropIsPartial, null)) - { - continue; - } - - if (propIsRunning.TryReadProperty(ref reader, options, PropIsRunning, null)) - { - continue; - } - - if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Eql.GetEqlStatusResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CompletionStatus = propCompletionStatus.Value, - ExpirationTimeInMillis = propExpirationTimeInMillis.Value, - Id = propId.Value, - IsPartial = propIsPartial.Value, - IsRunning = propIsRunning.Value, - StartTimeInMillis = propStartTimeInMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Eql.GetEqlStatusResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCompletionStatus, value.CompletionStatus, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropExpirationTimeInMillis, value.ExpirationTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIsPartial, value.IsPartial, null, null); - writer.WriteProperty(options, PropIsRunning, value.IsRunning, null, null); - writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Eql.GetEqlStatusResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Eql.Json.GetEqlStatusResponseConverter))] public sealed partial class GetEqlStatusResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryDeleteRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryDeleteRequest.Converters.g.cs new file mode 100644 index 00000000000..764fa034abb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryDeleteRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Esql.Json; + +public sealed partial class AsyncQueryDeleteRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Esql.AsyncQueryDeleteRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Esql.AsyncQueryDeleteRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.AsyncQueryDeleteRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryDeleteRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryDeleteRequest.g.cs index ddbb0be8c24..0f03093aeee 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryDeleteRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryDeleteRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class AsyncQueryDeleteRequestParameters : Elastic.Transpor { } -internal sealed partial class AsyncQueryDeleteRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Esql.AsyncQueryDeleteRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Esql.AsyncQueryDeleteRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.AsyncQueryDeleteRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete an async ES|QL query. @@ -78,7 +49,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.AsyncQueryDeleteRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.Json.AsyncQueryDeleteRequestConverter))] public sealed partial class AsyncQueryDeleteRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryDeleteResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryDeleteResponse.Converters.g.cs new file mode 100644 index 00000000000..daeb8bdc573 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryDeleteResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Esql.Json; + +public sealed partial class AsyncQueryDeleteResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.Esql.AsyncQueryDeleteResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Esql.AsyncQueryDeleteResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.AsyncQueryDeleteResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryDeleteResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryDeleteResponse.g.cs index 50d11077ee2..09c3d9e7cac 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryDeleteResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryDeleteResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Esql; -internal sealed partial class AsyncQueryDeleteResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.Esql.AsyncQueryDeleteResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Esql.AsyncQueryDeleteResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.AsyncQueryDeleteResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.AsyncQueryDeleteResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.Json.AsyncQueryDeleteResponseConverter))] public sealed partial class AsyncQueryDeleteResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryGetRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryGetRequest.Converters.g.cs new file mode 100644 index 00000000000..9753fe17be9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryGetRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Esql.Json; + +public sealed partial class AsyncQueryGetRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Esql.AsyncQueryGetRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Esql.AsyncQueryGetRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.AsyncQueryGetRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryGetRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryGetRequest.g.cs index 3629e3b2ce8..a18aa09a622 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryGetRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryGetRequest.g.cs @@ -59,35 +59,6 @@ public sealed partial class AsyncQueryGetRequestParameters : Elastic.Transport.R public Elastic.Clients.Elasticsearch.Duration? WaitForCompletionTimeout { get => Q("wait_for_completion_timeout"); set => Q("wait_for_completion_timeout", value); } } -internal sealed partial class AsyncQueryGetRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Esql.AsyncQueryGetRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Esql.AsyncQueryGetRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.AsyncQueryGetRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get async ES|QL query results. @@ -95,7 +66,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If the Elasticsearch security features are enabled, only the user who first submitted the ES|QL query can retrieve the results using this API. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.AsyncQueryGetRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.Json.AsyncQueryGetRequestConverter))] public sealed partial class AsyncQueryGetRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.Converters.g.cs new file mode 100644 index 00000000000..121c4b5c27b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Esql.Json; + +public sealed partial class AsyncQueryRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropColumnar = System.Text.Json.JsonEncodedText.Encode("columnar"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropIncludeCcsMetadata = System.Text.Json.JsonEncodedText.Encode("include_ccs_metadata"); + private static readonly System.Text.Json.JsonEncodedText PropKeepAlive = System.Text.Json.JsonEncodedText.Encode("keep_alive"); + private static readonly System.Text.Json.JsonEncodedText PropKeepOnCompletion = System.Text.Json.JsonEncodedText.Encode("keep_on_completion"); + private static readonly System.Text.Json.JsonEncodedText PropLocale = System.Text.Json.JsonEncodedText.Encode("locale"); + private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); + 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 PropWaitForCompletionTimeout = System.Text.Json.JsonEncodedText.Encode("wait_for_completion_timeout"); + + public override Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propColumnar = default; + LocalJsonValue propFilter = default; + LocalJsonValue propIncludeCcsMetadata = default; + LocalJsonValue propKeepAlive = default; + LocalJsonValue propKeepOnCompletion = default; + LocalJsonValue propLocale = default; + LocalJsonValue?> propParams = default; + LocalJsonValue propProfile = default; + LocalJsonValue propQuery = default; + LocalJsonValue propWaitForCompletionTimeout = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propColumnar.TryReadProperty(ref reader, options, PropColumnar, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) + { + continue; + } + + if (propIncludeCcsMetadata.TryReadProperty(ref reader, options, PropIncludeCcsMetadata, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propKeepAlive.TryReadProperty(ref reader, options, PropKeepAlive, null)) + { + continue; + } + + if (propKeepOnCompletion.TryReadProperty(ref reader, options, PropKeepOnCompletion, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLocale.TryReadProperty(ref reader, options, PropLocale, null)) + { + continue; + } + + if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propProfile.TryReadProperty(ref reader, options, PropProfile, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propWaitForCompletionTimeout.TryReadProperty(ref reader, options, PropWaitForCompletionTimeout, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Columnar = propColumnar.Value, + Filter = propFilter.Value, + IncludeCcsMetadata = propIncludeCcsMetadata.Value, + KeepAlive = propKeepAlive.Value, + KeepOnCompletion = propKeepOnCompletion.Value, + Locale = propLocale.Value, + Params = propParams.Value, + Profile = propProfile.Value, + Query = propQuery.Value, + WaitForCompletionTimeout = propWaitForCompletionTimeout.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropColumnar, value.Columnar, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFilter, value.Filter, null, null); + writer.WriteProperty(options, PropIncludeCcsMetadata, value.IncludeCcsMetadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropKeepAlive, value.KeepAlive, null, null); + writer.WriteProperty(options, PropKeepOnCompletion, value.KeepOnCompletion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLocale, value.Locale, null, null); + writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropProfile, value.Profile, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropWaitForCompletionTimeout, value.WaitForCompletionTimeout, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.g.cs index 75a1156fd4e..726d8f66e60 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.g.cs @@ -67,126 +67,6 @@ public sealed partial class AsyncQueryRequestParameters : Elastic.Transport.Requ public Elastic.Clients.Elasticsearch.Esql.EsqlFormat? Format { get => Q("format"); set => Q("format", value); } } -internal sealed partial class AsyncQueryRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropColumnar = System.Text.Json.JsonEncodedText.Encode("columnar"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropIncludeCcsMetadata = System.Text.Json.JsonEncodedText.Encode("include_ccs_metadata"); - private static readonly System.Text.Json.JsonEncodedText PropKeepAlive = System.Text.Json.JsonEncodedText.Encode("keep_alive"); - private static readonly System.Text.Json.JsonEncodedText PropKeepOnCompletion = System.Text.Json.JsonEncodedText.Encode("keep_on_completion"); - private static readonly System.Text.Json.JsonEncodedText PropLocale = System.Text.Json.JsonEncodedText.Encode("locale"); - private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); - 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 PropWaitForCompletionTimeout = System.Text.Json.JsonEncodedText.Encode("wait_for_completion_timeout"); - - public override Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propColumnar = default; - LocalJsonValue propFilter = default; - LocalJsonValue propIncludeCcsMetadata = default; - LocalJsonValue propKeepAlive = default; - LocalJsonValue propKeepOnCompletion = default; - LocalJsonValue propLocale = default; - LocalJsonValue?> propParams = default; - LocalJsonValue propProfile = default; - LocalJsonValue propQuery = default; - LocalJsonValue propWaitForCompletionTimeout = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propColumnar.TryReadProperty(ref reader, options, PropColumnar, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) - { - continue; - } - - if (propIncludeCcsMetadata.TryReadProperty(ref reader, options, PropIncludeCcsMetadata, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propKeepAlive.TryReadProperty(ref reader, options, PropKeepAlive, null)) - { - continue; - } - - if (propKeepOnCompletion.TryReadProperty(ref reader, options, PropKeepOnCompletion, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLocale.TryReadProperty(ref reader, options, PropLocale, null)) - { - continue; - } - - if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propProfile.TryReadProperty(ref reader, options, PropProfile, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propWaitForCompletionTimeout.TryReadProperty(ref reader, options, PropWaitForCompletionTimeout, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Columnar = propColumnar.Value, - Filter = propFilter.Value, - IncludeCcsMetadata = propIncludeCcsMetadata.Value, - KeepAlive = propKeepAlive.Value, - KeepOnCompletion = propKeepOnCompletion.Value, - Locale = propLocale.Value, - Params = propParams.Value, - Profile = propProfile.Value, - Query = propQuery.Value, - WaitForCompletionTimeout = propWaitForCompletionTimeout.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropColumnar, value.Columnar, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFilter, value.Filter, null, null); - writer.WriteProperty(options, PropIncludeCcsMetadata, value.IncludeCcsMetadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropKeepAlive, value.KeepAlive, null, null); - writer.WriteProperty(options, PropKeepOnCompletion, value.KeepOnCompletion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLocale, value.Locale, null, null); - writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropProfile, value.Profile, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropWaitForCompletionTimeout, value.WaitForCompletionTimeout, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Run an async ES|QL query. @@ -196,7 +76,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The API accepts the same parameters and request body as the synchronous query API, along with additional async related properties. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.Json.AsyncQueryRequestConverter))] public sealed partial class AsyncQueryRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryStopRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryStopRequest.Converters.g.cs new file mode 100644 index 00000000000..4be617e5931 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryStopRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Esql.Json; + +public sealed partial class AsyncQueryStopRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Esql.AsyncQueryStopRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Esql.AsyncQueryStopRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.AsyncQueryStopRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryStopRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryStopRequest.g.cs index 2c416395633..bd115eb51d8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryStopRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryStopRequest.g.cs @@ -34,35 +34,6 @@ public sealed partial class AsyncQueryStopRequestParameters : Elastic.Transport. public bool? DropNullColumns { get => Q("drop_null_columns"); set => Q("drop_null_columns", value); } } -internal sealed partial class AsyncQueryStopRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Esql.AsyncQueryStopRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Esql.AsyncQueryStopRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.AsyncQueryStopRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Stop async ES|QL query. @@ -72,7 +43,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If the Elasticsearch security features are enabled, only the user who first submitted the ES|QL query can stop it. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.AsyncQueryStopRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.Json.AsyncQueryStopRequestConverter))] public sealed partial class AsyncQueryStopRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryRequest.Converters.g.cs new file mode 100644 index 00000000000..8f3356eb856 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryRequest.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Esql.Json; + +public sealed partial class EsqlQueryRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropColumnar = System.Text.Json.JsonEncodedText.Encode("columnar"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropIncludeCcsMetadata = System.Text.Json.JsonEncodedText.Encode("include_ccs_metadata"); + private static readonly System.Text.Json.JsonEncodedText PropLocale = System.Text.Json.JsonEncodedText.Encode("locale"); + private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); + 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"); + + public override Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propColumnar = default; + LocalJsonValue propFilter = default; + LocalJsonValue propIncludeCcsMetadata = default; + LocalJsonValue propLocale = default; + LocalJsonValue?> propParams = default; + LocalJsonValue propProfile = default; + LocalJsonValue propQuery = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propColumnar.TryReadProperty(ref reader, options, PropColumnar, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) + { + continue; + } + + if (propIncludeCcsMetadata.TryReadProperty(ref reader, options, PropIncludeCcsMetadata, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLocale.TryReadProperty(ref reader, options, PropLocale, null)) + { + continue; + } + + if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propProfile.TryReadProperty(ref reader, options, PropProfile, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Columnar = propColumnar.Value, + Filter = propFilter.Value, + IncludeCcsMetadata = propIncludeCcsMetadata.Value, + Locale = propLocale.Value, + Params = propParams.Value, + Profile = propProfile.Value, + Query = propQuery.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropColumnar, value.Columnar, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFilter, value.Filter, null, null); + writer.WriteProperty(options, PropIncludeCcsMetadata, value.IncludeCcsMetadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLocale, value.Locale, null, null); + writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropProfile, value.Profile, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryRequest.g.cs index 4f855616d58..ba5452d1f27 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/EsqlQueryRequest.g.cs @@ -62,106 +62,13 @@ public sealed partial class EsqlQueryRequestParameters : Elastic.Transport.Reque public Elastic.Clients.Elasticsearch.Esql.EsqlFormat? Format { get => Q("format"); set => Q("format", value); } } -internal sealed partial class EsqlQueryRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropColumnar = System.Text.Json.JsonEncodedText.Encode("columnar"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropIncludeCcsMetadata = System.Text.Json.JsonEncodedText.Encode("include_ccs_metadata"); - private static readonly System.Text.Json.JsonEncodedText PropLocale = System.Text.Json.JsonEncodedText.Encode("locale"); - private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); - 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"); - - public override Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propColumnar = default; - LocalJsonValue propFilter = default; - LocalJsonValue propIncludeCcsMetadata = default; - LocalJsonValue propLocale = default; - LocalJsonValue?> propParams = default; - LocalJsonValue propProfile = default; - LocalJsonValue propQuery = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propColumnar.TryReadProperty(ref reader, options, PropColumnar, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) - { - continue; - } - - if (propIncludeCcsMetadata.TryReadProperty(ref reader, options, PropIncludeCcsMetadata, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLocale.TryReadProperty(ref reader, options, PropLocale, null)) - { - continue; - } - - if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propProfile.TryReadProperty(ref reader, options, PropProfile, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Columnar = propColumnar.Value, - Filter = propFilter.Value, - IncludeCcsMetadata = propIncludeCcsMetadata.Value, - Locale = propLocale.Value, - Params = propParams.Value, - Profile = propProfile.Value, - Query = propQuery.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropColumnar, value.Columnar, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFilter, value.Filter, null, null); - writer.WriteProperty(options, PropIncludeCcsMetadata, value.IncludeCcsMetadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLocale, value.Locale, null, null); - writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropProfile, value.Profile, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Run an ES|QL query. /// Get search results for an ES|QL (Elasticsearch query language) query. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.EsqlQueryRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.Json.EsqlQueryRequestConverter))] public sealed partial class EsqlQueryRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/GetEsqlQueryRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/GetEsqlQueryRequest.Converters.g.cs new file mode 100644 index 00000000000..9b9205a0c20 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/GetEsqlQueryRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Esql.Json; + +public sealed partial class GetEsqlQueryRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Esql.GetEsqlQueryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Esql.GetEsqlQueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.GetEsqlQueryRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/GetEsqlQueryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/GetEsqlQueryRequest.g.cs index 3924c29ec94..ceac79c6188 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/GetEsqlQueryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/GetEsqlQueryRequest.g.cs @@ -27,42 +27,13 @@ public sealed partial class GetEsqlQueryRequestParameters : Elastic.Transport.Re { } -internal sealed partial class GetEsqlQueryRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Esql.GetEsqlQueryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Esql.GetEsqlQueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.GetEsqlQueryRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get a specific running ES|QL query information. /// Returns an object extended information about a running ES|QL query. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.GetEsqlQueryRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.Json.GetEsqlQueryRequestConverter))] public sealed partial class GetEsqlQueryRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/GetEsqlQueryResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/GetEsqlQueryResponse.Converters.g.cs new file mode 100644 index 00000000000..9d08b6a6df5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/GetEsqlQueryResponse.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Esql.Json; + +public sealed partial class GetEsqlQueryResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCoordinatingNode = System.Text.Json.JsonEncodedText.Encode("coordinating_node"); + private static readonly System.Text.Json.JsonEncodedText PropDataNodes = System.Text.Json.JsonEncodedText.Encode("data_nodes"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropRunningTimeNanos = System.Text.Json.JsonEncodedText.Encode("running_time_nanos"); + private static readonly System.Text.Json.JsonEncodedText PropStartTimeMillis = System.Text.Json.JsonEncodedText.Encode("start_time_millis"); + + public override Elastic.Clients.Elasticsearch.Esql.GetEsqlQueryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCoordinatingNode = default; + LocalJsonValue> propDataNodes = default; + LocalJsonValue propId = default; + LocalJsonValue propNode = default; + LocalJsonValue propQuery = default; + LocalJsonValue propRunningTimeNanos = default; + LocalJsonValue propStartTimeMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCoordinatingNode.TryReadProperty(ref reader, options, PropCoordinatingNode, null)) + { + continue; + } + + if (propDataNodes.TryReadProperty(ref reader, options, PropDataNodes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propNode.TryReadProperty(ref reader, options, PropNode, null)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propRunningTimeNanos.TryReadProperty(ref reader, options, PropRunningTimeNanos, null)) + { + continue; + } + + if (propStartTimeMillis.TryReadProperty(ref reader, options, PropStartTimeMillis, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Esql.GetEsqlQueryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CoordinatingNode = propCoordinatingNode.Value, + DataNodes = propDataNodes.Value, + Id = propId.Value, + Node = propNode.Value, + Query = propQuery.Value, + RunningTimeNanos = propRunningTimeNanos.Value, + StartTimeMillis = propStartTimeMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.GetEsqlQueryResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCoordinatingNode, value.CoordinatingNode, null, null); + writer.WriteProperty(options, PropDataNodes, value.DataNodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropNode, value.Node, null, null); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropRunningTimeNanos, value.RunningTimeNanos, null, null); + writer.WriteProperty(options, PropStartTimeMillis, value.StartTimeMillis, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/GetEsqlQueryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/GetEsqlQueryResponse.g.cs index 13a41859899..9436b896d1f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/GetEsqlQueryResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/GetEsqlQueryResponse.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Esql; -internal sealed partial class GetEsqlQueryResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCoordinatingNode = System.Text.Json.JsonEncodedText.Encode("coordinating_node"); - private static readonly System.Text.Json.JsonEncodedText PropDataNodes = System.Text.Json.JsonEncodedText.Encode("data_nodes"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropRunningTimeNanos = System.Text.Json.JsonEncodedText.Encode("running_time_nanos"); - private static readonly System.Text.Json.JsonEncodedText PropStartTimeMillis = System.Text.Json.JsonEncodedText.Encode("start_time_millis"); - - public override Elastic.Clients.Elasticsearch.Esql.GetEsqlQueryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCoordinatingNode = default; - LocalJsonValue> propDataNodes = default; - LocalJsonValue propId = default; - LocalJsonValue propNode = default; - LocalJsonValue propQuery = default; - LocalJsonValue propRunningTimeNanos = default; - LocalJsonValue propStartTimeMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCoordinatingNode.TryReadProperty(ref reader, options, PropCoordinatingNode, null)) - { - continue; - } - - if (propDataNodes.TryReadProperty(ref reader, options, PropDataNodes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propNode.TryReadProperty(ref reader, options, PropNode, null)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propRunningTimeNanos.TryReadProperty(ref reader, options, PropRunningTimeNanos, null)) - { - continue; - } - - if (propStartTimeMillis.TryReadProperty(ref reader, options, PropStartTimeMillis, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Esql.GetEsqlQueryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CoordinatingNode = propCoordinatingNode.Value, - DataNodes = propDataNodes.Value, - Id = propId.Value, - Node = propNode.Value, - Query = propQuery.Value, - RunningTimeNanos = propRunningTimeNanos.Value, - StartTimeMillis = propStartTimeMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.GetEsqlQueryResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCoordinatingNode, value.CoordinatingNode, null, null); - writer.WriteProperty(options, PropDataNodes, value.DataNodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropNode, value.Node, null, null); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropRunningTimeNanos, value.RunningTimeNanos, null, null); - writer.WriteProperty(options, PropStartTimeMillis, value.StartTimeMillis, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.GetEsqlQueryResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.Json.GetEsqlQueryResponseConverter))] public sealed partial class GetEsqlQueryResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -132,37 +39,37 @@ internal GetEsqlQueryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCo public #if NET7_0_OR_GREATER - required +required #endif - string CoordinatingNode { get; set; } +string CoordinatingNode { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection DataNodes { get; set; } +System.Collections.Generic.IReadOnlyCollection DataNodes { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long Id { get; set; } +long Id { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Node { get; set; } +string Node { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Query { get; set; } +string Query { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long RunningTimeNanos { get; set; } +long RunningTimeNanos { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long StartTimeMillis { get; set; } +long StartTimeMillis { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/ListQueriesRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/ListQueriesRequest.Converters.g.cs new file mode 100644 index 00000000000..429fb035209 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/ListQueriesRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Esql.Json; + +public sealed partial class ListQueriesRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Esql.ListQueriesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Esql.ListQueriesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.ListQueriesRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/ListQueriesRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/ListQueriesRequest.g.cs index b7cccab92cc..635f38e0483 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/ListQueriesRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/ListQueriesRequest.g.cs @@ -27,42 +27,13 @@ public sealed partial class ListQueriesRequestParameters : Elastic.Transport.Req { } -internal sealed partial class ListQueriesRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Esql.ListQueriesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Esql.ListQueriesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.ListQueriesRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get running ES|QL queries information. /// Returns an object containing IDs and other information about the running ES|QL queries. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.ListQueriesRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.Json.ListQueriesRequestConverter))] public sealed partial class ListQueriesRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/ListQueriesResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/ListQueriesResponse.Converters.g.cs new file mode 100644 index 00000000000..dd1df2a109e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/ListQueriesResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Esql.Json; + +public sealed partial class ListQueriesResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropQueries = System.Text.Json.JsonEncodedText.Encode("queries"); + + public override Elastic.Clients.Elasticsearch.Esql.ListQueriesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propQueries = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propQueries.TryReadProperty(ref reader, options, PropQueries, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Esql.ListQueriesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Queries = propQueries.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.ListQueriesResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropQueries, value.Queries, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/ListQueriesResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/ListQueriesResponse.g.cs index 46cb9b7929f..4add3ed88ba 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/ListQueriesResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/ListQueriesResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Esql; -internal sealed partial class ListQueriesResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropQueries = System.Text.Json.JsonEncodedText.Encode("queries"); - - public override Elastic.Clients.Elasticsearch.Esql.ListQueriesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propQueries = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propQueries.TryReadProperty(ref reader, options, PropQueries, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Esql.ListQueriesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Queries = propQueries.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.ListQueriesResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropQueries, value.Queries, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.ListQueriesResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.Json.ListQueriesResponseConverter))] public sealed partial class ListQueriesResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal ListQueriesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCon public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary Queries { get; set; } +System.Collections.Generic.IReadOnlyDictionary Queries { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsRequest.Converters.g.cs new file mode 100644 index 00000000000..6a9fdf1f361 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ExistsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.ExistsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ExistsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ExistsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsRequest.g.cs index 68a57ba22d8..da1965496a9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsRequest.g.cs @@ -112,35 +112,6 @@ public sealed partial class ExistsRequestParameters : Elastic.Transport.RequestP public Elastic.Clients.Elasticsearch.VersionType? VersionType { get => Q("version_type"); set => Q("version_type", value); } } -internal sealed partial class ExistsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.ExistsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ExistsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ExistsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Check a document. @@ -168,7 +139,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Elasticsearch cleans up deleted documents in the background as you continue to index more data. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ExistsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ExistsRequestConverter))] public sealed partial class ExistsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsResponse.Converters.g.cs new file mode 100644 index 00000000000..828d0e111ab --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsResponse.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ExistsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.ExistsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ExistsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ExistsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsResponse.g.cs index 3d985a2fa68..b0ac46d60a1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsResponse.g.cs @@ -23,36 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class ExistsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.ExistsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ExistsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ExistsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ExistsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ExistsResponseConverter))] public sealed partial class ExistsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceRequest.Converters.g.cs new file mode 100644 index 00000000000..ec8182d2f1f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ExistsSourceRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.ExistsSourceRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ExistsSourceRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ExistsSourceRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceRequest.g.cs index 69ec3b5b575..db9f89bfa61 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceRequest.g.cs @@ -92,35 +92,6 @@ public sealed partial class ExistsSourceRequestParameters : Elastic.Transport.Re public Elastic.Clients.Elasticsearch.VersionType? VersionType { get => Q("version_type"); set => Q("version_type", value); } } -internal sealed partial class ExistsSourceRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.ExistsSourceRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ExistsSourceRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ExistsSourceRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Check for a document source. @@ -136,7 +107,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// A document's source is not available if it is disabled in the mapping. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ExistsSourceRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ExistsSourceRequestConverter))] public sealed partial class ExistsSourceRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceResponse.Converters.g.cs new file mode 100644 index 00000000000..fa01a5ae2f6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceResponse.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ExistsSourceResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.ExistsSourceResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ExistsSourceResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ExistsSourceResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceResponse.g.cs index 73a0da491ff..b8b4d5a0956 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceResponse.g.cs @@ -23,36 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class ExistsSourceResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.ExistsSourceResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ExistsSourceResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ExistsSourceResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ExistsSourceResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ExistsSourceResponseConverter))] public sealed partial class ExistsSourceResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainRequest.Converters.g.cs new file mode 100644 index 00000000000..27d239c634b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ExplainRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + + public override Elastic.Clients.Elasticsearch.ExplainRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propQuery = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ExplainRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Query = propQuery.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ExplainRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainRequest.g.cs index 13ff52fde28..f57d8ed8657 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainRequest.g.cs @@ -121,45 +121,6 @@ public sealed partial class ExplainRequestParameters : Elastic.Transport.Request public Elastic.Clients.Elasticsearch.Fields? StoredFields { get => Q("stored_fields"); set => Q("stored_fields", value); } } -internal sealed partial class ExplainRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - - public override Elastic.Clients.Elasticsearch.ExplainRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propQuery = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ExplainRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Query = propQuery.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ExplainRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Explain a document match result. @@ -167,7 +128,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// It computes a score explanation for a query and a specific document. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ExplainRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ExplainRequestConverter))] public sealed partial class ExplainRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainResponse.Converters.g.cs new file mode 100644 index 00000000000..b641b33eb8d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainResponse.Converters.g.cs @@ -0,0 +1,115 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ExplainResponseConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropExplanation = System.Text.Json.JsonEncodedText.Encode("explanation"); + private static readonly System.Text.Json.JsonEncodedText PropGet = System.Text.Json.JsonEncodedText.Encode("get"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); + private static readonly System.Text.Json.JsonEncodedText PropMatched = System.Text.Json.JsonEncodedText.Encode("matched"); + + public override Elastic.Clients.Elasticsearch.ExplainResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExplanation = default; + LocalJsonValue?> propGet = default; + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + LocalJsonValue propMatched = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExplanation.TryReadProperty(ref reader, options, PropExplanation, null)) + { + continue; + } + + if (propGet.TryReadProperty(ref reader, options, PropGet, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propMatched.TryReadProperty(ref reader, options, PropMatched, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ExplainResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Explanation = propExplanation.Value, + Get = propGet.Value, + Id = propId.Value, + Index = propIndex.Value, + Matched = propMatched.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ExplainResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExplanation, value.Explanation, null, null); + writer.WriteProperty(options, PropGet, value.Get, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropMatched, value.Matched, null, null); + writer.WriteEndObject(); + } +} + +public sealed partial class ExplainResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(ExplainResponse<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(ExplainResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainResponse.g.cs index c05ebf3e826..c8c1bd41b92 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainResponse.g.cs @@ -23,98 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class ExplainResponseConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropExplanation = System.Text.Json.JsonEncodedText.Encode("explanation"); - private static readonly System.Text.Json.JsonEncodedText PropGet = System.Text.Json.JsonEncodedText.Encode("get"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); - private static readonly System.Text.Json.JsonEncodedText PropMatched = System.Text.Json.JsonEncodedText.Encode("matched"); - - public override Elastic.Clients.Elasticsearch.ExplainResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propExplanation = default; - LocalJsonValue?> propGet = default; - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - LocalJsonValue propMatched = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExplanation.TryReadProperty(ref reader, options, PropExplanation, null)) - { - continue; - } - - if (propGet.TryReadProperty(ref reader, options, PropGet, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propMatched.TryReadProperty(ref reader, options, PropMatched, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ExplainResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Explanation = propExplanation.Value, - Get = propGet.Value, - Id = propId.Value, - Index = propIndex.Value, - Matched = propMatched.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ExplainResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExplanation, value.Explanation, null, null); - writer.WriteProperty(options, PropGet, value.Get, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropMatched, value.Matched, null, null); - writer.WriteEndObject(); - } -} - -internal sealed partial class ExplainResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(ExplainResponse<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(ExplainResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ExplainResponseConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ExplainResponseConverterFactory))] public sealed partial class ExplainResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -132,17 +41,17 @@ internal ExplainResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstru public Elastic.Clients.Elasticsearch.InlineGet? Get { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Id { get; set; } +string Id { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Index { get; set; } +string Index { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool Matched { get; set; } +bool Matched { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/GetFeaturesRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/GetFeaturesRequest.Converters.g.cs new file mode 100644 index 00000000000..909f975a7b5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/GetFeaturesRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Features.Json; + +public sealed partial class GetFeaturesRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Features.GetFeaturesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Features.GetFeaturesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Features.GetFeaturesRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/GetFeaturesRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/GetFeaturesRequest.g.cs index 749b4ed3bd2..25933cc7443 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/GetFeaturesRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/GetFeaturesRequest.g.cs @@ -33,35 +33,6 @@ public sealed partial class GetFeaturesRequestParameters : Elastic.Transport.Req public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class GetFeaturesRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Features.GetFeaturesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Features.GetFeaturesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Features.GetFeaturesRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get the features. @@ -78,7 +49,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// In order for a feature state to be listed in this API and recognized as a valid feature state by the create snapshot API, the plugin that defines that feature must be installed on the master node. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Features.GetFeaturesRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Features.Json.GetFeaturesRequestConverter))] public sealed partial class GetFeaturesRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/GetFeaturesResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/GetFeaturesResponse.Converters.g.cs new file mode 100644 index 00000000000..cf553e9694a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/GetFeaturesResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Features.Json; + +public sealed partial class GetFeaturesResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFeatures = System.Text.Json.JsonEncodedText.Encode("features"); + + public override Elastic.Clients.Elasticsearch.Features.GetFeaturesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propFeatures = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFeatures.TryReadProperty(ref reader, options, PropFeatures, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Features.GetFeaturesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Features = propFeatures.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Features.GetFeaturesResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFeatures, value.Features, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/GetFeaturesResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/GetFeaturesResponse.g.cs index e408c4f84ca..8dfa4654604 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/GetFeaturesResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/GetFeaturesResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Features; -internal sealed partial class GetFeaturesResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFeatures = System.Text.Json.JsonEncodedText.Encode("features"); - - public override Elastic.Clients.Elasticsearch.Features.GetFeaturesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propFeatures = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFeatures.TryReadProperty(ref reader, options, PropFeatures, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Features.GetFeaturesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Features = propFeatures.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Features.GetFeaturesResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFeatures, value.Features, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Features.GetFeaturesResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Features.Json.GetFeaturesResponseConverter))] public sealed partial class GetFeaturesResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal GetFeaturesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCon public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Features { get; set; } +System.Collections.Generic.IReadOnlyCollection Features { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/ResetFeaturesRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/ResetFeaturesRequest.Converters.g.cs new file mode 100644 index 00000000000..cb6d8efbeae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/ResetFeaturesRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Features.Json; + +public sealed partial class ResetFeaturesRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Features.ResetFeaturesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Features.ResetFeaturesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Features.ResetFeaturesRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/ResetFeaturesRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/ResetFeaturesRequest.g.cs index d8ccdc19b57..bc39a39ad2d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/ResetFeaturesRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/ResetFeaturesRequest.g.cs @@ -33,35 +33,6 @@ public sealed partial class ResetFeaturesRequestParameters : Elastic.Transport.R public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class ResetFeaturesRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Features.ResetFeaturesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Features.ResetFeaturesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Features.ResetFeaturesRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Reset the features. @@ -89,7 +60,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// IMPORTANT: The features installed on the node you submit this request to are the features that will be reset. Run on the master node if you have any doubts about which plugins are installed on individual nodes. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Features.ResetFeaturesRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Features.Json.ResetFeaturesRequestConverter))] public sealed partial class ResetFeaturesRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/ResetFeaturesResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/ResetFeaturesResponse.Converters.g.cs new file mode 100644 index 00000000000..c218c14940e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/ResetFeaturesResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Features.Json; + +public sealed partial class ResetFeaturesResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFeatures = System.Text.Json.JsonEncodedText.Encode("features"); + + public override Elastic.Clients.Elasticsearch.Features.ResetFeaturesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propFeatures = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFeatures.TryReadProperty(ref reader, options, PropFeatures, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Features.ResetFeaturesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Features = propFeatures.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Features.ResetFeaturesResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFeatures, value.Features, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/ResetFeaturesResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/ResetFeaturesResponse.g.cs index ef610dc435b..b50da193d58 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/ResetFeaturesResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/ResetFeaturesResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Features; -internal sealed partial class ResetFeaturesResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFeatures = System.Text.Json.JsonEncodedText.Encode("features"); - - public override Elastic.Clients.Elasticsearch.Features.ResetFeaturesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propFeatures = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFeatures.TryReadProperty(ref reader, options, PropFeatures, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Features.ResetFeaturesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Features = propFeatures.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Features.ResetFeaturesResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFeatures, value.Features, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Features.ResetFeaturesResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Features.Json.ResetFeaturesResponseConverter))] public sealed partial class ResetFeaturesResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal ResetFeaturesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonC public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Features { get; set; } +System.Collections.Generic.IReadOnlyCollection Features { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/FieldCapsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/FieldCapsRequest.Converters.g.cs new file mode 100644 index 00000000000..4d1fff9bb98 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/FieldCapsRequest.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class FieldCapsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIndexFilter = System.Text.Json.JsonEncodedText.Encode("index_filter"); + private static readonly System.Text.Json.JsonEncodedText PropRuntimeMappings = System.Text.Json.JsonEncodedText.Encode("runtime_mappings"); + + public override Elastic.Clients.Elasticsearch.FieldCapsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFields = default; + LocalJsonValue propIndexFilter = default; + LocalJsonValue?> propRuntimeMappings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFields.TryReadProperty(ref reader, options, PropFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propIndexFilter.TryReadProperty(ref reader, options, PropIndexFilter, null)) + { + continue; + } + + if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.FieldCapsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Fields = propFields.Value, + IndexFilter = propIndexFilter.Value, + RuntimeMappings = propRuntimeMappings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.FieldCapsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropIndexFilter, value.IndexFilter, null, null); + writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/FieldCapsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/FieldCapsRequest.g.cs index eb86b167775..c984fff8309 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/FieldCapsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/FieldCapsRequest.g.cs @@ -79,63 +79,6 @@ public sealed partial class FieldCapsRequestParameters : Elastic.Transport.Reque public System.Collections.Generic.ICollection? Types { get => Q?>("types"); set => Q("types", value); } } -internal sealed partial class FieldCapsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIndexFilter = System.Text.Json.JsonEncodedText.Encode("index_filter"); - private static readonly System.Text.Json.JsonEncodedText PropRuntimeMappings = System.Text.Json.JsonEncodedText.Encode("runtime_mappings"); - - public override Elastic.Clients.Elasticsearch.FieldCapsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFields = default; - LocalJsonValue propIndexFilter = default; - LocalJsonValue?> propRuntimeMappings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFields.TryReadProperty(ref reader, options, PropFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propIndexFilter.TryReadProperty(ref reader, options, PropIndexFilter, null)) - { - continue; - } - - if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.FieldCapsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Fields = propFields.Value, - IndexFilter = propIndexFilter.Value, - RuntimeMappings = propRuntimeMappings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.FieldCapsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropIndexFilter, value.IndexFilter, null, null); - writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - /// /// /// Get the field capabilities. @@ -149,7 +92,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// For example, a runtime field with a type of keyword is returned the same as any other field that belongs to the keyword family. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.FieldCapsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.FieldCapsRequestConverter))] public sealed partial class FieldCapsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public FieldCapsRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/FieldCapsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/FieldCapsResponse.Converters.g.cs new file mode 100644 index 00000000000..119b1ff65b4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/FieldCapsResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class FieldCapsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + + public override Elastic.Clients.Elasticsearch.FieldCapsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>> propFields = default; + LocalJsonValue> propIndices = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)!)) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.FieldCapsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Fields = propFields.Value, + Indices = propIndices.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.FieldCapsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null))); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/FieldCapsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/FieldCapsResponse.g.cs index 1a4d2e20066..378c472e070 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/FieldCapsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/FieldCapsResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class FieldCapsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - - public override Elastic.Clients.Elasticsearch.FieldCapsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>> propFields = default; - LocalJsonValue> propIndices = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)!)) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.FieldCapsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Fields = propFields.Value, - Indices = propIndices.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.FieldCapsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null))); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.FieldCapsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.FieldCapsResponseConverter))] public sealed partial class FieldCapsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,9 +39,9 @@ internal FieldCapsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConst public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary> Fields { get; set; } +System.Collections.Generic.IReadOnlyDictionary> Fields { get; set; } /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetRequest.Converters.g.cs new file mode 100644 index 00000000000..56d11a06766 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class GetRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.GetRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.GetRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GetRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetRequest.g.cs index 18404739209..b460432671b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetRequest.g.cs @@ -130,35 +130,6 @@ public sealed partial class GetRequestParameters : Elastic.Transport.RequestPara public Elastic.Clients.Elasticsearch.VersionType? VersionType { get => Q("version_type"); set => Q("version_type", value); } } -internal sealed partial class GetRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.GetRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.GetRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GetRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get a document by its ID. @@ -231,7 +202,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Elasticsearch cleans up deleted documents in the background as you continue to index more data. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.GetRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.GetRequestConverter))] public sealed partial class GetRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetResponse.Converters.g.cs new file mode 100644 index 00000000000..771febbae82 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetResponse.Converters.g.cs @@ -0,0 +1,160 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class GetResponseConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropFound = System.Text.Json.JsonEncodedText.Encode("found"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); + private static readonly System.Text.Json.JsonEncodedText PropIgnored = System.Text.Json.JsonEncodedText.Encode("_ignored"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); + private static readonly System.Text.Json.JsonEncodedText PropPrimaryTerm = System.Text.Json.JsonEncodedText.Encode("_primary_term"); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("_routing"); + private static readonly System.Text.Json.JsonEncodedText PropSeqNo = System.Text.Json.JsonEncodedText.Encode("_seq_no"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("_version"); + + public override Elastic.Clients.Elasticsearch.GetResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propFields = default; + LocalJsonValue propFound = default; + LocalJsonValue propId = default; + LocalJsonValue?> propIgnored = default; + LocalJsonValue propIndex = default; + LocalJsonValue propPrimaryTerm = default; + LocalJsonValue propRouting = default; + LocalJsonValue propSeqNo = default; + LocalJsonValue propSource = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propFound.TryReadProperty(ref reader, options, PropFound, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIgnored.TryReadProperty(ref reader, options, PropIgnored, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propPrimaryTerm.TryReadProperty(ref reader, options, PropPrimaryTerm, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (propSeqNo.TryReadProperty(ref reader, options, PropSeqNo, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, static TDocument? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.GetResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Fields = propFields.Value, + Found = propFound.Value, + Id = propId.Value, + Ignored = propIgnored.Value, + Index = propIndex.Value, + PrimaryTerm = propPrimaryTerm.Value, + Routing = propRouting.Value, + SeqNo = propSeqNo.Value, + Source = propSource.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GetResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropFound, value.Found, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIgnored, value.Ignored, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropPrimaryTerm, value.PrimaryTerm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteProperty(options, PropSeqNo, value.SeqNo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSource, value.Source, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TDocument? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} + +public sealed partial class GetResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(GetResponse<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(GetResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetResponse.g.cs index 8ed98ae62b4..f9deed616b3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetResponse.g.cs @@ -23,143 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class GetResponseConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropFound = System.Text.Json.JsonEncodedText.Encode("found"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - private static readonly System.Text.Json.JsonEncodedText PropIgnored = System.Text.Json.JsonEncodedText.Encode("_ignored"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); - private static readonly System.Text.Json.JsonEncodedText PropPrimaryTerm = System.Text.Json.JsonEncodedText.Encode("_primary_term"); - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("_routing"); - private static readonly System.Text.Json.JsonEncodedText PropSeqNo = System.Text.Json.JsonEncodedText.Encode("_seq_no"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("_version"); - - public override Elastic.Clients.Elasticsearch.GetResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propFields = default; - LocalJsonValue propFound = default; - LocalJsonValue propId = default; - LocalJsonValue?> propIgnored = default; - LocalJsonValue propIndex = default; - LocalJsonValue propPrimaryTerm = default; - LocalJsonValue propRouting = default; - LocalJsonValue propSeqNo = default; - LocalJsonValue propSource = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propFound.TryReadProperty(ref reader, options, PropFound, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIgnored.TryReadProperty(ref reader, options, PropIgnored, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propPrimaryTerm.TryReadProperty(ref reader, options, PropPrimaryTerm, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (propSeqNo.TryReadProperty(ref reader, options, PropSeqNo, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, static TDocument? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.GetResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Fields = propFields.Value, - Found = propFound.Value, - Id = propId.Value, - Ignored = propIgnored.Value, - Index = propIndex.Value, - PrimaryTerm = propPrimaryTerm.Value, - Routing = propRouting.Value, - SeqNo = propSeqNo.Value, - Source = propSource.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GetResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropFound, value.Found, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIgnored, value.Ignored, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropPrimaryTerm, value.PrimaryTerm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteProperty(options, PropSeqNo, value.SeqNo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSource, value.Source, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TDocument? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -internal sealed partial class GetResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(GetResponse<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(GetResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.GetResponseConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.GetResponseConverterFactory))] public sealed partial class GetResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptContextRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptContextRequest.Converters.g.cs new file mode 100644 index 00000000000..023f39d9dd1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptContextRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class GetScriptContextRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.GetScriptContextRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.GetScriptContextRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GetScriptContextRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptContextRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptContextRequest.g.cs index 76328dc04dc..3d874a42bb9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptContextRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptContextRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class GetScriptContextRequestParameters : Elastic.Transpor { } -internal sealed partial class GetScriptContextRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.GetScriptContextRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.GetScriptContextRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GetScriptContextRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get script contexts. @@ -64,7 +35,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Get a list of supported script contexts and their methods. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.GetScriptContextRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.GetScriptContextRequestConverter))] public sealed partial class GetScriptContextRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptContextResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptContextResponse.Converters.g.cs new file mode 100644 index 00000000000..bd4359cad03 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptContextResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class GetScriptContextResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropContexts = System.Text.Json.JsonEncodedText.Encode("contexts"); + + public override Elastic.Clients.Elasticsearch.GetScriptContextResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propContexts = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propContexts.TryReadProperty(ref reader, options, PropContexts, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.GetScriptContextResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Contexts = propContexts.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GetScriptContextResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropContexts, value.Contexts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptContextResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptContextResponse.g.cs index 8a91073a6c9..f5aac4cc8f8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptContextResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptContextResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class GetScriptContextResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropContexts = System.Text.Json.JsonEncodedText.Encode("contexts"); - - public override Elastic.Clients.Elasticsearch.GetScriptContextResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propContexts = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propContexts.TryReadProperty(ref reader, options, PropContexts, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.GetScriptContextResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Contexts = propContexts.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GetScriptContextResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropContexts, value.Contexts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.GetScriptContextResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.GetScriptContextResponseConverter))] public sealed partial class GetScriptContextResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal GetScriptContextResponse(Elastic.Clients.Elasticsearch.Serialization.Js public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Contexts { get; set; } +System.Collections.Generic.IReadOnlyCollection Contexts { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptLanguagesRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptLanguagesRequest.Converters.g.cs new file mode 100644 index 00000000000..8adb425d8a7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptLanguagesRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class GetScriptLanguagesRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.GetScriptLanguagesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.GetScriptLanguagesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GetScriptLanguagesRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptLanguagesRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptLanguagesRequest.g.cs index 6683edc7178..2a9908cefa0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptLanguagesRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptLanguagesRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class GetScriptLanguagesRequestParameters : Elastic.Transp { } -internal sealed partial class GetScriptLanguagesRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.GetScriptLanguagesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.GetScriptLanguagesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GetScriptLanguagesRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get script languages. @@ -64,7 +35,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Get a list of available script types, languages, and contexts. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.GetScriptLanguagesRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.GetScriptLanguagesRequestConverter))] public sealed partial class GetScriptLanguagesRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptLanguagesResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptLanguagesResponse.Converters.g.cs new file mode 100644 index 00000000000..b655dd853fc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptLanguagesResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class GetScriptLanguagesResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLanguageContexts = System.Text.Json.JsonEncodedText.Encode("language_contexts"); + private static readonly System.Text.Json.JsonEncodedText PropTypesAllowed = System.Text.Json.JsonEncodedText.Encode("types_allowed"); + + public override Elastic.Clients.Elasticsearch.GetScriptLanguagesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propLanguageContexts = default; + LocalJsonValue> propTypesAllowed = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLanguageContexts.TryReadProperty(ref reader, options, PropLanguageContexts, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propTypesAllowed.TryReadProperty(ref reader, options, PropTypesAllowed, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.GetScriptLanguagesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + LanguageContexts = propLanguageContexts.Value, + TypesAllowed = propTypesAllowed.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GetScriptLanguagesResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLanguageContexts, value.LanguageContexts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTypesAllowed, value.TypesAllowed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptLanguagesResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptLanguagesResponse.g.cs index a8253210a4b..6e28eb4424a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptLanguagesResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptLanguagesResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class GetScriptLanguagesResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLanguageContexts = System.Text.Json.JsonEncodedText.Encode("language_contexts"); - private static readonly System.Text.Json.JsonEncodedText PropTypesAllowed = System.Text.Json.JsonEncodedText.Encode("types_allowed"); - - public override Elastic.Clients.Elasticsearch.GetScriptLanguagesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propLanguageContexts = default; - LocalJsonValue> propTypesAllowed = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLanguageContexts.TryReadProperty(ref reader, options, PropLanguageContexts, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propTypesAllowed.TryReadProperty(ref reader, options, PropTypesAllowed, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.GetScriptLanguagesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - LanguageContexts = propLanguageContexts.Value, - TypesAllowed = propTypesAllowed.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GetScriptLanguagesResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLanguageContexts, value.LanguageContexts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTypesAllowed, value.TypesAllowed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.GetScriptLanguagesResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.GetScriptLanguagesResponseConverter))] public sealed partial class GetScriptLanguagesResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal GetScriptLanguagesResponse(Elastic.Clients.Elasticsearch.Serialization. public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection LanguageContexts { get; set; } +System.Collections.Generic.IReadOnlyCollection LanguageContexts { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection TypesAllowed { get; set; } +System.Collections.Generic.IReadOnlyCollection TypesAllowed { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptRequest.Converters.g.cs new file mode 100644 index 00000000000..e4a98e1d88a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class GetScriptRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.GetScriptRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.GetScriptRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GetScriptRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptRequest.g.cs index 2eed12f90e1..e5152b61c31 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptRequest.g.cs @@ -35,42 +35,13 @@ public sealed partial class GetScriptRequestParameters : Elastic.Transport.Reque public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class GetScriptRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.GetScriptRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.GetScriptRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GetScriptRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get a script or search template. /// Retrieves a stored script or search template. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.GetScriptRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.GetScriptRequestConverter))] public sealed partial class GetScriptRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptResponse.Converters.g.cs new file mode 100644 index 00000000000..9ed663c8c35 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class GetScriptResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFound = System.Text.Json.JsonEncodedText.Encode("found"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.GetScriptResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFound = default; + LocalJsonValue propId = default; + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFound.TryReadProperty(ref reader, options, PropFound, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.GetScriptResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Found = propFound.Value, + Id = propId.Value, + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GetScriptResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFound, value.Found, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptResponse.g.cs index 5b151620d9b..27724bc83ae 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetScriptResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class GetScriptResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFound = System.Text.Json.JsonEncodedText.Encode("found"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.GetScriptResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFound = default; - LocalJsonValue propId = default; - LocalJsonValue propScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFound.TryReadProperty(ref reader, options, PropFound, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.GetScriptResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Found = propFound.Value, - Id = propId.Value, - Script = propScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GetScriptResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFound, value.Found, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.GetScriptResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.GetScriptResponseConverter))] public sealed partial class GetScriptResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -96,13 +39,13 @@ internal GetScriptResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConst public #if NET7_0_OR_GREATER - required +required #endif - bool Found { get; set; } +bool Found { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Id { get; set; } +string Id { get; set; } public Elastic.Clients.Elasticsearch.StoredScript? Script { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceRequest.Converters.g.cs new file mode 100644 index 00000000000..4e2472eac9e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class GetSourceRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.GetSourceRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.GetSourceRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GetSourceRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceRequest.g.cs index 1a11bf0d20c..d54a1937f0b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceRequest.g.cs @@ -92,35 +92,6 @@ public sealed partial class GetSourceRequestParameters : Elastic.Transport.Reque public Elastic.Clients.Elasticsearch.VersionType? VersionType { get => Q("version_type"); set => Q("version_type", value); } } -internal sealed partial class GetSourceRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.GetSourceRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.GetSourceRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GetSourceRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get a document's source. @@ -139,7 +110,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// GET my-index-000001/_source/1/?_source_includes=*.id&_source_excludes=entities /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.GetSourceRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.GetSourceRequestConverter))] public sealed partial class GetSourceRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceResponse.Converters.g.cs new file mode 100644 index 00000000000..963a0824575 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceResponse.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class GetSourceResponseConverter : System.Text.Json.Serialization.JsonConverter> +{ + public override Elastic.Clients.Elasticsearch.GetSourceResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.GetSourceResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Source = reader.ReadValue(options, static TDocument (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GetSourceResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Source, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TDocument v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + } +} + +public sealed partial class GetSourceResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(GetSourceResponse<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(GetSourceResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceResponse.g.cs index cb73935ccb8..0de8fa92562 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/GetSourceResponse.g.cs @@ -23,36 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class GetSourceResponseConverter : System.Text.Json.Serialization.JsonConverter> -{ - public override Elastic.Clients.Elasticsearch.GetSourceResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.GetSourceResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Source = reader.ReadValue(options, static TDocument (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GetSourceResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Source, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TDocument v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - } -} - -internal sealed partial class GetSourceResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(GetSourceResponse<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(GetSourceResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.GetSourceResponseConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.GetSourceResponseConverterFactory))] public partial class GetSourceResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/ExploreRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/ExploreRequest.Converters.g.cs new file mode 100644 index 00000000000..73e05ae2adb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/ExploreRequest.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Graph.Json; + +public sealed partial class ExploreRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropConnections = System.Text.Json.JsonEncodedText.Encode("connections"); + private static readonly System.Text.Json.JsonEncodedText PropControls = System.Text.Json.JsonEncodedText.Encode("controls"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropVertices = System.Text.Json.JsonEncodedText.Encode("vertices"); + + public override Elastic.Clients.Elasticsearch.Graph.ExploreRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propConnections = default; + LocalJsonValue propControls = default; + LocalJsonValue propQuery = default; + LocalJsonValue?> propVertices = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propConnections.TryReadProperty(ref reader, options, PropConnections, null)) + { + continue; + } + + if (propControls.TryReadProperty(ref reader, options, PropControls, null)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propVertices.TryReadProperty(ref reader, options, PropVertices, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Graph.ExploreRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Connections = propConnections.Value, + Controls = propControls.Value, + Query = propQuery.Value, + Vertices = propVertices.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Graph.ExploreRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropConnections, value.Connections, null, null); + writer.WriteProperty(options, PropControls, value.Controls, null, null); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropVertices, value.Vertices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/ExploreRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/ExploreRequest.g.cs index 28df2adcebe..d8f888f508f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/ExploreRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/ExploreRequest.g.cs @@ -42,72 +42,6 @@ public sealed partial class ExploreRequestParameters : Elastic.Transport.Request public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class ExploreRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropConnections = System.Text.Json.JsonEncodedText.Encode("connections"); - private static readonly System.Text.Json.JsonEncodedText PropControls = System.Text.Json.JsonEncodedText.Encode("controls"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropVertices = System.Text.Json.JsonEncodedText.Encode("vertices"); - - public override Elastic.Clients.Elasticsearch.Graph.ExploreRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propConnections = default; - LocalJsonValue propControls = default; - LocalJsonValue propQuery = default; - LocalJsonValue?> propVertices = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propConnections.TryReadProperty(ref reader, options, PropConnections, null)) - { - continue; - } - - if (propControls.TryReadProperty(ref reader, options, PropControls, null)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propVertices.TryReadProperty(ref reader, options, PropVertices, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Graph.ExploreRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Connections = propConnections.Value, - Controls = propControls.Value, - Query = propQuery.Value, - Vertices = propVertices.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Graph.ExploreRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropConnections, value.Connections, null, null); - writer.WriteProperty(options, PropControls, value.Controls, null, null); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropVertices, value.Vertices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// Explore graph analytics. @@ -118,7 +52,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// You can exclude vertices that have already been returned. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Graph.ExploreRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Graph.Json.ExploreRequestConverter))] public sealed partial class ExploreRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/ExploreResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/ExploreResponse.Converters.g.cs new file mode 100644 index 00000000000..bb9511e6f7b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/ExploreResponse.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Graph.Json; + +public sealed partial class ExploreResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropConnections = System.Text.Json.JsonEncodedText.Encode("connections"); + private static readonly System.Text.Json.JsonEncodedText PropFailures = System.Text.Json.JsonEncodedText.Encode("failures"); + private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); + private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); + private static readonly System.Text.Json.JsonEncodedText PropVertices = System.Text.Json.JsonEncodedText.Encode("vertices"); + + public override Elastic.Clients.Elasticsearch.Graph.ExploreResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propConnections = default; + LocalJsonValue> propFailures = default; + LocalJsonValue propTimedOut = default; + LocalJsonValue propTook = default; + LocalJsonValue> propVertices = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propConnections.TryReadProperty(ref reader, options, PropConnections, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propFailures.TryReadProperty(ref reader, options, PropFailures, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, null)) + { + continue; + } + + if (propTook.TryReadProperty(ref reader, options, PropTook, null)) + { + continue; + } + + if (propVertices.TryReadProperty(ref reader, options, PropVertices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Graph.ExploreResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Connections = propConnections.Value, + Failures = propFailures.Value, + TimedOut = propTimedOut.Value, + Took = propTook.Value, + Vertices = propVertices.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Graph.ExploreResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropConnections, value.Connections, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFailures, value.Failures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, null); + writer.WriteProperty(options, PropTook, value.Took, null, null); + writer.WriteProperty(options, PropVertices, value.Vertices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/ExploreResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/ExploreResponse.g.cs index 55c5631a5b9..85381725dbc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/ExploreResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Graph/ExploreResponse.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Graph; -internal sealed partial class ExploreResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropConnections = System.Text.Json.JsonEncodedText.Encode("connections"); - private static readonly System.Text.Json.JsonEncodedText PropFailures = System.Text.Json.JsonEncodedText.Encode("failures"); - private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); - private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); - private static readonly System.Text.Json.JsonEncodedText PropVertices = System.Text.Json.JsonEncodedText.Encode("vertices"); - - public override Elastic.Clients.Elasticsearch.Graph.ExploreResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propConnections = default; - LocalJsonValue> propFailures = default; - LocalJsonValue propTimedOut = default; - LocalJsonValue propTook = default; - LocalJsonValue> propVertices = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propConnections.TryReadProperty(ref reader, options, PropConnections, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propFailures.TryReadProperty(ref reader, options, PropFailures, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, null)) - { - continue; - } - - if (propTook.TryReadProperty(ref reader, options, PropTook, null)) - { - continue; - } - - if (propVertices.TryReadProperty(ref reader, options, PropVertices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Graph.ExploreResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Connections = propConnections.Value, - Failures = propFailures.Value, - TimedOut = propTimedOut.Value, - Took = propTook.Value, - Vertices = propVertices.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Graph.ExploreResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropConnections, value.Connections, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFailures, value.Failures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, null); - writer.WriteProperty(options, PropTook, value.Took, null, null); - writer.WriteProperty(options, PropVertices, value.Vertices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Graph.ExploreResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Graph.Json.ExploreResponseConverter))] public sealed partial class ExploreResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -114,27 +39,27 @@ internal ExploreResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstru public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Connections { get; set; } +System.Collections.Generic.IReadOnlyCollection Connections { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Failures { get; set; } +System.Collections.Generic.IReadOnlyCollection Failures { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool TimedOut { get; set; } +bool TimedOut { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long Took { get; set; } +long Took { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Vertices { get; set; } +System.Collections.Generic.IReadOnlyCollection Vertices { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/HealthReportRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/HealthReportRequest.Converters.g.cs new file mode 100644 index 00000000000..5b74352ec02 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/HealthReportRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class HealthReportRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.HealthReportRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.HealthReportRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.HealthReportRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/HealthReportRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/HealthReportRequest.g.cs index 0c7d9e53afd..991282e8bca 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/HealthReportRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/HealthReportRequest.g.cs @@ -47,35 +47,6 @@ public sealed partial class HealthReportRequestParameters : Elastic.Transport.Re public bool? Verbose { get => Q("verbose"); set => Q("verbose", value); } } -internal sealed partial class HealthReportRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.HealthReportRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.HealthReportRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.HealthReportRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get the cluster health. @@ -103,7 +74,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// When setting up automated polling of the API for health status, set verbose to false to disable the more expensive analysis logic. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.HealthReportRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.HealthReportRequestConverter))] public sealed partial class HealthReportRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public HealthReportRequest(System.Collections.Generic.ICollection? feature) : base(r => r.Optional("feature", feature)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/HealthReportResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/HealthReportResponse.Converters.g.cs new file mode 100644 index 00000000000..22f6213f6b9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/HealthReportResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class HealthReportResponseConverter : 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 PropIndicators = System.Text.Json.JsonEncodedText.Encode("indicators"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + + public override Elastic.Clients.Elasticsearch.HealthReportResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClusterName = default; + LocalJsonValue propIndicators = default; + LocalJsonValue propStatus = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) + { + continue; + } + + if (propIndicators.TryReadProperty(ref reader, options, PropIndicators, null)) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, static Elastic.Clients.Elasticsearch.Core.HealthReport.IndicatorHealthStatus? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.HealthReportResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClusterName = propClusterName.Value, + Indicators = propIndicators.Value, + Status = propStatus.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.HealthReportResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); + writer.WriteProperty(options, PropIndicators, value.Indicators, null, null); + writer.WriteProperty(options, PropStatus, value.Status, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.HealthReport.IndicatorHealthStatus? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/HealthReportResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/HealthReportResponse.g.cs index 624165f5504..d0f6dd93331 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/HealthReportResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/HealthReportResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class HealthReportResponseConverter : 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 PropIndicators = System.Text.Json.JsonEncodedText.Encode("indicators"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - - public override Elastic.Clients.Elasticsearch.HealthReportResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClusterName = default; - LocalJsonValue propIndicators = default; - LocalJsonValue propStatus = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) - { - continue; - } - - if (propIndicators.TryReadProperty(ref reader, options, PropIndicators, null)) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, static Elastic.Clients.Elasticsearch.Core.HealthReport.IndicatorHealthStatus? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.HealthReportResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClusterName = propClusterName.Value, - Indicators = propIndicators.Value, - Status = propStatus.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.HealthReportResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); - writer.WriteProperty(options, PropIndicators, value.Indicators, null, null); - writer.WriteProperty(options, PropStatus, value.Status, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.HealthReport.IndicatorHealthStatus? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.HealthReportResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.HealthReportResponseConverter))] public sealed partial class HealthReportResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -96,13 +39,13 @@ internal HealthReportResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCo public #if NET7_0_OR_GREATER - required +required #endif - string ClusterName { get; set; } +string ClusterName { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Core.HealthReport.Indicators Indicators { get; set; } +Elastic.Clients.Elasticsearch.Core.HealthReport.Indicators Indicators { get; set; } public Elastic.Clients.Elasticsearch.Core.HealthReport.IndicatorHealthStatus? Status { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/DeleteLifecycleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/DeleteLifecycleRequest.Converters.g.cs new file mode 100644 index 00000000000..fe55f498ad7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/DeleteLifecycleRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class DeleteLifecycleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteLifecycleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteLifecycleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteLifecycleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/DeleteLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/DeleteLifecycleRequest.g.cs index 3044b96a851..35338e8d136 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/DeleteLifecycleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/DeleteLifecycleRequest.g.cs @@ -40,42 +40,13 @@ public sealed partial class DeleteLifecycleRequestParameters : Elastic.Transport public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class DeleteLifecycleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteLifecycleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteLifecycleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteLifecycleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete a lifecycle policy. /// You cannot delete policies that are currently in use. If the policy is being used to manage any indices, the request fails and returns an error. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteLifecycleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.DeleteLifecycleRequestConverter))] public sealed partial class DeleteLifecycleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/DeleteLifecycleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/DeleteLifecycleResponse.Converters.g.cs new file mode 100644 index 00000000000..fabf24afaa9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/DeleteLifecycleResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class DeleteLifecycleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteLifecycleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteLifecycleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteLifecycleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/DeleteLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/DeleteLifecycleResponse.g.cs index abc3d083f92..f17dc9eaed5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/DeleteLifecycleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/DeleteLifecycleResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; -internal sealed partial class DeleteLifecycleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteLifecycleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteLifecycleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteLifecycleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteLifecycleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.DeleteLifecycleResponseConverter))] public sealed partial class DeleteLifecycleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetIlmStatusRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetIlmStatusRequest.Converters.g.cs new file mode 100644 index 00000000000..90969286623 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetIlmStatusRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class GetIlmStatusRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetIlmStatusRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetIlmStatusRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetIlmStatusRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetIlmStatusRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetIlmStatusRequest.g.cs index 339bce95d74..041ac9d91c1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetIlmStatusRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetIlmStatusRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class GetIlmStatusRequestParameters : Elastic.Transport.Re { } -internal sealed partial class GetIlmStatusRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetIlmStatusRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetIlmStatusRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetIlmStatusRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get the ILM status. @@ -64,7 +35,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Get the current index lifecycle management status. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetIlmStatusRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.GetIlmStatusRequestConverter))] public sealed partial class GetIlmStatusRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetIlmStatusResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetIlmStatusResponse.Converters.g.cs new file mode 100644 index 00000000000..653614709ba --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetIlmStatusResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class GetIlmStatusResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropOperationMode = System.Text.Json.JsonEncodedText.Encode("operation_mode"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetIlmStatusResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propOperationMode = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propOperationMode.TryReadProperty(ref reader, options, PropOperationMode, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetIlmStatusResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + OperationMode = propOperationMode.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetIlmStatusResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropOperationMode, value.OperationMode, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetIlmStatusResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetIlmStatusResponse.g.cs index 9d3cb2c91b8..cc3e5eb1045 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetIlmStatusResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetIlmStatusResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; -internal sealed partial class GetIlmStatusResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropOperationMode = System.Text.Json.JsonEncodedText.Encode("operation_mode"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetIlmStatusResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propOperationMode = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propOperationMode.TryReadProperty(ref reader, options, PropOperationMode, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetIlmStatusResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - OperationMode = propOperationMode.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetIlmStatusResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropOperationMode, value.OperationMode, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetIlmStatusResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.GetIlmStatusResponseConverter))] public sealed partial class GetIlmStatusResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal GetIlmStatusResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCo public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.LifecycleOperationMode OperationMode { get; set; } +Elastic.Clients.Elasticsearch.LifecycleOperationMode OperationMode { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetLifecycleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetLifecycleRequest.Converters.g.cs new file mode 100644 index 00000000000..b7bedcb9d46 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetLifecycleRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class GetLifecycleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetLifecycleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetLifecycleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetLifecycleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetLifecycleRequest.g.cs index d335fcf10c8..52e5f6bd72e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetLifecycleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetLifecycleRequest.g.cs @@ -40,41 +40,12 @@ public sealed partial class GetLifecycleRequestParameters : Elastic.Transport.Re public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class GetLifecycleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetLifecycleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetLifecycleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetLifecycleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get lifecycle policies. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetLifecycleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.GetLifecycleRequestConverter))] public sealed partial class GetLifecycleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetLifecycleRequest(Elastic.Clients.Elasticsearch.Name? name) : base(r => r.Optional("policy", name)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetLifecycleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetLifecycleResponse.Converters.g.cs new file mode 100644 index 00000000000..126dcca5c14 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetLifecycleResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class GetLifecycleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetLifecycleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetLifecycleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Lifecycles = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetLifecycleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Lifecycles, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetLifecycleResponse.g.cs index aad43ef2238..8de1cc5da70 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetLifecycleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/GetLifecycleResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; -internal sealed partial class GetLifecycleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetLifecycleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetLifecycleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Lifecycles = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetLifecycleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Lifecycles, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.GetLifecycleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.GetLifecycleResponseConverter))] public sealed partial class GetLifecycleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MigrateToDataTiersRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MigrateToDataTiersRequest.Converters.g.cs new file mode 100644 index 00000000000..79e2c3e9101 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MigrateToDataTiersRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class MigrateToDataTiersRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLegacyTemplateToDelete = System.Text.Json.JsonEncodedText.Encode("legacy_template_to_delete"); + private static readonly System.Text.Json.JsonEncodedText PropNodeAttribute = System.Text.Json.JsonEncodedText.Encode("node_attribute"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateToDataTiersRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLegacyTemplateToDelete = default; + LocalJsonValue propNodeAttribute = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLegacyTemplateToDelete.TryReadProperty(ref reader, options, PropLegacyTemplateToDelete, null)) + { + continue; + } + + if (propNodeAttribute.TryReadProperty(ref reader, options, PropNodeAttribute, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateToDataTiersRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + LegacyTemplateToDelete = propLegacyTemplateToDelete.Value, + NodeAttribute = propNodeAttribute.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateToDataTiersRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLegacyTemplateToDelete, value.LegacyTemplateToDelete, null, null); + writer.WriteProperty(options, PropNodeAttribute, value.NodeAttribute, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MigrateToDataTiersRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MigrateToDataTiersRequest.g.cs index 15b79526383..97280a87f47 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MigrateToDataTiersRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MigrateToDataTiersRequest.g.cs @@ -43,54 +43,6 @@ public sealed partial class MigrateToDataTiersRequestParameters : Elastic.Transp public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class MigrateToDataTiersRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLegacyTemplateToDelete = System.Text.Json.JsonEncodedText.Encode("legacy_template_to_delete"); - private static readonly System.Text.Json.JsonEncodedText PropNodeAttribute = System.Text.Json.JsonEncodedText.Encode("node_attribute"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateToDataTiersRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLegacyTemplateToDelete = default; - LocalJsonValue propNodeAttribute = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLegacyTemplateToDelete.TryReadProperty(ref reader, options, PropLegacyTemplateToDelete, null)) - { - continue; - } - - if (propNodeAttribute.TryReadProperty(ref reader, options, PropNodeAttribute, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateToDataTiersRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - LegacyTemplateToDelete = propLegacyTemplateToDelete.Value, - NodeAttribute = propNodeAttribute.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateToDataTiersRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLegacyTemplateToDelete, value.LegacyTemplateToDelete, null, null); - writer.WriteProperty(options, PropNodeAttribute, value.NodeAttribute, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Migrate to data tiers routing. @@ -124,7 +76,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Use the stop ILM and get ILM status APIs to wait until the reported operation mode is STOPPED. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateToDataTiersRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.MigrateToDataTiersRequestConverter))] public sealed partial class MigrateToDataTiersRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MigrateToDataTiersResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MigrateToDataTiersResponse.Converters.g.cs new file mode 100644 index 00000000000..3a250d6be76 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MigrateToDataTiersResponse.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class MigrateToDataTiersResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDryRun = System.Text.Json.JsonEncodedText.Encode("dry_run"); + private static readonly System.Text.Json.JsonEncodedText PropMigratedComponentTemplates = System.Text.Json.JsonEncodedText.Encode("migrated_component_templates"); + private static readonly System.Text.Json.JsonEncodedText PropMigratedComposableTemplates = System.Text.Json.JsonEncodedText.Encode("migrated_composable_templates"); + private static readonly System.Text.Json.JsonEncodedText PropMigratedIlmPolicies = System.Text.Json.JsonEncodedText.Encode("migrated_ilm_policies"); + private static readonly System.Text.Json.JsonEncodedText PropMigratedIndices = System.Text.Json.JsonEncodedText.Encode("migrated_indices"); + private static readonly System.Text.Json.JsonEncodedText PropMigratedLegacyTemplates = System.Text.Json.JsonEncodedText.Encode("migrated_legacy_templates"); + private static readonly System.Text.Json.JsonEncodedText PropRemovedLegacyTemplate = System.Text.Json.JsonEncodedText.Encode("removed_legacy_template"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateToDataTiersResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDryRun = default; + LocalJsonValue> propMigratedComponentTemplates = default; + LocalJsonValue> propMigratedComposableTemplates = default; + LocalJsonValue> propMigratedIlmPolicies = default; + LocalJsonValue> propMigratedIndices = default; + LocalJsonValue> propMigratedLegacyTemplates = default; + LocalJsonValue propRemovedLegacyTemplate = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDryRun.TryReadProperty(ref reader, options, PropDryRun, null)) + { + continue; + } + + if (propMigratedComponentTemplates.TryReadProperty(ref reader, options, PropMigratedComponentTemplates, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMigratedComposableTemplates.TryReadProperty(ref reader, options, PropMigratedComposableTemplates, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMigratedIlmPolicies.TryReadProperty(ref reader, options, PropMigratedIlmPolicies, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMigratedIndices.TryReadProperty(ref reader, options, PropMigratedIndices, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propMigratedLegacyTemplates.TryReadProperty(ref reader, options, PropMigratedLegacyTemplates, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propRemovedLegacyTemplate.TryReadProperty(ref reader, options, PropRemovedLegacyTemplate, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateToDataTiersResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DryRun = propDryRun.Value, + MigratedComponentTemplates = propMigratedComponentTemplates.Value, + MigratedComposableTemplates = propMigratedComposableTemplates.Value, + MigratedIlmPolicies = propMigratedIlmPolicies.Value, + MigratedIndices = propMigratedIndices.Value, + MigratedLegacyTemplates = propMigratedLegacyTemplates.Value, + RemovedLegacyTemplate = propRemovedLegacyTemplate.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateToDataTiersResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDryRun, value.DryRun, null, null); + writer.WriteProperty(options, PropMigratedComponentTemplates, value.MigratedComponentTemplates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMigratedComposableTemplates, value.MigratedComposableTemplates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMigratedIlmPolicies, value.MigratedIlmPolicies, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMigratedIndices, value.MigratedIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMigratedLegacyTemplates, value.MigratedLegacyTemplates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRemovedLegacyTemplate, value.RemovedLegacyTemplate, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MigrateToDataTiersResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MigrateToDataTiersResponse.g.cs index 9f05e3271a9..c4c5238a4d3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MigrateToDataTiersResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MigrateToDataTiersResponse.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; -internal sealed partial class MigrateToDataTiersResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDryRun = System.Text.Json.JsonEncodedText.Encode("dry_run"); - private static readonly System.Text.Json.JsonEncodedText PropMigratedComponentTemplates = System.Text.Json.JsonEncodedText.Encode("migrated_component_templates"); - private static readonly System.Text.Json.JsonEncodedText PropMigratedComposableTemplates = System.Text.Json.JsonEncodedText.Encode("migrated_composable_templates"); - private static readonly System.Text.Json.JsonEncodedText PropMigratedIlmPolicies = System.Text.Json.JsonEncodedText.Encode("migrated_ilm_policies"); - private static readonly System.Text.Json.JsonEncodedText PropMigratedIndices = System.Text.Json.JsonEncodedText.Encode("migrated_indices"); - private static readonly System.Text.Json.JsonEncodedText PropMigratedLegacyTemplates = System.Text.Json.JsonEncodedText.Encode("migrated_legacy_templates"); - private static readonly System.Text.Json.JsonEncodedText PropRemovedLegacyTemplate = System.Text.Json.JsonEncodedText.Encode("removed_legacy_template"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateToDataTiersResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDryRun = default; - LocalJsonValue> propMigratedComponentTemplates = default; - LocalJsonValue> propMigratedComposableTemplates = default; - LocalJsonValue> propMigratedIlmPolicies = default; - LocalJsonValue> propMigratedIndices = default; - LocalJsonValue> propMigratedLegacyTemplates = default; - LocalJsonValue propRemovedLegacyTemplate = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDryRun.TryReadProperty(ref reader, options, PropDryRun, null)) - { - continue; - } - - if (propMigratedComponentTemplates.TryReadProperty(ref reader, options, PropMigratedComponentTemplates, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMigratedComposableTemplates.TryReadProperty(ref reader, options, PropMigratedComposableTemplates, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMigratedIlmPolicies.TryReadProperty(ref reader, options, PropMigratedIlmPolicies, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMigratedIndices.TryReadProperty(ref reader, options, PropMigratedIndices, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (propMigratedLegacyTemplates.TryReadProperty(ref reader, options, PropMigratedLegacyTemplates, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propRemovedLegacyTemplate.TryReadProperty(ref reader, options, PropRemovedLegacyTemplate, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateToDataTiersResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DryRun = propDryRun.Value, - MigratedComponentTemplates = propMigratedComponentTemplates.Value, - MigratedComposableTemplates = propMigratedComposableTemplates.Value, - MigratedIlmPolicies = propMigratedIlmPolicies.Value, - MigratedIndices = propMigratedIndices.Value, - MigratedLegacyTemplates = propMigratedLegacyTemplates.Value, - RemovedLegacyTemplate = propRemovedLegacyTemplate.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateToDataTiersResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDryRun, value.DryRun, null, null); - writer.WriteProperty(options, PropMigratedComponentTemplates, value.MigratedComponentTemplates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMigratedComposableTemplates, value.MigratedComposableTemplates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMigratedIlmPolicies, value.MigratedIlmPolicies, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMigratedIndices, value.MigratedIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMigratedLegacyTemplates, value.MigratedLegacyTemplates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRemovedLegacyTemplate, value.RemovedLegacyTemplate, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateToDataTiersResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.MigrateToDataTiersResponseConverter))] public sealed partial class MigrateToDataTiersResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -132,9 +39,9 @@ internal MigrateToDataTiersResponse(Elastic.Clients.Elasticsearch.Serialization. public #if NET7_0_OR_GREATER - required +required #endif - bool DryRun { get; set; } +bool DryRun { get; set; } /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepRequest.Converters.g.cs new file mode 100644 index 00000000000..87684caebfa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class MoveToStepRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCurrentStep = System.Text.Json.JsonEncodedText.Encode("current_step"); + private static readonly System.Text.Json.JsonEncodedText PropNextStep = System.Text.Json.JsonEncodedText.Encode("next_step"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MoveToStepRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCurrentStep = default; + LocalJsonValue propNextStep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCurrentStep.TryReadProperty(ref reader, options, PropCurrentStep, null)) + { + continue; + } + + if (propNextStep.TryReadProperty(ref reader, options, PropNextStep, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MoveToStepRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CurrentStep = propCurrentStep.Value, + NextStep = propNextStep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MoveToStepRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCurrentStep, value.CurrentStep, null, null); + writer.WriteProperty(options, PropNextStep, value.NextStep, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepRequest.g.cs index 5712af720f3..52804341d85 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepRequest.g.cs @@ -27,54 +27,6 @@ public sealed partial class MoveToStepRequestParameters : Elastic.Transport.Requ { } -internal sealed partial class MoveToStepRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCurrentStep = System.Text.Json.JsonEncodedText.Encode("current_step"); - private static readonly System.Text.Json.JsonEncodedText PropNextStep = System.Text.Json.JsonEncodedText.Encode("next_step"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MoveToStepRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCurrentStep = default; - LocalJsonValue propNextStep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCurrentStep.TryReadProperty(ref reader, options, PropCurrentStep, null)) - { - continue; - } - - if (propNextStep.TryReadProperty(ref reader, options, PropNextStep, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MoveToStepRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CurrentStep = propCurrentStep.Value, - NextStep = propNextStep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MoveToStepRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCurrentStep, value.CurrentStep, null, null); - writer.WriteProperty(options, PropNextStep, value.NextStep, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Move to a lifecycle step. @@ -96,7 +48,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// An index cannot move to a step that is not part of its policy. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MoveToStepRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.MoveToStepRequestConverter))] public sealed partial class MoveToStepRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepResponse.Converters.g.cs new file mode 100644 index 00000000000..266cfb07ac2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class MoveToStepResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MoveToStepResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MoveToStepResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MoveToStepResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepResponse.g.cs index 60abe834936..21f31418bbe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/MoveToStepResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; -internal sealed partial class MoveToStepResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MoveToStepResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MoveToStepResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MoveToStepResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MoveToStepResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.MoveToStepResponseConverter))] public sealed partial class MoveToStepResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/PutLifecycleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/PutLifecycleRequest.Converters.g.cs new file mode 100644 index 00000000000..cd772cedc43 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/PutLifecycleRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class PutLifecycleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPolicy = System.Text.Json.JsonEncodedText.Encode("policy"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PutLifecycleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPolicy = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPolicy.TryReadProperty(ref reader, options, PropPolicy, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PutLifecycleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Policy = propPolicy.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PutLifecycleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPolicy, value.Policy, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/PutLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/PutLifecycleRequest.g.cs index eeb1eb3431e..d3cbd38e036 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/PutLifecycleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/PutLifecycleRequest.g.cs @@ -40,45 +40,6 @@ public sealed partial class PutLifecycleRequestParameters : Elastic.Transport.Re public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutLifecycleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPolicy = System.Text.Json.JsonEncodedText.Encode("policy"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PutLifecycleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPolicy = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPolicy.TryReadProperty(ref reader, options, PropPolicy, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PutLifecycleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Policy = propPolicy.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PutLifecycleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPolicy, value.Policy, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create or update a lifecycle policy. @@ -88,7 +49,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// NOTE: Only the latest version of the policy is stored, you cannot revert to previous versions. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PutLifecycleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.PutLifecycleRequestConverter))] public sealed partial class PutLifecycleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/PutLifecycleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/PutLifecycleResponse.Converters.g.cs new file mode 100644 index 00000000000..6738f073dc1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/PutLifecycleResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class PutLifecycleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PutLifecycleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PutLifecycleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PutLifecycleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/PutLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/PutLifecycleResponse.g.cs index ec681ebcb2b..e1f17aadca2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/PutLifecycleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/PutLifecycleResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; -internal sealed partial class PutLifecycleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PutLifecycleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PutLifecycleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PutLifecycleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PutLifecycleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.PutLifecycleResponseConverter))] public sealed partial class PutLifecycleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RemovePolicyRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RemovePolicyRequest.Converters.g.cs new file mode 100644 index 00000000000..af3e6667683 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RemovePolicyRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class RemovePolicyRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RemovePolicyRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RemovePolicyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RemovePolicyRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RemovePolicyRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RemovePolicyRequest.g.cs index ddff6d153c9..a029ae73e31 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RemovePolicyRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RemovePolicyRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class RemovePolicyRequestParameters : Elastic.Transport.Re { } -internal sealed partial class RemovePolicyRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RemovePolicyRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RemovePolicyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RemovePolicyRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Remove policies from an index. @@ -63,7 +34,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// It also stops managing the indices. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RemovePolicyRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.RemovePolicyRequestConverter))] public sealed partial class RemovePolicyRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RemovePolicyResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RemovePolicyResponse.Converters.g.cs new file mode 100644 index 00000000000..f74aeb7df2d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RemovePolicyResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class RemovePolicyResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFailedIndexes = System.Text.Json.JsonEncodedText.Encode("failed_indexes"); + private static readonly System.Text.Json.JsonEncodedText PropHasFailures = System.Text.Json.JsonEncodedText.Encode("has_failures"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RemovePolicyResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propFailedIndexes = default; + LocalJsonValue propHasFailures = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFailedIndexes.TryReadProperty(ref reader, options, PropFailedIndexes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propHasFailures.TryReadProperty(ref reader, options, PropHasFailures, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RemovePolicyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FailedIndexes = propFailedIndexes.Value, + HasFailures = propHasFailures.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RemovePolicyResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFailedIndexes, value.FailedIndexes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropHasFailures, value.HasFailures, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RemovePolicyResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RemovePolicyResponse.g.cs index c70fc96f128..fc7ed1c1da3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RemovePolicyResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RemovePolicyResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; -internal sealed partial class RemovePolicyResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFailedIndexes = System.Text.Json.JsonEncodedText.Encode("failed_indexes"); - private static readonly System.Text.Json.JsonEncodedText PropHasFailures = System.Text.Json.JsonEncodedText.Encode("has_failures"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RemovePolicyResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propFailedIndexes = default; - LocalJsonValue propHasFailures = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFailedIndexes.TryReadProperty(ref reader, options, PropFailedIndexes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propHasFailures.TryReadProperty(ref reader, options, PropHasFailures, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RemovePolicyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FailedIndexes = propFailedIndexes.Value, - HasFailures = propHasFailures.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RemovePolicyResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFailedIndexes, value.FailedIndexes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropHasFailures, value.HasFailures, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RemovePolicyResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.RemovePolicyResponseConverter))] public sealed partial class RemovePolicyResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal RemovePolicyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCo public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection FailedIndexes { get; set; } +System.Collections.Generic.IReadOnlyCollection FailedIndexes { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool HasFailures { get; set; } +bool HasFailures { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RetryRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RetryRequest.Converters.g.cs new file mode 100644 index 00000000000..3e874b265a2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RetryRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class RetryRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RetryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RetryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RetryRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RetryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RetryRequest.g.cs index 74cfaf1ae4e..34733028a98 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RetryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RetryRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class RetryRequestParameters : Elastic.Transport.RequestPa { } -internal sealed partial class RetryRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RetryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RetryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RetryRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Retry a policy. @@ -64,7 +35,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Use the explain lifecycle state API to determine whether an index is in the ERROR step. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RetryRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.RetryRequestConverter))] public sealed partial class RetryRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RetryResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RetryResponse.Converters.g.cs new file mode 100644 index 00000000000..adbecf11189 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RetryResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class RetryResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RetryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RetryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RetryResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RetryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RetryResponse.g.cs index e66effa2231..df6104429ee 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RetryResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/RetryResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; -internal sealed partial class RetryResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RetryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RetryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RetryResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RetryResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.RetryResponseConverter))] public sealed partial class RetryResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StartIlmRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StartIlmRequest.Converters.g.cs new file mode 100644 index 00000000000..e24eb6abe6b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StartIlmRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class StartIlmRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StartIlmRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StartIlmRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StartIlmRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StartIlmRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StartIlmRequest.g.cs index 686f264c68d..1a98c3b398e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StartIlmRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StartIlmRequest.g.cs @@ -40,35 +40,6 @@ public sealed partial class StartIlmRequestParameters : Elastic.Transport.Reques public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class StartIlmRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StartIlmRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StartIlmRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StartIlmRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Start the ILM plugin. @@ -77,7 +48,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Restarting ILM is necessary only when it has been stopped using the stop ILM API. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StartIlmRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.StartIlmRequestConverter))] public sealed partial class StartIlmRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StartIlmResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StartIlmResponse.Converters.g.cs new file mode 100644 index 00000000000..19615935d7c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StartIlmResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class StartIlmResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StartIlmResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StartIlmResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StartIlmResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StartIlmResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StartIlmResponse.g.cs index 582b3d123b0..069c2ddfaae 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StartIlmResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StartIlmResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; -internal sealed partial class StartIlmResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StartIlmResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StartIlmResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StartIlmResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StartIlmResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.StartIlmResponseConverter))] public sealed partial class StartIlmResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StopIlmRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StopIlmRequest.Converters.g.cs new file mode 100644 index 00000000000..e046c52e4f0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StopIlmRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class StopIlmRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StopIlmRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StopIlmRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StopIlmRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StopIlmRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StopIlmRequest.g.cs index 975729bead3..1797bc3230f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StopIlmRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StopIlmRequest.g.cs @@ -40,35 +40,6 @@ public sealed partial class StopIlmRequestParameters : Elastic.Transport.Request public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class StopIlmRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StopIlmRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StopIlmRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StopIlmRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Stop the ILM plugin. @@ -80,7 +51,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Use the get ILM status API to check whether ILM is running. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StopIlmRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.StopIlmRequestConverter))] public sealed partial class StopIlmRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StopIlmResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StopIlmResponse.Converters.g.cs new file mode 100644 index 00000000000..ae5100f34b9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StopIlmResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class StopIlmResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StopIlmResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StopIlmResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StopIlmResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StopIlmResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StopIlmResponse.g.cs index fd76b4cba87..974786425c8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StopIlmResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexLifecycleManagement/StopIlmResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; -internal sealed partial class StopIlmResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StopIlmResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StopIlmResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StopIlmResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StopIlmResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.StopIlmResponseConverter))] public sealed partial class StopIlmResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/AnalyzeIndexRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/AnalyzeIndexRequest.Converters.g.cs new file mode 100644 index 00000000000..363190dc166 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/AnalyzeIndexRequest.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class AnalyzeIndexRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); + private static readonly System.Text.Json.JsonEncodedText PropCharFilter = System.Text.Json.JsonEncodedText.Encode("char_filter"); + private static readonly System.Text.Json.JsonEncodedText PropExplain = System.Text.Json.JsonEncodedText.Encode("explain"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropNormalizer = System.Text.Json.JsonEncodedText.Encode("normalizer"); + private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); + private static readonly System.Text.Json.JsonEncodedText PropTokenizer = System.Text.Json.JsonEncodedText.Encode("tokenizer"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeIndexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzer = default; + LocalJsonValue?> propAttributes = default; + LocalJsonValue?> propCharFilter = default; + LocalJsonValue propExplain = default; + LocalJsonValue propField = default; + LocalJsonValue?> propFilter = default; + LocalJsonValue propNormalizer = default; + LocalJsonValue?> propText = default; + LocalJsonValue propTokenizer = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) + { + continue; + } + + if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propCharFilter.TryReadProperty(ref reader, options, PropCharFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propExplain.TryReadProperty(ref reader, options, PropExplain, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propNormalizer.TryReadProperty(ref reader, options, PropNormalizer, null)) + { + continue; + } + + if (propText.TryReadProperty(ref reader, options, PropText, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propTokenizer.TryReadProperty(ref reader, options, PropTokenizer, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeIndexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analyzer = propAnalyzer.Value, + Attributes = propAttributes.Value, + CharFilter = propCharFilter.Value, + Explain = propExplain.Value, + Field = propField.Value, + Filter = propFilter.Value, + Normalizer = propNormalizer.Value, + Text = propText.Value, + Tokenizer = propTokenizer.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeIndexRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); + writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCharFilter, value.CharFilter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropExplain, value.Explain, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropNormalizer, value.Normalizer, null, null); + writer.WriteProperty(options, PropText, value.Text, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTokenizer, value.Tokenizer, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/AnalyzeIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/AnalyzeIndexRequest.g.cs index 9b4a72817bc..79e6a584a5b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/AnalyzeIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/AnalyzeIndexRequest.g.cs @@ -27,117 +27,6 @@ public sealed partial class AnalyzeIndexRequestParameters : Elastic.Transport.Re { } -internal sealed partial class AnalyzeIndexRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); - private static readonly System.Text.Json.JsonEncodedText PropCharFilter = System.Text.Json.JsonEncodedText.Encode("char_filter"); - private static readonly System.Text.Json.JsonEncodedText PropExplain = System.Text.Json.JsonEncodedText.Encode("explain"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropNormalizer = System.Text.Json.JsonEncodedText.Encode("normalizer"); - private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); - private static readonly System.Text.Json.JsonEncodedText PropTokenizer = System.Text.Json.JsonEncodedText.Encode("tokenizer"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeIndexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyzer = default; - LocalJsonValue?> propAttributes = default; - LocalJsonValue?> propCharFilter = default; - LocalJsonValue propExplain = default; - LocalJsonValue propField = default; - LocalJsonValue?> propFilter = default; - LocalJsonValue propNormalizer = default; - LocalJsonValue?> propText = default; - LocalJsonValue propTokenizer = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) - { - continue; - } - - if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propCharFilter.TryReadProperty(ref reader, options, PropCharFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propExplain.TryReadProperty(ref reader, options, PropExplain, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propNormalizer.TryReadProperty(ref reader, options, PropNormalizer, null)) - { - continue; - } - - if (propText.TryReadProperty(ref reader, options, PropText, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propTokenizer.TryReadProperty(ref reader, options, PropTokenizer, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeIndexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analyzer = propAnalyzer.Value, - Attributes = propAttributes.Value, - CharFilter = propCharFilter.Value, - Explain = propExplain.Value, - Field = propField.Value, - Filter = propFilter.Value, - Normalizer = propNormalizer.Value, - Text = propText.Value, - Tokenizer = propTokenizer.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeIndexRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); - writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCharFilter, value.CharFilter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropExplain, value.Explain, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropNormalizer, value.Normalizer, null, null); - writer.WriteProperty(options, PropText, value.Text, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTokenizer, value.Tokenizer, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Get tokens from text analysis. @@ -150,7 +39,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The _analyze endpoint without a specified index will always use 10000 as its limit. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeIndexRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.AnalyzeIndexRequestConverter))] public sealed partial class AnalyzeIndexRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public AnalyzeIndexRequest(Elastic.Clients.Elasticsearch.IndexName? index) : base(r => r.Optional("index", index)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/AnalyzeIndexResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/AnalyzeIndexResponse.Converters.g.cs new file mode 100644 index 00000000000..f672f43b6c3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/AnalyzeIndexResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class AnalyzeIndexResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDetail = System.Text.Json.JsonEncodedText.Encode("detail"); + private static readonly System.Text.Json.JsonEncodedText PropTokens = System.Text.Json.JsonEncodedText.Encode("tokens"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeIndexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDetail = default; + LocalJsonValue?> propTokens = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDetail.TryReadProperty(ref reader, options, PropDetail, null)) + { + continue; + } + + if (propTokens.TryReadProperty(ref reader, options, PropTokens, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Detail = propDetail.Value, + Tokens = propTokens.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeIndexResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDetail, value.Detail, null, null); + writer.WriteProperty(options, PropTokens, value.Tokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/AnalyzeIndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/AnalyzeIndexResponse.g.cs index d8ecae19a57..be558dd345d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/AnalyzeIndexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/AnalyzeIndexResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class AnalyzeIndexResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDetail = System.Text.Json.JsonEncodedText.Encode("detail"); - private static readonly System.Text.Json.JsonEncodedText PropTokens = System.Text.Json.JsonEncodedText.Encode("tokens"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeIndexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDetail = default; - LocalJsonValue?> propTokens = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDetail.TryReadProperty(ref reader, options, PropDetail, null)) - { - continue; - } - - if (propTokens.TryReadProperty(ref reader, options, PropTokens, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Detail = propDetail.Value, - Tokens = propTokens.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeIndexResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDetail, value.Detail, null, null); - writer.WriteProperty(options, PropTokens, value.Tokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeIndexResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.AnalyzeIndexResponseConverter))] public sealed partial class AnalyzeIndexResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CancelMigrateReindexRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CancelMigrateReindexRequest.Converters.g.cs new file mode 100644 index 00000000000..255b64f07c2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CancelMigrateReindexRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class CancelMigrateReindexRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.CancelMigrateReindexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.CancelMigrateReindexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CancelMigrateReindexRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CancelMigrateReindexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CancelMigrateReindexRequest.g.cs index d58f0310545..c68321037f7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CancelMigrateReindexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CancelMigrateReindexRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class CancelMigrateReindexRequestParameters : Elastic.Tran { } -internal sealed partial class CancelMigrateReindexRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.CancelMigrateReindexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.CancelMigrateReindexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CancelMigrateReindexRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Cancel a migration reindex operation. @@ -64,7 +35,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Cancel a migration reindex attempt for a data stream or index. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.CancelMigrateReindexRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.CancelMigrateReindexRequestConverter))] public sealed partial class CancelMigrateReindexRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CancelMigrateReindexResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CancelMigrateReindexResponse.Converters.g.cs new file mode 100644 index 00000000000..21be5cc2723 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CancelMigrateReindexResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class CancelMigrateReindexResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.CancelMigrateReindexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.CancelMigrateReindexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CancelMigrateReindexResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CancelMigrateReindexResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CancelMigrateReindexResponse.g.cs index 110b04b9db8..2461dc1e07e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CancelMigrateReindexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CancelMigrateReindexResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class CancelMigrateReindexResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.CancelMigrateReindexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.CancelMigrateReindexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CancelMigrateReindexResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.CancelMigrateReindexResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.CancelMigrateReindexResponseConverter))] public sealed partial class CancelMigrateReindexResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ClearCacheRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ClearCacheRequest.Converters.g.cs new file mode 100644 index 00000000000..dbeb303f713 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ClearCacheRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ClearCacheRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.ClearCacheRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ClearCacheRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ClearCacheRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ClearCacheRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ClearCacheRequest.g.cs index eea4dbc0c8b..da6dc50b133 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ClearCacheRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ClearCacheRequest.g.cs @@ -79,35 +79,6 @@ public sealed partial class ClearCacheRequestParameters : Elastic.Transport.Requ public bool? Request { get => Q("request"); set => Q("request", value); } } -internal sealed partial class ClearCacheRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.ClearCacheRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ClearCacheRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ClearCacheRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Clear the cache. @@ -120,7 +91,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// To clear the cache only of specific fields, use the fields parameter. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ClearCacheRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ClearCacheRequestConverter))] public sealed partial class ClearCacheRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public ClearCacheRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ClearCacheResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ClearCacheResponse.Converters.g.cs new file mode 100644 index 00000000000..138cf3022a0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ClearCacheResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ClearCacheResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ClearCacheResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propShards = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ClearCacheResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Shards = propShards.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ClearCacheResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ClearCacheResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ClearCacheResponse.g.cs index 48ac535ff35..3b57ebe2525 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ClearCacheResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ClearCacheResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ClearCacheResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ClearCacheResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propShards = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ClearCacheResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Shards = propShards.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ClearCacheResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ClearCacheResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ClearCacheResponseConverter))] public sealed partial class ClearCacheResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloneIndexRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloneIndexRequest.Converters.g.cs new file mode 100644 index 00000000000..bec829d00e3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloneIndexRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class CloneIndexRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.CloneIndexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAliases = default; + LocalJsonValue?> propSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propSettings.TryReadProperty(ref reader, options, PropSettings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.CloneIndexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aliases = propAliases.Value, + Settings = propSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CloneIndexRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropSettings, value.Settings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloneIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloneIndexRequest.g.cs index f0d596773ec..2ebc1ad9705 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloneIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloneIndexRequest.g.cs @@ -50,54 +50,6 @@ public sealed partial class CloneIndexRequestParameters : Elastic.Transport.Requ public Elastic.Clients.Elasticsearch.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } } -internal sealed partial class CloneIndexRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.CloneIndexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAliases = default; - LocalJsonValue?> propSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propSettings.TryReadProperty(ref reader, options, PropSettings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.CloneIndexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aliases = propAliases.Value, - Settings = propSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CloneIndexRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropSettings, value.Settings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - /// /// /// Clone an index. @@ -189,7 +141,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Because the clone operation creates a new index to clone the shards to, the wait for active shards setting on index creation applies to the clone index action as well. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.CloneIndexRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.CloneIndexRequestConverter))] public sealed partial class CloneIndexRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloneIndexResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloneIndexResponse.Converters.g.cs new file mode 100644 index 00000000000..ec9aa071b3b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloneIndexResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class CloneIndexResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropShardsAcknowledged = System.Text.Json.JsonEncodedText.Encode("shards_acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.CloneIndexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + LocalJsonValue propIndex = default; + LocalJsonValue propShardsAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propShardsAcknowledged.TryReadProperty(ref reader, options, PropShardsAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.CloneIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value, + Index = propIndex.Value, + ShardsAcknowledged = propShardsAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CloneIndexResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropShardsAcknowledged, value.ShardsAcknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloneIndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloneIndexResponse.g.cs index f4386d96453..9bb9c370487 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloneIndexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloneIndexResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class CloneIndexResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropShardsAcknowledged = System.Text.Json.JsonEncodedText.Encode("shards_acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.CloneIndexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - LocalJsonValue propIndex = default; - LocalJsonValue propShardsAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propShardsAcknowledged.TryReadProperty(ref reader, options, PropShardsAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.CloneIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value, - Index = propIndex.Value, - ShardsAcknowledged = propShardsAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CloneIndexResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropShardsAcknowledged, value.ShardsAcknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.CloneIndexResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.CloneIndexResponseConverter))] public sealed partial class CloneIndexResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -96,17 +39,17 @@ internal CloneIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCons public #if NET7_0_OR_GREATER - required +required #endif - bool Acknowledged { get; set; } +bool Acknowledged { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Index { get; set; } +string Index { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool ShardsAcknowledged { get; set; } +bool ShardsAcknowledged { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloseIndexRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloseIndexRequest.Converters.g.cs new file mode 100644 index 00000000000..9ef11a733e7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloseIndexRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class CloseIndexRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.CloseIndexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.CloseIndexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CloseIndexRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloseIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloseIndexRequest.g.cs index cd9e0ce1eb9..cf1a7e53371 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloseIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloseIndexRequest.g.cs @@ -74,35 +74,6 @@ public sealed partial class CloseIndexRequestParameters : Elastic.Transport.Requ public Elastic.Clients.Elasticsearch.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } } -internal sealed partial class CloseIndexRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.CloseIndexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.CloseIndexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CloseIndexRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Close an index. @@ -129,7 +100,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Closing indices can be turned off with the cluster settings API by setting cluster.indices.close.enable to false. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.CloseIndexRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.CloseIndexRequestConverter))] public sealed partial class CloseIndexRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloseIndexResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloseIndexResponse.Converters.g.cs new file mode 100644 index 00000000000..4172b29626d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloseIndexResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class CloseIndexResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropShardsAcknowledged = System.Text.Json.JsonEncodedText.Encode("shards_acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.CloseIndexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + LocalJsonValue> propIndices = default; + LocalJsonValue propShardsAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propShardsAcknowledged.TryReadProperty(ref reader, options, PropShardsAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.CloseIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value, + Indices = propIndices.Value, + ShardsAcknowledged = propShardsAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CloseIndexResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropShardsAcknowledged, value.ShardsAcknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloseIndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloseIndexResponse.g.cs index b45a50c4227..254d7a12849 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloseIndexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CloseIndexResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class CloseIndexResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropShardsAcknowledged = System.Text.Json.JsonEncodedText.Encode("shards_acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.CloseIndexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - LocalJsonValue> propIndices = default; - LocalJsonValue propShardsAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propShardsAcknowledged.TryReadProperty(ref reader, options, PropShardsAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.CloseIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value, - Indices = propIndices.Value, - ShardsAcknowledged = propShardsAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CloseIndexResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropShardsAcknowledged, value.ShardsAcknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.CloseIndexResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.CloseIndexResponseConverter))] public sealed partial class CloseIndexResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -96,17 +39,17 @@ internal CloseIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCons public #if NET7_0_OR_GREATER - required +required #endif - bool Acknowledged { get; set; } +bool Acknowledged { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary Indices { get; set; } +System.Collections.Generic.IReadOnlyDictionary Indices { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool ShardsAcknowledged { get; set; } +bool ShardsAcknowledged { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateDataStreamRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateDataStreamRequest.Converters.g.cs new file mode 100644 index 00000000000..967e92adbfb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateDataStreamRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class CreateDataStreamRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.CreateDataStreamRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.CreateDataStreamRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CreateDataStreamRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateDataStreamRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateDataStreamRequest.g.cs index 5b8333827a3..ff029d7ead3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateDataStreamRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateDataStreamRequest.g.cs @@ -40,35 +40,6 @@ public sealed partial class CreateDataStreamRequestParameters : Elastic.Transpor public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class CreateDataStreamRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.CreateDataStreamRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.CreateDataStreamRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CreateDataStreamRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Create a data stream. @@ -77,7 +48,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// You must have a matching index template with data stream enabled. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.CreateDataStreamRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.CreateDataStreamRequestConverter))] public sealed partial class CreateDataStreamRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateDataStreamResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateDataStreamResponse.Converters.g.cs new file mode 100644 index 00000000000..f421e14b2da --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateDataStreamResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class CreateDataStreamResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.CreateDataStreamResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.CreateDataStreamResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CreateDataStreamResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateDataStreamResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateDataStreamResponse.g.cs index 03ca087e8c1..a8f5719e5e5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateDataStreamResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateDataStreamResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class CreateDataStreamResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.CreateDataStreamResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.CreateDataStreamResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CreateDataStreamResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.CreateDataStreamResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.CreateDataStreamResponseConverter))] public sealed partial class CreateDataStreamResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateFromRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateFromRequest.Converters.g.cs new file mode 100644 index 00000000000..169b8709ffb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateFromRequest.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class CreateFromRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.CreateFromRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.IndexManagement.CreateFromRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { CreateFrom = reader.ReadValue(options, null) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CreateFromRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.CreateFrom, null); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateFromRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateFromRequest.g.cs index 057c105e439..e0022f1ee2c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateFromRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateFromRequest.g.cs @@ -27,19 +27,6 @@ public sealed partial class CreateFromRequestParameters : Elastic.Transport.Requ { } -internal sealed partial class CreateFromRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.CreateFromRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.IndexManagement.CreateFromRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { CreateFrom = reader.ReadValue(options, null) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CreateFromRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.CreateFrom, null); - } -} - /// /// /// Create an index from a source index. @@ -48,7 +35,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Copy the mappings and settings from the source index to a destination index while allowing request settings and mappings to override the source values. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.CreateFromRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.CreateFromRequestConverter))] public sealed partial class CreateFromRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateFromResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateFromResponse.Converters.g.cs new file mode 100644 index 00000000000..8f4b60d3bc8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateFromResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class CreateFromResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropShardsAcknowledged = System.Text.Json.JsonEncodedText.Encode("shards_acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.CreateFromResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + LocalJsonValue propIndex = default; + LocalJsonValue propShardsAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propShardsAcknowledged.TryReadProperty(ref reader, options, PropShardsAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.CreateFromResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value, + Index = propIndex.Value, + ShardsAcknowledged = propShardsAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CreateFromResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropShardsAcknowledged, value.ShardsAcknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateFromResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateFromResponse.g.cs index 2803a79929d..a973ed3fdf9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateFromResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateFromResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class CreateFromResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropShardsAcknowledged = System.Text.Json.JsonEncodedText.Encode("shards_acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.CreateFromResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - LocalJsonValue propIndex = default; - LocalJsonValue propShardsAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propShardsAcknowledged.TryReadProperty(ref reader, options, PropShardsAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.CreateFromResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value, - Index = propIndex.Value, - ShardsAcknowledged = propShardsAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CreateFromResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropShardsAcknowledged, value.ShardsAcknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.CreateFromResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.CreateFromResponseConverter))] public sealed partial class CreateFromResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -96,17 +39,17 @@ internal CreateFromResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCons public #if NET7_0_OR_GREATER - required +required #endif - bool Acknowledged { get; set; } +bool Acknowledged { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Index { get; set; } +string Index { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool ShardsAcknowledged { get; set; } +bool ShardsAcknowledged { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexRequest.Converters.g.cs new file mode 100644 index 00000000000..7a27c933b01 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexRequest.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class CreateIndexRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); + private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.CreateIndexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAliases = default; + LocalJsonValue propMappings = default; + LocalJsonValue propSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) + { + continue; + } + + if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.CreateIndexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aliases = propAliases.Value, + Mappings = propMappings.Value, + Settings = propSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CreateIndexRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropMappings, value.Mappings, null, null); + writer.WriteProperty(options, PropSettings, value.Settings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexRequest.g.cs index 97b8b97663d..4026ad15f5e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexRequest.g.cs @@ -50,63 +50,6 @@ public sealed partial class CreateIndexRequestParameters : Elastic.Transport.Req public Elastic.Clients.Elasticsearch.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } } -internal sealed partial class CreateIndexRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); - private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.CreateIndexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAliases = default; - LocalJsonValue propMappings = default; - LocalJsonValue propSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) - { - continue; - } - - if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.CreateIndexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aliases = propAliases.Value, - Mappings = propMappings.Value, - Settings = propSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CreateIndexRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropMappings, value.Mappings, null, null); - writer.WriteProperty(options, PropSettings, value.Settings, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create an index. @@ -147,7 +90,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Note that changing this setting will also affect the wait_for_active_shards value on all subsequent write operations. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.CreateIndexRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.CreateIndexRequestConverter))] public sealed partial class CreateIndexRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexResponse.Converters.g.cs new file mode 100644 index 00000000000..d3fac0c6682 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class CreateIndexResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropShardsAcknowledged = System.Text.Json.JsonEncodedText.Encode("shards_acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.CreateIndexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + LocalJsonValue propIndex = default; + LocalJsonValue propShardsAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propShardsAcknowledged.TryReadProperty(ref reader, options, PropShardsAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.CreateIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value, + Index = propIndex.Value, + ShardsAcknowledged = propShardsAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CreateIndexResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropShardsAcknowledged, value.ShardsAcknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexResponse.g.cs index 4ac85ea3eff..c05d82d4594 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class CreateIndexResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropShardsAcknowledged = System.Text.Json.JsonEncodedText.Encode("shards_acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.CreateIndexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - LocalJsonValue propIndex = default; - LocalJsonValue propShardsAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propShardsAcknowledged.TryReadProperty(ref reader, options, PropShardsAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.CreateIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value, - Index = propIndex.Value, - ShardsAcknowledged = propShardsAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CreateIndexResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropShardsAcknowledged, value.ShardsAcknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.CreateIndexResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.CreateIndexResponseConverter))] public sealed partial class CreateIndexResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -96,17 +39,17 @@ internal CreateIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCon public #if NET7_0_OR_GREATER - required +required #endif - bool Acknowledged { get; set; } +bool Acknowledged { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Index { get; set; } +string Index { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool ShardsAcknowledged { get; set; } +bool ShardsAcknowledged { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DataStreamsStatsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DataStreamsStatsRequest.Converters.g.cs new file mode 100644 index 00000000000..707ba0291ce --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DataStreamsStatsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DataStreamsStatsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamsStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamsStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamsStatsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DataStreamsStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DataStreamsStatsRequest.g.cs index 7525ffbed1e..43741be7d2a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DataStreamsStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DataStreamsStatsRequest.g.cs @@ -34,35 +34,6 @@ public sealed partial class DataStreamsStatsRequestParameters : Elastic.Transpor public System.Collections.Generic.ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } } -internal sealed partial class DataStreamsStatsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamsStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamsStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamsStatsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get data stream stats. @@ -71,7 +42,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Get statistics for one or more data streams. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamsStatsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DataStreamsStatsRequestConverter))] public sealed partial class DataStreamsStatsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public DataStreamsStatsRequest(Elastic.Clients.Elasticsearch.IndexName? name) : base(r => r.Optional("name", name)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DataStreamsStatsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DataStreamsStatsResponse.Converters.g.cs new file mode 100644 index 00000000000..87d77e4b97b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DataStreamsStatsResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DataStreamsStatsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBackingIndices = System.Text.Json.JsonEncodedText.Encode("backing_indices"); + private static readonly System.Text.Json.JsonEncodedText PropDataStreamCount = System.Text.Json.JsonEncodedText.Encode("data_stream_count"); + private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + private static readonly System.Text.Json.JsonEncodedText PropTotalStoreSizeBytes = System.Text.Json.JsonEncodedText.Encode("total_store_size_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTotalStoreSizes = System.Text.Json.JsonEncodedText.Encode("total_store_sizes"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamsStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBackingIndices = default; + LocalJsonValue propDataStreamCount = default; + LocalJsonValue> propDataStreams = default; + LocalJsonValue propShards = default; + LocalJsonValue propTotalStoreSizeBytes = default; + LocalJsonValue propTotalStoreSizes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBackingIndices.TryReadProperty(ref reader, options, PropBackingIndices, null)) + { + continue; + } + + if (propDataStreamCount.TryReadProperty(ref reader, options, PropDataStreamCount, null)) + { + continue; + } + + if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (propTotalStoreSizeBytes.TryReadProperty(ref reader, options, PropTotalStoreSizeBytes, null)) + { + continue; + } + + if (propTotalStoreSizes.TryReadProperty(ref reader, options, PropTotalStoreSizes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamsStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BackingIndices = propBackingIndices.Value, + DataStreamCount = propDataStreamCount.Value, + DataStreams = propDataStreams.Value, + Shards = propShards.Value, + TotalStoreSizeBytes = propTotalStoreSizeBytes.Value, + TotalStoreSizes = propTotalStoreSizes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamsStatsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBackingIndices, value.BackingIndices, null, null); + writer.WriteProperty(options, PropDataStreamCount, value.DataStreamCount, null, null); + writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteProperty(options, PropTotalStoreSizeBytes, value.TotalStoreSizeBytes, null, null); + writer.WriteProperty(options, PropTotalStoreSizes, value.TotalStoreSizes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DataStreamsStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DataStreamsStatsResponse.g.cs index d35dcd288d9..83a1896f0d1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DataStreamsStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DataStreamsStatsResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DataStreamsStatsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBackingIndices = System.Text.Json.JsonEncodedText.Encode("backing_indices"); - private static readonly System.Text.Json.JsonEncodedText PropDataStreamCount = System.Text.Json.JsonEncodedText.Encode("data_stream_count"); - private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - private static readonly System.Text.Json.JsonEncodedText PropTotalStoreSizeBytes = System.Text.Json.JsonEncodedText.Encode("total_store_size_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTotalStoreSizes = System.Text.Json.JsonEncodedText.Encode("total_store_sizes"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamsStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBackingIndices = default; - LocalJsonValue propDataStreamCount = default; - LocalJsonValue> propDataStreams = default; - LocalJsonValue propShards = default; - LocalJsonValue propTotalStoreSizeBytes = default; - LocalJsonValue propTotalStoreSizes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBackingIndices.TryReadProperty(ref reader, options, PropBackingIndices, null)) - { - continue; - } - - if (propDataStreamCount.TryReadProperty(ref reader, options, PropDataStreamCount, null)) - { - continue; - } - - if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (propTotalStoreSizeBytes.TryReadProperty(ref reader, options, PropTotalStoreSizeBytes, null)) - { - continue; - } - - if (propTotalStoreSizes.TryReadProperty(ref reader, options, PropTotalStoreSizes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamsStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BackingIndices = propBackingIndices.Value, - DataStreamCount = propDataStreamCount.Value, - DataStreams = propDataStreams.Value, - Shards = propShards.Value, - TotalStoreSizeBytes = propTotalStoreSizeBytes.Value, - TotalStoreSizes = propTotalStoreSizes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamsStatsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBackingIndices, value.BackingIndices, null, null); - writer.WriteProperty(options, PropDataStreamCount, value.DataStreamCount, null, null); - writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteProperty(options, PropTotalStoreSizeBytes, value.TotalStoreSizeBytes, null, null); - writer.WriteProperty(options, PropTotalStoreSizes, value.TotalStoreSizes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamsStatsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DataStreamsStatsResponseConverter))] public sealed partial class DataStreamsStatsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteAliasRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteAliasRequest.Converters.g.cs new file mode 100644 index 00000000000..ba949329018 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteAliasRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DeleteAliasRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteAliasRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteAliasRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteAliasRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteAliasRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteAliasRequest.g.cs index f7d3f34dde9..8fbeff5b09f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteAliasRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteAliasRequest.g.cs @@ -42,42 +42,13 @@ public sealed partial class DeleteAliasRequestParameters : Elastic.Transport.Req public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class DeleteAliasRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteAliasRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteAliasRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteAliasRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete an alias. /// Removes a data stream or index from an alias. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DeleteAliasRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DeleteAliasRequestConverter))] public sealed partial class DeleteAliasRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteAliasResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteAliasResponse.Converters.g.cs new file mode 100644 index 00000000000..5eace7cbd3d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteAliasResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DeleteAliasResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + private static readonly System.Text.Json.JsonEncodedText PropErrors = System.Text.Json.JsonEncodedText.Encode("errors"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteAliasResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + LocalJsonValue propErrors = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (propErrors.TryReadProperty(ref reader, options, PropErrors, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteAliasResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value, + Errors = propErrors.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteAliasResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteProperty(options, PropErrors, value.Errors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteAliasResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteAliasResponse.g.cs index 200378a0cc6..9dcb422e6e9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteAliasResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteAliasResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DeleteAliasResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - private static readonly System.Text.Json.JsonEncodedText PropErrors = System.Text.Json.JsonEncodedText.Encode("errors"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteAliasResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - LocalJsonValue propErrors = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (propErrors.TryReadProperty(ref reader, options, PropErrors, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteAliasResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value, - Errors = propErrors.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteAliasResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteProperty(options, PropErrors, value.Errors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DeleteAliasResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DeleteAliasResponseConverter))] public sealed partial class DeleteAliasResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataLifecycleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataLifecycleRequest.Converters.g.cs new file mode 100644 index 00000000000..c7d85b16321 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataLifecycleRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DeleteDataLifecycleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataLifecycleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataLifecycleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataLifecycleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataLifecycleRequest.g.cs index 00500f10e51..9688c73b9b6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataLifecycleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataLifecycleRequest.g.cs @@ -47,42 +47,13 @@ public sealed partial class DeleteDataLifecycleRequestParameters : Elastic.Trans public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class DeleteDataLifecycleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataLifecycleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataLifecycleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataLifecycleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete data stream lifecycles. /// Removes the data stream lifecycle from a data stream, rendering it not managed by the data stream lifecycle. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataLifecycleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DeleteDataLifecycleRequestConverter))] public sealed partial class DeleteDataLifecycleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataLifecycleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataLifecycleResponse.Converters.g.cs new file mode 100644 index 00000000000..4552c663748 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataLifecycleResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DeleteDataLifecycleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataLifecycleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataLifecycleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataLifecycleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataLifecycleResponse.g.cs index e0ceb41957c..664c35edf05 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataLifecycleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataLifecycleResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DeleteDataLifecycleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataLifecycleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataLifecycleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataLifecycleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataLifecycleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DeleteDataLifecycleResponseConverter))] public sealed partial class DeleteDataLifecycleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamOptionsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamOptionsRequest.Converters.g.cs new file mode 100644 index 00000000000..8b6724fe19b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamOptionsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DeleteDataStreamOptionsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamOptionsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamOptionsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamOptionsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamOptionsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamOptionsRequest.g.cs index c3780d4debc..50050a53955 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamOptionsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamOptionsRequest.g.cs @@ -47,42 +47,13 @@ public sealed partial class DeleteDataStreamOptionsRequestParameters : Elastic.T public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class DeleteDataStreamOptionsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamOptionsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamOptionsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamOptionsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete data stream options. /// Removes the data stream options from a data stream. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamOptionsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DeleteDataStreamOptionsRequestConverter))] public sealed partial class DeleteDataStreamOptionsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamOptionsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamOptionsResponse.Converters.g.cs new file mode 100644 index 00000000000..fdad20cda9b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamOptionsResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DeleteDataStreamOptionsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamOptionsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamOptionsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamOptionsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamOptionsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamOptionsResponse.g.cs index 9b22787c8a3..c74b3021b06 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamOptionsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamOptionsResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DeleteDataStreamOptionsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamOptionsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamOptionsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamOptionsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamOptionsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DeleteDataStreamOptionsResponseConverter))] public sealed partial class DeleteDataStreamOptionsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamRequest.Converters.g.cs new file mode 100644 index 00000000000..f73a95a8330 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DeleteDataStreamRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamRequest.g.cs index 8b27bcf4397..e9c11b3f5fc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamRequest.g.cs @@ -40,42 +40,13 @@ public sealed partial class DeleteDataStreamRequestParameters : Elastic.Transpor public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class DeleteDataStreamRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete data streams. /// Deletes one or more data streams and their backing indices. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DeleteDataStreamRequestConverter))] public sealed partial class DeleteDataStreamRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamResponse.Converters.g.cs new file mode 100644 index 00000000000..d85f68c8f8b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DeleteDataStreamResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamResponse.g.cs index 082d2254028..241d4a6a371 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteDataStreamResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DeleteDataStreamResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DeleteDataStreamResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DeleteDataStreamResponseConverter))] public sealed partial class DeleteDataStreamResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexRequest.Converters.g.cs new file mode 100644 index 00000000000..10e68ca9b23 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DeleteIndexRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexRequest.g.cs index 11a531793e4..67a5c2ef6cc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexRequest.g.cs @@ -66,35 +66,6 @@ public sealed partial class DeleteIndexRequestParameters : Elastic.Transport.Req public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class DeleteIndexRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete indices. @@ -107,7 +78,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// You can then use the delete index API to delete the previous write index. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DeleteIndexRequestConverter))] public sealed partial class DeleteIndexRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexResponse.Converters.g.cs new file mode 100644 index 00000000000..e1956133550 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DeleteIndexResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + LocalJsonValue propShards = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value, + Shards = propShards.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexResponse.g.cs index cff1f032dfe..b3ed2160d70 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DeleteIndexResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - LocalJsonValue propShards = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value, - Shards = propShards.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DeleteIndexResponseConverter))] public sealed partial class DeleteIndexResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexTemplateRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexTemplateRequest.Converters.g.cs new file mode 100644 index 00000000000..2efb318c66d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexTemplateRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DeleteIndexTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexTemplateRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexTemplateRequest.g.cs index 4499a366f63..8099ab20ee3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexTemplateRequest.g.cs @@ -40,35 +40,6 @@ public sealed partial class DeleteIndexTemplateRequestParameters : Elastic.Trans public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class DeleteIndexTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexTemplateRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete an index template. @@ -77,7 +48,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// existing templates. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexTemplateRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DeleteIndexTemplateRequestConverter))] public sealed partial class DeleteIndexTemplateRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexTemplateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexTemplateResponse.Converters.g.cs new file mode 100644 index 00000000000..c3e661f36c8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexTemplateResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DeleteIndexTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexTemplateResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexTemplateResponse.g.cs index 26b33dcdd3c..6b5914128ca 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteIndexTemplateResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DeleteIndexTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexTemplateResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DeleteIndexTemplateResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DeleteIndexTemplateResponseConverter))] public sealed partial class DeleteIndexTemplateResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteTemplateRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteTemplateRequest.Converters.g.cs new file mode 100644 index 00000000000..27a9a6a21a4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteTemplateRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DeleteTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteTemplateRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteTemplateRequest.g.cs index 41141acf27c..584456a638c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteTemplateRequest.g.cs @@ -42,42 +42,13 @@ public sealed partial class DeleteTemplateRequestParameters : Elastic.Transport. public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class DeleteTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteTemplateRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete a legacy index template. /// IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DeleteTemplateRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DeleteTemplateRequestConverter))] public sealed partial class DeleteTemplateRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteTemplateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteTemplateResponse.Converters.g.cs new file mode 100644 index 00000000000..ade8aafee24 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteTemplateResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DeleteTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteTemplateResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteTemplateResponse.g.cs index 8406acc46b1..933f6a4a010 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DeleteTemplateResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DeleteTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DeleteTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DeleteTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DeleteTemplateResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DeleteTemplateResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DeleteTemplateResponseConverter))] public sealed partial class DeleteTemplateResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DiskUsageRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DiskUsageRequest.Converters.g.cs new file mode 100644 index 00000000000..ee4d248990f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DiskUsageRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DiskUsageRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.DiskUsageRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DiskUsageRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DiskUsageRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DiskUsageRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DiskUsageRequest.g.cs index 60eb33ac732..11b53047e29 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DiskUsageRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DiskUsageRequest.g.cs @@ -67,35 +67,6 @@ public sealed partial class DiskUsageRequestParameters : Elastic.Transport.Reque public bool? RunExpensiveTasks { get => Q("run_expensive_tasks"); set => Q("run_expensive_tasks", value); } } -internal sealed partial class DiskUsageRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.DiskUsageRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DiskUsageRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DiskUsageRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Analyze the index disk usage. @@ -109,7 +80,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The stored size of the _id field is likely underestimated while the _source field is overestimated. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DiskUsageRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DiskUsageRequestConverter))] public sealed partial class DiskUsageRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DiskUsageResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DiskUsageResponse.Converters.g.cs new file mode 100644 index 00000000000..3e178987096 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DiskUsageResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DiskUsageResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.DiskUsageResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.IndexManagement.DiskUsageResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { DiskUsage = reader.ReadValue(options, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DiskUsageResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.DiskUsage, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DiskUsageResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DiskUsageResponse.g.cs index b7f5aa70852..a33695f17ab 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DiskUsageResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DiskUsageResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DiskUsageResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.DiskUsageResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.IndexManagement.DiskUsageResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { DiskUsage = reader.ReadValue(options, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DiskUsageResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.DiskUsage, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DiskUsageResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DiskUsageResponseConverter))] public sealed partial class DiskUsageResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DownsampleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DownsampleRequest.Converters.g.cs new file mode 100644 index 00000000000..d4bc3f8b2dc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DownsampleRequest.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DownsampleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.DownsampleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.IndexManagement.DownsampleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Config = reader.ReadValue(options, null) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DownsampleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Config, null); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DownsampleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DownsampleRequest.g.cs index 0a1963b61b7..f5d1361a812 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DownsampleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DownsampleRequest.g.cs @@ -27,19 +27,6 @@ public sealed partial class DownsampleRequestParameters : Elastic.Transport.Requ { } -internal sealed partial class DownsampleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.DownsampleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.IndexManagement.DownsampleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Config = reader.ReadValue(options, null) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DownsampleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Config, null); - } -} - /// /// /// Downsample an index. @@ -53,7 +40,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The source index must be read only (index.blocks.write: true). /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DownsampleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DownsampleRequestConverter))] public sealed partial class DownsampleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DownsampleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DownsampleResponse.Converters.g.cs new file mode 100644 index 00000000000..94a539d5e65 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DownsampleResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DownsampleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.DownsampleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.IndexManagement.DownsampleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Result = reader.ReadValue(options, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DownsampleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Result, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DownsampleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DownsampleResponse.g.cs index 679f0b88d3c..db84ba71643 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DownsampleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/DownsampleResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DownsampleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.DownsampleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.IndexManagement.DownsampleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Result = reader.ReadValue(options, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DownsampleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Result, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DownsampleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DownsampleResponseConverter))] public sealed partial class DownsampleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsAliasRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsAliasRequest.Converters.g.cs new file mode 100644 index 00000000000..d867bb3ae08 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsAliasRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ExistsAliasRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.ExistsAliasRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ExistsAliasRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ExistsAliasRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsAliasRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsAliasRequest.g.cs index 6c257ad8bed..47942224b24 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsAliasRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsAliasRequest.g.cs @@ -58,35 +58,6 @@ public sealed partial class ExistsAliasRequestParameters : Elastic.Transport.Req public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class ExistsAliasRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.ExistsAliasRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ExistsAliasRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ExistsAliasRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Check aliases. @@ -95,7 +66,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Check if one or more data stream or index aliases exist. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ExistsAliasRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ExistsAliasRequestConverter))] public sealed partial class ExistsAliasRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsAliasResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsAliasResponse.Converters.g.cs new file mode 100644 index 00000000000..d36cef259c6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsAliasResponse.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ExistsAliasResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.ExistsAliasResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ExistsAliasResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ExistsAliasResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsAliasResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsAliasResponse.g.cs index 2b90ad4157f..4b7dbb209c8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsAliasResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsAliasResponse.g.cs @@ -23,36 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ExistsAliasResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.ExistsAliasResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ExistsAliasResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ExistsAliasResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ExistsAliasResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ExistsAliasResponseConverter))] public sealed partial class ExistsAliasResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsIndexTemplateRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsIndexTemplateRequest.Converters.g.cs new file mode 100644 index 00000000000..27aa6c08360 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsIndexTemplateRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ExistsIndexTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.ExistsIndexTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ExistsIndexTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ExistsIndexTemplateRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsIndexTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsIndexTemplateRequest.g.cs index 4b4d689f780..65840d0c291 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsIndexTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsIndexTemplateRequest.g.cs @@ -47,35 +47,6 @@ public sealed partial class ExistsIndexTemplateRequestParameters : Elastic.Trans public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class ExistsIndexTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.ExistsIndexTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ExistsIndexTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ExistsIndexTemplateRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Check index templates. @@ -84,7 +55,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Check whether index templates exist. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ExistsIndexTemplateRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ExistsIndexTemplateRequestConverter))] public sealed partial class ExistsIndexTemplateRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsIndexTemplateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsIndexTemplateResponse.Converters.g.cs new file mode 100644 index 00000000000..bfee0e0be2f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsIndexTemplateResponse.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ExistsIndexTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.ExistsIndexTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ExistsIndexTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ExistsIndexTemplateResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsIndexTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsIndexTemplateResponse.g.cs index fa6cf02c5ac..2f99742bb89 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsIndexTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsIndexTemplateResponse.g.cs @@ -23,36 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ExistsIndexTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.ExistsIndexTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ExistsIndexTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ExistsIndexTemplateResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ExistsIndexTemplateResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ExistsIndexTemplateResponseConverter))] public sealed partial class ExistsIndexTemplateResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsRequest.Converters.g.cs new file mode 100644 index 00000000000..6087188cbca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ExistsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.ExistsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ExistsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ExistsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsRequest.g.cs index fe14014be38..709b329cc44 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsRequest.g.cs @@ -71,42 +71,13 @@ public sealed partial class ExistsRequestParameters : Elastic.Transport.RequestP public bool? Local { get => Q("local"); set => Q("local", value); } } -internal sealed partial class ExistsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.ExistsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ExistsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ExistsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Check indices. /// Check if one or more indices, index aliases, or data streams exist. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ExistsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ExistsRequestConverter))] public sealed partial class ExistsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsResponse.Converters.g.cs new file mode 100644 index 00000000000..8de5d246fdf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsResponse.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ExistsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.ExistsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ExistsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ExistsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsResponse.g.cs index 9757005fe63..b806b2efbed 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsResponse.g.cs @@ -23,36 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ExistsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.ExistsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ExistsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ExistsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ExistsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ExistsResponseConverter))] public sealed partial class ExistsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateRequest.Converters.g.cs new file mode 100644 index 00000000000..be1642266fc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ExistsTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.ExistsTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ExistsTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ExistsTemplateRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateRequest.g.cs index 11bdd2b9903..886289e29e1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateRequest.g.cs @@ -49,35 +49,6 @@ public sealed partial class ExistsTemplateRequestParameters : Elastic.Transport. public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class ExistsTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.ExistsTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ExistsTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ExistsTemplateRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Check existence of index templates. @@ -88,7 +59,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ExistsTemplateRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ExistsTemplateRequestConverter))] public sealed partial class ExistsTemplateRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateResponse.Converters.g.cs new file mode 100644 index 00000000000..f2d504bdfe5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateResponse.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ExistsTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.ExistsTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ExistsTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ExistsTemplateResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateResponse.g.cs index 43490f6eac4..026183e02ba 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateResponse.g.cs @@ -23,36 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ExistsTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.ExistsTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ExistsTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ExistsTemplateResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ExistsTemplateResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ExistsTemplateResponseConverter))] public sealed partial class ExistsTemplateResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExplainDataLifecycleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExplainDataLifecycleRequest.Converters.g.cs new file mode 100644 index 00000000000..95fef6d6995 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExplainDataLifecycleRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ExplainDataLifecycleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.ExplainDataLifecycleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ExplainDataLifecycleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ExplainDataLifecycleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExplainDataLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExplainDataLifecycleRequest.g.cs index 9dfd3681075..5eb3cf9e1ba 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExplainDataLifecycleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExplainDataLifecycleRequest.g.cs @@ -40,42 +40,13 @@ public sealed partial class ExplainDataLifecycleRequestParameters : Elastic.Tran public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class ExplainDataLifecycleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.ExplainDataLifecycleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ExplainDataLifecycleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ExplainDataLifecycleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get the status for a data stream lifecycle. /// Get information about an index or data stream's current data stream lifecycle status, such as time since index creation, time since rollover, the lifecycle configuration managing the index, or any errors encountered during lifecycle execution. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ExplainDataLifecycleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ExplainDataLifecycleRequestConverter))] public sealed partial class ExplainDataLifecycleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExplainDataLifecycleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExplainDataLifecycleResponse.Converters.g.cs new file mode 100644 index 00000000000..9923e66bd1f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExplainDataLifecycleResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ExplainDataLifecycleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ExplainDataLifecycleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propIndices = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ExplainDataLifecycleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Indices = propIndices.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ExplainDataLifecycleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExplainDataLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExplainDataLifecycleResponse.g.cs index 45623ce5591..29a5fd044b2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExplainDataLifecycleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExplainDataLifecycleResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ExplainDataLifecycleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ExplainDataLifecycleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propIndices = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ExplainDataLifecycleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Indices = propIndices.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ExplainDataLifecycleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ExplainDataLifecycleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ExplainDataLifecycleResponseConverter))] public sealed partial class ExplainDataLifecycleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal ExplainDataLifecycleResponse(Elastic.Clients.Elasticsearch.Serializatio public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary Indices { get; set; } +System.Collections.Generic.IReadOnlyDictionary Indices { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FieldUsageStatsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FieldUsageStatsRequest.Converters.g.cs new file mode 100644 index 00000000000..d6efaa0849c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FieldUsageStatsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class FieldUsageStatsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.FieldUsageStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.FieldUsageStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.FieldUsageStatsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FieldUsageStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FieldUsageStatsRequest.g.cs index 58b6e0921f2..8e8b8032273 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FieldUsageStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FieldUsageStatsRequest.g.cs @@ -58,35 +58,6 @@ public sealed partial class FieldUsageStatsRequestParameters : Elastic.Transport public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } } -internal sealed partial class FieldUsageStatsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.FieldUsageStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.FieldUsageStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.FieldUsageStatsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get field usage stats. @@ -99,7 +70,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// A given request will increment each count by a maximum value of 1, even if the request accesses the same field multiple times. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.FieldUsageStatsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.FieldUsageStatsRequestConverter))] public sealed partial class FieldUsageStatsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FieldUsageStatsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FieldUsageStatsResponse.Converters.g.cs new file mode 100644 index 00000000000..87d2b0e36bc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FieldUsageStatsResponse.Converters.g.cs @@ -0,0 +1,69 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class FieldUsageStatsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.FieldUsageStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propShards = default; + System.Collections.Generic.Dictionary? propStats = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + propStats ??= new System.Collections.Generic.Dictionary(); + reader.ReadProperty(options, out string key, out Elastic.Clients.Elasticsearch.IndexManagement.UsageStatsIndex value, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!, null); + propStats[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.FieldUsageStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Shards = propShards.Value, + Stats = propStats + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.FieldUsageStatsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + if (value.Stats is not null) + { + foreach (var item in value.Stats) + { + writer.WriteProperty(options, item.Key, item.Value, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), null); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FieldUsageStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FieldUsageStatsResponse.g.cs index a2d263a531c..c70045e0f80 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FieldUsageStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FieldUsageStatsResponse.g.cs @@ -23,52 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class FieldUsageStatsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.FieldUsageStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propShards = default; - System.Collections.Generic.Dictionary? propStats = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - propStats ??= new System.Collections.Generic.Dictionary(); - reader.ReadProperty(options, out string key, out Elastic.Clients.Elasticsearch.IndexManagement.UsageStatsIndex value, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!, null); - propStats[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.FieldUsageStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Shards = propShards.Value, - Stats = propStats - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.FieldUsageStatsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - if (value.Stats is not null) - { - foreach (var item in value.Stats) - { - writer.WriteProperty(options, item.Key, item.Value, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), null); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.FieldUsageStatsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.FieldUsageStatsResponseConverter))] public sealed partial class FieldUsageStatsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -84,9 +39,9 @@ internal FieldUsageStatsResponse(Elastic.Clients.Elasticsearch.Serialization.Jso public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; set; } +Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; set; } /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FlushRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FlushRequest.Converters.g.cs new file mode 100644 index 00000000000..68d835d8b95 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FlushRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class FlushRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.FlushRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.FlushRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.FlushRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FlushRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FlushRequest.g.cs index 5b513bd9f0d..d64535712af 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FlushRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FlushRequest.g.cs @@ -65,35 +65,6 @@ public sealed partial class FlushRequestParameters : Elastic.Transport.RequestPa public bool? WaitIfOngoing { get => Q("wait_if_ongoing"); set => Q("wait_if_ongoing", value); } } -internal sealed partial class FlushRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.FlushRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.FlushRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.FlushRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Flush data streams or indices. @@ -111,7 +82,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If you call the flush API after indexing some documents then a successful response indicates that Elasticsearch has flushed all the documents that were indexed before the flush API was called. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.FlushRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.FlushRequestConverter))] public sealed partial class FlushRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public FlushRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FlushResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FlushResponse.Converters.g.cs new file mode 100644 index 00000000000..29b591afad5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FlushResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class FlushResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.FlushResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propShards = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.FlushResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Shards = propShards.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.FlushResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FlushResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FlushResponse.g.cs index 97bfbe6ca04..45388080e00 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FlushResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/FlushResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class FlushResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.FlushResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propShards = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.FlushResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Shards = propShards.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.FlushResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.FlushResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.FlushResponseConverter))] public sealed partial class FlushResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeRequest.Converters.g.cs new file mode 100644 index 00000000000..d8769c098c4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ForcemergeRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.ForcemergeRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ForcemergeRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ForcemergeRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeRequest.g.cs index 3f35752dd7e..27e83d2c336 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeRequest.g.cs @@ -75,35 +75,6 @@ public sealed partial class ForcemergeRequestParameters : Elastic.Transport.Requ public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } } -internal sealed partial class ForcemergeRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.ForcemergeRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ForcemergeRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ForcemergeRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Force a merge. @@ -189,7 +160,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// POST /.ds-my-data-stream-2099.03.07-000001/_forcemerge?max_num_segments=1 /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ForcemergeRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ForcemergeRequestConverter))] public sealed partial class ForcemergeRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public ForcemergeRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeResponse.Converters.g.cs new file mode 100644 index 00000000000..05c0bd6b5ad --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ForcemergeResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + private static readonly System.Text.Json.JsonEncodedText PropTask = System.Text.Json.JsonEncodedText.Encode("task"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ForcemergeResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propShards = default; + LocalJsonValue propTask = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (propTask.TryReadProperty(ref reader, options, PropTask, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ForcemergeResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Shards = propShards.Value, + Task = propTask.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ForcemergeResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteProperty(options, PropTask, value.Task, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeResponse.g.cs index 1af7c2e37c2..1b83c70b7bf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ForcemergeResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - private static readonly System.Text.Json.JsonEncodedText PropTask = System.Text.Json.JsonEncodedText.Encode("task"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ForcemergeResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propShards = default; - LocalJsonValue propTask = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (propTask.TryReadProperty(ref reader, options, PropTask, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ForcemergeResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Shards = propShards.Value, - Task = propTask.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ForcemergeResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteProperty(options, PropTask, value.Task, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ForcemergeResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ForcemergeResponseConverter))] public sealed partial class ForcemergeResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAliasRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAliasRequest.Converters.g.cs new file mode 100644 index 00000000000..e4787b9232f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAliasRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetAliasRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.GetAliasRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GetAliasRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetAliasRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAliasRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAliasRequest.g.cs index dc18188125e..0c20d7cf1c7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAliasRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAliasRequest.g.cs @@ -58,42 +58,13 @@ public sealed partial class GetAliasRequestParameters : Elastic.Transport.Reques public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class GetAliasRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.GetAliasRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetAliasRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetAliasRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get aliases. /// Retrieves information for one or more data stream or index aliases. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetAliasRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetAliasRequestConverter))] public sealed partial class GetAliasRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetAliasRequest(Elastic.Clients.Elasticsearch.Names? name) : base(r => r.Optional("name", name)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAliasResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAliasResponse.Converters.g.cs new file mode 100644 index 00000000000..aca7245a471 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAliasResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetAliasResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.GetAliasResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.IndexManagement.GetAliasResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Aliases = reader.ReadValue?>(options, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetAliasResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Aliases, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAliasResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAliasResponse.g.cs index cc7fe2d2aba..180e12d1ede 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAliasResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetAliasResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class GetAliasResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.GetAliasResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.IndexManagement.GetAliasResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Aliases = reader.ReadValue?>(options, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetAliasResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Aliases, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetAliasResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetAliasResponseConverter))] public partial class GetAliasResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleRequest.Converters.g.cs new file mode 100644 index 00000000000..a253777a66c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetDataLifecycleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleRequest.g.cs index c03951e93f3..25b70296e34 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleRequest.g.cs @@ -48,35 +48,6 @@ public sealed partial class GetDataLifecycleRequestParameters : Elastic.Transpor public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class GetDataLifecycleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get data stream lifecycles. @@ -85,7 +56,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Get the data stream lifecycle configuration of one or more data streams. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetDataLifecycleRequestConverter))] public sealed partial class GetDataLifecycleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleResponse.Converters.g.cs new file mode 100644 index 00000000000..e87e0c0e00d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetDataLifecycleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propDataStreams = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DataStreams = propDataStreams.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleResponse.g.cs index 052d828a20e..4bc351f621c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class GetDataLifecycleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propDataStreams = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DataStreams = propDataStreams.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetDataLifecycleResponseConverter))] public sealed partial class GetDataLifecycleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal GetDataLifecycleResponse(Elastic.Clients.Elasticsearch.Serialization.Js public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection DataStreams { get; set; } +System.Collections.Generic.IReadOnlyCollection DataStreams { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleStatsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleStatsRequest.Converters.g.cs new file mode 100644 index 00000000000..e0536e69af4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleStatsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetDataLifecycleStatsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleStatsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleStatsRequest.g.cs index a6addc90a6d..9bdaab59ce3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleStatsRequest.g.cs @@ -27,42 +27,13 @@ public sealed partial class GetDataLifecycleStatsRequestParameters : Elastic.Tra { } -internal sealed partial class GetDataLifecycleStatsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleStatsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get data stream lifecycle stats. /// Get statistics about the data streams that are managed by a data stream lifecycle. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleStatsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetDataLifecycleStatsRequestConverter))] public sealed partial class GetDataLifecycleStatsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleStatsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleStatsResponse.Converters.g.cs new file mode 100644 index 00000000000..b7faf46bbfd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleStatsResponse.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetDataLifecycleStatsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDataStreamCount = System.Text.Json.JsonEncodedText.Encode("data_stream_count"); + private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"); + private static readonly System.Text.Json.JsonEncodedText PropLastRunDurationInMillis = System.Text.Json.JsonEncodedText.Encode("last_run_duration_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTimeBetweenStartsInMillis = System.Text.Json.JsonEncodedText.Encode("time_between_starts_in_millis"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDataStreamCount = default; + LocalJsonValue> propDataStreams = default; + LocalJsonValue propLastRunDurationInMillis = default; + LocalJsonValue propTimeBetweenStartsInMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDataStreamCount.TryReadProperty(ref reader, options, PropDataStreamCount, null)) + { + continue; + } + + if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propLastRunDurationInMillis.TryReadProperty(ref reader, options, PropLastRunDurationInMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTimeBetweenStartsInMillis.TryReadProperty(ref reader, options, PropTimeBetweenStartsInMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DataStreamCount = propDataStreamCount.Value, + DataStreams = propDataStreams.Value, + LastRunDurationInMillis = propLastRunDurationInMillis.Value, + TimeBetweenStartsInMillis = propTimeBetweenStartsInMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleStatsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDataStreamCount, value.DataStreamCount, null, null); + writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropLastRunDurationInMillis, value.LastRunDurationInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTimeBetweenStartsInMillis, value.TimeBetweenStartsInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleStatsResponse.g.cs index 7935e65f7a8..cc259d1ba7c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataLifecycleStatsResponse.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class GetDataLifecycleStatsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDataStreamCount = System.Text.Json.JsonEncodedText.Encode("data_stream_count"); - private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"); - private static readonly System.Text.Json.JsonEncodedText PropLastRunDurationInMillis = System.Text.Json.JsonEncodedText.Encode("last_run_duration_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTimeBetweenStartsInMillis = System.Text.Json.JsonEncodedText.Encode("time_between_starts_in_millis"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDataStreamCount = default; - LocalJsonValue> propDataStreams = default; - LocalJsonValue propLastRunDurationInMillis = default; - LocalJsonValue propTimeBetweenStartsInMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDataStreamCount.TryReadProperty(ref reader, options, PropDataStreamCount, null)) - { - continue; - } - - if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propLastRunDurationInMillis.TryReadProperty(ref reader, options, PropLastRunDurationInMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTimeBetweenStartsInMillis.TryReadProperty(ref reader, options, PropTimeBetweenStartsInMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DataStreamCount = propDataStreamCount.Value, - DataStreams = propDataStreams.Value, - LastRunDurationInMillis = propLastRunDurationInMillis.Value, - TimeBetweenStartsInMillis = propTimeBetweenStartsInMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleStatsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDataStreamCount, value.DataStreamCount, null, null); - writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropLastRunDurationInMillis, value.LastRunDurationInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTimeBetweenStartsInMillis, value.TimeBetweenStartsInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetDataLifecycleStatsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetDataLifecycleStatsResponseConverter))] public sealed partial class GetDataLifecycleStatsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamMappingsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamMappingsRequest.Converters.g.cs new file mode 100644 index 00000000000..3c3530dd3e2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamMappingsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetDataStreamMappingsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamMappingsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamMappingsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamMappingsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamMappingsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamMappingsRequest.g.cs index 3490b12531f..f667af51706 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamMappingsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamMappingsRequest.g.cs @@ -35,35 +35,6 @@ public sealed partial class GetDataStreamMappingsRequestParameters : Elastic.Tra public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class GetDataStreamMappingsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamMappingsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamMappingsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamMappingsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get data stream mappings. @@ -72,7 +43,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Get mapping information for one or more data streams. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamMappingsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetDataStreamMappingsRequestConverter))] public sealed partial class GetDataStreamMappingsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamMappingsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamMappingsResponse.Converters.g.cs new file mode 100644 index 00000000000..747874745e6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamMappingsResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetDataStreamMappingsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamMappingsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propDataStreams = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamMappingsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DataStreams = propDataStreams.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamMappingsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamMappingsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamMappingsResponse.g.cs index a76f52e1c9c..a4989cd9f5e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamMappingsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamMappingsResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class GetDataStreamMappingsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamMappingsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propDataStreams = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamMappingsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DataStreams = propDataStreams.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamMappingsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamMappingsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetDataStreamMappingsResponseConverter))] public sealed partial class GetDataStreamMappingsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal GetDataStreamMappingsResponse(Elastic.Clients.Elasticsearch.Serializati public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection DataStreams { get; set; } +System.Collections.Generic.IReadOnlyCollection DataStreams { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamOptionsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamOptionsRequest.Converters.g.cs new file mode 100644 index 00000000000..b2e892f167a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamOptionsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetDataStreamOptionsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamOptionsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamOptionsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamOptionsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamOptionsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamOptionsRequest.g.cs index e8a75e3b63e..6a6122d4cf9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamOptionsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamOptionsRequest.g.cs @@ -41,35 +41,6 @@ public sealed partial class GetDataStreamOptionsRequestParameters : Elastic.Tran public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class GetDataStreamOptionsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamOptionsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamOptionsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamOptionsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get data stream options. @@ -78,7 +49,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Get the data stream options configuration of one or more data streams. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamOptionsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetDataStreamOptionsRequestConverter))] public sealed partial class GetDataStreamOptionsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamOptionsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamOptionsResponse.Converters.g.cs new file mode 100644 index 00000000000..8ceaeab4050 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamOptionsResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetDataStreamOptionsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamOptionsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propDataStreams = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamOptionsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DataStreams = propDataStreams.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamOptionsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamOptionsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamOptionsResponse.g.cs index 255887c35b0..28e0eb04f0d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamOptionsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamOptionsResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class GetDataStreamOptionsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamOptionsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propDataStreams = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamOptionsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DataStreams = propDataStreams.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamOptionsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamOptionsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetDataStreamOptionsResponseConverter))] public sealed partial class GetDataStreamOptionsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal GetDataStreamOptionsResponse(Elastic.Clients.Elasticsearch.Serializatio public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection DataStreams { get; set; } +System.Collections.Generic.IReadOnlyCollection DataStreams { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamRequest.Converters.g.cs new file mode 100644 index 00000000000..4ac396901ff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetDataStreamRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamRequest.g.cs index 1893e15081c..a483e3772fe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamRequest.g.cs @@ -55,35 +55,6 @@ public sealed partial class GetDataStreamRequestParameters : Elastic.Transport.R public bool? Verbose { get => Q("verbose"); set => Q("verbose", value); } } -internal sealed partial class GetDataStreamRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get data streams. @@ -92,7 +63,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Get information about one or more data streams. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetDataStreamRequestConverter))] public sealed partial class GetDataStreamRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetDataStreamRequest(Elastic.Clients.Elasticsearch.DataStreamNames? name) : base(r => r.Optional("name", name)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamResponse.Converters.g.cs new file mode 100644 index 00000000000..c891aabd8f8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetDataStreamResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propDataStreams = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DataStreams = propDataStreams.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamResponse.g.cs index f3177b46e90..b0d540c9454 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class GetDataStreamResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propDataStreams = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DataStreams = propDataStreams.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetDataStreamResponseConverter))] public sealed partial class GetDataStreamResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal GetDataStreamResponse(Elastic.Clients.Elasticsearch.Serialization.JsonC public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection DataStreams { get; set; } +System.Collections.Generic.IReadOnlyCollection DataStreams { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamSettingsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamSettingsRequest.Converters.g.cs new file mode 100644 index 00000000000..e240260ddc6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamSettingsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetDataStreamSettingsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamSettingsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamSettingsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamSettingsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamSettingsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamSettingsRequest.g.cs index 3545198417c..5a24b7f29cc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamSettingsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamSettingsRequest.g.cs @@ -35,35 +35,6 @@ public sealed partial class GetDataStreamSettingsRequestParameters : Elastic.Tra public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class GetDataStreamSettingsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamSettingsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamSettingsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamSettingsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get data stream settings. @@ -72,7 +43,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Get setting information for one or more data streams. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamSettingsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetDataStreamSettingsRequestConverter))] public sealed partial class GetDataStreamSettingsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamSettingsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamSettingsResponse.Converters.g.cs new file mode 100644 index 00000000000..a2f6e4f8f74 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamSettingsResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetDataStreamSettingsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamSettingsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propDataStreams = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamSettingsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DataStreams = propDataStreams.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamSettingsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamSettingsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamSettingsResponse.g.cs index 7e7d08ceec2..b6e4229866f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamSettingsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetDataStreamSettingsResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class GetDataStreamSettingsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamSettingsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propDataStreams = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamSettingsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DataStreams = propDataStreams.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamSettingsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetDataStreamSettingsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetDataStreamSettingsResponseConverter))] public sealed partial class GetDataStreamSettingsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal GetDataStreamSettingsResponse(Elastic.Clients.Elasticsearch.Serializati public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection DataStreams { get; set; } +System.Collections.Generic.IReadOnlyCollection DataStreams { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetFieldMappingRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetFieldMappingRequest.Converters.g.cs new file mode 100644 index 00000000000..c57b4c2ab38 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetFieldMappingRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetFieldMappingRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.GetFieldMappingRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GetFieldMappingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetFieldMappingRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetFieldMappingRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetFieldMappingRequest.g.cs index 1c0ff517279..5b955551d7d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetFieldMappingRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetFieldMappingRequest.g.cs @@ -57,35 +57,6 @@ public sealed partial class GetFieldMappingRequestParameters : Elastic.Transport public bool? IncludeDefaults { get => Q("include_defaults"); set => Q("include_defaults", value); } } -internal sealed partial class GetFieldMappingRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.GetFieldMappingRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetFieldMappingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetFieldMappingRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get mapping definitions. @@ -96,7 +67,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// This API is useful if you don't need a complete mapping or if an index mapping contains a large number of fields. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetFieldMappingRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetFieldMappingRequestConverter))] public sealed partial class GetFieldMappingRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetFieldMappingResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetFieldMappingResponse.Converters.g.cs new file mode 100644 index 00000000000..f139ff76b40 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetFieldMappingResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetFieldMappingResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.GetFieldMappingResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.IndexManagement.GetFieldMappingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { FieldMappings = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetFieldMappingResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.FieldMappings, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetFieldMappingResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetFieldMappingResponse.g.cs index f29f9b60078..5cd2b1703b1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetFieldMappingResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetFieldMappingResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class GetFieldMappingResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.GetFieldMappingResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.IndexManagement.GetFieldMappingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { FieldMappings = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetFieldMappingResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.FieldMappings, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetFieldMappingResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetFieldMappingResponseConverter))] public partial class GetFieldMappingResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexRequest.Converters.g.cs new file mode 100644 index 00000000000..a89907a7ff7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetIndexRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.GetIndexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GetIndexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetIndexRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexRequest.g.cs index 48956b6a999..607584b2dae 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexRequest.g.cs @@ -86,35 +86,6 @@ public sealed partial class GetIndexRequestParameters : Elastic.Transport.Reques public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class GetIndexRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.GetIndexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetIndexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetIndexRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get index information. @@ -122,7 +93,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// stream’s backing indices. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetIndexRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetIndexRequestConverter))] public sealed partial class GetIndexRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexResponse.Converters.g.cs new file mode 100644 index 00000000000..4a9b1ed7cee --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetIndexResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.GetIndexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.IndexManagement.GetIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Indices = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetIndexResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Indices, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexResponse.g.cs index 48d5f69c5d5..e123b9d9ba9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class GetIndexResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.GetIndexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.IndexManagement.GetIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Indices = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetIndexResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Indices, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetIndexResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetIndexResponseConverter))] public sealed partial class GetIndexResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexTemplateRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexTemplateRequest.Converters.g.cs new file mode 100644 index 00000000000..100006790ae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexTemplateRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetIndexTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.GetIndexTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GetIndexTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetIndexTemplateRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexTemplateRequest.g.cs index 942177674ec..feb86b26269 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexTemplateRequest.g.cs @@ -54,42 +54,13 @@ public sealed partial class GetIndexTemplateRequestParameters : Elastic.Transpor public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class GetIndexTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.GetIndexTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetIndexTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetIndexTemplateRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get index templates. /// Get information about one or more index templates. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetIndexTemplateRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetIndexTemplateRequestConverter))] public sealed partial class GetIndexTemplateRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetIndexTemplateRequest(Elastic.Clients.Elasticsearch.Name? name) : base(r => r.Optional("name", name)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexTemplateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexTemplateResponse.Converters.g.cs new file mode 100644 index 00000000000..998a6379123 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexTemplateResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetIndexTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndexTemplates = System.Text.Json.JsonEncodedText.Encode("index_templates"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.GetIndexTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propIndexTemplates = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndexTemplates.TryReadProperty(ref reader, options, PropIndexTemplates, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GetIndexTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + IndexTemplates = propIndexTemplates.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetIndexTemplateResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndexTemplates, value.IndexTemplates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexTemplateResponse.g.cs index e06c3a788fb..ad7f20ea27b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndexTemplateResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class GetIndexTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndexTemplates = System.Text.Json.JsonEncodedText.Encode("index_templates"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.GetIndexTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propIndexTemplates = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndexTemplates.TryReadProperty(ref reader, options, PropIndexTemplates, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetIndexTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - IndexTemplates = propIndexTemplates.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetIndexTemplateResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndexTemplates, value.IndexTemplates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetIndexTemplateResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetIndexTemplateResponseConverter))] public sealed partial class GetIndexTemplateResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal GetIndexTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.Js public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection IndexTemplates { get; set; } +System.Collections.Generic.IReadOnlyCollection IndexTemplates { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndicesSettingsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndicesSettingsRequest.Converters.g.cs new file mode 100644 index 00000000000..7a6b41cac6a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndicesSettingsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetIndicesSettingsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.GetIndicesSettingsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GetIndicesSettingsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetIndicesSettingsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndicesSettingsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndicesSettingsRequest.g.cs index 0672ed95f38..318976042b4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndicesSettingsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndicesSettingsRequest.g.cs @@ -84,35 +84,6 @@ public sealed partial class GetIndicesSettingsRequestParameters : Elastic.Transp public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class GetIndicesSettingsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.GetIndicesSettingsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetIndicesSettingsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetIndicesSettingsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get index settings. @@ -120,7 +91,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// For data streams, it returns setting information for the stream's backing indices. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetIndicesSettingsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetIndicesSettingsRequestConverter))] public sealed partial class GetIndicesSettingsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetIndicesSettingsRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndicesSettingsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndicesSettingsResponse.Converters.g.cs new file mode 100644 index 00000000000..f22bb75dac7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndicesSettingsResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetIndicesSettingsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.GetIndicesSettingsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.IndexManagement.GetIndicesSettingsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Settings = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetIndicesSettingsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Settings, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndicesSettingsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndicesSettingsResponse.g.cs index a4a6b6ac40b..5c7f4912f94 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndicesSettingsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetIndicesSettingsResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class GetIndicesSettingsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.GetIndicesSettingsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.IndexManagement.GetIndicesSettingsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Settings = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetIndicesSettingsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Settings, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetIndicesSettingsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetIndicesSettingsResponseConverter))] public sealed partial class GetIndicesSettingsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMappingRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMappingRequest.Converters.g.cs new file mode 100644 index 00000000000..2d713e98f18 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMappingRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetMappingRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.GetMappingRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GetMappingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetMappingRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMappingRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMappingRequest.g.cs index 2e9ae6c3ef2..2371b399d01 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMappingRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMappingRequest.g.cs @@ -66,42 +66,13 @@ public sealed partial class GetMappingRequestParameters : Elastic.Transport.Requ public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class GetMappingRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.GetMappingRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetMappingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetMappingRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get mapping definitions. /// For data streams, the API retrieves mappings for the stream’s backing indices. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetMappingRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetMappingRequestConverter))] public sealed partial class GetMappingRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetMappingRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMappingResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMappingResponse.Converters.g.cs new file mode 100644 index 00000000000..7fe9934f415 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMappingResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetMappingResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.GetMappingResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.IndexManagement.GetMappingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Mappings = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetMappingResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Mappings, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMappingResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMappingResponse.g.cs index b5f25c00ec3..b1788463d05 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMappingResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMappingResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class GetMappingResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.GetMappingResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.IndexManagement.GetMappingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Mappings = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetMappingResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Mappings, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetMappingResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetMappingResponseConverter))] public sealed partial class GetMappingResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMigrateReindexStatusRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMigrateReindexStatusRequest.Converters.g.cs new file mode 100644 index 00000000000..2b94286b72e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMigrateReindexStatusRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetMigrateReindexStatusRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.GetMigrateReindexStatusRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GetMigrateReindexStatusRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetMigrateReindexStatusRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMigrateReindexStatusRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMigrateReindexStatusRequest.g.cs index cf60861f22c..c1bbb9ef871 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMigrateReindexStatusRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMigrateReindexStatusRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class GetMigrateReindexStatusRequestParameters : Elastic.T { } -internal sealed partial class GetMigrateReindexStatusRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.GetMigrateReindexStatusRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetMigrateReindexStatusRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetMigrateReindexStatusRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get the migration reindexing status. @@ -64,7 +35,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Get the status of a migration reindex attempt for a data stream or index. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetMigrateReindexStatusRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetMigrateReindexStatusRequestConverter))] public sealed partial class GetMigrateReindexStatusRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMigrateReindexStatusResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMigrateReindexStatusResponse.Converters.g.cs new file mode 100644 index 00000000000..b2214476532 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMigrateReindexStatusResponse.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetMigrateReindexStatusResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropComplete = System.Text.Json.JsonEncodedText.Encode("complete"); + private static readonly System.Text.Json.JsonEncodedText PropErrors = System.Text.Json.JsonEncodedText.Encode("errors"); + private static readonly System.Text.Json.JsonEncodedText PropException = System.Text.Json.JsonEncodedText.Encode("exception"); + private static readonly System.Text.Json.JsonEncodedText PropInProgress = System.Text.Json.JsonEncodedText.Encode("in_progress"); + private static readonly System.Text.Json.JsonEncodedText PropPending = System.Text.Json.JsonEncodedText.Encode("pending"); + private static readonly System.Text.Json.JsonEncodedText PropStartTime = System.Text.Json.JsonEncodedText.Encode("start_time"); + private static readonly System.Text.Json.JsonEncodedText PropStartTimeMillis = System.Text.Json.JsonEncodedText.Encode("start_time_millis"); + private static readonly System.Text.Json.JsonEncodedText PropSuccesses = System.Text.Json.JsonEncodedText.Encode("successes"); + private static readonly System.Text.Json.JsonEncodedText PropTotalIndicesInDataStream = System.Text.Json.JsonEncodedText.Encode("total_indices_in_data_stream"); + private static readonly System.Text.Json.JsonEncodedText PropTotalIndicesRequiringUpgrade = System.Text.Json.JsonEncodedText.Encode("total_indices_requiring_upgrade"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.GetMigrateReindexStatusResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propComplete = default; + LocalJsonValue> propErrors = default; + LocalJsonValue propException = default; + LocalJsonValue> propInProgress = default; + LocalJsonValue propPending = default; + LocalJsonValue propStartTime = default; + LocalJsonValue propStartTimeMillis = default; + LocalJsonValue propSuccesses = default; + LocalJsonValue propTotalIndicesInDataStream = default; + LocalJsonValue propTotalIndicesRequiringUpgrade = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propComplete.TryReadProperty(ref reader, options, PropComplete, null)) + { + continue; + } + + if (propErrors.TryReadProperty(ref reader, options, PropErrors, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propException.TryReadProperty(ref reader, options, PropException, null)) + { + continue; + } + + if (propInProgress.TryReadProperty(ref reader, options, PropInProgress, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propPending.TryReadProperty(ref reader, options, PropPending, null)) + { + continue; + } + + if (propStartTime.TryReadProperty(ref reader, options, PropStartTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propStartTimeMillis.TryReadProperty(ref reader, options, PropStartTimeMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propSuccesses.TryReadProperty(ref reader, options, PropSuccesses, null)) + { + continue; + } + + if (propTotalIndicesInDataStream.TryReadProperty(ref reader, options, PropTotalIndicesInDataStream, null)) + { + continue; + } + + if (propTotalIndicesRequiringUpgrade.TryReadProperty(ref reader, options, PropTotalIndicesRequiringUpgrade, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GetMigrateReindexStatusResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Complete = propComplete.Value, + Errors = propErrors.Value, + Exception = propException.Value, + InProgress = propInProgress.Value, + Pending = propPending.Value, + StartTime = propStartTime.Value, + StartTimeMillis = propStartTimeMillis.Value, + Successes = propSuccesses.Value, + TotalIndicesInDataStream = propTotalIndicesInDataStream.Value, + TotalIndicesRequiringUpgrade = propTotalIndicesRequiringUpgrade.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetMigrateReindexStatusResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropComplete, value.Complete, null, null); + writer.WriteProperty(options, PropErrors, value.Errors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropException, value.Exception, null, null); + writer.WriteProperty(options, PropInProgress, value.InProgress, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPending, value.Pending, null, null); + writer.WriteProperty(options, PropStartTime, value.StartTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropStartTimeMillis, value.StartTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropSuccesses, value.Successes, null, null); + writer.WriteProperty(options, PropTotalIndicesInDataStream, value.TotalIndicesInDataStream, null, null); + writer.WriteProperty(options, PropTotalIndicesRequiringUpgrade, value.TotalIndicesRequiringUpgrade, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMigrateReindexStatusResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMigrateReindexStatusResponse.g.cs index db19e3f8358..3ca8b28058a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMigrateReindexStatusResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetMigrateReindexStatusResponse.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class GetMigrateReindexStatusResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropComplete = System.Text.Json.JsonEncodedText.Encode("complete"); - private static readonly System.Text.Json.JsonEncodedText PropErrors = System.Text.Json.JsonEncodedText.Encode("errors"); - private static readonly System.Text.Json.JsonEncodedText PropException = System.Text.Json.JsonEncodedText.Encode("exception"); - private static readonly System.Text.Json.JsonEncodedText PropInProgress = System.Text.Json.JsonEncodedText.Encode("in_progress"); - private static readonly System.Text.Json.JsonEncodedText PropPending = System.Text.Json.JsonEncodedText.Encode("pending"); - private static readonly System.Text.Json.JsonEncodedText PropStartTime = System.Text.Json.JsonEncodedText.Encode("start_time"); - private static readonly System.Text.Json.JsonEncodedText PropStartTimeMillis = System.Text.Json.JsonEncodedText.Encode("start_time_millis"); - private static readonly System.Text.Json.JsonEncodedText PropSuccesses = System.Text.Json.JsonEncodedText.Encode("successes"); - private static readonly System.Text.Json.JsonEncodedText PropTotalIndicesInDataStream = System.Text.Json.JsonEncodedText.Encode("total_indices_in_data_stream"); - private static readonly System.Text.Json.JsonEncodedText PropTotalIndicesRequiringUpgrade = System.Text.Json.JsonEncodedText.Encode("total_indices_requiring_upgrade"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.GetMigrateReindexStatusResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propComplete = default; - LocalJsonValue> propErrors = default; - LocalJsonValue propException = default; - LocalJsonValue> propInProgress = default; - LocalJsonValue propPending = default; - LocalJsonValue propStartTime = default; - LocalJsonValue propStartTimeMillis = default; - LocalJsonValue propSuccesses = default; - LocalJsonValue propTotalIndicesInDataStream = default; - LocalJsonValue propTotalIndicesRequiringUpgrade = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propComplete.TryReadProperty(ref reader, options, PropComplete, null)) - { - continue; - } - - if (propErrors.TryReadProperty(ref reader, options, PropErrors, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propException.TryReadProperty(ref reader, options, PropException, null)) - { - continue; - } - - if (propInProgress.TryReadProperty(ref reader, options, PropInProgress, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propPending.TryReadProperty(ref reader, options, PropPending, null)) - { - continue; - } - - if (propStartTime.TryReadProperty(ref reader, options, PropStartTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propStartTimeMillis.TryReadProperty(ref reader, options, PropStartTimeMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propSuccesses.TryReadProperty(ref reader, options, PropSuccesses, null)) - { - continue; - } - - if (propTotalIndicesInDataStream.TryReadProperty(ref reader, options, PropTotalIndicesInDataStream, null)) - { - continue; - } - - if (propTotalIndicesRequiringUpgrade.TryReadProperty(ref reader, options, PropTotalIndicesRequiringUpgrade, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetMigrateReindexStatusResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Complete = propComplete.Value, - Errors = propErrors.Value, - Exception = propException.Value, - InProgress = propInProgress.Value, - Pending = propPending.Value, - StartTime = propStartTime.Value, - StartTimeMillis = propStartTimeMillis.Value, - Successes = propSuccesses.Value, - TotalIndicesInDataStream = propTotalIndicesInDataStream.Value, - TotalIndicesRequiringUpgrade = propTotalIndicesRequiringUpgrade.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetMigrateReindexStatusResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropComplete, value.Complete, null, null); - writer.WriteProperty(options, PropErrors, value.Errors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropException, value.Exception, null, null); - writer.WriteProperty(options, PropInProgress, value.InProgress, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPending, value.Pending, null, null); - writer.WriteProperty(options, PropStartTime, value.StartTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropStartTimeMillis, value.StartTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropSuccesses, value.Successes, null, null); - writer.WriteProperty(options, PropTotalIndicesInDataStream, value.TotalIndicesInDataStream, null, null); - writer.WriteProperty(options, PropTotalIndicesRequiringUpgrade, value.TotalIndicesRequiringUpgrade, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetMigrateReindexStatusResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetMigrateReindexStatusResponseConverter))] public sealed partial class GetMigrateReindexStatusResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -159,44 +39,44 @@ internal GetMigrateReindexStatusResponse(Elastic.Clients.Elasticsearch.Serializa public #if NET7_0_OR_GREATER - required +required #endif - bool Complete { get; set; } +bool Complete { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Errors { get; set; } +System.Collections.Generic.IReadOnlyCollection Errors { get; set; } public string? Exception { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection InProgress { get; set; } +System.Collections.Generic.IReadOnlyCollection InProgress { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - int Pending { get; set; } +int Pending { get; set; } public System.DateTimeOffset? StartTime { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.DateTimeOffset StartTimeMillis { get; set; } +System.DateTimeOffset StartTimeMillis { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - int Successes { get; set; } +int Successes { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - int TotalIndicesInDataStream { get; set; } +int TotalIndicesInDataStream { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - int TotalIndicesRequiringUpgrade { get; set; } +int TotalIndicesRequiringUpgrade { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetTemplateRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetTemplateRequest.Converters.g.cs new file mode 100644 index 00000000000..a3fb1174aae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetTemplateRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.GetTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GetTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetTemplateRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetTemplateRequest.g.cs index 30f1cfc5a77..354efda3041 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetTemplateRequest.g.cs @@ -48,35 +48,6 @@ public sealed partial class GetTemplateRequestParameters : Elastic.Transport.Req public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class GetTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.GetTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.GetTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetTemplateRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get legacy index templates. @@ -86,7 +57,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetTemplateRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetTemplateRequestConverter))] public sealed partial class GetTemplateRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetTemplateRequest(Elastic.Clients.Elasticsearch.Names? name) : base(r => r.Optional("name", name)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetTemplateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetTemplateResponse.Converters.g.cs new file mode 100644 index 00000000000..0b7ae3cfc30 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetTemplateResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.GetTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.IndexManagement.GetTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Templates = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetTemplateResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Templates, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetTemplateResponse.g.cs index 195c4a5d6e4..e4abbe8d656 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetTemplateResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class GetTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.GetTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.IndexManagement.GetTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Templates = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetTemplateResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Templates, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.GetTemplateResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetTemplateResponseConverter))] public sealed partial class GetTemplateResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/IndicesStatsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/IndicesStatsRequest.Converters.g.cs new file mode 100644 index 00000000000..f09fe9becca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/IndicesStatsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndicesStatsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.IndicesStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndicesStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndicesStatsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/IndicesStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/IndicesStatsRequest.g.cs index b5dca3edf63..49ab77f4a81 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/IndicesStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/IndicesStatsRequest.g.cs @@ -91,35 +91,6 @@ public sealed partial class IndicesStatsRequestParameters : Elastic.Transport.Re public Elastic.Clients.Elasticsearch.Level? Level { get => Q("level"); set => Q("level", value); } } -internal sealed partial class IndicesStatsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.IndicesStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndicesStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndicesStatsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get index statistics. @@ -138,7 +109,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Although the shard is no longer part of the node, that node retains any node-level statistics to which the shard contributed. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndicesStatsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndicesStatsRequestConverter))] public sealed partial class IndicesStatsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public IndicesStatsRequest(Elastic.Clients.Elasticsearch.Metrics? metric) : base(r => r.Optional("metric", metric)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/IndicesStatsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/IndicesStatsResponse.Converters.g.cs new file mode 100644 index 00000000000..194926eb8c8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/IndicesStatsResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndicesStatsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAll = System.Text.Json.JsonEncodedText.Encode("_all"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndicesStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAll = default; + LocalJsonValue?> propIndices = default; + LocalJsonValue propShards = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAll.TryReadProperty(ref reader, options, PropAll, null)) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndicesStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + All = propAll.Value, + Indices = propIndices.Value, + Shards = propShards.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndicesStatsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAll, value.All, null, null); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/IndicesStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/IndicesStatsResponse.g.cs index e85bf92e995..0822661060c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/IndicesStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/IndicesStatsResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndicesStatsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAll = System.Text.Json.JsonEncodedText.Encode("_all"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndicesStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAll = default; - LocalJsonValue?> propIndices = default; - LocalJsonValue propShards = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAll.TryReadProperty(ref reader, options, PropAll, null)) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndicesStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - All = propAll.Value, - Indices = propIndices.Value, - Shards = propShards.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndicesStatsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAll, value.All, null, null); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndicesStatsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndicesStatsResponseConverter))] public sealed partial class IndicesStatsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -96,13 +39,13 @@ internal IndicesStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCo public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.IndexManagement.IndicesStats All { get; set; } +Elastic.Clients.Elasticsearch.IndexManagement.IndicesStats All { get; set; } public System.Collections.Generic.IReadOnlyDictionary? Indices { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; set; } +Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateReindexRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateReindexRequest.Converters.g.cs new file mode 100644 index 00000000000..cb9e655fd91 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateReindexRequest.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class MigrateReindexRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.MigrateReindexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.IndexManagement.MigrateReindexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Reindex = reader.ReadValue(options, null) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MigrateReindexRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Reindex, null); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateReindexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateReindexRequest.g.cs index ad6a0f95ff0..d9e76681e36 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateReindexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateReindexRequest.g.cs @@ -27,19 +27,6 @@ public sealed partial class MigrateReindexRequestParameters : Elastic.Transport. { } -internal sealed partial class MigrateReindexRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.MigrateReindexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.IndexManagement.MigrateReindexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Reindex = reader.ReadValue(options, null) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MigrateReindexRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Reindex, null); - } -} - /// /// /// Reindex legacy backing indices. @@ -50,7 +37,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The persistent task ID is returned immediately and the reindexing work is completed in that task. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.MigrateReindexRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.MigrateReindexRequestConverter))] public sealed partial class MigrateReindexRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateReindexResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateReindexResponse.Converters.g.cs new file mode 100644 index 00000000000..77011e763b9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateReindexResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class MigrateReindexResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.MigrateReindexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.MigrateReindexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MigrateReindexResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateReindexResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateReindexResponse.g.cs index 32b4adf0a84..be6dc8d163d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateReindexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateReindexResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class MigrateReindexResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.MigrateReindexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.MigrateReindexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MigrateReindexResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.MigrateReindexResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.MigrateReindexResponseConverter))] public sealed partial class MigrateReindexResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateToDataStreamRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateToDataStreamRequest.Converters.g.cs new file mode 100644 index 00000000000..18f0aef08da --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateToDataStreamRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class MigrateToDataStreamRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.MigrateToDataStreamRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.MigrateToDataStreamRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MigrateToDataStreamRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateToDataStreamRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateToDataStreamRequest.g.cs index e4c21e20dec..f66f46357dd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateToDataStreamRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateToDataStreamRequest.g.cs @@ -40,35 +40,6 @@ public sealed partial class MigrateToDataStreamRequestParameters : Elastic.Trans public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class MigrateToDataStreamRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.MigrateToDataStreamRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.MigrateToDataStreamRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MigrateToDataStreamRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Convert an index alias to a data stream. @@ -84,7 +55,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The write index for the alias becomes the write index for the stream. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.MigrateToDataStreamRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.MigrateToDataStreamRequestConverter))] public sealed partial class MigrateToDataStreamRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateToDataStreamResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateToDataStreamResponse.Converters.g.cs new file mode 100644 index 00000000000..95b66a1d834 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateToDataStreamResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class MigrateToDataStreamResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.MigrateToDataStreamResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.MigrateToDataStreamResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MigrateToDataStreamResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateToDataStreamResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateToDataStreamResponse.g.cs index 4649db81d9d..c71ac7af780 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateToDataStreamResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/MigrateToDataStreamResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class MigrateToDataStreamResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.MigrateToDataStreamResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.MigrateToDataStreamResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MigrateToDataStreamResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.MigrateToDataStreamResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.MigrateToDataStreamResponseConverter))] public sealed partial class MigrateToDataStreamResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ModifyDataStreamRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ModifyDataStreamRequest.Converters.g.cs new file mode 100644 index 00000000000..6ed44d84ac0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ModifyDataStreamRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ModifyDataStreamRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropActions = System.Text.Json.JsonEncodedText.Encode("actions"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ModifyDataStreamRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propActions = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propActions.TryReadProperty(ref reader, options, PropActions, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ModifyDataStreamRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Actions = propActions.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ModifyDataStreamRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropActions, value.Actions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ModifyDataStreamRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ModifyDataStreamRequest.g.cs index ad330a5af43..614ea781a3e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ModifyDataStreamRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ModifyDataStreamRequest.g.cs @@ -27,52 +27,13 @@ public sealed partial class ModifyDataStreamRequestParameters : Elastic.Transpor { } -internal sealed partial class ModifyDataStreamRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropActions = System.Text.Json.JsonEncodedText.Encode("actions"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ModifyDataStreamRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propActions = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propActions.TryReadProperty(ref reader, options, PropActions, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ModifyDataStreamRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Actions = propActions.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ModifyDataStreamRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropActions, value.Actions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// Update data streams. /// Performs one or more data stream modification actions in a single atomic operation. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ModifyDataStreamRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ModifyDataStreamRequestConverter))] public sealed partial class ModifyDataStreamRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ModifyDataStreamResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ModifyDataStreamResponse.Converters.g.cs new file mode 100644 index 00000000000..da8acc17ab7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ModifyDataStreamResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ModifyDataStreamResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ModifyDataStreamResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ModifyDataStreamResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ModifyDataStreamResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ModifyDataStreamResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ModifyDataStreamResponse.g.cs index f7ec961334d..d29c6361f9d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ModifyDataStreamResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ModifyDataStreamResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ModifyDataStreamResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ModifyDataStreamResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ModifyDataStreamResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ModifyDataStreamResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ModifyDataStreamResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ModifyDataStreamResponseConverter))] public sealed partial class ModifyDataStreamResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/OpenIndexRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/OpenIndexRequest.Converters.g.cs new file mode 100644 index 00000000000..67581fa075a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/OpenIndexRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class OpenIndexRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.OpenIndexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.OpenIndexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.OpenIndexRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/OpenIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/OpenIndexRequest.g.cs index e1dc8e848cf..1b2791739ed 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/OpenIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/OpenIndexRequest.g.cs @@ -74,35 +74,6 @@ public sealed partial class OpenIndexRequestParameters : Elastic.Transport.Reque public Elastic.Clients.Elasticsearch.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } } -internal sealed partial class OpenIndexRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.OpenIndexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.OpenIndexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.OpenIndexRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Open a closed index. @@ -136,7 +107,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Because opening or closing an index allocates its shards, the wait_for_active_shards setting on index creation applies to the _open and _close index actions as well. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.OpenIndexRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.OpenIndexRequestConverter))] public sealed partial class OpenIndexRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/OpenIndexResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/OpenIndexResponse.Converters.g.cs new file mode 100644 index 00000000000..f077db20aed --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/OpenIndexResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class OpenIndexResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + private static readonly System.Text.Json.JsonEncodedText PropShardsAcknowledged = System.Text.Json.JsonEncodedText.Encode("shards_acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.OpenIndexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + LocalJsonValue propShardsAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (propShardsAcknowledged.TryReadProperty(ref reader, options, PropShardsAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.OpenIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value, + ShardsAcknowledged = propShardsAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.OpenIndexResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteProperty(options, PropShardsAcknowledged, value.ShardsAcknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/OpenIndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/OpenIndexResponse.g.cs index c48a9603f6b..ed7a7d49c9e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/OpenIndexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/OpenIndexResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class OpenIndexResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - private static readonly System.Text.Json.JsonEncodedText PropShardsAcknowledged = System.Text.Json.JsonEncodedText.Encode("shards_acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.OpenIndexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - LocalJsonValue propShardsAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (propShardsAcknowledged.TryReadProperty(ref reader, options, PropShardsAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.OpenIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value, - ShardsAcknowledged = propShardsAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.OpenIndexResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteProperty(options, PropShardsAcknowledged, value.ShardsAcknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.OpenIndexResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.OpenIndexResponseConverter))] public sealed partial class OpenIndexResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal OpenIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConst public #if NET7_0_OR_GREATER - required +required #endif - bool Acknowledged { get; set; } +bool Acknowledged { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool ShardsAcknowledged { get; set; } +bool ShardsAcknowledged { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PromoteDataStreamRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PromoteDataStreamRequest.Converters.g.cs new file mode 100644 index 00000000000..49c50939349 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PromoteDataStreamRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class PromoteDataStreamRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.PromoteDataStreamRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.PromoteDataStreamRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PromoteDataStreamRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PromoteDataStreamRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PromoteDataStreamRequest.g.cs index ddbcb7a6980..38db9bfba37 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PromoteDataStreamRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PromoteDataStreamRequest.g.cs @@ -33,35 +33,6 @@ public sealed partial class PromoteDataStreamRequestParameters : Elastic.Transpo public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class PromoteDataStreamRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.PromoteDataStreamRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.PromoteDataStreamRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PromoteDataStreamRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Promote a data stream. @@ -79,7 +50,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// This will affect the lifecycle management of the data stream and interfere with the data stream size and retention. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.PromoteDataStreamRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.PromoteDataStreamRequestConverter))] public sealed partial class PromoteDataStreamRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PromoteDataStreamResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PromoteDataStreamResponse.Converters.g.cs new file mode 100644 index 00000000000..0e7819df885 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PromoteDataStreamResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class PromoteDataStreamResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.PromoteDataStreamResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.IndexManagement.PromoteDataStreamResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Result = reader.ReadValue(options, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PromoteDataStreamResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Result, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PromoteDataStreamResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PromoteDataStreamResponse.g.cs index e61ea1d75b1..37beb235ed6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PromoteDataStreamResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PromoteDataStreamResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class PromoteDataStreamResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.PromoteDataStreamResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.IndexManagement.PromoteDataStreamResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Result = reader.ReadValue(options, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PromoteDataStreamResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Result, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.PromoteDataStreamResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.PromoteDataStreamResponseConverter))] public sealed partial class PromoteDataStreamResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasRequest.Converters.g.cs new file mode 100644 index 00000000000..00489edceb8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasRequest.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class PutAliasRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropIndexRouting = System.Text.Json.JsonEncodedText.Encode("index_routing"); + private static readonly System.Text.Json.JsonEncodedText PropIsWriteIndex = System.Text.Json.JsonEncodedText.Encode("is_write_index"); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); + private static readonly System.Text.Json.JsonEncodedText PropSearchRouting = System.Text.Json.JsonEncodedText.Encode("search_routing"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.PutAliasRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFilter = default; + LocalJsonValue propIndexRouting = default; + LocalJsonValue propIsWriteIndex = default; + LocalJsonValue propRouting = default; + LocalJsonValue propSearchRouting = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) + { + continue; + } + + if (propIndexRouting.TryReadProperty(ref reader, options, PropIndexRouting, null)) + { + continue; + } + + if (propIsWriteIndex.TryReadProperty(ref reader, options, PropIsWriteIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (propSearchRouting.TryReadProperty(ref reader, options, PropSearchRouting, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.PutAliasRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Filter = propFilter.Value, + IndexRouting = propIndexRouting.Value, + IsWriteIndex = propIsWriteIndex.Value, + Routing = propRouting.Value, + SearchRouting = propSearchRouting.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutAliasRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFilter, value.Filter, null, null); + writer.WriteProperty(options, PropIndexRouting, value.IndexRouting, null, null); + writer.WriteProperty(options, PropIsWriteIndex, value.IsWriteIndex, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteProperty(options, PropSearchRouting, value.SearchRouting, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasRequest.g.cs index a9f6190a39f..0a94f277e91 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasRequest.g.cs @@ -42,88 +42,13 @@ public sealed partial class PutAliasRequestParameters : Elastic.Transport.Reques public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutAliasRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropIndexRouting = System.Text.Json.JsonEncodedText.Encode("index_routing"); - private static readonly System.Text.Json.JsonEncodedText PropIsWriteIndex = System.Text.Json.JsonEncodedText.Encode("is_write_index"); - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); - private static readonly System.Text.Json.JsonEncodedText PropSearchRouting = System.Text.Json.JsonEncodedText.Encode("search_routing"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.PutAliasRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFilter = default; - LocalJsonValue propIndexRouting = default; - LocalJsonValue propIsWriteIndex = default; - LocalJsonValue propRouting = default; - LocalJsonValue propSearchRouting = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) - { - continue; - } - - if (propIndexRouting.TryReadProperty(ref reader, options, PropIndexRouting, null)) - { - continue; - } - - if (propIsWriteIndex.TryReadProperty(ref reader, options, PropIsWriteIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (propSearchRouting.TryReadProperty(ref reader, options, PropSearchRouting, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.PutAliasRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Filter = propFilter.Value, - IndexRouting = propIndexRouting.Value, - IsWriteIndex = propIsWriteIndex.Value, - Routing = propRouting.Value, - SearchRouting = propSearchRouting.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutAliasRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFilter, value.Filter, null, null); - writer.WriteProperty(options, PropIndexRouting, value.IndexRouting, null, null); - writer.WriteProperty(options, PropIsWriteIndex, value.IsWriteIndex, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteProperty(options, PropSearchRouting, value.SearchRouting, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create or update an alias. /// Adds a data stream or index to an alias. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.PutAliasRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.PutAliasRequestConverter))] public sealed partial class PutAliasRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasResponse.Converters.g.cs new file mode 100644 index 00000000000..939c34bd3d7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class PutAliasResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.PutAliasResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.PutAliasResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutAliasResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasResponse.g.cs index 01d005d9db3..a1e251895d8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutAliasResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class PutAliasResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.PutAliasResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.PutAliasResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutAliasResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.PutAliasResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.PutAliasResponseConverter))] public sealed partial class PutAliasResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataLifecycleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataLifecycleRequest.Converters.g.cs new file mode 100644 index 00000000000..91e51d711b5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataLifecycleRequest.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class PutDataLifecycleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDataRetention = System.Text.Json.JsonEncodedText.Encode("data_retention"); + private static readonly System.Text.Json.JsonEncodedText PropDownsampling = System.Text.Json.JsonEncodedText.Encode("downsampling"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.PutDataLifecycleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDataRetention = default; + LocalJsonValue propDownsampling = default; + LocalJsonValue propEnabled = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDataRetention.TryReadProperty(ref reader, options, PropDataRetention, null)) + { + continue; + } + + if (propDownsampling.TryReadProperty(ref reader, options, PropDownsampling, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.PutDataLifecycleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DataRetention = propDataRetention.Value, + Downsampling = propDownsampling.Value, + Enabled = propEnabled.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutDataLifecycleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDataRetention, value.DataRetention, null, null); + writer.WriteProperty(options, PropDownsampling, value.Downsampling, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataLifecycleRequest.g.cs index 7ec1f64bba8..4f5e0da14ec 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataLifecycleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataLifecycleRequest.g.cs @@ -51,70 +51,13 @@ public sealed partial class PutDataLifecycleRequestParameters : Elastic.Transpor public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutDataLifecycleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDataRetention = System.Text.Json.JsonEncodedText.Encode("data_retention"); - private static readonly System.Text.Json.JsonEncodedText PropDownsampling = System.Text.Json.JsonEncodedText.Encode("downsampling"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.PutDataLifecycleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDataRetention = default; - LocalJsonValue propDownsampling = default; - LocalJsonValue propEnabled = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDataRetention.TryReadProperty(ref reader, options, PropDataRetention, null)) - { - continue; - } - - if (propDownsampling.TryReadProperty(ref reader, options, PropDownsampling, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.PutDataLifecycleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DataRetention = propDataRetention.Value, - Downsampling = propDownsampling.Value, - Enabled = propEnabled.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutDataLifecycleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDataRetention, value.DataRetention, null, null); - writer.WriteProperty(options, PropDownsampling, value.Downsampling, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Update data stream lifecycles. /// Update the data stream lifecycle of the specified data streams. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.PutDataLifecycleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.PutDataLifecycleRequestConverter))] public sealed partial class PutDataLifecycleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataLifecycleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataLifecycleResponse.Converters.g.cs new file mode 100644 index 00000000000..31f2d7341f6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataLifecycleResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class PutDataLifecycleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.PutDataLifecycleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.PutDataLifecycleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutDataLifecycleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataLifecycleResponse.g.cs index 0c7addc457d..7667288562f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataLifecycleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataLifecycleResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class PutDataLifecycleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.PutDataLifecycleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.PutDataLifecycleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutDataLifecycleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.PutDataLifecycleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.PutDataLifecycleResponseConverter))] public sealed partial class PutDataLifecycleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamMappingsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamMappingsRequest.Converters.g.cs new file mode 100644 index 00000000000..b0eab51d065 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamMappingsRequest.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class PutDataStreamMappingsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamMappingsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamMappingsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Mappings = reader.ReadValue(options, null) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamMappingsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Mappings, null); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamMappingsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamMappingsRequest.g.cs index 66cad0ce69e..93d1167a4d5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamMappingsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamMappingsRequest.g.cs @@ -52,19 +52,6 @@ public sealed partial class PutDataStreamMappingsRequestParameters : Elastic.Tra public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutDataStreamMappingsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamMappingsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamMappingsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Mappings = reader.ReadValue(options, null) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamMappingsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Mappings, null); - } -} - /// /// /// Update data stream mappings. @@ -75,7 +62,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// that are created during rollover after this API is called. No indices are changed by this API. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamMappingsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.PutDataStreamMappingsRequestConverter))] public sealed partial class PutDataStreamMappingsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamMappingsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamMappingsResponse.Converters.g.cs new file mode 100644 index 00000000000..f28f906afe5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamMappingsResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class PutDataStreamMappingsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamMappingsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propDataStreams = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamMappingsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DataStreams = propDataStreams.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamMappingsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamMappingsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamMappingsResponse.g.cs index 647e855db33..7c74a79db3b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamMappingsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamMappingsResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class PutDataStreamMappingsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamMappingsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propDataStreams = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamMappingsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DataStreams = propDataStreams.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamMappingsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamMappingsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.PutDataStreamMappingsResponseConverter))] public sealed partial class PutDataStreamMappingsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal PutDataStreamMappingsResponse(Elastic.Clients.Elasticsearch.Serializati public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection DataStreams { get; set; } +System.Collections.Generic.IReadOnlyCollection DataStreams { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamOptionsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamOptionsRequest.Converters.g.cs new file mode 100644 index 00000000000..4485adf71d8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamOptionsRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class PutDataStreamOptionsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFailureStore = System.Text.Json.JsonEncodedText.Encode("failure_store"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamOptionsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFailureStore = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFailureStore.TryReadProperty(ref reader, options, PropFailureStore, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamOptionsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FailureStore = propFailureStore.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamOptionsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFailureStore, value.FailureStore, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamOptionsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamOptionsRequest.g.cs index 67ce64e848e..5cf573e694d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamOptionsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamOptionsRequest.g.cs @@ -51,52 +51,13 @@ public sealed partial class PutDataStreamOptionsRequestParameters : Elastic.Tran public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutDataStreamOptionsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFailureStore = System.Text.Json.JsonEncodedText.Encode("failure_store"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamOptionsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFailureStore = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFailureStore.TryReadProperty(ref reader, options, PropFailureStore, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamOptionsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FailureStore = propFailureStore.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamOptionsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFailureStore, value.FailureStore, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Update data stream options. /// Update the data stream options of the specified data streams. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamOptionsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.PutDataStreamOptionsRequestConverter))] public sealed partial class PutDataStreamOptionsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamOptionsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamOptionsResponse.Converters.g.cs new file mode 100644 index 00000000000..75a703795ac --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamOptionsResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class PutDataStreamOptionsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamOptionsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamOptionsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamOptionsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamOptionsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamOptionsResponse.g.cs index 382272a6a3d..fdf9a634a61 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamOptionsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamOptionsResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class PutDataStreamOptionsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamOptionsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamOptionsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamOptionsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamOptionsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.PutDataStreamOptionsResponseConverter))] public sealed partial class PutDataStreamOptionsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamSettingsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamSettingsRequest.Converters.g.cs new file mode 100644 index 00000000000..d7bcb18610d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamSettingsRequest.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class PutDataStreamSettingsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamSettingsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamSettingsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Settings = reader.ReadValue(options, null) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamSettingsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Settings, null); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamSettingsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamSettingsRequest.g.cs index d3ef3ce5d56..7720ea62d34 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamSettingsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamSettingsRequest.g.cs @@ -52,19 +52,6 @@ public sealed partial class PutDataStreamSettingsRequestParameters : Elastic.Tra public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutDataStreamSettingsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamSettingsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamSettingsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Settings = reader.ReadValue(options, null) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamSettingsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Settings, null); - } -} - /// /// /// Update data stream settings. @@ -76,7 +63,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// backing indices. Otherwise, it will be applied when the data stream is next rolled over. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamSettingsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.PutDataStreamSettingsRequestConverter))] public sealed partial class PutDataStreamSettingsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamSettingsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamSettingsResponse.Converters.g.cs new file mode 100644 index 00000000000..2567bee3e99 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamSettingsResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class PutDataStreamSettingsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamSettingsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propDataStreams = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamSettingsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DataStreams = propDataStreams.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamSettingsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamSettingsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamSettingsResponse.g.cs index 33b5de17d58..b6e55179c13 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamSettingsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutDataStreamSettingsResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class PutDataStreamSettingsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamSettingsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propDataStreams = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamSettingsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DataStreams = propDataStreams.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamSettingsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.PutDataStreamSettingsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.PutDataStreamSettingsResponseConverter))] public sealed partial class PutDataStreamSettingsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal PutDataStreamSettingsResponse(Elastic.Clients.Elasticsearch.Serializati public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection DataStreams { get; set; } +System.Collections.Generic.IReadOnlyCollection DataStreams { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateRequest.Converters.g.cs new file mode 100644 index 00000000000..d45ee6430ba --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateRequest.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class PutIndexTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowAutoCreate = System.Text.Json.JsonEncodedText.Encode("allow_auto_create"); + private static readonly System.Text.Json.JsonEncodedText PropComposedOf = System.Text.Json.JsonEncodedText.Encode("composed_of"); + private static readonly System.Text.Json.JsonEncodedText PropDataStream = System.Text.Json.JsonEncodedText.Encode("data_stream"); + private static readonly System.Text.Json.JsonEncodedText PropDeprecated = System.Text.Json.JsonEncodedText.Encode("deprecated"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissingComponentTemplates = System.Text.Json.JsonEncodedText.Encode("ignore_missing_component_templates"); + private static readonly System.Text.Json.JsonEncodedText PropIndexPatterns = System.Text.Json.JsonEncodedText.Encode("index_patterns"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); + private static readonly System.Text.Json.JsonEncodedText PropPriority = System.Text.Json.JsonEncodedText.Encode("priority"); + private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.PutIndexTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowAutoCreate = default; + LocalJsonValue?> propComposedOf = default; + LocalJsonValue propDataStream = default; + LocalJsonValue propDeprecated = default; + LocalJsonValue?> propIgnoreMissingComponentTemplates = default; + LocalJsonValue propIndexPatterns = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propPriority = default; + LocalJsonValue propTemplate = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowAutoCreate.TryReadProperty(ref reader, options, PropAllowAutoCreate, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propComposedOf.TryReadProperty(ref reader, options, PropComposedOf, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propDataStream.TryReadProperty(ref reader, options, PropDataStream, null)) + { + continue; + } + + if (propDeprecated.TryReadProperty(ref reader, options, PropDeprecated, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissingComponentTemplates.TryReadProperty(ref reader, options, PropIgnoreMissingComponentTemplates, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propIndexPatterns.TryReadProperty(ref reader, options, PropIndexPatterns, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propPriority.TryReadProperty(ref reader, options, PropPriority, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.PutIndexTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowAutoCreate = propAllowAutoCreate.Value, + ComposedOf = propComposedOf.Value, + DataStream = propDataStream.Value, + Deprecated = propDeprecated.Value, + IgnoreMissingComponentTemplates = propIgnoreMissingComponentTemplates.Value, + IndexPatterns = propIndexPatterns.Value, + Meta = propMeta.Value, + Priority = propPriority.Value, + Template = propTemplate.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutIndexTemplateRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowAutoCreate, value.AllowAutoCreate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropComposedOf, value.ComposedOf, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDataStream, value.DataStream, null, null); + writer.WriteProperty(options, PropDeprecated, value.Deprecated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissingComponentTemplates, value.IgnoreMissingComponentTemplates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIndexPatterns, value.IndexPatterns, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropPriority, value.Priority, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTemplate, value.Template, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateRequest.g.cs index f306eb09807..43366d6bd30 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateRequest.g.cs @@ -48,126 +48,6 @@ public sealed partial class PutIndexTemplateRequestParameters : Elastic.Transpor public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class PutIndexTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowAutoCreate = System.Text.Json.JsonEncodedText.Encode("allow_auto_create"); - private static readonly System.Text.Json.JsonEncodedText PropComposedOf = System.Text.Json.JsonEncodedText.Encode("composed_of"); - private static readonly System.Text.Json.JsonEncodedText PropDataStream = System.Text.Json.JsonEncodedText.Encode("data_stream"); - private static readonly System.Text.Json.JsonEncodedText PropDeprecated = System.Text.Json.JsonEncodedText.Encode("deprecated"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissingComponentTemplates = System.Text.Json.JsonEncodedText.Encode("ignore_missing_component_templates"); - private static readonly System.Text.Json.JsonEncodedText PropIndexPatterns = System.Text.Json.JsonEncodedText.Encode("index_patterns"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); - private static readonly System.Text.Json.JsonEncodedText PropPriority = System.Text.Json.JsonEncodedText.Encode("priority"); - private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.PutIndexTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowAutoCreate = default; - LocalJsonValue?> propComposedOf = default; - LocalJsonValue propDataStream = default; - LocalJsonValue propDeprecated = default; - LocalJsonValue?> propIgnoreMissingComponentTemplates = default; - LocalJsonValue propIndexPatterns = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propPriority = default; - LocalJsonValue propTemplate = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowAutoCreate.TryReadProperty(ref reader, options, PropAllowAutoCreate, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propComposedOf.TryReadProperty(ref reader, options, PropComposedOf, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propDataStream.TryReadProperty(ref reader, options, PropDataStream, null)) - { - continue; - } - - if (propDeprecated.TryReadProperty(ref reader, options, PropDeprecated, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissingComponentTemplates.TryReadProperty(ref reader, options, PropIgnoreMissingComponentTemplates, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propIndexPatterns.TryReadProperty(ref reader, options, PropIndexPatterns, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propPriority.TryReadProperty(ref reader, options, PropPriority, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.PutIndexTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowAutoCreate = propAllowAutoCreate.Value, - ComposedOf = propComposedOf.Value, - DataStream = propDataStream.Value, - Deprecated = propDeprecated.Value, - IgnoreMissingComponentTemplates = propIgnoreMissingComponentTemplates.Value, - IndexPatterns = propIndexPatterns.Value, - Meta = propMeta.Value, - Priority = propPriority.Value, - Template = propTemplate.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutIndexTemplateRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowAutoCreate, value.AllowAutoCreate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropComposedOf, value.ComposedOf, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDataStream, value.DataStream, null, null); - writer.WriteProperty(options, PropDeprecated, value.Deprecated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissingComponentTemplates, value.IgnoreMissingComponentTemplates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIndexPatterns, value.IndexPatterns, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropPriority, value.Priority, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTemplate, value.Template, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Create or update an index template. @@ -207,7 +87,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If an entry already exists with the same key, then it is overwritten by the new definition. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.PutIndexTemplateRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.PutIndexTemplateRequestConverter))] public sealed partial class PutIndexTemplateRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateResponse.Converters.g.cs new file mode 100644 index 00000000000..4c8502084c4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class PutIndexTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.PutIndexTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.PutIndexTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutIndexTemplateResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateResponse.g.cs index 569bd4b954b..625dcaaaeb7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndexTemplateResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class PutIndexTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.PutIndexTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.PutIndexTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutIndexTemplateResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.PutIndexTemplateResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.PutIndexTemplateResponseConverter))] public sealed partial class PutIndexTemplateResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndicesSettingsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndicesSettingsRequest.Converters.g.cs new file mode 100644 index 00000000000..c6410a25b55 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndicesSettingsRequest.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class PutIndicesSettingsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.PutIndicesSettingsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.IndexManagement.PutIndicesSettingsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Settings = reader.ReadValue(options, null) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutIndicesSettingsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Settings, null); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndicesSettingsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndicesSettingsRequest.g.cs index b4633761195..c71dc48b3c5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndicesSettingsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndicesSettingsRequest.g.cs @@ -94,19 +94,6 @@ public sealed partial class PutIndicesSettingsRequestParameters : Elastic.Transp public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutIndicesSettingsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.PutIndicesSettingsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.IndexManagement.PutIndicesSettingsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Settings = reader.ReadValue(options, null) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutIndicesSettingsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Settings, null); - } -} - /// /// /// Update index settings. @@ -170,7 +157,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Refer to updating analyzers on existing indices for step-by-step examples. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.PutIndicesSettingsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.PutIndicesSettingsRequestConverter))] public sealed partial class PutIndicesSettingsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndicesSettingsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndicesSettingsResponse.Converters.g.cs new file mode 100644 index 00000000000..35aaf27a096 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndicesSettingsResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class PutIndicesSettingsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.PutIndicesSettingsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.PutIndicesSettingsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutIndicesSettingsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndicesSettingsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndicesSettingsResponse.g.cs index 6f03c73ac83..75226bc5c63 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndicesSettingsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutIndicesSettingsResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class PutIndicesSettingsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.PutIndicesSettingsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.PutIndicesSettingsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutIndicesSettingsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.PutIndicesSettingsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.PutIndicesSettingsResponseConverter))] public sealed partial class PutIndicesSettingsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutMappingRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutMappingRequest.Converters.g.cs new file mode 100644 index 00000000000..663baef3c82 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutMappingRequest.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class PutMappingRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDateDetection = System.Text.Json.JsonEncodedText.Encode("date_detection"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropDynamicDateFormats = System.Text.Json.JsonEncodedText.Encode("dynamic_date_formats"); + private static readonly System.Text.Json.JsonEncodedText PropDynamicTemplates = System.Text.Json.JsonEncodedText.Encode("dynamic_templates"); + private static readonly System.Text.Json.JsonEncodedText PropFieldNames = System.Text.Json.JsonEncodedText.Encode("_field_names"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); + private static readonly System.Text.Json.JsonEncodedText PropNumericDetection = System.Text.Json.JsonEncodedText.Encode("numeric_detection"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("_routing"); + private static readonly System.Text.Json.JsonEncodedText PropRuntime = System.Text.Json.JsonEncodedText.Encode("runtime"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.PutMappingRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDateDetection = default; + LocalJsonValue propDynamic = default; + LocalJsonValue?> propDynamicDateFormats = default; + LocalJsonValue>?> propDynamicTemplates = default; + LocalJsonValue propFieldNames = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propNumericDetection = default; + LocalJsonValue propProperties = default; + LocalJsonValue propRouting = default; + LocalJsonValue?> propRuntime = default; + LocalJsonValue propSource = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDateDetection.TryReadProperty(ref reader, options, PropDateDetection, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamicDateFormats.TryReadProperty(ref reader, options, PropDynamicDateFormats, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propDynamicTemplates.TryReadProperty(ref reader, options, PropDynamicTemplates, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null)))) + { + continue; + } + + if (propFieldNames.TryReadProperty(ref reader, options, PropFieldNames, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propNumericDetection.TryReadProperty(ref reader, options, PropNumericDetection, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (propRuntime.TryReadProperty(ref reader, options, PropRuntime, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.PutMappingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DateDetection = propDateDetection.Value, + Dynamic = propDynamic.Value, + DynamicDateFormats = propDynamicDateFormats.Value, + DynamicTemplates = propDynamicTemplates.Value, + FieldNames = propFieldNames.Value, + Meta = propMeta.Value, + NumericDetection = propNumericDetection.Value, + Properties = propProperties.Value, + Routing = propRouting.Value, + Runtime = propRuntime.Value, + Source = propSource.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutMappingRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDateDetection, value.DateDetection, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamicDateFormats, value.DynamicDateFormats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDynamicTemplates, value.DynamicTemplates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null))); + writer.WriteProperty(options, PropFieldNames, value.FieldNames, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropNumericDetection, value.NumericDetection, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteProperty(options, PropRuntime, value.Runtime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutMappingRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutMappingRequest.g.cs index af0aa76bd0a..eba653fe2cc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutMappingRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutMappingRequest.g.cs @@ -73,135 +73,6 @@ public sealed partial class PutMappingRequestParameters : Elastic.Transport.Requ public bool? WriteIndexOnly { get => Q("write_index_only"); set => Q("write_index_only", value); } } -internal sealed partial class PutMappingRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDateDetection = System.Text.Json.JsonEncodedText.Encode("date_detection"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropDynamicDateFormats = System.Text.Json.JsonEncodedText.Encode("dynamic_date_formats"); - private static readonly System.Text.Json.JsonEncodedText PropDynamicTemplates = System.Text.Json.JsonEncodedText.Encode("dynamic_templates"); - private static readonly System.Text.Json.JsonEncodedText PropFieldNames = System.Text.Json.JsonEncodedText.Encode("_field_names"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); - private static readonly System.Text.Json.JsonEncodedText PropNumericDetection = System.Text.Json.JsonEncodedText.Encode("numeric_detection"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("_routing"); - private static readonly System.Text.Json.JsonEncodedText PropRuntime = System.Text.Json.JsonEncodedText.Encode("runtime"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.PutMappingRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDateDetection = default; - LocalJsonValue propDynamic = default; - LocalJsonValue?> propDynamicDateFormats = default; - LocalJsonValue>?> propDynamicTemplates = default; - LocalJsonValue propFieldNames = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propNumericDetection = default; - LocalJsonValue propProperties = default; - LocalJsonValue propRouting = default; - LocalJsonValue?> propRuntime = default; - LocalJsonValue propSource = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDateDetection.TryReadProperty(ref reader, options, PropDateDetection, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamicDateFormats.TryReadProperty(ref reader, options, PropDynamicDateFormats, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propDynamicTemplates.TryReadProperty(ref reader, options, PropDynamicTemplates, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null)))) - { - continue; - } - - if (propFieldNames.TryReadProperty(ref reader, options, PropFieldNames, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propNumericDetection.TryReadProperty(ref reader, options, PropNumericDetection, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (propRuntime.TryReadProperty(ref reader, options, PropRuntime, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.PutMappingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DateDetection = propDateDetection.Value, - Dynamic = propDynamic.Value, - DynamicDateFormats = propDynamicDateFormats.Value, - DynamicTemplates = propDynamicTemplates.Value, - FieldNames = propFieldNames.Value, - Meta = propMeta.Value, - NumericDetection = propNumericDetection.Value, - Properties = propProperties.Value, - Routing = propRouting.Value, - Runtime = propRuntime.Value, - Source = propSource.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutMappingRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDateDetection, value.DateDetection, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamicDateFormats, value.DynamicDateFormats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDynamicTemplates, value.DynamicTemplates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null))); - writer.WriteProperty(options, PropFieldNames, value.FieldNames, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropNumericDetection, value.NumericDetection, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteProperty(options, PropRuntime, value.Runtime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Update field mappings. @@ -249,7 +120,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Learn how to use the update mapping API with practical examples in the Update mapping API examples guide. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.PutMappingRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.PutMappingRequestConverter))] public sealed partial class PutMappingRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutMappingResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutMappingResponse.Converters.g.cs new file mode 100644 index 00000000000..1c81534e542 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutMappingResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class PutMappingResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.PutMappingResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + LocalJsonValue propShards = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.PutMappingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value, + Shards = propShards.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutMappingResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutMappingResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutMappingResponse.g.cs index 7b0d41d7d7b..b031896fdc4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutMappingResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutMappingResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class PutMappingResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.PutMappingResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - LocalJsonValue propShards = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.PutMappingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value, - Shards = propShards.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutMappingResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.PutMappingResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.PutMappingResponseConverter))] public sealed partial class PutMappingResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutTemplateRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutTemplateRequest.Converters.g.cs new file mode 100644 index 00000000000..89db7e0734c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutTemplateRequest.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class PutTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); + private static readonly System.Text.Json.JsonEncodedText PropIndexPatterns = System.Text.Json.JsonEncodedText.Encode("index_patterns"); + private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); + private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.PutTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAliases = default; + LocalJsonValue?> propIndexPatterns = default; + LocalJsonValue propMappings = default; + LocalJsonValue propOrder = default; + LocalJsonValue propSettings = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propIndexPatterns.TryReadProperty(ref reader, options, PropIndexPatterns, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) + { + continue; + } + + if (propOrder.TryReadProperty(ref reader, options, PropOrder, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.PutTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aliases = propAliases.Value, + IndexPatterns = propIndexPatterns.Value, + Mappings = propMappings.Value, + Order = propOrder.Value, + Settings = propSettings.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutTemplateRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropIndexPatterns, value.IndexPatterns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMappings, value.Mappings, null, null); + writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSettings, value.Settings, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutTemplateRequest.g.cs index ae4d415aa00..013b8b963fb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutTemplateRequest.g.cs @@ -48,90 +48,6 @@ public sealed partial class PutTemplateRequestParameters : Elastic.Transport.Req public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class PutTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); - private static readonly System.Text.Json.JsonEncodedText PropIndexPatterns = System.Text.Json.JsonEncodedText.Encode("index_patterns"); - private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); - private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.PutTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAliases = default; - LocalJsonValue?> propIndexPatterns = default; - LocalJsonValue propMappings = default; - LocalJsonValue propOrder = default; - LocalJsonValue propSettings = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propIndexPatterns.TryReadProperty(ref reader, options, PropIndexPatterns, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) - { - continue; - } - - if (propOrder.TryReadProperty(ref reader, options, PropOrder, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.PutTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aliases = propAliases.Value, - IndexPatterns = propIndexPatterns.Value, - Mappings = propMappings.Value, - Order = propOrder.Value, - Settings = propSettings.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutTemplateRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropIndexPatterns, value.IndexPatterns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMappings, value.Mappings, null, null); - writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSettings, value.Settings, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Create or update a legacy index template. @@ -163,7 +79,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// NOTE: Multiple matching templates with the same order value will result in a non-deterministic merging order. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.PutTemplateRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.PutTemplateRequestConverter))] public sealed partial class PutTemplateRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutTemplateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutTemplateResponse.Converters.g.cs new file mode 100644 index 00000000000..71639370d8f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutTemplateResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class PutTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.PutTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.PutTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutTemplateResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutTemplateResponse.g.cs index bf1b51b6783..0a8e402c525 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/PutTemplateResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class PutTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.PutTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.PutTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.PutTemplateResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.PutTemplateResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.PutTemplateResponseConverter))] public sealed partial class PutTemplateResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RecoveryRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RecoveryRequest.Converters.g.cs new file mode 100644 index 00000000000..0661c5b7443 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RecoveryRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class RecoveryRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.RecoveryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.RecoveryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RecoveryRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RecoveryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RecoveryRequest.g.cs index 54ce1c42253..d5503790c94 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RecoveryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RecoveryRequest.g.cs @@ -64,35 +64,6 @@ public sealed partial class RecoveryRequestParameters : Elastic.Transport.Reques public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } } -internal sealed partial class RecoveryRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.RecoveryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.RecoveryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RecoveryRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get index recovery information. @@ -150,7 +121,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// This means that if a shard copy completes a recovery and then Elasticsearch relocates it onto a different node then the information about the original recovery will not be shown in the recovery API. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.RecoveryRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.RecoveryRequestConverter))] public sealed partial class RecoveryRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public RecoveryRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RecoveryResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RecoveryResponse.Converters.g.cs new file mode 100644 index 00000000000..0d7cd2f382b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RecoveryResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class RecoveryResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.RecoveryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.IndexManagement.RecoveryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Statuses = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RecoveryResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Statuses, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RecoveryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RecoveryResponse.g.cs index 04306e39437..9c5006624a5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RecoveryResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RecoveryResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class RecoveryResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.RecoveryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.IndexManagement.RecoveryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Statuses = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RecoveryResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Statuses, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.RecoveryResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.RecoveryResponseConverter))] public sealed partial class RecoveryResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RefreshRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RefreshRequest.Converters.g.cs new file mode 100644 index 00000000000..b5e0963d159 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RefreshRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class RefreshRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.RefreshRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.RefreshRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RefreshRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RefreshRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RefreshRequest.g.cs index 2f44dc3d0f7..e049f041ee5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RefreshRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RefreshRequest.g.cs @@ -50,35 +50,6 @@ public sealed partial class RefreshRequestParameters : Elastic.Transport.Request public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } } -internal sealed partial class RefreshRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.RefreshRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.RefreshRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RefreshRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Refresh an index. @@ -101,7 +72,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// This option ensures the indexing operation waits for a periodic refresh before running the search. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.RefreshRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.RefreshRequestConverter))] public sealed partial class RefreshRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public RefreshRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RefreshResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RefreshResponse.Converters.g.cs new file mode 100644 index 00000000000..f54e28b7397 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RefreshResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class RefreshResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.RefreshResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propShards = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.RefreshResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Shards = propShards.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RefreshResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RefreshResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RefreshResponse.g.cs index e8448020648..48030183fea 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RefreshResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RefreshResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class RefreshResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.RefreshResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propShards = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.RefreshResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Shards = propShards.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RefreshResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.RefreshResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.RefreshResponseConverter))] public sealed partial class RefreshResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ReloadSearchAnalyzersRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ReloadSearchAnalyzersRequest.Converters.g.cs new file mode 100644 index 00000000000..3e9b6a9fe4d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ReloadSearchAnalyzersRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ReloadSearchAnalyzersRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.ReloadSearchAnalyzersRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ReloadSearchAnalyzersRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ReloadSearchAnalyzersRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ReloadSearchAnalyzersRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ReloadSearchAnalyzersRequest.g.cs index ea63689b475..449d6a4c358 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ReloadSearchAnalyzersRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ReloadSearchAnalyzersRequest.g.cs @@ -54,35 +54,6 @@ public sealed partial class ReloadSearchAnalyzersRequestParameters : Elastic.Tra public string? Resource { get => Q("resource"); set => Q("resource", value); } } -internal sealed partial class ReloadSearchAnalyzersRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.ReloadSearchAnalyzersRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ReloadSearchAnalyzersRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ReloadSearchAnalyzersRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Reload search analyzers. @@ -104,7 +75,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// This ensures the synonym file is updated everywhere in the cluster in case shards are relocated in the future. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ReloadSearchAnalyzersRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ReloadSearchAnalyzersRequestConverter))] public sealed partial class ReloadSearchAnalyzersRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ReloadSearchAnalyzersResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ReloadSearchAnalyzersResponse.Converters.g.cs new file mode 100644 index 00000000000..8852c1abd1b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ReloadSearchAnalyzersResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ReloadSearchAnalyzersResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropReloadDetails = System.Text.Json.JsonEncodedText.Encode("reload_details"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ReloadSearchAnalyzersResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propReloadDetails = default; + LocalJsonValue propShards = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propReloadDetails.TryReadProperty(ref reader, options, PropReloadDetails, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ReloadSearchAnalyzersResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ReloadDetails = propReloadDetails.Value, + Shards = propShards.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ReloadSearchAnalyzersResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropReloadDetails, value.ReloadDetails, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ReloadSearchAnalyzersResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ReloadSearchAnalyzersResponse.g.cs index 7bf33f146d8..482cbe7faec 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ReloadSearchAnalyzersResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ReloadSearchAnalyzersResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ReloadSearchAnalyzersResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropReloadDetails = System.Text.Json.JsonEncodedText.Encode("reload_details"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ReloadSearchAnalyzersResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propReloadDetails = default; - LocalJsonValue propShards = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propReloadDetails.TryReadProperty(ref reader, options, PropReloadDetails, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ReloadSearchAnalyzersResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ReloadDetails = propReloadDetails.Value, - Shards = propShards.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ReloadSearchAnalyzersResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropReloadDetails, value.ReloadDetails, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ReloadSearchAnalyzersResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ReloadSearchAnalyzersResponseConverter))] public sealed partial class ReloadSearchAnalyzersResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal ReloadSearchAnalyzersResponse(Elastic.Clients.Elasticsearch.Serializati public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection ReloadDetails { get; set; } +System.Collections.Generic.IReadOnlyCollection ReloadDetails { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; set; } +Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RemoveBlockRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RemoveBlockRequest.Converters.g.cs new file mode 100644 index 00000000000..b3ae709ad2d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RemoveBlockRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class RemoveBlockRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.RemoveBlockRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.RemoveBlockRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RemoveBlockRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RemoveBlockRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RemoveBlockRequest.g.cs index c7866e9c574..0e004111f23 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RemoveBlockRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RemoveBlockRequest.g.cs @@ -69,35 +69,6 @@ public sealed partial class RemoveBlockRequestParameters : Elastic.Transport.Req public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class RemoveBlockRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.RemoveBlockRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.RemoveBlockRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RemoveBlockRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Remove an index block. @@ -107,7 +78,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Index blocks limit the operations allowed on an index by blocking specific operation types. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.RemoveBlockRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.RemoveBlockRequestConverter))] public sealed partial class RemoveBlockRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RemoveBlockResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RemoveBlockResponse.Converters.g.cs new file mode 100644 index 00000000000..01f227df1ea --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RemoveBlockResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class RemoveBlockResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.RemoveBlockResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + LocalJsonValue> propIndices = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.RemoveBlockResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value, + Indices = propIndices.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RemoveBlockResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RemoveBlockResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RemoveBlockResponse.g.cs index 0f163771264..03d4b2de7c7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RemoveBlockResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RemoveBlockResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class RemoveBlockResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.RemoveBlockResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - LocalJsonValue> propIndices = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.RemoveBlockResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value, - Indices = propIndices.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RemoveBlockResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.RemoveBlockResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.RemoveBlockResponseConverter))] public sealed partial class RemoveBlockResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal RemoveBlockResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCon public #if NET7_0_OR_GREATER - required +required #endif - bool Acknowledged { get; set; } +bool Acknowledged { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Indices { get; set; } +System.Collections.Generic.IReadOnlyCollection Indices { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveClusterRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveClusterRequest.Converters.g.cs new file mode 100644 index 00000000000..2adec9ac891 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveClusterRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ResolveClusterRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.ResolveClusterRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ResolveClusterRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ResolveClusterRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveClusterRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveClusterRequest.g.cs index d86c0fb20c7..584f2986d31 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveClusterRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveClusterRequest.g.cs @@ -82,35 +82,6 @@ public sealed partial class ResolveClusterRequestParameters : Elastic.Transport. public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class ResolveClusterRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.ResolveClusterRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ResolveClusterRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ResolveClusterRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Resolve the cluster. @@ -206,7 +177,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If a connection was (re-)established, this will also cause the remote/info endpoint to now indicate a connected status. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ResolveClusterRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ResolveClusterRequestConverter))] public sealed partial class ResolveClusterRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public ResolveClusterRequest(Elastic.Clients.Elasticsearch.Names? name) : base(r => r.Optional("name", name)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveClusterResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveClusterResponse.Converters.g.cs new file mode 100644 index 00000000000..8499f356573 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveClusterResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ResolveClusterResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.ResolveClusterResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.IndexManagement.ResolveClusterResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Infos = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ResolveClusterResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Infos, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveClusterResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveClusterResponse.g.cs index 099c67650f9..2552cc133c0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveClusterResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveClusterResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ResolveClusterResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.ResolveClusterResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.IndexManagement.ResolveClusterResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Infos = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ResolveClusterResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Infos, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ResolveClusterResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ResolveClusterResponseConverter))] public sealed partial class ResolveClusterResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveIndexRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveIndexRequest.Converters.g.cs new file mode 100644 index 00000000000..225eab729e7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveIndexRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ResolveIndexRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveIndexRequest.g.cs index 99aaa95d347..a23ecbff064 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveIndexRequest.g.cs @@ -51,35 +51,6 @@ public sealed partial class ResolveIndexRequestParameters : Elastic.Transport.Re public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } } -internal sealed partial class ResolveIndexRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Resolve indices. @@ -87,7 +58,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Multiple patterns and remote clusters are supported. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ResolveIndexRequestConverter))] public sealed partial class ResolveIndexRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveIndexResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveIndexResponse.Converters.g.cs new file mode 100644 index 00000000000..457e04b82ae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveIndexResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ResolveIndexResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); + private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propAliases = default; + LocalJsonValue> propDataStreams = default; + LocalJsonValue> propIndices = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aliases = propAliases.Value, + DataStreams = propDataStreams.Value, + Indices = propIndices.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveIndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveIndexResponse.g.cs index 5e08cfcd78d..d4a30c7c567 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveIndexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ResolveIndexResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ResolveIndexResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); - private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propAliases = default; - LocalJsonValue> propDataStreams = default; - LocalJsonValue> propIndices = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aliases = propAliases.Value, - DataStreams = propDataStreams.Value, - Indices = propIndices.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ResolveIndexResponseConverter))] public sealed partial class ResolveIndexResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -96,17 +39,17 @@ internal ResolveIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCo public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Aliases { get; set; } +System.Collections.Generic.IReadOnlyCollection Aliases { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection DataStreams { get; set; } +System.Collections.Generic.IReadOnlyCollection DataStreams { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Indices { get; set; } +System.Collections.Generic.IReadOnlyCollection Indices { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RolloverRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RolloverRequest.Converters.g.cs new file mode 100644 index 00000000000..276aa87c7ab --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RolloverRequest.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class RolloverRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); + private static readonly System.Text.Json.JsonEncodedText PropConditions = System.Text.Json.JsonEncodedText.Encode("conditions"); + private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.RolloverRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAliases = default; + LocalJsonValue propConditions = default; + LocalJsonValue propMappings = default; + LocalJsonValue?> propSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propConditions.TryReadProperty(ref reader, options, PropConditions, null)) + { + continue; + } + + if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) + { + continue; + } + + if (propSettings.TryReadProperty(ref reader, options, PropSettings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.RolloverRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aliases = propAliases.Value, + Conditions = propConditions.Value, + Mappings = propMappings.Value, + Settings = propSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RolloverRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropConditions, value.Conditions, null, null); + writer.WriteProperty(options, PropMappings, value.Mappings, null, null); + writer.WriteProperty(options, PropSettings, value.Settings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RolloverRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RolloverRequest.g.cs index 629ca34f316..4b6aaf619bc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RolloverRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RolloverRequest.g.cs @@ -65,72 +65,6 @@ public sealed partial class RolloverRequestParameters : Elastic.Transport.Reques public Elastic.Clients.Elasticsearch.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } } -internal sealed partial class RolloverRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); - private static readonly System.Text.Json.JsonEncodedText PropConditions = System.Text.Json.JsonEncodedText.Encode("conditions"); - private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.RolloverRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAliases = default; - LocalJsonValue propConditions = default; - LocalJsonValue propMappings = default; - LocalJsonValue?> propSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propConditions.TryReadProperty(ref reader, options, PropConditions, null)) - { - continue; - } - - if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) - { - continue; - } - - if (propSettings.TryReadProperty(ref reader, options, PropSettings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.RolloverRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aliases = propAliases.Value, - Conditions = propConditions.Value, - Mappings = propMappings.Value, - Settings = propSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RolloverRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropConditions, value.Conditions, null, null); - writer.WriteProperty(options, PropMappings, value.Mappings, null, null); - writer.WriteProperty(options, PropSettings, value.Settings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - /// /// /// Roll over to a new index. @@ -185,7 +119,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If you roll over the alias on May 7, 2099, the new index's name is my-index-2099.05.07-000002. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.RolloverRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.RolloverRequestConverter))] public sealed partial class RolloverRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RolloverResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RolloverResponse.Converters.g.cs new file mode 100644 index 00000000000..f27ab94a694 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RolloverResponse.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class RolloverResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + private static readonly System.Text.Json.JsonEncodedText PropConditions = System.Text.Json.JsonEncodedText.Encode("conditions"); + private static readonly System.Text.Json.JsonEncodedText PropDryRun = System.Text.Json.JsonEncodedText.Encode("dry_run"); + private static readonly System.Text.Json.JsonEncodedText PropNewIndex = System.Text.Json.JsonEncodedText.Encode("new_index"); + private static readonly System.Text.Json.JsonEncodedText PropOldIndex = System.Text.Json.JsonEncodedText.Encode("old_index"); + private static readonly System.Text.Json.JsonEncodedText PropRolledOver = System.Text.Json.JsonEncodedText.Encode("rolled_over"); + private static readonly System.Text.Json.JsonEncodedText PropShardsAcknowledged = System.Text.Json.JsonEncodedText.Encode("shards_acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.RolloverResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + LocalJsonValue> propConditions = default; + LocalJsonValue propDryRun = default; + LocalJsonValue propNewIndex = default; + LocalJsonValue propOldIndex = default; + LocalJsonValue propRolledOver = default; + LocalJsonValue propShardsAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (propConditions.TryReadProperty(ref reader, options, PropConditions, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propDryRun.TryReadProperty(ref reader, options, PropDryRun, null)) + { + continue; + } + + if (propNewIndex.TryReadProperty(ref reader, options, PropNewIndex, null)) + { + continue; + } + + if (propOldIndex.TryReadProperty(ref reader, options, PropOldIndex, null)) + { + continue; + } + + if (propRolledOver.TryReadProperty(ref reader, options, PropRolledOver, null)) + { + continue; + } + + if (propShardsAcknowledged.TryReadProperty(ref reader, options, PropShardsAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.RolloverResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value, + Conditions = propConditions.Value, + DryRun = propDryRun.Value, + NewIndex = propNewIndex.Value, + OldIndex = propOldIndex.Value, + RolledOver = propRolledOver.Value, + ShardsAcknowledged = propShardsAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RolloverResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteProperty(options, PropConditions, value.Conditions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropDryRun, value.DryRun, null, null); + writer.WriteProperty(options, PropNewIndex, value.NewIndex, null, null); + writer.WriteProperty(options, PropOldIndex, value.OldIndex, null, null); + writer.WriteProperty(options, PropRolledOver, value.RolledOver, null, null); + writer.WriteProperty(options, PropShardsAcknowledged, value.ShardsAcknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RolloverResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RolloverResponse.g.cs index ba6b9e7f112..58567790206 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RolloverResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/RolloverResponse.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class RolloverResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - private static readonly System.Text.Json.JsonEncodedText PropConditions = System.Text.Json.JsonEncodedText.Encode("conditions"); - private static readonly System.Text.Json.JsonEncodedText PropDryRun = System.Text.Json.JsonEncodedText.Encode("dry_run"); - private static readonly System.Text.Json.JsonEncodedText PropNewIndex = System.Text.Json.JsonEncodedText.Encode("new_index"); - private static readonly System.Text.Json.JsonEncodedText PropOldIndex = System.Text.Json.JsonEncodedText.Encode("old_index"); - private static readonly System.Text.Json.JsonEncodedText PropRolledOver = System.Text.Json.JsonEncodedText.Encode("rolled_over"); - private static readonly System.Text.Json.JsonEncodedText PropShardsAcknowledged = System.Text.Json.JsonEncodedText.Encode("shards_acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.RolloverResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - LocalJsonValue> propConditions = default; - LocalJsonValue propDryRun = default; - LocalJsonValue propNewIndex = default; - LocalJsonValue propOldIndex = default; - LocalJsonValue propRolledOver = default; - LocalJsonValue propShardsAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (propConditions.TryReadProperty(ref reader, options, PropConditions, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propDryRun.TryReadProperty(ref reader, options, PropDryRun, null)) - { - continue; - } - - if (propNewIndex.TryReadProperty(ref reader, options, PropNewIndex, null)) - { - continue; - } - - if (propOldIndex.TryReadProperty(ref reader, options, PropOldIndex, null)) - { - continue; - } - - if (propRolledOver.TryReadProperty(ref reader, options, PropRolledOver, null)) - { - continue; - } - - if (propShardsAcknowledged.TryReadProperty(ref reader, options, PropShardsAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.RolloverResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value, - Conditions = propConditions.Value, - DryRun = propDryRun.Value, - NewIndex = propNewIndex.Value, - OldIndex = propOldIndex.Value, - RolledOver = propRolledOver.Value, - ShardsAcknowledged = propShardsAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RolloverResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteProperty(options, PropConditions, value.Conditions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropDryRun, value.DryRun, null, null); - writer.WriteProperty(options, PropNewIndex, value.NewIndex, null, null); - writer.WriteProperty(options, PropOldIndex, value.OldIndex, null, null); - writer.WriteProperty(options, PropRolledOver, value.RolledOver, null, null); - writer.WriteProperty(options, PropShardsAcknowledged, value.ShardsAcknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.RolloverResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.RolloverResponseConverter))] public sealed partial class RolloverResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -132,37 +39,37 @@ internal RolloverResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstr public #if NET7_0_OR_GREATER - required +required #endif - bool Acknowledged { get; set; } +bool Acknowledged { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary Conditions { get; set; } +System.Collections.Generic.IReadOnlyDictionary Conditions { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool DryRun { get; set; } +bool DryRun { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string NewIndex { get; set; } +string NewIndex { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string OldIndex { get; set; } +string OldIndex { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool RolledOver { get; set; } +bool RolledOver { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool ShardsAcknowledged { get; set; } +bool ShardsAcknowledged { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SegmentsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SegmentsRequest.Converters.g.cs new file mode 100644 index 00000000000..fede2d5a865 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SegmentsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SegmentsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.SegmentsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.SegmentsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SegmentsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SegmentsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SegmentsRequest.g.cs index 91c89de8a88..b4ea95db96c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SegmentsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SegmentsRequest.g.cs @@ -50,35 +50,6 @@ public sealed partial class SegmentsRequestParameters : Elastic.Transport.Reques public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } } -internal sealed partial class SegmentsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.SegmentsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SegmentsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SegmentsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get index segments. @@ -86,7 +57,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// For data streams, the API returns information about the stream's backing indices. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SegmentsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SegmentsRequestConverter))] public sealed partial class SegmentsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public SegmentsRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SegmentsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SegmentsResponse.Converters.g.cs new file mode 100644 index 00000000000..e5e85d17c52 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SegmentsResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SegmentsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SegmentsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propIndices = default; + LocalJsonValue propShards = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.SegmentsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Indices = propIndices.Value, + Shards = propShards.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SegmentsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SegmentsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SegmentsResponse.g.cs index 209dcd0b00b..6397cec9b12 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SegmentsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SegmentsResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class SegmentsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SegmentsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propIndices = default; - LocalJsonValue propShards = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SegmentsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Indices = propIndices.Value, - Shards = propShards.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SegmentsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SegmentsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SegmentsResponseConverter))] public sealed partial class SegmentsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal SegmentsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstr public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary Indices { get; set; } +System.Collections.Generic.IReadOnlyDictionary Indices { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; set; } +Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShardStoresRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShardStoresRequest.Converters.g.cs new file mode 100644 index 00000000000..4c7e2b7f53a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShardStoresRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ShardStoresRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.ShardStoresRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ShardStoresRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardStoresRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShardStoresRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShardStoresRequest.g.cs index e14d3830eee..1ac5615e8d0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShardStoresRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShardStoresRequest.g.cs @@ -57,35 +57,6 @@ public sealed partial class ShardStoresRequestParameters : Elastic.Transport.Req public System.Collections.Generic.ICollection? Status { get => Q?>("status"); set => Q("status", value); } } -internal sealed partial class ShardStoresRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.ShardStoresRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ShardStoresRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardStoresRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get index shard stores. @@ -121,7 +92,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// By default, the API returns store information only for primary shards that are unassigned or have one or more unassigned replica shards. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ShardStoresRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ShardStoresRequestConverter))] public sealed partial class ShardStoresRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public ShardStoresRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShardStoresResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShardStoresResponse.Converters.g.cs new file mode 100644 index 00000000000..ebca04c9e7d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShardStoresResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ShardStoresResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShardStoresResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propIndices = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ShardStoresResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Indices = propIndices.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardStoresResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShardStoresResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShardStoresResponse.g.cs index caa8257e86c..e88e77e5fbe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShardStoresResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShardStoresResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ShardStoresResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShardStoresResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propIndices = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ShardStoresResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Indices = propIndices.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardStoresResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ShardStoresResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ShardStoresResponseConverter))] public sealed partial class ShardStoresResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal ShardStoresResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCon public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary Indices { get; set; } +System.Collections.Generic.IReadOnlyDictionary Indices { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShrinkIndexRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShrinkIndexRequest.Converters.g.cs new file mode 100644 index 00000000000..f60524f11a7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShrinkIndexRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ShrinkIndexRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShrinkIndexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAliases = default; + LocalJsonValue?> propSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propSettings.TryReadProperty(ref reader, options, PropSettings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ShrinkIndexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aliases = propAliases.Value, + Settings = propSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShrinkIndexRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropSettings, value.Settings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShrinkIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShrinkIndexRequest.g.cs index 76acffc9fab..b959b20aad8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShrinkIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShrinkIndexRequest.g.cs @@ -50,54 +50,6 @@ public sealed partial class ShrinkIndexRequestParameters : Elastic.Transport.Req public Elastic.Clients.Elasticsearch.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } } -internal sealed partial class ShrinkIndexRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShrinkIndexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAliases = default; - LocalJsonValue?> propSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propSettings.TryReadProperty(ref reader, options, PropSettings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ShrinkIndexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aliases = propAliases.Value, - Settings = propSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShrinkIndexRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropSettings, value.Settings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - /// /// /// Shrink an index. @@ -187,7 +139,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ShrinkIndexRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ShrinkIndexRequestConverter))] public sealed partial class ShrinkIndexRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShrinkIndexResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShrinkIndexResponse.Converters.g.cs new file mode 100644 index 00000000000..b2e9be2e9fc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShrinkIndexResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ShrinkIndexResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropShardsAcknowledged = System.Text.Json.JsonEncodedText.Encode("shards_acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShrinkIndexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + LocalJsonValue propIndex = default; + LocalJsonValue propShardsAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propShardsAcknowledged.TryReadProperty(ref reader, options, PropShardsAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ShrinkIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value, + Index = propIndex.Value, + ShardsAcknowledged = propShardsAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShrinkIndexResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropShardsAcknowledged, value.ShardsAcknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShrinkIndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShrinkIndexResponse.g.cs index d033a6bbccc..639acb595db 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShrinkIndexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ShrinkIndexResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ShrinkIndexResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropShardsAcknowledged = System.Text.Json.JsonEncodedText.Encode("shards_acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShrinkIndexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - LocalJsonValue propIndex = default; - LocalJsonValue propShardsAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propShardsAcknowledged.TryReadProperty(ref reader, options, PropShardsAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ShrinkIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value, - Index = propIndex.Value, - ShardsAcknowledged = propShardsAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShrinkIndexResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropShardsAcknowledged, value.ShardsAcknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ShrinkIndexResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ShrinkIndexResponseConverter))] public sealed partial class ShrinkIndexResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -96,17 +39,17 @@ internal ShrinkIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCon public #if NET7_0_OR_GREATER - required +required #endif - bool Acknowledged { get; set; } +bool Acknowledged { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Index { get; set; } +string Index { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool ShardsAcknowledged { get; set; } +bool ShardsAcknowledged { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateIndexTemplateRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateIndexTemplateRequest.Converters.g.cs new file mode 100644 index 00000000000..8849c06e93a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateIndexTemplateRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SimulateIndexTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.SimulateIndexTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.SimulateIndexTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SimulateIndexTemplateRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateIndexTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateIndexTemplateRequest.g.cs index 0ca6b50a804..b3429fa9f70 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateIndexTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateIndexTemplateRequest.g.cs @@ -54,42 +54,13 @@ public sealed partial class SimulateIndexTemplateRequestParameters : Elastic.Tra public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class SimulateIndexTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.SimulateIndexTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SimulateIndexTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SimulateIndexTemplateRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Simulate an index. /// Get the index configuration that would be applied to the specified index from an existing index template. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SimulateIndexTemplateRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SimulateIndexTemplateRequestConverter))] public sealed partial class SimulateIndexTemplateRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateIndexTemplateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateIndexTemplateResponse.Converters.g.cs new file mode 100644 index 00000000000..e4d3a403c7c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateIndexTemplateResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SimulateIndexTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropOverlapping = System.Text.Json.JsonEncodedText.Encode("overlapping"); + private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SimulateIndexTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propOverlapping = default; + LocalJsonValue propTemplate = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propOverlapping.TryReadProperty(ref reader, options, PropOverlapping, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.SimulateIndexTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Overlapping = propOverlapping.Value, + Template = propTemplate.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SimulateIndexTemplateResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropOverlapping, value.Overlapping, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTemplate, value.Template, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateIndexTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateIndexTemplateResponse.g.cs index c899c11609c..0521c6e306a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateIndexTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateIndexTemplateResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class SimulateIndexTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropOverlapping = System.Text.Json.JsonEncodedText.Encode("overlapping"); - private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SimulateIndexTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propOverlapping = default; - LocalJsonValue propTemplate = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propOverlapping.TryReadProperty(ref reader, options, PropOverlapping, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SimulateIndexTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Overlapping = propOverlapping.Value, - Template = propTemplate.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SimulateIndexTemplateResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropOverlapping, value.Overlapping, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTemplate, value.Template, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SimulateIndexTemplateResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SimulateIndexTemplateResponseConverter))] public sealed partial class SimulateIndexTemplateResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -88,7 +40,7 @@ internal SimulateIndexTemplateResponse(Elastic.Clients.Elasticsearch.Serializati public System.Collections.Generic.IReadOnlyCollection? Overlapping { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.IndexManagement.Template Template { get; set; } +Elastic.Clients.Elasticsearch.IndexManagement.Template Template { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateTemplateRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateTemplateRequest.Converters.g.cs new file mode 100644 index 00000000000..6cd3ef0bac0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateTemplateRequest.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SimulateTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowAutoCreate = System.Text.Json.JsonEncodedText.Encode("allow_auto_create"); + private static readonly System.Text.Json.JsonEncodedText PropComposedOf = System.Text.Json.JsonEncodedText.Encode("composed_of"); + private static readonly System.Text.Json.JsonEncodedText PropDataStream = System.Text.Json.JsonEncodedText.Encode("data_stream"); + private static readonly System.Text.Json.JsonEncodedText PropDeprecated = System.Text.Json.JsonEncodedText.Encode("deprecated"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissingComponentTemplates = System.Text.Json.JsonEncodedText.Encode("ignore_missing_component_templates"); + private static readonly System.Text.Json.JsonEncodedText PropIndexPatterns = System.Text.Json.JsonEncodedText.Encode("index_patterns"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); + private static readonly System.Text.Json.JsonEncodedText PropPriority = System.Text.Json.JsonEncodedText.Encode("priority"); + private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SimulateTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowAutoCreate = default; + LocalJsonValue?> propComposedOf = default; + LocalJsonValue propDataStream = default; + LocalJsonValue propDeprecated = default; + LocalJsonValue?> propIgnoreMissingComponentTemplates = default; + LocalJsonValue propIndexPatterns = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propPriority = default; + LocalJsonValue propTemplate = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowAutoCreate.TryReadProperty(ref reader, options, PropAllowAutoCreate, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propComposedOf.TryReadProperty(ref reader, options, PropComposedOf, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propDataStream.TryReadProperty(ref reader, options, PropDataStream, null)) + { + continue; + } + + if (propDeprecated.TryReadProperty(ref reader, options, PropDeprecated, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissingComponentTemplates.TryReadProperty(ref reader, options, PropIgnoreMissingComponentTemplates, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propIndexPatterns.TryReadProperty(ref reader, options, PropIndexPatterns, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propPriority.TryReadProperty(ref reader, options, PropPriority, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.SimulateTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowAutoCreate = propAllowAutoCreate.Value, + ComposedOf = propComposedOf.Value, + DataStream = propDataStream.Value, + Deprecated = propDeprecated.Value, + IgnoreMissingComponentTemplates = propIgnoreMissingComponentTemplates.Value, + IndexPatterns = propIndexPatterns.Value, + Meta = propMeta.Value, + Priority = propPriority.Value, + Template = propTemplate.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SimulateTemplateRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowAutoCreate, value.AllowAutoCreate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropComposedOf, value.ComposedOf, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDataStream, value.DataStream, null, null); + writer.WriteProperty(options, PropDeprecated, value.Deprecated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissingComponentTemplates, value.IgnoreMissingComponentTemplates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIndexPatterns, value.IndexPatterns, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropPriority, value.Priority, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTemplate, value.Template, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateTemplateRequest.g.cs index 791795ce04a..222f7a650b1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateTemplateRequest.g.cs @@ -54,133 +54,13 @@ public sealed partial class SimulateTemplateRequestParameters : Elastic.Transpor public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class SimulateTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowAutoCreate = System.Text.Json.JsonEncodedText.Encode("allow_auto_create"); - private static readonly System.Text.Json.JsonEncodedText PropComposedOf = System.Text.Json.JsonEncodedText.Encode("composed_of"); - private static readonly System.Text.Json.JsonEncodedText PropDataStream = System.Text.Json.JsonEncodedText.Encode("data_stream"); - private static readonly System.Text.Json.JsonEncodedText PropDeprecated = System.Text.Json.JsonEncodedText.Encode("deprecated"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissingComponentTemplates = System.Text.Json.JsonEncodedText.Encode("ignore_missing_component_templates"); - private static readonly System.Text.Json.JsonEncodedText PropIndexPatterns = System.Text.Json.JsonEncodedText.Encode("index_patterns"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); - private static readonly System.Text.Json.JsonEncodedText PropPriority = System.Text.Json.JsonEncodedText.Encode("priority"); - private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SimulateTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowAutoCreate = default; - LocalJsonValue?> propComposedOf = default; - LocalJsonValue propDataStream = default; - LocalJsonValue propDeprecated = default; - LocalJsonValue?> propIgnoreMissingComponentTemplates = default; - LocalJsonValue propIndexPatterns = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propPriority = default; - LocalJsonValue propTemplate = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowAutoCreate.TryReadProperty(ref reader, options, PropAllowAutoCreate, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propComposedOf.TryReadProperty(ref reader, options, PropComposedOf, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propDataStream.TryReadProperty(ref reader, options, PropDataStream, null)) - { - continue; - } - - if (propDeprecated.TryReadProperty(ref reader, options, PropDeprecated, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissingComponentTemplates.TryReadProperty(ref reader, options, PropIgnoreMissingComponentTemplates, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propIndexPatterns.TryReadProperty(ref reader, options, PropIndexPatterns, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propPriority.TryReadProperty(ref reader, options, PropPriority, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SimulateTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowAutoCreate = propAllowAutoCreate.Value, - ComposedOf = propComposedOf.Value, - DataStream = propDataStream.Value, - Deprecated = propDeprecated.Value, - IgnoreMissingComponentTemplates = propIgnoreMissingComponentTemplates.Value, - IndexPatterns = propIndexPatterns.Value, - Meta = propMeta.Value, - Priority = propPriority.Value, - Template = propTemplate.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SimulateTemplateRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowAutoCreate, value.AllowAutoCreate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropComposedOf, value.ComposedOf, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDataStream, value.DataStream, null, null); - writer.WriteProperty(options, PropDeprecated, value.Deprecated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissingComponentTemplates, value.IgnoreMissingComponentTemplates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIndexPatterns, value.IndexPatterns, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropPriority, value.Priority, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTemplate, value.Template, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Simulate an index template. /// Get the index configuration that would be applied by a particular index template. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SimulateTemplateRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SimulateTemplateRequestConverter))] public sealed partial class SimulateTemplateRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public SimulateTemplateRequest(Elastic.Clients.Elasticsearch.Name? name) : base(r => r.Optional("name", name)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateTemplateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateTemplateResponse.Converters.g.cs new file mode 100644 index 00000000000..6e3d6f2390b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateTemplateResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SimulateTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropOverlapping = System.Text.Json.JsonEncodedText.Encode("overlapping"); + private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SimulateTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propOverlapping = default; + LocalJsonValue propTemplate = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propOverlapping.TryReadProperty(ref reader, options, PropOverlapping, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.SimulateTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Overlapping = propOverlapping.Value, + Template = propTemplate.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SimulateTemplateResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropOverlapping, value.Overlapping, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTemplate, value.Template, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateTemplateResponse.g.cs index 7103b51c3cc..f222feb15da 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SimulateTemplateResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class SimulateTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropOverlapping = System.Text.Json.JsonEncodedText.Encode("overlapping"); - private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SimulateTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propOverlapping = default; - LocalJsonValue propTemplate = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propOverlapping.TryReadProperty(ref reader, options, PropOverlapping, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SimulateTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Overlapping = propOverlapping.Value, - Template = propTemplate.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SimulateTemplateResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropOverlapping, value.Overlapping, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTemplate, value.Template, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SimulateTemplateResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SimulateTemplateResponseConverter))] public sealed partial class SimulateTemplateResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -88,7 +40,7 @@ internal SimulateTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.Js public System.Collections.Generic.IReadOnlyCollection? Overlapping { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.IndexManagement.Template Template { get; set; } +Elastic.Clients.Elasticsearch.IndexManagement.Template Template { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SplitIndexRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SplitIndexRequest.Converters.g.cs new file mode 100644 index 00000000000..eaec863654e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SplitIndexRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SplitIndexRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SplitIndexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAliases = default; + LocalJsonValue?> propSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propSettings.TryReadProperty(ref reader, options, PropSettings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.SplitIndexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aliases = propAliases.Value, + Settings = propSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SplitIndexRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropSettings, value.Settings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SplitIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SplitIndexRequest.g.cs index a70a4270e07..25213ebde78 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SplitIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SplitIndexRequest.g.cs @@ -50,54 +50,6 @@ public sealed partial class SplitIndexRequestParameters : Elastic.Transport.Requ public Elastic.Clients.Elasticsearch.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } } -internal sealed partial class SplitIndexRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SplitIndexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAliases = default; - LocalJsonValue?> propSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propSettings.TryReadProperty(ref reader, options, PropSettings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SplitIndexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aliases = propAliases.Value, - Settings = propSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SplitIndexRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropSettings, value.Settings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - /// /// /// Split an index. @@ -186,7 +138,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SplitIndexRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SplitIndexRequestConverter))] public sealed partial class SplitIndexRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SplitIndexResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SplitIndexResponse.Converters.g.cs new file mode 100644 index 00000000000..2a50be00ad7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SplitIndexResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SplitIndexResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropShardsAcknowledged = System.Text.Json.JsonEncodedText.Encode("shards_acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SplitIndexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + LocalJsonValue propIndex = default; + LocalJsonValue propShardsAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propShardsAcknowledged.TryReadProperty(ref reader, options, PropShardsAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.SplitIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value, + Index = propIndex.Value, + ShardsAcknowledged = propShardsAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SplitIndexResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropShardsAcknowledged, value.ShardsAcknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SplitIndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SplitIndexResponse.g.cs index d683701b11e..442f6e6870f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SplitIndexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/SplitIndexResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class SplitIndexResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropShardsAcknowledged = System.Text.Json.JsonEncodedText.Encode("shards_acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SplitIndexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - LocalJsonValue propIndex = default; - LocalJsonValue propShardsAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propShardsAcknowledged.TryReadProperty(ref reader, options, PropShardsAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SplitIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value, - Index = propIndex.Value, - ShardsAcknowledged = propShardsAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SplitIndexResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropShardsAcknowledged, value.ShardsAcknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SplitIndexResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SplitIndexResponseConverter))] public sealed partial class SplitIndexResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -96,17 +39,17 @@ internal SplitIndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCons public #if NET7_0_OR_GREATER - required +required #endif - bool Acknowledged { get; set; } +bool Acknowledged { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Index { get; set; } +string Index { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool ShardsAcknowledged { get; set; } +bool ShardsAcknowledged { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/UpdateAliasesRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/UpdateAliasesRequest.Converters.g.cs new file mode 100644 index 00000000000..344df332736 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/UpdateAliasesRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class UpdateAliasesRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropActions = System.Text.Json.JsonEncodedText.Encode("actions"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.UpdateAliasesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propActions = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propActions.TryReadProperty(ref reader, options, PropActions, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.UpdateAliasesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Actions = propActions.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.UpdateAliasesRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropActions, value.Actions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/UpdateAliasesRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/UpdateAliasesRequest.g.cs index db587964c0f..2d0b66f0c2c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/UpdateAliasesRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/UpdateAliasesRequest.g.cs @@ -42,52 +42,13 @@ public sealed partial class UpdateAliasesRequestParameters : Elastic.Transport.R public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class UpdateAliasesRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropActions = System.Text.Json.JsonEncodedText.Encode("actions"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.UpdateAliasesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propActions = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propActions.TryReadProperty(ref reader, options, PropActions, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.UpdateAliasesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Actions = propActions.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.UpdateAliasesRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropActions, value.Actions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// Create or update an alias. /// Adds a data stream or index to an alias. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.UpdateAliasesRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.UpdateAliasesRequestConverter))] public sealed partial class UpdateAliasesRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/UpdateAliasesResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/UpdateAliasesResponse.Converters.g.cs new file mode 100644 index 00000000000..88e1eaf4114 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/UpdateAliasesResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class UpdateAliasesResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.UpdateAliasesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.UpdateAliasesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.UpdateAliasesResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/UpdateAliasesResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/UpdateAliasesResponse.g.cs index 486e6d5c063..729679d4a23 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/UpdateAliasesResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/UpdateAliasesResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class UpdateAliasesResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.UpdateAliasesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.UpdateAliasesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.UpdateAliasesResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.UpdateAliasesResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.UpdateAliasesResponseConverter))] public sealed partial class UpdateAliasesResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ValidateQueryRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ValidateQueryRequest.Converters.g.cs new file mode 100644 index 00000000000..bb93b126167 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ValidateQueryRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ValidateQueryRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ValidateQueryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propQuery = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ValidateQueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Query = propQuery.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ValidateQueryRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ValidateQueryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ValidateQueryRequest.g.cs index 942ffe64929..b80d1f74e53 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ValidateQueryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ValidateQueryRequest.g.cs @@ -115,52 +115,13 @@ public sealed partial class ValidateQueryRequestParameters : Elastic.Transport.R public bool? Rewrite { get => Q("rewrite"); set => Q("rewrite", value); } } -internal sealed partial class ValidateQueryRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ValidateQueryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propQuery = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ValidateQueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Query = propQuery.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ValidateQueryRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Validate a query. /// Validates a query without running it. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ValidateQueryRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ValidateQueryRequestConverter))] public sealed partial class ValidateQueryRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public ValidateQueryRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ValidateQueryResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ValidateQueryResponse.Converters.g.cs new file mode 100644 index 00000000000..d9eb8bee730 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ValidateQueryResponse.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ValidateQueryResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); + private static readonly System.Text.Json.JsonEncodedText PropExplanations = System.Text.Json.JsonEncodedText.Encode("explanations"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + private static readonly System.Text.Json.JsonEncodedText PropValid = System.Text.Json.JsonEncodedText.Encode("valid"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ValidateQueryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propError = default; + LocalJsonValue?> propExplanations = default; + LocalJsonValue propShards = default; + LocalJsonValue propValid = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propError.TryReadProperty(ref reader, options, PropError, null)) + { + continue; + } + + if (propExplanations.TryReadProperty(ref reader, options, PropExplanations, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (propValid.TryReadProperty(ref reader, options, PropValid, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ValidateQueryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Error = propError.Value, + Explanations = propExplanations.Value, + Shards = propShards.Value, + Valid = propValid.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ValidateQueryResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropError, value.Error, null, null); + writer.WriteProperty(options, PropExplanations, value.Explanations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteProperty(options, PropValid, value.Valid, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ValidateQueryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ValidateQueryResponse.g.cs index f3f3a062ee1..b30011e1d3f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ValidateQueryResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ValidateQueryResponse.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ValidateQueryResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); - private static readonly System.Text.Json.JsonEncodedText PropExplanations = System.Text.Json.JsonEncodedText.Encode("explanations"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - private static readonly System.Text.Json.JsonEncodedText PropValid = System.Text.Json.JsonEncodedText.Encode("valid"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ValidateQueryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propError = default; - LocalJsonValue?> propExplanations = default; - LocalJsonValue propShards = default; - LocalJsonValue propValid = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propError.TryReadProperty(ref reader, options, PropError, null)) - { - continue; - } - - if (propExplanations.TryReadProperty(ref reader, options, PropExplanations, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (propValid.TryReadProperty(ref reader, options, PropValid, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ValidateQueryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Error = propError.Value, - Explanations = propExplanations.Value, - Shards = propShards.Value, - Valid = propValid.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ValidateQueryResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropError, value.Error, null, null); - writer.WriteProperty(options, PropExplanations, value.Explanations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteProperty(options, PropValid, value.Valid, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ValidateQueryResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ValidateQueryResponseConverter))] public sealed partial class ValidateQueryResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -108,7 +42,7 @@ internal ValidateQueryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonC public Elastic.Clients.Elasticsearch.ShardStatistics? Shards { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool Valid { get; set; } +bool Valid { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexRequest.Converters.g.cs new file mode 100644 index 00000000000..7909be49a59 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class IndexRequestConverter : System.Text.Json.Serialization.JsonConverter> +{ + public override Elastic.Clients.Elasticsearch.IndexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.IndexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Document = reader.ReadValue(options, static TDocument (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Document, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TDocument v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + } +} + +public sealed partial class IndexRequestConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(IndexRequest<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(IndexRequestConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexRequest.g.cs index e6231996a5c..f2ab3b11689 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexRequest.g.cs @@ -135,35 +135,6 @@ public sealed partial class IndexRequestParameters : Elastic.Transport.RequestPa public Elastic.Clients.Elasticsearch.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } } -internal sealed partial class IndexRequestConverter : System.Text.Json.Serialization.JsonConverter> -{ - public override Elastic.Clients.Elasticsearch.IndexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.IndexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Document = reader.ReadValue(options, static TDocument (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Document, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TDocument v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - } -} - -internal sealed partial class IndexRequestConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(IndexRequest<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(IndexRequestConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - /// /// /// Create or update a document in an index. @@ -332,7 +303,7 @@ public override System.Text.Json.Serialization.JsonConverter CreateConverter(Sys /// Even the simple case of updating the Elasticsearch index using data from a database is simplified if external versioning is used, as only the latest version will be used if the index operations arrive out of order. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexRequestConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.IndexRequestConverterFactory))] public partial class IndexRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexResponse.Converters.g.cs new file mode 100644 index 00000000000..c45d1ab6e2f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexResponse.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class IndexResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropForcedRefresh = System.Text.Json.JsonEncodedText.Encode("forced_refresh"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); + private static readonly System.Text.Json.JsonEncodedText PropPrimaryTerm = System.Text.Json.JsonEncodedText.Encode("_primary_term"); + private static readonly System.Text.Json.JsonEncodedText PropResult = System.Text.Json.JsonEncodedText.Encode("result"); + private static readonly System.Text.Json.JsonEncodedText PropSeqNo = System.Text.Json.JsonEncodedText.Encode("_seq_no"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("_version"); + + public override Elastic.Clients.Elasticsearch.IndexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propForcedRefresh = default; + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + LocalJsonValue propPrimaryTerm = default; + LocalJsonValue propResult = default; + LocalJsonValue propSeqNo = default; + LocalJsonValue propShards = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propForcedRefresh.TryReadProperty(ref reader, options, PropForcedRefresh, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propPrimaryTerm.TryReadProperty(ref reader, options, PropPrimaryTerm, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propResult.TryReadProperty(ref reader, options, PropResult, null)) + { + continue; + } + + if (propSeqNo.TryReadProperty(ref reader, options, PropSeqNo, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ForcedRefresh = propForcedRefresh.Value, + Id = propId.Value, + Index = propIndex.Value, + PrimaryTerm = propPrimaryTerm.Value, + Result = propResult.Value, + SeqNo = propSeqNo.Value, + Shards = propShards.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropForcedRefresh, value.ForcedRefresh, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropPrimaryTerm, value.PrimaryTerm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropResult, value.Result, null, null); + writer.WriteProperty(options, PropSeqNo, value.SeqNo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexResponse.g.cs index 7876d9bb30d..15cdd6ccb72 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexResponse.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class IndexResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropForcedRefresh = System.Text.Json.JsonEncodedText.Encode("forced_refresh"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); - private static readonly System.Text.Json.JsonEncodedText PropPrimaryTerm = System.Text.Json.JsonEncodedText.Encode("_primary_term"); - private static readonly System.Text.Json.JsonEncodedText PropResult = System.Text.Json.JsonEncodedText.Encode("result"); - private static readonly System.Text.Json.JsonEncodedText PropSeqNo = System.Text.Json.JsonEncodedText.Encode("_seq_no"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("_version"); - - public override Elastic.Clients.Elasticsearch.IndexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propForcedRefresh = default; - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - LocalJsonValue propPrimaryTerm = default; - LocalJsonValue propResult = default; - LocalJsonValue propSeqNo = default; - LocalJsonValue propShards = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propForcedRefresh.TryReadProperty(ref reader, options, PropForcedRefresh, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propPrimaryTerm.TryReadProperty(ref reader, options, PropPrimaryTerm, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propResult.TryReadProperty(ref reader, options, PropResult, null)) - { - continue; - } - - if (propSeqNo.TryReadProperty(ref reader, options, PropSeqNo, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ForcedRefresh = propForcedRefresh.Value, - Id = propId.Value, - Index = propIndex.Value, - PrimaryTerm = propPrimaryTerm.Value, - Result = propResult.Value, - SeqNo = propSeqNo.Value, - Shards = propShards.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropForcedRefresh, value.ForcedRefresh, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropPrimaryTerm, value.PrimaryTerm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropResult, value.Result, null, null); - writer.WriteProperty(options, PropSeqNo, value.SeqNo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.IndexResponseConverter))] public sealed partial class IndexResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/ChatCompletionUnifiedRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/ChatCompletionUnifiedRequest.Converters.g.cs new file mode 100644 index 00000000000..5fd521a4688 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/ChatCompletionUnifiedRequest.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class ChatCompletionUnifiedRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Inference.ChatCompletionUnifiedRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Inference.ChatCompletionUnifiedRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { ChatCompletionRequest = reader.ReadValue(options, null) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ChatCompletionUnifiedRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.ChatCompletionRequest, null); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/ChatCompletionUnifiedRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/ChatCompletionUnifiedRequest.g.cs index 85cb48b1150..544b6077124 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/ChatCompletionUnifiedRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/ChatCompletionUnifiedRequest.g.cs @@ -33,19 +33,6 @@ public sealed partial class ChatCompletionUnifiedRequestParameters : Elastic.Tra public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class ChatCompletionUnifiedRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Inference.ChatCompletionUnifiedRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Inference.ChatCompletionUnifiedRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { ChatCompletionRequest = reader.ReadValue(options, null) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ChatCompletionUnifiedRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.ChatCompletionRequest, null); - } -} - /// /// /// Perform chat completion inference @@ -61,7 +48,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If you use the openai, hugging_face or the elastic service, use the Chat completion inference API. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.ChatCompletionUnifiedRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.ChatCompletionUnifiedRequestConverter))] public sealed partial class ChatCompletionUnifiedRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/CompletionRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/CompletionRequest.Converters.g.cs new file mode 100644 index 00000000000..f593fcdc3ad --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/CompletionRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class CompletionRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropInput = System.Text.Json.JsonEncodedText.Encode("input"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.CompletionRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propInput = default; + LocalJsonValue propTaskSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propInput.TryReadProperty(ref reader, options, PropInput, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.CompletionRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Input = propInput.Value, + TaskSettings = propTaskSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CompletionRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropInput, value.Input, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/CompletionRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/CompletionRequest.g.cs index ba680552c70..d8c094dce23 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/CompletionRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/CompletionRequest.g.cs @@ -33,60 +33,12 @@ public sealed partial class CompletionRequestParameters : Elastic.Transport.Requ public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class CompletionRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropInput = System.Text.Json.JsonEncodedText.Encode("input"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.CompletionRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propInput = default; - LocalJsonValue propTaskSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propInput.TryReadProperty(ref reader, options, PropInput, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.CompletionRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Input = propInput.Value, - TaskSettings = propTaskSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CompletionRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropInput, value.Input, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteEndObject(); - } -} - /// /// /// Perform completion inference on the service /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.CompletionRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.CompletionRequestConverter))] public sealed partial class CompletionRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/CompletionResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/CompletionResponse.Converters.g.cs new file mode 100644 index 00000000000..6b3822d3942 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/CompletionResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class CompletionResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + + public override Elastic.Clients.Elasticsearch.Inference.CompletionResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propCompletion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCompletion.TryReadProperty(ref reader, options, PropCompletion, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.CompletionResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Completion = propCompletion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CompletionResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCompletion, value.Completion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/CompletionResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/CompletionResponse.g.cs index e9a673738e1..e1478bc9fb5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/CompletionResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/CompletionResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class CompletionResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - - public override Elastic.Clients.Elasticsearch.Inference.CompletionResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propCompletion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCompletion.TryReadProperty(ref reader, options, PropCompletion, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.CompletionResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Completion = propCompletion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CompletionResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCompletion, value.Completion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.CompletionResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.CompletionResponseConverter))] public sealed partial class CompletionResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal CompletionResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCons public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Completion { get; set; } +System.Collections.Generic.IReadOnlyCollection Completion { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/DeleteInferenceRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/DeleteInferenceRequest.Converters.g.cs new file mode 100644 index 00000000000..87035ce22fd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/DeleteInferenceRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class DeleteInferenceRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Inference.DeleteInferenceRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.DeleteInferenceRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.DeleteInferenceRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/DeleteInferenceRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/DeleteInferenceRequest.g.cs index 7d9c9df7028..0a08d75c4fa 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/DeleteInferenceRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/DeleteInferenceRequest.g.cs @@ -40,41 +40,12 @@ public sealed partial class DeleteInferenceRequestParameters : Elastic.Transport public bool? Force { get => Q("force"); set => Q("force", value); } } -internal sealed partial class DeleteInferenceRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Inference.DeleteInferenceRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.DeleteInferenceRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.DeleteInferenceRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete an inference endpoint /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.DeleteInferenceRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.DeleteInferenceRequestConverter))] public sealed partial class DeleteInferenceRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/DeleteInferenceResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/DeleteInferenceResponse.Converters.g.cs new file mode 100644 index 00000000000..703be54c4dd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/DeleteInferenceResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class DeleteInferenceResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + private static readonly System.Text.Json.JsonEncodedText PropPipelines = System.Text.Json.JsonEncodedText.Encode("pipelines"); + + public override Elastic.Clients.Elasticsearch.Inference.DeleteInferenceResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + LocalJsonValue> propPipelines = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (propPipelines.TryReadProperty(ref reader, options, PropPipelines, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.DeleteInferenceResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value, + Pipelines = propPipelines.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.DeleteInferenceResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteProperty(options, PropPipelines, value.Pipelines, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/DeleteInferenceResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/DeleteInferenceResponse.g.cs index 0cb0e7dcd47..32b83ad262b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/DeleteInferenceResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/DeleteInferenceResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class DeleteInferenceResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - private static readonly System.Text.Json.JsonEncodedText PropPipelines = System.Text.Json.JsonEncodedText.Encode("pipelines"); - - public override Elastic.Clients.Elasticsearch.Inference.DeleteInferenceResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - LocalJsonValue> propPipelines = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (propPipelines.TryReadProperty(ref reader, options, PropPipelines, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.DeleteInferenceResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value, - Pipelines = propPipelines.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.DeleteInferenceResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteProperty(options, PropPipelines, value.Pipelines, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.DeleteInferenceResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.DeleteInferenceResponseConverter))] public sealed partial class DeleteInferenceResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetInferenceRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetInferenceRequest.Converters.g.cs new file mode 100644 index 00000000000..ca065ce8580 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetInferenceRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class GetInferenceRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Inference.GetInferenceRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.GetInferenceRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.GetInferenceRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetInferenceRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetInferenceRequest.g.cs index dcdf716dcf2..6a67f4c1f60 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetInferenceRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetInferenceRequest.g.cs @@ -27,41 +27,12 @@ public sealed partial class GetInferenceRequestParameters : Elastic.Transport.Re { } -internal sealed partial class GetInferenceRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Inference.GetInferenceRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.GetInferenceRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.GetInferenceRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get an inference endpoint /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.GetInferenceRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.GetInferenceRequestConverter))] public sealed partial class GetInferenceRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetInferenceRequest(Elastic.Clients.Elasticsearch.Id? inferenceId) : base(r => r.Optional("inference_id", inferenceId)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetInferenceResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetInferenceResponse.Converters.g.cs new file mode 100644 index 00000000000..c1aa2110e3c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetInferenceResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class GetInferenceResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEndpoints = System.Text.Json.JsonEncodedText.Encode("endpoints"); + + public override Elastic.Clients.Elasticsearch.Inference.GetInferenceResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propEndpoints = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEndpoints.TryReadProperty(ref reader, options, PropEndpoints, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.GetInferenceResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Endpoints = propEndpoints.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.GetInferenceResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEndpoints, value.Endpoints, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetInferenceResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetInferenceResponse.g.cs index 76808319901..f1da2c4ff53 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetInferenceResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/GetInferenceResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class GetInferenceResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEndpoints = System.Text.Json.JsonEncodedText.Encode("endpoints"); - - public override Elastic.Clients.Elasticsearch.Inference.GetInferenceResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propEndpoints = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEndpoints.TryReadProperty(ref reader, options, PropEndpoints, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.GetInferenceResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Endpoints = propEndpoints.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.GetInferenceResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEndpoints, value.Endpoints, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.GetInferenceResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.GetInferenceResponseConverter))] public sealed partial class GetInferenceResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal GetInferenceResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCo public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Endpoints { get; set; } +System.Collections.Generic.IReadOnlyCollection Endpoints { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/InferenceRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/InferenceRequest.Converters.g.cs new file mode 100644 index 00000000000..87e3f00b783 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/InferenceRequest.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class InferenceRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropInput = System.Text.Json.JsonEncodedText.Encode("input"); + private static readonly System.Text.Json.JsonEncodedText PropInputType = System.Text.Json.JsonEncodedText.Encode("input_type"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.InferenceRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propInput = default; + LocalJsonValue propInputType = default; + LocalJsonValue propQuery = default; + LocalJsonValue propTaskSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propInput.TryReadProperty(ref reader, options, PropInput, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propInputType.TryReadProperty(ref reader, options, PropInputType, null)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.InferenceRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Input = propInput.Value, + InputType = propInputType.Value, + Query = propQuery.Value, + TaskSettings = propTaskSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.InferenceRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropInput, value.Input, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropInputType, value.InputType, null, null); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/InferenceRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/InferenceRequest.g.cs index 195b765f29f..d4647894c06 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/InferenceRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/InferenceRequest.g.cs @@ -33,72 +33,6 @@ public sealed partial class InferenceRequestParameters : Elastic.Transport.Reque public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class InferenceRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropInput = System.Text.Json.JsonEncodedText.Encode("input"); - private static readonly System.Text.Json.JsonEncodedText PropInputType = System.Text.Json.JsonEncodedText.Encode("input_type"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.InferenceRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propInput = default; - LocalJsonValue propInputType = default; - LocalJsonValue propQuery = default; - LocalJsonValue propTaskSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propInput.TryReadProperty(ref reader, options, PropInput, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (propInputType.TryReadProperty(ref reader, options, PropInputType, null)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.InferenceRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Input = propInput.Value, - InputType = propInputType.Value, - Query = propQuery.Value, - TaskSettings = propTaskSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.InferenceRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropInput, value.Input, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropInputType, value.InputType, null, null); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteEndObject(); - } -} - /// /// /// Perform inference on the service. @@ -116,7 +50,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Azure, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face. For built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models. However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.InferenceRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.InferenceRequestConverter))] public sealed partial class InferenceRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/InferenceResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/InferenceResponse.Converters.g.cs new file mode 100644 index 00000000000..d44e05bf556 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/InferenceResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class InferenceResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Inference.InferenceResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Inference.InferenceResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Result = reader.ReadValue(options, null) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.InferenceResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Result, null); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/InferenceResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/InferenceResponse.g.cs index 7f0395c7216..5ccd5e2558a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/InferenceResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/InferenceResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class InferenceResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Inference.InferenceResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Inference.InferenceResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Result = reader.ReadValue(options, null) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.InferenceResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Result, null); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.InferenceResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.InferenceResponseConverter))] public sealed partial class InferenceResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAi21Request.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAi21Request.Converters.g.cs new file mode 100644 index 00000000000..36adf451fca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAi21Request.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutAi21RequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.PutAi21Request Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propServiceSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropService)) + { + reader.Skip(); + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutAi21Request(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ServiceSettings = propServiceSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAi21Request value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAi21Request.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAi21Request.g.cs index 04a026c99f8..e3ba9385c6e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAi21Request.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAi21Request.g.cs @@ -33,53 +33,6 @@ public sealed partial class PutAi21RequestParameters : Elastic.Transport.Request public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutAi21RequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.PutAi21Request Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propServiceSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropService)) - { - reader.Skip(); - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutAi21Request(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ServiceSettings = propServiceSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAi21Request value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create a AI21 inference endpoint. @@ -88,7 +41,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Create an inference endpoint to perform an inference task with the ai21 service. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutAi21RequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutAi21RequestConverter))] public sealed partial class PutAi21Request : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAi21Response.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAi21Response.Converters.g.cs new file mode 100644 index 00000000000..29f68f8dd68 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAi21Response.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutAi21ResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); + + public override Elastic.Clients.Elasticsearch.Inference.PutAi21Response Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + LocalJsonValue propTaskType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutAi21Response(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + InferenceId = propInferenceId.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value, + TaskType = propTaskType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAi21Response value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAi21Response.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAi21Response.g.cs index 9359b691775..d3343766b50 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAi21Response.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAi21Response.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class PutAi21ResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); - - public override Elastic.Clients.Elasticsearch.Inference.PutAi21Response Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue propService = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - LocalJsonValue propTaskType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propService.TryReadProperty(ref reader, options, PropService, null)) - { - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutAi21Response(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - InferenceId = propInferenceId.Value, - Service = propService.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value, - TaskType = propTaskType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAi21Response value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutAi21ResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutAi21ResponseConverter))] public sealed partial class PutAi21Response : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudRequest.Converters.g.cs new file mode 100644 index 00000000000..a6850770a3e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudRequest.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutAlibabacloudRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.PutAlibabacloudRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropService)) + { + reader.Skip(); + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutAlibabacloudRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAlibabacloudRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudRequest.g.cs index d352cad5063..1863c01648d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudRequest.g.cs @@ -33,71 +33,6 @@ public sealed partial class PutAlibabacloudRequestParameters : Elastic.Transport public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutAlibabacloudRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.PutAlibabacloudRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropService)) - { - reader.Skip(); - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutAlibabacloudRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAlibabacloudRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create an AlibabaCloud AI Search inference endpoint. @@ -106,7 +41,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Create an inference endpoint to perform an inference task with the alibabacloud-ai-search service. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutAlibabacloudRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutAlibabacloudRequestConverter))] public sealed partial class PutAlibabacloudRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudResponse.Converters.g.cs new file mode 100644 index 00000000000..f9f56e327e7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutAlibabacloudResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); + + public override Elastic.Clients.Elasticsearch.Inference.PutAlibabacloudResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + LocalJsonValue propTaskType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutAlibabacloudResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + InferenceId = propInferenceId.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value, + TaskType = propTaskType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAlibabacloudResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudResponse.g.cs index a2ca042da3a..d1504d27c9e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class PutAlibabacloudResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); - - public override Elastic.Clients.Elasticsearch.Inference.PutAlibabacloudResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue propService = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - LocalJsonValue propTaskType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propService.TryReadProperty(ref reader, options, PropService, null)) - { - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutAlibabacloudResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - InferenceId = propInferenceId.Value, - Service = propService.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value, - TaskType = propTaskType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAlibabacloudResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutAlibabacloudResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutAlibabacloudResponseConverter))] public sealed partial class PutAlibabacloudResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockRequest.Converters.g.cs new file mode 100644 index 00000000000..0c107a560c4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockRequest.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutAmazonbedrockRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.PutAmazonbedrockRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropService)) + { + reader.Skip(); + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutAmazonbedrockRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAmazonbedrockRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockRequest.g.cs index 335c642ccc5..76566635860 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockRequest.g.cs @@ -33,71 +33,6 @@ public sealed partial class PutAmazonbedrockRequestParameters : Elastic.Transpor public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutAmazonbedrockRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.PutAmazonbedrockRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropService)) - { - reader.Skip(); - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutAmazonbedrockRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAmazonbedrockRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create an Amazon Bedrock inference endpoint. @@ -110,7 +45,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// You need to provide the access and secret keys only once, during the inference model creation. The get inference API does not retrieve your access or secret keys. After creating the inference model, you cannot change the associated key pairs. If you want to use a different access and secret key pair, delete the inference model and recreate it with the same name and the updated keys. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutAmazonbedrockRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutAmazonbedrockRequestConverter))] public sealed partial class PutAmazonbedrockRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockResponse.Converters.g.cs new file mode 100644 index 00000000000..84f8ec3ea34 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutAmazonbedrockResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); + + public override Elastic.Clients.Elasticsearch.Inference.PutAmazonbedrockResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + LocalJsonValue propTaskType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutAmazonbedrockResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + InferenceId = propInferenceId.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value, + TaskType = propTaskType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAmazonbedrockResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockResponse.g.cs index 65dc90e0c09..11c8ee2afb7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class PutAmazonbedrockResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); - - public override Elastic.Clients.Elasticsearch.Inference.PutAmazonbedrockResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue propService = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - LocalJsonValue propTaskType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propService.TryReadProperty(ref reader, options, PropService, null)) - { - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutAmazonbedrockResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - InferenceId = propInferenceId.Value, - Service = propService.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value, - TaskType = propTaskType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAmazonbedrockResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutAmazonbedrockResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutAmazonbedrockResponseConverter))] public sealed partial class PutAmazonbedrockResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonsagemakerRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonsagemakerRequest.Converters.g.cs new file mode 100644 index 00000000000..26eb9dbb980 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonsagemakerRequest.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutAmazonsagemakerRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.PutAmazonsagemakerRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropService)) + { + reader.Skip(); + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutAmazonsagemakerRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAmazonsagemakerRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonsagemakerRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonsagemakerRequest.g.cs index 63e7131ca8d..35ae86225b6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonsagemakerRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonsagemakerRequest.g.cs @@ -33,71 +33,6 @@ public sealed partial class PutAmazonsagemakerRequestParameters : Elastic.Transp public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutAmazonsagemakerRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.PutAmazonsagemakerRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropService)) - { - reader.Skip(); - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutAmazonsagemakerRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAmazonsagemakerRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create an Amazon SageMaker inference endpoint. @@ -106,7 +41,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Create an inference endpoint to perform an inference task with the amazon_sagemaker service. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutAmazonsagemakerRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutAmazonsagemakerRequestConverter))] public sealed partial class PutAmazonsagemakerRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonsagemakerResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonsagemakerResponse.Converters.g.cs new file mode 100644 index 00000000000..72cedbd5627 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonsagemakerResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutAmazonsagemakerResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); + + public override Elastic.Clients.Elasticsearch.Inference.PutAmazonsagemakerResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + LocalJsonValue propTaskType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutAmazonsagemakerResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + InferenceId = propInferenceId.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value, + TaskType = propTaskType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAmazonsagemakerResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonsagemakerResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonsagemakerResponse.g.cs index 383dad70637..fee3fb58939 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonsagemakerResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonsagemakerResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class PutAmazonsagemakerResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); - - public override Elastic.Clients.Elasticsearch.Inference.PutAmazonsagemakerResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue propService = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - LocalJsonValue propTaskType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propService.TryReadProperty(ref reader, options, PropService, null)) - { - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutAmazonsagemakerResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - InferenceId = propInferenceId.Value, - Service = propService.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value, - TaskType = propTaskType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAmazonsagemakerResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutAmazonsagemakerResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutAmazonsagemakerResponseConverter))] public sealed partial class PutAmazonsagemakerResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAnthropicRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAnthropicRequest.Converters.g.cs new file mode 100644 index 00000000000..238336b841a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAnthropicRequest.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutAnthropicRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.PutAnthropicRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropService)) + { + reader.Skip(); + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutAnthropicRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAnthropicRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAnthropicRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAnthropicRequest.g.cs index 3fa14f35cde..8311ddddcde 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAnthropicRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAnthropicRequest.g.cs @@ -33,71 +33,6 @@ public sealed partial class PutAnthropicRequestParameters : Elastic.Transport.Re public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutAnthropicRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.PutAnthropicRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropService)) - { - reader.Skip(); - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutAnthropicRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAnthropicRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create an Anthropic inference endpoint. @@ -106,7 +41,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Create an inference endpoint to perform an inference task with the anthropic service. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutAnthropicRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutAnthropicRequestConverter))] public sealed partial class PutAnthropicRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAnthropicResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAnthropicResponse.Converters.g.cs new file mode 100644 index 00000000000..999c4454d22 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAnthropicResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutAnthropicResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); + + public override Elastic.Clients.Elasticsearch.Inference.PutAnthropicResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + LocalJsonValue propTaskType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutAnthropicResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + InferenceId = propInferenceId.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value, + TaskType = propTaskType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAnthropicResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAnthropicResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAnthropicResponse.g.cs index 4127f006e94..50ae139fce7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAnthropicResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAnthropicResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class PutAnthropicResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); - - public override Elastic.Clients.Elasticsearch.Inference.PutAnthropicResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue propService = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - LocalJsonValue propTaskType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propService.TryReadProperty(ref reader, options, PropService, null)) - { - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutAnthropicResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - InferenceId = propInferenceId.Value, - Service = propService.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value, - TaskType = propTaskType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAnthropicResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutAnthropicResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutAnthropicResponseConverter))] public sealed partial class PutAnthropicResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureaistudioRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureaistudioRequest.Converters.g.cs new file mode 100644 index 00000000000..f2de72943cf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureaistudioRequest.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutAzureaistudioRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.PutAzureaistudioRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropService)) + { + reader.Skip(); + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutAzureaistudioRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAzureaistudioRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureaistudioRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureaistudioRequest.g.cs index cd6e4da4f71..543e3652250 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureaistudioRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureaistudioRequest.g.cs @@ -33,71 +33,6 @@ public sealed partial class PutAzureaistudioRequestParameters : Elastic.Transpor public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutAzureaistudioRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.PutAzureaistudioRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropService)) - { - reader.Skip(); - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutAzureaistudioRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAzureaistudioRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create an Azure AI studio inference endpoint. @@ -106,7 +41,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Create an inference endpoint to perform an inference task with the azureaistudio service. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutAzureaistudioRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutAzureaistudioRequestConverter))] public sealed partial class PutAzureaistudioRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureaistudioResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureaistudioResponse.Converters.g.cs new file mode 100644 index 00000000000..ea5665c0306 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureaistudioResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutAzureaistudioResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); + + public override Elastic.Clients.Elasticsearch.Inference.PutAzureaistudioResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + LocalJsonValue propTaskType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutAzureaistudioResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + InferenceId = propInferenceId.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value, + TaskType = propTaskType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAzureaistudioResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureaistudioResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureaistudioResponse.g.cs index 40a92dfeaa4..b4967652f38 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureaistudioResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureaistudioResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class PutAzureaistudioResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); - - public override Elastic.Clients.Elasticsearch.Inference.PutAzureaistudioResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue propService = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - LocalJsonValue propTaskType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propService.TryReadProperty(ref reader, options, PropService, null)) - { - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutAzureaistudioResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - InferenceId = propInferenceId.Value, - Service = propService.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value, - TaskType = propTaskType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAzureaistudioResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutAzureaistudioResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutAzureaistudioResponseConverter))] public sealed partial class PutAzureaistudioResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureopenaiRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureopenaiRequest.Converters.g.cs new file mode 100644 index 00000000000..831f5d99a67 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureopenaiRequest.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutAzureopenaiRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.PutAzureopenaiRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropService)) + { + reader.Skip(); + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutAzureopenaiRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAzureopenaiRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureopenaiRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureopenaiRequest.g.cs index 626d5859073..dd7aab791c0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureopenaiRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureopenaiRequest.g.cs @@ -33,71 +33,6 @@ public sealed partial class PutAzureopenaiRequestParameters : Elastic.Transport. public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutAzureopenaiRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.PutAzureopenaiRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropService)) - { - reader.Skip(); - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutAzureopenaiRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAzureopenaiRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create an Azure OpenAI inference endpoint. @@ -124,7 +59,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The list of embeddings models that you can choose from in your deployment can be found in the Azure models documentation. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutAzureopenaiRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutAzureopenaiRequestConverter))] public sealed partial class PutAzureopenaiRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureopenaiResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureopenaiResponse.Converters.g.cs new file mode 100644 index 00000000000..f66790e5a6b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureopenaiResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutAzureopenaiResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); + + public override Elastic.Clients.Elasticsearch.Inference.PutAzureopenaiResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + LocalJsonValue propTaskType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutAzureopenaiResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + InferenceId = propInferenceId.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value, + TaskType = propTaskType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAzureopenaiResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureopenaiResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureopenaiResponse.g.cs index ffa3ddca512..fae6875a1fa 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureopenaiResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureopenaiResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class PutAzureopenaiResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); - - public override Elastic.Clients.Elasticsearch.Inference.PutAzureopenaiResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue propService = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - LocalJsonValue propTaskType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propService.TryReadProperty(ref reader, options, PropService, null)) - { - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutAzureopenaiResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - InferenceId = propInferenceId.Value, - Service = propService.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value, - TaskType = propTaskType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutAzureopenaiResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutAzureopenaiResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutAzureopenaiResponseConverter))] public sealed partial class PutAzureopenaiResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCohereRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCohereRequest.Converters.g.cs new file mode 100644 index 00000000000..885f1fe4f37 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCohereRequest.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutCohereRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.PutCohereRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropService)) + { + reader.Skip(); + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutCohereRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutCohereRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCohereRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCohereRequest.g.cs index cd380a4ea2f..7960f25b0b0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCohereRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCohereRequest.g.cs @@ -33,71 +33,6 @@ public sealed partial class PutCohereRequestParameters : Elastic.Transport.Reque public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutCohereRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.PutCohereRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropService)) - { - reader.Skip(); - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutCohereRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutCohereRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create a Cohere inference endpoint. @@ -106,7 +41,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Create an inference endpoint to perform an inference task with the cohere service. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutCohereRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutCohereRequestConverter))] public sealed partial class PutCohereRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCohereResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCohereResponse.Converters.g.cs new file mode 100644 index 00000000000..6c292cd56ce --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCohereResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutCohereResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); + + public override Elastic.Clients.Elasticsearch.Inference.PutCohereResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + LocalJsonValue propTaskType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutCohereResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + InferenceId = propInferenceId.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value, + TaskType = propTaskType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutCohereResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCohereResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCohereResponse.g.cs index 3aac786adaa..268698bc595 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCohereResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCohereResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class PutCohereResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); - - public override Elastic.Clients.Elasticsearch.Inference.PutCohereResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue propService = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - LocalJsonValue propTaskType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propService.TryReadProperty(ref reader, options, PropService, null)) - { - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutCohereResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - InferenceId = propInferenceId.Value, - Service = propService.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value, - TaskType = propTaskType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutCohereResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutCohereResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutCohereResponseConverter))] public sealed partial class PutCohereResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCustomRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCustomRequest.Converters.g.cs new file mode 100644 index 00000000000..93192a5dc34 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCustomRequest.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutCustomRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.PutCustomRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropService)) + { + reader.Skip(); + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutCustomRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutCustomRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCustomRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCustomRequest.g.cs index 19b42e99c50..7755908a00d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCustomRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCustomRequest.g.cs @@ -27,71 +27,6 @@ public sealed partial class PutCustomRequestParameters : Elastic.Transport.Reque { } -internal sealed partial class PutCustomRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.PutCustomRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropService)) - { - reader.Skip(); - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutCustomRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutCustomRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create a custom inference endpoint. @@ -165,7 +100,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutCustomRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutCustomRequestConverter))] public sealed partial class PutCustomRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCustomResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCustomResponse.Converters.g.cs new file mode 100644 index 00000000000..afa26029de6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCustomResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutCustomResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); + + public override Elastic.Clients.Elasticsearch.Inference.PutCustomResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + LocalJsonValue propTaskType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutCustomResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + InferenceId = propInferenceId.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value, + TaskType = propTaskType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutCustomResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCustomResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCustomResponse.g.cs index 282616e944b..c2c6d953823 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCustomResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCustomResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class PutCustomResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); - - public override Elastic.Clients.Elasticsearch.Inference.PutCustomResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue propService = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - LocalJsonValue propTaskType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propService.TryReadProperty(ref reader, options, PropService, null)) - { - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutCustomResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - InferenceId = propInferenceId.Value, - Service = propService.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value, - TaskType = propTaskType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutCustomResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutCustomResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutCustomResponseConverter))] public sealed partial class PutCustomResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutDeepseekRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutDeepseekRequest.Converters.g.cs new file mode 100644 index 00000000000..4d19383d691 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutDeepseekRequest.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutDeepseekRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.PutDeepseekRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propServiceSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropService)) + { + reader.Skip(); + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutDeepseekRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + ServiceSettings = propServiceSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutDeepseekRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutDeepseekRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutDeepseekRequest.g.cs index 4eca3aefdd3..16ffe77fac2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutDeepseekRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutDeepseekRequest.g.cs @@ -33,62 +33,6 @@ public sealed partial class PutDeepseekRequestParameters : Elastic.Transport.Req public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutDeepseekRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.PutDeepseekRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propServiceSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropService)) - { - reader.Skip(); - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutDeepseekRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - ServiceSettings = propServiceSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutDeepseekRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create a DeepSeek inference endpoint. @@ -97,7 +41,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Create an inference endpoint to perform an inference task with the deepseek service. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutDeepseekRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutDeepseekRequestConverter))] public sealed partial class PutDeepseekRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutDeepseekResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutDeepseekResponse.Converters.g.cs new file mode 100644 index 00000000000..5bfd0bd8f5f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutDeepseekResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutDeepseekResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); + + public override Elastic.Clients.Elasticsearch.Inference.PutDeepseekResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + LocalJsonValue propTaskType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutDeepseekResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + InferenceId = propInferenceId.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value, + TaskType = propTaskType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutDeepseekResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutDeepseekResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutDeepseekResponse.g.cs index 8558ab3d17c..0e893dddcfa 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutDeepseekResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutDeepseekResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class PutDeepseekResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); - - public override Elastic.Clients.Elasticsearch.Inference.PutDeepseekResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue propService = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - LocalJsonValue propTaskType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propService.TryReadProperty(ref reader, options, PropService, null)) - { - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutDeepseekResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - InferenceId = propInferenceId.Value, - Service = propService.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value, - TaskType = propTaskType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutDeepseekResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutDeepseekResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutDeepseekResponseConverter))] public sealed partial class PutDeepseekResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElasticsearchRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElasticsearchRequest.Converters.g.cs new file mode 100644 index 00000000000..7341b629112 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElasticsearchRequest.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutElasticsearchRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.PutElasticsearchRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropService)) + { + reader.Skip(); + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutElasticsearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutElasticsearchRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElasticsearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElasticsearchRequest.g.cs index 8e1b78029c1..8c176a94586 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElasticsearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElasticsearchRequest.g.cs @@ -33,71 +33,6 @@ public sealed partial class PutElasticsearchRequestParameters : Elastic.Transpor public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutElasticsearchRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.PutElasticsearchRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropService)) - { - reader.Skip(); - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutElasticsearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutElasticsearchRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create an Elasticsearch inference endpoint. @@ -123,7 +58,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutElasticsearchRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutElasticsearchRequestConverter))] public sealed partial class PutElasticsearchRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElasticsearchResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElasticsearchResponse.Converters.g.cs new file mode 100644 index 00000000000..624fab78c0b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElasticsearchResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutElasticsearchResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); + + public override Elastic.Clients.Elasticsearch.Inference.PutElasticsearchResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + LocalJsonValue propTaskType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutElasticsearchResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + InferenceId = propInferenceId.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value, + TaskType = propTaskType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutElasticsearchResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElasticsearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElasticsearchResponse.g.cs index 1d4065b9260..3054748c539 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElasticsearchResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElasticsearchResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class PutElasticsearchResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); - - public override Elastic.Clients.Elasticsearch.Inference.PutElasticsearchResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue propService = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - LocalJsonValue propTaskType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propService.TryReadProperty(ref reader, options, PropService, null)) - { - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutElasticsearchResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - InferenceId = propInferenceId.Value, - Service = propService.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value, - TaskType = propTaskType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutElasticsearchResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutElasticsearchResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutElasticsearchResponseConverter))] public sealed partial class PutElasticsearchResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElserRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElserRequest.Converters.g.cs new file mode 100644 index 00000000000..411894967ef --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElserRequest.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutElserRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.PutElserRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propServiceSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropService)) + { + reader.Skip(); + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutElserRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + ServiceSettings = propServiceSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutElserRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElserRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElserRequest.g.cs index 84144671eec..0e96a1d5ae8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElserRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElserRequest.g.cs @@ -33,62 +33,6 @@ public sealed partial class PutElserRequestParameters : Elastic.Transport.Reques public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutElserRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.PutElserRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propServiceSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropService)) - { - reader.Skip(); - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutElserRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - ServiceSettings = propServiceSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutElserRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create an ELSER inference endpoint. @@ -115,7 +59,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutElserRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutElserRequestConverter))] public sealed partial class PutElserRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElserResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElserResponse.Converters.g.cs new file mode 100644 index 00000000000..646c51d9f2e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElserResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutElserResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); + + public override Elastic.Clients.Elasticsearch.Inference.PutElserResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + LocalJsonValue propTaskType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutElserResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + InferenceId = propInferenceId.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value, + TaskType = propTaskType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutElserResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElserResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElserResponse.g.cs index 2e5c8502ccc..d69730c79f3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElserResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElserResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class PutElserResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); - - public override Elastic.Clients.Elasticsearch.Inference.PutElserResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue propService = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - LocalJsonValue propTaskType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propService.TryReadProperty(ref reader, options, PropService, null)) - { - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutElserResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - InferenceId = propInferenceId.Value, - Service = propService.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value, - TaskType = propTaskType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutElserResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutElserResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutElserResponseConverter))] public sealed partial class PutElserResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGoogleaistudioRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGoogleaistudioRequest.Converters.g.cs new file mode 100644 index 00000000000..c88d5859e6e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGoogleaistudioRequest.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutGoogleaistudioRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.PutGoogleaistudioRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propServiceSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropService)) + { + reader.Skip(); + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutGoogleaistudioRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + ServiceSettings = propServiceSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutGoogleaistudioRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGoogleaistudioRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGoogleaistudioRequest.g.cs index 08520ffb6c3..fa84d6403af 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGoogleaistudioRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGoogleaistudioRequest.g.cs @@ -33,62 +33,6 @@ public sealed partial class PutGoogleaistudioRequestParameters : Elastic.Transpo public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutGoogleaistudioRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.PutGoogleaistudioRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propServiceSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropService)) - { - reader.Skip(); - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutGoogleaistudioRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - ServiceSettings = propServiceSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutGoogleaistudioRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create an Google AI Studio inference endpoint. @@ -97,7 +41,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Create an inference endpoint to perform an inference task with the googleaistudio service. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutGoogleaistudioRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutGoogleaistudioRequestConverter))] public sealed partial class PutGoogleaistudioRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGoogleaistudioResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGoogleaistudioResponse.Converters.g.cs new file mode 100644 index 00000000000..ffaf44c9c86 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGoogleaistudioResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutGoogleaistudioResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); + + public override Elastic.Clients.Elasticsearch.Inference.PutGoogleaistudioResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + LocalJsonValue propTaskType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutGoogleaistudioResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + InferenceId = propInferenceId.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value, + TaskType = propTaskType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutGoogleaistudioResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGoogleaistudioResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGoogleaistudioResponse.g.cs index 003fdf7d2b5..86b904dcdaf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGoogleaistudioResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGoogleaistudioResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class PutGoogleaistudioResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); - - public override Elastic.Clients.Elasticsearch.Inference.PutGoogleaistudioResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue propService = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - LocalJsonValue propTaskType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propService.TryReadProperty(ref reader, options, PropService, null)) - { - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutGoogleaistudioResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - InferenceId = propInferenceId.Value, - Service = propService.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value, - TaskType = propTaskType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutGoogleaistudioResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutGoogleaistudioResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutGoogleaistudioResponseConverter))] public sealed partial class PutGoogleaistudioResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGooglevertexaiRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGooglevertexaiRequest.Converters.g.cs new file mode 100644 index 00000000000..55a5331427b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGooglevertexaiRequest.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutGooglevertexaiRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.PutGooglevertexaiRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropService)) + { + reader.Skip(); + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutGooglevertexaiRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutGooglevertexaiRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGooglevertexaiRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGooglevertexaiRequest.g.cs index d345be7e27f..23f9dec61dc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGooglevertexaiRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGooglevertexaiRequest.g.cs @@ -33,71 +33,6 @@ public sealed partial class PutGooglevertexaiRequestParameters : Elastic.Transpo public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutGooglevertexaiRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.PutGooglevertexaiRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropService)) - { - reader.Skip(); - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutGooglevertexaiRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutGooglevertexaiRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create a Google Vertex AI inference endpoint. @@ -106,7 +41,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Create an inference endpoint to perform an inference task with the googlevertexai service. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutGooglevertexaiRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutGooglevertexaiRequestConverter))] public sealed partial class PutGooglevertexaiRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGooglevertexaiResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGooglevertexaiResponse.Converters.g.cs new file mode 100644 index 00000000000..c7620e179ed --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGooglevertexaiResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutGooglevertexaiResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); + + public override Elastic.Clients.Elasticsearch.Inference.PutGooglevertexaiResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + LocalJsonValue propTaskType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutGooglevertexaiResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + InferenceId = propInferenceId.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value, + TaskType = propTaskType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutGooglevertexaiResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGooglevertexaiResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGooglevertexaiResponse.g.cs index 13529eb6e1c..3a561386256 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGooglevertexaiResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGooglevertexaiResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class PutGooglevertexaiResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); - - public override Elastic.Clients.Elasticsearch.Inference.PutGooglevertexaiResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue propService = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - LocalJsonValue propTaskType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propService.TryReadProperty(ref reader, options, PropService, null)) - { - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutGooglevertexaiResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - InferenceId = propInferenceId.Value, - Service = propService.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value, - TaskType = propTaskType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutGooglevertexaiResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutGooglevertexaiResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutGooglevertexaiResponseConverter))] public sealed partial class PutGooglevertexaiResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutHuggingFaceRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutHuggingFaceRequest.Converters.g.cs new file mode 100644 index 00000000000..c00bad7fc26 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutHuggingFaceRequest.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutHuggingFaceRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.PutHuggingFaceRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropService)) + { + reader.Skip(); + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutHuggingFaceRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutHuggingFaceRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutHuggingFaceRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutHuggingFaceRequest.g.cs index ee2da9ac802..5a88093eed8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutHuggingFaceRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutHuggingFaceRequest.g.cs @@ -33,71 +33,6 @@ public sealed partial class PutHuggingFaceRequestParameters : Elastic.Transport. public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutHuggingFaceRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.PutHuggingFaceRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropService)) - { - reader.Skip(); - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutHuggingFaceRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutHuggingFaceRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create a Hugging Face inference endpoint. @@ -196,7 +131,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutHuggingFaceRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutHuggingFaceRequestConverter))] public sealed partial class PutHuggingFaceRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutHuggingFaceResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutHuggingFaceResponse.Converters.g.cs new file mode 100644 index 00000000000..04106d65bab --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutHuggingFaceResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutHuggingFaceResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); + + public override Elastic.Clients.Elasticsearch.Inference.PutHuggingFaceResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + LocalJsonValue propTaskType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutHuggingFaceResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + InferenceId = propInferenceId.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value, + TaskType = propTaskType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutHuggingFaceResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutHuggingFaceResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutHuggingFaceResponse.g.cs index 4745f6f4365..2153e94cf83 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutHuggingFaceResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutHuggingFaceResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class PutHuggingFaceResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); - - public override Elastic.Clients.Elasticsearch.Inference.PutHuggingFaceResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue propService = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - LocalJsonValue propTaskType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propService.TryReadProperty(ref reader, options, PropService, null)) - { - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutHuggingFaceResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - InferenceId = propInferenceId.Value, - Service = propService.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value, - TaskType = propTaskType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutHuggingFaceResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutHuggingFaceResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutHuggingFaceResponseConverter))] public sealed partial class PutHuggingFaceResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceRequest.Converters.g.cs new file mode 100644 index 00000000000..fce119d2214 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceRequest.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutInferenceRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Inference.PutInferenceRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Inference.PutInferenceRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { InferenceConfig = reader.ReadValue(options, null) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutInferenceRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.InferenceConfig, null); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceRequest.g.cs index 89f1c809b8d..444f0e6cf1f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceRequest.g.cs @@ -33,19 +33,6 @@ public sealed partial class PutInferenceRequestParameters : Elastic.Transport.Re public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutInferenceRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Inference.PutInferenceRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Inference.PutInferenceRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { InferenceConfig = reader.ReadValue(options, null) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutInferenceRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.InferenceConfig, null); - } -} - /// /// /// Create an inference endpoint. @@ -161,7 +148,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutInferenceRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutInferenceRequestConverter))] public sealed partial class PutInferenceRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceResponse.Converters.g.cs new file mode 100644 index 00000000000..483f7252dbd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutInferenceResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); + + public override Elastic.Clients.Elasticsearch.Inference.PutInferenceResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + LocalJsonValue propTaskType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutInferenceResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + InferenceId = propInferenceId.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value, + TaskType = propTaskType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutInferenceResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceResponse.g.cs index a8ce75de047..37d019001b6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class PutInferenceResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); - - public override Elastic.Clients.Elasticsearch.Inference.PutInferenceResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue propService = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - LocalJsonValue propTaskType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propService.TryReadProperty(ref reader, options, PropService, null)) - { - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutInferenceResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - InferenceId = propInferenceId.Value, - Service = propService.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value, - TaskType = propTaskType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutInferenceResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutInferenceResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutInferenceResponseConverter))] public sealed partial class PutInferenceResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiRequest.Converters.g.cs new file mode 100644 index 00000000000..9818837bc7d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiRequest.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutJinaaiRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.PutJinaaiRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropService)) + { + reader.Skip(); + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutJinaaiRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutJinaaiRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiRequest.g.cs index 16eb4bb3ddf..034d2b7bd08 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiRequest.g.cs @@ -33,71 +33,6 @@ public sealed partial class PutJinaaiRequestParameters : Elastic.Transport.Reque public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutJinaaiRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.PutJinaaiRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropService)) - { - reader.Skip(); - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutJinaaiRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutJinaaiRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create an JinaAI inference endpoint. @@ -110,7 +45,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// To review the available text_embedding models, refer to the https://jina.ai/embeddings/. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutJinaaiRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutJinaaiRequestConverter))] public sealed partial class PutJinaaiRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiResponse.Converters.g.cs new file mode 100644 index 00000000000..548d55c461d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutJinaaiResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); + + public override Elastic.Clients.Elasticsearch.Inference.PutJinaaiResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + LocalJsonValue propTaskType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutJinaaiResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + InferenceId = propInferenceId.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value, + TaskType = propTaskType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutJinaaiResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiResponse.g.cs index 40af45c9b42..c133d5c110a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class PutJinaaiResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); - - public override Elastic.Clients.Elasticsearch.Inference.PutJinaaiResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue propService = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - LocalJsonValue propTaskType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propService.TryReadProperty(ref reader, options, PropService, null)) - { - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutJinaaiResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - InferenceId = propInferenceId.Value, - Service = propService.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value, - TaskType = propTaskType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutJinaaiResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutJinaaiResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutJinaaiResponseConverter))] public sealed partial class PutJinaaiResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutLlamaRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutLlamaRequest.Converters.g.cs new file mode 100644 index 00000000000..0b33c962067 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutLlamaRequest.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutLlamaRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.PutLlamaRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propServiceSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropService)) + { + reader.Skip(); + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutLlamaRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + ServiceSettings = propServiceSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutLlamaRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutLlamaRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutLlamaRequest.g.cs index 4516fded91a..eed4e40d8b4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutLlamaRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutLlamaRequest.g.cs @@ -33,62 +33,6 @@ public sealed partial class PutLlamaRequestParameters : Elastic.Transport.Reques public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutLlamaRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.PutLlamaRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propServiceSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropService)) - { - reader.Skip(); - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutLlamaRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - ServiceSettings = propServiceSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutLlamaRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create a Llama inference endpoint. @@ -97,7 +41,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Create an inference endpoint to perform an inference task with the llama service. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutLlamaRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutLlamaRequestConverter))] public sealed partial class PutLlamaRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutLlamaResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutLlamaResponse.Converters.g.cs new file mode 100644 index 00000000000..d1aa0c4a541 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutLlamaResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutLlamaResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); + + public override Elastic.Clients.Elasticsearch.Inference.PutLlamaResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + LocalJsonValue propTaskType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutLlamaResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + InferenceId = propInferenceId.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value, + TaskType = propTaskType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutLlamaResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutLlamaResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutLlamaResponse.g.cs index 70eefa6d0e7..bbd2e051009 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutLlamaResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutLlamaResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class PutLlamaResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); - - public override Elastic.Clients.Elasticsearch.Inference.PutLlamaResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue propService = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - LocalJsonValue propTaskType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propService.TryReadProperty(ref reader, options, PropService, null)) - { - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutLlamaResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - InferenceId = propInferenceId.Value, - Service = propService.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value, - TaskType = propTaskType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutLlamaResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutLlamaResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutLlamaResponseConverter))] public sealed partial class PutLlamaResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutMistralRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutMistralRequest.Converters.g.cs new file mode 100644 index 00000000000..97d7306f417 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutMistralRequest.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutMistralRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.PutMistralRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propServiceSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropService)) + { + reader.Skip(); + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutMistralRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + ServiceSettings = propServiceSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutMistralRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutMistralRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutMistralRequest.g.cs index bfb8cd09045..0887b249715 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutMistralRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutMistralRequest.g.cs @@ -33,62 +33,6 @@ public sealed partial class PutMistralRequestParameters : Elastic.Transport.Requ public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutMistralRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.PutMistralRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propServiceSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropService)) - { - reader.Skip(); - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutMistralRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - ServiceSettings = propServiceSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutMistralRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create a Mistral inference endpoint. @@ -97,7 +41,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Create an inference endpoint to perform an inference task with the mistral service. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutMistralRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutMistralRequestConverter))] public sealed partial class PutMistralRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutMistralResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutMistralResponse.Converters.g.cs new file mode 100644 index 00000000000..bb0e6752ca1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutMistralResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutMistralResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); + + public override Elastic.Clients.Elasticsearch.Inference.PutMistralResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + LocalJsonValue propTaskType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutMistralResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + InferenceId = propInferenceId.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value, + TaskType = propTaskType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutMistralResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutMistralResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutMistralResponse.g.cs index 1cfc546ff6b..8820aa14703 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutMistralResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutMistralResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class PutMistralResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); - - public override Elastic.Clients.Elasticsearch.Inference.PutMistralResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue propService = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - LocalJsonValue propTaskType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propService.TryReadProperty(ref reader, options, PropService, null)) - { - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutMistralResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - InferenceId = propInferenceId.Value, - Service = propService.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value, - TaskType = propTaskType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutMistralResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutMistralResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutMistralResponseConverter))] public sealed partial class PutMistralResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenaiRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenaiRequest.Converters.g.cs new file mode 100644 index 00000000000..60c987500e2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenaiRequest.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutOpenaiRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.PutOpenaiRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropService)) + { + reader.Skip(); + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutOpenaiRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutOpenaiRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenaiRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenaiRequest.g.cs index dae4ebe59ee..7b7499b4c24 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenaiRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenaiRequest.g.cs @@ -33,71 +33,6 @@ public sealed partial class PutOpenaiRequestParameters : Elastic.Transport.Reque public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutOpenaiRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.PutOpenaiRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropService)) - { - reader.Skip(); - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutOpenaiRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutOpenaiRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create an OpenAI inference endpoint. @@ -106,7 +41,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Create an inference endpoint to perform an inference task with the openai service or openai compatible APIs. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutOpenaiRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutOpenaiRequestConverter))] public sealed partial class PutOpenaiRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenaiResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenaiResponse.Converters.g.cs new file mode 100644 index 00000000000..49ae16a8146 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenaiResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutOpenaiResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); + + public override Elastic.Clients.Elasticsearch.Inference.PutOpenaiResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + LocalJsonValue propTaskType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutOpenaiResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + InferenceId = propInferenceId.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value, + TaskType = propTaskType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutOpenaiResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenaiResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenaiResponse.g.cs index c620d9008a5..b5460cba600 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenaiResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenaiResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class PutOpenaiResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); - - public override Elastic.Clients.Elasticsearch.Inference.PutOpenaiResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue propService = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - LocalJsonValue propTaskType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propService.TryReadProperty(ref reader, options, PropService, null)) - { - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutOpenaiResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - InferenceId = propInferenceId.Value, - Service = propService.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value, - TaskType = propTaskType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutOpenaiResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutOpenaiResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutOpenaiResponseConverter))] public sealed partial class PutOpenaiResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutVoyageaiRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutVoyageaiRequest.Converters.g.cs new file mode 100644 index 00000000000..4778a83ef5d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutVoyageaiRequest.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutVoyageaiRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.PutVoyageaiRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropService)) + { + reader.Skip(); + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutVoyageaiRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutVoyageaiRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutVoyageaiRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutVoyageaiRequest.g.cs index 4e6660caefc..a7f47242827 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutVoyageaiRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutVoyageaiRequest.g.cs @@ -33,71 +33,6 @@ public sealed partial class PutVoyageaiRequestParameters : Elastic.Transport.Req public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutVoyageaiRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.PutVoyageaiRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropService)) - { - reader.Skip(); - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutVoyageaiRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutVoyageaiRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create a VoyageAI inference endpoint. @@ -109,7 +44,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutVoyageaiRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutVoyageaiRequestConverter))] public sealed partial class PutVoyageaiRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutVoyageaiResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutVoyageaiResponse.Converters.g.cs new file mode 100644 index 00000000000..ec096c1e581 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutVoyageaiResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutVoyageaiResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); + + public override Elastic.Clients.Elasticsearch.Inference.PutVoyageaiResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + LocalJsonValue propTaskType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutVoyageaiResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + InferenceId = propInferenceId.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value, + TaskType = propTaskType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutVoyageaiResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutVoyageaiResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutVoyageaiResponse.g.cs index 5fcaeac804d..061a54ac556 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutVoyageaiResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutVoyageaiResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class PutVoyageaiResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); - - public override Elastic.Clients.Elasticsearch.Inference.PutVoyageaiResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue propService = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - LocalJsonValue propTaskType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propService.TryReadProperty(ref reader, options, PropService, null)) - { - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutVoyageaiResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - InferenceId = propInferenceId.Value, - Service = propService.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value, - TaskType = propTaskType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutVoyageaiResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutVoyageaiResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutVoyageaiResponseConverter))] public sealed partial class PutVoyageaiResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxRequest.Converters.g.cs new file mode 100644 index 00000000000..1aa459bb559 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxRequest.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutWatsonxRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.PutWatsonxRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propServiceSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropService)) + { + reader.Skip(); + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutWatsonxRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ServiceSettings = propServiceSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutWatsonxRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxRequest.g.cs index ba62827b2ce..0ebd1e98e7f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxRequest.g.cs @@ -33,53 +33,6 @@ public sealed partial class PutWatsonxRequestParameters : Elastic.Transport.Requ public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutWatsonxRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.PutWatsonxRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propServiceSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropService)) - { - reader.Skip(); - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutWatsonxRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ServiceSettings = propServiceSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutWatsonxRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create a Watsonx inference endpoint. @@ -90,7 +43,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// You can provision one through the IBM catalog, the Cloud Databases CLI plug-in, the Cloud Databases API, or Terraform. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutWatsonxRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutWatsonxRequestConverter))] public sealed partial class PutWatsonxRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxResponse.Converters.g.cs new file mode 100644 index 00000000000..74433a54238 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class PutWatsonxResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); + + public override Elastic.Clients.Elasticsearch.Inference.PutWatsonxResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + LocalJsonValue propTaskType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.PutWatsonxResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + InferenceId = propInferenceId.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value, + TaskType = propTaskType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutWatsonxResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxResponse.g.cs index f67282ceeb5..831ecd98de8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class PutWatsonxResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); - - public override Elastic.Clients.Elasticsearch.Inference.PutWatsonxResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue propService = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - LocalJsonValue propTaskType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propService.TryReadProperty(ref reader, options, PropService, null)) - { - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.PutWatsonxResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - InferenceId = propInferenceId.Value, - Service = propService.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value, - TaskType = propTaskType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutWatsonxResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutWatsonxResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutWatsonxResponseConverter))] public sealed partial class PutWatsonxResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/RerankRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/RerankRequest.Converters.g.cs new file mode 100644 index 00000000000..d03673e8f98 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/RerankRequest.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class RerankRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropInput = System.Text.Json.JsonEncodedText.Encode("input"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.RerankRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propInput = default; + LocalJsonValue propQuery = default; + LocalJsonValue propTaskSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propInput.TryReadProperty(ref reader, options, PropInput, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.RerankRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Input = propInput.Value, + Query = propQuery.Value, + TaskSettings = propTaskSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.RerankRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropInput, value.Input, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/RerankRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/RerankRequest.g.cs index 4f882f593b8..edbf89430f9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/RerankRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/RerankRequest.g.cs @@ -33,69 +33,12 @@ public sealed partial class RerankRequestParameters : Elastic.Transport.RequestP public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class RerankRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropInput = System.Text.Json.JsonEncodedText.Encode("input"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.RerankRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propInput = default; - LocalJsonValue propQuery = default; - LocalJsonValue propTaskSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propInput.TryReadProperty(ref reader, options, PropInput, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.RerankRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Input = propInput.Value, - Query = propQuery.Value, - TaskSettings = propTaskSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.RerankRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropInput, value.Input, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteEndObject(); - } -} - /// /// /// Perform reranking inference on the service /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.RerankRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.RerankRequestConverter))] public sealed partial class RerankRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/RerankResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/RerankResponse.Converters.g.cs new file mode 100644 index 00000000000..4254a0d61e2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/RerankResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class RerankResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); + + public override Elastic.Clients.Elasticsearch.Inference.RerankResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propRerank = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRerank.TryReadProperty(ref reader, options, PropRerank, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.RerankResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Rerank = propRerank.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.RerankResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRerank, value.Rerank, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/RerankResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/RerankResponse.g.cs index bfeccc466aa..d1f5531b4e5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/RerankResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/RerankResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class RerankResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); - - public override Elastic.Clients.Elasticsearch.Inference.RerankResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propRerank = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRerank.TryReadProperty(ref reader, options, PropRerank, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.RerankResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Rerank = propRerank.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.RerankResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRerank, value.Rerank, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.RerankResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.RerankResponseConverter))] public sealed partial class RerankResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal RerankResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstruc public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Rerank { get; set; } +System.Collections.Generic.IReadOnlyCollection Rerank { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/SparseEmbeddingRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/SparseEmbeddingRequest.Converters.g.cs new file mode 100644 index 00000000000..35cdd190fb2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/SparseEmbeddingRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class SparseEmbeddingRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropInput = System.Text.Json.JsonEncodedText.Encode("input"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.SparseEmbeddingRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propInput = default; + LocalJsonValue propTaskSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propInput.TryReadProperty(ref reader, options, PropInput, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.SparseEmbeddingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Input = propInput.Value, + TaskSettings = propTaskSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.SparseEmbeddingRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropInput, value.Input, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/SparseEmbeddingRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/SparseEmbeddingRequest.g.cs index 38d619de99c..ee93b576c05 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/SparseEmbeddingRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/SparseEmbeddingRequest.g.cs @@ -33,60 +33,12 @@ public sealed partial class SparseEmbeddingRequestParameters : Elastic.Transport public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class SparseEmbeddingRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropInput = System.Text.Json.JsonEncodedText.Encode("input"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.SparseEmbeddingRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propInput = default; - LocalJsonValue propTaskSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propInput.TryReadProperty(ref reader, options, PropInput, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.SparseEmbeddingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Input = propInput.Value, - TaskSettings = propTaskSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.SparseEmbeddingRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropInput, value.Input, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteEndObject(); - } -} - /// /// /// Perform sparse embedding inference on the service /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.SparseEmbeddingRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.SparseEmbeddingRequestConverter))] public sealed partial class SparseEmbeddingRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/SparseEmbeddingResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/SparseEmbeddingResponse.Converters.g.cs new file mode 100644 index 00000000000..c829ea6e728 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/SparseEmbeddingResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class SparseEmbeddingResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSparseEmbedding = System.Text.Json.JsonEncodedText.Encode("sparse_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.SparseEmbeddingResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propSparseEmbedding = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSparseEmbedding.TryReadProperty(ref reader, options, PropSparseEmbedding, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.SparseEmbeddingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + SparseEmbedding = propSparseEmbedding.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.SparseEmbeddingResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSparseEmbedding, value.SparseEmbedding, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/SparseEmbeddingResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/SparseEmbeddingResponse.g.cs index 50a074e961a..4ea0afac710 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/SparseEmbeddingResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/SparseEmbeddingResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class SparseEmbeddingResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSparseEmbedding = System.Text.Json.JsonEncodedText.Encode("sparse_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.SparseEmbeddingResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propSparseEmbedding = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSparseEmbedding.TryReadProperty(ref reader, options, PropSparseEmbedding, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.SparseEmbeddingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - SparseEmbedding = propSparseEmbedding.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.SparseEmbeddingResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSparseEmbedding, value.SparseEmbedding, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.SparseEmbeddingResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.SparseEmbeddingResponseConverter))] public sealed partial class SparseEmbeddingResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal SparseEmbeddingResponse(Elastic.Clients.Elasticsearch.Serialization.Jso public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection SparseEmbedding { get; set; } +System.Collections.Generic.IReadOnlyCollection SparseEmbedding { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/StreamCompletionRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/StreamCompletionRequest.Converters.g.cs new file mode 100644 index 00000000000..b4e2fb87c4e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/StreamCompletionRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class StreamCompletionRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropInput = System.Text.Json.JsonEncodedText.Encode("input"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.StreamCompletionRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propInput = default; + LocalJsonValue propTaskSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propInput.TryReadProperty(ref reader, options, PropInput, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.StreamCompletionRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Input = propInput.Value, + TaskSettings = propTaskSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.StreamCompletionRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropInput, value.Input, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/StreamCompletionRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/StreamCompletionRequest.g.cs index d96dd5901fd..277404841e9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/StreamCompletionRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/StreamCompletionRequest.g.cs @@ -33,54 +33,6 @@ public sealed partial class StreamCompletionRequestParameters : Elastic.Transpor public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class StreamCompletionRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropInput = System.Text.Json.JsonEncodedText.Encode("input"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.StreamCompletionRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propInput = default; - LocalJsonValue propTaskSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propInput.TryReadProperty(ref reader, options, PropInput, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.StreamCompletionRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Input = propInput.Value, - TaskSettings = propTaskSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.StreamCompletionRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropInput, value.Input, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteEndObject(); - } -} - /// /// /// Perform streaming inference. @@ -94,7 +46,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// This API requires the monitor_inference cluster privilege (the built-in inference_admin and inference_user roles grant this privilege). You must use a client that supports streaming. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.StreamCompletionRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.StreamCompletionRequestConverter))] public sealed partial class StreamCompletionRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/TextEmbeddingRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/TextEmbeddingRequest.Converters.g.cs new file mode 100644 index 00000000000..32d3373803c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/TextEmbeddingRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TextEmbeddingRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropInput = System.Text.Json.JsonEncodedText.Encode("input"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.TextEmbeddingRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propInput = default; + LocalJsonValue propTaskSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propInput.TryReadProperty(ref reader, options, PropInput, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.TextEmbeddingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Input = propInput.Value, + TaskSettings = propTaskSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TextEmbeddingRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropInput, value.Input, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/TextEmbeddingRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/TextEmbeddingRequest.g.cs index da4ac9b4177..355b2df3754 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/TextEmbeddingRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/TextEmbeddingRequest.g.cs @@ -33,60 +33,12 @@ public sealed partial class TextEmbeddingRequestParameters : Elastic.Transport.R public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class TextEmbeddingRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropInput = System.Text.Json.JsonEncodedText.Encode("input"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.TextEmbeddingRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propInput = default; - LocalJsonValue propTaskSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propInput.TryReadProperty(ref reader, options, PropInput, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.TextEmbeddingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Input = propInput.Value, - TaskSettings = propTaskSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TextEmbeddingRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropInput, value.Input, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteEndObject(); - } -} - /// /// /// Perform text embedding inference on the service /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TextEmbeddingRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TextEmbeddingRequestConverter))] public sealed partial class TextEmbeddingRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/TextEmbeddingResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/TextEmbeddingResponse.Converters.g.cs new file mode 100644 index 00000000000..8c3fa57eda8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/TextEmbeddingResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TextEmbeddingResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Inference.TextEmbeddingResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Inference.TextEmbeddingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { InferenceResult = reader.ReadValue(options, null) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TextEmbeddingResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.InferenceResult, null); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/TextEmbeddingResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/TextEmbeddingResponse.g.cs index a659ad8e878..7d18278155d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/TextEmbeddingResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/TextEmbeddingResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class TextEmbeddingResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Inference.TextEmbeddingResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Inference.TextEmbeddingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { InferenceResult = reader.ReadValue(options, null) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TextEmbeddingResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.InferenceResult, null); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TextEmbeddingResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TextEmbeddingResponseConverter))] public sealed partial class TextEmbeddingResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/UpdateInferenceRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/UpdateInferenceRequest.Converters.g.cs new file mode 100644 index 00000000000..c40377193a0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/UpdateInferenceRequest.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class UpdateInferenceRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Inference.UpdateInferenceRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Inference.UpdateInferenceRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { InferenceConfig = reader.ReadValue(options, null) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.UpdateInferenceRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.InferenceConfig, null); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/UpdateInferenceRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/UpdateInferenceRequest.g.cs index 9a7385d69f8..d344fe064a6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/UpdateInferenceRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/UpdateInferenceRequest.g.cs @@ -27,19 +27,6 @@ public sealed partial class UpdateInferenceRequestParameters : Elastic.Transport { } -internal sealed partial class UpdateInferenceRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Inference.UpdateInferenceRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Inference.UpdateInferenceRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { InferenceConfig = reader.ReadValue(options, null) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.UpdateInferenceRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.InferenceConfig, null); - } -} - /// /// /// Update an inference endpoint. @@ -53,7 +40,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.UpdateInferenceRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.UpdateInferenceRequestConverter))] public sealed partial class UpdateInferenceRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/UpdateInferenceResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/UpdateInferenceResponse.Converters.g.cs new file mode 100644 index 00000000000..65569e5a625 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/UpdateInferenceResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class UpdateInferenceResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); + + public override Elastic.Clients.Elasticsearch.Inference.UpdateInferenceResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + LocalJsonValue propTaskType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.UpdateInferenceResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + InferenceId = propInferenceId.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value, + TaskType = propTaskType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.UpdateInferenceResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/UpdateInferenceResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/UpdateInferenceResponse.g.cs index 90751282092..d56778ec721 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/UpdateInferenceResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/UpdateInferenceResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class UpdateInferenceResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); - - public override Elastic.Clients.Elasticsearch.Inference.UpdateInferenceResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue propService = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - LocalJsonValue propTaskType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propService.TryReadProperty(ref reader, options, PropService, null)) - { - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.UpdateInferenceResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - InferenceId = propInferenceId.Value, - Service = propService.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value, - TaskType = propTaskType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.UpdateInferenceResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.UpdateInferenceResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.UpdateInferenceResponseConverter))] public sealed partial class UpdateInferenceResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/InfoRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/InfoRequest.Converters.g.cs new file mode 100644 index 00000000000..307021fb144 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/InfoRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class InfoRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.InfoRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.InfoRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.InfoRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/InfoRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/InfoRequest.g.cs index 673c763a733..be8a273f69e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/InfoRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/InfoRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class InfoRequestParameters : Elastic.Transport.RequestPar { } -internal sealed partial class InfoRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.InfoRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.InfoRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.InfoRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get cluster info. @@ -63,7 +34,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// ::: In Serverless, this API is retained for backward compatibility only. Some response fields, such as the version number, should be ignored. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.InfoRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.InfoRequestConverter))] public sealed partial class InfoRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/InfoResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/InfoResponse.Converters.g.cs new file mode 100644 index 00000000000..ee145c93c11 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/InfoResponse.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class InfoResponseConverter : 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 PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropTagline = System.Text.Json.JsonEncodedText.Encode("tagline"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.InfoResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClusterName = default; + LocalJsonValue propClusterUuid = default; + LocalJsonValue propName = default; + LocalJsonValue propTagline = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) + { + continue; + } + + if (propClusterUuid.TryReadProperty(ref reader, options, PropClusterUuid, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propTagline.TryReadProperty(ref reader, options, PropTagline, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.InfoResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClusterName = propClusterName.Value, + ClusterUuid = propClusterUuid.Value, + Name = propName.Value, + Tagline = propTagline.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.InfoResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); + writer.WriteProperty(options, PropClusterUuid, value.ClusterUuid, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropTagline, value.Tagline, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/InfoResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/InfoResponse.g.cs index 4489d9a351c..4817620c16a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/InfoResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/InfoResponse.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class InfoResponseConverter : 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 PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropTagline = System.Text.Json.JsonEncodedText.Encode("tagline"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.InfoResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClusterName = default; - LocalJsonValue propClusterUuid = default; - LocalJsonValue propName = default; - LocalJsonValue propTagline = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) - { - continue; - } - - if (propClusterUuid.TryReadProperty(ref reader, options, PropClusterUuid, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propTagline.TryReadProperty(ref reader, options, PropTagline, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.InfoResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClusterName = propClusterName.Value, - ClusterUuid = propClusterUuid.Value, - Name = propName.Value, - Tagline = propTagline.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.InfoResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); - writer.WriteProperty(options, PropClusterUuid, value.ClusterUuid, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropTagline, value.Tagline, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.InfoResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.InfoResponseConverter))] public sealed partial class InfoResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteGeoipDatabaseRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteGeoipDatabaseRequest.Converters.g.cs new file mode 100644 index 00000000000..050559fb07f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteGeoipDatabaseRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class DeleteGeoipDatabaseRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Ingest.DeleteGeoipDatabaseRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.DeleteGeoipDatabaseRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DeleteGeoipDatabaseRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteGeoipDatabaseRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteGeoipDatabaseRequest.g.cs index 48a35d59f0e..7521e69a230 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteGeoipDatabaseRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteGeoipDatabaseRequest.g.cs @@ -41,35 +41,6 @@ public sealed partial class DeleteGeoipDatabaseRequestParameters : Elastic.Trans public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class DeleteGeoipDatabaseRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Ingest.DeleteGeoipDatabaseRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.DeleteGeoipDatabaseRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DeleteGeoipDatabaseRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete GeoIP database configurations. @@ -78,7 +49,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Delete one or more IP geolocation database configurations. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.DeleteGeoipDatabaseRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.DeleteGeoipDatabaseRequestConverter))] public sealed partial class DeleteGeoipDatabaseRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteGeoipDatabaseResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteGeoipDatabaseResponse.Converters.g.cs new file mode 100644 index 00000000000..b15653aac16 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteGeoipDatabaseResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class DeleteGeoipDatabaseResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.Ingest.DeleteGeoipDatabaseResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.DeleteGeoipDatabaseResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DeleteGeoipDatabaseResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteGeoipDatabaseResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteGeoipDatabaseResponse.g.cs index 66d562febe0..31602956dde 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteGeoipDatabaseResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteGeoipDatabaseResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class DeleteGeoipDatabaseResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.Ingest.DeleteGeoipDatabaseResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.DeleteGeoipDatabaseResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DeleteGeoipDatabaseResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.DeleteGeoipDatabaseResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.DeleteGeoipDatabaseResponseConverter))] public sealed partial class DeleteGeoipDatabaseResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteIpLocationDatabaseRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteIpLocationDatabaseRequest.Converters.g.cs new file mode 100644 index 00000000000..d051293862d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteIpLocationDatabaseRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class DeleteIpLocationDatabaseRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Ingest.DeleteIpLocationDatabaseRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.DeleteIpLocationDatabaseRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DeleteIpLocationDatabaseRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteIpLocationDatabaseRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteIpLocationDatabaseRequest.g.cs index 1d6715f1df5..003e086393d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteIpLocationDatabaseRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteIpLocationDatabaseRequest.g.cs @@ -44,41 +44,12 @@ public sealed partial class DeleteIpLocationDatabaseRequestParameters : Elastic. public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class DeleteIpLocationDatabaseRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Ingest.DeleteIpLocationDatabaseRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.DeleteIpLocationDatabaseRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DeleteIpLocationDatabaseRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete IP geolocation database configurations. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.DeleteIpLocationDatabaseRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.DeleteIpLocationDatabaseRequestConverter))] public sealed partial class DeleteIpLocationDatabaseRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteIpLocationDatabaseResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteIpLocationDatabaseResponse.Converters.g.cs new file mode 100644 index 00000000000..5092551af7c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteIpLocationDatabaseResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class DeleteIpLocationDatabaseResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.Ingest.DeleteIpLocationDatabaseResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.DeleteIpLocationDatabaseResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DeleteIpLocationDatabaseResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteIpLocationDatabaseResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteIpLocationDatabaseResponse.g.cs index 3f782febdb2..a0784ae9cd8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteIpLocationDatabaseResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeleteIpLocationDatabaseResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class DeleteIpLocationDatabaseResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.Ingest.DeleteIpLocationDatabaseResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.DeleteIpLocationDatabaseResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DeleteIpLocationDatabaseResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.DeleteIpLocationDatabaseResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.DeleteIpLocationDatabaseResponseConverter))] public sealed partial class DeleteIpLocationDatabaseResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeletePipelineRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeletePipelineRequest.Converters.g.cs new file mode 100644 index 00000000000..c7ff8ae9a85 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeletePipelineRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class DeletePipelineRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Ingest.DeletePipelineRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.DeletePipelineRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DeletePipelineRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeletePipelineRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeletePipelineRequest.g.cs index 195b508f0b2..2a2e1e26ae4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeletePipelineRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeletePipelineRequest.g.cs @@ -42,42 +42,13 @@ public sealed partial class DeletePipelineRequestParameters : Elastic.Transport. public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class DeletePipelineRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Ingest.DeletePipelineRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.DeletePipelineRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DeletePipelineRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete pipelines. /// Delete one or more ingest pipelines. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.DeletePipelineRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.DeletePipelineRequestConverter))] public sealed partial class DeletePipelineRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeletePipelineResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeletePipelineResponse.Converters.g.cs new file mode 100644 index 00000000000..8a620ad03ad --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeletePipelineResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class DeletePipelineResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.Ingest.DeletePipelineResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.DeletePipelineResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DeletePipelineResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeletePipelineResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeletePipelineResponse.g.cs index 0841523b0d8..ea831d4ee43 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeletePipelineResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/DeletePipelineResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class DeletePipelineResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.Ingest.DeletePipelineResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.DeletePipelineResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DeletePipelineResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.DeletePipelineResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.DeletePipelineResponseConverter))] public sealed partial class DeletePipelineResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GeoIpStatsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GeoIpStatsRequest.Converters.g.cs new file mode 100644 index 00000000000..455aa8dffc8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GeoIpStatsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class GeoIpStatsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Ingest.GeoIpStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.GeoIpStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GeoIpStatsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GeoIpStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GeoIpStatsRequest.g.cs index dd0c52d2db0..70d1a139ec5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GeoIpStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GeoIpStatsRequest.g.cs @@ -27,42 +27,13 @@ public sealed partial class GeoIpStatsRequestParameters : Elastic.Transport.Requ { } -internal sealed partial class GeoIpStatsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Ingest.GeoIpStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.GeoIpStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GeoIpStatsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get GeoIP statistics. /// Get download statistics for GeoIP2 databases that are used with the GeoIP processor. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.GeoIpStatsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.GeoIpStatsRequestConverter))] public sealed partial class GeoIpStatsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GeoIpStatsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GeoIpStatsResponse.Converters.g.cs new file mode 100644 index 00000000000..424b058e345 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GeoIpStatsResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class GeoIpStatsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); + private static readonly System.Text.Json.JsonEncodedText PropStats = System.Text.Json.JsonEncodedText.Encode("stats"); + + public override Elastic.Clients.Elasticsearch.Ingest.GeoIpStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propNodes = default; + LocalJsonValue propStats = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propStats.TryReadProperty(ref reader, options, PropStats, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.GeoIpStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Nodes = propNodes.Value, + Stats = propStats.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GeoIpStatsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropStats, value.Stats, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GeoIpStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GeoIpStatsResponse.g.cs index 061d42be019..f933f1e6fb3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GeoIpStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GeoIpStatsResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class GeoIpStatsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); - private static readonly System.Text.Json.JsonEncodedText PropStats = System.Text.Json.JsonEncodedText.Encode("stats"); - - public override Elastic.Clients.Elasticsearch.Ingest.GeoIpStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propNodes = default; - LocalJsonValue propStats = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propStats.TryReadProperty(ref reader, options, PropStats, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.GeoIpStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Nodes = propNodes.Value, - Stats = propStats.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GeoIpStatsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropStats, value.Stats, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.GeoIpStatsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.GeoIpStatsResponseConverter))] public sealed partial class GeoIpStatsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetGeoipDatabaseRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetGeoipDatabaseRequest.Converters.g.cs new file mode 100644 index 00000000000..40672e98943 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetGeoipDatabaseRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class GetGeoipDatabaseRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Ingest.GetGeoipDatabaseRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.GetGeoipDatabaseRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GetGeoipDatabaseRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetGeoipDatabaseRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetGeoipDatabaseRequest.g.cs index 12267b905d7..85f68580a5d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetGeoipDatabaseRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetGeoipDatabaseRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class GetGeoipDatabaseRequestParameters : Elastic.Transpor { } -internal sealed partial class GetGeoipDatabaseRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Ingest.GetGeoipDatabaseRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.GetGeoipDatabaseRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GetGeoipDatabaseRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get GeoIP database configurations. @@ -64,7 +35,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Get information about one or more IP geolocation database configurations. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.GetGeoipDatabaseRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.GetGeoipDatabaseRequestConverter))] public sealed partial class GetGeoipDatabaseRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetGeoipDatabaseRequest(Elastic.Clients.Elasticsearch.Ids? id) : base(r => r.Optional("id", id)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetGeoipDatabaseResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetGeoipDatabaseResponse.Converters.g.cs new file mode 100644 index 00000000000..32b428f4ec5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetGeoipDatabaseResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class GetGeoipDatabaseResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDatabases = System.Text.Json.JsonEncodedText.Encode("databases"); + + public override Elastic.Clients.Elasticsearch.Ingest.GetGeoipDatabaseResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propDatabases = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDatabases.TryReadProperty(ref reader, options, PropDatabases, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.GetGeoipDatabaseResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Databases = propDatabases.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GetGeoipDatabaseResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDatabases, value.Databases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetGeoipDatabaseResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetGeoipDatabaseResponse.g.cs index 4a1186f2506..9df201f4e28 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetGeoipDatabaseResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetGeoipDatabaseResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class GetGeoipDatabaseResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDatabases = System.Text.Json.JsonEncodedText.Encode("databases"); - - public override Elastic.Clients.Elasticsearch.Ingest.GetGeoipDatabaseResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propDatabases = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDatabases.TryReadProperty(ref reader, options, PropDatabases, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.GetGeoipDatabaseResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Databases = propDatabases.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GetGeoipDatabaseResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDatabases, value.Databases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.GetGeoipDatabaseResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.GetGeoipDatabaseResponseConverter))] public sealed partial class GetGeoipDatabaseResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal GetGeoipDatabaseResponse(Elastic.Clients.Elasticsearch.Serialization.Js public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Databases { get; set; } +System.Collections.Generic.IReadOnlyCollection Databases { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetIpLocationDatabaseRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetIpLocationDatabaseRequest.Converters.g.cs new file mode 100644 index 00000000000..3026440f03b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetIpLocationDatabaseRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class GetIpLocationDatabaseRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Ingest.GetIpLocationDatabaseRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.GetIpLocationDatabaseRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GetIpLocationDatabaseRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetIpLocationDatabaseRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetIpLocationDatabaseRequest.g.cs index 38fb62ebac5..872aab7bf79 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetIpLocationDatabaseRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetIpLocationDatabaseRequest.g.cs @@ -27,41 +27,12 @@ public sealed partial class GetIpLocationDatabaseRequestParameters : Elastic.Tra { } -internal sealed partial class GetIpLocationDatabaseRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Ingest.GetIpLocationDatabaseRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.GetIpLocationDatabaseRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GetIpLocationDatabaseRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get IP geolocation database configurations. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.GetIpLocationDatabaseRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.GetIpLocationDatabaseRequestConverter))] public sealed partial class GetIpLocationDatabaseRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetIpLocationDatabaseRequest(Elastic.Clients.Elasticsearch.Ids? id) : base(r => r.Optional("id", id)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetIpLocationDatabaseResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetIpLocationDatabaseResponse.Converters.g.cs new file mode 100644 index 00000000000..dc8c7f86e24 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetIpLocationDatabaseResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class GetIpLocationDatabaseResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDatabases = System.Text.Json.JsonEncodedText.Encode("databases"); + + public override Elastic.Clients.Elasticsearch.Ingest.GetIpLocationDatabaseResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propDatabases = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDatabases.TryReadProperty(ref reader, options, PropDatabases, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.GetIpLocationDatabaseResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Databases = propDatabases.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GetIpLocationDatabaseResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDatabases, value.Databases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetIpLocationDatabaseResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetIpLocationDatabaseResponse.g.cs index 5f7d00560f6..3b6eb5605d4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetIpLocationDatabaseResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetIpLocationDatabaseResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class GetIpLocationDatabaseResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDatabases = System.Text.Json.JsonEncodedText.Encode("databases"); - - public override Elastic.Clients.Elasticsearch.Ingest.GetIpLocationDatabaseResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propDatabases = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDatabases.TryReadProperty(ref reader, options, PropDatabases, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.GetIpLocationDatabaseResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Databases = propDatabases.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GetIpLocationDatabaseResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDatabases, value.Databases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.GetIpLocationDatabaseResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.GetIpLocationDatabaseResponseConverter))] public sealed partial class GetIpLocationDatabaseResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal GetIpLocationDatabaseResponse(Elastic.Clients.Elasticsearch.Serializati public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Databases { get; set; } +System.Collections.Generic.IReadOnlyCollection Databases { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetPipelineRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetPipelineRequest.Converters.g.cs new file mode 100644 index 00000000000..c05ab0fe2e4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetPipelineRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class GetPipelineRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Ingest.GetPipelineRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.GetPipelineRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GetPipelineRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetPipelineRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetPipelineRequest.g.cs index f9bb11f8b94..64792501880 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetPipelineRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetPipelineRequest.g.cs @@ -41,35 +41,6 @@ public sealed partial class GetPipelineRequestParameters : Elastic.Transport.Req public bool? Summary { get => Q("summary"); set => Q("summary", value); } } -internal sealed partial class GetPipelineRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Ingest.GetPipelineRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.GetPipelineRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GetPipelineRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get pipelines. @@ -79,7 +50,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// This API returns a local reference of the pipeline. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.GetPipelineRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.GetPipelineRequestConverter))] public sealed partial class GetPipelineRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetPipelineRequest(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetPipelineResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetPipelineResponse.Converters.g.cs new file mode 100644 index 00000000000..2ffc36a4312 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetPipelineResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class GetPipelineResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Ingest.GetPipelineResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Ingest.GetPipelineResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Pipelines = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GetPipelineResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Pipelines, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetPipelineResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetPipelineResponse.g.cs index 7e194ae0645..7a52e01d7d1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetPipelineResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/GetPipelineResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class GetPipelineResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Ingest.GetPipelineResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Ingest.GetPipelineResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Pipelines = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GetPipelineResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Pipelines, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.GetPipelineResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.GetPipelineResponseConverter))] public sealed partial class GetPipelineResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/ProcessorGrokRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/ProcessorGrokRequest.Converters.g.cs new file mode 100644 index 00000000000..6f91369e2b5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/ProcessorGrokRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class ProcessorGrokRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Ingest.ProcessorGrokRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.ProcessorGrokRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.ProcessorGrokRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/ProcessorGrokRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/ProcessorGrokRequest.g.cs index ac196922f48..23ec1170f4c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/ProcessorGrokRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/ProcessorGrokRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class ProcessorGrokRequestParameters : Elastic.Transport.R { } -internal sealed partial class ProcessorGrokRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Ingest.ProcessorGrokRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.ProcessorGrokRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.ProcessorGrokRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Run a grok processor. @@ -64,7 +35,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// A grok pattern is like a regular expression that supports aliased expressions that can be reused. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.ProcessorGrokRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.ProcessorGrokRequestConverter))] public sealed partial class ProcessorGrokRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/ProcessorGrokResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/ProcessorGrokResponse.Converters.g.cs new file mode 100644 index 00000000000..f793899f00d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/ProcessorGrokResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class ProcessorGrokResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPatterns = System.Text.Json.JsonEncodedText.Encode("patterns"); + + public override Elastic.Clients.Elasticsearch.Ingest.ProcessorGrokResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propPatterns = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPatterns.TryReadProperty(ref reader, options, PropPatterns, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.ProcessorGrokResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Patterns = propPatterns.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.ProcessorGrokResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPatterns, value.Patterns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/ProcessorGrokResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/ProcessorGrokResponse.g.cs index a57811929bd..a69ff48b807 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/ProcessorGrokResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/ProcessorGrokResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class ProcessorGrokResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPatterns = System.Text.Json.JsonEncodedText.Encode("patterns"); - - public override Elastic.Clients.Elasticsearch.Ingest.ProcessorGrokResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propPatterns = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPatterns.TryReadProperty(ref reader, options, PropPatterns, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.ProcessorGrokResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Patterns = propPatterns.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.ProcessorGrokResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPatterns, value.Patterns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.ProcessorGrokResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.ProcessorGrokResponseConverter))] public sealed partial class ProcessorGrokResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal ProcessorGrokResponse(Elastic.Clients.Elasticsearch.Serialization.JsonC public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary Patterns { get; set; } +System.Collections.Generic.IReadOnlyDictionary Patterns { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutGeoipDatabaseRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutGeoipDatabaseRequest.Converters.g.cs new file mode 100644 index 00000000000..9c4df615ae4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutGeoipDatabaseRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class PutGeoipDatabaseRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxmind = System.Text.Json.JsonEncodedText.Encode("maxmind"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.Ingest.PutGeoipDatabaseRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxmind = default; + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxmind.TryReadProperty(ref reader, options, PropMaxmind, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.PutGeoipDatabaseRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Maxmind = propMaxmind.Value, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.PutGeoipDatabaseRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxmind, value.Maxmind, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutGeoipDatabaseRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutGeoipDatabaseRequest.g.cs index 19d0424aa7b..5948ffd6945 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutGeoipDatabaseRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutGeoipDatabaseRequest.g.cs @@ -41,54 +41,6 @@ public sealed partial class PutGeoipDatabaseRequestParameters : Elastic.Transpor public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutGeoipDatabaseRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxmind = System.Text.Json.JsonEncodedText.Encode("maxmind"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.Ingest.PutGeoipDatabaseRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxmind = default; - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxmind.TryReadProperty(ref reader, options, PropMaxmind, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.PutGeoipDatabaseRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Maxmind = propMaxmind.Value, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.PutGeoipDatabaseRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxmind, value.Maxmind, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create or update a GeoIP database configuration. @@ -97,7 +49,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Refer to the create or update IP geolocation database configuration API. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.PutGeoipDatabaseRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.PutGeoipDatabaseRequestConverter))] public sealed partial class PutGeoipDatabaseRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutGeoipDatabaseResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutGeoipDatabaseResponse.Converters.g.cs new file mode 100644 index 00000000000..a83a1c47d28 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutGeoipDatabaseResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class PutGeoipDatabaseResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.Ingest.PutGeoipDatabaseResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.PutGeoipDatabaseResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.PutGeoipDatabaseResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutGeoipDatabaseResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutGeoipDatabaseResponse.g.cs index 839310896bd..3dc3086bae2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutGeoipDatabaseResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutGeoipDatabaseResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class PutGeoipDatabaseResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.Ingest.PutGeoipDatabaseResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.PutGeoipDatabaseResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.PutGeoipDatabaseResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.PutGeoipDatabaseResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.PutGeoipDatabaseResponseConverter))] public sealed partial class PutGeoipDatabaseResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutIpLocationDatabaseRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutIpLocationDatabaseRequest.Converters.g.cs new file mode 100644 index 00000000000..f52c942f5b8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutIpLocationDatabaseRequest.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class PutIpLocationDatabaseRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Ingest.PutIpLocationDatabaseRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Ingest.PutIpLocationDatabaseRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Configuration = reader.ReadValue(options, null) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.PutIpLocationDatabaseRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Configuration, null); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutIpLocationDatabaseRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutIpLocationDatabaseRequest.g.cs index af03733e82f..61df7b25bec 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutIpLocationDatabaseRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutIpLocationDatabaseRequest.g.cs @@ -44,25 +44,12 @@ public sealed partial class PutIpLocationDatabaseRequestParameters : Elastic.Tra public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutIpLocationDatabaseRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Ingest.PutIpLocationDatabaseRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Ingest.PutIpLocationDatabaseRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Configuration = reader.ReadValue(options, null) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.PutIpLocationDatabaseRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Configuration, null); - } -} - /// /// /// Create or update an IP geolocation database configuration. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.PutIpLocationDatabaseRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.PutIpLocationDatabaseRequestConverter))] public sealed partial class PutIpLocationDatabaseRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutIpLocationDatabaseResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutIpLocationDatabaseResponse.Converters.g.cs new file mode 100644 index 00000000000..b213610138a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutIpLocationDatabaseResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class PutIpLocationDatabaseResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.Ingest.PutIpLocationDatabaseResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.PutIpLocationDatabaseResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.PutIpLocationDatabaseResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutIpLocationDatabaseResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutIpLocationDatabaseResponse.g.cs index 28307fa48eb..3c8aeb63f13 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutIpLocationDatabaseResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutIpLocationDatabaseResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class PutIpLocationDatabaseResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.Ingest.PutIpLocationDatabaseResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.PutIpLocationDatabaseResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.PutIpLocationDatabaseResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.PutIpLocationDatabaseResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.PutIpLocationDatabaseResponseConverter))] public sealed partial class PutIpLocationDatabaseResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutPipelineRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutPipelineRequest.Converters.g.cs new file mode 100644 index 00000000000..99a5d3cc65e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutPipelineRequest.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class PutPipelineRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDeprecated = System.Text.Json.JsonEncodedText.Encode("deprecated"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropProcessors = System.Text.Json.JsonEncodedText.Encode("processors"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Ingest.PutPipelineRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDeprecated = default; + LocalJsonValue propDescription = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue?> propProcessors = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDeprecated.TryReadProperty(ref reader, options, PropDeprecated, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propProcessors.TryReadProperty(ref reader, options, PropProcessors, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.PutPipelineRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Deprecated = propDeprecated.Value, + Description = propDescription.Value, + Meta = propMeta.Value, + OnFailure = propOnFailure.Value, + Processors = propProcessors.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.PutPipelineRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDeprecated, value.Deprecated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropProcessors, value.Processors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutPipelineRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutPipelineRequest.g.cs index 510e202956c..56129cd6b38 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutPipelineRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutPipelineRequest.g.cs @@ -47,97 +47,13 @@ public sealed partial class PutPipelineRequestParameters : Elastic.Transport.Req public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutPipelineRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDeprecated = System.Text.Json.JsonEncodedText.Encode("deprecated"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropProcessors = System.Text.Json.JsonEncodedText.Encode("processors"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Ingest.PutPipelineRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDeprecated = default; - LocalJsonValue propDescription = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue?> propProcessors = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDeprecated.TryReadProperty(ref reader, options, PropDeprecated, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propProcessors.TryReadProperty(ref reader, options, PropProcessors, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.PutPipelineRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Deprecated = propDeprecated.Value, - Description = propDescription.Value, - Meta = propMeta.Value, - OnFailure = propOnFailure.Value, - Processors = propProcessors.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.PutPipelineRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDeprecated, value.Deprecated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropProcessors, value.Processors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Create or update a pipeline. /// Changes made using this API take effect immediately. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.PutPipelineRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.PutPipelineRequestConverter))] public sealed partial class PutPipelineRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutPipelineResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutPipelineResponse.Converters.g.cs new file mode 100644 index 00000000000..6ad54714b0a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutPipelineResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class PutPipelineResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.Ingest.PutPipelineResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.PutPipelineResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.PutPipelineResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutPipelineResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutPipelineResponse.g.cs index 808d00f3c72..a21922c8795 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutPipelineResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/PutPipelineResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class PutPipelineResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.Ingest.PutPipelineResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.PutPipelineResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.PutPipelineResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.PutPipelineResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.PutPipelineResponseConverter))] public sealed partial class PutPipelineResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateRequest.Converters.g.cs new file mode 100644 index 00000000000..c85fad3a5b4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class SimulateRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); + private static readonly System.Text.Json.JsonEncodedText PropPipeline = System.Text.Json.JsonEncodedText.Encode("pipeline"); + + public override Elastic.Clients.Elasticsearch.Ingest.SimulateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propDocs = default; + LocalJsonValue propPipeline = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocs.TryReadProperty(ref reader, options, PropDocs, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propPipeline.TryReadProperty(ref reader, options, PropPipeline, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.SimulateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Docs = propDocs.Value, + Pipeline = propPipeline.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.SimulateRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocs, value.Docs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPipeline, value.Pipeline, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateRequest.g.cs index c598a8f68fc..867132da54d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateRequest.g.cs @@ -33,54 +33,6 @@ public sealed partial class SimulateRequestParameters : Elastic.Transport.Reques public bool? Verbose { get => Q("verbose"); set => Q("verbose", value); } } -internal sealed partial class SimulateRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); - private static readonly System.Text.Json.JsonEncodedText PropPipeline = System.Text.Json.JsonEncodedText.Encode("pipeline"); - - public override Elastic.Clients.Elasticsearch.Ingest.SimulateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propDocs = default; - LocalJsonValue propPipeline = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocs.TryReadProperty(ref reader, options, PropDocs, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propPipeline.TryReadProperty(ref reader, options, PropPipeline, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.SimulateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Docs = propDocs.Value, - Pipeline = propPipeline.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.SimulateRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocs, value.Docs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPipeline, value.Pipeline, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Simulate a pipeline. @@ -90,7 +42,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// You can either specify an existing pipeline to use with the provided documents or supply a pipeline definition in the body of the request. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.SimulateRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.SimulateRequestConverter))] public sealed partial class SimulateRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateResponse.Converters.g.cs new file mode 100644 index 00000000000..f7104fbc1d6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class SimulateResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); + + public override Elastic.Clients.Elasticsearch.Ingest.SimulateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propDocs = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocs.TryReadProperty(ref reader, options, PropDocs, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.SimulateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Docs = propDocs.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.SimulateResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocs, value.Docs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateResponse.g.cs index 689a8be4003..f17b9ba9666 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ingest/SimulateResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class SimulateResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); - - public override Elastic.Clients.Elasticsearch.Ingest.SimulateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propDocs = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocs.TryReadProperty(ref reader, options, PropDocs, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.SimulateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Docs = propDocs.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.SimulateResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocs, value.Docs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.SimulateResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.SimulateResponseConverter))] public sealed partial class SimulateResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal SimulateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstr public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Docs { get; set; } +System.Collections.Generic.IReadOnlyCollection Docs { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/DeleteLicenseRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/DeleteLicenseRequest.Converters.g.cs new file mode 100644 index 00000000000..ee50c199c62 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/DeleteLicenseRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement.Json; + +public sealed partial class DeleteLicenseRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.LicenseManagement.DeleteLicenseRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.LicenseManagement.DeleteLicenseRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.DeleteLicenseRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/DeleteLicenseRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/DeleteLicenseRequest.g.cs index 7d4577310f2..04f6a6e4772 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/DeleteLicenseRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/DeleteLicenseRequest.g.cs @@ -40,35 +40,6 @@ public sealed partial class DeleteLicenseRequestParameters : Elastic.Transport.R public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class DeleteLicenseRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.LicenseManagement.DeleteLicenseRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.LicenseManagement.DeleteLicenseRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.DeleteLicenseRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete the license. @@ -80,7 +51,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If the operator privileges feature is enabled, only operator users can use this API. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.DeleteLicenseRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.Json.DeleteLicenseRequestConverter))] public sealed partial class DeleteLicenseRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/DeleteLicenseResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/DeleteLicenseResponse.Converters.g.cs new file mode 100644 index 00000000000..5d9db4cfb2e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/DeleteLicenseResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement.Json; + +public sealed partial class DeleteLicenseResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.LicenseManagement.DeleteLicenseResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.LicenseManagement.DeleteLicenseResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.DeleteLicenseResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/DeleteLicenseResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/DeleteLicenseResponse.g.cs index cf21c68cf17..ad3621c62dd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/DeleteLicenseResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/DeleteLicenseResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.LicenseManagement; -internal sealed partial class DeleteLicenseResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.LicenseManagement.DeleteLicenseResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.LicenseManagement.DeleteLicenseResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.DeleteLicenseResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.DeleteLicenseResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.Json.DeleteLicenseResponseConverter))] public sealed partial class DeleteLicenseResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetBasicStatusRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetBasicStatusRequest.Converters.g.cs new file mode 100644 index 00000000000..7b6c0a72de6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetBasicStatusRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement.Json; + +public sealed partial class GetBasicStatusRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.LicenseManagement.GetBasicStatusRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.LicenseManagement.GetBasicStatusRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.GetBasicStatusRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetBasicStatusRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetBasicStatusRequest.g.cs index 13904166dec..d160801991c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetBasicStatusRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetBasicStatusRequest.g.cs @@ -27,41 +27,12 @@ public sealed partial class GetBasicStatusRequestParameters : Elastic.Transport. { } -internal sealed partial class GetBasicStatusRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.LicenseManagement.GetBasicStatusRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.LicenseManagement.GetBasicStatusRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.GetBasicStatusRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get the basic license status. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.GetBasicStatusRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.Json.GetBasicStatusRequestConverter))] public sealed partial class GetBasicStatusRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetBasicStatusResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetBasicStatusResponse.Converters.g.cs new file mode 100644 index 00000000000..77f668ac140 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetBasicStatusResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement.Json; + +public sealed partial class GetBasicStatusResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEligibleToStartBasic = System.Text.Json.JsonEncodedText.Encode("eligible_to_start_basic"); + + public override Elastic.Clients.Elasticsearch.LicenseManagement.GetBasicStatusResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEligibleToStartBasic = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEligibleToStartBasic.TryReadProperty(ref reader, options, PropEligibleToStartBasic, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.LicenseManagement.GetBasicStatusResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + EligibleToStartBasic = propEligibleToStartBasic.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.GetBasicStatusResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEligibleToStartBasic, value.EligibleToStartBasic, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetBasicStatusResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetBasicStatusResponse.g.cs index 2173602367e..013dbcd8f73 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetBasicStatusResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetBasicStatusResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.LicenseManagement; -internal sealed partial class GetBasicStatusResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEligibleToStartBasic = System.Text.Json.JsonEncodedText.Encode("eligible_to_start_basic"); - - public override Elastic.Clients.Elasticsearch.LicenseManagement.GetBasicStatusResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEligibleToStartBasic = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEligibleToStartBasic.TryReadProperty(ref reader, options, PropEligibleToStartBasic, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.LicenseManagement.GetBasicStatusResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - EligibleToStartBasic = propEligibleToStartBasic.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.GetBasicStatusResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEligibleToStartBasic, value.EligibleToStartBasic, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.GetBasicStatusResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.Json.GetBasicStatusResponseConverter))] public sealed partial class GetBasicStatusResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal GetBasicStatusResponse(Elastic.Clients.Elasticsearch.Serialization.Json public #if NET7_0_OR_GREATER - required +required #endif - bool EligibleToStartBasic { get; set; } +bool EligibleToStartBasic { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetLicenseRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetLicenseRequest.Converters.g.cs new file mode 100644 index 00000000000..1538b49f911 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetLicenseRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement.Json; + +public sealed partial class GetLicenseRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.LicenseManagement.GetLicenseRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.LicenseManagement.GetLicenseRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.GetLicenseRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetLicenseRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetLicenseRequest.g.cs index daa4591205f..fdc7399b709 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetLicenseRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetLicenseRequest.g.cs @@ -42,35 +42,6 @@ public sealed partial class GetLicenseRequestParameters : Elastic.Transport.Requ public bool? Local { get => Q("local"); set => Q("local", value); } } -internal sealed partial class GetLicenseRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.LicenseManagement.GetLicenseRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.LicenseManagement.GetLicenseRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.GetLicenseRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get license information. @@ -84,7 +55,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If you receive an unexpected 404 response after cluster startup, wait a short period and retry the request. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.GetLicenseRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.Json.GetLicenseRequestConverter))] public sealed partial class GetLicenseRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetLicenseResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetLicenseResponse.Converters.g.cs new file mode 100644 index 00000000000..cc350bab4cb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetLicenseResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement.Json; + +public sealed partial class GetLicenseResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLicense = System.Text.Json.JsonEncodedText.Encode("license"); + + public override Elastic.Clients.Elasticsearch.LicenseManagement.GetLicenseResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLicense = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLicense.TryReadProperty(ref reader, options, PropLicense, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.LicenseManagement.GetLicenseResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + License = propLicense.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.GetLicenseResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLicense, value.License, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetLicenseResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetLicenseResponse.g.cs index 064a44e24ee..5930ed39424 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetLicenseResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetLicenseResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.LicenseManagement; -internal sealed partial class GetLicenseResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLicense = System.Text.Json.JsonEncodedText.Encode("license"); - - public override Elastic.Clients.Elasticsearch.LicenseManagement.GetLicenseResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLicense = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLicense.TryReadProperty(ref reader, options, PropLicense, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.LicenseManagement.GetLicenseResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - License = propLicense.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.GetLicenseResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLicense, value.License, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.GetLicenseResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.Json.GetLicenseResponseConverter))] public sealed partial class GetLicenseResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal GetLicenseResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCons public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.LicenseManagement.LicenseInformation License { get; set; } +Elastic.Clients.Elasticsearch.LicenseManagement.LicenseInformation License { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetTrialStatusRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetTrialStatusRequest.Converters.g.cs new file mode 100644 index 00000000000..8c5e88776c9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetTrialStatusRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement.Json; + +public sealed partial class GetTrialStatusRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.LicenseManagement.GetTrialStatusRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.LicenseManagement.GetTrialStatusRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.GetTrialStatusRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetTrialStatusRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetTrialStatusRequest.g.cs index 5960d49a367..0beeaafd1cb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetTrialStatusRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetTrialStatusRequest.g.cs @@ -27,41 +27,12 @@ public sealed partial class GetTrialStatusRequestParameters : Elastic.Transport. { } -internal sealed partial class GetTrialStatusRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.LicenseManagement.GetTrialStatusRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.LicenseManagement.GetTrialStatusRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.GetTrialStatusRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get the trial status. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.GetTrialStatusRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.Json.GetTrialStatusRequestConverter))] public sealed partial class GetTrialStatusRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetTrialStatusResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetTrialStatusResponse.Converters.g.cs new file mode 100644 index 00000000000..f9b8369f88c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetTrialStatusResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement.Json; + +public sealed partial class GetTrialStatusResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEligibleToStartTrial = System.Text.Json.JsonEncodedText.Encode("eligible_to_start_trial"); + + public override Elastic.Clients.Elasticsearch.LicenseManagement.GetTrialStatusResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEligibleToStartTrial = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEligibleToStartTrial.TryReadProperty(ref reader, options, PropEligibleToStartTrial, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.LicenseManagement.GetTrialStatusResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + EligibleToStartTrial = propEligibleToStartTrial.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.GetTrialStatusResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEligibleToStartTrial, value.EligibleToStartTrial, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetTrialStatusResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetTrialStatusResponse.g.cs index 81539a570e4..0ecf2ed852b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetTrialStatusResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/GetTrialStatusResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.LicenseManagement; -internal sealed partial class GetTrialStatusResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEligibleToStartTrial = System.Text.Json.JsonEncodedText.Encode("eligible_to_start_trial"); - - public override Elastic.Clients.Elasticsearch.LicenseManagement.GetTrialStatusResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEligibleToStartTrial = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEligibleToStartTrial.TryReadProperty(ref reader, options, PropEligibleToStartTrial, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.LicenseManagement.GetTrialStatusResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - EligibleToStartTrial = propEligibleToStartTrial.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.GetTrialStatusResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEligibleToStartTrial, value.EligibleToStartTrial, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.GetTrialStatusResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.Json.GetTrialStatusResponseConverter))] public sealed partial class GetTrialStatusResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal GetTrialStatusResponse(Elastic.Clients.Elasticsearch.Serialization.Json public #if NET7_0_OR_GREATER - required +required #endif - bool EligibleToStartTrial { get; set; } +bool EligibleToStartTrial { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostRequest.Converters.g.cs new file mode 100644 index 00000000000..903dde66aff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement.Json; + +public sealed partial class PostRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLicense = System.Text.Json.JsonEncodedText.Encode("license"); + private static readonly System.Text.Json.JsonEncodedText PropLicenses = System.Text.Json.JsonEncodedText.Encode("licenses"); + + public override Elastic.Clients.Elasticsearch.LicenseManagement.PostRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLicense = default; + LocalJsonValue?> propLicenses = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLicense.TryReadProperty(ref reader, options, PropLicense, null)) + { + continue; + } + + if (propLicenses.TryReadProperty(ref reader, options, PropLicenses, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.LicenseManagement.PostRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + License = propLicense.Value, + Licenses = propLicenses.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.PostRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLicense, value.License, null, null); + writer.WriteProperty(options, PropLicenses, value.Licenses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostRequest.g.cs index b340a182809..c32052d5141 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostRequest.g.cs @@ -47,54 +47,6 @@ public sealed partial class PostRequestParameters : Elastic.Transport.RequestPar public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PostRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLicense = System.Text.Json.JsonEncodedText.Encode("license"); - private static readonly System.Text.Json.JsonEncodedText PropLicenses = System.Text.Json.JsonEncodedText.Encode("licenses"); - - public override Elastic.Clients.Elasticsearch.LicenseManagement.PostRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLicense = default; - LocalJsonValue?> propLicenses = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLicense.TryReadProperty(ref reader, options, PropLicense, null)) - { - continue; - } - - if (propLicenses.TryReadProperty(ref reader, options, PropLicenses, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.LicenseManagement.PostRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - License = propLicense.Value, - Licenses = propLicenses.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.PostRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLicense, value.License, null, null); - writer.WriteProperty(options, PropLicenses, value.Licenses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// Update the license. @@ -110,7 +62,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If the operator privileges feature is enabled, only operator users can use this API. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.PostRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.Json.PostRequestConverter))] public sealed partial class PostRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostResponse.Converters.g.cs new file mode 100644 index 00000000000..c94648473a4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement.Json; + +public sealed partial class PostResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledge = System.Text.Json.JsonEncodedText.Encode("acknowledge"); + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + private static readonly System.Text.Json.JsonEncodedText PropLicenseStatus = System.Text.Json.JsonEncodedText.Encode("license_status"); + + public override Elastic.Clients.Elasticsearch.LicenseManagement.PostResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledge = default; + LocalJsonValue propAcknowledged = default; + LocalJsonValue propLicenseStatus = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledge.TryReadProperty(ref reader, options, PropAcknowledge, null)) + { + continue; + } + + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (propLicenseStatus.TryReadProperty(ref reader, options, PropLicenseStatus, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.LicenseManagement.PostResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledge = propAcknowledge.Value, + Acknowledged = propAcknowledged.Value, + LicenseStatus = propLicenseStatus.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.PostResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledge, value.Acknowledge, null, null); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteProperty(options, PropLicenseStatus, value.LicenseStatus, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostResponse.g.cs index 6278d0d74b8..8bb44b61ebf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.LicenseManagement; -internal sealed partial class PostResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledge = System.Text.Json.JsonEncodedText.Encode("acknowledge"); - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - private static readonly System.Text.Json.JsonEncodedText PropLicenseStatus = System.Text.Json.JsonEncodedText.Encode("license_status"); - - public override Elastic.Clients.Elasticsearch.LicenseManagement.PostResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledge = default; - LocalJsonValue propAcknowledged = default; - LocalJsonValue propLicenseStatus = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledge.TryReadProperty(ref reader, options, PropAcknowledge, null)) - { - continue; - } - - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (propLicenseStatus.TryReadProperty(ref reader, options, PropLicenseStatus, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.LicenseManagement.PostResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledge = propAcknowledge.Value, - Acknowledged = propAcknowledged.Value, - LicenseStatus = propLicenseStatus.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.PostResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledge, value.Acknowledge, null, null); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteProperty(options, PropLicenseStatus, value.LicenseStatus, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.PostResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.Json.PostResponseConverter))] public sealed partial class PostResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -97,12 +40,12 @@ internal PostResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructo public Elastic.Clients.Elasticsearch.LicenseManagement.Acknowledgement? Acknowledge { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool Acknowledged { get; set; } +bool Acknowledged { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus LicenseStatus { get; set; } +Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus LicenseStatus { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartBasicRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartBasicRequest.Converters.g.cs new file mode 100644 index 00000000000..8780b59a710 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartBasicRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement.Json; + +public sealed partial class PostStartBasicRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.LicenseManagement.PostStartBasicRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.LicenseManagement.PostStartBasicRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.PostStartBasicRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartBasicRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartBasicRequest.g.cs index badc70f2eeb..1cdb541ba44 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartBasicRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartBasicRequest.g.cs @@ -47,35 +47,6 @@ public sealed partial class PostStartBasicRequestParameters : Elastic.Transport. public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PostStartBasicRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.LicenseManagement.PostStartBasicRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.LicenseManagement.PostStartBasicRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.PostStartBasicRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Start a basic license. @@ -94,7 +65,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// To check the status of your basic license, use the get basic license API. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.PostStartBasicRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.Json.PostStartBasicRequestConverter))] public sealed partial class PostStartBasicRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartBasicResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartBasicResponse.Converters.g.cs new file mode 100644 index 00000000000..e038ae9a1c7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartBasicResponse.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement.Json; + +public sealed partial class PostStartBasicResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledge = System.Text.Json.JsonEncodedText.Encode("acknowledge"); + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + private static readonly System.Text.Json.JsonEncodedText PropBasicWasStarted = System.Text.Json.JsonEncodedText.Encode("basic_was_started"); + private static readonly System.Text.Json.JsonEncodedText PropErrorMessage = System.Text.Json.JsonEncodedText.Encode("error_message"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.LicenseManagement.PostStartBasicResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>?> propAcknowledge = default; + LocalJsonValue propAcknowledged = default; + LocalJsonValue propBasicWasStarted = default; + LocalJsonValue propErrorMessage = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledge.TryReadProperty(ref reader, options, PropAcknowledge, static System.Collections.Generic.IReadOnlyDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!))) + { + continue; + } + + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (propBasicWasStarted.TryReadProperty(ref reader, options, PropBasicWasStarted, null)) + { + continue; + } + + if (propErrorMessage.TryReadProperty(ref reader, options, PropErrorMessage, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, static Elastic.Clients.Elasticsearch.LicenseManagement.LicenseType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.LicenseManagement.PostStartBasicResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledge = propAcknowledge.Value, + Acknowledged = propAcknowledged.Value, + BasicWasStarted = propBasicWasStarted.Value, + ErrorMessage = propErrorMessage.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.PostStartBasicResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledge, value.Acknowledge, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteProperty(options, PropBasicWasStarted, value.BasicWasStarted, null, null); + writer.WriteProperty(options, PropErrorMessage, value.ErrorMessage, null, null); + writer.WriteProperty(options, PropType, value.Type, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.LicenseManagement.LicenseType? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartBasicResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartBasicResponse.g.cs index 8350f33c90d..e25f850d04e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartBasicResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartBasicResponse.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.LicenseManagement; -internal sealed partial class PostStartBasicResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledge = System.Text.Json.JsonEncodedText.Encode("acknowledge"); - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - private static readonly System.Text.Json.JsonEncodedText PropBasicWasStarted = System.Text.Json.JsonEncodedText.Encode("basic_was_started"); - private static readonly System.Text.Json.JsonEncodedText PropErrorMessage = System.Text.Json.JsonEncodedText.Encode("error_message"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.LicenseManagement.PostStartBasicResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>?> propAcknowledge = default; - LocalJsonValue propAcknowledged = default; - LocalJsonValue propBasicWasStarted = default; - LocalJsonValue propErrorMessage = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledge.TryReadProperty(ref reader, options, PropAcknowledge, static System.Collections.Generic.IReadOnlyDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!))) - { - continue; - } - - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (propBasicWasStarted.TryReadProperty(ref reader, options, PropBasicWasStarted, null)) - { - continue; - } - - if (propErrorMessage.TryReadProperty(ref reader, options, PropErrorMessage, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, static Elastic.Clients.Elasticsearch.LicenseManagement.LicenseType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.LicenseManagement.PostStartBasicResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledge = propAcknowledge.Value, - Acknowledged = propAcknowledged.Value, - BasicWasStarted = propBasicWasStarted.Value, - ErrorMessage = propErrorMessage.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.PostStartBasicResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledge, value.Acknowledge, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteProperty(options, PropBasicWasStarted, value.BasicWasStarted, null, null); - writer.WriteProperty(options, PropErrorMessage, value.ErrorMessage, null, null); - writer.WriteProperty(options, PropType, value.Type, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.LicenseManagement.LicenseType? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.PostStartBasicResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.Json.PostStartBasicResponseConverter))] public sealed partial class PostStartBasicResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -115,14 +40,14 @@ internal PostStartBasicResponse(Elastic.Clients.Elasticsearch.Serialization.Json public System.Collections.Generic.IReadOnlyDictionary>? Acknowledge { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool Acknowledged { get; set; } +bool Acknowledged { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool BasicWasStarted { get; set; } +bool BasicWasStarted { get; set; } public string? ErrorMessage { get; set; } public Elastic.Clients.Elasticsearch.LicenseManagement.LicenseType? Type { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartTrialRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartTrialRequest.Converters.g.cs new file mode 100644 index 00000000000..915d5e45c75 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartTrialRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement.Json; + +public sealed partial class PostStartTrialRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.LicenseManagement.PostStartTrialRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.LicenseManagement.PostStartTrialRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.PostStartTrialRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartTrialRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartTrialRequest.g.cs index ce773abcd14..01198988b09 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartTrialRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartTrialRequest.g.cs @@ -47,35 +47,6 @@ public sealed partial class PostStartTrialRequestParameters : Elastic.Transport. public string? Type { get => Q("type"); set => Q("type", value); } } -internal sealed partial class PostStartTrialRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.LicenseManagement.PostStartTrialRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.LicenseManagement.PostStartTrialRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.PostStartTrialRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Start a trial. @@ -89,7 +60,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// To check the status of your trial, use the get trial status API. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.PostStartTrialRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.Json.PostStartTrialRequestConverter))] public sealed partial class PostStartTrialRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartTrialResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartTrialResponse.Converters.g.cs new file mode 100644 index 00000000000..f959dc5304d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartTrialResponse.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement.Json; + +public sealed partial class PostStartTrialResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + private static readonly System.Text.Json.JsonEncodedText PropErrorMessage = System.Text.Json.JsonEncodedText.Encode("error_message"); + private static readonly System.Text.Json.JsonEncodedText PropTrialWasStarted = System.Text.Json.JsonEncodedText.Encode("trial_was_started"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.LicenseManagement.PostStartTrialResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + LocalJsonValue propErrorMessage = default; + LocalJsonValue propTrialWasStarted = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (propErrorMessage.TryReadProperty(ref reader, options, PropErrorMessage, null)) + { + continue; + } + + if (propTrialWasStarted.TryReadProperty(ref reader, options, PropTrialWasStarted, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, static Elastic.Clients.Elasticsearch.LicenseManagement.LicenseType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.LicenseManagement.PostStartTrialResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value, + ErrorMessage = propErrorMessage.Value, + TrialWasStarted = propTrialWasStarted.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.PostStartTrialResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteProperty(options, PropErrorMessage, value.ErrorMessage, null, null); + writer.WriteProperty(options, PropTrialWasStarted, value.TrialWasStarted, null, null); + writer.WriteProperty(options, PropType, value.Type, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.LicenseManagement.LicenseType? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartTrialResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartTrialResponse.g.cs index a0b2f6ee026..bdab8a710a5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartTrialResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartTrialResponse.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.LicenseManagement; -internal sealed partial class PostStartTrialResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - private static readonly System.Text.Json.JsonEncodedText PropErrorMessage = System.Text.Json.JsonEncodedText.Encode("error_message"); - private static readonly System.Text.Json.JsonEncodedText PropTrialWasStarted = System.Text.Json.JsonEncodedText.Encode("trial_was_started"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.LicenseManagement.PostStartTrialResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - LocalJsonValue propErrorMessage = default; - LocalJsonValue propTrialWasStarted = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (propErrorMessage.TryReadProperty(ref reader, options, PropErrorMessage, null)) - { - continue; - } - - if (propTrialWasStarted.TryReadProperty(ref reader, options, PropTrialWasStarted, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, static Elastic.Clients.Elasticsearch.LicenseManagement.LicenseType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.LicenseManagement.PostStartTrialResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value, - ErrorMessage = propErrorMessage.Value, - TrialWasStarted = propTrialWasStarted.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.PostStartTrialResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteProperty(options, PropErrorMessage, value.ErrorMessage, null, null); - writer.WriteProperty(options, PropTrialWasStarted, value.TrialWasStarted, null, null); - writer.WriteProperty(options, PropType, value.Type, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.LicenseManagement.LicenseType? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.PostStartTrialResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.Json.PostStartTrialResponseConverter))] public sealed partial class PostStartTrialResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -105,14 +39,14 @@ internal PostStartTrialResponse(Elastic.Clients.Elasticsearch.Serialization.Json public #if NET7_0_OR_GREATER - required +required #endif - bool Acknowledged { get; set; } +bool Acknowledged { get; set; } public string? ErrorMessage { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool TrialWasStarted { get; set; } +bool TrialWasStarted { get; set; } public Elastic.Clients.Elasticsearch.LicenseManagement.LicenseType? Type { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheRequest.Converters.g.cs new file mode 100644 index 00000000000..dbbf022f49f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ClearTrainedModelDeploymentCacheRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.ClearTrainedModelDeploymentCacheRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.ClearTrainedModelDeploymentCacheRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ClearTrainedModelDeploymentCacheRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheRequest.g.cs index d480598c713..3565d12a60d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class ClearTrainedModelDeploymentCacheRequestParameters : { } -internal sealed partial class ClearTrainedModelDeploymentCacheRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.ClearTrainedModelDeploymentCacheRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.ClearTrainedModelDeploymentCacheRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ClearTrainedModelDeploymentCacheRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Clear trained model deployment cache. @@ -67,7 +38,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Calling this API clears the caches without restarting the deployment. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ClearTrainedModelDeploymentCacheRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ClearTrainedModelDeploymentCacheRequestConverter))] public sealed partial class ClearTrainedModelDeploymentCacheRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheResponse.Converters.g.cs new file mode 100644 index 00000000000..b0262ce8d9f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ClearTrainedModelDeploymentCacheResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCleared = System.Text.Json.JsonEncodedText.Encode("cleared"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.ClearTrainedModelDeploymentCacheResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCleared = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCleared.TryReadProperty(ref reader, options, PropCleared, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.ClearTrainedModelDeploymentCacheResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Cleared = propCleared.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ClearTrainedModelDeploymentCacheResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCleared, value.Cleared, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheResponse.g.cs index 54bb57e516a..2b8a50505f8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ClearTrainedModelDeploymentCacheResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class ClearTrainedModelDeploymentCacheResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCleared = System.Text.Json.JsonEncodedText.Encode("cleared"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.ClearTrainedModelDeploymentCacheResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCleared = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCleared.TryReadProperty(ref reader, options, PropCleared, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.ClearTrainedModelDeploymentCacheResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Cleared = propCleared.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ClearTrainedModelDeploymentCacheResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCleared, value.Cleared, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ClearTrainedModelDeploymentCacheResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ClearTrainedModelDeploymentCacheResponseConverter))] public sealed partial class ClearTrainedModelDeploymentCacheResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal ClearTrainedModelDeploymentCacheResponse(Elastic.Clients.Elasticsearch. public #if NET7_0_OR_GREATER - required +required #endif - bool Cleared { get; set; } +bool Cleared { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/CloseJobRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/CloseJobRequest.Converters.g.cs new file mode 100644 index 00000000000..ccc7af0e447 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/CloseJobRequest.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class CloseJobRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowNoMatch = System.Text.Json.JsonEncodedText.Encode("allow_no_match"); + private static readonly System.Text.Json.JsonEncodedText PropForce = System.Text.Json.JsonEncodedText.Encode("force"); + private static readonly System.Text.Json.JsonEncodedText PropTimeout = System.Text.Json.JsonEncodedText.Encode("timeout"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.CloseJobRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowNoMatch = default; + LocalJsonValue propForce = default; + LocalJsonValue propTimeout = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowNoMatch.TryReadProperty(ref reader, options, PropAllowNoMatch, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propForce.TryReadProperty(ref reader, options, PropForce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeout.TryReadProperty(ref reader, options, PropTimeout, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.CloseJobRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowNoMatch = propAllowNoMatch.Value, + Force = propForce.Value, + Timeout = propTimeout.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.CloseJobRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowNoMatch, value.AllowNoMatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropForce, value.Force, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeout, value.Timeout, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/CloseJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/CloseJobRequest.g.cs index d8faf8a4b68..324411af00d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/CloseJobRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/CloseJobRequest.g.cs @@ -27,63 +27,6 @@ public sealed partial class CloseJobRequestParameters : Elastic.Transport.Reques { } -internal sealed partial class CloseJobRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowNoMatch = System.Text.Json.JsonEncodedText.Encode("allow_no_match"); - private static readonly System.Text.Json.JsonEncodedText PropForce = System.Text.Json.JsonEncodedText.Encode("force"); - private static readonly System.Text.Json.JsonEncodedText PropTimeout = System.Text.Json.JsonEncodedText.Encode("timeout"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.CloseJobRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowNoMatch = default; - LocalJsonValue propForce = default; - LocalJsonValue propTimeout = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowNoMatch.TryReadProperty(ref reader, options, PropAllowNoMatch, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propForce.TryReadProperty(ref reader, options, PropForce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeout.TryReadProperty(ref reader, options, PropTimeout, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.CloseJobRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowNoMatch = propAllowNoMatch.Value, - Force = propForce.Value, - Timeout = propTimeout.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.CloseJobRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowNoMatch, value.AllowNoMatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropForce, value.Force, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeout, value.Timeout, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Close anomaly detection jobs. @@ -95,7 +38,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// When a datafeed that has a specified end date stops, it automatically closes its associated job. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.CloseJobRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.CloseJobRequestConverter))] public sealed partial class CloseJobRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/CloseJobResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/CloseJobResponse.Converters.g.cs new file mode 100644 index 00000000000..dd5625d3be2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/CloseJobResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class CloseJobResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClosed = System.Text.Json.JsonEncodedText.Encode("closed"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.CloseJobResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClosed = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClosed.TryReadProperty(ref reader, options, PropClosed, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.CloseJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Closed = propClosed.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.CloseJobResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClosed, value.Closed, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/CloseJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/CloseJobResponse.g.cs index 9f967d831ac..3dbf5ee4e57 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/CloseJobResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/CloseJobResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class CloseJobResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClosed = System.Text.Json.JsonEncodedText.Encode("closed"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.CloseJobResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClosed = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClosed.TryReadProperty(ref reader, options, PropClosed, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.CloseJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Closed = propClosed.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.CloseJobResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClosed, value.Closed, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.CloseJobResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.CloseJobResponseConverter))] public sealed partial class CloseJobResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal CloseJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstr public #if NET7_0_OR_GREATER - required +required #endif - bool Closed { get; set; } +bool Closed { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarEventRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarEventRequest.Converters.g.cs new file mode 100644 index 00000000000..a622c98b353 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarEventRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DeleteCalendarEventRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarEventRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarEventRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarEventRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarEventRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarEventRequest.g.cs index 072f7da9e2e..752c8af5593 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarEventRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarEventRequest.g.cs @@ -27,41 +27,12 @@ public sealed partial class DeleteCalendarEventRequestParameters : Elastic.Trans { } -internal sealed partial class DeleteCalendarEventRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarEventRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarEventRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarEventRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete events from a calendar. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarEventRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DeleteCalendarEventRequestConverter))] public sealed partial class DeleteCalendarEventRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarEventResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarEventResponse.Converters.g.cs new file mode 100644 index 00000000000..3010af1b0b0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarEventResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DeleteCalendarEventResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarEventResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarEventResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarEventResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarEventResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarEventResponse.g.cs index 87017b3c105..4c17016c227 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarEventResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarEventResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DeleteCalendarEventResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarEventResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarEventResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarEventResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarEventResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DeleteCalendarEventResponseConverter))] public sealed partial class DeleteCalendarEventResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarJobRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarJobRequest.Converters.g.cs new file mode 100644 index 00000000000..1c4ef1a8ebc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarJobRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DeleteCalendarJobRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarJobRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarJobRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarJobRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarJobRequest.g.cs index ccfa853a64f..2678ce2e0ea 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarJobRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarJobRequest.g.cs @@ -27,41 +27,12 @@ public sealed partial class DeleteCalendarJobRequestParameters : Elastic.Transpo { } -internal sealed partial class DeleteCalendarJobRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarJobRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarJobRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarJobRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete anomaly jobs from a calendar. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarJobRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DeleteCalendarJobRequestConverter))] public sealed partial class DeleteCalendarJobRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarJobResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarJobResponse.Converters.g.cs new file mode 100644 index 00000000000..255a93790d4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarJobResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DeleteCalendarJobResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCalendarId = System.Text.Json.JsonEncodedText.Encode("calendar_id"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropJobIds = System.Text.Json.JsonEncodedText.Encode("job_ids"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarJobResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCalendarId = default; + LocalJsonValue propDescription = default; + LocalJsonValue> propJobIds = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCalendarId.TryReadProperty(ref reader, options, PropCalendarId, null)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propJobIds.TryReadProperty(ref reader, options, PropJobIds, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CalendarId = propCalendarId.Value, + Description = propDescription.Value, + JobIds = propJobIds.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarJobResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCalendarId, value.CalendarId, null, null); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropJobIds, value.JobIds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarJobResponse.g.cs index fd62674ba97..6ed3b914b1d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarJobResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarJobResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DeleteCalendarJobResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCalendarId = System.Text.Json.JsonEncodedText.Encode("calendar_id"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropJobIds = System.Text.Json.JsonEncodedText.Encode("job_ids"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarJobResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCalendarId = default; - LocalJsonValue propDescription = default; - LocalJsonValue> propJobIds = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCalendarId.TryReadProperty(ref reader, options, PropCalendarId, null)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propJobIds.TryReadProperty(ref reader, options, PropJobIds, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CalendarId = propCalendarId.Value, - Description = propDescription.Value, - JobIds = propJobIds.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarJobResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCalendarId, value.CalendarId, null, null); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropJobIds, value.JobIds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarJobResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DeleteCalendarJobResponseConverter))] public sealed partial class DeleteCalendarJobResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarRequest.Converters.g.cs new file mode 100644 index 00000000000..6cf7927dd9b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DeleteCalendarRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarRequest.g.cs index b2c8fea57dd..1215b5de5b9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class DeleteCalendarRequestParameters : Elastic.Transport. { } -internal sealed partial class DeleteCalendarRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete a calendar. @@ -64,7 +35,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Remove all scheduled events from a calendar, then delete it. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DeleteCalendarRequestConverter))] public sealed partial class DeleteCalendarRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarResponse.Converters.g.cs new file mode 100644 index 00000000000..f64a7fc457e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DeleteCalendarResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarResponse.g.cs index acac8c1e2a8..e54453c463d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteCalendarResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DeleteCalendarResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DeleteCalendarResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DeleteCalendarResponseConverter))] public sealed partial class DeleteCalendarResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsRequest.Converters.g.cs new file mode 100644 index 00000000000..9c55fa364c9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DeleteDataFrameAnalyticsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteDataFrameAnalyticsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteDataFrameAnalyticsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsRequest.g.cs index 959d8473ea9..14ce471322b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsRequest.g.cs @@ -40,41 +40,12 @@ public sealed partial class DeleteDataFrameAnalyticsRequestParameters : Elastic. public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class DeleteDataFrameAnalyticsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteDataFrameAnalyticsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteDataFrameAnalyticsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete a data frame analytics job. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DeleteDataFrameAnalyticsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DeleteDataFrameAnalyticsRequestConverter))] public sealed partial class DeleteDataFrameAnalyticsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsResponse.Converters.g.cs new file mode 100644 index 00000000000..15e6a1ac9a1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DeleteDataFrameAnalyticsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteDataFrameAnalyticsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteDataFrameAnalyticsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteDataFrameAnalyticsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsResponse.g.cs index 33024ea9dea..ba46d4a5f16 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDataFrameAnalyticsResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DeleteDataFrameAnalyticsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteDataFrameAnalyticsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteDataFrameAnalyticsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteDataFrameAnalyticsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DeleteDataFrameAnalyticsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DeleteDataFrameAnalyticsResponseConverter))] public sealed partial class DeleteDataFrameAnalyticsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDatafeedRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDatafeedRequest.Converters.g.cs new file mode 100644 index 00000000000..a23b695eb14 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDatafeedRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DeleteDatafeedRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteDatafeedRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteDatafeedRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteDatafeedRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDatafeedRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDatafeedRequest.g.cs index 00f0422d278..6e1045d4c04 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDatafeedRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDatafeedRequest.g.cs @@ -34,41 +34,12 @@ public sealed partial class DeleteDatafeedRequestParameters : Elastic.Transport. public bool? Force { get => Q("force"); set => Q("force", value); } } -internal sealed partial class DeleteDatafeedRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteDatafeedRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteDatafeedRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteDatafeedRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete a datafeed. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DeleteDatafeedRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DeleteDatafeedRequestConverter))] public sealed partial class DeleteDatafeedRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDatafeedResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDatafeedResponse.Converters.g.cs new file mode 100644 index 00000000000..6161f72b629 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDatafeedResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DeleteDatafeedResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteDatafeedResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteDatafeedResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteDatafeedResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDatafeedResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDatafeedResponse.g.cs index c92c468bfca..8708e3cc304 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDatafeedResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteDatafeedResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DeleteDatafeedResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteDatafeedResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteDatafeedResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteDatafeedResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DeleteDatafeedResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DeleteDatafeedResponseConverter))] public sealed partial class DeleteDatafeedResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteExpiredDataRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteExpiredDataRequest.Converters.g.cs new file mode 100644 index 00000000000..1cabb41396e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteExpiredDataRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DeleteExpiredDataRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRequestsPerSecond = System.Text.Json.JsonEncodedText.Encode("requests_per_second"); + private static readonly System.Text.Json.JsonEncodedText PropTimeout = System.Text.Json.JsonEncodedText.Encode("timeout"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteExpiredDataRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propRequestsPerSecond = default; + LocalJsonValue propTimeout = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRequestsPerSecond.TryReadProperty(ref reader, options, PropRequestsPerSecond, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeout.TryReadProperty(ref reader, options, PropTimeout, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteExpiredDataRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + RequestsPerSecond = propRequestsPerSecond.Value, + Timeout = propTimeout.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteExpiredDataRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRequestsPerSecond, value.RequestsPerSecond, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeout, value.Timeout, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteExpiredDataRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteExpiredDataRequest.g.cs index a10b531ead9..d710f0763cd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteExpiredDataRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteExpiredDataRequest.g.cs @@ -27,54 +27,6 @@ public sealed partial class DeleteExpiredDataRequestParameters : Elastic.Transpo { } -internal sealed partial class DeleteExpiredDataRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRequestsPerSecond = System.Text.Json.JsonEncodedText.Encode("requests_per_second"); - private static readonly System.Text.Json.JsonEncodedText PropTimeout = System.Text.Json.JsonEncodedText.Encode("timeout"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteExpiredDataRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propRequestsPerSecond = default; - LocalJsonValue propTimeout = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRequestsPerSecond.TryReadProperty(ref reader, options, PropRequestsPerSecond, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeout.TryReadProperty(ref reader, options, PropTimeout, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteExpiredDataRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - RequestsPerSecond = propRequestsPerSecond.Value, - Timeout = propTimeout.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteExpiredDataRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRequestsPerSecond, value.RequestsPerSecond, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeout, value.Timeout, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Delete expired ML data. @@ -90,7 +42,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// <job_id>. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DeleteExpiredDataRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DeleteExpiredDataRequestConverter))] public sealed partial class DeleteExpiredDataRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public DeleteExpiredDataRequest(Elastic.Clients.Elasticsearch.Id? jobId) : base(r => r.Optional("job_id", jobId)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteExpiredDataResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteExpiredDataResponse.Converters.g.cs new file mode 100644 index 00000000000..f16bb6c1244 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteExpiredDataResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DeleteExpiredDataResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDeleted = System.Text.Json.JsonEncodedText.Encode("deleted"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteExpiredDataResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDeleted = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDeleted.TryReadProperty(ref reader, options, PropDeleted, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteExpiredDataResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Deleted = propDeleted.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteExpiredDataResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDeleted, value.Deleted, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteExpiredDataResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteExpiredDataResponse.g.cs index 460dedef68e..8ac65980d84 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteExpiredDataResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteExpiredDataResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DeleteExpiredDataResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDeleted = System.Text.Json.JsonEncodedText.Encode("deleted"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteExpiredDataResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDeleted = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDeleted.TryReadProperty(ref reader, options, PropDeleted, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteExpiredDataResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Deleted = propDeleted.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteExpiredDataResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDeleted, value.Deleted, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DeleteExpiredDataResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DeleteExpiredDataResponseConverter))] public sealed partial class DeleteExpiredDataResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal DeleteExpiredDataResponse(Elastic.Clients.Elasticsearch.Serialization.J public #if NET7_0_OR_GREATER - required +required #endif - bool Deleted { get; set; } +bool Deleted { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteFilterRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteFilterRequest.Converters.g.cs new file mode 100644 index 00000000000..f9b346a618b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteFilterRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DeleteFilterRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteFilterRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteFilterRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteFilterRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteFilterRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteFilterRequest.g.cs index f001d8e185f..c894cc9d14e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteFilterRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteFilterRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class DeleteFilterRequestParameters : Elastic.Transport.Re { } -internal sealed partial class DeleteFilterRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteFilterRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteFilterRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteFilterRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete a filter. @@ -65,7 +36,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// filter. You must update or delete the job before you can delete the filter. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DeleteFilterRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DeleteFilterRequestConverter))] public sealed partial class DeleteFilterRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteFilterResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteFilterResponse.Converters.g.cs new file mode 100644 index 00000000000..b08b72fbab4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteFilterResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DeleteFilterResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteFilterResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteFilterResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteFilterResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteFilterResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteFilterResponse.g.cs index 6bef5f55117..d64be7b7eab 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteFilterResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteFilterResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DeleteFilterResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteFilterResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteFilterResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteFilterResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DeleteFilterResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DeleteFilterResponseConverter))] public sealed partial class DeleteFilterResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteForecastRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteForecastRequest.Converters.g.cs new file mode 100644 index 00000000000..8bdee3dfb2d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteForecastRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DeleteForecastRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteForecastRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteForecastRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteForecastRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteForecastRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteForecastRequest.g.cs index 35954b07eb0..e2e8fbe1d74 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteForecastRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteForecastRequest.g.cs @@ -45,35 +45,6 @@ public sealed partial class DeleteForecastRequestParameters : Elastic.Transport. public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class DeleteForecastRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteForecastRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteForecastRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteForecastRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete forecasts from a job. @@ -85,7 +56,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// forecasts before they expire. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DeleteForecastRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DeleteForecastRequestConverter))] public sealed partial class DeleteForecastRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteForecastResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteForecastResponse.Converters.g.cs new file mode 100644 index 00000000000..4ed5b1158ce --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteForecastResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DeleteForecastResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteForecastResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteForecastResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteForecastResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteForecastResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteForecastResponse.g.cs index 9b6322ebf77..d3b4ce75b79 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteForecastResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteForecastResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DeleteForecastResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteForecastResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteForecastResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteForecastResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DeleteForecastResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DeleteForecastResponseConverter))] public sealed partial class DeleteForecastResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteJobRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteJobRequest.Converters.g.cs new file mode 100644 index 00000000000..ea1ef4be621 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteJobRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DeleteJobRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteJobRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteJobRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteJobRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteJobRequest.g.cs index e7e10e81c35..952947ee1e1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteJobRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteJobRequest.g.cs @@ -51,35 +51,6 @@ public sealed partial class DeleteJobRequestParameters : Elastic.Transport.Reque public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } } -internal sealed partial class DeleteJobRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteJobRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteJobRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteJobRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete an anomaly detection job. @@ -93,7 +64,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// delete job request. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DeleteJobRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DeleteJobRequestConverter))] public sealed partial class DeleteJobRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteJobResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteJobResponse.Converters.g.cs new file mode 100644 index 00000000000..2a795176881 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteJobResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DeleteJobResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteJobResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteJobResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteJobResponse.g.cs index d275a3073aa..8daad5a3872 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteJobResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteJobResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DeleteJobResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteJobResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteJobResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DeleteJobResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DeleteJobResponseConverter))] public sealed partial class DeleteJobResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteModelSnapshotRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteModelSnapshotRequest.Converters.g.cs new file mode 100644 index 00000000000..1a15c19f5e6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteModelSnapshotRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DeleteModelSnapshotRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteModelSnapshotRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteModelSnapshotRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteModelSnapshotRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteModelSnapshotRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteModelSnapshotRequest.g.cs index db42f1a720e..c8f29044bb9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteModelSnapshotRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteModelSnapshotRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class DeleteModelSnapshotRequestParameters : Elastic.Trans { } -internal sealed partial class DeleteModelSnapshotRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteModelSnapshotRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteModelSnapshotRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteModelSnapshotRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete a model snapshot. @@ -66,7 +37,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// the model_snapshot_id in the results from the get jobs API. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DeleteModelSnapshotRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DeleteModelSnapshotRequestConverter))] public sealed partial class DeleteModelSnapshotRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteModelSnapshotResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteModelSnapshotResponse.Converters.g.cs new file mode 100644 index 00000000000..10cdc347c14 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteModelSnapshotResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DeleteModelSnapshotResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteModelSnapshotResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteModelSnapshotResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteModelSnapshotResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteModelSnapshotResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteModelSnapshotResponse.g.cs index 9a62bae4e8d..1dc87817886 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteModelSnapshotResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteModelSnapshotResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DeleteModelSnapshotResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteModelSnapshotResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteModelSnapshotResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteModelSnapshotResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DeleteModelSnapshotResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DeleteModelSnapshotResponseConverter))] public sealed partial class DeleteModelSnapshotResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelAliasRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelAliasRequest.Converters.g.cs new file mode 100644 index 00000000000..02745f00b74 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelAliasRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DeleteTrainedModelAliasRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelAliasRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelAliasRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelAliasRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelAliasRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelAliasRequest.g.cs index a92e1dc1d21..c9d3ab81090 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelAliasRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelAliasRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class DeleteTrainedModelAliasRequestParameters : Elastic.T { } -internal sealed partial class DeleteTrainedModelAliasRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelAliasRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelAliasRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelAliasRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete a trained model alias. @@ -66,7 +37,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// by the model_id, this API returns an error. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelAliasRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DeleteTrainedModelAliasRequestConverter))] public sealed partial class DeleteTrainedModelAliasRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelAliasResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelAliasResponse.Converters.g.cs new file mode 100644 index 00000000000..3580e5ee193 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelAliasResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DeleteTrainedModelAliasResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelAliasResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelAliasResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelAliasResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelAliasResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelAliasResponse.g.cs index 940ce59813a..9f39aaf4c75 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelAliasResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelAliasResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DeleteTrainedModelAliasResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelAliasResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelAliasResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelAliasResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelAliasResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DeleteTrainedModelAliasResponseConverter))] public sealed partial class DeleteTrainedModelAliasResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelRequest.Converters.g.cs new file mode 100644 index 00000000000..ee73edc9dbd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DeleteTrainedModelRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelRequest.g.cs index eede526af31..99281a3e959 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelRequest.g.cs @@ -40,35 +40,6 @@ public sealed partial class DeleteTrainedModelRequestParameters : Elastic.Transp public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class DeleteTrainedModelRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete an unreferenced trained model. @@ -77,7 +48,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The request deletes a trained inference model that is not referenced by an ingest pipeline. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DeleteTrainedModelRequestConverter))] public sealed partial class DeleteTrainedModelRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelResponse.Converters.g.cs new file mode 100644 index 00000000000..f35032350a5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DeleteTrainedModelResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelResponse.g.cs index d44d74640df..e524529737a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/DeleteTrainedModelResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DeleteTrainedModelResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DeleteTrainedModelResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DeleteTrainedModelResponseConverter))] public sealed partial class DeleteTrainedModelResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EstimateModelMemoryRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EstimateModelMemoryRequest.Converters.g.cs new file mode 100644 index 00000000000..20b60f14afa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EstimateModelMemoryRequest.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class EstimateModelMemoryRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalysisConfig = System.Text.Json.JsonEncodedText.Encode("analysis_config"); + private static readonly System.Text.Json.JsonEncodedText PropMaxBucketCardinality = System.Text.Json.JsonEncodedText.Encode("max_bucket_cardinality"); + private static readonly System.Text.Json.JsonEncodedText PropOverallCardinality = System.Text.Json.JsonEncodedText.Encode("overall_cardinality"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.EstimateModelMemoryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalysisConfig = default; + LocalJsonValue?> propMaxBucketCardinality = default; + LocalJsonValue?> propOverallCardinality = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalysisConfig.TryReadProperty(ref reader, options, PropAnalysisConfig, null)) + { + continue; + } + + if (propMaxBucketCardinality.TryReadProperty(ref reader, options, PropMaxBucketCardinality, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propOverallCardinality.TryReadProperty(ref reader, options, PropOverallCardinality, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.EstimateModelMemoryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AnalysisConfig = propAnalysisConfig.Value, + MaxBucketCardinality = propMaxBucketCardinality.Value, + OverallCardinality = propOverallCardinality.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.EstimateModelMemoryRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalysisConfig, value.AnalysisConfig, null, null); + writer.WriteProperty(options, PropMaxBucketCardinality, value.MaxBucketCardinality, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropOverallCardinality, value.OverallCardinality, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EstimateModelMemoryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EstimateModelMemoryRequest.g.cs index a5334052963..55ae3651a88 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EstimateModelMemoryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EstimateModelMemoryRequest.g.cs @@ -27,63 +27,6 @@ public sealed partial class EstimateModelMemoryRequestParameters : Elastic.Trans { } -internal sealed partial class EstimateModelMemoryRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalysisConfig = System.Text.Json.JsonEncodedText.Encode("analysis_config"); - private static readonly System.Text.Json.JsonEncodedText PropMaxBucketCardinality = System.Text.Json.JsonEncodedText.Encode("max_bucket_cardinality"); - private static readonly System.Text.Json.JsonEncodedText PropOverallCardinality = System.Text.Json.JsonEncodedText.Encode("overall_cardinality"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.EstimateModelMemoryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalysisConfig = default; - LocalJsonValue?> propMaxBucketCardinality = default; - LocalJsonValue?> propOverallCardinality = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalysisConfig.TryReadProperty(ref reader, options, PropAnalysisConfig, null)) - { - continue; - } - - if (propMaxBucketCardinality.TryReadProperty(ref reader, options, PropMaxBucketCardinality, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propOverallCardinality.TryReadProperty(ref reader, options, PropOverallCardinality, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.EstimateModelMemoryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AnalysisConfig = propAnalysisConfig.Value, - MaxBucketCardinality = propMaxBucketCardinality.Value, - OverallCardinality = propOverallCardinality.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.EstimateModelMemoryRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalysisConfig, value.AnalysisConfig, null, null); - writer.WriteProperty(options, PropMaxBucketCardinality, value.MaxBucketCardinality, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropOverallCardinality, value.OverallCardinality, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - /// /// /// Estimate job model memory usage. @@ -94,7 +37,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// estimates for the fields it references. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.EstimateModelMemoryRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.EstimateModelMemoryRequestConverter))] public sealed partial class EstimateModelMemoryRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EstimateModelMemoryResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EstimateModelMemoryResponse.Converters.g.cs new file mode 100644 index 00000000000..a6545b06c58 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EstimateModelMemoryResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class EstimateModelMemoryResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropModelMemoryEstimate = System.Text.Json.JsonEncodedText.Encode("model_memory_estimate"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.EstimateModelMemoryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propModelMemoryEstimate = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propModelMemoryEstimate.TryReadProperty(ref reader, options, PropModelMemoryEstimate, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.EstimateModelMemoryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ModelMemoryEstimate = propModelMemoryEstimate.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.EstimateModelMemoryResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropModelMemoryEstimate, value.ModelMemoryEstimate, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EstimateModelMemoryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EstimateModelMemoryResponse.g.cs index d625aee3e77..767dad7b293 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EstimateModelMemoryResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EstimateModelMemoryResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class EstimateModelMemoryResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropModelMemoryEstimate = System.Text.Json.JsonEncodedText.Encode("model_memory_estimate"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.EstimateModelMemoryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propModelMemoryEstimate = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propModelMemoryEstimate.TryReadProperty(ref reader, options, PropModelMemoryEstimate, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.EstimateModelMemoryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ModelMemoryEstimate = propModelMemoryEstimate.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.EstimateModelMemoryResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropModelMemoryEstimate, value.ModelMemoryEstimate, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.EstimateModelMemoryResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.EstimateModelMemoryResponseConverter))] public sealed partial class EstimateModelMemoryResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal EstimateModelMemoryResponse(Elastic.Clients.Elasticsearch.Serialization public #if NET7_0_OR_GREATER - required +required #endif - string ModelMemoryEstimate { get; set; } +string ModelMemoryEstimate { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EvaluateDataFrameRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EvaluateDataFrameRequest.Converters.g.cs new file mode 100644 index 00000000000..3a503bdf475 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EvaluateDataFrameRequest.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class EvaluateDataFrameRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEvaluation = System.Text.Json.JsonEncodedText.Encode("evaluation"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.EvaluateDataFrameRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEvaluation = default; + LocalJsonValue propIndex = default; + LocalJsonValue propQuery = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEvaluation.TryReadProperty(ref reader, options, PropEvaluation, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.EvaluateDataFrameRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Evaluation = propEvaluation.Value, + Index = propIndex.Value, + Query = propQuery.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.EvaluateDataFrameRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEvaluation, value.Evaluation, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EvaluateDataFrameRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EvaluateDataFrameRequest.g.cs index 738d57ecafc..37b9cc67ecd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EvaluateDataFrameRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EvaluateDataFrameRequest.g.cs @@ -27,63 +27,6 @@ public sealed partial class EvaluateDataFrameRequestParameters : Elastic.Transpo { } -internal sealed partial class EvaluateDataFrameRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEvaluation = System.Text.Json.JsonEncodedText.Encode("evaluation"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.EvaluateDataFrameRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEvaluation = default; - LocalJsonValue propIndex = default; - LocalJsonValue propQuery = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEvaluation.TryReadProperty(ref reader, options, PropEvaluation, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.EvaluateDataFrameRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Evaluation = propEvaluation.Value, - Index = propIndex.Value, - Query = propQuery.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.EvaluateDataFrameRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEvaluation, value.Evaluation, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Evaluate data frame analytics. @@ -95,7 +38,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// field and an analytics result field to be present. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.EvaluateDataFrameRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.EvaluateDataFrameRequestConverter))] public sealed partial class EvaluateDataFrameRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EvaluateDataFrameResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EvaluateDataFrameResponse.Converters.g.cs new file mode 100644 index 00000000000..6d005cc508c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EvaluateDataFrameResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class EvaluateDataFrameResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClassification = System.Text.Json.JsonEncodedText.Encode("classification"); + private static readonly System.Text.Json.JsonEncodedText PropOutlierDetection = System.Text.Json.JsonEncodedText.Encode("outlier_detection"); + private static readonly System.Text.Json.JsonEncodedText PropRegression = System.Text.Json.JsonEncodedText.Encode("regression"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.EvaluateDataFrameResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClassification = default; + LocalJsonValue propOutlierDetection = default; + LocalJsonValue propRegression = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClassification.TryReadProperty(ref reader, options, PropClassification, null)) + { + continue; + } + + if (propOutlierDetection.TryReadProperty(ref reader, options, PropOutlierDetection, null)) + { + continue; + } + + if (propRegression.TryReadProperty(ref reader, options, PropRegression, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.EvaluateDataFrameResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Classification = propClassification.Value, + OutlierDetection = propOutlierDetection.Value, + Regression = propRegression.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.EvaluateDataFrameResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClassification, value.Classification, null, null); + writer.WriteProperty(options, PropOutlierDetection, value.OutlierDetection, null, null); + writer.WriteProperty(options, PropRegression, value.Regression, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EvaluateDataFrameResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EvaluateDataFrameResponse.g.cs index 325f282423d..0f8debbba69 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EvaluateDataFrameResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/EvaluateDataFrameResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class EvaluateDataFrameResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClassification = System.Text.Json.JsonEncodedText.Encode("classification"); - private static readonly System.Text.Json.JsonEncodedText PropOutlierDetection = System.Text.Json.JsonEncodedText.Encode("outlier_detection"); - private static readonly System.Text.Json.JsonEncodedText PropRegression = System.Text.Json.JsonEncodedText.Encode("regression"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.EvaluateDataFrameResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClassification = default; - LocalJsonValue propOutlierDetection = default; - LocalJsonValue propRegression = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClassification.TryReadProperty(ref reader, options, PropClassification, null)) - { - continue; - } - - if (propOutlierDetection.TryReadProperty(ref reader, options, PropOutlierDetection, null)) - { - continue; - } - - if (propRegression.TryReadProperty(ref reader, options, PropRegression, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.EvaluateDataFrameResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Classification = propClassification.Value, - OutlierDetection = propOutlierDetection.Value, - Regression = propRegression.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.EvaluateDataFrameResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClassification, value.Classification, null, null); - writer.WriteProperty(options, PropOutlierDetection, value.OutlierDetection, null, null); - writer.WriteProperty(options, PropRegression, value.Regression, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.EvaluateDataFrameResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.EvaluateDataFrameResponseConverter))] public sealed partial class EvaluateDataFrameResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsRequest.Converters.g.cs new file mode 100644 index 00000000000..d250b54bf65 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsRequest.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ExplainDataFrameAnalyticsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowLazyStart = System.Text.Json.JsonEncodedText.Encode("allow_lazy_start"); + private static readonly System.Text.Json.JsonEncodedText PropAnalysis = System.Text.Json.JsonEncodedText.Encode("analysis"); + private static readonly System.Text.Json.JsonEncodedText PropAnalyzedFields = System.Text.Json.JsonEncodedText.Encode("analyzed_fields"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropDest = System.Text.Json.JsonEncodedText.Encode("dest"); + private static readonly System.Text.Json.JsonEncodedText PropMaxNumThreads = System.Text.Json.JsonEncodedText.Encode("max_num_threads"); + private static readonly System.Text.Json.JsonEncodedText PropModelMemoryLimit = System.Text.Json.JsonEncodedText.Encode("model_memory_limit"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.ExplainDataFrameAnalyticsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowLazyStart = default; + LocalJsonValue propAnalysis = default; + LocalJsonValue propAnalyzedFields = default; + LocalJsonValue propDescription = default; + LocalJsonValue propDest = default; + LocalJsonValue propMaxNumThreads = default; + LocalJsonValue propModelMemoryLimit = default; + LocalJsonValue propSource = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowLazyStart.TryReadProperty(ref reader, options, PropAllowLazyStart, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propAnalysis.TryReadProperty(ref reader, options, PropAnalysis, null)) + { + continue; + } + + if (propAnalyzedFields.TryReadProperty(ref reader, options, PropAnalyzedFields, null)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propDest.TryReadProperty(ref reader, options, PropDest, null)) + { + continue; + } + + if (propMaxNumThreads.TryReadProperty(ref reader, options, PropMaxNumThreads, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propModelMemoryLimit.TryReadProperty(ref reader, options, PropModelMemoryLimit, null)) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.ExplainDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowLazyStart = propAllowLazyStart.Value, + Analysis = propAnalysis.Value, + AnalyzedFields = propAnalyzedFields.Value, + Description = propDescription.Value, + Dest = propDest.Value, + MaxNumThreads = propMaxNumThreads.Value, + ModelMemoryLimit = propModelMemoryLimit.Value, + Source = propSource.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ExplainDataFrameAnalyticsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowLazyStart, value.AllowLazyStart, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropAnalysis, value.Analysis, null, null); + writer.WriteProperty(options, PropAnalyzedFields, value.AnalyzedFields, null, null); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropDest, value.Dest, null, null); + writer.WriteProperty(options, PropMaxNumThreads, value.MaxNumThreads, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropModelMemoryLimit, value.ModelMemoryLimit, null, null); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsRequest.g.cs index 7d4b4499bd8..d78595ad2cd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsRequest.g.cs @@ -27,108 +27,6 @@ public sealed partial class ExplainDataFrameAnalyticsRequestParameters : Elastic { } -internal sealed partial class ExplainDataFrameAnalyticsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowLazyStart = System.Text.Json.JsonEncodedText.Encode("allow_lazy_start"); - private static readonly System.Text.Json.JsonEncodedText PropAnalysis = System.Text.Json.JsonEncodedText.Encode("analysis"); - private static readonly System.Text.Json.JsonEncodedText PropAnalyzedFields = System.Text.Json.JsonEncodedText.Encode("analyzed_fields"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropDest = System.Text.Json.JsonEncodedText.Encode("dest"); - private static readonly System.Text.Json.JsonEncodedText PropMaxNumThreads = System.Text.Json.JsonEncodedText.Encode("max_num_threads"); - private static readonly System.Text.Json.JsonEncodedText PropModelMemoryLimit = System.Text.Json.JsonEncodedText.Encode("model_memory_limit"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.ExplainDataFrameAnalyticsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowLazyStart = default; - LocalJsonValue propAnalysis = default; - LocalJsonValue propAnalyzedFields = default; - LocalJsonValue propDescription = default; - LocalJsonValue propDest = default; - LocalJsonValue propMaxNumThreads = default; - LocalJsonValue propModelMemoryLimit = default; - LocalJsonValue propSource = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowLazyStart.TryReadProperty(ref reader, options, PropAllowLazyStart, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propAnalysis.TryReadProperty(ref reader, options, PropAnalysis, null)) - { - continue; - } - - if (propAnalyzedFields.TryReadProperty(ref reader, options, PropAnalyzedFields, null)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propDest.TryReadProperty(ref reader, options, PropDest, null)) - { - continue; - } - - if (propMaxNumThreads.TryReadProperty(ref reader, options, PropMaxNumThreads, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propModelMemoryLimit.TryReadProperty(ref reader, options, PropModelMemoryLimit, null)) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.ExplainDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowLazyStart = propAllowLazyStart.Value, - Analysis = propAnalysis.Value, - AnalyzedFields = propAnalyzedFields.Value, - Description = propDescription.Value, - Dest = propDest.Value, - MaxNumThreads = propMaxNumThreads.Value, - ModelMemoryLimit = propModelMemoryLimit.Value, - Source = propSource.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ExplainDataFrameAnalyticsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowLazyStart, value.AllowLazyStart, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropAnalysis, value.Analysis, null, null); - writer.WriteProperty(options, PropAnalyzedFields, value.AnalyzedFields, null, null); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropDest, value.Dest, null, null); - writer.WriteProperty(options, PropMaxNumThreads, value.MaxNumThreads, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropModelMemoryLimit, value.ModelMemoryLimit, null, null); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Explain data frame analytics config. @@ -152,7 +50,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ExplainDataFrameAnalyticsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ExplainDataFrameAnalyticsRequestConverter))] public sealed partial class ExplainDataFrameAnalyticsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public ExplainDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsResponse.Converters.g.cs new file mode 100644 index 00000000000..fd700b28212 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ExplainDataFrameAnalyticsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFieldSelection = System.Text.Json.JsonEncodedText.Encode("field_selection"); + private static readonly System.Text.Json.JsonEncodedText PropMemoryEstimation = System.Text.Json.JsonEncodedText.Encode("memory_estimation"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.ExplainDataFrameAnalyticsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propFieldSelection = default; + LocalJsonValue propMemoryEstimation = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFieldSelection.TryReadProperty(ref reader, options, PropFieldSelection, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMemoryEstimation.TryReadProperty(ref reader, options, PropMemoryEstimation, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.ExplainDataFrameAnalyticsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FieldSelection = propFieldSelection.Value, + MemoryEstimation = propMemoryEstimation.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ExplainDataFrameAnalyticsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFieldSelection, value.FieldSelection, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMemoryEstimation, value.MemoryEstimation, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsResponse.g.cs index c8a6103398a..649a68f8951 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ExplainDataFrameAnalyticsResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class ExplainDataFrameAnalyticsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFieldSelection = System.Text.Json.JsonEncodedText.Encode("field_selection"); - private static readonly System.Text.Json.JsonEncodedText PropMemoryEstimation = System.Text.Json.JsonEncodedText.Encode("memory_estimation"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.ExplainDataFrameAnalyticsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propFieldSelection = default; - LocalJsonValue propMemoryEstimation = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFieldSelection.TryReadProperty(ref reader, options, PropFieldSelection, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMemoryEstimation.TryReadProperty(ref reader, options, PropMemoryEstimation, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.ExplainDataFrameAnalyticsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FieldSelection = propFieldSelection.Value, - MemoryEstimation = propMemoryEstimation.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ExplainDataFrameAnalyticsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFieldSelection, value.FieldSelection, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMemoryEstimation, value.MemoryEstimation, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ExplainDataFrameAnalyticsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ExplainDataFrameAnalyticsResponseConverter))] public sealed partial class ExplainDataFrameAnalyticsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/FlushJobRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/FlushJobRequest.Converters.g.cs new file mode 100644 index 00000000000..c68713ca4c0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/FlushJobRequest.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class FlushJobRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAdvanceTime = System.Text.Json.JsonEncodedText.Encode("advance_time"); + private static readonly System.Text.Json.JsonEncodedText PropCalcInterim = System.Text.Json.JsonEncodedText.Encode("calc_interim"); + private static readonly System.Text.Json.JsonEncodedText PropEnd = System.Text.Json.JsonEncodedText.Encode("end"); + private static readonly System.Text.Json.JsonEncodedText PropSkipTime = System.Text.Json.JsonEncodedText.Encode("skip_time"); + private static readonly System.Text.Json.JsonEncodedText PropStart = System.Text.Json.JsonEncodedText.Encode("start"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.FlushJobRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAdvanceTime = default; + LocalJsonValue propCalcInterim = default; + LocalJsonValue propEnd = default; + LocalJsonValue propSkipTime = default; + LocalJsonValue propStart = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAdvanceTime.TryReadProperty(ref reader, options, PropAdvanceTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propCalcInterim.TryReadProperty(ref reader, options, PropCalcInterim, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEnd.TryReadProperty(ref reader, options, PropEnd, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propSkipTime.TryReadProperty(ref reader, options, PropSkipTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propStart.TryReadProperty(ref reader, options, PropStart, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.FlushJobRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AdvanceTime = propAdvanceTime.Value, + CalcInterim = propCalcInterim.Value, + End = propEnd.Value, + SkipTime = propSkipTime.Value, + Start = propStart.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.FlushJobRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAdvanceTime, value.AdvanceTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropCalcInterim, value.CalcInterim, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEnd, value.End, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropSkipTime, value.SkipTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropStart, value.Start, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/FlushJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/FlushJobRequest.g.cs index 26d21bfab0b..5ca5c200f91 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/FlushJobRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/FlushJobRequest.g.cs @@ -27,81 +27,6 @@ public sealed partial class FlushJobRequestParameters : Elastic.Transport.Reques { } -internal sealed partial class FlushJobRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAdvanceTime = System.Text.Json.JsonEncodedText.Encode("advance_time"); - private static readonly System.Text.Json.JsonEncodedText PropCalcInterim = System.Text.Json.JsonEncodedText.Encode("calc_interim"); - private static readonly System.Text.Json.JsonEncodedText PropEnd = System.Text.Json.JsonEncodedText.Encode("end"); - private static readonly System.Text.Json.JsonEncodedText PropSkipTime = System.Text.Json.JsonEncodedText.Encode("skip_time"); - private static readonly System.Text.Json.JsonEncodedText PropStart = System.Text.Json.JsonEncodedText.Encode("start"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.FlushJobRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAdvanceTime = default; - LocalJsonValue propCalcInterim = default; - LocalJsonValue propEnd = default; - LocalJsonValue propSkipTime = default; - LocalJsonValue propStart = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAdvanceTime.TryReadProperty(ref reader, options, PropAdvanceTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propCalcInterim.TryReadProperty(ref reader, options, PropCalcInterim, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEnd.TryReadProperty(ref reader, options, PropEnd, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propSkipTime.TryReadProperty(ref reader, options, PropSkipTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propStart.TryReadProperty(ref reader, options, PropStart, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.FlushJobRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AdvanceTime = propAdvanceTime.Value, - CalcInterim = propCalcInterim.Value, - End = propEnd.Value, - SkipTime = propSkipTime.Value, - Start = propStart.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.FlushJobRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAdvanceTime, value.AdvanceTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropCalcInterim, value.CalcInterim, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEnd, value.End, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropSkipTime, value.SkipTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropStart, value.Start, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteEndObject(); - } -} - /// /// /// Force buffered data to be processed. @@ -115,7 +40,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// analyzing further data. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.FlushJobRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.FlushJobRequestConverter))] public sealed partial class FlushJobRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/FlushJobResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/FlushJobResponse.Converters.g.cs new file mode 100644 index 00000000000..51930974378 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/FlushJobResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class FlushJobResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFlushed = System.Text.Json.JsonEncodedText.Encode("flushed"); + private static readonly System.Text.Json.JsonEncodedText PropLastFinalizedBucketEnd = System.Text.Json.JsonEncodedText.Encode("last_finalized_bucket_end"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.FlushJobResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFlushed = default; + LocalJsonValue propLastFinalizedBucketEnd = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFlushed.TryReadProperty(ref reader, options, PropFlushed, null)) + { + continue; + } + + if (propLastFinalizedBucketEnd.TryReadProperty(ref reader, options, PropLastFinalizedBucketEnd, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.FlushJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Flushed = propFlushed.Value, + LastFinalizedBucketEnd = propLastFinalizedBucketEnd.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.FlushJobResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFlushed, value.Flushed, null, null); + writer.WriteProperty(options, PropLastFinalizedBucketEnd, value.LastFinalizedBucketEnd, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/FlushJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/FlushJobResponse.g.cs index ea1d8c49ff1..86dd68bad9a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/FlushJobResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/FlushJobResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class FlushJobResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFlushed = System.Text.Json.JsonEncodedText.Encode("flushed"); - private static readonly System.Text.Json.JsonEncodedText PropLastFinalizedBucketEnd = System.Text.Json.JsonEncodedText.Encode("last_finalized_bucket_end"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.FlushJobResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFlushed = default; - LocalJsonValue propLastFinalizedBucketEnd = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFlushed.TryReadProperty(ref reader, options, PropFlushed, null)) - { - continue; - } - - if (propLastFinalizedBucketEnd.TryReadProperty(ref reader, options, PropLastFinalizedBucketEnd, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.FlushJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Flushed = propFlushed.Value, - LastFinalizedBucketEnd = propLastFinalizedBucketEnd.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.FlushJobResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFlushed, value.Flushed, null, null); - writer.WriteProperty(options, PropLastFinalizedBucketEnd, value.LastFinalizedBucketEnd, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.FlushJobResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.FlushJobResponseConverter))] public sealed partial class FlushJobResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,9 +39,9 @@ internal FlushJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstr public #if NET7_0_OR_GREATER - required +required #endif - bool Flushed { get; set; } +bool Flushed { get; set; } /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ForecastRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ForecastRequest.Converters.g.cs new file mode 100644 index 00000000000..e6f0a642500 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ForecastRequest.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ForecastRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDuration = System.Text.Json.JsonEncodedText.Encode("duration"); + private static readonly System.Text.Json.JsonEncodedText PropExpiresIn = System.Text.Json.JsonEncodedText.Encode("expires_in"); + private static readonly System.Text.Json.JsonEncodedText PropMaxModelMemory = System.Text.Json.JsonEncodedText.Encode("max_model_memory"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.ForecastRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDuration = default; + LocalJsonValue propExpiresIn = default; + LocalJsonValue propMaxModelMemory = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDuration.TryReadProperty(ref reader, options, PropDuration, null)) + { + continue; + } + + if (propExpiresIn.TryReadProperty(ref reader, options, PropExpiresIn, null)) + { + continue; + } + + if (propMaxModelMemory.TryReadProperty(ref reader, options, PropMaxModelMemory, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.ForecastRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Duration = propDuration.Value, + ExpiresIn = propExpiresIn.Value, + MaxModelMemory = propMaxModelMemory.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ForecastRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDuration, value.Duration, null, null); + writer.WriteProperty(options, PropExpiresIn, value.ExpiresIn, null, null); + writer.WriteProperty(options, PropMaxModelMemory, value.MaxModelMemory, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ForecastRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ForecastRequest.g.cs index 04215b6c07c..8560130d2a6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ForecastRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ForecastRequest.g.cs @@ -27,63 +27,6 @@ public sealed partial class ForecastRequestParameters : Elastic.Transport.Reques { } -internal sealed partial class ForecastRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDuration = System.Text.Json.JsonEncodedText.Encode("duration"); - private static readonly System.Text.Json.JsonEncodedText PropExpiresIn = System.Text.Json.JsonEncodedText.Encode("expires_in"); - private static readonly System.Text.Json.JsonEncodedText PropMaxModelMemory = System.Text.Json.JsonEncodedText.Encode("max_model_memory"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.ForecastRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDuration = default; - LocalJsonValue propExpiresIn = default; - LocalJsonValue propMaxModelMemory = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDuration.TryReadProperty(ref reader, options, PropDuration, null)) - { - continue; - } - - if (propExpiresIn.TryReadProperty(ref reader, options, PropExpiresIn, null)) - { - continue; - } - - if (propMaxModelMemory.TryReadProperty(ref reader, options, PropMaxModelMemory, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.ForecastRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Duration = propDuration.Value, - ExpiresIn = propExpiresIn.Value, - MaxModelMemory = propMaxModelMemory.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ForecastRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDuration, value.Duration, null, null); - writer.WriteProperty(options, PropExpiresIn, value.ExpiresIn, null, null); - writer.WriteProperty(options, PropMaxModelMemory, value.MaxModelMemory, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Predict future behavior of a time series. @@ -95,7 +38,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// based on historical data. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ForecastRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ForecastRequestConverter))] public sealed partial class ForecastRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ForecastResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ForecastResponse.Converters.g.cs new file mode 100644 index 00000000000..fae96f1a835 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ForecastResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ForecastResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + private static readonly System.Text.Json.JsonEncodedText PropForecastId = System.Text.Json.JsonEncodedText.Encode("forecast_id"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.ForecastResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + LocalJsonValue propForecastId = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (propForecastId.TryReadProperty(ref reader, options, PropForecastId, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.ForecastResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value, + ForecastId = propForecastId.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ForecastResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteProperty(options, PropForecastId, value.ForecastId, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ForecastResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ForecastResponse.g.cs index 88ed045de5e..b60c51dfcd9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ForecastResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ForecastResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class ForecastResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - private static readonly System.Text.Json.JsonEncodedText PropForecastId = System.Text.Json.JsonEncodedText.Encode("forecast_id"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.ForecastResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - LocalJsonValue propForecastId = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (propForecastId.TryReadProperty(ref reader, options, PropForecastId, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.ForecastResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value, - ForecastId = propForecastId.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ForecastResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteProperty(options, PropForecastId, value.ForecastId, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ForecastResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ForecastResponseConverter))] public sealed partial class ForecastResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal ForecastResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstr public #if NET7_0_OR_GREATER - required +required #endif - bool Acknowledged { get; set; } +bool Acknowledged { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string ForecastId { get; set; } +string ForecastId { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetBucketsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetBucketsRequest.Converters.g.cs new file mode 100644 index 00000000000..504ed31758e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetBucketsRequest.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetBucketsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnomalyScore = System.Text.Json.JsonEncodedText.Encode("anomaly_score"); + private static readonly System.Text.Json.JsonEncodedText PropDesc = System.Text.Json.JsonEncodedText.Encode("desc"); + private static readonly System.Text.Json.JsonEncodedText PropEnd = System.Text.Json.JsonEncodedText.Encode("end"); + private static readonly System.Text.Json.JsonEncodedText PropExcludeInterim = System.Text.Json.JsonEncodedText.Encode("exclude_interim"); + private static readonly System.Text.Json.JsonEncodedText PropExpand = System.Text.Json.JsonEncodedText.Encode("expand"); + private static readonly System.Text.Json.JsonEncodedText PropPage = System.Text.Json.JsonEncodedText.Encode("page"); + private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); + private static readonly System.Text.Json.JsonEncodedText PropStart = System.Text.Json.JsonEncodedText.Encode("start"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GetBucketsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnomalyScore = default; + LocalJsonValue propDesc = default; + LocalJsonValue propEnd = default; + LocalJsonValue propExcludeInterim = default; + LocalJsonValue propExpand = default; + LocalJsonValue propPage = default; + LocalJsonValue propSort = default; + LocalJsonValue propStart = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnomalyScore.TryReadProperty(ref reader, options, PropAnomalyScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDesc.TryReadProperty(ref reader, options, PropDesc, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEnd.TryReadProperty(ref reader, options, PropEnd, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propExcludeInterim.TryReadProperty(ref reader, options, PropExcludeInterim, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propExpand.TryReadProperty(ref reader, options, PropExpand, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPage.TryReadProperty(ref reader, options, PropPage, null)) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, null)) + { + continue; + } + + if (propStart.TryReadProperty(ref reader, options, PropStart, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetBucketsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AnomalyScore = propAnomalyScore.Value, + Desc = propDesc.Value, + End = propEnd.Value, + ExcludeInterim = propExcludeInterim.Value, + Expand = propExpand.Value, + Page = propPage.Value, + Sort = propSort.Value, + Start = propStart.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetBucketsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnomalyScore, value.AnomalyScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDesc, value.Desc, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEnd, value.End, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropExcludeInterim, value.ExcludeInterim, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropExpand, value.Expand, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPage, value.Page, null, null); + writer.WriteProperty(options, PropSort, value.Sort, null, null); + writer.WriteProperty(options, PropStart, value.Start, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetBucketsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetBucketsRequest.g.cs index e3c68ca89b3..08fafdc802b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetBucketsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetBucketsRequest.g.cs @@ -40,115 +40,13 @@ public sealed partial class GetBucketsRequestParameters : Elastic.Transport.Requ public int? Size { get => Q("size"); set => Q("size", value); } } -internal sealed partial class GetBucketsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnomalyScore = System.Text.Json.JsonEncodedText.Encode("anomaly_score"); - private static readonly System.Text.Json.JsonEncodedText PropDesc = System.Text.Json.JsonEncodedText.Encode("desc"); - private static readonly System.Text.Json.JsonEncodedText PropEnd = System.Text.Json.JsonEncodedText.Encode("end"); - private static readonly System.Text.Json.JsonEncodedText PropExcludeInterim = System.Text.Json.JsonEncodedText.Encode("exclude_interim"); - private static readonly System.Text.Json.JsonEncodedText PropExpand = System.Text.Json.JsonEncodedText.Encode("expand"); - private static readonly System.Text.Json.JsonEncodedText PropPage = System.Text.Json.JsonEncodedText.Encode("page"); - private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); - private static readonly System.Text.Json.JsonEncodedText PropStart = System.Text.Json.JsonEncodedText.Encode("start"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GetBucketsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnomalyScore = default; - LocalJsonValue propDesc = default; - LocalJsonValue propEnd = default; - LocalJsonValue propExcludeInterim = default; - LocalJsonValue propExpand = default; - LocalJsonValue propPage = default; - LocalJsonValue propSort = default; - LocalJsonValue propStart = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnomalyScore.TryReadProperty(ref reader, options, PropAnomalyScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDesc.TryReadProperty(ref reader, options, PropDesc, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEnd.TryReadProperty(ref reader, options, PropEnd, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propExcludeInterim.TryReadProperty(ref reader, options, PropExcludeInterim, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propExpand.TryReadProperty(ref reader, options, PropExpand, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPage.TryReadProperty(ref reader, options, PropPage, null)) - { - continue; - } - - if (propSort.TryReadProperty(ref reader, options, PropSort, null)) - { - continue; - } - - if (propStart.TryReadProperty(ref reader, options, PropStart, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetBucketsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AnomalyScore = propAnomalyScore.Value, - Desc = propDesc.Value, - End = propEnd.Value, - ExcludeInterim = propExcludeInterim.Value, - Expand = propExpand.Value, - Page = propPage.Value, - Sort = propSort.Value, - Start = propStart.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetBucketsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnomalyScore, value.AnomalyScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDesc, value.Desc, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEnd, value.End, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropExcludeInterim, value.ExcludeInterim, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropExpand, value.Expand, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPage, value.Page, null, null); - writer.WriteProperty(options, PropSort, value.Sort, null, null); - writer.WriteProperty(options, PropStart, value.Start, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteEndObject(); - } -} - /// /// /// Get anomaly detection job results for buckets. /// The API presents a chronological view of the records, grouped by bucket. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetBucketsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetBucketsRequestConverter))] public sealed partial class GetBucketsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetBucketsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetBucketsResponse.Converters.g.cs new file mode 100644 index 00000000000..20c1ec82235 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetBucketsResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetBucketsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GetBucketsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBuckets = default; + LocalJsonValue propCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetBucketsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + Count = propCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetBucketsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetBucketsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetBucketsResponse.g.cs index f8d2b8d63e1..050412f8957 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetBucketsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetBucketsResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class GetBucketsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GetBucketsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBuckets = default; - LocalJsonValue propCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetBucketsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - Count = propCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetBucketsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetBucketsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetBucketsResponseConverter))] public sealed partial class GetBucketsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal GetBucketsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCons public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Buckets { get; set; } +System.Collections.Generic.IReadOnlyCollection Buckets { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long Count { get; set; } +long Count { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarEventsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarEventsRequest.Converters.g.cs new file mode 100644 index 00000000000..5c067886a65 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarEventsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetCalendarEventsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarEventsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarEventsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarEventsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarEventsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarEventsRequest.g.cs index 45115aff81f..cc76ad80646 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarEventsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarEventsRequest.g.cs @@ -61,41 +61,12 @@ public sealed partial class GetCalendarEventsRequestParameters : Elastic.Transpo public System.DateTimeOffset? Start { get => Q("start"); set => Q("start", value); } } -internal sealed partial class GetCalendarEventsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarEventsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarEventsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarEventsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get info about events in calendars. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarEventsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetCalendarEventsRequestConverter))] public sealed partial class GetCalendarEventsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarEventsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarEventsResponse.Converters.g.cs new file mode 100644 index 00000000000..eaf1182f14c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarEventsResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetCalendarEventsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropEvents = System.Text.Json.JsonEncodedText.Encode("events"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarEventsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propEvents = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propEvents.TryReadProperty(ref reader, options, PropEvents, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarEventsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Events = propEvents.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarEventsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropEvents, value.Events, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarEventsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarEventsResponse.g.cs index e828dad73f8..3b159781cf1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarEventsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarEventsResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class GetCalendarEventsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropEvents = System.Text.Json.JsonEncodedText.Encode("events"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarEventsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propEvents = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propEvents.TryReadProperty(ref reader, options, PropEvents, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarEventsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Events = propEvents.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarEventsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropEvents, value.Events, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarEventsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetCalendarEventsResponseConverter))] public sealed partial class GetCalendarEventsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal GetCalendarEventsResponse(Elastic.Clients.Elasticsearch.Serialization.J public #if NET7_0_OR_GREATER - required +required #endif - long Count { get; set; } +long Count { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Events { get; set; } +System.Collections.Generic.IReadOnlyCollection Events { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarsRequest.Converters.g.cs new file mode 100644 index 00000000000..3a86427db6b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarsRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetCalendarsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPage = System.Text.Json.JsonEncodedText.Encode("page"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPage = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPage.TryReadProperty(ref reader, options, PropPage, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Page = propPage.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPage, value.Page, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarsRequest.g.cs index 4297d82e8e0..9eac0d6939a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarsRequest.g.cs @@ -40,51 +40,12 @@ public sealed partial class GetCalendarsRequestParameters : Elastic.Transport.Re public int? Size { get => Q("size"); set => Q("size", value); } } -internal sealed partial class GetCalendarsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPage = System.Text.Json.JsonEncodedText.Encode("page"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPage = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPage.TryReadProperty(ref reader, options, PropPage, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Page = propPage.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPage, value.Page, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Get calendar configuration info. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetCalendarsRequestConverter))] public sealed partial class GetCalendarsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetCalendarsRequest(Elastic.Clients.Elasticsearch.Id? calendarId) : base(r => r.Optional("calendar_id", calendarId)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarsResponse.Converters.g.cs new file mode 100644 index 00000000000..eaefb96c2af --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarsResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetCalendarsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCalendars = System.Text.Json.JsonEncodedText.Encode("calendars"); + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propCalendars = default; + LocalJsonValue propCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCalendars.TryReadProperty(ref reader, options, PropCalendars, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Calendars = propCalendars.Value, + Count = propCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCalendars, value.Calendars, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarsResponse.g.cs index 6009d887521..c454cdfe6f4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCalendarsResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class GetCalendarsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCalendars = System.Text.Json.JsonEncodedText.Encode("calendars"); - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propCalendars = default; - LocalJsonValue propCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCalendars.TryReadProperty(ref reader, options, PropCalendars, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Calendars = propCalendars.Value, - Count = propCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCalendars, value.Calendars, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetCalendarsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetCalendarsResponseConverter))] public sealed partial class GetCalendarsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal GetCalendarsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCo public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Calendars { get; set; } +System.Collections.Generic.IReadOnlyCollection Calendars { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long Count { get; set; } +long Count { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCategoriesRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCategoriesRequest.Converters.g.cs new file mode 100644 index 00000000000..8c808dba673 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCategoriesRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetCategoriesRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPage = System.Text.Json.JsonEncodedText.Encode("page"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GetCategoriesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPage = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPage.TryReadProperty(ref reader, options, PropPage, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetCategoriesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Page = propPage.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetCategoriesRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPage, value.Page, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCategoriesRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCategoriesRequest.g.cs index dfdaa8fe6b2..86ae0e25116 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCategoriesRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCategoriesRequest.g.cs @@ -47,51 +47,12 @@ public sealed partial class GetCategoriesRequestParameters : Elastic.Transport.R public int? Size { get => Q("size"); set => Q("size", value); } } -internal sealed partial class GetCategoriesRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPage = System.Text.Json.JsonEncodedText.Encode("page"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GetCategoriesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPage = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPage.TryReadProperty(ref reader, options, PropPage, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetCategoriesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Page = propPage.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetCategoriesRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPage, value.Page, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Get anomaly detection job results for categories. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetCategoriesRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetCategoriesRequestConverter))] public sealed partial class GetCategoriesRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCategoriesResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCategoriesResponse.Converters.g.cs new file mode 100644 index 00000000000..16e52157ce4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCategoriesResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetCategoriesResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCategories = System.Text.Json.JsonEncodedText.Encode("categories"); + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GetCategoriesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propCategories = default; + LocalJsonValue propCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCategories.TryReadProperty(ref reader, options, PropCategories, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetCategoriesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Categories = propCategories.Value, + Count = propCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetCategoriesResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCategories, value.Categories, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCategoriesResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCategoriesResponse.g.cs index 1b92bc55fc0..793539090c3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCategoriesResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetCategoriesResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class GetCategoriesResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCategories = System.Text.Json.JsonEncodedText.Encode("categories"); - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GetCategoriesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propCategories = default; - LocalJsonValue propCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCategories.TryReadProperty(ref reader, options, PropCategories, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetCategoriesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Categories = propCategories.Value, - Count = propCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetCategoriesResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCategories, value.Categories, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetCategoriesResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetCategoriesResponseConverter))] public sealed partial class GetCategoriesResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal GetCategoriesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonC public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Categories { get; set; } +System.Collections.Generic.IReadOnlyCollection Categories { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long Count { get; set; } +long Count { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsRequest.Converters.g.cs new file mode 100644 index 00000000000..c4536d5e105 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetDataFrameAnalyticsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsRequest.g.cs index 1e6101eb5a1..8b620d5f66c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsRequest.g.cs @@ -80,35 +80,6 @@ public sealed partial class GetDataFrameAnalyticsRequestParameters : Elastic.Tra public int? Size { get => Q("size"); set => Q("size", value); } } -internal sealed partial class GetDataFrameAnalyticsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get data frame analytics job configuration info. @@ -117,7 +88,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// wildcard expression. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetDataFrameAnalyticsRequestConverter))] public sealed partial class GetDataFrameAnalyticsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsResponse.Converters.g.cs new file mode 100644 index 00000000000..7c16d8c90cc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetDataFrameAnalyticsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropDataFrameAnalytics = System.Text.Json.JsonEncodedText.Encode("data_frame_analytics"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propDataFrameAnalytics = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propDataFrameAnalytics.TryReadProperty(ref reader, options, PropDataFrameAnalytics, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + DataFrameAnalytics = propDataFrameAnalytics.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropDataFrameAnalytics, value.DataFrameAnalytics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsResponse.g.cs index b3c73c76dfc..fd6b7667642 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class GetDataFrameAnalyticsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropDataFrameAnalytics = System.Text.Json.JsonEncodedText.Encode("data_frame_analytics"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propDataFrameAnalytics = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propDataFrameAnalytics.TryReadProperty(ref reader, options, PropDataFrameAnalytics, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - DataFrameAnalytics = propDataFrameAnalytics.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropDataFrameAnalytics, value.DataFrameAnalytics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetDataFrameAnalyticsResponseConverter))] public sealed partial class GetDataFrameAnalyticsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,9 +39,9 @@ internal GetDataFrameAnalyticsResponse(Elastic.Clients.Elasticsearch.Serializati public #if NET7_0_OR_GREATER - required +required #endif - int Count { get; set; } +int Count { get; set; } /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsRequest.Converters.g.cs new file mode 100644 index 00000000000..21151569de8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetDataFrameAnalyticsStatsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsStatsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsRequest.g.cs index 47c5a16aa4a..edba7eb3d5f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsRequest.g.cs @@ -78,41 +78,12 @@ public sealed partial class GetDataFrameAnalyticsStatsRequestParameters : Elasti public bool? Verbose { get => Q("verbose"); set => Q("verbose", value); } } -internal sealed partial class GetDataFrameAnalyticsStatsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsStatsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get data frame analytics job stats. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsStatsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetDataFrameAnalyticsStatsRequestConverter))] public sealed partial class GetDataFrameAnalyticsStatsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetDataFrameAnalyticsStatsRequest(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsResponse.Converters.g.cs new file mode 100644 index 00000000000..eb0b31a6e44 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetDataFrameAnalyticsStatsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropDataFrameAnalytics = System.Text.Json.JsonEncodedText.Encode("data_frame_analytics"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propDataFrameAnalytics = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propDataFrameAnalytics.TryReadProperty(ref reader, options, PropDataFrameAnalytics, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + DataFrameAnalytics = propDataFrameAnalytics.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsStatsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropDataFrameAnalytics, value.DataFrameAnalytics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsResponse.g.cs index 9084d46d0a3..f20710aa31e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDataFrameAnalyticsStatsResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class GetDataFrameAnalyticsStatsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropDataFrameAnalytics = System.Text.Json.JsonEncodedText.Encode("data_frame_analytics"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propDataFrameAnalytics = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propDataFrameAnalytics.TryReadProperty(ref reader, options, PropDataFrameAnalytics, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - DataFrameAnalytics = propDataFrameAnalytics.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsStatsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropDataFrameAnalytics, value.DataFrameAnalytics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetDataFrameAnalyticsStatsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetDataFrameAnalyticsStatsResponseConverter))] public sealed partial class GetDataFrameAnalyticsStatsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,9 +39,9 @@ internal GetDataFrameAnalyticsStatsResponse(Elastic.Clients.Elasticsearch.Serial public #if NET7_0_OR_GREATER - required +required #endif - long Count { get; set; } +long Count { get; set; } /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedStatsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedStatsRequest.Converters.g.cs new file mode 100644 index 00000000000..373dbdf7439 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedStatsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetDatafeedStatsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedStatsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedStatsRequest.g.cs index 8afd1ed794a..c7046e7391d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedStatsRequest.g.cs @@ -56,35 +56,6 @@ public sealed partial class GetDatafeedStatsRequestParameters : Elastic.Transpor public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } } -internal sealed partial class GetDatafeedStatsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedStatsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get datafeed stats. @@ -96,7 +67,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// This API returns a maximum of 10,000 datafeeds. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedStatsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetDatafeedStatsRequestConverter))] public sealed partial class GetDatafeedStatsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetDatafeedStatsRequest(Elastic.Clients.Elasticsearch.Ids? datafeedId) : base(r => r.Optional("datafeed_id", datafeedId)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedStatsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedStatsResponse.Converters.g.cs new file mode 100644 index 00000000000..7d38d832c4e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedStatsResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetDatafeedStatsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropDatafeeds = System.Text.Json.JsonEncodedText.Encode("datafeeds"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propDatafeeds = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propDatafeeds.TryReadProperty(ref reader, options, PropDatafeeds, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Datafeeds = propDatafeeds.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedStatsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropDatafeeds, value.Datafeeds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedStatsResponse.g.cs index edf322328bc..4afa0cd0fd5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedStatsResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class GetDatafeedStatsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropDatafeeds = System.Text.Json.JsonEncodedText.Encode("datafeeds"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propDatafeeds = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propDatafeeds.TryReadProperty(ref reader, options, PropDatafeeds, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Datafeeds = propDatafeeds.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedStatsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropDatafeeds, value.Datafeeds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedStatsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetDatafeedStatsResponseConverter))] public sealed partial class GetDatafeedStatsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal GetDatafeedStatsResponse(Elastic.Clients.Elasticsearch.Serialization.Js public #if NET7_0_OR_GREATER - required +required #endif - long Count { get; set; } +long Count { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Datafeeds { get; set; } +System.Collections.Generic.IReadOnlyCollection Datafeeds { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedsRequest.Converters.g.cs new file mode 100644 index 00000000000..2c535639dcb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetDatafeedsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedsRequest.g.cs index 8b09ed2cec8..4d4800218f0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedsRequest.g.cs @@ -65,35 +65,6 @@ public sealed partial class GetDatafeedsRequestParameters : Elastic.Transport.Re public bool? ExcludeGenerated { get => Q("exclude_generated"); set => Q("exclude_generated", value); } } -internal sealed partial class GetDatafeedsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get datafeeds configuration info. @@ -104,7 +75,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// This API returns a maximum of 10,000 datafeeds. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetDatafeedsRequestConverter))] public sealed partial class GetDatafeedsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetDatafeedsRequest(Elastic.Clients.Elasticsearch.Ids? datafeedId) : base(r => r.Optional("datafeed_id", datafeedId)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedsResponse.Converters.g.cs new file mode 100644 index 00000000000..27b1ca1ff4c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedsResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetDatafeedsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropDatafeeds = System.Text.Json.JsonEncodedText.Encode("datafeeds"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propDatafeeds = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propDatafeeds.TryReadProperty(ref reader, options, PropDatafeeds, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Datafeeds = propDatafeeds.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropDatafeeds, value.Datafeeds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedsResponse.g.cs index a56284729ba..94dcfea144a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetDatafeedsResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class GetDatafeedsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropDatafeeds = System.Text.Json.JsonEncodedText.Encode("datafeeds"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propDatafeeds = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propDatafeeds.TryReadProperty(ref reader, options, PropDatafeeds, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Datafeeds = propDatafeeds.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropDatafeeds, value.Datafeeds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetDatafeedsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetDatafeedsResponseConverter))] public sealed partial class GetDatafeedsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal GetDatafeedsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCo public #if NET7_0_OR_GREATER - required +required #endif - long Count { get; set; } +long Count { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Datafeeds { get; set; } +System.Collections.Generic.IReadOnlyCollection Datafeeds { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetFiltersRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetFiltersRequest.Converters.g.cs new file mode 100644 index 00000000000..dcce297178a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetFiltersRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetFiltersRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.GetFiltersRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetFiltersRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetFiltersRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetFiltersRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetFiltersRequest.g.cs index 727ae13df41..6ce941cafe0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetFiltersRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetFiltersRequest.g.cs @@ -40,42 +40,13 @@ public sealed partial class GetFiltersRequestParameters : Elastic.Transport.Requ public int? Size { get => Q("size"); set => Q("size", value); } } -internal sealed partial class GetFiltersRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.GetFiltersRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetFiltersRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetFiltersRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get filters. /// You can get a single filter or all filters. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetFiltersRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetFiltersRequestConverter))] public sealed partial class GetFiltersRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetFiltersRequest(Elastic.Clients.Elasticsearch.Ids? filterId) : base(r => r.Optional("filter_id", filterId)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetFiltersResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetFiltersResponse.Converters.g.cs new file mode 100644 index 00000000000..1279839c268 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetFiltersResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetFiltersResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropFilters = System.Text.Json.JsonEncodedText.Encode("filters"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GetFiltersResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propFilters = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propFilters.TryReadProperty(ref reader, options, PropFilters, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetFiltersResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Filters = propFilters.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetFiltersResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropFilters, value.Filters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetFiltersResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetFiltersResponse.g.cs index 8351c18f618..31fb821d799 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetFiltersResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetFiltersResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class GetFiltersResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropFilters = System.Text.Json.JsonEncodedText.Encode("filters"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GetFiltersResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propFilters = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propFilters.TryReadProperty(ref reader, options, PropFilters, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetFiltersResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Filters = propFilters.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetFiltersResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropFilters, value.Filters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetFiltersResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetFiltersResponseConverter))] public sealed partial class GetFiltersResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal GetFiltersResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCons public #if NET7_0_OR_GREATER - required +required #endif - long Count { get; set; } +long Count { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Filters { get; set; } +System.Collections.Generic.IReadOnlyCollection Filters { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetInfluencersRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetInfluencersRequest.Converters.g.cs new file mode 100644 index 00000000000..d3a1482b3f4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetInfluencersRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetInfluencersRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPage = System.Text.Json.JsonEncodedText.Encode("page"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GetInfluencersRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPage = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPage.TryReadProperty(ref reader, options, PropPage, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetInfluencersRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Page = propPage.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetInfluencersRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPage, value.Page, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetInfluencersRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetInfluencersRequest.g.cs index e92a5f5ae28..0b7e83864da 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetInfluencersRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetInfluencersRequest.g.cs @@ -88,45 +88,6 @@ public sealed partial class GetInfluencersRequestParameters : Elastic.Transport. public System.DateTimeOffset? Start { get => Q("start"); set => Q("start", value); } } -internal sealed partial class GetInfluencersRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPage = System.Text.Json.JsonEncodedText.Encode("page"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GetInfluencersRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPage = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPage.TryReadProperty(ref reader, options, PropPage, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetInfluencersRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Page = propPage.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetInfluencersRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPage, value.Page, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Get anomaly detection job results for influencers. @@ -135,7 +96,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// influencer_field_name is specified in the job configuration. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetInfluencersRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetInfluencersRequestConverter))] public sealed partial class GetInfluencersRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetInfluencersResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetInfluencersResponse.Converters.g.cs new file mode 100644 index 00000000000..b1ebccca010 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetInfluencersResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetInfluencersResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropInfluencers = System.Text.Json.JsonEncodedText.Encode("influencers"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GetInfluencersResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propInfluencers = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propInfluencers.TryReadProperty(ref reader, options, PropInfluencers, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetInfluencersResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Influencers = propInfluencers.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetInfluencersResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropInfluencers, value.Influencers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetInfluencersResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetInfluencersResponse.g.cs index 6338d6ff72d..ab2fc522776 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetInfluencersResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetInfluencersResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class GetInfluencersResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropInfluencers = System.Text.Json.JsonEncodedText.Encode("influencers"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GetInfluencersResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propInfluencers = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propInfluencers.TryReadProperty(ref reader, options, PropInfluencers, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetInfluencersResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Influencers = propInfluencers.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetInfluencersResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropInfluencers, value.Influencers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetInfluencersResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetInfluencersResponseConverter))] public sealed partial class GetInfluencersResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,9 +39,9 @@ internal GetInfluencersResponse(Elastic.Clients.Elasticsearch.Serialization.Json public #if NET7_0_OR_GREATER - required +required #endif - long Count { get; set; } +long Count { get; set; } /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobStatsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobStatsRequest.Converters.g.cs new file mode 100644 index 00000000000..4b53d68ebad --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobStatsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetJobStatsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.GetJobStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetJobStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetJobStatsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobStatsRequest.g.cs index 5a6515d9b7b..b604c8860c7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobStatsRequest.g.cs @@ -56,41 +56,12 @@ public sealed partial class GetJobStatsRequestParameters : Elastic.Transport.Req public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } } -internal sealed partial class GetJobStatsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.GetJobStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetJobStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetJobStatsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get anomaly detection job stats. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetJobStatsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetJobStatsRequestConverter))] public sealed partial class GetJobStatsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetJobStatsRequest(Elastic.Clients.Elasticsearch.Id? jobId) : base(r => r.Optional("job_id", jobId)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobStatsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobStatsResponse.Converters.g.cs new file mode 100644 index 00000000000..fe1ce938945 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobStatsResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetJobStatsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropJobs = System.Text.Json.JsonEncodedText.Encode("jobs"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GetJobStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propJobs = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propJobs.TryReadProperty(ref reader, options, PropJobs, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetJobStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Jobs = propJobs.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetJobStatsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropJobs, value.Jobs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobStatsResponse.g.cs index 831bcedacfc..8cdafc2d0bf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobStatsResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class GetJobStatsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropJobs = System.Text.Json.JsonEncodedText.Encode("jobs"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GetJobStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propJobs = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propJobs.TryReadProperty(ref reader, options, PropJobs, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetJobStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Jobs = propJobs.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetJobStatsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropJobs, value.Jobs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetJobStatsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetJobStatsResponseConverter))] public sealed partial class GetJobStatsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal GetJobStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCon public #if NET7_0_OR_GREATER - required +required #endif - long Count { get; set; } +long Count { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Jobs { get; set; } +System.Collections.Generic.IReadOnlyCollection Jobs { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobsRequest.Converters.g.cs new file mode 100644 index 00000000000..aab41f4d4ca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetJobsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.GetJobsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetJobsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetJobsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobsRequest.g.cs index 585992ebe54..76bef127a37 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobsRequest.g.cs @@ -65,35 +65,6 @@ public sealed partial class GetJobsRequestParameters : Elastic.Transport.Request public bool? ExcludeGenerated { get => Q("exclude_generated"); set => Q("exclude_generated", value); } } -internal sealed partial class GetJobsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.GetJobsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetJobsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetJobsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get anomaly detection jobs configuration info. @@ -103,7 +74,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// _all, by specifying * as the <job_id>, or by omitting the <job_id>. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetJobsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetJobsRequestConverter))] public sealed partial class GetJobsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetJobsRequest(Elastic.Clients.Elasticsearch.Ids? jobId) : base(r => r.Optional("job_id", jobId)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobsResponse.Converters.g.cs new file mode 100644 index 00000000000..0bb0749e497 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobsResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetJobsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropJobs = System.Text.Json.JsonEncodedText.Encode("jobs"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GetJobsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propJobs = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propJobs.TryReadProperty(ref reader, options, PropJobs, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetJobsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Jobs = propJobs.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetJobsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropJobs, value.Jobs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobsResponse.g.cs index 2c21091d747..6baf6b85fc9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetJobsResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class GetJobsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropJobs = System.Text.Json.JsonEncodedText.Encode("jobs"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GetJobsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propJobs = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propJobs.TryReadProperty(ref reader, options, PropJobs, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetJobsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Jobs = propJobs.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetJobsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropJobs, value.Jobs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetJobsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetJobsResponseConverter))] public sealed partial class GetJobsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal GetJobsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstru public #if NET7_0_OR_GREATER - required +required #endif - long Count { get; set; } +long Count { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Jobs { get; set; } +System.Collections.Generic.IReadOnlyCollection Jobs { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetMemoryStatsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetMemoryStatsRequest.Converters.g.cs new file mode 100644 index 00000000000..ea2a0e12397 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetMemoryStatsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetMemoryStatsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.GetMemoryStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetMemoryStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetMemoryStatsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetMemoryStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetMemoryStatsRequest.g.cs index ef3b9e05933..c1e4c1c3ec0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetMemoryStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetMemoryStatsRequest.g.cs @@ -42,35 +42,6 @@ public sealed partial class GetMemoryStatsRequestParameters : Elastic.Transport. public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class GetMemoryStatsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.GetMemoryStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetMemoryStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetMemoryStatsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get machine learning memory usage info. @@ -78,7 +49,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// on each node, both within the JVM heap, and natively, outside of the JVM. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetMemoryStatsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetMemoryStatsRequestConverter))] public sealed partial class GetMemoryStatsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetMemoryStatsRequest(Elastic.Clients.Elasticsearch.Id? nodeId) : base(r => r.Optional("node_id", nodeId)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetMemoryStatsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetMemoryStatsResponse.Converters.g.cs new file mode 100644 index 00000000000..66c1b465d42 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetMemoryStatsResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetMemoryStatsResponseConverter : 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 PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); + private static readonly System.Text.Json.JsonEncodedText PropNodeStatistics = System.Text.Json.JsonEncodedText.Encode("_nodes"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GetMemoryStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClusterName = default; + LocalJsonValue> propNodes = default; + LocalJsonValue propNodeStatistics = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) + { + continue; + } + + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propNodeStatistics.TryReadProperty(ref reader, options, PropNodeStatistics, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetMemoryStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClusterName = propClusterName.Value, + Nodes = propNodes.Value, + NodeStatistics = propNodeStatistics.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetMemoryStatsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNodeStatistics, value.NodeStatistics, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetMemoryStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetMemoryStatsResponse.g.cs index 0f3d45ebb3a..5acf61affc6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetMemoryStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetMemoryStatsResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class GetMemoryStatsResponseConverter : 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 PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); - private static readonly System.Text.Json.JsonEncodedText PropNodeStatistics = System.Text.Json.JsonEncodedText.Encode("_nodes"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GetMemoryStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClusterName = default; - LocalJsonValue> propNodes = default; - LocalJsonValue propNodeStatistics = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) - { - continue; - } - - if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propNodeStatistics.TryReadProperty(ref reader, options, PropNodeStatistics, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetMemoryStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClusterName = propClusterName.Value, - Nodes = propNodes.Value, - NodeStatistics = propNodeStatistics.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetMemoryStatsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); - writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNodeStatistics, value.NodeStatistics, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetMemoryStatsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetMemoryStatsResponseConverter))] public sealed partial class GetMemoryStatsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -96,17 +39,17 @@ internal GetMemoryStatsResponse(Elastic.Clients.Elasticsearch.Serialization.Json public #if NET7_0_OR_GREATER - required +required #endif - string ClusterName { get; set; } +string ClusterName { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } +System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.NodeStatistics NodeStatistics { get; set; } +Elastic.Clients.Elasticsearch.NodeStatistics NodeStatistics { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsRequest.Converters.g.cs new file mode 100644 index 00000000000..40b12c86628 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetModelSnapshotUpgradeStatsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotUpgradeStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotUpgradeStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotUpgradeStatsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsRequest.g.cs index 9a967d95b79..6ff820ff3bb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsRequest.g.cs @@ -55,41 +55,12 @@ public sealed partial class GetModelSnapshotUpgradeStatsRequestParameters : Elas public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } } -internal sealed partial class GetModelSnapshotUpgradeStatsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotUpgradeStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotUpgradeStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotUpgradeStatsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get anomaly detection job model snapshot upgrade usage info. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotUpgradeStatsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetModelSnapshotUpgradeStatsRequestConverter))] public sealed partial class GetModelSnapshotUpgradeStatsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsResponse.Converters.g.cs new file mode 100644 index 00000000000..0f49461baec --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetModelSnapshotUpgradeStatsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropModelSnapshotUpgrades = System.Text.Json.JsonEncodedText.Encode("model_snapshot_upgrades"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotUpgradeStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propModelSnapshotUpgrades = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propModelSnapshotUpgrades.TryReadProperty(ref reader, options, PropModelSnapshotUpgrades, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotUpgradeStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + ModelSnapshotUpgrades = propModelSnapshotUpgrades.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotUpgradeStatsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropModelSnapshotUpgrades, value.ModelSnapshotUpgrades, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsResponse.g.cs index 9a5c1b76036..a4dcc24aab7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotUpgradeStatsResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class GetModelSnapshotUpgradeStatsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropModelSnapshotUpgrades = System.Text.Json.JsonEncodedText.Encode("model_snapshot_upgrades"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotUpgradeStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propModelSnapshotUpgrades = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propModelSnapshotUpgrades.TryReadProperty(ref reader, options, PropModelSnapshotUpgrades, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotUpgradeStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - ModelSnapshotUpgrades = propModelSnapshotUpgrades.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotUpgradeStatsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropModelSnapshotUpgrades, value.ModelSnapshotUpgrades, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotUpgradeStatsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetModelSnapshotUpgradeStatsResponseConverter))] public sealed partial class GetModelSnapshotUpgradeStatsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal GetModelSnapshotUpgradeStatsResponse(Elastic.Clients.Elasticsearch.Seri public #if NET7_0_OR_GREATER - required +required #endif - long Count { get; set; } +long Count { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection ModelSnapshotUpgrades { get; set; } +System.Collections.Generic.IReadOnlyCollection ModelSnapshotUpgrades { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotsRequest.Converters.g.cs new file mode 100644 index 00000000000..76ed072bdb9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotsRequest.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetModelSnapshotsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDesc = System.Text.Json.JsonEncodedText.Encode("desc"); + private static readonly System.Text.Json.JsonEncodedText PropEnd = System.Text.Json.JsonEncodedText.Encode("end"); + private static readonly System.Text.Json.JsonEncodedText PropPage = System.Text.Json.JsonEncodedText.Encode("page"); + private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); + private static readonly System.Text.Json.JsonEncodedText PropStart = System.Text.Json.JsonEncodedText.Encode("start"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDesc = default; + LocalJsonValue propEnd = default; + LocalJsonValue propPage = default; + LocalJsonValue propSort = default; + LocalJsonValue propStart = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDesc.TryReadProperty(ref reader, options, PropDesc, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEnd.TryReadProperty(ref reader, options, PropEnd, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propPage.TryReadProperty(ref reader, options, PropPage, null)) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, null)) + { + continue; + } + + if (propStart.TryReadProperty(ref reader, options, PropStart, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Desc = propDesc.Value, + End = propEnd.Value, + Page = propPage.Value, + Sort = propSort.Value, + Start = propStart.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDesc, value.Desc, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEnd, value.End, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropPage, value.Page, null, null); + writer.WriteProperty(options, PropSort, value.Sort, null, null); + writer.WriteProperty(options, PropStart, value.Start, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotsRequest.g.cs index 6c01ea208ba..86a3a2979c4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotsRequest.g.cs @@ -40,87 +40,12 @@ public sealed partial class GetModelSnapshotsRequestParameters : Elastic.Transpo public int? Size { get => Q("size"); set => Q("size", value); } } -internal sealed partial class GetModelSnapshotsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDesc = System.Text.Json.JsonEncodedText.Encode("desc"); - private static readonly System.Text.Json.JsonEncodedText PropEnd = System.Text.Json.JsonEncodedText.Encode("end"); - private static readonly System.Text.Json.JsonEncodedText PropPage = System.Text.Json.JsonEncodedText.Encode("page"); - private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); - private static readonly System.Text.Json.JsonEncodedText PropStart = System.Text.Json.JsonEncodedText.Encode("start"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDesc = default; - LocalJsonValue propEnd = default; - LocalJsonValue propPage = default; - LocalJsonValue propSort = default; - LocalJsonValue propStart = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDesc.TryReadProperty(ref reader, options, PropDesc, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEnd.TryReadProperty(ref reader, options, PropEnd, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propPage.TryReadProperty(ref reader, options, PropPage, null)) - { - continue; - } - - if (propSort.TryReadProperty(ref reader, options, PropSort, null)) - { - continue; - } - - if (propStart.TryReadProperty(ref reader, options, PropStart, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Desc = propDesc.Value, - End = propEnd.Value, - Page = propPage.Value, - Sort = propSort.Value, - Start = propStart.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDesc, value.Desc, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEnd, value.End, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropPage, value.Page, null, null); - writer.WriteProperty(options, PropSort, value.Sort, null, null); - writer.WriteProperty(options, PropStart, value.Start, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteEndObject(); - } -} - /// /// /// Get model snapshots info. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetModelSnapshotsRequestConverter))] public sealed partial class GetModelSnapshotsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotsResponse.Converters.g.cs new file mode 100644 index 00000000000..47ea3ab0670 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotsResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetModelSnapshotsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropModelSnapshots = System.Text.Json.JsonEncodedText.Encode("model_snapshots"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propModelSnapshots = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propModelSnapshots.TryReadProperty(ref reader, options, PropModelSnapshots, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + ModelSnapshots = propModelSnapshots.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropModelSnapshots, value.ModelSnapshots, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotsResponse.g.cs index be1ef57e781..c8fd4ebc71f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetModelSnapshotsResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class GetModelSnapshotsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropModelSnapshots = System.Text.Json.JsonEncodedText.Encode("model_snapshots"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propModelSnapshots = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propModelSnapshots.TryReadProperty(ref reader, options, PropModelSnapshots, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - ModelSnapshots = propModelSnapshots.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropModelSnapshots, value.ModelSnapshots, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetModelSnapshotsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetModelSnapshotsResponseConverter))] public sealed partial class GetModelSnapshotsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal GetModelSnapshotsResponse(Elastic.Clients.Elasticsearch.Serialization.J public #if NET7_0_OR_GREATER - required +required #endif - long Count { get; set; } +long Count { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection ModelSnapshots { get; set; } +System.Collections.Generic.IReadOnlyCollection ModelSnapshots { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetOverallBucketsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetOverallBucketsRequest.Converters.g.cs new file mode 100644 index 00000000000..b82d3c802f0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetOverallBucketsRequest.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetOverallBucketsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowNoMatch = System.Text.Json.JsonEncodedText.Encode("allow_no_match"); + private static readonly System.Text.Json.JsonEncodedText PropBucketSpan = System.Text.Json.JsonEncodedText.Encode("bucket_span"); + private static readonly System.Text.Json.JsonEncodedText PropEnd = System.Text.Json.JsonEncodedText.Encode("end"); + private static readonly System.Text.Json.JsonEncodedText PropExcludeInterim = System.Text.Json.JsonEncodedText.Encode("exclude_interim"); + private static readonly System.Text.Json.JsonEncodedText PropOverallScore = System.Text.Json.JsonEncodedText.Encode("overall_score"); + private static readonly System.Text.Json.JsonEncodedText PropStart = System.Text.Json.JsonEncodedText.Encode("start"); + private static readonly System.Text.Json.JsonEncodedText PropTopN = System.Text.Json.JsonEncodedText.Encode("top_n"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GetOverallBucketsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowNoMatch = default; + LocalJsonValue propBucketSpan = default; + LocalJsonValue propEnd = default; + LocalJsonValue propExcludeInterim = default; + LocalJsonValue?> propOverallScore = default; + LocalJsonValue propStart = default; + LocalJsonValue propTopN = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowNoMatch.TryReadProperty(ref reader, options, PropAllowNoMatch, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propBucketSpan.TryReadProperty(ref reader, options, PropBucketSpan, null)) + { + continue; + } + + if (propEnd.TryReadProperty(ref reader, options, PropEnd, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propExcludeInterim.TryReadProperty(ref reader, options, PropExcludeInterim, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOverallScore.TryReadProperty(ref reader, options, PropOverallScore, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) + { + continue; + } + + if (propStart.TryReadProperty(ref reader, options, PropStart, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propTopN.TryReadProperty(ref reader, options, PropTopN, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetOverallBucketsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowNoMatch = propAllowNoMatch.Value, + BucketSpan = propBucketSpan.Value, + End = propEnd.Value, + ExcludeInterim = propExcludeInterim.Value, + OverallScore = propOverallScore.Value, + Start = propStart.Value, + TopN = propTopN.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetOverallBucketsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowNoMatch, value.AllowNoMatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropBucketSpan, value.BucketSpan, null, null); + writer.WriteProperty(options, PropEnd, value.End, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropExcludeInterim, value.ExcludeInterim, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOverallScore, value.OverallScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); + writer.WriteProperty(options, PropStart, value.Start, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropTopN, value.TopN, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetOverallBucketsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetOverallBucketsRequest.g.cs index 61c4da75b8e..e9c3f4adee4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetOverallBucketsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetOverallBucketsRequest.g.cs @@ -27,99 +27,6 @@ public sealed partial class GetOverallBucketsRequestParameters : Elastic.Transpo { } -internal sealed partial class GetOverallBucketsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowNoMatch = System.Text.Json.JsonEncodedText.Encode("allow_no_match"); - private static readonly System.Text.Json.JsonEncodedText PropBucketSpan = System.Text.Json.JsonEncodedText.Encode("bucket_span"); - private static readonly System.Text.Json.JsonEncodedText PropEnd = System.Text.Json.JsonEncodedText.Encode("end"); - private static readonly System.Text.Json.JsonEncodedText PropExcludeInterim = System.Text.Json.JsonEncodedText.Encode("exclude_interim"); - private static readonly System.Text.Json.JsonEncodedText PropOverallScore = System.Text.Json.JsonEncodedText.Encode("overall_score"); - private static readonly System.Text.Json.JsonEncodedText PropStart = System.Text.Json.JsonEncodedText.Encode("start"); - private static readonly System.Text.Json.JsonEncodedText PropTopN = System.Text.Json.JsonEncodedText.Encode("top_n"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GetOverallBucketsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowNoMatch = default; - LocalJsonValue propBucketSpan = default; - LocalJsonValue propEnd = default; - LocalJsonValue propExcludeInterim = default; - LocalJsonValue?> propOverallScore = default; - LocalJsonValue propStart = default; - LocalJsonValue propTopN = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowNoMatch.TryReadProperty(ref reader, options, PropAllowNoMatch, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propBucketSpan.TryReadProperty(ref reader, options, PropBucketSpan, null)) - { - continue; - } - - if (propEnd.TryReadProperty(ref reader, options, PropEnd, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propExcludeInterim.TryReadProperty(ref reader, options, PropExcludeInterim, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOverallScore.TryReadProperty(ref reader, options, PropOverallScore, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) - { - continue; - } - - if (propStart.TryReadProperty(ref reader, options, PropStart, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propTopN.TryReadProperty(ref reader, options, PropTopN, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetOverallBucketsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowNoMatch = propAllowNoMatch.Value, - BucketSpan = propBucketSpan.Value, - End = propEnd.Value, - ExcludeInterim = propExcludeInterim.Value, - OverallScore = propOverallScore.Value, - Start = propStart.Value, - TopN = propTopN.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetOverallBucketsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowNoMatch, value.AllowNoMatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropBucketSpan, value.BucketSpan, null, null); - writer.WriteProperty(options, PropEnd, value.End, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropExcludeInterim, value.ExcludeInterim, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOverallScore, value.OverallScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); - writer.WriteProperty(options, PropStart, value.Start, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropTopN, value.TopN, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Get overall bucket results. @@ -145,7 +52,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// jobs' largest bucket span. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetOverallBucketsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetOverallBucketsRequestConverter))] public sealed partial class GetOverallBucketsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetOverallBucketsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetOverallBucketsResponse.Converters.g.cs new file mode 100644 index 00000000000..76241fe2d91 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetOverallBucketsResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetOverallBucketsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropOverallBuckets = System.Text.Json.JsonEncodedText.Encode("overall_buckets"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GetOverallBucketsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propOverallBuckets = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propOverallBuckets.TryReadProperty(ref reader, options, PropOverallBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetOverallBucketsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + OverallBuckets = propOverallBuckets.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetOverallBucketsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropOverallBuckets, value.OverallBuckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetOverallBucketsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetOverallBucketsResponse.g.cs index e41bb15d2d3..1810e4c721c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetOverallBucketsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetOverallBucketsResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class GetOverallBucketsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropOverallBuckets = System.Text.Json.JsonEncodedText.Encode("overall_buckets"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GetOverallBucketsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propOverallBuckets = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propOverallBuckets.TryReadProperty(ref reader, options, PropOverallBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetOverallBucketsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - OverallBuckets = propOverallBuckets.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetOverallBucketsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropOverallBuckets, value.OverallBuckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetOverallBucketsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetOverallBucketsResponseConverter))] public sealed partial class GetOverallBucketsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,9 +39,9 @@ internal GetOverallBucketsResponse(Elastic.Clients.Elasticsearch.Serialization.J public #if NET7_0_OR_GREATER - required +required #endif - long Count { get; set; } +long Count { get; set; } /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetRecordsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetRecordsRequest.Converters.g.cs new file mode 100644 index 00000000000..f8e7e620bff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetRecordsRequest.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetRecordsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDesc = System.Text.Json.JsonEncodedText.Encode("desc"); + private static readonly System.Text.Json.JsonEncodedText PropEnd = System.Text.Json.JsonEncodedText.Encode("end"); + private static readonly System.Text.Json.JsonEncodedText PropExcludeInterim = System.Text.Json.JsonEncodedText.Encode("exclude_interim"); + private static readonly System.Text.Json.JsonEncodedText PropPage = System.Text.Json.JsonEncodedText.Encode("page"); + private static readonly System.Text.Json.JsonEncodedText PropRecordScore = System.Text.Json.JsonEncodedText.Encode("record_score"); + private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); + private static readonly System.Text.Json.JsonEncodedText PropStart = System.Text.Json.JsonEncodedText.Encode("start"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GetRecordsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDesc = default; + LocalJsonValue propEnd = default; + LocalJsonValue propExcludeInterim = default; + LocalJsonValue propPage = default; + LocalJsonValue propRecordScore = default; + LocalJsonValue propSort = default; + LocalJsonValue propStart = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDesc.TryReadProperty(ref reader, options, PropDesc, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEnd.TryReadProperty(ref reader, options, PropEnd, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propExcludeInterim.TryReadProperty(ref reader, options, PropExcludeInterim, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPage.TryReadProperty(ref reader, options, PropPage, null)) + { + continue; + } + + if (propRecordScore.TryReadProperty(ref reader, options, PropRecordScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, null)) + { + continue; + } + + if (propStart.TryReadProperty(ref reader, options, PropStart, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetRecordsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Desc = propDesc.Value, + End = propEnd.Value, + ExcludeInterim = propExcludeInterim.Value, + Page = propPage.Value, + RecordScore = propRecordScore.Value, + Sort = propSort.Value, + Start = propStart.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetRecordsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDesc, value.Desc, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEnd, value.End, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropExcludeInterim, value.ExcludeInterim, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPage, value.Page, null, null); + writer.WriteProperty(options, PropRecordScore, value.RecordScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSort, value.Sort, null, null); + writer.WriteProperty(options, PropStart, value.Start, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetRecordsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetRecordsRequest.g.cs index 4fa2e8f1838..5a745c01963 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetRecordsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetRecordsRequest.g.cs @@ -40,99 +40,6 @@ public sealed partial class GetRecordsRequestParameters : Elastic.Transport.Requ public int? Size { get => Q("size"); set => Q("size", value); } } -internal sealed partial class GetRecordsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDesc = System.Text.Json.JsonEncodedText.Encode("desc"); - private static readonly System.Text.Json.JsonEncodedText PropEnd = System.Text.Json.JsonEncodedText.Encode("end"); - private static readonly System.Text.Json.JsonEncodedText PropExcludeInterim = System.Text.Json.JsonEncodedText.Encode("exclude_interim"); - private static readonly System.Text.Json.JsonEncodedText PropPage = System.Text.Json.JsonEncodedText.Encode("page"); - private static readonly System.Text.Json.JsonEncodedText PropRecordScore = System.Text.Json.JsonEncodedText.Encode("record_score"); - private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); - private static readonly System.Text.Json.JsonEncodedText PropStart = System.Text.Json.JsonEncodedText.Encode("start"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GetRecordsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDesc = default; - LocalJsonValue propEnd = default; - LocalJsonValue propExcludeInterim = default; - LocalJsonValue propPage = default; - LocalJsonValue propRecordScore = default; - LocalJsonValue propSort = default; - LocalJsonValue propStart = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDesc.TryReadProperty(ref reader, options, PropDesc, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEnd.TryReadProperty(ref reader, options, PropEnd, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propExcludeInterim.TryReadProperty(ref reader, options, PropExcludeInterim, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPage.TryReadProperty(ref reader, options, PropPage, null)) - { - continue; - } - - if (propRecordScore.TryReadProperty(ref reader, options, PropRecordScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSort.TryReadProperty(ref reader, options, PropSort, null)) - { - continue; - } - - if (propStart.TryReadProperty(ref reader, options, PropStart, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetRecordsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Desc = propDesc.Value, - End = propEnd.Value, - ExcludeInterim = propExcludeInterim.Value, - Page = propPage.Value, - RecordScore = propRecordScore.Value, - Sort = propSort.Value, - Start = propStart.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetRecordsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDesc, value.Desc, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEnd, value.End, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropExcludeInterim, value.ExcludeInterim, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPage, value.Page, null, null); - writer.WriteProperty(options, PropRecordScore, value.RecordScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSort, value.Sort, null, null); - writer.WriteProperty(options, PropStart, value.Start, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteEndObject(); - } -} - /// /// /// Get anomaly records for an anomaly detection job. @@ -148,7 +55,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// number of detectors. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetRecordsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetRecordsRequestConverter))] public sealed partial class GetRecordsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetRecordsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetRecordsResponse.Converters.g.cs new file mode 100644 index 00000000000..a5b32922e11 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetRecordsResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetRecordsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropRecords = System.Text.Json.JsonEncodedText.Encode("records"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GetRecordsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propRecords = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propRecords.TryReadProperty(ref reader, options, PropRecords, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetRecordsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Records = propRecords.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetRecordsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropRecords, value.Records, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetRecordsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetRecordsResponse.g.cs index 32c25f1e78a..cef436a3667 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetRecordsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetRecordsResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class GetRecordsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropRecords = System.Text.Json.JsonEncodedText.Encode("records"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GetRecordsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propRecords = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propRecords.TryReadProperty(ref reader, options, PropRecords, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetRecordsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Records = propRecords.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetRecordsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropRecords, value.Records, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetRecordsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetRecordsResponseConverter))] public sealed partial class GetRecordsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal GetRecordsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCons public #if NET7_0_OR_GREATER - required +required #endif - long Count { get; set; } +long Count { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Records { get; set; } +System.Collections.Generic.IReadOnlyCollection Records { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsRequest.Converters.g.cs new file mode 100644 index 00000000000..f4c8bc4fcc6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetTrainedModelsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsRequest.g.cs index 0e2b73612cb..aa3b9580131 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsRequest.g.cs @@ -102,41 +102,12 @@ public sealed partial class GetTrainedModelsRequestParameters : Elastic.Transpor public System.Collections.Generic.ICollection? Tags { get => Q?>("tags"); set => Q("tags", value); } } -internal sealed partial class GetTrainedModelsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get trained model configuration info. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetTrainedModelsRequestConverter))] public sealed partial class GetTrainedModelsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetTrainedModelsRequest(Elastic.Clients.Elasticsearch.Ids? modelId) : base(r => r.Optional("model_id", modelId)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsResponse.Converters.g.cs new file mode 100644 index 00000000000..ae3e847df58 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetTrainedModelsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropTrainedModelConfigs = System.Text.Json.JsonEncodedText.Encode("trained_model_configs"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propTrainedModelConfigs = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propTrainedModelConfigs.TryReadProperty(ref reader, options, PropTrainedModelConfigs, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + TrainedModelConfigs = propTrainedModelConfigs.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropTrainedModelConfigs, value.TrainedModelConfigs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsResponse.g.cs index 10c8b2e8614..6c9ae69b08d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class GetTrainedModelsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropTrainedModelConfigs = System.Text.Json.JsonEncodedText.Encode("trained_model_configs"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propTrainedModelConfigs = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propTrainedModelConfigs.TryReadProperty(ref reader, options, PropTrainedModelConfigs, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - TrainedModelConfigs = propTrainedModelConfigs.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropTrainedModelConfigs, value.TrainedModelConfigs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetTrainedModelsResponseConverter))] public sealed partial class GetTrainedModelsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,9 +39,9 @@ internal GetTrainedModelsResponse(Elastic.Clients.Elasticsearch.Serialization.Js public #if NET7_0_OR_GREATER - required +required #endif - int Count { get; set; } +int Count { get; set; } /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsStatsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsStatsRequest.Converters.g.cs new file mode 100644 index 00000000000..98c09c9eb3e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsStatsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetTrainedModelsStatsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsStatsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsStatsRequest.g.cs index b116e69c430..90d33f24bfa 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsStatsRequest.g.cs @@ -68,35 +68,6 @@ public sealed partial class GetTrainedModelsStatsRequestParameters : Elastic.Tra public int? Size { get => Q("size"); set => Q("size", value); } } -internal sealed partial class GetTrainedModelsStatsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsStatsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get trained models usage info. @@ -104,7 +75,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// models in a single API request by using a comma-separated list of model IDs or a wildcard expression. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsStatsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetTrainedModelsStatsRequestConverter))] public sealed partial class GetTrainedModelsStatsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetTrainedModelsStatsRequest(Elastic.Clients.Elasticsearch.Ids? modelId) : base(r => r.Optional("model_id", modelId)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsStatsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsStatsResponse.Converters.g.cs new file mode 100644 index 00000000000..0102fd46796 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsStatsResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GetTrainedModelsStatsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropTrainedModelStats = System.Text.Json.JsonEncodedText.Encode("trained_model_stats"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propTrainedModelStats = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propTrainedModelStats.TryReadProperty(ref reader, options, PropTrainedModelStats, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + TrainedModelStats = propTrainedModelStats.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsStatsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropTrainedModelStats, value.TrainedModelStats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsStatsResponse.g.cs index 46d3dd71c72..4aa3e7cad3f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/GetTrainedModelsStatsResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class GetTrainedModelsStatsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropTrainedModelStats = System.Text.Json.JsonEncodedText.Encode("trained_model_stats"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propTrainedModelStats = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propTrainedModelStats.TryReadProperty(ref reader, options, PropTrainedModelStats, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - TrainedModelStats = propTrainedModelStats.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsStatsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropTrainedModelStats, value.TrainedModelStats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GetTrainedModelsStatsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GetTrainedModelsStatsResponseConverter))] public sealed partial class GetTrainedModelsStatsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/InferTrainedModelRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/InferTrainedModelRequest.Converters.g.cs new file mode 100644 index 00000000000..0b770f73e66 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/InferTrainedModelRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class InferTrainedModelRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceConfig = System.Text.Json.JsonEncodedText.Encode("inference_config"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.InferTrainedModelRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>> propDocs = default; + LocalJsonValue propInferenceConfig = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocs.TryReadProperty(ref reader, options, PropDocs, static System.Collections.Generic.ICollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)!)) + { + continue; + } + + if (propInferenceConfig.TryReadProperty(ref reader, options, PropInferenceConfig, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.InferTrainedModelRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Docs = propDocs.Value, + InferenceConfig = propInferenceConfig.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.InferTrainedModelRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocs, value.Docs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection> v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))))); + writer.WriteProperty(options, PropInferenceConfig, value.InferenceConfig, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/InferTrainedModelRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/InferTrainedModelRequest.g.cs index d841a287444..447d8326aac 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/InferTrainedModelRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/InferTrainedModelRequest.g.cs @@ -33,60 +33,12 @@ public sealed partial class InferTrainedModelRequestParameters : Elastic.Transpo public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class InferTrainedModelRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceConfig = System.Text.Json.JsonEncodedText.Encode("inference_config"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.InferTrainedModelRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>> propDocs = default; - LocalJsonValue propInferenceConfig = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocs.TryReadProperty(ref reader, options, PropDocs, static System.Collections.Generic.ICollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)!)) - { - continue; - } - - if (propInferenceConfig.TryReadProperty(ref reader, options, PropInferenceConfig, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.InferTrainedModelRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Docs = propDocs.Value, - InferenceConfig = propInferenceConfig.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.InferTrainedModelRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocs, value.Docs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection> v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))))); - writer.WriteProperty(options, PropInferenceConfig, value.InferenceConfig, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Evaluate a trained model. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.InferTrainedModelRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.InferTrainedModelRequestConverter))] public sealed partial class InferTrainedModelRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/InferTrainedModelResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/InferTrainedModelResponse.Converters.g.cs new file mode 100644 index 00000000000..357593483c3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/InferTrainedModelResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class InferTrainedModelResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropInferenceResults = System.Text.Json.JsonEncodedText.Encode("inference_results"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.InferTrainedModelResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propInferenceResults = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propInferenceResults.TryReadProperty(ref reader, options, PropInferenceResults, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.InferTrainedModelResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + InferenceResults = propInferenceResults.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.InferTrainedModelResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropInferenceResults, value.InferenceResults, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/InferTrainedModelResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/InferTrainedModelResponse.g.cs index 6ea4adf5183..b639f5234aa 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/InferTrainedModelResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/InferTrainedModelResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class InferTrainedModelResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropInferenceResults = System.Text.Json.JsonEncodedText.Encode("inference_results"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.InferTrainedModelResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propInferenceResults = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propInferenceResults.TryReadProperty(ref reader, options, PropInferenceResults, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.InferTrainedModelResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - InferenceResults = propInferenceResults.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.InferTrainedModelResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropInferenceResults, value.InferenceResults, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.InferTrainedModelResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.InferTrainedModelResponseConverter))] public sealed partial class InferTrainedModelResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal InferTrainedModelResponse(Elastic.Clients.Elasticsearch.Serialization.J public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection InferenceResults { get; set; } +System.Collections.Generic.IReadOnlyCollection InferenceResults { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/MlInfoRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/MlInfoRequest.Converters.g.cs new file mode 100644 index 00000000000..769359cdced --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/MlInfoRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class MlInfoRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.MlInfoRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.MlInfoRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.MlInfoRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/MlInfoRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/MlInfoRequest.g.cs index 0d520f79b3d..70f48c66eac 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/MlInfoRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/MlInfoRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class MlInfoRequestParameters : Elastic.Transport.RequestP { } -internal sealed partial class MlInfoRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.MlInfoRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.MlInfoRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.MlInfoRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get machine learning information. @@ -68,7 +39,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// cluster configuration. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.MlInfoRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.MlInfoRequestConverter))] public sealed partial class MlInfoRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/MlInfoResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/MlInfoResponse.Converters.g.cs new file mode 100644 index 00000000000..60d47de6c46 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/MlInfoResponse.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class MlInfoResponseConverter : 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 PropLimits = System.Text.Json.JsonEncodedText.Encode("limits"); + private static readonly System.Text.Json.JsonEncodedText PropNativeCode = System.Text.Json.JsonEncodedText.Encode("native_code"); + private static readonly System.Text.Json.JsonEncodedText PropUpgradeMode = System.Text.Json.JsonEncodedText.Encode("upgrade_mode"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.MlInfoResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDefaults = default; + LocalJsonValue propLimits = default; + LocalJsonValue propNativeCode = default; + LocalJsonValue propUpgradeMode = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDefaults.TryReadProperty(ref reader, options, PropDefaults, null)) + { + continue; + } + + if (propLimits.TryReadProperty(ref reader, options, PropLimits, null)) + { + continue; + } + + if (propNativeCode.TryReadProperty(ref reader, options, PropNativeCode, null)) + { + continue; + } + + if (propUpgradeMode.TryReadProperty(ref reader, options, PropUpgradeMode, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.MlInfoResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Defaults = propDefaults.Value, + Limits = propLimits.Value, + NativeCode = propNativeCode.Value, + UpgradeMode = propUpgradeMode.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.MlInfoResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDefaults, value.Defaults, null, null); + writer.WriteProperty(options, PropLimits, value.Limits, null, null); + writer.WriteProperty(options, PropNativeCode, value.NativeCode, null, null); + writer.WriteProperty(options, PropUpgradeMode, value.UpgradeMode, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/MlInfoResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/MlInfoResponse.g.cs index 4115a3e11dd..4b51d415f41 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/MlInfoResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/MlInfoResponse.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class MlInfoResponseConverter : 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 PropLimits = System.Text.Json.JsonEncodedText.Encode("limits"); - private static readonly System.Text.Json.JsonEncodedText PropNativeCode = System.Text.Json.JsonEncodedText.Encode("native_code"); - private static readonly System.Text.Json.JsonEncodedText PropUpgradeMode = System.Text.Json.JsonEncodedText.Encode("upgrade_mode"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.MlInfoResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDefaults = default; - LocalJsonValue propLimits = default; - LocalJsonValue propNativeCode = default; - LocalJsonValue propUpgradeMode = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDefaults.TryReadProperty(ref reader, options, PropDefaults, null)) - { - continue; - } - - if (propLimits.TryReadProperty(ref reader, options, PropLimits, null)) - { - continue; - } - - if (propNativeCode.TryReadProperty(ref reader, options, PropNativeCode, null)) - { - continue; - } - - if (propUpgradeMode.TryReadProperty(ref reader, options, PropUpgradeMode, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.MlInfoResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Defaults = propDefaults.Value, - Limits = propLimits.Value, - NativeCode = propNativeCode.Value, - UpgradeMode = propUpgradeMode.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.MlInfoResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDefaults, value.Defaults, null, null); - writer.WriteProperty(options, PropLimits, value.Limits, null, null); - writer.WriteProperty(options, PropNativeCode, value.NativeCode, null, null); - writer.WriteProperty(options, PropUpgradeMode, value.UpgradeMode, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.MlInfoResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.MlInfoResponseConverter))] public sealed partial class MlInfoResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -105,22 +39,22 @@ internal MlInfoResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstruc public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.MachineLearning.Defaults Defaults { get; set; } +Elastic.Clients.Elasticsearch.MachineLearning.Defaults Defaults { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.MachineLearning.Limits Limits { get; set; } +Elastic.Clients.Elasticsearch.MachineLearning.Limits Limits { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.MachineLearning.NativeCode NativeCode { get; set; } +Elastic.Clients.Elasticsearch.MachineLearning.NativeCode NativeCode { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool UpgradeMode { get; set; } +bool UpgradeMode { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/OpenJobRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/OpenJobRequest.Converters.g.cs new file mode 100644 index 00000000000..b6a4abdc970 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/OpenJobRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class OpenJobRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropTimeout = System.Text.Json.JsonEncodedText.Encode("timeout"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.OpenJobRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propTimeout = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propTimeout.TryReadProperty(ref reader, options, PropTimeout, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.OpenJobRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Timeout = propTimeout.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.OpenJobRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropTimeout, value.Timeout, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/OpenJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/OpenJobRequest.g.cs index d266676d157..fcb4466889a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/OpenJobRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/OpenJobRequest.g.cs @@ -27,45 +27,6 @@ public sealed partial class OpenJobRequestParameters : Elastic.Transport.Request { } -internal sealed partial class OpenJobRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropTimeout = System.Text.Json.JsonEncodedText.Encode("timeout"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.OpenJobRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propTimeout = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propTimeout.TryReadProperty(ref reader, options, PropTimeout, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.OpenJobRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Timeout = propTimeout.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.OpenJobRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropTimeout, value.Timeout, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Open anomaly detection jobs. @@ -79,7 +40,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// new data is received. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.OpenJobRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.OpenJobRequestConverter))] public sealed partial class OpenJobRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/OpenJobResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/OpenJobResponse.Converters.g.cs new file mode 100644 index 00000000000..f889894f708 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/OpenJobResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class OpenJobResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); + private static readonly System.Text.Json.JsonEncodedText PropOpened = System.Text.Json.JsonEncodedText.Encode("opened"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.OpenJobResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propNode = default; + LocalJsonValue propOpened = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNode.TryReadProperty(ref reader, options, PropNode, null)) + { + continue; + } + + if (propOpened.TryReadProperty(ref reader, options, PropOpened, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.OpenJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Node = propNode.Value, + Opened = propOpened.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.OpenJobResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNode, value.Node, null, null); + writer.WriteProperty(options, PropOpened, value.Opened, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/OpenJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/OpenJobResponse.g.cs index d8e0144ae85..93dd7b20189 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/OpenJobResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/OpenJobResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class OpenJobResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); - private static readonly System.Text.Json.JsonEncodedText PropOpened = System.Text.Json.JsonEncodedText.Encode("opened"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.OpenJobResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propNode = default; - LocalJsonValue propOpened = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNode.TryReadProperty(ref reader, options, PropNode, null)) - { - continue; - } - - if (propOpened.TryReadProperty(ref reader, options, PropOpened, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.OpenJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Node = propNode.Value, - Opened = propOpened.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.OpenJobResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNode, value.Node, null, null); - writer.WriteProperty(options, PropOpened, value.Opened, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.OpenJobResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.OpenJobResponseConverter))] public sealed partial class OpenJobResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PostCalendarEventsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PostCalendarEventsRequest.Converters.g.cs new file mode 100644 index 00000000000..628884629a4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PostCalendarEventsRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PostCalendarEventsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEvents = System.Text.Json.JsonEncodedText.Encode("events"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.PostCalendarEventsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propEvents = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEvents.TryReadProperty(ref reader, options, PropEvents, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PostCalendarEventsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Events = propEvents.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PostCalendarEventsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEvents, value.Events, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PostCalendarEventsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PostCalendarEventsRequest.g.cs index 7fb73de7334..1c7c13bc147 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PostCalendarEventsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PostCalendarEventsRequest.g.cs @@ -27,51 +27,12 @@ public sealed partial class PostCalendarEventsRequestParameters : Elastic.Transp { } -internal sealed partial class PostCalendarEventsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEvents = System.Text.Json.JsonEncodedText.Encode("events"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.PostCalendarEventsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propEvents = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEvents.TryReadProperty(ref reader, options, PropEvents, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PostCalendarEventsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Events = propEvents.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PostCalendarEventsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEvents, value.Events, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// Add scheduled events to the calendar. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PostCalendarEventsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PostCalendarEventsRequestConverter))] public sealed partial class PostCalendarEventsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PostCalendarEventsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PostCalendarEventsResponse.Converters.g.cs new file mode 100644 index 00000000000..d23590dcf43 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PostCalendarEventsResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PostCalendarEventsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEvents = System.Text.Json.JsonEncodedText.Encode("events"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.PostCalendarEventsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propEvents = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEvents.TryReadProperty(ref reader, options, PropEvents, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PostCalendarEventsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Events = propEvents.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PostCalendarEventsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEvents, value.Events, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PostCalendarEventsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PostCalendarEventsResponse.g.cs index 5f5975818b1..16fb533a0f0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PostCalendarEventsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PostCalendarEventsResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class PostCalendarEventsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEvents = System.Text.Json.JsonEncodedText.Encode("events"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.PostCalendarEventsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propEvents = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEvents.TryReadProperty(ref reader, options, PropEvents, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PostCalendarEventsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Events = propEvents.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PostCalendarEventsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEvents, value.Events, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PostCalendarEventsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PostCalendarEventsResponseConverter))] public sealed partial class PostCalendarEventsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal PostCalendarEventsResponse(Elastic.Clients.Elasticsearch.Serialization. public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Events { get; set; } +System.Collections.Generic.IReadOnlyCollection Events { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsRequest.Converters.g.cs new file mode 100644 index 00000000000..4a5d82ae3b1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PreviewDataFrameAnalyticsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropConfig = System.Text.Json.JsonEncodedText.Encode("config"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.PreviewDataFrameAnalyticsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propConfig = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propConfig.TryReadProperty(ref reader, options, PropConfig, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PreviewDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Config = propConfig.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PreviewDataFrameAnalyticsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropConfig, value.Config, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsRequest.g.cs index f281b92bfcd..4aa8c4d44e0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsRequest.g.cs @@ -27,52 +27,13 @@ public sealed partial class PreviewDataFrameAnalyticsRequestParameters : Elastic { } -internal sealed partial class PreviewDataFrameAnalyticsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropConfig = System.Text.Json.JsonEncodedText.Encode("config"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.PreviewDataFrameAnalyticsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propConfig = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propConfig.TryReadProperty(ref reader, options, PropConfig, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PreviewDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Config = propConfig.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PreviewDataFrameAnalyticsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropConfig, value.Config, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Preview features used by data frame analytics. /// Preview the extracted features used by a data frame analytics config. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PreviewDataFrameAnalyticsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PreviewDataFrameAnalyticsRequestConverter))] public sealed partial class PreviewDataFrameAnalyticsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public PreviewDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsResponse.Converters.g.cs new file mode 100644 index 00000000000..6ab37904a67 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PreviewDataFrameAnalyticsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFeatureValues = System.Text.Json.JsonEncodedText.Encode("feature_values"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.PreviewDataFrameAnalyticsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>> propFeatureValues = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFeatureValues.TryReadProperty(ref reader, options, PropFeatureValues, static System.Collections.Generic.IReadOnlyCollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PreviewDataFrameAnalyticsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FeatureValues = propFeatureValues.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PreviewDataFrameAnalyticsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFeatureValues, value.FeatureValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection> v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsResponse.g.cs index b142d44fdcf..df085b24429 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PreviewDataFrameAnalyticsResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class PreviewDataFrameAnalyticsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFeatureValues = System.Text.Json.JsonEncodedText.Encode("feature_values"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.PreviewDataFrameAnalyticsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>> propFeatureValues = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFeatureValues.TryReadProperty(ref reader, options, PropFeatureValues, static System.Collections.Generic.IReadOnlyCollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PreviewDataFrameAnalyticsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FeatureValues = propFeatureValues.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PreviewDataFrameAnalyticsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFeatureValues, value.FeatureValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection> v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PreviewDataFrameAnalyticsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PreviewDataFrameAnalyticsResponseConverter))] public sealed partial class PreviewDataFrameAnalyticsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarJobRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarJobRequest.Converters.g.cs new file mode 100644 index 00000000000..0b0e3dd095f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarJobRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PutCalendarJobRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarJobRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarJobRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarJobRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarJobRequest.g.cs index 7de2d339dbb..c1ae91dc444 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarJobRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarJobRequest.g.cs @@ -27,41 +27,12 @@ public sealed partial class PutCalendarJobRequestParameters : Elastic.Transport. { } -internal sealed partial class PutCalendarJobRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarJobRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarJobRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarJobRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Add anomaly detection job to calendar. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarJobRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PutCalendarJobRequestConverter))] public sealed partial class PutCalendarJobRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarJobResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarJobResponse.Converters.g.cs new file mode 100644 index 00000000000..3eed600c933 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarJobResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PutCalendarJobResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCalendarId = System.Text.Json.JsonEncodedText.Encode("calendar_id"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropJobIds = System.Text.Json.JsonEncodedText.Encode("job_ids"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarJobResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCalendarId = default; + LocalJsonValue propDescription = default; + LocalJsonValue> propJobIds = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCalendarId.TryReadProperty(ref reader, options, PropCalendarId, null)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propJobIds.TryReadProperty(ref reader, options, PropJobIds, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CalendarId = propCalendarId.Value, + Description = propDescription.Value, + JobIds = propJobIds.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarJobResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCalendarId, value.CalendarId, null, null); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropJobIds, value.JobIds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarJobResponse.g.cs index 5ffe694185f..3405c2c1624 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarJobResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarJobResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class PutCalendarJobResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCalendarId = System.Text.Json.JsonEncodedText.Encode("calendar_id"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropJobIds = System.Text.Json.JsonEncodedText.Encode("job_ids"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarJobResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCalendarId = default; - LocalJsonValue propDescription = default; - LocalJsonValue> propJobIds = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCalendarId.TryReadProperty(ref reader, options, PropCalendarId, null)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propJobIds.TryReadProperty(ref reader, options, PropJobIds, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CalendarId = propCalendarId.Value, - Description = propDescription.Value, - JobIds = propJobIds.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarJobResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCalendarId, value.CalendarId, null, null); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropJobIds, value.JobIds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarJobResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PutCalendarJobResponseConverter))] public sealed partial class PutCalendarJobResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarRequest.Converters.g.cs new file mode 100644 index 00000000000..d9b4d559a00 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PutCalendarRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropJobIds = System.Text.Json.JsonEncodedText.Encode("job_ids"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue?> propJobIds = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propJobIds.TryReadProperty(ref reader, options, PropJobIds, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + JobIds = propJobIds.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropJobIds, value.JobIds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarRequest.g.cs index 3e8dd6d70d7..0da007a6f27 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarRequest.g.cs @@ -27,60 +27,12 @@ public sealed partial class PutCalendarRequestParameters : Elastic.Transport.Req { } -internal sealed partial class PutCalendarRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropJobIds = System.Text.Json.JsonEncodedText.Encode("job_ids"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue?> propJobIds = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propJobIds.TryReadProperty(ref reader, options, PropJobIds, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - JobIds = propJobIds.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropJobIds, value.JobIds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// Create a calendar. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PutCalendarRequestConverter))] public sealed partial class PutCalendarRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarResponse.Converters.g.cs new file mode 100644 index 00000000000..d223469216d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PutCalendarResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCalendarId = System.Text.Json.JsonEncodedText.Encode("calendar_id"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropJobIds = System.Text.Json.JsonEncodedText.Encode("job_ids"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCalendarId = default; + LocalJsonValue propDescription = default; + LocalJsonValue> propJobIds = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCalendarId.TryReadProperty(ref reader, options, PropCalendarId, null)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propJobIds.TryReadProperty(ref reader, options, PropJobIds, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CalendarId = propCalendarId.Value, + Description = propDescription.Value, + JobIds = propJobIds.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCalendarId, value.CalendarId, null, null); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropJobIds, value.JobIds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarResponse.g.cs index c723735efc0..ae2c4c32f06 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutCalendarResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class PutCalendarResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCalendarId = System.Text.Json.JsonEncodedText.Encode("calendar_id"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropJobIds = System.Text.Json.JsonEncodedText.Encode("job_ids"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCalendarId = default; - LocalJsonValue propDescription = default; - LocalJsonValue> propJobIds = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCalendarId.TryReadProperty(ref reader, options, PropCalendarId, null)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propJobIds.TryReadProperty(ref reader, options, PropJobIds, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CalendarId = propCalendarId.Value, - Description = propDescription.Value, - JobIds = propJobIds.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCalendarId, value.CalendarId, null, null); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropJobIds, value.JobIds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PutCalendarResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PutCalendarResponseConverter))] public sealed partial class PutCalendarResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDataFrameAnalyticsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDataFrameAnalyticsRequest.Converters.g.cs new file mode 100644 index 00000000000..d92832d689e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDataFrameAnalyticsRequest.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PutDataFrameAnalyticsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowLazyStart = System.Text.Json.JsonEncodedText.Encode("allow_lazy_start"); + private static readonly System.Text.Json.JsonEncodedText PropAnalysis = System.Text.Json.JsonEncodedText.Encode("analysis"); + private static readonly System.Text.Json.JsonEncodedText PropAnalyzedFields = System.Text.Json.JsonEncodedText.Encode("analyzed_fields"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropDest = System.Text.Json.JsonEncodedText.Encode("dest"); + private static readonly System.Text.Json.JsonEncodedText PropHeaders = System.Text.Json.JsonEncodedText.Encode("headers"); + private static readonly System.Text.Json.JsonEncodedText PropMaxNumThreads = System.Text.Json.JsonEncodedText.Encode("max_num_threads"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); + private static readonly System.Text.Json.JsonEncodedText PropModelMemoryLimit = System.Text.Json.JsonEncodedText.Encode("model_memory_limit"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.PutDataFrameAnalyticsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowLazyStart = default; + LocalJsonValue propAnalysis = default; + LocalJsonValue propAnalyzedFields = default; + LocalJsonValue propDescription = default; + LocalJsonValue propDest = default; + LocalJsonValue>?> propHeaders = default; + LocalJsonValue propMaxNumThreads = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propModelMemoryLimit = default; + LocalJsonValue propSource = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowLazyStart.TryReadProperty(ref reader, options, PropAllowLazyStart, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propAnalysis.TryReadProperty(ref reader, options, PropAnalysis, null)) + { + continue; + } + + if (propAnalyzedFields.TryReadProperty(ref reader, options, PropAnalyzedFields, null)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propDest.TryReadProperty(ref reader, options, PropDest, null)) + { + continue; + } + + if (propHeaders.TryReadProperty(ref reader, options, PropHeaders, static System.Collections.Generic.IDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!))) + { + continue; + } + + if (propMaxNumThreads.TryReadProperty(ref reader, options, PropMaxNumThreads, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propModelMemoryLimit.TryReadProperty(ref reader, options, PropModelMemoryLimit, null)) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PutDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowLazyStart = propAllowLazyStart.Value, + Analysis = propAnalysis.Value, + AnalyzedFields = propAnalyzedFields.Value, + Description = propDescription.Value, + Dest = propDest.Value, + Headers = propHeaders.Value, + MaxNumThreads = propMaxNumThreads.Value, + Meta = propMeta.Value, + ModelMemoryLimit = propModelMemoryLimit.Value, + Source = propSource.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutDataFrameAnalyticsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowLazyStart, value.AllowLazyStart, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropAnalysis, value.Analysis, null, null); + writer.WriteProperty(options, PropAnalyzedFields, value.AnalyzedFields, null, null); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropDest, value.Dest, null, null); + writer.WriteProperty(options, PropHeaders, value.Headers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); + writer.WriteProperty(options, PropMaxNumThreads, value.MaxNumThreads, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropModelMemoryLimit, value.ModelMemoryLimit, null, null); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDataFrameAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDataFrameAnalyticsRequest.g.cs index b63369815f8..80c21b0df7b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDataFrameAnalyticsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDataFrameAnalyticsRequest.g.cs @@ -27,135 +27,6 @@ public sealed partial class PutDataFrameAnalyticsRequestParameters : Elastic.Tra { } -internal sealed partial class PutDataFrameAnalyticsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowLazyStart = System.Text.Json.JsonEncodedText.Encode("allow_lazy_start"); - private static readonly System.Text.Json.JsonEncodedText PropAnalysis = System.Text.Json.JsonEncodedText.Encode("analysis"); - private static readonly System.Text.Json.JsonEncodedText PropAnalyzedFields = System.Text.Json.JsonEncodedText.Encode("analyzed_fields"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropDest = System.Text.Json.JsonEncodedText.Encode("dest"); - private static readonly System.Text.Json.JsonEncodedText PropHeaders = System.Text.Json.JsonEncodedText.Encode("headers"); - private static readonly System.Text.Json.JsonEncodedText PropMaxNumThreads = System.Text.Json.JsonEncodedText.Encode("max_num_threads"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); - private static readonly System.Text.Json.JsonEncodedText PropModelMemoryLimit = System.Text.Json.JsonEncodedText.Encode("model_memory_limit"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.PutDataFrameAnalyticsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowLazyStart = default; - LocalJsonValue propAnalysis = default; - LocalJsonValue propAnalyzedFields = default; - LocalJsonValue propDescription = default; - LocalJsonValue propDest = default; - LocalJsonValue>?> propHeaders = default; - LocalJsonValue propMaxNumThreads = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propModelMemoryLimit = default; - LocalJsonValue propSource = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowLazyStart.TryReadProperty(ref reader, options, PropAllowLazyStart, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propAnalysis.TryReadProperty(ref reader, options, PropAnalysis, null)) - { - continue; - } - - if (propAnalyzedFields.TryReadProperty(ref reader, options, PropAnalyzedFields, null)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propDest.TryReadProperty(ref reader, options, PropDest, null)) - { - continue; - } - - if (propHeaders.TryReadProperty(ref reader, options, PropHeaders, static System.Collections.Generic.IDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!))) - { - continue; - } - - if (propMaxNumThreads.TryReadProperty(ref reader, options, PropMaxNumThreads, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propModelMemoryLimit.TryReadProperty(ref reader, options, PropModelMemoryLimit, null)) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PutDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowLazyStart = propAllowLazyStart.Value, - Analysis = propAnalysis.Value, - AnalyzedFields = propAnalyzedFields.Value, - Description = propDescription.Value, - Dest = propDest.Value, - Headers = propHeaders.Value, - MaxNumThreads = propMaxNumThreads.Value, - Meta = propMeta.Value, - ModelMemoryLimit = propModelMemoryLimit.Value, - Source = propSource.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutDataFrameAnalyticsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowLazyStart, value.AllowLazyStart, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropAnalysis, value.Analysis, null, null); - writer.WriteProperty(options, PropAnalyzedFields, value.AnalyzedFields, null, null); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropDest, value.Dest, null, null); - writer.WriteProperty(options, PropHeaders, value.Headers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); - writer.WriteProperty(options, PropMaxNumThreads, value.MaxNumThreads, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropModelMemoryLimit, value.ModelMemoryLimit, null, null); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create a data frame analytics job. @@ -170,7 +41,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If you supply only a subset of the regression or classification parameters, hyperparameter optimization occurs. It determines a value for each of the undefined parameters. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PutDataFrameAnalyticsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PutDataFrameAnalyticsRequestConverter))] public sealed partial class PutDataFrameAnalyticsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDataFrameAnalyticsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDataFrameAnalyticsResponse.Converters.g.cs new file mode 100644 index 00000000000..e5e6cd47163 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDataFrameAnalyticsResponse.Converters.g.cs @@ -0,0 +1,171 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PutDataFrameAnalyticsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowLazyStart = System.Text.Json.JsonEncodedText.Encode("allow_lazy_start"); + private static readonly System.Text.Json.JsonEncodedText PropAnalysis = System.Text.Json.JsonEncodedText.Encode("analysis"); + private static readonly System.Text.Json.JsonEncodedText PropAnalyzedFields = System.Text.Json.JsonEncodedText.Encode("analyzed_fields"); + private static readonly System.Text.Json.JsonEncodedText PropAuthorization = System.Text.Json.JsonEncodedText.Encode("authorization"); + private static readonly System.Text.Json.JsonEncodedText PropCreateTime = System.Text.Json.JsonEncodedText.Encode("create_time"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropDest = System.Text.Json.JsonEncodedText.Encode("dest"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropMaxNumThreads = System.Text.Json.JsonEncodedText.Encode("max_num_threads"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); + private static readonly System.Text.Json.JsonEncodedText PropModelMemoryLimit = System.Text.Json.JsonEncodedText.Encode("model_memory_limit"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.PutDataFrameAnalyticsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowLazyStart = default; + LocalJsonValue propAnalysis = default; + LocalJsonValue propAnalyzedFields = default; + LocalJsonValue propAuthorization = default; + LocalJsonValue propCreateTime = default; + LocalJsonValue propDescription = default; + LocalJsonValue propDest = default; + LocalJsonValue propId = default; + LocalJsonValue propMaxNumThreads = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propModelMemoryLimit = default; + LocalJsonValue propSource = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowLazyStart.TryReadProperty(ref reader, options, PropAllowLazyStart, null)) + { + continue; + } + + if (propAnalysis.TryReadProperty(ref reader, options, PropAnalysis, null)) + { + continue; + } + + if (propAnalyzedFields.TryReadProperty(ref reader, options, PropAnalyzedFields, null)) + { + continue; + } + + if (propAuthorization.TryReadProperty(ref reader, options, PropAuthorization, null)) + { + continue; + } + + if (propCreateTime.TryReadProperty(ref reader, options, PropCreateTime, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propDest.TryReadProperty(ref reader, options, PropDest, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propMaxNumThreads.TryReadProperty(ref reader, options, PropMaxNumThreads, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propModelMemoryLimit.TryReadProperty(ref reader, options, PropModelMemoryLimit, null)) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PutDataFrameAnalyticsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowLazyStart = propAllowLazyStart.Value, + Analysis = propAnalysis.Value, + AnalyzedFields = propAnalyzedFields.Value, + Authorization = propAuthorization.Value, + CreateTime = propCreateTime.Value, + Description = propDescription.Value, + Dest = propDest.Value, + Id = propId.Value, + MaxNumThreads = propMaxNumThreads.Value, + Meta = propMeta.Value, + ModelMemoryLimit = propModelMemoryLimit.Value, + Source = propSource.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutDataFrameAnalyticsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowLazyStart, value.AllowLazyStart, null, null); + writer.WriteProperty(options, PropAnalysis, value.Analysis, null, null); + writer.WriteProperty(options, PropAnalyzedFields, value.AnalyzedFields, null, null); + writer.WriteProperty(options, PropAuthorization, value.Authorization, null, null); + writer.WriteProperty(options, PropCreateTime, value.CreateTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropDest, value.Dest, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropMaxNumThreads, value.MaxNumThreads, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropModelMemoryLimit, value.ModelMemoryLimit, null, null); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDataFrameAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDataFrameAnalyticsResponse.g.cs index b7814434b10..7b6f804ddb6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDataFrameAnalyticsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDataFrameAnalyticsResponse.g.cs @@ -23,154 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class PutDataFrameAnalyticsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowLazyStart = System.Text.Json.JsonEncodedText.Encode("allow_lazy_start"); - private static readonly System.Text.Json.JsonEncodedText PropAnalysis = System.Text.Json.JsonEncodedText.Encode("analysis"); - private static readonly System.Text.Json.JsonEncodedText PropAnalyzedFields = System.Text.Json.JsonEncodedText.Encode("analyzed_fields"); - private static readonly System.Text.Json.JsonEncodedText PropAuthorization = System.Text.Json.JsonEncodedText.Encode("authorization"); - private static readonly System.Text.Json.JsonEncodedText PropCreateTime = System.Text.Json.JsonEncodedText.Encode("create_time"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropDest = System.Text.Json.JsonEncodedText.Encode("dest"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropMaxNumThreads = System.Text.Json.JsonEncodedText.Encode("max_num_threads"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); - private static readonly System.Text.Json.JsonEncodedText PropModelMemoryLimit = System.Text.Json.JsonEncodedText.Encode("model_memory_limit"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.PutDataFrameAnalyticsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowLazyStart = default; - LocalJsonValue propAnalysis = default; - LocalJsonValue propAnalyzedFields = default; - LocalJsonValue propAuthorization = default; - LocalJsonValue propCreateTime = default; - LocalJsonValue propDescription = default; - LocalJsonValue propDest = default; - LocalJsonValue propId = default; - LocalJsonValue propMaxNumThreads = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propModelMemoryLimit = default; - LocalJsonValue propSource = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowLazyStart.TryReadProperty(ref reader, options, PropAllowLazyStart, null)) - { - continue; - } - - if (propAnalysis.TryReadProperty(ref reader, options, PropAnalysis, null)) - { - continue; - } - - if (propAnalyzedFields.TryReadProperty(ref reader, options, PropAnalyzedFields, null)) - { - continue; - } - - if (propAuthorization.TryReadProperty(ref reader, options, PropAuthorization, null)) - { - continue; - } - - if (propCreateTime.TryReadProperty(ref reader, options, PropCreateTime, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propDest.TryReadProperty(ref reader, options, PropDest, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propMaxNumThreads.TryReadProperty(ref reader, options, PropMaxNumThreads, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propModelMemoryLimit.TryReadProperty(ref reader, options, PropModelMemoryLimit, null)) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PutDataFrameAnalyticsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowLazyStart = propAllowLazyStart.Value, - Analysis = propAnalysis.Value, - AnalyzedFields = propAnalyzedFields.Value, - Authorization = propAuthorization.Value, - CreateTime = propCreateTime.Value, - Description = propDescription.Value, - Dest = propDest.Value, - Id = propId.Value, - MaxNumThreads = propMaxNumThreads.Value, - Meta = propMeta.Value, - ModelMemoryLimit = propModelMemoryLimit.Value, - Source = propSource.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutDataFrameAnalyticsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowLazyStart, value.AllowLazyStart, null, null); - writer.WriteProperty(options, PropAnalysis, value.Analysis, null, null); - writer.WriteProperty(options, PropAnalyzedFields, value.AnalyzedFields, null, null); - writer.WriteProperty(options, PropAuthorization, value.Authorization, null, null); - writer.WriteProperty(options, PropCreateTime, value.CreateTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropDest, value.Dest, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropMaxNumThreads, value.MaxNumThreads, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropModelMemoryLimit, value.ModelMemoryLimit, null, null); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PutDataFrameAnalyticsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PutDataFrameAnalyticsResponseConverter))] public sealed partial class PutDataFrameAnalyticsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -186,51 +39,51 @@ internal PutDataFrameAnalyticsResponse(Elastic.Clients.Elasticsearch.Serializati public #if NET7_0_OR_GREATER - required +required #endif - bool AllowLazyStart { get; set; } +bool AllowLazyStart { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis Analysis { get; set; } +Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis Analysis { get; set; } public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields? AnalyzedFields { get; set; } public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsAuthorization? Authorization { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.DateTimeOffset CreateTime { get; set; } +System.DateTimeOffset CreateTime { get; set; } public string? Description { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestination Dest { get; set; } +Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestination Dest { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Id { get; set; } +string Id { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - int MaxNumThreads { get; set; } +int MaxNumThreads { get; set; } public System.Collections.Generic.IReadOnlyDictionary? Meta { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string ModelMemoryLimit { get; set; } +string ModelMemoryLimit { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource Source { get; set; } +Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource Source { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Version { get; set; } +string Version { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDatafeedRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDatafeedRequest.Converters.g.cs new file mode 100644 index 00000000000..08950527a9d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDatafeedRequest.Converters.g.cs @@ -0,0 +1,182 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PutDatafeedRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + 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 PropChunkingConfig = System.Text.Json.JsonEncodedText.Encode("chunking_config"); + private static readonly System.Text.Json.JsonEncodedText PropDelayedDataCheckConfig = System.Text.Json.JsonEncodedText.Encode("delayed_data_check_config"); + private static readonly System.Text.Json.JsonEncodedText PropFrequency = System.Text.Json.JsonEncodedText.Encode("frequency"); + private static readonly System.Text.Json.JsonEncodedText PropHeaders = System.Text.Json.JsonEncodedText.Encode("headers"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropIndices1 = System.Text.Json.JsonEncodedText.Encode("indexes"); + private static readonly System.Text.Json.JsonEncodedText PropIndicesOptions = System.Text.Json.JsonEncodedText.Encode("indices_options"); + private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); + private static readonly System.Text.Json.JsonEncodedText PropMaxEmptySearches = System.Text.Json.JsonEncodedText.Encode("max_empty_searches"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropQueryDelay = System.Text.Json.JsonEncodedText.Encode("query_delay"); + 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 PropScrollSize = System.Text.Json.JsonEncodedText.Encode("scroll_size"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.PutDatafeedRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAggregations = default; + LocalJsonValue propChunkingConfig = default; + LocalJsonValue propDelayedDataCheckConfig = default; + LocalJsonValue propFrequency = default; + LocalJsonValue>?> propHeaders = default; + LocalJsonValue propIndices = default; + LocalJsonValue propIndicesOptions = default; + LocalJsonValue propJobId = default; + LocalJsonValue propMaxEmptySearches = default; + LocalJsonValue propQuery = default; + LocalJsonValue propQueryDelay = default; + LocalJsonValue?> propRuntimeMappings = default; + LocalJsonValue?> propScriptFields = default; + LocalJsonValue propScrollSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)) || propAggregations.TryReadProperty(ref reader, options, PropAggregations1, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propChunkingConfig.TryReadProperty(ref reader, options, PropChunkingConfig, null)) + { + continue; + } + + if (propDelayedDataCheckConfig.TryReadProperty(ref reader, options, PropDelayedDataCheckConfig, null)) + { + continue; + } + + if (propFrequency.TryReadProperty(ref reader, options, PropFrequency, null)) + { + continue; + } + + if (propHeaders.TryReadProperty(ref reader, options, PropHeaders, static System.Collections.Generic.IDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!))) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, null) || propIndices.TryReadProperty(ref reader, options, PropIndices1, null)) + { + continue; + } + + if (propIndicesOptions.TryReadProperty(ref reader, options, PropIndicesOptions, null)) + { + continue; + } + + if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) + { + continue; + } + + if (propMaxEmptySearches.TryReadProperty(ref reader, options, PropMaxEmptySearches, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propQueryDelay.TryReadProperty(ref reader, options, PropQueryDelay, null)) + { + continue; + } + + if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propScriptFields.TryReadProperty(ref reader, options, PropScriptFields, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propScrollSize.TryReadProperty(ref reader, options, PropScrollSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PutDatafeedRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = propAggregations.Value, + ChunkingConfig = propChunkingConfig.Value, + DelayedDataCheckConfig = propDelayedDataCheckConfig.Value, + Frequency = propFrequency.Value, + Headers = propHeaders.Value, + Indices = propIndices.Value, + IndicesOptions = propIndicesOptions.Value, + JobId = propJobId.Value, + MaxEmptySearches = propMaxEmptySearches.Value, + Query = propQuery.Value, + QueryDelay = propQueryDelay.Value, + RuntimeMappings = propRuntimeMappings.Value, + ScriptFields = propScriptFields.Value, + ScrollSize = propScrollSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutDatafeedRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropChunkingConfig, value.ChunkingConfig, null, null); + writer.WriteProperty(options, PropDelayedDataCheckConfig, value.DelayedDataCheckConfig, null, null); + writer.WriteProperty(options, PropFrequency, value.Frequency, null, null); + writer.WriteProperty(options, PropHeaders, value.Headers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); + writer.WriteProperty(options, PropIndices, value.Indices, null, null); + writer.WriteProperty(options, PropIndicesOptions, value.IndicesOptions, null, null); + writer.WriteProperty(options, PropJobId, value.JobId, null, null); + writer.WriteProperty(options, PropMaxEmptySearches, value.MaxEmptySearches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropQueryDelay, value.QueryDelay, null, null); + writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropScriptFields, value.ScriptFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropScrollSize, value.ScrollSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDatafeedRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDatafeedRequest.g.cs index 4caf5059d35..66247b89418 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDatafeedRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDatafeedRequest.g.cs @@ -57,164 +57,6 @@ public sealed partial class PutDatafeedRequestParameters : Elastic.Transport.Req public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } } -internal sealed partial class PutDatafeedRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - 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 PropChunkingConfig = System.Text.Json.JsonEncodedText.Encode("chunking_config"); - private static readonly System.Text.Json.JsonEncodedText PropDelayedDataCheckConfig = System.Text.Json.JsonEncodedText.Encode("delayed_data_check_config"); - private static readonly System.Text.Json.JsonEncodedText PropFrequency = System.Text.Json.JsonEncodedText.Encode("frequency"); - private static readonly System.Text.Json.JsonEncodedText PropHeaders = System.Text.Json.JsonEncodedText.Encode("headers"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropIndices1 = System.Text.Json.JsonEncodedText.Encode("indexes"); - private static readonly System.Text.Json.JsonEncodedText PropIndicesOptions = System.Text.Json.JsonEncodedText.Encode("indices_options"); - private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); - private static readonly System.Text.Json.JsonEncodedText PropMaxEmptySearches = System.Text.Json.JsonEncodedText.Encode("max_empty_searches"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropQueryDelay = System.Text.Json.JsonEncodedText.Encode("query_delay"); - 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 PropScrollSize = System.Text.Json.JsonEncodedText.Encode("scroll_size"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.PutDatafeedRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAggregations = default; - LocalJsonValue propChunkingConfig = default; - LocalJsonValue propDelayedDataCheckConfig = default; - LocalJsonValue propFrequency = default; - LocalJsonValue>?> propHeaders = default; - LocalJsonValue propIndices = default; - LocalJsonValue propIndicesOptions = default; - LocalJsonValue propJobId = default; - LocalJsonValue propMaxEmptySearches = default; - LocalJsonValue propQuery = default; - LocalJsonValue propQueryDelay = default; - LocalJsonValue?> propRuntimeMappings = default; - LocalJsonValue?> propScriptFields = default; - LocalJsonValue propScrollSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)) || propAggregations.TryReadProperty(ref reader, options, PropAggregations1, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propChunkingConfig.TryReadProperty(ref reader, options, PropChunkingConfig, null)) - { - continue; - } - - if (propDelayedDataCheckConfig.TryReadProperty(ref reader, options, PropDelayedDataCheckConfig, null)) - { - continue; - } - - if (propFrequency.TryReadProperty(ref reader, options, PropFrequency, null)) - { - continue; - } - - if (propHeaders.TryReadProperty(ref reader, options, PropHeaders, static System.Collections.Generic.IDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!))) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, null) || propIndices.TryReadProperty(ref reader, options, PropIndices1, null)) - { - continue; - } - - if (propIndicesOptions.TryReadProperty(ref reader, options, PropIndicesOptions, null)) - { - continue; - } - - if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) - { - continue; - } - - if (propMaxEmptySearches.TryReadProperty(ref reader, options, PropMaxEmptySearches, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propQueryDelay.TryReadProperty(ref reader, options, PropQueryDelay, null)) - { - continue; - } - - if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propScriptFields.TryReadProperty(ref reader, options, PropScriptFields, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propScrollSize.TryReadProperty(ref reader, options, PropScrollSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PutDatafeedRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = propAggregations.Value, - ChunkingConfig = propChunkingConfig.Value, - DelayedDataCheckConfig = propDelayedDataCheckConfig.Value, - Frequency = propFrequency.Value, - Headers = propHeaders.Value, - Indices = propIndices.Value, - IndicesOptions = propIndicesOptions.Value, - JobId = propJobId.Value, - MaxEmptySearches = propMaxEmptySearches.Value, - Query = propQuery.Value, - QueryDelay = propQueryDelay.Value, - RuntimeMappings = propRuntimeMappings.Value, - ScriptFields = propScriptFields.Value, - ScrollSize = propScrollSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutDatafeedRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropChunkingConfig, value.ChunkingConfig, null, null); - writer.WriteProperty(options, PropDelayedDataCheckConfig, value.DelayedDataCheckConfig, null, null); - writer.WriteProperty(options, PropFrequency, value.Frequency, null, null); - writer.WriteProperty(options, PropHeaders, value.Headers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); - writer.WriteProperty(options, PropIndices, value.Indices, null, null); - writer.WriteProperty(options, PropIndicesOptions, value.IndicesOptions, null, null); - writer.WriteProperty(options, PropJobId, value.JobId, null, null); - writer.WriteProperty(options, PropMaxEmptySearches, value.MaxEmptySearches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropQueryDelay, value.QueryDelay, null, null); - writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropScriptFields, value.ScriptFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropScrollSize, value.ScrollSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Create a datafeed. @@ -231,7 +73,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// directly to the .ml-config index. Do not give users write privileges on the .ml-config index. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PutDatafeedRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PutDatafeedRequestConverter))] public sealed partial class PutDatafeedRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDatafeedResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDatafeedResponse.Converters.g.cs new file mode 100644 index 00000000000..edcb621de91 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDatafeedResponse.Converters.g.cs @@ -0,0 +1,189 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PutDatafeedResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); + private static readonly System.Text.Json.JsonEncodedText PropAuthorization = System.Text.Json.JsonEncodedText.Encode("authorization"); + private static readonly System.Text.Json.JsonEncodedText PropChunkingConfig = System.Text.Json.JsonEncodedText.Encode("chunking_config"); + private static readonly System.Text.Json.JsonEncodedText PropDatafeedId = System.Text.Json.JsonEncodedText.Encode("datafeed_id"); + private static readonly System.Text.Json.JsonEncodedText PropDelayedDataCheckConfig = System.Text.Json.JsonEncodedText.Encode("delayed_data_check_config"); + private static readonly System.Text.Json.JsonEncodedText PropFrequency = System.Text.Json.JsonEncodedText.Encode("frequency"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropIndicesOptions = System.Text.Json.JsonEncodedText.Encode("indices_options"); + private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); + private static readonly System.Text.Json.JsonEncodedText PropMaxEmptySearches = System.Text.Json.JsonEncodedText.Encode("max_empty_searches"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropQueryDelay = System.Text.Json.JsonEncodedText.Encode("query_delay"); + 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 PropScrollSize = System.Text.Json.JsonEncodedText.Encode("scroll_size"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.PutDatafeedResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAggregations = default; + LocalJsonValue propAuthorization = default; + LocalJsonValue propChunkingConfig = default; + LocalJsonValue propDatafeedId = default; + LocalJsonValue propDelayedDataCheckConfig = default; + LocalJsonValue propFrequency = default; + LocalJsonValue> propIndices = default; + LocalJsonValue propIndicesOptions = default; + LocalJsonValue propJobId = default; + LocalJsonValue propMaxEmptySearches = default; + LocalJsonValue propQuery = default; + LocalJsonValue propQueryDelay = default; + LocalJsonValue?> propRuntimeMappings = default; + LocalJsonValue?> propScriptFields = default; + LocalJsonValue propScrollSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propAuthorization.TryReadProperty(ref reader, options, PropAuthorization, null)) + { + continue; + } + + if (propChunkingConfig.TryReadProperty(ref reader, options, PropChunkingConfig, null)) + { + continue; + } + + if (propDatafeedId.TryReadProperty(ref reader, options, PropDatafeedId, null)) + { + continue; + } + + if (propDelayedDataCheckConfig.TryReadProperty(ref reader, options, PropDelayedDataCheckConfig, null)) + { + continue; + } + + if (propFrequency.TryReadProperty(ref reader, options, PropFrequency, null)) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propIndicesOptions.TryReadProperty(ref reader, options, PropIndicesOptions, null)) + { + continue; + } + + if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) + { + continue; + } + + if (propMaxEmptySearches.TryReadProperty(ref reader, options, PropMaxEmptySearches, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propQueryDelay.TryReadProperty(ref reader, options, PropQueryDelay, null)) + { + continue; + } + + if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propScriptFields.TryReadProperty(ref reader, options, PropScriptFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propScrollSize.TryReadProperty(ref reader, options, PropScrollSize, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PutDatafeedResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = propAggregations.Value, + Authorization = propAuthorization.Value, + ChunkingConfig = propChunkingConfig.Value, + DatafeedId = propDatafeedId.Value, + DelayedDataCheckConfig = propDelayedDataCheckConfig.Value, + Frequency = propFrequency.Value, + Indices = propIndices.Value, + IndicesOptions = propIndicesOptions.Value, + JobId = propJobId.Value, + MaxEmptySearches = propMaxEmptySearches.Value, + Query = propQuery.Value, + QueryDelay = propQueryDelay.Value, + RuntimeMappings = propRuntimeMappings.Value, + ScriptFields = propScriptFields.Value, + ScrollSize = propScrollSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutDatafeedResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropAuthorization, value.Authorization, null, null); + writer.WriteProperty(options, PropChunkingConfig, value.ChunkingConfig, null, null); + writer.WriteProperty(options, PropDatafeedId, value.DatafeedId, null, null); + writer.WriteProperty(options, PropDelayedDataCheckConfig, value.DelayedDataCheckConfig, null, null); + writer.WriteProperty(options, PropFrequency, value.Frequency, null, null); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIndicesOptions, value.IndicesOptions, null, null); + writer.WriteProperty(options, PropJobId, value.JobId, null, null); + writer.WriteProperty(options, PropMaxEmptySearches, value.MaxEmptySearches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropQueryDelay, value.QueryDelay, null, null); + writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropScriptFields, value.ScriptFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropScrollSize, value.ScrollSize, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDatafeedResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDatafeedResponse.g.cs index 643e754eeed..fbb6344d40b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDatafeedResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutDatafeedResponse.g.cs @@ -23,172 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class PutDatafeedResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); - private static readonly System.Text.Json.JsonEncodedText PropAuthorization = System.Text.Json.JsonEncodedText.Encode("authorization"); - private static readonly System.Text.Json.JsonEncodedText PropChunkingConfig = System.Text.Json.JsonEncodedText.Encode("chunking_config"); - private static readonly System.Text.Json.JsonEncodedText PropDatafeedId = System.Text.Json.JsonEncodedText.Encode("datafeed_id"); - private static readonly System.Text.Json.JsonEncodedText PropDelayedDataCheckConfig = System.Text.Json.JsonEncodedText.Encode("delayed_data_check_config"); - private static readonly System.Text.Json.JsonEncodedText PropFrequency = System.Text.Json.JsonEncodedText.Encode("frequency"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropIndicesOptions = System.Text.Json.JsonEncodedText.Encode("indices_options"); - private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); - private static readonly System.Text.Json.JsonEncodedText PropMaxEmptySearches = System.Text.Json.JsonEncodedText.Encode("max_empty_searches"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropQueryDelay = System.Text.Json.JsonEncodedText.Encode("query_delay"); - 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 PropScrollSize = System.Text.Json.JsonEncodedText.Encode("scroll_size"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.PutDatafeedResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAggregations = default; - LocalJsonValue propAuthorization = default; - LocalJsonValue propChunkingConfig = default; - LocalJsonValue propDatafeedId = default; - LocalJsonValue propDelayedDataCheckConfig = default; - LocalJsonValue propFrequency = default; - LocalJsonValue> propIndices = default; - LocalJsonValue propIndicesOptions = default; - LocalJsonValue propJobId = default; - LocalJsonValue propMaxEmptySearches = default; - LocalJsonValue propQuery = default; - LocalJsonValue propQueryDelay = default; - LocalJsonValue?> propRuntimeMappings = default; - LocalJsonValue?> propScriptFields = default; - LocalJsonValue propScrollSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propAuthorization.TryReadProperty(ref reader, options, PropAuthorization, null)) - { - continue; - } - - if (propChunkingConfig.TryReadProperty(ref reader, options, PropChunkingConfig, null)) - { - continue; - } - - if (propDatafeedId.TryReadProperty(ref reader, options, PropDatafeedId, null)) - { - continue; - } - - if (propDelayedDataCheckConfig.TryReadProperty(ref reader, options, PropDelayedDataCheckConfig, null)) - { - continue; - } - - if (propFrequency.TryReadProperty(ref reader, options, PropFrequency, null)) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propIndicesOptions.TryReadProperty(ref reader, options, PropIndicesOptions, null)) - { - continue; - } - - if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) - { - continue; - } - - if (propMaxEmptySearches.TryReadProperty(ref reader, options, PropMaxEmptySearches, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propQueryDelay.TryReadProperty(ref reader, options, PropQueryDelay, null)) - { - continue; - } - - if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propScriptFields.TryReadProperty(ref reader, options, PropScriptFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propScrollSize.TryReadProperty(ref reader, options, PropScrollSize, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PutDatafeedResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = propAggregations.Value, - Authorization = propAuthorization.Value, - ChunkingConfig = propChunkingConfig.Value, - DatafeedId = propDatafeedId.Value, - DelayedDataCheckConfig = propDelayedDataCheckConfig.Value, - Frequency = propFrequency.Value, - Indices = propIndices.Value, - IndicesOptions = propIndicesOptions.Value, - JobId = propJobId.Value, - MaxEmptySearches = propMaxEmptySearches.Value, - Query = propQuery.Value, - QueryDelay = propQueryDelay.Value, - RuntimeMappings = propRuntimeMappings.Value, - ScriptFields = propScriptFields.Value, - ScrollSize = propScrollSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutDatafeedResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropAuthorization, value.Authorization, null, null); - writer.WriteProperty(options, PropChunkingConfig, value.ChunkingConfig, null, null); - writer.WriteProperty(options, PropDatafeedId, value.DatafeedId, null, null); - writer.WriteProperty(options, PropDelayedDataCheckConfig, value.DelayedDataCheckConfig, null, null); - writer.WriteProperty(options, PropFrequency, value.Frequency, null, null); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIndicesOptions, value.IndicesOptions, null, null); - writer.WriteProperty(options, PropJobId, value.JobId, null, null); - writer.WriteProperty(options, PropMaxEmptySearches, value.MaxEmptySearches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropQueryDelay, value.QueryDelay, null, null); - writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropScriptFields, value.ScriptFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropScrollSize, value.ScrollSize, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PutDatafeedResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PutDatafeedResponseConverter))] public sealed partial class PutDatafeedResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -206,43 +41,43 @@ internal PutDatafeedResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCon public Elastic.Clients.Elasticsearch.MachineLearning.DatafeedAuthorization? Authorization { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig ChunkingConfig { get; set; } +Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig ChunkingConfig { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string DatafeedId { get; set; } +string DatafeedId { get; set; } public Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig? DelayedDataCheckConfig { get; set; } public Elastic.Clients.Elasticsearch.Duration? Frequency { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Indices { get; set; } +System.Collections.Generic.IReadOnlyCollection Indices { get; set; } public Elastic.Clients.Elasticsearch.IndicesOptions? IndicesOptions { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string JobId { get; set; } +string JobId { get; set; } public int? MaxEmptySearches { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.QueryDsl.Query Query { get; set; } +Elastic.Clients.Elasticsearch.QueryDsl.Query Query { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Duration QueryDelay { get; set; } +Elastic.Clients.Elasticsearch.Duration QueryDelay { get; set; } public System.Collections.Generic.IReadOnlyDictionary? RuntimeMappings { get; set; } public System.Collections.Generic.IReadOnlyDictionary? ScriptFields { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - int ScrollSize { get; set; } +int ScrollSize { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutFilterRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutFilterRequest.Converters.g.cs new file mode 100644 index 00000000000..1ea1b95bc9f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutFilterRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PutFilterRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropItems = System.Text.Json.JsonEncodedText.Encode("items"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.PutFilterRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue?> propItems = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propItems.TryReadProperty(ref reader, options, PropItems, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PutFilterRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Items = propItems.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutFilterRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropItems, value.Items, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutFilterRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutFilterRequest.g.cs index 501f9862a66..51447d91cff 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutFilterRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutFilterRequest.g.cs @@ -27,54 +27,6 @@ public sealed partial class PutFilterRequestParameters : Elastic.Transport.Reque { } -internal sealed partial class PutFilterRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropItems = System.Text.Json.JsonEncodedText.Encode("items"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.PutFilterRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue?> propItems = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propItems.TryReadProperty(ref reader, options, PropItems, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PutFilterRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Items = propItems.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutFilterRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropItems, value.Items, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// Create a filter. @@ -82,7 +34,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Specifically, filters are referenced in the custom_rules property of detector configuration objects. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PutFilterRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PutFilterRequestConverter))] public sealed partial class PutFilterRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutFilterResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutFilterResponse.Converters.g.cs new file mode 100644 index 00000000000..5104eb10c9e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutFilterResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PutFilterResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropFilterId = System.Text.Json.JsonEncodedText.Encode("filter_id"); + private static readonly System.Text.Json.JsonEncodedText PropItems = System.Text.Json.JsonEncodedText.Encode("items"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.PutFilterResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propFilterId = default; + LocalJsonValue> propItems = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propFilterId.TryReadProperty(ref reader, options, PropFilterId, null)) + { + continue; + } + + if (propItems.TryReadProperty(ref reader, options, PropItems, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PutFilterResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + FilterId = propFilterId.Value, + Items = propItems.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutFilterResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropFilterId, value.FilterId, null, null); + writer.WriteProperty(options, PropItems, value.Items, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutFilterResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutFilterResponse.g.cs index 4586b500474..b4222db509e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutFilterResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutFilterResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class PutFilterResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropFilterId = System.Text.Json.JsonEncodedText.Encode("filter_id"); - private static readonly System.Text.Json.JsonEncodedText PropItems = System.Text.Json.JsonEncodedText.Encode("items"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.PutFilterResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propFilterId = default; - LocalJsonValue> propItems = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propFilterId.TryReadProperty(ref reader, options, PropFilterId, null)) - { - continue; - } - - if (propItems.TryReadProperty(ref reader, options, PropItems, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PutFilterResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - FilterId = propFilterId.Value, - Items = propItems.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutFilterResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropFilterId, value.FilterId, null, null); - writer.WriteProperty(options, PropItems, value.Items, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PutFilterResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PutFilterResponseConverter))] public sealed partial class PutFilterResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -96,17 +39,17 @@ internal PutFilterResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConst public #if NET7_0_OR_GREATER - required +required #endif - string Description { get; set; } +string Description { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string FilterId { get; set; } +string FilterId { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Items { get; set; } +System.Collections.Generic.IReadOnlyCollection Items { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutJobRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutJobRequest.Converters.g.cs new file mode 100644 index 00000000000..3204e4466ed --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutJobRequest.Converters.g.cs @@ -0,0 +1,198 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PutJobRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowLazyOpen = System.Text.Json.JsonEncodedText.Encode("allow_lazy_open"); + private static readonly System.Text.Json.JsonEncodedText PropAnalysisConfig = System.Text.Json.JsonEncodedText.Encode("analysis_config"); + private static readonly System.Text.Json.JsonEncodedText PropAnalysisLimits = System.Text.Json.JsonEncodedText.Encode("analysis_limits"); + private static readonly System.Text.Json.JsonEncodedText PropBackgroundPersistInterval = System.Text.Json.JsonEncodedText.Encode("background_persist_interval"); + private static readonly System.Text.Json.JsonEncodedText PropCustomSettings = System.Text.Json.JsonEncodedText.Encode("custom_settings"); + private static readonly System.Text.Json.JsonEncodedText PropDailyModelSnapshotRetentionAfterDays = System.Text.Json.JsonEncodedText.Encode("daily_model_snapshot_retention_after_days"); + private static readonly System.Text.Json.JsonEncodedText PropDataDescription = System.Text.Json.JsonEncodedText.Encode("data_description"); + private static readonly System.Text.Json.JsonEncodedText PropDatafeedConfig = System.Text.Json.JsonEncodedText.Encode("datafeed_config"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropGroups = System.Text.Json.JsonEncodedText.Encode("groups"); + private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); + private static readonly System.Text.Json.JsonEncodedText PropModelPlotConfig = System.Text.Json.JsonEncodedText.Encode("model_plot_config"); + private static readonly System.Text.Json.JsonEncodedText PropModelSnapshotRetentionDays = System.Text.Json.JsonEncodedText.Encode("model_snapshot_retention_days"); + private static readonly System.Text.Json.JsonEncodedText PropRenormalizationWindowDays = System.Text.Json.JsonEncodedText.Encode("renormalization_window_days"); + private static readonly System.Text.Json.JsonEncodedText PropResultsIndexName = System.Text.Json.JsonEncodedText.Encode("results_index_name"); + private static readonly System.Text.Json.JsonEncodedText PropResultsRetentionDays = System.Text.Json.JsonEncodedText.Encode("results_retention_days"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.PutJobRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowLazyOpen = default; + LocalJsonValue propAnalysisConfig = default; + LocalJsonValue propAnalysisLimits = default; + LocalJsonValue propBackgroundPersistInterval = default; + LocalJsonValue propCustomSettings = default; + LocalJsonValue propDailyModelSnapshotRetentionAfterDays = default; + LocalJsonValue propDataDescription = default; + LocalJsonValue propDatafeedConfig = default; + LocalJsonValue propDescription = default; + LocalJsonValue?> propGroups = default; + LocalJsonValue propJobId = default; + LocalJsonValue propModelPlotConfig = default; + LocalJsonValue propModelSnapshotRetentionDays = default; + LocalJsonValue propRenormalizationWindowDays = default; + LocalJsonValue propResultsIndexName = default; + LocalJsonValue propResultsRetentionDays = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowLazyOpen.TryReadProperty(ref reader, options, PropAllowLazyOpen, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propAnalysisConfig.TryReadProperty(ref reader, options, PropAnalysisConfig, null)) + { + continue; + } + + if (propAnalysisLimits.TryReadProperty(ref reader, options, PropAnalysisLimits, null)) + { + continue; + } + + if (propBackgroundPersistInterval.TryReadProperty(ref reader, options, PropBackgroundPersistInterval, null)) + { + continue; + } + + if (propCustomSettings.TryReadProperty(ref reader, options, PropCustomSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propDailyModelSnapshotRetentionAfterDays.TryReadProperty(ref reader, options, PropDailyModelSnapshotRetentionAfterDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDataDescription.TryReadProperty(ref reader, options, PropDataDescription, null)) + { + continue; + } + + if (propDatafeedConfig.TryReadProperty(ref reader, options, PropDatafeedConfig, null)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propGroups.TryReadProperty(ref reader, options, PropGroups, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) + { + continue; + } + + if (propModelPlotConfig.TryReadProperty(ref reader, options, PropModelPlotConfig, null)) + { + continue; + } + + if (propModelSnapshotRetentionDays.TryReadProperty(ref reader, options, PropModelSnapshotRetentionDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRenormalizationWindowDays.TryReadProperty(ref reader, options, PropRenormalizationWindowDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propResultsIndexName.TryReadProperty(ref reader, options, PropResultsIndexName, null)) + { + continue; + } + + if (propResultsRetentionDays.TryReadProperty(ref reader, options, PropResultsRetentionDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PutJobRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowLazyOpen = propAllowLazyOpen.Value, + AnalysisConfig = propAnalysisConfig.Value, + AnalysisLimits = propAnalysisLimits.Value, + BackgroundPersistInterval = propBackgroundPersistInterval.Value, + CustomSettings = propCustomSettings.Value, + DailyModelSnapshotRetentionAfterDays = propDailyModelSnapshotRetentionAfterDays.Value, + DataDescription = propDataDescription.Value, + DatafeedConfig = propDatafeedConfig.Value, + Description = propDescription.Value, + Groups = propGroups.Value, + JobId = propJobId.Value, + ModelPlotConfig = propModelPlotConfig.Value, + ModelSnapshotRetentionDays = propModelSnapshotRetentionDays.Value, + RenormalizationWindowDays = propRenormalizationWindowDays.Value, + ResultsIndexName = propResultsIndexName.Value, + ResultsRetentionDays = propResultsRetentionDays.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutJobRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowLazyOpen, value.AllowLazyOpen, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropAnalysisConfig, value.AnalysisConfig, null, null); + writer.WriteProperty(options, PropAnalysisLimits, value.AnalysisLimits, null, null); + writer.WriteProperty(options, PropBackgroundPersistInterval, value.BackgroundPersistInterval, null, null); + writer.WriteProperty(options, PropCustomSettings, value.CustomSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropDailyModelSnapshotRetentionAfterDays, value.DailyModelSnapshotRetentionAfterDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDataDescription, value.DataDescription, null, null); + writer.WriteProperty(options, PropDatafeedConfig, value.DatafeedConfig, null, null); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropGroups, value.Groups, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropJobId, value.JobId, null, null); + writer.WriteProperty(options, PropModelPlotConfig, value.ModelPlotConfig, null, null); + writer.WriteProperty(options, PropModelSnapshotRetentionDays, value.ModelSnapshotRetentionDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRenormalizationWindowDays, value.RenormalizationWindowDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropResultsIndexName, value.ResultsIndexName, null, null); + writer.WriteProperty(options, PropResultsRetentionDays, value.ResultsRetentionDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutJobRequest.g.cs index ada859ed1c5..f1df73ec206 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutJobRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutJobRequest.g.cs @@ -57,180 +57,6 @@ public sealed partial class PutJobRequestParameters : Elastic.Transport.RequestP public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } } -internal sealed partial class PutJobRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowLazyOpen = System.Text.Json.JsonEncodedText.Encode("allow_lazy_open"); - private static readonly System.Text.Json.JsonEncodedText PropAnalysisConfig = System.Text.Json.JsonEncodedText.Encode("analysis_config"); - private static readonly System.Text.Json.JsonEncodedText PropAnalysisLimits = System.Text.Json.JsonEncodedText.Encode("analysis_limits"); - private static readonly System.Text.Json.JsonEncodedText PropBackgroundPersistInterval = System.Text.Json.JsonEncodedText.Encode("background_persist_interval"); - private static readonly System.Text.Json.JsonEncodedText PropCustomSettings = System.Text.Json.JsonEncodedText.Encode("custom_settings"); - private static readonly System.Text.Json.JsonEncodedText PropDailyModelSnapshotRetentionAfterDays = System.Text.Json.JsonEncodedText.Encode("daily_model_snapshot_retention_after_days"); - private static readonly System.Text.Json.JsonEncodedText PropDataDescription = System.Text.Json.JsonEncodedText.Encode("data_description"); - private static readonly System.Text.Json.JsonEncodedText PropDatafeedConfig = System.Text.Json.JsonEncodedText.Encode("datafeed_config"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropGroups = System.Text.Json.JsonEncodedText.Encode("groups"); - private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); - private static readonly System.Text.Json.JsonEncodedText PropModelPlotConfig = System.Text.Json.JsonEncodedText.Encode("model_plot_config"); - private static readonly System.Text.Json.JsonEncodedText PropModelSnapshotRetentionDays = System.Text.Json.JsonEncodedText.Encode("model_snapshot_retention_days"); - private static readonly System.Text.Json.JsonEncodedText PropRenormalizationWindowDays = System.Text.Json.JsonEncodedText.Encode("renormalization_window_days"); - private static readonly System.Text.Json.JsonEncodedText PropResultsIndexName = System.Text.Json.JsonEncodedText.Encode("results_index_name"); - private static readonly System.Text.Json.JsonEncodedText PropResultsRetentionDays = System.Text.Json.JsonEncodedText.Encode("results_retention_days"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.PutJobRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowLazyOpen = default; - LocalJsonValue propAnalysisConfig = default; - LocalJsonValue propAnalysisLimits = default; - LocalJsonValue propBackgroundPersistInterval = default; - LocalJsonValue propCustomSettings = default; - LocalJsonValue propDailyModelSnapshotRetentionAfterDays = default; - LocalJsonValue propDataDescription = default; - LocalJsonValue propDatafeedConfig = default; - LocalJsonValue propDescription = default; - LocalJsonValue?> propGroups = default; - LocalJsonValue propJobId = default; - LocalJsonValue propModelPlotConfig = default; - LocalJsonValue propModelSnapshotRetentionDays = default; - LocalJsonValue propRenormalizationWindowDays = default; - LocalJsonValue propResultsIndexName = default; - LocalJsonValue propResultsRetentionDays = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowLazyOpen.TryReadProperty(ref reader, options, PropAllowLazyOpen, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propAnalysisConfig.TryReadProperty(ref reader, options, PropAnalysisConfig, null)) - { - continue; - } - - if (propAnalysisLimits.TryReadProperty(ref reader, options, PropAnalysisLimits, null)) - { - continue; - } - - if (propBackgroundPersistInterval.TryReadProperty(ref reader, options, PropBackgroundPersistInterval, null)) - { - continue; - } - - if (propCustomSettings.TryReadProperty(ref reader, options, PropCustomSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propDailyModelSnapshotRetentionAfterDays.TryReadProperty(ref reader, options, PropDailyModelSnapshotRetentionAfterDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDataDescription.TryReadProperty(ref reader, options, PropDataDescription, null)) - { - continue; - } - - if (propDatafeedConfig.TryReadProperty(ref reader, options, PropDatafeedConfig, null)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propGroups.TryReadProperty(ref reader, options, PropGroups, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) - { - continue; - } - - if (propModelPlotConfig.TryReadProperty(ref reader, options, PropModelPlotConfig, null)) - { - continue; - } - - if (propModelSnapshotRetentionDays.TryReadProperty(ref reader, options, PropModelSnapshotRetentionDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRenormalizationWindowDays.TryReadProperty(ref reader, options, PropRenormalizationWindowDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propResultsIndexName.TryReadProperty(ref reader, options, PropResultsIndexName, null)) - { - continue; - } - - if (propResultsRetentionDays.TryReadProperty(ref reader, options, PropResultsRetentionDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PutJobRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowLazyOpen = propAllowLazyOpen.Value, - AnalysisConfig = propAnalysisConfig.Value, - AnalysisLimits = propAnalysisLimits.Value, - BackgroundPersistInterval = propBackgroundPersistInterval.Value, - CustomSettings = propCustomSettings.Value, - DailyModelSnapshotRetentionAfterDays = propDailyModelSnapshotRetentionAfterDays.Value, - DataDescription = propDataDescription.Value, - DatafeedConfig = propDatafeedConfig.Value, - Description = propDescription.Value, - Groups = propGroups.Value, - JobId = propJobId.Value, - ModelPlotConfig = propModelPlotConfig.Value, - ModelSnapshotRetentionDays = propModelSnapshotRetentionDays.Value, - RenormalizationWindowDays = propRenormalizationWindowDays.Value, - ResultsIndexName = propResultsIndexName.Value, - ResultsRetentionDays = propResultsRetentionDays.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutJobRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowLazyOpen, value.AllowLazyOpen, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropAnalysisConfig, value.AnalysisConfig, null, null); - writer.WriteProperty(options, PropAnalysisLimits, value.AnalysisLimits, null, null); - writer.WriteProperty(options, PropBackgroundPersistInterval, value.BackgroundPersistInterval, null, null); - writer.WriteProperty(options, PropCustomSettings, value.CustomSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropDailyModelSnapshotRetentionAfterDays, value.DailyModelSnapshotRetentionAfterDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDataDescription, value.DataDescription, null, null); - writer.WriteProperty(options, PropDatafeedConfig, value.DatafeedConfig, null, null); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropGroups, value.Groups, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropJobId, value.JobId, null, null); - writer.WriteProperty(options, PropModelPlotConfig, value.ModelPlotConfig, null, null); - writer.WriteProperty(options, PropModelSnapshotRetentionDays, value.ModelSnapshotRetentionDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRenormalizationWindowDays, value.RenormalizationWindowDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropResultsIndexName, value.ResultsIndexName, null, null); - writer.WriteProperty(options, PropResultsRetentionDays, value.ResultsRetentionDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Create an anomaly detection job. @@ -240,7 +66,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If you include a datafeed_config but do not provide a query, the datafeed uses {"match_all": {"boost": 1}}. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PutJobRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PutJobRequestConverter))] public sealed partial class PutJobRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutJobResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutJobResponse.Converters.g.cs new file mode 100644 index 00000000000..e805f0b329c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutJobResponse.Converters.g.cs @@ -0,0 +1,234 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PutJobResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowLazyOpen = System.Text.Json.JsonEncodedText.Encode("allow_lazy_open"); + private static readonly System.Text.Json.JsonEncodedText PropAnalysisConfig = System.Text.Json.JsonEncodedText.Encode("analysis_config"); + private static readonly System.Text.Json.JsonEncodedText PropAnalysisLimits = System.Text.Json.JsonEncodedText.Encode("analysis_limits"); + private static readonly System.Text.Json.JsonEncodedText PropBackgroundPersistInterval = System.Text.Json.JsonEncodedText.Encode("background_persist_interval"); + private static readonly System.Text.Json.JsonEncodedText PropCreateTime = System.Text.Json.JsonEncodedText.Encode("create_time"); + private static readonly System.Text.Json.JsonEncodedText PropCustomSettings = System.Text.Json.JsonEncodedText.Encode("custom_settings"); + private static readonly System.Text.Json.JsonEncodedText PropDailyModelSnapshotRetentionAfterDays = System.Text.Json.JsonEncodedText.Encode("daily_model_snapshot_retention_after_days"); + private static readonly System.Text.Json.JsonEncodedText PropDataDescription = System.Text.Json.JsonEncodedText.Encode("data_description"); + private static readonly System.Text.Json.JsonEncodedText PropDatafeedConfig = System.Text.Json.JsonEncodedText.Encode("datafeed_config"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropGroups = System.Text.Json.JsonEncodedText.Encode("groups"); + private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); + private static readonly System.Text.Json.JsonEncodedText PropJobType = System.Text.Json.JsonEncodedText.Encode("job_type"); + private static readonly System.Text.Json.JsonEncodedText PropJobVersion = System.Text.Json.JsonEncodedText.Encode("job_version"); + private static readonly System.Text.Json.JsonEncodedText PropModelPlotConfig = System.Text.Json.JsonEncodedText.Encode("model_plot_config"); + private static readonly System.Text.Json.JsonEncodedText PropModelSnapshotId = System.Text.Json.JsonEncodedText.Encode("model_snapshot_id"); + private static readonly System.Text.Json.JsonEncodedText PropModelSnapshotRetentionDays = System.Text.Json.JsonEncodedText.Encode("model_snapshot_retention_days"); + private static readonly System.Text.Json.JsonEncodedText PropRenormalizationWindowDays = System.Text.Json.JsonEncodedText.Encode("renormalization_window_days"); + private static readonly System.Text.Json.JsonEncodedText PropResultsIndexName = System.Text.Json.JsonEncodedText.Encode("results_index_name"); + private static readonly System.Text.Json.JsonEncodedText PropResultsRetentionDays = System.Text.Json.JsonEncodedText.Encode("results_retention_days"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.PutJobResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowLazyOpen = default; + LocalJsonValue propAnalysisConfig = default; + LocalJsonValue propAnalysisLimits = default; + LocalJsonValue propBackgroundPersistInterval = default; + LocalJsonValue propCreateTime = default; + LocalJsonValue propCustomSettings = default; + LocalJsonValue propDailyModelSnapshotRetentionAfterDays = default; + LocalJsonValue propDataDescription = default; + LocalJsonValue propDatafeedConfig = default; + LocalJsonValue propDescription = default; + LocalJsonValue?> propGroups = default; + LocalJsonValue propJobId = default; + LocalJsonValue propJobType = default; + LocalJsonValue propJobVersion = default; + LocalJsonValue propModelPlotConfig = default; + LocalJsonValue propModelSnapshotId = default; + LocalJsonValue propModelSnapshotRetentionDays = default; + LocalJsonValue propRenormalizationWindowDays = default; + LocalJsonValue propResultsIndexName = default; + LocalJsonValue propResultsRetentionDays = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowLazyOpen.TryReadProperty(ref reader, options, PropAllowLazyOpen, null)) + { + continue; + } + + if (propAnalysisConfig.TryReadProperty(ref reader, options, PropAnalysisConfig, null)) + { + continue; + } + + if (propAnalysisLimits.TryReadProperty(ref reader, options, PropAnalysisLimits, null)) + { + continue; + } + + if (propBackgroundPersistInterval.TryReadProperty(ref reader, options, PropBackgroundPersistInterval, null)) + { + continue; + } + + if (propCreateTime.TryReadProperty(ref reader, options, PropCreateTime, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propCustomSettings.TryReadProperty(ref reader, options, PropCustomSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propDailyModelSnapshotRetentionAfterDays.TryReadProperty(ref reader, options, PropDailyModelSnapshotRetentionAfterDays, null)) + { + continue; + } + + if (propDataDescription.TryReadProperty(ref reader, options, PropDataDescription, null)) + { + continue; + } + + if (propDatafeedConfig.TryReadProperty(ref reader, options, PropDatafeedConfig, null)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propGroups.TryReadProperty(ref reader, options, PropGroups, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) + { + continue; + } + + if (propJobType.TryReadProperty(ref reader, options, PropJobType, null)) + { + continue; + } + + if (propJobVersion.TryReadProperty(ref reader, options, PropJobVersion, null)) + { + continue; + } + + if (propModelPlotConfig.TryReadProperty(ref reader, options, PropModelPlotConfig, null)) + { + continue; + } + + if (propModelSnapshotId.TryReadProperty(ref reader, options, PropModelSnapshotId, null)) + { + continue; + } + + if (propModelSnapshotRetentionDays.TryReadProperty(ref reader, options, PropModelSnapshotRetentionDays, null)) + { + continue; + } + + if (propRenormalizationWindowDays.TryReadProperty(ref reader, options, PropRenormalizationWindowDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propResultsIndexName.TryReadProperty(ref reader, options, PropResultsIndexName, null)) + { + continue; + } + + if (propResultsRetentionDays.TryReadProperty(ref reader, options, PropResultsRetentionDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PutJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowLazyOpen = propAllowLazyOpen.Value, + AnalysisConfig = propAnalysisConfig.Value, + AnalysisLimits = propAnalysisLimits.Value, + BackgroundPersistInterval = propBackgroundPersistInterval.Value, + CreateTime = propCreateTime.Value, + CustomSettings = propCustomSettings.Value, + DailyModelSnapshotRetentionAfterDays = propDailyModelSnapshotRetentionAfterDays.Value, + DataDescription = propDataDescription.Value, + DatafeedConfig = propDatafeedConfig.Value, + Description = propDescription.Value, + Groups = propGroups.Value, + JobId = propJobId.Value, + JobType = propJobType.Value, + JobVersion = propJobVersion.Value, + ModelPlotConfig = propModelPlotConfig.Value, + ModelSnapshotId = propModelSnapshotId.Value, + ModelSnapshotRetentionDays = propModelSnapshotRetentionDays.Value, + RenormalizationWindowDays = propRenormalizationWindowDays.Value, + ResultsIndexName = propResultsIndexName.Value, + ResultsRetentionDays = propResultsRetentionDays.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutJobResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowLazyOpen, value.AllowLazyOpen, null, null); + writer.WriteProperty(options, PropAnalysisConfig, value.AnalysisConfig, null, null); + writer.WriteProperty(options, PropAnalysisLimits, value.AnalysisLimits, null, null); + writer.WriteProperty(options, PropBackgroundPersistInterval, value.BackgroundPersistInterval, null, null); + writer.WriteProperty(options, PropCreateTime, value.CreateTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropCustomSettings, value.CustomSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropDailyModelSnapshotRetentionAfterDays, value.DailyModelSnapshotRetentionAfterDays, null, null); + writer.WriteProperty(options, PropDataDescription, value.DataDescription, null, null); + writer.WriteProperty(options, PropDatafeedConfig, value.DatafeedConfig, null, null); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropGroups, value.Groups, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropJobId, value.JobId, null, null); + writer.WriteProperty(options, PropJobType, value.JobType, null, null); + writer.WriteProperty(options, PropJobVersion, value.JobVersion, null, null); + writer.WriteProperty(options, PropModelPlotConfig, value.ModelPlotConfig, null, null); + writer.WriteProperty(options, PropModelSnapshotId, value.ModelSnapshotId, null, null); + writer.WriteProperty(options, PropModelSnapshotRetentionDays, value.ModelSnapshotRetentionDays, null, null); + writer.WriteProperty(options, PropRenormalizationWindowDays, value.RenormalizationWindowDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropResultsIndexName, value.ResultsIndexName, null, null); + writer.WriteProperty(options, PropResultsRetentionDays, value.ResultsRetentionDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutJobResponse.g.cs index 1b554374bbb..d88d1f213d0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutJobResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutJobResponse.g.cs @@ -23,217 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class PutJobResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowLazyOpen = System.Text.Json.JsonEncodedText.Encode("allow_lazy_open"); - private static readonly System.Text.Json.JsonEncodedText PropAnalysisConfig = System.Text.Json.JsonEncodedText.Encode("analysis_config"); - private static readonly System.Text.Json.JsonEncodedText PropAnalysisLimits = System.Text.Json.JsonEncodedText.Encode("analysis_limits"); - private static readonly System.Text.Json.JsonEncodedText PropBackgroundPersistInterval = System.Text.Json.JsonEncodedText.Encode("background_persist_interval"); - private static readonly System.Text.Json.JsonEncodedText PropCreateTime = System.Text.Json.JsonEncodedText.Encode("create_time"); - private static readonly System.Text.Json.JsonEncodedText PropCustomSettings = System.Text.Json.JsonEncodedText.Encode("custom_settings"); - private static readonly System.Text.Json.JsonEncodedText PropDailyModelSnapshotRetentionAfterDays = System.Text.Json.JsonEncodedText.Encode("daily_model_snapshot_retention_after_days"); - private static readonly System.Text.Json.JsonEncodedText PropDataDescription = System.Text.Json.JsonEncodedText.Encode("data_description"); - private static readonly System.Text.Json.JsonEncodedText PropDatafeedConfig = System.Text.Json.JsonEncodedText.Encode("datafeed_config"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropGroups = System.Text.Json.JsonEncodedText.Encode("groups"); - private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); - private static readonly System.Text.Json.JsonEncodedText PropJobType = System.Text.Json.JsonEncodedText.Encode("job_type"); - private static readonly System.Text.Json.JsonEncodedText PropJobVersion = System.Text.Json.JsonEncodedText.Encode("job_version"); - private static readonly System.Text.Json.JsonEncodedText PropModelPlotConfig = System.Text.Json.JsonEncodedText.Encode("model_plot_config"); - private static readonly System.Text.Json.JsonEncodedText PropModelSnapshotId = System.Text.Json.JsonEncodedText.Encode("model_snapshot_id"); - private static readonly System.Text.Json.JsonEncodedText PropModelSnapshotRetentionDays = System.Text.Json.JsonEncodedText.Encode("model_snapshot_retention_days"); - private static readonly System.Text.Json.JsonEncodedText PropRenormalizationWindowDays = System.Text.Json.JsonEncodedText.Encode("renormalization_window_days"); - private static readonly System.Text.Json.JsonEncodedText PropResultsIndexName = System.Text.Json.JsonEncodedText.Encode("results_index_name"); - private static readonly System.Text.Json.JsonEncodedText PropResultsRetentionDays = System.Text.Json.JsonEncodedText.Encode("results_retention_days"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.PutJobResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowLazyOpen = default; - LocalJsonValue propAnalysisConfig = default; - LocalJsonValue propAnalysisLimits = default; - LocalJsonValue propBackgroundPersistInterval = default; - LocalJsonValue propCreateTime = default; - LocalJsonValue propCustomSettings = default; - LocalJsonValue propDailyModelSnapshotRetentionAfterDays = default; - LocalJsonValue propDataDescription = default; - LocalJsonValue propDatafeedConfig = default; - LocalJsonValue propDescription = default; - LocalJsonValue?> propGroups = default; - LocalJsonValue propJobId = default; - LocalJsonValue propJobType = default; - LocalJsonValue propJobVersion = default; - LocalJsonValue propModelPlotConfig = default; - LocalJsonValue propModelSnapshotId = default; - LocalJsonValue propModelSnapshotRetentionDays = default; - LocalJsonValue propRenormalizationWindowDays = default; - LocalJsonValue propResultsIndexName = default; - LocalJsonValue propResultsRetentionDays = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowLazyOpen.TryReadProperty(ref reader, options, PropAllowLazyOpen, null)) - { - continue; - } - - if (propAnalysisConfig.TryReadProperty(ref reader, options, PropAnalysisConfig, null)) - { - continue; - } - - if (propAnalysisLimits.TryReadProperty(ref reader, options, PropAnalysisLimits, null)) - { - continue; - } - - if (propBackgroundPersistInterval.TryReadProperty(ref reader, options, PropBackgroundPersistInterval, null)) - { - continue; - } - - if (propCreateTime.TryReadProperty(ref reader, options, PropCreateTime, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propCustomSettings.TryReadProperty(ref reader, options, PropCustomSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propDailyModelSnapshotRetentionAfterDays.TryReadProperty(ref reader, options, PropDailyModelSnapshotRetentionAfterDays, null)) - { - continue; - } - - if (propDataDescription.TryReadProperty(ref reader, options, PropDataDescription, null)) - { - continue; - } - - if (propDatafeedConfig.TryReadProperty(ref reader, options, PropDatafeedConfig, null)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propGroups.TryReadProperty(ref reader, options, PropGroups, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) - { - continue; - } - - if (propJobType.TryReadProperty(ref reader, options, PropJobType, null)) - { - continue; - } - - if (propJobVersion.TryReadProperty(ref reader, options, PropJobVersion, null)) - { - continue; - } - - if (propModelPlotConfig.TryReadProperty(ref reader, options, PropModelPlotConfig, null)) - { - continue; - } - - if (propModelSnapshotId.TryReadProperty(ref reader, options, PropModelSnapshotId, null)) - { - continue; - } - - if (propModelSnapshotRetentionDays.TryReadProperty(ref reader, options, PropModelSnapshotRetentionDays, null)) - { - continue; - } - - if (propRenormalizationWindowDays.TryReadProperty(ref reader, options, PropRenormalizationWindowDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propResultsIndexName.TryReadProperty(ref reader, options, PropResultsIndexName, null)) - { - continue; - } - - if (propResultsRetentionDays.TryReadProperty(ref reader, options, PropResultsRetentionDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PutJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowLazyOpen = propAllowLazyOpen.Value, - AnalysisConfig = propAnalysisConfig.Value, - AnalysisLimits = propAnalysisLimits.Value, - BackgroundPersistInterval = propBackgroundPersistInterval.Value, - CreateTime = propCreateTime.Value, - CustomSettings = propCustomSettings.Value, - DailyModelSnapshotRetentionAfterDays = propDailyModelSnapshotRetentionAfterDays.Value, - DataDescription = propDataDescription.Value, - DatafeedConfig = propDatafeedConfig.Value, - Description = propDescription.Value, - Groups = propGroups.Value, - JobId = propJobId.Value, - JobType = propJobType.Value, - JobVersion = propJobVersion.Value, - ModelPlotConfig = propModelPlotConfig.Value, - ModelSnapshotId = propModelSnapshotId.Value, - ModelSnapshotRetentionDays = propModelSnapshotRetentionDays.Value, - RenormalizationWindowDays = propRenormalizationWindowDays.Value, - ResultsIndexName = propResultsIndexName.Value, - ResultsRetentionDays = propResultsRetentionDays.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutJobResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowLazyOpen, value.AllowLazyOpen, null, null); - writer.WriteProperty(options, PropAnalysisConfig, value.AnalysisConfig, null, null); - writer.WriteProperty(options, PropAnalysisLimits, value.AnalysisLimits, null, null); - writer.WriteProperty(options, PropBackgroundPersistInterval, value.BackgroundPersistInterval, null, null); - writer.WriteProperty(options, PropCreateTime, value.CreateTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropCustomSettings, value.CustomSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropDailyModelSnapshotRetentionAfterDays, value.DailyModelSnapshotRetentionAfterDays, null, null); - writer.WriteProperty(options, PropDataDescription, value.DataDescription, null, null); - writer.WriteProperty(options, PropDatafeedConfig, value.DatafeedConfig, null, null); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropGroups, value.Groups, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropJobId, value.JobId, null, null); - writer.WriteProperty(options, PropJobType, value.JobType, null, null); - writer.WriteProperty(options, PropJobVersion, value.JobVersion, null, null); - writer.WriteProperty(options, PropModelPlotConfig, value.ModelPlotConfig, null, null); - writer.WriteProperty(options, PropModelSnapshotId, value.ModelSnapshotId, null, null); - writer.WriteProperty(options, PropModelSnapshotRetentionDays, value.ModelSnapshotRetentionDays, null, null); - writer.WriteProperty(options, PropRenormalizationWindowDays, value.RenormalizationWindowDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropResultsIndexName, value.ResultsIndexName, null, null); - writer.WriteProperty(options, PropResultsRetentionDays, value.ResultsRetentionDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PutJobResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PutJobResponseConverter))] public sealed partial class PutJobResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -249,66 +39,66 @@ internal PutJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstruc public #if NET7_0_OR_GREATER - required +required #endif - bool AllowLazyOpen { get; set; } +bool AllowLazyOpen { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigRead AnalysisConfig { get; set; } +Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigRead AnalysisConfig { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimits AnalysisLimits { get; set; } +Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimits AnalysisLimits { get; set; } public Elastic.Clients.Elasticsearch.Duration? BackgroundPersistInterval { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.DateTimeOffset CreateTime { get; set; } +System.DateTimeOffset CreateTime { get; set; } public object? CustomSettings { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long DailyModelSnapshotRetentionAfterDays { get; set; } +long DailyModelSnapshotRetentionAfterDays { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.MachineLearning.DataDescription DataDescription { get; set; } +Elastic.Clients.Elasticsearch.MachineLearning.DataDescription DataDescription { get; set; } public Elastic.Clients.Elasticsearch.MachineLearning.Datafeed? DatafeedConfig { get; set; } public string? Description { get; set; } public System.Collections.Generic.IReadOnlyCollection? Groups { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string JobId { get; set; } +string JobId { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string JobType { get; set; } +string JobType { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string JobVersion { get; set; } +string JobVersion { get; set; } public Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfig? ModelPlotConfig { get; set; } public string? ModelSnapshotId { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long ModelSnapshotRetentionDays { get; set; } +long ModelSnapshotRetentionDays { get; set; } public long? RenormalizationWindowDays { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string ResultsIndexName { get; set; } +string ResultsIndexName { get; set; } public long? ResultsRetentionDays { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelAliasRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelAliasRequest.Converters.g.cs new file mode 100644 index 00000000000..1aca2070632 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelAliasRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PutTrainedModelAliasRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelAliasRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelAliasRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelAliasRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelAliasRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelAliasRequest.g.cs index 23af5935a90..8c2b8b262e2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelAliasRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelAliasRequest.g.cs @@ -35,35 +35,6 @@ public sealed partial class PutTrainedModelAliasRequestParameters : Elastic.Tran public bool? Reassign { get => Q("reassign"); set => Q("reassign", value); } } -internal sealed partial class PutTrainedModelAliasRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelAliasRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelAliasRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelAliasRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Create or update a trained model alias. @@ -85,7 +56,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// returns a warning. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelAliasRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PutTrainedModelAliasRequestConverter))] public sealed partial class PutTrainedModelAliasRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelAliasResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelAliasResponse.Converters.g.cs new file mode 100644 index 00000000000..a47193c669c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelAliasResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PutTrainedModelAliasResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelAliasResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelAliasResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelAliasResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelAliasResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelAliasResponse.g.cs index 04608887c50..d716b00c4ad 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelAliasResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelAliasResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class PutTrainedModelAliasResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelAliasResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelAliasResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelAliasResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelAliasResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PutTrainedModelAliasResponseConverter))] public sealed partial class PutTrainedModelAliasResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartRequest.Converters.g.cs new file mode 100644 index 00000000000..997b398bbd7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartRequest.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PutTrainedModelDefinitionPartRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDefinition = System.Text.Json.JsonEncodedText.Encode("definition"); + private static readonly System.Text.Json.JsonEncodedText PropTotalDefinitionLength = System.Text.Json.JsonEncodedText.Encode("total_definition_length"); + private static readonly System.Text.Json.JsonEncodedText PropTotalParts = System.Text.Json.JsonEncodedText.Encode("total_parts"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelDefinitionPartRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDefinition = default; + LocalJsonValue propTotalDefinitionLength = default; + LocalJsonValue propTotalParts = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDefinition.TryReadProperty(ref reader, options, PropDefinition, null)) + { + continue; + } + + if (propTotalDefinitionLength.TryReadProperty(ref reader, options, PropTotalDefinitionLength, null)) + { + continue; + } + + if (propTotalParts.TryReadProperty(ref reader, options, PropTotalParts, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelDefinitionPartRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Definition = propDefinition.Value, + TotalDefinitionLength = propTotalDefinitionLength.Value, + TotalParts = propTotalParts.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelDefinitionPartRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDefinition, value.Definition, null, null); + writer.WriteProperty(options, PropTotalDefinitionLength, value.TotalDefinitionLength, null, null); + writer.WriteProperty(options, PropTotalParts, value.TotalParts, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartRequest.g.cs index 2dbe1357913..55fa78cba3b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartRequest.g.cs @@ -27,69 +27,12 @@ public sealed partial class PutTrainedModelDefinitionPartRequestParameters : Ela { } -internal sealed partial class PutTrainedModelDefinitionPartRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDefinition = System.Text.Json.JsonEncodedText.Encode("definition"); - private static readonly System.Text.Json.JsonEncodedText PropTotalDefinitionLength = System.Text.Json.JsonEncodedText.Encode("total_definition_length"); - private static readonly System.Text.Json.JsonEncodedText PropTotalParts = System.Text.Json.JsonEncodedText.Encode("total_parts"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelDefinitionPartRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDefinition = default; - LocalJsonValue propTotalDefinitionLength = default; - LocalJsonValue propTotalParts = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDefinition.TryReadProperty(ref reader, options, PropDefinition, null)) - { - continue; - } - - if (propTotalDefinitionLength.TryReadProperty(ref reader, options, PropTotalDefinitionLength, null)) - { - continue; - } - - if (propTotalParts.TryReadProperty(ref reader, options, PropTotalParts, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelDefinitionPartRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Definition = propDefinition.Value, - TotalDefinitionLength = propTotalDefinitionLength.Value, - TotalParts = propTotalParts.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelDefinitionPartRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDefinition, value.Definition, null, null); - writer.WriteProperty(options, PropTotalDefinitionLength, value.TotalDefinitionLength, null, null); - writer.WriteProperty(options, PropTotalParts, value.TotalParts, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create part of a trained model definition. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelDefinitionPartRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PutTrainedModelDefinitionPartRequestConverter))] public sealed partial class PutTrainedModelDefinitionPartRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartResponse.Converters.g.cs new file mode 100644 index 00000000000..3386c31522a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PutTrainedModelDefinitionPartResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelDefinitionPartResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelDefinitionPartResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelDefinitionPartResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartResponse.g.cs index 347c1928fe6..68c3b65cb53 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelDefinitionPartResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class PutTrainedModelDefinitionPartResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelDefinitionPartResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelDefinitionPartResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelDefinitionPartResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelDefinitionPartResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PutTrainedModelDefinitionPartResponseConverter))] public sealed partial class PutTrainedModelDefinitionPartResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelRequest.Converters.g.cs new file mode 100644 index 00000000000..4baa228a6e4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelRequest.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PutTrainedModelRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCompressedDefinition = System.Text.Json.JsonEncodedText.Encode("compressed_definition"); + private static readonly System.Text.Json.JsonEncodedText PropDefinition = System.Text.Json.JsonEncodedText.Encode("definition"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceConfig = System.Text.Json.JsonEncodedText.Encode("inference_config"); + private static readonly System.Text.Json.JsonEncodedText PropInput = System.Text.Json.JsonEncodedText.Encode("input"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropModelSizeBytes = System.Text.Json.JsonEncodedText.Encode("model_size_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropModelType = System.Text.Json.JsonEncodedText.Encode("model_type"); + private static readonly System.Text.Json.JsonEncodedText PropPlatformArchitecture = System.Text.Json.JsonEncodedText.Encode("platform_architecture"); + private static readonly System.Text.Json.JsonEncodedText PropPrefixStrings = System.Text.Json.JsonEncodedText.Encode("prefix_strings"); + private static readonly System.Text.Json.JsonEncodedText PropTags = System.Text.Json.JsonEncodedText.Encode("tags"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCompressedDefinition = default; + LocalJsonValue propDefinition = default; + LocalJsonValue propDescription = default; + LocalJsonValue propInferenceConfig = default; + LocalJsonValue propInput = default; + LocalJsonValue propMetadata = default; + LocalJsonValue propModelSizeBytes = default; + LocalJsonValue propModelType = default; + LocalJsonValue propPlatformArchitecture = default; + LocalJsonValue propPrefixStrings = default; + LocalJsonValue?> propTags = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCompressedDefinition.TryReadProperty(ref reader, options, PropCompressedDefinition, null)) + { + continue; + } + + if (propDefinition.TryReadProperty(ref reader, options, PropDefinition, null)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propInferenceConfig.TryReadProperty(ref reader, options, PropInferenceConfig, null)) + { + continue; + } + + if (propInput.TryReadProperty(ref reader, options, PropInput, null)) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propModelSizeBytes.TryReadProperty(ref reader, options, PropModelSizeBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propModelType.TryReadProperty(ref reader, options, PropModelType, static Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPlatformArchitecture.TryReadProperty(ref reader, options, PropPlatformArchitecture, null)) + { + continue; + } + + if (propPrefixStrings.TryReadProperty(ref reader, options, PropPrefixStrings, null)) + { + continue; + } + + if (propTags.TryReadProperty(ref reader, options, PropTags, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CompressedDefinition = propCompressedDefinition.Value, + Definition = propDefinition.Value, + Description = propDescription.Value, + InferenceConfig = propInferenceConfig.Value, + Input = propInput.Value, + Metadata = propMetadata.Value, + ModelSizeBytes = propModelSizeBytes.Value, + ModelType = propModelType.Value, + PlatformArchitecture = propPlatformArchitecture.Value, + PrefixStrings = propPrefixStrings.Value, + Tags = propTags.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCompressedDefinition, value.CompressedDefinition, null, null); + writer.WriteProperty(options, PropDefinition, value.Definition, null, null); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropInferenceConfig, value.InferenceConfig, null, null); + writer.WriteProperty(options, PropInput, value.Input, null, null); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropModelSizeBytes, value.ModelSizeBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropModelType, value.ModelType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPlatformArchitecture, value.PlatformArchitecture, null, null); + writer.WriteProperty(options, PropPrefixStrings, value.PrefixStrings, null, null); + writer.WriteProperty(options, PropTags, value.Tags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelRequest.g.cs index 0ecfc1867b2..c60a1276d5a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelRequest.g.cs @@ -43,142 +43,13 @@ public sealed partial class PutTrainedModelRequestParameters : Elastic.Transport public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } } -internal sealed partial class PutTrainedModelRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCompressedDefinition = System.Text.Json.JsonEncodedText.Encode("compressed_definition"); - private static readonly System.Text.Json.JsonEncodedText PropDefinition = System.Text.Json.JsonEncodedText.Encode("definition"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceConfig = System.Text.Json.JsonEncodedText.Encode("inference_config"); - private static readonly System.Text.Json.JsonEncodedText PropInput = System.Text.Json.JsonEncodedText.Encode("input"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropModelSizeBytes = System.Text.Json.JsonEncodedText.Encode("model_size_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropModelType = System.Text.Json.JsonEncodedText.Encode("model_type"); - private static readonly System.Text.Json.JsonEncodedText PropPlatformArchitecture = System.Text.Json.JsonEncodedText.Encode("platform_architecture"); - private static readonly System.Text.Json.JsonEncodedText PropPrefixStrings = System.Text.Json.JsonEncodedText.Encode("prefix_strings"); - private static readonly System.Text.Json.JsonEncodedText PropTags = System.Text.Json.JsonEncodedText.Encode("tags"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCompressedDefinition = default; - LocalJsonValue propDefinition = default; - LocalJsonValue propDescription = default; - LocalJsonValue propInferenceConfig = default; - LocalJsonValue propInput = default; - LocalJsonValue propMetadata = default; - LocalJsonValue propModelSizeBytes = default; - LocalJsonValue propModelType = default; - LocalJsonValue propPlatformArchitecture = default; - LocalJsonValue propPrefixStrings = default; - LocalJsonValue?> propTags = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCompressedDefinition.TryReadProperty(ref reader, options, PropCompressedDefinition, null)) - { - continue; - } - - if (propDefinition.TryReadProperty(ref reader, options, PropDefinition, null)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propInferenceConfig.TryReadProperty(ref reader, options, PropInferenceConfig, null)) - { - continue; - } - - if (propInput.TryReadProperty(ref reader, options, PropInput, null)) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propModelSizeBytes.TryReadProperty(ref reader, options, PropModelSizeBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propModelType.TryReadProperty(ref reader, options, PropModelType, static Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPlatformArchitecture.TryReadProperty(ref reader, options, PropPlatformArchitecture, null)) - { - continue; - } - - if (propPrefixStrings.TryReadProperty(ref reader, options, PropPrefixStrings, null)) - { - continue; - } - - if (propTags.TryReadProperty(ref reader, options, PropTags, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CompressedDefinition = propCompressedDefinition.Value, - Definition = propDefinition.Value, - Description = propDescription.Value, - InferenceConfig = propInferenceConfig.Value, - Input = propInput.Value, - Metadata = propMetadata.Value, - ModelSizeBytes = propModelSizeBytes.Value, - ModelType = propModelType.Value, - PlatformArchitecture = propPlatformArchitecture.Value, - PrefixStrings = propPrefixStrings.Value, - Tags = propTags.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCompressedDefinition, value.CompressedDefinition, null, null); - writer.WriteProperty(options, PropDefinition, value.Definition, null, null); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropInferenceConfig, value.InferenceConfig, null, null); - writer.WriteProperty(options, PropInput, value.Input, null, null); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropModelSizeBytes, value.ModelSizeBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropModelType, value.ModelType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPlatformArchitecture, value.PlatformArchitecture, null, null); - writer.WriteProperty(options, PropPrefixStrings, value.PrefixStrings, null, null); - writer.WriteProperty(options, PropTags, value.Tags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// Create a trained model. /// Enable you to supply a trained model that is not created by data frame analytics. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PutTrainedModelRequestConverter))] public sealed partial class PutTrainedModelRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelResponse.Converters.g.cs new file mode 100644 index 00000000000..344e6d0fe3e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelResponse.Converters.g.cs @@ -0,0 +1,243 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PutTrainedModelResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCompressedDefinition = System.Text.Json.JsonEncodedText.Encode("compressed_definition"); + private static readonly System.Text.Json.JsonEncodedText PropCreatedBy = System.Text.Json.JsonEncodedText.Encode("created_by"); + private static readonly System.Text.Json.JsonEncodedText PropCreateTime = System.Text.Json.JsonEncodedText.Encode("create_time"); + private static readonly System.Text.Json.JsonEncodedText PropDefaultFieldMap = System.Text.Json.JsonEncodedText.Encode("default_field_map"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropEstimatedHeapMemoryUsageBytes = System.Text.Json.JsonEncodedText.Encode("estimated_heap_memory_usage_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropEstimatedOperations = System.Text.Json.JsonEncodedText.Encode("estimated_operations"); + private static readonly System.Text.Json.JsonEncodedText PropFullyDefined = System.Text.Json.JsonEncodedText.Encode("fully_defined"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceConfig = System.Text.Json.JsonEncodedText.Encode("inference_config"); + private static readonly System.Text.Json.JsonEncodedText PropInput = System.Text.Json.JsonEncodedText.Encode("input"); + private static readonly System.Text.Json.JsonEncodedText PropLicenseLevel = System.Text.Json.JsonEncodedText.Encode("license_level"); + private static readonly System.Text.Json.JsonEncodedText PropLocation = System.Text.Json.JsonEncodedText.Encode("location"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); + private static readonly System.Text.Json.JsonEncodedText PropModelPackage = System.Text.Json.JsonEncodedText.Encode("model_package"); + private static readonly System.Text.Json.JsonEncodedText PropModelSizeBytes = System.Text.Json.JsonEncodedText.Encode("model_size_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropModelType = System.Text.Json.JsonEncodedText.Encode("model_type"); + private static readonly System.Text.Json.JsonEncodedText PropPlatformArchitecture = System.Text.Json.JsonEncodedText.Encode("platform_architecture"); + private static readonly System.Text.Json.JsonEncodedText PropPrefixStrings = System.Text.Json.JsonEncodedText.Encode("prefix_strings"); + private static readonly System.Text.Json.JsonEncodedText PropTags = System.Text.Json.JsonEncodedText.Encode("tags"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCompressedDefinition = default; + LocalJsonValue propCreatedBy = default; + LocalJsonValue propCreateTime = default; + LocalJsonValue?> propDefaultFieldMap = default; + LocalJsonValue propDescription = default; + LocalJsonValue propEstimatedHeapMemoryUsageBytes = default; + LocalJsonValue propEstimatedOperations = default; + LocalJsonValue propFullyDefined = default; + LocalJsonValue propInferenceConfig = default; + LocalJsonValue propInput = default; + LocalJsonValue propLicenseLevel = default; + LocalJsonValue propLocation = default; + LocalJsonValue propMetadata = default; + LocalJsonValue propModelId = default; + LocalJsonValue propModelPackage = default; + LocalJsonValue propModelSizeBytes = default; + LocalJsonValue propModelType = default; + LocalJsonValue propPlatformArchitecture = default; + LocalJsonValue propPrefixStrings = default; + LocalJsonValue> propTags = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCompressedDefinition.TryReadProperty(ref reader, options, PropCompressedDefinition, null)) + { + continue; + } + + if (propCreatedBy.TryReadProperty(ref reader, options, PropCreatedBy, null)) + { + continue; + } + + if (propCreateTime.TryReadProperty(ref reader, options, PropCreateTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propDefaultFieldMap.TryReadProperty(ref reader, options, PropDefaultFieldMap, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propEstimatedHeapMemoryUsageBytes.TryReadProperty(ref reader, options, PropEstimatedHeapMemoryUsageBytes, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEstimatedOperations.TryReadProperty(ref reader, options, PropEstimatedOperations, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFullyDefined.TryReadProperty(ref reader, options, PropFullyDefined, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propInferenceConfig.TryReadProperty(ref reader, options, PropInferenceConfig, null)) + { + continue; + } + + if (propInput.TryReadProperty(ref reader, options, PropInput, null)) + { + continue; + } + + if (propLicenseLevel.TryReadProperty(ref reader, options, PropLicenseLevel, null)) + { + continue; + } + + if (propLocation.TryReadProperty(ref reader, options, PropLocation, null)) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, null)) + { + continue; + } + + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) + { + continue; + } + + if (propModelPackage.TryReadProperty(ref reader, options, PropModelPackage, null)) + { + continue; + } + + if (propModelSizeBytes.TryReadProperty(ref reader, options, PropModelSizeBytes, null)) + { + continue; + } + + if (propModelType.TryReadProperty(ref reader, options, PropModelType, static Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPlatformArchitecture.TryReadProperty(ref reader, options, PropPlatformArchitecture, null)) + { + continue; + } + + if (propPrefixStrings.TryReadProperty(ref reader, options, PropPrefixStrings, null)) + { + continue; + } + + if (propTags.TryReadProperty(ref reader, options, PropTags, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CompressedDefinition = propCompressedDefinition.Value, + CreatedBy = propCreatedBy.Value, + CreateTime = propCreateTime.Value, + DefaultFieldMap = propDefaultFieldMap.Value, + Description = propDescription.Value, + EstimatedHeapMemoryUsageBytes = propEstimatedHeapMemoryUsageBytes.Value, + EstimatedOperations = propEstimatedOperations.Value, + FullyDefined = propFullyDefined.Value, + InferenceConfig = propInferenceConfig.Value, + Input = propInput.Value, + LicenseLevel = propLicenseLevel.Value, + Location = propLocation.Value, + Metadata = propMetadata.Value, + ModelId = propModelId.Value, + ModelPackage = propModelPackage.Value, + ModelSizeBytes = propModelSizeBytes.Value, + ModelType = propModelType.Value, + PlatformArchitecture = propPlatformArchitecture.Value, + PrefixStrings = propPrefixStrings.Value, + Tags = propTags.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCompressedDefinition, value.CompressedDefinition, null, null); + writer.WriteProperty(options, PropCreatedBy, value.CreatedBy, null, null); + writer.WriteProperty(options, PropCreateTime, value.CreateTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropDefaultFieldMap, value.DefaultFieldMap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropEstimatedHeapMemoryUsageBytes, value.EstimatedHeapMemoryUsageBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEstimatedOperations, value.EstimatedOperations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFullyDefined, value.FullyDefined, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropInferenceConfig, value.InferenceConfig, null, null); + writer.WriteProperty(options, PropInput, value.Input, null, null); + writer.WriteProperty(options, PropLicenseLevel, value.LicenseLevel, null, null); + writer.WriteProperty(options, PropLocation, value.Location, null, null); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, null); + writer.WriteProperty(options, PropModelId, value.ModelId, null, null); + writer.WriteProperty(options, PropModelPackage, value.ModelPackage, null, null); + writer.WriteProperty(options, PropModelSizeBytes, value.ModelSizeBytes, null, null); + writer.WriteProperty(options, PropModelType, value.ModelType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPlatformArchitecture, value.PlatformArchitecture, null, null); + writer.WriteProperty(options, PropPrefixStrings, value.PrefixStrings, null, null); + writer.WriteProperty(options, PropTags, value.Tags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelResponse.g.cs index 3c6407c1877..71dd5dc57ff 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelResponse.g.cs @@ -23,226 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class PutTrainedModelResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCompressedDefinition = System.Text.Json.JsonEncodedText.Encode("compressed_definition"); - private static readonly System.Text.Json.JsonEncodedText PropCreatedBy = System.Text.Json.JsonEncodedText.Encode("created_by"); - private static readonly System.Text.Json.JsonEncodedText PropCreateTime = System.Text.Json.JsonEncodedText.Encode("create_time"); - private static readonly System.Text.Json.JsonEncodedText PropDefaultFieldMap = System.Text.Json.JsonEncodedText.Encode("default_field_map"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropEstimatedHeapMemoryUsageBytes = System.Text.Json.JsonEncodedText.Encode("estimated_heap_memory_usage_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropEstimatedOperations = System.Text.Json.JsonEncodedText.Encode("estimated_operations"); - private static readonly System.Text.Json.JsonEncodedText PropFullyDefined = System.Text.Json.JsonEncodedText.Encode("fully_defined"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceConfig = System.Text.Json.JsonEncodedText.Encode("inference_config"); - private static readonly System.Text.Json.JsonEncodedText PropInput = System.Text.Json.JsonEncodedText.Encode("input"); - private static readonly System.Text.Json.JsonEncodedText PropLicenseLevel = System.Text.Json.JsonEncodedText.Encode("license_level"); - private static readonly System.Text.Json.JsonEncodedText PropLocation = System.Text.Json.JsonEncodedText.Encode("location"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); - private static readonly System.Text.Json.JsonEncodedText PropModelPackage = System.Text.Json.JsonEncodedText.Encode("model_package"); - private static readonly System.Text.Json.JsonEncodedText PropModelSizeBytes = System.Text.Json.JsonEncodedText.Encode("model_size_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropModelType = System.Text.Json.JsonEncodedText.Encode("model_type"); - private static readonly System.Text.Json.JsonEncodedText PropPlatformArchitecture = System.Text.Json.JsonEncodedText.Encode("platform_architecture"); - private static readonly System.Text.Json.JsonEncodedText PropPrefixStrings = System.Text.Json.JsonEncodedText.Encode("prefix_strings"); - private static readonly System.Text.Json.JsonEncodedText PropTags = System.Text.Json.JsonEncodedText.Encode("tags"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCompressedDefinition = default; - LocalJsonValue propCreatedBy = default; - LocalJsonValue propCreateTime = default; - LocalJsonValue?> propDefaultFieldMap = default; - LocalJsonValue propDescription = default; - LocalJsonValue propEstimatedHeapMemoryUsageBytes = default; - LocalJsonValue propEstimatedOperations = default; - LocalJsonValue propFullyDefined = default; - LocalJsonValue propInferenceConfig = default; - LocalJsonValue propInput = default; - LocalJsonValue propLicenseLevel = default; - LocalJsonValue propLocation = default; - LocalJsonValue propMetadata = default; - LocalJsonValue propModelId = default; - LocalJsonValue propModelPackage = default; - LocalJsonValue propModelSizeBytes = default; - LocalJsonValue propModelType = default; - LocalJsonValue propPlatformArchitecture = default; - LocalJsonValue propPrefixStrings = default; - LocalJsonValue> propTags = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCompressedDefinition.TryReadProperty(ref reader, options, PropCompressedDefinition, null)) - { - continue; - } - - if (propCreatedBy.TryReadProperty(ref reader, options, PropCreatedBy, null)) - { - continue; - } - - if (propCreateTime.TryReadProperty(ref reader, options, PropCreateTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propDefaultFieldMap.TryReadProperty(ref reader, options, PropDefaultFieldMap, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propEstimatedHeapMemoryUsageBytes.TryReadProperty(ref reader, options, PropEstimatedHeapMemoryUsageBytes, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEstimatedOperations.TryReadProperty(ref reader, options, PropEstimatedOperations, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFullyDefined.TryReadProperty(ref reader, options, PropFullyDefined, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propInferenceConfig.TryReadProperty(ref reader, options, PropInferenceConfig, null)) - { - continue; - } - - if (propInput.TryReadProperty(ref reader, options, PropInput, null)) - { - continue; - } - - if (propLicenseLevel.TryReadProperty(ref reader, options, PropLicenseLevel, null)) - { - continue; - } - - if (propLocation.TryReadProperty(ref reader, options, PropLocation, null)) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, null)) - { - continue; - } - - if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) - { - continue; - } - - if (propModelPackage.TryReadProperty(ref reader, options, PropModelPackage, null)) - { - continue; - } - - if (propModelSizeBytes.TryReadProperty(ref reader, options, PropModelSizeBytes, null)) - { - continue; - } - - if (propModelType.TryReadProperty(ref reader, options, PropModelType, static Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPlatformArchitecture.TryReadProperty(ref reader, options, PropPlatformArchitecture, null)) - { - continue; - } - - if (propPrefixStrings.TryReadProperty(ref reader, options, PropPrefixStrings, null)) - { - continue; - } - - if (propTags.TryReadProperty(ref reader, options, PropTags, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CompressedDefinition = propCompressedDefinition.Value, - CreatedBy = propCreatedBy.Value, - CreateTime = propCreateTime.Value, - DefaultFieldMap = propDefaultFieldMap.Value, - Description = propDescription.Value, - EstimatedHeapMemoryUsageBytes = propEstimatedHeapMemoryUsageBytes.Value, - EstimatedOperations = propEstimatedOperations.Value, - FullyDefined = propFullyDefined.Value, - InferenceConfig = propInferenceConfig.Value, - Input = propInput.Value, - LicenseLevel = propLicenseLevel.Value, - Location = propLocation.Value, - Metadata = propMetadata.Value, - ModelId = propModelId.Value, - ModelPackage = propModelPackage.Value, - ModelSizeBytes = propModelSizeBytes.Value, - ModelType = propModelType.Value, - PlatformArchitecture = propPlatformArchitecture.Value, - PrefixStrings = propPrefixStrings.Value, - Tags = propTags.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCompressedDefinition, value.CompressedDefinition, null, null); - writer.WriteProperty(options, PropCreatedBy, value.CreatedBy, null, null); - writer.WriteProperty(options, PropCreateTime, value.CreateTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropDefaultFieldMap, value.DefaultFieldMap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropEstimatedHeapMemoryUsageBytes, value.EstimatedHeapMemoryUsageBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEstimatedOperations, value.EstimatedOperations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFullyDefined, value.FullyDefined, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropInferenceConfig, value.InferenceConfig, null, null); - writer.WriteProperty(options, PropInput, value.Input, null, null); - writer.WriteProperty(options, PropLicenseLevel, value.LicenseLevel, null, null); - writer.WriteProperty(options, PropLocation, value.Location, null, null); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, null); - writer.WriteProperty(options, PropModelId, value.ModelId, null, null); - writer.WriteProperty(options, PropModelPackage, value.ModelPackage, null, null); - writer.WriteProperty(options, PropModelSizeBytes, value.ModelSizeBytes, null, null); - writer.WriteProperty(options, PropModelType, value.ModelType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPlatformArchitecture, value.PlatformArchitecture, null, null); - writer.WriteProperty(options, PropPrefixStrings, value.PrefixStrings, null, null); - writer.WriteProperty(options, PropTags, value.Tags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PutTrainedModelResponseConverter))] public sealed partial class PutTrainedModelResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelVocabularyRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelVocabularyRequest.Converters.g.cs new file mode 100644 index 00000000000..322e503f9b6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelVocabularyRequest.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PutTrainedModelVocabularyRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMerges = System.Text.Json.JsonEncodedText.Encode("merges"); + private static readonly System.Text.Json.JsonEncodedText PropScores = System.Text.Json.JsonEncodedText.Encode("scores"); + private static readonly System.Text.Json.JsonEncodedText PropVocabulary = System.Text.Json.JsonEncodedText.Encode("vocabulary"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelVocabularyRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propMerges = default; + LocalJsonValue?> propScores = default; + LocalJsonValue> propVocabulary = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMerges.TryReadProperty(ref reader, options, PropMerges, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propScores.TryReadProperty(ref reader, options, PropScores, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propVocabulary.TryReadProperty(ref reader, options, PropVocabulary, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelVocabularyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Merges = propMerges.Value, + Scores = propScores.Value, + Vocabulary = propVocabulary.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelVocabularyRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMerges, value.Merges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropScores, value.Scores, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropVocabulary, value.Vocabulary, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelVocabularyRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelVocabularyRequest.g.cs index aabf9130a9c..5fb54b6104c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelVocabularyRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelVocabularyRequest.g.cs @@ -27,63 +27,6 @@ public sealed partial class PutTrainedModelVocabularyRequestParameters : Elastic { } -internal sealed partial class PutTrainedModelVocabularyRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMerges = System.Text.Json.JsonEncodedText.Encode("merges"); - private static readonly System.Text.Json.JsonEncodedText PropScores = System.Text.Json.JsonEncodedText.Encode("scores"); - private static readonly System.Text.Json.JsonEncodedText PropVocabulary = System.Text.Json.JsonEncodedText.Encode("vocabulary"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelVocabularyRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propMerges = default; - LocalJsonValue?> propScores = default; - LocalJsonValue> propVocabulary = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMerges.TryReadProperty(ref reader, options, PropMerges, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propScores.TryReadProperty(ref reader, options, PropScores, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propVocabulary.TryReadProperty(ref reader, options, PropVocabulary, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelVocabularyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Merges = propMerges.Value, - Scores = propScores.Value, - Vocabulary = propVocabulary.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelVocabularyRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMerges, value.Merges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropScores, value.Scores, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropVocabulary, value.Vocabulary, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// Create a trained model vocabulary. @@ -91,7 +34,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The vocabulary is stored in the index as described in inference_config.*.vocabulary of the trained model definition. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelVocabularyRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PutTrainedModelVocabularyRequestConverter))] public sealed partial class PutTrainedModelVocabularyRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelVocabularyResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelVocabularyResponse.Converters.g.cs new file mode 100644 index 00000000000..5024e15c767 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelVocabularyResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PutTrainedModelVocabularyResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelVocabularyResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelVocabularyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelVocabularyResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelVocabularyResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelVocabularyResponse.g.cs index 27ff91887ab..f06ac6980cd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelVocabularyResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/PutTrainedModelVocabularyResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class PutTrainedModelVocabularyResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelVocabularyResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelVocabularyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelVocabularyResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PutTrainedModelVocabularyResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PutTrainedModelVocabularyResponseConverter))] public sealed partial class PutTrainedModelVocabularyResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ResetJobRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ResetJobRequest.Converters.g.cs new file mode 100644 index 00000000000..0b1901773bb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ResetJobRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ResetJobRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.ResetJobRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.ResetJobRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ResetJobRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ResetJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ResetJobRequest.g.cs index e24e0e74813..54f515d4b04 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ResetJobRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ResetJobRequest.g.cs @@ -43,35 +43,6 @@ public sealed partial class ResetJobRequestParameters : Elastic.Transport.Reques public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } } -internal sealed partial class ResetJobRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.ResetJobRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.ResetJobRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ResetJobRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Reset an anomaly detection job. @@ -81,7 +52,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// comma separated list. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ResetJobRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ResetJobRequestConverter))] public sealed partial class ResetJobRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ResetJobResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ResetJobResponse.Converters.g.cs new file mode 100644 index 00000000000..be0eaa6aceb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ResetJobResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ResetJobResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.ResetJobResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.ResetJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ResetJobResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ResetJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ResetJobResponse.g.cs index 8add4557dcc..e92f0a51add 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ResetJobResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ResetJobResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class ResetJobResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.ResetJobResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.ResetJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ResetJobResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ResetJobResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ResetJobResponseConverter))] public sealed partial class ResetJobResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/RevertModelSnapshotRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/RevertModelSnapshotRequest.Converters.g.cs new file mode 100644 index 00000000000..5b67a976957 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/RevertModelSnapshotRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class RevertModelSnapshotRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDeleteInterveningResults = System.Text.Json.JsonEncodedText.Encode("delete_intervening_results"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.RevertModelSnapshotRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDeleteInterveningResults = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDeleteInterveningResults.TryReadProperty(ref reader, options, PropDeleteInterveningResults, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.RevertModelSnapshotRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DeleteInterveningResults = propDeleteInterveningResults.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.RevertModelSnapshotRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDeleteInterveningResults, value.DeleteInterveningResults, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/RevertModelSnapshotRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/RevertModelSnapshotRequest.g.cs index be7e7983d61..342467009ba 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/RevertModelSnapshotRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/RevertModelSnapshotRequest.g.cs @@ -27,45 +27,6 @@ public sealed partial class RevertModelSnapshotRequestParameters : Elastic.Trans { } -internal sealed partial class RevertModelSnapshotRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDeleteInterveningResults = System.Text.Json.JsonEncodedText.Encode("delete_intervening_results"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.RevertModelSnapshotRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDeleteInterveningResults = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDeleteInterveningResults.TryReadProperty(ref reader, options, PropDeleteInterveningResults, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.RevertModelSnapshotRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DeleteInterveningResults = propDeleteInterveningResults.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.RevertModelSnapshotRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDeleteInterveningResults, value.DeleteInterveningResults, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Revert to a snapshot. @@ -78,7 +39,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// snapshot after Black Friday or a critical system failure. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.RevertModelSnapshotRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.RevertModelSnapshotRequestConverter))] public sealed partial class RevertModelSnapshotRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/RevertModelSnapshotResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/RevertModelSnapshotResponse.Converters.g.cs new file mode 100644 index 00000000000..e5039c367c2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/RevertModelSnapshotResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class RevertModelSnapshotResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropModel = System.Text.Json.JsonEncodedText.Encode("model"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.RevertModelSnapshotResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propModel = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propModel.TryReadProperty(ref reader, options, PropModel, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.RevertModelSnapshotResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Model = propModel.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.RevertModelSnapshotResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropModel, value.Model, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/RevertModelSnapshotResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/RevertModelSnapshotResponse.g.cs index 9312efaff6f..fc9bb0744ce 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/RevertModelSnapshotResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/RevertModelSnapshotResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class RevertModelSnapshotResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropModel = System.Text.Json.JsonEncodedText.Encode("model"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.RevertModelSnapshotResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propModel = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propModel.TryReadProperty(ref reader, options, PropModel, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.RevertModelSnapshotResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Model = propModel.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.RevertModelSnapshotResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropModel, value.Model, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.RevertModelSnapshotResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.RevertModelSnapshotResponseConverter))] public sealed partial class RevertModelSnapshotResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal RevertModelSnapshotResponse(Elastic.Clients.Elasticsearch.Serialization public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.MachineLearning.ModelSnapshot Model { get; set; } +Elastic.Clients.Elasticsearch.MachineLearning.ModelSnapshot Model { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/SetUpgradeModeRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/SetUpgradeModeRequest.Converters.g.cs new file mode 100644 index 00000000000..318fb110e74 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/SetUpgradeModeRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class SetUpgradeModeRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.SetUpgradeModeRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.SetUpgradeModeRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.SetUpgradeModeRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/SetUpgradeModeRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/SetUpgradeModeRequest.g.cs index b73b8cdd924..8f68484cc7b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/SetUpgradeModeRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/SetUpgradeModeRequest.g.cs @@ -42,35 +42,6 @@ public sealed partial class SetUpgradeModeRequestParameters : Elastic.Transport. public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class SetUpgradeModeRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.SetUpgradeModeRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.SetUpgradeModeRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.SetUpgradeModeRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Set upgrade_mode for ML indices. @@ -88,7 +59,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// machine learning info API. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.SetUpgradeModeRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.SetUpgradeModeRequestConverter))] public sealed partial class SetUpgradeModeRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/SetUpgradeModeResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/SetUpgradeModeResponse.Converters.g.cs new file mode 100644 index 00000000000..f57d4c6b6a5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/SetUpgradeModeResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class SetUpgradeModeResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.SetUpgradeModeResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.SetUpgradeModeResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.SetUpgradeModeResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/SetUpgradeModeResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/SetUpgradeModeResponse.g.cs index 075e74293ab..2a3fcdcff63 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/SetUpgradeModeResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/SetUpgradeModeResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class SetUpgradeModeResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.SetUpgradeModeResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.SetUpgradeModeResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.SetUpgradeModeResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.SetUpgradeModeResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.SetUpgradeModeResponseConverter))] public sealed partial class SetUpgradeModeResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDataFrameAnalyticsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDataFrameAnalyticsRequest.Converters.g.cs new file mode 100644 index 00000000000..06f447f2609 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDataFrameAnalyticsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class StartDataFrameAnalyticsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.StartDataFrameAnalyticsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.StartDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.StartDataFrameAnalyticsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDataFrameAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDataFrameAnalyticsRequest.g.cs index 4495f5a1326..154de16c8bc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDataFrameAnalyticsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDataFrameAnalyticsRequest.g.cs @@ -34,35 +34,6 @@ public sealed partial class StartDataFrameAnalyticsRequestParameters : Elastic.T public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class StartDataFrameAnalyticsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.StartDataFrameAnalyticsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.StartDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.StartDataFrameAnalyticsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Start a data frame analytics job. @@ -79,7 +50,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// the destination index in advance with custom settings and mappings. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.StartDataFrameAnalyticsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.StartDataFrameAnalyticsRequestConverter))] public sealed partial class StartDataFrameAnalyticsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDataFrameAnalyticsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDataFrameAnalyticsResponse.Converters.g.cs new file mode 100644 index 00000000000..f45ea109e0f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDataFrameAnalyticsResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class StartDataFrameAnalyticsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.StartDataFrameAnalyticsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + LocalJsonValue propNode = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (propNode.TryReadProperty(ref reader, options, PropNode, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.StartDataFrameAnalyticsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value, + Node = propNode.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.StartDataFrameAnalyticsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteProperty(options, PropNode, value.Node, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDataFrameAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDataFrameAnalyticsResponse.g.cs index 5763df79669..afcf6724228 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDataFrameAnalyticsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDataFrameAnalyticsResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class StartDataFrameAnalyticsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.StartDataFrameAnalyticsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - LocalJsonValue propNode = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (propNode.TryReadProperty(ref reader, options, PropNode, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.StartDataFrameAnalyticsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value, - Node = propNode.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.StartDataFrameAnalyticsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteProperty(options, PropNode, value.Node, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.StartDataFrameAnalyticsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.StartDataFrameAnalyticsResponseConverter))] public sealed partial class StartDataFrameAnalyticsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,9 +39,9 @@ internal StartDataFrameAnalyticsResponse(Elastic.Clients.Elasticsearch.Serializa public #if NET7_0_OR_GREATER - required +required #endif - bool Acknowledged { get; set; } +bool Acknowledged { get; set; } /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDatafeedRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDatafeedRequest.Converters.g.cs new file mode 100644 index 00000000000..287d2ec3849 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDatafeedRequest.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class StartDatafeedRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnd = System.Text.Json.JsonEncodedText.Encode("end"); + private static readonly System.Text.Json.JsonEncodedText PropStart = System.Text.Json.JsonEncodedText.Encode("start"); + private static readonly System.Text.Json.JsonEncodedText PropTimeout = System.Text.Json.JsonEncodedText.Encode("timeout"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.StartDatafeedRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEnd = default; + LocalJsonValue propStart = default; + LocalJsonValue propTimeout = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnd.TryReadProperty(ref reader, options, PropEnd, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propStart.TryReadProperty(ref reader, options, PropStart, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propTimeout.TryReadProperty(ref reader, options, PropTimeout, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.StartDatafeedRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + End = propEnd.Value, + Start = propStart.Value, + Timeout = propTimeout.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.StartDatafeedRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnd, value.End, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropStart, value.Start, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropTimeout, value.Timeout, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDatafeedRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDatafeedRequest.g.cs index 427591dfaa0..ae9e81721fb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDatafeedRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDatafeedRequest.g.cs @@ -27,63 +27,6 @@ public sealed partial class StartDatafeedRequestParameters : Elastic.Transport.R { } -internal sealed partial class StartDatafeedRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEnd = System.Text.Json.JsonEncodedText.Encode("end"); - private static readonly System.Text.Json.JsonEncodedText PropStart = System.Text.Json.JsonEncodedText.Encode("start"); - private static readonly System.Text.Json.JsonEncodedText PropTimeout = System.Text.Json.JsonEncodedText.Encode("timeout"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.StartDatafeedRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEnd = default; - LocalJsonValue propStart = default; - LocalJsonValue propTimeout = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEnd.TryReadProperty(ref reader, options, PropEnd, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propStart.TryReadProperty(ref reader, options, PropStart, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propTimeout.TryReadProperty(ref reader, options, PropTimeout, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.StartDatafeedRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - End = propEnd.Value, - Start = propStart.Value, - Timeout = propTimeout.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.StartDatafeedRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEnd, value.End, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropStart, value.Start, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropTimeout, value.Timeout, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Start datafeeds. @@ -105,7 +48,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// authorization headers when you created or updated the datafeed, those credentials are used instead. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.StartDatafeedRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.StartDatafeedRequestConverter))] public sealed partial class StartDatafeedRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDatafeedResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDatafeedResponse.Converters.g.cs new file mode 100644 index 00000000000..6da503262f2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDatafeedResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class StartDatafeedResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); + private static readonly System.Text.Json.JsonEncodedText PropStarted = System.Text.Json.JsonEncodedText.Encode("started"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.StartDatafeedResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propNode = default; + LocalJsonValue propStarted = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNode.TryReadProperty(ref reader, options, PropNode, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propStarted.TryReadProperty(ref reader, options, PropStarted, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.StartDatafeedResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Node = propNode.Value, + Started = propStarted.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.StartDatafeedResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNode, value.Node, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStarted, value.Started, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDatafeedResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDatafeedResponse.g.cs index f916b715d28..af8af10a932 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDatafeedResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartDatafeedResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class StartDatafeedResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); - private static readonly System.Text.Json.JsonEncodedText PropStarted = System.Text.Json.JsonEncodedText.Encode("started"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.StartDatafeedResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propNode = default; - LocalJsonValue propStarted = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNode.TryReadProperty(ref reader, options, PropNode, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (propStarted.TryReadProperty(ref reader, options, PropStarted, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.StartDatafeedResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Node = propNode.Value, - Started = propStarted.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.StartDatafeedResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNode, value.Node, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStarted, value.Started, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.StartDatafeedResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.StartDatafeedResponseConverter))] public sealed partial class StartDatafeedResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartTrainedModelDeploymentRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartTrainedModelDeploymentRequest.Converters.g.cs new file mode 100644 index 00000000000..c7683df8816 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartTrainedModelDeploymentRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class StartTrainedModelDeploymentRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAdaptiveAllocations = System.Text.Json.JsonEncodedText.Encode("adaptive_allocations"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.StartTrainedModelDeploymentRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAdaptiveAllocations = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAdaptiveAllocations.TryReadProperty(ref reader, options, PropAdaptiveAllocations, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.StartTrainedModelDeploymentRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AdaptiveAllocations = propAdaptiveAllocations.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.StartTrainedModelDeploymentRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAdaptiveAllocations, value.AdaptiveAllocations, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartTrainedModelDeploymentRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartTrainedModelDeploymentRequest.g.cs index 20cc0f9e6e8..2b31f51ed33 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartTrainedModelDeploymentRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartTrainedModelDeploymentRequest.g.cs @@ -95,52 +95,13 @@ public sealed partial class StartTrainedModelDeploymentRequestParameters : Elast public Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState? WaitFor { get => Q("wait_for"); set => Q("wait_for", value); } } -internal sealed partial class StartTrainedModelDeploymentRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAdaptiveAllocations = System.Text.Json.JsonEncodedText.Encode("adaptive_allocations"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.StartTrainedModelDeploymentRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAdaptiveAllocations = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAdaptiveAllocations.TryReadProperty(ref reader, options, PropAdaptiveAllocations, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.StartTrainedModelDeploymentRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AdaptiveAllocations = propAdaptiveAllocations.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.StartTrainedModelDeploymentRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAdaptiveAllocations, value.AdaptiveAllocations, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Start a trained model deployment. /// It allocates the model to every machine learning node. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.StartTrainedModelDeploymentRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.StartTrainedModelDeploymentRequestConverter))] public sealed partial class StartTrainedModelDeploymentRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartTrainedModelDeploymentResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartTrainedModelDeploymentResponse.Converters.g.cs new file mode 100644 index 00000000000..b9d7a25f525 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartTrainedModelDeploymentResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class StartTrainedModelDeploymentResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAssignment = System.Text.Json.JsonEncodedText.Encode("assignment"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.StartTrainedModelDeploymentResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAssignment = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAssignment.TryReadProperty(ref reader, options, PropAssignment, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.StartTrainedModelDeploymentResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Assignment = propAssignment.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.StartTrainedModelDeploymentResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAssignment, value.Assignment, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartTrainedModelDeploymentResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartTrainedModelDeploymentResponse.g.cs index 446ce8498a6..9e9ad7cf6cb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartTrainedModelDeploymentResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StartTrainedModelDeploymentResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class StartTrainedModelDeploymentResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAssignment = System.Text.Json.JsonEncodedText.Encode("assignment"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.StartTrainedModelDeploymentResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAssignment = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAssignment.TryReadProperty(ref reader, options, PropAssignment, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.StartTrainedModelDeploymentResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Assignment = propAssignment.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.StartTrainedModelDeploymentResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAssignment, value.Assignment, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.StartTrainedModelDeploymentResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.StartTrainedModelDeploymentResponseConverter))] public sealed partial class StartTrainedModelDeploymentResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal StartTrainedModelDeploymentResponse(Elastic.Clients.Elasticsearch.Seria public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignment Assignment { get; set; } +Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignment Assignment { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDataFrameAnalyticsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDataFrameAnalyticsRequest.Converters.g.cs new file mode 100644 index 00000000000..e254224b6b1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDataFrameAnalyticsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class StopDataFrameAnalyticsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.StopDataFrameAnalyticsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.StopDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.StopDataFrameAnalyticsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDataFrameAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDataFrameAnalyticsRequest.g.cs index 3d55b937f77..c84b7806a06 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDataFrameAnalyticsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDataFrameAnalyticsRequest.g.cs @@ -72,35 +72,6 @@ public sealed partial class StopDataFrameAnalyticsRequestParameters : Elastic.Tr public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class StopDataFrameAnalyticsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.StopDataFrameAnalyticsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.StopDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.StopDataFrameAnalyticsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Stop data frame analytics jobs. @@ -108,7 +79,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// throughout its lifecycle. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.StopDataFrameAnalyticsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.StopDataFrameAnalyticsRequestConverter))] public sealed partial class StopDataFrameAnalyticsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDataFrameAnalyticsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDataFrameAnalyticsResponse.Converters.g.cs new file mode 100644 index 00000000000..77fbd290119 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDataFrameAnalyticsResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class StopDataFrameAnalyticsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStopped = System.Text.Json.JsonEncodedText.Encode("stopped"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.StopDataFrameAnalyticsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propStopped = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStopped.TryReadProperty(ref reader, options, PropStopped, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.StopDataFrameAnalyticsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Stopped = propStopped.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.StopDataFrameAnalyticsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStopped, value.Stopped, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDataFrameAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDataFrameAnalyticsResponse.g.cs index a05310d3eec..83af3a81595 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDataFrameAnalyticsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDataFrameAnalyticsResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class StopDataFrameAnalyticsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStopped = System.Text.Json.JsonEncodedText.Encode("stopped"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.StopDataFrameAnalyticsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propStopped = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStopped.TryReadProperty(ref reader, options, PropStopped, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.StopDataFrameAnalyticsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Stopped = propStopped.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.StopDataFrameAnalyticsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStopped, value.Stopped, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.StopDataFrameAnalyticsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.StopDataFrameAnalyticsResponseConverter))] public sealed partial class StopDataFrameAnalyticsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal StopDataFrameAnalyticsResponse(Elastic.Clients.Elasticsearch.Serializat public #if NET7_0_OR_GREATER - required +required #endif - bool Stopped { get; set; } +bool Stopped { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedRequest.Converters.g.cs new file mode 100644 index 00000000000..2e50c3404b7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedRequest.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class StopDatafeedRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowNoMatch = System.Text.Json.JsonEncodedText.Encode("allow_no_match"); + private static readonly System.Text.Json.JsonEncodedText PropForce = System.Text.Json.JsonEncodedText.Encode("force"); + private static readonly System.Text.Json.JsonEncodedText PropTimeout = System.Text.Json.JsonEncodedText.Encode("timeout"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.StopDatafeedRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowNoMatch = default; + LocalJsonValue propForce = default; + LocalJsonValue propTimeout = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowNoMatch.TryReadProperty(ref reader, options, PropAllowNoMatch, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propForce.TryReadProperty(ref reader, options, PropForce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeout.TryReadProperty(ref reader, options, PropTimeout, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.StopDatafeedRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowNoMatch = propAllowNoMatch.Value, + Force = propForce.Value, + Timeout = propTimeout.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.StopDatafeedRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowNoMatch, value.AllowNoMatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropForce, value.Force, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeout, value.Timeout, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedRequest.g.cs index a8bb1a53d6d..7009f15d81b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedRequest.g.cs @@ -27,63 +27,6 @@ public sealed partial class StopDatafeedRequestParameters : Elastic.Transport.Re { } -internal sealed partial class StopDatafeedRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowNoMatch = System.Text.Json.JsonEncodedText.Encode("allow_no_match"); - private static readonly System.Text.Json.JsonEncodedText PropForce = System.Text.Json.JsonEncodedText.Encode("force"); - private static readonly System.Text.Json.JsonEncodedText PropTimeout = System.Text.Json.JsonEncodedText.Encode("timeout"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.StopDatafeedRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowNoMatch = default; - LocalJsonValue propForce = default; - LocalJsonValue propTimeout = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowNoMatch.TryReadProperty(ref reader, options, PropAllowNoMatch, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propForce.TryReadProperty(ref reader, options, PropForce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeout.TryReadProperty(ref reader, options, PropTimeout, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.StopDatafeedRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowNoMatch = propAllowNoMatch.Value, - Force = propForce.Value, - Timeout = propTimeout.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.StopDatafeedRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowNoMatch, value.AllowNoMatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropForce, value.Force, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeout, value.Timeout, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Stop datafeeds. @@ -91,7 +34,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// multiple times throughout its lifecycle. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.StopDatafeedRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.StopDatafeedRequestConverter))] public sealed partial class StopDatafeedRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedResponse.Converters.g.cs new file mode 100644 index 00000000000..8c2d546eb2a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class StopDatafeedResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStopped = System.Text.Json.JsonEncodedText.Encode("stopped"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.StopDatafeedResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propStopped = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStopped.TryReadProperty(ref reader, options, PropStopped, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.StopDatafeedResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Stopped = propStopped.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.StopDatafeedResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStopped, value.Stopped, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedResponse.g.cs index 0f1780e30f9..8c33fc955e4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopDatafeedResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class StopDatafeedResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStopped = System.Text.Json.JsonEncodedText.Encode("stopped"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.StopDatafeedResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propStopped = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStopped.TryReadProperty(ref reader, options, PropStopped, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.StopDatafeedResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Stopped = propStopped.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.StopDatafeedResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStopped, value.Stopped, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.StopDatafeedResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.StopDatafeedResponseConverter))] public sealed partial class StopDatafeedResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal StopDatafeedResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCo public #if NET7_0_OR_GREATER - required +required #endif - bool Stopped { get; set; } +bool Stopped { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopTrainedModelDeploymentRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopTrainedModelDeploymentRequest.Converters.g.cs new file mode 100644 index 00000000000..4cdd7f31d96 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopTrainedModelDeploymentRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class StopTrainedModelDeploymentRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.StopTrainedModelDeploymentRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.StopTrainedModelDeploymentRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.StopTrainedModelDeploymentRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopTrainedModelDeploymentRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopTrainedModelDeploymentRequest.g.cs index 6c3110a5c05..a899c904b41 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopTrainedModelDeploymentRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopTrainedModelDeploymentRequest.g.cs @@ -44,41 +44,12 @@ public sealed partial class StopTrainedModelDeploymentRequestParameters : Elasti public bool? Force { get => Q("force"); set => Q("force", value); } } -internal sealed partial class StopTrainedModelDeploymentRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.StopTrainedModelDeploymentRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.StopTrainedModelDeploymentRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.StopTrainedModelDeploymentRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Stop a trained model deployment. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.StopTrainedModelDeploymentRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.StopTrainedModelDeploymentRequestConverter))] public sealed partial class StopTrainedModelDeploymentRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopTrainedModelDeploymentResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopTrainedModelDeploymentResponse.Converters.g.cs new file mode 100644 index 00000000000..8b31f7cdb0a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopTrainedModelDeploymentResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class StopTrainedModelDeploymentResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStopped = System.Text.Json.JsonEncodedText.Encode("stopped"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.StopTrainedModelDeploymentResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propStopped = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStopped.TryReadProperty(ref reader, options, PropStopped, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.StopTrainedModelDeploymentResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Stopped = propStopped.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.StopTrainedModelDeploymentResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStopped, value.Stopped, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopTrainedModelDeploymentResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopTrainedModelDeploymentResponse.g.cs index 1fd2973607b..b52860855b4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopTrainedModelDeploymentResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/StopTrainedModelDeploymentResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class StopTrainedModelDeploymentResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStopped = System.Text.Json.JsonEncodedText.Encode("stopped"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.StopTrainedModelDeploymentResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propStopped = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStopped.TryReadProperty(ref reader, options, PropStopped, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.StopTrainedModelDeploymentResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Stopped = propStopped.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.StopTrainedModelDeploymentResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStopped, value.Stopped, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.StopTrainedModelDeploymentResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.StopTrainedModelDeploymentResponseConverter))] public sealed partial class StopTrainedModelDeploymentResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal StopTrainedModelDeploymentResponse(Elastic.Clients.Elasticsearch.Serial public #if NET7_0_OR_GREATER - required +required #endif - bool Stopped { get; set; } +bool Stopped { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsRequest.Converters.g.cs new file mode 100644 index 00000000000..72fe54c155f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsRequest.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class UpdateDataFrameAnalyticsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowLazyStart = System.Text.Json.JsonEncodedText.Encode("allow_lazy_start"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropMaxNumThreads = System.Text.Json.JsonEncodedText.Encode("max_num_threads"); + private static readonly System.Text.Json.JsonEncodedText PropModelMemoryLimit = System.Text.Json.JsonEncodedText.Encode("model_memory_limit"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.UpdateDataFrameAnalyticsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowLazyStart = default; + LocalJsonValue propDescription = default; + LocalJsonValue propMaxNumThreads = default; + LocalJsonValue propModelMemoryLimit = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowLazyStart.TryReadProperty(ref reader, options, PropAllowLazyStart, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propMaxNumThreads.TryReadProperty(ref reader, options, PropMaxNumThreads, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propModelMemoryLimit.TryReadProperty(ref reader, options, PropModelMemoryLimit, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.UpdateDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowLazyStart = propAllowLazyStart.Value, + Description = propDescription.Value, + MaxNumThreads = propMaxNumThreads.Value, + ModelMemoryLimit = propModelMemoryLimit.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpdateDataFrameAnalyticsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowLazyStart, value.AllowLazyStart, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropMaxNumThreads, value.MaxNumThreads, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropModelMemoryLimit, value.ModelMemoryLimit, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsRequest.g.cs index bcdf616f9fc..447e65835d4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsRequest.g.cs @@ -27,78 +27,12 @@ public sealed partial class UpdateDataFrameAnalyticsRequestParameters : Elastic. { } -internal sealed partial class UpdateDataFrameAnalyticsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowLazyStart = System.Text.Json.JsonEncodedText.Encode("allow_lazy_start"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropMaxNumThreads = System.Text.Json.JsonEncodedText.Encode("max_num_threads"); - private static readonly System.Text.Json.JsonEncodedText PropModelMemoryLimit = System.Text.Json.JsonEncodedText.Encode("model_memory_limit"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.UpdateDataFrameAnalyticsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowLazyStart = default; - LocalJsonValue propDescription = default; - LocalJsonValue propMaxNumThreads = default; - LocalJsonValue propModelMemoryLimit = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowLazyStart.TryReadProperty(ref reader, options, PropAllowLazyStart, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propMaxNumThreads.TryReadProperty(ref reader, options, PropMaxNumThreads, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propModelMemoryLimit.TryReadProperty(ref reader, options, PropModelMemoryLimit, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.UpdateDataFrameAnalyticsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowLazyStart = propAllowLazyStart.Value, - Description = propDescription.Value, - MaxNumThreads = propMaxNumThreads.Value, - ModelMemoryLimit = propModelMemoryLimit.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpdateDataFrameAnalyticsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowLazyStart, value.AllowLazyStart, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropMaxNumThreads, value.MaxNumThreads, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropModelMemoryLimit, value.ModelMemoryLimit, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Update a data frame analytics job. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.UpdateDataFrameAnalyticsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.UpdateDataFrameAnalyticsRequestConverter))] public sealed partial class UpdateDataFrameAnalyticsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsResponse.Converters.g.cs new file mode 100644 index 00000000000..59701b70d45 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsResponse.Converters.g.cs @@ -0,0 +1,162 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class UpdateDataFrameAnalyticsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowLazyStart = System.Text.Json.JsonEncodedText.Encode("allow_lazy_start"); + private static readonly System.Text.Json.JsonEncodedText PropAnalysis = System.Text.Json.JsonEncodedText.Encode("analysis"); + private static readonly System.Text.Json.JsonEncodedText PropAnalyzedFields = System.Text.Json.JsonEncodedText.Encode("analyzed_fields"); + private static readonly System.Text.Json.JsonEncodedText PropAuthorization = System.Text.Json.JsonEncodedText.Encode("authorization"); + private static readonly System.Text.Json.JsonEncodedText PropCreateTime = System.Text.Json.JsonEncodedText.Encode("create_time"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropDest = System.Text.Json.JsonEncodedText.Encode("dest"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropMaxNumThreads = System.Text.Json.JsonEncodedText.Encode("max_num_threads"); + private static readonly System.Text.Json.JsonEncodedText PropModelMemoryLimit = System.Text.Json.JsonEncodedText.Encode("model_memory_limit"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.UpdateDataFrameAnalyticsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowLazyStart = default; + LocalJsonValue propAnalysis = default; + LocalJsonValue propAnalyzedFields = default; + LocalJsonValue propAuthorization = default; + LocalJsonValue propCreateTime = default; + LocalJsonValue propDescription = default; + LocalJsonValue propDest = default; + LocalJsonValue propId = default; + LocalJsonValue propMaxNumThreads = default; + LocalJsonValue propModelMemoryLimit = default; + LocalJsonValue propSource = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowLazyStart.TryReadProperty(ref reader, options, PropAllowLazyStart, null)) + { + continue; + } + + if (propAnalysis.TryReadProperty(ref reader, options, PropAnalysis, null)) + { + continue; + } + + if (propAnalyzedFields.TryReadProperty(ref reader, options, PropAnalyzedFields, null)) + { + continue; + } + + if (propAuthorization.TryReadProperty(ref reader, options, PropAuthorization, null)) + { + continue; + } + + if (propCreateTime.TryReadProperty(ref reader, options, PropCreateTime, null)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propDest.TryReadProperty(ref reader, options, PropDest, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propMaxNumThreads.TryReadProperty(ref reader, options, PropMaxNumThreads, null)) + { + continue; + } + + if (propModelMemoryLimit.TryReadProperty(ref reader, options, PropModelMemoryLimit, null)) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.UpdateDataFrameAnalyticsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowLazyStart = propAllowLazyStart.Value, + Analysis = propAnalysis.Value, + AnalyzedFields = propAnalyzedFields.Value, + Authorization = propAuthorization.Value, + CreateTime = propCreateTime.Value, + Description = propDescription.Value, + Dest = propDest.Value, + Id = propId.Value, + MaxNumThreads = propMaxNumThreads.Value, + ModelMemoryLimit = propModelMemoryLimit.Value, + Source = propSource.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpdateDataFrameAnalyticsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowLazyStart, value.AllowLazyStart, null, null); + writer.WriteProperty(options, PropAnalysis, value.Analysis, null, null); + writer.WriteProperty(options, PropAnalyzedFields, value.AnalyzedFields, null, null); + writer.WriteProperty(options, PropAuthorization, value.Authorization, null, null); + writer.WriteProperty(options, PropCreateTime, value.CreateTime, null, null); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropDest, value.Dest, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropMaxNumThreads, value.MaxNumThreads, null, null); + writer.WriteProperty(options, PropModelMemoryLimit, value.ModelMemoryLimit, null, null); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsResponse.g.cs index 873acfeaec9..10ea89af5cd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDataFrameAnalyticsResponse.g.cs @@ -23,145 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class UpdateDataFrameAnalyticsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowLazyStart = System.Text.Json.JsonEncodedText.Encode("allow_lazy_start"); - private static readonly System.Text.Json.JsonEncodedText PropAnalysis = System.Text.Json.JsonEncodedText.Encode("analysis"); - private static readonly System.Text.Json.JsonEncodedText PropAnalyzedFields = System.Text.Json.JsonEncodedText.Encode("analyzed_fields"); - private static readonly System.Text.Json.JsonEncodedText PropAuthorization = System.Text.Json.JsonEncodedText.Encode("authorization"); - private static readonly System.Text.Json.JsonEncodedText PropCreateTime = System.Text.Json.JsonEncodedText.Encode("create_time"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropDest = System.Text.Json.JsonEncodedText.Encode("dest"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropMaxNumThreads = System.Text.Json.JsonEncodedText.Encode("max_num_threads"); - private static readonly System.Text.Json.JsonEncodedText PropModelMemoryLimit = System.Text.Json.JsonEncodedText.Encode("model_memory_limit"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.UpdateDataFrameAnalyticsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowLazyStart = default; - LocalJsonValue propAnalysis = default; - LocalJsonValue propAnalyzedFields = default; - LocalJsonValue propAuthorization = default; - LocalJsonValue propCreateTime = default; - LocalJsonValue propDescription = default; - LocalJsonValue propDest = default; - LocalJsonValue propId = default; - LocalJsonValue propMaxNumThreads = default; - LocalJsonValue propModelMemoryLimit = default; - LocalJsonValue propSource = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowLazyStart.TryReadProperty(ref reader, options, PropAllowLazyStart, null)) - { - continue; - } - - if (propAnalysis.TryReadProperty(ref reader, options, PropAnalysis, null)) - { - continue; - } - - if (propAnalyzedFields.TryReadProperty(ref reader, options, PropAnalyzedFields, null)) - { - continue; - } - - if (propAuthorization.TryReadProperty(ref reader, options, PropAuthorization, null)) - { - continue; - } - - if (propCreateTime.TryReadProperty(ref reader, options, PropCreateTime, null)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propDest.TryReadProperty(ref reader, options, PropDest, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propMaxNumThreads.TryReadProperty(ref reader, options, PropMaxNumThreads, null)) - { - continue; - } - - if (propModelMemoryLimit.TryReadProperty(ref reader, options, PropModelMemoryLimit, null)) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.UpdateDataFrameAnalyticsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowLazyStart = propAllowLazyStart.Value, - Analysis = propAnalysis.Value, - AnalyzedFields = propAnalyzedFields.Value, - Authorization = propAuthorization.Value, - CreateTime = propCreateTime.Value, - Description = propDescription.Value, - Dest = propDest.Value, - Id = propId.Value, - MaxNumThreads = propMaxNumThreads.Value, - ModelMemoryLimit = propModelMemoryLimit.Value, - Source = propSource.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpdateDataFrameAnalyticsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowLazyStart, value.AllowLazyStart, null, null); - writer.WriteProperty(options, PropAnalysis, value.Analysis, null, null); - writer.WriteProperty(options, PropAnalyzedFields, value.AnalyzedFields, null, null); - writer.WriteProperty(options, PropAuthorization, value.Authorization, null, null); - writer.WriteProperty(options, PropCreateTime, value.CreateTime, null, null); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropDest, value.Dest, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropMaxNumThreads, value.MaxNumThreads, null, null); - writer.WriteProperty(options, PropModelMemoryLimit, value.ModelMemoryLimit, null, null); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.UpdateDataFrameAnalyticsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.UpdateDataFrameAnalyticsResponseConverter))] public sealed partial class UpdateDataFrameAnalyticsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -177,50 +39,50 @@ internal UpdateDataFrameAnalyticsResponse(Elastic.Clients.Elasticsearch.Serializ public #if NET7_0_OR_GREATER - required +required #endif - bool AllowLazyStart { get; set; } +bool AllowLazyStart { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis Analysis { get; set; } +Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis Analysis { get; set; } public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields? AnalyzedFields { get; set; } public Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsAuthorization? Authorization { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long CreateTime { get; set; } +long CreateTime { get; set; } public string? Description { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestination Dest { get; set; } +Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestination Dest { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Id { get; set; } +string Id { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - int MaxNumThreads { get; set; } +int MaxNumThreads { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string ModelMemoryLimit { get; set; } +string ModelMemoryLimit { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource Source { get; set; } +Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource Source { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Version { get; set; } +string Version { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDatafeedRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDatafeedRequest.Converters.g.cs new file mode 100644 index 00000000000..9882b92f40f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDatafeedRequest.Converters.g.cs @@ -0,0 +1,172 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class UpdateDatafeedRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); + private static readonly System.Text.Json.JsonEncodedText PropChunkingConfig = System.Text.Json.JsonEncodedText.Encode("chunking_config"); + private static readonly System.Text.Json.JsonEncodedText PropDelayedDataCheckConfig = System.Text.Json.JsonEncodedText.Encode("delayed_data_check_config"); + private static readonly System.Text.Json.JsonEncodedText PropFrequency = System.Text.Json.JsonEncodedText.Encode("frequency"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropIndices1 = System.Text.Json.JsonEncodedText.Encode("indexes"); + private static readonly System.Text.Json.JsonEncodedText PropIndicesOptions = System.Text.Json.JsonEncodedText.Encode("indices_options"); + private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); + private static readonly System.Text.Json.JsonEncodedText PropMaxEmptySearches = System.Text.Json.JsonEncodedText.Encode("max_empty_searches"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropQueryDelay = System.Text.Json.JsonEncodedText.Encode("query_delay"); + 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 PropScrollSize = System.Text.Json.JsonEncodedText.Encode("scroll_size"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.UpdateDatafeedRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAggregations = default; + LocalJsonValue propChunkingConfig = default; + LocalJsonValue propDelayedDataCheckConfig = default; + LocalJsonValue propFrequency = default; + LocalJsonValue?> propIndices = default; + LocalJsonValue propIndicesOptions = default; + LocalJsonValue propJobId = default; + LocalJsonValue propMaxEmptySearches = default; + LocalJsonValue propQuery = default; + LocalJsonValue propQueryDelay = default; + LocalJsonValue?> propRuntimeMappings = default; + LocalJsonValue?> propScriptFields = default; + LocalJsonValue propScrollSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propChunkingConfig.TryReadProperty(ref reader, options, PropChunkingConfig, null)) + { + continue; + } + + if (propDelayedDataCheckConfig.TryReadProperty(ref reader, options, PropDelayedDataCheckConfig, null)) + { + continue; + } + + if (propFrequency.TryReadProperty(ref reader, options, PropFrequency, null)) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)) || propIndices.TryReadProperty(ref reader, options, PropIndices1, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propIndicesOptions.TryReadProperty(ref reader, options, PropIndicesOptions, null)) + { + continue; + } + + if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) + { + continue; + } + + if (propMaxEmptySearches.TryReadProperty(ref reader, options, PropMaxEmptySearches, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propQueryDelay.TryReadProperty(ref reader, options, PropQueryDelay, null)) + { + continue; + } + + if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propScriptFields.TryReadProperty(ref reader, options, PropScriptFields, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propScrollSize.TryReadProperty(ref reader, options, PropScrollSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.UpdateDatafeedRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = propAggregations.Value, + ChunkingConfig = propChunkingConfig.Value, + DelayedDataCheckConfig = propDelayedDataCheckConfig.Value, + Frequency = propFrequency.Value, + Indices = propIndices.Value, + IndicesOptions = propIndicesOptions.Value, + JobId = propJobId.Value, + MaxEmptySearches = propMaxEmptySearches.Value, + Query = propQuery.Value, + QueryDelay = propQueryDelay.Value, + RuntimeMappings = propRuntimeMappings.Value, + ScriptFields = propScriptFields.Value, + ScrollSize = propScrollSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpdateDatafeedRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropChunkingConfig, value.ChunkingConfig, null, null); + writer.WriteProperty(options, PropDelayedDataCheckConfig, value.DelayedDataCheckConfig, null, null); + writer.WriteProperty(options, PropFrequency, value.Frequency, null, null); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIndicesOptions, value.IndicesOptions, null, null); + writer.WriteProperty(options, PropJobId, value.JobId, null, null); + writer.WriteProperty(options, PropMaxEmptySearches, value.MaxEmptySearches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropQueryDelay, value.QueryDelay, null, null); + writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropScriptFields, value.ScriptFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropScrollSize, value.ScrollSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDatafeedRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDatafeedRequest.g.cs index 86df8e37263..32bba650f0e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDatafeedRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDatafeedRequest.g.cs @@ -57,154 +57,6 @@ public sealed partial class UpdateDatafeedRequestParameters : Elastic.Transport. public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } } -internal sealed partial class UpdateDatafeedRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); - private static readonly System.Text.Json.JsonEncodedText PropChunkingConfig = System.Text.Json.JsonEncodedText.Encode("chunking_config"); - private static readonly System.Text.Json.JsonEncodedText PropDelayedDataCheckConfig = System.Text.Json.JsonEncodedText.Encode("delayed_data_check_config"); - private static readonly System.Text.Json.JsonEncodedText PropFrequency = System.Text.Json.JsonEncodedText.Encode("frequency"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropIndices1 = System.Text.Json.JsonEncodedText.Encode("indexes"); - private static readonly System.Text.Json.JsonEncodedText PropIndicesOptions = System.Text.Json.JsonEncodedText.Encode("indices_options"); - private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); - private static readonly System.Text.Json.JsonEncodedText PropMaxEmptySearches = System.Text.Json.JsonEncodedText.Encode("max_empty_searches"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropQueryDelay = System.Text.Json.JsonEncodedText.Encode("query_delay"); - 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 PropScrollSize = System.Text.Json.JsonEncodedText.Encode("scroll_size"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.UpdateDatafeedRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAggregations = default; - LocalJsonValue propChunkingConfig = default; - LocalJsonValue propDelayedDataCheckConfig = default; - LocalJsonValue propFrequency = default; - LocalJsonValue?> propIndices = default; - LocalJsonValue propIndicesOptions = default; - LocalJsonValue propJobId = default; - LocalJsonValue propMaxEmptySearches = default; - LocalJsonValue propQuery = default; - LocalJsonValue propQueryDelay = default; - LocalJsonValue?> propRuntimeMappings = default; - LocalJsonValue?> propScriptFields = default; - LocalJsonValue propScrollSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propChunkingConfig.TryReadProperty(ref reader, options, PropChunkingConfig, null)) - { - continue; - } - - if (propDelayedDataCheckConfig.TryReadProperty(ref reader, options, PropDelayedDataCheckConfig, null)) - { - continue; - } - - if (propFrequency.TryReadProperty(ref reader, options, PropFrequency, null)) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)) || propIndices.TryReadProperty(ref reader, options, PropIndices1, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propIndicesOptions.TryReadProperty(ref reader, options, PropIndicesOptions, null)) - { - continue; - } - - if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) - { - continue; - } - - if (propMaxEmptySearches.TryReadProperty(ref reader, options, PropMaxEmptySearches, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propQueryDelay.TryReadProperty(ref reader, options, PropQueryDelay, null)) - { - continue; - } - - if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propScriptFields.TryReadProperty(ref reader, options, PropScriptFields, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propScrollSize.TryReadProperty(ref reader, options, PropScrollSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.UpdateDatafeedRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = propAggregations.Value, - ChunkingConfig = propChunkingConfig.Value, - DelayedDataCheckConfig = propDelayedDataCheckConfig.Value, - Frequency = propFrequency.Value, - Indices = propIndices.Value, - IndicesOptions = propIndicesOptions.Value, - JobId = propJobId.Value, - MaxEmptySearches = propMaxEmptySearches.Value, - Query = propQuery.Value, - QueryDelay = propQueryDelay.Value, - RuntimeMappings = propRuntimeMappings.Value, - ScriptFields = propScriptFields.Value, - ScrollSize = propScrollSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpdateDatafeedRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropChunkingConfig, value.ChunkingConfig, null, null); - writer.WriteProperty(options, PropDelayedDataCheckConfig, value.DelayedDataCheckConfig, null, null); - writer.WriteProperty(options, PropFrequency, value.Frequency, null, null); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIndicesOptions, value.IndicesOptions, null, null); - writer.WriteProperty(options, PropJobId, value.JobId, null, null); - writer.WriteProperty(options, PropMaxEmptySearches, value.MaxEmptySearches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropQueryDelay, value.QueryDelay, null, null); - writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropScriptFields, value.ScriptFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropScrollSize, value.ScrollSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Update a datafeed. @@ -214,7 +66,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// those credentials are used instead. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.UpdateDatafeedRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.UpdateDatafeedRequestConverter))] public sealed partial class UpdateDatafeedRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDatafeedResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDatafeedResponse.Converters.g.cs new file mode 100644 index 00000000000..515e75d2264 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDatafeedResponse.Converters.g.cs @@ -0,0 +1,189 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class UpdateDatafeedResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); + private static readonly System.Text.Json.JsonEncodedText PropAuthorization = System.Text.Json.JsonEncodedText.Encode("authorization"); + private static readonly System.Text.Json.JsonEncodedText PropChunkingConfig = System.Text.Json.JsonEncodedText.Encode("chunking_config"); + private static readonly System.Text.Json.JsonEncodedText PropDatafeedId = System.Text.Json.JsonEncodedText.Encode("datafeed_id"); + private static readonly System.Text.Json.JsonEncodedText PropDelayedDataCheckConfig = System.Text.Json.JsonEncodedText.Encode("delayed_data_check_config"); + private static readonly System.Text.Json.JsonEncodedText PropFrequency = System.Text.Json.JsonEncodedText.Encode("frequency"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropIndicesOptions = System.Text.Json.JsonEncodedText.Encode("indices_options"); + private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); + private static readonly System.Text.Json.JsonEncodedText PropMaxEmptySearches = System.Text.Json.JsonEncodedText.Encode("max_empty_searches"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropQueryDelay = System.Text.Json.JsonEncodedText.Encode("query_delay"); + 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 PropScrollSize = System.Text.Json.JsonEncodedText.Encode("scroll_size"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.UpdateDatafeedResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAggregations = default; + LocalJsonValue propAuthorization = default; + LocalJsonValue propChunkingConfig = default; + LocalJsonValue propDatafeedId = default; + LocalJsonValue propDelayedDataCheckConfig = default; + LocalJsonValue propFrequency = default; + LocalJsonValue> propIndices = default; + LocalJsonValue propIndicesOptions = default; + LocalJsonValue propJobId = default; + LocalJsonValue propMaxEmptySearches = default; + LocalJsonValue propQuery = default; + LocalJsonValue propQueryDelay = default; + LocalJsonValue?> propRuntimeMappings = default; + LocalJsonValue?> propScriptFields = default; + LocalJsonValue propScrollSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propAuthorization.TryReadProperty(ref reader, options, PropAuthorization, null)) + { + continue; + } + + if (propChunkingConfig.TryReadProperty(ref reader, options, PropChunkingConfig, null)) + { + continue; + } + + if (propDatafeedId.TryReadProperty(ref reader, options, PropDatafeedId, null)) + { + continue; + } + + if (propDelayedDataCheckConfig.TryReadProperty(ref reader, options, PropDelayedDataCheckConfig, null)) + { + continue; + } + + if (propFrequency.TryReadProperty(ref reader, options, PropFrequency, null)) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propIndicesOptions.TryReadProperty(ref reader, options, PropIndicesOptions, null)) + { + continue; + } + + if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) + { + continue; + } + + if (propMaxEmptySearches.TryReadProperty(ref reader, options, PropMaxEmptySearches, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propQueryDelay.TryReadProperty(ref reader, options, PropQueryDelay, null)) + { + continue; + } + + if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propScriptFields.TryReadProperty(ref reader, options, PropScriptFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propScrollSize.TryReadProperty(ref reader, options, PropScrollSize, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.UpdateDatafeedResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = propAggregations.Value, + Authorization = propAuthorization.Value, + ChunkingConfig = propChunkingConfig.Value, + DatafeedId = propDatafeedId.Value, + DelayedDataCheckConfig = propDelayedDataCheckConfig.Value, + Frequency = propFrequency.Value, + Indices = propIndices.Value, + IndicesOptions = propIndicesOptions.Value, + JobId = propJobId.Value, + MaxEmptySearches = propMaxEmptySearches.Value, + Query = propQuery.Value, + QueryDelay = propQueryDelay.Value, + RuntimeMappings = propRuntimeMappings.Value, + ScriptFields = propScriptFields.Value, + ScrollSize = propScrollSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpdateDatafeedResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropAuthorization, value.Authorization, null, null); + writer.WriteProperty(options, PropChunkingConfig, value.ChunkingConfig, null, null); + writer.WriteProperty(options, PropDatafeedId, value.DatafeedId, null, null); + writer.WriteProperty(options, PropDelayedDataCheckConfig, value.DelayedDataCheckConfig, null, null); + writer.WriteProperty(options, PropFrequency, value.Frequency, null, null); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIndicesOptions, value.IndicesOptions, null, null); + writer.WriteProperty(options, PropJobId, value.JobId, null, null); + writer.WriteProperty(options, PropMaxEmptySearches, value.MaxEmptySearches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropQueryDelay, value.QueryDelay, null, null); + writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropScriptFields, value.ScriptFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropScrollSize, value.ScrollSize, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDatafeedResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDatafeedResponse.g.cs index 88b1cf9eb76..af1eab3bb65 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDatafeedResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateDatafeedResponse.g.cs @@ -23,172 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class UpdateDatafeedResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); - private static readonly System.Text.Json.JsonEncodedText PropAuthorization = System.Text.Json.JsonEncodedText.Encode("authorization"); - private static readonly System.Text.Json.JsonEncodedText PropChunkingConfig = System.Text.Json.JsonEncodedText.Encode("chunking_config"); - private static readonly System.Text.Json.JsonEncodedText PropDatafeedId = System.Text.Json.JsonEncodedText.Encode("datafeed_id"); - private static readonly System.Text.Json.JsonEncodedText PropDelayedDataCheckConfig = System.Text.Json.JsonEncodedText.Encode("delayed_data_check_config"); - private static readonly System.Text.Json.JsonEncodedText PropFrequency = System.Text.Json.JsonEncodedText.Encode("frequency"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropIndicesOptions = System.Text.Json.JsonEncodedText.Encode("indices_options"); - private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); - private static readonly System.Text.Json.JsonEncodedText PropMaxEmptySearches = System.Text.Json.JsonEncodedText.Encode("max_empty_searches"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropQueryDelay = System.Text.Json.JsonEncodedText.Encode("query_delay"); - 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 PropScrollSize = System.Text.Json.JsonEncodedText.Encode("scroll_size"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.UpdateDatafeedResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAggregations = default; - LocalJsonValue propAuthorization = default; - LocalJsonValue propChunkingConfig = default; - LocalJsonValue propDatafeedId = default; - LocalJsonValue propDelayedDataCheckConfig = default; - LocalJsonValue propFrequency = default; - LocalJsonValue> propIndices = default; - LocalJsonValue propIndicesOptions = default; - LocalJsonValue propJobId = default; - LocalJsonValue propMaxEmptySearches = default; - LocalJsonValue propQuery = default; - LocalJsonValue propQueryDelay = default; - LocalJsonValue?> propRuntimeMappings = default; - LocalJsonValue?> propScriptFields = default; - LocalJsonValue propScrollSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propAuthorization.TryReadProperty(ref reader, options, PropAuthorization, null)) - { - continue; - } - - if (propChunkingConfig.TryReadProperty(ref reader, options, PropChunkingConfig, null)) - { - continue; - } - - if (propDatafeedId.TryReadProperty(ref reader, options, PropDatafeedId, null)) - { - continue; - } - - if (propDelayedDataCheckConfig.TryReadProperty(ref reader, options, PropDelayedDataCheckConfig, null)) - { - continue; - } - - if (propFrequency.TryReadProperty(ref reader, options, PropFrequency, null)) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propIndicesOptions.TryReadProperty(ref reader, options, PropIndicesOptions, null)) - { - continue; - } - - if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) - { - continue; - } - - if (propMaxEmptySearches.TryReadProperty(ref reader, options, PropMaxEmptySearches, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propQueryDelay.TryReadProperty(ref reader, options, PropQueryDelay, null)) - { - continue; - } - - if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propScriptFields.TryReadProperty(ref reader, options, PropScriptFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propScrollSize.TryReadProperty(ref reader, options, PropScrollSize, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.UpdateDatafeedResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = propAggregations.Value, - Authorization = propAuthorization.Value, - ChunkingConfig = propChunkingConfig.Value, - DatafeedId = propDatafeedId.Value, - DelayedDataCheckConfig = propDelayedDataCheckConfig.Value, - Frequency = propFrequency.Value, - Indices = propIndices.Value, - IndicesOptions = propIndicesOptions.Value, - JobId = propJobId.Value, - MaxEmptySearches = propMaxEmptySearches.Value, - Query = propQuery.Value, - QueryDelay = propQueryDelay.Value, - RuntimeMappings = propRuntimeMappings.Value, - ScriptFields = propScriptFields.Value, - ScrollSize = propScrollSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpdateDatafeedResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropAuthorization, value.Authorization, null, null); - writer.WriteProperty(options, PropChunkingConfig, value.ChunkingConfig, null, null); - writer.WriteProperty(options, PropDatafeedId, value.DatafeedId, null, null); - writer.WriteProperty(options, PropDelayedDataCheckConfig, value.DelayedDataCheckConfig, null, null); - writer.WriteProperty(options, PropFrequency, value.Frequency, null, null); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIndicesOptions, value.IndicesOptions, null, null); - writer.WriteProperty(options, PropJobId, value.JobId, null, null); - writer.WriteProperty(options, PropMaxEmptySearches, value.MaxEmptySearches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropQueryDelay, value.QueryDelay, null, null); - writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropScriptFields, value.ScriptFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropScrollSize, value.ScrollSize, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.UpdateDatafeedResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.UpdateDatafeedResponseConverter))] public sealed partial class UpdateDatafeedResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -206,43 +41,43 @@ internal UpdateDatafeedResponse(Elastic.Clients.Elasticsearch.Serialization.Json public Elastic.Clients.Elasticsearch.MachineLearning.DatafeedAuthorization? Authorization { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig ChunkingConfig { get; set; } +Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig ChunkingConfig { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string DatafeedId { get; set; } +string DatafeedId { get; set; } public Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig? DelayedDataCheckConfig { get; set; } public Elastic.Clients.Elasticsearch.Duration? Frequency { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Indices { get; set; } +System.Collections.Generic.IReadOnlyCollection Indices { get; set; } public Elastic.Clients.Elasticsearch.IndicesOptions? IndicesOptions { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string JobId { get; set; } +string JobId { get; set; } public int? MaxEmptySearches { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.QueryDsl.Query Query { get; set; } +Elastic.Clients.Elasticsearch.QueryDsl.Query Query { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Duration QueryDelay { get; set; } +Elastic.Clients.Elasticsearch.Duration QueryDelay { get; set; } public System.Collections.Generic.IReadOnlyDictionary? RuntimeMappings { get; set; } public System.Collections.Generic.IReadOnlyDictionary? ScriptFields { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - int ScrollSize { get; set; } +int ScrollSize { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateFilterRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateFilterRequest.Converters.g.cs new file mode 100644 index 00000000000..9dad5760d50 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateFilterRequest.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class UpdateFilterRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAddItems = System.Text.Json.JsonEncodedText.Encode("add_items"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropRemoveItems = System.Text.Json.JsonEncodedText.Encode("remove_items"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.UpdateFilterRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAddItems = default; + LocalJsonValue propDescription = default; + LocalJsonValue?> propRemoveItems = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAddItems.TryReadProperty(ref reader, options, PropAddItems, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propRemoveItems.TryReadProperty(ref reader, options, PropRemoveItems, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.UpdateFilterRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AddItems = propAddItems.Value, + Description = propDescription.Value, + RemoveItems = propRemoveItems.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpdateFilterRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAddItems, value.AddItems, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropRemoveItems, value.RemoveItems, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateFilterRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateFilterRequest.g.cs index 1719e860c6a..166c1d93a69 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateFilterRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateFilterRequest.g.cs @@ -27,70 +27,13 @@ public sealed partial class UpdateFilterRequestParameters : Elastic.Transport.Re { } -internal sealed partial class UpdateFilterRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAddItems = System.Text.Json.JsonEncodedText.Encode("add_items"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropRemoveItems = System.Text.Json.JsonEncodedText.Encode("remove_items"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.UpdateFilterRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAddItems = default; - LocalJsonValue propDescription = default; - LocalJsonValue?> propRemoveItems = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAddItems.TryReadProperty(ref reader, options, PropAddItems, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propRemoveItems.TryReadProperty(ref reader, options, PropRemoveItems, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.UpdateFilterRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AddItems = propAddItems.Value, - Description = propDescription.Value, - RemoveItems = propRemoveItems.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpdateFilterRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAddItems, value.AddItems, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropRemoveItems, value.RemoveItems, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// Update a filter. /// Updates the description of a filter, adds items, or removes items from the list. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.UpdateFilterRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.UpdateFilterRequestConverter))] public sealed partial class UpdateFilterRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateFilterResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateFilterResponse.Converters.g.cs new file mode 100644 index 00000000000..5d7c46787e2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateFilterResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class UpdateFilterResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropFilterId = System.Text.Json.JsonEncodedText.Encode("filter_id"); + private static readonly System.Text.Json.JsonEncodedText PropItems = System.Text.Json.JsonEncodedText.Encode("items"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.UpdateFilterResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propFilterId = default; + LocalJsonValue> propItems = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propFilterId.TryReadProperty(ref reader, options, PropFilterId, null)) + { + continue; + } + + if (propItems.TryReadProperty(ref reader, options, PropItems, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.UpdateFilterResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + FilterId = propFilterId.Value, + Items = propItems.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpdateFilterResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropFilterId, value.FilterId, null, null); + writer.WriteProperty(options, PropItems, value.Items, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateFilterResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateFilterResponse.g.cs index a74119a24c0..cedc7f91d0b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateFilterResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateFilterResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class UpdateFilterResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropFilterId = System.Text.Json.JsonEncodedText.Encode("filter_id"); - private static readonly System.Text.Json.JsonEncodedText PropItems = System.Text.Json.JsonEncodedText.Encode("items"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.UpdateFilterResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propFilterId = default; - LocalJsonValue> propItems = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propFilterId.TryReadProperty(ref reader, options, PropFilterId, null)) - { - continue; - } - - if (propItems.TryReadProperty(ref reader, options, PropItems, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.UpdateFilterResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - FilterId = propFilterId.Value, - Items = propItems.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpdateFilterResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropFilterId, value.FilterId, null, null); - writer.WriteProperty(options, PropItems, value.Items, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.UpdateFilterResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.UpdateFilterResponseConverter))] public sealed partial class UpdateFilterResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -96,17 +39,17 @@ internal UpdateFilterResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCo public #if NET7_0_OR_GREATER - required +required #endif - string Description { get; set; } +string Description { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string FilterId { get; set; } +string FilterId { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Items { get; set; } +System.Collections.Generic.IReadOnlyCollection Items { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateJobRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateJobRequest.Converters.g.cs new file mode 100644 index 00000000000..d4523e41304 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateJobRequest.Converters.g.cs @@ -0,0 +1,189 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class UpdateJobRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowLazyOpen = System.Text.Json.JsonEncodedText.Encode("allow_lazy_open"); + private static readonly System.Text.Json.JsonEncodedText PropAnalysisLimits = System.Text.Json.JsonEncodedText.Encode("analysis_limits"); + private static readonly System.Text.Json.JsonEncodedText PropBackgroundPersistInterval = System.Text.Json.JsonEncodedText.Encode("background_persist_interval"); + private static readonly System.Text.Json.JsonEncodedText PropCategorizationFilters = System.Text.Json.JsonEncodedText.Encode("categorization_filters"); + private static readonly System.Text.Json.JsonEncodedText PropCustomSettings = System.Text.Json.JsonEncodedText.Encode("custom_settings"); + private static readonly System.Text.Json.JsonEncodedText PropDailyModelSnapshotRetentionAfterDays = System.Text.Json.JsonEncodedText.Encode("daily_model_snapshot_retention_after_days"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropDetectors = System.Text.Json.JsonEncodedText.Encode("detectors"); + private static readonly System.Text.Json.JsonEncodedText PropGroups = System.Text.Json.JsonEncodedText.Encode("groups"); + private static readonly System.Text.Json.JsonEncodedText PropModelPlotConfig = System.Text.Json.JsonEncodedText.Encode("model_plot_config"); + private static readonly System.Text.Json.JsonEncodedText PropModelPruneWindow = System.Text.Json.JsonEncodedText.Encode("model_prune_window"); + private static readonly System.Text.Json.JsonEncodedText PropModelSnapshotRetentionDays = System.Text.Json.JsonEncodedText.Encode("model_snapshot_retention_days"); + private static readonly System.Text.Json.JsonEncodedText PropPerPartitionCategorization = System.Text.Json.JsonEncodedText.Encode("per_partition_categorization"); + private static readonly System.Text.Json.JsonEncodedText PropRenormalizationWindowDays = System.Text.Json.JsonEncodedText.Encode("renormalization_window_days"); + private static readonly System.Text.Json.JsonEncodedText PropResultsRetentionDays = System.Text.Json.JsonEncodedText.Encode("results_retention_days"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.UpdateJobRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowLazyOpen = default; + LocalJsonValue propAnalysisLimits = default; + LocalJsonValue propBackgroundPersistInterval = default; + LocalJsonValue?> propCategorizationFilters = default; + LocalJsonValue?> propCustomSettings = default; + LocalJsonValue propDailyModelSnapshotRetentionAfterDays = default; + LocalJsonValue propDescription = default; + LocalJsonValue?> propDetectors = default; + LocalJsonValue?> propGroups = default; + LocalJsonValue propModelPlotConfig = default; + LocalJsonValue propModelPruneWindow = default; + LocalJsonValue propModelSnapshotRetentionDays = default; + LocalJsonValue propPerPartitionCategorization = default; + LocalJsonValue propRenormalizationWindowDays = default; + LocalJsonValue propResultsRetentionDays = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowLazyOpen.TryReadProperty(ref reader, options, PropAllowLazyOpen, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propAnalysisLimits.TryReadProperty(ref reader, options, PropAnalysisLimits, null)) + { + continue; + } + + if (propBackgroundPersistInterval.TryReadProperty(ref reader, options, PropBackgroundPersistInterval, null)) + { + continue; + } + + if (propCategorizationFilters.TryReadProperty(ref reader, options, PropCategorizationFilters, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propCustomSettings.TryReadProperty(ref reader, options, PropCustomSettings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propDailyModelSnapshotRetentionAfterDays.TryReadProperty(ref reader, options, PropDailyModelSnapshotRetentionAfterDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propDetectors.TryReadProperty(ref reader, options, PropDetectors, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propGroups.TryReadProperty(ref reader, options, PropGroups, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propModelPlotConfig.TryReadProperty(ref reader, options, PropModelPlotConfig, null)) + { + continue; + } + + if (propModelPruneWindow.TryReadProperty(ref reader, options, PropModelPruneWindow, null)) + { + continue; + } + + if (propModelSnapshotRetentionDays.TryReadProperty(ref reader, options, PropModelSnapshotRetentionDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPerPartitionCategorization.TryReadProperty(ref reader, options, PropPerPartitionCategorization, null)) + { + continue; + } + + if (propRenormalizationWindowDays.TryReadProperty(ref reader, options, PropRenormalizationWindowDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propResultsRetentionDays.TryReadProperty(ref reader, options, PropResultsRetentionDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.UpdateJobRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowLazyOpen = propAllowLazyOpen.Value, + AnalysisLimits = propAnalysisLimits.Value, + BackgroundPersistInterval = propBackgroundPersistInterval.Value, + CategorizationFilters = propCategorizationFilters.Value, + CustomSettings = propCustomSettings.Value, + DailyModelSnapshotRetentionAfterDays = propDailyModelSnapshotRetentionAfterDays.Value, + Description = propDescription.Value, + Detectors = propDetectors.Value, + Groups = propGroups.Value, + ModelPlotConfig = propModelPlotConfig.Value, + ModelPruneWindow = propModelPruneWindow.Value, + ModelSnapshotRetentionDays = propModelSnapshotRetentionDays.Value, + PerPartitionCategorization = propPerPartitionCategorization.Value, + RenormalizationWindowDays = propRenormalizationWindowDays.Value, + ResultsRetentionDays = propResultsRetentionDays.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpdateJobRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowLazyOpen, value.AllowLazyOpen, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropAnalysisLimits, value.AnalysisLimits, null, null); + writer.WriteProperty(options, PropBackgroundPersistInterval, value.BackgroundPersistInterval, null, null); + writer.WriteProperty(options, PropCategorizationFilters, value.CategorizationFilters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCustomSettings, value.CustomSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropDailyModelSnapshotRetentionAfterDays, value.DailyModelSnapshotRetentionAfterDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropDetectors, value.Detectors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropGroups, value.Groups, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropModelPlotConfig, value.ModelPlotConfig, null, null); + writer.WriteProperty(options, PropModelPruneWindow, value.ModelPruneWindow, null, null); + writer.WriteProperty(options, PropModelSnapshotRetentionDays, value.ModelSnapshotRetentionDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPerPartitionCategorization, value.PerPartitionCategorization, null, null); + writer.WriteProperty(options, PropRenormalizationWindowDays, value.RenormalizationWindowDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropResultsRetentionDays, value.ResultsRetentionDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateJobRequest.g.cs index 935382c1863..78a32f06cce 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateJobRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateJobRequest.g.cs @@ -27,178 +27,13 @@ public sealed partial class UpdateJobRequestParameters : Elastic.Transport.Reque { } -internal sealed partial class UpdateJobRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowLazyOpen = System.Text.Json.JsonEncodedText.Encode("allow_lazy_open"); - private static readonly System.Text.Json.JsonEncodedText PropAnalysisLimits = System.Text.Json.JsonEncodedText.Encode("analysis_limits"); - private static readonly System.Text.Json.JsonEncodedText PropBackgroundPersistInterval = System.Text.Json.JsonEncodedText.Encode("background_persist_interval"); - private static readonly System.Text.Json.JsonEncodedText PropCategorizationFilters = System.Text.Json.JsonEncodedText.Encode("categorization_filters"); - private static readonly System.Text.Json.JsonEncodedText PropCustomSettings = System.Text.Json.JsonEncodedText.Encode("custom_settings"); - private static readonly System.Text.Json.JsonEncodedText PropDailyModelSnapshotRetentionAfterDays = System.Text.Json.JsonEncodedText.Encode("daily_model_snapshot_retention_after_days"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropDetectors = System.Text.Json.JsonEncodedText.Encode("detectors"); - private static readonly System.Text.Json.JsonEncodedText PropGroups = System.Text.Json.JsonEncodedText.Encode("groups"); - private static readonly System.Text.Json.JsonEncodedText PropModelPlotConfig = System.Text.Json.JsonEncodedText.Encode("model_plot_config"); - private static readonly System.Text.Json.JsonEncodedText PropModelPruneWindow = System.Text.Json.JsonEncodedText.Encode("model_prune_window"); - private static readonly System.Text.Json.JsonEncodedText PropModelSnapshotRetentionDays = System.Text.Json.JsonEncodedText.Encode("model_snapshot_retention_days"); - private static readonly System.Text.Json.JsonEncodedText PropPerPartitionCategorization = System.Text.Json.JsonEncodedText.Encode("per_partition_categorization"); - private static readonly System.Text.Json.JsonEncodedText PropRenormalizationWindowDays = System.Text.Json.JsonEncodedText.Encode("renormalization_window_days"); - private static readonly System.Text.Json.JsonEncodedText PropResultsRetentionDays = System.Text.Json.JsonEncodedText.Encode("results_retention_days"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.UpdateJobRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowLazyOpen = default; - LocalJsonValue propAnalysisLimits = default; - LocalJsonValue propBackgroundPersistInterval = default; - LocalJsonValue?> propCategorizationFilters = default; - LocalJsonValue?> propCustomSettings = default; - LocalJsonValue propDailyModelSnapshotRetentionAfterDays = default; - LocalJsonValue propDescription = default; - LocalJsonValue?> propDetectors = default; - LocalJsonValue?> propGroups = default; - LocalJsonValue propModelPlotConfig = default; - LocalJsonValue propModelPruneWindow = default; - LocalJsonValue propModelSnapshotRetentionDays = default; - LocalJsonValue propPerPartitionCategorization = default; - LocalJsonValue propRenormalizationWindowDays = default; - LocalJsonValue propResultsRetentionDays = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowLazyOpen.TryReadProperty(ref reader, options, PropAllowLazyOpen, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propAnalysisLimits.TryReadProperty(ref reader, options, PropAnalysisLimits, null)) - { - continue; - } - - if (propBackgroundPersistInterval.TryReadProperty(ref reader, options, PropBackgroundPersistInterval, null)) - { - continue; - } - - if (propCategorizationFilters.TryReadProperty(ref reader, options, PropCategorizationFilters, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propCustomSettings.TryReadProperty(ref reader, options, PropCustomSettings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propDailyModelSnapshotRetentionAfterDays.TryReadProperty(ref reader, options, PropDailyModelSnapshotRetentionAfterDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propDetectors.TryReadProperty(ref reader, options, PropDetectors, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propGroups.TryReadProperty(ref reader, options, PropGroups, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propModelPlotConfig.TryReadProperty(ref reader, options, PropModelPlotConfig, null)) - { - continue; - } - - if (propModelPruneWindow.TryReadProperty(ref reader, options, PropModelPruneWindow, null)) - { - continue; - } - - if (propModelSnapshotRetentionDays.TryReadProperty(ref reader, options, PropModelSnapshotRetentionDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPerPartitionCategorization.TryReadProperty(ref reader, options, PropPerPartitionCategorization, null)) - { - continue; - } - - if (propRenormalizationWindowDays.TryReadProperty(ref reader, options, PropRenormalizationWindowDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propResultsRetentionDays.TryReadProperty(ref reader, options, PropResultsRetentionDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.UpdateJobRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowLazyOpen = propAllowLazyOpen.Value, - AnalysisLimits = propAnalysisLimits.Value, - BackgroundPersistInterval = propBackgroundPersistInterval.Value, - CategorizationFilters = propCategorizationFilters.Value, - CustomSettings = propCustomSettings.Value, - DailyModelSnapshotRetentionAfterDays = propDailyModelSnapshotRetentionAfterDays.Value, - Description = propDescription.Value, - Detectors = propDetectors.Value, - Groups = propGroups.Value, - ModelPlotConfig = propModelPlotConfig.Value, - ModelPruneWindow = propModelPruneWindow.Value, - ModelSnapshotRetentionDays = propModelSnapshotRetentionDays.Value, - PerPartitionCategorization = propPerPartitionCategorization.Value, - RenormalizationWindowDays = propRenormalizationWindowDays.Value, - ResultsRetentionDays = propResultsRetentionDays.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpdateJobRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowLazyOpen, value.AllowLazyOpen, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropAnalysisLimits, value.AnalysisLimits, null, null); - writer.WriteProperty(options, PropBackgroundPersistInterval, value.BackgroundPersistInterval, null, null); - writer.WriteProperty(options, PropCategorizationFilters, value.CategorizationFilters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCustomSettings, value.CustomSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropDailyModelSnapshotRetentionAfterDays, value.DailyModelSnapshotRetentionAfterDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropDetectors, value.Detectors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropGroups, value.Groups, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropModelPlotConfig, value.ModelPlotConfig, null, null); - writer.WriteProperty(options, PropModelPruneWindow, value.ModelPruneWindow, null, null); - writer.WriteProperty(options, PropModelSnapshotRetentionDays, value.ModelSnapshotRetentionDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPerPartitionCategorization, value.PerPartitionCategorization, null, null); - writer.WriteProperty(options, PropRenormalizationWindowDays, value.RenormalizationWindowDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropResultsRetentionDays, value.ResultsRetentionDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Update an anomaly detection job. /// Updates certain properties of an anomaly detection job. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.UpdateJobRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.UpdateJobRequestConverter))] public sealed partial class UpdateJobRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateJobResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateJobResponse.Converters.g.cs new file mode 100644 index 00000000000..8dd73c95cc6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateJobResponse.Converters.g.cs @@ -0,0 +1,243 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class UpdateJobResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowLazyOpen = System.Text.Json.JsonEncodedText.Encode("allow_lazy_open"); + private static readonly System.Text.Json.JsonEncodedText PropAnalysisConfig = System.Text.Json.JsonEncodedText.Encode("analysis_config"); + private static readonly System.Text.Json.JsonEncodedText PropAnalysisLimits = System.Text.Json.JsonEncodedText.Encode("analysis_limits"); + private static readonly System.Text.Json.JsonEncodedText PropBackgroundPersistInterval = System.Text.Json.JsonEncodedText.Encode("background_persist_interval"); + private static readonly System.Text.Json.JsonEncodedText PropCreateTime = System.Text.Json.JsonEncodedText.Encode("create_time"); + private static readonly System.Text.Json.JsonEncodedText PropCustomSettings = System.Text.Json.JsonEncodedText.Encode("custom_settings"); + private static readonly System.Text.Json.JsonEncodedText PropDailyModelSnapshotRetentionAfterDays = System.Text.Json.JsonEncodedText.Encode("daily_model_snapshot_retention_after_days"); + private static readonly System.Text.Json.JsonEncodedText PropDataDescription = System.Text.Json.JsonEncodedText.Encode("data_description"); + private static readonly System.Text.Json.JsonEncodedText PropDatafeedConfig = System.Text.Json.JsonEncodedText.Encode("datafeed_config"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropFinishedTime = System.Text.Json.JsonEncodedText.Encode("finished_time"); + private static readonly System.Text.Json.JsonEncodedText PropGroups = System.Text.Json.JsonEncodedText.Encode("groups"); + private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); + private static readonly System.Text.Json.JsonEncodedText PropJobType = System.Text.Json.JsonEncodedText.Encode("job_type"); + private static readonly System.Text.Json.JsonEncodedText PropJobVersion = System.Text.Json.JsonEncodedText.Encode("job_version"); + private static readonly System.Text.Json.JsonEncodedText PropModelPlotConfig = System.Text.Json.JsonEncodedText.Encode("model_plot_config"); + private static readonly System.Text.Json.JsonEncodedText PropModelSnapshotId = System.Text.Json.JsonEncodedText.Encode("model_snapshot_id"); + private static readonly System.Text.Json.JsonEncodedText PropModelSnapshotRetentionDays = System.Text.Json.JsonEncodedText.Encode("model_snapshot_retention_days"); + private static readonly System.Text.Json.JsonEncodedText PropRenormalizationWindowDays = System.Text.Json.JsonEncodedText.Encode("renormalization_window_days"); + private static readonly System.Text.Json.JsonEncodedText PropResultsIndexName = System.Text.Json.JsonEncodedText.Encode("results_index_name"); + private static readonly System.Text.Json.JsonEncodedText PropResultsRetentionDays = System.Text.Json.JsonEncodedText.Encode("results_retention_days"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.UpdateJobResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowLazyOpen = default; + LocalJsonValue propAnalysisConfig = default; + LocalJsonValue propAnalysisLimits = default; + LocalJsonValue propBackgroundPersistInterval = default; + LocalJsonValue propCreateTime = default; + LocalJsonValue?> propCustomSettings = default; + LocalJsonValue propDailyModelSnapshotRetentionAfterDays = default; + LocalJsonValue propDataDescription = default; + LocalJsonValue propDatafeedConfig = default; + LocalJsonValue propDescription = default; + LocalJsonValue propFinishedTime = default; + LocalJsonValue?> propGroups = default; + LocalJsonValue propJobId = default; + LocalJsonValue propJobType = default; + LocalJsonValue propJobVersion = default; + LocalJsonValue propModelPlotConfig = default; + LocalJsonValue propModelSnapshotId = default; + LocalJsonValue propModelSnapshotRetentionDays = default; + LocalJsonValue propRenormalizationWindowDays = default; + LocalJsonValue propResultsIndexName = default; + LocalJsonValue propResultsRetentionDays = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowLazyOpen.TryReadProperty(ref reader, options, PropAllowLazyOpen, null)) + { + continue; + } + + if (propAnalysisConfig.TryReadProperty(ref reader, options, PropAnalysisConfig, null)) + { + continue; + } + + if (propAnalysisLimits.TryReadProperty(ref reader, options, PropAnalysisLimits, null)) + { + continue; + } + + if (propBackgroundPersistInterval.TryReadProperty(ref reader, options, PropBackgroundPersistInterval, null)) + { + continue; + } + + if (propCreateTime.TryReadProperty(ref reader, options, PropCreateTime, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propCustomSettings.TryReadProperty(ref reader, options, PropCustomSettings, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propDailyModelSnapshotRetentionAfterDays.TryReadProperty(ref reader, options, PropDailyModelSnapshotRetentionAfterDays, null)) + { + continue; + } + + if (propDataDescription.TryReadProperty(ref reader, options, PropDataDescription, null)) + { + continue; + } + + if (propDatafeedConfig.TryReadProperty(ref reader, options, PropDatafeedConfig, null)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propFinishedTime.TryReadProperty(ref reader, options, PropFinishedTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propGroups.TryReadProperty(ref reader, options, PropGroups, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) + { + continue; + } + + if (propJobType.TryReadProperty(ref reader, options, PropJobType, null)) + { + continue; + } + + if (propJobVersion.TryReadProperty(ref reader, options, PropJobVersion, null)) + { + continue; + } + + if (propModelPlotConfig.TryReadProperty(ref reader, options, PropModelPlotConfig, null)) + { + continue; + } + + if (propModelSnapshotId.TryReadProperty(ref reader, options, PropModelSnapshotId, null)) + { + continue; + } + + if (propModelSnapshotRetentionDays.TryReadProperty(ref reader, options, PropModelSnapshotRetentionDays, null)) + { + continue; + } + + if (propRenormalizationWindowDays.TryReadProperty(ref reader, options, PropRenormalizationWindowDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propResultsIndexName.TryReadProperty(ref reader, options, PropResultsIndexName, null)) + { + continue; + } + + if (propResultsRetentionDays.TryReadProperty(ref reader, options, PropResultsRetentionDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.UpdateJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowLazyOpen = propAllowLazyOpen.Value, + AnalysisConfig = propAnalysisConfig.Value, + AnalysisLimits = propAnalysisLimits.Value, + BackgroundPersistInterval = propBackgroundPersistInterval.Value, + CreateTime = propCreateTime.Value, + CustomSettings = propCustomSettings.Value, + DailyModelSnapshotRetentionAfterDays = propDailyModelSnapshotRetentionAfterDays.Value, + DataDescription = propDataDescription.Value, + DatafeedConfig = propDatafeedConfig.Value, + Description = propDescription.Value, + FinishedTime = propFinishedTime.Value, + Groups = propGroups.Value, + JobId = propJobId.Value, + JobType = propJobType.Value, + JobVersion = propJobVersion.Value, + ModelPlotConfig = propModelPlotConfig.Value, + ModelSnapshotId = propModelSnapshotId.Value, + ModelSnapshotRetentionDays = propModelSnapshotRetentionDays.Value, + RenormalizationWindowDays = propRenormalizationWindowDays.Value, + ResultsIndexName = propResultsIndexName.Value, + ResultsRetentionDays = propResultsRetentionDays.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpdateJobResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowLazyOpen, value.AllowLazyOpen, null, null); + writer.WriteProperty(options, PropAnalysisConfig, value.AnalysisConfig, null, null); + writer.WriteProperty(options, PropAnalysisLimits, value.AnalysisLimits, null, null); + writer.WriteProperty(options, PropBackgroundPersistInterval, value.BackgroundPersistInterval, null, null); + writer.WriteProperty(options, PropCreateTime, value.CreateTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropCustomSettings, value.CustomSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropDailyModelSnapshotRetentionAfterDays, value.DailyModelSnapshotRetentionAfterDays, null, null); + writer.WriteProperty(options, PropDataDescription, value.DataDescription, null, null); + writer.WriteProperty(options, PropDatafeedConfig, value.DatafeedConfig, null, null); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropFinishedTime, value.FinishedTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropGroups, value.Groups, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropJobId, value.JobId, null, null); + writer.WriteProperty(options, PropJobType, value.JobType, null, null); + writer.WriteProperty(options, PropJobVersion, value.JobVersion, null, null); + writer.WriteProperty(options, PropModelPlotConfig, value.ModelPlotConfig, null, null); + writer.WriteProperty(options, PropModelSnapshotId, value.ModelSnapshotId, null, null); + writer.WriteProperty(options, PropModelSnapshotRetentionDays, value.ModelSnapshotRetentionDays, null, null); + writer.WriteProperty(options, PropRenormalizationWindowDays, value.RenormalizationWindowDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropResultsIndexName, value.ResultsIndexName, null, null); + writer.WriteProperty(options, PropResultsRetentionDays, value.ResultsRetentionDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateJobResponse.g.cs index a9a9ef57522..067476e4397 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateJobResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateJobResponse.g.cs @@ -23,226 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class UpdateJobResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowLazyOpen = System.Text.Json.JsonEncodedText.Encode("allow_lazy_open"); - private static readonly System.Text.Json.JsonEncodedText PropAnalysisConfig = System.Text.Json.JsonEncodedText.Encode("analysis_config"); - private static readonly System.Text.Json.JsonEncodedText PropAnalysisLimits = System.Text.Json.JsonEncodedText.Encode("analysis_limits"); - private static readonly System.Text.Json.JsonEncodedText PropBackgroundPersistInterval = System.Text.Json.JsonEncodedText.Encode("background_persist_interval"); - private static readonly System.Text.Json.JsonEncodedText PropCreateTime = System.Text.Json.JsonEncodedText.Encode("create_time"); - private static readonly System.Text.Json.JsonEncodedText PropCustomSettings = System.Text.Json.JsonEncodedText.Encode("custom_settings"); - private static readonly System.Text.Json.JsonEncodedText PropDailyModelSnapshotRetentionAfterDays = System.Text.Json.JsonEncodedText.Encode("daily_model_snapshot_retention_after_days"); - private static readonly System.Text.Json.JsonEncodedText PropDataDescription = System.Text.Json.JsonEncodedText.Encode("data_description"); - private static readonly System.Text.Json.JsonEncodedText PropDatafeedConfig = System.Text.Json.JsonEncodedText.Encode("datafeed_config"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropFinishedTime = System.Text.Json.JsonEncodedText.Encode("finished_time"); - private static readonly System.Text.Json.JsonEncodedText PropGroups = System.Text.Json.JsonEncodedText.Encode("groups"); - private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); - private static readonly System.Text.Json.JsonEncodedText PropJobType = System.Text.Json.JsonEncodedText.Encode("job_type"); - private static readonly System.Text.Json.JsonEncodedText PropJobVersion = System.Text.Json.JsonEncodedText.Encode("job_version"); - private static readonly System.Text.Json.JsonEncodedText PropModelPlotConfig = System.Text.Json.JsonEncodedText.Encode("model_plot_config"); - private static readonly System.Text.Json.JsonEncodedText PropModelSnapshotId = System.Text.Json.JsonEncodedText.Encode("model_snapshot_id"); - private static readonly System.Text.Json.JsonEncodedText PropModelSnapshotRetentionDays = System.Text.Json.JsonEncodedText.Encode("model_snapshot_retention_days"); - private static readonly System.Text.Json.JsonEncodedText PropRenormalizationWindowDays = System.Text.Json.JsonEncodedText.Encode("renormalization_window_days"); - private static readonly System.Text.Json.JsonEncodedText PropResultsIndexName = System.Text.Json.JsonEncodedText.Encode("results_index_name"); - private static readonly System.Text.Json.JsonEncodedText PropResultsRetentionDays = System.Text.Json.JsonEncodedText.Encode("results_retention_days"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.UpdateJobResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowLazyOpen = default; - LocalJsonValue propAnalysisConfig = default; - LocalJsonValue propAnalysisLimits = default; - LocalJsonValue propBackgroundPersistInterval = default; - LocalJsonValue propCreateTime = default; - LocalJsonValue?> propCustomSettings = default; - LocalJsonValue propDailyModelSnapshotRetentionAfterDays = default; - LocalJsonValue propDataDescription = default; - LocalJsonValue propDatafeedConfig = default; - LocalJsonValue propDescription = default; - LocalJsonValue propFinishedTime = default; - LocalJsonValue?> propGroups = default; - LocalJsonValue propJobId = default; - LocalJsonValue propJobType = default; - LocalJsonValue propJobVersion = default; - LocalJsonValue propModelPlotConfig = default; - LocalJsonValue propModelSnapshotId = default; - LocalJsonValue propModelSnapshotRetentionDays = default; - LocalJsonValue propRenormalizationWindowDays = default; - LocalJsonValue propResultsIndexName = default; - LocalJsonValue propResultsRetentionDays = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowLazyOpen.TryReadProperty(ref reader, options, PropAllowLazyOpen, null)) - { - continue; - } - - if (propAnalysisConfig.TryReadProperty(ref reader, options, PropAnalysisConfig, null)) - { - continue; - } - - if (propAnalysisLimits.TryReadProperty(ref reader, options, PropAnalysisLimits, null)) - { - continue; - } - - if (propBackgroundPersistInterval.TryReadProperty(ref reader, options, PropBackgroundPersistInterval, null)) - { - continue; - } - - if (propCreateTime.TryReadProperty(ref reader, options, PropCreateTime, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propCustomSettings.TryReadProperty(ref reader, options, PropCustomSettings, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propDailyModelSnapshotRetentionAfterDays.TryReadProperty(ref reader, options, PropDailyModelSnapshotRetentionAfterDays, null)) - { - continue; - } - - if (propDataDescription.TryReadProperty(ref reader, options, PropDataDescription, null)) - { - continue; - } - - if (propDatafeedConfig.TryReadProperty(ref reader, options, PropDatafeedConfig, null)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propFinishedTime.TryReadProperty(ref reader, options, PropFinishedTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propGroups.TryReadProperty(ref reader, options, PropGroups, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) - { - continue; - } - - if (propJobType.TryReadProperty(ref reader, options, PropJobType, null)) - { - continue; - } - - if (propJobVersion.TryReadProperty(ref reader, options, PropJobVersion, null)) - { - continue; - } - - if (propModelPlotConfig.TryReadProperty(ref reader, options, PropModelPlotConfig, null)) - { - continue; - } - - if (propModelSnapshotId.TryReadProperty(ref reader, options, PropModelSnapshotId, null)) - { - continue; - } - - if (propModelSnapshotRetentionDays.TryReadProperty(ref reader, options, PropModelSnapshotRetentionDays, null)) - { - continue; - } - - if (propRenormalizationWindowDays.TryReadProperty(ref reader, options, PropRenormalizationWindowDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propResultsIndexName.TryReadProperty(ref reader, options, PropResultsIndexName, null)) - { - continue; - } - - if (propResultsRetentionDays.TryReadProperty(ref reader, options, PropResultsRetentionDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.UpdateJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowLazyOpen = propAllowLazyOpen.Value, - AnalysisConfig = propAnalysisConfig.Value, - AnalysisLimits = propAnalysisLimits.Value, - BackgroundPersistInterval = propBackgroundPersistInterval.Value, - CreateTime = propCreateTime.Value, - CustomSettings = propCustomSettings.Value, - DailyModelSnapshotRetentionAfterDays = propDailyModelSnapshotRetentionAfterDays.Value, - DataDescription = propDataDescription.Value, - DatafeedConfig = propDatafeedConfig.Value, - Description = propDescription.Value, - FinishedTime = propFinishedTime.Value, - Groups = propGroups.Value, - JobId = propJobId.Value, - JobType = propJobType.Value, - JobVersion = propJobVersion.Value, - ModelPlotConfig = propModelPlotConfig.Value, - ModelSnapshotId = propModelSnapshotId.Value, - ModelSnapshotRetentionDays = propModelSnapshotRetentionDays.Value, - RenormalizationWindowDays = propRenormalizationWindowDays.Value, - ResultsIndexName = propResultsIndexName.Value, - ResultsRetentionDays = propResultsRetentionDays.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpdateJobResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowLazyOpen, value.AllowLazyOpen, null, null); - writer.WriteProperty(options, PropAnalysisConfig, value.AnalysisConfig, null, null); - writer.WriteProperty(options, PropAnalysisLimits, value.AnalysisLimits, null, null); - writer.WriteProperty(options, PropBackgroundPersistInterval, value.BackgroundPersistInterval, null, null); - writer.WriteProperty(options, PropCreateTime, value.CreateTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropCustomSettings, value.CustomSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropDailyModelSnapshotRetentionAfterDays, value.DailyModelSnapshotRetentionAfterDays, null, null); - writer.WriteProperty(options, PropDataDescription, value.DataDescription, null, null); - writer.WriteProperty(options, PropDatafeedConfig, value.DatafeedConfig, null, null); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropFinishedTime, value.FinishedTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropGroups, value.Groups, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropJobId, value.JobId, null, null); - writer.WriteProperty(options, PropJobType, value.JobType, null, null); - writer.WriteProperty(options, PropJobVersion, value.JobVersion, null, null); - writer.WriteProperty(options, PropModelPlotConfig, value.ModelPlotConfig, null, null); - writer.WriteProperty(options, PropModelSnapshotId, value.ModelSnapshotId, null, null); - writer.WriteProperty(options, PropModelSnapshotRetentionDays, value.ModelSnapshotRetentionDays, null, null); - writer.WriteProperty(options, PropRenormalizationWindowDays, value.RenormalizationWindowDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropResultsIndexName, value.ResultsIndexName, null, null); - writer.WriteProperty(options, PropResultsRetentionDays, value.ResultsRetentionDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.UpdateJobResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.UpdateJobResponseConverter))] public sealed partial class UpdateJobResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -258,67 +39,67 @@ internal UpdateJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConst public #if NET7_0_OR_GREATER - required +required #endif - bool AllowLazyOpen { get; set; } +bool AllowLazyOpen { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigRead AnalysisConfig { get; set; } +Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigRead AnalysisConfig { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimits AnalysisLimits { get; set; } +Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimits AnalysisLimits { get; set; } public Elastic.Clients.Elasticsearch.Duration? BackgroundPersistInterval { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.DateTimeOffset CreateTime { get; set; } +System.DateTimeOffset CreateTime { get; set; } public System.Collections.Generic.IReadOnlyDictionary? CustomSettings { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long DailyModelSnapshotRetentionAfterDays { get; set; } +long DailyModelSnapshotRetentionAfterDays { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.MachineLearning.DataDescription DataDescription { get; set; } +Elastic.Clients.Elasticsearch.MachineLearning.DataDescription DataDescription { get; set; } public Elastic.Clients.Elasticsearch.MachineLearning.Datafeed? DatafeedConfig { get; set; } public string? Description { get; set; } public System.DateTimeOffset? FinishedTime { get; set; } public System.Collections.Generic.IReadOnlyCollection? Groups { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string JobId { get; set; } +string JobId { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string JobType { get; set; } +string JobType { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string JobVersion { get; set; } +string JobVersion { get; set; } public Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfig? ModelPlotConfig { get; set; } public string? ModelSnapshotId { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long ModelSnapshotRetentionDays { get; set; } +long ModelSnapshotRetentionDays { get; set; } public long? RenormalizationWindowDays { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string ResultsIndexName { get; set; } +string ResultsIndexName { get; set; } public long? ResultsRetentionDays { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateModelSnapshotRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateModelSnapshotRequest.Converters.g.cs new file mode 100644 index 00000000000..a4531818c23 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateModelSnapshotRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class UpdateModelSnapshotRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropRetain = System.Text.Json.JsonEncodedText.Encode("retain"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.UpdateModelSnapshotRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propRetain = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propRetain.TryReadProperty(ref reader, options, PropRetain, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.UpdateModelSnapshotRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Retain = propRetain.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpdateModelSnapshotRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropRetain, value.Retain, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateModelSnapshotRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateModelSnapshotRequest.g.cs index ff2f8f2283f..c36011aec05 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateModelSnapshotRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateModelSnapshotRequest.g.cs @@ -27,61 +27,13 @@ public sealed partial class UpdateModelSnapshotRequestParameters : Elastic.Trans { } -internal sealed partial class UpdateModelSnapshotRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropRetain = System.Text.Json.JsonEncodedText.Encode("retain"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.UpdateModelSnapshotRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propRetain = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propRetain.TryReadProperty(ref reader, options, PropRetain, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.UpdateModelSnapshotRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Retain = propRetain.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpdateModelSnapshotRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropRetain, value.Retain, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Update a snapshot. /// Updates certain properties of a snapshot. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.UpdateModelSnapshotRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.UpdateModelSnapshotRequestConverter))] public sealed partial class UpdateModelSnapshotRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateModelSnapshotResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateModelSnapshotResponse.Converters.g.cs new file mode 100644 index 00000000000..7cef3fb777a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateModelSnapshotResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class UpdateModelSnapshotResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + private static readonly System.Text.Json.JsonEncodedText PropModel = System.Text.Json.JsonEncodedText.Encode("model"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.UpdateModelSnapshotResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + LocalJsonValue propModel = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (propModel.TryReadProperty(ref reader, options, PropModel, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.UpdateModelSnapshotResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value, + Model = propModel.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpdateModelSnapshotResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteProperty(options, PropModel, value.Model, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateModelSnapshotResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateModelSnapshotResponse.g.cs index 4e3775db572..c3581857afe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateModelSnapshotResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateModelSnapshotResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class UpdateModelSnapshotResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - private static readonly System.Text.Json.JsonEncodedText PropModel = System.Text.Json.JsonEncodedText.Encode("model"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.UpdateModelSnapshotResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - LocalJsonValue propModel = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (propModel.TryReadProperty(ref reader, options, PropModel, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.UpdateModelSnapshotResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value, - Model = propModel.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpdateModelSnapshotResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteProperty(options, PropModel, value.Model, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.UpdateModelSnapshotResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.UpdateModelSnapshotResponseConverter))] public sealed partial class UpdateModelSnapshotResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal UpdateModelSnapshotResponse(Elastic.Clients.Elasticsearch.Serialization public #if NET7_0_OR_GREATER - required +required #endif - bool Acknowledged { get; set; } +bool Acknowledged { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.MachineLearning.ModelSnapshot Model { get; set; } +Elastic.Clients.Elasticsearch.MachineLearning.ModelSnapshot Model { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateTrainedModelDeploymentRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateTrainedModelDeploymentRequest.Converters.g.cs new file mode 100644 index 00000000000..bed5d610373 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateTrainedModelDeploymentRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class UpdateTrainedModelDeploymentRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAdaptiveAllocations = System.Text.Json.JsonEncodedText.Encode("adaptive_allocations"); + private static readonly System.Text.Json.JsonEncodedText PropNumberOfAllocations = System.Text.Json.JsonEncodedText.Encode("number_of_allocations"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.UpdateTrainedModelDeploymentRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAdaptiveAllocations = default; + LocalJsonValue propNumberOfAllocations = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAdaptiveAllocations.TryReadProperty(ref reader, options, PropAdaptiveAllocations, null)) + { + continue; + } + + if (propNumberOfAllocations.TryReadProperty(ref reader, options, PropNumberOfAllocations, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.UpdateTrainedModelDeploymentRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AdaptiveAllocations = propAdaptiveAllocations.Value, + NumberOfAllocations = propNumberOfAllocations.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpdateTrainedModelDeploymentRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAdaptiveAllocations, value.AdaptiveAllocations, null, null); + writer.WriteProperty(options, PropNumberOfAllocations, value.NumberOfAllocations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateTrainedModelDeploymentRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateTrainedModelDeploymentRequest.g.cs index 8b1de0e1a88..80a091b75d9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateTrainedModelDeploymentRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateTrainedModelDeploymentRequest.g.cs @@ -27,60 +27,12 @@ public sealed partial class UpdateTrainedModelDeploymentRequestParameters : Elas { } -internal sealed partial class UpdateTrainedModelDeploymentRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAdaptiveAllocations = System.Text.Json.JsonEncodedText.Encode("adaptive_allocations"); - private static readonly System.Text.Json.JsonEncodedText PropNumberOfAllocations = System.Text.Json.JsonEncodedText.Encode("number_of_allocations"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.UpdateTrainedModelDeploymentRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAdaptiveAllocations = default; - LocalJsonValue propNumberOfAllocations = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAdaptiveAllocations.TryReadProperty(ref reader, options, PropAdaptiveAllocations, null)) - { - continue; - } - - if (propNumberOfAllocations.TryReadProperty(ref reader, options, PropNumberOfAllocations, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.UpdateTrainedModelDeploymentRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AdaptiveAllocations = propAdaptiveAllocations.Value, - NumberOfAllocations = propNumberOfAllocations.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpdateTrainedModelDeploymentRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAdaptiveAllocations, value.AdaptiveAllocations, null, null); - writer.WriteProperty(options, PropNumberOfAllocations, value.NumberOfAllocations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Update a trained model deployment. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.UpdateTrainedModelDeploymentRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.UpdateTrainedModelDeploymentRequestConverter))] public sealed partial class UpdateTrainedModelDeploymentRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateTrainedModelDeploymentResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateTrainedModelDeploymentResponse.Converters.g.cs new file mode 100644 index 00000000000..41d157e9db0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateTrainedModelDeploymentResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class UpdateTrainedModelDeploymentResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAssignment = System.Text.Json.JsonEncodedText.Encode("assignment"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.UpdateTrainedModelDeploymentResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAssignment = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAssignment.TryReadProperty(ref reader, options, PropAssignment, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.UpdateTrainedModelDeploymentResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Assignment = propAssignment.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpdateTrainedModelDeploymentResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAssignment, value.Assignment, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateTrainedModelDeploymentResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateTrainedModelDeploymentResponse.g.cs index 2fc9d92c54e..88905144072 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateTrainedModelDeploymentResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpdateTrainedModelDeploymentResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class UpdateTrainedModelDeploymentResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAssignment = System.Text.Json.JsonEncodedText.Encode("assignment"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.UpdateTrainedModelDeploymentResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAssignment = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAssignment.TryReadProperty(ref reader, options, PropAssignment, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.UpdateTrainedModelDeploymentResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Assignment = propAssignment.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpdateTrainedModelDeploymentResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAssignment, value.Assignment, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.UpdateTrainedModelDeploymentResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.UpdateTrainedModelDeploymentResponseConverter))] public sealed partial class UpdateTrainedModelDeploymentResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal UpdateTrainedModelDeploymentResponse(Elastic.Clients.Elasticsearch.Seri public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignment Assignment { get; set; } +Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignment Assignment { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpgradeJobSnapshotRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpgradeJobSnapshotRequest.Converters.g.cs new file mode 100644 index 00000000000..e4aced157eb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpgradeJobSnapshotRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class UpgradeJobSnapshotRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.UpgradeJobSnapshotRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.UpgradeJobSnapshotRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpgradeJobSnapshotRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpgradeJobSnapshotRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpgradeJobSnapshotRequest.g.cs index f84d7a98303..7ad980d694a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpgradeJobSnapshotRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpgradeJobSnapshotRequest.g.cs @@ -41,35 +41,6 @@ public sealed partial class UpgradeJobSnapshotRequestParameters : Elastic.Transp public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } } -internal sealed partial class UpgradeJobSnapshotRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.UpgradeJobSnapshotRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.UpgradeJobSnapshotRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpgradeJobSnapshotRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Upgrade a snapshot. @@ -84,7 +55,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// job. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.UpgradeJobSnapshotRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.UpgradeJobSnapshotRequestConverter))] public sealed partial class UpgradeJobSnapshotRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpgradeJobSnapshotResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpgradeJobSnapshotResponse.Converters.g.cs new file mode 100644 index 00000000000..5e0e09f6064 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpgradeJobSnapshotResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class UpgradeJobSnapshotResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCompleted = System.Text.Json.JsonEncodedText.Encode("completed"); + private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.UpgradeJobSnapshotResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCompleted = default; + LocalJsonValue propNode = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCompleted.TryReadProperty(ref reader, options, PropCompleted, null)) + { + continue; + } + + if (propNode.TryReadProperty(ref reader, options, PropNode, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.UpgradeJobSnapshotResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Completed = propCompleted.Value, + Node = propNode.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpgradeJobSnapshotResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCompleted, value.Completed, null, null); + writer.WriteProperty(options, PropNode, value.Node, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpgradeJobSnapshotResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpgradeJobSnapshotResponse.g.cs index aafef6ef41d..589d4301d96 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpgradeJobSnapshotResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/UpgradeJobSnapshotResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class UpgradeJobSnapshotResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCompleted = System.Text.Json.JsonEncodedText.Encode("completed"); - private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.UpgradeJobSnapshotResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCompleted = default; - LocalJsonValue propNode = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCompleted.TryReadProperty(ref reader, options, PropCompleted, null)) - { - continue; - } - - if (propNode.TryReadProperty(ref reader, options, PropNode, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.UpgradeJobSnapshotResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Completed = propCompleted.Value, - Node = propNode.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.UpgradeJobSnapshotResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCompleted, value.Completed, null, null); - writer.WriteProperty(options, PropNode, value.Node, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.UpgradeJobSnapshotResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.UpgradeJobSnapshotResponseConverter))] public sealed partial class UpgradeJobSnapshotResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateDetectorRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateDetectorRequest.Converters.g.cs new file mode 100644 index 00000000000..ddf663ba8e6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateDetectorRequest.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ValidateDetectorRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.ValidateDetectorRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.MachineLearning.ValidateDetectorRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Detector = reader.ReadValue(options, null) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ValidateDetectorRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Detector, null); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateDetectorRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateDetectorRequest.g.cs index 1181c7a333d..5e7e7296531 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateDetectorRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateDetectorRequest.g.cs @@ -27,25 +27,12 @@ public sealed partial class ValidateDetectorRequestParameters : Elastic.Transpor { } -internal sealed partial class ValidateDetectorRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.ValidateDetectorRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.MachineLearning.ValidateDetectorRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Detector = reader.ReadValue(options, null) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ValidateDetectorRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Detector, null); - } -} - /// /// /// Validate an anomaly detection job. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ValidateDetectorRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ValidateDetectorRequestConverter))] public sealed partial class ValidateDetectorRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateDetectorResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateDetectorResponse.Converters.g.cs new file mode 100644 index 00000000000..3e4adf8553f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateDetectorResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ValidateDetectorResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.ValidateDetectorResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.ValidateDetectorResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ValidateDetectorResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateDetectorResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateDetectorResponse.g.cs index 4f8c69cc984..a2db19295b6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateDetectorResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateDetectorResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class ValidateDetectorResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.ValidateDetectorResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.ValidateDetectorResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ValidateDetectorResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ValidateDetectorResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ValidateDetectorResponseConverter))] public sealed partial class ValidateDetectorResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateRequest.Converters.g.cs new file mode 100644 index 00000000000..3fabb319ea7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateRequest.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ValidateRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalysisConfig = System.Text.Json.JsonEncodedText.Encode("analysis_config"); + private static readonly System.Text.Json.JsonEncodedText PropAnalysisLimits = System.Text.Json.JsonEncodedText.Encode("analysis_limits"); + private static readonly System.Text.Json.JsonEncodedText PropDataDescription = System.Text.Json.JsonEncodedText.Encode("data_description"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); + private static readonly System.Text.Json.JsonEncodedText PropModelPlot = System.Text.Json.JsonEncodedText.Encode("model_plot"); + private static readonly System.Text.Json.JsonEncodedText PropModelSnapshotId = System.Text.Json.JsonEncodedText.Encode("model_snapshot_id"); + private static readonly System.Text.Json.JsonEncodedText PropModelSnapshotRetentionDays = System.Text.Json.JsonEncodedText.Encode("model_snapshot_retention_days"); + private static readonly System.Text.Json.JsonEncodedText PropResultsIndexName = System.Text.Json.JsonEncodedText.Encode("results_index_name"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.ValidateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalysisConfig = default; + LocalJsonValue propAnalysisLimits = default; + LocalJsonValue propDataDescription = default; + LocalJsonValue propDescription = default; + LocalJsonValue propJobId = default; + LocalJsonValue propModelPlot = default; + LocalJsonValue propModelSnapshotId = default; + LocalJsonValue propModelSnapshotRetentionDays = default; + LocalJsonValue propResultsIndexName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalysisConfig.TryReadProperty(ref reader, options, PropAnalysisConfig, null)) + { + continue; + } + + if (propAnalysisLimits.TryReadProperty(ref reader, options, PropAnalysisLimits, null)) + { + continue; + } + + if (propDataDescription.TryReadProperty(ref reader, options, PropDataDescription, null)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) + { + continue; + } + + if (propModelPlot.TryReadProperty(ref reader, options, PropModelPlot, null)) + { + continue; + } + + if (propModelSnapshotId.TryReadProperty(ref reader, options, PropModelSnapshotId, null)) + { + continue; + } + + if (propModelSnapshotRetentionDays.TryReadProperty(ref reader, options, PropModelSnapshotRetentionDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propResultsIndexName.TryReadProperty(ref reader, options, PropResultsIndexName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.ValidateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AnalysisConfig = propAnalysisConfig.Value, + AnalysisLimits = propAnalysisLimits.Value, + DataDescription = propDataDescription.Value, + Description = propDescription.Value, + JobId = propJobId.Value, + ModelPlot = propModelPlot.Value, + ModelSnapshotId = propModelSnapshotId.Value, + ModelSnapshotRetentionDays = propModelSnapshotRetentionDays.Value, + ResultsIndexName = propResultsIndexName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ValidateRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalysisConfig, value.AnalysisConfig, null, null); + writer.WriteProperty(options, PropAnalysisLimits, value.AnalysisLimits, null, null); + writer.WriteProperty(options, PropDataDescription, value.DataDescription, null, null); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropJobId, value.JobId, null, null); + writer.WriteProperty(options, PropModelPlot, value.ModelPlot, null, null); + writer.WriteProperty(options, PropModelSnapshotId, value.ModelSnapshotId, null, null); + writer.WriteProperty(options, PropModelSnapshotRetentionDays, value.ModelSnapshotRetentionDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropResultsIndexName, value.ResultsIndexName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateRequest.g.cs index dfa936bbd78..b087a5b7436 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateRequest.g.cs @@ -27,123 +27,12 @@ public sealed partial class ValidateRequestParameters : Elastic.Transport.Reques { } -internal sealed partial class ValidateRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalysisConfig = System.Text.Json.JsonEncodedText.Encode("analysis_config"); - private static readonly System.Text.Json.JsonEncodedText PropAnalysisLimits = System.Text.Json.JsonEncodedText.Encode("analysis_limits"); - private static readonly System.Text.Json.JsonEncodedText PropDataDescription = System.Text.Json.JsonEncodedText.Encode("data_description"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); - private static readonly System.Text.Json.JsonEncodedText PropModelPlot = System.Text.Json.JsonEncodedText.Encode("model_plot"); - private static readonly System.Text.Json.JsonEncodedText PropModelSnapshotId = System.Text.Json.JsonEncodedText.Encode("model_snapshot_id"); - private static readonly System.Text.Json.JsonEncodedText PropModelSnapshotRetentionDays = System.Text.Json.JsonEncodedText.Encode("model_snapshot_retention_days"); - private static readonly System.Text.Json.JsonEncodedText PropResultsIndexName = System.Text.Json.JsonEncodedText.Encode("results_index_name"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.ValidateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalysisConfig = default; - LocalJsonValue propAnalysisLimits = default; - LocalJsonValue propDataDescription = default; - LocalJsonValue propDescription = default; - LocalJsonValue propJobId = default; - LocalJsonValue propModelPlot = default; - LocalJsonValue propModelSnapshotId = default; - LocalJsonValue propModelSnapshotRetentionDays = default; - LocalJsonValue propResultsIndexName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalysisConfig.TryReadProperty(ref reader, options, PropAnalysisConfig, null)) - { - continue; - } - - if (propAnalysisLimits.TryReadProperty(ref reader, options, PropAnalysisLimits, null)) - { - continue; - } - - if (propDataDescription.TryReadProperty(ref reader, options, PropDataDescription, null)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) - { - continue; - } - - if (propModelPlot.TryReadProperty(ref reader, options, PropModelPlot, null)) - { - continue; - } - - if (propModelSnapshotId.TryReadProperty(ref reader, options, PropModelSnapshotId, null)) - { - continue; - } - - if (propModelSnapshotRetentionDays.TryReadProperty(ref reader, options, PropModelSnapshotRetentionDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propResultsIndexName.TryReadProperty(ref reader, options, PropResultsIndexName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.ValidateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AnalysisConfig = propAnalysisConfig.Value, - AnalysisLimits = propAnalysisLimits.Value, - DataDescription = propDataDescription.Value, - Description = propDescription.Value, - JobId = propJobId.Value, - ModelPlot = propModelPlot.Value, - ModelSnapshotId = propModelSnapshotId.Value, - ModelSnapshotRetentionDays = propModelSnapshotRetentionDays.Value, - ResultsIndexName = propResultsIndexName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ValidateRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalysisConfig, value.AnalysisConfig, null, null); - writer.WriteProperty(options, PropAnalysisLimits, value.AnalysisLimits, null, null); - writer.WriteProperty(options, PropDataDescription, value.DataDescription, null, null); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropJobId, value.JobId, null, null); - writer.WriteProperty(options, PropModelPlot, value.ModelPlot, null, null); - writer.WriteProperty(options, PropModelSnapshotId, value.ModelSnapshotId, null, null); - writer.WriteProperty(options, PropModelSnapshotRetentionDays, value.ModelSnapshotRetentionDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropResultsIndexName, value.ResultsIndexName, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Validate an anomaly detection job. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ValidateRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ValidateRequestConverter))] public sealed partial class ValidateRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateResponse.Converters.g.cs new file mode 100644 index 00000000000..72174cd90b1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ValidateResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.ValidateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.ValidateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ValidateResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateResponse.g.cs index c5a91537e47..bcec4752d99 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MachineLearning/ValidateResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class ValidateResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.ValidateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.ValidateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ValidateResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ValidateResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ValidateResponseConverter))] public sealed partial class ValidateResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiGetRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiGetRequest.Converters.g.cs new file mode 100644 index 00000000000..effcfa2c781 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiGetRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class MultiGetRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); + private static readonly System.Text.Json.JsonEncodedText PropIds = System.Text.Json.JsonEncodedText.Encode("ids"); + + public override Elastic.Clients.Elasticsearch.MultiGetRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propDocs = default; + LocalJsonValue propIds = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocs.TryReadProperty(ref reader, options, PropDocs, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propIds.TryReadProperty(ref reader, options, PropIds, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MultiGetRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Docs = propDocs.Value, + Ids = propIds.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MultiGetRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocs, value.Docs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIds, value.Ids, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiGetRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiGetRequest.g.cs index fb0410ae86e..036363cba40 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiGetRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiGetRequest.g.cs @@ -94,54 +94,6 @@ public sealed partial class MultiGetRequestParameters : Elastic.Transport.Reques public Elastic.Clients.Elasticsearch.Fields? StoredFields { get => Q("stored_fields"); set => Q("stored_fields", value); } } -internal sealed partial class MultiGetRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); - private static readonly System.Text.Json.JsonEncodedText PropIds = System.Text.Json.JsonEncodedText.Encode("ids"); - - public override Elastic.Clients.Elasticsearch.MultiGetRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propDocs = default; - LocalJsonValue propIds = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocs.TryReadProperty(ref reader, options, PropDocs, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propIds.TryReadProperty(ref reader, options, PropIds, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MultiGetRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Docs = propDocs.Value, - Ids = propIds.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MultiGetRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocs, value.Docs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIds, value.Ids, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Get multiple documents. @@ -168,7 +120,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// You can include the stored_fields query parameter in the request URI to specify the defaults to use when there are no per-document instructions. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MultiGetRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.MultiGetRequestConverter))] public sealed partial class MultiGetRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public MultiGetRequest(Elastic.Clients.Elasticsearch.IndexName? index) : base(r => r.Optional("index", index)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiGetResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiGetResponse.Converters.g.cs new file mode 100644 index 00000000000..30090e9924e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiGetResponse.Converters.g.cs @@ -0,0 +1,79 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class MultiGetResponseConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); + + public override Elastic.Clients.Elasticsearch.MultiGetResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>> propDocs = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocs.TryReadProperty(ref reader, options, PropDocs, static System.Collections.Generic.IReadOnlyCollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MultiGetResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Docs = propDocs.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MultiGetResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocs, value.Docs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection> v) => w.WriteCollectionValue>(o, v, null)); + writer.WriteEndObject(); + } +} + +public sealed partial class MultiGetResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(MultiGetResponse<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(MultiGetResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiGetResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiGetResponse.g.cs index a321c908f67..59752ce5bd9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiGetResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiGetResponse.g.cs @@ -23,62 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class MultiGetResponseConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); - - public override Elastic.Clients.Elasticsearch.MultiGetResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>> propDocs = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocs.TryReadProperty(ref reader, options, PropDocs, static System.Collections.Generic.IReadOnlyCollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MultiGetResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Docs = propDocs.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MultiGetResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocs, value.Docs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection> v) => w.WriteCollectionValue>(o, v, null)); - writer.WriteEndObject(); - } -} - -internal sealed partial class MultiGetResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(MultiGetResponse<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(MultiGetResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MultiGetResponseConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.MultiGetResponseConverterFactory))] public sealed partial class MultiGetResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchRequest.g.cs index c153caf9631..67914d72d2c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchRequest.g.cs @@ -862,4 +862,4 @@ public Elastic.Clients.Elasticsearch.MultiSearchRequestDescriptor Req Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; return this; } -} +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchResponse.Converters.g.cs new file mode 100644 index 00000000000..24b0bf5b93c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchResponse.Converters.g.cs @@ -0,0 +1,88 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class MultiSearchResponseConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropResponses = System.Text.Json.JsonEncodedText.Encode("responses"); + private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); + + public override Elastic.Clients.Elasticsearch.MultiSearchResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>> propResponses = default; + LocalJsonValue propTook = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propResponses.TryReadProperty(ref reader, options, PropResponses, static System.Collections.Generic.IReadOnlyCollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, null)!)) + { + continue; + } + + if (propTook.TryReadProperty(ref reader, options, PropTook, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MultiSearchResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Responses = propResponses.Value, + Took = propTook.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MultiSearchResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropResponses, value.Responses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection> v) => w.WriteCollectionValue>(o, v, null)); + writer.WriteProperty(options, PropTook, value.Took, null, null); + writer.WriteEndObject(); + } +} + +public sealed partial class MultiSearchResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(MultiSearchResponse<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(MultiSearchResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchResponse.g.cs index 22a239db7ce..f07b313c193 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchResponse.g.cs @@ -23,71 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class MultiSearchResponseConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropResponses = System.Text.Json.JsonEncodedText.Encode("responses"); - private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); - - public override Elastic.Clients.Elasticsearch.MultiSearchResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>> propResponses = default; - LocalJsonValue propTook = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propResponses.TryReadProperty(ref reader, options, PropResponses, static System.Collections.Generic.IReadOnlyCollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, null)!)) - { - continue; - } - - if (propTook.TryReadProperty(ref reader, options, PropTook, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MultiSearchResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Responses = propResponses.Value, - Took = propTook.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MultiSearchResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropResponses, value.Responses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection> v) => w.WriteCollectionValue>(o, v, null)); - writer.WriteProperty(options, PropTook, value.Took, null, null); - writer.WriteEndObject(); - } -} - -internal sealed partial class MultiSearchResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(MultiSearchResponse<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(MultiSearchResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MultiSearchResponseConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.MultiSearchResponseConverterFactory))] public partial class MultiSearchResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -103,12 +39,12 @@ internal MultiSearchResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCon public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection> Responses { get; set; } +System.Collections.Generic.IReadOnlyCollection> Responses { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long Took { get; set; } +long Took { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchTemplateRequest.g.cs index 6c7b3192e79..293c430d289 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchTemplateRequest.g.cs @@ -526,4 +526,4 @@ public Elastic.Clients.Elasticsearch.MultiSearchTemplateRequestDescriptor : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropResponses = System.Text.Json.JsonEncodedText.Encode("responses"); + private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); + + public override Elastic.Clients.Elasticsearch.MultiSearchTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>> propResponses = default; + LocalJsonValue propTook = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propResponses.TryReadProperty(ref reader, options, PropResponses, static System.Collections.Generic.IReadOnlyCollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, null)!)) + { + continue; + } + + if (propTook.TryReadProperty(ref reader, options, PropTook, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MultiSearchTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Responses = propResponses.Value, + Took = propTook.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MultiSearchTemplateResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropResponses, value.Responses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection> v) => w.WriteCollectionValue>(o, v, null)); + writer.WriteProperty(options, PropTook, value.Took, null, null); + writer.WriteEndObject(); + } +} + +public sealed partial class MultiSearchTemplateResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(MultiSearchTemplateResponse<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(MultiSearchTemplateResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchTemplateResponse.g.cs index a8b335db4b3..43946a50ad1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiSearchTemplateResponse.g.cs @@ -23,71 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class MultiSearchTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropResponses = System.Text.Json.JsonEncodedText.Encode("responses"); - private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); - - public override Elastic.Clients.Elasticsearch.MultiSearchTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>> propResponses = default; - LocalJsonValue propTook = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propResponses.TryReadProperty(ref reader, options, PropResponses, static System.Collections.Generic.IReadOnlyCollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, null)!)) - { - continue; - } - - if (propTook.TryReadProperty(ref reader, options, PropTook, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MultiSearchTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Responses = propResponses.Value, - Took = propTook.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MultiSearchTemplateResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropResponses, value.Responses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection> v) => w.WriteCollectionValue>(o, v, null)); - writer.WriteProperty(options, PropTook, value.Took, null, null); - writer.WriteEndObject(); - } -} - -internal sealed partial class MultiSearchTemplateResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(MultiSearchTemplateResponse<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(MultiSearchTemplateResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MultiSearchTemplateResponseConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.MultiSearchTemplateResponseConverterFactory))] public partial class MultiSearchTemplateResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -103,12 +39,12 @@ internal MultiSearchTemplateResponse(Elastic.Clients.Elasticsearch.Serialization public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection> Responses { get; set; } +System.Collections.Generic.IReadOnlyCollection> Responses { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long Took { get; set; } +long Took { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiTermVectorsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiTermVectorsRequest.Converters.g.cs new file mode 100644 index 00000000000..b504ef66897 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiTermVectorsRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class MultiTermVectorsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); + private static readonly System.Text.Json.JsonEncodedText PropIds = System.Text.Json.JsonEncodedText.Encode("ids"); + + public override Elastic.Clients.Elasticsearch.MultiTermVectorsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propDocs = default; + LocalJsonValue?> propIds = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocs.TryReadProperty(ref reader, options, PropDocs, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propIds.TryReadProperty(ref reader, options, PropIds, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MultiTermVectorsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Docs = propDocs.Value, + Ids = propIds.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MultiTermVectorsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocs, value.Docs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIds, value.Ids, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiTermVectorsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiTermVectorsRequest.g.cs index 002e2d66cc9..4c4ee78e7b8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiTermVectorsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiTermVectorsRequest.g.cs @@ -105,54 +105,6 @@ public sealed partial class MultiTermVectorsRequestParameters : Elastic.Transpor public Elastic.Clients.Elasticsearch.VersionType? VersionType { get => Q("version_type"); set => Q("version_type", value); } } -internal sealed partial class MultiTermVectorsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); - private static readonly System.Text.Json.JsonEncodedText PropIds = System.Text.Json.JsonEncodedText.Encode("ids"); - - public override Elastic.Clients.Elasticsearch.MultiTermVectorsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propDocs = default; - LocalJsonValue?> propIds = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocs.TryReadProperty(ref reader, options, PropDocs, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propIds.TryReadProperty(ref reader, options, PropIds, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MultiTermVectorsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Docs = propDocs.Value, - Ids = propIds.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MultiTermVectorsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocs, value.Docs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIds, value.Ids, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// Get multiple term vectors. @@ -172,7 +124,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The mapping used is determined by the specified _index. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MultiTermVectorsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.MultiTermVectorsRequestConverter))] public sealed partial class MultiTermVectorsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public MultiTermVectorsRequest(Elastic.Clients.Elasticsearch.IndexName? index) : base(r => r.Optional("index", index)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiTermVectorsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiTermVectorsResponse.Converters.g.cs new file mode 100644 index 00000000000..f8bfbf5fa9d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiTermVectorsResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class MultiTermVectorsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); + + public override Elastic.Clients.Elasticsearch.MultiTermVectorsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propDocs = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocs.TryReadProperty(ref reader, options, PropDocs, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MultiTermVectorsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Docs = propDocs.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MultiTermVectorsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocs, value.Docs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiTermVectorsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiTermVectorsResponse.g.cs index c3a93faa391..1d0d63294b1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiTermVectorsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/MultiTermVectorsResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class MultiTermVectorsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); - - public override Elastic.Clients.Elasticsearch.MultiTermVectorsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propDocs = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocs.TryReadProperty(ref reader, options, PropDocs, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MultiTermVectorsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Docs = propDocs.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MultiTermVectorsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocs, value.Docs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MultiTermVectorsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.MultiTermVectorsResponseConverter))] public sealed partial class MultiTermVectorsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal MultiTermVectorsResponse(Elastic.Clients.Elasticsearch.Serialization.Js public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Docs { get; set; } +System.Collections.Generic.IReadOnlyCollection Docs { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ClearRepositoriesMeteringArchiveRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ClearRepositoriesMeteringArchiveRequest.Converters.g.cs new file mode 100644 index 00000000000..a3f99409c4a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ClearRepositoriesMeteringArchiveRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class ClearRepositoriesMeteringArchiveRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Nodes.ClearRepositoriesMeteringArchiveRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.ClearRepositoriesMeteringArchiveRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.ClearRepositoriesMeteringArchiveRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ClearRepositoriesMeteringArchiveRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ClearRepositoriesMeteringArchiveRequest.g.cs index 36ba82da25d..35d8b2c62b5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ClearRepositoriesMeteringArchiveRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ClearRepositoriesMeteringArchiveRequest.g.cs @@ -27,42 +27,13 @@ public sealed partial class ClearRepositoriesMeteringArchiveRequestParameters : { } -internal sealed partial class ClearRepositoriesMeteringArchiveRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Nodes.ClearRepositoriesMeteringArchiveRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.ClearRepositoriesMeteringArchiveRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.ClearRepositoriesMeteringArchiveRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Clear the archived repositories metering. /// Clear the archived repositories metering information in the cluster. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.ClearRepositoriesMeteringArchiveRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.ClearRepositoriesMeteringArchiveRequestConverter))] public sealed partial class ClearRepositoriesMeteringArchiveRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ClearRepositoriesMeteringArchiveResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ClearRepositoriesMeteringArchiveResponse.Converters.g.cs new file mode 100644 index 00000000000..0fc52d2e7e8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ClearRepositoriesMeteringArchiveResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class ClearRepositoriesMeteringArchiveResponseConverter : 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 PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); + private static readonly System.Text.Json.JsonEncodedText PropNodeStats = System.Text.Json.JsonEncodedText.Encode("_nodes"); + + public override Elastic.Clients.Elasticsearch.Nodes.ClearRepositoriesMeteringArchiveResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClusterName = default; + LocalJsonValue> propNodes = default; + LocalJsonValue propNodeStats = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) + { + continue; + } + + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propNodeStats.TryReadProperty(ref reader, options, PropNodeStats, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.ClearRepositoriesMeteringArchiveResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClusterName = propClusterName.Value, + Nodes = propNodes.Value, + NodeStats = propNodeStats.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.ClearRepositoriesMeteringArchiveResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNodeStats, value.NodeStats, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ClearRepositoriesMeteringArchiveResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ClearRepositoriesMeteringArchiveResponse.g.cs index 0a86abac97b..0ddc0bd91c5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ClearRepositoriesMeteringArchiveResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ClearRepositoriesMeteringArchiveResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class ClearRepositoriesMeteringArchiveResponseConverter : 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 PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); - private static readonly System.Text.Json.JsonEncodedText PropNodeStats = System.Text.Json.JsonEncodedText.Encode("_nodes"); - - public override Elastic.Clients.Elasticsearch.Nodes.ClearRepositoriesMeteringArchiveResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClusterName = default; - LocalJsonValue> propNodes = default; - LocalJsonValue propNodeStats = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) - { - continue; - } - - if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propNodeStats.TryReadProperty(ref reader, options, PropNodeStats, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.ClearRepositoriesMeteringArchiveResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClusterName = propClusterName.Value, - Nodes = propNodes.Value, - NodeStats = propNodeStats.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.ClearRepositoriesMeteringArchiveResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); - writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNodeStats, value.NodeStats, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.ClearRepositoriesMeteringArchiveResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.ClearRepositoriesMeteringArchiveResponseConverter))] public sealed partial class ClearRepositoriesMeteringArchiveResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/GetRepositoriesMeteringInfoRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/GetRepositoriesMeteringInfoRequest.Converters.g.cs new file mode 100644 index 00000000000..46455a72836 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/GetRepositoriesMeteringInfoRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class GetRepositoriesMeteringInfoRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Nodes.GetRepositoriesMeteringInfoRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.GetRepositoriesMeteringInfoRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.GetRepositoriesMeteringInfoRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/GetRepositoriesMeteringInfoRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/GetRepositoriesMeteringInfoRequest.g.cs index d4ea3754aad..af4c1d1c0be 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/GetRepositoriesMeteringInfoRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/GetRepositoriesMeteringInfoRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class GetRepositoriesMeteringInfoRequestParameters : Elast { } -internal sealed partial class GetRepositoriesMeteringInfoRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Nodes.GetRepositoriesMeteringInfoRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.GetRepositoriesMeteringInfoRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.GetRepositoriesMeteringInfoRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get cluster repositories metering. @@ -64,7 +35,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Additionally, the information exposed by this API is volatile, meaning that it will not be present after node restarts. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.GetRepositoriesMeteringInfoRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.GetRepositoriesMeteringInfoRequestConverter))] public sealed partial class GetRepositoriesMeteringInfoRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/GetRepositoriesMeteringInfoResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/GetRepositoriesMeteringInfoResponse.Converters.g.cs new file mode 100644 index 00000000000..780db8d912f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/GetRepositoriesMeteringInfoResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class GetRepositoriesMeteringInfoResponseConverter : 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 PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); + private static readonly System.Text.Json.JsonEncodedText PropNodeStats = System.Text.Json.JsonEncodedText.Encode("_nodes"); + + public override Elastic.Clients.Elasticsearch.Nodes.GetRepositoriesMeteringInfoResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClusterName = default; + LocalJsonValue> propNodes = default; + LocalJsonValue propNodeStats = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) + { + continue; + } + + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propNodeStats.TryReadProperty(ref reader, options, PropNodeStats, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.GetRepositoriesMeteringInfoResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClusterName = propClusterName.Value, + Nodes = propNodes.Value, + NodeStats = propNodeStats.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.GetRepositoriesMeteringInfoResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNodeStats, value.NodeStats, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/GetRepositoriesMeteringInfoResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/GetRepositoriesMeteringInfoResponse.g.cs index 670f4de7a4b..b47413936c9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/GetRepositoriesMeteringInfoResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/GetRepositoriesMeteringInfoResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class GetRepositoriesMeteringInfoResponseConverter : 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 PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); - private static readonly System.Text.Json.JsonEncodedText PropNodeStats = System.Text.Json.JsonEncodedText.Encode("_nodes"); - - public override Elastic.Clients.Elasticsearch.Nodes.GetRepositoriesMeteringInfoResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClusterName = default; - LocalJsonValue> propNodes = default; - LocalJsonValue propNodeStats = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) - { - continue; - } - - if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propNodeStats.TryReadProperty(ref reader, options, PropNodeStats, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.GetRepositoriesMeteringInfoResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClusterName = propClusterName.Value, - Nodes = propNodes.Value, - NodeStats = propNodeStats.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.GetRepositoriesMeteringInfoResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); - writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNodeStats, value.NodeStats, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.GetRepositoriesMeteringInfoResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.GetRepositoriesMeteringInfoResponseConverter))] public sealed partial class GetRepositoriesMeteringInfoResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/HotThreadsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/HotThreadsRequest.Converters.g.cs new file mode 100644 index 00000000000..c18fb0d0e37 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/HotThreadsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class HotThreadsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Nodes.HotThreadsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.HotThreadsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.HotThreadsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/HotThreadsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/HotThreadsRequest.g.cs index 3911f34705a..9a92d361d37 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/HotThreadsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/HotThreadsRequest.g.cs @@ -77,35 +77,6 @@ public sealed partial class HotThreadsRequestParameters : Elastic.Transport.Requ public Elastic.Clients.Elasticsearch.ThreadType? Type { get => Q("type"); set => Q("type", value); } } -internal sealed partial class HotThreadsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Nodes.HotThreadsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.HotThreadsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.HotThreadsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get the hot threads for nodes. @@ -113,7 +84,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The output is plain text with a breakdown of the top hot threads for each node. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.HotThreadsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.HotThreadsRequestConverter))] public sealed partial class HotThreadsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public HotThreadsRequest(Elastic.Clients.Elasticsearch.NodeIds? nodeId) : base(r => r.Optional("node_id", nodeId)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/HotThreadsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/HotThreadsResponse.Converters.g.cs new file mode 100644 index 00000000000..2e7469b38c8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/HotThreadsResponse.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class HotThreadsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Nodes.HotThreadsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.HotThreadsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.HotThreadsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/HotThreadsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/HotThreadsResponse.g.cs index ed9f4e9bc45..da6636e2c96 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/HotThreadsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/HotThreadsResponse.g.cs @@ -23,36 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class HotThreadsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Nodes.HotThreadsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.HotThreadsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.HotThreadsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.HotThreadsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.HotThreadsResponseConverter))] public sealed partial class HotThreadsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesInfoRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesInfoRequest.Converters.g.cs new file mode 100644 index 00000000000..825e6eeea9d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesInfoRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodesInfoRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Nodes.NodesInfoRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodesInfoRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodesInfoRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesInfoRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesInfoRequest.g.cs index e24f0db94a2..bf87ec6f461 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesInfoRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesInfoRequest.g.cs @@ -40,35 +40,6 @@ public sealed partial class NodesInfoRequestParameters : Elastic.Transport.Reque public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class NodesInfoRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Nodes.NodesInfoRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodesInfoRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodesInfoRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get node information. @@ -77,7 +48,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// By default, the API returns all attributes and core settings for cluster nodes. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodesInfoRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodesInfoRequestConverter))] public sealed partial class NodesInfoRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public NodesInfoRequest(Elastic.Clients.Elasticsearch.NodeIds? nodeId) : base(r => r.Optional("node_id", nodeId)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesInfoResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesInfoResponse.Converters.g.cs new file mode 100644 index 00000000000..008f2b1b1fd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesInfoResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodesInfoResponseConverter : 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 PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); + private static readonly System.Text.Json.JsonEncodedText PropNodeStats = System.Text.Json.JsonEncodedText.Encode("_nodes"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodesInfoResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClusterName = default; + LocalJsonValue> propNodes = default; + LocalJsonValue propNodeStats = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) + { + continue; + } + + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propNodeStats.TryReadProperty(ref reader, options, PropNodeStats, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodesInfoResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClusterName = propClusterName.Value, + Nodes = propNodes.Value, + NodeStats = propNodeStats.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodesInfoResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNodeStats, value.NodeStats, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesInfoResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesInfoResponse.g.cs index 18041011571..bae21599a8b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesInfoResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesInfoResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodesInfoResponseConverter : 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 PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); - private static readonly System.Text.Json.JsonEncodedText PropNodeStats = System.Text.Json.JsonEncodedText.Encode("_nodes"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodesInfoResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClusterName = default; - LocalJsonValue> propNodes = default; - LocalJsonValue propNodeStats = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) - { - continue; - } - - if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propNodeStats.TryReadProperty(ref reader, options, PropNodeStats, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodesInfoResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClusterName = propClusterName.Value, - Nodes = propNodes.Value, - NodeStats = propNodeStats.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodesInfoResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); - writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNodeStats, value.NodeStats, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodesInfoResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodesInfoResponseConverter))] public sealed partial class NodesInfoResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -96,14 +39,14 @@ internal NodesInfoResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConst public #if NET7_0_OR_GREATER - required +required #endif - string ClusterName { get; set; } +string ClusterName { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } +System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesStatsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesStatsRequest.Converters.g.cs new file mode 100644 index 00000000000..aa7b4aaabb2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesStatsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodesStatsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Nodes.NodesStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodesStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodesStatsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesStatsRequest.g.cs index 09e4c28d374..aed238b6e10 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesStatsRequest.g.cs @@ -89,35 +89,6 @@ public sealed partial class NodesStatsRequestParameters : Elastic.Transport.Requ public System.Collections.Generic.ICollection? Types { get => Q?>("types"); set => Q("types", value); } } -internal sealed partial class NodesStatsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Nodes.NodesStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodesStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodesStatsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get node statistics. @@ -125,7 +96,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// By default, all stats are returned. You can limit the returned information by using metrics. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodesStatsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodesStatsRequestConverter))] public sealed partial class NodesStatsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public NodesStatsRequest(Elastic.Clients.Elasticsearch.NodeIds? nodeId) : base(r => r.Optional("node_id", nodeId)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesStatsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesStatsResponse.Converters.g.cs new file mode 100644 index 00000000000..b90e02c5961 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesStatsResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodesStatsResponseConverter : 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 PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); + private static readonly System.Text.Json.JsonEncodedText PropNodeStats = System.Text.Json.JsonEncodedText.Encode("_nodes"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodesStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClusterName = default; + LocalJsonValue> propNodes = default; + LocalJsonValue propNodeStats = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) + { + continue; + } + + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propNodeStats.TryReadProperty(ref reader, options, PropNodeStats, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodesStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClusterName = propClusterName.Value, + Nodes = propNodes.Value, + NodeStats = propNodeStats.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodesStatsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNodeStats, value.NodeStats, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesStatsResponse.g.cs index 54f4f4fb051..96fbd92efc9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesStatsResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodesStatsResponseConverter : 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 PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); - private static readonly System.Text.Json.JsonEncodedText PropNodeStats = System.Text.Json.JsonEncodedText.Encode("_nodes"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodesStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClusterName = default; - LocalJsonValue> propNodes = default; - LocalJsonValue propNodeStats = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) - { - continue; - } - - if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propNodeStats.TryReadProperty(ref reader, options, PropNodeStats, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodesStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClusterName = propClusterName.Value, - Nodes = propNodes.Value, - NodeStats = propNodeStats.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodesStatsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); - writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNodeStats, value.NodeStats, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodesStatsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodesStatsResponseConverter))] public sealed partial class NodesStatsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -97,9 +40,9 @@ internal NodesStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCons public string? ClusterName { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } +System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesUsageRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesUsageRequest.Converters.g.cs new file mode 100644 index 00000000000..9fdcefb8138 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesUsageRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodesUsageRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Nodes.NodesUsageRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodesUsageRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodesUsageRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesUsageRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesUsageRequest.g.cs index f73b514d323..fde97d2d20b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesUsageRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesUsageRequest.g.cs @@ -34,41 +34,12 @@ public sealed partial class NodesUsageRequestParameters : Elastic.Transport.Requ public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class NodesUsageRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Nodes.NodesUsageRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodesUsageRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodesUsageRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get feature usage information. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodesUsageRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodesUsageRequestConverter))] public sealed partial class NodesUsageRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public NodesUsageRequest(Elastic.Clients.Elasticsearch.NodeIds? nodeId) : base(r => r.Optional("node_id", nodeId)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesUsageResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesUsageResponse.Converters.g.cs new file mode 100644 index 00000000000..56269bf41b9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesUsageResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodesUsageResponseConverter : 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 PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); + private static readonly System.Text.Json.JsonEncodedText PropNodeStats = System.Text.Json.JsonEncodedText.Encode("_nodes"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodesUsageResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClusterName = default; + LocalJsonValue> propNodes = default; + LocalJsonValue propNodeStats = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) + { + continue; + } + + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propNodeStats.TryReadProperty(ref reader, options, PropNodeStats, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodesUsageResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClusterName = propClusterName.Value, + Nodes = propNodes.Value, + NodeStats = propNodeStats.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodesUsageResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNodeStats, value.NodeStats, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesUsageResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesUsageResponse.g.cs index d42c26ec25a..5309aa7573e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesUsageResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesUsageResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodesUsageResponseConverter : 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 PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); - private static readonly System.Text.Json.JsonEncodedText PropNodeStats = System.Text.Json.JsonEncodedText.Encode("_nodes"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodesUsageResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClusterName = default; - LocalJsonValue> propNodes = default; - LocalJsonValue propNodeStats = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) - { - continue; - } - - if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propNodeStats.TryReadProperty(ref reader, options, PropNodeStats, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodesUsageResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClusterName = propClusterName.Value, - Nodes = propNodes.Value, - NodeStats = propNodeStats.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodesUsageResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); - writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNodeStats, value.NodeStats, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodesUsageResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodesUsageResponseConverter))] public sealed partial class NodesUsageResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -96,14 +39,14 @@ internal NodesUsageResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCons public #if NET7_0_OR_GREATER - required +required #endif - string ClusterName { get; set; } +string ClusterName { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } +System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ReloadSecureSettingsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ReloadSecureSettingsRequest.Converters.g.cs new file mode 100644 index 00000000000..5664f9d0974 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ReloadSecureSettingsRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class ReloadSecureSettingsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSecureSettingsPassword = System.Text.Json.JsonEncodedText.Encode("secure_settings_password"); + + public override Elastic.Clients.Elasticsearch.Nodes.ReloadSecureSettingsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propSecureSettingsPassword = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSecureSettingsPassword.TryReadProperty(ref reader, options, PropSecureSettingsPassword, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.ReloadSecureSettingsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + SecureSettingsPassword = propSecureSettingsPassword.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.ReloadSecureSettingsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSecureSettingsPassword, value.SecureSettingsPassword, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ReloadSecureSettingsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ReloadSecureSettingsRequest.g.cs index 4bdbbc53ca0..3df71df4848 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ReloadSecureSettingsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ReloadSecureSettingsRequest.g.cs @@ -34,45 +34,6 @@ public sealed partial class ReloadSecureSettingsRequestParameters : Elastic.Tran public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class ReloadSecureSettingsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSecureSettingsPassword = System.Text.Json.JsonEncodedText.Encode("secure_settings_password"); - - public override Elastic.Clients.Elasticsearch.Nodes.ReloadSecureSettingsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propSecureSettingsPassword = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSecureSettingsPassword.TryReadProperty(ref reader, options, PropSecureSettingsPassword, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.ReloadSecureSettingsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - SecureSettingsPassword = propSecureSettingsPassword.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.ReloadSecureSettingsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSecureSettingsPassword, value.SecureSettingsPassword, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Reload the keystore on nodes in the cluster. @@ -88,7 +49,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Alternatively, you can reload the secure settings on each node by locally accessing the API and passing the node-specific Elasticsearch keystore password. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.ReloadSecureSettingsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.ReloadSecureSettingsRequestConverter))] public sealed partial class ReloadSecureSettingsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public ReloadSecureSettingsRequest(Elastic.Clients.Elasticsearch.NodeIds? nodeId) : base(r => r.Optional("node_id", nodeId)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ReloadSecureSettingsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ReloadSecureSettingsResponse.Converters.g.cs new file mode 100644 index 00000000000..7cd47133c17 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ReloadSecureSettingsResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class ReloadSecureSettingsResponseConverter : 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 PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); + private static readonly System.Text.Json.JsonEncodedText PropNodeStats = System.Text.Json.JsonEncodedText.Encode("_nodes"); + + public override Elastic.Clients.Elasticsearch.Nodes.ReloadSecureSettingsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClusterName = default; + LocalJsonValue> propNodes = default; + LocalJsonValue propNodeStats = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) + { + continue; + } + + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propNodeStats.TryReadProperty(ref reader, options, PropNodeStats, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.ReloadSecureSettingsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClusterName = propClusterName.Value, + Nodes = propNodes.Value, + NodeStats = propNodeStats.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.ReloadSecureSettingsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNodeStats, value.NodeStats, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ReloadSecureSettingsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ReloadSecureSettingsResponse.g.cs index 668c8184d76..6bfdb313fed 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ReloadSecureSettingsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/ReloadSecureSettingsResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class ReloadSecureSettingsResponseConverter : 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 PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); - private static readonly System.Text.Json.JsonEncodedText PropNodeStats = System.Text.Json.JsonEncodedText.Encode("_nodes"); - - public override Elastic.Clients.Elasticsearch.Nodes.ReloadSecureSettingsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClusterName = default; - LocalJsonValue> propNodes = default; - LocalJsonValue propNodeStats = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) - { - continue; - } - - if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propNodeStats.TryReadProperty(ref reader, options, PropNodeStats, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.ReloadSecureSettingsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClusterName = propClusterName.Value, - Nodes = propNodes.Value, - NodeStats = propNodeStats.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.ReloadSecureSettingsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); - writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNodeStats, value.NodeStats, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.ReloadSecureSettingsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.ReloadSecureSettingsResponseConverter))] public sealed partial class ReloadSecureSettingsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -96,14 +39,14 @@ internal ReloadSecureSettingsResponse(Elastic.Clients.Elasticsearch.Serializatio public #if NET7_0_OR_GREATER - required +required #endif - string ClusterName { get; set; } +string ClusterName { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } +System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/OpenPointInTimeRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/OpenPointInTimeRequest.Converters.g.cs new file mode 100644 index 00000000000..dce0a152bc6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/OpenPointInTimeRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class OpenPointInTimeRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndexFilter = System.Text.Json.JsonEncodedText.Encode("index_filter"); + + public override Elastic.Clients.Elasticsearch.OpenPointInTimeRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndexFilter = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndexFilter.TryReadProperty(ref reader, options, PropIndexFilter, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.OpenPointInTimeRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + IndexFilter = propIndexFilter.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.OpenPointInTimeRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndexFilter, value.IndexFilter, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/OpenPointInTimeRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/OpenPointInTimeRequest.g.cs index 956acbfaa91..16bb08c0617 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/OpenPointInTimeRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/OpenPointInTimeRequest.g.cs @@ -80,45 +80,6 @@ public sealed partial class OpenPointInTimeRequestParameters : Elastic.Transport public Elastic.Clients.Elasticsearch.Routing? Routing { get => Q("routing"); set => Q("routing", value); } } -internal sealed partial class OpenPointInTimeRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndexFilter = System.Text.Json.JsonEncodedText.Encode("index_filter"); - - public override Elastic.Clients.Elasticsearch.OpenPointInTimeRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndexFilter = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndexFilter.TryReadProperty(ref reader, options, PropIndexFilter, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.OpenPointInTimeRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - IndexFilter = propIndexFilter.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.OpenPointInTimeRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndexFilter, value.IndexFilter, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Open a point in time. @@ -171,7 +132,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// You can check how many point-in-times (that is, search contexts) are open with the nodes stats API. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.OpenPointInTimeRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.OpenPointInTimeRequestConverter))] public sealed partial class OpenPointInTimeRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/OpenPointInTimeResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/OpenPointInTimeResponse.Converters.g.cs new file mode 100644 index 00000000000..6db72b16f5c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/OpenPointInTimeResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class OpenPointInTimeResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + + public override Elastic.Clients.Elasticsearch.OpenPointInTimeResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propShards = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.OpenPointInTimeResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + Shards = propShards.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.OpenPointInTimeResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/OpenPointInTimeResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/OpenPointInTimeResponse.g.cs index 1f51ac9a1f5..6839734dceb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/OpenPointInTimeResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/OpenPointInTimeResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class OpenPointInTimeResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - - public override Elastic.Clients.Elasticsearch.OpenPointInTimeResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue propShards = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.OpenPointInTimeResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - Shards = propShards.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.OpenPointInTimeResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.OpenPointInTimeResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.OpenPointInTimeResponseConverter))] public sealed partial class OpenPointInTimeResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,9 +39,9 @@ internal OpenPointInTimeResponse(Elastic.Clients.Elasticsearch.Serialization.Jso public #if NET7_0_OR_GREATER - required +required #endif - string Id { get; set; } +string Id { get; set; } /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/PingRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/PingRequest.Converters.g.cs new file mode 100644 index 00000000000..6cbef8e8b96 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/PingRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class PingRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.PingRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.PingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.PingRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/PingRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/PingRequest.g.cs index 20fe0e8050d..1094f4c225b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/PingRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/PingRequest.g.cs @@ -27,42 +27,13 @@ public sealed partial class PingRequestParameters : Elastic.Transport.RequestPar { } -internal sealed partial class PingRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.PingRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.PingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.PingRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Ping the cluster. /// Get information about whether the cluster is running. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.PingRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.PingRequestConverter))] public sealed partial class PingRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/PingResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/PingResponse.Converters.g.cs new file mode 100644 index 00000000000..b6865e287fc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/PingResponse.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class PingResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.PingResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.PingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.PingResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/PingResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/PingResponse.g.cs index aeb7fb227e0..390bee7cbab 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/PingResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/PingResponse.g.cs @@ -23,36 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class PingResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.PingResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.PingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.PingResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.PingResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.PingResponseConverter))] public sealed partial class PingResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/PutScriptRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/PutScriptRequest.Converters.g.cs new file mode 100644 index 00000000000..b62a6ac7695 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/PutScriptRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class PutScriptRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.PutScriptRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.PutScriptRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.PutScriptRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/PutScriptRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/PutScriptRequest.g.cs index 1dfac2cfb8b..1b62eb4bdc3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/PutScriptRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/PutScriptRequest.g.cs @@ -44,52 +44,13 @@ public sealed partial class PutScriptRequestParameters : Elastic.Transport.Reque public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutScriptRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.PutScriptRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.PutScriptRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Script = propScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.PutScriptRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create or update a script or search template. /// Creates or updates a stored script or search template. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.PutScriptRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.PutScriptRequestConverter))] public sealed partial class PutScriptRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/PutScriptResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/PutScriptResponse.Converters.g.cs new file mode 100644 index 00000000000..2f27b9e0c08 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/PutScriptResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class PutScriptResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.PutScriptResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.PutScriptResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.PutScriptResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/PutScriptResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/PutScriptResponse.g.cs index 72b92c4e846..0b8e30976ce 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/PutScriptResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/PutScriptResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class PutScriptResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.PutScriptResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.PutScriptResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.PutScriptResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.PutScriptResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.PutScriptResponseConverter))] public sealed partial class PutScriptResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRuleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRuleRequest.Converters.g.cs new file mode 100644 index 00000000000..016c94c2668 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRuleRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRules.Json; + +public sealed partial class DeleteRuleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.QueryRules.DeleteRuleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryRules.DeleteRuleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.DeleteRuleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRuleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRuleRequest.g.cs index 5d6550abbae..bcdb9da95e9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRuleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRuleRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class DeleteRuleRequestParameters : Elastic.Transport.Requ { } -internal sealed partial class DeleteRuleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.QueryRules.DeleteRuleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryRules.DeleteRuleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.DeleteRuleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete a query rule. @@ -63,7 +34,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// This is a destructive action that is only recoverable by re-adding the same rule with the create or update query rule API. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.DeleteRuleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.Json.DeleteRuleRequestConverter))] public sealed partial class DeleteRuleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRuleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRuleResponse.Converters.g.cs new file mode 100644 index 00000000000..6c545972fb2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRuleResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRules.Json; + +public sealed partial class DeleteRuleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.QueryRules.DeleteRuleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryRules.DeleteRuleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.DeleteRuleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRuleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRuleResponse.g.cs index f081db96de0..ae40cd63661 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRuleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRuleResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryRules; -internal sealed partial class DeleteRuleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.QueryRules.DeleteRuleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryRules.DeleteRuleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.DeleteRuleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.DeleteRuleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.Json.DeleteRuleResponseConverter))] public sealed partial class DeleteRuleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRulesetRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRulesetRequest.Converters.g.cs new file mode 100644 index 00000000000..e84c0804dd3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRulesetRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRules.Json; + +public sealed partial class DeleteRulesetRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.QueryRules.DeleteRulesetRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryRules.DeleteRulesetRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.DeleteRulesetRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRulesetRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRulesetRequest.g.cs index 42d1a43a663..986e86a4b35 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRulesetRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRulesetRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class DeleteRulesetRequestParameters : Elastic.Transport.R { } -internal sealed partial class DeleteRulesetRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.QueryRules.DeleteRulesetRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryRules.DeleteRulesetRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.DeleteRulesetRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete a query ruleset. @@ -63,7 +34,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// This is a destructive action that is not recoverable. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.DeleteRulesetRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.Json.DeleteRulesetRequestConverter))] public sealed partial class DeleteRulesetRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRulesetResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRulesetResponse.Converters.g.cs new file mode 100644 index 00000000000..665cabeea71 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRulesetResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRules.Json; + +public sealed partial class DeleteRulesetResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.QueryRules.DeleteRulesetResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryRules.DeleteRulesetResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.DeleteRulesetResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRulesetResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRulesetResponse.g.cs index 05f20e1a435..55f2b20c295 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRulesetResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/DeleteRulesetResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryRules; -internal sealed partial class DeleteRulesetResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.QueryRules.DeleteRulesetResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryRules.DeleteRulesetResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.DeleteRulesetResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.DeleteRulesetResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.Json.DeleteRulesetResponseConverter))] public sealed partial class DeleteRulesetResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRuleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRuleRequest.Converters.g.cs new file mode 100644 index 00000000000..4b6438beb8e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRuleRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRules.Json; + +public sealed partial class GetRuleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.QueryRules.GetRuleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryRules.GetRuleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.GetRuleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRuleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRuleRequest.g.cs index 8b941cedd83..4bdde7b0c86 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRuleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRuleRequest.g.cs @@ -27,42 +27,13 @@ public sealed partial class GetRuleRequestParameters : Elastic.Transport.Request { } -internal sealed partial class GetRuleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.QueryRules.GetRuleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryRules.GetRuleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.GetRuleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get a query rule. /// Get details about a query rule within a query ruleset. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.GetRuleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.Json.GetRuleRequestConverter))] public sealed partial class GetRuleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRuleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRuleResponse.Converters.g.cs new file mode 100644 index 00000000000..fa8809874b8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRuleResponse.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRules.Json; + +public sealed partial class GetRuleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropActions = System.Text.Json.JsonEncodedText.Encode("actions"); + private static readonly System.Text.Json.JsonEncodedText PropCriteria = System.Text.Json.JsonEncodedText.Encode("criteria"); + private static readonly System.Text.Json.JsonEncodedText PropPriority = System.Text.Json.JsonEncodedText.Encode("priority"); + private static readonly System.Text.Json.JsonEncodedText PropRuleId = System.Text.Json.JsonEncodedText.Encode("rule_id"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.QueryRules.GetRuleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propActions = default; + LocalJsonValue> propCriteria = default; + LocalJsonValue propPriority = default; + LocalJsonValue propRuleId = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propActions.TryReadProperty(ref reader, options, PropActions, null)) + { + continue; + } + + if (propCriteria.TryReadProperty(ref reader, options, PropCriteria, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propPriority.TryReadProperty(ref reader, options, PropPriority, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRuleId.TryReadProperty(ref reader, options, PropRuleId, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryRules.GetRuleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Actions = propActions.Value, + Criteria = propCriteria.Value, + Priority = propPriority.Value, + RuleId = propRuleId.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.GetRuleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropActions, value.Actions, null, null); + writer.WriteProperty(options, PropCriteria, value.Criteria, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPriority, value.Priority, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRuleId, value.RuleId, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRuleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRuleResponse.g.cs index 60f8de8c4d6..1561e4cd8cc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRuleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRuleResponse.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryRules; -internal sealed partial class GetRuleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropActions = System.Text.Json.JsonEncodedText.Encode("actions"); - private static readonly System.Text.Json.JsonEncodedText PropCriteria = System.Text.Json.JsonEncodedText.Encode("criteria"); - private static readonly System.Text.Json.JsonEncodedText PropPriority = System.Text.Json.JsonEncodedText.Encode("priority"); - private static readonly System.Text.Json.JsonEncodedText PropRuleId = System.Text.Json.JsonEncodedText.Encode("rule_id"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.QueryRules.GetRuleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propActions = default; - LocalJsonValue> propCriteria = default; - LocalJsonValue propPriority = default; - LocalJsonValue propRuleId = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propActions.TryReadProperty(ref reader, options, PropActions, null)) - { - continue; - } - - if (propCriteria.TryReadProperty(ref reader, options, PropCriteria, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (propPriority.TryReadProperty(ref reader, options, PropPriority, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRuleId.TryReadProperty(ref reader, options, PropRuleId, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryRules.GetRuleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Actions = propActions.Value, - Criteria = propCriteria.Value, - Priority = propPriority.Value, - RuleId = propRuleId.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.GetRuleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropActions, value.Actions, null, null); - writer.WriteProperty(options, PropCriteria, value.Criteria, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPriority, value.Priority, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRuleId, value.RuleId, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.GetRuleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.Json.GetRuleResponseConverter))] public sealed partial class GetRuleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRulesetRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRulesetRequest.Converters.g.cs new file mode 100644 index 00000000000..19373319299 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRulesetRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRules.Json; + +public sealed partial class GetRulesetRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.QueryRules.GetRulesetRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryRules.GetRulesetRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.GetRulesetRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRulesetRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRulesetRequest.g.cs index 76dd473357e..058fe67f522 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRulesetRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRulesetRequest.g.cs @@ -27,42 +27,13 @@ public sealed partial class GetRulesetRequestParameters : Elastic.Transport.Requ { } -internal sealed partial class GetRulesetRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.QueryRules.GetRulesetRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryRules.GetRulesetRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.GetRulesetRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get a query ruleset. /// Get details about a query ruleset. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.GetRulesetRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.Json.GetRulesetRequestConverter))] public sealed partial class GetRulesetRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRulesetResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRulesetResponse.Converters.g.cs new file mode 100644 index 00000000000..a19aeaf60d8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRulesetResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRules.Json; + +public sealed partial class GetRulesetResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRules = System.Text.Json.JsonEncodedText.Encode("rules"); + private static readonly System.Text.Json.JsonEncodedText PropRulesetId = System.Text.Json.JsonEncodedText.Encode("ruleset_id"); + + public override Elastic.Clients.Elasticsearch.QueryRules.GetRulesetResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propRules = default; + LocalJsonValue propRulesetId = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRules.TryReadProperty(ref reader, options, PropRules, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propRulesetId.TryReadProperty(ref reader, options, PropRulesetId, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryRules.GetRulesetResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Rules = propRules.Value, + RulesetId = propRulesetId.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.GetRulesetResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRules, value.Rules, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRulesetId, value.RulesetId, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRulesetResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRulesetResponse.g.cs index 0b90cd2c3f4..a2983a31006 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRulesetResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/GetRulesetResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryRules; -internal sealed partial class GetRulesetResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRules = System.Text.Json.JsonEncodedText.Encode("rules"); - private static readonly System.Text.Json.JsonEncodedText PropRulesetId = System.Text.Json.JsonEncodedText.Encode("ruleset_id"); - - public override Elastic.Clients.Elasticsearch.QueryRules.GetRulesetResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propRules = default; - LocalJsonValue propRulesetId = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRules.TryReadProperty(ref reader, options, PropRules, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propRulesetId.TryReadProperty(ref reader, options, PropRulesetId, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryRules.GetRulesetResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Rules = propRules.Value, - RulesetId = propRulesetId.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.GetRulesetResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRules, value.Rules, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRulesetId, value.RulesetId, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.GetRulesetResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.Json.GetRulesetResponseConverter))] public sealed partial class GetRulesetResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/ListRulesetsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/ListRulesetsRequest.Converters.g.cs new file mode 100644 index 00000000000..f71b2f384b1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/ListRulesetsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRules.Json; + +public sealed partial class ListRulesetsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.QueryRules.ListRulesetsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryRules.ListRulesetsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.ListRulesetsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/ListRulesetsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/ListRulesetsRequest.g.cs index 63cff0dabb6..662eed6d2b1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/ListRulesetsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/ListRulesetsRequest.g.cs @@ -40,42 +40,13 @@ public sealed partial class ListRulesetsRequestParameters : Elastic.Transport.Re public int? Size { get => Q("size"); set => Q("size", value); } } -internal sealed partial class ListRulesetsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.QueryRules.ListRulesetsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryRules.ListRulesetsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.ListRulesetsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get all query rulesets. /// Get summarized information about the query rulesets. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.ListRulesetsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.Json.ListRulesetsRequestConverter))] public sealed partial class ListRulesetsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/ListRulesetsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/ListRulesetsResponse.Converters.g.cs new file mode 100644 index 00000000000..857fc72432b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/ListRulesetsResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRules.Json; + +public sealed partial class ListRulesetsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropResults = System.Text.Json.JsonEncodedText.Encode("results"); + + public override Elastic.Clients.Elasticsearch.QueryRules.ListRulesetsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propResults = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propResults.TryReadProperty(ref reader, options, PropResults, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryRules.ListRulesetsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Results = propResults.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.ListRulesetsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropResults, value.Results, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/ListRulesetsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/ListRulesetsResponse.g.cs index 48d5abcaa57..eed9610be8c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/ListRulesetsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/ListRulesetsResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryRules; -internal sealed partial class ListRulesetsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropResults = System.Text.Json.JsonEncodedText.Encode("results"); - - public override Elastic.Clients.Elasticsearch.QueryRules.ListRulesetsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propResults = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propResults.TryReadProperty(ref reader, options, PropResults, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryRules.ListRulesetsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Results = propResults.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.ListRulesetsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropResults, value.Results, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.ListRulesetsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.Json.ListRulesetsResponseConverter))] public sealed partial class ListRulesetsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal ListRulesetsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCo public #if NET7_0_OR_GREATER - required +required #endif - long Count { get; set; } +long Count { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Results { get; set; } +System.Collections.Generic.IReadOnlyCollection Results { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRuleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRuleRequest.Converters.g.cs new file mode 100644 index 00000000000..8f10e757847 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRuleRequest.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRules.Json; + +public sealed partial class PutRuleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropActions = System.Text.Json.JsonEncodedText.Encode("actions"); + private static readonly System.Text.Json.JsonEncodedText PropCriteria = System.Text.Json.JsonEncodedText.Encode("criteria"); + private static readonly System.Text.Json.JsonEncodedText PropPriority = System.Text.Json.JsonEncodedText.Encode("priority"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.QueryRules.PutRuleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propActions = default; + LocalJsonValue> propCriteria = default; + LocalJsonValue propPriority = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propActions.TryReadProperty(ref reader, options, PropActions, null)) + { + continue; + } + + if (propCriteria.TryReadProperty(ref reader, options, PropCriteria, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propPriority.TryReadProperty(ref reader, options, PropPriority, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryRules.PutRuleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Actions = propActions.Value, + Criteria = propCriteria.Value, + Priority = propPriority.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.PutRuleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropActions, value.Actions, null, null); + writer.WriteProperty(options, PropCriteria, value.Criteria, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPriority, value.Priority, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRuleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRuleRequest.g.cs index cf36adc3c62..85dd304bbfd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRuleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRuleRequest.g.cs @@ -27,72 +27,6 @@ public sealed partial class PutRuleRequestParameters : Elastic.Transport.Request { } -internal sealed partial class PutRuleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropActions = System.Text.Json.JsonEncodedText.Encode("actions"); - private static readonly System.Text.Json.JsonEncodedText PropCriteria = System.Text.Json.JsonEncodedText.Encode("criteria"); - private static readonly System.Text.Json.JsonEncodedText PropPriority = System.Text.Json.JsonEncodedText.Encode("priority"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.QueryRules.PutRuleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propActions = default; - LocalJsonValue> propCriteria = default; - LocalJsonValue propPriority = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propActions.TryReadProperty(ref reader, options, PropActions, null)) - { - continue; - } - - if (propCriteria.TryReadProperty(ref reader, options, PropCriteria, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (propPriority.TryReadProperty(ref reader, options, PropPriority, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryRules.PutRuleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Actions = propActions.Value, - Criteria = propCriteria.Value, - Priority = propPriority.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.PutRuleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropActions, value.Actions, null, null); - writer.WriteProperty(options, PropCriteria, value.Criteria, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPriority, value.Priority, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create or update a query rule. @@ -105,7 +39,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If multiple matching rules pin more than 100 documents, only the first 100 documents are pinned in the order they are specified in the ruleset. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.PutRuleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.Json.PutRuleRequestConverter))] public sealed partial class PutRuleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRuleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRuleResponse.Converters.g.cs new file mode 100644 index 00000000000..704dcd974ec --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRuleResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRules.Json; + +public sealed partial class PutRuleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropResult = System.Text.Json.JsonEncodedText.Encode("result"); + + public override Elastic.Clients.Elasticsearch.QueryRules.PutRuleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propResult = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propResult.TryReadProperty(ref reader, options, PropResult, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryRules.PutRuleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Result = propResult.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.PutRuleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropResult, value.Result, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRuleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRuleResponse.g.cs index cf9546aa0de..82433b02be5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRuleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRuleResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryRules; -internal sealed partial class PutRuleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropResult = System.Text.Json.JsonEncodedText.Encode("result"); - - public override Elastic.Clients.Elasticsearch.QueryRules.PutRuleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propResult = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propResult.TryReadProperty(ref reader, options, PropResult, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryRules.PutRuleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Result = propResult.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.PutRuleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropResult, value.Result, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.PutRuleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.Json.PutRuleResponseConverter))] public sealed partial class PutRuleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal PutRuleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstru public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Result Result { get; set; } +Elastic.Clients.Elasticsearch.Result Result { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRulesetRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRulesetRequest.Converters.g.cs new file mode 100644 index 00000000000..f11b2e5ea93 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRulesetRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRules.Json; + +public sealed partial class PutRulesetRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRules = System.Text.Json.JsonEncodedText.Encode("rules"); + + public override Elastic.Clients.Elasticsearch.QueryRules.PutRulesetRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propRules = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRules.TryReadProperty(ref reader, options, PropRules, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryRules.PutRulesetRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Rules = propRules.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.PutRulesetRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRules, value.Rules, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRulesetRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRulesetRequest.g.cs index 9a2d2503d84..c824b7e2723 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRulesetRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRulesetRequest.g.cs @@ -27,45 +27,6 @@ public sealed partial class PutRulesetRequestParameters : Elastic.Transport.Requ { } -internal sealed partial class PutRulesetRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRules = System.Text.Json.JsonEncodedText.Encode("rules"); - - public override Elastic.Clients.Elasticsearch.QueryRules.PutRulesetRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propRules = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRules.TryReadProperty(ref reader, options, PropRules, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryRules.PutRulesetRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Rules = propRules.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.PutRulesetRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRules, value.Rules, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// Create or update a query ruleset. @@ -79,7 +40,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If multiple matching rules pin more than 100 documents, only the first 100 documents are pinned in the order they are specified in the ruleset. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.PutRulesetRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.Json.PutRulesetRequestConverter))] public sealed partial class PutRulesetRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRulesetResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRulesetResponse.Converters.g.cs new file mode 100644 index 00000000000..c34bbb5071c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRulesetResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRules.Json; + +public sealed partial class PutRulesetResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropResult = System.Text.Json.JsonEncodedText.Encode("result"); + + public override Elastic.Clients.Elasticsearch.QueryRules.PutRulesetResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propResult = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propResult.TryReadProperty(ref reader, options, PropResult, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryRules.PutRulesetResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Result = propResult.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.PutRulesetResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropResult, value.Result, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRulesetResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRulesetResponse.g.cs index 627d3cbf625..c18533d1f13 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRulesetResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/PutRulesetResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryRules; -internal sealed partial class PutRulesetResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropResult = System.Text.Json.JsonEncodedText.Encode("result"); - - public override Elastic.Clients.Elasticsearch.QueryRules.PutRulesetResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propResult = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propResult.TryReadProperty(ref reader, options, PropResult, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryRules.PutRulesetResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Result = propResult.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.PutRulesetResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropResult, value.Result, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.PutRulesetResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.Json.PutRulesetResponseConverter))] public sealed partial class PutRulesetResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal PutRulesetResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCons public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Result Result { get; set; } +Elastic.Clients.Elasticsearch.Result Result { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/TestRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/TestRequest.Converters.g.cs new file mode 100644 index 00000000000..45a6ac960d1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/TestRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRules.Json; + +public sealed partial class TestRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMatchCriteria = System.Text.Json.JsonEncodedText.Encode("match_criteria"); + + public override Elastic.Clients.Elasticsearch.QueryRules.TestRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propMatchCriteria = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMatchCriteria.TryReadProperty(ref reader, options, PropMatchCriteria, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryRules.TestRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MatchCriteria = propMatchCriteria.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.TestRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMatchCriteria, value.MatchCriteria, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/TestRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/TestRequest.g.cs index 48315ac8576..16d1b44af74 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/TestRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/TestRequest.g.cs @@ -27,52 +27,13 @@ public sealed partial class TestRequestParameters : Elastic.Transport.RequestPar { } -internal sealed partial class TestRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMatchCriteria = System.Text.Json.JsonEncodedText.Encode("match_criteria"); - - public override Elastic.Clients.Elasticsearch.QueryRules.TestRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propMatchCriteria = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMatchCriteria.TryReadProperty(ref reader, options, PropMatchCriteria, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryRules.TestRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MatchCriteria = propMatchCriteria.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.TestRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMatchCriteria, value.MatchCriteria, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - /// /// /// Test a query ruleset. /// Evaluate match criteria against a query ruleset to identify the rules that would match that criteria. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.TestRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.Json.TestRequestConverter))] public sealed partial class TestRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/TestResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/TestResponse.Converters.g.cs new file mode 100644 index 00000000000..28ebbe8cf3d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/TestResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRules.Json; + +public sealed partial class TestResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMatchedRules = System.Text.Json.JsonEncodedText.Encode("matched_rules"); + private static readonly System.Text.Json.JsonEncodedText PropTotalMatchedRules = System.Text.Json.JsonEncodedText.Encode("total_matched_rules"); + + public override Elastic.Clients.Elasticsearch.QueryRules.TestResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propMatchedRules = default; + LocalJsonValue propTotalMatchedRules = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMatchedRules.TryReadProperty(ref reader, options, PropMatchedRules, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propTotalMatchedRules.TryReadProperty(ref reader, options, PropTotalMatchedRules, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryRules.TestResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MatchedRules = propMatchedRules.Value, + TotalMatchedRules = propTotalMatchedRules.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.TestResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMatchedRules, value.MatchedRules, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTotalMatchedRules, value.TotalMatchedRules, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/TestResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/TestResponse.g.cs index a50231afe34..972d119e7f1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/TestResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/QueryRules/TestResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryRules; -internal sealed partial class TestResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMatchedRules = System.Text.Json.JsonEncodedText.Encode("matched_rules"); - private static readonly System.Text.Json.JsonEncodedText PropTotalMatchedRules = System.Text.Json.JsonEncodedText.Encode("total_matched_rules"); - - public override Elastic.Clients.Elasticsearch.QueryRules.TestResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propMatchedRules = default; - LocalJsonValue propTotalMatchedRules = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMatchedRules.TryReadProperty(ref reader, options, PropMatchedRules, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propTotalMatchedRules.TryReadProperty(ref reader, options, PropTotalMatchedRules, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryRules.TestResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MatchedRules = propMatchedRules.Value, - TotalMatchedRules = propTotalMatchedRules.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.TestResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMatchedRules, value.MatchedRules, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTotalMatchedRules, value.TotalMatchedRules, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.TestResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.Json.TestResponseConverter))] public sealed partial class TestResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal TestResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructo public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection MatchedRules { get; set; } +System.Collections.Generic.IReadOnlyCollection MatchedRules { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - int TotalMatchedRules { get; set; } +int TotalMatchedRules { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/RankEvalRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/RankEvalRequest.Converters.g.cs new file mode 100644 index 00000000000..a90ac522fa7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/RankEvalRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class RankEvalRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMetric = System.Text.Json.JsonEncodedText.Encode("metric"); + private static readonly System.Text.Json.JsonEncodedText PropRequests = System.Text.Json.JsonEncodedText.Encode("requests"); + + public override Elastic.Clients.Elasticsearch.RankEvalRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMetric = default; + LocalJsonValue> propRequests = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMetric.TryReadProperty(ref reader, options, PropMetric, null)) + { + continue; + } + + if (propRequests.TryReadProperty(ref reader, options, PropRequests, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.RankEvalRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Metric = propMetric.Value, + Requests = propRequests.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.RankEvalRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMetric, value.Metric, null, null); + writer.WriteProperty(options, PropRequests, value.Requests, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/RankEvalRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/RankEvalRequest.g.cs index fe60f7dec46..bcf2d348ee6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/RankEvalRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/RankEvalRequest.g.cs @@ -54,54 +54,6 @@ public sealed partial class RankEvalRequestParameters : Elastic.Transport.Reques public string? SearchType { get => Q("search_type"); set => Q("search_type", value); } } -internal sealed partial class RankEvalRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMetric = System.Text.Json.JsonEncodedText.Encode("metric"); - private static readonly System.Text.Json.JsonEncodedText PropRequests = System.Text.Json.JsonEncodedText.Encode("requests"); - - public override Elastic.Clients.Elasticsearch.RankEvalRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMetric = default; - LocalJsonValue> propRequests = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMetric.TryReadProperty(ref reader, options, PropMetric, null)) - { - continue; - } - - if (propRequests.TryReadProperty(ref reader, options, PropRequests, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.RankEvalRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Metric = propMetric.Value, - Requests = propRequests.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.RankEvalRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMetric, value.Metric, null, null); - writer.WriteProperty(options, PropRequests, value.Requests, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// Evaluate ranked search results. @@ -110,7 +62,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Evaluate the quality of ranked search results over a set of typical search queries. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.RankEvalRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.RankEvalRequestConverter))] public sealed partial class RankEvalRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/RankEvalResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/RankEvalResponse.Converters.g.cs new file mode 100644 index 00000000000..993f03cfb01 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/RankEvalResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class RankEvalResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); + private static readonly System.Text.Json.JsonEncodedText PropFailures = System.Text.Json.JsonEncodedText.Encode("failures"); + private static readonly System.Text.Json.JsonEncodedText PropMetricScore = System.Text.Json.JsonEncodedText.Encode("metric_score"); + + public override Elastic.Clients.Elasticsearch.RankEvalResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propDetails = default; + LocalJsonValue> propFailures = default; + LocalJsonValue propMetricScore = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDetails.TryReadProperty(ref reader, options, PropDetails, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propFailures.TryReadProperty(ref reader, options, PropFailures, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (propMetricScore.TryReadProperty(ref reader, options, PropMetricScore, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.RankEvalResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Details = propDetails.Value, + Failures = propFailures.Value, + MetricScore = propMetricScore.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.RankEvalResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDetails, value.Details, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropFailures, value.Failures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropMetricScore, value.MetricScore, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/RankEvalResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/RankEvalResponse.g.cs index b8fb351cd3b..e33152a361b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/RankEvalResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/RankEvalResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class RankEvalResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); - private static readonly System.Text.Json.JsonEncodedText PropFailures = System.Text.Json.JsonEncodedText.Encode("failures"); - private static readonly System.Text.Json.JsonEncodedText PropMetricScore = System.Text.Json.JsonEncodedText.Encode("metric_score"); - - public override Elastic.Clients.Elasticsearch.RankEvalResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propDetails = default; - LocalJsonValue> propFailures = default; - LocalJsonValue propMetricScore = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDetails.TryReadProperty(ref reader, options, PropDetails, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propFailures.TryReadProperty(ref reader, options, PropFailures, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (propMetricScore.TryReadProperty(ref reader, options, PropMetricScore, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.RankEvalResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Details = propDetails.Value, - Failures = propFailures.Value, - MetricScore = propMetricScore.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.RankEvalResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDetails, value.Details, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropFailures, value.Failures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropMetricScore, value.MetricScore, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.RankEvalResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.RankEvalResponseConverter))] public sealed partial class RankEvalResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRequest.Converters.g.cs new file mode 100644 index 00000000000..32c8453ac8a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRequest.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ReindexRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropConflicts = System.Text.Json.JsonEncodedText.Encode("conflicts"); + private static readonly System.Text.Json.JsonEncodedText PropDest = System.Text.Json.JsonEncodedText.Encode("dest"); + private static readonly System.Text.Json.JsonEncodedText PropMaxDocs = System.Text.Json.JsonEncodedText.Encode("max_docs"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + + public override Elastic.Clients.Elasticsearch.ReindexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propConflicts = default; + LocalJsonValue propDest = default; + LocalJsonValue propMaxDocs = default; + LocalJsonValue propScript = default; + LocalJsonValue propSize = default; + LocalJsonValue propSource = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propConflicts.TryReadProperty(ref reader, options, PropConflicts, static Elastic.Clients.Elasticsearch.Conflicts? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDest.TryReadProperty(ref reader, options, PropDest, null)) + { + continue; + } + + if (propMaxDocs.TryReadProperty(ref reader, options, PropMaxDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ReindexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Conflicts = propConflicts.Value, + Dest = propDest.Value, + MaxDocs = propMaxDocs.Value, + Script = propScript.Value, + Size = propSize.Value, + Source = propSource.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ReindexRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropConflicts, value.Conflicts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Conflicts? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDest, value.Dest, null, null); + writer.WriteProperty(options, PropMaxDocs, value.MaxDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRequest.g.cs index 7c404b56aa0..252ecd7e9a0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRequest.g.cs @@ -100,90 +100,6 @@ public sealed partial class ReindexRequestParameters : Elastic.Transport.Request public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } } -internal sealed partial class ReindexRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropConflicts = System.Text.Json.JsonEncodedText.Encode("conflicts"); - private static readonly System.Text.Json.JsonEncodedText PropDest = System.Text.Json.JsonEncodedText.Encode("dest"); - private static readonly System.Text.Json.JsonEncodedText PropMaxDocs = System.Text.Json.JsonEncodedText.Encode("max_docs"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - - public override Elastic.Clients.Elasticsearch.ReindexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propConflicts = default; - LocalJsonValue propDest = default; - LocalJsonValue propMaxDocs = default; - LocalJsonValue propScript = default; - LocalJsonValue propSize = default; - LocalJsonValue propSource = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propConflicts.TryReadProperty(ref reader, options, PropConflicts, static Elastic.Clients.Elasticsearch.Conflicts? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDest.TryReadProperty(ref reader, options, PropDest, null)) - { - continue; - } - - if (propMaxDocs.TryReadProperty(ref reader, options, PropMaxDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ReindexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Conflicts = propConflicts.Value, - Dest = propDest.Value, - MaxDocs = propMaxDocs.Value, - Script = propScript.Value, - Size = propSize.Value, - Source = propSource.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ReindexRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropConflicts, value.Conflicts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Conflicts? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDest, value.Dest, null, null); - writer.WriteProperty(options, PropMaxDocs, value.MaxDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Reindex documents. @@ -274,7 +190,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Refer to the linked documentation for examples of how to reindex documents. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ReindexRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ReindexRequestConverter))] public sealed partial class ReindexRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexResponse.Converters.g.cs new file mode 100644 index 00000000000..b52d539c650 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexResponse.Converters.g.cs @@ -0,0 +1,198 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ReindexResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBatches = System.Text.Json.JsonEncodedText.Encode("batches"); + private static readonly System.Text.Json.JsonEncodedText PropCreated = System.Text.Json.JsonEncodedText.Encode("created"); + private static readonly System.Text.Json.JsonEncodedText PropDeleted = System.Text.Json.JsonEncodedText.Encode("deleted"); + private static readonly System.Text.Json.JsonEncodedText PropFailures = System.Text.Json.JsonEncodedText.Encode("failures"); + private static readonly System.Text.Json.JsonEncodedText PropNoops = System.Text.Json.JsonEncodedText.Encode("noops"); + private static readonly System.Text.Json.JsonEncodedText PropRequestsPerSecond = System.Text.Json.JsonEncodedText.Encode("requests_per_second"); + private static readonly System.Text.Json.JsonEncodedText PropRetries = System.Text.Json.JsonEncodedText.Encode("retries"); + private static readonly System.Text.Json.JsonEncodedText PropSliceId = System.Text.Json.JsonEncodedText.Encode("slice_id"); + private static readonly System.Text.Json.JsonEncodedText PropTask = System.Text.Json.JsonEncodedText.Encode("task"); + private static readonly System.Text.Json.JsonEncodedText PropThrottledMillis = System.Text.Json.JsonEncodedText.Encode("throttled_millis"); + private static readonly System.Text.Json.JsonEncodedText PropThrottledUntilMillis = System.Text.Json.JsonEncodedText.Encode("throttled_until_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); + private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + private static readonly System.Text.Json.JsonEncodedText PropUpdated = System.Text.Json.JsonEncodedText.Encode("updated"); + private static readonly System.Text.Json.JsonEncodedText PropVersionConflicts = System.Text.Json.JsonEncodedText.Encode("version_conflicts"); + + public override Elastic.Clients.Elasticsearch.ReindexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBatches = default; + LocalJsonValue propCreated = default; + LocalJsonValue propDeleted = default; + LocalJsonValue?> propFailures = default; + LocalJsonValue propNoops = default; + LocalJsonValue propRequestsPerSecond = default; + LocalJsonValue propRetries = default; + LocalJsonValue propSliceId = default; + LocalJsonValue propTask = default; + LocalJsonValue propThrottledMillis = default; + LocalJsonValue propThrottledUntilMillis = default; + LocalJsonValue propTimedOut = default; + LocalJsonValue propTook = default; + LocalJsonValue propTotal = default; + LocalJsonValue propUpdated = default; + LocalJsonValue propVersionConflicts = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBatches.TryReadProperty(ref reader, options, PropBatches, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCreated.TryReadProperty(ref reader, options, PropCreated, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDeleted.TryReadProperty(ref reader, options, PropDeleted, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFailures.TryReadProperty(ref reader, options, PropFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propNoops.TryReadProperty(ref reader, options, PropNoops, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRequestsPerSecond.TryReadProperty(ref reader, options, PropRequestsPerSecond, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRetries.TryReadProperty(ref reader, options, PropRetries, null)) + { + continue; + } + + if (propSliceId.TryReadProperty(ref reader, options, PropSliceId, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTask.TryReadProperty(ref reader, options, PropTask, null)) + { + continue; + } + + if (propThrottledMillis.TryReadProperty(ref reader, options, PropThrottledMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propThrottledUntilMillis.TryReadProperty(ref reader, options, PropThrottledUntilMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTook.TryReadProperty(ref reader, options, PropTook, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propUpdated.TryReadProperty(ref reader, options, PropUpdated, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propVersionConflicts.TryReadProperty(ref reader, options, PropVersionConflicts, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ReindexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Batches = propBatches.Value, + Created = propCreated.Value, + Deleted = propDeleted.Value, + Failures = propFailures.Value, + Noops = propNoops.Value, + RequestsPerSecond = propRequestsPerSecond.Value, + Retries = propRetries.Value, + SliceId = propSliceId.Value, + Task = propTask.Value, + ThrottledMillis = propThrottledMillis.Value, + ThrottledUntilMillis = propThrottledUntilMillis.Value, + TimedOut = propTimedOut.Value, + Took = propTook.Value, + Total = propTotal.Value, + Updated = propUpdated.Value, + VersionConflicts = propVersionConflicts.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ReindexResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBatches, value.Batches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCreated, value.Created, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDeleted, value.Deleted, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFailures, value.Failures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropNoops, value.Noops, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRequestsPerSecond, value.RequestsPerSecond, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRetries, value.Retries, null, null); + writer.WriteProperty(options, PropSliceId, value.SliceId, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTask, value.Task, null, null); + writer.WriteProperty(options, PropThrottledMillis, value.ThrottledMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropThrottledUntilMillis, value.ThrottledUntilMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTook, value.Took, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTotal, value.Total, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropUpdated, value.Updated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVersionConflicts, value.VersionConflicts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexResponse.g.cs index 9d122ee93e8..cbbb6fc9135 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexResponse.g.cs @@ -23,181 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class ReindexResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBatches = System.Text.Json.JsonEncodedText.Encode("batches"); - private static readonly System.Text.Json.JsonEncodedText PropCreated = System.Text.Json.JsonEncodedText.Encode("created"); - private static readonly System.Text.Json.JsonEncodedText PropDeleted = System.Text.Json.JsonEncodedText.Encode("deleted"); - private static readonly System.Text.Json.JsonEncodedText PropFailures = System.Text.Json.JsonEncodedText.Encode("failures"); - private static readonly System.Text.Json.JsonEncodedText PropNoops = System.Text.Json.JsonEncodedText.Encode("noops"); - private static readonly System.Text.Json.JsonEncodedText PropRequestsPerSecond = System.Text.Json.JsonEncodedText.Encode("requests_per_second"); - private static readonly System.Text.Json.JsonEncodedText PropRetries = System.Text.Json.JsonEncodedText.Encode("retries"); - private static readonly System.Text.Json.JsonEncodedText PropSliceId = System.Text.Json.JsonEncodedText.Encode("slice_id"); - private static readonly System.Text.Json.JsonEncodedText PropTask = System.Text.Json.JsonEncodedText.Encode("task"); - private static readonly System.Text.Json.JsonEncodedText PropThrottledMillis = System.Text.Json.JsonEncodedText.Encode("throttled_millis"); - private static readonly System.Text.Json.JsonEncodedText PropThrottledUntilMillis = System.Text.Json.JsonEncodedText.Encode("throttled_until_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); - private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - private static readonly System.Text.Json.JsonEncodedText PropUpdated = System.Text.Json.JsonEncodedText.Encode("updated"); - private static readonly System.Text.Json.JsonEncodedText PropVersionConflicts = System.Text.Json.JsonEncodedText.Encode("version_conflicts"); - - public override Elastic.Clients.Elasticsearch.ReindexResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBatches = default; - LocalJsonValue propCreated = default; - LocalJsonValue propDeleted = default; - LocalJsonValue?> propFailures = default; - LocalJsonValue propNoops = default; - LocalJsonValue propRequestsPerSecond = default; - LocalJsonValue propRetries = default; - LocalJsonValue propSliceId = default; - LocalJsonValue propTask = default; - LocalJsonValue propThrottledMillis = default; - LocalJsonValue propThrottledUntilMillis = default; - LocalJsonValue propTimedOut = default; - LocalJsonValue propTook = default; - LocalJsonValue propTotal = default; - LocalJsonValue propUpdated = default; - LocalJsonValue propVersionConflicts = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBatches.TryReadProperty(ref reader, options, PropBatches, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCreated.TryReadProperty(ref reader, options, PropCreated, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDeleted.TryReadProperty(ref reader, options, PropDeleted, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFailures.TryReadProperty(ref reader, options, PropFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propNoops.TryReadProperty(ref reader, options, PropNoops, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRequestsPerSecond.TryReadProperty(ref reader, options, PropRequestsPerSecond, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRetries.TryReadProperty(ref reader, options, PropRetries, null)) - { - continue; - } - - if (propSliceId.TryReadProperty(ref reader, options, PropSliceId, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTask.TryReadProperty(ref reader, options, PropTask, null)) - { - continue; - } - - if (propThrottledMillis.TryReadProperty(ref reader, options, PropThrottledMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propThrottledUntilMillis.TryReadProperty(ref reader, options, PropThrottledUntilMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTook.TryReadProperty(ref reader, options, PropTook, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propUpdated.TryReadProperty(ref reader, options, PropUpdated, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propVersionConflicts.TryReadProperty(ref reader, options, PropVersionConflicts, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ReindexResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Batches = propBatches.Value, - Created = propCreated.Value, - Deleted = propDeleted.Value, - Failures = propFailures.Value, - Noops = propNoops.Value, - RequestsPerSecond = propRequestsPerSecond.Value, - Retries = propRetries.Value, - SliceId = propSliceId.Value, - Task = propTask.Value, - ThrottledMillis = propThrottledMillis.Value, - ThrottledUntilMillis = propThrottledUntilMillis.Value, - TimedOut = propTimedOut.Value, - Took = propTook.Value, - Total = propTotal.Value, - Updated = propUpdated.Value, - VersionConflicts = propVersionConflicts.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ReindexResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBatches, value.Batches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCreated, value.Created, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDeleted, value.Deleted, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFailures, value.Failures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropNoops, value.Noops, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRequestsPerSecond, value.RequestsPerSecond, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRetries, value.Retries, null, null); - writer.WriteProperty(options, PropSliceId, value.SliceId, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTask, value.Task, null, null); - writer.WriteProperty(options, PropThrottledMillis, value.ThrottledMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropThrottledUntilMillis, value.ThrottledUntilMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTook, value.Took, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTotal, value.Total, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropUpdated, value.Updated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropVersionConflicts, value.VersionConflicts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ReindexResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ReindexResponseConverter))] public sealed partial class ReindexResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleRequest.Converters.g.cs new file mode 100644 index 00000000000..0cdba8033c1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ReindexRethrottleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.ReindexRethrottleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ReindexRethrottleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ReindexRethrottleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleRequest.g.cs index 8abc86fe847..21947737832 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleRequest.g.cs @@ -34,35 +34,6 @@ public sealed partial class ReindexRethrottleRequestParameters : Elastic.Transpo public float? RequestsPerSecond { get => Q("requests_per_second"); set => Q("requests_per_second", value); } } -internal sealed partial class ReindexRethrottleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.ReindexRethrottleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ReindexRethrottleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ReindexRethrottleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Throttle a reindex operation. @@ -80,7 +51,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// This behavior prevents scroll timeouts. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ReindexRethrottleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ReindexRethrottleRequestConverter))] public sealed partial class ReindexRethrottleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleResponse.Converters.g.cs new file mode 100644 index 00000000000..9f64564dca4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ReindexRethrottleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); + + public override Elastic.Clients.Elasticsearch.ReindexRethrottleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propNodes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ReindexRethrottleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Nodes = propNodes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ReindexRethrottleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleResponse.g.cs index 191a852ccb1..7f601fb0242 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRethrottleResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class ReindexRethrottleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); - - public override Elastic.Clients.Elasticsearch.ReindexRethrottleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propNodes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ReindexRethrottleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Nodes = propNodes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ReindexRethrottleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ReindexRethrottleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ReindexRethrottleResponseConverter))] public sealed partial class ReindexRethrottleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal ReindexRethrottleResponse(Elastic.Clients.Elasticsearch.Serialization.J public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } +System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/RenderSearchTemplateRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/RenderSearchTemplateRequest.Converters.g.cs new file mode 100644 index 00000000000..d65d6282e87 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/RenderSearchTemplateRequest.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class RenderSearchTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFile = System.Text.Json.JsonEncodedText.Encode("file"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + + public override Elastic.Clients.Elasticsearch.RenderSearchTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFile = default; + LocalJsonValue propId = default; + LocalJsonValue?> propParams = default; + LocalJsonValue propSource = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFile.TryReadProperty(ref reader, options, PropFile, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.RenderSearchTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + File = propFile.Value, + Id = propId.Value, + Params = propParams.Value, + Source = propSource.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.RenderSearchTemplateRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFile, value.File, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/RenderSearchTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/RenderSearchTemplateRequest.g.cs index 79af34cb864..7b22cf0a44b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/RenderSearchTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/RenderSearchTemplateRequest.g.cs @@ -27,72 +27,6 @@ public sealed partial class RenderSearchTemplateRequestParameters : Elastic.Tran { } -internal sealed partial class RenderSearchTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFile = System.Text.Json.JsonEncodedText.Encode("file"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - - public override Elastic.Clients.Elasticsearch.RenderSearchTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFile = default; - LocalJsonValue propId = default; - LocalJsonValue?> propParams = default; - LocalJsonValue propSource = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFile.TryReadProperty(ref reader, options, PropFile, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.RenderSearchTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - File = propFile.Value, - Id = propId.Value, - Params = propParams.Value, - Source = propSource.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.RenderSearchTemplateRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFile, value.File, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Render a search template. @@ -101,7 +35,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Render a search template as a search request body. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.RenderSearchTemplateRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.RenderSearchTemplateRequestConverter))] public sealed partial class RenderSearchTemplateRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/RenderSearchTemplateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/RenderSearchTemplateResponse.Converters.g.cs new file mode 100644 index 00000000000..1215558281b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/RenderSearchTemplateResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class RenderSearchTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropTemplateOutput = System.Text.Json.JsonEncodedText.Encode("template_output"); + + public override Elastic.Clients.Elasticsearch.RenderSearchTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propTemplateOutput = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propTemplateOutput.TryReadProperty(ref reader, options, PropTemplateOutput, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.RenderSearchTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + TemplateOutput = propTemplateOutput.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.RenderSearchTemplateResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropTemplateOutput, value.TemplateOutput, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/RenderSearchTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/RenderSearchTemplateResponse.g.cs index c56cfc90485..5882f135efb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/RenderSearchTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/RenderSearchTemplateResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class RenderSearchTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropTemplateOutput = System.Text.Json.JsonEncodedText.Encode("template_output"); - - public override Elastic.Clients.Elasticsearch.RenderSearchTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propTemplateOutput = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propTemplateOutput.TryReadProperty(ref reader, options, PropTemplateOutput, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.RenderSearchTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - TemplateOutput = propTemplateOutput.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.RenderSearchTemplateResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropTemplateOutput, value.TemplateOutput, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.RenderSearchTemplateResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.RenderSearchTemplateResponseConverter))] public sealed partial class RenderSearchTemplateResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal RenderSearchTemplateResponse(Elastic.Clients.Elasticsearch.Serializatio public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary TemplateOutput { get; set; } +System.Collections.Generic.IReadOnlyDictionary TemplateOutput { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/DeleteJobRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/DeleteJobRequest.Converters.g.cs new file mode 100644 index 00000000000..e3eec5b1a87 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/DeleteJobRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class DeleteJobRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Rollup.DeleteJobRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.DeleteJobRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.DeleteJobRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/DeleteJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/DeleteJobRequest.g.cs index dbc668dac78..a4e4468d6c4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/DeleteJobRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/DeleteJobRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class DeleteJobRequestParameters : Elastic.Transport.Reque { } -internal sealed partial class DeleteJobRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Rollup.DeleteJobRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.DeleteJobRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.DeleteJobRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete a rollup job. @@ -85,7 +56,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// } /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.DeleteJobRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.DeleteJobRequestConverter))] public sealed partial class DeleteJobRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/DeleteJobResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/DeleteJobResponse.Converters.g.cs new file mode 100644 index 00000000000..3c8e1e9dcc3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/DeleteJobResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class DeleteJobResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + private static readonly System.Text.Json.JsonEncodedText PropTaskFailures = System.Text.Json.JsonEncodedText.Encode("task_failures"); + + public override Elastic.Clients.Elasticsearch.Rollup.DeleteJobResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + LocalJsonValue?> propTaskFailures = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (propTaskFailures.TryReadProperty(ref reader, options, PropTaskFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.DeleteJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value, + TaskFailures = propTaskFailures.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.DeleteJobResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteProperty(options, PropTaskFailures, value.TaskFailures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/DeleteJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/DeleteJobResponse.g.cs index 92eabdd06f5..94c6c03e6a7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/DeleteJobResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/DeleteJobResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Rollup; -internal sealed partial class DeleteJobResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - private static readonly System.Text.Json.JsonEncodedText PropTaskFailures = System.Text.Json.JsonEncodedText.Encode("task_failures"); - - public override Elastic.Clients.Elasticsearch.Rollup.DeleteJobResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - LocalJsonValue?> propTaskFailures = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (propTaskFailures.TryReadProperty(ref reader, options, PropTaskFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.DeleteJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value, - TaskFailures = propTaskFailures.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.DeleteJobResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteProperty(options, PropTaskFailures, value.TaskFailures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.DeleteJobResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.DeleteJobResponseConverter))] public sealed partial class DeleteJobResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,8 +39,8 @@ internal DeleteJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConst public #if NET7_0_OR_GREATER - required +required #endif - bool Acknowledged { get; set; } +bool Acknowledged { get; set; } public System.Collections.Generic.IReadOnlyCollection? TaskFailures { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetJobsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetJobsRequest.Converters.g.cs new file mode 100644 index 00000000000..ad4a21e00a2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetJobsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class GetJobsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Rollup.GetJobsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.GetJobsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.GetJobsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetJobsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetJobsRequest.g.cs index b11c4618365..531a517478d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetJobsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetJobsRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class GetJobsRequestParameters : Elastic.Transport.Request { } -internal sealed partial class GetJobsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Rollup.GetJobsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.GetJobsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.GetJobsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get rollup job information. @@ -67,7 +38,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// For details about a historical rollup job, the rollup capabilities API may be more useful. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.GetJobsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.GetJobsRequestConverter))] public sealed partial class GetJobsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetJobsRequest(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetJobsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetJobsResponse.Converters.g.cs new file mode 100644 index 00000000000..e2e04f13cc4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetJobsResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class GetJobsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropJobs = System.Text.Json.JsonEncodedText.Encode("jobs"); + + public override Elastic.Clients.Elasticsearch.Rollup.GetJobsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propJobs = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propJobs.TryReadProperty(ref reader, options, PropJobs, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.GetJobsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Jobs = propJobs.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.GetJobsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropJobs, value.Jobs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetJobsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetJobsResponse.g.cs index 75f70561780..74c4b4aa331 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetJobsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetJobsResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Rollup; -internal sealed partial class GetJobsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropJobs = System.Text.Json.JsonEncodedText.Encode("jobs"); - - public override Elastic.Clients.Elasticsearch.Rollup.GetJobsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propJobs = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propJobs.TryReadProperty(ref reader, options, PropJobs, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.GetJobsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Jobs = propJobs.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.GetJobsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropJobs, value.Jobs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.GetJobsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.GetJobsResponseConverter))] public sealed partial class GetJobsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal GetJobsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstru public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Jobs { get; set; } +System.Collections.Generic.IReadOnlyCollection Jobs { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupCapsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupCapsRequest.Converters.g.cs new file mode 100644 index 00000000000..b87ac14b852 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupCapsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class GetRollupCapsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Rollup.GetRollupCapsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.GetRollupCapsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.GetRollupCapsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupCapsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupCapsRequest.g.cs index 7a7a58d7bbd..81ab495c36f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupCapsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupCapsRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class GetRollupCapsRequestParameters : Elastic.Transport.R { } -internal sealed partial class GetRollupCapsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Rollup.GetRollupCapsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.GetRollupCapsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.GetRollupCapsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get the rollup job capabilities. @@ -79,7 +50,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.GetRollupCapsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.GetRollupCapsRequestConverter))] public sealed partial class GetRollupCapsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetRollupCapsRequest(Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Optional("id", id)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupCapsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupCapsResponse.Converters.g.cs new file mode 100644 index 00000000000..0af2ba4fbc5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupCapsResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class GetRollupCapsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Rollup.GetRollupCapsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Rollup.GetRollupCapsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Capabilities = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.GetRollupCapsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Capabilities, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupCapsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupCapsResponse.g.cs index 5bae50396f4..9edcea193d0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupCapsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupCapsResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Rollup; -internal sealed partial class GetRollupCapsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Rollup.GetRollupCapsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Rollup.GetRollupCapsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Capabilities = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.GetRollupCapsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Capabilities, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.GetRollupCapsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.GetRollupCapsResponseConverter))] public sealed partial class GetRollupCapsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupIndexCapsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupIndexCapsRequest.Converters.g.cs new file mode 100644 index 00000000000..05df10fe043 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupIndexCapsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class GetRollupIndexCapsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Rollup.GetRollupIndexCapsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.GetRollupIndexCapsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.GetRollupIndexCapsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupIndexCapsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupIndexCapsRequest.g.cs index a4c30f191db..301fe102abb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupIndexCapsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupIndexCapsRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class GetRollupIndexCapsRequestParameters : Elastic.Transp { } -internal sealed partial class GetRollupIndexCapsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Rollup.GetRollupIndexCapsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.GetRollupIndexCapsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.GetRollupIndexCapsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get the rollup index capabilities. @@ -75,7 +46,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.GetRollupIndexCapsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.GetRollupIndexCapsRequestConverter))] public sealed partial class GetRollupIndexCapsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupIndexCapsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupIndexCapsResponse.Converters.g.cs new file mode 100644 index 00000000000..b806add448d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupIndexCapsResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class GetRollupIndexCapsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Rollup.GetRollupIndexCapsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Rollup.GetRollupIndexCapsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Capabilities = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.GetRollupIndexCapsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Capabilities, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupIndexCapsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupIndexCapsResponse.g.cs index 3f5336c51c8..4f2651434ba 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupIndexCapsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/GetRollupIndexCapsResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Rollup; -internal sealed partial class GetRollupIndexCapsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Rollup.GetRollupIndexCapsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Rollup.GetRollupIndexCapsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Capabilities = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.GetRollupIndexCapsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Capabilities, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.GetRollupIndexCapsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.GetRollupIndexCapsResponseConverter))] public sealed partial class GetRollupIndexCapsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/PutJobRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/PutJobRequest.Converters.g.cs new file mode 100644 index 00000000000..a1907b5c817 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/PutJobRequest.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class PutJobRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCron = System.Text.Json.JsonEncodedText.Encode("cron"); + private static readonly System.Text.Json.JsonEncodedText PropGroups = System.Text.Json.JsonEncodedText.Encode("groups"); + private static readonly System.Text.Json.JsonEncodedText PropHeaders = System.Text.Json.JsonEncodedText.Encode("headers"); + private static readonly System.Text.Json.JsonEncodedText PropIndexPattern = System.Text.Json.JsonEncodedText.Encode("index_pattern"); + private static readonly System.Text.Json.JsonEncodedText PropMetrics = System.Text.Json.JsonEncodedText.Encode("metrics"); + private static readonly System.Text.Json.JsonEncodedText PropPageSize = System.Text.Json.JsonEncodedText.Encode("page_size"); + private static readonly System.Text.Json.JsonEncodedText PropRollupIndex = System.Text.Json.JsonEncodedText.Encode("rollup_index"); + private static readonly System.Text.Json.JsonEncodedText PropTimeout = System.Text.Json.JsonEncodedText.Encode("timeout"); + + public override Elastic.Clients.Elasticsearch.Rollup.PutJobRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCron = default; + LocalJsonValue propGroups = default; + LocalJsonValue>?> propHeaders = default; + LocalJsonValue propIndexPattern = default; + LocalJsonValue?> propMetrics = default; + LocalJsonValue propPageSize = default; + LocalJsonValue propRollupIndex = default; + LocalJsonValue propTimeout = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCron.TryReadProperty(ref reader, options, PropCron, null)) + { + continue; + } + + if (propGroups.TryReadProperty(ref reader, options, PropGroups, null)) + { + continue; + } + + if (propHeaders.TryReadProperty(ref reader, options, PropHeaders, static System.Collections.Generic.IDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!))) + { + continue; + } + + if (propIndexPattern.TryReadProperty(ref reader, options, PropIndexPattern, null)) + { + continue; + } + + if (propMetrics.TryReadProperty(ref reader, options, PropMetrics, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propPageSize.TryReadProperty(ref reader, options, PropPageSize, null)) + { + continue; + } + + if (propRollupIndex.TryReadProperty(ref reader, options, PropRollupIndex, null)) + { + continue; + } + + if (propTimeout.TryReadProperty(ref reader, options, PropTimeout, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.PutJobRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Cron = propCron.Value, + Groups = propGroups.Value, + Headers = propHeaders.Value, + IndexPattern = propIndexPattern.Value, + Metrics = propMetrics.Value, + PageSize = propPageSize.Value, + RollupIndex = propRollupIndex.Value, + Timeout = propTimeout.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.PutJobRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCron, value.Cron, null, null); + writer.WriteProperty(options, PropGroups, value.Groups, null, null); + writer.WriteProperty(options, PropHeaders, value.Headers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); + writer.WriteProperty(options, PropIndexPattern, value.IndexPattern, null, null); + writer.WriteProperty(options, PropMetrics, value.Metrics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPageSize, value.PageSize, null, null); + writer.WriteProperty(options, PropRollupIndex, value.RollupIndex, null, null); + writer.WriteProperty(options, PropTimeout, value.Timeout, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/PutJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/PutJobRequest.g.cs index 0291901e458..6e37d5f50e1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/PutJobRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/PutJobRequest.g.cs @@ -27,108 +27,6 @@ public sealed partial class PutJobRequestParameters : Elastic.Transport.RequestP { } -internal sealed partial class PutJobRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCron = System.Text.Json.JsonEncodedText.Encode("cron"); - private static readonly System.Text.Json.JsonEncodedText PropGroups = System.Text.Json.JsonEncodedText.Encode("groups"); - private static readonly System.Text.Json.JsonEncodedText PropHeaders = System.Text.Json.JsonEncodedText.Encode("headers"); - private static readonly System.Text.Json.JsonEncodedText PropIndexPattern = System.Text.Json.JsonEncodedText.Encode("index_pattern"); - private static readonly System.Text.Json.JsonEncodedText PropMetrics = System.Text.Json.JsonEncodedText.Encode("metrics"); - private static readonly System.Text.Json.JsonEncodedText PropPageSize = System.Text.Json.JsonEncodedText.Encode("page_size"); - private static readonly System.Text.Json.JsonEncodedText PropRollupIndex = System.Text.Json.JsonEncodedText.Encode("rollup_index"); - private static readonly System.Text.Json.JsonEncodedText PropTimeout = System.Text.Json.JsonEncodedText.Encode("timeout"); - - public override Elastic.Clients.Elasticsearch.Rollup.PutJobRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCron = default; - LocalJsonValue propGroups = default; - LocalJsonValue>?> propHeaders = default; - LocalJsonValue propIndexPattern = default; - LocalJsonValue?> propMetrics = default; - LocalJsonValue propPageSize = default; - LocalJsonValue propRollupIndex = default; - LocalJsonValue propTimeout = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCron.TryReadProperty(ref reader, options, PropCron, null)) - { - continue; - } - - if (propGroups.TryReadProperty(ref reader, options, PropGroups, null)) - { - continue; - } - - if (propHeaders.TryReadProperty(ref reader, options, PropHeaders, static System.Collections.Generic.IDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!))) - { - continue; - } - - if (propIndexPattern.TryReadProperty(ref reader, options, PropIndexPattern, null)) - { - continue; - } - - if (propMetrics.TryReadProperty(ref reader, options, PropMetrics, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propPageSize.TryReadProperty(ref reader, options, PropPageSize, null)) - { - continue; - } - - if (propRollupIndex.TryReadProperty(ref reader, options, PropRollupIndex, null)) - { - continue; - } - - if (propTimeout.TryReadProperty(ref reader, options, PropTimeout, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.PutJobRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Cron = propCron.Value, - Groups = propGroups.Value, - Headers = propHeaders.Value, - IndexPattern = propIndexPattern.Value, - Metrics = propMetrics.Value, - PageSize = propPageSize.Value, - RollupIndex = propRollupIndex.Value, - Timeout = propTimeout.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.PutJobRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCron, value.Cron, null, null); - writer.WriteProperty(options, PropGroups, value.Groups, null, null); - writer.WriteProperty(options, PropHeaders, value.Headers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); - writer.WriteProperty(options, PropIndexPattern, value.IndexPattern, null, null); - writer.WriteProperty(options, PropMetrics, value.Metrics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPageSize, value.PageSize, null, null); - writer.WriteProperty(options, PropRollupIndex, value.RollupIndex, null, null); - writer.WriteProperty(options, PropTimeout, value.Timeout, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create a rollup job. @@ -146,7 +44,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Jobs are created in a STOPPED state. You can start them with the start rollup jobs API. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.PutJobRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.PutJobRequestConverter))] public sealed partial class PutJobRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/PutJobResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/PutJobResponse.Converters.g.cs new file mode 100644 index 00000000000..eba856ae938 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/PutJobResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class PutJobResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.Rollup.PutJobResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.PutJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.PutJobResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/PutJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/PutJobResponse.g.cs index b092088cab0..c5d4b8ae1a7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/PutJobResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/PutJobResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Rollup; -internal sealed partial class PutJobResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.Rollup.PutJobResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.PutJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.PutJobResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.PutJobResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.PutJobResponseConverter))] public sealed partial class PutJobResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/RollupSearchRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/RollupSearchRequest.Converters.g.cs new file mode 100644 index 00000000000..f87758ef682 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/RollupSearchRequest.Converters.g.cs @@ -0,0 +1,82 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class RollupSearchRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + 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 PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + + public override Elastic.Clients.Elasticsearch.Rollup.RollupSearchRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAggregations = default; + LocalJsonValue propQuery = default; + LocalJsonValue propSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)) || propAggregations.TryReadProperty(ref reader, options, PropAggregations1, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.RollupSearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = propAggregations.Value, + Query = propQuery.Value, + Size = propSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.RollupSearchRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/RollupSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/RollupSearchRequest.g.cs index 305b38b57f6..b4789387cda 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/RollupSearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/RollupSearchRequest.g.cs @@ -40,64 +40,6 @@ public sealed partial class RollupSearchRequestParameters : Elastic.Transport.Re public bool? TypedKeys { get => Q("typed_keys"); set => Q("typed_keys", value); } } -internal sealed partial class RollupSearchRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - 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 PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - - public override Elastic.Clients.Elasticsearch.Rollup.RollupSearchRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAggregations = default; - LocalJsonValue propQuery = default; - LocalJsonValue propSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)) || propAggregations.TryReadProperty(ref reader, options, PropAggregations1, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.RollupSearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = propAggregations.Value, - Query = propQuery.Value, - Size = propSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.RollupSearchRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Search rolled-up data. @@ -116,7 +58,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// For more detailed examples of using the rollup search API, including querying rolled-up data only or combining rolled-up and live data, refer to the External documentation. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.RollupSearchRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.RollupSearchRequestConverter))] public partial class RollupSearchRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/RollupSearchResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/RollupSearchResponse.Converters.g.cs new file mode 100644 index 00000000000..fb5303818a4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/RollupSearchResponse.Converters.g.cs @@ -0,0 +1,124 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class RollupSearchResponseConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); + private static readonly System.Text.Json.JsonEncodedText PropHits = System.Text.Json.JsonEncodedText.Encode("hits"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + private static readonly System.Text.Json.JsonEncodedText PropTerminatedEarly = System.Text.Json.JsonEncodedText.Encode("terminated_early"); + private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); + private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); + + public override Elastic.Clients.Elasticsearch.Rollup.RollupSearchResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAggregations = default; + LocalJsonValue> propHits = default; + LocalJsonValue propShards = default; + LocalJsonValue propTerminatedEarly = default; + LocalJsonValue propTimedOut = default; + LocalJsonValue propTook = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, null)) + { + continue; + } + + if (propHits.TryReadProperty(ref reader, options, PropHits, null)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (propTerminatedEarly.TryReadProperty(ref reader, options, PropTerminatedEarly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, null)) + { + continue; + } + + if (propTook.TryReadProperty(ref reader, options, PropTook, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.RollupSearchResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = propAggregations.Value, + Hits = propHits.Value, + Shards = propShards.Value, + TerminatedEarly = propTerminatedEarly.Value, + TimedOut = propTimedOut.Value, + Took = propTook.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.RollupSearchResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregations, value.Aggregations, null, null); + writer.WriteProperty(options, PropHits, value.Hits, null, null); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteProperty(options, PropTerminatedEarly, value.TerminatedEarly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, null); + writer.WriteProperty(options, PropTook, value.Took, null, null); + writer.WriteEndObject(); + } +} + +public sealed partial class RollupSearchResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(RollupSearchResponse<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(RollupSearchResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/RollupSearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/RollupSearchResponse.g.cs index ba28650b351..c7bcd6807b4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/RollupSearchResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/RollupSearchResponse.g.cs @@ -23,107 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Rollup; -internal sealed partial class RollupSearchResponseConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); - private static readonly System.Text.Json.JsonEncodedText PropHits = System.Text.Json.JsonEncodedText.Encode("hits"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - private static readonly System.Text.Json.JsonEncodedText PropTerminatedEarly = System.Text.Json.JsonEncodedText.Encode("terminated_early"); - private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); - private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); - - public override Elastic.Clients.Elasticsearch.Rollup.RollupSearchResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAggregations = default; - LocalJsonValue> propHits = default; - LocalJsonValue propShards = default; - LocalJsonValue propTerminatedEarly = default; - LocalJsonValue propTimedOut = default; - LocalJsonValue propTook = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, null)) - { - continue; - } - - if (propHits.TryReadProperty(ref reader, options, PropHits, null)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (propTerminatedEarly.TryReadProperty(ref reader, options, PropTerminatedEarly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, null)) - { - continue; - } - - if (propTook.TryReadProperty(ref reader, options, PropTook, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.RollupSearchResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = propAggregations.Value, - Hits = propHits.Value, - Shards = propShards.Value, - TerminatedEarly = propTerminatedEarly.Value, - TimedOut = propTimedOut.Value, - Took = propTook.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.RollupSearchResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregations, value.Aggregations, null, null); - writer.WriteProperty(options, PropHits, value.Hits, null, null); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteProperty(options, PropTerminatedEarly, value.TerminatedEarly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, null); - writer.WriteProperty(options, PropTook, value.Took, null, null); - writer.WriteEndObject(); - } -} - -internal sealed partial class RollupSearchResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(RollupSearchResponse<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(RollupSearchResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.RollupSearchResponseConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.RollupSearchResponseConverterFactory))] public sealed partial class RollupSearchResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -140,23 +40,23 @@ internal RollupSearchResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCo public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary? Aggregations { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Core.Search.HitsMetadata Hits { get; set; } +Elastic.Clients.Elasticsearch.Core.Search.HitsMetadata Hits { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; set; } +Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; set; } public bool? TerminatedEarly { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool TimedOut { get; set; } +bool TimedOut { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long Took { get; set; } +long Took { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StartJobRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StartJobRequest.Converters.g.cs new file mode 100644 index 00000000000..33c5e5c1033 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StartJobRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class StartJobRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Rollup.StartJobRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.StartJobRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.StartJobRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StartJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StartJobRequest.g.cs index 877d09d1a95..9d8737ec1f1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StartJobRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StartJobRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class StartJobRequestParameters : Elastic.Transport.Reques { } -internal sealed partial class StartJobRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Rollup.StartJobRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.StartJobRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.StartJobRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Start rollup jobs. @@ -63,7 +34,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If you try to start a job that is already started, nothing happens. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.StartJobRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.StartJobRequestConverter))] public sealed partial class StartJobRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StartJobResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StartJobResponse.Converters.g.cs new file mode 100644 index 00000000000..10d1698d0ac --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StartJobResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class StartJobResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStarted = System.Text.Json.JsonEncodedText.Encode("started"); + + public override Elastic.Clients.Elasticsearch.Rollup.StartJobResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propStarted = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStarted.TryReadProperty(ref reader, options, PropStarted, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.StartJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Started = propStarted.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.StartJobResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStarted, value.Started, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StartJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StartJobResponse.g.cs index d57989297ea..581c06c3e63 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StartJobResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StartJobResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Rollup; -internal sealed partial class StartJobResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStarted = System.Text.Json.JsonEncodedText.Encode("started"); - - public override Elastic.Clients.Elasticsearch.Rollup.StartJobResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propStarted = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStarted.TryReadProperty(ref reader, options, PropStarted, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.StartJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Started = propStarted.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.StartJobResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStarted, value.Started, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.StartJobResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.StartJobResponseConverter))] public sealed partial class StartJobResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal StartJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstr public #if NET7_0_OR_GREATER - required +required #endif - bool Started { get; set; } +bool Started { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StopJobRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StopJobRequest.Converters.g.cs new file mode 100644 index 00000000000..2ac6cb1051f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StopJobRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class StopJobRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Rollup.StopJobRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.StopJobRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.StopJobRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StopJobRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StopJobRequest.g.cs index e88fd70c382..4fa1f704c42 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StopJobRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StopJobRequest.g.cs @@ -44,35 +44,6 @@ public sealed partial class StopJobRequestParameters : Elastic.Transport.Request public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } } -internal sealed partial class StopJobRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Rollup.StopJobRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.StopJobRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.StopJobRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Stop rollup jobs. @@ -91,7 +62,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If the specified time elapses without the job moving to STOPPED, a timeout exception occurs. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.StopJobRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.StopJobRequestConverter))] public sealed partial class StopJobRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StopJobResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StopJobResponse.Converters.g.cs new file mode 100644 index 00000000000..2d863d39311 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StopJobResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class StopJobResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStopped = System.Text.Json.JsonEncodedText.Encode("stopped"); + + public override Elastic.Clients.Elasticsearch.Rollup.StopJobResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propStopped = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStopped.TryReadProperty(ref reader, options, PropStopped, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.StopJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Stopped = propStopped.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.StopJobResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStopped, value.Stopped, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StopJobResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StopJobResponse.g.cs index 7ac4c3b3384..9c9a0247996 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StopJobResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Rollup/StopJobResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Rollup; -internal sealed partial class StopJobResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStopped = System.Text.Json.JsonEncodedText.Encode("stopped"); - - public override Elastic.Clients.Elasticsearch.Rollup.StopJobResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propStopped = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStopped.TryReadProperty(ref reader, options, PropStopped, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.StopJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Stopped = propStopped.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.StopJobResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStopped, value.Stopped, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.StopJobResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.StopJobResponseConverter))] public sealed partial class StopJobResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal StopJobResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstru public #if NET7_0_OR_GREATER - required +required #endif - bool Stopped { get; set; } +bool Stopped { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScriptsPainlessExecuteRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScriptsPainlessExecuteRequest.Converters.g.cs new file mode 100644 index 00000000000..6579554ca37 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScriptsPainlessExecuteRequest.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ScriptsPainlessExecuteRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropContext = System.Text.Json.JsonEncodedText.Encode("context"); + private static readonly System.Text.Json.JsonEncodedText PropContextSetup = System.Text.Json.JsonEncodedText.Encode("context_setup"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.ScriptsPainlessExecuteRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propContext = default; + LocalJsonValue propContextSetup = default; + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propContext.TryReadProperty(ref reader, options, PropContext, static Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.PainlessContext? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propContextSetup.TryReadProperty(ref reader, options, PropContextSetup, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ScriptsPainlessExecuteRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Context = propContext.Value, + ContextSetup = propContextSetup.Value, + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ScriptsPainlessExecuteRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropContext, value.Context, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.PainlessContext? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropContextSetup, value.ContextSetup, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScriptsPainlessExecuteRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScriptsPainlessExecuteRequest.g.cs index 43a8c7829f2..2e4183be32f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScriptsPainlessExecuteRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScriptsPainlessExecuteRequest.g.cs @@ -27,63 +27,6 @@ public sealed partial class ScriptsPainlessExecuteRequestParameters : Elastic.Tr { } -internal sealed partial class ScriptsPainlessExecuteRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropContext = System.Text.Json.JsonEncodedText.Encode("context"); - private static readonly System.Text.Json.JsonEncodedText PropContextSetup = System.Text.Json.JsonEncodedText.Encode("context_setup"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.ScriptsPainlessExecuteRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propContext = default; - LocalJsonValue propContextSetup = default; - LocalJsonValue propScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propContext.TryReadProperty(ref reader, options, PropContext, static Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.PainlessContext? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propContextSetup.TryReadProperty(ref reader, options, PropContextSetup, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ScriptsPainlessExecuteRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Context = propContext.Value, - ContextSetup = propContextSetup.Value, - Script = propScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ScriptsPainlessExecuteRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropContext, value.Context, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.PainlessContext? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropContextSetup, value.ContextSetup, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Run a script. @@ -100,7 +43,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Each context requires a script, but additional parameters depend on the context you're using for that script. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ScriptsPainlessExecuteRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ScriptsPainlessExecuteRequestConverter))] public sealed partial class ScriptsPainlessExecuteRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScriptsPainlessExecuteResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScriptsPainlessExecuteResponse.Converters.g.cs new file mode 100644 index 00000000000..1dd2466db0a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScriptsPainlessExecuteResponse.Converters.g.cs @@ -0,0 +1,79 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ScriptsPainlessExecuteResponseConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropResult = System.Text.Json.JsonEncodedText.Encode("result"); + + public override Elastic.Clients.Elasticsearch.ScriptsPainlessExecuteResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propResult = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propResult.TryReadProperty(ref reader, options, PropResult, static TResult (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ScriptsPainlessExecuteResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Result = propResult.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ScriptsPainlessExecuteResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropResult, value.Result, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TResult v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} + +public sealed partial class ScriptsPainlessExecuteResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(ScriptsPainlessExecuteResponse<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(ScriptsPainlessExecuteResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScriptsPainlessExecuteResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScriptsPainlessExecuteResponse.g.cs index 6b517cbc080..a88e0a76bd5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScriptsPainlessExecuteResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScriptsPainlessExecuteResponse.g.cs @@ -23,62 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class ScriptsPainlessExecuteResponseConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropResult = System.Text.Json.JsonEncodedText.Encode("result"); - - public override Elastic.Clients.Elasticsearch.ScriptsPainlessExecuteResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propResult = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propResult.TryReadProperty(ref reader, options, PropResult, static TResult (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ScriptsPainlessExecuteResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Result = propResult.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ScriptsPainlessExecuteResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropResult, value.Result, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TResult v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteEndObject(); - } -} - -internal sealed partial class ScriptsPainlessExecuteResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(ScriptsPainlessExecuteResponse<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(ScriptsPainlessExecuteResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ScriptsPainlessExecuteResponseConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ScriptsPainlessExecuteResponseConverterFactory))] public sealed partial class ScriptsPainlessExecuteResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -94,7 +39,7 @@ internal ScriptsPainlessExecuteResponse(Elastic.Clients.Elasticsearch.Serializat public #if NET7_0_OR_GREATER - required +required #endif - TResult Result { get; set; } +TResult Result { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScrollRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScrollRequest.Converters.g.cs new file mode 100644 index 00000000000..8cfe73fbb4b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScrollRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ScrollRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropScroll = System.Text.Json.JsonEncodedText.Encode("scroll"); + private static readonly System.Text.Json.JsonEncodedText PropScrollId = System.Text.Json.JsonEncodedText.Encode("scroll_id"); + + public override Elastic.Clients.Elasticsearch.ScrollRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propScroll = default; + LocalJsonValue propScrollId = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propScroll.TryReadProperty(ref reader, options, PropScroll, null)) + { + continue; + } + + if (propScrollId.TryReadProperty(ref reader, options, PropScrollId, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ScrollRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Scroll = propScroll.Value, + ScrollId = propScrollId.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ScrollRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropScroll, value.Scroll, null, null); + writer.WriteProperty(options, PropScrollId, value.ScrollId, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScrollRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScrollRequest.g.cs index b60a5508145..c26f1c95a74 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScrollRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScrollRequest.g.cs @@ -33,54 +33,6 @@ public sealed partial class ScrollRequestParameters : Elastic.Transport.RequestP public bool? RestTotalHitsAsInt { get => Q("rest_total_hits_as_int"); set => Q("rest_total_hits_as_int", value); } } -internal sealed partial class ScrollRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropScroll = System.Text.Json.JsonEncodedText.Encode("scroll"); - private static readonly System.Text.Json.JsonEncodedText PropScrollId = System.Text.Json.JsonEncodedText.Encode("scroll_id"); - - public override Elastic.Clients.Elasticsearch.ScrollRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propScroll = default; - LocalJsonValue propScrollId = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propScroll.TryReadProperty(ref reader, options, PropScroll, null)) - { - continue; - } - - if (propScrollId.TryReadProperty(ref reader, options, PropScrollId, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ScrollRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Scroll = propScroll.Value, - ScrollId = propScrollId.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ScrollRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropScroll, value.Scroll, null, null); - writer.WriteProperty(options, PropScrollId, value.ScrollId, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Run a scrolling search. @@ -103,7 +55,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// IMPORTANT: Results from a scrolling search reflect the state of the index at the time of the initial search request. Subsequent indexing or document changes only affect later search and scroll requests. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ScrollRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ScrollRequestConverter))] public sealed partial class ScrollRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScrollResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScrollResponse.Converters.g.cs new file mode 100644 index 00000000000..60943d14ad8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScrollResponse.Converters.g.cs @@ -0,0 +1,196 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ScrollResponseConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); + private static readonly System.Text.Json.JsonEncodedText PropClusters = System.Text.Json.JsonEncodedText.Encode("_clusters"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropHitsMetadata = System.Text.Json.JsonEncodedText.Encode("hits"); + private static readonly System.Text.Json.JsonEncodedText PropMaxScore = System.Text.Json.JsonEncodedText.Encode("max_score"); + private static readonly System.Text.Json.JsonEncodedText PropNumReducePhases = System.Text.Json.JsonEncodedText.Encode("num_reduce_phases"); + private static readonly System.Text.Json.JsonEncodedText PropPitId = System.Text.Json.JsonEncodedText.Encode("pit_id"); + private static readonly System.Text.Json.JsonEncodedText PropProfile = System.Text.Json.JsonEncodedText.Encode("profile"); + private static readonly System.Text.Json.JsonEncodedText PropScrollId = System.Text.Json.JsonEncodedText.Encode("_scroll_id"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + private static readonly System.Text.Json.JsonEncodedText PropSuggest = System.Text.Json.JsonEncodedText.Encode("suggest"); + private static readonly System.Text.Json.JsonEncodedText PropTerminatedEarly = System.Text.Json.JsonEncodedText.Encode("terminated_early"); + private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); + private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); + + public override Elastic.Clients.Elasticsearch.ScrollResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAggregations = default; + LocalJsonValue propClusters = default; + LocalJsonValue?> propFields = default; + LocalJsonValue> propHitsMetadata = default; + LocalJsonValue propMaxScore = default; + LocalJsonValue propNumReducePhases = default; + LocalJsonValue propPitId = default; + LocalJsonValue propProfile = default; + LocalJsonValue propScrollId = default; + LocalJsonValue propShards = default; + LocalJsonValue?> propSuggest = default; + LocalJsonValue propTerminatedEarly = default; + LocalJsonValue propTimedOut = default; + LocalJsonValue propTook = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, null)) + { + continue; + } + + if (propClusters.TryReadProperty(ref reader, options, PropClusters, null)) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propHitsMetadata.TryReadProperty(ref reader, options, PropHitsMetadata, null)) + { + continue; + } + + if (propMaxScore.TryReadProperty(ref reader, options, PropMaxScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNumReducePhases.TryReadProperty(ref reader, options, PropNumReducePhases, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPitId.TryReadProperty(ref reader, options, PropPitId, null)) + { + continue; + } + + if (propProfile.TryReadProperty(ref reader, options, PropProfile, null)) + { + continue; + } + + if (propScrollId.TryReadProperty(ref reader, options, PropScrollId, null)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (propSuggest.TryReadProperty(ref reader, options, PropSuggest, null)) + { + continue; + } + + if (propTerminatedEarly.TryReadProperty(ref reader, options, PropTerminatedEarly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, null)) + { + continue; + } + + if (propTook.TryReadProperty(ref reader, options, PropTook, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ScrollResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = propAggregations.Value, + Clusters = propClusters.Value, + Fields = propFields.Value, + HitsMetadata = propHitsMetadata.Value, + MaxScore = propMaxScore.Value, + NumReducePhases = propNumReducePhases.Value, + PitId = propPitId.Value, + Profile = propProfile.Value, + ScrollId = propScrollId.Value, + Shards = propShards.Value, + Suggest = propSuggest.Value, + TerminatedEarly = propTerminatedEarly.Value, + TimedOut = propTimedOut.Value, + Took = propTook.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ScrollResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregations, value.Aggregations, null, null); + writer.WriteProperty(options, PropClusters, value.Clusters, null, null); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropHitsMetadata, value.HitsMetadata, null, null); + writer.WriteProperty(options, PropMaxScore, value.MaxScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNumReducePhases, value.NumReducePhases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPitId, value.PitId, null, null); + writer.WriteProperty(options, PropProfile, value.Profile, null, null); + writer.WriteProperty(options, PropScrollId, value.ScrollId, null, null); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteProperty(options, PropSuggest, value.Suggest, null, null); + writer.WriteProperty(options, PropTerminatedEarly, value.TerminatedEarly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, null); + writer.WriteProperty(options, PropTook, value.Took, null, null); + writer.WriteEndObject(); + } +} + +public sealed partial class ScrollResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(ScrollResponse<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(ScrollResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScrollResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScrollResponse.g.cs index 90de23be272..bd27ff52de5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScrollResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ScrollResponse.g.cs @@ -23,179 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class ScrollResponseConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); - private static readonly System.Text.Json.JsonEncodedText PropClusters = System.Text.Json.JsonEncodedText.Encode("_clusters"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropHitsMetadata = System.Text.Json.JsonEncodedText.Encode("hits"); - private static readonly System.Text.Json.JsonEncodedText PropMaxScore = System.Text.Json.JsonEncodedText.Encode("max_score"); - private static readonly System.Text.Json.JsonEncodedText PropNumReducePhases = System.Text.Json.JsonEncodedText.Encode("num_reduce_phases"); - private static readonly System.Text.Json.JsonEncodedText PropPitId = System.Text.Json.JsonEncodedText.Encode("pit_id"); - private static readonly System.Text.Json.JsonEncodedText PropProfile = System.Text.Json.JsonEncodedText.Encode("profile"); - private static readonly System.Text.Json.JsonEncodedText PropScrollId = System.Text.Json.JsonEncodedText.Encode("_scroll_id"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - private static readonly System.Text.Json.JsonEncodedText PropSuggest = System.Text.Json.JsonEncodedText.Encode("suggest"); - private static readonly System.Text.Json.JsonEncodedText PropTerminatedEarly = System.Text.Json.JsonEncodedText.Encode("terminated_early"); - private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); - private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); - - public override Elastic.Clients.Elasticsearch.ScrollResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAggregations = default; - LocalJsonValue propClusters = default; - LocalJsonValue?> propFields = default; - LocalJsonValue> propHitsMetadata = default; - LocalJsonValue propMaxScore = default; - LocalJsonValue propNumReducePhases = default; - LocalJsonValue propPitId = default; - LocalJsonValue propProfile = default; - LocalJsonValue propScrollId = default; - LocalJsonValue propShards = default; - LocalJsonValue?> propSuggest = default; - LocalJsonValue propTerminatedEarly = default; - LocalJsonValue propTimedOut = default; - LocalJsonValue propTook = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, null)) - { - continue; - } - - if (propClusters.TryReadProperty(ref reader, options, PropClusters, null)) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propHitsMetadata.TryReadProperty(ref reader, options, PropHitsMetadata, null)) - { - continue; - } - - if (propMaxScore.TryReadProperty(ref reader, options, PropMaxScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNumReducePhases.TryReadProperty(ref reader, options, PropNumReducePhases, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPitId.TryReadProperty(ref reader, options, PropPitId, null)) - { - continue; - } - - if (propProfile.TryReadProperty(ref reader, options, PropProfile, null)) - { - continue; - } - - if (propScrollId.TryReadProperty(ref reader, options, PropScrollId, null)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (propSuggest.TryReadProperty(ref reader, options, PropSuggest, null)) - { - continue; - } - - if (propTerminatedEarly.TryReadProperty(ref reader, options, PropTerminatedEarly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, null)) - { - continue; - } - - if (propTook.TryReadProperty(ref reader, options, PropTook, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ScrollResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = propAggregations.Value, - Clusters = propClusters.Value, - Fields = propFields.Value, - HitsMetadata = propHitsMetadata.Value, - MaxScore = propMaxScore.Value, - NumReducePhases = propNumReducePhases.Value, - PitId = propPitId.Value, - Profile = propProfile.Value, - ScrollId = propScrollId.Value, - Shards = propShards.Value, - Suggest = propSuggest.Value, - TerminatedEarly = propTerminatedEarly.Value, - TimedOut = propTimedOut.Value, - Took = propTook.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ScrollResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregations, value.Aggregations, null, null); - writer.WriteProperty(options, PropClusters, value.Clusters, null, null); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropHitsMetadata, value.HitsMetadata, null, null); - writer.WriteProperty(options, PropMaxScore, value.MaxScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNumReducePhases, value.NumReducePhases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPitId, value.PitId, null, null); - writer.WriteProperty(options, PropProfile, value.Profile, null, null); - writer.WriteProperty(options, PropScrollId, value.ScrollId, null, null); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteProperty(options, PropSuggest, value.Suggest, null, null); - writer.WriteProperty(options, PropTerminatedEarly, value.TerminatedEarly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, null); - writer.WriteProperty(options, PropTook, value.Took, null, null); - writer.WriteEndObject(); - } -} - -internal sealed partial class ScrollResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(ScrollResponse<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(ScrollResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ScrollResponseConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ScrollResponseConverterFactory))] public partial class ScrollResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteBehavioralAnalyticsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteBehavioralAnalyticsRequest.Converters.g.cs new file mode 100644 index 00000000000..df62dfd7861 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteBehavioralAnalyticsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication.Json; + +public sealed partial class DeleteBehavioralAnalyticsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.SearchApplication.DeleteBehavioralAnalyticsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchApplication.DeleteBehavioralAnalyticsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.DeleteBehavioralAnalyticsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteBehavioralAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteBehavioralAnalyticsRequest.g.cs index fdf18c5d431..5c8087173a3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteBehavioralAnalyticsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteBehavioralAnalyticsRequest.g.cs @@ -27,42 +27,13 @@ public sealed partial class DeleteBehavioralAnalyticsRequestParameters : Elastic { } -internal sealed partial class DeleteBehavioralAnalyticsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.SearchApplication.DeleteBehavioralAnalyticsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchApplication.DeleteBehavioralAnalyticsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.DeleteBehavioralAnalyticsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete a behavioral analytics collection. /// The associated data stream is also deleted. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.DeleteBehavioralAnalyticsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.Json.DeleteBehavioralAnalyticsRequestConverter))] public sealed partial class DeleteBehavioralAnalyticsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteBehavioralAnalyticsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteBehavioralAnalyticsResponse.Converters.g.cs new file mode 100644 index 00000000000..50107d570d4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteBehavioralAnalyticsResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication.Json; + +public sealed partial class DeleteBehavioralAnalyticsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.SearchApplication.DeleteBehavioralAnalyticsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchApplication.DeleteBehavioralAnalyticsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.DeleteBehavioralAnalyticsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteBehavioralAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteBehavioralAnalyticsResponse.g.cs index d29b663848f..a626a7771bb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteBehavioralAnalyticsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteBehavioralAnalyticsResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SearchApplication; -internal sealed partial class DeleteBehavioralAnalyticsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.SearchApplication.DeleteBehavioralAnalyticsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchApplication.DeleteBehavioralAnalyticsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.DeleteBehavioralAnalyticsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.DeleteBehavioralAnalyticsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.Json.DeleteBehavioralAnalyticsResponseConverter))] public sealed partial class DeleteBehavioralAnalyticsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteSearchApplicationRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteSearchApplicationRequest.Converters.g.cs new file mode 100644 index 00000000000..2f19eec6a9a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteSearchApplicationRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication.Json; + +public sealed partial class DeleteSearchApplicationRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.SearchApplication.DeleteSearchApplicationRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchApplication.DeleteSearchApplicationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.DeleteSearchApplicationRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteSearchApplicationRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteSearchApplicationRequest.g.cs index bec17e58ad7..a7a531a2f2a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteSearchApplicationRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteSearchApplicationRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class DeleteSearchApplicationRequestParameters : Elastic.T { } -internal sealed partial class DeleteSearchApplicationRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.SearchApplication.DeleteSearchApplicationRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchApplication.DeleteSearchApplicationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.DeleteSearchApplicationRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete a search application. @@ -64,7 +35,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Remove a search application and its associated alias. Indices attached to the search application are not removed. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.DeleteSearchApplicationRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.Json.DeleteSearchApplicationRequestConverter))] public sealed partial class DeleteSearchApplicationRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteSearchApplicationResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteSearchApplicationResponse.Converters.g.cs new file mode 100644 index 00000000000..61aa994faef --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteSearchApplicationResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication.Json; + +public sealed partial class DeleteSearchApplicationResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.SearchApplication.DeleteSearchApplicationResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchApplication.DeleteSearchApplicationResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.DeleteSearchApplicationResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteSearchApplicationResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteSearchApplicationResponse.g.cs index f6e50a1eddf..3e8d4719fd5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteSearchApplicationResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/DeleteSearchApplicationResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SearchApplication; -internal sealed partial class DeleteSearchApplicationResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.SearchApplication.DeleteSearchApplicationResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchApplication.DeleteSearchApplicationResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.DeleteSearchApplicationResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.DeleteSearchApplicationResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.Json.DeleteSearchApplicationResponseConverter))] public sealed partial class DeleteSearchApplicationResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetBehavioralAnalyticsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetBehavioralAnalyticsRequest.Converters.g.cs new file mode 100644 index 00000000000..3125af6fe1f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetBehavioralAnalyticsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication.Json; + +public sealed partial class GetBehavioralAnalyticsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.SearchApplication.GetBehavioralAnalyticsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchApplication.GetBehavioralAnalyticsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.GetBehavioralAnalyticsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetBehavioralAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetBehavioralAnalyticsRequest.g.cs index fe2e8d58ba9..4deb4d76931 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetBehavioralAnalyticsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetBehavioralAnalyticsRequest.g.cs @@ -27,41 +27,12 @@ public sealed partial class GetBehavioralAnalyticsRequestParameters : Elastic.Tr { } -internal sealed partial class GetBehavioralAnalyticsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.SearchApplication.GetBehavioralAnalyticsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchApplication.GetBehavioralAnalyticsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.GetBehavioralAnalyticsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get behavioral analytics collections. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.GetBehavioralAnalyticsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.Json.GetBehavioralAnalyticsRequestConverter))] public sealed partial class GetBehavioralAnalyticsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetBehavioralAnalyticsRequest(System.Collections.Generic.ICollection? name) : base(r => r.Optional("name", name)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetBehavioralAnalyticsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetBehavioralAnalyticsResponse.Converters.g.cs new file mode 100644 index 00000000000..904954be403 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetBehavioralAnalyticsResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication.Json; + +public sealed partial class GetBehavioralAnalyticsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.SearchApplication.GetBehavioralAnalyticsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.SearchApplication.GetBehavioralAnalyticsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Analytics = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.GetBehavioralAnalyticsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Analytics, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetBehavioralAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetBehavioralAnalyticsResponse.g.cs index 8915534a97e..65a0955ec2f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetBehavioralAnalyticsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetBehavioralAnalyticsResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SearchApplication; -internal sealed partial class GetBehavioralAnalyticsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.SearchApplication.GetBehavioralAnalyticsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.SearchApplication.GetBehavioralAnalyticsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Analytics = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.GetBehavioralAnalyticsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Analytics, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.GetBehavioralAnalyticsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.Json.GetBehavioralAnalyticsResponseConverter))] public sealed partial class GetBehavioralAnalyticsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetSearchApplicationRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetSearchApplicationRequest.Converters.g.cs new file mode 100644 index 00000000000..46cbc4af767 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetSearchApplicationRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication.Json; + +public sealed partial class GetSearchApplicationRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.SearchApplication.GetSearchApplicationRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchApplication.GetSearchApplicationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.GetSearchApplicationRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetSearchApplicationRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetSearchApplicationRequest.g.cs index dc9227780cc..40af3d277b6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetSearchApplicationRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetSearchApplicationRequest.g.cs @@ -27,41 +27,12 @@ public sealed partial class GetSearchApplicationRequestParameters : Elastic.Tran { } -internal sealed partial class GetSearchApplicationRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.SearchApplication.GetSearchApplicationRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchApplication.GetSearchApplicationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.GetSearchApplicationRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get search application details. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.GetSearchApplicationRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.Json.GetSearchApplicationRequestConverter))] public sealed partial class GetSearchApplicationRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetSearchApplicationResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetSearchApplicationResponse.Converters.g.cs new file mode 100644 index 00000000000..c5d3721f8a1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetSearchApplicationResponse.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication.Json; + +public sealed partial class GetSearchApplicationResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyticsCollectionName = System.Text.Json.JsonEncodedText.Encode("analytics_collection_name"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"); + private static readonly System.Text.Json.JsonEncodedText PropUpdatedAtMillis = System.Text.Json.JsonEncodedText.Encode("updated_at_millis"); + + public override Elastic.Clients.Elasticsearch.SearchApplication.GetSearchApplicationResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyticsCollectionName = default; + LocalJsonValue> propIndices = default; + LocalJsonValue propName = default; + LocalJsonValue propTemplate = default; + LocalJsonValue propUpdatedAtMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyticsCollectionName.TryReadProperty(ref reader, options, PropAnalyticsCollectionName, null)) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, null)) + { + continue; + } + + if (propUpdatedAtMillis.TryReadProperty(ref reader, options, PropUpdatedAtMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchApplication.GetSearchApplicationResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AnalyticsCollectionName = propAnalyticsCollectionName.Value, + Indices = propIndices.Value, + Name = propName.Value, + Template = propTemplate.Value, + UpdatedAtMillis = propUpdatedAtMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.GetSearchApplicationResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyticsCollectionName, value.AnalyticsCollectionName, null, null); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropTemplate, value.Template, null, null); + writer.WriteProperty(options, PropUpdatedAtMillis, value.UpdatedAtMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetSearchApplicationResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetSearchApplicationResponse.g.cs index 7cceb19d4de..c971dd49f1b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetSearchApplicationResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/GetSearchApplicationResponse.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SearchApplication; -internal sealed partial class GetSearchApplicationResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyticsCollectionName = System.Text.Json.JsonEncodedText.Encode("analytics_collection_name"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"); - private static readonly System.Text.Json.JsonEncodedText PropUpdatedAtMillis = System.Text.Json.JsonEncodedText.Encode("updated_at_millis"); - - public override Elastic.Clients.Elasticsearch.SearchApplication.GetSearchApplicationResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyticsCollectionName = default; - LocalJsonValue> propIndices = default; - LocalJsonValue propName = default; - LocalJsonValue propTemplate = default; - LocalJsonValue propUpdatedAtMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyticsCollectionName.TryReadProperty(ref reader, options, PropAnalyticsCollectionName, null)) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, null)) - { - continue; - } - - if (propUpdatedAtMillis.TryReadProperty(ref reader, options, PropUpdatedAtMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchApplication.GetSearchApplicationResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AnalyticsCollectionName = propAnalyticsCollectionName.Value, - Indices = propIndices.Value, - Name = propName.Value, - Template = propTemplate.Value, - UpdatedAtMillis = propUpdatedAtMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.GetSearchApplicationResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyticsCollectionName, value.AnalyticsCollectionName, null, null); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropTemplate, value.Template, null, null); - writer.WriteProperty(options, PropUpdatedAtMillis, value.UpdatedAtMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.GetSearchApplicationResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.Json.GetSearchApplicationResponseConverter))] public sealed partial class GetSearchApplicationResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/ListRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/ListRequest.Converters.g.cs new file mode 100644 index 00000000000..1cd48edf2c3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/ListRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication.Json; + +public sealed partial class ListRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.SearchApplication.ListRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchApplication.ListRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.ListRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/ListRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/ListRequest.g.cs index 2043562c720..11569eecae8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/ListRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/ListRequest.g.cs @@ -47,42 +47,13 @@ public sealed partial class ListRequestParameters : Elastic.Transport.RequestPar public int? Size { get => Q("size"); set => Q("size", value); } } -internal sealed partial class ListRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.SearchApplication.ListRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchApplication.ListRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.ListRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get search applications. /// Get information about search applications. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.ListRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.Json.ListRequestConverter))] public sealed partial class ListRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/ListResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/ListResponse.Converters.g.cs new file mode 100644 index 00000000000..2fec149eefb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/ListResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication.Json; + +public sealed partial class ListResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropResults = System.Text.Json.JsonEncodedText.Encode("results"); + + public override Elastic.Clients.Elasticsearch.SearchApplication.ListResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propResults = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propResults.TryReadProperty(ref reader, options, PropResults, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchApplication.ListResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Results = propResults.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.ListResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropResults, value.Results, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/ListResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/ListResponse.g.cs index d04b250717b..66f294c3362 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/ListResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/ListResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SearchApplication; -internal sealed partial class ListResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropResults = System.Text.Json.JsonEncodedText.Encode("results"); - - public override Elastic.Clients.Elasticsearch.SearchApplication.ListResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propResults = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propResults.TryReadProperty(ref reader, options, PropResults, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchApplication.ListResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Results = propResults.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.ListResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropResults, value.Results, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.ListResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.Json.ListResponseConverter))] public sealed partial class ListResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal ListResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructo public #if NET7_0_OR_GREATER - required +required #endif - long Count { get; set; } +long Count { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Results { get; set; } +System.Collections.Generic.IReadOnlyCollection Results { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PostBehavioralAnalyticsEventRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PostBehavioralAnalyticsEventRequest.Converters.g.cs new file mode 100644 index 00000000000..f51370c0449 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PostBehavioralAnalyticsEventRequest.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication.Json; + +public sealed partial class PostBehavioralAnalyticsEventRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.SearchApplication.PostBehavioralAnalyticsEventRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.SearchApplication.PostBehavioralAnalyticsEventRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Payload = reader.ReadValue(options, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.PostBehavioralAnalyticsEventRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Payload, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PostBehavioralAnalyticsEventRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PostBehavioralAnalyticsEventRequest.g.cs index 8778a5decad..2e682920d8b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PostBehavioralAnalyticsEventRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PostBehavioralAnalyticsEventRequest.g.cs @@ -33,25 +33,12 @@ public sealed partial class PostBehavioralAnalyticsEventRequestParameters : Elas public bool? Debug { get => Q("debug"); set => Q("debug", value); } } -internal sealed partial class PostBehavioralAnalyticsEventRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.SearchApplication.PostBehavioralAnalyticsEventRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.SearchApplication.PostBehavioralAnalyticsEventRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Payload = reader.ReadValue(options, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.PostBehavioralAnalyticsEventRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Payload, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - } -} - /// /// /// Create a behavioral analytics collection event. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.PostBehavioralAnalyticsEventRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.Json.PostBehavioralAnalyticsEventRequestConverter))] public sealed partial class PostBehavioralAnalyticsEventRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PostBehavioralAnalyticsEventResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PostBehavioralAnalyticsEventResponse.Converters.g.cs new file mode 100644 index 00000000000..ac35d31ebd6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PostBehavioralAnalyticsEventResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication.Json; + +public sealed partial class PostBehavioralAnalyticsEventResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAccepted = System.Text.Json.JsonEncodedText.Encode("accepted"); + private static readonly System.Text.Json.JsonEncodedText PropEvent = System.Text.Json.JsonEncodedText.Encode("event"); + + public override Elastic.Clients.Elasticsearch.SearchApplication.PostBehavioralAnalyticsEventResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAccepted = default; + LocalJsonValue propEvent = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAccepted.TryReadProperty(ref reader, options, PropAccepted, null)) + { + continue; + } + + if (propEvent.TryReadProperty(ref reader, options, PropEvent, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchApplication.PostBehavioralAnalyticsEventResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Accepted = propAccepted.Value, + Event = propEvent.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.PostBehavioralAnalyticsEventResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAccepted, value.Accepted, null, null); + writer.WriteProperty(options, PropEvent, value.Event, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PostBehavioralAnalyticsEventResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PostBehavioralAnalyticsEventResponse.g.cs index b2b0c2c4739..317dbd51151 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PostBehavioralAnalyticsEventResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PostBehavioralAnalyticsEventResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SearchApplication; -internal sealed partial class PostBehavioralAnalyticsEventResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAccepted = System.Text.Json.JsonEncodedText.Encode("accepted"); - private static readonly System.Text.Json.JsonEncodedText PropEvent = System.Text.Json.JsonEncodedText.Encode("event"); - - public override Elastic.Clients.Elasticsearch.SearchApplication.PostBehavioralAnalyticsEventResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAccepted = default; - LocalJsonValue propEvent = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAccepted.TryReadProperty(ref reader, options, PropAccepted, null)) - { - continue; - } - - if (propEvent.TryReadProperty(ref reader, options, PropEvent, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchApplication.PostBehavioralAnalyticsEventResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Accepted = propAccepted.Value, - Event = propEvent.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.PostBehavioralAnalyticsEventResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAccepted, value.Accepted, null, null); - writer.WriteProperty(options, PropEvent, value.Event, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.PostBehavioralAnalyticsEventResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.Json.PostBehavioralAnalyticsEventResponseConverter))] public sealed partial class PostBehavioralAnalyticsEventResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,8 +39,8 @@ internal PostBehavioralAnalyticsEventResponse(Elastic.Clients.Elasticsearch.Seri public #if NET7_0_OR_GREATER - required +required #endif - bool Accepted { get; set; } +bool Accepted { get; set; } public object? Event { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutBehavioralAnalyticsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutBehavioralAnalyticsRequest.Converters.g.cs new file mode 100644 index 00000000000..d648682232b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutBehavioralAnalyticsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication.Json; + +public sealed partial class PutBehavioralAnalyticsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.SearchApplication.PutBehavioralAnalyticsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchApplication.PutBehavioralAnalyticsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.PutBehavioralAnalyticsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutBehavioralAnalyticsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutBehavioralAnalyticsRequest.g.cs index cd394455219..0e64a60a277 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutBehavioralAnalyticsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutBehavioralAnalyticsRequest.g.cs @@ -27,41 +27,12 @@ public sealed partial class PutBehavioralAnalyticsRequestParameters : Elastic.Tr { } -internal sealed partial class PutBehavioralAnalyticsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.SearchApplication.PutBehavioralAnalyticsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchApplication.PutBehavioralAnalyticsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.PutBehavioralAnalyticsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Create a behavioral analytics collection. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.PutBehavioralAnalyticsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.Json.PutBehavioralAnalyticsRequestConverter))] public sealed partial class PutBehavioralAnalyticsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutBehavioralAnalyticsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutBehavioralAnalyticsResponse.Converters.g.cs new file mode 100644 index 00000000000..382ff001119 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutBehavioralAnalyticsResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication.Json; + +public sealed partial class PutBehavioralAnalyticsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.SearchApplication.PutBehavioralAnalyticsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchApplication.PutBehavioralAnalyticsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.PutBehavioralAnalyticsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutBehavioralAnalyticsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutBehavioralAnalyticsResponse.g.cs index 5b8753c2e8c..88845116866 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutBehavioralAnalyticsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutBehavioralAnalyticsResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SearchApplication; -internal sealed partial class PutBehavioralAnalyticsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.SearchApplication.PutBehavioralAnalyticsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchApplication.PutBehavioralAnalyticsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.PutBehavioralAnalyticsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.PutBehavioralAnalyticsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.Json.PutBehavioralAnalyticsResponseConverter))] public sealed partial class PutBehavioralAnalyticsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutSearchApplicationRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutSearchApplicationRequest.Converters.g.cs new file mode 100644 index 00000000000..0376452dccc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutSearchApplicationRequest.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication.Json; + +public sealed partial class PutSearchApplicationRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.SearchApplication.PutSearchApplicationRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.SearchApplication.PutSearchApplicationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { SearchApplication = reader.ReadValue(options, null) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.PutSearchApplicationRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.SearchApplication, null); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutSearchApplicationRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutSearchApplicationRequest.g.cs index 458906d5292..c487267d439 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutSearchApplicationRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutSearchApplicationRequest.g.cs @@ -33,25 +33,12 @@ public sealed partial class PutSearchApplicationRequestParameters : Elastic.Tran public bool? Create { get => Q("create"); set => Q("create", value); } } -internal sealed partial class PutSearchApplicationRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.SearchApplication.PutSearchApplicationRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.SearchApplication.PutSearchApplicationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { SearchApplication = reader.ReadValue(options, null) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.PutSearchApplicationRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.SearchApplication, null); - } -} - /// /// /// Create or update a search application. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.PutSearchApplicationRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.Json.PutSearchApplicationRequestConverter))] public sealed partial class PutSearchApplicationRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutSearchApplicationResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutSearchApplicationResponse.Converters.g.cs new file mode 100644 index 00000000000..ce7c9d503b6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutSearchApplicationResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication.Json; + +public sealed partial class PutSearchApplicationResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropResult = System.Text.Json.JsonEncodedText.Encode("result"); + + public override Elastic.Clients.Elasticsearch.SearchApplication.PutSearchApplicationResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propResult = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propResult.TryReadProperty(ref reader, options, PropResult, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchApplication.PutSearchApplicationResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Result = propResult.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.PutSearchApplicationResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropResult, value.Result, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutSearchApplicationResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutSearchApplicationResponse.g.cs index 1e65066d2b1..4501daf221d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutSearchApplicationResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/PutSearchApplicationResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SearchApplication; -internal sealed partial class PutSearchApplicationResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropResult = System.Text.Json.JsonEncodedText.Encode("result"); - - public override Elastic.Clients.Elasticsearch.SearchApplication.PutSearchApplicationResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propResult = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propResult.TryReadProperty(ref reader, options, PropResult, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchApplication.PutSearchApplicationResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Result = propResult.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.PutSearchApplicationResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropResult, value.Result, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.PutSearchApplicationResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.Json.PutSearchApplicationResponseConverter))] public sealed partial class PutSearchApplicationResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal PutSearchApplicationResponse(Elastic.Clients.Elasticsearch.Serializatio public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Result Result { get; set; } +Elastic.Clients.Elasticsearch.Result Result { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/RenderQueryRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/RenderQueryRequest.Converters.g.cs new file mode 100644 index 00000000000..a577dce6e54 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/RenderQueryRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication.Json; + +public sealed partial class RenderQueryRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); + + public override Elastic.Clients.Elasticsearch.SearchApplication.RenderQueryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propParams = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchApplication.RenderQueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Params = propParams.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.RenderQueryRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/RenderQueryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/RenderQueryRequest.g.cs index e6d48c127ef..cd150905c53 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/RenderQueryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/RenderQueryRequest.g.cs @@ -27,45 +27,6 @@ public sealed partial class RenderQueryRequestParameters : Elastic.Transport.Req { } -internal sealed partial class RenderQueryRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); - - public override Elastic.Clients.Elasticsearch.SearchApplication.RenderQueryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propParams = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchApplication.RenderQueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Params = propParams.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.RenderQueryRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - /// /// /// Render a search application query. @@ -77,7 +38,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// You must have read privileges on the backing alias of the search application. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.RenderQueryRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.Json.RenderQueryRequestConverter))] public sealed partial class RenderQueryRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/RenderQueryResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/RenderQueryResponse.Converters.g.cs new file mode 100644 index 00000000000..cb94f8c7192 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/RenderQueryResponse.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication.Json; + +public sealed partial class RenderQueryResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.SearchApplication.RenderQueryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchApplication.RenderQueryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.RenderQueryResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/RenderQueryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/RenderQueryResponse.g.cs index fffaf238704..45fa61349b6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/RenderQueryResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/RenderQueryResponse.g.cs @@ -23,36 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SearchApplication; -internal sealed partial class RenderQueryResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.SearchApplication.RenderQueryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchApplication.RenderQueryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.RenderQueryResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.RenderQueryResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.Json.RenderQueryResponseConverter))] public sealed partial class RenderQueryResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/SearchApplicationSearchRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/SearchApplicationSearchRequest.Converters.g.cs new file mode 100644 index 00000000000..7261f5ec58d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/SearchApplicationSearchRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication.Json; + +public sealed partial class SearchApplicationSearchRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); + + public override Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationSearchRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propParams = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationSearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Params = propParams.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationSearchRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/SearchApplicationSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/SearchApplicationSearchRequest.g.cs index 0a987c64fe1..71b451cdca0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/SearchApplicationSearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/SearchApplicationSearchRequest.g.cs @@ -33,45 +33,6 @@ public sealed partial class SearchApplicationSearchRequestParameters : Elastic.T public bool? TypedKeys { get => Q("typed_keys"); set => Q("typed_keys", value); } } -internal sealed partial class SearchApplicationSearchRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); - - public override Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationSearchRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propParams = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationSearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Params = propParams.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationSearchRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - /// /// /// Run a search application search. @@ -79,7 +40,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Unspecified template parameters are assigned their default values if applicable. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationSearchRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.Json.SearchApplicationSearchRequestConverter))] public partial class SearchApplicationSearchRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/SearchApplicationSearchResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/SearchApplicationSearchResponse.Converters.g.cs new file mode 100644 index 00000000000..f9c6e7838b6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/SearchApplicationSearchResponse.Converters.g.cs @@ -0,0 +1,196 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication.Json; + +public sealed partial class SearchApplicationSearchResponseConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); + private static readonly System.Text.Json.JsonEncodedText PropClusters = System.Text.Json.JsonEncodedText.Encode("_clusters"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropHitsMetadata = System.Text.Json.JsonEncodedText.Encode("hits"); + private static readonly System.Text.Json.JsonEncodedText PropMaxScore = System.Text.Json.JsonEncodedText.Encode("max_score"); + private static readonly System.Text.Json.JsonEncodedText PropNumReducePhases = System.Text.Json.JsonEncodedText.Encode("num_reduce_phases"); + private static readonly System.Text.Json.JsonEncodedText PropPitId = System.Text.Json.JsonEncodedText.Encode("pit_id"); + private static readonly System.Text.Json.JsonEncodedText PropProfile = System.Text.Json.JsonEncodedText.Encode("profile"); + private static readonly System.Text.Json.JsonEncodedText PropScrollId = System.Text.Json.JsonEncodedText.Encode("_scroll_id"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + private static readonly System.Text.Json.JsonEncodedText PropSuggest = System.Text.Json.JsonEncodedText.Encode("suggest"); + private static readonly System.Text.Json.JsonEncodedText PropTerminatedEarly = System.Text.Json.JsonEncodedText.Encode("terminated_early"); + private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); + private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); + + public override Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationSearchResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAggregations = default; + LocalJsonValue propClusters = default; + LocalJsonValue?> propFields = default; + LocalJsonValue> propHitsMetadata = default; + LocalJsonValue propMaxScore = default; + LocalJsonValue propNumReducePhases = default; + LocalJsonValue propPitId = default; + LocalJsonValue propProfile = default; + LocalJsonValue propScrollId = default; + LocalJsonValue propShards = default; + LocalJsonValue?> propSuggest = default; + LocalJsonValue propTerminatedEarly = default; + LocalJsonValue propTimedOut = default; + LocalJsonValue propTook = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, null)) + { + continue; + } + + if (propClusters.TryReadProperty(ref reader, options, PropClusters, null)) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propHitsMetadata.TryReadProperty(ref reader, options, PropHitsMetadata, null)) + { + continue; + } + + if (propMaxScore.TryReadProperty(ref reader, options, PropMaxScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNumReducePhases.TryReadProperty(ref reader, options, PropNumReducePhases, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPitId.TryReadProperty(ref reader, options, PropPitId, null)) + { + continue; + } + + if (propProfile.TryReadProperty(ref reader, options, PropProfile, null)) + { + continue; + } + + if (propScrollId.TryReadProperty(ref reader, options, PropScrollId, null)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (propSuggest.TryReadProperty(ref reader, options, PropSuggest, null)) + { + continue; + } + + if (propTerminatedEarly.TryReadProperty(ref reader, options, PropTerminatedEarly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, null)) + { + continue; + } + + if (propTook.TryReadProperty(ref reader, options, PropTook, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationSearchResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = propAggregations.Value, + Clusters = propClusters.Value, + Fields = propFields.Value, + HitsMetadata = propHitsMetadata.Value, + MaxScore = propMaxScore.Value, + NumReducePhases = propNumReducePhases.Value, + PitId = propPitId.Value, + Profile = propProfile.Value, + ScrollId = propScrollId.Value, + Shards = propShards.Value, + Suggest = propSuggest.Value, + TerminatedEarly = propTerminatedEarly.Value, + TimedOut = propTimedOut.Value, + Took = propTook.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationSearchResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregations, value.Aggregations, null, null); + writer.WriteProperty(options, PropClusters, value.Clusters, null, null); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropHitsMetadata, value.HitsMetadata, null, null); + writer.WriteProperty(options, PropMaxScore, value.MaxScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNumReducePhases, value.NumReducePhases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPitId, value.PitId, null, null); + writer.WriteProperty(options, PropProfile, value.Profile, null, null); + writer.WriteProperty(options, PropScrollId, value.ScrollId, null, null); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteProperty(options, PropSuggest, value.Suggest, null, null); + writer.WriteProperty(options, PropTerminatedEarly, value.TerminatedEarly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, null); + writer.WriteProperty(options, PropTook, value.Took, null, null); + writer.WriteEndObject(); + } +} + +public sealed partial class SearchApplicationSearchResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(SearchApplicationSearchResponse<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(SearchApplicationSearchResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/SearchApplicationSearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/SearchApplicationSearchResponse.g.cs index 3fe098cfc76..2fbd985bead 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/SearchApplicationSearchResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchApplication/SearchApplicationSearchResponse.g.cs @@ -23,179 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SearchApplication; -internal sealed partial class SearchApplicationSearchResponseConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); - private static readonly System.Text.Json.JsonEncodedText PropClusters = System.Text.Json.JsonEncodedText.Encode("_clusters"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropHitsMetadata = System.Text.Json.JsonEncodedText.Encode("hits"); - private static readonly System.Text.Json.JsonEncodedText PropMaxScore = System.Text.Json.JsonEncodedText.Encode("max_score"); - private static readonly System.Text.Json.JsonEncodedText PropNumReducePhases = System.Text.Json.JsonEncodedText.Encode("num_reduce_phases"); - private static readonly System.Text.Json.JsonEncodedText PropPitId = System.Text.Json.JsonEncodedText.Encode("pit_id"); - private static readonly System.Text.Json.JsonEncodedText PropProfile = System.Text.Json.JsonEncodedText.Encode("profile"); - private static readonly System.Text.Json.JsonEncodedText PropScrollId = System.Text.Json.JsonEncodedText.Encode("_scroll_id"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - private static readonly System.Text.Json.JsonEncodedText PropSuggest = System.Text.Json.JsonEncodedText.Encode("suggest"); - private static readonly System.Text.Json.JsonEncodedText PropTerminatedEarly = System.Text.Json.JsonEncodedText.Encode("terminated_early"); - private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); - private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); - - public override Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationSearchResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAggregations = default; - LocalJsonValue propClusters = default; - LocalJsonValue?> propFields = default; - LocalJsonValue> propHitsMetadata = default; - LocalJsonValue propMaxScore = default; - LocalJsonValue propNumReducePhases = default; - LocalJsonValue propPitId = default; - LocalJsonValue propProfile = default; - LocalJsonValue propScrollId = default; - LocalJsonValue propShards = default; - LocalJsonValue?> propSuggest = default; - LocalJsonValue propTerminatedEarly = default; - LocalJsonValue propTimedOut = default; - LocalJsonValue propTook = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, null)) - { - continue; - } - - if (propClusters.TryReadProperty(ref reader, options, PropClusters, null)) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propHitsMetadata.TryReadProperty(ref reader, options, PropHitsMetadata, null)) - { - continue; - } - - if (propMaxScore.TryReadProperty(ref reader, options, PropMaxScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNumReducePhases.TryReadProperty(ref reader, options, PropNumReducePhases, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPitId.TryReadProperty(ref reader, options, PropPitId, null)) - { - continue; - } - - if (propProfile.TryReadProperty(ref reader, options, PropProfile, null)) - { - continue; - } - - if (propScrollId.TryReadProperty(ref reader, options, PropScrollId, null)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (propSuggest.TryReadProperty(ref reader, options, PropSuggest, null)) - { - continue; - } - - if (propTerminatedEarly.TryReadProperty(ref reader, options, PropTerminatedEarly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, null)) - { - continue; - } - - if (propTook.TryReadProperty(ref reader, options, PropTook, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationSearchResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = propAggregations.Value, - Clusters = propClusters.Value, - Fields = propFields.Value, - HitsMetadata = propHitsMetadata.Value, - MaxScore = propMaxScore.Value, - NumReducePhases = propNumReducePhases.Value, - PitId = propPitId.Value, - Profile = propProfile.Value, - ScrollId = propScrollId.Value, - Shards = propShards.Value, - Suggest = propSuggest.Value, - TerminatedEarly = propTerminatedEarly.Value, - TimedOut = propTimedOut.Value, - Took = propTook.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationSearchResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregations, value.Aggregations, null, null); - writer.WriteProperty(options, PropClusters, value.Clusters, null, null); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropHitsMetadata, value.HitsMetadata, null, null); - writer.WriteProperty(options, PropMaxScore, value.MaxScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNumReducePhases, value.NumReducePhases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPitId, value.PitId, null, null); - writer.WriteProperty(options, PropProfile, value.Profile, null, null); - writer.WriteProperty(options, PropScrollId, value.ScrollId, null, null); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteProperty(options, PropSuggest, value.Suggest, null, null); - writer.WriteProperty(options, PropTerminatedEarly, value.TerminatedEarly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, null); - writer.WriteProperty(options, PropTook, value.Took, null, null); - writer.WriteEndObject(); - } -} - -internal sealed partial class SearchApplicationSearchResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(SearchApplicationSearchResponse<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(SearchApplicationSearchResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationSearchResponseConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.Json.SearchApplicationSearchResponseConverterFactory))] public sealed partial class SearchApplicationSearchResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchMvtRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchMvtRequest.Converters.g.cs new file mode 100644 index 00000000000..5a85bdee23d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchMvtRequest.Converters.g.cs @@ -0,0 +1,180 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class SearchMvtRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAggs = System.Text.Json.JsonEncodedText.Encode("aggs"); + private static readonly System.Text.Json.JsonEncodedText PropBuffer = System.Text.Json.JsonEncodedText.Encode("buffer"); + private static readonly System.Text.Json.JsonEncodedText PropExactBounds = System.Text.Json.JsonEncodedText.Encode("exact_bounds"); + private static readonly System.Text.Json.JsonEncodedText PropExtent = System.Text.Json.JsonEncodedText.Encode("extent"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropGridAgg = System.Text.Json.JsonEncodedText.Encode("grid_agg"); + private static readonly System.Text.Json.JsonEncodedText PropGridPrecision = System.Text.Json.JsonEncodedText.Encode("grid_precision"); + private static readonly System.Text.Json.JsonEncodedText PropGridType = System.Text.Json.JsonEncodedText.Encode("grid_type"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropRuntimeMappings = System.Text.Json.JsonEncodedText.Encode("runtime_mappings"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); + private static readonly System.Text.Json.JsonEncodedText PropTrackTotalHits = System.Text.Json.JsonEncodedText.Encode("track_total_hits"); + private static readonly System.Text.Json.JsonEncodedText PropWithLabels = System.Text.Json.JsonEncodedText.Encode("with_labels"); + + public override Elastic.Clients.Elasticsearch.SearchMvtRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAggs = default; + LocalJsonValue propBuffer = default; + LocalJsonValue propExactBounds = default; + LocalJsonValue propExtent = default; + LocalJsonValue propFields = default; + LocalJsonValue propGridAgg = default; + LocalJsonValue propGridPrecision = default; + LocalJsonValue propGridType = default; + LocalJsonValue propQuery = default; + LocalJsonValue?> propRuntimeMappings = default; + LocalJsonValue propSize = default; + LocalJsonValue?> propSort = default; + LocalJsonValue propTrackTotalHits = default; + LocalJsonValue propWithLabels = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggs.TryReadProperty(ref reader, options, PropAggs, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propBuffer.TryReadProperty(ref reader, options, PropBuffer, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propExactBounds.TryReadProperty(ref reader, options, PropExactBounds, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propExtent.TryReadProperty(ref reader, options, PropExtent, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propGridAgg.TryReadProperty(ref reader, options, PropGridAgg, static Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propGridPrecision.TryReadProperty(ref reader, options, PropGridPrecision, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propGridType.TryReadProperty(ref reader, options, PropGridType, static Elastic.Clients.Elasticsearch.Core.SearchMvt.GridType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propTrackTotalHits.TryReadProperty(ref reader, options, PropTrackTotalHits, null)) + { + continue; + } + + if (propWithLabels.TryReadProperty(ref reader, options, PropWithLabels, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchMvtRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggs = propAggs.Value, + Buffer = propBuffer.Value, + ExactBounds = propExactBounds.Value, + Extent = propExtent.Value, + Fields = propFields.Value, + GridAgg = propGridAgg.Value, + GridPrecision = propGridPrecision.Value, + GridType = propGridType.Value, + Query = propQuery.Value, + RuntimeMappings = propRuntimeMappings.Value, + Size = propSize.Value, + Sort = propSort.Value, + TrackTotalHits = propTrackTotalHits.Value, + WithLabels = propWithLabels.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchMvtRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggs, value.Aggs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropBuffer, value.Buffer, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropExactBounds, value.ExactBounds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropExtent, value.Extent, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropGridAgg, value.GridAgg, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropGridPrecision, value.GridPrecision, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropGridType, value.GridType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.SearchMvt.GridType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTrackTotalHits, value.TrackTotalHits, null, null); + writer.WriteProperty(options, PropWithLabels, value.WithLabels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchMvtRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchMvtRequest.g.cs index 5e14dc1b925..07bd634c54a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchMvtRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchMvtRequest.g.cs @@ -27,162 +27,6 @@ public sealed partial class SearchMvtRequestParameters : Elastic.Transport.Reque { } -internal sealed partial class SearchMvtRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAggs = System.Text.Json.JsonEncodedText.Encode("aggs"); - private static readonly System.Text.Json.JsonEncodedText PropBuffer = System.Text.Json.JsonEncodedText.Encode("buffer"); - private static readonly System.Text.Json.JsonEncodedText PropExactBounds = System.Text.Json.JsonEncodedText.Encode("exact_bounds"); - private static readonly System.Text.Json.JsonEncodedText PropExtent = System.Text.Json.JsonEncodedText.Encode("extent"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropGridAgg = System.Text.Json.JsonEncodedText.Encode("grid_agg"); - private static readonly System.Text.Json.JsonEncodedText PropGridPrecision = System.Text.Json.JsonEncodedText.Encode("grid_precision"); - private static readonly System.Text.Json.JsonEncodedText PropGridType = System.Text.Json.JsonEncodedText.Encode("grid_type"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropRuntimeMappings = System.Text.Json.JsonEncodedText.Encode("runtime_mappings"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); - private static readonly System.Text.Json.JsonEncodedText PropTrackTotalHits = System.Text.Json.JsonEncodedText.Encode("track_total_hits"); - private static readonly System.Text.Json.JsonEncodedText PropWithLabels = System.Text.Json.JsonEncodedText.Encode("with_labels"); - - public override Elastic.Clients.Elasticsearch.SearchMvtRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAggs = default; - LocalJsonValue propBuffer = default; - LocalJsonValue propExactBounds = default; - LocalJsonValue propExtent = default; - LocalJsonValue propFields = default; - LocalJsonValue propGridAgg = default; - LocalJsonValue propGridPrecision = default; - LocalJsonValue propGridType = default; - LocalJsonValue propQuery = default; - LocalJsonValue?> propRuntimeMappings = default; - LocalJsonValue propSize = default; - LocalJsonValue?> propSort = default; - LocalJsonValue propTrackTotalHits = default; - LocalJsonValue propWithLabels = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggs.TryReadProperty(ref reader, options, PropAggs, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propBuffer.TryReadProperty(ref reader, options, PropBuffer, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propExactBounds.TryReadProperty(ref reader, options, PropExactBounds, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propExtent.TryReadProperty(ref reader, options, PropExtent, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propGridAgg.TryReadProperty(ref reader, options, PropGridAgg, static Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propGridPrecision.TryReadProperty(ref reader, options, PropGridPrecision, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propGridType.TryReadProperty(ref reader, options, PropGridType, static Elastic.Clients.Elasticsearch.Core.SearchMvt.GridType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propTrackTotalHits.TryReadProperty(ref reader, options, PropTrackTotalHits, null)) - { - continue; - } - - if (propWithLabels.TryReadProperty(ref reader, options, PropWithLabels, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchMvtRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggs = propAggs.Value, - Buffer = propBuffer.Value, - ExactBounds = propExactBounds.Value, - Extent = propExtent.Value, - Fields = propFields.Value, - GridAgg = propGridAgg.Value, - GridPrecision = propGridPrecision.Value, - GridType = propGridType.Value, - Query = propQuery.Value, - RuntimeMappings = propRuntimeMappings.Value, - Size = propSize.Value, - Sort = propSort.Value, - TrackTotalHits = propTrackTotalHits.Value, - WithLabels = propWithLabels.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchMvtRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggs, value.Aggs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropBuffer, value.Buffer, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropExactBounds, value.ExactBounds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropExtent, value.Extent, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropGridAgg, value.GridAgg, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropGridPrecision, value.GridPrecision, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropGridType, value.GridType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.SearchMvt.GridType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTrackTotalHits, value.TrackTotalHits, null, null); - writer.WriteProperty(options, PropWithLabels, value.WithLabels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Search a vector tile. @@ -333,7 +177,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Learn how to use the vector tile search API with practical examples in the Vector tile search examples guide. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchMvtRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.SearchMvtRequestConverter))] public sealed partial class SearchMvtRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.Converters.g.cs new file mode 100644 index 00000000000..83cdd3adbb3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.Converters.g.cs @@ -0,0 +1,361 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class SearchRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + 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 PropRank = System.Text.Json.JsonEncodedText.Encode("rank"); + private static readonly System.Text.Json.JsonEncodedText PropRescore = System.Text.Json.JsonEncodedText.Encode("rescore"); + private static readonly System.Text.Json.JsonEncodedText PropRetriever = System.Text.Json.JsonEncodedText.Encode("retriever"); + 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 Elastic.Clients.Elasticsearch.SearchRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAggregations = default; + LocalJsonValue propCollapse = default; + LocalJsonValue?> propDocvalueFields = default; + LocalJsonValue propExplain = default; + LocalJsonValue?> propExt = default; + LocalJsonValue?> propFields = default; + LocalJsonValue propFrom = default; + LocalJsonValue propHighlight = default; + LocalJsonValue>?> propIndicesBoost = default; + LocalJsonValue?> propKnn = default; + LocalJsonValue propMinScore = default; + LocalJsonValue propPit = default; + LocalJsonValue propPostFilter = default; + LocalJsonValue propProfile = default; + LocalJsonValue propQuery = default; + LocalJsonValue propRank = default; + LocalJsonValue?> propRescore = default; + LocalJsonValue propRetriever = default; + LocalJsonValue?> propRuntimeMappings = default; + LocalJsonValue?> propScriptFields = default; + LocalJsonValue?> propSearchAfter = default; + LocalJsonValue propSeqNoPrimaryTerm = default; + LocalJsonValue propSize = default; + LocalJsonValue propSlice = default; + LocalJsonValue?> propSort = default; + LocalJsonValue propSource = default; + LocalJsonValue?> propStats = default; + LocalJsonValue propStoredFields = default; + LocalJsonValue propSuggest = default; + LocalJsonValue propTerminateAfter = default; + LocalJsonValue propTimeout = default; + LocalJsonValue propTrackScores = default; + LocalJsonValue propTrackTotalHits = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)) || propAggregations.TryReadProperty(ref reader, options, PropAggregations1, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propCollapse.TryReadProperty(ref reader, options, PropCollapse, null)) + { + continue; + } + + if (propDocvalueFields.TryReadProperty(ref reader, options, PropDocvalueFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propExplain.TryReadProperty(ref reader, options, PropExplain, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propExt.TryReadProperty(ref reader, options, PropExt, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propFrom.TryReadProperty(ref reader, options, PropFrom, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propHighlight.TryReadProperty(ref reader, options, PropHighlight, null)) + { + continue; + } + + if (propIndicesBoost.TryReadProperty(ref reader, options, PropIndicesBoost, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null)))) + { + continue; + } + + if (propKnn.TryReadProperty(ref reader, options, PropKnn, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPit.TryReadProperty(ref reader, options, PropPit, null)) + { + continue; + } + + if (propPostFilter.TryReadProperty(ref reader, options, PropPostFilter, null)) + { + continue; + } + + if (propProfile.TryReadProperty(ref reader, options, PropProfile, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propRank.TryReadProperty(ref reader, options, PropRank, null)) + { + continue; + } + + if (propRescore.TryReadProperty(ref reader, options, PropRescore, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propRetriever.TryReadProperty(ref reader, options, PropRetriever, null)) + { + continue; + } + + if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propScriptFields.TryReadProperty(ref reader, options, PropScriptFields, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propSearchAfter.TryReadProperty(ref reader, options, PropSearchAfter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propSeqNoPrimaryTerm.TryReadProperty(ref reader, options, PropSeqNoPrimaryTerm, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSlice.TryReadProperty(ref reader, options, PropSlice, null)) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (propStats.TryReadProperty(ref reader, options, PropStats, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStoredFields.TryReadProperty(ref reader, options, PropStoredFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propSuggest.TryReadProperty(ref reader, options, PropSuggest, null)) + { + continue; + } + + if (propTerminateAfter.TryReadProperty(ref reader, options, PropTerminateAfter, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeout.TryReadProperty(ref reader, options, PropTimeout, null)) + { + continue; + } + + if (propTrackScores.TryReadProperty(ref reader, options, PropTrackScores, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTrackTotalHits.TryReadProperty(ref reader, options, PropTrackTotalHits, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + 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, + Rank = propRank.Value, + Rescore = propRescore.Value, + Retriever = propRetriever.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, Elastic.Clients.Elasticsearch.SearchRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropCollapse, value.Collapse, null, null); + writer.WriteProperty(options, PropDocvalueFields, value.DocvalueFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropExplain, value.Explain, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropExt, value.Ext, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFrom, value.From, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropHighlight, value.Highlight, null, null); + writer.WriteProperty(options, PropIndicesBoost, value.IndicesBoost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null))); + writer.WriteProperty(options, PropKnn, value.Knn, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPit, value.Pit, null, null); + writer.WriteProperty(options, PropPostFilter, value.PostFilter, null, null); + writer.WriteProperty(options, PropProfile, value.Profile, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropRank, value.Rank, null, null); + writer.WriteProperty(options, PropRescore, value.Rescore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRetriever, value.Retriever, null, null); + writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropScriptFields, value.ScriptFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropSearchAfter, value.SearchAfter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSeqNoPrimaryTerm, value.SeqNoPrimaryTerm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSlice, value.Slice, null, null); + writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteProperty(options, PropStats, value.Stats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStoredFields, value.StoredFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropSuggest, value.Suggest, null, null); + writer.WriteProperty(options, PropTerminateAfter, value.TerminateAfter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeout, value.Timeout, null, null); + writer.WriteProperty(options, PropTrackScores, value.TrackScores, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTrackTotalHits, value.TrackTotalHits, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs index 8c48fbf7c4b..7c221d5b0ef 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs @@ -335,343 +335,6 @@ public sealed partial class SearchRequestParameters : Elastic.Transport.RequestP public bool? TypedKeys { get => Q("typed_keys"); set => Q("typed_keys", value); } } -internal sealed partial class SearchRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - 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 PropRank = System.Text.Json.JsonEncodedText.Encode("rank"); - private static readonly System.Text.Json.JsonEncodedText PropRescore = System.Text.Json.JsonEncodedText.Encode("rescore"); - private static readonly System.Text.Json.JsonEncodedText PropRetriever = System.Text.Json.JsonEncodedText.Encode("retriever"); - 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 Elastic.Clients.Elasticsearch.SearchRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAggregations = default; - LocalJsonValue propCollapse = default; - LocalJsonValue?> propDocvalueFields = default; - LocalJsonValue propExplain = default; - LocalJsonValue?> propExt = default; - LocalJsonValue?> propFields = default; - LocalJsonValue propFrom = default; - LocalJsonValue propHighlight = default; - LocalJsonValue>?> propIndicesBoost = default; - LocalJsonValue?> propKnn = default; - LocalJsonValue propMinScore = default; - LocalJsonValue propPit = default; - LocalJsonValue propPostFilter = default; - LocalJsonValue propProfile = default; - LocalJsonValue propQuery = default; - LocalJsonValue propRank = default; - LocalJsonValue?> propRescore = default; - LocalJsonValue propRetriever = default; - LocalJsonValue?> propRuntimeMappings = default; - LocalJsonValue?> propScriptFields = default; - LocalJsonValue?> propSearchAfter = default; - LocalJsonValue propSeqNoPrimaryTerm = default; - LocalJsonValue propSize = default; - LocalJsonValue propSlice = default; - LocalJsonValue?> propSort = default; - LocalJsonValue propSource = default; - LocalJsonValue?> propStats = default; - LocalJsonValue propStoredFields = default; - LocalJsonValue propSuggest = default; - LocalJsonValue propTerminateAfter = default; - LocalJsonValue propTimeout = default; - LocalJsonValue propTrackScores = default; - LocalJsonValue propTrackTotalHits = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)) || propAggregations.TryReadProperty(ref reader, options, PropAggregations1, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propCollapse.TryReadProperty(ref reader, options, PropCollapse, null)) - { - continue; - } - - if (propDocvalueFields.TryReadProperty(ref reader, options, PropDocvalueFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propExplain.TryReadProperty(ref reader, options, PropExplain, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propExt.TryReadProperty(ref reader, options, PropExt, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propFrom.TryReadProperty(ref reader, options, PropFrom, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propHighlight.TryReadProperty(ref reader, options, PropHighlight, null)) - { - continue; - } - - if (propIndicesBoost.TryReadProperty(ref reader, options, PropIndicesBoost, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null)))) - { - continue; - } - - if (propKnn.TryReadProperty(ref reader, options, PropKnn, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPit.TryReadProperty(ref reader, options, PropPit, null)) - { - continue; - } - - if (propPostFilter.TryReadProperty(ref reader, options, PropPostFilter, null)) - { - continue; - } - - if (propProfile.TryReadProperty(ref reader, options, PropProfile, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propRank.TryReadProperty(ref reader, options, PropRank, null)) - { - continue; - } - - if (propRescore.TryReadProperty(ref reader, options, PropRescore, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propRetriever.TryReadProperty(ref reader, options, PropRetriever, null)) - { - continue; - } - - if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propScriptFields.TryReadProperty(ref reader, options, PropScriptFields, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propSearchAfter.TryReadProperty(ref reader, options, PropSearchAfter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propSeqNoPrimaryTerm.TryReadProperty(ref reader, options, PropSeqNoPrimaryTerm, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSlice.TryReadProperty(ref reader, options, PropSlice, null)) - { - continue; - } - - if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (propStats.TryReadProperty(ref reader, options, PropStats, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStoredFields.TryReadProperty(ref reader, options, PropStoredFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propSuggest.TryReadProperty(ref reader, options, PropSuggest, null)) - { - continue; - } - - if (propTerminateAfter.TryReadProperty(ref reader, options, PropTerminateAfter, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeout.TryReadProperty(ref reader, options, PropTimeout, null)) - { - continue; - } - - if (propTrackScores.TryReadProperty(ref reader, options, PropTrackScores, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTrackTotalHits.TryReadProperty(ref reader, options, PropTrackTotalHits, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - 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, - Rank = propRank.Value, - Rescore = propRescore.Value, - Retriever = propRetriever.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, Elastic.Clients.Elasticsearch.SearchRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropCollapse, value.Collapse, null, null); - writer.WriteProperty(options, PropDocvalueFields, value.DocvalueFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropExplain, value.Explain, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropExt, value.Ext, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFrom, value.From, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropHighlight, value.Highlight, null, null); - writer.WriteProperty(options, PropIndicesBoost, value.IndicesBoost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null))); - writer.WriteProperty(options, PropKnn, value.Knn, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPit, value.Pit, null, null); - writer.WriteProperty(options, PropPostFilter, value.PostFilter, null, null); - writer.WriteProperty(options, PropProfile, value.Profile, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropRank, value.Rank, null, null); - writer.WriteProperty(options, PropRescore, value.Rescore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRetriever, value.Retriever, null, null); - writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropScriptFields, value.ScriptFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropSearchAfter, value.SearchAfter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSeqNoPrimaryTerm, value.SeqNoPrimaryTerm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSlice, value.Slice, null, null); - writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteProperty(options, PropStats, value.Stats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStoredFields, value.StoredFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropSuggest, value.Suggest, null, null); - writer.WriteProperty(options, PropTerminateAfter, value.TerminateAfter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeout, value.Timeout, null, null); - writer.WriteProperty(options, PropTrackScores, value.TrackScores, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTrackTotalHits, value.TrackTotalHits, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Run a search. @@ -702,7 +365,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// This situation can occur because the splitting criterion is based on Lucene document IDs, which are not stable across changes to the index. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.SearchRequestConverter))] public partial class SearchRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public SearchRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchResponse.Converters.g.cs new file mode 100644 index 00000000000..fd48a0b9c8e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchResponse.Converters.g.cs @@ -0,0 +1,196 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class SearchResponseConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); + private static readonly System.Text.Json.JsonEncodedText PropClusters = System.Text.Json.JsonEncodedText.Encode("_clusters"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropHitsMetadata = System.Text.Json.JsonEncodedText.Encode("hits"); + private static readonly System.Text.Json.JsonEncodedText PropMaxScore = System.Text.Json.JsonEncodedText.Encode("max_score"); + private static readonly System.Text.Json.JsonEncodedText PropNumReducePhases = System.Text.Json.JsonEncodedText.Encode("num_reduce_phases"); + private static readonly System.Text.Json.JsonEncodedText PropPitId = System.Text.Json.JsonEncodedText.Encode("pit_id"); + private static readonly System.Text.Json.JsonEncodedText PropProfile = System.Text.Json.JsonEncodedText.Encode("profile"); + private static readonly System.Text.Json.JsonEncodedText PropScrollId = System.Text.Json.JsonEncodedText.Encode("_scroll_id"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + private static readonly System.Text.Json.JsonEncodedText PropSuggest = System.Text.Json.JsonEncodedText.Encode("suggest"); + private static readonly System.Text.Json.JsonEncodedText PropTerminatedEarly = System.Text.Json.JsonEncodedText.Encode("terminated_early"); + private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); + private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); + + public override Elastic.Clients.Elasticsearch.SearchResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAggregations = default; + LocalJsonValue propClusters = default; + LocalJsonValue?> propFields = default; + LocalJsonValue> propHitsMetadata = default; + LocalJsonValue propMaxScore = default; + LocalJsonValue propNumReducePhases = default; + LocalJsonValue propPitId = default; + LocalJsonValue propProfile = default; + LocalJsonValue propScrollId = default; + LocalJsonValue propShards = default; + LocalJsonValue?> propSuggest = default; + LocalJsonValue propTerminatedEarly = default; + LocalJsonValue propTimedOut = default; + LocalJsonValue propTook = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, null)) + { + continue; + } + + if (propClusters.TryReadProperty(ref reader, options, PropClusters, null)) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propHitsMetadata.TryReadProperty(ref reader, options, PropHitsMetadata, null)) + { + continue; + } + + if (propMaxScore.TryReadProperty(ref reader, options, PropMaxScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNumReducePhases.TryReadProperty(ref reader, options, PropNumReducePhases, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPitId.TryReadProperty(ref reader, options, PropPitId, null)) + { + continue; + } + + if (propProfile.TryReadProperty(ref reader, options, PropProfile, null)) + { + continue; + } + + if (propScrollId.TryReadProperty(ref reader, options, PropScrollId, null)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (propSuggest.TryReadProperty(ref reader, options, PropSuggest, null)) + { + continue; + } + + if (propTerminatedEarly.TryReadProperty(ref reader, options, PropTerminatedEarly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, null)) + { + continue; + } + + if (propTook.TryReadProperty(ref reader, options, PropTook, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = propAggregations.Value, + Clusters = propClusters.Value, + Fields = propFields.Value, + HitsMetadata = propHitsMetadata.Value, + MaxScore = propMaxScore.Value, + NumReducePhases = propNumReducePhases.Value, + PitId = propPitId.Value, + Profile = propProfile.Value, + ScrollId = propScrollId.Value, + Shards = propShards.Value, + Suggest = propSuggest.Value, + TerminatedEarly = propTerminatedEarly.Value, + TimedOut = propTimedOut.Value, + Took = propTook.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregations, value.Aggregations, null, null); + writer.WriteProperty(options, PropClusters, value.Clusters, null, null); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropHitsMetadata, value.HitsMetadata, null, null); + writer.WriteProperty(options, PropMaxScore, value.MaxScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNumReducePhases, value.NumReducePhases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPitId, value.PitId, null, null); + writer.WriteProperty(options, PropProfile, value.Profile, null, null); + writer.WriteProperty(options, PropScrollId, value.ScrollId, null, null); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteProperty(options, PropSuggest, value.Suggest, null, null); + writer.WriteProperty(options, PropTerminatedEarly, value.TerminatedEarly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, null); + writer.WriteProperty(options, PropTook, value.Took, null, null); + writer.WriteEndObject(); + } +} + +public sealed partial class SearchResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(SearchResponse<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(SearchResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchResponse.g.cs index 65489f06ee6..cb0dc81b773 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchResponse.g.cs @@ -23,179 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class SearchResponseConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); - private static readonly System.Text.Json.JsonEncodedText PropClusters = System.Text.Json.JsonEncodedText.Encode("_clusters"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropHitsMetadata = System.Text.Json.JsonEncodedText.Encode("hits"); - private static readonly System.Text.Json.JsonEncodedText PropMaxScore = System.Text.Json.JsonEncodedText.Encode("max_score"); - private static readonly System.Text.Json.JsonEncodedText PropNumReducePhases = System.Text.Json.JsonEncodedText.Encode("num_reduce_phases"); - private static readonly System.Text.Json.JsonEncodedText PropPitId = System.Text.Json.JsonEncodedText.Encode("pit_id"); - private static readonly System.Text.Json.JsonEncodedText PropProfile = System.Text.Json.JsonEncodedText.Encode("profile"); - private static readonly System.Text.Json.JsonEncodedText PropScrollId = System.Text.Json.JsonEncodedText.Encode("_scroll_id"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - private static readonly System.Text.Json.JsonEncodedText PropSuggest = System.Text.Json.JsonEncodedText.Encode("suggest"); - private static readonly System.Text.Json.JsonEncodedText PropTerminatedEarly = System.Text.Json.JsonEncodedText.Encode("terminated_early"); - private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); - private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); - - public override Elastic.Clients.Elasticsearch.SearchResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAggregations = default; - LocalJsonValue propClusters = default; - LocalJsonValue?> propFields = default; - LocalJsonValue> propHitsMetadata = default; - LocalJsonValue propMaxScore = default; - LocalJsonValue propNumReducePhases = default; - LocalJsonValue propPitId = default; - LocalJsonValue propProfile = default; - LocalJsonValue propScrollId = default; - LocalJsonValue propShards = default; - LocalJsonValue?> propSuggest = default; - LocalJsonValue propTerminatedEarly = default; - LocalJsonValue propTimedOut = default; - LocalJsonValue propTook = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, null)) - { - continue; - } - - if (propClusters.TryReadProperty(ref reader, options, PropClusters, null)) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propHitsMetadata.TryReadProperty(ref reader, options, PropHitsMetadata, null)) - { - continue; - } - - if (propMaxScore.TryReadProperty(ref reader, options, PropMaxScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNumReducePhases.TryReadProperty(ref reader, options, PropNumReducePhases, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPitId.TryReadProperty(ref reader, options, PropPitId, null)) - { - continue; - } - - if (propProfile.TryReadProperty(ref reader, options, PropProfile, null)) - { - continue; - } - - if (propScrollId.TryReadProperty(ref reader, options, PropScrollId, null)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (propSuggest.TryReadProperty(ref reader, options, PropSuggest, null)) - { - continue; - } - - if (propTerminatedEarly.TryReadProperty(ref reader, options, PropTerminatedEarly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, null)) - { - continue; - } - - if (propTook.TryReadProperty(ref reader, options, PropTook, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = propAggregations.Value, - Clusters = propClusters.Value, - Fields = propFields.Value, - HitsMetadata = propHitsMetadata.Value, - MaxScore = propMaxScore.Value, - NumReducePhases = propNumReducePhases.Value, - PitId = propPitId.Value, - Profile = propProfile.Value, - ScrollId = propScrollId.Value, - Shards = propShards.Value, - Suggest = propSuggest.Value, - TerminatedEarly = propTerminatedEarly.Value, - TimedOut = propTimedOut.Value, - Took = propTook.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregations, value.Aggregations, null, null); - writer.WriteProperty(options, PropClusters, value.Clusters, null, null); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropHitsMetadata, value.HitsMetadata, null, null); - writer.WriteProperty(options, PropMaxScore, value.MaxScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNumReducePhases, value.NumReducePhases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPitId, value.PitId, null, null); - writer.WriteProperty(options, PropProfile, value.Profile, null, null); - writer.WriteProperty(options, PropScrollId, value.ScrollId, null, null); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteProperty(options, PropSuggest, value.Suggest, null, null); - writer.WriteProperty(options, PropTerminatedEarly, value.TerminatedEarly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, null); - writer.WriteProperty(options, PropTook, value.Took, null, null); - writer.WriteEndObject(); - } -} - -internal sealed partial class SearchResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(SearchResponse<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(SearchResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchResponseConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.SearchResponseConverterFactory))] public partial class SearchResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchShardsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchShardsRequest.Converters.g.cs new file mode 100644 index 00000000000..f7a170617a1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchShardsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class SearchShardsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.SearchShardsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchShardsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchShardsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchShardsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchShardsRequest.g.cs index 7848464abac..984f62240e3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchShardsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchShardsRequest.g.cs @@ -82,35 +82,6 @@ public sealed partial class SearchShardsRequestParameters : Elastic.Transport.Re public Elastic.Clients.Elasticsearch.Routing? Routing { get => Q("routing"); set => Q("routing", value); } } -internal sealed partial class SearchShardsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.SearchShardsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchShardsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchShardsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get the search shards. @@ -124,7 +95,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If the Elasticsearch security features are enabled, you must have the view_index_metadata or manage index privilege for the target data stream, index, or alias. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchShardsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.SearchShardsRequestConverter))] public sealed partial class SearchShardsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public SearchShardsRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchShardsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchShardsResponse.Converters.g.cs new file mode 100644 index 00000000000..96c5436f815 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchShardsResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class SearchShardsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + 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 PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); + + public override Elastic.Clients.Elasticsearch.SearchShardsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propIndices = default; + LocalJsonValue> propNodes = default; + LocalJsonValue>> propShards = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, static System.Collections.Generic.IReadOnlyCollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchShardsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Indices = propIndices.Value, + Nodes = propNodes.Value, + Shards = propShards.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchShardsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropShards, value.Shards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection> v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchShardsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchShardsResponse.g.cs index 91af040722c..e446a552df3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchShardsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchShardsResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class SearchShardsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - 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 PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); - - public override Elastic.Clients.Elasticsearch.SearchShardsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propIndices = default; - LocalJsonValue> propNodes = default; - LocalJsonValue>> propShards = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, static System.Collections.Generic.IReadOnlyCollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchShardsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Indices = propIndices.Value, - Nodes = propNodes.Value, - Shards = propShards.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchShardsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropShards, value.Shards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection> v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchShardsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.SearchShardsResponseConverter))] public sealed partial class SearchShardsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -96,17 +39,17 @@ internal SearchShardsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCo public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary Indices { get; set; } +System.Collections.Generic.IReadOnlyDictionary Indices { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } +System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection> Shards { get; set; } +System.Collections.Generic.IReadOnlyCollection> Shards { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateRequest.Converters.g.cs new file mode 100644 index 00000000000..c723a6bf287 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateRequest.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class SearchTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExplain = System.Text.Json.JsonEncodedText.Encode("explain"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); + private static readonly System.Text.Json.JsonEncodedText PropProfile = System.Text.Json.JsonEncodedText.Encode("profile"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + + public override Elastic.Clients.Elasticsearch.SearchTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExplain = default; + LocalJsonValue propId = default; + LocalJsonValue?> propParams = default; + LocalJsonValue propProfile = default; + LocalJsonValue propSource = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExplain.TryReadProperty(ref reader, options, PropExplain, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propProfile.TryReadProperty(ref reader, options, PropProfile, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Explain = propExplain.Value, + Id = propId.Value, + Params = propParams.Value, + Profile = propProfile.Value, + Source = propSource.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchTemplateRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExplain, value.Explain, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropProfile, value.Profile, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateRequest.g.cs index 02516f420a2..01d7db85fb3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateRequest.g.cs @@ -111,87 +111,12 @@ public sealed partial class SearchTemplateRequestParameters : Elastic.Transport. public bool? TypedKeys { get => Q("typed_keys"); set => Q("typed_keys", value); } } -internal sealed partial class SearchTemplateRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExplain = System.Text.Json.JsonEncodedText.Encode("explain"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); - private static readonly System.Text.Json.JsonEncodedText PropProfile = System.Text.Json.JsonEncodedText.Encode("profile"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - - public override Elastic.Clients.Elasticsearch.SearchTemplateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propExplain = default; - LocalJsonValue propId = default; - LocalJsonValue?> propParams = default; - LocalJsonValue propProfile = default; - LocalJsonValue propSource = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExplain.TryReadProperty(ref reader, options, PropExplain, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propProfile.TryReadProperty(ref reader, options, PropProfile, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchTemplateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Explain = propExplain.Value, - Id = propId.Value, - Params = propParams.Value, - Profile = propProfile.Value, - Source = propSource.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchTemplateRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExplain, value.Explain, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropProfile, value.Profile, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Run a search with a search template. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchTemplateRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.SearchTemplateRequestConverter))] public partial class SearchTemplateRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public SearchTemplateRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateResponse.Converters.g.cs new file mode 100644 index 00000000000..49f4362827e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateResponse.Converters.g.cs @@ -0,0 +1,196 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class SearchTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); + private static readonly System.Text.Json.JsonEncodedText PropClusters = System.Text.Json.JsonEncodedText.Encode("_clusters"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropHits = System.Text.Json.JsonEncodedText.Encode("hits"); + private static readonly System.Text.Json.JsonEncodedText PropMaxScore = System.Text.Json.JsonEncodedText.Encode("max_score"); + private static readonly System.Text.Json.JsonEncodedText PropNumReducePhases = System.Text.Json.JsonEncodedText.Encode("num_reduce_phases"); + private static readonly System.Text.Json.JsonEncodedText PropPitId = System.Text.Json.JsonEncodedText.Encode("pit_id"); + private static readonly System.Text.Json.JsonEncodedText PropProfile = System.Text.Json.JsonEncodedText.Encode("profile"); + private static readonly System.Text.Json.JsonEncodedText PropScrollId = System.Text.Json.JsonEncodedText.Encode("_scroll_id"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + private static readonly System.Text.Json.JsonEncodedText PropSuggest = System.Text.Json.JsonEncodedText.Encode("suggest"); + private static readonly System.Text.Json.JsonEncodedText PropTerminatedEarly = System.Text.Json.JsonEncodedText.Encode("terminated_early"); + private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); + private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); + + public override Elastic.Clients.Elasticsearch.SearchTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAggregations = default; + LocalJsonValue propClusters = default; + LocalJsonValue?> propFields = default; + LocalJsonValue> propHits = default; + LocalJsonValue propMaxScore = default; + LocalJsonValue propNumReducePhases = default; + LocalJsonValue propPitId = default; + LocalJsonValue propProfile = default; + LocalJsonValue propScrollId = default; + LocalJsonValue propShards = default; + LocalJsonValue?> propSuggest = default; + LocalJsonValue propTerminatedEarly = default; + LocalJsonValue propTimedOut = default; + LocalJsonValue propTook = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, null)) + { + continue; + } + + if (propClusters.TryReadProperty(ref reader, options, PropClusters, null)) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propHits.TryReadProperty(ref reader, options, PropHits, null)) + { + continue; + } + + if (propMaxScore.TryReadProperty(ref reader, options, PropMaxScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNumReducePhases.TryReadProperty(ref reader, options, PropNumReducePhases, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPitId.TryReadProperty(ref reader, options, PropPitId, null)) + { + continue; + } + + if (propProfile.TryReadProperty(ref reader, options, PropProfile, null)) + { + continue; + } + + if (propScrollId.TryReadProperty(ref reader, options, PropScrollId, null)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (propSuggest.TryReadProperty(ref reader, options, PropSuggest, null)) + { + continue; + } + + if (propTerminatedEarly.TryReadProperty(ref reader, options, PropTerminatedEarly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, null)) + { + continue; + } + + if (propTook.TryReadProperty(ref reader, options, PropTook, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = propAggregations.Value, + Clusters = propClusters.Value, + Fields = propFields.Value, + Hits = propHits.Value, + MaxScore = propMaxScore.Value, + NumReducePhases = propNumReducePhases.Value, + PitId = propPitId.Value, + Profile = propProfile.Value, + ScrollId = propScrollId.Value, + Shards = propShards.Value, + Suggest = propSuggest.Value, + TerminatedEarly = propTerminatedEarly.Value, + TimedOut = propTimedOut.Value, + Took = propTook.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchTemplateResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregations, value.Aggregations, null, null); + writer.WriteProperty(options, PropClusters, value.Clusters, null, null); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropHits, value.Hits, null, null); + writer.WriteProperty(options, PropMaxScore, value.MaxScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNumReducePhases, value.NumReducePhases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPitId, value.PitId, null, null); + writer.WriteProperty(options, PropProfile, value.Profile, null, null); + writer.WriteProperty(options, PropScrollId, value.ScrollId, null, null); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteProperty(options, PropSuggest, value.Suggest, null, null); + writer.WriteProperty(options, PropTerminatedEarly, value.TerminatedEarly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, null); + writer.WriteProperty(options, PropTook, value.Took, null, null); + writer.WriteEndObject(); + } +} + +public sealed partial class SearchTemplateResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(SearchTemplateResponse<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(SearchTemplateResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateResponse.g.cs index 62b64d84c6a..69827c644b0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchTemplateResponse.g.cs @@ -23,179 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class SearchTemplateResponseConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); - private static readonly System.Text.Json.JsonEncodedText PropClusters = System.Text.Json.JsonEncodedText.Encode("_clusters"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropHits = System.Text.Json.JsonEncodedText.Encode("hits"); - private static readonly System.Text.Json.JsonEncodedText PropMaxScore = System.Text.Json.JsonEncodedText.Encode("max_score"); - private static readonly System.Text.Json.JsonEncodedText PropNumReducePhases = System.Text.Json.JsonEncodedText.Encode("num_reduce_phases"); - private static readonly System.Text.Json.JsonEncodedText PropPitId = System.Text.Json.JsonEncodedText.Encode("pit_id"); - private static readonly System.Text.Json.JsonEncodedText PropProfile = System.Text.Json.JsonEncodedText.Encode("profile"); - private static readonly System.Text.Json.JsonEncodedText PropScrollId = System.Text.Json.JsonEncodedText.Encode("_scroll_id"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - private static readonly System.Text.Json.JsonEncodedText PropSuggest = System.Text.Json.JsonEncodedText.Encode("suggest"); - private static readonly System.Text.Json.JsonEncodedText PropTerminatedEarly = System.Text.Json.JsonEncodedText.Encode("terminated_early"); - private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); - private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); - - public override Elastic.Clients.Elasticsearch.SearchTemplateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAggregations = default; - LocalJsonValue propClusters = default; - LocalJsonValue?> propFields = default; - LocalJsonValue> propHits = default; - LocalJsonValue propMaxScore = default; - LocalJsonValue propNumReducePhases = default; - LocalJsonValue propPitId = default; - LocalJsonValue propProfile = default; - LocalJsonValue propScrollId = default; - LocalJsonValue propShards = default; - LocalJsonValue?> propSuggest = default; - LocalJsonValue propTerminatedEarly = default; - LocalJsonValue propTimedOut = default; - LocalJsonValue propTook = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, null)) - { - continue; - } - - if (propClusters.TryReadProperty(ref reader, options, PropClusters, null)) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propHits.TryReadProperty(ref reader, options, PropHits, null)) - { - continue; - } - - if (propMaxScore.TryReadProperty(ref reader, options, PropMaxScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNumReducePhases.TryReadProperty(ref reader, options, PropNumReducePhases, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPitId.TryReadProperty(ref reader, options, PropPitId, null)) - { - continue; - } - - if (propProfile.TryReadProperty(ref reader, options, PropProfile, null)) - { - continue; - } - - if (propScrollId.TryReadProperty(ref reader, options, PropScrollId, null)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (propSuggest.TryReadProperty(ref reader, options, PropSuggest, null)) - { - continue; - } - - if (propTerminatedEarly.TryReadProperty(ref reader, options, PropTerminatedEarly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, null)) - { - continue; - } - - if (propTook.TryReadProperty(ref reader, options, PropTook, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = propAggregations.Value, - Clusters = propClusters.Value, - Fields = propFields.Value, - Hits = propHits.Value, - MaxScore = propMaxScore.Value, - NumReducePhases = propNumReducePhases.Value, - PitId = propPitId.Value, - Profile = propProfile.Value, - ScrollId = propScrollId.Value, - Shards = propShards.Value, - Suggest = propSuggest.Value, - TerminatedEarly = propTerminatedEarly.Value, - TimedOut = propTimedOut.Value, - Took = propTook.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchTemplateResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregations, value.Aggregations, null, null); - writer.WriteProperty(options, PropClusters, value.Clusters, null, null); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropHits, value.Hits, null, null); - writer.WriteProperty(options, PropMaxScore, value.MaxScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNumReducePhases, value.NumReducePhases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPitId, value.PitId, null, null); - writer.WriteProperty(options, PropProfile, value.Profile, null, null); - writer.WriteProperty(options, PropScrollId, value.ScrollId, null, null); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteProperty(options, PropSuggest, value.Suggest, null, null); - writer.WriteProperty(options, PropTerminatedEarly, value.TerminatedEarly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, null); - writer.WriteProperty(options, PropTook, value.Took, null, null); - writer.WriteEndObject(); - } -} - -internal sealed partial class SearchTemplateResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(SearchTemplateResponse<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(SearchTemplateResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchTemplateResponseConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.SearchTemplateResponseConverterFactory))] public sealed partial class SearchTemplateResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -214,9 +42,9 @@ internal SearchTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.Json public System.Collections.Generic.IReadOnlyDictionary? Fields { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Core.Search.HitsMetadata Hits { get; set; } +Elastic.Clients.Elasticsearch.Core.Search.HitsMetadata Hits { get; set; } public double? MaxScore { get; set; } public long? NumReducePhases { get; set; } public string? PitId { get; set; } @@ -224,19 +52,19 @@ internal SearchTemplateResponse(Elastic.Clients.Elasticsearch.Serialization.Json public Elastic.Clients.Elasticsearch.ScrollId? ScrollId { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; set; } +Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; set; } public Elastic.Clients.Elasticsearch.Core.Search.SuggestDictionary? Suggest { get; set; } public bool? TerminatedEarly { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool TimedOut { get; set; } +bool TimedOut { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long Took { get; set; } +long Took { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/CacheStatsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/CacheStatsRequest.Converters.g.cs new file mode 100644 index 00000000000..053a64b9c79 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/CacheStatsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchableSnapshots.Json; + +public sealed partial class CacheStatsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.SearchableSnapshots.CacheStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchableSnapshots.CacheStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchableSnapshots.CacheStatsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/CacheStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/CacheStatsRequest.g.cs index 1403872f7e1..615621db4fd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/CacheStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/CacheStatsRequest.g.cs @@ -28,42 +28,13 @@ public sealed partial class CacheStatsRequestParameters : Elastic.Transport.Requ public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class CacheStatsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.SearchableSnapshots.CacheStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchableSnapshots.CacheStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchableSnapshots.CacheStatsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get cache statistics. /// Get statistics about the shared cache for partially mounted indices. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchableSnapshots.CacheStatsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchableSnapshots.Json.CacheStatsRequestConverter))] public sealed partial class CacheStatsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public CacheStatsRequest(Elastic.Clients.Elasticsearch.NodeIds? nodeId) : base(r => r.Optional("node_id", nodeId)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/CacheStatsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/CacheStatsResponse.Converters.g.cs new file mode 100644 index 00000000000..d5e2563c30e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/CacheStatsResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchableSnapshots.Json; + +public sealed partial class CacheStatsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); + + public override Elastic.Clients.Elasticsearch.SearchableSnapshots.CacheStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propNodes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchableSnapshots.CacheStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Nodes = propNodes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchableSnapshots.CacheStatsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/CacheStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/CacheStatsResponse.g.cs index 17aeeaed6ab..757534f4c04 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/CacheStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/CacheStatsResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SearchableSnapshots; -internal sealed partial class CacheStatsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); - - public override Elastic.Clients.Elasticsearch.SearchableSnapshots.CacheStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propNodes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchableSnapshots.CacheStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Nodes = propNodes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchableSnapshots.CacheStatsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchableSnapshots.CacheStatsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchableSnapshots.Json.CacheStatsResponseConverter))] public sealed partial class CacheStatsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal CacheStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCons public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } +System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/ClearCacheRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/ClearCacheRequest.Converters.g.cs new file mode 100644 index 00000000000..4361693f903 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/ClearCacheRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchableSnapshots.Json; + +public sealed partial class ClearCacheRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.SearchableSnapshots.ClearCacheRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchableSnapshots.ClearCacheRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchableSnapshots.ClearCacheRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/ClearCacheRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/ClearCacheRequest.g.cs index 03a400a896a..7b86a84cc03 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/ClearCacheRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/ClearCacheRequest.g.cs @@ -47,42 +47,13 @@ public sealed partial class ClearCacheRequestParameters : Elastic.Transport.Requ public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } } -internal sealed partial class ClearCacheRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.SearchableSnapshots.ClearCacheRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchableSnapshots.ClearCacheRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchableSnapshots.ClearCacheRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Clear the cache. /// Clear indices and data streams from the shared cache for partially mounted indices. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchableSnapshots.ClearCacheRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchableSnapshots.Json.ClearCacheRequestConverter))] public sealed partial class ClearCacheRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public ClearCacheRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/ClearCacheResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/ClearCacheResponse.Converters.g.cs new file mode 100644 index 00000000000..61e498b4892 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/ClearCacheResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchableSnapshots.Json; + +public sealed partial class ClearCacheResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.SearchableSnapshots.ClearCacheResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.SearchableSnapshots.ClearCacheResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Result = reader.ReadValue(options, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchableSnapshots.ClearCacheResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Result, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/ClearCacheResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/ClearCacheResponse.g.cs index 7c0dde8fefc..62ff64741c8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/ClearCacheResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/ClearCacheResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SearchableSnapshots; -internal sealed partial class ClearCacheResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.SearchableSnapshots.ClearCacheResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.SearchableSnapshots.ClearCacheResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Result = reader.ReadValue(options, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchableSnapshots.ClearCacheResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Result, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchableSnapshots.ClearCacheResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchableSnapshots.Json.ClearCacheResponseConverter))] public sealed partial class ClearCacheResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/MountRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/MountRequest.Converters.g.cs new file mode 100644 index 00000000000..2a20965048f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/MountRequest.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchableSnapshots.Json; + +public sealed partial class MountRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIgnoreIndexSettings = System.Text.Json.JsonEncodedText.Encode("ignore_index_settings"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropIndexSettings = System.Text.Json.JsonEncodedText.Encode("index_settings"); + private static readonly System.Text.Json.JsonEncodedText PropRenamedIndex = System.Text.Json.JsonEncodedText.Encode("renamed_index"); + + public override Elastic.Clients.Elasticsearch.SearchableSnapshots.MountRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propIgnoreIndexSettings = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propIndexSettings = default; + LocalJsonValue propRenamedIndex = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIgnoreIndexSettings.TryReadProperty(ref reader, options, PropIgnoreIndexSettings, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propIndexSettings.TryReadProperty(ref reader, options, PropIndexSettings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propRenamedIndex.TryReadProperty(ref reader, options, PropRenamedIndex, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchableSnapshots.MountRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + IgnoreIndexSettings = propIgnoreIndexSettings.Value, + Index = propIndex.Value, + IndexSettings = propIndexSettings.Value, + RenamedIndex = propRenamedIndex.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchableSnapshots.MountRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIgnoreIndexSettings, value.IgnoreIndexSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropIndexSettings, value.IndexSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropRenamedIndex, value.RenamedIndex, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/MountRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/MountRequest.g.cs index 4ba273dcfa9..0222c20b1b1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/MountRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/MountRequest.g.cs @@ -49,72 +49,6 @@ public sealed partial class MountRequestParameters : Elastic.Transport.RequestPa public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } } -internal sealed partial class MountRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIgnoreIndexSettings = System.Text.Json.JsonEncodedText.Encode("ignore_index_settings"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropIndexSettings = System.Text.Json.JsonEncodedText.Encode("index_settings"); - private static readonly System.Text.Json.JsonEncodedText PropRenamedIndex = System.Text.Json.JsonEncodedText.Encode("renamed_index"); - - public override Elastic.Clients.Elasticsearch.SearchableSnapshots.MountRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propIgnoreIndexSettings = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propIndexSettings = default; - LocalJsonValue propRenamedIndex = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIgnoreIndexSettings.TryReadProperty(ref reader, options, PropIgnoreIndexSettings, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propIndexSettings.TryReadProperty(ref reader, options, PropIndexSettings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propRenamedIndex.TryReadProperty(ref reader, options, PropRenamedIndex, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchableSnapshots.MountRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - IgnoreIndexSettings = propIgnoreIndexSettings.Value, - Index = propIndex.Value, - IndexSettings = propIndexSettings.Value, - RenamedIndex = propRenamedIndex.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchableSnapshots.MountRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIgnoreIndexSettings, value.IgnoreIndexSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropIndexSettings, value.IndexSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropRenamedIndex, value.RenamedIndex, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Mount a snapshot. @@ -123,7 +57,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Manually mounting ILM-managed snapshots can interfere with ILM processes. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchableSnapshots.MountRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchableSnapshots.Json.MountRequestConverter))] public sealed partial class MountRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/MountResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/MountResponse.Converters.g.cs new file mode 100644 index 00000000000..c4156ec6f68 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/MountResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchableSnapshots.Json; + +public sealed partial class MountResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSnapshot = System.Text.Json.JsonEncodedText.Encode("snapshot"); + + public override Elastic.Clients.Elasticsearch.SearchableSnapshots.MountResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propSnapshot = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSnapshot.TryReadProperty(ref reader, options, PropSnapshot, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchableSnapshots.MountResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Snapshot = propSnapshot.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchableSnapshots.MountResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSnapshot, value.Snapshot, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/MountResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/MountResponse.g.cs index a67806a640b..68be7db5f28 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/MountResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/MountResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SearchableSnapshots; -internal sealed partial class MountResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSnapshot = System.Text.Json.JsonEncodedText.Encode("snapshot"); - - public override Elastic.Clients.Elasticsearch.SearchableSnapshots.MountResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propSnapshot = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSnapshot.TryReadProperty(ref reader, options, PropSnapshot, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchableSnapshots.MountResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Snapshot = propSnapshot.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchableSnapshots.MountResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSnapshot, value.Snapshot, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchableSnapshots.MountResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchableSnapshots.Json.MountResponseConverter))] public sealed partial class MountResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal MountResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstruct public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.SearchableSnapshots.MountedSnapshot Snapshot { get; set; } +Elastic.Clients.Elasticsearch.SearchableSnapshots.MountedSnapshot Snapshot { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/SearchableSnapshotsStatsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/SearchableSnapshotsStatsRequest.Converters.g.cs new file mode 100644 index 00000000000..76c0a1097f2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/SearchableSnapshotsStatsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchableSnapshots.Json; + +public sealed partial class SearchableSnapshotsStatsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.SearchableSnapshots.SearchableSnapshotsStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchableSnapshots.SearchableSnapshotsStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchableSnapshots.SearchableSnapshotsStatsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/SearchableSnapshotsStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/SearchableSnapshotsStatsRequest.g.cs index 13ac704e662..aac922cd4f6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/SearchableSnapshotsStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/SearchableSnapshotsStatsRequest.g.cs @@ -33,41 +33,12 @@ public sealed partial class SearchableSnapshotsStatsRequestParameters : Elastic. public Elastic.Clients.Elasticsearch.SearchableSnapshots.StatsLevel? Level { get => Q("level"); set => Q("level", value); } } -internal sealed partial class SearchableSnapshotsStatsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.SearchableSnapshots.SearchableSnapshotsStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchableSnapshots.SearchableSnapshotsStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchableSnapshots.SearchableSnapshotsStatsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get searchable snapshot statistics. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchableSnapshots.SearchableSnapshotsStatsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchableSnapshots.Json.SearchableSnapshotsStatsRequestConverter))] public sealed partial class SearchableSnapshotsStatsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public SearchableSnapshotsStatsRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/SearchableSnapshotsStatsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/SearchableSnapshotsStatsResponse.Converters.g.cs new file mode 100644 index 00000000000..d67b76d0f2c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/SearchableSnapshotsStatsResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchableSnapshots.Json; + +public sealed partial class SearchableSnapshotsStatsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStats = System.Text.Json.JsonEncodedText.Encode("stats"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.SearchableSnapshots.SearchableSnapshotsStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propStats = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStats.TryReadProperty(ref reader, options, PropStats, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchableSnapshots.SearchableSnapshotsStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Stats = propStats.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchableSnapshots.SearchableSnapshotsStatsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStats, value.Stats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTotal, value.Total, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/SearchableSnapshotsStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/SearchableSnapshotsStatsResponse.g.cs index b29fd46c9ed..0dc3e6b65e6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/SearchableSnapshotsStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchableSnapshots/SearchableSnapshotsStatsResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SearchableSnapshots; -internal sealed partial class SearchableSnapshotsStatsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStats = System.Text.Json.JsonEncodedText.Encode("stats"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.SearchableSnapshots.SearchableSnapshotsStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propStats = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStats.TryReadProperty(ref reader, options, PropStats, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchableSnapshots.SearchableSnapshotsStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Stats = propStats.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchableSnapshots.SearchableSnapshotsStatsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStats, value.Stats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTotal, value.Total, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchableSnapshots.SearchableSnapshotsStatsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchableSnapshots.Json.SearchableSnapshotsStatsResponseConverter))] public sealed partial class SearchableSnapshotsStatsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal SearchableSnapshotsStatsResponse(Elastic.Clients.Elasticsearch.Serializ public #if NET7_0_OR_GREATER - required +required #endif - object Stats { get; set; } +object Stats { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - object Total { get; set; } +object Total { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ActivateUserProfileRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ActivateUserProfileRequest.Converters.g.cs new file mode 100644 index 00000000000..b4a5ac01ced --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ActivateUserProfileRequest.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ActivateUserProfileRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAccessToken = System.Text.Json.JsonEncodedText.Encode("access_token"); + private static readonly System.Text.Json.JsonEncodedText PropGrantType = System.Text.Json.JsonEncodedText.Encode("grant_type"); + private static readonly System.Text.Json.JsonEncodedText PropPassword = System.Text.Json.JsonEncodedText.Encode("password"); + private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); + + public override Elastic.Clients.Elasticsearch.Security.ActivateUserProfileRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAccessToken = default; + LocalJsonValue propGrantType = default; + LocalJsonValue propPassword = default; + LocalJsonValue propUsername = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAccessToken.TryReadProperty(ref reader, options, PropAccessToken, null)) + { + continue; + } + + if (propGrantType.TryReadProperty(ref reader, options, PropGrantType, null)) + { + continue; + } + + if (propPassword.TryReadProperty(ref reader, options, PropPassword, null)) + { + continue; + } + + if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.ActivateUserProfileRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AccessToken = propAccessToken.Value, + GrantType = propGrantType.Value, + Password = propPassword.Value, + Username = propUsername.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ActivateUserProfileRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAccessToken, value.AccessToken, null, null); + writer.WriteProperty(options, PropGrantType, value.GrantType, null, null); + writer.WriteProperty(options, PropPassword, value.Password, null, null); + writer.WriteProperty(options, PropUsername, value.Username, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ActivateUserProfileRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ActivateUserProfileRequest.g.cs index 9a433b7354a..48c19fde0a8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ActivateUserProfileRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ActivateUserProfileRequest.g.cs @@ -27,72 +27,6 @@ public sealed partial class ActivateUserProfileRequestParameters : Elastic.Trans { } -internal sealed partial class ActivateUserProfileRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAccessToken = System.Text.Json.JsonEncodedText.Encode("access_token"); - private static readonly System.Text.Json.JsonEncodedText PropGrantType = System.Text.Json.JsonEncodedText.Encode("grant_type"); - private static readonly System.Text.Json.JsonEncodedText PropPassword = System.Text.Json.JsonEncodedText.Encode("password"); - private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); - - public override Elastic.Clients.Elasticsearch.Security.ActivateUserProfileRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAccessToken = default; - LocalJsonValue propGrantType = default; - LocalJsonValue propPassword = default; - LocalJsonValue propUsername = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAccessToken.TryReadProperty(ref reader, options, PropAccessToken, null)) - { - continue; - } - - if (propGrantType.TryReadProperty(ref reader, options, PropGrantType, null)) - { - continue; - } - - if (propPassword.TryReadProperty(ref reader, options, PropPassword, null)) - { - continue; - } - - if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.ActivateUserProfileRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AccessToken = propAccessToken.Value, - GrantType = propGrantType.Value, - Password = propPassword.Value, - Username = propUsername.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ActivateUserProfileRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAccessToken, value.AccessToken, null, null); - writer.WriteProperty(options, PropGrantType, value.GrantType, null, null); - writer.WriteProperty(options, PropPassword, value.Password, null, null); - writer.WriteProperty(options, PropUsername, value.Username, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Activate a user profile. @@ -115,7 +49,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Any updates do not change existing content for either the labels or data fields. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ActivateUserProfileRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ActivateUserProfileRequestConverter))] public sealed partial class ActivateUserProfileRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ActivateUserProfileResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ActivateUserProfileResponse.Converters.g.cs new file mode 100644 index 00000000000..18ebe090866 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ActivateUserProfileResponse.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ActivateUserProfileResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropData = System.Text.Json.JsonEncodedText.Encode("data"); + private static readonly System.Text.Json.JsonEncodedText PropDoc = System.Text.Json.JsonEncodedText.Encode("_doc"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropLabels = System.Text.Json.JsonEncodedText.Encode("labels"); + private static readonly System.Text.Json.JsonEncodedText PropLastSynchronized = System.Text.Json.JsonEncodedText.Encode("last_synchronized"); + private static readonly System.Text.Json.JsonEncodedText PropUid = System.Text.Json.JsonEncodedText.Encode("uid"); + private static readonly System.Text.Json.JsonEncodedText PropUser = System.Text.Json.JsonEncodedText.Encode("user"); + + public override Elastic.Clients.Elasticsearch.Security.ActivateUserProfileResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propData = default; + LocalJsonValue propDoc = default; + LocalJsonValue propEnabled = default; + LocalJsonValue> propLabels = default; + LocalJsonValue propLastSynchronized = default; + LocalJsonValue propUid = default; + LocalJsonValue propUser = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propData.TryReadProperty(ref reader, options, PropData, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (propDoc.TryReadProperty(ref reader, options, PropDoc, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLabels.TryReadProperty(ref reader, options, PropLabels, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (propLastSynchronized.TryReadProperty(ref reader, options, PropLastSynchronized, null)) + { + continue; + } + + if (propUid.TryReadProperty(ref reader, options, PropUid, null)) + { + continue; + } + + if (propUser.TryReadProperty(ref reader, options, PropUser, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.ActivateUserProfileResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Data = propData.Value, + Doc = propDoc.Value, + Enabled = propEnabled.Value, + Labels = propLabels.Value, + LastSynchronized = propLastSynchronized.Value, + Uid = propUid.Value, + User = propUser.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ActivateUserProfileResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropData, value.Data, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropDoc, value.Doc, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLabels, value.Labels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropLastSynchronized, value.LastSynchronized, null, null); + writer.WriteProperty(options, PropUid, value.Uid, null, null); + writer.WriteProperty(options, PropUser, value.User, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ActivateUserProfileResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ActivateUserProfileResponse.g.cs index 413ac01f033..456a331bcf8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ActivateUserProfileResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ActivateUserProfileResponse.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class ActivateUserProfileResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropData = System.Text.Json.JsonEncodedText.Encode("data"); - private static readonly System.Text.Json.JsonEncodedText PropDoc = System.Text.Json.JsonEncodedText.Encode("_doc"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropLabels = System.Text.Json.JsonEncodedText.Encode("labels"); - private static readonly System.Text.Json.JsonEncodedText PropLastSynchronized = System.Text.Json.JsonEncodedText.Encode("last_synchronized"); - private static readonly System.Text.Json.JsonEncodedText PropUid = System.Text.Json.JsonEncodedText.Encode("uid"); - private static readonly System.Text.Json.JsonEncodedText PropUser = System.Text.Json.JsonEncodedText.Encode("user"); - - public override Elastic.Clients.Elasticsearch.Security.ActivateUserProfileResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propData = default; - LocalJsonValue propDoc = default; - LocalJsonValue propEnabled = default; - LocalJsonValue> propLabels = default; - LocalJsonValue propLastSynchronized = default; - LocalJsonValue propUid = default; - LocalJsonValue propUser = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propData.TryReadProperty(ref reader, options, PropData, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (propDoc.TryReadProperty(ref reader, options, PropDoc, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLabels.TryReadProperty(ref reader, options, PropLabels, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (propLastSynchronized.TryReadProperty(ref reader, options, PropLastSynchronized, null)) - { - continue; - } - - if (propUid.TryReadProperty(ref reader, options, PropUid, null)) - { - continue; - } - - if (propUser.TryReadProperty(ref reader, options, PropUser, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.ActivateUserProfileResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Data = propData.Value, - Doc = propDoc.Value, - Enabled = propEnabled.Value, - Labels = propLabels.Value, - LastSynchronized = propLastSynchronized.Value, - Uid = propUid.Value, - User = propUser.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ActivateUserProfileResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropData, value.Data, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropDoc, value.Doc, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLabels, value.Labels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropLastSynchronized, value.LastSynchronized, null, null); - writer.WriteProperty(options, PropUid, value.Uid, null, null); - writer.WriteProperty(options, PropUser, value.User, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ActivateUserProfileResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ActivateUserProfileResponseConverter))] public sealed partial class ActivateUserProfileResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -132,33 +39,33 @@ internal ActivateUserProfileResponse(Elastic.Clients.Elasticsearch.Serialization public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary Data { get; set; } +System.Collections.Generic.IReadOnlyDictionary Data { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Security.UserProfileHitMetadata Doc { get; set; } +Elastic.Clients.Elasticsearch.Security.UserProfileHitMetadata Doc { get; set; } public bool? Enabled { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary Labels { get; set; } +System.Collections.Generic.IReadOnlyDictionary Labels { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long LastSynchronized { get; set; } +long LastSynchronized { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Uid { get; set; } +string Uid { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Security.UserProfileUser User { get; set; } +Elastic.Clients.Elasticsearch.Security.UserProfileUser User { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/AuthenticateRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/AuthenticateRequest.Converters.g.cs new file mode 100644 index 00000000000..50c01af3cbe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/AuthenticateRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class AuthenticateRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.AuthenticateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.AuthenticateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.AuthenticateRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/AuthenticateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/AuthenticateRequest.g.cs index c900f045095..50055cfd08e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/AuthenticateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/AuthenticateRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class AuthenticateRequestParameters : Elastic.Transport.Re { } -internal sealed partial class AuthenticateRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.AuthenticateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.AuthenticateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.AuthenticateRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Authenticate a user. @@ -67,7 +38,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If the user cannot be authenticated, this API returns a 401 status code. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.AuthenticateRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.AuthenticateRequestConverter))] public sealed partial class AuthenticateRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/AuthenticateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/AuthenticateResponse.Converters.g.cs new file mode 100644 index 00000000000..d90b34be941 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/AuthenticateResponse.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class AuthenticateResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); + private static readonly System.Text.Json.JsonEncodedText PropAuthenticationRealm = System.Text.Json.JsonEncodedText.Encode("authentication_realm"); + private static readonly System.Text.Json.JsonEncodedText PropAuthenticationType = System.Text.Json.JsonEncodedText.Encode("authentication_type"); + private static readonly System.Text.Json.JsonEncodedText PropEmail = System.Text.Json.JsonEncodedText.Encode("email"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropFullName = System.Text.Json.JsonEncodedText.Encode("full_name"); + private static readonly System.Text.Json.JsonEncodedText PropLookupRealm = System.Text.Json.JsonEncodedText.Encode("lookup_realm"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + private static readonly System.Text.Json.JsonEncodedText PropToken = System.Text.Json.JsonEncodedText.Encode("token"); + private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); + + public override Elastic.Clients.Elasticsearch.Security.AuthenticateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApiKey = default; + LocalJsonValue propAuthenticationRealm = default; + LocalJsonValue propAuthenticationType = default; + LocalJsonValue propEmail = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propFullName = default; + LocalJsonValue propLookupRealm = default; + LocalJsonValue> propMetadata = default; + LocalJsonValue> propRoles = default; + LocalJsonValue propToken = default; + LocalJsonValue propUsername = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) + { + continue; + } + + if (propAuthenticationRealm.TryReadProperty(ref reader, options, PropAuthenticationRealm, null)) + { + continue; + } + + if (propAuthenticationType.TryReadProperty(ref reader, options, PropAuthenticationType, null)) + { + continue; + } + + if (propEmail.TryReadProperty(ref reader, options, PropEmail, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propFullName.TryReadProperty(ref reader, options, PropFullName, null)) + { + continue; + } + + if (propLookupRealm.TryReadProperty(ref reader, options, PropLookupRealm, null)) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propToken.TryReadProperty(ref reader, options, PropToken, null)) + { + continue; + } + + if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.AuthenticateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ApiKey = propApiKey.Value, + AuthenticationRealm = propAuthenticationRealm.Value, + AuthenticationType = propAuthenticationType.Value, + Email = propEmail.Value, + Enabled = propEnabled.Value, + FullName = propFullName.Value, + LookupRealm = propLookupRealm.Value, + Metadata = propMetadata.Value, + Roles = propRoles.Value, + Token = propToken.Value, + Username = propUsername.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.AuthenticateResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); + writer.WriteProperty(options, PropAuthenticationRealm, value.AuthenticationRealm, null, null); + writer.WriteProperty(options, PropAuthenticationType, value.AuthenticationType, null, null); + writer.WriteProperty(options, PropEmail, value.Email, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropFullName, value.FullName, null, null); + writer.WriteProperty(options, PropLookupRealm, value.LookupRealm, null, null); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropToken, value.Token, null, null); + writer.WriteProperty(options, PropUsername, value.Username, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/AuthenticateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/AuthenticateResponse.g.cs index 2c12b1a8755..356de204665 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/AuthenticateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/AuthenticateResponse.g.cs @@ -23,136 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class AuthenticateResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); - private static readonly System.Text.Json.JsonEncodedText PropAuthenticationRealm = System.Text.Json.JsonEncodedText.Encode("authentication_realm"); - private static readonly System.Text.Json.JsonEncodedText PropAuthenticationType = System.Text.Json.JsonEncodedText.Encode("authentication_type"); - private static readonly System.Text.Json.JsonEncodedText PropEmail = System.Text.Json.JsonEncodedText.Encode("email"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropFullName = System.Text.Json.JsonEncodedText.Encode("full_name"); - private static readonly System.Text.Json.JsonEncodedText PropLookupRealm = System.Text.Json.JsonEncodedText.Encode("lookup_realm"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); - private static readonly System.Text.Json.JsonEncodedText PropToken = System.Text.Json.JsonEncodedText.Encode("token"); - private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); - - public override Elastic.Clients.Elasticsearch.Security.AuthenticateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propApiKey = default; - LocalJsonValue propAuthenticationRealm = default; - LocalJsonValue propAuthenticationType = default; - LocalJsonValue propEmail = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propFullName = default; - LocalJsonValue propLookupRealm = default; - LocalJsonValue> propMetadata = default; - LocalJsonValue> propRoles = default; - LocalJsonValue propToken = default; - LocalJsonValue propUsername = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) - { - continue; - } - - if (propAuthenticationRealm.TryReadProperty(ref reader, options, PropAuthenticationRealm, null)) - { - continue; - } - - if (propAuthenticationType.TryReadProperty(ref reader, options, PropAuthenticationType, null)) - { - continue; - } - - if (propEmail.TryReadProperty(ref reader, options, PropEmail, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propFullName.TryReadProperty(ref reader, options, PropFullName, null)) - { - continue; - } - - if (propLookupRealm.TryReadProperty(ref reader, options, PropLookupRealm, null)) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propToken.TryReadProperty(ref reader, options, PropToken, null)) - { - continue; - } - - if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.AuthenticateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ApiKey = propApiKey.Value, - AuthenticationRealm = propAuthenticationRealm.Value, - AuthenticationType = propAuthenticationType.Value, - Email = propEmail.Value, - Enabled = propEnabled.Value, - FullName = propFullName.Value, - LookupRealm = propLookupRealm.Value, - Metadata = propMetadata.Value, - Roles = propRoles.Value, - Token = propToken.Value, - Username = propUsername.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.AuthenticateResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); - writer.WriteProperty(options, PropAuthenticationRealm, value.AuthenticationRealm, null, null); - writer.WriteProperty(options, PropAuthenticationType, value.AuthenticationType, null, null); - writer.WriteProperty(options, PropEmail, value.Email, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropFullName, value.FullName, null, null); - writer.WriteProperty(options, PropLookupRealm, value.LookupRealm, null, null); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropToken, value.Token, null, null); - writer.WriteProperty(options, PropUsername, value.Username, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.AuthenticateResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.AuthenticateResponseConverter))] public sealed partial class AuthenticateResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -169,40 +40,40 @@ internal AuthenticateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCo public Elastic.Clients.Elasticsearch.Security.AuthenticateApiKey? ApiKey { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Security.RealmInfo AuthenticationRealm { get; set; } +Elastic.Clients.Elasticsearch.Security.RealmInfo AuthenticationRealm { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string AuthenticationType { get; set; } +string AuthenticationType { get; set; } public string? Email { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool Enabled { get; set; } +bool Enabled { get; set; } public string? FullName { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Security.RealmInfo LookupRealm { get; set; } +Elastic.Clients.Elasticsearch.Security.RealmInfo LookupRealm { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary Metadata { get; set; } +System.Collections.Generic.IReadOnlyDictionary Metadata { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Roles { get; set; } +System.Collections.Generic.IReadOnlyCollection Roles { get; set; } public Elastic.Clients.Elasticsearch.Security.AuthenticateToken? Token { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Username { get; set; } +string Username { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkDeleteRoleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkDeleteRoleRequest.Converters.g.cs new file mode 100644 index 00000000000..d5634dc6890 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkDeleteRoleRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class BulkDeleteRoleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNames = System.Text.Json.JsonEncodedText.Encode("names"); + + public override Elastic.Clients.Elasticsearch.Security.BulkDeleteRoleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propNames = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNames.TryReadProperty(ref reader, options, PropNames, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.BulkDeleteRoleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Names = propNames.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.BulkDeleteRoleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNames, value.Names, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkDeleteRoleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkDeleteRoleRequest.g.cs index c0fb4e82f41..8a8f4b650c1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkDeleteRoleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkDeleteRoleRequest.g.cs @@ -33,45 +33,6 @@ public sealed partial class BulkDeleteRoleRequestParameters : Elastic.Transport. public Elastic.Clients.Elasticsearch.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } } -internal sealed partial class BulkDeleteRoleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNames = System.Text.Json.JsonEncodedText.Encode("names"); - - public override Elastic.Clients.Elasticsearch.Security.BulkDeleteRoleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propNames = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNames.TryReadProperty(ref reader, options, PropNames, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.BulkDeleteRoleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Names = propNames.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.BulkDeleteRoleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNames, value.Names, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// Bulk delete roles. @@ -81,7 +42,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The bulk delete roles API cannot delete roles that are defined in roles files. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.BulkDeleteRoleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.BulkDeleteRoleRequestConverter))] public sealed partial class BulkDeleteRoleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkDeleteRoleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkDeleteRoleResponse.Converters.g.cs new file mode 100644 index 00000000000..c11e3a79bc1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkDeleteRoleResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class BulkDeleteRoleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDeleted = System.Text.Json.JsonEncodedText.Encode("deleted"); + private static readonly System.Text.Json.JsonEncodedText PropErrors = System.Text.Json.JsonEncodedText.Encode("errors"); + private static readonly System.Text.Json.JsonEncodedText PropNotFound = System.Text.Json.JsonEncodedText.Encode("not_found"); + + public override Elastic.Clients.Elasticsearch.Security.BulkDeleteRoleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propDeleted = default; + LocalJsonValue propErrors = default; + LocalJsonValue?> propNotFound = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDeleted.TryReadProperty(ref reader, options, PropDeleted, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propErrors.TryReadProperty(ref reader, options, PropErrors, null)) + { + continue; + } + + if (propNotFound.TryReadProperty(ref reader, options, PropNotFound, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.BulkDeleteRoleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Deleted = propDeleted.Value, + Errors = propErrors.Value, + NotFound = propNotFound.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.BulkDeleteRoleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDeleted, value.Deleted, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropErrors, value.Errors, null, null); + writer.WriteProperty(options, PropNotFound, value.NotFound, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkDeleteRoleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkDeleteRoleResponse.g.cs index d0df3a3ec71..628cca2943c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkDeleteRoleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkDeleteRoleResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class BulkDeleteRoleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDeleted = System.Text.Json.JsonEncodedText.Encode("deleted"); - private static readonly System.Text.Json.JsonEncodedText PropErrors = System.Text.Json.JsonEncodedText.Encode("errors"); - private static readonly System.Text.Json.JsonEncodedText PropNotFound = System.Text.Json.JsonEncodedText.Encode("not_found"); - - public override Elastic.Clients.Elasticsearch.Security.BulkDeleteRoleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propDeleted = default; - LocalJsonValue propErrors = default; - LocalJsonValue?> propNotFound = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDeleted.TryReadProperty(ref reader, options, PropDeleted, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propErrors.TryReadProperty(ref reader, options, PropErrors, null)) - { - continue; - } - - if (propNotFound.TryReadProperty(ref reader, options, PropNotFound, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.BulkDeleteRoleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Deleted = propDeleted.Value, - Errors = propErrors.Value, - NotFound = propNotFound.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.BulkDeleteRoleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDeleted, value.Deleted, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropErrors, value.Errors, null, null); - writer.WriteProperty(options, PropNotFound, value.NotFound, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.BulkDeleteRoleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.BulkDeleteRoleResponseConverter))] public sealed partial class BulkDeleteRoleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkPutRoleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkPutRoleRequest.Converters.g.cs new file mode 100644 index 00000000000..df3fb3eeecd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkPutRoleRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class BulkPutRoleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + + public override Elastic.Clients.Elasticsearch.Security.BulkPutRoleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propRoles = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.BulkPutRoleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Roles = propRoles.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.BulkPutRoleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkPutRoleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkPutRoleRequest.g.cs index 2e95816af09..26e501215ee 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkPutRoleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkPutRoleRequest.g.cs @@ -33,45 +33,6 @@ public sealed partial class BulkPutRoleRequestParameters : Elastic.Transport.Req public Elastic.Clients.Elasticsearch.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } } -internal sealed partial class BulkPutRoleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); - - public override Elastic.Clients.Elasticsearch.Security.BulkPutRoleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propRoles = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.BulkPutRoleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Roles = propRoles.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.BulkPutRoleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - /// /// /// Bulk create or update roles. @@ -81,7 +42,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The bulk create or update roles API cannot update roles that are defined in roles files. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.BulkPutRoleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.BulkPutRoleRequestConverter))] public sealed partial class BulkPutRoleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkPutRoleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkPutRoleResponse.Converters.g.cs new file mode 100644 index 00000000000..5bb93298344 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkPutRoleResponse.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class BulkPutRoleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCreated = System.Text.Json.JsonEncodedText.Encode("created"); + private static readonly System.Text.Json.JsonEncodedText PropErrors = System.Text.Json.JsonEncodedText.Encode("errors"); + private static readonly System.Text.Json.JsonEncodedText PropNoop = System.Text.Json.JsonEncodedText.Encode("noop"); + private static readonly System.Text.Json.JsonEncodedText PropUpdated = System.Text.Json.JsonEncodedText.Encode("updated"); + + public override Elastic.Clients.Elasticsearch.Security.BulkPutRoleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propCreated = default; + LocalJsonValue propErrors = default; + LocalJsonValue?> propNoop = default; + LocalJsonValue?> propUpdated = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCreated.TryReadProperty(ref reader, options, PropCreated, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propErrors.TryReadProperty(ref reader, options, PropErrors, null)) + { + continue; + } + + if (propNoop.TryReadProperty(ref reader, options, PropNoop, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propUpdated.TryReadProperty(ref reader, options, PropUpdated, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.BulkPutRoleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Created = propCreated.Value, + Errors = propErrors.Value, + Noop = propNoop.Value, + Updated = propUpdated.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.BulkPutRoleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCreated, value.Created, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropErrors, value.Errors, null, null); + writer.WriteProperty(options, PropNoop, value.Noop, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropUpdated, value.Updated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkPutRoleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkPutRoleResponse.g.cs index 3699e740c18..dca4d1e05cd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkPutRoleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkPutRoleResponse.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class BulkPutRoleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCreated = System.Text.Json.JsonEncodedText.Encode("created"); - private static readonly System.Text.Json.JsonEncodedText PropErrors = System.Text.Json.JsonEncodedText.Encode("errors"); - private static readonly System.Text.Json.JsonEncodedText PropNoop = System.Text.Json.JsonEncodedText.Encode("noop"); - private static readonly System.Text.Json.JsonEncodedText PropUpdated = System.Text.Json.JsonEncodedText.Encode("updated"); - - public override Elastic.Clients.Elasticsearch.Security.BulkPutRoleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propCreated = default; - LocalJsonValue propErrors = default; - LocalJsonValue?> propNoop = default; - LocalJsonValue?> propUpdated = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCreated.TryReadProperty(ref reader, options, PropCreated, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propErrors.TryReadProperty(ref reader, options, PropErrors, null)) - { - continue; - } - - if (propNoop.TryReadProperty(ref reader, options, PropNoop, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propUpdated.TryReadProperty(ref reader, options, PropUpdated, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.BulkPutRoleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Created = propCreated.Value, - Errors = propErrors.Value, - Noop = propNoop.Value, - Updated = propUpdated.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.BulkPutRoleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCreated, value.Created, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropErrors, value.Errors, null, null); - writer.WriteProperty(options, PropNoop, value.Noop, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropUpdated, value.Updated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.BulkPutRoleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.BulkPutRoleResponseConverter))] public sealed partial class BulkPutRoleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkUpdateApiKeysRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkUpdateApiKeysRequest.Converters.g.cs new file mode 100644 index 00000000000..eb249975806 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkUpdateApiKeysRequest.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class BulkUpdateApiKeysRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExpiration = System.Text.Json.JsonEncodedText.Encode("expiration"); + private static readonly System.Text.Json.JsonEncodedText PropIds = System.Text.Json.JsonEncodedText.Encode("ids"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropRoleDescriptors = System.Text.Json.JsonEncodedText.Encode("role_descriptors"); + + public override Elastic.Clients.Elasticsearch.Security.BulkUpdateApiKeysRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExpiration = default; + LocalJsonValue> propIds = default; + LocalJsonValue?> propMetadata = default; + LocalJsonValue?> propRoleDescriptors = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExpiration.TryReadProperty(ref reader, options, PropExpiration, null)) + { + continue; + } + + if (propIds.TryReadProperty(ref reader, options, PropIds, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propRoleDescriptors.TryReadProperty(ref reader, options, PropRoleDescriptors, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.BulkUpdateApiKeysRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Expiration = propExpiration.Value, + Ids = propIds.Value, + Metadata = propMetadata.Value, + RoleDescriptors = propRoleDescriptors.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.BulkUpdateApiKeysRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExpiration, value.Expiration, null, null); + writer.WriteProperty(options, PropIds, value.Ids, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropRoleDescriptors, value.RoleDescriptors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkUpdateApiKeysRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkUpdateApiKeysRequest.g.cs index 66340e133be..08602cb18e6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkUpdateApiKeysRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkUpdateApiKeysRequest.g.cs @@ -27,72 +27,6 @@ public sealed partial class BulkUpdateApiKeysRequestParameters : Elastic.Transpo { } -internal sealed partial class BulkUpdateApiKeysRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExpiration = System.Text.Json.JsonEncodedText.Encode("expiration"); - private static readonly System.Text.Json.JsonEncodedText PropIds = System.Text.Json.JsonEncodedText.Encode("ids"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropRoleDescriptors = System.Text.Json.JsonEncodedText.Encode("role_descriptors"); - - public override Elastic.Clients.Elasticsearch.Security.BulkUpdateApiKeysRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propExpiration = default; - LocalJsonValue> propIds = default; - LocalJsonValue?> propMetadata = default; - LocalJsonValue?> propRoleDescriptors = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExpiration.TryReadProperty(ref reader, options, PropExpiration, null)) - { - continue; - } - - if (propIds.TryReadProperty(ref reader, options, PropIds, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propRoleDescriptors.TryReadProperty(ref reader, options, PropRoleDescriptors, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.BulkUpdateApiKeysRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Expiration = propExpiration.Value, - Ids = propIds.Value, - Metadata = propMetadata.Value, - RoleDescriptors = propRoleDescriptors.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.BulkUpdateApiKeysRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExpiration, value.Expiration, null, null); - writer.WriteProperty(options, PropIds, value.Ids, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropRoleDescriptors, value.RoleDescriptors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - /// /// /// Bulk update API keys. @@ -119,7 +53,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// A successful request returns a JSON structure that contains the IDs of all updated API keys, the IDs of API keys that already had the requested changes and did not require an update, and error details for any failed update. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.BulkUpdateApiKeysRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.BulkUpdateApiKeysRequestConverter))] public sealed partial class BulkUpdateApiKeysRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkUpdateApiKeysResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkUpdateApiKeysResponse.Converters.g.cs new file mode 100644 index 00000000000..c9506b1d194 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkUpdateApiKeysResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class BulkUpdateApiKeysResponseConverter : 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 PropNoops = System.Text.Json.JsonEncodedText.Encode("noops"); + private static readonly System.Text.Json.JsonEncodedText PropUpdated = System.Text.Json.JsonEncodedText.Encode("updated"); + + public override Elastic.Clients.Elasticsearch.Security.BulkUpdateApiKeysResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propErrors = default; + LocalJsonValue> propNoops = default; + LocalJsonValue> propUpdated = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propErrors.TryReadProperty(ref reader, options, PropErrors, null)) + { + continue; + } + + if (propNoops.TryReadProperty(ref reader, options, PropNoops, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propUpdated.TryReadProperty(ref reader, options, PropUpdated, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.BulkUpdateApiKeysResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Errors = propErrors.Value, + Noops = propNoops.Value, + Updated = propUpdated.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.BulkUpdateApiKeysResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropErrors, value.Errors, null, null); + writer.WriteProperty(options, PropNoops, value.Noops, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropUpdated, value.Updated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkUpdateApiKeysResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkUpdateApiKeysResponse.g.cs index 4a614d087c8..74a075c6ae4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkUpdateApiKeysResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/BulkUpdateApiKeysResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class BulkUpdateApiKeysResponseConverter : 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 PropNoops = System.Text.Json.JsonEncodedText.Encode("noops"); - private static readonly System.Text.Json.JsonEncodedText PropUpdated = System.Text.Json.JsonEncodedText.Encode("updated"); - - public override Elastic.Clients.Elasticsearch.Security.BulkUpdateApiKeysResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propErrors = default; - LocalJsonValue> propNoops = default; - LocalJsonValue> propUpdated = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propErrors.TryReadProperty(ref reader, options, PropErrors, null)) - { - continue; - } - - if (propNoops.TryReadProperty(ref reader, options, PropNoops, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propUpdated.TryReadProperty(ref reader, options, PropUpdated, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.BulkUpdateApiKeysResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Errors = propErrors.Value, - Noops = propNoops.Value, - Updated = propUpdated.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.BulkUpdateApiKeysResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropErrors, value.Errors, null, null); - writer.WriteProperty(options, PropNoops, value.Noops, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropUpdated, value.Updated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.BulkUpdateApiKeysResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.BulkUpdateApiKeysResponseConverter))] public sealed partial class BulkUpdateApiKeysResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -97,12 +40,12 @@ internal BulkUpdateApiKeysResponse(Elastic.Clients.Elasticsearch.Serialization.J public Elastic.Clients.Elasticsearch.Security.BulkError? Errors { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Noops { get; set; } +System.Collections.Generic.IReadOnlyCollection Noops { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Updated { get; set; } +System.Collections.Generic.IReadOnlyCollection Updated { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ChangePasswordRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ChangePasswordRequest.Converters.g.cs new file mode 100644 index 00000000000..46985ee8779 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ChangePasswordRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ChangePasswordRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPassword = System.Text.Json.JsonEncodedText.Encode("password"); + private static readonly System.Text.Json.JsonEncodedText PropPasswordHash = System.Text.Json.JsonEncodedText.Encode("password_hash"); + + public override Elastic.Clients.Elasticsearch.Security.ChangePasswordRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPassword = default; + LocalJsonValue propPasswordHash = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPassword.TryReadProperty(ref reader, options, PropPassword, null)) + { + continue; + } + + if (propPasswordHash.TryReadProperty(ref reader, options, PropPasswordHash, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.ChangePasswordRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Password = propPassword.Value, + PasswordHash = propPasswordHash.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ChangePasswordRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPassword, value.Password, null, null); + writer.WriteProperty(options, PropPasswordHash, value.PasswordHash, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ChangePasswordRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ChangePasswordRequest.g.cs index 9f681973de9..9ef5b9f3a67 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ChangePasswordRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ChangePasswordRequest.g.cs @@ -33,54 +33,6 @@ public sealed partial class ChangePasswordRequestParameters : Elastic.Transport. public Elastic.Clients.Elasticsearch.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } } -internal sealed partial class ChangePasswordRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPassword = System.Text.Json.JsonEncodedText.Encode("password"); - private static readonly System.Text.Json.JsonEncodedText PropPasswordHash = System.Text.Json.JsonEncodedText.Encode("password_hash"); - - public override Elastic.Clients.Elasticsearch.Security.ChangePasswordRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPassword = default; - LocalJsonValue propPasswordHash = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPassword.TryReadProperty(ref reader, options, PropPassword, null)) - { - continue; - } - - if (propPasswordHash.TryReadProperty(ref reader, options, PropPasswordHash, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.ChangePasswordRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Password = propPassword.Value, - PasswordHash = propPasswordHash.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ChangePasswordRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPassword, value.Password, null, null); - writer.WriteProperty(options, PropPasswordHash, value.PasswordHash, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Change passwords. @@ -89,7 +41,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Change the passwords of users in the native realm and built-in users. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ChangePasswordRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ChangePasswordRequestConverter))] public sealed partial class ChangePasswordRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public ChangePasswordRequest(Elastic.Clients.Elasticsearch.Username? username) : base(r => r.Optional("username", username)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ChangePasswordResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ChangePasswordResponse.Converters.g.cs new file mode 100644 index 00000000000..10f83c9b2e8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ChangePasswordResponse.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ChangePasswordResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.ChangePasswordResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.ChangePasswordResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ChangePasswordResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ChangePasswordResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ChangePasswordResponse.g.cs index 8bfaee55f6e..dabec5966a1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ChangePasswordResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ChangePasswordResponse.g.cs @@ -23,36 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class ChangePasswordResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.ChangePasswordResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.ChangePasswordResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ChangePasswordResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ChangePasswordResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ChangePasswordResponseConverter))] public sealed partial class ChangePasswordResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearApiKeyCacheRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearApiKeyCacheRequest.Converters.g.cs new file mode 100644 index 00000000000..8b96e4c8260 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearApiKeyCacheRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ClearApiKeyCacheRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.ClearApiKeyCacheRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.ClearApiKeyCacheRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ClearApiKeyCacheRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearApiKeyCacheRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearApiKeyCacheRequest.g.cs index 9ff0160f8b5..f18ab4031e3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearApiKeyCacheRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearApiKeyCacheRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class ClearApiKeyCacheRequestParameters : Elastic.Transpor { } -internal sealed partial class ClearApiKeyCacheRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.ClearApiKeyCacheRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.ClearApiKeyCacheRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ClearApiKeyCacheRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Clear the API key cache. @@ -65,7 +36,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The cache is also automatically cleared on state changes of the security index. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ClearApiKeyCacheRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ClearApiKeyCacheRequestConverter))] public sealed partial class ClearApiKeyCacheRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearApiKeyCacheResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearApiKeyCacheResponse.Converters.g.cs new file mode 100644 index 00000000000..76c755c2b3d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearApiKeyCacheResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ClearApiKeyCacheResponseConverter : 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 PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); + private static readonly System.Text.Json.JsonEncodedText PropNodeStats = System.Text.Json.JsonEncodedText.Encode("_nodes"); + + public override Elastic.Clients.Elasticsearch.Security.ClearApiKeyCacheResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClusterName = default; + LocalJsonValue> propNodes = default; + LocalJsonValue propNodeStats = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) + { + continue; + } + + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propNodeStats.TryReadProperty(ref reader, options, PropNodeStats, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.ClearApiKeyCacheResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClusterName = propClusterName.Value, + Nodes = propNodes.Value, + NodeStats = propNodeStats.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ClearApiKeyCacheResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNodeStats, value.NodeStats, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearApiKeyCacheResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearApiKeyCacheResponse.g.cs index 01a7c8451c8..00e7257828c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearApiKeyCacheResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearApiKeyCacheResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class ClearApiKeyCacheResponseConverter : 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 PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); - private static readonly System.Text.Json.JsonEncodedText PropNodeStats = System.Text.Json.JsonEncodedText.Encode("_nodes"); - - public override Elastic.Clients.Elasticsearch.Security.ClearApiKeyCacheResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClusterName = default; - LocalJsonValue> propNodes = default; - LocalJsonValue propNodeStats = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) - { - continue; - } - - if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propNodeStats.TryReadProperty(ref reader, options, PropNodeStats, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.ClearApiKeyCacheResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClusterName = propClusterName.Value, - Nodes = propNodes.Value, - NodeStats = propNodeStats.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ClearApiKeyCacheResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); - writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNodeStats, value.NodeStats, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ClearApiKeyCacheResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ClearApiKeyCacheResponseConverter))] public sealed partial class ClearApiKeyCacheResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -96,17 +39,17 @@ internal ClearApiKeyCacheResponse(Elastic.Clients.Elasticsearch.Serialization.Js public #if NET7_0_OR_GREATER - required +required #endif - string ClusterName { get; set; } +string ClusterName { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } +System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.NodeStatistics NodeStats { get; set; } +Elastic.Clients.Elasticsearch.NodeStatistics NodeStats { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedPrivilegesRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedPrivilegesRequest.Converters.g.cs new file mode 100644 index 00000000000..04a1d435a32 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedPrivilegesRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ClearCachedPrivilegesRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.ClearCachedPrivilegesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.ClearCachedPrivilegesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ClearCachedPrivilegesRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedPrivilegesRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedPrivilegesRequest.g.cs index a8f218424ef..710afcac6eb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedPrivilegesRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedPrivilegesRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class ClearCachedPrivilegesRequestParameters : Elastic.Tra { } -internal sealed partial class ClearCachedPrivilegesRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.ClearCachedPrivilegesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.ClearCachedPrivilegesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ClearCachedPrivilegesRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Clear the privileges cache. @@ -65,7 +36,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The cache is also automatically cleared for applications that have their privileges updated. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ClearCachedPrivilegesRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ClearCachedPrivilegesRequestConverter))] public sealed partial class ClearCachedPrivilegesRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedPrivilegesResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedPrivilegesResponse.Converters.g.cs new file mode 100644 index 00000000000..a05ba17ceeb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedPrivilegesResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ClearCachedPrivilegesResponseConverter : 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 PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); + private static readonly System.Text.Json.JsonEncodedText PropNodeStats = System.Text.Json.JsonEncodedText.Encode("_nodes"); + + public override Elastic.Clients.Elasticsearch.Security.ClearCachedPrivilegesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClusterName = default; + LocalJsonValue> propNodes = default; + LocalJsonValue propNodeStats = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) + { + continue; + } + + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propNodeStats.TryReadProperty(ref reader, options, PropNodeStats, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.ClearCachedPrivilegesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClusterName = propClusterName.Value, + Nodes = propNodes.Value, + NodeStats = propNodeStats.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ClearCachedPrivilegesResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNodeStats, value.NodeStats, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedPrivilegesResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedPrivilegesResponse.g.cs index 56bf89abf8f..c0ec4d5396a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedPrivilegesResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedPrivilegesResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class ClearCachedPrivilegesResponseConverter : 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 PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); - private static readonly System.Text.Json.JsonEncodedText PropNodeStats = System.Text.Json.JsonEncodedText.Encode("_nodes"); - - public override Elastic.Clients.Elasticsearch.Security.ClearCachedPrivilegesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClusterName = default; - LocalJsonValue> propNodes = default; - LocalJsonValue propNodeStats = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) - { - continue; - } - - if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propNodeStats.TryReadProperty(ref reader, options, PropNodeStats, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.ClearCachedPrivilegesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClusterName = propClusterName.Value, - Nodes = propNodes.Value, - NodeStats = propNodeStats.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ClearCachedPrivilegesResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); - writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNodeStats, value.NodeStats, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ClearCachedPrivilegesResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ClearCachedPrivilegesResponseConverter))] public sealed partial class ClearCachedPrivilegesResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -96,17 +39,17 @@ internal ClearCachedPrivilegesResponse(Elastic.Clients.Elasticsearch.Serializati public #if NET7_0_OR_GREATER - required +required #endif - string ClusterName { get; set; } +string ClusterName { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } +System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.NodeStatistics NodeStats { get; set; } +Elastic.Clients.Elasticsearch.NodeStatistics NodeStats { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRealmsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRealmsRequest.Converters.g.cs new file mode 100644 index 00000000000..9e0a8c52bd3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRealmsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ClearCachedRealmsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.ClearCachedRealmsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.ClearCachedRealmsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ClearCachedRealmsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRealmsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRealmsRequest.g.cs index ead0d71ed78..66f76a08e60 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRealmsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRealmsRequest.g.cs @@ -34,35 +34,6 @@ public sealed partial class ClearCachedRealmsRequestParameters : Elastic.Transpo public System.Collections.Generic.ICollection? Usernames { get => Q?>("usernames"); set => Q("usernames", value); } } -internal sealed partial class ClearCachedRealmsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.ClearCachedRealmsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.ClearCachedRealmsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ClearCachedRealmsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Clear the user cache. @@ -77,7 +48,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// For more information, refer to the documentation about controlling the user cache. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ClearCachedRealmsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ClearCachedRealmsRequestConverter))] public sealed partial class ClearCachedRealmsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRealmsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRealmsResponse.Converters.g.cs new file mode 100644 index 00000000000..667a8f3209a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRealmsResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ClearCachedRealmsResponseConverter : 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 PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); + private static readonly System.Text.Json.JsonEncodedText PropNodeStats = System.Text.Json.JsonEncodedText.Encode("_nodes"); + + public override Elastic.Clients.Elasticsearch.Security.ClearCachedRealmsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClusterName = default; + LocalJsonValue> propNodes = default; + LocalJsonValue propNodeStats = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) + { + continue; + } + + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propNodeStats.TryReadProperty(ref reader, options, PropNodeStats, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.ClearCachedRealmsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClusterName = propClusterName.Value, + Nodes = propNodes.Value, + NodeStats = propNodeStats.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ClearCachedRealmsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNodeStats, value.NodeStats, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRealmsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRealmsResponse.g.cs index 51de076cd1f..8f23a174113 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRealmsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRealmsResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class ClearCachedRealmsResponseConverter : 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 PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); - private static readonly System.Text.Json.JsonEncodedText PropNodeStats = System.Text.Json.JsonEncodedText.Encode("_nodes"); - - public override Elastic.Clients.Elasticsearch.Security.ClearCachedRealmsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClusterName = default; - LocalJsonValue> propNodes = default; - LocalJsonValue propNodeStats = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) - { - continue; - } - - if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propNodeStats.TryReadProperty(ref reader, options, PropNodeStats, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.ClearCachedRealmsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClusterName = propClusterName.Value, - Nodes = propNodes.Value, - NodeStats = propNodeStats.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ClearCachedRealmsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); - writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNodeStats, value.NodeStats, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ClearCachedRealmsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ClearCachedRealmsResponseConverter))] public sealed partial class ClearCachedRealmsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -96,17 +39,17 @@ internal ClearCachedRealmsResponse(Elastic.Clients.Elasticsearch.Serialization.J public #if NET7_0_OR_GREATER - required +required #endif - string ClusterName { get; set; } +string ClusterName { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } +System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.NodeStatistics NodeStats { get; set; } +Elastic.Clients.Elasticsearch.NodeStatistics NodeStats { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRolesRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRolesRequest.Converters.g.cs new file mode 100644 index 00000000000..6c4e6f00c01 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRolesRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ClearCachedRolesRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.ClearCachedRolesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.ClearCachedRolesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ClearCachedRolesRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRolesRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRolesRequest.g.cs index 35717fb726c..873a0a5280f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRolesRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRolesRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class ClearCachedRolesRequestParameters : Elastic.Transpor { } -internal sealed partial class ClearCachedRolesRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.ClearCachedRolesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.ClearCachedRolesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ClearCachedRolesRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Clear the roles cache. @@ -64,7 +35,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Evict roles from the native role cache. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ClearCachedRolesRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ClearCachedRolesRequestConverter))] public sealed partial class ClearCachedRolesRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRolesResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRolesResponse.Converters.g.cs new file mode 100644 index 00000000000..6225f6ad891 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRolesResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ClearCachedRolesResponseConverter : 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 PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); + private static readonly System.Text.Json.JsonEncodedText PropNodeStats = System.Text.Json.JsonEncodedText.Encode("_nodes"); + + public override Elastic.Clients.Elasticsearch.Security.ClearCachedRolesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClusterName = default; + LocalJsonValue> propNodes = default; + LocalJsonValue propNodeStats = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) + { + continue; + } + + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propNodeStats.TryReadProperty(ref reader, options, PropNodeStats, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.ClearCachedRolesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClusterName = propClusterName.Value, + Nodes = propNodes.Value, + NodeStats = propNodeStats.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ClearCachedRolesResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNodeStats, value.NodeStats, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRolesResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRolesResponse.g.cs index 8689f7289b3..b1173e49a37 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRolesResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedRolesResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class ClearCachedRolesResponseConverter : 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 PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); - private static readonly System.Text.Json.JsonEncodedText PropNodeStats = System.Text.Json.JsonEncodedText.Encode("_nodes"); - - public override Elastic.Clients.Elasticsearch.Security.ClearCachedRolesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClusterName = default; - LocalJsonValue> propNodes = default; - LocalJsonValue propNodeStats = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) - { - continue; - } - - if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propNodeStats.TryReadProperty(ref reader, options, PropNodeStats, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.ClearCachedRolesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClusterName = propClusterName.Value, - Nodes = propNodes.Value, - NodeStats = propNodeStats.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ClearCachedRolesResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); - writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNodeStats, value.NodeStats, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ClearCachedRolesResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ClearCachedRolesResponseConverter))] public sealed partial class ClearCachedRolesResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -96,17 +39,17 @@ internal ClearCachedRolesResponse(Elastic.Clients.Elasticsearch.Serialization.Js public #if NET7_0_OR_GREATER - required +required #endif - string ClusterName { get; set; } +string ClusterName { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } +System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.NodeStatistics NodeStats { get; set; } +Elastic.Clients.Elasticsearch.NodeStatistics NodeStats { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedServiceTokensRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedServiceTokensRequest.Converters.g.cs new file mode 100644 index 00000000000..3c44850aba2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedServiceTokensRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ClearCachedServiceTokensRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.ClearCachedServiceTokensRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.ClearCachedServiceTokensRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ClearCachedServiceTokensRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedServiceTokensRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedServiceTokensRequest.g.cs index b3a245c0aec..145f7326c93 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedServiceTokensRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedServiceTokensRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class ClearCachedServiceTokensRequestParameters : Elastic. { } -internal sealed partial class ClearCachedServiceTokensRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.ClearCachedServiceTokensRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.ClearCachedServiceTokensRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ClearCachedServiceTokensRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Clear service account token caches. @@ -70,7 +41,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The cache for tokens backed by the service_tokens file is cleared automatically on file changes. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ClearCachedServiceTokensRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ClearCachedServiceTokensRequestConverter))] public sealed partial class ClearCachedServiceTokensRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedServiceTokensResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedServiceTokensResponse.Converters.g.cs new file mode 100644 index 00000000000..a0fddbc8ca2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedServiceTokensResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ClearCachedServiceTokensResponseConverter : 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 PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); + private static readonly System.Text.Json.JsonEncodedText PropNodeStats = System.Text.Json.JsonEncodedText.Encode("_nodes"); + + public override Elastic.Clients.Elasticsearch.Security.ClearCachedServiceTokensResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClusterName = default; + LocalJsonValue> propNodes = default; + LocalJsonValue propNodeStats = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) + { + continue; + } + + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propNodeStats.TryReadProperty(ref reader, options, PropNodeStats, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.ClearCachedServiceTokensResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClusterName = propClusterName.Value, + Nodes = propNodes.Value, + NodeStats = propNodeStats.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ClearCachedServiceTokensResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNodeStats, value.NodeStats, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedServiceTokensResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedServiceTokensResponse.g.cs index 71b4431cdb2..928e498b403 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedServiceTokensResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/ClearCachedServiceTokensResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class ClearCachedServiceTokensResponseConverter : 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 PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); - private static readonly System.Text.Json.JsonEncodedText PropNodeStats = System.Text.Json.JsonEncodedText.Encode("_nodes"); - - public override Elastic.Clients.Elasticsearch.Security.ClearCachedServiceTokensResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClusterName = default; - LocalJsonValue> propNodes = default; - LocalJsonValue propNodeStats = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) - { - continue; - } - - if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propNodeStats.TryReadProperty(ref reader, options, PropNodeStats, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.ClearCachedServiceTokensResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClusterName = propClusterName.Value, - Nodes = propNodes.Value, - NodeStats = propNodeStats.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ClearCachedServiceTokensResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); - writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNodeStats, value.NodeStats, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ClearCachedServiceTokensResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ClearCachedServiceTokensResponseConverter))] public sealed partial class ClearCachedServiceTokensResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -96,17 +39,17 @@ internal ClearCachedServiceTokensResponse(Elastic.Clients.Elasticsearch.Serializ public #if NET7_0_OR_GREATER - required +required #endif - string ClusterName { get; set; } +string ClusterName { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } +System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.NodeStatistics NodeStats { get; set; } +Elastic.Clients.Elasticsearch.NodeStatistics NodeStats { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateApiKeyRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateApiKeyRequest.Converters.g.cs new file mode 100644 index 00000000000..db1857b9a12 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateApiKeyRequest.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class CreateApiKeyRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExpiration = System.Text.Json.JsonEncodedText.Encode("expiration"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropRoleDescriptors = System.Text.Json.JsonEncodedText.Encode("role_descriptors"); + + public override Elastic.Clients.Elasticsearch.Security.CreateApiKeyRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExpiration = default; + LocalJsonValue?> propMetadata = default; + LocalJsonValue propName = default; + LocalJsonValue?> propRoleDescriptors = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExpiration.TryReadProperty(ref reader, options, PropExpiration, null)) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propRoleDescriptors.TryReadProperty(ref reader, options, PropRoleDescriptors, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.CreateApiKeyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Expiration = propExpiration.Value, + Metadata = propMetadata.Value, + Name = propName.Value, + RoleDescriptors = propRoleDescriptors.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.CreateApiKeyRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExpiration, value.Expiration, null, null); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropRoleDescriptors, value.RoleDescriptors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateApiKeyRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateApiKeyRequest.g.cs index f22fd5ba0d0..22a6e3793f3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateApiKeyRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateApiKeyRequest.g.cs @@ -33,72 +33,6 @@ public sealed partial class CreateApiKeyRequestParameters : Elastic.Transport.Re public Elastic.Clients.Elasticsearch.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } } -internal sealed partial class CreateApiKeyRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExpiration = System.Text.Json.JsonEncodedText.Encode("expiration"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropRoleDescriptors = System.Text.Json.JsonEncodedText.Encode("role_descriptors"); - - public override Elastic.Clients.Elasticsearch.Security.CreateApiKeyRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propExpiration = default; - LocalJsonValue?> propMetadata = default; - LocalJsonValue propName = default; - LocalJsonValue?> propRoleDescriptors = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExpiration.TryReadProperty(ref reader, options, PropExpiration, null)) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propRoleDescriptors.TryReadProperty(ref reader, options, PropRoleDescriptors, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.CreateApiKeyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Expiration = propExpiration.Value, - Metadata = propMetadata.Value, - Name = propName.Value, - RoleDescriptors = propRoleDescriptors.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.CreateApiKeyRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExpiration, value.Expiration, null, null); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropRoleDescriptors, value.RoleDescriptors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - /// /// /// Create an API key. @@ -122,7 +56,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// To configure or turn off the API key service, refer to API key service setting documentation. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.CreateApiKeyRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.CreateApiKeyRequestConverter))] public sealed partial class CreateApiKeyRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateApiKeyResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateApiKeyResponse.Converters.g.cs new file mode 100644 index 00000000000..05fb2ad58f9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateApiKeyResponse.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class CreateApiKeyResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); + private static readonly System.Text.Json.JsonEncodedText PropEncoded = System.Text.Json.JsonEncodedText.Encode("encoded"); + private static readonly System.Text.Json.JsonEncodedText PropExpiration = System.Text.Json.JsonEncodedText.Encode("expiration"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.Security.CreateApiKeyResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApiKey = default; + LocalJsonValue propEncoded = default; + LocalJsonValue propExpiration = default; + LocalJsonValue propId = default; + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) + { + continue; + } + + if (propEncoded.TryReadProperty(ref reader, options, PropEncoded, null)) + { + continue; + } + + if (propExpiration.TryReadProperty(ref reader, options, PropExpiration, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.CreateApiKeyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ApiKey = propApiKey.Value, + Encoded = propEncoded.Value, + Expiration = propExpiration.Value, + Id = propId.Value, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.CreateApiKeyResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); + writer.WriteProperty(options, PropEncoded, value.Encoded, null, null); + writer.WriteProperty(options, PropExpiration, value.Expiration, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateApiKeyResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateApiKeyResponse.g.cs index eea64e53cbb..d428bfd1e1a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateApiKeyResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateApiKeyResponse.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class CreateApiKeyResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); - private static readonly System.Text.Json.JsonEncodedText PropEncoded = System.Text.Json.JsonEncodedText.Encode("encoded"); - private static readonly System.Text.Json.JsonEncodedText PropExpiration = System.Text.Json.JsonEncodedText.Encode("expiration"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.Security.CreateApiKeyResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propApiKey = default; - LocalJsonValue propEncoded = default; - LocalJsonValue propExpiration = default; - LocalJsonValue propId = default; - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) - { - continue; - } - - if (propEncoded.TryReadProperty(ref reader, options, PropEncoded, null)) - { - continue; - } - - if (propExpiration.TryReadProperty(ref reader, options, PropExpiration, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.CreateApiKeyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ApiKey = propApiKey.Value, - Encoded = propEncoded.Value, - Expiration = propExpiration.Value, - Id = propId.Value, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.CreateApiKeyResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); - writer.WriteProperty(options, PropEncoded, value.Encoded, null, null); - writer.WriteProperty(options, PropExpiration, value.Expiration, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.CreateApiKeyResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.CreateApiKeyResponseConverter))] public sealed partial class CreateApiKeyResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateCrossClusterApiKeyRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateCrossClusterApiKeyRequest.Converters.g.cs new file mode 100644 index 00000000000..d55979b1346 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateCrossClusterApiKeyRequest.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class CreateCrossClusterApiKeyRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAccess = System.Text.Json.JsonEncodedText.Encode("access"); + private static readonly System.Text.Json.JsonEncodedText PropExpiration = System.Text.Json.JsonEncodedText.Encode("expiration"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.Security.CreateCrossClusterApiKeyRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAccess = default; + LocalJsonValue propExpiration = default; + LocalJsonValue?> propMetadata = default; + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAccess.TryReadProperty(ref reader, options, PropAccess, null)) + { + continue; + } + + if (propExpiration.TryReadProperty(ref reader, options, PropExpiration, null)) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.CreateCrossClusterApiKeyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Access = propAccess.Value, + Expiration = propExpiration.Value, + Metadata = propMetadata.Value, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.CreateCrossClusterApiKeyRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAccess, value.Access, null, null); + writer.WriteProperty(options, PropExpiration, value.Expiration, null, null); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateCrossClusterApiKeyRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateCrossClusterApiKeyRequest.g.cs index 4a0707880a3..28cf2e516af 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateCrossClusterApiKeyRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateCrossClusterApiKeyRequest.g.cs @@ -27,72 +27,6 @@ public sealed partial class CreateCrossClusterApiKeyRequestParameters : Elastic. { } -internal sealed partial class CreateCrossClusterApiKeyRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAccess = System.Text.Json.JsonEncodedText.Encode("access"); - private static readonly System.Text.Json.JsonEncodedText PropExpiration = System.Text.Json.JsonEncodedText.Encode("expiration"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.Security.CreateCrossClusterApiKeyRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAccess = default; - LocalJsonValue propExpiration = default; - LocalJsonValue?> propMetadata = default; - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAccess.TryReadProperty(ref reader, options, PropAccess, null)) - { - continue; - } - - if (propExpiration.TryReadProperty(ref reader, options, PropExpiration, null)) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.CreateCrossClusterApiKeyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Access = propAccess.Value, - Expiration = propExpiration.Value, - Metadata = propMetadata.Value, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.CreateCrossClusterApiKeyRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAccess, value.Access, null, null); - writer.WriteProperty(options, PropExpiration, value.Expiration, null, null); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create a cross-cluster API key. @@ -121,7 +55,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Attempting to update them with the update REST API key API or the bulk update REST API keys API will result in an error. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.CreateCrossClusterApiKeyRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.CreateCrossClusterApiKeyRequestConverter))] public sealed partial class CreateCrossClusterApiKeyRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateCrossClusterApiKeyResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateCrossClusterApiKeyResponse.Converters.g.cs new file mode 100644 index 00000000000..fd61305db5e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateCrossClusterApiKeyResponse.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class CreateCrossClusterApiKeyResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); + private static readonly System.Text.Json.JsonEncodedText PropEncoded = System.Text.Json.JsonEncodedText.Encode("encoded"); + private static readonly System.Text.Json.JsonEncodedText PropExpiration = System.Text.Json.JsonEncodedText.Encode("expiration"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.Security.CreateCrossClusterApiKeyResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApiKey = default; + LocalJsonValue propEncoded = default; + LocalJsonValue propExpiration = default; + LocalJsonValue propId = default; + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) + { + continue; + } + + if (propEncoded.TryReadProperty(ref reader, options, PropEncoded, null)) + { + continue; + } + + if (propExpiration.TryReadProperty(ref reader, options, PropExpiration, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.CreateCrossClusterApiKeyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ApiKey = propApiKey.Value, + Encoded = propEncoded.Value, + Expiration = propExpiration.Value, + Id = propId.Value, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.CreateCrossClusterApiKeyResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); + writer.WriteProperty(options, PropEncoded, value.Encoded, null, null); + writer.WriteProperty(options, PropExpiration, value.Expiration, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateCrossClusterApiKeyResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateCrossClusterApiKeyResponse.g.cs index 9f5762ec039..3f672edcedf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateCrossClusterApiKeyResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateCrossClusterApiKeyResponse.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class CreateCrossClusterApiKeyResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); - private static readonly System.Text.Json.JsonEncodedText PropEncoded = System.Text.Json.JsonEncodedText.Encode("encoded"); - private static readonly System.Text.Json.JsonEncodedText PropExpiration = System.Text.Json.JsonEncodedText.Encode("expiration"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.Security.CreateCrossClusterApiKeyResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propApiKey = default; - LocalJsonValue propEncoded = default; - LocalJsonValue propExpiration = default; - LocalJsonValue propId = default; - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) - { - continue; - } - - if (propEncoded.TryReadProperty(ref reader, options, PropEncoded, null)) - { - continue; - } - - if (propExpiration.TryReadProperty(ref reader, options, PropExpiration, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.CreateCrossClusterApiKeyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ApiKey = propApiKey.Value, - Encoded = propEncoded.Value, - Expiration = propExpiration.Value, - Id = propId.Value, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.CreateCrossClusterApiKeyResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); - writer.WriteProperty(options, PropEncoded, value.Encoded, null, null); - writer.WriteProperty(options, PropExpiration, value.Expiration, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.CreateCrossClusterApiKeyResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.CreateCrossClusterApiKeyResponseConverter))] public sealed partial class CreateCrossClusterApiKeyResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateServiceTokenRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateServiceTokenRequest.Converters.g.cs new file mode 100644 index 00000000000..8b3ab331297 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateServiceTokenRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class CreateServiceTokenRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.CreateServiceTokenRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.CreateServiceTokenRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.CreateServiceTokenRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateServiceTokenRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateServiceTokenRequest.g.cs index 24f6f265328..2efe337afc0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateServiceTokenRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateServiceTokenRequest.g.cs @@ -33,35 +33,6 @@ public sealed partial class CreateServiceTokenRequestParameters : Elastic.Transp public Elastic.Clients.Elasticsearch.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } } -internal sealed partial class CreateServiceTokenRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.CreateServiceTokenRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.CreateServiceTokenRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.CreateServiceTokenRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Create a service account token. @@ -74,7 +45,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// You must actively delete them if they are no longer needed. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.CreateServiceTokenRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.CreateServiceTokenRequestConverter))] public sealed partial class CreateServiceTokenRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateServiceTokenResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateServiceTokenResponse.Converters.g.cs new file mode 100644 index 00000000000..7fc4ba127a8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateServiceTokenResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class CreateServiceTokenResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCreated = System.Text.Json.JsonEncodedText.Encode("created"); + private static readonly System.Text.Json.JsonEncodedText PropToken = System.Text.Json.JsonEncodedText.Encode("token"); + + public override Elastic.Clients.Elasticsearch.Security.CreateServiceTokenResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCreated = default; + LocalJsonValue propToken = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCreated.TryReadProperty(ref reader, options, PropCreated, null)) + { + continue; + } + + if (propToken.TryReadProperty(ref reader, options, PropToken, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.CreateServiceTokenResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Created = propCreated.Value, + Token = propToken.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.CreateServiceTokenResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCreated, value.Created, null, null); + writer.WriteProperty(options, PropToken, value.Token, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateServiceTokenResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateServiceTokenResponse.g.cs index 62cc6e0ad33..cb68b7ac912 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateServiceTokenResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateServiceTokenResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class CreateServiceTokenResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCreated = System.Text.Json.JsonEncodedText.Encode("created"); - private static readonly System.Text.Json.JsonEncodedText PropToken = System.Text.Json.JsonEncodedText.Encode("token"); - - public override Elastic.Clients.Elasticsearch.Security.CreateServiceTokenResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCreated = default; - LocalJsonValue propToken = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCreated.TryReadProperty(ref reader, options, PropCreated, null)) - { - continue; - } - - if (propToken.TryReadProperty(ref reader, options, PropToken, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.CreateServiceTokenResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Created = propCreated.Value, - Token = propToken.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.CreateServiceTokenResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCreated, value.Created, null, null); - writer.WriteProperty(options, PropToken, value.Token, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.CreateServiceTokenResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.CreateServiceTokenResponseConverter))] public sealed partial class CreateServiceTokenResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal CreateServiceTokenResponse(Elastic.Clients.Elasticsearch.Serialization. public #if NET7_0_OR_GREATER - required +required #endif - bool Created { get; set; } +bool Created { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Security.ServiceToken Token { get; set; } +Elastic.Clients.Elasticsearch.Security.ServiceToken Token { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DelegatePkiRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DelegatePkiRequest.Converters.g.cs new file mode 100644 index 00000000000..3e5ad93a777 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DelegatePkiRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class DelegatePkiRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropX509CertificateChain = System.Text.Json.JsonEncodedText.Encode("x509_certificate_chain"); + + public override Elastic.Clients.Elasticsearch.Security.DelegatePkiRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propX509CertificateChain = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propX509CertificateChain.TryReadProperty(ref reader, options, PropX509CertificateChain, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.DelegatePkiRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + X509CertificateChain = propX509CertificateChain.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DelegatePkiRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropX509CertificateChain, value.X509CertificateChain, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DelegatePkiRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DelegatePkiRequest.g.cs index 87ce9e4ad56..95eca19b537 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DelegatePkiRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DelegatePkiRequest.g.cs @@ -27,45 +27,6 @@ public sealed partial class DelegatePkiRequestParameters : Elastic.Transport.Req { } -internal sealed partial class DelegatePkiRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropX509CertificateChain = System.Text.Json.JsonEncodedText.Encode("x509_certificate_chain"); - - public override Elastic.Clients.Elasticsearch.Security.DelegatePkiRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propX509CertificateChain = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propX509CertificateChain.TryReadProperty(ref reader, options, PropX509CertificateChain, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.DelegatePkiRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - X509CertificateChain = propX509CertificateChain.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DelegatePkiRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropX509CertificateChain, value.X509CertificateChain, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// Delegate PKI authentication. @@ -84,7 +45,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The proxy is trusted to have performed the TLS authentication and this API translates that authentication into an Elasticsearch access token. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.DelegatePkiRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.DelegatePkiRequestConverter))] public sealed partial class DelegatePkiRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DelegatePkiResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DelegatePkiResponse.Converters.g.cs new file mode 100644 index 00000000000..1e9250a94db --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DelegatePkiResponse.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class DelegatePkiResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAccessToken = System.Text.Json.JsonEncodedText.Encode("access_token"); + private static readonly System.Text.Json.JsonEncodedText PropAuthentication = System.Text.Json.JsonEncodedText.Encode("authentication"); + private static readonly System.Text.Json.JsonEncodedText PropExpiresIn = System.Text.Json.JsonEncodedText.Encode("expires_in"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Security.DelegatePkiResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAccessToken = default; + LocalJsonValue propAuthentication = default; + LocalJsonValue propExpiresIn = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAccessToken.TryReadProperty(ref reader, options, PropAccessToken, null)) + { + continue; + } + + if (propAuthentication.TryReadProperty(ref reader, options, PropAuthentication, null)) + { + continue; + } + + if (propExpiresIn.TryReadProperty(ref reader, options, PropExpiresIn, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.DelegatePkiResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AccessToken = propAccessToken.Value, + Authentication = propAuthentication.Value, + ExpiresIn = propExpiresIn.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DelegatePkiResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAccessToken, value.AccessToken, null, null); + writer.WriteProperty(options, PropAuthentication, value.Authentication, null, null); + writer.WriteProperty(options, PropExpiresIn, value.ExpiresIn, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DelegatePkiResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DelegatePkiResponse.g.cs index 0ed7e2a42fa..ea872f0983b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DelegatePkiResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DelegatePkiResponse.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class DelegatePkiResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAccessToken = System.Text.Json.JsonEncodedText.Encode("access_token"); - private static readonly System.Text.Json.JsonEncodedText PropAuthentication = System.Text.Json.JsonEncodedText.Encode("authentication"); - private static readonly System.Text.Json.JsonEncodedText PropExpiresIn = System.Text.Json.JsonEncodedText.Encode("expires_in"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Security.DelegatePkiResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAccessToken = default; - LocalJsonValue propAuthentication = default; - LocalJsonValue propExpiresIn = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAccessToken.TryReadProperty(ref reader, options, PropAccessToken, null)) - { - continue; - } - - if (propAuthentication.TryReadProperty(ref reader, options, PropAuthentication, null)) - { - continue; - } - - if (propExpiresIn.TryReadProperty(ref reader, options, PropExpiresIn, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.DelegatePkiResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AccessToken = propAccessToken.Value, - Authentication = propAuthentication.Value, - ExpiresIn = propExpiresIn.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DelegatePkiResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAccessToken, value.AccessToken, null, null); - writer.WriteProperty(options, PropAuthentication, value.Authentication, null, null); - writer.WriteProperty(options, PropExpiresIn, value.ExpiresIn, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.DelegatePkiResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.DelegatePkiResponseConverter))] public sealed partial class DelegatePkiResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeletePrivilegesRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeletePrivilegesRequest.Converters.g.cs new file mode 100644 index 00000000000..4a166136638 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeletePrivilegesRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class DeletePrivilegesRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.DeletePrivilegesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.DeletePrivilegesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DeletePrivilegesRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeletePrivilegesRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeletePrivilegesRequest.g.cs index c613fa130a2..3125ea9d04a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeletePrivilegesRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeletePrivilegesRequest.g.cs @@ -33,35 +33,6 @@ public sealed partial class DeletePrivilegesRequestParameters : Elastic.Transpor public Elastic.Clients.Elasticsearch.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } } -internal sealed partial class DeletePrivilegesRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.DeletePrivilegesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.DeletePrivilegesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DeletePrivilegesRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete application privileges. @@ -82,7 +53,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.DeletePrivilegesRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.DeletePrivilegesRequestConverter))] public sealed partial class DeletePrivilegesRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeletePrivilegesResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeletePrivilegesResponse.Converters.g.cs new file mode 100644 index 00000000000..623cca82d85 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeletePrivilegesResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class DeletePrivilegesResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.DeletePrivilegesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Security.DeletePrivilegesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Result = reader.ReadValue>>(options, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DeletePrivilegesResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Result, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null))); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeletePrivilegesResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeletePrivilegesResponse.g.cs index 0f98e2e795b..c148f2ab099 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeletePrivilegesResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeletePrivilegesResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class DeletePrivilegesResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.DeletePrivilegesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Security.DeletePrivilegesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Result = reader.ReadValue>>(options, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DeletePrivilegesResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Result, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null))); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.DeletePrivilegesResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.DeletePrivilegesResponseConverter))] public sealed partial class DeletePrivilegesResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleMappingRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleMappingRequest.Converters.g.cs new file mode 100644 index 00000000000..71eea8d4f3f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleMappingRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class DeleteRoleMappingRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.DeleteRoleMappingRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.DeleteRoleMappingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DeleteRoleMappingRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleMappingRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleMappingRequest.g.cs index aa9b6ab267f..4d6b0d6fda7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleMappingRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleMappingRequest.g.cs @@ -33,35 +33,6 @@ public sealed partial class DeleteRoleMappingRequestParameters : Elastic.Transpo public Elastic.Clients.Elasticsearch.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } } -internal sealed partial class DeleteRoleMappingRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.DeleteRoleMappingRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.DeleteRoleMappingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DeleteRoleMappingRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete role mappings. @@ -72,7 +43,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The delete role mappings API cannot remove role mappings that are defined in role mapping files. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.DeleteRoleMappingRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.DeleteRoleMappingRequestConverter))] public sealed partial class DeleteRoleMappingRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleMappingResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleMappingResponse.Converters.g.cs new file mode 100644 index 00000000000..9a7b0d5defe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleMappingResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class DeleteRoleMappingResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFound = System.Text.Json.JsonEncodedText.Encode("found"); + + public override Elastic.Clients.Elasticsearch.Security.DeleteRoleMappingResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFound = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFound.TryReadProperty(ref reader, options, PropFound, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.DeleteRoleMappingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Found = propFound.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DeleteRoleMappingResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFound, value.Found, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleMappingResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleMappingResponse.g.cs index f237e8a9206..b852d6c6563 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleMappingResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleMappingResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class DeleteRoleMappingResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFound = System.Text.Json.JsonEncodedText.Encode("found"); - - public override Elastic.Clients.Elasticsearch.Security.DeleteRoleMappingResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFound = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFound.TryReadProperty(ref reader, options, PropFound, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.DeleteRoleMappingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Found = propFound.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DeleteRoleMappingResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFound, value.Found, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.DeleteRoleMappingResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.DeleteRoleMappingResponseConverter))] public sealed partial class DeleteRoleMappingResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleRequest.Converters.g.cs new file mode 100644 index 00000000000..92662e130c0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class DeleteRoleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.DeleteRoleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.DeleteRoleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DeleteRoleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleRequest.g.cs index edae4b44b2c..cdc331114bd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleRequest.g.cs @@ -33,35 +33,6 @@ public sealed partial class DeleteRoleRequestParameters : Elastic.Transport.Requ public Elastic.Clients.Elasticsearch.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } } -internal sealed partial class DeleteRoleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.DeleteRoleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.DeleteRoleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DeleteRoleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete roles. @@ -72,7 +43,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The delete roles API cannot remove roles that are defined in roles files. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.DeleteRoleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.DeleteRoleRequestConverter))] public sealed partial class DeleteRoleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleResponse.Converters.g.cs new file mode 100644 index 00000000000..80f6449131b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class DeleteRoleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFound = System.Text.Json.JsonEncodedText.Encode("found"); + + public override Elastic.Clients.Elasticsearch.Security.DeleteRoleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFound = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFound.TryReadProperty(ref reader, options, PropFound, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.DeleteRoleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Found = propFound.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DeleteRoleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFound, value.Found, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleResponse.g.cs index e6f74230d85..5cbef624939 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteRoleResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class DeleteRoleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFound = System.Text.Json.JsonEncodedText.Encode("found"); - - public override Elastic.Clients.Elasticsearch.Security.DeleteRoleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFound = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFound.TryReadProperty(ref reader, options, PropFound, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.DeleteRoleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Found = propFound.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DeleteRoleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFound, value.Found, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.DeleteRoleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.DeleteRoleResponseConverter))] public sealed partial class DeleteRoleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteServiceTokenRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteServiceTokenRequest.Converters.g.cs new file mode 100644 index 00000000000..021d14922e7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteServiceTokenRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class DeleteServiceTokenRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.DeleteServiceTokenRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.DeleteServiceTokenRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DeleteServiceTokenRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteServiceTokenRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteServiceTokenRequest.g.cs index 2de344743d1..8ae8d883c0a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteServiceTokenRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteServiceTokenRequest.g.cs @@ -33,35 +33,6 @@ public sealed partial class DeleteServiceTokenRequestParameters : Elastic.Transp public Elastic.Clients.Elasticsearch.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } } -internal sealed partial class DeleteServiceTokenRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.DeleteServiceTokenRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.DeleteServiceTokenRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DeleteServiceTokenRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete service account tokens. @@ -70,7 +41,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Delete service account tokens for a service in a specified namespace. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.DeleteServiceTokenRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.DeleteServiceTokenRequestConverter))] public sealed partial class DeleteServiceTokenRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteServiceTokenResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteServiceTokenResponse.Converters.g.cs new file mode 100644 index 00000000000..3c363f93c74 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteServiceTokenResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class DeleteServiceTokenResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFound = System.Text.Json.JsonEncodedText.Encode("found"); + + public override Elastic.Clients.Elasticsearch.Security.DeleteServiceTokenResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFound = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFound.TryReadProperty(ref reader, options, PropFound, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.DeleteServiceTokenResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Found = propFound.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DeleteServiceTokenResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFound, value.Found, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteServiceTokenResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteServiceTokenResponse.g.cs index 4e7f372441a..a7b025b22f1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteServiceTokenResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteServiceTokenResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class DeleteServiceTokenResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFound = System.Text.Json.JsonEncodedText.Encode("found"); - - public override Elastic.Clients.Elasticsearch.Security.DeleteServiceTokenResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFound = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFound.TryReadProperty(ref reader, options, PropFound, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.DeleteServiceTokenResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Found = propFound.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DeleteServiceTokenResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFound, value.Found, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.DeleteServiceTokenResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.DeleteServiceTokenResponseConverter))] public sealed partial class DeleteServiceTokenResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteUserRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteUserRequest.Converters.g.cs new file mode 100644 index 00000000000..401946113c6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteUserRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class DeleteUserRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.DeleteUserRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.DeleteUserRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DeleteUserRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteUserRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteUserRequest.g.cs index b60fb6f3655..dc86c161f10 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteUserRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteUserRequest.g.cs @@ -33,35 +33,6 @@ public sealed partial class DeleteUserRequestParameters : Elastic.Transport.Requ public Elastic.Clients.Elasticsearch.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } } -internal sealed partial class DeleteUserRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.DeleteUserRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.DeleteUserRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DeleteUserRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete users. @@ -70,7 +41,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Delete users from the native realm. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.DeleteUserRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.DeleteUserRequestConverter))] public sealed partial class DeleteUserRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteUserResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteUserResponse.Converters.g.cs new file mode 100644 index 00000000000..ec883db18df --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteUserResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class DeleteUserResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFound = System.Text.Json.JsonEncodedText.Encode("found"); + + public override Elastic.Clients.Elasticsearch.Security.DeleteUserResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFound = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFound.TryReadProperty(ref reader, options, PropFound, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.DeleteUserResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Found = propFound.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DeleteUserResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFound, value.Found, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteUserResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteUserResponse.g.cs index 74c3db7fe46..64f4d16ca1e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteUserResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DeleteUserResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class DeleteUserResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFound = System.Text.Json.JsonEncodedText.Encode("found"); - - public override Elastic.Clients.Elasticsearch.Security.DeleteUserResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFound = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFound.TryReadProperty(ref reader, options, PropFound, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.DeleteUserResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Found = propFound.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DeleteUserResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFound, value.Found, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.DeleteUserResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.DeleteUserResponseConverter))] public sealed partial class DeleteUserResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserProfileRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserProfileRequest.Converters.g.cs new file mode 100644 index 00000000000..a58bdd275a2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserProfileRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class DisableUserProfileRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.DisableUserProfileRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.DisableUserProfileRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DisableUserProfileRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserProfileRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserProfileRequest.g.cs index a62a53e1a47..d20fb9c4cd7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserProfileRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserProfileRequest.g.cs @@ -35,35 +35,6 @@ public sealed partial class DisableUserProfileRequestParameters : Elastic.Transp public Elastic.Clients.Elasticsearch.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } } -internal sealed partial class DisableUserProfileRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.DisableUserProfileRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.DisableUserProfileRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DisableUserProfileRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Disable a user profile. @@ -81,7 +52,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// To re-enable a disabled user profile, use the enable user profile API . /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.DisableUserProfileRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.DisableUserProfileRequestConverter))] public sealed partial class DisableUserProfileRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserProfileResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserProfileResponse.Converters.g.cs new file mode 100644 index 00000000000..07d2a3e6627 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserProfileResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class DisableUserProfileResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.Security.DisableUserProfileResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.DisableUserProfileResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DisableUserProfileResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserProfileResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserProfileResponse.g.cs index 01fffeb5de7..7118ac5b9ce 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserProfileResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserProfileResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class DisableUserProfileResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.Security.DisableUserProfileResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.DisableUserProfileResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DisableUserProfileResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.DisableUserProfileResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.DisableUserProfileResponseConverter))] public sealed partial class DisableUserProfileResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserRequest.Converters.g.cs new file mode 100644 index 00000000000..f4e243bbba3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class DisableUserRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.DisableUserRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.DisableUserRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DisableUserRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserRequest.g.cs index 4e6b4a8abee..9c571f37480 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserRequest.g.cs @@ -33,35 +33,6 @@ public sealed partial class DisableUserRequestParameters : Elastic.Transport.Req public Elastic.Clients.Elasticsearch.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } } -internal sealed partial class DisableUserRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.DisableUserRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.DisableUserRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DisableUserRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Disable users. @@ -72,7 +43,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// You can use this API to revoke a user's access to Elasticsearch. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.DisableUserRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.DisableUserRequestConverter))] public sealed partial class DisableUserRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserResponse.Converters.g.cs new file mode 100644 index 00000000000..b4d9d65a3cc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserResponse.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class DisableUserResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.DisableUserResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.DisableUserResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DisableUserResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserResponse.g.cs index c60fceb4e52..23b6528322f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/DisableUserResponse.g.cs @@ -23,36 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class DisableUserResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.DisableUserResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.DisableUserResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.DisableUserResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.DisableUserResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.DisableUserResponseConverter))] public sealed partial class DisableUserResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserProfileRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserProfileRequest.Converters.g.cs new file mode 100644 index 00000000000..2bb8ab16ccc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserProfileRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class EnableUserProfileRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.EnableUserProfileRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.EnableUserProfileRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.EnableUserProfileRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserProfileRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserProfileRequest.g.cs index e42734ec25b..1bc3b2964a8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserProfileRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserProfileRequest.g.cs @@ -36,35 +36,6 @@ public sealed partial class EnableUserProfileRequestParameters : Elastic.Transpo public Elastic.Clients.Elasticsearch.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } } -internal sealed partial class EnableUserProfileRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.EnableUserProfileRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.EnableUserProfileRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.EnableUserProfileRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Enable a user profile. @@ -82,7 +53,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If you later disable the user profile, you can use the enable user profile API to make the profile visible in these searches again. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.EnableUserProfileRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.EnableUserProfileRequestConverter))] public sealed partial class EnableUserProfileRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserProfileResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserProfileResponse.Converters.g.cs new file mode 100644 index 00000000000..02956f32896 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserProfileResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class EnableUserProfileResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.Security.EnableUserProfileResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.EnableUserProfileResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.EnableUserProfileResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserProfileResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserProfileResponse.g.cs index 2b5b6c64710..445a66797f4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserProfileResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserProfileResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class EnableUserProfileResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.Security.EnableUserProfileResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.EnableUserProfileResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.EnableUserProfileResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.EnableUserProfileResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.EnableUserProfileResponseConverter))] public sealed partial class EnableUserProfileResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserRequest.Converters.g.cs new file mode 100644 index 00000000000..b7ef049b3ba --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class EnableUserRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.EnableUserRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.EnableUserRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.EnableUserRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserRequest.g.cs index af3410534f9..2164a212b8d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserRequest.g.cs @@ -33,35 +33,6 @@ public sealed partial class EnableUserRequestParameters : Elastic.Transport.Requ public Elastic.Clients.Elasticsearch.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } } -internal sealed partial class EnableUserRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.EnableUserRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.EnableUserRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.EnableUserRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Enable users. @@ -71,7 +42,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// By default, when you create users, they are enabled. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.EnableUserRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.EnableUserRequestConverter))] public sealed partial class EnableUserRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserResponse.Converters.g.cs new file mode 100644 index 00000000000..9da3b29f58b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserResponse.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class EnableUserResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.EnableUserResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.EnableUserResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.EnableUserResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserResponse.g.cs index fbb460aa564..43e40b761a3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnableUserResponse.g.cs @@ -23,36 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class EnableUserResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.EnableUserResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.EnableUserResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.EnableUserResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.EnableUserResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.EnableUserResponseConverter))] public sealed partial class EnableUserResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollKibanaRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollKibanaRequest.Converters.g.cs new file mode 100644 index 00000000000..531d9b9c199 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollKibanaRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class EnrollKibanaRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.EnrollKibanaRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.EnrollKibanaRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.EnrollKibanaRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollKibanaRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollKibanaRequest.g.cs index 613da170790..9b37fcf5283 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollKibanaRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollKibanaRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class EnrollKibanaRequestParameters : Elastic.Transport.Re { } -internal sealed partial class EnrollKibanaRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.EnrollKibanaRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.EnrollKibanaRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.EnrollKibanaRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Enroll Kibana. @@ -68,7 +39,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Kibana uses this API internally to configure itself for communications with an Elasticsearch cluster that already has security features enabled. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.EnrollKibanaRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.EnrollKibanaRequestConverter))] public sealed partial class EnrollKibanaRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollKibanaResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollKibanaResponse.Converters.g.cs new file mode 100644 index 00000000000..0808b4adb23 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollKibanaResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class EnrollKibanaResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropHttpCa = System.Text.Json.JsonEncodedText.Encode("http_ca"); + private static readonly System.Text.Json.JsonEncodedText PropToken = System.Text.Json.JsonEncodedText.Encode("token"); + + public override Elastic.Clients.Elasticsearch.Security.EnrollKibanaResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propHttpCa = default; + LocalJsonValue propToken = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propHttpCa.TryReadProperty(ref reader, options, PropHttpCa, null)) + { + continue; + } + + if (propToken.TryReadProperty(ref reader, options, PropToken, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.EnrollKibanaResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + HttpCa = propHttpCa.Value, + Token = propToken.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.EnrollKibanaResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropHttpCa, value.HttpCa, null, null); + writer.WriteProperty(options, PropToken, value.Token, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollKibanaResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollKibanaResponse.g.cs index b97dc2ba19c..29a4ffa4c69 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollKibanaResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollKibanaResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class EnrollKibanaResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropHttpCa = System.Text.Json.JsonEncodedText.Encode("http_ca"); - private static readonly System.Text.Json.JsonEncodedText PropToken = System.Text.Json.JsonEncodedText.Encode("token"); - - public override Elastic.Clients.Elasticsearch.Security.EnrollKibanaResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propHttpCa = default; - LocalJsonValue propToken = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propHttpCa.TryReadProperty(ref reader, options, PropHttpCa, null)) - { - continue; - } - - if (propToken.TryReadProperty(ref reader, options, PropToken, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.EnrollKibanaResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - HttpCa = propHttpCa.Value, - Token = propToken.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.EnrollKibanaResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropHttpCa, value.HttpCa, null, null); - writer.WriteProperty(options, PropToken, value.Token, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.EnrollKibanaResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.EnrollKibanaResponseConverter))] public sealed partial class EnrollKibanaResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollNodeRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollNodeRequest.Converters.g.cs new file mode 100644 index 00000000000..3f73ec36ba6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollNodeRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class EnrollNodeRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.EnrollNodeRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.EnrollNodeRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.EnrollNodeRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollNodeRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollNodeRequest.g.cs index 5363e5c22c4..981333d912d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollNodeRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollNodeRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class EnrollNodeRequestParameters : Elastic.Transport.Requ { } -internal sealed partial class EnrollNodeRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.EnrollNodeRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.EnrollNodeRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.EnrollNodeRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Enroll a node. @@ -68,7 +39,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The response contains key and certificate material that allows the caller to generate valid signed certificates for the HTTP layer of all nodes in the cluster. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.EnrollNodeRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.EnrollNodeRequestConverter))] public sealed partial class EnrollNodeRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollNodeResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollNodeResponse.Converters.g.cs new file mode 100644 index 00000000000..e723c7feec4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollNodeResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class EnrollNodeResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropHttpCaCert = System.Text.Json.JsonEncodedText.Encode("http_ca_cert"); + private static readonly System.Text.Json.JsonEncodedText PropHttpCaKey = System.Text.Json.JsonEncodedText.Encode("http_ca_key"); + private static readonly System.Text.Json.JsonEncodedText PropNodesAddresses = System.Text.Json.JsonEncodedText.Encode("nodes_addresses"); + private static readonly System.Text.Json.JsonEncodedText PropTransportCaCert = System.Text.Json.JsonEncodedText.Encode("transport_ca_cert"); + private static readonly System.Text.Json.JsonEncodedText PropTransportCert = System.Text.Json.JsonEncodedText.Encode("transport_cert"); + private static readonly System.Text.Json.JsonEncodedText PropTransportKey = System.Text.Json.JsonEncodedText.Encode("transport_key"); + + public override Elastic.Clients.Elasticsearch.Security.EnrollNodeResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propHttpCaCert = default; + LocalJsonValue propHttpCaKey = default; + LocalJsonValue> propNodesAddresses = default; + LocalJsonValue propTransportCaCert = default; + LocalJsonValue propTransportCert = default; + LocalJsonValue propTransportKey = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propHttpCaCert.TryReadProperty(ref reader, options, PropHttpCaCert, null)) + { + continue; + } + + if (propHttpCaKey.TryReadProperty(ref reader, options, PropHttpCaKey, null)) + { + continue; + } + + if (propNodesAddresses.TryReadProperty(ref reader, options, PropNodesAddresses, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propTransportCaCert.TryReadProperty(ref reader, options, PropTransportCaCert, null)) + { + continue; + } + + if (propTransportCert.TryReadProperty(ref reader, options, PropTransportCert, null)) + { + continue; + } + + if (propTransportKey.TryReadProperty(ref reader, options, PropTransportKey, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.EnrollNodeResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + HttpCaCert = propHttpCaCert.Value, + HttpCaKey = propHttpCaKey.Value, + NodesAddresses = propNodesAddresses.Value, + TransportCaCert = propTransportCaCert.Value, + TransportCert = propTransportCert.Value, + TransportKey = propTransportKey.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.EnrollNodeResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropHttpCaCert, value.HttpCaCert, null, null); + writer.WriteProperty(options, PropHttpCaKey, value.HttpCaKey, null, null); + writer.WriteProperty(options, PropNodesAddresses, value.NodesAddresses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTransportCaCert, value.TransportCaCert, null, null); + writer.WriteProperty(options, PropTransportCert, value.TransportCert, null, null); + writer.WriteProperty(options, PropTransportKey, value.TransportKey, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollNodeResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollNodeResponse.g.cs index 561a5a242b4..6a44726ca43 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollNodeResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/EnrollNodeResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class EnrollNodeResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropHttpCaCert = System.Text.Json.JsonEncodedText.Encode("http_ca_cert"); - private static readonly System.Text.Json.JsonEncodedText PropHttpCaKey = System.Text.Json.JsonEncodedText.Encode("http_ca_key"); - private static readonly System.Text.Json.JsonEncodedText PropNodesAddresses = System.Text.Json.JsonEncodedText.Encode("nodes_addresses"); - private static readonly System.Text.Json.JsonEncodedText PropTransportCaCert = System.Text.Json.JsonEncodedText.Encode("transport_ca_cert"); - private static readonly System.Text.Json.JsonEncodedText PropTransportCert = System.Text.Json.JsonEncodedText.Encode("transport_cert"); - private static readonly System.Text.Json.JsonEncodedText PropTransportKey = System.Text.Json.JsonEncodedText.Encode("transport_key"); - - public override Elastic.Clients.Elasticsearch.Security.EnrollNodeResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propHttpCaCert = default; - LocalJsonValue propHttpCaKey = default; - LocalJsonValue> propNodesAddresses = default; - LocalJsonValue propTransportCaCert = default; - LocalJsonValue propTransportCert = default; - LocalJsonValue propTransportKey = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propHttpCaCert.TryReadProperty(ref reader, options, PropHttpCaCert, null)) - { - continue; - } - - if (propHttpCaKey.TryReadProperty(ref reader, options, PropHttpCaKey, null)) - { - continue; - } - - if (propNodesAddresses.TryReadProperty(ref reader, options, PropNodesAddresses, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propTransportCaCert.TryReadProperty(ref reader, options, PropTransportCaCert, null)) - { - continue; - } - - if (propTransportCert.TryReadProperty(ref reader, options, PropTransportCert, null)) - { - continue; - } - - if (propTransportKey.TryReadProperty(ref reader, options, PropTransportKey, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.EnrollNodeResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - HttpCaCert = propHttpCaCert.Value, - HttpCaKey = propHttpCaKey.Value, - NodesAddresses = propNodesAddresses.Value, - TransportCaCert = propTransportCaCert.Value, - TransportCert = propTransportCert.Value, - TransportKey = propTransportKey.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.EnrollNodeResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropHttpCaCert, value.HttpCaCert, null, null); - writer.WriteProperty(options, PropHttpCaKey, value.HttpCaKey, null, null); - writer.WriteProperty(options, PropNodesAddresses, value.NodesAddresses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTransportCaCert, value.TransportCaCert, null, null); - writer.WriteProperty(options, PropTransportCert, value.TransportCert, null, null); - writer.WriteProperty(options, PropTransportKey, value.TransportKey, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.EnrollNodeResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.EnrollNodeResponseConverter))] public sealed partial class EnrollNodeResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetApiKeyRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetApiKeyRequest.Converters.g.cs new file mode 100644 index 00000000000..6eef86b680c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetApiKeyRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GetApiKeyRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.GetApiKeyRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.GetApiKeyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetApiKeyRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetApiKeyRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetApiKeyRequest.g.cs index ff69d328175..d8be0df5072 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetApiKeyRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetApiKeyRequest.g.cs @@ -91,35 +91,6 @@ public sealed partial class GetApiKeyRequestParameters : Elastic.Transport.Reque public bool? WithProfileUid { get => Q("with_profile_uid"); set => Q("with_profile_uid", value); } } -internal sealed partial class GetApiKeyRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.GetApiKeyRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.GetApiKeyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetApiKeyRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get API key information. @@ -130,7 +101,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If you have read_security, manage_api_key or greater privileges (including manage_security), this API returns all API keys regardless of ownership. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GetApiKeyRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetApiKeyRequestConverter))] public sealed partial class GetApiKeyRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetApiKeyResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetApiKeyResponse.Converters.g.cs new file mode 100644 index 00000000000..d989ef8397c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetApiKeyResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GetApiKeyResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApiKeys = System.Text.Json.JsonEncodedText.Encode("api_keys"); + + public override Elastic.Clients.Elasticsearch.Security.GetApiKeyResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propApiKeys = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApiKeys.TryReadProperty(ref reader, options, PropApiKeys, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.GetApiKeyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ApiKeys = propApiKeys.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetApiKeyResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApiKeys, value.ApiKeys, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetApiKeyResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetApiKeyResponse.g.cs index 7d5cd465f6a..f90839ab1bb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetApiKeyResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetApiKeyResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class GetApiKeyResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApiKeys = System.Text.Json.JsonEncodedText.Encode("api_keys"); - - public override Elastic.Clients.Elasticsearch.Security.GetApiKeyResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propApiKeys = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApiKeys.TryReadProperty(ref reader, options, PropApiKeys, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.GetApiKeyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ApiKeys = propApiKeys.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetApiKeyResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApiKeys, value.ApiKeys, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GetApiKeyResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetApiKeyResponseConverter))] public sealed partial class GetApiKeyResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal GetApiKeyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConst public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection ApiKeys { get; set; } +System.Collections.Generic.IReadOnlyCollection ApiKeys { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetBuiltinPrivilegesRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetBuiltinPrivilegesRequest.Converters.g.cs new file mode 100644 index 00000000000..9e99fc4b0f1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetBuiltinPrivilegesRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GetBuiltinPrivilegesRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.GetBuiltinPrivilegesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.GetBuiltinPrivilegesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetBuiltinPrivilegesRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetBuiltinPrivilegesRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetBuiltinPrivilegesRequest.g.cs index cf59ec9a857..0b2729af905 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetBuiltinPrivilegesRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetBuiltinPrivilegesRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class GetBuiltinPrivilegesRequestParameters : Elastic.Tran { } -internal sealed partial class GetBuiltinPrivilegesRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.GetBuiltinPrivilegesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.GetBuiltinPrivilegesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetBuiltinPrivilegesRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get builtin privileges. @@ -64,7 +35,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Get the list of cluster privileges and index privileges that are available in this version of Elasticsearch. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GetBuiltinPrivilegesRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetBuiltinPrivilegesRequestConverter))] public sealed partial class GetBuiltinPrivilegesRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetBuiltinPrivilegesResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetBuiltinPrivilegesResponse.Converters.g.cs new file mode 100644 index 00000000000..816c2d24d60 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetBuiltinPrivilegesResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GetBuiltinPrivilegesResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropRemoteCluster = System.Text.Json.JsonEncodedText.Encode("remote_cluster"); + + public override Elastic.Clients.Elasticsearch.Security.GetBuiltinPrivilegesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propCluster = default; + LocalJsonValue> propIndex = default; + LocalJsonValue> propRemoteCluster = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCluster.TryReadProperty(ref reader, options, PropCluster, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propRemoteCluster.TryReadProperty(ref reader, options, PropRemoteCluster, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.GetBuiltinPrivilegesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Cluster = propCluster.Value, + Index = propIndex.Value, + RemoteCluster = propRemoteCluster.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetBuiltinPrivilegesResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCluster, value.Cluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRemoteCluster, value.RemoteCluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetBuiltinPrivilegesResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetBuiltinPrivilegesResponse.g.cs index 7eaaf243ad3..83e76c82022 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetBuiltinPrivilegesResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetBuiltinPrivilegesResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class GetBuiltinPrivilegesResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropRemoteCluster = System.Text.Json.JsonEncodedText.Encode("remote_cluster"); - - public override Elastic.Clients.Elasticsearch.Security.GetBuiltinPrivilegesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propCluster = default; - LocalJsonValue> propIndex = default; - LocalJsonValue> propRemoteCluster = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCluster.TryReadProperty(ref reader, options, PropCluster, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propRemoteCluster.TryReadProperty(ref reader, options, PropRemoteCluster, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.GetBuiltinPrivilegesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Cluster = propCluster.Value, - Index = propIndex.Value, - RemoteCluster = propRemoteCluster.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetBuiltinPrivilegesResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCluster, value.Cluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRemoteCluster, value.RemoteCluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GetBuiltinPrivilegesResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetBuiltinPrivilegesResponseConverter))] public sealed partial class GetBuiltinPrivilegesResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetPrivilegesRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetPrivilegesRequest.Converters.g.cs new file mode 100644 index 00000000000..d9bd1f366f5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetPrivilegesRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GetPrivilegesRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.GetPrivilegesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.GetPrivilegesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetPrivilegesRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetPrivilegesRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetPrivilegesRequest.g.cs index b5365a53bff..75da2124c0c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetPrivilegesRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetPrivilegesRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class GetPrivilegesRequestParameters : Elastic.Transport.R { } -internal sealed partial class GetPrivilegesRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.GetPrivilegesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.GetPrivilegesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetPrivilegesRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get application privileges. @@ -76,7 +47,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GetPrivilegesRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetPrivilegesRequestConverter))] public sealed partial class GetPrivilegesRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetPrivilegesRequest(Elastic.Clients.Elasticsearch.Name? application) : base(r => r.Optional("application", application)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetPrivilegesResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetPrivilegesResponse.Converters.g.cs new file mode 100644 index 00000000000..727a2f7d387 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetPrivilegesResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GetPrivilegesResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.GetPrivilegesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Security.GetPrivilegesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Privileges = reader.ReadValue>>(options, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetPrivilegesResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Privileges, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null))); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetPrivilegesResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetPrivilegesResponse.g.cs index 8b9b60ed4d7..72838f26fc5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetPrivilegesResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetPrivilegesResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class GetPrivilegesResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.GetPrivilegesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Security.GetPrivilegesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Privileges = reader.ReadValue>>(options, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetPrivilegesResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Privileges, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null))); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GetPrivilegesResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetPrivilegesResponseConverter))] public sealed partial class GetPrivilegesResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleMappingRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleMappingRequest.Converters.g.cs new file mode 100644 index 00000000000..c9c6153f5f9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleMappingRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GetRoleMappingRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.GetRoleMappingRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.GetRoleMappingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetRoleMappingRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleMappingRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleMappingRequest.g.cs index ac33f650f65..b6637be2221 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleMappingRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleMappingRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class GetRoleMappingRequestParameters : Elastic.Transport. { } -internal sealed partial class GetRoleMappingRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.GetRoleMappingRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.GetRoleMappingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetRoleMappingRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get role mappings. @@ -66,7 +37,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The get role mappings API cannot retrieve role mappings that are defined in role mapping files. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GetRoleMappingRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetRoleMappingRequestConverter))] public sealed partial class GetRoleMappingRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetRoleMappingRequest(Elastic.Clients.Elasticsearch.Names? name) : base(r => r.Optional("name", name)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleMappingResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleMappingResponse.Converters.g.cs new file mode 100644 index 00000000000..4d9f6d82cec --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleMappingResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GetRoleMappingResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.GetRoleMappingResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Security.GetRoleMappingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { RoleMappings = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetRoleMappingResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.RoleMappings, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleMappingResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleMappingResponse.g.cs index 5535cb646a1..9a5fd203af1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleMappingResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleMappingResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class GetRoleMappingResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.GetRoleMappingResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Security.GetRoleMappingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { RoleMappings = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetRoleMappingResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.RoleMappings, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GetRoleMappingResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetRoleMappingResponseConverter))] public sealed partial class GetRoleMappingResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleRequest.Converters.g.cs new file mode 100644 index 00000000000..8dcf0c5674f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GetRoleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.GetRoleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.GetRoleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetRoleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleRequest.g.cs index 3f770d5f942..09388a11256 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class GetRoleRequestParameters : Elastic.Transport.Request { } -internal sealed partial class GetRoleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.GetRoleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.GetRoleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetRoleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get roles. @@ -66,7 +37,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The get roles API cannot retrieve roles that are defined in roles files. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GetRoleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetRoleRequestConverter))] public sealed partial class GetRoleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetRoleRequest(Elastic.Clients.Elasticsearch.Names? name) : base(r => r.Optional("name", name)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleResponse.Converters.g.cs new file mode 100644 index 00000000000..f6bc732fc64 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GetRoleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.GetRoleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Security.GetRoleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Roles = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetRoleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Roles, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleResponse.g.cs index 1ff6146ab3e..121bc402f1a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetRoleResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class GetRoleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.GetRoleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Security.GetRoleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Roles = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetRoleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Roles, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GetRoleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetRoleResponseConverter))] public sealed partial class GetRoleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetSecuritySettingsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetSecuritySettingsRequest.Converters.g.cs new file mode 100644 index 00000000000..39e478ee2f7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetSecuritySettingsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GetSecuritySettingsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.GetSecuritySettingsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.GetSecuritySettingsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetSecuritySettingsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetSecuritySettingsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetSecuritySettingsRequest.g.cs index b2839cc1dd6..c4f7ed7fa04 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetSecuritySettingsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetSecuritySettingsRequest.g.cs @@ -34,35 +34,6 @@ public sealed partial class GetSecuritySettingsRequestParameters : Elastic.Trans public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class GetSecuritySettingsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.GetSecuritySettingsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.GetSecuritySettingsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetSecuritySettingsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get security index settings. @@ -85,7 +56,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GetSecuritySettingsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetSecuritySettingsRequestConverter))] public sealed partial class GetSecuritySettingsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetSecuritySettingsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetSecuritySettingsResponse.Converters.g.cs new file mode 100644 index 00000000000..8fd187ce410 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetSecuritySettingsResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GetSecuritySettingsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSecurity = System.Text.Json.JsonEncodedText.Encode("security"); + private static readonly System.Text.Json.JsonEncodedText PropSecurityProfile = System.Text.Json.JsonEncodedText.Encode("security-profile"); + private static readonly System.Text.Json.JsonEncodedText PropSecurityTokens = System.Text.Json.JsonEncodedText.Encode("security-tokens"); + + public override Elastic.Clients.Elasticsearch.Security.GetSecuritySettingsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propSecurity = default; + LocalJsonValue propSecurityProfile = default; + LocalJsonValue propSecurityTokens = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSecurity.TryReadProperty(ref reader, options, PropSecurity, null)) + { + continue; + } + + if (propSecurityProfile.TryReadProperty(ref reader, options, PropSecurityProfile, null)) + { + continue; + } + + if (propSecurityTokens.TryReadProperty(ref reader, options, PropSecurityTokens, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.GetSecuritySettingsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Security = propSecurity.Value, + SecurityProfile = propSecurityProfile.Value, + SecurityTokens = propSecurityTokens.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetSecuritySettingsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSecurity, value.Security, null, null); + writer.WriteProperty(options, PropSecurityProfile, value.SecurityProfile, null, null); + writer.WriteProperty(options, PropSecurityTokens, value.SecurityTokens, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetSecuritySettingsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetSecuritySettingsResponse.g.cs index 1f68956e422..435de25e5b3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetSecuritySettingsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetSecuritySettingsResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class GetSecuritySettingsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSecurity = System.Text.Json.JsonEncodedText.Encode("security"); - private static readonly System.Text.Json.JsonEncodedText PropSecurityProfile = System.Text.Json.JsonEncodedText.Encode("security-profile"); - private static readonly System.Text.Json.JsonEncodedText PropSecurityTokens = System.Text.Json.JsonEncodedText.Encode("security-tokens"); - - public override Elastic.Clients.Elasticsearch.Security.GetSecuritySettingsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propSecurity = default; - LocalJsonValue propSecurityProfile = default; - LocalJsonValue propSecurityTokens = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSecurity.TryReadProperty(ref reader, options, PropSecurity, null)) - { - continue; - } - - if (propSecurityProfile.TryReadProperty(ref reader, options, PropSecurityProfile, null)) - { - continue; - } - - if (propSecurityTokens.TryReadProperty(ref reader, options, PropSecurityTokens, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.GetSecuritySettingsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Security = propSecurity.Value, - SecurityProfile = propSecurityProfile.Value, - SecurityTokens = propSecurityTokens.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetSecuritySettingsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSecurity, value.Security, null, null); - writer.WriteProperty(options, PropSecurityProfile, value.SecurityProfile, null, null); - writer.WriteProperty(options, PropSecurityTokens, value.SecurityTokens, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GetSecuritySettingsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetSecuritySettingsResponseConverter))] public sealed partial class GetSecuritySettingsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceAccountsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceAccountsRequest.Converters.g.cs new file mode 100644 index 00000000000..3e10064f9d6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceAccountsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GetServiceAccountsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.GetServiceAccountsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.GetServiceAccountsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetServiceAccountsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceAccountsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceAccountsRequest.g.cs index f808de6bb74..9c9a56fdac4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceAccountsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceAccountsRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class GetServiceAccountsRequestParameters : Elastic.Transp { } -internal sealed partial class GetServiceAccountsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.GetServiceAccountsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.GetServiceAccountsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetServiceAccountsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get service accounts. @@ -67,7 +38,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// NOTE: Currently, only the elastic/fleet-server service account is available. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GetServiceAccountsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetServiceAccountsRequestConverter))] public sealed partial class GetServiceAccountsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetServiceAccountsRequest(string? @namespace, string? service) : base(r => r.Optional("namespace", @namespace).Optional("service", service)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceAccountsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceAccountsResponse.Converters.g.cs new file mode 100644 index 00000000000..26f2e0b21cd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceAccountsResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GetServiceAccountsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.GetServiceAccountsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Security.GetServiceAccountsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { ServiceAccoutns = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetServiceAccountsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.ServiceAccoutns, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceAccountsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceAccountsResponse.g.cs index e5215ea21fb..7049d4d90f3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceAccountsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceAccountsResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class GetServiceAccountsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.GetServiceAccountsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Security.GetServiceAccountsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { ServiceAccoutns = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetServiceAccountsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.ServiceAccoutns, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GetServiceAccountsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetServiceAccountsResponseConverter))] public sealed partial class GetServiceAccountsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceCredentialsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceCredentialsRequest.Converters.g.cs new file mode 100644 index 00000000000..a71513561f8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceCredentialsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GetServiceCredentialsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.GetServiceCredentialsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.GetServiceCredentialsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetServiceCredentialsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceCredentialsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceCredentialsRequest.g.cs index 423d5ec791c..a839b1c80ff 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceCredentialsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceCredentialsRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class GetServiceCredentialsRequestParameters : Elastic.Tra { } -internal sealed partial class GetServiceCredentialsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.GetServiceCredentialsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.GetServiceCredentialsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetServiceCredentialsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get service account credentials. @@ -71,7 +42,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Tokens with the same name from different nodes are assumed to be the same token and are only counted once towards the total number of service tokens. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GetServiceCredentialsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetServiceCredentialsRequestConverter))] public sealed partial class GetServiceCredentialsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceCredentialsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceCredentialsResponse.Converters.g.cs new file mode 100644 index 00000000000..5c11e4688dd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceCredentialsResponse.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GetServiceCredentialsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropNodesCredentials = System.Text.Json.JsonEncodedText.Encode("nodes_credentials"); + private static readonly System.Text.Json.JsonEncodedText PropServiceAccount = System.Text.Json.JsonEncodedText.Encode("service_account"); + private static readonly System.Text.Json.JsonEncodedText PropTokens = System.Text.Json.JsonEncodedText.Encode("tokens"); + + public override Elastic.Clients.Elasticsearch.Security.GetServiceCredentialsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propNodesCredentials = default; + LocalJsonValue propServiceAccount = default; + LocalJsonValue>> propTokens = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propNodesCredentials.TryReadProperty(ref reader, options, PropNodesCredentials, null)) + { + continue; + } + + if (propServiceAccount.TryReadProperty(ref reader, options, PropServiceAccount, null)) + { + continue; + } + + if (propTokens.TryReadProperty(ref reader, options, PropTokens, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.GetServiceCredentialsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + NodesCredentials = propNodesCredentials.Value, + ServiceAccount = propServiceAccount.Value, + Tokens = propTokens.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetServiceCredentialsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropNodesCredentials, value.NodesCredentials, null, null); + writer.WriteProperty(options, PropServiceAccount, value.ServiceAccount, null, null); + writer.WriteProperty(options, PropTokens, value.Tokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceCredentialsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceCredentialsResponse.g.cs index f3d9f6d20fc..03b79e1256a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceCredentialsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetServiceCredentialsResponse.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class GetServiceCredentialsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropNodesCredentials = System.Text.Json.JsonEncodedText.Encode("nodes_credentials"); - private static readonly System.Text.Json.JsonEncodedText PropServiceAccount = System.Text.Json.JsonEncodedText.Encode("service_account"); - private static readonly System.Text.Json.JsonEncodedText PropTokens = System.Text.Json.JsonEncodedText.Encode("tokens"); - - public override Elastic.Clients.Elasticsearch.Security.GetServiceCredentialsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propNodesCredentials = default; - LocalJsonValue propServiceAccount = default; - LocalJsonValue>> propTokens = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propNodesCredentials.TryReadProperty(ref reader, options, PropNodesCredentials, null)) - { - continue; - } - - if (propServiceAccount.TryReadProperty(ref reader, options, PropServiceAccount, null)) - { - continue; - } - - if (propTokens.TryReadProperty(ref reader, options, PropTokens, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.GetServiceCredentialsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - NodesCredentials = propNodesCredentials.Value, - ServiceAccount = propServiceAccount.Value, - Tokens = propTokens.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetServiceCredentialsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropNodesCredentials, value.NodesCredentials, null, null); - writer.WriteProperty(options, PropServiceAccount, value.ServiceAccount, null, null); - writer.WriteProperty(options, PropTokens, value.Tokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GetServiceCredentialsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetServiceCredentialsResponseConverter))] public sealed partial class GetServiceCredentialsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -105,9 +39,9 @@ internal GetServiceCredentialsResponse(Elastic.Clients.Elasticsearch.Serializati public #if NET7_0_OR_GREATER - required +required #endif - int Count { get; set; } +int Count { get; set; } /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetTokenRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetTokenRequest.Converters.g.cs new file mode 100644 index 00000000000..7ea702f5982 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetTokenRequest.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GetTokenRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropGrantType = System.Text.Json.JsonEncodedText.Encode("grant_type"); + private static readonly System.Text.Json.JsonEncodedText PropKerberosTicket = System.Text.Json.JsonEncodedText.Encode("kerberos_ticket"); + private static readonly System.Text.Json.JsonEncodedText PropPassword = System.Text.Json.JsonEncodedText.Encode("password"); + private static readonly System.Text.Json.JsonEncodedText PropRefreshToken = System.Text.Json.JsonEncodedText.Encode("refresh_token"); + private static readonly System.Text.Json.JsonEncodedText PropScope = System.Text.Json.JsonEncodedText.Encode("scope"); + private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); + + public override Elastic.Clients.Elasticsearch.Security.GetTokenRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propGrantType = default; + LocalJsonValue propKerberosTicket = default; + LocalJsonValue propPassword = default; + LocalJsonValue propRefreshToken = default; + LocalJsonValue propScope = default; + LocalJsonValue propUsername = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propGrantType.TryReadProperty(ref reader, options, PropGrantType, static Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propKerberosTicket.TryReadProperty(ref reader, options, PropKerberosTicket, null)) + { + continue; + } + + if (propPassword.TryReadProperty(ref reader, options, PropPassword, null)) + { + continue; + } + + if (propRefreshToken.TryReadProperty(ref reader, options, PropRefreshToken, null)) + { + continue; + } + + if (propScope.TryReadProperty(ref reader, options, PropScope, null)) + { + continue; + } + + if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.GetTokenRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + GrantType = propGrantType.Value, + KerberosTicket = propKerberosTicket.Value, + Password = propPassword.Value, + RefreshToken = propRefreshToken.Value, + Scope = propScope.Value, + Username = propUsername.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetTokenRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropGrantType, value.GrantType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropKerberosTicket, value.KerberosTicket, null, null); + writer.WriteProperty(options, PropPassword, value.Password, null, null); + writer.WriteProperty(options, PropRefreshToken, value.RefreshToken, null, null); + writer.WriteProperty(options, PropScope, value.Scope, null, null); + writer.WriteProperty(options, PropUsername, value.Username, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetTokenRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetTokenRequest.g.cs index dd547ea04b4..11ce3d5c999 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetTokenRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetTokenRequest.g.cs @@ -27,90 +27,6 @@ public sealed partial class GetTokenRequestParameters : Elastic.Transport.Reques { } -internal sealed partial class GetTokenRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropGrantType = System.Text.Json.JsonEncodedText.Encode("grant_type"); - private static readonly System.Text.Json.JsonEncodedText PropKerberosTicket = System.Text.Json.JsonEncodedText.Encode("kerberos_ticket"); - private static readonly System.Text.Json.JsonEncodedText PropPassword = System.Text.Json.JsonEncodedText.Encode("password"); - private static readonly System.Text.Json.JsonEncodedText PropRefreshToken = System.Text.Json.JsonEncodedText.Encode("refresh_token"); - private static readonly System.Text.Json.JsonEncodedText PropScope = System.Text.Json.JsonEncodedText.Encode("scope"); - private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); - - public override Elastic.Clients.Elasticsearch.Security.GetTokenRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propGrantType = default; - LocalJsonValue propKerberosTicket = default; - LocalJsonValue propPassword = default; - LocalJsonValue propRefreshToken = default; - LocalJsonValue propScope = default; - LocalJsonValue propUsername = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propGrantType.TryReadProperty(ref reader, options, PropGrantType, static Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propKerberosTicket.TryReadProperty(ref reader, options, PropKerberosTicket, null)) - { - continue; - } - - if (propPassword.TryReadProperty(ref reader, options, PropPassword, null)) - { - continue; - } - - if (propRefreshToken.TryReadProperty(ref reader, options, PropRefreshToken, null)) - { - continue; - } - - if (propScope.TryReadProperty(ref reader, options, PropScope, null)) - { - continue; - } - - if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.GetTokenRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - GrantType = propGrantType.Value, - KerberosTicket = propKerberosTicket.Value, - Password = propPassword.Value, - RefreshToken = propRefreshToken.Value, - Scope = propScope.Value, - Username = propUsername.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetTokenRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropGrantType, value.GrantType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropKerberosTicket, value.KerberosTicket, null, null); - writer.WriteProperty(options, PropPassword, value.Password, null, null); - writer.WriteProperty(options, PropRefreshToken, value.RefreshToken, null, null); - writer.WriteProperty(options, PropScope, value.Scope, null, null); - writer.WriteProperty(options, PropUsername, value.Username, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Get a token. @@ -133,7 +49,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If you want to invalidate a token immediately, you can do so by using the invalidate token API. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GetTokenRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetTokenRequestConverter))] public sealed partial class GetTokenRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetTokenResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetTokenResponse.Converters.g.cs new file mode 100644 index 00000000000..61c123cdd28 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetTokenResponse.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GetTokenResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAccessToken = System.Text.Json.JsonEncodedText.Encode("access_token"); + private static readonly System.Text.Json.JsonEncodedText PropAuthentication = System.Text.Json.JsonEncodedText.Encode("authentication"); + private static readonly System.Text.Json.JsonEncodedText PropExpiresIn = System.Text.Json.JsonEncodedText.Encode("expires_in"); + private static readonly System.Text.Json.JsonEncodedText PropKerberosAuthenticationResponseToken = System.Text.Json.JsonEncodedText.Encode("kerberos_authentication_response_token"); + private static readonly System.Text.Json.JsonEncodedText PropRefreshToken = System.Text.Json.JsonEncodedText.Encode("refresh_token"); + private static readonly System.Text.Json.JsonEncodedText PropScope = System.Text.Json.JsonEncodedText.Encode("scope"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Security.GetTokenResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAccessToken = default; + LocalJsonValue propAuthentication = default; + LocalJsonValue propExpiresIn = default; + LocalJsonValue propKerberosAuthenticationResponseToken = default; + LocalJsonValue propRefreshToken = default; + LocalJsonValue propScope = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAccessToken.TryReadProperty(ref reader, options, PropAccessToken, null)) + { + continue; + } + + if (propAuthentication.TryReadProperty(ref reader, options, PropAuthentication, null)) + { + continue; + } + + if (propExpiresIn.TryReadProperty(ref reader, options, PropExpiresIn, null)) + { + continue; + } + + if (propKerberosAuthenticationResponseToken.TryReadProperty(ref reader, options, PropKerberosAuthenticationResponseToken, null)) + { + continue; + } + + if (propRefreshToken.TryReadProperty(ref reader, options, PropRefreshToken, null)) + { + continue; + } + + if (propScope.TryReadProperty(ref reader, options, PropScope, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.GetTokenResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AccessToken = propAccessToken.Value, + Authentication = propAuthentication.Value, + ExpiresIn = propExpiresIn.Value, + KerberosAuthenticationResponseToken = propKerberosAuthenticationResponseToken.Value, + RefreshToken = propRefreshToken.Value, + Scope = propScope.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetTokenResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAccessToken, value.AccessToken, null, null); + writer.WriteProperty(options, PropAuthentication, value.Authentication, null, null); + writer.WriteProperty(options, PropExpiresIn, value.ExpiresIn, null, null); + writer.WriteProperty(options, PropKerberosAuthenticationResponseToken, value.KerberosAuthenticationResponseToken, null, null); + writer.WriteProperty(options, PropRefreshToken, value.RefreshToken, null, null); + writer.WriteProperty(options, PropScope, value.Scope, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetTokenResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetTokenResponse.g.cs index 937be964ce6..cd6cbb9d721 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetTokenResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetTokenResponse.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class GetTokenResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAccessToken = System.Text.Json.JsonEncodedText.Encode("access_token"); - private static readonly System.Text.Json.JsonEncodedText PropAuthentication = System.Text.Json.JsonEncodedText.Encode("authentication"); - private static readonly System.Text.Json.JsonEncodedText PropExpiresIn = System.Text.Json.JsonEncodedText.Encode("expires_in"); - private static readonly System.Text.Json.JsonEncodedText PropKerberosAuthenticationResponseToken = System.Text.Json.JsonEncodedText.Encode("kerberos_authentication_response_token"); - private static readonly System.Text.Json.JsonEncodedText PropRefreshToken = System.Text.Json.JsonEncodedText.Encode("refresh_token"); - private static readonly System.Text.Json.JsonEncodedText PropScope = System.Text.Json.JsonEncodedText.Encode("scope"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Security.GetTokenResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAccessToken = default; - LocalJsonValue propAuthentication = default; - LocalJsonValue propExpiresIn = default; - LocalJsonValue propKerberosAuthenticationResponseToken = default; - LocalJsonValue propRefreshToken = default; - LocalJsonValue propScope = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAccessToken.TryReadProperty(ref reader, options, PropAccessToken, null)) - { - continue; - } - - if (propAuthentication.TryReadProperty(ref reader, options, PropAuthentication, null)) - { - continue; - } - - if (propExpiresIn.TryReadProperty(ref reader, options, PropExpiresIn, null)) - { - continue; - } - - if (propKerberosAuthenticationResponseToken.TryReadProperty(ref reader, options, PropKerberosAuthenticationResponseToken, null)) - { - continue; - } - - if (propRefreshToken.TryReadProperty(ref reader, options, PropRefreshToken, null)) - { - continue; - } - - if (propScope.TryReadProperty(ref reader, options, PropScope, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.GetTokenResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AccessToken = propAccessToken.Value, - Authentication = propAuthentication.Value, - ExpiresIn = propExpiresIn.Value, - KerberosAuthenticationResponseToken = propKerberosAuthenticationResponseToken.Value, - RefreshToken = propRefreshToken.Value, - Scope = propScope.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetTokenResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAccessToken, value.AccessToken, null, null); - writer.WriteProperty(options, PropAuthentication, value.Authentication, null, null); - writer.WriteProperty(options, PropExpiresIn, value.ExpiresIn, null, null); - writer.WriteProperty(options, PropKerberosAuthenticationResponseToken, value.KerberosAuthenticationResponseToken, null, null); - writer.WriteProperty(options, PropRefreshToken, value.RefreshToken, null, null); - writer.WriteProperty(options, PropScope, value.Scope, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GetTokenResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetTokenResponseConverter))] public sealed partial class GetTokenResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -132,25 +39,25 @@ internal GetTokenResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstr public #if NET7_0_OR_GREATER - required +required #endif - string AccessToken { get; set; } +string AccessToken { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Security.AuthenticatedUser Authentication { get; set; } +Elastic.Clients.Elasticsearch.Security.AuthenticatedUser Authentication { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long ExpiresIn { get; set; } +long ExpiresIn { get; set; } public string? KerberosAuthenticationResponseToken { get; set; } public string? RefreshToken { get; set; } public string? Scope { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Type { get; set; } +string Type { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserPrivilegesRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserPrivilegesRequest.Converters.g.cs new file mode 100644 index 00000000000..1cef79830a1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserPrivilegesRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GetUserPrivilegesRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.GetUserPrivilegesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.GetUserPrivilegesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetUserPrivilegesRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserPrivilegesRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserPrivilegesRequest.g.cs index 716c4838efa..3dc247c9173 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserPrivilegesRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserPrivilegesRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class GetUserPrivilegesRequestParameters : Elastic.Transpo { } -internal sealed partial class GetUserPrivilegesRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.GetUserPrivilegesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.GetUserPrivilegesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetUserPrivilegesRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get user privileges. @@ -67,7 +38,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// To check whether a user has a specific list of privileges, use the has privileges API. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GetUserPrivilegesRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetUserPrivilegesRequestConverter))] public sealed partial class GetUserPrivilegesRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserPrivilegesResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserPrivilegesResponse.Converters.g.cs new file mode 100644 index 00000000000..259c2187a32 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserPrivilegesResponse.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GetUserPrivilegesResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApplications = System.Text.Json.JsonEncodedText.Encode("applications"); + private static readonly System.Text.Json.JsonEncodedText PropCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); + private static readonly System.Text.Json.JsonEncodedText PropGlobal = System.Text.Json.JsonEncodedText.Encode("global"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropRemoteCluster = System.Text.Json.JsonEncodedText.Encode("remote_cluster"); + private static readonly System.Text.Json.JsonEncodedText PropRemoteIndices = System.Text.Json.JsonEncodedText.Encode("remote_indices"); + private static readonly System.Text.Json.JsonEncodedText PropRunAs = System.Text.Json.JsonEncodedText.Encode("run_as"); + + public override Elastic.Clients.Elasticsearch.Security.GetUserPrivilegesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propApplications = default; + LocalJsonValue> propCluster = default; + LocalJsonValue> propGlobal = default; + LocalJsonValue> propIndices = default; + LocalJsonValue?> propRemoteCluster = default; + LocalJsonValue?> propRemoteIndices = default; + LocalJsonValue> propRunAs = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApplications.TryReadProperty(ref reader, options, PropApplications, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propCluster.TryReadProperty(ref reader, options, PropCluster, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propGlobal.TryReadProperty(ref reader, options, PropGlobal, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propRemoteCluster.TryReadProperty(ref reader, options, PropRemoteCluster, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propRemoteIndices.TryReadProperty(ref reader, options, PropRemoteIndices, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propRunAs.TryReadProperty(ref reader, options, PropRunAs, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.GetUserPrivilegesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Applications = propApplications.Value, + Cluster = propCluster.Value, + Global = propGlobal.Value, + Indices = propIndices.Value, + RemoteCluster = propRemoteCluster.Value, + RemoteIndices = propRemoteIndices.Value, + RunAs = propRunAs.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetUserPrivilegesResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApplications, value.Applications, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCluster, value.Cluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropGlobal, value.Global, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRemoteCluster, value.RemoteCluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRemoteIndices, value.RemoteIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRunAs, value.RunAs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserPrivilegesResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserPrivilegesResponse.g.cs index 542909a3d95..2bf77db1604 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserPrivilegesResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserPrivilegesResponse.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class GetUserPrivilegesResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApplications = System.Text.Json.JsonEncodedText.Encode("applications"); - private static readonly System.Text.Json.JsonEncodedText PropCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); - private static readonly System.Text.Json.JsonEncodedText PropGlobal = System.Text.Json.JsonEncodedText.Encode("global"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropRemoteCluster = System.Text.Json.JsonEncodedText.Encode("remote_cluster"); - private static readonly System.Text.Json.JsonEncodedText PropRemoteIndices = System.Text.Json.JsonEncodedText.Encode("remote_indices"); - private static readonly System.Text.Json.JsonEncodedText PropRunAs = System.Text.Json.JsonEncodedText.Encode("run_as"); - - public override Elastic.Clients.Elasticsearch.Security.GetUserPrivilegesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propApplications = default; - LocalJsonValue> propCluster = default; - LocalJsonValue> propGlobal = default; - LocalJsonValue> propIndices = default; - LocalJsonValue?> propRemoteCluster = default; - LocalJsonValue?> propRemoteIndices = default; - LocalJsonValue> propRunAs = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApplications.TryReadProperty(ref reader, options, PropApplications, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propCluster.TryReadProperty(ref reader, options, PropCluster, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propGlobal.TryReadProperty(ref reader, options, PropGlobal, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propRemoteCluster.TryReadProperty(ref reader, options, PropRemoteCluster, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propRemoteIndices.TryReadProperty(ref reader, options, PropRemoteIndices, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propRunAs.TryReadProperty(ref reader, options, PropRunAs, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.GetUserPrivilegesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Applications = propApplications.Value, - Cluster = propCluster.Value, - Global = propGlobal.Value, - Indices = propIndices.Value, - RemoteCluster = propRemoteCluster.Value, - RemoteIndices = propRemoteIndices.Value, - RunAs = propRunAs.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetUserPrivilegesResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApplications, value.Applications, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCluster, value.Cluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropGlobal, value.Global, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRemoteCluster, value.RemoteCluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRemoteIndices, value.RemoteIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRunAs, value.RunAs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GetUserPrivilegesResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetUserPrivilegesResponseConverter))] public sealed partial class GetUserPrivilegesResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -132,29 +39,29 @@ internal GetUserPrivilegesResponse(Elastic.Clients.Elasticsearch.Serialization.J public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Applications { get; set; } +System.Collections.Generic.IReadOnlyCollection Applications { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Cluster { get; set; } +System.Collections.Generic.IReadOnlyCollection Cluster { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Global { get; set; } +System.Collections.Generic.IReadOnlyCollection Global { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Indices { get; set; } +System.Collections.Generic.IReadOnlyCollection Indices { get; set; } public System.Collections.Generic.IReadOnlyCollection? RemoteCluster { get; set; } public System.Collections.Generic.IReadOnlyCollection? RemoteIndices { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection RunAs { get; set; } +System.Collections.Generic.IReadOnlyCollection RunAs { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserProfileRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserProfileRequest.Converters.g.cs new file mode 100644 index 00000000000..3be89b5ab22 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserProfileRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GetUserProfileRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.GetUserProfileRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.GetUserProfileRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetUserProfileRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserProfileRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserProfileRequest.g.cs index 1aa13116033..e1cd09c54fe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserProfileRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserProfileRequest.g.cs @@ -36,35 +36,6 @@ public sealed partial class GetUserProfileRequestParameters : Elastic.Transport. public System.Collections.Generic.ICollection? Data { get => Q?>("data"); set => Q("data", value); } } -internal sealed partial class GetUserProfileRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.GetUserProfileRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.GetUserProfileRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetUserProfileRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get a user profile. @@ -78,7 +49,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Elastic reserves the right to change or remove this feature in future releases without prior notice. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GetUserProfileRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetUserProfileRequestConverter))] public sealed partial class GetUserProfileRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserProfileResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserProfileResponse.Converters.g.cs new file mode 100644 index 00000000000..059f51c3195 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserProfileResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GetUserProfileResponseConverter : 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 PropProfiles = System.Text.Json.JsonEncodedText.Encode("profiles"); + + public override Elastic.Clients.Elasticsearch.Security.GetUserProfileResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propErrors = default; + LocalJsonValue> propProfiles = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propErrors.TryReadProperty(ref reader, options, PropErrors, null)) + { + continue; + } + + if (propProfiles.TryReadProperty(ref reader, options, PropProfiles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.GetUserProfileResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Errors = propErrors.Value, + Profiles = propProfiles.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetUserProfileResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropErrors, value.Errors, null, null); + writer.WriteProperty(options, PropProfiles, value.Profiles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserProfileResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserProfileResponse.g.cs index f1d065ddfad..76c71ae3e6e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserProfileResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserProfileResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class GetUserProfileResponseConverter : 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 PropProfiles = System.Text.Json.JsonEncodedText.Encode("profiles"); - - public override Elastic.Clients.Elasticsearch.Security.GetUserProfileResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propErrors = default; - LocalJsonValue> propProfiles = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propErrors.TryReadProperty(ref reader, options, PropErrors, null)) - { - continue; - } - - if (propProfiles.TryReadProperty(ref reader, options, PropProfiles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.GetUserProfileResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Errors = propErrors.Value, - Profiles = propProfiles.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetUserProfileResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropErrors, value.Errors, null, null); - writer.WriteProperty(options, PropProfiles, value.Profiles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GetUserProfileResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetUserProfileResponseConverter))] public sealed partial class GetUserProfileResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserRequest.Converters.g.cs new file mode 100644 index 00000000000..34a7f5a8e26 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GetUserRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.GetUserRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.GetUserRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetUserRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserRequest.g.cs index 97f8c00722b..494f06aeae0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserRequest.g.cs @@ -33,35 +33,6 @@ public sealed partial class GetUserRequestParameters : Elastic.Transport.Request public bool? WithProfileUid { get => Q("with_profile_uid"); set => Q("with_profile_uid", value); } } -internal sealed partial class GetUserRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.GetUserRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.GetUserRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetUserRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get users. @@ -70,7 +41,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Get information about users in the native realm and built-in users. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GetUserRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetUserRequestConverter))] public sealed partial class GetUserRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetUserRequest(System.Collections.Generic.ICollection? username) : base(r => r.Optional("username", username)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserResponse.Converters.g.cs new file mode 100644 index 00000000000..2727e2b495f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GetUserResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.GetUserResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Security.GetUserResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Users = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetUserResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Users, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserResponse.g.cs index 44737da4592..8705fd6a91f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetUserResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class GetUserResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.GetUserResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Security.GetUserResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Users = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetUserResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Users, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GetUserResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetUserResponseConverter))] public sealed partial class GetUserResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GrantApiKeyRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GrantApiKeyRequest.Converters.g.cs new file mode 100644 index 00000000000..9f351242b0b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GrantApiKeyRequest.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GrantApiKeyRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAccessToken = System.Text.Json.JsonEncodedText.Encode("access_token"); + private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); + private static readonly System.Text.Json.JsonEncodedText PropGrantType = System.Text.Json.JsonEncodedText.Encode("grant_type"); + private static readonly System.Text.Json.JsonEncodedText PropPassword = System.Text.Json.JsonEncodedText.Encode("password"); + private static readonly System.Text.Json.JsonEncodedText PropRunAs = System.Text.Json.JsonEncodedText.Encode("run_as"); + private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); + + public override Elastic.Clients.Elasticsearch.Security.GrantApiKeyRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAccessToken = default; + LocalJsonValue propApiKey = default; + LocalJsonValue propGrantType = default; + LocalJsonValue propPassword = default; + LocalJsonValue propRunAs = default; + LocalJsonValue propUsername = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAccessToken.TryReadProperty(ref reader, options, PropAccessToken, null)) + { + continue; + } + + if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) + { + continue; + } + + if (propGrantType.TryReadProperty(ref reader, options, PropGrantType, null)) + { + continue; + } + + if (propPassword.TryReadProperty(ref reader, options, PropPassword, null)) + { + continue; + } + + if (propRunAs.TryReadProperty(ref reader, options, PropRunAs, null)) + { + continue; + } + + if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.GrantApiKeyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AccessToken = propAccessToken.Value, + ApiKey = propApiKey.Value, + GrantType = propGrantType.Value, + Password = propPassword.Value, + RunAs = propRunAs.Value, + Username = propUsername.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GrantApiKeyRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAccessToken, value.AccessToken, null, null); + writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); + writer.WriteProperty(options, PropGrantType, value.GrantType, null, null); + writer.WriteProperty(options, PropPassword, value.Password, null, null); + writer.WriteProperty(options, PropRunAs, value.RunAs, null, null); + writer.WriteProperty(options, PropUsername, value.Username, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GrantApiKeyRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GrantApiKeyRequest.g.cs index cccd64c3269..66c2b150a4a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GrantApiKeyRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GrantApiKeyRequest.g.cs @@ -36,90 +36,6 @@ public sealed partial class GrantApiKeyRequestParameters : Elastic.Transport.Req public Elastic.Clients.Elasticsearch.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } } -internal sealed partial class GrantApiKeyRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAccessToken = System.Text.Json.JsonEncodedText.Encode("access_token"); - private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); - private static readonly System.Text.Json.JsonEncodedText PropGrantType = System.Text.Json.JsonEncodedText.Encode("grant_type"); - private static readonly System.Text.Json.JsonEncodedText PropPassword = System.Text.Json.JsonEncodedText.Encode("password"); - private static readonly System.Text.Json.JsonEncodedText PropRunAs = System.Text.Json.JsonEncodedText.Encode("run_as"); - private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); - - public override Elastic.Clients.Elasticsearch.Security.GrantApiKeyRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAccessToken = default; - LocalJsonValue propApiKey = default; - LocalJsonValue propGrantType = default; - LocalJsonValue propPassword = default; - LocalJsonValue propRunAs = default; - LocalJsonValue propUsername = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAccessToken.TryReadProperty(ref reader, options, PropAccessToken, null)) - { - continue; - } - - if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) - { - continue; - } - - if (propGrantType.TryReadProperty(ref reader, options, PropGrantType, null)) - { - continue; - } - - if (propPassword.TryReadProperty(ref reader, options, PropPassword, null)) - { - continue; - } - - if (propRunAs.TryReadProperty(ref reader, options, PropRunAs, null)) - { - continue; - } - - if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.GrantApiKeyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AccessToken = propAccessToken.Value, - ApiKey = propApiKey.Value, - GrantType = propGrantType.Value, - Password = propPassword.Value, - RunAs = propRunAs.Value, - Username = propUsername.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GrantApiKeyRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAccessToken, value.AccessToken, null, null); - writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); - writer.WriteProperty(options, PropGrantType, value.GrantType, null, null); - writer.WriteProperty(options, PropPassword, value.Password, null, null); - writer.WriteProperty(options, PropRunAs, value.RunAs, null, null); - writer.WriteProperty(options, PropUsername, value.Username, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Grant an API key. @@ -164,7 +80,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// By default, API keys never expire. You can specify expiration information when you create the API keys. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GrantApiKeyRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GrantApiKeyRequestConverter))] public sealed partial class GrantApiKeyRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GrantApiKeyResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GrantApiKeyResponse.Converters.g.cs new file mode 100644 index 00000000000..76afc1afe5d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GrantApiKeyResponse.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GrantApiKeyResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); + private static readonly System.Text.Json.JsonEncodedText PropEncoded = System.Text.Json.JsonEncodedText.Encode("encoded"); + private static readonly System.Text.Json.JsonEncodedText PropExpiration = System.Text.Json.JsonEncodedText.Encode("expiration"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.Security.GrantApiKeyResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApiKey = default; + LocalJsonValue propEncoded = default; + LocalJsonValue propExpiration = default; + LocalJsonValue propId = default; + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) + { + continue; + } + + if (propEncoded.TryReadProperty(ref reader, options, PropEncoded, null)) + { + continue; + } + + if (propExpiration.TryReadProperty(ref reader, options, PropExpiration, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.GrantApiKeyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ApiKey = propApiKey.Value, + Encoded = propEncoded.Value, + Expiration = propExpiration.Value, + Id = propId.Value, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GrantApiKeyResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); + writer.WriteProperty(options, PropEncoded, value.Encoded, null, null); + writer.WriteProperty(options, PropExpiration, value.Expiration, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GrantApiKeyResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GrantApiKeyResponse.g.cs index 5c60b7aae71..58257a3aa03 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GrantApiKeyResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GrantApiKeyResponse.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class GrantApiKeyResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); - private static readonly System.Text.Json.JsonEncodedText PropEncoded = System.Text.Json.JsonEncodedText.Encode("encoded"); - private static readonly System.Text.Json.JsonEncodedText PropExpiration = System.Text.Json.JsonEncodedText.Encode("expiration"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.Security.GrantApiKeyResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propApiKey = default; - LocalJsonValue propEncoded = default; - LocalJsonValue propExpiration = default; - LocalJsonValue propId = default; - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) - { - continue; - } - - if (propEncoded.TryReadProperty(ref reader, options, PropEncoded, null)) - { - continue; - } - - if (propExpiration.TryReadProperty(ref reader, options, PropExpiration, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.GrantApiKeyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ApiKey = propApiKey.Value, - Encoded = propEncoded.Value, - Expiration = propExpiration.Value, - Id = propId.Value, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GrantApiKeyResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); - writer.WriteProperty(options, PropEncoded, value.Encoded, null, null); - writer.WriteProperty(options, PropExpiration, value.Expiration, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GrantApiKeyResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GrantApiKeyResponseConverter))] public sealed partial class GrantApiKeyResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -114,23 +39,23 @@ internal GrantApiKeyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCon public #if NET7_0_OR_GREATER - required +required #endif - string ApiKey { get; set; } +string ApiKey { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Encoded { get; set; } +string Encoded { get; set; } public System.DateTimeOffset? Expiration { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Id { get; set; } +string Id { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Name { get; set; } +string Name { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesRequest.Converters.g.cs new file mode 100644 index 00000000000..a593ed21f29 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesRequest.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class HasPrivilegesRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApplication = System.Text.Json.JsonEncodedText.Encode("application"); + private static readonly System.Text.Json.JsonEncodedText PropCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + + public override Elastic.Clients.Elasticsearch.Security.HasPrivilegesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propApplication = default; + LocalJsonValue?> propCluster = default; + LocalJsonValue?> propIndex = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApplication.TryReadProperty(ref reader, options, PropApplication, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propCluster.TryReadProperty(ref reader, options, PropCluster, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.HasPrivilegesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Application = propApplication.Value, + Cluster = propCluster.Value, + Index = propIndex.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.HasPrivilegesRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApplication, value.Application, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCluster, value.Cluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesRequest.g.cs index 790e44033bb..6ced7e74f46 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesRequest.g.cs @@ -27,63 +27,6 @@ public sealed partial class HasPrivilegesRequestParameters : Elastic.Transport.R { } -internal sealed partial class HasPrivilegesRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApplication = System.Text.Json.JsonEncodedText.Encode("application"); - private static readonly System.Text.Json.JsonEncodedText PropCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - - public override Elastic.Clients.Elasticsearch.Security.HasPrivilegesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propApplication = default; - LocalJsonValue?> propCluster = default; - LocalJsonValue?> propIndex = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApplication.TryReadProperty(ref reader, options, PropApplication, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propCluster.TryReadProperty(ref reader, options, PropCluster, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.HasPrivilegesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Application = propApplication.Value, - Cluster = propCluster.Value, - Index = propIndex.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.HasPrivilegesRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApplication, value.Application, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCluster, value.Cluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// Check user privileges. @@ -94,7 +37,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// To check the privileges of other users, you must use the run as feature. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.HasPrivilegesRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.HasPrivilegesRequestConverter))] public sealed partial class HasPrivilegesRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public HasPrivilegesRequest(Elastic.Clients.Elasticsearch.Name? user) : base(r => r.Optional("user", user)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesResponse.Converters.g.cs new file mode 100644 index 00000000000..d7eb942e021 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesResponse.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class HasPrivilegesResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApplication = System.Text.Json.JsonEncodedText.Encode("application"); + private static readonly System.Text.Json.JsonEncodedText PropCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); + private static readonly System.Text.Json.JsonEncodedText PropHasAllRequested = System.Text.Json.JsonEncodedText.Encode("has_all_requested"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); + + public override Elastic.Clients.Elasticsearch.Security.HasPrivilegesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>>> propApplication = default; + LocalJsonValue> propCluster = default; + LocalJsonValue propHasAllRequested = default; + LocalJsonValue>> propIndex = default; + LocalJsonValue propUsername = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApplication.TryReadProperty(ref reader, options, PropApplication, static System.Collections.Generic.IReadOnlyDictionary>> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>>(o, null, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)!)!)) + { + continue; + } + + if (propCluster.TryReadProperty(ref reader, options, PropCluster, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propHasAllRequested.TryReadProperty(ref reader, options, PropHasAllRequested, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)!)) + { + continue; + } + + if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.HasPrivilegesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Application = propApplication.Value, + Cluster = propCluster.Value, + HasAllRequested = propHasAllRequested.Value, + Index = propIndex.Value, + Username = propUsername.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.HasPrivilegesResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApplication, value.Application, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>> v) => w.WriteDictionaryValue>>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)))); + writer.WriteProperty(options, PropCluster, value.Cluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropHasAllRequested, value.HasAllRequested, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null))); + writer.WriteProperty(options, PropUsername, value.Username, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesResponse.g.cs index 7ef6f3c5ff3..d3aca814bf2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesResponse.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class HasPrivilegesResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApplication = System.Text.Json.JsonEncodedText.Encode("application"); - private static readonly System.Text.Json.JsonEncodedText PropCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); - private static readonly System.Text.Json.JsonEncodedText PropHasAllRequested = System.Text.Json.JsonEncodedText.Encode("has_all_requested"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); - - public override Elastic.Clients.Elasticsearch.Security.HasPrivilegesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>>> propApplication = default; - LocalJsonValue> propCluster = default; - LocalJsonValue propHasAllRequested = default; - LocalJsonValue>> propIndex = default; - LocalJsonValue propUsername = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApplication.TryReadProperty(ref reader, options, PropApplication, static System.Collections.Generic.IReadOnlyDictionary>> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>>(o, null, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)!)!)) - { - continue; - } - - if (propCluster.TryReadProperty(ref reader, options, PropCluster, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propHasAllRequested.TryReadProperty(ref reader, options, PropHasAllRequested, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)!)) - { - continue; - } - - if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.HasPrivilegesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Application = propApplication.Value, - Cluster = propCluster.Value, - HasAllRequested = propHasAllRequested.Value, - Index = propIndex.Value, - Username = propUsername.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.HasPrivilegesResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApplication, value.Application, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>> v) => w.WriteDictionaryValue>>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)))); - writer.WriteProperty(options, PropCluster, value.Cluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropHasAllRequested, value.HasAllRequested, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null))); - writer.WriteProperty(options, PropUsername, value.Username, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.HasPrivilegesResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.HasPrivilegesResponseConverter))] public sealed partial class HasPrivilegesResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -114,27 +39,27 @@ internal HasPrivilegesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonC public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary>> Application { get; set; } +System.Collections.Generic.IReadOnlyDictionary>> Application { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary Cluster { get; set; } +System.Collections.Generic.IReadOnlyDictionary Cluster { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool HasAllRequested { get; set; } +bool HasAllRequested { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary> Index { get; set; } +System.Collections.Generic.IReadOnlyDictionary> Index { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Username { get; set; } +string Username { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesUserProfileRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesUserProfileRequest.Converters.g.cs new file mode 100644 index 00000000000..4ce16412560 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesUserProfileRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class HasPrivilegesUserProfileRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPrivileges = System.Text.Json.JsonEncodedText.Encode("privileges"); + private static readonly System.Text.Json.JsonEncodedText PropUids = System.Text.Json.JsonEncodedText.Encode("uids"); + + public override Elastic.Clients.Elasticsearch.Security.HasPrivilegesUserProfileRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPrivileges = default; + LocalJsonValue> propUids = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPrivileges.TryReadProperty(ref reader, options, PropPrivileges, null)) + { + continue; + } + + if (propUids.TryReadProperty(ref reader, options, PropUids, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.HasPrivilegesUserProfileRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Privileges = propPrivileges.Value, + Uids = propUids.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.HasPrivilegesUserProfileRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPrivileges, value.Privileges, null, null); + writer.WriteProperty(options, PropUids, value.Uids, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesUserProfileRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesUserProfileRequest.g.cs index e6671aa6f65..a74ef791130 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesUserProfileRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesUserProfileRequest.g.cs @@ -27,54 +27,6 @@ public sealed partial class HasPrivilegesUserProfileRequestParameters : Elastic. { } -internal sealed partial class HasPrivilegesUserProfileRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPrivileges = System.Text.Json.JsonEncodedText.Encode("privileges"); - private static readonly System.Text.Json.JsonEncodedText PropUids = System.Text.Json.JsonEncodedText.Encode("uids"); - - public override Elastic.Clients.Elasticsearch.Security.HasPrivilegesUserProfileRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPrivileges = default; - LocalJsonValue> propUids = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPrivileges.TryReadProperty(ref reader, options, PropPrivileges, null)) - { - continue; - } - - if (propUids.TryReadProperty(ref reader, options, PropUids, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.HasPrivilegesUserProfileRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Privileges = propPrivileges.Value, - Uids = propUids.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.HasPrivilegesUserProfileRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPrivileges, value.Privileges, null, null); - writer.WriteProperty(options, PropUids, value.Uids, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// Check user profile privileges. @@ -87,7 +39,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Elastic reserves the right to change or remove this feature in future releases without prior notice. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.HasPrivilegesUserProfileRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.HasPrivilegesUserProfileRequestConverter))] public sealed partial class HasPrivilegesUserProfileRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesUserProfileResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesUserProfileResponse.Converters.g.cs new file mode 100644 index 00000000000..9ae3faaf653 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesUserProfileResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class HasPrivilegesUserProfileResponseConverter : 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 PropHasPrivilegeUids = System.Text.Json.JsonEncodedText.Encode("has_privilege_uids"); + + public override Elastic.Clients.Elasticsearch.Security.HasPrivilegesUserProfileResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propErrors = default; + LocalJsonValue> propHasPrivilegeUids = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propErrors.TryReadProperty(ref reader, options, PropErrors, null)) + { + continue; + } + + if (propHasPrivilegeUids.TryReadProperty(ref reader, options, PropHasPrivilegeUids, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.HasPrivilegesUserProfileResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Errors = propErrors.Value, + HasPrivilegeUids = propHasPrivilegeUids.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.HasPrivilegesUserProfileResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropErrors, value.Errors, null, null); + writer.WriteProperty(options, PropHasPrivilegeUids, value.HasPrivilegeUids, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesUserProfileResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesUserProfileResponse.g.cs index 3bab88dc062..2869acd74d2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesUserProfileResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/HasPrivilegesUserProfileResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class HasPrivilegesUserProfileResponseConverter : 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 PropHasPrivilegeUids = System.Text.Json.JsonEncodedText.Encode("has_privilege_uids"); - - public override Elastic.Clients.Elasticsearch.Security.HasPrivilegesUserProfileResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propErrors = default; - LocalJsonValue> propHasPrivilegeUids = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propErrors.TryReadProperty(ref reader, options, PropErrors, null)) - { - continue; - } - - if (propHasPrivilegeUids.TryReadProperty(ref reader, options, PropHasPrivilegeUids, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.HasPrivilegesUserProfileResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Errors = propErrors.Value, - HasPrivilegeUids = propHasPrivilegeUids.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.HasPrivilegesUserProfileResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropErrors, value.Errors, null, null); - writer.WriteProperty(options, PropHasPrivilegeUids, value.HasPrivilegeUids, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.HasPrivilegesUserProfileResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.HasPrivilegesUserProfileResponseConverter))] public sealed partial class HasPrivilegesUserProfileResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateApiKeyRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateApiKeyRequest.Converters.g.cs new file mode 100644 index 00000000000..231e655fba8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateApiKeyRequest.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class InvalidateApiKeyRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropIds = System.Text.Json.JsonEncodedText.Encode("ids"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropOwner = System.Text.Json.JsonEncodedText.Encode("owner"); + private static readonly System.Text.Json.JsonEncodedText PropRealmName = System.Text.Json.JsonEncodedText.Encode("realm_name"); + private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); + + public override Elastic.Clients.Elasticsearch.Security.InvalidateApiKeyRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue?> propIds = default; + LocalJsonValue propName = default; + LocalJsonValue propOwner = default; + LocalJsonValue propRealmName = default; + LocalJsonValue propUsername = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIds.TryReadProperty(ref reader, options, PropIds, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propOwner.TryReadProperty(ref reader, options, PropOwner, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRealmName.TryReadProperty(ref reader, options, PropRealmName, null)) + { + continue; + } + + if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.InvalidateApiKeyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + Ids = propIds.Value, + Name = propName.Value, + Owner = propOwner.Value, + RealmName = propRealmName.Value, + Username = propUsername.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.InvalidateApiKeyRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIds, value.Ids, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropOwner, value.Owner, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRealmName, value.RealmName, null, null); + writer.WriteProperty(options, PropUsername, value.Username, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateApiKeyRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateApiKeyRequest.g.cs index 8802a0031a0..52663a95c0a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateApiKeyRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateApiKeyRequest.g.cs @@ -27,90 +27,6 @@ public sealed partial class InvalidateApiKeyRequestParameters : Elastic.Transpor { } -internal sealed partial class InvalidateApiKeyRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropIds = System.Text.Json.JsonEncodedText.Encode("ids"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropOwner = System.Text.Json.JsonEncodedText.Encode("owner"); - private static readonly System.Text.Json.JsonEncodedText PropRealmName = System.Text.Json.JsonEncodedText.Encode("realm_name"); - private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); - - public override Elastic.Clients.Elasticsearch.Security.InvalidateApiKeyRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue?> propIds = default; - LocalJsonValue propName = default; - LocalJsonValue propOwner = default; - LocalJsonValue propRealmName = default; - LocalJsonValue propUsername = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIds.TryReadProperty(ref reader, options, PropIds, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propOwner.TryReadProperty(ref reader, options, PropOwner, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRealmName.TryReadProperty(ref reader, options, PropRealmName, null)) - { - continue; - } - - if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.InvalidateApiKeyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - Ids = propIds.Value, - Name = propName.Value, - Owner = propOwner.Value, - RealmName = propRealmName.Value, - Username = propUsername.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.InvalidateApiKeyRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIds, value.Ids, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropOwner, value.Owner, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRealmName, value.RealmName, null, null); - writer.WriteProperty(options, PropUsername, value.Username, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Invalidate API keys. @@ -144,7 +60,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.InvalidateApiKeyRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.InvalidateApiKeyRequestConverter))] public sealed partial class InvalidateApiKeyRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateApiKeyResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateApiKeyResponse.Converters.g.cs new file mode 100644 index 00000000000..41e7386408b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateApiKeyResponse.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class InvalidateApiKeyResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropErrorCount = System.Text.Json.JsonEncodedText.Encode("error_count"); + private static readonly System.Text.Json.JsonEncodedText PropErrorDetails = System.Text.Json.JsonEncodedText.Encode("error_details"); + private static readonly System.Text.Json.JsonEncodedText PropInvalidatedApiKeys = System.Text.Json.JsonEncodedText.Encode("invalidated_api_keys"); + private static readonly System.Text.Json.JsonEncodedText PropPreviouslyInvalidatedApiKeys = System.Text.Json.JsonEncodedText.Encode("previously_invalidated_api_keys"); + + public override Elastic.Clients.Elasticsearch.Security.InvalidateApiKeyResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propErrorCount = default; + LocalJsonValue?> propErrorDetails = default; + LocalJsonValue> propInvalidatedApiKeys = default; + LocalJsonValue> propPreviouslyInvalidatedApiKeys = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propErrorCount.TryReadProperty(ref reader, options, PropErrorCount, null)) + { + continue; + } + + if (propErrorDetails.TryReadProperty(ref reader, options, PropErrorDetails, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propInvalidatedApiKeys.TryReadProperty(ref reader, options, PropInvalidatedApiKeys, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propPreviouslyInvalidatedApiKeys.TryReadProperty(ref reader, options, PropPreviouslyInvalidatedApiKeys, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.InvalidateApiKeyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ErrorCount = propErrorCount.Value, + ErrorDetails = propErrorDetails.Value, + InvalidatedApiKeys = propInvalidatedApiKeys.Value, + PreviouslyInvalidatedApiKeys = propPreviouslyInvalidatedApiKeys.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.InvalidateApiKeyResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropErrorCount, value.ErrorCount, null, null); + writer.WriteProperty(options, PropErrorDetails, value.ErrorDetails, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropInvalidatedApiKeys, value.InvalidatedApiKeys, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPreviouslyInvalidatedApiKeys, value.PreviouslyInvalidatedApiKeys, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateApiKeyResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateApiKeyResponse.g.cs index 247d8efe9ae..f7b6c340c64 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateApiKeyResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateApiKeyResponse.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class InvalidateApiKeyResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropErrorCount = System.Text.Json.JsonEncodedText.Encode("error_count"); - private static readonly System.Text.Json.JsonEncodedText PropErrorDetails = System.Text.Json.JsonEncodedText.Encode("error_details"); - private static readonly System.Text.Json.JsonEncodedText PropInvalidatedApiKeys = System.Text.Json.JsonEncodedText.Encode("invalidated_api_keys"); - private static readonly System.Text.Json.JsonEncodedText PropPreviouslyInvalidatedApiKeys = System.Text.Json.JsonEncodedText.Encode("previously_invalidated_api_keys"); - - public override Elastic.Clients.Elasticsearch.Security.InvalidateApiKeyResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propErrorCount = default; - LocalJsonValue?> propErrorDetails = default; - LocalJsonValue> propInvalidatedApiKeys = default; - LocalJsonValue> propPreviouslyInvalidatedApiKeys = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propErrorCount.TryReadProperty(ref reader, options, PropErrorCount, null)) - { - continue; - } - - if (propErrorDetails.TryReadProperty(ref reader, options, PropErrorDetails, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propInvalidatedApiKeys.TryReadProperty(ref reader, options, PropInvalidatedApiKeys, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propPreviouslyInvalidatedApiKeys.TryReadProperty(ref reader, options, PropPreviouslyInvalidatedApiKeys, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.InvalidateApiKeyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ErrorCount = propErrorCount.Value, - ErrorDetails = propErrorDetails.Value, - InvalidatedApiKeys = propInvalidatedApiKeys.Value, - PreviouslyInvalidatedApiKeys = propPreviouslyInvalidatedApiKeys.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.InvalidateApiKeyResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropErrorCount, value.ErrorCount, null, null); - writer.WriteProperty(options, PropErrorDetails, value.ErrorDetails, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropInvalidatedApiKeys, value.InvalidatedApiKeys, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPreviouslyInvalidatedApiKeys, value.PreviouslyInvalidatedApiKeys, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.InvalidateApiKeyResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.InvalidateApiKeyResponseConverter))] public sealed partial class InvalidateApiKeyResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateTokenRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateTokenRequest.Converters.g.cs new file mode 100644 index 00000000000..b6df77b56bf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateTokenRequest.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class InvalidateTokenRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRealmName = System.Text.Json.JsonEncodedText.Encode("realm_name"); + private static readonly System.Text.Json.JsonEncodedText PropRefreshToken = System.Text.Json.JsonEncodedText.Encode("refresh_token"); + private static readonly System.Text.Json.JsonEncodedText PropToken = System.Text.Json.JsonEncodedText.Encode("token"); + private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); + + public override Elastic.Clients.Elasticsearch.Security.InvalidateTokenRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propRealmName = default; + LocalJsonValue propRefreshToken = default; + LocalJsonValue propToken = default; + LocalJsonValue propUsername = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRealmName.TryReadProperty(ref reader, options, PropRealmName, null)) + { + continue; + } + + if (propRefreshToken.TryReadProperty(ref reader, options, PropRefreshToken, null)) + { + continue; + } + + if (propToken.TryReadProperty(ref reader, options, PropToken, null)) + { + continue; + } + + if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.InvalidateTokenRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + RealmName = propRealmName.Value, + RefreshToken = propRefreshToken.Value, + Token = propToken.Value, + Username = propUsername.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.InvalidateTokenRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRealmName, value.RealmName, null, null); + writer.WriteProperty(options, PropRefreshToken, value.RefreshToken, null, null); + writer.WriteProperty(options, PropToken, value.Token, null, null); + writer.WriteProperty(options, PropUsername, value.Username, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateTokenRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateTokenRequest.g.cs index ad6f73cfeec..654809a67ed 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateTokenRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateTokenRequest.g.cs @@ -27,72 +27,6 @@ public sealed partial class InvalidateTokenRequestParameters : Elastic.Transport { } -internal sealed partial class InvalidateTokenRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRealmName = System.Text.Json.JsonEncodedText.Encode("realm_name"); - private static readonly System.Text.Json.JsonEncodedText PropRefreshToken = System.Text.Json.JsonEncodedText.Encode("refresh_token"); - private static readonly System.Text.Json.JsonEncodedText PropToken = System.Text.Json.JsonEncodedText.Encode("token"); - private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); - - public override Elastic.Clients.Elasticsearch.Security.InvalidateTokenRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propRealmName = default; - LocalJsonValue propRefreshToken = default; - LocalJsonValue propToken = default; - LocalJsonValue propUsername = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRealmName.TryReadProperty(ref reader, options, PropRealmName, null)) - { - continue; - } - - if (propRefreshToken.TryReadProperty(ref reader, options, PropRefreshToken, null)) - { - continue; - } - - if (propToken.TryReadProperty(ref reader, options, PropToken, null)) - { - continue; - } - - if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.InvalidateTokenRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - RealmName = propRealmName.Value, - RefreshToken = propRefreshToken.Value, - Token = propToken.Value, - Username = propUsername.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.InvalidateTokenRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRealmName, value.RealmName, null, null); - writer.WriteProperty(options, PropRefreshToken, value.RefreshToken, null, null); - writer.WriteProperty(options, PropToken, value.Token, null, null); - writer.WriteProperty(options, PropUsername, value.Username, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Invalidate a token. @@ -113,7 +47,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If none of these two are specified, then realm_name and/or username need to be specified. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.InvalidateTokenRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.InvalidateTokenRequestConverter))] public sealed partial class InvalidateTokenRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateTokenResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateTokenResponse.Converters.g.cs new file mode 100644 index 00000000000..032cdc25d5b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateTokenResponse.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class InvalidateTokenResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropErrorCount = System.Text.Json.JsonEncodedText.Encode("error_count"); + private static readonly System.Text.Json.JsonEncodedText PropErrorDetails = System.Text.Json.JsonEncodedText.Encode("error_details"); + private static readonly System.Text.Json.JsonEncodedText PropInvalidatedTokens = System.Text.Json.JsonEncodedText.Encode("invalidated_tokens"); + private static readonly System.Text.Json.JsonEncodedText PropPreviouslyInvalidatedTokens = System.Text.Json.JsonEncodedText.Encode("previously_invalidated_tokens"); + + public override Elastic.Clients.Elasticsearch.Security.InvalidateTokenResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propErrorCount = default; + LocalJsonValue?> propErrorDetails = default; + LocalJsonValue propInvalidatedTokens = default; + LocalJsonValue propPreviouslyInvalidatedTokens = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propErrorCount.TryReadProperty(ref reader, options, PropErrorCount, null)) + { + continue; + } + + if (propErrorDetails.TryReadProperty(ref reader, options, PropErrorDetails, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propInvalidatedTokens.TryReadProperty(ref reader, options, PropInvalidatedTokens, null)) + { + continue; + } + + if (propPreviouslyInvalidatedTokens.TryReadProperty(ref reader, options, PropPreviouslyInvalidatedTokens, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.InvalidateTokenResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ErrorCount = propErrorCount.Value, + ErrorDetails = propErrorDetails.Value, + InvalidatedTokens = propInvalidatedTokens.Value, + PreviouslyInvalidatedTokens = propPreviouslyInvalidatedTokens.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.InvalidateTokenResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropErrorCount, value.ErrorCount, null, null); + writer.WriteProperty(options, PropErrorDetails, value.ErrorDetails, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropInvalidatedTokens, value.InvalidatedTokens, null, null); + writer.WriteProperty(options, PropPreviouslyInvalidatedTokens, value.PreviouslyInvalidatedTokens, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateTokenResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateTokenResponse.g.cs index d926e286819..92cf8e9543e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateTokenResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/InvalidateTokenResponse.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class InvalidateTokenResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropErrorCount = System.Text.Json.JsonEncodedText.Encode("error_count"); - private static readonly System.Text.Json.JsonEncodedText PropErrorDetails = System.Text.Json.JsonEncodedText.Encode("error_details"); - private static readonly System.Text.Json.JsonEncodedText PropInvalidatedTokens = System.Text.Json.JsonEncodedText.Encode("invalidated_tokens"); - private static readonly System.Text.Json.JsonEncodedText PropPreviouslyInvalidatedTokens = System.Text.Json.JsonEncodedText.Encode("previously_invalidated_tokens"); - - public override Elastic.Clients.Elasticsearch.Security.InvalidateTokenResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propErrorCount = default; - LocalJsonValue?> propErrorDetails = default; - LocalJsonValue propInvalidatedTokens = default; - LocalJsonValue propPreviouslyInvalidatedTokens = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propErrorCount.TryReadProperty(ref reader, options, PropErrorCount, null)) - { - continue; - } - - if (propErrorDetails.TryReadProperty(ref reader, options, PropErrorDetails, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propInvalidatedTokens.TryReadProperty(ref reader, options, PropInvalidatedTokens, null)) - { - continue; - } - - if (propPreviouslyInvalidatedTokens.TryReadProperty(ref reader, options, PropPreviouslyInvalidatedTokens, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.InvalidateTokenResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ErrorCount = propErrorCount.Value, - ErrorDetails = propErrorDetails.Value, - InvalidatedTokens = propInvalidatedTokens.Value, - PreviouslyInvalidatedTokens = propPreviouslyInvalidatedTokens.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.InvalidateTokenResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropErrorCount, value.ErrorCount, null, null); - writer.WriteProperty(options, PropErrorDetails, value.ErrorDetails, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropInvalidatedTokens, value.InvalidatedTokens, null, null); - writer.WriteProperty(options, PropPreviouslyInvalidatedTokens, value.PreviouslyInvalidatedTokens, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.InvalidateTokenResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.InvalidateTokenResponseConverter))] public sealed partial class InvalidateTokenResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcAuthenticateRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcAuthenticateRequest.Converters.g.cs new file mode 100644 index 00000000000..8cb7cec5dd5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcAuthenticateRequest.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class OidcAuthenticateRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNonce = System.Text.Json.JsonEncodedText.Encode("nonce"); + private static readonly System.Text.Json.JsonEncodedText PropRealm = System.Text.Json.JsonEncodedText.Encode("realm"); + private static readonly System.Text.Json.JsonEncodedText PropRedirectUri = System.Text.Json.JsonEncodedText.Encode("redirect_uri"); + private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); + + public override Elastic.Clients.Elasticsearch.Security.OidcAuthenticateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propNonce = default; + LocalJsonValue propRealm = default; + LocalJsonValue propRedirectUri = default; + LocalJsonValue propState = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNonce.TryReadProperty(ref reader, options, PropNonce, null)) + { + continue; + } + + if (propRealm.TryReadProperty(ref reader, options, PropRealm, null)) + { + continue; + } + + if (propRedirectUri.TryReadProperty(ref reader, options, PropRedirectUri, null)) + { + continue; + } + + if (propState.TryReadProperty(ref reader, options, PropState, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.OidcAuthenticateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Nonce = propNonce.Value, + Realm = propRealm.Value, + RedirectUri = propRedirectUri.Value, + State = propState.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.OidcAuthenticateRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNonce, value.Nonce, null, null); + writer.WriteProperty(options, PropRealm, value.Realm, null, null); + writer.WriteProperty(options, PropRedirectUri, value.RedirectUri, null, null); + writer.WriteProperty(options, PropState, value.State, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcAuthenticateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcAuthenticateRequest.g.cs index 43a39b9620d..a018064260c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcAuthenticateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcAuthenticateRequest.g.cs @@ -27,72 +27,6 @@ public sealed partial class OidcAuthenticateRequestParameters : Elastic.Transpor { } -internal sealed partial class OidcAuthenticateRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNonce = System.Text.Json.JsonEncodedText.Encode("nonce"); - private static readonly System.Text.Json.JsonEncodedText PropRealm = System.Text.Json.JsonEncodedText.Encode("realm"); - private static readonly System.Text.Json.JsonEncodedText PropRedirectUri = System.Text.Json.JsonEncodedText.Encode("redirect_uri"); - private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); - - public override Elastic.Clients.Elasticsearch.Security.OidcAuthenticateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propNonce = default; - LocalJsonValue propRealm = default; - LocalJsonValue propRedirectUri = default; - LocalJsonValue propState = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNonce.TryReadProperty(ref reader, options, PropNonce, null)) - { - continue; - } - - if (propRealm.TryReadProperty(ref reader, options, PropRealm, null)) - { - continue; - } - - if (propRedirectUri.TryReadProperty(ref reader, options, PropRedirectUri, null)) - { - continue; - } - - if (propState.TryReadProperty(ref reader, options, PropState, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.OidcAuthenticateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Nonce = propNonce.Value, - Realm = propRealm.Value, - RedirectUri = propRedirectUri.Value, - State = propState.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.OidcAuthenticateRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNonce, value.Nonce, null, null); - writer.WriteProperty(options, PropRealm, value.Realm, null, null); - writer.WriteProperty(options, PropRedirectUri, value.RedirectUri, null, null); - writer.WriteProperty(options, PropState, value.State, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Authenticate OpenID Connect. @@ -105,7 +39,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// These APIs are used internally by Kibana in order to provide OpenID Connect based authentication, but can also be used by other, custom web applications or other clients. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.OidcAuthenticateRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.OidcAuthenticateRequestConverter))] public sealed partial class OidcAuthenticateRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcAuthenticateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcAuthenticateResponse.Converters.g.cs new file mode 100644 index 00000000000..c4f4187514f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcAuthenticateResponse.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class OidcAuthenticateResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAccessToken = System.Text.Json.JsonEncodedText.Encode("access_token"); + private static readonly System.Text.Json.JsonEncodedText PropExpiresIn = System.Text.Json.JsonEncodedText.Encode("expires_in"); + private static readonly System.Text.Json.JsonEncodedText PropRefreshToken = System.Text.Json.JsonEncodedText.Encode("refresh_token"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Security.OidcAuthenticateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAccessToken = default; + LocalJsonValue propExpiresIn = default; + LocalJsonValue propRefreshToken = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAccessToken.TryReadProperty(ref reader, options, PropAccessToken, null)) + { + continue; + } + + if (propExpiresIn.TryReadProperty(ref reader, options, PropExpiresIn, null)) + { + continue; + } + + if (propRefreshToken.TryReadProperty(ref reader, options, PropRefreshToken, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.OidcAuthenticateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AccessToken = propAccessToken.Value, + ExpiresIn = propExpiresIn.Value, + RefreshToken = propRefreshToken.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.OidcAuthenticateResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAccessToken, value.AccessToken, null, null); + writer.WriteProperty(options, PropExpiresIn, value.ExpiresIn, null, null); + writer.WriteProperty(options, PropRefreshToken, value.RefreshToken, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcAuthenticateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcAuthenticateResponse.g.cs index 1e6c2d16320..16de08dd460 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcAuthenticateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcAuthenticateResponse.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class OidcAuthenticateResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAccessToken = System.Text.Json.JsonEncodedText.Encode("access_token"); - private static readonly System.Text.Json.JsonEncodedText PropExpiresIn = System.Text.Json.JsonEncodedText.Encode("expires_in"); - private static readonly System.Text.Json.JsonEncodedText PropRefreshToken = System.Text.Json.JsonEncodedText.Encode("refresh_token"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Security.OidcAuthenticateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAccessToken = default; - LocalJsonValue propExpiresIn = default; - LocalJsonValue propRefreshToken = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAccessToken.TryReadProperty(ref reader, options, PropAccessToken, null)) - { - continue; - } - - if (propExpiresIn.TryReadProperty(ref reader, options, PropExpiresIn, null)) - { - continue; - } - - if (propRefreshToken.TryReadProperty(ref reader, options, PropRefreshToken, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.OidcAuthenticateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AccessToken = propAccessToken.Value, - ExpiresIn = propExpiresIn.Value, - RefreshToken = propRefreshToken.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.OidcAuthenticateResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAccessToken, value.AccessToken, null, null); - writer.WriteProperty(options, PropExpiresIn, value.ExpiresIn, null, null); - writer.WriteProperty(options, PropRefreshToken, value.RefreshToken, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.OidcAuthenticateResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.OidcAuthenticateResponseConverter))] public sealed partial class OidcAuthenticateResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcLogoutRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcLogoutRequest.Converters.g.cs new file mode 100644 index 00000000000..4b8d45a94dd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcLogoutRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class OidcLogoutRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRefreshToken = System.Text.Json.JsonEncodedText.Encode("refresh_token"); + private static readonly System.Text.Json.JsonEncodedText PropToken = System.Text.Json.JsonEncodedText.Encode("token"); + + public override Elastic.Clients.Elasticsearch.Security.OidcLogoutRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propRefreshToken = default; + LocalJsonValue propToken = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRefreshToken.TryReadProperty(ref reader, options, PropRefreshToken, null)) + { + continue; + } + + if (propToken.TryReadProperty(ref reader, options, PropToken, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.OidcLogoutRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + RefreshToken = propRefreshToken.Value, + Token = propToken.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.OidcLogoutRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRefreshToken, value.RefreshToken, null, null); + writer.WriteProperty(options, PropToken, value.Token, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcLogoutRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcLogoutRequest.g.cs index ac02a74eb53..183883d6e43 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcLogoutRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcLogoutRequest.g.cs @@ -27,54 +27,6 @@ public sealed partial class OidcLogoutRequestParameters : Elastic.Transport.Requ { } -internal sealed partial class OidcLogoutRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRefreshToken = System.Text.Json.JsonEncodedText.Encode("refresh_token"); - private static readonly System.Text.Json.JsonEncodedText PropToken = System.Text.Json.JsonEncodedText.Encode("token"); - - public override Elastic.Clients.Elasticsearch.Security.OidcLogoutRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propRefreshToken = default; - LocalJsonValue propToken = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRefreshToken.TryReadProperty(ref reader, options, PropRefreshToken, null)) - { - continue; - } - - if (propToken.TryReadProperty(ref reader, options, PropToken, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.OidcLogoutRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - RefreshToken = propRefreshToken.Value, - Token = propToken.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.OidcLogoutRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRefreshToken, value.RefreshToken, null, null); - writer.WriteProperty(options, PropToken, value.Token, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Logout of OpenID Connect. @@ -90,7 +42,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// These APIs are used internally by Kibana in order to provide OpenID Connect based authentication, but can also be used by other, custom web applications or other clients. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.OidcLogoutRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.OidcLogoutRequestConverter))] public sealed partial class OidcLogoutRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcLogoutResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcLogoutResponse.Converters.g.cs new file mode 100644 index 00000000000..c8557b7996e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcLogoutResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class OidcLogoutResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRedirect = System.Text.Json.JsonEncodedText.Encode("redirect"); + + public override Elastic.Clients.Elasticsearch.Security.OidcLogoutResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propRedirect = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRedirect.TryReadProperty(ref reader, options, PropRedirect, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.OidcLogoutResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Redirect = propRedirect.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.OidcLogoutResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRedirect, value.Redirect, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcLogoutResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcLogoutResponse.g.cs index 49fece09abe..d0c2f5a5110 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcLogoutResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcLogoutResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class OidcLogoutResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRedirect = System.Text.Json.JsonEncodedText.Encode("redirect"); - - public override Elastic.Clients.Elasticsearch.Security.OidcLogoutResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propRedirect = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRedirect.TryReadProperty(ref reader, options, PropRedirect, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.OidcLogoutResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Redirect = propRedirect.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.OidcLogoutResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRedirect, value.Redirect, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.OidcLogoutResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.OidcLogoutResponseConverter))] public sealed partial class OidcLogoutResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcPrepareAuthenticationRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcPrepareAuthenticationRequest.Converters.g.cs new file mode 100644 index 00000000000..d18f80c5a6e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcPrepareAuthenticationRequest.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class OidcPrepareAuthenticationRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIss = System.Text.Json.JsonEncodedText.Encode("iss"); + private static readonly System.Text.Json.JsonEncodedText PropLoginHint = System.Text.Json.JsonEncodedText.Encode("login_hint"); + private static readonly System.Text.Json.JsonEncodedText PropNonce = System.Text.Json.JsonEncodedText.Encode("nonce"); + private static readonly System.Text.Json.JsonEncodedText PropRealm = System.Text.Json.JsonEncodedText.Encode("realm"); + private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); + + public override Elastic.Clients.Elasticsearch.Security.OidcPrepareAuthenticationRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIss = default; + LocalJsonValue propLoginHint = default; + LocalJsonValue propNonce = default; + LocalJsonValue propRealm = default; + LocalJsonValue propState = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIss.TryReadProperty(ref reader, options, PropIss, null)) + { + continue; + } + + if (propLoginHint.TryReadProperty(ref reader, options, PropLoginHint, null)) + { + continue; + } + + if (propNonce.TryReadProperty(ref reader, options, PropNonce, null)) + { + continue; + } + + if (propRealm.TryReadProperty(ref reader, options, PropRealm, null)) + { + continue; + } + + if (propState.TryReadProperty(ref reader, options, PropState, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.OidcPrepareAuthenticationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Iss = propIss.Value, + LoginHint = propLoginHint.Value, + Nonce = propNonce.Value, + Realm = propRealm.Value, + State = propState.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.OidcPrepareAuthenticationRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIss, value.Iss, null, null); + writer.WriteProperty(options, PropLoginHint, value.LoginHint, null, null); + writer.WriteProperty(options, PropNonce, value.Nonce, null, null); + writer.WriteProperty(options, PropRealm, value.Realm, null, null); + writer.WriteProperty(options, PropState, value.State, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcPrepareAuthenticationRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcPrepareAuthenticationRequest.g.cs index 0de22af37e6..24c48d6869e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcPrepareAuthenticationRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcPrepareAuthenticationRequest.g.cs @@ -27,81 +27,6 @@ public sealed partial class OidcPrepareAuthenticationRequestParameters : Elastic { } -internal sealed partial class OidcPrepareAuthenticationRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIss = System.Text.Json.JsonEncodedText.Encode("iss"); - private static readonly System.Text.Json.JsonEncodedText PropLoginHint = System.Text.Json.JsonEncodedText.Encode("login_hint"); - private static readonly System.Text.Json.JsonEncodedText PropNonce = System.Text.Json.JsonEncodedText.Encode("nonce"); - private static readonly System.Text.Json.JsonEncodedText PropRealm = System.Text.Json.JsonEncodedText.Encode("realm"); - private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); - - public override Elastic.Clients.Elasticsearch.Security.OidcPrepareAuthenticationRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIss = default; - LocalJsonValue propLoginHint = default; - LocalJsonValue propNonce = default; - LocalJsonValue propRealm = default; - LocalJsonValue propState = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIss.TryReadProperty(ref reader, options, PropIss, null)) - { - continue; - } - - if (propLoginHint.TryReadProperty(ref reader, options, PropLoginHint, null)) - { - continue; - } - - if (propNonce.TryReadProperty(ref reader, options, PropNonce, null)) - { - continue; - } - - if (propRealm.TryReadProperty(ref reader, options, PropRealm, null)) - { - continue; - } - - if (propState.TryReadProperty(ref reader, options, PropState, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.OidcPrepareAuthenticationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Iss = propIss.Value, - LoginHint = propLoginHint.Value, - Nonce = propNonce.Value, - Realm = propRealm.Value, - State = propState.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.OidcPrepareAuthenticationRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIss, value.Iss, null, null); - writer.WriteProperty(options, PropLoginHint, value.LoginHint, null, null); - writer.WriteProperty(options, PropNonce, value.Nonce, null, null); - writer.WriteProperty(options, PropRealm, value.Realm, null, null); - writer.WriteProperty(options, PropState, value.State, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Prepare OpenID connect authentication. @@ -117,7 +42,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// These APIs are used internally by Kibana in order to provide OpenID Connect based authentication, but can also be used by other, custom web applications or other clients. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.OidcPrepareAuthenticationRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.OidcPrepareAuthenticationRequestConverter))] public sealed partial class OidcPrepareAuthenticationRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcPrepareAuthenticationResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcPrepareAuthenticationResponse.Converters.g.cs new file mode 100644 index 00000000000..79a8a0d537e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcPrepareAuthenticationResponse.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class OidcPrepareAuthenticationResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNonce = System.Text.Json.JsonEncodedText.Encode("nonce"); + private static readonly System.Text.Json.JsonEncodedText PropRealm = System.Text.Json.JsonEncodedText.Encode("realm"); + private static readonly System.Text.Json.JsonEncodedText PropRedirect = System.Text.Json.JsonEncodedText.Encode("redirect"); + private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); + + public override Elastic.Clients.Elasticsearch.Security.OidcPrepareAuthenticationResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propNonce = default; + LocalJsonValue propRealm = default; + LocalJsonValue propRedirect = default; + LocalJsonValue propState = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNonce.TryReadProperty(ref reader, options, PropNonce, null)) + { + continue; + } + + if (propRealm.TryReadProperty(ref reader, options, PropRealm, null)) + { + continue; + } + + if (propRedirect.TryReadProperty(ref reader, options, PropRedirect, null)) + { + continue; + } + + if (propState.TryReadProperty(ref reader, options, PropState, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.OidcPrepareAuthenticationResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Nonce = propNonce.Value, + Realm = propRealm.Value, + Redirect = propRedirect.Value, + State = propState.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.OidcPrepareAuthenticationResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNonce, value.Nonce, null, null); + writer.WriteProperty(options, PropRealm, value.Realm, null, null); + writer.WriteProperty(options, PropRedirect, value.Redirect, null, null); + writer.WriteProperty(options, PropState, value.State, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcPrepareAuthenticationResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcPrepareAuthenticationResponse.g.cs index 661c9bef0e9..6c178764555 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcPrepareAuthenticationResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/OidcPrepareAuthenticationResponse.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class OidcPrepareAuthenticationResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNonce = System.Text.Json.JsonEncodedText.Encode("nonce"); - private static readonly System.Text.Json.JsonEncodedText PropRealm = System.Text.Json.JsonEncodedText.Encode("realm"); - private static readonly System.Text.Json.JsonEncodedText PropRedirect = System.Text.Json.JsonEncodedText.Encode("redirect"); - private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); - - public override Elastic.Clients.Elasticsearch.Security.OidcPrepareAuthenticationResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propNonce = default; - LocalJsonValue propRealm = default; - LocalJsonValue propRedirect = default; - LocalJsonValue propState = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNonce.TryReadProperty(ref reader, options, PropNonce, null)) - { - continue; - } - - if (propRealm.TryReadProperty(ref reader, options, PropRealm, null)) - { - continue; - } - - if (propRedirect.TryReadProperty(ref reader, options, PropRedirect, null)) - { - continue; - } - - if (propState.TryReadProperty(ref reader, options, PropState, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.OidcPrepareAuthenticationResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Nonce = propNonce.Value, - Realm = propRealm.Value, - Redirect = propRedirect.Value, - State = propState.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.OidcPrepareAuthenticationResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNonce, value.Nonce, null, null); - writer.WriteProperty(options, PropRealm, value.Realm, null, null); - writer.WriteProperty(options, PropRedirect, value.Redirect, null, null); - writer.WriteProperty(options, PropState, value.State, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.OidcPrepareAuthenticationResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.OidcPrepareAuthenticationResponseConverter))] public sealed partial class OidcPrepareAuthenticationResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -105,14 +39,14 @@ internal OidcPrepareAuthenticationResponse(Elastic.Clients.Elasticsearch.Seriali public #if NET7_0_OR_GREATER - required +required #endif - string Nonce { get; set; } +string Nonce { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Realm { get; set; } +string Realm { get; set; } /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutPrivilegesRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutPrivilegesRequest.Converters.g.cs new file mode 100644 index 00000000000..f834c5f2447 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutPrivilegesRequest.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class PutPrivilegesRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.PutPrivilegesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Security.PutPrivilegesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Privileges = reader.ReadValue>>(options, static System.Collections.Generic.IDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.PutPrivilegesRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Privileges, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, null))); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutPrivilegesRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutPrivilegesRequest.g.cs index edd96fc9ec0..15679a717de 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutPrivilegesRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutPrivilegesRequest.g.cs @@ -33,19 +33,6 @@ public sealed partial class PutPrivilegesRequestParameters : Elastic.Transport.R public Elastic.Clients.Elasticsearch.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } } -internal sealed partial class PutPrivilegesRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.PutPrivilegesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Security.PutPrivilegesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Privileges = reader.ReadValue>>(options, static System.Collections.Generic.IDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.PutPrivilegesRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Privileges, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, null))); - } -} - /// /// /// Create or update application privileges. @@ -107,7 +94,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Action names can contain any number of printable ASCII characters and must contain at least one of the following characters: /, *, :. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.PutPrivilegesRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.PutPrivilegesRequestConverter))] public sealed partial class PutPrivilegesRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutPrivilegesResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutPrivilegesResponse.Converters.g.cs new file mode 100644 index 00000000000..cbb800837fb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutPrivilegesResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class PutPrivilegesResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.PutPrivilegesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Security.PutPrivilegesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Result = reader.ReadValue>>(options, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.PutPrivilegesResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Result, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null))); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutPrivilegesResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutPrivilegesResponse.g.cs index 7f74f2a6212..602716f3035 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutPrivilegesResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutPrivilegesResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class PutPrivilegesResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.PutPrivilegesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Security.PutPrivilegesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Result = reader.ReadValue>>(options, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.PutPrivilegesResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Result, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null))); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.PutPrivilegesResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.PutPrivilegesResponseConverter))] public sealed partial class PutPrivilegesResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleMappingRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleMappingRequest.Converters.g.cs new file mode 100644 index 00000000000..8d2a0135b36 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleMappingRequest.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class PutRoleMappingRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + private static readonly System.Text.Json.JsonEncodedText PropRoleTemplates = System.Text.Json.JsonEncodedText.Encode("role_templates"); + private static readonly System.Text.Json.JsonEncodedText PropRules = System.Text.Json.JsonEncodedText.Encode("rules"); + private static readonly System.Text.Json.JsonEncodedText PropRunAs = System.Text.Json.JsonEncodedText.Encode("run_as"); + + public override Elastic.Clients.Elasticsearch.Security.PutRoleMappingRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEnabled = default; + LocalJsonValue?> propMetadata = default; + LocalJsonValue?> propRoles = default; + LocalJsonValue?> propRoleTemplates = default; + LocalJsonValue propRules = default; + LocalJsonValue?> propRunAs = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propRoleTemplates.TryReadProperty(ref reader, options, PropRoleTemplates, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propRules.TryReadProperty(ref reader, options, PropRules, null)) + { + continue; + } + + if (propRunAs.TryReadProperty(ref reader, options, PropRunAs, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.PutRoleMappingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Enabled = propEnabled.Value, + Metadata = propMetadata.Value, + Roles = propRoles.Value, + RoleTemplates = propRoleTemplates.Value, + Rules = propRules.Value, + RunAs = propRunAs.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.PutRoleMappingRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRoleTemplates, value.RoleTemplates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRules, value.Rules, null, null); + writer.WriteProperty(options, PropRunAs, value.RunAs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleMappingRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleMappingRequest.g.cs index 74b2dd530b9..130461fe39b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleMappingRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleMappingRequest.g.cs @@ -33,90 +33,6 @@ public sealed partial class PutRoleMappingRequestParameters : Elastic.Transport. public Elastic.Clients.Elasticsearch.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } } -internal sealed partial class PutRoleMappingRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); - private static readonly System.Text.Json.JsonEncodedText PropRoleTemplates = System.Text.Json.JsonEncodedText.Encode("role_templates"); - private static readonly System.Text.Json.JsonEncodedText PropRules = System.Text.Json.JsonEncodedText.Encode("rules"); - private static readonly System.Text.Json.JsonEncodedText PropRunAs = System.Text.Json.JsonEncodedText.Encode("run_as"); - - public override Elastic.Clients.Elasticsearch.Security.PutRoleMappingRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEnabled = default; - LocalJsonValue?> propMetadata = default; - LocalJsonValue?> propRoles = default; - LocalJsonValue?> propRoleTemplates = default; - LocalJsonValue propRules = default; - LocalJsonValue?> propRunAs = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propRoleTemplates.TryReadProperty(ref reader, options, PropRoleTemplates, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propRules.TryReadProperty(ref reader, options, PropRules, null)) - { - continue; - } - - if (propRunAs.TryReadProperty(ref reader, options, PropRunAs, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.PutRoleMappingRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Enabled = propEnabled.Value, - Metadata = propMetadata.Value, - Roles = propRoles.Value, - RoleTemplates = propRoleTemplates.Value, - Rules = propRules.Value, - RunAs = propRunAs.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.PutRoleMappingRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRoleTemplates, value.RoleTemplates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRules, value.Rules, null, null); - writer.WriteProperty(options, PropRunAs, value.RunAs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// Create or update role mappings. @@ -155,7 +71,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If the format of the template is set to "json" then the template is expected to produce a JSON string or an array of JSON strings for the role names. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.PutRoleMappingRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.PutRoleMappingRequestConverter))] public sealed partial class PutRoleMappingRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleMappingResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleMappingResponse.Converters.g.cs new file mode 100644 index 00000000000..6ff9e892a1e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleMappingResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class PutRoleMappingResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCreated = System.Text.Json.JsonEncodedText.Encode("created"); + private static readonly System.Text.Json.JsonEncodedText PropRoleMapping = System.Text.Json.JsonEncodedText.Encode("role_mapping"); + + public override Elastic.Clients.Elasticsearch.Security.PutRoleMappingResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCreated = default; + LocalJsonValue propRoleMapping = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCreated.TryReadProperty(ref reader, options, PropCreated, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRoleMapping.TryReadProperty(ref reader, options, PropRoleMapping, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.PutRoleMappingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Created = propCreated.Value, + RoleMapping = propRoleMapping.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.PutRoleMappingResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCreated, value.Created, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRoleMapping, value.RoleMapping, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleMappingResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleMappingResponse.g.cs index 6cf926f6561..1fb999d727a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleMappingResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleMappingResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class PutRoleMappingResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCreated = System.Text.Json.JsonEncodedText.Encode("created"); - private static readonly System.Text.Json.JsonEncodedText PropRoleMapping = System.Text.Json.JsonEncodedText.Encode("role_mapping"); - - public override Elastic.Clients.Elasticsearch.Security.PutRoleMappingResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCreated = default; - LocalJsonValue propRoleMapping = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCreated.TryReadProperty(ref reader, options, PropCreated, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRoleMapping.TryReadProperty(ref reader, options, PropRoleMapping, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.PutRoleMappingResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Created = propCreated.Value, - RoleMapping = propRoleMapping.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.PutRoleMappingResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCreated, value.Created, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRoleMapping, value.RoleMapping, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.PutRoleMappingResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.PutRoleMappingResponseConverter))] public sealed partial class PutRoleMappingResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -88,7 +40,7 @@ internal PutRoleMappingResponse(Elastic.Clients.Elasticsearch.Serialization.Json public bool? Created { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Security.CreatedStatus RoleMapping { get; set; } +Elastic.Clients.Elasticsearch.Security.CreatedStatus RoleMapping { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleRequest.Converters.g.cs new file mode 100644 index 00000000000..9f9ecfd876c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleRequest.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class PutRoleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApplications = System.Text.Json.JsonEncodedText.Encode("applications"); + private static readonly System.Text.Json.JsonEncodedText PropCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropGlobal = System.Text.Json.JsonEncodedText.Encode("global"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropRemoteCluster = System.Text.Json.JsonEncodedText.Encode("remote_cluster"); + private static readonly System.Text.Json.JsonEncodedText PropRemoteIndices = System.Text.Json.JsonEncodedText.Encode("remote_indices"); + private static readonly System.Text.Json.JsonEncodedText PropRunAs = System.Text.Json.JsonEncodedText.Encode("run_as"); + private static readonly System.Text.Json.JsonEncodedText PropTransientMetadata = System.Text.Json.JsonEncodedText.Encode("transient_metadata"); + + public override Elastic.Clients.Elasticsearch.Security.PutRoleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propApplications = default; + LocalJsonValue?> propCluster = default; + LocalJsonValue propDescription = default; + LocalJsonValue?> propGlobal = default; + LocalJsonValue?> propIndices = default; + LocalJsonValue?> propMetadata = default; + LocalJsonValue?> propRemoteCluster = default; + LocalJsonValue?> propRemoteIndices = default; + LocalJsonValue?> propRunAs = default; + LocalJsonValue?> propTransientMetadata = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApplications.TryReadProperty(ref reader, options, PropApplications, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propCluster.TryReadProperty(ref reader, options, PropCluster, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propGlobal.TryReadProperty(ref reader, options, PropGlobal, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propRemoteCluster.TryReadProperty(ref reader, options, PropRemoteCluster, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propRemoteIndices.TryReadProperty(ref reader, options, PropRemoteIndices, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propRunAs.TryReadProperty(ref reader, options, PropRunAs, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTransientMetadata.TryReadProperty(ref reader, options, PropTransientMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.PutRoleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Applications = propApplications.Value, + Cluster = propCluster.Value, + Description = propDescription.Value, + Global = propGlobal.Value, + Indices = propIndices.Value, + Metadata = propMetadata.Value, + RemoteCluster = propRemoteCluster.Value, + RemoteIndices = propRemoteIndices.Value, + RunAs = propRunAs.Value, + TransientMetadata = propTransientMetadata.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.PutRoleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApplications, value.Applications, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCluster, value.Cluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropGlobal, value.Global, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropRemoteCluster, value.RemoteCluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRemoteIndices, value.RemoteIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRunAs, value.RunAs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTransientMetadata, value.TransientMetadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleRequest.g.cs index a1cdb37f1b6..bcc79ea7e36 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleRequest.g.cs @@ -33,126 +33,6 @@ public sealed partial class PutRoleRequestParameters : Elastic.Transport.Request public Elastic.Clients.Elasticsearch.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } } -internal sealed partial class PutRoleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApplications = System.Text.Json.JsonEncodedText.Encode("applications"); - private static readonly System.Text.Json.JsonEncodedText PropCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropGlobal = System.Text.Json.JsonEncodedText.Encode("global"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropRemoteCluster = System.Text.Json.JsonEncodedText.Encode("remote_cluster"); - private static readonly System.Text.Json.JsonEncodedText PropRemoteIndices = System.Text.Json.JsonEncodedText.Encode("remote_indices"); - private static readonly System.Text.Json.JsonEncodedText PropRunAs = System.Text.Json.JsonEncodedText.Encode("run_as"); - private static readonly System.Text.Json.JsonEncodedText PropTransientMetadata = System.Text.Json.JsonEncodedText.Encode("transient_metadata"); - - public override Elastic.Clients.Elasticsearch.Security.PutRoleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propApplications = default; - LocalJsonValue?> propCluster = default; - LocalJsonValue propDescription = default; - LocalJsonValue?> propGlobal = default; - LocalJsonValue?> propIndices = default; - LocalJsonValue?> propMetadata = default; - LocalJsonValue?> propRemoteCluster = default; - LocalJsonValue?> propRemoteIndices = default; - LocalJsonValue?> propRunAs = default; - LocalJsonValue?> propTransientMetadata = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApplications.TryReadProperty(ref reader, options, PropApplications, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propCluster.TryReadProperty(ref reader, options, PropCluster, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propGlobal.TryReadProperty(ref reader, options, PropGlobal, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propRemoteCluster.TryReadProperty(ref reader, options, PropRemoteCluster, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propRemoteIndices.TryReadProperty(ref reader, options, PropRemoteIndices, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propRunAs.TryReadProperty(ref reader, options, PropRunAs, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTransientMetadata.TryReadProperty(ref reader, options, PropTransientMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.PutRoleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Applications = propApplications.Value, - Cluster = propCluster.Value, - Description = propDescription.Value, - Global = propGlobal.Value, - Indices = propIndices.Value, - Metadata = propMetadata.Value, - RemoteCluster = propRemoteCluster.Value, - RemoteIndices = propRemoteIndices.Value, - RunAs = propRunAs.Value, - TransientMetadata = propTransientMetadata.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.PutRoleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApplications, value.Applications, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCluster, value.Cluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropGlobal, value.Global, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropRemoteCluster, value.RemoteCluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRemoteIndices, value.RemoteIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRunAs, value.RunAs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTransientMetadata, value.TransientMetadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - /// /// /// Create or update roles. @@ -163,7 +43,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// File-based role management is not available in Elastic Serverless. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.PutRoleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.PutRoleRequestConverter))] public sealed partial class PutRoleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleResponse.Converters.g.cs new file mode 100644 index 00000000000..b4d5335ae3b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class PutRoleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRole = System.Text.Json.JsonEncodedText.Encode("role"); + + public override Elastic.Clients.Elasticsearch.Security.PutRoleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propRole = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRole.TryReadProperty(ref reader, options, PropRole, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.PutRoleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Role = propRole.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.PutRoleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRole, value.Role, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleResponse.g.cs index 6f0d6eb864e..e4c23160efe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutRoleResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class PutRoleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRole = System.Text.Json.JsonEncodedText.Encode("role"); - - public override Elastic.Clients.Elasticsearch.Security.PutRoleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propRole = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRole.TryReadProperty(ref reader, options, PropRole, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.PutRoleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Role = propRole.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.PutRoleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRole, value.Role, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.PutRoleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.PutRoleResponseConverter))] public sealed partial class PutRoleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutUserRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutUserRequest.Converters.g.cs new file mode 100644 index 00000000000..bc3ab0a0d6b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutUserRequest.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class PutUserRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEmail = System.Text.Json.JsonEncodedText.Encode("email"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropFullName = System.Text.Json.JsonEncodedText.Encode("full_name"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropPassword = System.Text.Json.JsonEncodedText.Encode("password"); + private static readonly System.Text.Json.JsonEncodedText PropPasswordHash = System.Text.Json.JsonEncodedText.Encode("password_hash"); + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); + + public override Elastic.Clients.Elasticsearch.Security.PutUserRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEmail = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propFullName = default; + LocalJsonValue?> propMetadata = default; + LocalJsonValue propPassword = default; + LocalJsonValue propPasswordHash = default; + LocalJsonValue?> propRoles = default; + LocalJsonValue propUsername = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEmail.TryReadProperty(ref reader, options, PropEmail, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFullName.TryReadProperty(ref reader, options, PropFullName, null)) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propPassword.TryReadProperty(ref reader, options, PropPassword, null)) + { + continue; + } + + if (propPasswordHash.TryReadProperty(ref reader, options, PropPasswordHash, null)) + { + continue; + } + + if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.PutUserRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Email = propEmail.Value, + Enabled = propEnabled.Value, + FullName = propFullName.Value, + Metadata = propMetadata.Value, + Password = propPassword.Value, + PasswordHash = propPasswordHash.Value, + Roles = propRoles.Value, + Username = propUsername.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.PutUserRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEmail, value.Email, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFullName, value.FullName, null, null); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropPassword, value.Password, null, null); + writer.WriteProperty(options, PropPasswordHash, value.PasswordHash, null, null); + writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropUsername, value.Username, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutUserRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutUserRequest.g.cs index 0f11d8aa103..c9269ea7d76 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutUserRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutUserRequest.g.cs @@ -34,108 +34,6 @@ public sealed partial class PutUserRequestParameters : Elastic.Transport.Request public Elastic.Clients.Elasticsearch.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } } -internal sealed partial class PutUserRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEmail = System.Text.Json.JsonEncodedText.Encode("email"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropFullName = System.Text.Json.JsonEncodedText.Encode("full_name"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropPassword = System.Text.Json.JsonEncodedText.Encode("password"); - private static readonly System.Text.Json.JsonEncodedText PropPasswordHash = System.Text.Json.JsonEncodedText.Encode("password_hash"); - private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); - private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); - - public override Elastic.Clients.Elasticsearch.Security.PutUserRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEmail = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propFullName = default; - LocalJsonValue?> propMetadata = default; - LocalJsonValue propPassword = default; - LocalJsonValue propPasswordHash = default; - LocalJsonValue?> propRoles = default; - LocalJsonValue propUsername = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEmail.TryReadProperty(ref reader, options, PropEmail, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFullName.TryReadProperty(ref reader, options, PropFullName, null)) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propPassword.TryReadProperty(ref reader, options, PropPassword, null)) - { - continue; - } - - if (propPasswordHash.TryReadProperty(ref reader, options, PropPasswordHash, null)) - { - continue; - } - - if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.PutUserRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Email = propEmail.Value, - Enabled = propEnabled.Value, - FullName = propFullName.Value, - Metadata = propMetadata.Value, - Password = propPassword.Value, - PasswordHash = propPasswordHash.Value, - Roles = propRoles.Value, - Username = propUsername.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.PutUserRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEmail, value.Email, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFullName, value.FullName, null, null); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropPassword, value.Password, null, null); - writer.WriteProperty(options, PropPasswordHash, value.PasswordHash, null, null); - writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropUsername, value.Username, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create or update users. @@ -146,7 +44,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// To change a user's password without updating any other fields, use the change password API. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.PutUserRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.PutUserRequestConverter))] public sealed partial class PutUserRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutUserResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutUserResponse.Converters.g.cs new file mode 100644 index 00000000000..b34c9e41c9f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutUserResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class PutUserResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCreated = System.Text.Json.JsonEncodedText.Encode("created"); + + public override Elastic.Clients.Elasticsearch.Security.PutUserResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCreated = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCreated.TryReadProperty(ref reader, options, PropCreated, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.PutUserResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Created = propCreated.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.PutUserResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCreated, value.Created, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutUserResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutUserResponse.g.cs index 838152e9f5d..99283b637ad 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutUserResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/PutUserResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class PutUserResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCreated = System.Text.Json.JsonEncodedText.Encode("created"); - - public override Elastic.Clients.Elasticsearch.Security.PutUserResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCreated = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCreated.TryReadProperty(ref reader, options, PropCreated, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.PutUserResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Created = propCreated.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.PutUserResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCreated, value.Created, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.PutUserResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.PutUserResponseConverter))] public sealed partial class PutUserResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryApiKeysRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryApiKeysRequest.Converters.g.cs new file mode 100644 index 00000000000..54073e87c88 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryApiKeysRequest.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class QueryApiKeysRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + 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 PropFrom = System.Text.Json.JsonEncodedText.Encode("from"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropSearchAfter = System.Text.Json.JsonEncodedText.Encode("search_after"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); + + public override Elastic.Clients.Elasticsearch.Security.QueryApiKeysRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAggregations = default; + LocalJsonValue propFrom = default; + LocalJsonValue propQuery = default; + LocalJsonValue?> propSearchAfter = default; + LocalJsonValue propSize = default; + LocalJsonValue?> propSort = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)) || propAggregations.TryReadProperty(ref reader, options, PropAggregations1, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propFrom.TryReadProperty(ref reader, options, PropFrom, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propSearchAfter.TryReadProperty(ref reader, options, PropSearchAfter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.QueryApiKeysRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = propAggregations.Value, + From = propFrom.Value, + Query = propQuery.Value, + SearchAfter = propSearchAfter.Value, + Size = propSize.Value, + Sort = propSort.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.QueryApiKeysRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropFrom, value.From, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropSearchAfter, value.SearchAfter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryApiKeysRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryApiKeysRequest.g.cs index 7542364a11a..98d6a935f39 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryApiKeysRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryApiKeysRequest.g.cs @@ -50,91 +50,6 @@ public sealed partial class QueryApiKeysRequestParameters : Elastic.Transport.Re public bool? WithProfileUid { get => Q("with_profile_uid"); set => Q("with_profile_uid", value); } } -internal sealed partial class QueryApiKeysRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - 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 PropFrom = System.Text.Json.JsonEncodedText.Encode("from"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropSearchAfter = System.Text.Json.JsonEncodedText.Encode("search_after"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); - - public override Elastic.Clients.Elasticsearch.Security.QueryApiKeysRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAggregations = default; - LocalJsonValue propFrom = default; - LocalJsonValue propQuery = default; - LocalJsonValue?> propSearchAfter = default; - LocalJsonValue propSize = default; - LocalJsonValue?> propSort = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)) || propAggregations.TryReadProperty(ref reader, options, PropAggregations1, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propFrom.TryReadProperty(ref reader, options, PropFrom, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propSearchAfter.TryReadProperty(ref reader, options, PropSearchAfter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.QueryApiKeysRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = propAggregations.Value, - From = propFrom.Value, - Query = propQuery.Value, - SearchAfter = propSearchAfter.Value, - Size = propSize.Value, - Sort = propSort.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.QueryApiKeysRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropFrom, value.From, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropSearchAfter, value.SearchAfter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// Find API keys with a query. @@ -150,7 +65,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Refer to the linked documentation for examples of how to find API keys: /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.QueryApiKeysRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.QueryApiKeysRequestConverter))] public partial class QueryApiKeysRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryApiKeysResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryApiKeysResponse.Converters.g.cs new file mode 100644 index 00000000000..efe618d9219 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryApiKeysResponse.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class QueryApiKeysResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); + private static readonly System.Text.Json.JsonEncodedText PropApiKeys = System.Text.Json.JsonEncodedText.Encode("api_keys"); + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Security.QueryApiKeysResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAggregations = default; + LocalJsonValue> propApiKeys = default; + LocalJsonValue propCount = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, null)) + { + continue; + } + + if (propApiKeys.TryReadProperty(ref reader, options, PropApiKeys, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.QueryApiKeysResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = propAggregations.Value, + ApiKeys = propApiKeys.Value, + Count = propCount.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.QueryApiKeysResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregations, value.Aggregations, null, null); + writer.WriteProperty(options, PropApiKeys, value.ApiKeys, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryApiKeysResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryApiKeysResponse.g.cs index ae65a4eb5a8..8bb7d4cfc8b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryApiKeysResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryApiKeysResponse.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class QueryApiKeysResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); - private static readonly System.Text.Json.JsonEncodedText PropApiKeys = System.Text.Json.JsonEncodedText.Encode("api_keys"); - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Security.QueryApiKeysResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAggregations = default; - LocalJsonValue> propApiKeys = default; - LocalJsonValue propCount = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, null)) - { - continue; - } - - if (propApiKeys.TryReadProperty(ref reader, options, PropApiKeys, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.QueryApiKeysResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = propAggregations.Value, - ApiKeys = propApiKeys.Value, - Count = propCount.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.QueryApiKeysResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregations, value.Aggregations, null, null); - writer.WriteProperty(options, PropApiKeys, value.ApiKeys, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.QueryApiKeysResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.QueryApiKeysResponseConverter))] public sealed partial class QueryApiKeysResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryRoleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryRoleRequest.Converters.g.cs new file mode 100644 index 00000000000..a8d4299a8e4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryRoleRequest.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class QueryRoleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFrom = System.Text.Json.JsonEncodedText.Encode("from"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropSearchAfter = System.Text.Json.JsonEncodedText.Encode("search_after"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); + + public override Elastic.Clients.Elasticsearch.Security.QueryRoleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFrom = default; + LocalJsonValue propQuery = default; + LocalJsonValue?> propSearchAfter = default; + LocalJsonValue propSize = default; + LocalJsonValue?> propSort = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFrom.TryReadProperty(ref reader, options, PropFrom, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propSearchAfter.TryReadProperty(ref reader, options, PropSearchAfter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.QueryRoleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + From = propFrom.Value, + Query = propQuery.Value, + SearchAfter = propSearchAfter.Value, + Size = propSize.Value, + Sort = propSort.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.QueryRoleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFrom, value.From, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropSearchAfter, value.SearchAfter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryRoleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryRoleRequest.g.cs index fddff00bc8a..f8117558f63 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryRoleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryRoleRequest.g.cs @@ -27,81 +27,6 @@ public sealed partial class QueryRoleRequestParameters : Elastic.Transport.Reque { } -internal sealed partial class QueryRoleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFrom = System.Text.Json.JsonEncodedText.Encode("from"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropSearchAfter = System.Text.Json.JsonEncodedText.Encode("search_after"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); - - public override Elastic.Clients.Elasticsearch.Security.QueryRoleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFrom = default; - LocalJsonValue propQuery = default; - LocalJsonValue?> propSearchAfter = default; - LocalJsonValue propSize = default; - LocalJsonValue?> propSort = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFrom.TryReadProperty(ref reader, options, PropFrom, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propSearchAfter.TryReadProperty(ref reader, options, PropSearchAfter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.QueryRoleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - From = propFrom.Value, - Query = propQuery.Value, - SearchAfter = propSearchAfter.Value, - Size = propSize.Value, - Sort = propSort.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.QueryRoleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFrom, value.From, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropSearchAfter, value.SearchAfter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// Find roles with a query. @@ -114,7 +39,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Also, the results can be paginated and sorted. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.QueryRoleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.QueryRoleRequestConverter))] public sealed partial class QueryRoleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryRoleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryRoleResponse.Converters.g.cs new file mode 100644 index 00000000000..033cc6985df --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryRoleResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class QueryRoleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Security.QueryRoleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propRoles = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.QueryRoleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Roles = propRoles.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.QueryRoleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryRoleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryRoleResponse.g.cs index deb4155b862..fa04822c961 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryRoleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryRoleResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class QueryRoleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Security.QueryRoleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propRoles = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.QueryRoleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Roles = propRoles.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.QueryRoleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.QueryRoleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.QueryRoleResponseConverter))] public sealed partial class QueryRoleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryUserRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryUserRequest.Converters.g.cs new file mode 100644 index 00000000000..0aec7b27053 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryUserRequest.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class QueryUserRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFrom = System.Text.Json.JsonEncodedText.Encode("from"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropSearchAfter = System.Text.Json.JsonEncodedText.Encode("search_after"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); + + public override Elastic.Clients.Elasticsearch.Security.QueryUserRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFrom = default; + LocalJsonValue propQuery = default; + LocalJsonValue?> propSearchAfter = default; + LocalJsonValue propSize = default; + LocalJsonValue?> propSort = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFrom.TryReadProperty(ref reader, options, PropFrom, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propSearchAfter.TryReadProperty(ref reader, options, PropSearchAfter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.QueryUserRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + From = propFrom.Value, + Query = propQuery.Value, + SearchAfter = propSearchAfter.Value, + Size = propSize.Value, + Sort = propSort.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.QueryUserRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFrom, value.From, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropSearchAfter, value.SearchAfter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryUserRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryUserRequest.g.cs index 609995bfda2..b27f5696618 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryUserRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryUserRequest.g.cs @@ -33,81 +33,6 @@ public sealed partial class QueryUserRequestParameters : Elastic.Transport.Reque public bool? WithProfileUid { get => Q("with_profile_uid"); set => Q("with_profile_uid", value); } } -internal sealed partial class QueryUserRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFrom = System.Text.Json.JsonEncodedText.Encode("from"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropSearchAfter = System.Text.Json.JsonEncodedText.Encode("search_after"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); - - public override Elastic.Clients.Elasticsearch.Security.QueryUserRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFrom = default; - LocalJsonValue propQuery = default; - LocalJsonValue?> propSearchAfter = default; - LocalJsonValue propSize = default; - LocalJsonValue?> propSort = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFrom.TryReadProperty(ref reader, options, PropFrom, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propSearchAfter.TryReadProperty(ref reader, options, PropSearchAfter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.QueryUserRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - From = propFrom.Value, - Query = propQuery.Value, - SearchAfter = propSearchAfter.Value, - Size = propSize.Value, - Sort = propSort.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.QueryUserRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFrom, value.From, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropSearchAfter, value.SearchAfter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// Find users with a query. @@ -121,7 +46,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// This API is only for native users. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.QueryUserRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.QueryUserRequestConverter))] public sealed partial class QueryUserRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryUserResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryUserResponse.Converters.g.cs new file mode 100644 index 00000000000..951c9368e71 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryUserResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class QueryUserResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + private static readonly System.Text.Json.JsonEncodedText PropUsers = System.Text.Json.JsonEncodedText.Encode("users"); + + public override Elastic.Clients.Elasticsearch.Security.QueryUserResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propTotal = default; + LocalJsonValue> propUsers = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (propUsers.TryReadProperty(ref reader, options, PropUsers, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.QueryUserResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Total = propTotal.Value, + Users = propUsers.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.QueryUserResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteProperty(options, PropUsers, value.Users, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryUserResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryUserResponse.g.cs index 2f5d81b6cad..a2ce92d8702 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryUserResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/QueryUserResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class QueryUserResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - private static readonly System.Text.Json.JsonEncodedText PropUsers = System.Text.Json.JsonEncodedText.Encode("users"); - - public override Elastic.Clients.Elasticsearch.Security.QueryUserResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propTotal = default; - LocalJsonValue> propUsers = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (propUsers.TryReadProperty(ref reader, options, PropUsers, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.QueryUserResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Total = propTotal.Value, - Users = propUsers.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.QueryUserResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteProperty(options, PropUsers, value.Users, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.QueryUserResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.QueryUserResponseConverter))] public sealed partial class QueryUserResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlAuthenticateRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlAuthenticateRequest.Converters.g.cs new file mode 100644 index 00000000000..e7095326346 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlAuthenticateRequest.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class SamlAuthenticateRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropContent = System.Text.Json.JsonEncodedText.Encode("content"); + private static readonly System.Text.Json.JsonEncodedText PropIds = System.Text.Json.JsonEncodedText.Encode("ids"); + private static readonly System.Text.Json.JsonEncodedText PropRealm = System.Text.Json.JsonEncodedText.Encode("realm"); + + public override Elastic.Clients.Elasticsearch.Security.SamlAuthenticateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propContent = default; + LocalJsonValue propIds = default; + LocalJsonValue propRealm = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propContent.TryReadProperty(ref reader, options, PropContent, null)) + { + continue; + } + + if (propIds.TryReadProperty(ref reader, options, PropIds, null)) + { + continue; + } + + if (propRealm.TryReadProperty(ref reader, options, PropRealm, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.SamlAuthenticateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Content = propContent.Value, + Ids = propIds.Value, + Realm = propRealm.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SamlAuthenticateRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropContent, value.Content, null, null); + writer.WriteProperty(options, PropIds, value.Ids, null, null); + writer.WriteProperty(options, PropRealm, value.Realm, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlAuthenticateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlAuthenticateRequest.g.cs index 5726218b1a7..a1e69bae325 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlAuthenticateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlAuthenticateRequest.g.cs @@ -27,63 +27,6 @@ public sealed partial class SamlAuthenticateRequestParameters : Elastic.Transpor { } -internal sealed partial class SamlAuthenticateRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropContent = System.Text.Json.JsonEncodedText.Encode("content"); - private static readonly System.Text.Json.JsonEncodedText PropIds = System.Text.Json.JsonEncodedText.Encode("ids"); - private static readonly System.Text.Json.JsonEncodedText PropRealm = System.Text.Json.JsonEncodedText.Encode("realm"); - - public override Elastic.Clients.Elasticsearch.Security.SamlAuthenticateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propContent = default; - LocalJsonValue propIds = default; - LocalJsonValue propRealm = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propContent.TryReadProperty(ref reader, options, PropContent, null)) - { - continue; - } - - if (propIds.TryReadProperty(ref reader, options, PropIds, null)) - { - continue; - } - - if (propRealm.TryReadProperty(ref reader, options, PropRealm, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.SamlAuthenticateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Content = propContent.Value, - Ids = propIds.Value, - Realm = propRealm.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SamlAuthenticateRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropContent, value.Content, null, null); - writer.WriteProperty(options, PropIds, value.Ids, null, null); - writer.WriteProperty(options, PropRealm, value.Realm, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Authenticate SAML. @@ -118,7 +61,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// This API endpoint essentially exchanges SAML responses that indicate successful authentication in the IdP for Elasticsearch access and refresh tokens, which can be used for authentication against Elasticsearch. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.SamlAuthenticateRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.SamlAuthenticateRequestConverter))] public sealed partial class SamlAuthenticateRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlAuthenticateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlAuthenticateResponse.Converters.g.cs new file mode 100644 index 00000000000..da8528eb05b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlAuthenticateResponse.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class SamlAuthenticateResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAccessToken = System.Text.Json.JsonEncodedText.Encode("access_token"); + private static readonly System.Text.Json.JsonEncodedText PropExpiresIn = System.Text.Json.JsonEncodedText.Encode("expires_in"); + private static readonly System.Text.Json.JsonEncodedText PropRealm = System.Text.Json.JsonEncodedText.Encode("realm"); + private static readonly System.Text.Json.JsonEncodedText PropRefreshToken = System.Text.Json.JsonEncodedText.Encode("refresh_token"); + private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); + + public override Elastic.Clients.Elasticsearch.Security.SamlAuthenticateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAccessToken = default; + LocalJsonValue propExpiresIn = default; + LocalJsonValue propRealm = default; + LocalJsonValue propRefreshToken = default; + LocalJsonValue propUsername = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAccessToken.TryReadProperty(ref reader, options, PropAccessToken, null)) + { + continue; + } + + if (propExpiresIn.TryReadProperty(ref reader, options, PropExpiresIn, null)) + { + continue; + } + + if (propRealm.TryReadProperty(ref reader, options, PropRealm, null)) + { + continue; + } + + if (propRefreshToken.TryReadProperty(ref reader, options, PropRefreshToken, null)) + { + continue; + } + + if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.SamlAuthenticateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AccessToken = propAccessToken.Value, + ExpiresIn = propExpiresIn.Value, + Realm = propRealm.Value, + RefreshToken = propRefreshToken.Value, + Username = propUsername.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SamlAuthenticateResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAccessToken, value.AccessToken, null, null); + writer.WriteProperty(options, PropExpiresIn, value.ExpiresIn, null, null); + writer.WriteProperty(options, PropRealm, value.Realm, null, null); + writer.WriteProperty(options, PropRefreshToken, value.RefreshToken, null, null); + writer.WriteProperty(options, PropUsername, value.Username, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlAuthenticateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlAuthenticateResponse.g.cs index f608570d123..e9dd787eb3d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlAuthenticateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlAuthenticateResponse.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class SamlAuthenticateResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAccessToken = System.Text.Json.JsonEncodedText.Encode("access_token"); - private static readonly System.Text.Json.JsonEncodedText PropExpiresIn = System.Text.Json.JsonEncodedText.Encode("expires_in"); - private static readonly System.Text.Json.JsonEncodedText PropRealm = System.Text.Json.JsonEncodedText.Encode("realm"); - private static readonly System.Text.Json.JsonEncodedText PropRefreshToken = System.Text.Json.JsonEncodedText.Encode("refresh_token"); - private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); - - public override Elastic.Clients.Elasticsearch.Security.SamlAuthenticateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAccessToken = default; - LocalJsonValue propExpiresIn = default; - LocalJsonValue propRealm = default; - LocalJsonValue propRefreshToken = default; - LocalJsonValue propUsername = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAccessToken.TryReadProperty(ref reader, options, PropAccessToken, null)) - { - continue; - } - - if (propExpiresIn.TryReadProperty(ref reader, options, PropExpiresIn, null)) - { - continue; - } - - if (propRealm.TryReadProperty(ref reader, options, PropRealm, null)) - { - continue; - } - - if (propRefreshToken.TryReadProperty(ref reader, options, PropRefreshToken, null)) - { - continue; - } - - if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.SamlAuthenticateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AccessToken = propAccessToken.Value, - ExpiresIn = propExpiresIn.Value, - Realm = propRealm.Value, - RefreshToken = propRefreshToken.Value, - Username = propUsername.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SamlAuthenticateResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAccessToken, value.AccessToken, null, null); - writer.WriteProperty(options, PropExpiresIn, value.ExpiresIn, null, null); - writer.WriteProperty(options, PropRealm, value.Realm, null, null); - writer.WriteProperty(options, PropRefreshToken, value.RefreshToken, null, null); - writer.WriteProperty(options, PropUsername, value.Username, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.SamlAuthenticateResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.SamlAuthenticateResponseConverter))] public sealed partial class SamlAuthenticateResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlCompleteLogoutRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlCompleteLogoutRequest.Converters.g.cs new file mode 100644 index 00000000000..8a90398116d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlCompleteLogoutRequest.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class SamlCompleteLogoutRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropContent = System.Text.Json.JsonEncodedText.Encode("content"); + private static readonly System.Text.Json.JsonEncodedText PropIds = System.Text.Json.JsonEncodedText.Encode("ids"); + private static readonly System.Text.Json.JsonEncodedText PropQueryString = System.Text.Json.JsonEncodedText.Encode("query_string"); + private static readonly System.Text.Json.JsonEncodedText PropRealm = System.Text.Json.JsonEncodedText.Encode("realm"); + + public override Elastic.Clients.Elasticsearch.Security.SamlCompleteLogoutRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propContent = default; + LocalJsonValue propIds = default; + LocalJsonValue propQueryString = default; + LocalJsonValue propRealm = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propContent.TryReadProperty(ref reader, options, PropContent, null)) + { + continue; + } + + if (propIds.TryReadProperty(ref reader, options, PropIds, null)) + { + continue; + } + + if (propQueryString.TryReadProperty(ref reader, options, PropQueryString, null)) + { + continue; + } + + if (propRealm.TryReadProperty(ref reader, options, PropRealm, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.SamlCompleteLogoutRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Content = propContent.Value, + Ids = propIds.Value, + QueryString = propQueryString.Value, + Realm = propRealm.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SamlCompleteLogoutRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropContent, value.Content, null, null); + writer.WriteProperty(options, PropIds, value.Ids, null, null); + writer.WriteProperty(options, PropQueryString, value.QueryString, null, null); + writer.WriteProperty(options, PropRealm, value.Realm, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlCompleteLogoutRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlCompleteLogoutRequest.g.cs index ac292317dee..12a7bf9a35d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlCompleteLogoutRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlCompleteLogoutRequest.g.cs @@ -27,72 +27,6 @@ public sealed partial class SamlCompleteLogoutRequestParameters : Elastic.Transp { } -internal sealed partial class SamlCompleteLogoutRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropContent = System.Text.Json.JsonEncodedText.Encode("content"); - private static readonly System.Text.Json.JsonEncodedText PropIds = System.Text.Json.JsonEncodedText.Encode("ids"); - private static readonly System.Text.Json.JsonEncodedText PropQueryString = System.Text.Json.JsonEncodedText.Encode("query_string"); - private static readonly System.Text.Json.JsonEncodedText PropRealm = System.Text.Json.JsonEncodedText.Encode("realm"); - - public override Elastic.Clients.Elasticsearch.Security.SamlCompleteLogoutRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propContent = default; - LocalJsonValue propIds = default; - LocalJsonValue propQueryString = default; - LocalJsonValue propRealm = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propContent.TryReadProperty(ref reader, options, PropContent, null)) - { - continue; - } - - if (propIds.TryReadProperty(ref reader, options, PropIds, null)) - { - continue; - } - - if (propQueryString.TryReadProperty(ref reader, options, PropQueryString, null)) - { - continue; - } - - if (propRealm.TryReadProperty(ref reader, options, PropRealm, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.SamlCompleteLogoutRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Content = propContent.Value, - Ids = propIds.Value, - QueryString = propQueryString.Value, - Realm = propRealm.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SamlCompleteLogoutRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropContent, value.Content, null, null); - writer.WriteProperty(options, PropIds, value.Ids, null, null); - writer.WriteProperty(options, PropQueryString, value.QueryString, null, null); - writer.WriteProperty(options, PropRealm, value.Realm, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Logout of SAML completely. @@ -112,7 +46,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The caller of this API must prepare the request accordingly so that this API can handle either of them. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.SamlCompleteLogoutRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.SamlCompleteLogoutRequestConverter))] public sealed partial class SamlCompleteLogoutRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlCompleteLogoutResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlCompleteLogoutResponse.Converters.g.cs new file mode 100644 index 00000000000..6b32201c177 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlCompleteLogoutResponse.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class SamlCompleteLogoutResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.SamlCompleteLogoutResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.SamlCompleteLogoutResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SamlCompleteLogoutResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlCompleteLogoutResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlCompleteLogoutResponse.g.cs index 7b364ca92cd..f8eb43e4786 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlCompleteLogoutResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlCompleteLogoutResponse.g.cs @@ -23,36 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class SamlCompleteLogoutResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.SamlCompleteLogoutResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.SamlCompleteLogoutResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SamlCompleteLogoutResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.SamlCompleteLogoutResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.SamlCompleteLogoutResponseConverter))] public sealed partial class SamlCompleteLogoutResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlInvalidateRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlInvalidateRequest.Converters.g.cs new file mode 100644 index 00000000000..4f70da59598 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlInvalidateRequest.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class SamlInvalidateRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcs = System.Text.Json.JsonEncodedText.Encode("acs"); + private static readonly System.Text.Json.JsonEncodedText PropQueryString = System.Text.Json.JsonEncodedText.Encode("query_string"); + private static readonly System.Text.Json.JsonEncodedText PropRealm = System.Text.Json.JsonEncodedText.Encode("realm"); + + public override Elastic.Clients.Elasticsearch.Security.SamlInvalidateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcs = default; + LocalJsonValue propQueryString = default; + LocalJsonValue propRealm = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcs.TryReadProperty(ref reader, options, PropAcs, null)) + { + continue; + } + + if (propQueryString.TryReadProperty(ref reader, options, PropQueryString, null)) + { + continue; + } + + if (propRealm.TryReadProperty(ref reader, options, PropRealm, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.SamlInvalidateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acs = propAcs.Value, + QueryString = propQueryString.Value, + Realm = propRealm.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SamlInvalidateRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcs, value.Acs, null, null); + writer.WriteProperty(options, PropQueryString, value.QueryString, null, null); + writer.WriteProperty(options, PropRealm, value.Realm, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlInvalidateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlInvalidateRequest.g.cs index f9692d34724..d93d8d8390b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlInvalidateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlInvalidateRequest.g.cs @@ -27,63 +27,6 @@ public sealed partial class SamlInvalidateRequestParameters : Elastic.Transport. { } -internal sealed partial class SamlInvalidateRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcs = System.Text.Json.JsonEncodedText.Encode("acs"); - private static readonly System.Text.Json.JsonEncodedText PropQueryString = System.Text.Json.JsonEncodedText.Encode("query_string"); - private static readonly System.Text.Json.JsonEncodedText PropRealm = System.Text.Json.JsonEncodedText.Encode("realm"); - - public override Elastic.Clients.Elasticsearch.Security.SamlInvalidateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcs = default; - LocalJsonValue propQueryString = default; - LocalJsonValue propRealm = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcs.TryReadProperty(ref reader, options, PropAcs, null)) - { - continue; - } - - if (propQueryString.TryReadProperty(ref reader, options, PropQueryString, null)) - { - continue; - } - - if (propRealm.TryReadProperty(ref reader, options, PropRealm, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.SamlInvalidateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acs = propAcs.Value, - QueryString = propQueryString.Value, - Realm = propRealm.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SamlInvalidateRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcs, value.Acs, null, null); - writer.WriteProperty(options, PropQueryString, value.QueryString, null, null); - writer.WriteProperty(options, PropRealm, value.Realm, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Invalidate SAML. @@ -102,7 +45,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Thus the user can be redirected back to their IdP. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.SamlInvalidateRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.SamlInvalidateRequestConverter))] public sealed partial class SamlInvalidateRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlInvalidateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlInvalidateResponse.Converters.g.cs new file mode 100644 index 00000000000..7179167cec9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlInvalidateResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class SamlInvalidateResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropInvalidated = System.Text.Json.JsonEncodedText.Encode("invalidated"); + private static readonly System.Text.Json.JsonEncodedText PropRealm = System.Text.Json.JsonEncodedText.Encode("realm"); + private static readonly System.Text.Json.JsonEncodedText PropRedirect = System.Text.Json.JsonEncodedText.Encode("redirect"); + + public override Elastic.Clients.Elasticsearch.Security.SamlInvalidateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propInvalidated = default; + LocalJsonValue propRealm = default; + LocalJsonValue propRedirect = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propInvalidated.TryReadProperty(ref reader, options, PropInvalidated, null)) + { + continue; + } + + if (propRealm.TryReadProperty(ref reader, options, PropRealm, null)) + { + continue; + } + + if (propRedirect.TryReadProperty(ref reader, options, PropRedirect, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.SamlInvalidateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Invalidated = propInvalidated.Value, + Realm = propRealm.Value, + Redirect = propRedirect.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SamlInvalidateResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropInvalidated, value.Invalidated, null, null); + writer.WriteProperty(options, PropRealm, value.Realm, null, null); + writer.WriteProperty(options, PropRedirect, value.Redirect, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlInvalidateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlInvalidateResponse.g.cs index f57b244528f..efc6c2d546b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlInvalidateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlInvalidateResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class SamlInvalidateResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropInvalidated = System.Text.Json.JsonEncodedText.Encode("invalidated"); - private static readonly System.Text.Json.JsonEncodedText PropRealm = System.Text.Json.JsonEncodedText.Encode("realm"); - private static readonly System.Text.Json.JsonEncodedText PropRedirect = System.Text.Json.JsonEncodedText.Encode("redirect"); - - public override Elastic.Clients.Elasticsearch.Security.SamlInvalidateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propInvalidated = default; - LocalJsonValue propRealm = default; - LocalJsonValue propRedirect = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propInvalidated.TryReadProperty(ref reader, options, PropInvalidated, null)) - { - continue; - } - - if (propRealm.TryReadProperty(ref reader, options, PropRealm, null)) - { - continue; - } - - if (propRedirect.TryReadProperty(ref reader, options, PropRedirect, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.SamlInvalidateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Invalidated = propInvalidated.Value, - Realm = propRealm.Value, - Redirect = propRedirect.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SamlInvalidateResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropInvalidated, value.Invalidated, null, null); - writer.WriteProperty(options, PropRealm, value.Realm, null, null); - writer.WriteProperty(options, PropRedirect, value.Redirect, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.SamlInvalidateResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.SamlInvalidateResponseConverter))] public sealed partial class SamlInvalidateResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlLogoutRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlLogoutRequest.Converters.g.cs new file mode 100644 index 00000000000..e191a7f57ba --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlLogoutRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class SamlLogoutRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRefreshToken = System.Text.Json.JsonEncodedText.Encode("refresh_token"); + private static readonly System.Text.Json.JsonEncodedText PropToken = System.Text.Json.JsonEncodedText.Encode("token"); + + public override Elastic.Clients.Elasticsearch.Security.SamlLogoutRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propRefreshToken = default; + LocalJsonValue propToken = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRefreshToken.TryReadProperty(ref reader, options, PropRefreshToken, null)) + { + continue; + } + + if (propToken.TryReadProperty(ref reader, options, PropToken, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.SamlLogoutRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + RefreshToken = propRefreshToken.Value, + Token = propToken.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SamlLogoutRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRefreshToken, value.RefreshToken, null, null); + writer.WriteProperty(options, PropToken, value.Token, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlLogoutRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlLogoutRequest.g.cs index ea99f411c14..77e5893562c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlLogoutRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlLogoutRequest.g.cs @@ -27,54 +27,6 @@ public sealed partial class SamlLogoutRequestParameters : Elastic.Transport.Requ { } -internal sealed partial class SamlLogoutRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRefreshToken = System.Text.Json.JsonEncodedText.Encode("refresh_token"); - private static readonly System.Text.Json.JsonEncodedText PropToken = System.Text.Json.JsonEncodedText.Encode("token"); - - public override Elastic.Clients.Elasticsearch.Security.SamlLogoutRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propRefreshToken = default; - LocalJsonValue propToken = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRefreshToken.TryReadProperty(ref reader, options, PropRefreshToken, null)) - { - continue; - } - - if (propToken.TryReadProperty(ref reader, options, PropToken, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.SamlLogoutRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - RefreshToken = propRefreshToken.Value, - Token = propToken.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SamlLogoutRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRefreshToken, value.RefreshToken, null, null); - writer.WriteProperty(options, PropToken, value.Token, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Logout of SAML. @@ -91,7 +43,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If the SAML realm in Elasticsearch is configured accordingly and the SAML IdP supports this, the Elasticsearch response contains a URL to redirect the user to the IdP that contains a SAML logout request (starting an SP-initiated SAML Single Logout). /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.SamlLogoutRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.SamlLogoutRequestConverter))] public sealed partial class SamlLogoutRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlLogoutResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlLogoutResponse.Converters.g.cs new file mode 100644 index 00000000000..6c4eb3dbf96 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlLogoutResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class SamlLogoutResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRedirect = System.Text.Json.JsonEncodedText.Encode("redirect"); + + public override Elastic.Clients.Elasticsearch.Security.SamlLogoutResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propRedirect = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRedirect.TryReadProperty(ref reader, options, PropRedirect, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.SamlLogoutResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Redirect = propRedirect.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SamlLogoutResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRedirect, value.Redirect, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlLogoutResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlLogoutResponse.g.cs index 8885b6ed1fb..8d09ceb466e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlLogoutResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlLogoutResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class SamlLogoutResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRedirect = System.Text.Json.JsonEncodedText.Encode("redirect"); - - public override Elastic.Clients.Elasticsearch.Security.SamlLogoutResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propRedirect = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRedirect.TryReadProperty(ref reader, options, PropRedirect, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.SamlLogoutResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Redirect = propRedirect.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SamlLogoutResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRedirect, value.Redirect, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.SamlLogoutResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.SamlLogoutResponseConverter))] public sealed partial class SamlLogoutResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlPrepareAuthenticationRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlPrepareAuthenticationRequest.Converters.g.cs new file mode 100644 index 00000000000..d9cd6717f2e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlPrepareAuthenticationRequest.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class SamlPrepareAuthenticationRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcs = System.Text.Json.JsonEncodedText.Encode("acs"); + private static readonly System.Text.Json.JsonEncodedText PropRealm = System.Text.Json.JsonEncodedText.Encode("realm"); + private static readonly System.Text.Json.JsonEncodedText PropRelayState = System.Text.Json.JsonEncodedText.Encode("relay_state"); + + public override Elastic.Clients.Elasticsearch.Security.SamlPrepareAuthenticationRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcs = default; + LocalJsonValue propRealm = default; + LocalJsonValue propRelayState = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcs.TryReadProperty(ref reader, options, PropAcs, null)) + { + continue; + } + + if (propRealm.TryReadProperty(ref reader, options, PropRealm, null)) + { + continue; + } + + if (propRelayState.TryReadProperty(ref reader, options, PropRelayState, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.SamlPrepareAuthenticationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acs = propAcs.Value, + Realm = propRealm.Value, + RelayState = propRelayState.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SamlPrepareAuthenticationRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcs, value.Acs, null, null); + writer.WriteProperty(options, PropRealm, value.Realm, null, null); + writer.WriteProperty(options, PropRelayState, value.RelayState, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlPrepareAuthenticationRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlPrepareAuthenticationRequest.g.cs index d5cf82e51ac..92e555243d8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlPrepareAuthenticationRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlPrepareAuthenticationRequest.g.cs @@ -27,63 +27,6 @@ public sealed partial class SamlPrepareAuthenticationRequestParameters : Elastic { } -internal sealed partial class SamlPrepareAuthenticationRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcs = System.Text.Json.JsonEncodedText.Encode("acs"); - private static readonly System.Text.Json.JsonEncodedText PropRealm = System.Text.Json.JsonEncodedText.Encode("realm"); - private static readonly System.Text.Json.JsonEncodedText PropRelayState = System.Text.Json.JsonEncodedText.Encode("relay_state"); - - public override Elastic.Clients.Elasticsearch.Security.SamlPrepareAuthenticationRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcs = default; - LocalJsonValue propRealm = default; - LocalJsonValue propRelayState = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcs.TryReadProperty(ref reader, options, PropAcs, null)) - { - continue; - } - - if (propRealm.TryReadProperty(ref reader, options, PropRealm, null)) - { - continue; - } - - if (propRelayState.TryReadProperty(ref reader, options, PropRelayState, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.SamlPrepareAuthenticationRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acs = propAcs.Value, - Realm = propRealm.Value, - RelayState = propRelayState.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SamlPrepareAuthenticationRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcs, value.Acs, null, null); - writer.WriteProperty(options, PropRealm, value.Realm, null, null); - writer.WriteProperty(options, PropRelayState, value.RelayState, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Prepare SAML authentication. @@ -105,7 +48,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The caller of this API needs to store this identifier as it needs to be used in a following step of the authentication process. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.SamlPrepareAuthenticationRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.SamlPrepareAuthenticationRequestConverter))] public sealed partial class SamlPrepareAuthenticationRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlPrepareAuthenticationResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlPrepareAuthenticationResponse.Converters.g.cs new file mode 100644 index 00000000000..1d5956e3f5f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlPrepareAuthenticationResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class SamlPrepareAuthenticationResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropRealm = System.Text.Json.JsonEncodedText.Encode("realm"); + private static readonly System.Text.Json.JsonEncodedText PropRedirect = System.Text.Json.JsonEncodedText.Encode("redirect"); + + public override Elastic.Clients.Elasticsearch.Security.SamlPrepareAuthenticationResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propRealm = default; + LocalJsonValue propRedirect = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propRealm.TryReadProperty(ref reader, options, PropRealm, null)) + { + continue; + } + + if (propRedirect.TryReadProperty(ref reader, options, PropRedirect, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.SamlPrepareAuthenticationResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + Realm = propRealm.Value, + Redirect = propRedirect.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SamlPrepareAuthenticationResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropRealm, value.Realm, null, null); + writer.WriteProperty(options, PropRedirect, value.Redirect, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlPrepareAuthenticationResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlPrepareAuthenticationResponse.g.cs index 31c58e65ec1..f313d54a4c8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlPrepareAuthenticationResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlPrepareAuthenticationResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class SamlPrepareAuthenticationResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropRealm = System.Text.Json.JsonEncodedText.Encode("realm"); - private static readonly System.Text.Json.JsonEncodedText PropRedirect = System.Text.Json.JsonEncodedText.Encode("redirect"); - - public override Elastic.Clients.Elasticsearch.Security.SamlPrepareAuthenticationResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue propRealm = default; - LocalJsonValue propRedirect = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propRealm.TryReadProperty(ref reader, options, PropRealm, null)) - { - continue; - } - - if (propRedirect.TryReadProperty(ref reader, options, PropRedirect, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.SamlPrepareAuthenticationResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - Realm = propRealm.Value, - Redirect = propRedirect.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SamlPrepareAuthenticationResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropRealm, value.Realm, null, null); - writer.WriteProperty(options, PropRedirect, value.Redirect, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.SamlPrepareAuthenticationResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.SamlPrepareAuthenticationResponseConverter))] public sealed partial class SamlPrepareAuthenticationResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlServiceProviderMetadataRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlServiceProviderMetadataRequest.Converters.g.cs new file mode 100644 index 00000000000..e893337606a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlServiceProviderMetadataRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class SamlServiceProviderMetadataRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.SamlServiceProviderMetadataRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.SamlServiceProviderMetadataRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SamlServiceProviderMetadataRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlServiceProviderMetadataRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlServiceProviderMetadataRequest.g.cs index 75a88cd885e..c4cf3ae575a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlServiceProviderMetadataRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlServiceProviderMetadataRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class SamlServiceProviderMetadataRequestParameters : Elast { } -internal sealed partial class SamlServiceProviderMetadataRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.SamlServiceProviderMetadataRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.SamlServiceProviderMetadataRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SamlServiceProviderMetadataRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Create SAML service provider metadata. @@ -68,7 +39,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// This API generates Service Provider metadata based on the configuration of a SAML realm in Elasticsearch. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.SamlServiceProviderMetadataRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.SamlServiceProviderMetadataRequestConverter))] public sealed partial class SamlServiceProviderMetadataRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlServiceProviderMetadataResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlServiceProviderMetadataResponse.Converters.g.cs new file mode 100644 index 00000000000..c41b1f76ee4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlServiceProviderMetadataResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class SamlServiceProviderMetadataResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + + public override Elastic.Clients.Elasticsearch.Security.SamlServiceProviderMetadataResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMetadata = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.SamlServiceProviderMetadataResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Metadata = propMetadata.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SamlServiceProviderMetadataResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlServiceProviderMetadataResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlServiceProviderMetadataResponse.g.cs index 1c5c08822ed..d9fc7b254d0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlServiceProviderMetadataResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SamlServiceProviderMetadataResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class SamlServiceProviderMetadataResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - - public override Elastic.Clients.Elasticsearch.Security.SamlServiceProviderMetadataResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMetadata = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.SamlServiceProviderMetadataResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Metadata = propMetadata.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SamlServiceProviderMetadataResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.SamlServiceProviderMetadataResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.SamlServiceProviderMetadataResponseConverter))] public sealed partial class SamlServiceProviderMetadataResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SuggestUserProfilesRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SuggestUserProfilesRequest.Converters.g.cs new file mode 100644 index 00000000000..260c325d775 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SuggestUserProfilesRequest.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class SuggestUserProfilesRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropData = System.Text.Json.JsonEncodedText.Encode("data"); + private static readonly System.Text.Json.JsonEncodedText PropHint = System.Text.Json.JsonEncodedText.Encode("hint"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + + public override Elastic.Clients.Elasticsearch.Security.SuggestUserProfilesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propData = default; + LocalJsonValue propHint = default; + LocalJsonValue propName = default; + LocalJsonValue propSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propData.TryReadProperty(ref reader, options, PropData, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propHint.TryReadProperty(ref reader, options, PropHint, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.SuggestUserProfilesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Data = propData.Value, + Hint = propHint.Value, + Name = propName.Value, + Size = propSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SuggestUserProfilesRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropData, value.Data, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropHint, value.Hint, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SuggestUserProfilesRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SuggestUserProfilesRequest.g.cs index a58e6c84ac7..a9e6128de79 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SuggestUserProfilesRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SuggestUserProfilesRequest.g.cs @@ -27,72 +27,6 @@ public sealed partial class SuggestUserProfilesRequestParameters : Elastic.Trans { } -internal sealed partial class SuggestUserProfilesRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropData = System.Text.Json.JsonEncodedText.Encode("data"); - private static readonly System.Text.Json.JsonEncodedText PropHint = System.Text.Json.JsonEncodedText.Encode("hint"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - - public override Elastic.Clients.Elasticsearch.Security.SuggestUserProfilesRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propData = default; - LocalJsonValue propHint = default; - LocalJsonValue propName = default; - LocalJsonValue propSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propData.TryReadProperty(ref reader, options, PropData, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propHint.TryReadProperty(ref reader, options, PropHint, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.SuggestUserProfilesRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Data = propData.Value, - Hint = propHint.Value, - Name = propName.Value, - Size = propSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SuggestUserProfilesRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropData, value.Data, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropHint, value.Hint, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Suggest a user profile. @@ -106,7 +40,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Elastic reserves the right to change or remove this feature in future releases without prior notice. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.SuggestUserProfilesRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.SuggestUserProfilesRequestConverter))] public sealed partial class SuggestUserProfilesRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SuggestUserProfilesResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SuggestUserProfilesResponse.Converters.g.cs new file mode 100644 index 00000000000..5cd4a33ca1f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SuggestUserProfilesResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class SuggestUserProfilesResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropProfiles = System.Text.Json.JsonEncodedText.Encode("profiles"); + private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Security.SuggestUserProfilesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propProfiles = default; + LocalJsonValue propTook = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propProfiles.TryReadProperty(ref reader, options, PropProfiles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propTook.TryReadProperty(ref reader, options, PropTook, null)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.SuggestUserProfilesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Profiles = propProfiles.Value, + Took = propTook.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SuggestUserProfilesResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropProfiles, value.Profiles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTook, value.Took, null, null); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SuggestUserProfilesResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SuggestUserProfilesResponse.g.cs index 9041e8363c3..237e9d7d927 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SuggestUserProfilesResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/SuggestUserProfilesResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class SuggestUserProfilesResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropProfiles = System.Text.Json.JsonEncodedText.Encode("profiles"); - private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Security.SuggestUserProfilesResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propProfiles = default; - LocalJsonValue propTook = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propProfiles.TryReadProperty(ref reader, options, PropProfiles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propTook.TryReadProperty(ref reader, options, PropTook, null)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.SuggestUserProfilesResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Profiles = propProfiles.Value, - Took = propTook.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SuggestUserProfilesResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropProfiles, value.Profiles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTook, value.Took, null, null); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.SuggestUserProfilesResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.SuggestUserProfilesResponseConverter))] public sealed partial class SuggestUserProfilesResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateApiKeyRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateApiKeyRequest.Converters.g.cs new file mode 100644 index 00000000000..ca2a0248aef --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateApiKeyRequest.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class UpdateApiKeyRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExpiration = System.Text.Json.JsonEncodedText.Encode("expiration"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropRoleDescriptors = System.Text.Json.JsonEncodedText.Encode("role_descriptors"); + + public override Elastic.Clients.Elasticsearch.Security.UpdateApiKeyRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExpiration = default; + LocalJsonValue?> propMetadata = default; + LocalJsonValue?> propRoleDescriptors = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExpiration.TryReadProperty(ref reader, options, PropExpiration, null)) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propRoleDescriptors.TryReadProperty(ref reader, options, PropRoleDescriptors, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.UpdateApiKeyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Expiration = propExpiration.Value, + Metadata = propMetadata.Value, + RoleDescriptors = propRoleDescriptors.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UpdateApiKeyRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExpiration, value.Expiration, null, null); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropRoleDescriptors, value.RoleDescriptors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateApiKeyRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateApiKeyRequest.g.cs index 394b2e54b7a..93f6d6f437a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateApiKeyRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateApiKeyRequest.g.cs @@ -27,63 +27,6 @@ public sealed partial class UpdateApiKeyRequestParameters : Elastic.Transport.Re { } -internal sealed partial class UpdateApiKeyRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExpiration = System.Text.Json.JsonEncodedText.Encode("expiration"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropRoleDescriptors = System.Text.Json.JsonEncodedText.Encode("role_descriptors"); - - public override Elastic.Clients.Elasticsearch.Security.UpdateApiKeyRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propExpiration = default; - LocalJsonValue?> propMetadata = default; - LocalJsonValue?> propRoleDescriptors = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExpiration.TryReadProperty(ref reader, options, PropExpiration, null)) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propRoleDescriptors.TryReadProperty(ref reader, options, PropRoleDescriptors, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.UpdateApiKeyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Expiration = propExpiration.Value, - Metadata = propMetadata.Value, - RoleDescriptors = propRoleDescriptors.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UpdateApiKeyRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExpiration, value.Expiration, null, null); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropRoleDescriptors, value.RoleDescriptors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - /// /// /// Update an API key. @@ -114,7 +57,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// This change can occur if the owner user's permissions have changed since the API key was created or last modified. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.UpdateApiKeyRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.UpdateApiKeyRequestConverter))] public sealed partial class UpdateApiKeyRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateApiKeyResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateApiKeyResponse.Converters.g.cs new file mode 100644 index 00000000000..165488ae1bd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateApiKeyResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class UpdateApiKeyResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropUpdated = System.Text.Json.JsonEncodedText.Encode("updated"); + + public override Elastic.Clients.Elasticsearch.Security.UpdateApiKeyResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propUpdated = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propUpdated.TryReadProperty(ref reader, options, PropUpdated, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.UpdateApiKeyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Updated = propUpdated.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UpdateApiKeyResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropUpdated, value.Updated, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateApiKeyResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateApiKeyResponse.g.cs index ffb15fd2cae..9430539e68e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateApiKeyResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateApiKeyResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class UpdateApiKeyResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropUpdated = System.Text.Json.JsonEncodedText.Encode("updated"); - - public override Elastic.Clients.Elasticsearch.Security.UpdateApiKeyResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propUpdated = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propUpdated.TryReadProperty(ref reader, options, PropUpdated, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.UpdateApiKeyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Updated = propUpdated.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UpdateApiKeyResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropUpdated, value.Updated, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.UpdateApiKeyResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.UpdateApiKeyResponseConverter))] public sealed partial class UpdateApiKeyResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateCrossClusterApiKeyRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateCrossClusterApiKeyRequest.Converters.g.cs new file mode 100644 index 00000000000..afa0ed8675f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateCrossClusterApiKeyRequest.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class UpdateCrossClusterApiKeyRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAccess = System.Text.Json.JsonEncodedText.Encode("access"); + private static readonly System.Text.Json.JsonEncodedText PropExpiration = System.Text.Json.JsonEncodedText.Encode("expiration"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + + public override Elastic.Clients.Elasticsearch.Security.UpdateCrossClusterApiKeyRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAccess = default; + LocalJsonValue propExpiration = default; + LocalJsonValue?> propMetadata = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAccess.TryReadProperty(ref reader, options, PropAccess, null)) + { + continue; + } + + if (propExpiration.TryReadProperty(ref reader, options, PropExpiration, null)) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.UpdateCrossClusterApiKeyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Access = propAccess.Value, + Expiration = propExpiration.Value, + Metadata = propMetadata.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UpdateCrossClusterApiKeyRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAccess, value.Access, null, null); + writer.WriteProperty(options, PropExpiration, value.Expiration, null, null); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateCrossClusterApiKeyRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateCrossClusterApiKeyRequest.g.cs index 9357ed7ed7c..cf7beab0e33 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateCrossClusterApiKeyRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateCrossClusterApiKeyRequest.g.cs @@ -27,63 +27,6 @@ public sealed partial class UpdateCrossClusterApiKeyRequestParameters : Elastic. { } -internal sealed partial class UpdateCrossClusterApiKeyRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAccess = System.Text.Json.JsonEncodedText.Encode("access"); - private static readonly System.Text.Json.JsonEncodedText PropExpiration = System.Text.Json.JsonEncodedText.Encode("expiration"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - - public override Elastic.Clients.Elasticsearch.Security.UpdateCrossClusterApiKeyRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAccess = default; - LocalJsonValue propExpiration = default; - LocalJsonValue?> propMetadata = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAccess.TryReadProperty(ref reader, options, PropAccess, null)) - { - continue; - } - - if (propExpiration.TryReadProperty(ref reader, options, PropExpiration, null)) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.UpdateCrossClusterApiKeyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Access = propAccess.Value, - Expiration = propExpiration.Value, - Metadata = propMetadata.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UpdateCrossClusterApiKeyRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAccess, value.Access, null, null); - writer.WriteProperty(options, PropExpiration, value.Expiration, null, null); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - /// /// /// Update a cross-cluster API key. @@ -114,7 +57,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// To learn more about how to use this API, refer to the Update cross cluter API key API examples page. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.UpdateCrossClusterApiKeyRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.UpdateCrossClusterApiKeyRequestConverter))] public sealed partial class UpdateCrossClusterApiKeyRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateCrossClusterApiKeyResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateCrossClusterApiKeyResponse.Converters.g.cs new file mode 100644 index 00000000000..44ffa4af097 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateCrossClusterApiKeyResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class UpdateCrossClusterApiKeyResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropUpdated = System.Text.Json.JsonEncodedText.Encode("updated"); + + public override Elastic.Clients.Elasticsearch.Security.UpdateCrossClusterApiKeyResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propUpdated = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propUpdated.TryReadProperty(ref reader, options, PropUpdated, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.UpdateCrossClusterApiKeyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Updated = propUpdated.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UpdateCrossClusterApiKeyResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropUpdated, value.Updated, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateCrossClusterApiKeyResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateCrossClusterApiKeyResponse.g.cs index b6cbb297917..a1ed0ea1029 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateCrossClusterApiKeyResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateCrossClusterApiKeyResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class UpdateCrossClusterApiKeyResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropUpdated = System.Text.Json.JsonEncodedText.Encode("updated"); - - public override Elastic.Clients.Elasticsearch.Security.UpdateCrossClusterApiKeyResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propUpdated = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propUpdated.TryReadProperty(ref reader, options, PropUpdated, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.UpdateCrossClusterApiKeyResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Updated = propUpdated.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UpdateCrossClusterApiKeyResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropUpdated, value.Updated, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.UpdateCrossClusterApiKeyResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.UpdateCrossClusterApiKeyResponseConverter))] public sealed partial class UpdateCrossClusterApiKeyResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateSettingsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateSettingsRequest.Converters.g.cs new file mode 100644 index 00000000000..be136d915c8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateSettingsRequest.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class UpdateSettingsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSecurity = System.Text.Json.JsonEncodedText.Encode("security"); + private static readonly System.Text.Json.JsonEncodedText PropSecurityProfile = System.Text.Json.JsonEncodedText.Encode("security-profile"); + private static readonly System.Text.Json.JsonEncodedText PropSecurityTokens = System.Text.Json.JsonEncodedText.Encode("security-tokens"); + + public override Elastic.Clients.Elasticsearch.Security.UpdateSettingsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propSecurity = default; + LocalJsonValue propSecurityProfile = default; + LocalJsonValue propSecurityTokens = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSecurity.TryReadProperty(ref reader, options, PropSecurity, null)) + { + continue; + } + + if (propSecurityProfile.TryReadProperty(ref reader, options, PropSecurityProfile, null)) + { + continue; + } + + if (propSecurityTokens.TryReadProperty(ref reader, options, PropSecurityTokens, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.UpdateSettingsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Security = propSecurity.Value, + SecurityProfile = propSecurityProfile.Value, + SecurityTokens = propSecurityTokens.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UpdateSettingsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSecurity, value.Security, null, null); + writer.WriteProperty(options, PropSecurityProfile, value.SecurityProfile, null, null); + writer.WriteProperty(options, PropSecurityTokens, value.SecurityTokens, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateSettingsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateSettingsRequest.g.cs index 93fa32204f6..56de5c089af 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateSettingsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateSettingsRequest.g.cs @@ -42,63 +42,6 @@ public sealed partial class UpdateSettingsRequestParameters : Elastic.Transport. public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class UpdateSettingsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSecurity = System.Text.Json.JsonEncodedText.Encode("security"); - private static readonly System.Text.Json.JsonEncodedText PropSecurityProfile = System.Text.Json.JsonEncodedText.Encode("security-profile"); - private static readonly System.Text.Json.JsonEncodedText PropSecurityTokens = System.Text.Json.JsonEncodedText.Encode("security-tokens"); - - public override Elastic.Clients.Elasticsearch.Security.UpdateSettingsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propSecurity = default; - LocalJsonValue propSecurityProfile = default; - LocalJsonValue propSecurityTokens = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSecurity.TryReadProperty(ref reader, options, PropSecurity, null)) - { - continue; - } - - if (propSecurityProfile.TryReadProperty(ref reader, options, PropSecurityProfile, null)) - { - continue; - } - - if (propSecurityTokens.TryReadProperty(ref reader, options, PropSecurityTokens, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.UpdateSettingsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Security = propSecurity.Value, - SecurityProfile = propSecurityProfile.Value, - SecurityTokens = propSecurityTokens.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UpdateSettingsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSecurity, value.Security, null, null); - writer.WriteProperty(options, PropSecurityProfile, value.SecurityProfile, null, null); - writer.WriteProperty(options, PropSecurityTokens, value.SecurityTokens, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Update security index settings. @@ -114,7 +57,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// This API does not yet support configuring the settings for indices before they are in use. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.UpdateSettingsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.UpdateSettingsRequestConverter))] public sealed partial class UpdateSettingsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateSettingsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateSettingsResponse.Converters.g.cs new file mode 100644 index 00000000000..4c54b3f573e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateSettingsResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class UpdateSettingsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.Security.UpdateSettingsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.UpdateSettingsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UpdateSettingsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateSettingsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateSettingsResponse.g.cs index 97bcf534560..f912a9a2314 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateSettingsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateSettingsResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class UpdateSettingsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.Security.UpdateSettingsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.UpdateSettingsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UpdateSettingsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.UpdateSettingsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.UpdateSettingsResponseConverter))] public sealed partial class UpdateSettingsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal UpdateSettingsResponse(Elastic.Clients.Elasticsearch.Serialization.Json public #if NET7_0_OR_GREATER - required +required #endif - bool Acknowledged { get; set; } +bool Acknowledged { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateUserProfileDataRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateUserProfileDataRequest.Converters.g.cs new file mode 100644 index 00000000000..dc450595305 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateUserProfileDataRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class UpdateUserProfileDataRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropData = System.Text.Json.JsonEncodedText.Encode("data"); + private static readonly System.Text.Json.JsonEncodedText PropLabels = System.Text.Json.JsonEncodedText.Encode("labels"); + + public override Elastic.Clients.Elasticsearch.Security.UpdateUserProfileDataRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propData = default; + LocalJsonValue?> propLabels = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propData.TryReadProperty(ref reader, options, PropData, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propLabels.TryReadProperty(ref reader, options, PropLabels, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.UpdateUserProfileDataRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Data = propData.Value, + Labels = propLabels.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UpdateUserProfileDataRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropData, value.Data, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropLabels, value.Labels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateUserProfileDataRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateUserProfileDataRequest.g.cs index 089ccfae297..dbee1154907 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateUserProfileDataRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateUserProfileDataRequest.g.cs @@ -50,54 +50,6 @@ public sealed partial class UpdateUserProfileDataRequestParameters : Elastic.Tra public Elastic.Clients.Elasticsearch.Refresh? Refresh { get => Q("refresh"); set => Q("refresh", value); } } -internal sealed partial class UpdateUserProfileDataRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropData = System.Text.Json.JsonEncodedText.Encode("data"); - private static readonly System.Text.Json.JsonEncodedText PropLabels = System.Text.Json.JsonEncodedText.Encode("labels"); - - public override Elastic.Clients.Elasticsearch.Security.UpdateUserProfileDataRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propData = default; - LocalJsonValue?> propLabels = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propData.TryReadProperty(ref reader, options, PropData, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propLabels.TryReadProperty(ref reader, options, PropLabels, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.UpdateUserProfileDataRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Data = propData.Value, - Labels = propLabels.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UpdateUserProfileDataRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropData, value.Data, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropLabels, value.Labels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - /// /// /// Update user profile data. @@ -134,7 +86,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The update_profile_data global privilege grants privileges for updating only the allowed namespaces. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.UpdateUserProfileDataRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.UpdateUserProfileDataRequestConverter))] public sealed partial class UpdateUserProfileDataRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateUserProfileDataResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateUserProfileDataResponse.Converters.g.cs new file mode 100644 index 00000000000..dde190358c9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateUserProfileDataResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class UpdateUserProfileDataResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.Security.UpdateUserProfileDataResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.UpdateUserProfileDataResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UpdateUserProfileDataResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateUserProfileDataResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateUserProfileDataResponse.g.cs index 3e1262969e8..4ceb39ac2d8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateUserProfileDataResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateUserProfileDataResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class UpdateUserProfileDataResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.Security.UpdateUserProfileDataResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.UpdateUserProfileDataResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UpdateUserProfileDataResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.UpdateUserProfileDataResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.UpdateUserProfileDataResponseConverter))] public sealed partial class UpdateUserProfileDataResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Simulate/IngestRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Simulate/IngestRequest.Converters.g.cs new file mode 100644 index 00000000000..6fa6289d364 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Simulate/IngestRequest.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Simulate.Json; + +public sealed partial class IngestRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropComponentTemplateSubstitutions = System.Text.Json.JsonEncodedText.Encode("component_template_substitutions"); + private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); + private static readonly System.Text.Json.JsonEncodedText PropIndexTemplateSubstitutions = System.Text.Json.JsonEncodedText.Encode("index_template_substitutions"); + private static readonly System.Text.Json.JsonEncodedText PropMappingAddition = System.Text.Json.JsonEncodedText.Encode("mapping_addition"); + private static readonly System.Text.Json.JsonEncodedText PropPipelineSubstitutions = System.Text.Json.JsonEncodedText.Encode("pipeline_substitutions"); + + public override Elastic.Clients.Elasticsearch.Simulate.IngestRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propComponentTemplateSubstitutions = default; + LocalJsonValue> propDocs = default; + LocalJsonValue?> propIndexTemplateSubstitutions = default; + LocalJsonValue propMappingAddition = default; + LocalJsonValue?> propPipelineSubstitutions = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propComponentTemplateSubstitutions.TryReadProperty(ref reader, options, PropComponentTemplateSubstitutions, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propDocs.TryReadProperty(ref reader, options, PropDocs, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propIndexTemplateSubstitutions.TryReadProperty(ref reader, options, PropIndexTemplateSubstitutions, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propMappingAddition.TryReadProperty(ref reader, options, PropMappingAddition, null)) + { + continue; + } + + if (propPipelineSubstitutions.TryReadProperty(ref reader, options, PropPipelineSubstitutions, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Simulate.IngestRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ComponentTemplateSubstitutions = propComponentTemplateSubstitutions.Value, + Docs = propDocs.Value, + IndexTemplateSubstitutions = propIndexTemplateSubstitutions.Value, + MappingAddition = propMappingAddition.Value, + PipelineSubstitutions = propPipelineSubstitutions.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Simulate.IngestRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropComponentTemplateSubstitutions, value.ComponentTemplateSubstitutions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropDocs, value.Docs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIndexTemplateSubstitutions, value.IndexTemplateSubstitutions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropMappingAddition, value.MappingAddition, null, null); + writer.WriteProperty(options, PropPipelineSubstitutions, value.PipelineSubstitutions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Simulate/IngestRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Simulate/IngestRequest.g.cs index 06a55cf1ada..d01a6546fc5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Simulate/IngestRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Simulate/IngestRequest.g.cs @@ -25,6 +25,16 @@ namespace Elastic.Clients.Elasticsearch.Simulate; public sealed partial class IngestRequestParameters : Elastic.Transport.RequestParameters { + /// + /// + /// The mapping merge type if mapping overrides are being provided in mapping_addition. + /// The allowed values are one of index or template. + /// The index option merges mappings the way they would be merged into an existing index. + /// The template option merges mappings the way they would be merged into a template. + /// + /// + public Elastic.Clients.Elasticsearch.Simulate.MergeType? MergeType { get => Q("merge_type"); set => Q("merge_type", value); } + /// /// /// The pipeline to use as the default pipeline. @@ -34,81 +44,6 @@ public sealed partial class IngestRequestParameters : Elastic.Transport.RequestP public string? Pipeline { get => Q("pipeline"); set => Q("pipeline", value); } } -internal sealed partial class IngestRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropComponentTemplateSubstitutions = System.Text.Json.JsonEncodedText.Encode("component_template_substitutions"); - private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); - private static readonly System.Text.Json.JsonEncodedText PropIndexTemplateSubstitutions = System.Text.Json.JsonEncodedText.Encode("index_template_substitutions"); - private static readonly System.Text.Json.JsonEncodedText PropMappingAddition = System.Text.Json.JsonEncodedText.Encode("mapping_addition"); - private static readonly System.Text.Json.JsonEncodedText PropPipelineSubstitutions = System.Text.Json.JsonEncodedText.Encode("pipeline_substitutions"); - - public override Elastic.Clients.Elasticsearch.Simulate.IngestRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propComponentTemplateSubstitutions = default; - LocalJsonValue> propDocs = default; - LocalJsonValue?> propIndexTemplateSubstitutions = default; - LocalJsonValue propMappingAddition = default; - LocalJsonValue?> propPipelineSubstitutions = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propComponentTemplateSubstitutions.TryReadProperty(ref reader, options, PropComponentTemplateSubstitutions, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propDocs.TryReadProperty(ref reader, options, PropDocs, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propIndexTemplateSubstitutions.TryReadProperty(ref reader, options, PropIndexTemplateSubstitutions, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propMappingAddition.TryReadProperty(ref reader, options, PropMappingAddition, null)) - { - continue; - } - - if (propPipelineSubstitutions.TryReadProperty(ref reader, options, PropPipelineSubstitutions, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Simulate.IngestRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ComponentTemplateSubstitutions = propComponentTemplateSubstitutions.Value, - Docs = propDocs.Value, - IndexTemplateSubstitutions = propIndexTemplateSubstitutions.Value, - MappingAddition = propMappingAddition.Value, - PipelineSubstitutions = propPipelineSubstitutions.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Simulate.IngestRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropComponentTemplateSubstitutions, value.ComponentTemplateSubstitutions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropDocs, value.Docs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIndexTemplateSubstitutions, value.IndexTemplateSubstitutions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropMappingAddition, value.MappingAddition, null, null); - writer.WriteProperty(options, PropPipelineSubstitutions, value.PipelineSubstitutions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - /// /// /// Simulate data ingestion. @@ -134,7 +69,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// These will be used in place of the pipeline definitions that are already in the system. This can be used to replace existing pipeline definitions or to create new ones. The pipeline substitutions are used only within this request. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Simulate.IngestRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Simulate.Json.IngestRequestConverter))] public sealed partial class IngestRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] @@ -188,6 +123,16 @@ internal IngestRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstruct /// public Elastic.Clients.Elasticsearch.IndexName? Index { get => P("index"); set => PO("index", value); } + /// + /// + /// The mapping merge type if mapping overrides are being provided in mapping_addition. + /// The allowed values are one of index or template. + /// The index option merges mappings the way they would be merged into an existing index. + /// The template option merges mappings the way they would be merged into a template. + /// + /// + public Elastic.Clients.Elasticsearch.Simulate.MergeType? MergeType { get => Q("merge_type"); set => Q("merge_type", value); } + /// /// /// The pipeline to use as the default pipeline. @@ -295,6 +240,20 @@ public Elastic.Clients.Elasticsearch.Simulate.IngestRequestDescriptor Index(Elas return this; } + /// + /// + /// The mapping merge type if mapping overrides are being provided in mapping_addition. + /// The allowed values are one of index or template. + /// The index option merges mappings the way they would be merged into an existing index. + /// The template option merges mappings the way they would be merged into a template. + /// + /// + public Elastic.Clients.Elasticsearch.Simulate.IngestRequestDescriptor MergeType(Elastic.Clients.Elasticsearch.Simulate.MergeType? value) + { + Instance.MergeType = value; + return this; + } + /// /// /// The pipeline to use as the default pipeline. @@ -728,6 +687,20 @@ public Elastic.Clients.Elasticsearch.Simulate.IngestRequestDescriptor return this; } + /// + /// + /// The mapping merge type if mapping overrides are being provided in mapping_addition. + /// The allowed values are one of index or template. + /// The index option merges mappings the way they would be merged into an existing index. + /// The template option merges mappings the way they would be merged into a template. + /// + /// + public Elastic.Clients.Elasticsearch.Simulate.IngestRequestDescriptor MergeType(Elastic.Clients.Elasticsearch.Simulate.MergeType? value) + { + Instance.MergeType = value; + return this; + } + /// /// /// The pipeline to use as the default pipeline. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Simulate/IngestResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Simulate/IngestResponse.Converters.g.cs new file mode 100644 index 00000000000..246335c760e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Simulate/IngestResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Simulate.Json; + +public sealed partial class IngestResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); + + public override Elastic.Clients.Elasticsearch.Simulate.IngestResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propDocs = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocs.TryReadProperty(ref reader, options, PropDocs, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Simulate.IngestResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Docs = propDocs.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Simulate.IngestResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocs, value.Docs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Simulate/IngestResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Simulate/IngestResponse.g.cs index 771544287aa..fc57fec0b13 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Simulate/IngestResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Simulate/IngestResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Simulate; -internal sealed partial class IngestResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); - - public override Elastic.Clients.Elasticsearch.Simulate.IngestResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propDocs = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocs.TryReadProperty(ref reader, options, PropDocs, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Simulate.IngestResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Docs = propDocs.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Simulate.IngestResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocs, value.Docs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Simulate.IngestResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Simulate.Json.IngestResponseConverter))] public sealed partial class IngestResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal IngestResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstruc public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Docs { get; set; } +System.Collections.Generic.IReadOnlyCollection Docs { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CleanupRepositoryRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CleanupRepositoryRequest.Converters.g.cs new file mode 100644 index 00000000000..b31726ce55f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CleanupRepositoryRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class CleanupRepositoryRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Snapshot.CleanupRepositoryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.CleanupRepositoryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.CleanupRepositoryRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CleanupRepositoryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CleanupRepositoryRequest.g.cs index f0d61779324..e66d8da26d1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CleanupRepositoryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CleanupRepositoryRequest.g.cs @@ -44,42 +44,13 @@ public sealed partial class CleanupRepositoryRequestParameters : Elastic.Transpo public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class CleanupRepositoryRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Snapshot.CleanupRepositoryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.CleanupRepositoryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.CleanupRepositoryRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Clean up the snapshot repository. /// Trigger the review of the contents of a snapshot repository and delete any stale data not referenced by existing snapshots. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.CleanupRepositoryRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.CleanupRepositoryRequestConverter))] public sealed partial class CleanupRepositoryRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CleanupRepositoryResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CleanupRepositoryResponse.Converters.g.cs new file mode 100644 index 00000000000..d84c8c11764 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CleanupRepositoryResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class CleanupRepositoryResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropResults = System.Text.Json.JsonEncodedText.Encode("results"); + + public override Elastic.Clients.Elasticsearch.Snapshot.CleanupRepositoryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propResults = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propResults.TryReadProperty(ref reader, options, PropResults, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.CleanupRepositoryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Results = propResults.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.CleanupRepositoryResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropResults, value.Results, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CleanupRepositoryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CleanupRepositoryResponse.g.cs index 832a07dbe99..3cba05f2261 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CleanupRepositoryResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CleanupRepositoryResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class CleanupRepositoryResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropResults = System.Text.Json.JsonEncodedText.Encode("results"); - - public override Elastic.Clients.Elasticsearch.Snapshot.CleanupRepositoryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propResults = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propResults.TryReadProperty(ref reader, options, PropResults, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.CleanupRepositoryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Results = propResults.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.CleanupRepositoryResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropResults, value.Results, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.CleanupRepositoryResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.CleanupRepositoryResponseConverter))] public sealed partial class CleanupRepositoryResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CloneSnapshotRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CloneSnapshotRequest.Converters.g.cs new file mode 100644 index 00000000000..c13d35333e6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CloneSnapshotRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class CloneSnapshotRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + + public override Elastic.Clients.Elasticsearch.Snapshot.CloneSnapshotRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndices = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.CloneSnapshotRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Indices = propIndices.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.CloneSnapshotRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndices, value.Indices, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CloneSnapshotRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CloneSnapshotRequest.g.cs index a233ae0251c..ad917fda58d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CloneSnapshotRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CloneSnapshotRequest.g.cs @@ -35,52 +35,13 @@ public sealed partial class CloneSnapshotRequestParameters : Elastic.Transport.R public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class CloneSnapshotRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - - public override Elastic.Clients.Elasticsearch.Snapshot.CloneSnapshotRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndices = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.CloneSnapshotRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Indices = propIndices.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.CloneSnapshotRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndices, value.Indices, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Clone a snapshot. /// Clone part of all of a snapshot into another snapshot in the same repository. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.CloneSnapshotRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.CloneSnapshotRequestConverter))] public sealed partial class CloneSnapshotRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CloneSnapshotResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CloneSnapshotResponse.Converters.g.cs new file mode 100644 index 00000000000..813e119f9b7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CloneSnapshotResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class CloneSnapshotResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.Snapshot.CloneSnapshotResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.CloneSnapshotResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.CloneSnapshotResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CloneSnapshotResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CloneSnapshotResponse.g.cs index 4a82edf220d..7731f1c90fd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CloneSnapshotResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CloneSnapshotResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class CloneSnapshotResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.Snapshot.CloneSnapshotResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.CloneSnapshotResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.CloneSnapshotResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.CloneSnapshotResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.CloneSnapshotResponseConverter))] public sealed partial class CloneSnapshotResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateRepositoryRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateRepositoryRequest.Converters.g.cs new file mode 100644 index 00000000000..bf71a409c8c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateRepositoryRequest.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class CreateRepositoryRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Snapshot.CreateRepositoryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Snapshot.CreateRepositoryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Repository = reader.ReadValue(options, null) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.CreateRepositoryRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Repository, null); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateRepositoryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateRepositoryRequest.g.cs index d6c38ee0690..4d511b2ca45 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateRepositoryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateRepositoryRequest.g.cs @@ -53,19 +53,6 @@ public sealed partial class CreateRepositoryRequestParameters : Elastic.Transpor public bool? Verify { get => Q("verify"); set => Q("verify", value); } } -internal sealed partial class CreateRepositoryRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Snapshot.CreateRepositoryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Snapshot.CreateRepositoryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Repository = reader.ReadValue(options, null) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.CreateRepositoryRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Repository, null); - } -} - /// /// /// Create or update a snapshot repository. @@ -78,7 +65,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If both parameters are specified, only the query parameter is used. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.CreateRepositoryRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.CreateRepositoryRequestConverter))] public sealed partial class CreateRepositoryRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateRepositoryResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateRepositoryResponse.Converters.g.cs new file mode 100644 index 00000000000..e5f099da7d4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateRepositoryResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class CreateRepositoryResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.Snapshot.CreateRepositoryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.CreateRepositoryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.CreateRepositoryResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateRepositoryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateRepositoryResponse.g.cs index 81832fea679..9e284a377a4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateRepositoryResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateRepositoryResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class CreateRepositoryResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.Snapshot.CreateRepositoryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.CreateRepositoryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.CreateRepositoryResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.CreateRepositoryResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.CreateRepositoryResponseConverter))] public sealed partial class CreateRepositoryResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateSnapshotRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateSnapshotRequest.Converters.g.cs new file mode 100644 index 00000000000..d0ad09727f9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateSnapshotRequest.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class CreateSnapshotRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExpandWildcards = System.Text.Json.JsonEncodedText.Encode("expand_wildcards"); + private static readonly System.Text.Json.JsonEncodedText PropFeatureStates = System.Text.Json.JsonEncodedText.Encode("feature_states"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnavailable = System.Text.Json.JsonEncodedText.Encode("ignore_unavailable"); + private static readonly System.Text.Json.JsonEncodedText PropIncludeGlobalState = System.Text.Json.JsonEncodedText.Encode("include_global_state"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropPartial = System.Text.Json.JsonEncodedText.Encode("partial"); + + public override Elastic.Clients.Elasticsearch.Snapshot.CreateSnapshotRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propExpandWildcards = default; + LocalJsonValue?> propFeatureStates = default; + LocalJsonValue propIgnoreUnavailable = default; + LocalJsonValue propIncludeGlobalState = default; + LocalJsonValue propIndices = default; + LocalJsonValue?> propMetadata = default; + LocalJsonValue propPartial = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExpandWildcards.TryReadProperty(ref reader, options, PropExpandWildcards, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propFeatureStates.TryReadProperty(ref reader, options, PropFeatureStates, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propIgnoreUnavailable.TryReadProperty(ref reader, options, PropIgnoreUnavailable, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIncludeGlobalState.TryReadProperty(ref reader, options, PropIncludeGlobalState, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propPartial.TryReadProperty(ref reader, options, PropPartial, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.CreateSnapshotRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ExpandWildcards = propExpandWildcards.Value, + FeatureStates = propFeatureStates.Value, + IgnoreUnavailable = propIgnoreUnavailable.Value, + IncludeGlobalState = propIncludeGlobalState.Value, + Indices = propIndices.Value, + Metadata = propMetadata.Value, + Partial = propPartial.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.CreateSnapshotRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExpandWildcards, value.ExpandWildcards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFeatureStates, value.FeatureStates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIgnoreUnavailable, value.IgnoreUnavailable, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIncludeGlobalState, value.IncludeGlobalState, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndices, value.Indices, null, null); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropPartial, value.Partial, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateSnapshotRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateSnapshotRequest.g.cs index ed08a02016d..4f3adc76699 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateSnapshotRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateSnapshotRequest.g.cs @@ -42,106 +42,13 @@ public sealed partial class CreateSnapshotRequestParameters : Elastic.Transport. public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } } -internal sealed partial class CreateSnapshotRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExpandWildcards = System.Text.Json.JsonEncodedText.Encode("expand_wildcards"); - private static readonly System.Text.Json.JsonEncodedText PropFeatureStates = System.Text.Json.JsonEncodedText.Encode("feature_states"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnavailable = System.Text.Json.JsonEncodedText.Encode("ignore_unavailable"); - private static readonly System.Text.Json.JsonEncodedText PropIncludeGlobalState = System.Text.Json.JsonEncodedText.Encode("include_global_state"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropPartial = System.Text.Json.JsonEncodedText.Encode("partial"); - - public override Elastic.Clients.Elasticsearch.Snapshot.CreateSnapshotRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propExpandWildcards = default; - LocalJsonValue?> propFeatureStates = default; - LocalJsonValue propIgnoreUnavailable = default; - LocalJsonValue propIncludeGlobalState = default; - LocalJsonValue propIndices = default; - LocalJsonValue?> propMetadata = default; - LocalJsonValue propPartial = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExpandWildcards.TryReadProperty(ref reader, options, PropExpandWildcards, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propFeatureStates.TryReadProperty(ref reader, options, PropFeatureStates, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propIgnoreUnavailable.TryReadProperty(ref reader, options, PropIgnoreUnavailable, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIncludeGlobalState.TryReadProperty(ref reader, options, PropIncludeGlobalState, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propPartial.TryReadProperty(ref reader, options, PropPartial, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.CreateSnapshotRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ExpandWildcards = propExpandWildcards.Value, - FeatureStates = propFeatureStates.Value, - IgnoreUnavailable = propIgnoreUnavailable.Value, - IncludeGlobalState = propIncludeGlobalState.Value, - Indices = propIndices.Value, - Metadata = propMetadata.Value, - Partial = propPartial.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.CreateSnapshotRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExpandWildcards, value.ExpandWildcards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFeatureStates, value.FeatureStates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIgnoreUnavailable, value.IgnoreUnavailable, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIncludeGlobalState, value.IncludeGlobalState, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndices, value.Indices, null, null); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropPartial, value.Partial, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Create a snapshot. /// Take a snapshot of a cluster or of data streams and indices. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.CreateSnapshotRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.CreateSnapshotRequestConverter))] public sealed partial class CreateSnapshotRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateSnapshotResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateSnapshotResponse.Converters.g.cs new file mode 100644 index 00000000000..0542f818423 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateSnapshotResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class CreateSnapshotResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAccepted = System.Text.Json.JsonEncodedText.Encode("accepted"); + private static readonly System.Text.Json.JsonEncodedText PropSnapshot = System.Text.Json.JsonEncodedText.Encode("snapshot"); + + public override Elastic.Clients.Elasticsearch.Snapshot.CreateSnapshotResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAccepted = default; + LocalJsonValue propSnapshot = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAccepted.TryReadProperty(ref reader, options, PropAccepted, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSnapshot.TryReadProperty(ref reader, options, PropSnapshot, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.CreateSnapshotResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Accepted = propAccepted.Value, + Snapshot = propSnapshot.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.CreateSnapshotResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAccepted, value.Accepted, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSnapshot, value.Snapshot, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateSnapshotResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateSnapshotResponse.g.cs index 70286996b8c..0fbcde1beb4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateSnapshotResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/CreateSnapshotResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class CreateSnapshotResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAccepted = System.Text.Json.JsonEncodedText.Encode("accepted"); - private static readonly System.Text.Json.JsonEncodedText PropSnapshot = System.Text.Json.JsonEncodedText.Encode("snapshot"); - - public override Elastic.Clients.Elasticsearch.Snapshot.CreateSnapshotResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAccepted = default; - LocalJsonValue propSnapshot = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAccepted.TryReadProperty(ref reader, options, PropAccepted, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSnapshot.TryReadProperty(ref reader, options, PropSnapshot, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.CreateSnapshotResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Accepted = propAccepted.Value, - Snapshot = propSnapshot.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.CreateSnapshotResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAccepted, value.Accepted, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSnapshot, value.Snapshot, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.CreateSnapshotResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.CreateSnapshotResponseConverter))] public sealed partial class CreateSnapshotResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteRepositoryRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteRepositoryRequest.Converters.g.cs new file mode 100644 index 00000000000..c08560d09b6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteRepositoryRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class DeleteRepositoryRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Snapshot.DeleteRepositoryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.DeleteRepositoryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.DeleteRepositoryRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteRepositoryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteRepositoryRequest.g.cs index f08c12b81a6..82d9ccb2a7a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteRepositoryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteRepositoryRequest.g.cs @@ -44,35 +44,6 @@ public sealed partial class DeleteRepositoryRequestParameters : Elastic.Transpor public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class DeleteRepositoryRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Snapshot.DeleteRepositoryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.DeleteRepositoryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.DeleteRepositoryRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete snapshot repositories. @@ -80,7 +51,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The snapshots themselves are left untouched and in place. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.DeleteRepositoryRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.DeleteRepositoryRequestConverter))] public sealed partial class DeleteRepositoryRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteRepositoryResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteRepositoryResponse.Converters.g.cs new file mode 100644 index 00000000000..c78f4b25739 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteRepositoryResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class DeleteRepositoryResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.Snapshot.DeleteRepositoryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.DeleteRepositoryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.DeleteRepositoryResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteRepositoryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteRepositoryResponse.g.cs index f079ff9078e..964f22939d8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteRepositoryResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteRepositoryResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class DeleteRepositoryResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.Snapshot.DeleteRepositoryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.DeleteRepositoryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.DeleteRepositoryResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.DeleteRepositoryResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.DeleteRepositoryResponseConverter))] public sealed partial class DeleteRepositoryResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteSnapshotRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteSnapshotRequest.Converters.g.cs new file mode 100644 index 00000000000..c9299afa0cd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteSnapshotRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class DeleteSnapshotRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Snapshot.DeleteSnapshotRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.DeleteSnapshotRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.DeleteSnapshotRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteSnapshotRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteSnapshotRequest.g.cs index aefbc87e0e4..e425c1d3cd1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteSnapshotRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteSnapshotRequest.g.cs @@ -43,41 +43,12 @@ public sealed partial class DeleteSnapshotRequestParameters : Elastic.Transport. public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } } -internal sealed partial class DeleteSnapshotRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Snapshot.DeleteSnapshotRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.DeleteSnapshotRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.DeleteSnapshotRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete snapshots. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.DeleteSnapshotRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.DeleteSnapshotRequestConverter))] public sealed partial class DeleteSnapshotRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteSnapshotResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteSnapshotResponse.Converters.g.cs new file mode 100644 index 00000000000..d8895e16568 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteSnapshotResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class DeleteSnapshotResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.Snapshot.DeleteSnapshotResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.DeleteSnapshotResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.DeleteSnapshotResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteSnapshotResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteSnapshotResponse.g.cs index 0c961154280..0b6a21efdbe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteSnapshotResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/DeleteSnapshotResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class DeleteSnapshotResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.Snapshot.DeleteSnapshotResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.DeleteSnapshotResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.DeleteSnapshotResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.DeleteSnapshotResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.DeleteSnapshotResponseConverter))] public sealed partial class DeleteSnapshotResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetRepositoryRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetRepositoryRequest.Converters.g.cs new file mode 100644 index 00000000000..2b95f20100a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetRepositoryRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class GetRepositoryRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Snapshot.GetRepositoryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.GetRepositoryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.GetRepositoryRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetRepositoryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetRepositoryRequest.g.cs index dd3a91c2b9f..a35268b5c83 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetRepositoryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetRepositoryRequest.g.cs @@ -43,41 +43,12 @@ public sealed partial class GetRepositoryRequestParameters : Elastic.Transport.R public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class GetRepositoryRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Snapshot.GetRepositoryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.GetRepositoryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.GetRepositoryRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get snapshot repository information. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.GetRepositoryRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.GetRepositoryRequestConverter))] public sealed partial class GetRepositoryRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetRepositoryRequest(Elastic.Clients.Elasticsearch.Names? name) : base(r => r.Optional("repository", name)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetRepositoryResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetRepositoryResponse.Converters.g.cs new file mode 100644 index 00000000000..9b482d7407a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetRepositoryResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class GetRepositoryResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Snapshot.GetRepositoryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Snapshot.GetRepositoryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Repositories = reader.ReadValue(options, null) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.GetRepositoryResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Repositories, null); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetRepositoryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetRepositoryResponse.g.cs index d905bdabc2c..5fb22f29f0e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetRepositoryResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetRepositoryResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class GetRepositoryResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Snapshot.GetRepositoryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Snapshot.GetRepositoryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Repositories = reader.ReadValue(options, null) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.GetRepositoryResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Repositories, null); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.GetRepositoryResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.GetRepositoryResponseConverter))] public sealed partial class GetRepositoryResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetSnapshotRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetSnapshotRequest.Converters.g.cs new file mode 100644 index 00000000000..344bcda62fa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetSnapshotRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class GetSnapshotRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Snapshot.GetSnapshotRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.GetSnapshotRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.GetSnapshotRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetSnapshotRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetSnapshotRequest.g.cs index bffd16d6e45..0f7626ff5bc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetSnapshotRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetSnapshotRequest.g.cs @@ -142,35 +142,6 @@ public sealed partial class GetSnapshotRequestParameters : Elastic.Transport.Req public bool? Verbose { get => Q("verbose"); set => Q("verbose", value); } } -internal sealed partial class GetSnapshotRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Snapshot.GetSnapshotRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.GetSnapshotRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.GetSnapshotRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get snapshot information. @@ -181,7 +152,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Snapshots concurrently created may be seen during an iteration. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.GetSnapshotRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.GetSnapshotRequestConverter))] public sealed partial class GetSnapshotRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetSnapshotResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetSnapshotResponse.Converters.g.cs new file mode 100644 index 00000000000..09cca0cabdc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetSnapshotResponse.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class GetSnapshotResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNext = System.Text.Json.JsonEncodedText.Encode("next"); + private static readonly System.Text.Json.JsonEncodedText PropRemaining = System.Text.Json.JsonEncodedText.Encode("remaining"); + private static readonly System.Text.Json.JsonEncodedText PropResponses = System.Text.Json.JsonEncodedText.Encode("responses"); + private static readonly System.Text.Json.JsonEncodedText PropSnapshots = System.Text.Json.JsonEncodedText.Encode("snapshots"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Snapshot.GetSnapshotResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propNext = default; + LocalJsonValue propRemaining = default; + LocalJsonValue?> propResponses = default; + LocalJsonValue?> propSnapshots = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNext.TryReadProperty(ref reader, options, PropNext, null)) + { + continue; + } + + if (propRemaining.TryReadProperty(ref reader, options, PropRemaining, null)) + { + continue; + } + + if (propResponses.TryReadProperty(ref reader, options, PropResponses, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propSnapshots.TryReadProperty(ref reader, options, PropSnapshots, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.GetSnapshotResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Next = propNext.Value, + Remaining = propRemaining.Value, + Responses = propResponses.Value, + Snapshots = propSnapshots.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.GetSnapshotResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNext, value.Next, null, null); + writer.WriteProperty(options, PropRemaining, value.Remaining, null, null); + writer.WriteProperty(options, PropResponses, value.Responses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSnapshots, value.Snapshots, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetSnapshotResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetSnapshotResponse.g.cs index c9e57a752f0..416b6cf29a2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetSnapshotResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/GetSnapshotResponse.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class GetSnapshotResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNext = System.Text.Json.JsonEncodedText.Encode("next"); - private static readonly System.Text.Json.JsonEncodedText PropRemaining = System.Text.Json.JsonEncodedText.Encode("remaining"); - private static readonly System.Text.Json.JsonEncodedText PropResponses = System.Text.Json.JsonEncodedText.Encode("responses"); - private static readonly System.Text.Json.JsonEncodedText PropSnapshots = System.Text.Json.JsonEncodedText.Encode("snapshots"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Snapshot.GetSnapshotResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propNext = default; - LocalJsonValue propRemaining = default; - LocalJsonValue?> propResponses = default; - LocalJsonValue?> propSnapshots = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNext.TryReadProperty(ref reader, options, PropNext, null)) - { - continue; - } - - if (propRemaining.TryReadProperty(ref reader, options, PropRemaining, null)) - { - continue; - } - - if (propResponses.TryReadProperty(ref reader, options, PropResponses, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propSnapshots.TryReadProperty(ref reader, options, PropSnapshots, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.GetSnapshotResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Next = propNext.Value, - Remaining = propRemaining.Value, - Responses = propResponses.Value, - Snapshots = propSnapshots.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.GetSnapshotResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNext, value.Next, null, null); - writer.WriteProperty(options, PropRemaining, value.Remaining, null, null); - writer.WriteProperty(options, PropResponses, value.Responses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSnapshots, value.Snapshots, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.GetSnapshotResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.GetSnapshotResponseConverter))] public sealed partial class GetSnapshotResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryAnalyzeRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryAnalyzeRequest.Converters.g.cs new file mode 100644 index 00000000000..155e5b954ce --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryAnalyzeRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class RepositoryAnalyzeRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Snapshot.RepositoryAnalyzeRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.RepositoryAnalyzeRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.RepositoryAnalyzeRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryAnalyzeRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryAnalyzeRequest.g.cs index 62532aa5c6f..8920e4c11e9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryAnalyzeRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryAnalyzeRequest.g.cs @@ -119,35 +119,6 @@ public sealed partial class RepositoryAnalyzeRequestParameters : Elastic.Transpo public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class RepositoryAnalyzeRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Snapshot.RepositoryAnalyzeRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.RepositoryAnalyzeRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.RepositoryAnalyzeRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Analyze a snapshot repository. @@ -289,7 +260,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Some operations also verify the behavior on small blobs with sizes other than 8 bytes. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.RepositoryAnalyzeRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.RepositoryAnalyzeRequestConverter))] public sealed partial class RepositoryAnalyzeRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryAnalyzeResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryAnalyzeResponse.Converters.g.cs new file mode 100644 index 00000000000..9c8713ddfed --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryAnalyzeResponse.Converters.g.cs @@ -0,0 +1,234 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class RepositoryAnalyzeResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBlobCount = System.Text.Json.JsonEncodedText.Encode("blob_count"); + private static readonly System.Text.Json.JsonEncodedText PropBlobPath = System.Text.Json.JsonEncodedText.Encode("blob_path"); + private static readonly System.Text.Json.JsonEncodedText PropConcurrency = System.Text.Json.JsonEncodedText.Encode("concurrency"); + private static readonly System.Text.Json.JsonEncodedText PropCoordinatingNode = System.Text.Json.JsonEncodedText.Encode("coordinating_node"); + private static readonly System.Text.Json.JsonEncodedText PropDeleteElapsed = System.Text.Json.JsonEncodedText.Encode("delete_elapsed"); + private static readonly System.Text.Json.JsonEncodedText PropDeleteElapsedNanos = System.Text.Json.JsonEncodedText.Encode("delete_elapsed_nanos"); + private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); + private static readonly System.Text.Json.JsonEncodedText PropEarlyReadNodeCount = System.Text.Json.JsonEncodedText.Encode("early_read_node_count"); + private static readonly System.Text.Json.JsonEncodedText PropIssuesDetected = System.Text.Json.JsonEncodedText.Encode("issues_detected"); + private static readonly System.Text.Json.JsonEncodedText PropListingElapsed = System.Text.Json.JsonEncodedText.Encode("listing_elapsed"); + private static readonly System.Text.Json.JsonEncodedText PropListingElapsedNanos = System.Text.Json.JsonEncodedText.Encode("listing_elapsed_nanos"); + private static readonly System.Text.Json.JsonEncodedText PropMaxBlobSize = System.Text.Json.JsonEncodedText.Encode("max_blob_size"); + private static readonly System.Text.Json.JsonEncodedText PropMaxBlobSizeBytes = System.Text.Json.JsonEncodedText.Encode("max_blob_size_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropMaxTotalDataSize = System.Text.Json.JsonEncodedText.Encode("max_total_data_size"); + private static readonly System.Text.Json.JsonEncodedText PropMaxTotalDataSizeBytes = System.Text.Json.JsonEncodedText.Encode("max_total_data_size_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropRareActionProbability = System.Text.Json.JsonEncodedText.Encode("rare_action_probability"); + private static readonly System.Text.Json.JsonEncodedText PropReadNodeCount = System.Text.Json.JsonEncodedText.Encode("read_node_count"); + private static readonly System.Text.Json.JsonEncodedText PropRepository = System.Text.Json.JsonEncodedText.Encode("repository"); + private static readonly System.Text.Json.JsonEncodedText PropSeed = System.Text.Json.JsonEncodedText.Encode("seed"); + private static readonly System.Text.Json.JsonEncodedText PropSummary = System.Text.Json.JsonEncodedText.Encode("summary"); + + public override Elastic.Clients.Elasticsearch.Snapshot.RepositoryAnalyzeResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBlobCount = default; + LocalJsonValue propBlobPath = default; + LocalJsonValue propConcurrency = default; + LocalJsonValue propCoordinatingNode = default; + LocalJsonValue propDeleteElapsed = default; + LocalJsonValue propDeleteElapsedNanos = default; + LocalJsonValue propDetails = default; + LocalJsonValue propEarlyReadNodeCount = default; + LocalJsonValue> propIssuesDetected = default; + LocalJsonValue propListingElapsed = default; + LocalJsonValue propListingElapsedNanos = default; + LocalJsonValue propMaxBlobSize = default; + LocalJsonValue propMaxBlobSizeBytes = default; + LocalJsonValue propMaxTotalDataSize = default; + LocalJsonValue propMaxTotalDataSizeBytes = default; + LocalJsonValue propRareActionProbability = default; + LocalJsonValue propReadNodeCount = default; + LocalJsonValue propRepository = default; + LocalJsonValue propSeed = default; + LocalJsonValue propSummary = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBlobCount.TryReadProperty(ref reader, options, PropBlobCount, null)) + { + continue; + } + + if (propBlobPath.TryReadProperty(ref reader, options, PropBlobPath, null)) + { + continue; + } + + if (propConcurrency.TryReadProperty(ref reader, options, PropConcurrency, null)) + { + continue; + } + + if (propCoordinatingNode.TryReadProperty(ref reader, options, PropCoordinatingNode, null)) + { + continue; + } + + if (propDeleteElapsed.TryReadProperty(ref reader, options, PropDeleteElapsed, null)) + { + continue; + } + + if (propDeleteElapsedNanos.TryReadProperty(ref reader, options, PropDeleteElapsedNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) + { + continue; + } + + if (propDetails.TryReadProperty(ref reader, options, PropDetails, null)) + { + continue; + } + + if (propEarlyReadNodeCount.TryReadProperty(ref reader, options, PropEarlyReadNodeCount, null)) + { + continue; + } + + if (propIssuesDetected.TryReadProperty(ref reader, options, PropIssuesDetected, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propListingElapsed.TryReadProperty(ref reader, options, PropListingElapsed, null)) + { + continue; + } + + if (propListingElapsedNanos.TryReadProperty(ref reader, options, PropListingElapsedNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) + { + continue; + } + + if (propMaxBlobSize.TryReadProperty(ref reader, options, PropMaxBlobSize, null)) + { + continue; + } + + if (propMaxBlobSizeBytes.TryReadProperty(ref reader, options, PropMaxBlobSizeBytes, null)) + { + continue; + } + + if (propMaxTotalDataSize.TryReadProperty(ref reader, options, PropMaxTotalDataSize, null)) + { + continue; + } + + if (propMaxTotalDataSizeBytes.TryReadProperty(ref reader, options, PropMaxTotalDataSizeBytes, null)) + { + continue; + } + + if (propRareActionProbability.TryReadProperty(ref reader, options, PropRareActionProbability, null)) + { + continue; + } + + if (propReadNodeCount.TryReadProperty(ref reader, options, PropReadNodeCount, null)) + { + continue; + } + + if (propRepository.TryReadProperty(ref reader, options, PropRepository, null)) + { + continue; + } + + if (propSeed.TryReadProperty(ref reader, options, PropSeed, null)) + { + continue; + } + + if (propSummary.TryReadProperty(ref reader, options, PropSummary, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.RepositoryAnalyzeResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BlobCount = propBlobCount.Value, + BlobPath = propBlobPath.Value, + Concurrency = propConcurrency.Value, + CoordinatingNode = propCoordinatingNode.Value, + DeleteElapsed = propDeleteElapsed.Value, + DeleteElapsedNanos = propDeleteElapsedNanos.Value, + Details = propDetails.Value, + EarlyReadNodeCount = propEarlyReadNodeCount.Value, + IssuesDetected = propIssuesDetected.Value, + ListingElapsed = propListingElapsed.Value, + ListingElapsedNanos = propListingElapsedNanos.Value, + MaxBlobSize = propMaxBlobSize.Value, + MaxBlobSizeBytes = propMaxBlobSizeBytes.Value, + MaxTotalDataSize = propMaxTotalDataSize.Value, + MaxTotalDataSizeBytes = propMaxTotalDataSizeBytes.Value, + RareActionProbability = propRareActionProbability.Value, + ReadNodeCount = propReadNodeCount.Value, + Repository = propRepository.Value, + Seed = propSeed.Value, + Summary = propSummary.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.RepositoryAnalyzeResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBlobCount, value.BlobCount, null, null); + writer.WriteProperty(options, PropBlobPath, value.BlobPath, null, null); + writer.WriteProperty(options, PropConcurrency, value.Concurrency, null, null); + writer.WriteProperty(options, PropCoordinatingNode, value.CoordinatingNode, null, null); + writer.WriteProperty(options, PropDeleteElapsed, value.DeleteElapsed, null, null); + writer.WriteProperty(options, PropDeleteElapsedNanos, value.DeleteElapsedNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); + writer.WriteProperty(options, PropDetails, value.Details, null, null); + writer.WriteProperty(options, PropEarlyReadNodeCount, value.EarlyReadNodeCount, null, null); + writer.WriteProperty(options, PropIssuesDetected, value.IssuesDetected, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropListingElapsed, value.ListingElapsed, null, null); + writer.WriteProperty(options, PropListingElapsedNanos, value.ListingElapsedNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); + writer.WriteProperty(options, PropMaxBlobSize, value.MaxBlobSize, null, null); + writer.WriteProperty(options, PropMaxBlobSizeBytes, value.MaxBlobSizeBytes, null, null); + writer.WriteProperty(options, PropMaxTotalDataSize, value.MaxTotalDataSize, null, null); + writer.WriteProperty(options, PropMaxTotalDataSizeBytes, value.MaxTotalDataSizeBytes, null, null); + writer.WriteProperty(options, PropRareActionProbability, value.RareActionProbability, null, null); + writer.WriteProperty(options, PropReadNodeCount, value.ReadNodeCount, null, null); + writer.WriteProperty(options, PropRepository, value.Repository, null, null); + writer.WriteProperty(options, PropSeed, value.Seed, null, null); + writer.WriteProperty(options, PropSummary, value.Summary, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryAnalyzeResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryAnalyzeResponse.g.cs index c8129ecc32e..35aeebd3945 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryAnalyzeResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryAnalyzeResponse.g.cs @@ -23,217 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class RepositoryAnalyzeResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBlobCount = System.Text.Json.JsonEncodedText.Encode("blob_count"); - private static readonly System.Text.Json.JsonEncodedText PropBlobPath = System.Text.Json.JsonEncodedText.Encode("blob_path"); - private static readonly System.Text.Json.JsonEncodedText PropConcurrency = System.Text.Json.JsonEncodedText.Encode("concurrency"); - private static readonly System.Text.Json.JsonEncodedText PropCoordinatingNode = System.Text.Json.JsonEncodedText.Encode("coordinating_node"); - private static readonly System.Text.Json.JsonEncodedText PropDeleteElapsed = System.Text.Json.JsonEncodedText.Encode("delete_elapsed"); - private static readonly System.Text.Json.JsonEncodedText PropDeleteElapsedNanos = System.Text.Json.JsonEncodedText.Encode("delete_elapsed_nanos"); - private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); - private static readonly System.Text.Json.JsonEncodedText PropEarlyReadNodeCount = System.Text.Json.JsonEncodedText.Encode("early_read_node_count"); - private static readonly System.Text.Json.JsonEncodedText PropIssuesDetected = System.Text.Json.JsonEncodedText.Encode("issues_detected"); - private static readonly System.Text.Json.JsonEncodedText PropListingElapsed = System.Text.Json.JsonEncodedText.Encode("listing_elapsed"); - private static readonly System.Text.Json.JsonEncodedText PropListingElapsedNanos = System.Text.Json.JsonEncodedText.Encode("listing_elapsed_nanos"); - private static readonly System.Text.Json.JsonEncodedText PropMaxBlobSize = System.Text.Json.JsonEncodedText.Encode("max_blob_size"); - private static readonly System.Text.Json.JsonEncodedText PropMaxBlobSizeBytes = System.Text.Json.JsonEncodedText.Encode("max_blob_size_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropMaxTotalDataSize = System.Text.Json.JsonEncodedText.Encode("max_total_data_size"); - private static readonly System.Text.Json.JsonEncodedText PropMaxTotalDataSizeBytes = System.Text.Json.JsonEncodedText.Encode("max_total_data_size_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropRareActionProbability = System.Text.Json.JsonEncodedText.Encode("rare_action_probability"); - private static readonly System.Text.Json.JsonEncodedText PropReadNodeCount = System.Text.Json.JsonEncodedText.Encode("read_node_count"); - private static readonly System.Text.Json.JsonEncodedText PropRepository = System.Text.Json.JsonEncodedText.Encode("repository"); - private static readonly System.Text.Json.JsonEncodedText PropSeed = System.Text.Json.JsonEncodedText.Encode("seed"); - private static readonly System.Text.Json.JsonEncodedText PropSummary = System.Text.Json.JsonEncodedText.Encode("summary"); - - public override Elastic.Clients.Elasticsearch.Snapshot.RepositoryAnalyzeResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBlobCount = default; - LocalJsonValue propBlobPath = default; - LocalJsonValue propConcurrency = default; - LocalJsonValue propCoordinatingNode = default; - LocalJsonValue propDeleteElapsed = default; - LocalJsonValue propDeleteElapsedNanos = default; - LocalJsonValue propDetails = default; - LocalJsonValue propEarlyReadNodeCount = default; - LocalJsonValue> propIssuesDetected = default; - LocalJsonValue propListingElapsed = default; - LocalJsonValue propListingElapsedNanos = default; - LocalJsonValue propMaxBlobSize = default; - LocalJsonValue propMaxBlobSizeBytes = default; - LocalJsonValue propMaxTotalDataSize = default; - LocalJsonValue propMaxTotalDataSizeBytes = default; - LocalJsonValue propRareActionProbability = default; - LocalJsonValue propReadNodeCount = default; - LocalJsonValue propRepository = default; - LocalJsonValue propSeed = default; - LocalJsonValue propSummary = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBlobCount.TryReadProperty(ref reader, options, PropBlobCount, null)) - { - continue; - } - - if (propBlobPath.TryReadProperty(ref reader, options, PropBlobPath, null)) - { - continue; - } - - if (propConcurrency.TryReadProperty(ref reader, options, PropConcurrency, null)) - { - continue; - } - - if (propCoordinatingNode.TryReadProperty(ref reader, options, PropCoordinatingNode, null)) - { - continue; - } - - if (propDeleteElapsed.TryReadProperty(ref reader, options, PropDeleteElapsed, null)) - { - continue; - } - - if (propDeleteElapsedNanos.TryReadProperty(ref reader, options, PropDeleteElapsedNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) - { - continue; - } - - if (propDetails.TryReadProperty(ref reader, options, PropDetails, null)) - { - continue; - } - - if (propEarlyReadNodeCount.TryReadProperty(ref reader, options, PropEarlyReadNodeCount, null)) - { - continue; - } - - if (propIssuesDetected.TryReadProperty(ref reader, options, PropIssuesDetected, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propListingElapsed.TryReadProperty(ref reader, options, PropListingElapsed, null)) - { - continue; - } - - if (propListingElapsedNanos.TryReadProperty(ref reader, options, PropListingElapsedNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) - { - continue; - } - - if (propMaxBlobSize.TryReadProperty(ref reader, options, PropMaxBlobSize, null)) - { - continue; - } - - if (propMaxBlobSizeBytes.TryReadProperty(ref reader, options, PropMaxBlobSizeBytes, null)) - { - continue; - } - - if (propMaxTotalDataSize.TryReadProperty(ref reader, options, PropMaxTotalDataSize, null)) - { - continue; - } - - if (propMaxTotalDataSizeBytes.TryReadProperty(ref reader, options, PropMaxTotalDataSizeBytes, null)) - { - continue; - } - - if (propRareActionProbability.TryReadProperty(ref reader, options, PropRareActionProbability, null)) - { - continue; - } - - if (propReadNodeCount.TryReadProperty(ref reader, options, PropReadNodeCount, null)) - { - continue; - } - - if (propRepository.TryReadProperty(ref reader, options, PropRepository, null)) - { - continue; - } - - if (propSeed.TryReadProperty(ref reader, options, PropSeed, null)) - { - continue; - } - - if (propSummary.TryReadProperty(ref reader, options, PropSummary, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.RepositoryAnalyzeResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BlobCount = propBlobCount.Value, - BlobPath = propBlobPath.Value, - Concurrency = propConcurrency.Value, - CoordinatingNode = propCoordinatingNode.Value, - DeleteElapsed = propDeleteElapsed.Value, - DeleteElapsedNanos = propDeleteElapsedNanos.Value, - Details = propDetails.Value, - EarlyReadNodeCount = propEarlyReadNodeCount.Value, - IssuesDetected = propIssuesDetected.Value, - ListingElapsed = propListingElapsed.Value, - ListingElapsedNanos = propListingElapsedNanos.Value, - MaxBlobSize = propMaxBlobSize.Value, - MaxBlobSizeBytes = propMaxBlobSizeBytes.Value, - MaxTotalDataSize = propMaxTotalDataSize.Value, - MaxTotalDataSizeBytes = propMaxTotalDataSizeBytes.Value, - RareActionProbability = propRareActionProbability.Value, - ReadNodeCount = propReadNodeCount.Value, - Repository = propRepository.Value, - Seed = propSeed.Value, - Summary = propSummary.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.RepositoryAnalyzeResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBlobCount, value.BlobCount, null, null); - writer.WriteProperty(options, PropBlobPath, value.BlobPath, null, null); - writer.WriteProperty(options, PropConcurrency, value.Concurrency, null, null); - writer.WriteProperty(options, PropCoordinatingNode, value.CoordinatingNode, null, null); - writer.WriteProperty(options, PropDeleteElapsed, value.DeleteElapsed, null, null); - writer.WriteProperty(options, PropDeleteElapsedNanos, value.DeleteElapsedNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); - writer.WriteProperty(options, PropDetails, value.Details, null, null); - writer.WriteProperty(options, PropEarlyReadNodeCount, value.EarlyReadNodeCount, null, null); - writer.WriteProperty(options, PropIssuesDetected, value.IssuesDetected, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropListingElapsed, value.ListingElapsed, null, null); - writer.WriteProperty(options, PropListingElapsedNanos, value.ListingElapsedNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); - writer.WriteProperty(options, PropMaxBlobSize, value.MaxBlobSize, null, null); - writer.WriteProperty(options, PropMaxBlobSizeBytes, value.MaxBlobSizeBytes, null, null); - writer.WriteProperty(options, PropMaxTotalDataSize, value.MaxTotalDataSize, null, null); - writer.WriteProperty(options, PropMaxTotalDataSizeBytes, value.MaxTotalDataSizeBytes, null, null); - writer.WriteProperty(options, PropRareActionProbability, value.RareActionProbability, null, null); - writer.WriteProperty(options, PropReadNodeCount, value.ReadNodeCount, null, null); - writer.WriteProperty(options, PropRepository, value.Repository, null, null); - writer.WriteProperty(options, PropSeed, value.Seed, null, null); - writer.WriteProperty(options, PropSummary, value.Summary, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.RepositoryAnalyzeResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.RepositoryAnalyzeResponseConverter))] public sealed partial class RepositoryAnalyzeResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryVerifyIntegrityRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryVerifyIntegrityRequest.Converters.g.cs new file mode 100644 index 00000000000..e1d7910b6ae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryVerifyIntegrityRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class RepositoryVerifyIntegrityRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Snapshot.RepositoryVerifyIntegrityRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.RepositoryVerifyIntegrityRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.RepositoryVerifyIntegrityRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryVerifyIntegrityRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryVerifyIntegrityRequest.g.cs index c9ed0d9ba55..97a8586eb6d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryVerifyIntegrityRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryVerifyIntegrityRequest.g.cs @@ -87,35 +87,6 @@ public sealed partial class RepositoryVerifyIntegrityRequestParameters : Elastic public bool? VerifyBlobContents { get => Q("verify_blob_contents"); set => Q("verify_blob_contents", value); } } -internal sealed partial class RepositoryVerifyIntegrityRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Snapshot.RepositoryVerifyIntegrityRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.RepositoryVerifyIntegrityRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.RepositoryVerifyIntegrityRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Verify the repository integrity. @@ -186,7 +157,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The response body format is therefore not considered stable and may be different in newer versions. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.RepositoryVerifyIntegrityRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.RepositoryVerifyIntegrityRequestConverter))] public sealed partial class RepositoryVerifyIntegrityRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryVerifyIntegrityResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryVerifyIntegrityResponse.Converters.g.cs new file mode 100644 index 00000000000..5eaed8170a1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryVerifyIntegrityResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class RepositoryVerifyIntegrityResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Snapshot.RepositoryVerifyIntegrityResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Snapshot.RepositoryVerifyIntegrityResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Result = reader.ReadValue(options, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.RepositoryVerifyIntegrityResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Result, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryVerifyIntegrityResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryVerifyIntegrityResponse.g.cs index b7f882bb242..94c43f0b073 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryVerifyIntegrityResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RepositoryVerifyIntegrityResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class RepositoryVerifyIntegrityResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Snapshot.RepositoryVerifyIntegrityResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Snapshot.RepositoryVerifyIntegrityResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Result = reader.ReadValue(options, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.RepositoryVerifyIntegrityResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Result, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.RepositoryVerifyIntegrityResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.RepositoryVerifyIntegrityResponseConverter))] public sealed partial class RepositoryVerifyIntegrityResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RestoreRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RestoreRequest.Converters.g.cs new file mode 100644 index 00000000000..069c92f14d0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RestoreRequest.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class RestoreRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFeatureStates = System.Text.Json.JsonEncodedText.Encode("feature_states"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreIndexSettings = System.Text.Json.JsonEncodedText.Encode("ignore_index_settings"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnavailable = System.Text.Json.JsonEncodedText.Encode("ignore_unavailable"); + private static readonly System.Text.Json.JsonEncodedText PropIncludeAliases = System.Text.Json.JsonEncodedText.Encode("include_aliases"); + private static readonly System.Text.Json.JsonEncodedText PropIncludeGlobalState = System.Text.Json.JsonEncodedText.Encode("include_global_state"); + private static readonly System.Text.Json.JsonEncodedText PropIndexSettings = System.Text.Json.JsonEncodedText.Encode("index_settings"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropPartial = System.Text.Json.JsonEncodedText.Encode("partial"); + private static readonly System.Text.Json.JsonEncodedText PropRenamePattern = System.Text.Json.JsonEncodedText.Encode("rename_pattern"); + private static readonly System.Text.Json.JsonEncodedText PropRenameReplacement = System.Text.Json.JsonEncodedText.Encode("rename_replacement"); + + public override Elastic.Clients.Elasticsearch.Snapshot.RestoreRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propFeatureStates = default; + LocalJsonValue?> propIgnoreIndexSettings = default; + LocalJsonValue propIgnoreUnavailable = default; + LocalJsonValue propIncludeAliases = default; + LocalJsonValue propIncludeGlobalState = default; + LocalJsonValue propIndexSettings = default; + LocalJsonValue propIndices = default; + LocalJsonValue propPartial = default; + LocalJsonValue propRenamePattern = default; + LocalJsonValue propRenameReplacement = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFeatureStates.TryReadProperty(ref reader, options, PropFeatureStates, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propIgnoreIndexSettings.TryReadProperty(ref reader, options, PropIgnoreIndexSettings, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propIgnoreUnavailable.TryReadProperty(ref reader, options, PropIgnoreUnavailable, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIncludeAliases.TryReadProperty(ref reader, options, PropIncludeAliases, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIncludeGlobalState.TryReadProperty(ref reader, options, PropIncludeGlobalState, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndexSettings.TryReadProperty(ref reader, options, PropIndexSettings, null)) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) + { + continue; + } + + if (propPartial.TryReadProperty(ref reader, options, PropPartial, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRenamePattern.TryReadProperty(ref reader, options, PropRenamePattern, null)) + { + continue; + } + + if (propRenameReplacement.TryReadProperty(ref reader, options, PropRenameReplacement, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.RestoreRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FeatureStates = propFeatureStates.Value, + IgnoreIndexSettings = propIgnoreIndexSettings.Value, + IgnoreUnavailable = propIgnoreUnavailable.Value, + IncludeAliases = propIncludeAliases.Value, + IncludeGlobalState = propIncludeGlobalState.Value, + IndexSettings = propIndexSettings.Value, + Indices = propIndices.Value, + Partial = propPartial.Value, + RenamePattern = propRenamePattern.Value, + RenameReplacement = propRenameReplacement.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.RestoreRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFeatureStates, value.FeatureStates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIgnoreIndexSettings, value.IgnoreIndexSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIgnoreUnavailable, value.IgnoreUnavailable, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIncludeAliases, value.IncludeAliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIncludeGlobalState, value.IncludeGlobalState, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndexSettings, value.IndexSettings, null, null); + writer.WriteProperty(options, PropIndices, value.Indices, null, null); + writer.WriteProperty(options, PropPartial, value.Partial, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRenamePattern, value.RenamePattern, null, null); + writer.WriteProperty(options, PropRenameReplacement, value.RenameReplacement, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RestoreRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RestoreRequest.g.cs index cc8ae333763..48b85c08ad8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RestoreRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RestoreRequest.g.cs @@ -47,126 +47,6 @@ public sealed partial class RestoreRequestParameters : Elastic.Transport.Request public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } } -internal sealed partial class RestoreRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFeatureStates = System.Text.Json.JsonEncodedText.Encode("feature_states"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreIndexSettings = System.Text.Json.JsonEncodedText.Encode("ignore_index_settings"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnavailable = System.Text.Json.JsonEncodedText.Encode("ignore_unavailable"); - private static readonly System.Text.Json.JsonEncodedText PropIncludeAliases = System.Text.Json.JsonEncodedText.Encode("include_aliases"); - private static readonly System.Text.Json.JsonEncodedText PropIncludeGlobalState = System.Text.Json.JsonEncodedText.Encode("include_global_state"); - private static readonly System.Text.Json.JsonEncodedText PropIndexSettings = System.Text.Json.JsonEncodedText.Encode("index_settings"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropPartial = System.Text.Json.JsonEncodedText.Encode("partial"); - private static readonly System.Text.Json.JsonEncodedText PropRenamePattern = System.Text.Json.JsonEncodedText.Encode("rename_pattern"); - private static readonly System.Text.Json.JsonEncodedText PropRenameReplacement = System.Text.Json.JsonEncodedText.Encode("rename_replacement"); - - public override Elastic.Clients.Elasticsearch.Snapshot.RestoreRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propFeatureStates = default; - LocalJsonValue?> propIgnoreIndexSettings = default; - LocalJsonValue propIgnoreUnavailable = default; - LocalJsonValue propIncludeAliases = default; - LocalJsonValue propIncludeGlobalState = default; - LocalJsonValue propIndexSettings = default; - LocalJsonValue propIndices = default; - LocalJsonValue propPartial = default; - LocalJsonValue propRenamePattern = default; - LocalJsonValue propRenameReplacement = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFeatureStates.TryReadProperty(ref reader, options, PropFeatureStates, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propIgnoreIndexSettings.TryReadProperty(ref reader, options, PropIgnoreIndexSettings, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propIgnoreUnavailable.TryReadProperty(ref reader, options, PropIgnoreUnavailable, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIncludeAliases.TryReadProperty(ref reader, options, PropIncludeAliases, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIncludeGlobalState.TryReadProperty(ref reader, options, PropIncludeGlobalState, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndexSettings.TryReadProperty(ref reader, options, PropIndexSettings, null)) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) - { - continue; - } - - if (propPartial.TryReadProperty(ref reader, options, PropPartial, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRenamePattern.TryReadProperty(ref reader, options, PropRenamePattern, null)) - { - continue; - } - - if (propRenameReplacement.TryReadProperty(ref reader, options, PropRenameReplacement, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.RestoreRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FeatureStates = propFeatureStates.Value, - IgnoreIndexSettings = propIgnoreIndexSettings.Value, - IgnoreUnavailable = propIgnoreUnavailable.Value, - IncludeAliases = propIncludeAliases.Value, - IncludeGlobalState = propIncludeGlobalState.Value, - IndexSettings = propIndexSettings.Value, - Indices = propIndices.Value, - Partial = propPartial.Value, - RenamePattern = propRenamePattern.Value, - RenameReplacement = propRenameReplacement.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.RestoreRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFeatureStates, value.FeatureStates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIgnoreIndexSettings, value.IgnoreIndexSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIgnoreUnavailable, value.IgnoreUnavailable, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIncludeAliases, value.IncludeAliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIncludeGlobalState, value.IncludeGlobalState, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndexSettings, value.IndexSettings, null, null); - writer.WriteProperty(options, PropIndices, value.Indices, null, null); - writer.WriteProperty(options, PropPartial, value.Partial, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRenamePattern, value.RenamePattern, null, null); - writer.WriteProperty(options, PropRenameReplacement, value.RenameReplacement, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Restore a snapshot. @@ -193,7 +73,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If your snapshot contains data from App Search or Workplace Search, you must restore the Enterprise Search encryption key before you restore the snapshot. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.RestoreRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.RestoreRequestConverter))] public sealed partial class RestoreRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RestoreResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RestoreResponse.Converters.g.cs new file mode 100644 index 00000000000..6408ddca6cb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RestoreResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class RestoreResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAccepted = System.Text.Json.JsonEncodedText.Encode("accepted"); + private static readonly System.Text.Json.JsonEncodedText PropSnapshot = System.Text.Json.JsonEncodedText.Encode("snapshot"); + + public override Elastic.Clients.Elasticsearch.Snapshot.RestoreResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAccepted = default; + LocalJsonValue propSnapshot = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAccepted.TryReadProperty(ref reader, options, PropAccepted, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSnapshot.TryReadProperty(ref reader, options, PropSnapshot, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.RestoreResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Accepted = propAccepted.Value, + Snapshot = propSnapshot.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.RestoreResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAccepted, value.Accepted, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSnapshot, value.Snapshot, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RestoreResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RestoreResponse.g.cs index 4856316a416..961f39fe9b2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RestoreResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/RestoreResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class RestoreResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAccepted = System.Text.Json.JsonEncodedText.Encode("accepted"); - private static readonly System.Text.Json.JsonEncodedText PropSnapshot = System.Text.Json.JsonEncodedText.Encode("snapshot"); - - public override Elastic.Clients.Elasticsearch.Snapshot.RestoreResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAccepted = default; - LocalJsonValue propSnapshot = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAccepted.TryReadProperty(ref reader, options, PropAccepted, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSnapshot.TryReadProperty(ref reader, options, PropSnapshot, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.RestoreResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Accepted = propAccepted.Value, - Snapshot = propSnapshot.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.RestoreResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAccepted, value.Accepted, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSnapshot, value.Snapshot, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.RestoreResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.RestoreResponseConverter))] public sealed partial class RestoreResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/SnapshotStatusRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/SnapshotStatusRequest.Converters.g.cs new file mode 100644 index 00000000000..94752ece5c4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/SnapshotStatusRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class SnapshotStatusRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotStatusRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.SnapshotStatusRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotStatusRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/SnapshotStatusRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/SnapshotStatusRequest.g.cs index 62c62603384..1845544a963 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/SnapshotStatusRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/SnapshotStatusRequest.g.cs @@ -43,35 +43,6 @@ public sealed partial class SnapshotStatusRequestParameters : Elastic.Transport. public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class SnapshotStatusRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotStatusRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.SnapshotStatusRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotStatusRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get the snapshot status. @@ -103,7 +74,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// These requests can also tax machine resources and, when using cloud storage, incur high processing costs. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.SnapshotStatusRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.SnapshotStatusRequestConverter))] public sealed partial class SnapshotStatusRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public SnapshotStatusRequest(Elastic.Clients.Elasticsearch.Name? repository) : base(r => r.Optional("repository", repository)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/SnapshotStatusResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/SnapshotStatusResponse.Converters.g.cs new file mode 100644 index 00000000000..4fbe4bb31ae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/SnapshotStatusResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class SnapshotStatusResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSnapshots = System.Text.Json.JsonEncodedText.Encode("snapshots"); + + public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotStatusResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propSnapshots = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSnapshots.TryReadProperty(ref reader, options, PropSnapshots, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.SnapshotStatusResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Snapshots = propSnapshots.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotStatusResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSnapshots, value.Snapshots, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/SnapshotStatusResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/SnapshotStatusResponse.g.cs index c9bb650ff41..4684a2a5e13 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/SnapshotStatusResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/SnapshotStatusResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class SnapshotStatusResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSnapshots = System.Text.Json.JsonEncodedText.Encode("snapshots"); - - public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotStatusResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propSnapshots = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSnapshots.TryReadProperty(ref reader, options, PropSnapshots, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.SnapshotStatusResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Snapshots = propSnapshots.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotStatusResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSnapshots, value.Snapshots, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.SnapshotStatusResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.SnapshotStatusResponseConverter))] public sealed partial class SnapshotStatusResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal SnapshotStatusResponse(Elastic.Clients.Elasticsearch.Serialization.Json public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Snapshots { get; set; } +System.Collections.Generic.IReadOnlyCollection Snapshots { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/VerifyRepositoryRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/VerifyRepositoryRequest.Converters.g.cs new file mode 100644 index 00000000000..3c7b6d753db --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/VerifyRepositoryRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class VerifyRepositoryRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Snapshot.VerifyRepositoryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.VerifyRepositoryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.VerifyRepositoryRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/VerifyRepositoryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/VerifyRepositoryRequest.g.cs index 5a7fdeede4c..8d03c11213e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/VerifyRepositoryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/VerifyRepositoryRequest.g.cs @@ -44,42 +44,13 @@ public sealed partial class VerifyRepositoryRequestParameters : Elastic.Transpor public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class VerifyRepositoryRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Snapshot.VerifyRepositoryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.VerifyRepositoryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.VerifyRepositoryRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Verify a snapshot repository. /// Check for common misconfigurations in a snapshot repository. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.VerifyRepositoryRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.VerifyRepositoryRequestConverter))] public sealed partial class VerifyRepositoryRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/VerifyRepositoryResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/VerifyRepositoryResponse.Converters.g.cs new file mode 100644 index 00000000000..cd6ef675f34 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/VerifyRepositoryResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class VerifyRepositoryResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); + + public override Elastic.Clients.Elasticsearch.Snapshot.VerifyRepositoryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propNodes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.VerifyRepositoryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Nodes = propNodes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.VerifyRepositoryResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/VerifyRepositoryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/VerifyRepositoryResponse.g.cs index 66540df4d6c..8801c81000e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/VerifyRepositoryResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/VerifyRepositoryResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class VerifyRepositoryResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); - - public override Elastic.Clients.Elasticsearch.Snapshot.VerifyRepositoryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propNodes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.VerifyRepositoryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Nodes = propNodes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.VerifyRepositoryResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.VerifyRepositoryResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.VerifyRepositoryResponseConverter))] public sealed partial class VerifyRepositoryResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleRequest.Converters.g.cs new file mode 100644 index 00000000000..cd762480a9c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json; + +public sealed partial class DeleteLifecycleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.DeleteLifecycleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.DeleteLifecycleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.DeleteLifecycleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleRequest.g.cs index 79c3b54d7a2..4886a147e8d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleRequest.g.cs @@ -42,35 +42,6 @@ public sealed partial class DeleteLifecycleRequestParameters : Elastic.Transport public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class DeleteLifecycleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.DeleteLifecycleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.DeleteLifecycleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.DeleteLifecycleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete a policy. @@ -78,7 +49,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// This operation prevents any future snapshots from being taken but does not cancel in-progress snapshots or remove previously-taken snapshots. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.DeleteLifecycleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json.DeleteLifecycleRequestConverter))] public sealed partial class DeleteLifecycleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleResponse.Converters.g.cs new file mode 100644 index 00000000000..ad1b39af41d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json; + +public sealed partial class DeleteLifecycleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.DeleteLifecycleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.DeleteLifecycleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.DeleteLifecycleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleResponse.g.cs index 5a77c30c0d4..cf7c62e36f6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/DeleteLifecycleResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; -internal sealed partial class DeleteLifecycleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.DeleteLifecycleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.DeleteLifecycleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.DeleteLifecycleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.DeleteLifecycleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json.DeleteLifecycleResponseConverter))] public sealed partial class DeleteLifecycleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleRequest.Converters.g.cs new file mode 100644 index 00000000000..5ea2670f37d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json; + +public sealed partial class ExecuteLifecycleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteLifecycleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteLifecycleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteLifecycleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleRequest.g.cs index ba68d566853..81e688235fc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleRequest.g.cs @@ -42,35 +42,6 @@ public sealed partial class ExecuteLifecycleRequestParameters : Elastic.Transpor public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class ExecuteLifecycleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteLifecycleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteLifecycleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteLifecycleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Run a policy. @@ -78,7 +49,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The snapshot policy is normally applied according to its schedule, but you might want to manually run a policy before performing an upgrade or other maintenance. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteLifecycleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json.ExecuteLifecycleRequestConverter))] public sealed partial class ExecuteLifecycleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleResponse.Converters.g.cs new file mode 100644 index 00000000000..1a8f5906a9b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json; + +public sealed partial class ExecuteLifecycleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSnapshotName = System.Text.Json.JsonEncodedText.Encode("snapshot_name"); + + public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteLifecycleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propSnapshotName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSnapshotName.TryReadProperty(ref reader, options, PropSnapshotName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteLifecycleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + SnapshotName = propSnapshotName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteLifecycleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSnapshotName, value.SnapshotName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleResponse.g.cs index dcd05c99a8a..0ad9d42c1b4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteLifecycleResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; -internal sealed partial class ExecuteLifecycleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSnapshotName = System.Text.Json.JsonEncodedText.Encode("snapshot_name"); - - public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteLifecycleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propSnapshotName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSnapshotName.TryReadProperty(ref reader, options, PropSnapshotName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteLifecycleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - SnapshotName = propSnapshotName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteLifecycleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSnapshotName, value.SnapshotName, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteLifecycleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json.ExecuteLifecycleResponseConverter))] public sealed partial class ExecuteLifecycleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal ExecuteLifecycleResponse(Elastic.Clients.Elasticsearch.Serialization.Js public #if NET7_0_OR_GREATER - required +required #endif - string SnapshotName { get; set; } +string SnapshotName { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionRequest.Converters.g.cs new file mode 100644 index 00000000000..140d0bfb70b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json; + +public sealed partial class ExecuteRetentionRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteRetentionRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteRetentionRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteRetentionRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionRequest.g.cs index 289a8205ae7..9463ef8d4c3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionRequest.g.cs @@ -42,35 +42,6 @@ public sealed partial class ExecuteRetentionRequestParameters : Elastic.Transpor public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class ExecuteRetentionRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteRetentionRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteRetentionRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteRetentionRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Run a retention policy. @@ -78,7 +49,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The retention policy is normally applied according to its schedule. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteRetentionRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json.ExecuteRetentionRequestConverter))] public sealed partial class ExecuteRetentionRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionResponse.Converters.g.cs new file mode 100644 index 00000000000..d9dc91b3c58 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json; + +public sealed partial class ExecuteRetentionResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteRetentionResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteRetentionResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteRetentionResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionResponse.g.cs index f7c8142ffff..1a780491d82 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/ExecuteRetentionResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; -internal sealed partial class ExecuteRetentionResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteRetentionResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteRetentionResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteRetentionResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.ExecuteRetentionResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json.ExecuteRetentionResponseConverter))] public sealed partial class ExecuteRetentionResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleRequest.Converters.g.cs new file mode 100644 index 00000000000..c4412bb39cf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json; + +public sealed partial class GetLifecycleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetLifecycleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetLifecycleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetLifecycleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleRequest.g.cs index 0242913bbe3..3784f950a86 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleRequest.g.cs @@ -42,42 +42,13 @@ public sealed partial class GetLifecycleRequestParameters : Elastic.Transport.Re public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class GetLifecycleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetLifecycleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetLifecycleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetLifecycleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get policy information. /// Get snapshot lifecycle policy definitions and information about the latest snapshot attempts. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetLifecycleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json.GetLifecycleRequestConverter))] public sealed partial class GetLifecycleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetLifecycleRequest(Elastic.Clients.Elasticsearch.Names? policyId) : base(r => r.Optional("policy_id", policyId)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleResponse.Converters.g.cs new file mode 100644 index 00000000000..117d33cb94e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleResponse.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json; + +public sealed partial class GetLifecycleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetLifecycleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetLifecycleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Lifecycles = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetLifecycleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Lifecycles, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleResponse.g.cs index 3144b29fc1a..4051f630a5f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetLifecycleResponse.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; -internal sealed partial class GetLifecycleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetLifecycleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetLifecycleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Lifecycles = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!) }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetLifecycleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Lifecycles, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetLifecycleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json.GetLifecycleResponseConverter))] public sealed partial class GetLifecycleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusRequest.Converters.g.cs new file mode 100644 index 00000000000..e4a6b9b28aa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json; + +public sealed partial class GetSlmStatusRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetSlmStatusRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetSlmStatusRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetSlmStatusRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusRequest.g.cs index 586d2c920e6..d9d46bc21c7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusRequest.g.cs @@ -44,41 +44,12 @@ public sealed partial class GetSlmStatusRequestParameters : Elastic.Transport.Re public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class GetSlmStatusRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetSlmStatusRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetSlmStatusRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetSlmStatusRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get the snapshot lifecycle management status. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetSlmStatusRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json.GetSlmStatusRequestConverter))] public sealed partial class GetSlmStatusRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusResponse.Converters.g.cs new file mode 100644 index 00000000000..387e7a69ebc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json; + +public sealed partial class GetSlmStatusResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropOperationMode = System.Text.Json.JsonEncodedText.Encode("operation_mode"); + + public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetSlmStatusResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propOperationMode = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propOperationMode.TryReadProperty(ref reader, options, PropOperationMode, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetSlmStatusResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + OperationMode = propOperationMode.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetSlmStatusResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropOperationMode, value.OperationMode, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusResponse.g.cs index 46c8b04fe60..21273939799 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetSlmStatusResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; -internal sealed partial class GetSlmStatusResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropOperationMode = System.Text.Json.JsonEncodedText.Encode("operation_mode"); - - public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetSlmStatusResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propOperationMode = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propOperationMode.TryReadProperty(ref reader, options, PropOperationMode, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetSlmStatusResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - OperationMode = propOperationMode.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetSlmStatusResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropOperationMode, value.OperationMode, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetSlmStatusResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json.GetSlmStatusResponseConverter))] public sealed partial class GetSlmStatusResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal GetSlmStatusResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCo public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.LifecycleOperationMode OperationMode { get; set; } +Elastic.Clients.Elasticsearch.LifecycleOperationMode OperationMode { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetStatsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetStatsRequest.Converters.g.cs new file mode 100644 index 00000000000..cbb7b0fe943 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetStatsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json; + +public sealed partial class GetStatsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetStatsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetStatsRequest.g.cs index 3599893c7cd..bc183f84d1a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetStatsRequest.g.cs @@ -40,42 +40,13 @@ public sealed partial class GetStatsRequestParameters : Elastic.Transport.Reques public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class GetStatsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetStatsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get snapshot lifecycle management statistics. /// Get global and policy-level statistics about actions taken by snapshot lifecycle management. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetStatsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json.GetStatsRequestConverter))] public sealed partial class GetStatsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetStatsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetStatsResponse.Converters.g.cs new file mode 100644 index 00000000000..f234730f488 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetStatsResponse.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json; + +public sealed partial class GetStatsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPolicyStats = System.Text.Json.JsonEncodedText.Encode("policy_stats"); + private static readonly System.Text.Json.JsonEncodedText PropRetentionDeletionTime = System.Text.Json.JsonEncodedText.Encode("retention_deletion_time"); + private static readonly System.Text.Json.JsonEncodedText PropRetentionDeletionTimeMillis = System.Text.Json.JsonEncodedText.Encode("retention_deletion_time_millis"); + private static readonly System.Text.Json.JsonEncodedText PropRetentionFailed = System.Text.Json.JsonEncodedText.Encode("retention_failed"); + private static readonly System.Text.Json.JsonEncodedText PropRetentionRuns = System.Text.Json.JsonEncodedText.Encode("retention_runs"); + private static readonly System.Text.Json.JsonEncodedText PropRetentionTimedOut = System.Text.Json.JsonEncodedText.Encode("retention_timed_out"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSnapshotDeletionFailures = System.Text.Json.JsonEncodedText.Encode("total_snapshot_deletion_failures"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSnapshotsDeleted = System.Text.Json.JsonEncodedText.Encode("total_snapshots_deleted"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSnapshotsFailed = System.Text.Json.JsonEncodedText.Encode("total_snapshots_failed"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSnapshotsTaken = System.Text.Json.JsonEncodedText.Encode("total_snapshots_taken"); + + public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propPolicyStats = default; + LocalJsonValue propRetentionDeletionTime = default; + LocalJsonValue propRetentionDeletionTimeMillis = default; + LocalJsonValue propRetentionFailed = default; + LocalJsonValue propRetentionRuns = default; + LocalJsonValue propRetentionTimedOut = default; + LocalJsonValue propTotalSnapshotDeletionFailures = default; + LocalJsonValue propTotalSnapshotsDeleted = default; + LocalJsonValue propTotalSnapshotsFailed = default; + LocalJsonValue propTotalSnapshotsTaken = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPolicyStats.TryReadProperty(ref reader, options, PropPolicyStats, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propRetentionDeletionTime.TryReadProperty(ref reader, options, PropRetentionDeletionTime, null)) + { + continue; + } + + if (propRetentionDeletionTimeMillis.TryReadProperty(ref reader, options, PropRetentionDeletionTimeMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propRetentionFailed.TryReadProperty(ref reader, options, PropRetentionFailed, null)) + { + continue; + } + + if (propRetentionRuns.TryReadProperty(ref reader, options, PropRetentionRuns, null)) + { + continue; + } + + if (propRetentionTimedOut.TryReadProperty(ref reader, options, PropRetentionTimedOut, null)) + { + continue; + } + + if (propTotalSnapshotDeletionFailures.TryReadProperty(ref reader, options, PropTotalSnapshotDeletionFailures, null)) + { + continue; + } + + if (propTotalSnapshotsDeleted.TryReadProperty(ref reader, options, PropTotalSnapshotsDeleted, null)) + { + continue; + } + + if (propTotalSnapshotsFailed.TryReadProperty(ref reader, options, PropTotalSnapshotsFailed, null)) + { + continue; + } + + if (propTotalSnapshotsTaken.TryReadProperty(ref reader, options, PropTotalSnapshotsTaken, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + PolicyStats = propPolicyStats.Value, + RetentionDeletionTime = propRetentionDeletionTime.Value, + RetentionDeletionTimeMillis = propRetentionDeletionTimeMillis.Value, + RetentionFailed = propRetentionFailed.Value, + RetentionRuns = propRetentionRuns.Value, + RetentionTimedOut = propRetentionTimedOut.Value, + TotalSnapshotDeletionFailures = propTotalSnapshotDeletionFailures.Value, + TotalSnapshotsDeleted = propTotalSnapshotsDeleted.Value, + TotalSnapshotsFailed = propTotalSnapshotsFailed.Value, + TotalSnapshotsTaken = propTotalSnapshotsTaken.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetStatsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPolicyStats, value.PolicyStats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRetentionDeletionTime, value.RetentionDeletionTime, null, null); + writer.WriteProperty(options, PropRetentionDeletionTimeMillis, value.RetentionDeletionTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropRetentionFailed, value.RetentionFailed, null, null); + writer.WriteProperty(options, PropRetentionRuns, value.RetentionRuns, null, null); + writer.WriteProperty(options, PropRetentionTimedOut, value.RetentionTimedOut, null, null); + writer.WriteProperty(options, PropTotalSnapshotDeletionFailures, value.TotalSnapshotDeletionFailures, null, null); + writer.WriteProperty(options, PropTotalSnapshotsDeleted, value.TotalSnapshotsDeleted, null, null); + writer.WriteProperty(options, PropTotalSnapshotsFailed, value.TotalSnapshotsFailed, null, null); + writer.WriteProperty(options, PropTotalSnapshotsTaken, value.TotalSnapshotsTaken, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetStatsResponse.g.cs index 0d699acc141..e72dbbac462 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/GetStatsResponse.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; -internal sealed partial class GetStatsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPolicyStats = System.Text.Json.JsonEncodedText.Encode("policy_stats"); - private static readonly System.Text.Json.JsonEncodedText PropRetentionDeletionTime = System.Text.Json.JsonEncodedText.Encode("retention_deletion_time"); - private static readonly System.Text.Json.JsonEncodedText PropRetentionDeletionTimeMillis = System.Text.Json.JsonEncodedText.Encode("retention_deletion_time_millis"); - private static readonly System.Text.Json.JsonEncodedText PropRetentionFailed = System.Text.Json.JsonEncodedText.Encode("retention_failed"); - private static readonly System.Text.Json.JsonEncodedText PropRetentionRuns = System.Text.Json.JsonEncodedText.Encode("retention_runs"); - private static readonly System.Text.Json.JsonEncodedText PropRetentionTimedOut = System.Text.Json.JsonEncodedText.Encode("retention_timed_out"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSnapshotDeletionFailures = System.Text.Json.JsonEncodedText.Encode("total_snapshot_deletion_failures"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSnapshotsDeleted = System.Text.Json.JsonEncodedText.Encode("total_snapshots_deleted"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSnapshotsFailed = System.Text.Json.JsonEncodedText.Encode("total_snapshots_failed"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSnapshotsTaken = System.Text.Json.JsonEncodedText.Encode("total_snapshots_taken"); - - public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propPolicyStats = default; - LocalJsonValue propRetentionDeletionTime = default; - LocalJsonValue propRetentionDeletionTimeMillis = default; - LocalJsonValue propRetentionFailed = default; - LocalJsonValue propRetentionRuns = default; - LocalJsonValue propRetentionTimedOut = default; - LocalJsonValue propTotalSnapshotDeletionFailures = default; - LocalJsonValue propTotalSnapshotsDeleted = default; - LocalJsonValue propTotalSnapshotsFailed = default; - LocalJsonValue propTotalSnapshotsTaken = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPolicyStats.TryReadProperty(ref reader, options, PropPolicyStats, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propRetentionDeletionTime.TryReadProperty(ref reader, options, PropRetentionDeletionTime, null)) - { - continue; - } - - if (propRetentionDeletionTimeMillis.TryReadProperty(ref reader, options, PropRetentionDeletionTimeMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propRetentionFailed.TryReadProperty(ref reader, options, PropRetentionFailed, null)) - { - continue; - } - - if (propRetentionRuns.TryReadProperty(ref reader, options, PropRetentionRuns, null)) - { - continue; - } - - if (propRetentionTimedOut.TryReadProperty(ref reader, options, PropRetentionTimedOut, null)) - { - continue; - } - - if (propTotalSnapshotDeletionFailures.TryReadProperty(ref reader, options, PropTotalSnapshotDeletionFailures, null)) - { - continue; - } - - if (propTotalSnapshotsDeleted.TryReadProperty(ref reader, options, PropTotalSnapshotsDeleted, null)) - { - continue; - } - - if (propTotalSnapshotsFailed.TryReadProperty(ref reader, options, PropTotalSnapshotsFailed, null)) - { - continue; - } - - if (propTotalSnapshotsTaken.TryReadProperty(ref reader, options, PropTotalSnapshotsTaken, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - PolicyStats = propPolicyStats.Value, - RetentionDeletionTime = propRetentionDeletionTime.Value, - RetentionDeletionTimeMillis = propRetentionDeletionTimeMillis.Value, - RetentionFailed = propRetentionFailed.Value, - RetentionRuns = propRetentionRuns.Value, - RetentionTimedOut = propRetentionTimedOut.Value, - TotalSnapshotDeletionFailures = propTotalSnapshotDeletionFailures.Value, - TotalSnapshotsDeleted = propTotalSnapshotsDeleted.Value, - TotalSnapshotsFailed = propTotalSnapshotsFailed.Value, - TotalSnapshotsTaken = propTotalSnapshotsTaken.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetStatsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPolicyStats, value.PolicyStats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRetentionDeletionTime, value.RetentionDeletionTime, null, null); - writer.WriteProperty(options, PropRetentionDeletionTimeMillis, value.RetentionDeletionTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropRetentionFailed, value.RetentionFailed, null, null); - writer.WriteProperty(options, PropRetentionRuns, value.RetentionRuns, null, null); - writer.WriteProperty(options, PropRetentionTimedOut, value.RetentionTimedOut, null, null); - writer.WriteProperty(options, PropTotalSnapshotDeletionFailures, value.TotalSnapshotDeletionFailures, null, null); - writer.WriteProperty(options, PropTotalSnapshotsDeleted, value.TotalSnapshotsDeleted, null, null); - writer.WriteProperty(options, PropTotalSnapshotsFailed, value.TotalSnapshotsFailed, null, null); - writer.WriteProperty(options, PropTotalSnapshotsTaken, value.TotalSnapshotsTaken, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.GetStatsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json.GetStatsResponseConverter))] public sealed partial class GetStatsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -159,52 +39,52 @@ internal GetStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstr public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection PolicyStats { get; set; } +System.Collections.Generic.IReadOnlyCollection PolicyStats { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Duration RetentionDeletionTime { get; set; } +Elastic.Clients.Elasticsearch.Duration RetentionDeletionTime { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.TimeSpan RetentionDeletionTimeMillis { get; set; } +System.TimeSpan RetentionDeletionTimeMillis { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long RetentionFailed { get; set; } +long RetentionFailed { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long RetentionRuns { get; set; } +long RetentionRuns { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long RetentionTimedOut { get; set; } +long RetentionTimedOut { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long TotalSnapshotDeletionFailures { get; set; } +long TotalSnapshotDeletionFailures { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long TotalSnapshotsDeleted { get; set; } +long TotalSnapshotsDeleted { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long TotalSnapshotsFailed { get; set; } +long TotalSnapshotsFailed { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long TotalSnapshotsTaken { get; set; } +long TotalSnapshotsTaken { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleRequest.Converters.g.cs new file mode 100644 index 00000000000..5fbd5b0cc7c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleRequest.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json; + +public sealed partial class PutLifecycleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropConfig = System.Text.Json.JsonEncodedText.Encode("config"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropRepository = System.Text.Json.JsonEncodedText.Encode("repository"); + private static readonly System.Text.Json.JsonEncodedText PropRetention = System.Text.Json.JsonEncodedText.Encode("retention"); + private static readonly System.Text.Json.JsonEncodedText PropSchedule = System.Text.Json.JsonEncodedText.Encode("schedule"); + + public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.PutLifecycleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propConfig = default; + LocalJsonValue propName = default; + LocalJsonValue propRepository = default; + LocalJsonValue propRetention = default; + LocalJsonValue propSchedule = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propConfig.TryReadProperty(ref reader, options, PropConfig, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propRepository.TryReadProperty(ref reader, options, PropRepository, null)) + { + continue; + } + + if (propRetention.TryReadProperty(ref reader, options, PropRetention, null)) + { + continue; + } + + if (propSchedule.TryReadProperty(ref reader, options, PropSchedule, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.PutLifecycleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Config = propConfig.Value, + Name = propName.Value, + Repository = propRepository.Value, + Retention = propRetention.Value, + Schedule = propSchedule.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.PutLifecycleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropConfig, value.Config, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropRepository, value.Repository, null, null); + writer.WriteProperty(options, PropRetention, value.Retention, null, null); + writer.WriteProperty(options, PropSchedule, value.Schedule, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleRequest.g.cs index 0fa8b7000ea..71efec7f4af 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleRequest.g.cs @@ -44,81 +44,6 @@ public sealed partial class PutLifecycleRequestParameters : Elastic.Transport.Re public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutLifecycleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropConfig = System.Text.Json.JsonEncodedText.Encode("config"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropRepository = System.Text.Json.JsonEncodedText.Encode("repository"); - private static readonly System.Text.Json.JsonEncodedText PropRetention = System.Text.Json.JsonEncodedText.Encode("retention"); - private static readonly System.Text.Json.JsonEncodedText PropSchedule = System.Text.Json.JsonEncodedText.Encode("schedule"); - - public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.PutLifecycleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propConfig = default; - LocalJsonValue propName = default; - LocalJsonValue propRepository = default; - LocalJsonValue propRetention = default; - LocalJsonValue propSchedule = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propConfig.TryReadProperty(ref reader, options, PropConfig, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propRepository.TryReadProperty(ref reader, options, PropRepository, null)) - { - continue; - } - - if (propRetention.TryReadProperty(ref reader, options, PropRetention, null)) - { - continue; - } - - if (propSchedule.TryReadProperty(ref reader, options, PropSchedule, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.PutLifecycleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Config = propConfig.Value, - Name = propName.Value, - Repository = propRepository.Value, - Retention = propRetention.Value, - Schedule = propSchedule.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.PutLifecycleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropConfig, value.Config, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropRepository, value.Repository, null, null); - writer.WriteProperty(options, PropRetention, value.Retention, null, null); - writer.WriteProperty(options, PropSchedule, value.Schedule, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create or update a policy. @@ -127,7 +52,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Only the latest version of a policy is stored. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.PutLifecycleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json.PutLifecycleRequestConverter))] public sealed partial class PutLifecycleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleResponse.Converters.g.cs new file mode 100644 index 00000000000..a0dbd0ac8a6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json; + +public sealed partial class PutLifecycleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.PutLifecycleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.PutLifecycleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.PutLifecycleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleResponse.g.cs index f7241586056..6b621685268 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/PutLifecycleResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; -internal sealed partial class PutLifecycleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.PutLifecycleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.PutLifecycleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.PutLifecycleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.PutLifecycleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json.PutLifecycleResponseConverter))] public sealed partial class PutLifecycleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StartSlmRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StartSlmRequest.Converters.g.cs new file mode 100644 index 00000000000..0169bf3f22f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StartSlmRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json; + +public sealed partial class StartSlmRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StartSlmRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StartSlmRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StartSlmRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StartSlmRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StartSlmRequest.g.cs index d510f5a2828..c20eabdf7e4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StartSlmRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StartSlmRequest.g.cs @@ -44,35 +44,6 @@ public sealed partial class StartSlmRequestParameters : Elastic.Transport.Reques public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class StartSlmRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StartSlmRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StartSlmRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StartSlmRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Start snapshot lifecycle management. @@ -80,7 +51,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Manually starting SLM is necessary only if it has been stopped using the stop SLM API. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StartSlmRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json.StartSlmRequestConverter))] public sealed partial class StartSlmRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StartSlmResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StartSlmResponse.Converters.g.cs new file mode 100644 index 00000000000..4a62bec7a78 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StartSlmResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json; + +public sealed partial class StartSlmResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StartSlmResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StartSlmResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StartSlmResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StartSlmResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StartSlmResponse.g.cs index b9940ff5f1a..e885a2223cf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StartSlmResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StartSlmResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; -internal sealed partial class StartSlmResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StartSlmResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StartSlmResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StartSlmResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StartSlmResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json.StartSlmResponseConverter))] public sealed partial class StartSlmResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StopSlmRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StopSlmRequest.Converters.g.cs new file mode 100644 index 00000000000..aaed2eac6fc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StopSlmRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json; + +public sealed partial class StopSlmRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StopSlmRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StopSlmRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StopSlmRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StopSlmRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StopSlmRequest.g.cs index a9bb241cf16..ede1c710fa0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StopSlmRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StopSlmRequest.g.cs @@ -44,35 +44,6 @@ public sealed partial class StopSlmRequestParameters : Elastic.Transport.Request public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class StopSlmRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StopSlmRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StopSlmRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StopSlmRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Stop snapshot lifecycle management. @@ -86,7 +57,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Use the get snapshot lifecycle management status API to see if SLM is running. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StopSlmRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json.StopSlmRequestConverter))] public sealed partial class StopSlmRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StopSlmResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StopSlmResponse.Converters.g.cs new file mode 100644 index 00000000000..f548ffa3921 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StopSlmResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json; + +public sealed partial class StopSlmResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StopSlmResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StopSlmResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StopSlmResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StopSlmResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StopSlmResponse.g.cs index 3eb12056a4c..7e74ecf5c8b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StopSlmResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SnapshotLifecycleManagement/StopSlmResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; -internal sealed partial class StopSlmResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StopSlmResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StopSlmResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StopSlmResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StopSlmResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json.StopSlmResponseConverter))] public sealed partial class StopSlmResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/ClearCursorRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/ClearCursorRequest.Converters.g.cs new file mode 100644 index 00000000000..3870c1d2644 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/ClearCursorRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Sql.Json; + +public sealed partial class ClearCursorRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCursor = System.Text.Json.JsonEncodedText.Encode("cursor"); + + public override Elastic.Clients.Elasticsearch.Sql.ClearCursorRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCursor = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCursor.TryReadProperty(ref reader, options, PropCursor, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Sql.ClearCursorRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Cursor = propCursor.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Sql.ClearCursorRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCursor, value.Cursor, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/ClearCursorRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/ClearCursorRequest.g.cs index 281ed6bb096..f5dfb74becf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/ClearCursorRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/ClearCursorRequest.g.cs @@ -27,51 +27,12 @@ public sealed partial class ClearCursorRequestParameters : Elastic.Transport.Req { } -internal sealed partial class ClearCursorRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCursor = System.Text.Json.JsonEncodedText.Encode("cursor"); - - public override Elastic.Clients.Elasticsearch.Sql.ClearCursorRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCursor = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCursor.TryReadProperty(ref reader, options, PropCursor, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Sql.ClearCursorRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Cursor = propCursor.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Sql.ClearCursorRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCursor, value.Cursor, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Clear an SQL search cursor. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.ClearCursorRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.Json.ClearCursorRequestConverter))] public sealed partial class ClearCursorRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/ClearCursorResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/ClearCursorResponse.Converters.g.cs new file mode 100644 index 00000000000..0796ac7e88d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/ClearCursorResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Sql.Json; + +public sealed partial class ClearCursorResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSucceeded = System.Text.Json.JsonEncodedText.Encode("succeeded"); + + public override Elastic.Clients.Elasticsearch.Sql.ClearCursorResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propSucceeded = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSucceeded.TryReadProperty(ref reader, options, PropSucceeded, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Sql.ClearCursorResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Succeeded = propSucceeded.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Sql.ClearCursorResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSucceeded, value.Succeeded, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/ClearCursorResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/ClearCursorResponse.g.cs index 0107fd85643..bfe58c39125 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/ClearCursorResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/ClearCursorResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Sql; -internal sealed partial class ClearCursorResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSucceeded = System.Text.Json.JsonEncodedText.Encode("succeeded"); - - public override Elastic.Clients.Elasticsearch.Sql.ClearCursorResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propSucceeded = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSucceeded.TryReadProperty(ref reader, options, PropSucceeded, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Sql.ClearCursorResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Succeeded = propSucceeded.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Sql.ClearCursorResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSucceeded, value.Succeeded, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.ClearCursorResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.Json.ClearCursorResponseConverter))] public sealed partial class ClearCursorResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal ClearCursorResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCon public #if NET7_0_OR_GREATER - required +required #endif - bool Succeeded { get; set; } +bool Succeeded { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/DeleteAsyncRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/DeleteAsyncRequest.Converters.g.cs new file mode 100644 index 00000000000..7ec0256b748 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/DeleteAsyncRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Sql.Json; + +public sealed partial class DeleteAsyncRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Sql.DeleteAsyncRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Sql.DeleteAsyncRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Sql.DeleteAsyncRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/DeleteAsyncRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/DeleteAsyncRequest.g.cs index b0f4ea17a1a..942f06837fc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/DeleteAsyncRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/DeleteAsyncRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class DeleteAsyncRequestParameters : Elastic.Transport.Req { } -internal sealed partial class DeleteAsyncRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Sql.DeleteAsyncRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Sql.DeleteAsyncRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Sql.DeleteAsyncRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete an async SQL search. @@ -78,7 +49,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.DeleteAsyncRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.Json.DeleteAsyncRequestConverter))] public sealed partial class DeleteAsyncRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/DeleteAsyncResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/DeleteAsyncResponse.Converters.g.cs new file mode 100644 index 00000000000..208e9b3f51e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/DeleteAsyncResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Sql.Json; + +public sealed partial class DeleteAsyncResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.Sql.DeleteAsyncResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Sql.DeleteAsyncResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Sql.DeleteAsyncResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/DeleteAsyncResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/DeleteAsyncResponse.g.cs index fe8b6e8980f..7b19672e2a3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/DeleteAsyncResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/DeleteAsyncResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Sql; -internal sealed partial class DeleteAsyncResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.Sql.DeleteAsyncResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Sql.DeleteAsyncResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Sql.DeleteAsyncResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.DeleteAsyncResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.Json.DeleteAsyncResponseConverter))] public sealed partial class DeleteAsyncResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncRequest.Converters.g.cs new file mode 100644 index 00000000000..cd1d56baeeb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Sql.Json; + +public sealed partial class GetAsyncRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Sql.GetAsyncRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Sql.GetAsyncRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Sql.GetAsyncRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncRequest.g.cs index 2bf3d8beecc..5c7ab67655b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncRequest.g.cs @@ -59,35 +59,6 @@ public sealed partial class GetAsyncRequestParameters : Elastic.Transport.Reques public Elastic.Clients.Elasticsearch.Duration? WaitForCompletionTimeout { get => Q("wait_for_completion_timeout"); set => Q("wait_for_completion_timeout", value); } } -internal sealed partial class GetAsyncRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Sql.GetAsyncRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Sql.GetAsyncRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Sql.GetAsyncRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get async SQL search results. @@ -97,7 +68,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If the Elasticsearch security features are enabled, only the user who first submitted the SQL search can retrieve the search using this API. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.GetAsyncRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.Json.GetAsyncRequestConverter))] public sealed partial class GetAsyncRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncResponse.Converters.g.cs new file mode 100644 index 00000000000..bb5cd58ceff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncResponse.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Sql.Json; + +public sealed partial class GetAsyncResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropColumns = System.Text.Json.JsonEncodedText.Encode("columns"); + private static readonly System.Text.Json.JsonEncodedText PropCursor = System.Text.Json.JsonEncodedText.Encode("cursor"); + 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"); + + public override Elastic.Clients.Elasticsearch.Sql.GetAsyncResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propColumns = default; + LocalJsonValue propCursor = default; + LocalJsonValue propId = default; + LocalJsonValue propIsPartial = default; + LocalJsonValue propIsRunning = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propColumns.TryReadProperty(ref reader, options, PropColumns, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propCursor.TryReadProperty(ref reader, options, PropCursor, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIsPartial.TryReadProperty(ref reader, options, PropIsPartial, null)) + { + continue; + } + + if (propIsRunning.TryReadProperty(ref reader, options, PropIsRunning, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Sql.GetAsyncResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Columns = propColumns.Value, + Cursor = propCursor.Value, + Id = propId.Value, + IsPartial = propIsPartial.Value, + IsRunning = propIsRunning.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Sql.GetAsyncResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropColumns, value.Columns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCursor, value.Cursor, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIsPartial, value.IsPartial, null, null); + writer.WriteProperty(options, PropIsRunning, value.IsRunning, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncResponse.g.cs index 0b8414c0753..a37b797e8ce 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncResponse.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Sql; -internal sealed partial class GetAsyncResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropColumns = System.Text.Json.JsonEncodedText.Encode("columns"); - private static readonly System.Text.Json.JsonEncodedText PropCursor = System.Text.Json.JsonEncodedText.Encode("cursor"); - 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"); - - public override Elastic.Clients.Elasticsearch.Sql.GetAsyncResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propColumns = default; - LocalJsonValue propCursor = default; - LocalJsonValue propId = default; - LocalJsonValue propIsPartial = default; - LocalJsonValue propIsRunning = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propColumns.TryReadProperty(ref reader, options, PropColumns, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propCursor.TryReadProperty(ref reader, options, PropCursor, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIsPartial.TryReadProperty(ref reader, options, PropIsPartial, null)) - { - continue; - } - - if (propIsRunning.TryReadProperty(ref reader, options, PropIsRunning, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Sql.GetAsyncResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Columns = propColumns.Value, - Cursor = propCursor.Value, - Id = propId.Value, - IsPartial = propIsPartial.Value, - IsRunning = propIsRunning.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Sql.GetAsyncResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropColumns, value.Columns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCursor, value.Cursor, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIsPartial, value.IsPartial, null, null); - writer.WriteProperty(options, PropIsRunning, value.IsRunning, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.GetAsyncResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.Json.GetAsyncResponseConverter))] public partial class GetAsyncResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncStatusRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncStatusRequest.Converters.g.cs new file mode 100644 index 00000000000..9241a81899d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncStatusRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Sql.Json; + +public sealed partial class GetAsyncStatusRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Sql.GetAsyncStatusRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Sql.GetAsyncStatusRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Sql.GetAsyncStatusRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncStatusRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncStatusRequest.g.cs index ddca4c93c32..b5531c9a19e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncStatusRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncStatusRequest.g.cs @@ -27,42 +27,13 @@ public sealed partial class GetAsyncStatusRequestParameters : Elastic.Transport. { } -internal sealed partial class GetAsyncStatusRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Sql.GetAsyncStatusRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Sql.GetAsyncStatusRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Sql.GetAsyncStatusRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get the async SQL search status. /// Get the current status of an async SQL search or a stored synchronous SQL search. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.GetAsyncStatusRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.Json.GetAsyncStatusRequestConverter))] public sealed partial class GetAsyncStatusRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncStatusResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncStatusResponse.Converters.g.cs new file mode 100644 index 00000000000..12cc321ce6f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncStatusResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Sql.Json; + +public sealed partial class GetAsyncStatusResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCompletionStatus = System.Text.Json.JsonEncodedText.Encode("completion_status"); + 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 PropStartTimeInMillis = System.Text.Json.JsonEncodedText.Encode("start_time_in_millis"); + + public override Elastic.Clients.Elasticsearch.Sql.GetAsyncStatusResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCompletionStatus = default; + LocalJsonValue propExpirationTimeInMillis = default; + LocalJsonValue propId = default; + LocalJsonValue propIsPartial = default; + LocalJsonValue propIsRunning = default; + LocalJsonValue propStartTimeInMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCompletionStatus.TryReadProperty(ref reader, options, PropCompletionStatus, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propExpirationTimeInMillis.TryReadProperty(ref reader, options, PropExpirationTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIsPartial.TryReadProperty(ref reader, options, PropIsPartial, null)) + { + continue; + } + + if (propIsRunning.TryReadProperty(ref reader, options, PropIsRunning, null)) + { + continue; + } + + if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Sql.GetAsyncStatusResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CompletionStatus = propCompletionStatus.Value, + ExpirationTimeInMillis = propExpirationTimeInMillis.Value, + Id = propId.Value, + IsPartial = propIsPartial.Value, + IsRunning = propIsRunning.Value, + StartTimeInMillis = propStartTimeInMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Sql.GetAsyncStatusResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCompletionStatus, value.CompletionStatus, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropExpirationTimeInMillis, value.ExpirationTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIsPartial, value.IsPartial, null, null); + writer.WriteProperty(options, PropIsRunning, value.IsRunning, null, null); + writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncStatusResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncStatusResponse.g.cs index 3cfb41e102d..528d71ce05a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncStatusResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/GetAsyncStatusResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Sql; -internal sealed partial class GetAsyncStatusResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCompletionStatus = System.Text.Json.JsonEncodedText.Encode("completion_status"); - 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 PropStartTimeInMillis = System.Text.Json.JsonEncodedText.Encode("start_time_in_millis"); - - public override Elastic.Clients.Elasticsearch.Sql.GetAsyncStatusResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCompletionStatus = default; - LocalJsonValue propExpirationTimeInMillis = default; - LocalJsonValue propId = default; - LocalJsonValue propIsPartial = default; - LocalJsonValue propIsRunning = default; - LocalJsonValue propStartTimeInMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCompletionStatus.TryReadProperty(ref reader, options, PropCompletionStatus, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propExpirationTimeInMillis.TryReadProperty(ref reader, options, PropExpirationTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIsPartial.TryReadProperty(ref reader, options, PropIsPartial, null)) - { - continue; - } - - if (propIsRunning.TryReadProperty(ref reader, options, PropIsRunning, null)) - { - continue; - } - - if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Sql.GetAsyncStatusResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CompletionStatus = propCompletionStatus.Value, - ExpirationTimeInMillis = propExpirationTimeInMillis.Value, - Id = propId.Value, - IsPartial = propIsPartial.Value, - IsRunning = propIsRunning.Value, - StartTimeInMillis = propStartTimeInMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Sql.GetAsyncStatusResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCompletionStatus, value.CompletionStatus, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropExpirationTimeInMillis, value.ExpirationTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIsPartial, value.IsPartial, null, null); - writer.WriteProperty(options, PropIsRunning, value.IsRunning, null, null); - writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.GetAsyncStatusResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.Json.GetAsyncStatusResponseConverter))] public sealed partial class GetAsyncStatusResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/QueryRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/QueryRequest.Converters.g.cs new file mode 100644 index 00000000000..5ea10b65427 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/QueryRequest.Converters.g.cs @@ -0,0 +1,207 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Sql.Json; + +public sealed partial class QueryRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowPartialSearchResults = System.Text.Json.JsonEncodedText.Encode("allow_partial_search_results"); + private static readonly System.Text.Json.JsonEncodedText PropCatalog = System.Text.Json.JsonEncodedText.Encode("catalog"); + private static readonly System.Text.Json.JsonEncodedText PropColumnar = System.Text.Json.JsonEncodedText.Encode("columnar"); + private static readonly System.Text.Json.JsonEncodedText PropCursor = System.Text.Json.JsonEncodedText.Encode("cursor"); + private static readonly System.Text.Json.JsonEncodedText PropFetchSize = System.Text.Json.JsonEncodedText.Encode("fetch_size"); + private static readonly System.Text.Json.JsonEncodedText PropFieldMultiValueLeniency = System.Text.Json.JsonEncodedText.Encode("field_multi_value_leniency"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropIndexUsingFrozen = System.Text.Json.JsonEncodedText.Encode("index_using_frozen"); + private static readonly System.Text.Json.JsonEncodedText PropKeepAlive = System.Text.Json.JsonEncodedText.Encode("keep_alive"); + private static readonly System.Text.Json.JsonEncodedText PropKeepOnCompletion = System.Text.Json.JsonEncodedText.Encode("keep_on_completion"); + private static readonly System.Text.Json.JsonEncodedText PropPageTimeout = System.Text.Json.JsonEncodedText.Encode("page_timeout"); + private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropRequestTimeout = System.Text.Json.JsonEncodedText.Encode("request_timeout"); + private static readonly System.Text.Json.JsonEncodedText PropRuntimeMappings = System.Text.Json.JsonEncodedText.Encode("runtime_mappings"); + private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"); + private static readonly System.Text.Json.JsonEncodedText PropWaitForCompletionTimeout = System.Text.Json.JsonEncodedText.Encode("wait_for_completion_timeout"); + + public override Elastic.Clients.Elasticsearch.Sql.QueryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowPartialSearchResults = default; + LocalJsonValue propCatalog = default; + LocalJsonValue propColumnar = default; + LocalJsonValue propCursor = default; + LocalJsonValue propFetchSize = default; + LocalJsonValue propFieldMultiValueLeniency = default; + LocalJsonValue propFilter = default; + LocalJsonValue propIndexUsingFrozen = default; + LocalJsonValue propKeepAlive = default; + LocalJsonValue propKeepOnCompletion = default; + LocalJsonValue propPageTimeout = default; + LocalJsonValue?> propParams = default; + LocalJsonValue propQuery = default; + LocalJsonValue propRequestTimeout = default; + LocalJsonValue?> propRuntimeMappings = default; + LocalJsonValue propTimeZone = default; + LocalJsonValue propWaitForCompletionTimeout = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowPartialSearchResults.TryReadProperty(ref reader, options, PropAllowPartialSearchResults, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCatalog.TryReadProperty(ref reader, options, PropCatalog, null)) + { + continue; + } + + if (propColumnar.TryReadProperty(ref reader, options, PropColumnar, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCursor.TryReadProperty(ref reader, options, PropCursor, null)) + { + continue; + } + + if (propFetchSize.TryReadProperty(ref reader, options, PropFetchSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFieldMultiValueLeniency.TryReadProperty(ref reader, options, PropFieldMultiValueLeniency, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) + { + continue; + } + + if (propIndexUsingFrozen.TryReadProperty(ref reader, options, PropIndexUsingFrozen, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propKeepAlive.TryReadProperty(ref reader, options, PropKeepAlive, null)) + { + continue; + } + + if (propKeepOnCompletion.TryReadProperty(ref reader, options, PropKeepOnCompletion, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPageTimeout.TryReadProperty(ref reader, options, PropPageTimeout, null)) + { + continue; + } + + if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propRequestTimeout.TryReadProperty(ref reader, options, PropRequestTimeout, null)) + { + continue; + } + + if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propTimeZone.TryReadProperty(ref reader, options, PropTimeZone, null)) + { + continue; + } + + if (propWaitForCompletionTimeout.TryReadProperty(ref reader, options, PropWaitForCompletionTimeout, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Sql.QueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowPartialSearchResults = propAllowPartialSearchResults.Value, + Catalog = propCatalog.Value, + Columnar = propColumnar.Value, + Cursor = propCursor.Value, + FetchSize = propFetchSize.Value, + FieldMultiValueLeniency = propFieldMultiValueLeniency.Value, + Filter = propFilter.Value, + IndexUsingFrozen = propIndexUsingFrozen.Value, + KeepAlive = propKeepAlive.Value, + KeepOnCompletion = propKeepOnCompletion.Value, + PageTimeout = propPageTimeout.Value, + Params = propParams.Value, + Query = propQuery.Value, + RequestTimeout = propRequestTimeout.Value, + RuntimeMappings = propRuntimeMappings.Value, + TimeZone = propTimeZone.Value, + WaitForCompletionTimeout = propWaitForCompletionTimeout.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Sql.QueryRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowPartialSearchResults, value.AllowPartialSearchResults, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCatalog, value.Catalog, null, null); + writer.WriteProperty(options, PropColumnar, value.Columnar, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCursor, value.Cursor, null, null); + writer.WriteProperty(options, PropFetchSize, value.FetchSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFieldMultiValueLeniency, value.FieldMultiValueLeniency, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFilter, value.Filter, null, null); + writer.WriteProperty(options, PropIndexUsingFrozen, value.IndexUsingFrozen, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropKeepAlive, value.KeepAlive, null, null); + writer.WriteProperty(options, PropKeepOnCompletion, value.KeepOnCompletion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPageTimeout, value.PageTimeout, null, null); + writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropRequestTimeout, value.RequestTimeout, null, null); + writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); + writer.WriteProperty(options, PropWaitForCompletionTimeout, value.WaitForCompletionTimeout, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/QueryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/QueryRequest.g.cs index cceede2895f..c1608f4d143 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/QueryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/QueryRequest.g.cs @@ -35,196 +35,13 @@ public sealed partial class QueryRequestParameters : Elastic.Transport.RequestPa public Elastic.Clients.Elasticsearch.Sql.SqlFormat? Format { get => Q("format"); set => Q("format", value); } } -internal sealed partial class QueryRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowPartialSearchResults = System.Text.Json.JsonEncodedText.Encode("allow_partial_search_results"); - private static readonly System.Text.Json.JsonEncodedText PropCatalog = System.Text.Json.JsonEncodedText.Encode("catalog"); - private static readonly System.Text.Json.JsonEncodedText PropColumnar = System.Text.Json.JsonEncodedText.Encode("columnar"); - private static readonly System.Text.Json.JsonEncodedText PropCursor = System.Text.Json.JsonEncodedText.Encode("cursor"); - private static readonly System.Text.Json.JsonEncodedText PropFetchSize = System.Text.Json.JsonEncodedText.Encode("fetch_size"); - private static readonly System.Text.Json.JsonEncodedText PropFieldMultiValueLeniency = System.Text.Json.JsonEncodedText.Encode("field_multi_value_leniency"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropIndexUsingFrozen = System.Text.Json.JsonEncodedText.Encode("index_using_frozen"); - private static readonly System.Text.Json.JsonEncodedText PropKeepAlive = System.Text.Json.JsonEncodedText.Encode("keep_alive"); - private static readonly System.Text.Json.JsonEncodedText PropKeepOnCompletion = System.Text.Json.JsonEncodedText.Encode("keep_on_completion"); - private static readonly System.Text.Json.JsonEncodedText PropPageTimeout = System.Text.Json.JsonEncodedText.Encode("page_timeout"); - private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropRequestTimeout = System.Text.Json.JsonEncodedText.Encode("request_timeout"); - private static readonly System.Text.Json.JsonEncodedText PropRuntimeMappings = System.Text.Json.JsonEncodedText.Encode("runtime_mappings"); - private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"); - private static readonly System.Text.Json.JsonEncodedText PropWaitForCompletionTimeout = System.Text.Json.JsonEncodedText.Encode("wait_for_completion_timeout"); - - public override Elastic.Clients.Elasticsearch.Sql.QueryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowPartialSearchResults = default; - LocalJsonValue propCatalog = default; - LocalJsonValue propColumnar = default; - LocalJsonValue propCursor = default; - LocalJsonValue propFetchSize = default; - LocalJsonValue propFieldMultiValueLeniency = default; - LocalJsonValue propFilter = default; - LocalJsonValue propIndexUsingFrozen = default; - LocalJsonValue propKeepAlive = default; - LocalJsonValue propKeepOnCompletion = default; - LocalJsonValue propPageTimeout = default; - LocalJsonValue?> propParams = default; - LocalJsonValue propQuery = default; - LocalJsonValue propRequestTimeout = default; - LocalJsonValue?> propRuntimeMappings = default; - LocalJsonValue propTimeZone = default; - LocalJsonValue propWaitForCompletionTimeout = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowPartialSearchResults.TryReadProperty(ref reader, options, PropAllowPartialSearchResults, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCatalog.TryReadProperty(ref reader, options, PropCatalog, null)) - { - continue; - } - - if (propColumnar.TryReadProperty(ref reader, options, PropColumnar, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCursor.TryReadProperty(ref reader, options, PropCursor, null)) - { - continue; - } - - if (propFetchSize.TryReadProperty(ref reader, options, PropFetchSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFieldMultiValueLeniency.TryReadProperty(ref reader, options, PropFieldMultiValueLeniency, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) - { - continue; - } - - if (propIndexUsingFrozen.TryReadProperty(ref reader, options, PropIndexUsingFrozen, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propKeepAlive.TryReadProperty(ref reader, options, PropKeepAlive, null)) - { - continue; - } - - if (propKeepOnCompletion.TryReadProperty(ref reader, options, PropKeepOnCompletion, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPageTimeout.TryReadProperty(ref reader, options, PropPageTimeout, null)) - { - continue; - } - - if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propRequestTimeout.TryReadProperty(ref reader, options, PropRequestTimeout, null)) - { - continue; - } - - if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propTimeZone.TryReadProperty(ref reader, options, PropTimeZone, null)) - { - continue; - } - - if (propWaitForCompletionTimeout.TryReadProperty(ref reader, options, PropWaitForCompletionTimeout, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Sql.QueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowPartialSearchResults = propAllowPartialSearchResults.Value, - Catalog = propCatalog.Value, - Columnar = propColumnar.Value, - Cursor = propCursor.Value, - FetchSize = propFetchSize.Value, - FieldMultiValueLeniency = propFieldMultiValueLeniency.Value, - Filter = propFilter.Value, - IndexUsingFrozen = propIndexUsingFrozen.Value, - KeepAlive = propKeepAlive.Value, - KeepOnCompletion = propKeepOnCompletion.Value, - PageTimeout = propPageTimeout.Value, - Params = propParams.Value, - Query = propQuery.Value, - RequestTimeout = propRequestTimeout.Value, - RuntimeMappings = propRuntimeMappings.Value, - TimeZone = propTimeZone.Value, - WaitForCompletionTimeout = propWaitForCompletionTimeout.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Sql.QueryRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowPartialSearchResults, value.AllowPartialSearchResults, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCatalog, value.Catalog, null, null); - writer.WriteProperty(options, PropColumnar, value.Columnar, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCursor, value.Cursor, null, null); - writer.WriteProperty(options, PropFetchSize, value.FetchSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFieldMultiValueLeniency, value.FieldMultiValueLeniency, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFilter, value.Filter, null, null); - writer.WriteProperty(options, PropIndexUsingFrozen, value.IndexUsingFrozen, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropKeepAlive, value.KeepAlive, null, null); - writer.WriteProperty(options, PropKeepOnCompletion, value.KeepOnCompletion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPageTimeout, value.PageTimeout, null, null); - writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropRequestTimeout, value.RequestTimeout, null, null); - writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); - writer.WriteProperty(options, PropWaitForCompletionTimeout, value.WaitForCompletionTimeout, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Get SQL search results. /// Run an SQL request. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.QueryRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.Json.QueryRequestConverter))] public sealed partial class QueryRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/QueryResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/QueryResponse.Converters.g.cs new file mode 100644 index 00000000000..091e67de232 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/QueryResponse.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Sql.Json; + +public sealed partial class QueryResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropColumns = System.Text.Json.JsonEncodedText.Encode("columns"); + private static readonly System.Text.Json.JsonEncodedText PropCursor = System.Text.Json.JsonEncodedText.Encode("cursor"); + 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"); + + public override Elastic.Clients.Elasticsearch.Sql.QueryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propColumns = default; + LocalJsonValue propCursor = default; + LocalJsonValue propId = default; + LocalJsonValue propIsPartial = default; + LocalJsonValue propIsRunning = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propColumns.TryReadProperty(ref reader, options, PropColumns, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propCursor.TryReadProperty(ref reader, options, PropCursor, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIsPartial.TryReadProperty(ref reader, options, PropIsPartial, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIsRunning.TryReadProperty(ref reader, options, PropIsRunning, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Sql.QueryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Columns = propColumns.Value, + Cursor = propCursor.Value, + Id = propId.Value, + IsPartial = propIsPartial.Value, + IsRunning = propIsRunning.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Sql.QueryResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropColumns, value.Columns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCursor, value.Cursor, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIsPartial, value.IsPartial, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIsRunning, value.IsRunning, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/QueryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/QueryResponse.g.cs index fa95d0b7f11..114d6089418 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/QueryResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/QueryResponse.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Sql; -internal sealed partial class QueryResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropColumns = System.Text.Json.JsonEncodedText.Encode("columns"); - private static readonly System.Text.Json.JsonEncodedText PropCursor = System.Text.Json.JsonEncodedText.Encode("cursor"); - 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"); - - public override Elastic.Clients.Elasticsearch.Sql.QueryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propColumns = default; - LocalJsonValue propCursor = default; - LocalJsonValue propId = default; - LocalJsonValue propIsPartial = default; - LocalJsonValue propIsRunning = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propColumns.TryReadProperty(ref reader, options, PropColumns, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propCursor.TryReadProperty(ref reader, options, PropCursor, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIsPartial.TryReadProperty(ref reader, options, PropIsPartial, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIsRunning.TryReadProperty(ref reader, options, PropIsRunning, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Sql.QueryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Columns = propColumns.Value, - Cursor = propCursor.Value, - Id = propId.Value, - IsPartial = propIsPartial.Value, - IsRunning = propIsRunning.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Sql.QueryResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropColumns, value.Columns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCursor, value.Cursor, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIsPartial, value.IsPartial, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIsRunning, value.IsRunning, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.QueryResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.Json.QueryResponseConverter))] public partial class QueryResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateRequest.Converters.g.cs new file mode 100644 index 00000000000..6fc5c602476 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateRequest.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Sql.Json; + +public sealed partial class TranslateRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFetchSize = System.Text.Json.JsonEncodedText.Encode("fetch_size"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"); + + public override Elastic.Clients.Elasticsearch.Sql.TranslateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFetchSize = default; + LocalJsonValue propFilter = default; + LocalJsonValue propQuery = default; + LocalJsonValue propTimeZone = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFetchSize.TryReadProperty(ref reader, options, PropFetchSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propTimeZone.TryReadProperty(ref reader, options, PropTimeZone, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Sql.TranslateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FetchSize = propFetchSize.Value, + Filter = propFilter.Value, + Query = propQuery.Value, + TimeZone = propTimeZone.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Sql.TranslateRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFetchSize, value.FetchSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFilter, value.Filter, null, null); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateRequest.g.cs index dbe91200e95..543a9212f0c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateRequest.g.cs @@ -27,72 +27,6 @@ public sealed partial class TranslateRequestParameters : Elastic.Transport.Reque { } -internal sealed partial class TranslateRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFetchSize = System.Text.Json.JsonEncodedText.Encode("fetch_size"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"); - - public override Elastic.Clients.Elasticsearch.Sql.TranslateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFetchSize = default; - LocalJsonValue propFilter = default; - LocalJsonValue propQuery = default; - LocalJsonValue propTimeZone = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFetchSize.TryReadProperty(ref reader, options, PropFetchSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propTimeZone.TryReadProperty(ref reader, options, PropTimeZone, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Sql.TranslateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FetchSize = propFetchSize.Value, - Filter = propFilter.Value, - Query = propQuery.Value, - TimeZone = propTimeZone.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Sql.TranslateRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFetchSize, value.FetchSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFilter, value.Filter, null, null); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Translate SQL into Elasticsearch queries. @@ -100,7 +34,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// It accepts the same request body parameters as the SQL search API, excluding cursor. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.TranslateRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.Json.TranslateRequestConverter))] public sealed partial class TranslateRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.Converters.g.cs new file mode 100644 index 00000000000..19a8fec5cb4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Sql.Json; + +public sealed partial class TranslateResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + 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"); + + public override Elastic.Clients.Elasticsearch.Sql.TranslateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAggregations = default; + LocalJsonValue?> propFields = default; + LocalJsonValue propQuery = default; + LocalJsonValue propSize = default; + LocalJsonValue?> propSort = default; + LocalJsonValue propSource = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Sql.TranslateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = propAggregations.Value, + Fields = propFields.Value, + Query = propQuery.Value, + Size = propSize.Value, + Sort = propSort.Value, + Source = propSource.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Sql.TranslateResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.g.cs index 922993e9ab5..2da5d5dfafd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Sql; -internal sealed partial class TranslateResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - 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"); - - public override Elastic.Clients.Elasticsearch.Sql.TranslateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAggregations = default; - LocalJsonValue?> propFields = default; - LocalJsonValue propQuery = default; - LocalJsonValue propSize = default; - LocalJsonValue?> propSort = default; - LocalJsonValue propSource = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Sql.TranslateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = propAggregations.Value, - Fields = propFields.Value, - Query = propQuery.Value, - Size = propSize.Value, - Sort = propSort.Value, - Source = propSource.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Sql.TranslateResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.TranslateResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.Json.TranslateResponseConverter))] public sealed partial class TranslateResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRequest.Converters.g.cs new file mode 100644 index 00000000000..2cfdd3c504c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms.Json; + +public sealed partial class DeleteSynonymRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRequest.g.cs index 2448794ca57..a7b94ce7597 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRequest.g.cs @@ -27,35 +27,6 @@ public sealed partial class DeleteSynonymRequestParameters : Elastic.Transport.R { } -internal sealed partial class DeleteSynonymRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete a synonym set. @@ -83,7 +54,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// When the synonyms set is not used in analyzers, you will be able to delete it. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.Json.DeleteSynonymRequestConverter))] public sealed partial class DeleteSynonymRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymResponse.Converters.g.cs new file mode 100644 index 00000000000..7399341cd92 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms.Json; + +public sealed partial class DeleteSynonymResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymResponse.g.cs index 89781208d65..c412cec28d4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Synonyms; -internal sealed partial class DeleteSynonymResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.Json.DeleteSynonymResponseConverter))] public sealed partial class DeleteSynonymResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRuleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRuleRequest.Converters.g.cs new file mode 100644 index 00000000000..3be06665332 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRuleRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms.Json; + +public sealed partial class DeleteSynonymRuleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymRuleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymRuleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymRuleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRuleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRuleRequest.g.cs index 899ec86c339..5df8810c838 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRuleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRuleRequest.g.cs @@ -34,42 +34,13 @@ public sealed partial class DeleteSynonymRuleRequestParameters : Elastic.Transpo public bool? Refresh { get => Q("refresh"); set => Q("refresh", value); } } -internal sealed partial class DeleteSynonymRuleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymRuleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymRuleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymRuleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete a synonym rule. /// Delete a synonym rule from a synonym set. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymRuleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.Json.DeleteSynonymRuleRequestConverter))] public sealed partial class DeleteSynonymRuleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRuleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRuleResponse.Converters.g.cs new file mode 100644 index 00000000000..ae93e8e747b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRuleResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms.Json; + +public sealed partial class DeleteSynonymRuleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropReloadAnalyzersDetails = System.Text.Json.JsonEncodedText.Encode("reload_analyzers_details"); + private static readonly System.Text.Json.JsonEncodedText PropResult = System.Text.Json.JsonEncodedText.Encode("result"); + + public override Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymRuleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propReloadAnalyzersDetails = default; + LocalJsonValue propResult = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propReloadAnalyzersDetails.TryReadProperty(ref reader, options, PropReloadAnalyzersDetails, null)) + { + continue; + } + + if (propResult.TryReadProperty(ref reader, options, PropResult, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymRuleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ReloadAnalyzersDetails = propReloadAnalyzersDetails.Value, + Result = propResult.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymRuleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropReloadAnalyzersDetails, value.ReloadAnalyzersDetails, null, null); + writer.WriteProperty(options, PropResult, value.Result, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRuleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRuleResponse.g.cs index c500d833860..2fa4238fd4e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRuleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/DeleteSynonymRuleResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Synonyms; -internal sealed partial class DeleteSynonymRuleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropReloadAnalyzersDetails = System.Text.Json.JsonEncodedText.Encode("reload_analyzers_details"); - private static readonly System.Text.Json.JsonEncodedText PropResult = System.Text.Json.JsonEncodedText.Encode("result"); - - public override Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymRuleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propReloadAnalyzersDetails = default; - LocalJsonValue propResult = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propReloadAnalyzersDetails.TryReadProperty(ref reader, options, PropReloadAnalyzersDetails, null)) - { - continue; - } - - if (propResult.TryReadProperty(ref reader, options, PropResult, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymRuleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ReloadAnalyzersDetails = propReloadAnalyzersDetails.Value, - Result = propResult.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymRuleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropReloadAnalyzersDetails, value.ReloadAnalyzersDetails, null, null); - writer.WriteProperty(options, PropResult, value.Result, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.DeleteSynonymRuleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.Json.DeleteSynonymRuleResponseConverter))] public sealed partial class DeleteSynonymRuleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRequest.Converters.g.cs new file mode 100644 index 00000000000..5ecb6e11194 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms.Json; + +public sealed partial class GetSynonymRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Synonyms.GetSynonymRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Synonyms.GetSynonymRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.GetSynonymRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRequest.g.cs index e2f4edbcdf0..795bd57196b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRequest.g.cs @@ -40,41 +40,12 @@ public sealed partial class GetSynonymRequestParameters : Elastic.Transport.Requ public int? Size { get => Q("size"); set => Q("size", value); } } -internal sealed partial class GetSynonymRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Synonyms.GetSynonymRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Synonyms.GetSynonymRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.GetSynonymRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get a synonym set. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.GetSynonymRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.Json.GetSynonymRequestConverter))] public sealed partial class GetSynonymRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymResponse.Converters.g.cs new file mode 100644 index 00000000000..706827bb210 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms.Json; + +public sealed partial class GetSynonymResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropSynonymsSet = System.Text.Json.JsonEncodedText.Encode("synonyms_set"); + + public override Elastic.Clients.Elasticsearch.Synonyms.GetSynonymResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propSynonymsSet = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propSynonymsSet.TryReadProperty(ref reader, options, PropSynonymsSet, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Synonyms.GetSynonymResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + SynonymsSet = propSynonymsSet.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.GetSynonymResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropSynonymsSet, value.SynonymsSet, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymResponse.g.cs index 34e00c3d73c..4d72b338a18 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Synonyms; -internal sealed partial class GetSynonymResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropSynonymsSet = System.Text.Json.JsonEncodedText.Encode("synonyms_set"); - - public override Elastic.Clients.Elasticsearch.Synonyms.GetSynonymResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propSynonymsSet = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propSynonymsSet.TryReadProperty(ref reader, options, PropSynonymsSet, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Synonyms.GetSynonymResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - SynonymsSet = propSynonymsSet.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.GetSynonymResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropSynonymsSet, value.SynonymsSet, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.GetSynonymResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.Json.GetSynonymResponseConverter))] public sealed partial class GetSynonymResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRuleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRuleRequest.Converters.g.cs new file mode 100644 index 00000000000..db929f96bb5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRuleRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms.Json; + +public sealed partial class GetSynonymRuleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Synonyms.GetSynonymRuleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Synonyms.GetSynonymRuleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.GetSynonymRuleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRuleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRuleRequest.g.cs index c3d09de42fa..77bca08663f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRuleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRuleRequest.g.cs @@ -27,42 +27,13 @@ public sealed partial class GetSynonymRuleRequestParameters : Elastic.Transport. { } -internal sealed partial class GetSynonymRuleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Synonyms.GetSynonymRuleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Synonyms.GetSynonymRuleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.GetSynonymRuleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get a synonym rule. /// Get a synonym rule from a synonym set. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.GetSynonymRuleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.Json.GetSynonymRuleRequestConverter))] public sealed partial class GetSynonymRuleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRuleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRuleResponse.Converters.g.cs new file mode 100644 index 00000000000..a1c312c2c44 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRuleResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms.Json; + +public sealed partial class GetSynonymRuleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropSynonyms = System.Text.Json.JsonEncodedText.Encode("synonyms"); + + public override Elastic.Clients.Elasticsearch.Synonyms.GetSynonymRuleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propSynonyms = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propSynonyms.TryReadProperty(ref reader, options, PropSynonyms, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Synonyms.GetSynonymRuleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + Synonyms = propSynonyms.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.GetSynonymRuleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropSynonyms, value.Synonyms, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRuleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRuleResponse.g.cs index de9e48a3108..8334b2e3c65 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRuleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRuleResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Synonyms; -internal sealed partial class GetSynonymRuleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropSynonyms = System.Text.Json.JsonEncodedText.Encode("synonyms"); - - public override Elastic.Clients.Elasticsearch.Synonyms.GetSynonymRuleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue propSynonyms = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propSynonyms.TryReadProperty(ref reader, options, PropSynonyms, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Synonyms.GetSynonymRuleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - Synonyms = propSynonyms.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.GetSynonymRuleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropSynonyms, value.Synonyms, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.GetSynonymRuleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.Json.GetSynonymRuleResponseConverter))] public sealed partial class GetSynonymRuleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymsSetsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymsSetsRequest.Converters.g.cs new file mode 100644 index 00000000000..fc1db7bfe52 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymsSetsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms.Json; + +public sealed partial class GetSynonymsSetsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Synonyms.GetSynonymsSetsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Synonyms.GetSynonymsSetsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.GetSynonymsSetsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymsSetsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymsSetsRequest.g.cs index 78b5f3e546b..b8c5dedeb97 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymsSetsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymsSetsRequest.g.cs @@ -40,42 +40,13 @@ public sealed partial class GetSynonymsSetsRequestParameters : Elastic.Transport public int? Size { get => Q("size"); set => Q("size", value); } } -internal sealed partial class GetSynonymsSetsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Synonyms.GetSynonymsSetsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Synonyms.GetSynonymsSetsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.GetSynonymsSetsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get all synonym sets. /// Get a summary of all defined synonym sets. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.GetSynonymsSetsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.Json.GetSynonymsSetsRequestConverter))] public sealed partial class GetSynonymsSetsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymsSetsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymsSetsResponse.Converters.g.cs new file mode 100644 index 00000000000..b34fd7d8059 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymsSetsResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms.Json; + +public sealed partial class GetSynonymsSetsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropResults = System.Text.Json.JsonEncodedText.Encode("results"); + + public override Elastic.Clients.Elasticsearch.Synonyms.GetSynonymsSetsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propResults = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propResults.TryReadProperty(ref reader, options, PropResults, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Synonyms.GetSynonymsSetsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Results = propResults.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.GetSynonymsSetsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropResults, value.Results, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymsSetsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymsSetsResponse.g.cs index 025d54cfb48..04c12adb352 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymsSetsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymsSetsResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Synonyms; -internal sealed partial class GetSynonymsSetsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropResults = System.Text.Json.JsonEncodedText.Encode("results"); - - public override Elastic.Clients.Elasticsearch.Synonyms.GetSynonymsSetsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propResults = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propResults.TryReadProperty(ref reader, options, PropResults, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Synonyms.GetSynonymsSetsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Results = propResults.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.GetSynonymsSetsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropResults, value.Results, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.GetSynonymsSetsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.Json.GetSynonymsSetsResponseConverter))] public sealed partial class GetSynonymsSetsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRequest.Converters.g.cs new file mode 100644 index 00000000000..481bc0f6b86 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms.Json; + +public sealed partial class PutSynonymRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSynonymsSet = System.Text.Json.JsonEncodedText.Encode("synonyms_set"); + + public override Elastic.Clients.Elasticsearch.Synonyms.PutSynonymRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propSynonymsSet = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSynonymsSet.TryReadProperty(ref reader, options, PropSynonymsSet, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Synonyms.PutSynonymRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + SynonymsSet = propSynonymsSet.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.PutSynonymRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSynonymsSet, value.SynonymsSet, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRequest.g.cs index 2b1e54b0e6c..af77d2cd0b8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRequest.g.cs @@ -34,45 +34,6 @@ public sealed partial class PutSynonymRequestParameters : Elastic.Transport.Requ public bool? Refresh { get => Q("refresh"); set => Q("refresh", value); } } -internal sealed partial class PutSynonymRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSynonymsSet = System.Text.Json.JsonEncodedText.Encode("synonyms_set"); - - public override Elastic.Clients.Elasticsearch.Synonyms.PutSynonymRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propSynonymsSet = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSynonymsSet.TryReadProperty(ref reader, options, PropSynonymsSet, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Synonyms.PutSynonymRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - SynonymsSet = propSynonymsSet.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.PutSynonymRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSynonymsSet, value.SynonymsSet, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// Create or update a synonym set. @@ -87,7 +48,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// For practical examples of how to create or update a synonyms set, refer to the External documentation. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.PutSynonymRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.Json.PutSynonymRequestConverter))] public sealed partial class PutSynonymRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymResponse.Converters.g.cs new file mode 100644 index 00000000000..d0265e7729a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms.Json; + +public sealed partial class PutSynonymResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropReloadAnalyzersDetails = System.Text.Json.JsonEncodedText.Encode("reload_analyzers_details"); + private static readonly System.Text.Json.JsonEncodedText PropResult = System.Text.Json.JsonEncodedText.Encode("result"); + + public override Elastic.Clients.Elasticsearch.Synonyms.PutSynonymResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propReloadAnalyzersDetails = default; + LocalJsonValue propResult = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propReloadAnalyzersDetails.TryReadProperty(ref reader, options, PropReloadAnalyzersDetails, null)) + { + continue; + } + + if (propResult.TryReadProperty(ref reader, options, PropResult, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Synonyms.PutSynonymResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ReloadAnalyzersDetails = propReloadAnalyzersDetails.Value, + Result = propResult.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.PutSynonymResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropReloadAnalyzersDetails, value.ReloadAnalyzersDetails, null, null); + writer.WriteProperty(options, PropResult, value.Result, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymResponse.g.cs index 8747b94f1c3..74a28cb3324 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Synonyms; -internal sealed partial class PutSynonymResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropReloadAnalyzersDetails = System.Text.Json.JsonEncodedText.Encode("reload_analyzers_details"); - private static readonly System.Text.Json.JsonEncodedText PropResult = System.Text.Json.JsonEncodedText.Encode("result"); - - public override Elastic.Clients.Elasticsearch.Synonyms.PutSynonymResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propReloadAnalyzersDetails = default; - LocalJsonValue propResult = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propReloadAnalyzersDetails.TryReadProperty(ref reader, options, PropReloadAnalyzersDetails, null)) - { - continue; - } - - if (propResult.TryReadProperty(ref reader, options, PropResult, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Synonyms.PutSynonymResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ReloadAnalyzersDetails = propReloadAnalyzersDetails.Value, - Result = propResult.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.PutSynonymResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropReloadAnalyzersDetails, value.ReloadAnalyzersDetails, null, null); - writer.WriteProperty(options, PropResult, value.Result, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.PutSynonymResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.Json.PutSynonymResponseConverter))] public sealed partial class PutSynonymResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRuleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRuleRequest.Converters.g.cs new file mode 100644 index 00000000000..07340cfd711 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRuleRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms.Json; + +public sealed partial class PutSynonymRuleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSynonyms = System.Text.Json.JsonEncodedText.Encode("synonyms"); + + public override Elastic.Clients.Elasticsearch.Synonyms.PutSynonymRuleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propSynonyms = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSynonyms.TryReadProperty(ref reader, options, PropSynonyms, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Synonyms.PutSynonymRuleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Synonyms = propSynonyms.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.PutSynonymRuleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSynonyms, value.Synonyms, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRuleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRuleRequest.g.cs index 2c4f31e8055..356bbfdb0ae 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRuleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRuleRequest.g.cs @@ -34,45 +34,6 @@ public sealed partial class PutSynonymRuleRequestParameters : Elastic.Transport. public bool? Refresh { get => Q("refresh"); set => Q("refresh", value); } } -internal sealed partial class PutSynonymRuleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSynonyms = System.Text.Json.JsonEncodedText.Encode("synonyms"); - - public override Elastic.Clients.Elasticsearch.Synonyms.PutSynonymRuleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propSynonyms = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSynonyms.TryReadProperty(ref reader, options, PropSynonyms, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Synonyms.PutSynonymRuleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Synonyms = propSynonyms.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.PutSynonymRuleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSynonyms, value.Synonyms, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create or update a synonym rule. @@ -85,7 +46,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// When you update a synonym rule, all analyzers using the synonyms set will be reloaded automatically to reflect the new rule. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.PutSynonymRuleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.Json.PutSynonymRuleRequestConverter))] public sealed partial class PutSynonymRuleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRuleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRuleResponse.Converters.g.cs new file mode 100644 index 00000000000..df10e01baff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRuleResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms.Json; + +public sealed partial class PutSynonymRuleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropReloadAnalyzersDetails = System.Text.Json.JsonEncodedText.Encode("reload_analyzers_details"); + private static readonly System.Text.Json.JsonEncodedText PropResult = System.Text.Json.JsonEncodedText.Encode("result"); + + public override Elastic.Clients.Elasticsearch.Synonyms.PutSynonymRuleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propReloadAnalyzersDetails = default; + LocalJsonValue propResult = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propReloadAnalyzersDetails.TryReadProperty(ref reader, options, PropReloadAnalyzersDetails, null)) + { + continue; + } + + if (propResult.TryReadProperty(ref reader, options, PropResult, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Synonyms.PutSynonymRuleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ReloadAnalyzersDetails = propReloadAnalyzersDetails.Value, + Result = propResult.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.PutSynonymRuleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropReloadAnalyzersDetails, value.ReloadAnalyzersDetails, null, null); + writer.WriteProperty(options, PropResult, value.Result, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRuleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRuleResponse.g.cs index f19de590e4a..9183191d458 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRuleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRuleResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Synonyms; -internal sealed partial class PutSynonymRuleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropReloadAnalyzersDetails = System.Text.Json.JsonEncodedText.Encode("reload_analyzers_details"); - private static readonly System.Text.Json.JsonEncodedText PropResult = System.Text.Json.JsonEncodedText.Encode("result"); - - public override Elastic.Clients.Elasticsearch.Synonyms.PutSynonymRuleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propReloadAnalyzersDetails = default; - LocalJsonValue propResult = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propReloadAnalyzersDetails.TryReadProperty(ref reader, options, PropReloadAnalyzersDetails, null)) - { - continue; - } - - if (propResult.TryReadProperty(ref reader, options, PropResult, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Synonyms.PutSynonymRuleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ReloadAnalyzersDetails = propReloadAnalyzersDetails.Value, - Result = propResult.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.PutSynonymRuleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropReloadAnalyzersDetails, value.ReloadAnalyzersDetails, null, null); - writer.WriteProperty(options, PropResult, value.Result, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.PutSynonymRuleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.Json.PutSynonymRuleResponseConverter))] public sealed partial class PutSynonymRuleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/CancelRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/CancelRequest.Converters.g.cs new file mode 100644 index 00000000000..7c9b9e2876b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/CancelRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Tasks.Json; + +public sealed partial class CancelRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Tasks.CancelRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Tasks.CancelRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Tasks.CancelRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/CancelRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/CancelRequest.g.cs index c45d75145ef..8f789eaa6ad 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/CancelRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/CancelRequest.g.cs @@ -54,35 +54,6 @@ public sealed partial class CancelRequestParameters : Elastic.Transport.RequestP public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } } -internal sealed partial class CancelRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Tasks.CancelRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Tasks.CancelRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Tasks.CancelRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Cancel a task. @@ -102,7 +73,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// You can also use the node hot threads API to obtain detailed information about the work the system is doing instead of completing the cancelled task. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Tasks.CancelRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Tasks.Json.CancelRequestConverter))] public sealed partial class CancelRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public CancelRequest(Elastic.Clients.Elasticsearch.TaskId? taskId) : base(r => r.Optional("task_id", taskId)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/CancelResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/CancelResponse.Converters.g.cs new file mode 100644 index 00000000000..a39b3f92d5d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/CancelResponse.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Tasks.Json; + +public sealed partial class CancelResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNodeFailures = System.Text.Json.JsonEncodedText.Encode("node_failures"); + private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); + private static readonly System.Text.Json.JsonEncodedText PropTaskFailures = System.Text.Json.JsonEncodedText.Encode("task_failures"); + private static readonly System.Text.Json.JsonEncodedText PropTasks = System.Text.Json.JsonEncodedText.Encode("tasks"); + + public override Elastic.Clients.Elasticsearch.Tasks.CancelResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propNodeFailures = default; + LocalJsonValue?> propNodes = default; + LocalJsonValue?> propTaskFailures = default; + LocalJsonValue propTasks = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNodeFailures.TryReadProperty(ref reader, options, PropNodeFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propTaskFailures.TryReadProperty(ref reader, options, PropTaskFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTasks.TryReadProperty(ref reader, options, PropTasks, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Tasks.CancelResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + NodeFailures = propNodeFailures.Value, + Nodes = propNodes.Value, + TaskFailures = propTaskFailures.Value, + Tasks = propTasks.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Tasks.CancelResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNodeFailures, value.NodeFailures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropTaskFailures, value.TaskFailures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTasks, value.Tasks, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/CancelResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/CancelResponse.g.cs index 91ff24bb706..4b292d738e2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/CancelResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/CancelResponse.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Tasks; -internal sealed partial class CancelResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNodeFailures = System.Text.Json.JsonEncodedText.Encode("node_failures"); - private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); - private static readonly System.Text.Json.JsonEncodedText PropTaskFailures = System.Text.Json.JsonEncodedText.Encode("task_failures"); - private static readonly System.Text.Json.JsonEncodedText PropTasks = System.Text.Json.JsonEncodedText.Encode("tasks"); - - public override Elastic.Clients.Elasticsearch.Tasks.CancelResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propNodeFailures = default; - LocalJsonValue?> propNodes = default; - LocalJsonValue?> propTaskFailures = default; - LocalJsonValue propTasks = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNodeFailures.TryReadProperty(ref reader, options, PropNodeFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propTaskFailures.TryReadProperty(ref reader, options, PropTaskFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTasks.TryReadProperty(ref reader, options, PropTasks, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Tasks.CancelResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - NodeFailures = propNodeFailures.Value, - Nodes = propNodes.Value, - TaskFailures = propTaskFailures.Value, - Tasks = propTasks.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Tasks.CancelResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNodeFailures, value.NodeFailures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropTaskFailures, value.TaskFailures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTasks, value.Tasks, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Tasks.CancelResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Tasks.Json.CancelResponseConverter))] public sealed partial class CancelResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/GetTasksRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/GetTasksRequest.Converters.g.cs new file mode 100644 index 00000000000..bde1d73148e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/GetTasksRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Tasks.Json; + +public sealed partial class GetTasksRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Tasks.GetTasksRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Tasks.GetTasksRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Tasks.GetTasksRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/GetTasksRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/GetTasksRequest.g.cs index 0b553cc0440..64b68f34426 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/GetTasksRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/GetTasksRequest.g.cs @@ -41,35 +41,6 @@ public sealed partial class GetTasksRequestParameters : Elastic.Transport.Reques public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } } -internal sealed partial class GetTasksRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Tasks.GetTasksRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Tasks.GetTasksRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Tasks.GetTasksRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get task information. @@ -83,7 +54,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If the task identifier is not found, a 404 response code indicates that there are no resources that match the request. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Tasks.GetTasksRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Tasks.Json.GetTasksRequestConverter))] public sealed partial class GetTasksRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/GetTasksResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/GetTasksResponse.Converters.g.cs new file mode 100644 index 00000000000..53d60bcf10a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/GetTasksResponse.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Tasks.Json; + +public sealed partial class GetTasksResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCompleted = System.Text.Json.JsonEncodedText.Encode("completed"); + private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); + private static readonly System.Text.Json.JsonEncodedText PropResponse = System.Text.Json.JsonEncodedText.Encode("response"); + private static readonly System.Text.Json.JsonEncodedText PropTask = System.Text.Json.JsonEncodedText.Encode("task"); + + public override Elastic.Clients.Elasticsearch.Tasks.GetTasksResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCompleted = default; + LocalJsonValue propError = default; + LocalJsonValue propResponse = default; + LocalJsonValue propTask = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCompleted.TryReadProperty(ref reader, options, PropCompleted, null)) + { + continue; + } + + if (propError.TryReadProperty(ref reader, options, PropError, null)) + { + continue; + } + + if (propResponse.TryReadProperty(ref reader, options, PropResponse, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTask.TryReadProperty(ref reader, options, PropTask, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Tasks.GetTasksResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Completed = propCompleted.Value, + Error = propError.Value, + Response = propResponse.Value, + Task = propTask.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Tasks.GetTasksResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCompleted, value.Completed, null, null); + writer.WriteProperty(options, PropError, value.Error, null, null); + writer.WriteProperty(options, PropResponse, value.Response, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTask, value.Task, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/GetTasksResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/GetTasksResponse.g.cs index b880c73456c..dcd5cef62f6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/GetTasksResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/GetTasksResponse.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Tasks; -internal sealed partial class GetTasksResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCompleted = System.Text.Json.JsonEncodedText.Encode("completed"); - private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); - private static readonly System.Text.Json.JsonEncodedText PropResponse = System.Text.Json.JsonEncodedText.Encode("response"); - private static readonly System.Text.Json.JsonEncodedText PropTask = System.Text.Json.JsonEncodedText.Encode("task"); - - public override Elastic.Clients.Elasticsearch.Tasks.GetTasksResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCompleted = default; - LocalJsonValue propError = default; - LocalJsonValue propResponse = default; - LocalJsonValue propTask = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCompleted.TryReadProperty(ref reader, options, PropCompleted, null)) - { - continue; - } - - if (propError.TryReadProperty(ref reader, options, PropError, null)) - { - continue; - } - - if (propResponse.TryReadProperty(ref reader, options, PropResponse, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propTask.TryReadProperty(ref reader, options, PropTask, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Tasks.GetTasksResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Completed = propCompleted.Value, - Error = propError.Value, - Response = propResponse.Value, - Task = propTask.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Tasks.GetTasksResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCompleted, value.Completed, null, null); - writer.WriteProperty(options, PropError, value.Error, null, null); - writer.WriteProperty(options, PropResponse, value.Response, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTask, value.Task, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Tasks.GetTasksResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Tasks.Json.GetTasksResponseConverter))] public sealed partial class GetTasksResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -105,14 +39,14 @@ internal GetTasksResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstr public #if NET7_0_OR_GREATER - required +required #endif - bool Completed { get; set; } +bool Completed { get; set; } public Elastic.Clients.Elasticsearch.ErrorCause? Error { get; set; } public object? Response { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Tasks.TaskInfo Task { get; set; } +Elastic.Clients.Elasticsearch.Tasks.TaskInfo Task { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/ListRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/ListRequest.Converters.g.cs new file mode 100644 index 00000000000..2aa71447db0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/ListRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Tasks.Json; + +public sealed partial class ListRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Tasks.ListRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Tasks.ListRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Tasks.ListRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/ListRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/ListRequest.g.cs index 26389b33fbb..c12d292bcd5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/ListRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/ListRequest.g.cs @@ -82,35 +82,6 @@ public sealed partial class ListRequestParameters : Elastic.Transport.RequestPar public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } } -internal sealed partial class ListRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Tasks.ListRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Tasks.ListRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Tasks.ListRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get all tasks. @@ -178,7 +149,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The X-Opaque-Id in the children headers is the child task of the task that was initiated by the REST request. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Tasks.ListRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Tasks.Json.ListRequestConverter))] public sealed partial class ListRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/ListResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/ListResponse.Converters.g.cs new file mode 100644 index 00000000000..cc722f9dd5e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/ListResponse.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Tasks.Json; + +public sealed partial class ListResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNodeFailures = System.Text.Json.JsonEncodedText.Encode("node_failures"); + private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); + private static readonly System.Text.Json.JsonEncodedText PropTaskFailures = System.Text.Json.JsonEncodedText.Encode("task_failures"); + private static readonly System.Text.Json.JsonEncodedText PropTasks = System.Text.Json.JsonEncodedText.Encode("tasks"); + + public override Elastic.Clients.Elasticsearch.Tasks.ListResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propNodeFailures = default; + LocalJsonValue?> propNodes = default; + LocalJsonValue?> propTaskFailures = default; + LocalJsonValue propTasks = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNodeFailures.TryReadProperty(ref reader, options, PropNodeFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propTaskFailures.TryReadProperty(ref reader, options, PropTaskFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTasks.TryReadProperty(ref reader, options, PropTasks, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Tasks.ListResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + NodeFailures = propNodeFailures.Value, + Nodes = propNodes.Value, + TaskFailures = propTaskFailures.Value, + Tasks = propTasks.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Tasks.ListResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNodeFailures, value.NodeFailures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropTaskFailures, value.TaskFailures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTasks, value.Tasks, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/ListResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/ListResponse.g.cs index 5e6e0bd8489..b45bcbb60af 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/ListResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Tasks/ListResponse.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Tasks; -internal sealed partial class ListResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNodeFailures = System.Text.Json.JsonEncodedText.Encode("node_failures"); - private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); - private static readonly System.Text.Json.JsonEncodedText PropTaskFailures = System.Text.Json.JsonEncodedText.Encode("task_failures"); - private static readonly System.Text.Json.JsonEncodedText PropTasks = System.Text.Json.JsonEncodedText.Encode("tasks"); - - public override Elastic.Clients.Elasticsearch.Tasks.ListResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propNodeFailures = default; - LocalJsonValue?> propNodes = default; - LocalJsonValue?> propTaskFailures = default; - LocalJsonValue propTasks = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNodeFailures.TryReadProperty(ref reader, options, PropNodeFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propTaskFailures.TryReadProperty(ref reader, options, PropTaskFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTasks.TryReadProperty(ref reader, options, PropTasks, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Tasks.ListResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - NodeFailures = propNodeFailures.Value, - Nodes = propNodes.Value, - TaskFailures = propTaskFailures.Value, - Tasks = propTasks.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Tasks.ListResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNodeFailures, value.NodeFailures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropTaskFailures, value.TaskFailures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTasks, value.Tasks, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Tasks.ListResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Tasks.Json.ListResponseConverter))] public sealed partial class ListResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermVectorsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermVectorsRequest.Converters.g.cs new file mode 100644 index 00000000000..5d84b47bae3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermVectorsRequest.Converters.g.cs @@ -0,0 +1,178 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class TermVectorsRequestConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropDoc = System.Text.Json.JsonEncodedText.Encode("doc"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropFieldStatistics = System.Text.Json.JsonEncodedText.Encode("field_statistics"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropOffsets = System.Text.Json.JsonEncodedText.Encode("offsets"); + private static readonly System.Text.Json.JsonEncodedText PropPayloads = System.Text.Json.JsonEncodedText.Encode("payloads"); + private static readonly System.Text.Json.JsonEncodedText PropPerFieldAnalyzer = System.Text.Json.JsonEncodedText.Encode("per_field_analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropPositions = System.Text.Json.JsonEncodedText.Encode("positions"); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); + private static readonly System.Text.Json.JsonEncodedText PropTermStatistics = System.Text.Json.JsonEncodedText.Encode("term_statistics"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + private static readonly System.Text.Json.JsonEncodedText PropVersionType = System.Text.Json.JsonEncodedText.Encode("version_type"); + + public override Elastic.Clients.Elasticsearch.TermVectorsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDoc = default; + LocalJsonValue propFields = default; + LocalJsonValue propFieldStatistics = default; + LocalJsonValue propFilter = default; + LocalJsonValue propOffsets = default; + LocalJsonValue propPayloads = default; + LocalJsonValue?> propPerFieldAnalyzer = default; + LocalJsonValue propPositions = default; + LocalJsonValue propRouting = default; + LocalJsonValue propTermStatistics = default; + LocalJsonValue propVersion = default; + LocalJsonValue propVersionType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDoc.TryReadProperty(ref reader, options, PropDoc, static TDocument? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propFieldStatistics.TryReadProperty(ref reader, options, PropFieldStatistics, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) + { + continue; + } + + if (propOffsets.TryReadProperty(ref reader, options, PropOffsets, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPayloads.TryReadProperty(ref reader, options, PropPayloads, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPerFieldAnalyzer.TryReadProperty(ref reader, options, PropPerFieldAnalyzer, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propPositions.TryReadProperty(ref reader, options, PropPositions, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (propTermStatistics.TryReadProperty(ref reader, options, PropTermStatistics, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propVersionType.TryReadProperty(ref reader, options, PropVersionType, static Elastic.Clients.Elasticsearch.VersionType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TermVectorsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Doc = propDoc.Value, + Fields = propFields.Value, + FieldStatistics = propFieldStatistics.Value, + Filter = propFilter.Value, + Offsets = propOffsets.Value, + Payloads = propPayloads.Value, + PerFieldAnalyzer = propPerFieldAnalyzer.Value, + Positions = propPositions.Value, + Routing = propRouting.Value, + TermStatistics = propTermStatistics.Value, + Version = propVersion.Value, + VersionType = propVersionType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TermVectorsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDoc, value.Doc, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TDocument? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropFieldStatistics, value.FieldStatistics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFilter, value.Filter, null, null); + writer.WriteProperty(options, PropOffsets, value.Offsets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPayloads, value.Payloads, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPerFieldAnalyzer, value.PerFieldAnalyzer, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropPositions, value.Positions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteProperty(options, PropTermStatistics, value.TermStatistics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVersionType, value.VersionType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.VersionType? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} + +public sealed partial class TermVectorsRequestConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(TermVectorsRequest<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(TermVectorsRequestConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermVectorsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermVectorsRequest.g.cs index 5c040d55512..a14c48ab957 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermVectorsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermVectorsRequest.g.cs @@ -41,160 +41,6 @@ public sealed partial class TermVectorsRequestParameters : Elastic.Transport.Req public bool? Realtime { get => Q("realtime"); set => Q("realtime", value); } } -internal sealed partial class TermVectorsRequestConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropDoc = System.Text.Json.JsonEncodedText.Encode("doc"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropFieldStatistics = System.Text.Json.JsonEncodedText.Encode("field_statistics"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropOffsets = System.Text.Json.JsonEncodedText.Encode("offsets"); - private static readonly System.Text.Json.JsonEncodedText PropPayloads = System.Text.Json.JsonEncodedText.Encode("payloads"); - private static readonly System.Text.Json.JsonEncodedText PropPerFieldAnalyzer = System.Text.Json.JsonEncodedText.Encode("per_field_analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropPositions = System.Text.Json.JsonEncodedText.Encode("positions"); - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); - private static readonly System.Text.Json.JsonEncodedText PropTermStatistics = System.Text.Json.JsonEncodedText.Encode("term_statistics"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - private static readonly System.Text.Json.JsonEncodedText PropVersionType = System.Text.Json.JsonEncodedText.Encode("version_type"); - - public override Elastic.Clients.Elasticsearch.TermVectorsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDoc = default; - LocalJsonValue propFields = default; - LocalJsonValue propFieldStatistics = default; - LocalJsonValue propFilter = default; - LocalJsonValue propOffsets = default; - LocalJsonValue propPayloads = default; - LocalJsonValue?> propPerFieldAnalyzer = default; - LocalJsonValue propPositions = default; - LocalJsonValue propRouting = default; - LocalJsonValue propTermStatistics = default; - LocalJsonValue propVersion = default; - LocalJsonValue propVersionType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDoc.TryReadProperty(ref reader, options, PropDoc, static TDocument? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propFieldStatistics.TryReadProperty(ref reader, options, PropFieldStatistics, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) - { - continue; - } - - if (propOffsets.TryReadProperty(ref reader, options, PropOffsets, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPayloads.TryReadProperty(ref reader, options, PropPayloads, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPerFieldAnalyzer.TryReadProperty(ref reader, options, PropPerFieldAnalyzer, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propPositions.TryReadProperty(ref reader, options, PropPositions, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (propTermStatistics.TryReadProperty(ref reader, options, PropTermStatistics, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propVersionType.TryReadProperty(ref reader, options, PropVersionType, static Elastic.Clients.Elasticsearch.VersionType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TermVectorsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Doc = propDoc.Value, - Fields = propFields.Value, - FieldStatistics = propFieldStatistics.Value, - Filter = propFilter.Value, - Offsets = propOffsets.Value, - Payloads = propPayloads.Value, - PerFieldAnalyzer = propPerFieldAnalyzer.Value, - Positions = propPositions.Value, - Routing = propRouting.Value, - TermStatistics = propTermStatistics.Value, - Version = propVersion.Value, - VersionType = propVersionType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TermVectorsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDoc, value.Doc, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TDocument? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropFieldStatistics, value.FieldStatistics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFilter, value.Filter, null, null); - writer.WriteProperty(options, PropOffsets, value.Offsets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPayloads, value.Payloads, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPerFieldAnalyzer, value.PerFieldAnalyzer, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropPositions, value.Positions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteProperty(options, PropTermStatistics, value.TermStatistics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropVersionType, value.VersionType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.VersionType? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -internal sealed partial class TermVectorsRequestConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(TermVectorsRequest<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(TermVectorsRequestConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - /// /// /// Get term vector information. @@ -267,7 +113,7 @@ public override System.Text.Json.Serialization.JsonConverter CreateConverter(Sys /// Refer to the linked documentation for detailed examples of how to use this API. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TermVectorsRequestConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.TermVectorsRequestConverterFactory))] public sealed partial class TermVectorsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermVectorsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermVectorsResponse.Converters.g.cs new file mode 100644 index 00000000000..cf58fa4fb1f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermVectorsResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class TermVectorsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFound = System.Text.Json.JsonEncodedText.Encode("found"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); + private static readonly System.Text.Json.JsonEncodedText PropTermVectors = System.Text.Json.JsonEncodedText.Encode("term_vectors"); + private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("_version"); + + public override Elastic.Clients.Elasticsearch.TermVectorsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFound = default; + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propTermVectors = default; + LocalJsonValue propTook = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFound.TryReadProperty(ref reader, options, PropFound, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propTermVectors.TryReadProperty(ref reader, options, PropTermVectors, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propTook.TryReadProperty(ref reader, options, PropTook, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TermVectorsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Found = propFound.Value, + Id = propId.Value, + Index = propIndex.Value, + TermVectors = propTermVectors.Value, + Took = propTook.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TermVectorsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFound, value.Found, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropTermVectors, value.TermVectors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropTook, value.Took, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermVectorsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermVectorsResponse.g.cs index ddb9be969c1..515e948d290 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermVectorsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermVectorsResponse.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class TermVectorsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFound = System.Text.Json.JsonEncodedText.Encode("found"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); - private static readonly System.Text.Json.JsonEncodedText PropTermVectors = System.Text.Json.JsonEncodedText.Encode("term_vectors"); - private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("_version"); - - public override Elastic.Clients.Elasticsearch.TermVectorsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFound = default; - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propTermVectors = default; - LocalJsonValue propTook = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFound.TryReadProperty(ref reader, options, PropFound, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propTermVectors.TryReadProperty(ref reader, options, PropTermVectors, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propTook.TryReadProperty(ref reader, options, PropTook, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TermVectorsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Found = propFound.Value, - Id = propId.Value, - Index = propIndex.Value, - TermVectors = propTermVectors.Value, - Took = propTook.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TermVectorsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFound, value.Found, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropTermVectors, value.TermVectors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropTook, value.Took, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TermVectorsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.TermVectorsResponseConverter))] public sealed partial class TermVectorsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -123,24 +39,24 @@ internal TermVectorsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCon public #if NET7_0_OR_GREATER - required +required #endif - bool Found { get; set; } +bool Found { get; set; } public string? Id { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Index { get; set; } +string Index { get; set; } public System.Collections.Generic.IReadOnlyDictionary? TermVectors { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long Took { get; set; } +long Took { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long Version { get; set; } +long Version { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermsEnumRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermsEnumRequest.Converters.g.cs new file mode 100644 index 00000000000..b0006df551f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermsEnumRequest.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class TermsEnumRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCaseInsensitive = System.Text.Json.JsonEncodedText.Encode("case_insensitive"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIndexFilter = System.Text.Json.JsonEncodedText.Encode("index_filter"); + private static readonly System.Text.Json.JsonEncodedText PropSearchAfter = System.Text.Json.JsonEncodedText.Encode("search_after"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropString = System.Text.Json.JsonEncodedText.Encode("string"); + private static readonly System.Text.Json.JsonEncodedText PropTimeout = System.Text.Json.JsonEncodedText.Encode("timeout"); + + public override Elastic.Clients.Elasticsearch.TermsEnumRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCaseInsensitive = default; + LocalJsonValue propField = default; + LocalJsonValue propIndexFilter = default; + LocalJsonValue propSearchAfter = default; + LocalJsonValue propSize = default; + LocalJsonValue propString = default; + LocalJsonValue propTimeout = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCaseInsensitive.TryReadProperty(ref reader, options, PropCaseInsensitive, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIndexFilter.TryReadProperty(ref reader, options, PropIndexFilter, null)) + { + continue; + } + + if (propSearchAfter.TryReadProperty(ref reader, options, PropSearchAfter, null)) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propString.TryReadProperty(ref reader, options, PropString, null)) + { + continue; + } + + if (propTimeout.TryReadProperty(ref reader, options, PropTimeout, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TermsEnumRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CaseInsensitive = propCaseInsensitive.Value, + Field = propField.Value, + IndexFilter = propIndexFilter.Value, + SearchAfter = propSearchAfter.Value, + Size = propSize.Value, + String = propString.Value, + Timeout = propTimeout.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TermsEnumRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCaseInsensitive, value.CaseInsensitive, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIndexFilter, value.IndexFilter, null, null); + writer.WriteProperty(options, PropSearchAfter, value.SearchAfter, null, null); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropString, value.String, null, null); + writer.WriteProperty(options, PropTimeout, value.Timeout, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermsEnumRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermsEnumRequest.g.cs index bdc6e0d2d4b..7c8899cc54c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermsEnumRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermsEnumRequest.g.cs @@ -27,99 +27,6 @@ public sealed partial class TermsEnumRequestParameters : Elastic.Transport.Reque { } -internal sealed partial class TermsEnumRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCaseInsensitive = System.Text.Json.JsonEncodedText.Encode("case_insensitive"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIndexFilter = System.Text.Json.JsonEncodedText.Encode("index_filter"); - private static readonly System.Text.Json.JsonEncodedText PropSearchAfter = System.Text.Json.JsonEncodedText.Encode("search_after"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropString = System.Text.Json.JsonEncodedText.Encode("string"); - private static readonly System.Text.Json.JsonEncodedText PropTimeout = System.Text.Json.JsonEncodedText.Encode("timeout"); - - public override Elastic.Clients.Elasticsearch.TermsEnumRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCaseInsensitive = default; - LocalJsonValue propField = default; - LocalJsonValue propIndexFilter = default; - LocalJsonValue propSearchAfter = default; - LocalJsonValue propSize = default; - LocalJsonValue propString = default; - LocalJsonValue propTimeout = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCaseInsensitive.TryReadProperty(ref reader, options, PropCaseInsensitive, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIndexFilter.TryReadProperty(ref reader, options, PropIndexFilter, null)) - { - continue; - } - - if (propSearchAfter.TryReadProperty(ref reader, options, PropSearchAfter, null)) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propString.TryReadProperty(ref reader, options, PropString, null)) - { - continue; - } - - if (propTimeout.TryReadProperty(ref reader, options, PropTimeout, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TermsEnumRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CaseInsensitive = propCaseInsensitive.Value, - Field = propField.Value, - IndexFilter = propIndexFilter.Value, - SearchAfter = propSearchAfter.Value, - Size = propSize.Value, - String = propString.Value, - Timeout = propTimeout.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TermsEnumRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCaseInsensitive, value.CaseInsensitive, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIndexFilter, value.IndexFilter, null, null); - writer.WriteProperty(options, PropSearchAfter, value.SearchAfter, null, null); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropString, value.String, null, null); - writer.WriteProperty(options, PropTimeout, value.Timeout, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Get terms in an index. @@ -133,7 +40,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The terms enum API may return terms from deleted documents. Deleted documents are initially only marked as deleted. It is not until their segments are merged that documents are actually deleted. Until that happens, the terms enum API will return terms from these documents. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TermsEnumRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.TermsEnumRequestConverter))] public sealed partial class TermsEnumRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermsEnumResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermsEnumResponse.Converters.g.cs new file mode 100644 index 00000000000..5b2ba42f909 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermsEnumResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class TermsEnumResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropComplete = System.Text.Json.JsonEncodedText.Encode("complete"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + private static readonly System.Text.Json.JsonEncodedText PropTerms = System.Text.Json.JsonEncodedText.Encode("terms"); + + public override Elastic.Clients.Elasticsearch.TermsEnumResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propComplete = default; + LocalJsonValue propShards = default; + LocalJsonValue> propTerms = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propComplete.TryReadProperty(ref reader, options, PropComplete, null)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (propTerms.TryReadProperty(ref reader, options, PropTerms, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TermsEnumResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Complete = propComplete.Value, + Shards = propShards.Value, + Terms = propTerms.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TermsEnumResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropComplete, value.Complete, null, null); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteProperty(options, PropTerms, value.Terms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermsEnumResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermsEnumResponse.g.cs index 239edfcd47c..3ea4ad051d8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermsEnumResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TermsEnumResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class TermsEnumResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropComplete = System.Text.Json.JsonEncodedText.Encode("complete"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - private static readonly System.Text.Json.JsonEncodedText PropTerms = System.Text.Json.JsonEncodedText.Encode("terms"); - - public override Elastic.Clients.Elasticsearch.TermsEnumResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propComplete = default; - LocalJsonValue propShards = default; - LocalJsonValue> propTerms = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propComplete.TryReadProperty(ref reader, options, PropComplete, null)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (propTerms.TryReadProperty(ref reader, options, PropTerms, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TermsEnumResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Complete = propComplete.Value, - Shards = propShards.Value, - Terms = propTerms.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TermsEnumResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropComplete, value.Complete, null, null); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteProperty(options, PropTerms, value.Terms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TermsEnumResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.TermsEnumResponseConverter))] public sealed partial class TermsEnumResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindFieldStructureRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindFieldStructureRequest.Converters.g.cs new file mode 100644 index 00000000000..31ed3fd0ae5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindFieldStructureRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TextStructure.Json; + +public sealed partial class FindFieldStructureRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.TextStructure.FindFieldStructureRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TextStructure.FindFieldStructureRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextStructure.FindFieldStructureRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindFieldStructureRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindFieldStructureRequest.g.cs index 6eb514c5440..1b89f297d44 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindFieldStructureRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindFieldStructureRequest.g.cs @@ -273,35 +273,6 @@ public sealed partial class FindFieldStructureRequestParameters : Elastic.Transp public string? TimestampFormat { get => Q("timestamp_format"); set => Q("timestamp_format", value); } } -internal sealed partial class FindFieldStructureRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.TextStructure.FindFieldStructureRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TextStructure.FindFieldStructureRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextStructure.FindFieldStructureRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Find the structure of a text field. @@ -345,7 +316,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// It helps determine why the returned structure was chosen. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TextStructure.FindFieldStructureRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TextStructure.Json.FindFieldStructureRequestConverter))] public sealed partial class FindFieldStructureRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindFieldStructureResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindFieldStructureResponse.Converters.g.cs new file mode 100644 index 00000000000..4fe1b4546fd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindFieldStructureResponse.Converters.g.cs @@ -0,0 +1,189 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TextStructure.Json; + +public sealed partial class FindFieldStructureResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCharset = System.Text.Json.JsonEncodedText.Encode("charset"); + private static readonly System.Text.Json.JsonEncodedText PropEcsCompatibility = System.Text.Json.JsonEncodedText.Encode("ecs_compatibility"); + private static readonly System.Text.Json.JsonEncodedText PropFieldStats = System.Text.Json.JsonEncodedText.Encode("field_stats"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropGrokPattern = System.Text.Json.JsonEncodedText.Encode("grok_pattern"); + private static readonly System.Text.Json.JsonEncodedText PropIngestPipeline = System.Text.Json.JsonEncodedText.Encode("ingest_pipeline"); + private static readonly System.Text.Json.JsonEncodedText PropJavaTimestampFormats = System.Text.Json.JsonEncodedText.Encode("java_timestamp_formats"); + private static readonly System.Text.Json.JsonEncodedText PropJodaTimestampFormats = System.Text.Json.JsonEncodedText.Encode("joda_timestamp_formats"); + private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); + private static readonly System.Text.Json.JsonEncodedText PropMultilineStartPattern = System.Text.Json.JsonEncodedText.Encode("multiline_start_pattern"); + private static readonly System.Text.Json.JsonEncodedText PropNeedClientTimezone = System.Text.Json.JsonEncodedText.Encode("need_client_timezone"); + private static readonly System.Text.Json.JsonEncodedText PropNumLinesAnalyzed = System.Text.Json.JsonEncodedText.Encode("num_lines_analyzed"); + private static readonly System.Text.Json.JsonEncodedText PropNumMessagesAnalyzed = System.Text.Json.JsonEncodedText.Encode("num_messages_analyzed"); + private static readonly System.Text.Json.JsonEncodedText PropSampleStart = System.Text.Json.JsonEncodedText.Encode("sample_start"); + private static readonly System.Text.Json.JsonEncodedText PropTimestampField = System.Text.Json.JsonEncodedText.Encode("timestamp_field"); + + public override Elastic.Clients.Elasticsearch.TextStructure.FindFieldStructureResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCharset = default; + LocalJsonValue propEcsCompatibility = default; + LocalJsonValue> propFieldStats = default; + LocalJsonValue propFormat = default; + LocalJsonValue propGrokPattern = default; + LocalJsonValue propIngestPipeline = default; + LocalJsonValue?> propJavaTimestampFormats = default; + LocalJsonValue?> propJodaTimestampFormats = default; + LocalJsonValue propMappings = default; + LocalJsonValue propMultilineStartPattern = default; + LocalJsonValue propNeedClientTimezone = default; + LocalJsonValue propNumLinesAnalyzed = default; + LocalJsonValue propNumMessagesAnalyzed = default; + LocalJsonValue propSampleStart = default; + LocalJsonValue propTimestampField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCharset.TryReadProperty(ref reader, options, PropCharset, null)) + { + continue; + } + + if (propEcsCompatibility.TryReadProperty(ref reader, options, PropEcsCompatibility, static Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFieldStats.TryReadProperty(ref reader, options, PropFieldStats, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propGrokPattern.TryReadProperty(ref reader, options, PropGrokPattern, null)) + { + continue; + } + + if (propIngestPipeline.TryReadProperty(ref reader, options, PropIngestPipeline, null)) + { + continue; + } + + if (propJavaTimestampFormats.TryReadProperty(ref reader, options, PropJavaTimestampFormats, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propJodaTimestampFormats.TryReadProperty(ref reader, options, PropJodaTimestampFormats, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) + { + continue; + } + + if (propMultilineStartPattern.TryReadProperty(ref reader, options, PropMultilineStartPattern, null)) + { + continue; + } + + if (propNeedClientTimezone.TryReadProperty(ref reader, options, PropNeedClientTimezone, null)) + { + continue; + } + + if (propNumLinesAnalyzed.TryReadProperty(ref reader, options, PropNumLinesAnalyzed, null)) + { + continue; + } + + if (propNumMessagesAnalyzed.TryReadProperty(ref reader, options, PropNumMessagesAnalyzed, null)) + { + continue; + } + + if (propSampleStart.TryReadProperty(ref reader, options, PropSampleStart, null)) + { + continue; + } + + if (propTimestampField.TryReadProperty(ref reader, options, PropTimestampField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TextStructure.FindFieldStructureResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Charset = propCharset.Value, + EcsCompatibility = propEcsCompatibility.Value, + FieldStats = propFieldStats.Value, + Format = propFormat.Value, + GrokPattern = propGrokPattern.Value, + IngestPipeline = propIngestPipeline.Value, + JavaTimestampFormats = propJavaTimestampFormats.Value, + JodaTimestampFormats = propJodaTimestampFormats.Value, + Mappings = propMappings.Value, + MultilineStartPattern = propMultilineStartPattern.Value, + NeedClientTimezone = propNeedClientTimezone.Value, + NumLinesAnalyzed = propNumLinesAnalyzed.Value, + NumMessagesAnalyzed = propNumMessagesAnalyzed.Value, + SampleStart = propSampleStart.Value, + TimestampField = propTimestampField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextStructure.FindFieldStructureResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCharset, value.Charset, null, null); + writer.WriteProperty(options, PropEcsCompatibility, value.EcsCompatibility, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFieldStats, value.FieldStats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropGrokPattern, value.GrokPattern, null, null); + writer.WriteProperty(options, PropIngestPipeline, value.IngestPipeline, null, null); + writer.WriteProperty(options, PropJavaTimestampFormats, value.JavaTimestampFormats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropJodaTimestampFormats, value.JodaTimestampFormats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMappings, value.Mappings, null, null); + writer.WriteProperty(options, PropMultilineStartPattern, value.MultilineStartPattern, null, null); + writer.WriteProperty(options, PropNeedClientTimezone, value.NeedClientTimezone, null, null); + writer.WriteProperty(options, PropNumLinesAnalyzed, value.NumLinesAnalyzed, null, null); + writer.WriteProperty(options, PropNumMessagesAnalyzed, value.NumMessagesAnalyzed, null, null); + writer.WriteProperty(options, PropSampleStart, value.SampleStart, null, null); + writer.WriteProperty(options, PropTimestampField, value.TimestampField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindFieldStructureResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindFieldStructureResponse.g.cs index fe5c21229fb..c1260cabe91 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindFieldStructureResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindFieldStructureResponse.g.cs @@ -23,172 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TextStructure; -internal sealed partial class FindFieldStructureResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCharset = System.Text.Json.JsonEncodedText.Encode("charset"); - private static readonly System.Text.Json.JsonEncodedText PropEcsCompatibility = System.Text.Json.JsonEncodedText.Encode("ecs_compatibility"); - private static readonly System.Text.Json.JsonEncodedText PropFieldStats = System.Text.Json.JsonEncodedText.Encode("field_stats"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropGrokPattern = System.Text.Json.JsonEncodedText.Encode("grok_pattern"); - private static readonly System.Text.Json.JsonEncodedText PropIngestPipeline = System.Text.Json.JsonEncodedText.Encode("ingest_pipeline"); - private static readonly System.Text.Json.JsonEncodedText PropJavaTimestampFormats = System.Text.Json.JsonEncodedText.Encode("java_timestamp_formats"); - private static readonly System.Text.Json.JsonEncodedText PropJodaTimestampFormats = System.Text.Json.JsonEncodedText.Encode("joda_timestamp_formats"); - private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); - private static readonly System.Text.Json.JsonEncodedText PropMultilineStartPattern = System.Text.Json.JsonEncodedText.Encode("multiline_start_pattern"); - private static readonly System.Text.Json.JsonEncodedText PropNeedClientTimezone = System.Text.Json.JsonEncodedText.Encode("need_client_timezone"); - private static readonly System.Text.Json.JsonEncodedText PropNumLinesAnalyzed = System.Text.Json.JsonEncodedText.Encode("num_lines_analyzed"); - private static readonly System.Text.Json.JsonEncodedText PropNumMessagesAnalyzed = System.Text.Json.JsonEncodedText.Encode("num_messages_analyzed"); - private static readonly System.Text.Json.JsonEncodedText PropSampleStart = System.Text.Json.JsonEncodedText.Encode("sample_start"); - private static readonly System.Text.Json.JsonEncodedText PropTimestampField = System.Text.Json.JsonEncodedText.Encode("timestamp_field"); - - public override Elastic.Clients.Elasticsearch.TextStructure.FindFieldStructureResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCharset = default; - LocalJsonValue propEcsCompatibility = default; - LocalJsonValue> propFieldStats = default; - LocalJsonValue propFormat = default; - LocalJsonValue propGrokPattern = default; - LocalJsonValue propIngestPipeline = default; - LocalJsonValue?> propJavaTimestampFormats = default; - LocalJsonValue?> propJodaTimestampFormats = default; - LocalJsonValue propMappings = default; - LocalJsonValue propMultilineStartPattern = default; - LocalJsonValue propNeedClientTimezone = default; - LocalJsonValue propNumLinesAnalyzed = default; - LocalJsonValue propNumMessagesAnalyzed = default; - LocalJsonValue propSampleStart = default; - LocalJsonValue propTimestampField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCharset.TryReadProperty(ref reader, options, PropCharset, null)) - { - continue; - } - - if (propEcsCompatibility.TryReadProperty(ref reader, options, PropEcsCompatibility, static Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFieldStats.TryReadProperty(ref reader, options, PropFieldStats, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propGrokPattern.TryReadProperty(ref reader, options, PropGrokPattern, null)) - { - continue; - } - - if (propIngestPipeline.TryReadProperty(ref reader, options, PropIngestPipeline, null)) - { - continue; - } - - if (propJavaTimestampFormats.TryReadProperty(ref reader, options, PropJavaTimestampFormats, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propJodaTimestampFormats.TryReadProperty(ref reader, options, PropJodaTimestampFormats, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) - { - continue; - } - - if (propMultilineStartPattern.TryReadProperty(ref reader, options, PropMultilineStartPattern, null)) - { - continue; - } - - if (propNeedClientTimezone.TryReadProperty(ref reader, options, PropNeedClientTimezone, null)) - { - continue; - } - - if (propNumLinesAnalyzed.TryReadProperty(ref reader, options, PropNumLinesAnalyzed, null)) - { - continue; - } - - if (propNumMessagesAnalyzed.TryReadProperty(ref reader, options, PropNumMessagesAnalyzed, null)) - { - continue; - } - - if (propSampleStart.TryReadProperty(ref reader, options, PropSampleStart, null)) - { - continue; - } - - if (propTimestampField.TryReadProperty(ref reader, options, PropTimestampField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TextStructure.FindFieldStructureResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Charset = propCharset.Value, - EcsCompatibility = propEcsCompatibility.Value, - FieldStats = propFieldStats.Value, - Format = propFormat.Value, - GrokPattern = propGrokPattern.Value, - IngestPipeline = propIngestPipeline.Value, - JavaTimestampFormats = propJavaTimestampFormats.Value, - JodaTimestampFormats = propJodaTimestampFormats.Value, - Mappings = propMappings.Value, - MultilineStartPattern = propMultilineStartPattern.Value, - NeedClientTimezone = propNeedClientTimezone.Value, - NumLinesAnalyzed = propNumLinesAnalyzed.Value, - NumMessagesAnalyzed = propNumMessagesAnalyzed.Value, - SampleStart = propSampleStart.Value, - TimestampField = propTimestampField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextStructure.FindFieldStructureResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCharset, value.Charset, null, null); - writer.WriteProperty(options, PropEcsCompatibility, value.EcsCompatibility, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFieldStats, value.FieldStats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropGrokPattern, value.GrokPattern, null, null); - writer.WriteProperty(options, PropIngestPipeline, value.IngestPipeline, null, null); - writer.WriteProperty(options, PropJavaTimestampFormats, value.JavaTimestampFormats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropJodaTimestampFormats, value.JodaTimestampFormats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMappings, value.Mappings, null, null); - writer.WriteProperty(options, PropMultilineStartPattern, value.MultilineStartPattern, null, null); - writer.WriteProperty(options, PropNeedClientTimezone, value.NeedClientTimezone, null, null); - writer.WriteProperty(options, PropNumLinesAnalyzed, value.NumLinesAnalyzed, null, null); - writer.WriteProperty(options, PropNumMessagesAnalyzed, value.NumMessagesAnalyzed, null, null); - writer.WriteProperty(options, PropSampleStart, value.SampleStart, null, null); - writer.WriteProperty(options, PropTimestampField, value.TimestampField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TextStructure.FindFieldStructureResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TextStructure.Json.FindFieldStructureResponseConverter))] public sealed partial class FindFieldStructureResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -204,53 +39,53 @@ internal FindFieldStructureResponse(Elastic.Clients.Elasticsearch.Serialization. public #if NET7_0_OR_GREATER - required +required #endif - string Charset { get; set; } +string Charset { get; set; } public Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType? EcsCompatibility { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary FieldStats { get; set; } +System.Collections.Generic.IReadOnlyDictionary FieldStats { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.TextStructure.FormatType Format { get; set; } +Elastic.Clients.Elasticsearch.TextStructure.FormatType Format { get; set; } public string? GrokPattern { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Ingest.PipelineConfig IngestPipeline { get; set; } +Elastic.Clients.Elasticsearch.Ingest.PipelineConfig IngestPipeline { get; set; } public System.Collections.Generic.IReadOnlyCollection? JavaTimestampFormats { get; set; } public System.Collections.Generic.IReadOnlyCollection? JodaTimestampFormats { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Mapping.TypeMapping Mappings { get; set; } +Elastic.Clients.Elasticsearch.Mapping.TypeMapping Mappings { get; set; } public string? MultilineStartPattern { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool NeedClientTimezone { get; set; } +bool NeedClientTimezone { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - int NumLinesAnalyzed { get; set; } +int NumLinesAnalyzed { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - int NumMessagesAnalyzed { get; set; } +int NumMessagesAnalyzed { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string SampleStart { get; set; } +string SampleStart { get; set; } public string? TimestampField { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindMessageStructureRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindMessageStructureRequest.Converters.g.cs new file mode 100644 index 00000000000..804c23055bb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindMessageStructureRequest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TextStructure.Json; + +public sealed partial class FindMessageStructureRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMessages = System.Text.Json.JsonEncodedText.Encode("messages"); + + public override Elastic.Clients.Elasticsearch.TextStructure.FindMessageStructureRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propMessages = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMessages.TryReadProperty(ref reader, options, PropMessages, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TextStructure.FindMessageStructureRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Messages = propMessages.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextStructure.FindMessageStructureRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMessages, value.Messages, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindMessageStructureRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindMessageStructureRequest.g.cs index 101d5e99872..d2766137056 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindMessageStructureRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindMessageStructureRequest.g.cs @@ -250,45 +250,6 @@ public sealed partial class FindMessageStructureRequestParameters : Elastic.Tran public string? TimestampFormat { get => Q("timestamp_format"); set => Q("timestamp_format", value); } } -internal sealed partial class FindMessageStructureRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMessages = System.Text.Json.JsonEncodedText.Encode("messages"); - - public override Elastic.Clients.Elasticsearch.TextStructure.FindMessageStructureRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propMessages = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMessages.TryReadProperty(ref reader, options, PropMessages, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TextStructure.FindMessageStructureRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Messages = propMessages.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextStructure.FindMessageStructureRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMessages, value.Messages, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// Find the structure of text messages. @@ -329,7 +290,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// It helps determine why the returned structure was chosen. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TextStructure.FindMessageStructureRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TextStructure.Json.FindMessageStructureRequestConverter))] public sealed partial class FindMessageStructureRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindMessageStructureResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindMessageStructureResponse.Converters.g.cs new file mode 100644 index 00000000000..7084c7274ac --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindMessageStructureResponse.Converters.g.cs @@ -0,0 +1,189 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TextStructure.Json; + +public sealed partial class FindMessageStructureResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCharset = System.Text.Json.JsonEncodedText.Encode("charset"); + private static readonly System.Text.Json.JsonEncodedText PropEcsCompatibility = System.Text.Json.JsonEncodedText.Encode("ecs_compatibility"); + private static readonly System.Text.Json.JsonEncodedText PropFieldStats = System.Text.Json.JsonEncodedText.Encode("field_stats"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropGrokPattern = System.Text.Json.JsonEncodedText.Encode("grok_pattern"); + private static readonly System.Text.Json.JsonEncodedText PropIngestPipeline = System.Text.Json.JsonEncodedText.Encode("ingest_pipeline"); + private static readonly System.Text.Json.JsonEncodedText PropJavaTimestampFormats = System.Text.Json.JsonEncodedText.Encode("java_timestamp_formats"); + private static readonly System.Text.Json.JsonEncodedText PropJodaTimestampFormats = System.Text.Json.JsonEncodedText.Encode("joda_timestamp_formats"); + private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); + private static readonly System.Text.Json.JsonEncodedText PropMultilineStartPattern = System.Text.Json.JsonEncodedText.Encode("multiline_start_pattern"); + private static readonly System.Text.Json.JsonEncodedText PropNeedClientTimezone = System.Text.Json.JsonEncodedText.Encode("need_client_timezone"); + private static readonly System.Text.Json.JsonEncodedText PropNumLinesAnalyzed = System.Text.Json.JsonEncodedText.Encode("num_lines_analyzed"); + private static readonly System.Text.Json.JsonEncodedText PropNumMessagesAnalyzed = System.Text.Json.JsonEncodedText.Encode("num_messages_analyzed"); + private static readonly System.Text.Json.JsonEncodedText PropSampleStart = System.Text.Json.JsonEncodedText.Encode("sample_start"); + private static readonly System.Text.Json.JsonEncodedText PropTimestampField = System.Text.Json.JsonEncodedText.Encode("timestamp_field"); + + public override Elastic.Clients.Elasticsearch.TextStructure.FindMessageStructureResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCharset = default; + LocalJsonValue propEcsCompatibility = default; + LocalJsonValue> propFieldStats = default; + LocalJsonValue propFormat = default; + LocalJsonValue propGrokPattern = default; + LocalJsonValue propIngestPipeline = default; + LocalJsonValue?> propJavaTimestampFormats = default; + LocalJsonValue?> propJodaTimestampFormats = default; + LocalJsonValue propMappings = default; + LocalJsonValue propMultilineStartPattern = default; + LocalJsonValue propNeedClientTimezone = default; + LocalJsonValue propNumLinesAnalyzed = default; + LocalJsonValue propNumMessagesAnalyzed = default; + LocalJsonValue propSampleStart = default; + LocalJsonValue propTimestampField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCharset.TryReadProperty(ref reader, options, PropCharset, null)) + { + continue; + } + + if (propEcsCompatibility.TryReadProperty(ref reader, options, PropEcsCompatibility, static Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFieldStats.TryReadProperty(ref reader, options, PropFieldStats, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propGrokPattern.TryReadProperty(ref reader, options, PropGrokPattern, null)) + { + continue; + } + + if (propIngestPipeline.TryReadProperty(ref reader, options, PropIngestPipeline, null)) + { + continue; + } + + if (propJavaTimestampFormats.TryReadProperty(ref reader, options, PropJavaTimestampFormats, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propJodaTimestampFormats.TryReadProperty(ref reader, options, PropJodaTimestampFormats, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) + { + continue; + } + + if (propMultilineStartPattern.TryReadProperty(ref reader, options, PropMultilineStartPattern, null)) + { + continue; + } + + if (propNeedClientTimezone.TryReadProperty(ref reader, options, PropNeedClientTimezone, null)) + { + continue; + } + + if (propNumLinesAnalyzed.TryReadProperty(ref reader, options, PropNumLinesAnalyzed, null)) + { + continue; + } + + if (propNumMessagesAnalyzed.TryReadProperty(ref reader, options, PropNumMessagesAnalyzed, null)) + { + continue; + } + + if (propSampleStart.TryReadProperty(ref reader, options, PropSampleStart, null)) + { + continue; + } + + if (propTimestampField.TryReadProperty(ref reader, options, PropTimestampField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TextStructure.FindMessageStructureResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Charset = propCharset.Value, + EcsCompatibility = propEcsCompatibility.Value, + FieldStats = propFieldStats.Value, + Format = propFormat.Value, + GrokPattern = propGrokPattern.Value, + IngestPipeline = propIngestPipeline.Value, + JavaTimestampFormats = propJavaTimestampFormats.Value, + JodaTimestampFormats = propJodaTimestampFormats.Value, + Mappings = propMappings.Value, + MultilineStartPattern = propMultilineStartPattern.Value, + NeedClientTimezone = propNeedClientTimezone.Value, + NumLinesAnalyzed = propNumLinesAnalyzed.Value, + NumMessagesAnalyzed = propNumMessagesAnalyzed.Value, + SampleStart = propSampleStart.Value, + TimestampField = propTimestampField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextStructure.FindMessageStructureResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCharset, value.Charset, null, null); + writer.WriteProperty(options, PropEcsCompatibility, value.EcsCompatibility, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFieldStats, value.FieldStats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropGrokPattern, value.GrokPattern, null, null); + writer.WriteProperty(options, PropIngestPipeline, value.IngestPipeline, null, null); + writer.WriteProperty(options, PropJavaTimestampFormats, value.JavaTimestampFormats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropJodaTimestampFormats, value.JodaTimestampFormats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMappings, value.Mappings, null, null); + writer.WriteProperty(options, PropMultilineStartPattern, value.MultilineStartPattern, null, null); + writer.WriteProperty(options, PropNeedClientTimezone, value.NeedClientTimezone, null, null); + writer.WriteProperty(options, PropNumLinesAnalyzed, value.NumLinesAnalyzed, null, null); + writer.WriteProperty(options, PropNumMessagesAnalyzed, value.NumMessagesAnalyzed, null, null); + writer.WriteProperty(options, PropSampleStart, value.SampleStart, null, null); + writer.WriteProperty(options, PropTimestampField, value.TimestampField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindMessageStructureResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindMessageStructureResponse.g.cs index 890559004a6..bf00e8fb31b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindMessageStructureResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/FindMessageStructureResponse.g.cs @@ -23,172 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TextStructure; -internal sealed partial class FindMessageStructureResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCharset = System.Text.Json.JsonEncodedText.Encode("charset"); - private static readonly System.Text.Json.JsonEncodedText PropEcsCompatibility = System.Text.Json.JsonEncodedText.Encode("ecs_compatibility"); - private static readonly System.Text.Json.JsonEncodedText PropFieldStats = System.Text.Json.JsonEncodedText.Encode("field_stats"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropGrokPattern = System.Text.Json.JsonEncodedText.Encode("grok_pattern"); - private static readonly System.Text.Json.JsonEncodedText PropIngestPipeline = System.Text.Json.JsonEncodedText.Encode("ingest_pipeline"); - private static readonly System.Text.Json.JsonEncodedText PropJavaTimestampFormats = System.Text.Json.JsonEncodedText.Encode("java_timestamp_formats"); - private static readonly System.Text.Json.JsonEncodedText PropJodaTimestampFormats = System.Text.Json.JsonEncodedText.Encode("joda_timestamp_formats"); - private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); - private static readonly System.Text.Json.JsonEncodedText PropMultilineStartPattern = System.Text.Json.JsonEncodedText.Encode("multiline_start_pattern"); - private static readonly System.Text.Json.JsonEncodedText PropNeedClientTimezone = System.Text.Json.JsonEncodedText.Encode("need_client_timezone"); - private static readonly System.Text.Json.JsonEncodedText PropNumLinesAnalyzed = System.Text.Json.JsonEncodedText.Encode("num_lines_analyzed"); - private static readonly System.Text.Json.JsonEncodedText PropNumMessagesAnalyzed = System.Text.Json.JsonEncodedText.Encode("num_messages_analyzed"); - private static readonly System.Text.Json.JsonEncodedText PropSampleStart = System.Text.Json.JsonEncodedText.Encode("sample_start"); - private static readonly System.Text.Json.JsonEncodedText PropTimestampField = System.Text.Json.JsonEncodedText.Encode("timestamp_field"); - - public override Elastic.Clients.Elasticsearch.TextStructure.FindMessageStructureResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCharset = default; - LocalJsonValue propEcsCompatibility = default; - LocalJsonValue> propFieldStats = default; - LocalJsonValue propFormat = default; - LocalJsonValue propGrokPattern = default; - LocalJsonValue propIngestPipeline = default; - LocalJsonValue?> propJavaTimestampFormats = default; - LocalJsonValue?> propJodaTimestampFormats = default; - LocalJsonValue propMappings = default; - LocalJsonValue propMultilineStartPattern = default; - LocalJsonValue propNeedClientTimezone = default; - LocalJsonValue propNumLinesAnalyzed = default; - LocalJsonValue propNumMessagesAnalyzed = default; - LocalJsonValue propSampleStart = default; - LocalJsonValue propTimestampField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCharset.TryReadProperty(ref reader, options, PropCharset, null)) - { - continue; - } - - if (propEcsCompatibility.TryReadProperty(ref reader, options, PropEcsCompatibility, static Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFieldStats.TryReadProperty(ref reader, options, PropFieldStats, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propGrokPattern.TryReadProperty(ref reader, options, PropGrokPattern, null)) - { - continue; - } - - if (propIngestPipeline.TryReadProperty(ref reader, options, PropIngestPipeline, null)) - { - continue; - } - - if (propJavaTimestampFormats.TryReadProperty(ref reader, options, PropJavaTimestampFormats, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propJodaTimestampFormats.TryReadProperty(ref reader, options, PropJodaTimestampFormats, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) - { - continue; - } - - if (propMultilineStartPattern.TryReadProperty(ref reader, options, PropMultilineStartPattern, null)) - { - continue; - } - - if (propNeedClientTimezone.TryReadProperty(ref reader, options, PropNeedClientTimezone, null)) - { - continue; - } - - if (propNumLinesAnalyzed.TryReadProperty(ref reader, options, PropNumLinesAnalyzed, null)) - { - continue; - } - - if (propNumMessagesAnalyzed.TryReadProperty(ref reader, options, PropNumMessagesAnalyzed, null)) - { - continue; - } - - if (propSampleStart.TryReadProperty(ref reader, options, PropSampleStart, null)) - { - continue; - } - - if (propTimestampField.TryReadProperty(ref reader, options, PropTimestampField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TextStructure.FindMessageStructureResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Charset = propCharset.Value, - EcsCompatibility = propEcsCompatibility.Value, - FieldStats = propFieldStats.Value, - Format = propFormat.Value, - GrokPattern = propGrokPattern.Value, - IngestPipeline = propIngestPipeline.Value, - JavaTimestampFormats = propJavaTimestampFormats.Value, - JodaTimestampFormats = propJodaTimestampFormats.Value, - Mappings = propMappings.Value, - MultilineStartPattern = propMultilineStartPattern.Value, - NeedClientTimezone = propNeedClientTimezone.Value, - NumLinesAnalyzed = propNumLinesAnalyzed.Value, - NumMessagesAnalyzed = propNumMessagesAnalyzed.Value, - SampleStart = propSampleStart.Value, - TimestampField = propTimestampField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextStructure.FindMessageStructureResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCharset, value.Charset, null, null); - writer.WriteProperty(options, PropEcsCompatibility, value.EcsCompatibility, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFieldStats, value.FieldStats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropGrokPattern, value.GrokPattern, null, null); - writer.WriteProperty(options, PropIngestPipeline, value.IngestPipeline, null, null); - writer.WriteProperty(options, PropJavaTimestampFormats, value.JavaTimestampFormats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropJodaTimestampFormats, value.JodaTimestampFormats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMappings, value.Mappings, null, null); - writer.WriteProperty(options, PropMultilineStartPattern, value.MultilineStartPattern, null, null); - writer.WriteProperty(options, PropNeedClientTimezone, value.NeedClientTimezone, null, null); - writer.WriteProperty(options, PropNumLinesAnalyzed, value.NumLinesAnalyzed, null, null); - writer.WriteProperty(options, PropNumMessagesAnalyzed, value.NumMessagesAnalyzed, null, null); - writer.WriteProperty(options, PropSampleStart, value.SampleStart, null, null); - writer.WriteProperty(options, PropTimestampField, value.TimestampField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TextStructure.FindMessageStructureResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TextStructure.Json.FindMessageStructureResponseConverter))] public sealed partial class FindMessageStructureResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -204,53 +39,53 @@ internal FindMessageStructureResponse(Elastic.Clients.Elasticsearch.Serializatio public #if NET7_0_OR_GREATER - required +required #endif - string Charset { get; set; } +string Charset { get; set; } public Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType? EcsCompatibility { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary FieldStats { get; set; } +System.Collections.Generic.IReadOnlyDictionary FieldStats { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.TextStructure.FormatType Format { get; set; } +Elastic.Clients.Elasticsearch.TextStructure.FormatType Format { get; set; } public string? GrokPattern { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Ingest.PipelineConfig IngestPipeline { get; set; } +Elastic.Clients.Elasticsearch.Ingest.PipelineConfig IngestPipeline { get; set; } public System.Collections.Generic.IReadOnlyCollection? JavaTimestampFormats { get; set; } public System.Collections.Generic.IReadOnlyCollection? JodaTimestampFormats { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Mapping.TypeMapping Mappings { get; set; } +Elastic.Clients.Elasticsearch.Mapping.TypeMapping Mappings { get; set; } public string? MultilineStartPattern { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - bool NeedClientTimezone { get; set; } +bool NeedClientTimezone { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - int NumLinesAnalyzed { get; set; } +int NumLinesAnalyzed { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - int NumMessagesAnalyzed { get; set; } +int NumMessagesAnalyzed { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string SampleStart { get; set; } +string SampleStart { get; set; } public string? TimestampField { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/TestGrokPatternRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/TestGrokPatternRequest.Converters.g.cs new file mode 100644 index 00000000000..7121e5d1f72 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/TestGrokPatternRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TextStructure.Json; + +public sealed partial class TestGrokPatternRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropGrokPattern = System.Text.Json.JsonEncodedText.Encode("grok_pattern"); + private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); + + public override Elastic.Clients.Elasticsearch.TextStructure.TestGrokPatternRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propGrokPattern = default; + LocalJsonValue> propText = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propGrokPattern.TryReadProperty(ref reader, options, PropGrokPattern, null)) + { + continue; + } + + if (propText.TryReadProperty(ref reader, options, PropText, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TextStructure.TestGrokPatternRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + GrokPattern = propGrokPattern.Value, + Text = propText.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextStructure.TestGrokPatternRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropGrokPattern, value.GrokPattern, null, null); + writer.WriteProperty(options, PropText, value.Text, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/TestGrokPatternRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/TestGrokPatternRequest.g.cs index 0d0bfd4a876..a661460bf01 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/TestGrokPatternRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/TestGrokPatternRequest.g.cs @@ -35,54 +35,6 @@ public sealed partial class TestGrokPatternRequestParameters : Elastic.Transport public string? EcsCompatibility { get => Q("ecs_compatibility"); set => Q("ecs_compatibility", value); } } -internal sealed partial class TestGrokPatternRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropGrokPattern = System.Text.Json.JsonEncodedText.Encode("grok_pattern"); - private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); - - public override Elastic.Clients.Elasticsearch.TextStructure.TestGrokPatternRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propGrokPattern = default; - LocalJsonValue> propText = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propGrokPattern.TryReadProperty(ref reader, options, PropGrokPattern, null)) - { - continue; - } - - if (propText.TryReadProperty(ref reader, options, PropText, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TextStructure.TestGrokPatternRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - GrokPattern = propGrokPattern.Value, - Text = propText.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextStructure.TestGrokPatternRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropGrokPattern, value.GrokPattern, null, null); - writer.WriteProperty(options, PropText, value.Text, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// Test a Grok pattern. @@ -90,7 +42,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The API indicates whether the lines match the pattern together with the offsets and lengths of the matched substrings. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TextStructure.TestGrokPatternRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TextStructure.Json.TestGrokPatternRequestConverter))] public sealed partial class TestGrokPatternRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/TestGrokPatternResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/TestGrokPatternResponse.Converters.g.cs new file mode 100644 index 00000000000..88317e3ff10 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/TestGrokPatternResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TextStructure.Json; + +public sealed partial class TestGrokPatternResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMatches = System.Text.Json.JsonEncodedText.Encode("matches"); + + public override Elastic.Clients.Elasticsearch.TextStructure.TestGrokPatternResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propMatches = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMatches.TryReadProperty(ref reader, options, PropMatches, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TextStructure.TestGrokPatternResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Matches = propMatches.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextStructure.TestGrokPatternResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMatches, value.Matches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/TestGrokPatternResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/TestGrokPatternResponse.g.cs index 92268ff43f2..290eb0b5ddf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/TestGrokPatternResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TextStructure/TestGrokPatternResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TextStructure; -internal sealed partial class TestGrokPatternResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMatches = System.Text.Json.JsonEncodedText.Encode("matches"); - - public override Elastic.Clients.Elasticsearch.TextStructure.TestGrokPatternResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propMatches = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMatches.TryReadProperty(ref reader, options, PropMatches, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TextStructure.TestGrokPatternResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Matches = propMatches.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextStructure.TestGrokPatternResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMatches, value.Matches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TextStructure.TestGrokPatternResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TextStructure.Json.TestGrokPatternResponseConverter))] public sealed partial class TestGrokPatternResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal TestGrokPatternResponse(Elastic.Clients.Elasticsearch.Serialization.Jso public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Matches { get; set; } +System.Collections.Generic.IReadOnlyCollection Matches { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/DeleteTransformRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/DeleteTransformRequest.Converters.g.cs new file mode 100644 index 00000000000..7ecff7e2c47 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/DeleteTransformRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class DeleteTransformRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.TransformManagement.DeleteTransformRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.DeleteTransformRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.DeleteTransformRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/DeleteTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/DeleteTransformRequest.g.cs index 53a8137c420..c927064e8b3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/DeleteTransformRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/DeleteTransformRequest.g.cs @@ -49,41 +49,12 @@ public sealed partial class DeleteTransformRequestParameters : Elastic.Transport public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class DeleteTransformRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.TransformManagement.DeleteTransformRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.DeleteTransformRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.DeleteTransformRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Delete a transform. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.DeleteTransformRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.DeleteTransformRequestConverter))] public sealed partial class DeleteTransformRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/DeleteTransformResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/DeleteTransformResponse.Converters.g.cs new file mode 100644 index 00000000000..85b693a2f39 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/DeleteTransformResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class DeleteTransformResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.DeleteTransformResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.DeleteTransformResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.DeleteTransformResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/DeleteTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/DeleteTransformResponse.g.cs index 1b38704cf39..1b425b98532 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/DeleteTransformResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/DeleteTransformResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class DeleteTransformResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.DeleteTransformResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.DeleteTransformResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.DeleteTransformResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.DeleteTransformResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.DeleteTransformResponseConverter))] public sealed partial class DeleteTransformResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformRequest.Converters.g.cs new file mode 100644 index 00000000000..25cfe3927de --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class GetTransformRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.TransformManagement.GetTransformRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.GetTransformRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.GetTransformRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformRequest.g.cs index bad0ff5a59f..3fbe68f6d43 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformRequest.g.cs @@ -77,42 +77,13 @@ public sealed partial class GetTransformRequestParameters : Elastic.Transport.Re public int? Size { get => Q("size"); set => Q("size", value); } } -internal sealed partial class GetTransformRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.TransformManagement.GetTransformRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.GetTransformRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.GetTransformRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get transforms. /// Get configuration information for transforms. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.GetTransformRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.GetTransformRequestConverter))] public sealed partial class GetTransformRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public GetTransformRequest(Elastic.Clients.Elasticsearch.Names? transformId) : base(r => r.Optional("transform_id", transformId)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformResponse.Converters.g.cs new file mode 100644 index 00000000000..a03296429ab --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class GetTransformResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropTransforms = System.Text.Json.JsonEncodedText.Encode("transforms"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.GetTransformResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propTransforms = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propTransforms.TryReadProperty(ref reader, options, PropTransforms, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.GetTransformResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Transforms = propTransforms.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.GetTransformResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropTransforms, value.Transforms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformResponse.g.cs index 405f610a4a3..c03d2c8169a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class GetTransformResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropTransforms = System.Text.Json.JsonEncodedText.Encode("transforms"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.GetTransformResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propTransforms = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propTransforms.TryReadProperty(ref reader, options, PropTransforms, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.GetTransformResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Transforms = propTransforms.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.GetTransformResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropTransforms, value.Transforms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.GetTransformResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.GetTransformResponseConverter))] public sealed partial class GetTransformResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal GetTransformResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCo public #if NET7_0_OR_GREATER - required +required #endif - long Count { get; set; } +long Count { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Transforms { get; set; } +System.Collections.Generic.IReadOnlyCollection Transforms { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformStatsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformStatsRequest.Converters.g.cs new file mode 100644 index 00000000000..b6bb2e983c7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformStatsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class GetTransformStatsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.TransformManagement.GetTransformStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.GetTransformStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.GetTransformStatsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformStatsRequest.g.cs index 5732e0aa256..0393e3c2b22 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformStatsRequest.g.cs @@ -75,35 +75,6 @@ public sealed partial class GetTransformStatsRequestParameters : Elastic.Transpo public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class GetTransformStatsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.TransformManagement.GetTransformStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.GetTransformStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.GetTransformStatsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get transform stats. @@ -112,7 +83,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Get usage information for transforms. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.GetTransformStatsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.GetTransformStatsRequestConverter))] public sealed partial class GetTransformStatsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformStatsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformStatsResponse.Converters.g.cs new file mode 100644 index 00000000000..e4e40d6a259 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformStatsResponse.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class GetTransformStatsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropTransforms = System.Text.Json.JsonEncodedText.Encode("transforms"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.GetTransformStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propTransforms = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propTransforms.TryReadProperty(ref reader, options, PropTransforms, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.GetTransformStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Transforms = propTransforms.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.GetTransformStatsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropTransforms, value.Transforms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformStatsResponse.g.cs index dbf3a81c86d..bad77b0fea3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/GetTransformStatsResponse.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class GetTransformStatsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropTransforms = System.Text.Json.JsonEncodedText.Encode("transforms"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.GetTransformStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propTransforms = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propTransforms.TryReadProperty(ref reader, options, PropTransforms, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.GetTransformStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Transforms = propTransforms.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.GetTransformStatsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropTransforms, value.Transforms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.GetTransformStatsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.GetTransformStatsResponseConverter))] public sealed partial class GetTransformStatsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -87,12 +39,12 @@ internal GetTransformStatsResponse(Elastic.Clients.Elasticsearch.Serialization.J public #if NET7_0_OR_GREATER - required +required #endif - long Count { get; set; } +long Count { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Transforms { get; set; } +System.Collections.Generic.IReadOnlyCollection Transforms { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PreviewTransformRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PreviewTransformRequest.Converters.g.cs new file mode 100644 index 00000000000..2824347626c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PreviewTransformRequest.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class PreviewTransformRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropDest = System.Text.Json.JsonEncodedText.Encode("dest"); + private static readonly System.Text.Json.JsonEncodedText PropFrequency = System.Text.Json.JsonEncodedText.Encode("frequency"); + private static readonly System.Text.Json.JsonEncodedText PropLatest = System.Text.Json.JsonEncodedText.Encode("latest"); + private static readonly System.Text.Json.JsonEncodedText PropPivot = System.Text.Json.JsonEncodedText.Encode("pivot"); + private static readonly System.Text.Json.JsonEncodedText PropRetentionPolicy = System.Text.Json.JsonEncodedText.Encode("retention_policy"); + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + private static readonly System.Text.Json.JsonEncodedText PropSync = System.Text.Json.JsonEncodedText.Encode("sync"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.PreviewTransformRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propDest = default; + LocalJsonValue propFrequency = default; + LocalJsonValue propLatest = default; + LocalJsonValue propPivot = default; + LocalJsonValue propRetentionPolicy = default; + LocalJsonValue propSettings = default; + LocalJsonValue propSource = default; + LocalJsonValue propSync = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propDest.TryReadProperty(ref reader, options, PropDest, null)) + { + continue; + } + + if (propFrequency.TryReadProperty(ref reader, options, PropFrequency, null)) + { + continue; + } + + if (propLatest.TryReadProperty(ref reader, options, PropLatest, null)) + { + continue; + } + + if (propPivot.TryReadProperty(ref reader, options, PropPivot, null)) + { + continue; + } + + if (propRetentionPolicy.TryReadProperty(ref reader, options, PropRetentionPolicy, null)) + { + continue; + } + + if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (propSync.TryReadProperty(ref reader, options, PropSync, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.PreviewTransformRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Dest = propDest.Value, + Frequency = propFrequency.Value, + Latest = propLatest.Value, + Pivot = propPivot.Value, + RetentionPolicy = propRetentionPolicy.Value, + Settings = propSettings.Value, + Source = propSource.Value, + Sync = propSync.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.PreviewTransformRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropDest, value.Dest, null, null); + writer.WriteProperty(options, PropFrequency, value.Frequency, null, null); + writer.WriteProperty(options, PropLatest, value.Latest, null, null); + writer.WriteProperty(options, PropPivot, value.Pivot, null, null); + writer.WriteProperty(options, PropRetentionPolicy, value.RetentionPolicy, null, null); + writer.WriteProperty(options, PropSettings, value.Settings, null, null); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteProperty(options, PropSync, value.Sync, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PreviewTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PreviewTransformRequest.g.cs index af7d06b2c2e..fd8af11db34 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PreviewTransformRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PreviewTransformRequest.g.cs @@ -34,117 +34,6 @@ public sealed partial class PreviewTransformRequestParameters : Elastic.Transpor public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PreviewTransformRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropDest = System.Text.Json.JsonEncodedText.Encode("dest"); - private static readonly System.Text.Json.JsonEncodedText PropFrequency = System.Text.Json.JsonEncodedText.Encode("frequency"); - private static readonly System.Text.Json.JsonEncodedText PropLatest = System.Text.Json.JsonEncodedText.Encode("latest"); - private static readonly System.Text.Json.JsonEncodedText PropPivot = System.Text.Json.JsonEncodedText.Encode("pivot"); - private static readonly System.Text.Json.JsonEncodedText PropRetentionPolicy = System.Text.Json.JsonEncodedText.Encode("retention_policy"); - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - private static readonly System.Text.Json.JsonEncodedText PropSync = System.Text.Json.JsonEncodedText.Encode("sync"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.PreviewTransformRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propDest = default; - LocalJsonValue propFrequency = default; - LocalJsonValue propLatest = default; - LocalJsonValue propPivot = default; - LocalJsonValue propRetentionPolicy = default; - LocalJsonValue propSettings = default; - LocalJsonValue propSource = default; - LocalJsonValue propSync = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propDest.TryReadProperty(ref reader, options, PropDest, null)) - { - continue; - } - - if (propFrequency.TryReadProperty(ref reader, options, PropFrequency, null)) - { - continue; - } - - if (propLatest.TryReadProperty(ref reader, options, PropLatest, null)) - { - continue; - } - - if (propPivot.TryReadProperty(ref reader, options, PropPivot, null)) - { - continue; - } - - if (propRetentionPolicy.TryReadProperty(ref reader, options, PropRetentionPolicy, null)) - { - continue; - } - - if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (propSync.TryReadProperty(ref reader, options, PropSync, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.PreviewTransformRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Dest = propDest.Value, - Frequency = propFrequency.Value, - Latest = propLatest.Value, - Pivot = propPivot.Value, - RetentionPolicy = propRetentionPolicy.Value, - Settings = propSettings.Value, - Source = propSource.Value, - Sync = propSync.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.PreviewTransformRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropDest, value.Dest, null, null); - writer.WriteProperty(options, PropFrequency, value.Frequency, null, null); - writer.WriteProperty(options, PropLatest, value.Latest, null, null); - writer.WriteProperty(options, PropPivot, value.Pivot, null, null); - writer.WriteProperty(options, PropRetentionPolicy, value.RetentionPolicy, null, null); - writer.WriteProperty(options, PropSettings, value.Settings, null, null); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteProperty(options, PropSync, value.Sync, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Preview a transform. @@ -156,7 +45,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// types of the source index and the transform aggregations. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.PreviewTransformRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.PreviewTransformRequestConverter))] public sealed partial class PreviewTransformRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { public PreviewTransformRequest(Elastic.Clients.Elasticsearch.Id? transformId) : base(r => r.Optional("transform_id", transformId)) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PreviewTransformResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PreviewTransformResponse.Converters.g.cs new file mode 100644 index 00000000000..f465ced8b34 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PreviewTransformResponse.Converters.g.cs @@ -0,0 +1,88 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class PreviewTransformResponseConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropGeneratedDestIndex = System.Text.Json.JsonEncodedText.Encode("generated_dest_index"); + private static readonly System.Text.Json.JsonEncodedText PropPreview = System.Text.Json.JsonEncodedText.Encode("preview"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.PreviewTransformResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propGeneratedDestIndex = default; + LocalJsonValue> propPreview = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propGeneratedDestIndex.TryReadProperty(ref reader, options, PropGeneratedDestIndex, null)) + { + continue; + } + + if (propPreview.TryReadProperty(ref reader, options, PropPreview, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, static TTransform (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.PreviewTransformResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + GeneratedDestIndex = propGeneratedDestIndex.Value, + Preview = propPreview.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.PreviewTransformResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropGeneratedDestIndex, value.GeneratedDestIndex, null, null); + writer.WriteProperty(options, PropPreview, value.Preview, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TTransform v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} + +public sealed partial class PreviewTransformResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(PreviewTransformResponse<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(PreviewTransformResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PreviewTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PreviewTransformResponse.g.cs index 77de1276da4..87a1d374280 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PreviewTransformResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PreviewTransformResponse.g.cs @@ -23,71 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class PreviewTransformResponseConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropGeneratedDestIndex = System.Text.Json.JsonEncodedText.Encode("generated_dest_index"); - private static readonly System.Text.Json.JsonEncodedText PropPreview = System.Text.Json.JsonEncodedText.Encode("preview"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.PreviewTransformResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propGeneratedDestIndex = default; - LocalJsonValue> propPreview = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propGeneratedDestIndex.TryReadProperty(ref reader, options, PropGeneratedDestIndex, null)) - { - continue; - } - - if (propPreview.TryReadProperty(ref reader, options, PropPreview, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, static TTransform (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.PreviewTransformResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - GeneratedDestIndex = propGeneratedDestIndex.Value, - Preview = propPreview.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.PreviewTransformResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropGeneratedDestIndex, value.GeneratedDestIndex, null, null); - writer.WriteProperty(options, PropPreview, value.Preview, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TTransform v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -internal sealed partial class PreviewTransformResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(PreviewTransformResponse<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(PreviewTransformResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.PreviewTransformResponseConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.PreviewTransformResponseConverterFactory))] public sealed partial class PreviewTransformResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -103,12 +39,12 @@ internal PreviewTransformResponse(Elastic.Clients.Elasticsearch.Serialization.Js public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.IndexManagement.IndexState GeneratedDestIndex { get; set; } +Elastic.Clients.Elasticsearch.IndexManagement.IndexState GeneratedDestIndex { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyCollection Preview { get; set; } +System.Collections.Generic.IReadOnlyCollection Preview { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PutTransformRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PutTransformRequest.Converters.g.cs new file mode 100644 index 00000000000..093d8e90c1d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PutTransformRequest.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class PutTransformRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropDest = System.Text.Json.JsonEncodedText.Encode("dest"); + private static readonly System.Text.Json.JsonEncodedText PropFrequency = System.Text.Json.JsonEncodedText.Encode("frequency"); + private static readonly System.Text.Json.JsonEncodedText PropLatest = System.Text.Json.JsonEncodedText.Encode("latest"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); + private static readonly System.Text.Json.JsonEncodedText PropPivot = System.Text.Json.JsonEncodedText.Encode("pivot"); + private static readonly System.Text.Json.JsonEncodedText PropRetentionPolicy = System.Text.Json.JsonEncodedText.Encode("retention_policy"); + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + private static readonly System.Text.Json.JsonEncodedText PropSync = System.Text.Json.JsonEncodedText.Encode("sync"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.PutTransformRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propDest = default; + LocalJsonValue propFrequency = default; + LocalJsonValue propLatest = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propPivot = default; + LocalJsonValue propRetentionPolicy = default; + LocalJsonValue propSettings = default; + LocalJsonValue propSource = default; + LocalJsonValue propSync = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propDest.TryReadProperty(ref reader, options, PropDest, null)) + { + continue; + } + + if (propFrequency.TryReadProperty(ref reader, options, PropFrequency, null)) + { + continue; + } + + if (propLatest.TryReadProperty(ref reader, options, PropLatest, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propPivot.TryReadProperty(ref reader, options, PropPivot, null)) + { + continue; + } + + if (propRetentionPolicy.TryReadProperty(ref reader, options, PropRetentionPolicy, null)) + { + continue; + } + + if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (propSync.TryReadProperty(ref reader, options, PropSync, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.PutTransformRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Dest = propDest.Value, + Frequency = propFrequency.Value, + Latest = propLatest.Value, + Meta = propMeta.Value, + Pivot = propPivot.Value, + RetentionPolicy = propRetentionPolicy.Value, + Settings = propSettings.Value, + Source = propSource.Value, + Sync = propSync.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.PutTransformRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropDest, value.Dest, null, null); + writer.WriteProperty(options, PropFrequency, value.Frequency, null, null); + writer.WriteProperty(options, PropLatest, value.Latest, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropPivot, value.Pivot, null, null); + writer.WriteProperty(options, PropRetentionPolicy, value.RetentionPolicy, null, null); + writer.WriteProperty(options, PropSettings, value.Settings, null, null); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteProperty(options, PropSync, value.Sync, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PutTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PutTransformRequest.g.cs index 7feb71008d0..9a620670199 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PutTransformRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PutTransformRequest.g.cs @@ -44,126 +44,6 @@ public sealed partial class PutTransformRequestParameters : Elastic.Transport.Re public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class PutTransformRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropDest = System.Text.Json.JsonEncodedText.Encode("dest"); - private static readonly System.Text.Json.JsonEncodedText PropFrequency = System.Text.Json.JsonEncodedText.Encode("frequency"); - private static readonly System.Text.Json.JsonEncodedText PropLatest = System.Text.Json.JsonEncodedText.Encode("latest"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); - private static readonly System.Text.Json.JsonEncodedText PropPivot = System.Text.Json.JsonEncodedText.Encode("pivot"); - private static readonly System.Text.Json.JsonEncodedText PropRetentionPolicy = System.Text.Json.JsonEncodedText.Encode("retention_policy"); - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - private static readonly System.Text.Json.JsonEncodedText PropSync = System.Text.Json.JsonEncodedText.Encode("sync"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.PutTransformRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propDest = default; - LocalJsonValue propFrequency = default; - LocalJsonValue propLatest = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propPivot = default; - LocalJsonValue propRetentionPolicy = default; - LocalJsonValue propSettings = default; - LocalJsonValue propSource = default; - LocalJsonValue propSync = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propDest.TryReadProperty(ref reader, options, PropDest, null)) - { - continue; - } - - if (propFrequency.TryReadProperty(ref reader, options, PropFrequency, null)) - { - continue; - } - - if (propLatest.TryReadProperty(ref reader, options, PropLatest, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propPivot.TryReadProperty(ref reader, options, PropPivot, null)) - { - continue; - } - - if (propRetentionPolicy.TryReadProperty(ref reader, options, PropRetentionPolicy, null)) - { - continue; - } - - if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (propSync.TryReadProperty(ref reader, options, PropSync, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.PutTransformRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Dest = propDest.Value, - Frequency = propFrequency.Value, - Latest = propLatest.Value, - Meta = propMeta.Value, - Pivot = propPivot.Value, - RetentionPolicy = propRetentionPolicy.Value, - Settings = propSettings.Value, - Source = propSource.Value, - Sync = propSync.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.PutTransformRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropDest, value.Dest, null, null); - writer.WriteProperty(options, PropFrequency, value.Frequency, null, null); - writer.WriteProperty(options, PropLatest, value.Latest, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropPivot, value.Pivot, null, null); - writer.WriteProperty(options, PropRetentionPolicy, value.RetentionPolicy, null, null); - writer.WriteProperty(options, PropSettings, value.Settings, null, null); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteProperty(options, PropSync, value.Sync, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Create a transform. @@ -194,7 +74,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// give users any privileges on .data-frame-internal* indices. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.PutTransformRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.PutTransformRequestConverter))] public sealed partial class PutTransformRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PutTransformResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PutTransformResponse.Converters.g.cs new file mode 100644 index 00000000000..33424ab9190 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PutTransformResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class PutTransformResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.PutTransformResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.PutTransformResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.PutTransformResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PutTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PutTransformResponse.g.cs index a5e2c870c98..a7907020dea 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PutTransformResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/PutTransformResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class PutTransformResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.PutTransformResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.PutTransformResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.PutTransformResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.PutTransformResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.PutTransformResponseConverter))] public sealed partial class PutTransformResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ResetTransformRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ResetTransformRequest.Converters.g.cs new file mode 100644 index 00000000000..81b3fec07d9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ResetTransformRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class ResetTransformRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.TransformManagement.ResetTransformRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.ResetTransformRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.ResetTransformRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ResetTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ResetTransformRequest.g.cs index 644c692d2c1..d6b558a0dcd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ResetTransformRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ResetTransformRequest.g.cs @@ -41,35 +41,6 @@ public sealed partial class ResetTransformRequestParameters : Elastic.Transport. public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class ResetTransformRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.TransformManagement.ResetTransformRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.ResetTransformRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.ResetTransformRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Reset a transform. @@ -79,7 +50,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// If the destination index was created by the transform, it is deleted. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.ResetTransformRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.ResetTransformRequestConverter))] public sealed partial class ResetTransformRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ResetTransformResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ResetTransformResponse.Converters.g.cs new file mode 100644 index 00000000000..9e372e906e6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ResetTransformResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class ResetTransformResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.ResetTransformResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.ResetTransformResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.ResetTransformResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ResetTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ResetTransformResponse.g.cs index e76075c7525..364c55f5870 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ResetTransformResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ResetTransformResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class ResetTransformResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.ResetTransformResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.ResetTransformResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.ResetTransformResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.ResetTransformResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.ResetTransformResponseConverter))] public sealed partial class ResetTransformResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ScheduleNowTransformRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ScheduleNowTransformRequest.Converters.g.cs new file mode 100644 index 00000000000..3ae4cfba479 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ScheduleNowTransformRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class ScheduleNowTransformRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.TransformManagement.ScheduleNowTransformRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.ScheduleNowTransformRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.ScheduleNowTransformRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ScheduleNowTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ScheduleNowTransformRequest.g.cs index 4e61885952a..c31819fcbe7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ScheduleNowTransformRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ScheduleNowTransformRequest.g.cs @@ -33,35 +33,6 @@ public sealed partial class ScheduleNowTransformRequestParameters : Elastic.Tran public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class ScheduleNowTransformRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.TransformManagement.ScheduleNowTransformRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.ScheduleNowTransformRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.ScheduleNowTransformRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Schedule a transform to start now. @@ -74,7 +45,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// is called again in the meantime. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.ScheduleNowTransformRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.ScheduleNowTransformRequestConverter))] public sealed partial class ScheduleNowTransformRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ScheduleNowTransformResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ScheduleNowTransformResponse.Converters.g.cs new file mode 100644 index 00000000000..9001fe8c5a1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ScheduleNowTransformResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class ScheduleNowTransformResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.ScheduleNowTransformResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.ScheduleNowTransformResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.ScheduleNowTransformResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ScheduleNowTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ScheduleNowTransformResponse.g.cs index fa22907703e..8c957cb8bff 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ScheduleNowTransformResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/ScheduleNowTransformResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class ScheduleNowTransformResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.ScheduleNowTransformResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.ScheduleNowTransformResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.ScheduleNowTransformResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.ScheduleNowTransformResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.ScheduleNowTransformResponseConverter))] public sealed partial class ScheduleNowTransformResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StartTransformRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StartTransformRequest.Converters.g.cs new file mode 100644 index 00000000000..9e68ef32b32 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StartTransformRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class StartTransformRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.TransformManagement.StartTransformRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.StartTransformRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.StartTransformRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StartTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StartTransformRequest.g.cs index 6828a9f40dd..135d03bccc5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StartTransformRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StartTransformRequest.g.cs @@ -40,35 +40,6 @@ public sealed partial class StartTransformRequestParameters : Elastic.Transport. public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class StartTransformRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.TransformManagement.StartTransformRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.StartTransformRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.StartTransformRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Start a transform. @@ -91,7 +62,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// destination indices, the transform fails when it attempts unauthorized operations. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.StartTransformRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.StartTransformRequestConverter))] public sealed partial class StartTransformRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StartTransformResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StartTransformResponse.Converters.g.cs new file mode 100644 index 00000000000..4a99afb6e38 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StartTransformResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class StartTransformResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.StartTransformResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.StartTransformResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.StartTransformResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StartTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StartTransformResponse.g.cs index a7a108b034d..ed65d5d204b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StartTransformResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StartTransformResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class StartTransformResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.StartTransformResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.StartTransformResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.StartTransformResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.StartTransformResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.StartTransformResponseConverter))] public sealed partial class StartTransformResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StopTransformRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StopTransformRequest.Converters.g.cs new file mode 100644 index 00000000000..d0182386671 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StopTransformRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class StopTransformRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.TransformManagement.StopTransformRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.StopTransformRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.StopTransformRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StopTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StopTransformRequest.g.cs index b083d95a629..dddbbf707c5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StopTransformRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StopTransformRequest.g.cs @@ -74,42 +74,13 @@ public sealed partial class StopTransformRequestParameters : Elastic.Transport.R public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } } -internal sealed partial class StopTransformRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.TransformManagement.StopTransformRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.StopTransformRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.StopTransformRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Stop transforms. /// Stops one or more transforms. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.StopTransformRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.StopTransformRequestConverter))] public sealed partial class StopTransformRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StopTransformResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StopTransformResponse.Converters.g.cs new file mode 100644 index 00000000000..cf7219dae84 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StopTransformResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class StopTransformResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.StopTransformResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.StopTransformResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.StopTransformResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StopTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StopTransformResponse.g.cs index 9b1aff372ec..352f4697343 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StopTransformResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/StopTransformResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class StopTransformResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.StopTransformResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAcknowledged = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.StopTransformResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Acknowledged = propAcknowledged.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.StopTransformResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.StopTransformResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.StopTransformResponseConverter))] public sealed partial class StopTransformResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpdateTransformRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpdateTransformRequest.Converters.g.cs new file mode 100644 index 00000000000..098f8f95716 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpdateTransformRequest.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class UpdateTransformRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropDest = System.Text.Json.JsonEncodedText.Encode("dest"); + private static readonly System.Text.Json.JsonEncodedText PropFrequency = System.Text.Json.JsonEncodedText.Encode("frequency"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); + private static readonly System.Text.Json.JsonEncodedText PropRetentionPolicy = System.Text.Json.JsonEncodedText.Encode("retention_policy"); + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + private static readonly System.Text.Json.JsonEncodedText PropSync = System.Text.Json.JsonEncodedText.Encode("sync"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.UpdateTransformRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propDest = default; + LocalJsonValue propFrequency = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propRetentionPolicy = default; + LocalJsonValue propSettings = default; + LocalJsonValue propSource = default; + LocalJsonValue propSync = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propDest.TryReadProperty(ref reader, options, PropDest, null)) + { + continue; + } + + if (propFrequency.TryReadProperty(ref reader, options, PropFrequency, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propRetentionPolicy.TryReadProperty(ref reader, options, PropRetentionPolicy, null)) + { + continue; + } + + if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (propSync.TryReadProperty(ref reader, options, PropSync, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.UpdateTransformRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Dest = propDest.Value, + Frequency = propFrequency.Value, + Meta = propMeta.Value, + RetentionPolicy = propRetentionPolicy.Value, + Settings = propSettings.Value, + Source = propSource.Value, + Sync = propSync.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.UpdateTransformRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropDest, value.Dest, null, null); + writer.WriteProperty(options, PropFrequency, value.Frequency, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropRetentionPolicy, value.RetentionPolicy, null, null); + writer.WriteProperty(options, PropSettings, value.Settings, null, null); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteProperty(options, PropSync, value.Sync, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpdateTransformRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpdateTransformRequest.g.cs index 781e2960521..27010c9fee5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpdateTransformRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpdateTransformRequest.g.cs @@ -43,108 +43,6 @@ public sealed partial class UpdateTransformRequestParameters : Elastic.Transport public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class UpdateTransformRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropDest = System.Text.Json.JsonEncodedText.Encode("dest"); - private static readonly System.Text.Json.JsonEncodedText PropFrequency = System.Text.Json.JsonEncodedText.Encode("frequency"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); - private static readonly System.Text.Json.JsonEncodedText PropRetentionPolicy = System.Text.Json.JsonEncodedText.Encode("retention_policy"); - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - private static readonly System.Text.Json.JsonEncodedText PropSync = System.Text.Json.JsonEncodedText.Encode("sync"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.UpdateTransformRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propDest = default; - LocalJsonValue propFrequency = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propRetentionPolicy = default; - LocalJsonValue propSettings = default; - LocalJsonValue propSource = default; - LocalJsonValue propSync = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propDest.TryReadProperty(ref reader, options, PropDest, null)) - { - continue; - } - - if (propFrequency.TryReadProperty(ref reader, options, PropFrequency, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propRetentionPolicy.TryReadProperty(ref reader, options, PropRetentionPolicy, null)) - { - continue; - } - - if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (propSync.TryReadProperty(ref reader, options, PropSync, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.UpdateTransformRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Dest = propDest.Value, - Frequency = propFrequency.Value, - Meta = propMeta.Value, - RetentionPolicy = propRetentionPolicy.Value, - Settings = propSettings.Value, - Source = propSource.Value, - Sync = propSync.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.UpdateTransformRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropDest, value.Dest, null, null); - writer.WriteProperty(options, PropFrequency, value.Frequency, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropRetentionPolicy, value.RetentionPolicy, null, null); - writer.WriteProperty(options, PropSettings, value.Settings, null, null); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteProperty(options, PropSync, value.Sync, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Update a transform. @@ -158,7 +56,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// time of update and runs with those privileges. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.UpdateTransformRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.UpdateTransformRequestConverter))] public sealed partial class UpdateTransformRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpdateTransformResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpdateTransformResponse.Converters.g.cs new file mode 100644 index 00000000000..71406d1b7fe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpdateTransformResponse.Converters.g.cs @@ -0,0 +1,180 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class UpdateTransformResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAuthorization = System.Text.Json.JsonEncodedText.Encode("authorization"); + private static readonly System.Text.Json.JsonEncodedText PropCreateTime = System.Text.Json.JsonEncodedText.Encode("create_time"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropDest = System.Text.Json.JsonEncodedText.Encode("dest"); + private static readonly System.Text.Json.JsonEncodedText PropFrequency = System.Text.Json.JsonEncodedText.Encode("frequency"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropLatest = System.Text.Json.JsonEncodedText.Encode("latest"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); + private static readonly System.Text.Json.JsonEncodedText PropPivot = System.Text.Json.JsonEncodedText.Encode("pivot"); + private static readonly System.Text.Json.JsonEncodedText PropRetentionPolicy = System.Text.Json.JsonEncodedText.Encode("retention_policy"); + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + private static readonly System.Text.Json.JsonEncodedText PropSync = System.Text.Json.JsonEncodedText.Encode("sync"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.UpdateTransformResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAuthorization = default; + LocalJsonValue propCreateTime = default; + LocalJsonValue propDescription = default; + LocalJsonValue propDest = default; + LocalJsonValue propFrequency = default; + LocalJsonValue propId = default; + LocalJsonValue propLatest = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propPivot = default; + LocalJsonValue propRetentionPolicy = default; + LocalJsonValue propSettings = default; + LocalJsonValue propSource = default; + LocalJsonValue propSync = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAuthorization.TryReadProperty(ref reader, options, PropAuthorization, null)) + { + continue; + } + + if (propCreateTime.TryReadProperty(ref reader, options, PropCreateTime, null)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propDest.TryReadProperty(ref reader, options, PropDest, null)) + { + continue; + } + + if (propFrequency.TryReadProperty(ref reader, options, PropFrequency, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propLatest.TryReadProperty(ref reader, options, PropLatest, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propPivot.TryReadProperty(ref reader, options, PropPivot, null)) + { + continue; + } + + if (propRetentionPolicy.TryReadProperty(ref reader, options, PropRetentionPolicy, null)) + { + continue; + } + + if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (propSync.TryReadProperty(ref reader, options, PropSync, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.UpdateTransformResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Authorization = propAuthorization.Value, + CreateTime = propCreateTime.Value, + Description = propDescription.Value, + Dest = propDest.Value, + Frequency = propFrequency.Value, + Id = propId.Value, + Latest = propLatest.Value, + Meta = propMeta.Value, + Pivot = propPivot.Value, + RetentionPolicy = propRetentionPolicy.Value, + Settings = propSettings.Value, + Source = propSource.Value, + Sync = propSync.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.UpdateTransformResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAuthorization, value.Authorization, null, null); + writer.WriteProperty(options, PropCreateTime, value.CreateTime, null, null); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropDest, value.Dest, null, null); + writer.WriteProperty(options, PropFrequency, value.Frequency, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropLatest, value.Latest, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropPivot, value.Pivot, null, null); + writer.WriteProperty(options, PropRetentionPolicy, value.RetentionPolicy, null, null); + writer.WriteProperty(options, PropSettings, value.Settings, null, null); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteProperty(options, PropSync, value.Sync, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpdateTransformResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpdateTransformResponse.g.cs index e1523b59d3f..a2d849d7878 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpdateTransformResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpdateTransformResponse.g.cs @@ -23,163 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class UpdateTransformResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAuthorization = System.Text.Json.JsonEncodedText.Encode("authorization"); - private static readonly System.Text.Json.JsonEncodedText PropCreateTime = System.Text.Json.JsonEncodedText.Encode("create_time"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropDest = System.Text.Json.JsonEncodedText.Encode("dest"); - private static readonly System.Text.Json.JsonEncodedText PropFrequency = System.Text.Json.JsonEncodedText.Encode("frequency"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropLatest = System.Text.Json.JsonEncodedText.Encode("latest"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); - private static readonly System.Text.Json.JsonEncodedText PropPivot = System.Text.Json.JsonEncodedText.Encode("pivot"); - private static readonly System.Text.Json.JsonEncodedText PropRetentionPolicy = System.Text.Json.JsonEncodedText.Encode("retention_policy"); - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - private static readonly System.Text.Json.JsonEncodedText PropSync = System.Text.Json.JsonEncodedText.Encode("sync"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.UpdateTransformResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAuthorization = default; - LocalJsonValue propCreateTime = default; - LocalJsonValue propDescription = default; - LocalJsonValue propDest = default; - LocalJsonValue propFrequency = default; - LocalJsonValue propId = default; - LocalJsonValue propLatest = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propPivot = default; - LocalJsonValue propRetentionPolicy = default; - LocalJsonValue propSettings = default; - LocalJsonValue propSource = default; - LocalJsonValue propSync = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAuthorization.TryReadProperty(ref reader, options, PropAuthorization, null)) - { - continue; - } - - if (propCreateTime.TryReadProperty(ref reader, options, PropCreateTime, null)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propDest.TryReadProperty(ref reader, options, PropDest, null)) - { - continue; - } - - if (propFrequency.TryReadProperty(ref reader, options, PropFrequency, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propLatest.TryReadProperty(ref reader, options, PropLatest, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propPivot.TryReadProperty(ref reader, options, PropPivot, null)) - { - continue; - } - - if (propRetentionPolicy.TryReadProperty(ref reader, options, PropRetentionPolicy, null)) - { - continue; - } - - if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (propSync.TryReadProperty(ref reader, options, PropSync, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.UpdateTransformResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Authorization = propAuthorization.Value, - CreateTime = propCreateTime.Value, - Description = propDescription.Value, - Dest = propDest.Value, - Frequency = propFrequency.Value, - Id = propId.Value, - Latest = propLatest.Value, - Meta = propMeta.Value, - Pivot = propPivot.Value, - RetentionPolicy = propRetentionPolicy.Value, - Settings = propSettings.Value, - Source = propSource.Value, - Sync = propSync.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.UpdateTransformResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAuthorization, value.Authorization, null, null); - writer.WriteProperty(options, PropCreateTime, value.CreateTime, null, null); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropDest, value.Dest, null, null); - writer.WriteProperty(options, PropFrequency, value.Frequency, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropLatest, value.Latest, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropPivot, value.Pivot, null, null); - writer.WriteProperty(options, PropRetentionPolicy, value.RetentionPolicy, null, null); - writer.WriteProperty(options, PropSettings, value.Settings, null, null); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteProperty(options, PropSync, value.Sync, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.UpdateTransformResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.UpdateTransformResponseConverter))] public sealed partial class UpdateTransformResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -196,43 +40,43 @@ internal UpdateTransformResponse(Elastic.Clients.Elasticsearch.Serialization.Jso public Elastic.Clients.Elasticsearch.MachineLearning.TransformAuthorization? Authorization { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - long CreateTime { get; set; } +long CreateTime { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Description { get; set; } +string Description { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Core.Reindex.Destination Dest { get; set; } +Elastic.Clients.Elasticsearch.Core.Reindex.Destination Dest { get; set; } public Elastic.Clients.Elasticsearch.Duration? Frequency { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Id { get; set; } +string Id { get; set; } public Elastic.Clients.Elasticsearch.TransformManagement.Latest? Latest { get; set; } public System.Collections.Generic.IReadOnlyDictionary? Meta { get; set; } public Elastic.Clients.Elasticsearch.TransformManagement.Pivot? Pivot { get; set; } public Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy? RetentionPolicy { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.TransformManagement.Settings Settings { get; set; } +Elastic.Clients.Elasticsearch.TransformManagement.Settings Settings { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Core.Reindex.Source Source { get; set; } +Elastic.Clients.Elasticsearch.Core.Reindex.Source Source { get; set; } public Elastic.Clients.Elasticsearch.TransformManagement.Sync? Sync { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Version { get; set; } +string Version { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpgradeTransformsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpgradeTransformsRequest.Converters.g.cs new file mode 100644 index 00000000000..bc42ac725f3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpgradeTransformsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class UpgradeTransformsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.TransformManagement.UpgradeTransformsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.UpgradeTransformsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.UpgradeTransformsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpgradeTransformsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpgradeTransformsRequest.g.cs index 554102ffd62..301bbbd60de 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpgradeTransformsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpgradeTransformsRequest.g.cs @@ -41,35 +41,6 @@ public sealed partial class UpgradeTransformsRequestParameters : Elastic.Transpo public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } } -internal sealed partial class UpgradeTransformsRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.TransformManagement.UpgradeTransformsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.UpgradeTransformsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.UpgradeTransformsRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Upgrade all transforms. @@ -92,7 +63,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// You may want to perform a recent cluster backup prior to the upgrade. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.UpgradeTransformsRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.UpgradeTransformsRequestConverter))] public sealed partial class UpgradeTransformsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpgradeTransformsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpgradeTransformsResponse.Converters.g.cs new file mode 100644 index 00000000000..9cb80dd8522 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpgradeTransformsResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class UpgradeTransformsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNeedsUpdate = System.Text.Json.JsonEncodedText.Encode("needs_update"); + private static readonly System.Text.Json.JsonEncodedText PropNoAction = System.Text.Json.JsonEncodedText.Encode("no_action"); + private static readonly System.Text.Json.JsonEncodedText PropUpdated = System.Text.Json.JsonEncodedText.Encode("updated"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.UpgradeTransformsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propNeedsUpdate = default; + LocalJsonValue propNoAction = default; + LocalJsonValue propUpdated = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNeedsUpdate.TryReadProperty(ref reader, options, PropNeedsUpdate, null)) + { + continue; + } + + if (propNoAction.TryReadProperty(ref reader, options, PropNoAction, null)) + { + continue; + } + + if (propUpdated.TryReadProperty(ref reader, options, PropUpdated, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.UpgradeTransformsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + NeedsUpdate = propNeedsUpdate.Value, + NoAction = propNoAction.Value, + Updated = propUpdated.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.UpgradeTransformsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNeedsUpdate, value.NeedsUpdate, null, null); + writer.WriteProperty(options, PropNoAction, value.NoAction, null, null); + writer.WriteProperty(options, PropUpdated, value.Updated, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpgradeTransformsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpgradeTransformsResponse.g.cs index 4966611dfac..0cd5fd9361b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpgradeTransformsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/TransformManagement/UpgradeTransformsResponse.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class UpgradeTransformsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNeedsUpdate = System.Text.Json.JsonEncodedText.Encode("needs_update"); - private static readonly System.Text.Json.JsonEncodedText PropNoAction = System.Text.Json.JsonEncodedText.Encode("no_action"); - private static readonly System.Text.Json.JsonEncodedText PropUpdated = System.Text.Json.JsonEncodedText.Encode("updated"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.UpgradeTransformsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propNeedsUpdate = default; - LocalJsonValue propNoAction = default; - LocalJsonValue propUpdated = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNeedsUpdate.TryReadProperty(ref reader, options, PropNeedsUpdate, null)) - { - continue; - } - - if (propNoAction.TryReadProperty(ref reader, options, PropNoAction, null)) - { - continue; - } - - if (propUpdated.TryReadProperty(ref reader, options, PropUpdated, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.UpgradeTransformsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - NeedsUpdate = propNeedsUpdate.Value, - NoAction = propNoAction.Value, - Updated = propUpdated.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.UpgradeTransformsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNeedsUpdate, value.NeedsUpdate, null, null); - writer.WriteProperty(options, PropNoAction, value.NoAction, null, null); - writer.WriteProperty(options, PropUpdated, value.Updated, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.UpgradeTransformsResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.UpgradeTransformsResponseConverter))] public sealed partial class UpgradeTransformsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRequest.Converters.g.cs new file mode 100644 index 00000000000..1d44f6e3523 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRequest.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class UpdateByQueryRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropConflicts = System.Text.Json.JsonEncodedText.Encode("conflicts"); + private static readonly System.Text.Json.JsonEncodedText PropMaxDocs = System.Text.Json.JsonEncodedText.Encode("max_docs"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropSlice = System.Text.Json.JsonEncodedText.Encode("slice"); + + public override Elastic.Clients.Elasticsearch.UpdateByQueryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propConflicts = default; + LocalJsonValue propMaxDocs = default; + LocalJsonValue propQuery = default; + LocalJsonValue propScript = default; + LocalJsonValue propSlice = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propConflicts.TryReadProperty(ref reader, options, PropConflicts, static Elastic.Clients.Elasticsearch.Conflicts? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxDocs.TryReadProperty(ref reader, options, PropMaxDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propSlice.TryReadProperty(ref reader, options, PropSlice, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.UpdateByQueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Conflicts = propConflicts.Value, + MaxDocs = propMaxDocs.Value, + Query = propQuery.Value, + Script = propScript.Value, + Slice = propSlice.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.UpdateByQueryRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropConflicts, value.Conflicts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Conflicts? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxDocs, value.MaxDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropSlice, value.Slice, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRequest.g.cs index 60c7006902b..56223c61a21 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRequest.g.cs @@ -260,81 +260,6 @@ public sealed partial class UpdateByQueryRequestParameters : Elastic.Transport.R public bool? WaitForCompletion { get => Q("wait_for_completion"); set => Q("wait_for_completion", value); } } -internal sealed partial class UpdateByQueryRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropConflicts = System.Text.Json.JsonEncodedText.Encode("conflicts"); - private static readonly System.Text.Json.JsonEncodedText PropMaxDocs = System.Text.Json.JsonEncodedText.Encode("max_docs"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropSlice = System.Text.Json.JsonEncodedText.Encode("slice"); - - public override Elastic.Clients.Elasticsearch.UpdateByQueryRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propConflicts = default; - LocalJsonValue propMaxDocs = default; - LocalJsonValue propQuery = default; - LocalJsonValue propScript = default; - LocalJsonValue propSlice = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propConflicts.TryReadProperty(ref reader, options, PropConflicts, static Elastic.Clients.Elasticsearch.Conflicts? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxDocs.TryReadProperty(ref reader, options, PropMaxDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propSlice.TryReadProperty(ref reader, options, PropSlice, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.UpdateByQueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Conflicts = propConflicts.Value, - MaxDocs = propMaxDocs.Value, - Query = propQuery.Value, - Script = propScript.Value, - Slice = propSlice.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.UpdateByQueryRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropConflicts, value.Conflicts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Conflicts? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxDocs, value.MaxDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropSlice, value.Slice, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Update documents. @@ -503,7 +428,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Refer to the linked documentation for examples of how to update documents using the _update_by_query API: /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.UpdateByQueryRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.UpdateByQueryRequestConverter))] public sealed partial class UpdateByQueryRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryResponse.Converters.g.cs new file mode 100644 index 00000000000..c2ead8bdf25 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryResponse.Converters.g.cs @@ -0,0 +1,198 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class UpdateByQueryResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBatches = System.Text.Json.JsonEncodedText.Encode("batches"); + private static readonly System.Text.Json.JsonEncodedText PropDeleted = System.Text.Json.JsonEncodedText.Encode("deleted"); + private static readonly System.Text.Json.JsonEncodedText PropFailures = System.Text.Json.JsonEncodedText.Encode("failures"); + private static readonly System.Text.Json.JsonEncodedText PropNoops = System.Text.Json.JsonEncodedText.Encode("noops"); + private static readonly System.Text.Json.JsonEncodedText PropRequestsPerSecond = System.Text.Json.JsonEncodedText.Encode("requests_per_second"); + private static readonly System.Text.Json.JsonEncodedText PropRetries = System.Text.Json.JsonEncodedText.Encode("retries"); + private static readonly System.Text.Json.JsonEncodedText PropTask = System.Text.Json.JsonEncodedText.Encode("task"); + private static readonly System.Text.Json.JsonEncodedText PropThrottled = System.Text.Json.JsonEncodedText.Encode("throttled"); + private static readonly System.Text.Json.JsonEncodedText PropThrottledMillis = System.Text.Json.JsonEncodedText.Encode("throttled_millis"); + private static readonly System.Text.Json.JsonEncodedText PropThrottledUntil = System.Text.Json.JsonEncodedText.Encode("throttled_until"); + private static readonly System.Text.Json.JsonEncodedText PropThrottledUntilMillis = System.Text.Json.JsonEncodedText.Encode("throttled_until_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); + private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + private static readonly System.Text.Json.JsonEncodedText PropUpdated = System.Text.Json.JsonEncodedText.Encode("updated"); + private static readonly System.Text.Json.JsonEncodedText PropVersionConflicts = System.Text.Json.JsonEncodedText.Encode("version_conflicts"); + + public override Elastic.Clients.Elasticsearch.UpdateByQueryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBatches = default; + LocalJsonValue propDeleted = default; + LocalJsonValue?> propFailures = default; + LocalJsonValue propNoops = default; + LocalJsonValue propRequestsPerSecond = default; + LocalJsonValue propRetries = default; + LocalJsonValue propTask = default; + LocalJsonValue propThrottled = default; + LocalJsonValue propThrottledMillis = default; + LocalJsonValue propThrottledUntil = default; + LocalJsonValue propThrottledUntilMillis = default; + LocalJsonValue propTimedOut = default; + LocalJsonValue propTook = default; + LocalJsonValue propTotal = default; + LocalJsonValue propUpdated = default; + LocalJsonValue propVersionConflicts = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBatches.TryReadProperty(ref reader, options, PropBatches, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDeleted.TryReadProperty(ref reader, options, PropDeleted, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFailures.TryReadProperty(ref reader, options, PropFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propNoops.TryReadProperty(ref reader, options, PropNoops, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRequestsPerSecond.TryReadProperty(ref reader, options, PropRequestsPerSecond, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRetries.TryReadProperty(ref reader, options, PropRetries, null)) + { + continue; + } + + if (propTask.TryReadProperty(ref reader, options, PropTask, null)) + { + continue; + } + + if (propThrottled.TryReadProperty(ref reader, options, PropThrottled, null)) + { + continue; + } + + if (propThrottledMillis.TryReadProperty(ref reader, options, PropThrottledMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propThrottledUntil.TryReadProperty(ref reader, options, PropThrottledUntil, null)) + { + continue; + } + + if (propThrottledUntilMillis.TryReadProperty(ref reader, options, PropThrottledUntilMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTook.TryReadProperty(ref reader, options, PropTook, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propUpdated.TryReadProperty(ref reader, options, PropUpdated, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propVersionConflicts.TryReadProperty(ref reader, options, PropVersionConflicts, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.UpdateByQueryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Batches = propBatches.Value, + Deleted = propDeleted.Value, + Failures = propFailures.Value, + Noops = propNoops.Value, + RequestsPerSecond = propRequestsPerSecond.Value, + Retries = propRetries.Value, + Task = propTask.Value, + Throttled = propThrottled.Value, + ThrottledMillis = propThrottledMillis.Value, + ThrottledUntil = propThrottledUntil.Value, + ThrottledUntilMillis = propThrottledUntilMillis.Value, + TimedOut = propTimedOut.Value, + Took = propTook.Value, + Total = propTotal.Value, + Updated = propUpdated.Value, + VersionConflicts = propVersionConflicts.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.UpdateByQueryResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBatches, value.Batches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDeleted, value.Deleted, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFailures, value.Failures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropNoops, value.Noops, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRequestsPerSecond, value.RequestsPerSecond, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRetries, value.Retries, null, null); + writer.WriteProperty(options, PropTask, value.Task, null, null); + writer.WriteProperty(options, PropThrottled, value.Throttled, null, null); + writer.WriteProperty(options, PropThrottledMillis, value.ThrottledMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropThrottledUntil, value.ThrottledUntil, null, null); + writer.WriteProperty(options, PropThrottledUntilMillis, value.ThrottledUntilMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTook, value.Took, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTotal, value.Total, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropUpdated, value.Updated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVersionConflicts, value.VersionConflicts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryResponse.g.cs index d99afaa2a35..eb984d5e203 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryResponse.g.cs @@ -23,181 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class UpdateByQueryResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBatches = System.Text.Json.JsonEncodedText.Encode("batches"); - private static readonly System.Text.Json.JsonEncodedText PropDeleted = System.Text.Json.JsonEncodedText.Encode("deleted"); - private static readonly System.Text.Json.JsonEncodedText PropFailures = System.Text.Json.JsonEncodedText.Encode("failures"); - private static readonly System.Text.Json.JsonEncodedText PropNoops = System.Text.Json.JsonEncodedText.Encode("noops"); - private static readonly System.Text.Json.JsonEncodedText PropRequestsPerSecond = System.Text.Json.JsonEncodedText.Encode("requests_per_second"); - private static readonly System.Text.Json.JsonEncodedText PropRetries = System.Text.Json.JsonEncodedText.Encode("retries"); - private static readonly System.Text.Json.JsonEncodedText PropTask = System.Text.Json.JsonEncodedText.Encode("task"); - private static readonly System.Text.Json.JsonEncodedText PropThrottled = System.Text.Json.JsonEncodedText.Encode("throttled"); - private static readonly System.Text.Json.JsonEncodedText PropThrottledMillis = System.Text.Json.JsonEncodedText.Encode("throttled_millis"); - private static readonly System.Text.Json.JsonEncodedText PropThrottledUntil = System.Text.Json.JsonEncodedText.Encode("throttled_until"); - private static readonly System.Text.Json.JsonEncodedText PropThrottledUntilMillis = System.Text.Json.JsonEncodedText.Encode("throttled_until_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); - private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - private static readonly System.Text.Json.JsonEncodedText PropUpdated = System.Text.Json.JsonEncodedText.Encode("updated"); - private static readonly System.Text.Json.JsonEncodedText PropVersionConflicts = System.Text.Json.JsonEncodedText.Encode("version_conflicts"); - - public override Elastic.Clients.Elasticsearch.UpdateByQueryResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBatches = default; - LocalJsonValue propDeleted = default; - LocalJsonValue?> propFailures = default; - LocalJsonValue propNoops = default; - LocalJsonValue propRequestsPerSecond = default; - LocalJsonValue propRetries = default; - LocalJsonValue propTask = default; - LocalJsonValue propThrottled = default; - LocalJsonValue propThrottledMillis = default; - LocalJsonValue propThrottledUntil = default; - LocalJsonValue propThrottledUntilMillis = default; - LocalJsonValue propTimedOut = default; - LocalJsonValue propTook = default; - LocalJsonValue propTotal = default; - LocalJsonValue propUpdated = default; - LocalJsonValue propVersionConflicts = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBatches.TryReadProperty(ref reader, options, PropBatches, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDeleted.TryReadProperty(ref reader, options, PropDeleted, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFailures.TryReadProperty(ref reader, options, PropFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propNoops.TryReadProperty(ref reader, options, PropNoops, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRequestsPerSecond.TryReadProperty(ref reader, options, PropRequestsPerSecond, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRetries.TryReadProperty(ref reader, options, PropRetries, null)) - { - continue; - } - - if (propTask.TryReadProperty(ref reader, options, PropTask, null)) - { - continue; - } - - if (propThrottled.TryReadProperty(ref reader, options, PropThrottled, null)) - { - continue; - } - - if (propThrottledMillis.TryReadProperty(ref reader, options, PropThrottledMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propThrottledUntil.TryReadProperty(ref reader, options, PropThrottledUntil, null)) - { - continue; - } - - if (propThrottledUntilMillis.TryReadProperty(ref reader, options, PropThrottledUntilMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTook.TryReadProperty(ref reader, options, PropTook, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propUpdated.TryReadProperty(ref reader, options, PropUpdated, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propVersionConflicts.TryReadProperty(ref reader, options, PropVersionConflicts, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.UpdateByQueryResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Batches = propBatches.Value, - Deleted = propDeleted.Value, - Failures = propFailures.Value, - Noops = propNoops.Value, - RequestsPerSecond = propRequestsPerSecond.Value, - Retries = propRetries.Value, - Task = propTask.Value, - Throttled = propThrottled.Value, - ThrottledMillis = propThrottledMillis.Value, - ThrottledUntil = propThrottledUntil.Value, - ThrottledUntilMillis = propThrottledUntilMillis.Value, - TimedOut = propTimedOut.Value, - Took = propTook.Value, - Total = propTotal.Value, - Updated = propUpdated.Value, - VersionConflicts = propVersionConflicts.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.UpdateByQueryResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBatches, value.Batches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDeleted, value.Deleted, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFailures, value.Failures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropNoops, value.Noops, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRequestsPerSecond, value.RequestsPerSecond, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRetries, value.Retries, null, null); - writer.WriteProperty(options, PropTask, value.Task, null, null); - writer.WriteProperty(options, PropThrottled, value.Throttled, null, null); - writer.WriteProperty(options, PropThrottledMillis, value.ThrottledMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropThrottledUntil, value.ThrottledUntil, null, null); - writer.WriteProperty(options, PropThrottledUntilMillis, value.ThrottledUntilMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTook, value.Took, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTotal, value.Total, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropUpdated, value.Updated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropVersionConflicts, value.VersionConflicts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.UpdateByQueryResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.UpdateByQueryResponseConverter))] public sealed partial class UpdateByQueryResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRethrottleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRethrottleRequest.Converters.g.cs new file mode 100644 index 00000000000..d498b616f6e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRethrottleRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class UpdateByQueryRethrottleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.UpdateByQueryRethrottleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.UpdateByQueryRethrottleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.UpdateByQueryRethrottleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRethrottleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRethrottleRequest.g.cs index 2c0b1b2f9c1..2f77de343dd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRethrottleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRethrottleRequest.g.cs @@ -34,35 +34,6 @@ public sealed partial class UpdateByQueryRethrottleRequestParameters : Elastic.T public float? RequestsPerSecond { get => Q("requests_per_second"); set => Q("requests_per_second", value); } } -internal sealed partial class UpdateByQueryRethrottleRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.UpdateByQueryRethrottleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.UpdateByQueryRethrottleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.UpdateByQueryRethrottleRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Throttle an update by query operation. @@ -72,7 +43,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Rethrottling that speeds up the query takes effect immediately but rethrotting that slows down the query takes effect after completing the current batch to prevent scroll timeouts. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.UpdateByQueryRethrottleRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.UpdateByQueryRethrottleRequestConverter))] public sealed partial class UpdateByQueryRethrottleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRethrottleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRethrottleResponse.Converters.g.cs new file mode 100644 index 00000000000..80b2e427e07 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRethrottleResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class UpdateByQueryRethrottleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); + + public override Elastic.Clients.Elasticsearch.UpdateByQueryRethrottleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propNodes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.UpdateByQueryRethrottleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Nodes = propNodes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.UpdateByQueryRethrottleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRethrottleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRethrottleResponse.g.cs index dd35a2f0f4c..113ab8706c4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRethrottleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRethrottleResponse.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class UpdateByQueryRethrottleResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); - - public override Elastic.Clients.Elasticsearch.UpdateByQueryRethrottleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propNodes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.UpdateByQueryRethrottleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Nodes = propNodes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.UpdateByQueryRethrottleResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.UpdateByQueryRethrottleResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.UpdateByQueryRethrottleResponseConverter))] public sealed partial class UpdateByQueryRethrottleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -78,7 +39,7 @@ internal UpdateByQueryRethrottleResponse(Elastic.Clients.Elasticsearch.Serializa public #if NET7_0_OR_GREATER - required +required #endif - System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } +System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateRequest.Converters.g.cs new file mode 100644 index 00000000000..f9415d8f89a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateRequest.Converters.g.cs @@ -0,0 +1,133 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class UpdateRequestConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropDetectNoop = System.Text.Json.JsonEncodedText.Encode("detect_noop"); + private static readonly System.Text.Json.JsonEncodedText PropDoc = System.Text.Json.JsonEncodedText.Encode("doc"); + private static readonly System.Text.Json.JsonEncodedText PropDocAsUpsert = System.Text.Json.JsonEncodedText.Encode("doc_as_upsert"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropScriptedUpsert = System.Text.Json.JsonEncodedText.Encode("scripted_upsert"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); + private static readonly System.Text.Json.JsonEncodedText PropUpsert = System.Text.Json.JsonEncodedText.Encode("upsert"); + + public override Elastic.Clients.Elasticsearch.UpdateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDetectNoop = default; + LocalJsonValue propDoc = default; + LocalJsonValue propDocAsUpsert = default; + LocalJsonValue propScript = default; + LocalJsonValue propScriptedUpsert = default; + LocalJsonValue propSource = default; + LocalJsonValue propUpsert = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDetectNoop.TryReadProperty(ref reader, options, PropDetectNoop, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDoc.TryReadProperty(ref reader, options, PropDoc, static TPartialDocument? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propDocAsUpsert.TryReadProperty(ref reader, options, PropDocAsUpsert, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propScriptedUpsert.TryReadProperty(ref reader, options, PropScriptedUpsert, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (propUpsert.TryReadProperty(ref reader, options, PropUpsert, static TDocument? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.UpdateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DetectNoop = propDetectNoop.Value, + Doc = propDoc.Value, + DocAsUpsert = propDocAsUpsert.Value, + Script = propScript.Value, + ScriptedUpsert = propScriptedUpsert.Value, + Source = propSource.Value, + Upsert = propUpsert.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.UpdateRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDetectNoop, value.DetectNoop, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDoc, value.Doc, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TPartialDocument? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropDocAsUpsert, value.DocAsUpsert, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropScriptedUpsert, value.ScriptedUpsert, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteProperty(options, PropUpsert, value.Upsert, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TDocument? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} + +public sealed partial class UpdateRequestConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(UpdateRequest<,>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(UpdateRequestConverter<,>).MakeGenericType(args[0], args[1]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateRequest.g.cs index 9073bb58ae8..2fe923270aa 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateRequest.g.cs @@ -116,115 +116,6 @@ public sealed partial class UpdateRequestParameters : Elastic.Transport.RequestP public Elastic.Clients.Elasticsearch.WaitForActiveShards? WaitForActiveShards { get => Q("wait_for_active_shards"); set => Q("wait_for_active_shards", value); } } -internal sealed partial class UpdateRequestConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropDetectNoop = System.Text.Json.JsonEncodedText.Encode("detect_noop"); - private static readonly System.Text.Json.JsonEncodedText PropDoc = System.Text.Json.JsonEncodedText.Encode("doc"); - private static readonly System.Text.Json.JsonEncodedText PropDocAsUpsert = System.Text.Json.JsonEncodedText.Encode("doc_as_upsert"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropScriptedUpsert = System.Text.Json.JsonEncodedText.Encode("scripted_upsert"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); - private static readonly System.Text.Json.JsonEncodedText PropUpsert = System.Text.Json.JsonEncodedText.Encode("upsert"); - - public override Elastic.Clients.Elasticsearch.UpdateRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDetectNoop = default; - LocalJsonValue propDoc = default; - LocalJsonValue propDocAsUpsert = default; - LocalJsonValue propScript = default; - LocalJsonValue propScriptedUpsert = default; - LocalJsonValue propSource = default; - LocalJsonValue propUpsert = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDetectNoop.TryReadProperty(ref reader, options, PropDetectNoop, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDoc.TryReadProperty(ref reader, options, PropDoc, static TPartialDocument? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propDocAsUpsert.TryReadProperty(ref reader, options, PropDocAsUpsert, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propScriptedUpsert.TryReadProperty(ref reader, options, PropScriptedUpsert, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (propUpsert.TryReadProperty(ref reader, options, PropUpsert, static TDocument? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.UpdateRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DetectNoop = propDetectNoop.Value, - Doc = propDoc.Value, - DocAsUpsert = propDocAsUpsert.Value, - Script = propScript.Value, - ScriptedUpsert = propScriptedUpsert.Value, - Source = propSource.Value, - Upsert = propUpsert.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.UpdateRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDetectNoop, value.DetectNoop, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDoc, value.Doc, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TPartialDocument? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropDocAsUpsert, value.DocAsUpsert, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropScriptedUpsert, value.ScriptedUpsert, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteProperty(options, PropUpsert, value.Upsert, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TDocument? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteEndObject(); - } -} - -internal sealed partial class UpdateRequestConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(UpdateRequest<,>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(UpdateRequestConverter<,>).MakeGenericType(args[0], args[1]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - /// /// /// Update a document. @@ -267,7 +158,7 @@ public override System.Text.Json.Serialization.JsonConverter CreateConverter(Sys /// For usage examples such as partial updates, upserts, and scripted updates, see the External documentation. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.UpdateRequestConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.UpdateRequestConverterFactory))] public sealed partial class UpdateRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateResponse.Converters.g.cs new file mode 100644 index 00000000000..27f5e49bb1f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateResponse.Converters.g.cs @@ -0,0 +1,151 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class UpdateResponseConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropForcedRefresh = System.Text.Json.JsonEncodedText.Encode("forced_refresh"); + private static readonly System.Text.Json.JsonEncodedText PropGet = System.Text.Json.JsonEncodedText.Encode("get"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); + private static readonly System.Text.Json.JsonEncodedText PropPrimaryTerm = System.Text.Json.JsonEncodedText.Encode("_primary_term"); + private static readonly System.Text.Json.JsonEncodedText PropResult = System.Text.Json.JsonEncodedText.Encode("result"); + private static readonly System.Text.Json.JsonEncodedText PropSeqNo = System.Text.Json.JsonEncodedText.Encode("_seq_no"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("_version"); + + public override Elastic.Clients.Elasticsearch.UpdateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propForcedRefresh = default; + LocalJsonValue?> propGet = default; + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + LocalJsonValue propPrimaryTerm = default; + LocalJsonValue propResult = default; + LocalJsonValue propSeqNo = default; + LocalJsonValue propShards = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propForcedRefresh.TryReadProperty(ref reader, options, PropForcedRefresh, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propGet.TryReadProperty(ref reader, options, PropGet, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propPrimaryTerm.TryReadProperty(ref reader, options, PropPrimaryTerm, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propResult.TryReadProperty(ref reader, options, PropResult, null)) + { + continue; + } + + if (propSeqNo.TryReadProperty(ref reader, options, PropSeqNo, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.UpdateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ForcedRefresh = propForcedRefresh.Value, + Get = propGet.Value, + Id = propId.Value, + Index = propIndex.Value, + PrimaryTerm = propPrimaryTerm.Value, + Result = propResult.Value, + SeqNo = propSeqNo.Value, + Shards = propShards.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.UpdateResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropForcedRefresh, value.ForcedRefresh, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropGet, value.Get, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropPrimaryTerm, value.PrimaryTerm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropResult, value.Result, null, null); + writer.WriteProperty(options, PropSeqNo, value.SeqNo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} + +public sealed partial class UpdateResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(UpdateResponse<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(UpdateResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateResponse.g.cs index 377eae51281..7346f1944c4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateResponse.g.cs @@ -23,134 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class UpdateResponseConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropForcedRefresh = System.Text.Json.JsonEncodedText.Encode("forced_refresh"); - private static readonly System.Text.Json.JsonEncodedText PropGet = System.Text.Json.JsonEncodedText.Encode("get"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); - private static readonly System.Text.Json.JsonEncodedText PropPrimaryTerm = System.Text.Json.JsonEncodedText.Encode("_primary_term"); - private static readonly System.Text.Json.JsonEncodedText PropResult = System.Text.Json.JsonEncodedText.Encode("result"); - private static readonly System.Text.Json.JsonEncodedText PropSeqNo = System.Text.Json.JsonEncodedText.Encode("_seq_no"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("_version"); - - public override Elastic.Clients.Elasticsearch.UpdateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propForcedRefresh = default; - LocalJsonValue?> propGet = default; - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - LocalJsonValue propPrimaryTerm = default; - LocalJsonValue propResult = default; - LocalJsonValue propSeqNo = default; - LocalJsonValue propShards = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propForcedRefresh.TryReadProperty(ref reader, options, PropForcedRefresh, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propGet.TryReadProperty(ref reader, options, PropGet, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propPrimaryTerm.TryReadProperty(ref reader, options, PropPrimaryTerm, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propResult.TryReadProperty(ref reader, options, PropResult, null)) - { - continue; - } - - if (propSeqNo.TryReadProperty(ref reader, options, PropSeqNo, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.UpdateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ForcedRefresh = propForcedRefresh.Value, - Get = propGet.Value, - Id = propId.Value, - Index = propIndex.Value, - PrimaryTerm = propPrimaryTerm.Value, - Result = propResult.Value, - SeqNo = propSeqNo.Value, - Shards = propShards.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.UpdateResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropForcedRefresh, value.ForcedRefresh, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropGet, value.Get, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropPrimaryTerm, value.PrimaryTerm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropResult, value.Result, null, null); - writer.WriteProperty(options, PropSeqNo, value.SeqNo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -internal sealed partial class UpdateResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(UpdateResponse<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(UpdateResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.UpdateResponseConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.UpdateResponseConverterFactory))] public sealed partial class UpdateResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackInfoRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackInfoRequest.Converters.g.cs new file mode 100644 index 00000000000..6057eb3e9d0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackInfoRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class XpackInfoRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Xpack.XpackInfoRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.XpackInfoRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.XpackInfoRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackInfoRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackInfoRequest.g.cs index fca20cf01ce..afa7fd23ac6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackInfoRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackInfoRequest.g.cs @@ -41,35 +41,6 @@ public sealed partial class XpackInfoRequestParameters : Elastic.Transport.Reque public System.Collections.Generic.ICollection? Categories { get => Q?>("categories"); set => Q("categories", value); } } -internal sealed partial class XpackInfoRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Xpack.XpackInfoRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.XpackInfoRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.XpackInfoRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get information. @@ -93,7 +64,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.XpackInfoRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.XpackInfoRequestConverter))] public sealed partial class XpackInfoRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackInfoResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackInfoResponse.Converters.g.cs new file mode 100644 index 00000000000..de2fbba4b5e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackInfoResponse.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class XpackInfoResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuild = System.Text.Json.JsonEncodedText.Encode("build"); + private static readonly System.Text.Json.JsonEncodedText PropFeatures = System.Text.Json.JsonEncodedText.Encode("features"); + private static readonly System.Text.Json.JsonEncodedText PropLicense = System.Text.Json.JsonEncodedText.Encode("license"); + private static readonly System.Text.Json.JsonEncodedText PropTagline = System.Text.Json.JsonEncodedText.Encode("tagline"); + + public override Elastic.Clients.Elasticsearch.Xpack.XpackInfoResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBuild = default; + LocalJsonValue propFeatures = default; + LocalJsonValue propLicense = default; + LocalJsonValue propTagline = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuild.TryReadProperty(ref reader, options, PropBuild, null)) + { + continue; + } + + if (propFeatures.TryReadProperty(ref reader, options, PropFeatures, null)) + { + continue; + } + + if (propLicense.TryReadProperty(ref reader, options, PropLicense, null)) + { + continue; + } + + if (propTagline.TryReadProperty(ref reader, options, PropTagline, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.XpackInfoResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Build = propBuild.Value, + Features = propFeatures.Value, + License = propLicense.Value, + Tagline = propTagline.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.XpackInfoResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuild, value.Build, null, null); + writer.WriteProperty(options, PropFeatures, value.Features, null, null); + writer.WriteProperty(options, PropLicense, value.License, null, null); + writer.WriteProperty(options, PropTagline, value.Tagline, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackInfoResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackInfoResponse.g.cs index 515cadc9022..426c176224d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackInfoResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackInfoResponse.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class XpackInfoResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuild = System.Text.Json.JsonEncodedText.Encode("build"); - private static readonly System.Text.Json.JsonEncodedText PropFeatures = System.Text.Json.JsonEncodedText.Encode("features"); - private static readonly System.Text.Json.JsonEncodedText PropLicense = System.Text.Json.JsonEncodedText.Encode("license"); - private static readonly System.Text.Json.JsonEncodedText PropTagline = System.Text.Json.JsonEncodedText.Encode("tagline"); - - public override Elastic.Clients.Elasticsearch.Xpack.XpackInfoResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBuild = default; - LocalJsonValue propFeatures = default; - LocalJsonValue propLicense = default; - LocalJsonValue propTagline = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuild.TryReadProperty(ref reader, options, PropBuild, null)) - { - continue; - } - - if (propFeatures.TryReadProperty(ref reader, options, PropFeatures, null)) - { - continue; - } - - if (propLicense.TryReadProperty(ref reader, options, PropLicense, null)) - { - continue; - } - - if (propTagline.TryReadProperty(ref reader, options, PropTagline, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.XpackInfoResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Build = propBuild.Value, - Features = propFeatures.Value, - License = propLicense.Value, - Tagline = propTagline.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.XpackInfoResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuild, value.Build, null, null); - writer.WriteProperty(options, PropFeatures, value.Features, null, null); - writer.WriteProperty(options, PropLicense, value.License, null, null); - writer.WriteProperty(options, PropTagline, value.Tagline, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.XpackInfoResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.XpackInfoResponseConverter))] public sealed partial class XpackInfoResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -105,22 +39,22 @@ internal XpackInfoResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConst public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Xpack.BuildInformation Build { get; set; } +Elastic.Clients.Elasticsearch.Xpack.BuildInformation Build { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Xpack.Features Features { get; set; } +Elastic.Clients.Elasticsearch.Xpack.Features Features { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Xpack.MinimalLicenseInformation License { get; set; } +Elastic.Clients.Elasticsearch.Xpack.MinimalLicenseInformation License { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - string Tagline { get; set; } +string Tagline { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageRequest.Converters.g.cs new file mode 100644 index 00000000000..7c6803047b5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class XpackUsageRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Xpack.XpackUsageRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.XpackUsageRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.XpackUsageRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageRequest.g.cs index 613eb851282..7b99bbcfb73 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageRequest.g.cs @@ -35,35 +35,6 @@ public sealed partial class XpackUsageRequestParameters : Elastic.Transport.Requ public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } -internal sealed partial class XpackUsageRequestConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Xpack.XpackUsageRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.XpackUsageRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.XpackUsageRequest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// Get usage information. @@ -71,7 +42,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// The API also provides some usage statistics. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.XpackUsageRequestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.XpackUsageRequestConverter))] public sealed partial class XpackUsageRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageResponse.Converters.g.cs new file mode 100644 index 00000000000..6d58393ca51 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageResponse.Converters.g.cs @@ -0,0 +1,306 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class XpackUsageResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAggregateMetric = System.Text.Json.JsonEncodedText.Encode("aggregate_metric"); + private static readonly System.Text.Json.JsonEncodedText PropAnalytics = System.Text.Json.JsonEncodedText.Encode("analytics"); + private static readonly System.Text.Json.JsonEncodedText PropArchive = System.Text.Json.JsonEncodedText.Encode("archive"); + private static readonly System.Text.Json.JsonEncodedText PropCcr = System.Text.Json.JsonEncodedText.Encode("ccr"); + private static readonly System.Text.Json.JsonEncodedText PropDataFrame = System.Text.Json.JsonEncodedText.Encode("data_frame"); + private static readonly System.Text.Json.JsonEncodedText PropDataScience = System.Text.Json.JsonEncodedText.Encode("data_science"); + private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"); + private static readonly System.Text.Json.JsonEncodedText PropDataTiers = System.Text.Json.JsonEncodedText.Encode("data_tiers"); + private static readonly System.Text.Json.JsonEncodedText PropEnrich = System.Text.Json.JsonEncodedText.Encode("enrich"); + private static readonly System.Text.Json.JsonEncodedText PropEql = System.Text.Json.JsonEncodedText.Encode("eql"); + private static readonly System.Text.Json.JsonEncodedText PropFlattened = System.Text.Json.JsonEncodedText.Encode("flattened"); + private static readonly System.Text.Json.JsonEncodedText PropGraph = System.Text.Json.JsonEncodedText.Encode("graph"); + private static readonly System.Text.Json.JsonEncodedText PropHealthApi = System.Text.Json.JsonEncodedText.Encode("health_api"); + private static readonly System.Text.Json.JsonEncodedText PropIlm = System.Text.Json.JsonEncodedText.Encode("ilm"); + private static readonly System.Text.Json.JsonEncodedText PropLogstash = System.Text.Json.JsonEncodedText.Encode("logstash"); + private static readonly System.Text.Json.JsonEncodedText PropMl = System.Text.Json.JsonEncodedText.Encode("ml"); + private static readonly System.Text.Json.JsonEncodedText PropMonitoring = System.Text.Json.JsonEncodedText.Encode("monitoring"); + private static readonly System.Text.Json.JsonEncodedText PropRollup = System.Text.Json.JsonEncodedText.Encode("rollup"); + private static readonly System.Text.Json.JsonEncodedText PropRuntimeFields = System.Text.Json.JsonEncodedText.Encode("runtime_fields"); + private static readonly System.Text.Json.JsonEncodedText PropSearchableSnapshots = System.Text.Json.JsonEncodedText.Encode("searchable_snapshots"); + private static readonly System.Text.Json.JsonEncodedText PropSecurity = System.Text.Json.JsonEncodedText.Encode("security"); + private static readonly System.Text.Json.JsonEncodedText PropSlm = System.Text.Json.JsonEncodedText.Encode("slm"); + private static readonly System.Text.Json.JsonEncodedText PropSpatial = System.Text.Json.JsonEncodedText.Encode("spatial"); + private static readonly System.Text.Json.JsonEncodedText PropSql = System.Text.Json.JsonEncodedText.Encode("sql"); + private static readonly System.Text.Json.JsonEncodedText PropTransform = System.Text.Json.JsonEncodedText.Encode("transform"); + private static readonly System.Text.Json.JsonEncodedText PropVectors = System.Text.Json.JsonEncodedText.Encode("vectors"); + private static readonly System.Text.Json.JsonEncodedText PropVotingOnly = System.Text.Json.JsonEncodedText.Encode("voting_only"); + private static readonly System.Text.Json.JsonEncodedText PropWatcher = System.Text.Json.JsonEncodedText.Encode("watcher"); + + public override Elastic.Clients.Elasticsearch.Xpack.XpackUsageResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAggregateMetric = default; + LocalJsonValue propAnalytics = default; + LocalJsonValue propArchive = default; + LocalJsonValue propCcr = default; + LocalJsonValue propDataFrame = default; + LocalJsonValue propDataScience = default; + LocalJsonValue propDataStreams = default; + LocalJsonValue propDataTiers = default; + LocalJsonValue propEnrich = default; + LocalJsonValue propEql = default; + LocalJsonValue propFlattened = default; + LocalJsonValue propGraph = default; + LocalJsonValue propHealthApi = default; + LocalJsonValue propIlm = default; + LocalJsonValue propLogstash = default; + LocalJsonValue propMl = default; + LocalJsonValue propMonitoring = default; + LocalJsonValue propRollup = default; + LocalJsonValue propRuntimeFields = default; + LocalJsonValue propSearchableSnapshots = default; + LocalJsonValue propSecurity = default; + LocalJsonValue propSlm = default; + LocalJsonValue propSpatial = default; + LocalJsonValue propSql = default; + LocalJsonValue propTransform = default; + LocalJsonValue propVectors = default; + LocalJsonValue propVotingOnly = default; + LocalJsonValue propWatcher = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregateMetric.TryReadProperty(ref reader, options, PropAggregateMetric, null)) + { + continue; + } + + if (propAnalytics.TryReadProperty(ref reader, options, PropAnalytics, null)) + { + continue; + } + + if (propArchive.TryReadProperty(ref reader, options, PropArchive, null)) + { + continue; + } + + if (propCcr.TryReadProperty(ref reader, options, PropCcr, null)) + { + continue; + } + + if (propDataFrame.TryReadProperty(ref reader, options, PropDataFrame, null)) + { + continue; + } + + if (propDataScience.TryReadProperty(ref reader, options, PropDataScience, null)) + { + continue; + } + + if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, null)) + { + continue; + } + + if (propDataTiers.TryReadProperty(ref reader, options, PropDataTiers, null)) + { + continue; + } + + if (propEnrich.TryReadProperty(ref reader, options, PropEnrich, null)) + { + continue; + } + + if (propEql.TryReadProperty(ref reader, options, PropEql, null)) + { + continue; + } + + if (propFlattened.TryReadProperty(ref reader, options, PropFlattened, null)) + { + continue; + } + + if (propGraph.TryReadProperty(ref reader, options, PropGraph, null)) + { + continue; + } + + if (propHealthApi.TryReadProperty(ref reader, options, PropHealthApi, null)) + { + continue; + } + + if (propIlm.TryReadProperty(ref reader, options, PropIlm, null)) + { + continue; + } + + if (propLogstash.TryReadProperty(ref reader, options, PropLogstash, null)) + { + continue; + } + + if (propMl.TryReadProperty(ref reader, options, PropMl, null)) + { + continue; + } + + if (propMonitoring.TryReadProperty(ref reader, options, PropMonitoring, null)) + { + continue; + } + + if (propRollup.TryReadProperty(ref reader, options, PropRollup, null)) + { + continue; + } + + if (propRuntimeFields.TryReadProperty(ref reader, options, PropRuntimeFields, null)) + { + continue; + } + + if (propSearchableSnapshots.TryReadProperty(ref reader, options, PropSearchableSnapshots, null)) + { + continue; + } + + if (propSecurity.TryReadProperty(ref reader, options, PropSecurity, null)) + { + continue; + } + + if (propSlm.TryReadProperty(ref reader, options, PropSlm, null)) + { + continue; + } + + if (propSpatial.TryReadProperty(ref reader, options, PropSpatial, null)) + { + continue; + } + + if (propSql.TryReadProperty(ref reader, options, PropSql, null)) + { + continue; + } + + if (propTransform.TryReadProperty(ref reader, options, PropTransform, null)) + { + continue; + } + + if (propVectors.TryReadProperty(ref reader, options, PropVectors, null)) + { + continue; + } + + if (propVotingOnly.TryReadProperty(ref reader, options, PropVotingOnly, null)) + { + continue; + } + + if (propWatcher.TryReadProperty(ref reader, options, PropWatcher, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.XpackUsageResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AggregateMetric = propAggregateMetric.Value, + Analytics = propAnalytics.Value, + Archive = propArchive.Value, + Ccr = propCcr.Value, + DataFrame = propDataFrame.Value, + DataScience = propDataScience.Value, + DataStreams = propDataStreams.Value, + DataTiers = propDataTiers.Value, + Enrich = propEnrich.Value, + Eql = propEql.Value, + Flattened = propFlattened.Value, + Graph = propGraph.Value, + HealthApi = propHealthApi.Value, + Ilm = propIlm.Value, + Logstash = propLogstash.Value, + Ml = propMl.Value, + Monitoring = propMonitoring.Value, + Rollup = propRollup.Value, + RuntimeFields = propRuntimeFields.Value, + SearchableSnapshots = propSearchableSnapshots.Value, + Security = propSecurity.Value, + Slm = propSlm.Value, + Spatial = propSpatial.Value, + Sql = propSql.Value, + Transform = propTransform.Value, + Vectors = propVectors.Value, + VotingOnly = propVotingOnly.Value, + Watcher = propWatcher.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.XpackUsageResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregateMetric, value.AggregateMetric, null, null); + writer.WriteProperty(options, PropAnalytics, value.Analytics, null, null); + writer.WriteProperty(options, PropArchive, value.Archive, null, null); + writer.WriteProperty(options, PropCcr, value.Ccr, null, null); + writer.WriteProperty(options, PropDataFrame, value.DataFrame, null, null); + writer.WriteProperty(options, PropDataScience, value.DataScience, null, null); + writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, null); + writer.WriteProperty(options, PropDataTiers, value.DataTiers, null, null); + writer.WriteProperty(options, PropEnrich, value.Enrich, null, null); + writer.WriteProperty(options, PropEql, value.Eql, null, null); + writer.WriteProperty(options, PropFlattened, value.Flattened, null, null); + writer.WriteProperty(options, PropGraph, value.Graph, null, null); + writer.WriteProperty(options, PropHealthApi, value.HealthApi, null, null); + writer.WriteProperty(options, PropIlm, value.Ilm, null, null); + writer.WriteProperty(options, PropLogstash, value.Logstash, null, null); + writer.WriteProperty(options, PropMl, value.Ml, null, null); + writer.WriteProperty(options, PropMonitoring, value.Monitoring, null, null); + writer.WriteProperty(options, PropRollup, value.Rollup, null, null); + writer.WriteProperty(options, PropRuntimeFields, value.RuntimeFields, null, null); + writer.WriteProperty(options, PropSearchableSnapshots, value.SearchableSnapshots, null, null); + writer.WriteProperty(options, PropSecurity, value.Security, null, null); + writer.WriteProperty(options, PropSlm, value.Slm, null, null); + writer.WriteProperty(options, PropSpatial, value.Spatial, null, null); + writer.WriteProperty(options, PropSql, value.Sql, null, null); + writer.WriteProperty(options, PropTransform, value.Transform, null, null); + writer.WriteProperty(options, PropVectors, value.Vectors, null, null); + writer.WriteProperty(options, PropVotingOnly, value.VotingOnly, null, null); + writer.WriteProperty(options, PropWatcher, value.Watcher, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageResponse.g.cs index 8d340e38601..14f32f5cabd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Xpack/XpackUsageResponse.g.cs @@ -23,289 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class XpackUsageResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAggregateMetric = System.Text.Json.JsonEncodedText.Encode("aggregate_metric"); - private static readonly System.Text.Json.JsonEncodedText PropAnalytics = System.Text.Json.JsonEncodedText.Encode("analytics"); - private static readonly System.Text.Json.JsonEncodedText PropArchive = System.Text.Json.JsonEncodedText.Encode("archive"); - private static readonly System.Text.Json.JsonEncodedText PropCcr = System.Text.Json.JsonEncodedText.Encode("ccr"); - private static readonly System.Text.Json.JsonEncodedText PropDataFrame = System.Text.Json.JsonEncodedText.Encode("data_frame"); - private static readonly System.Text.Json.JsonEncodedText PropDataScience = System.Text.Json.JsonEncodedText.Encode("data_science"); - private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"); - private static readonly System.Text.Json.JsonEncodedText PropDataTiers = System.Text.Json.JsonEncodedText.Encode("data_tiers"); - private static readonly System.Text.Json.JsonEncodedText PropEnrich = System.Text.Json.JsonEncodedText.Encode("enrich"); - private static readonly System.Text.Json.JsonEncodedText PropEql = System.Text.Json.JsonEncodedText.Encode("eql"); - private static readonly System.Text.Json.JsonEncodedText PropFlattened = System.Text.Json.JsonEncodedText.Encode("flattened"); - private static readonly System.Text.Json.JsonEncodedText PropGraph = System.Text.Json.JsonEncodedText.Encode("graph"); - private static readonly System.Text.Json.JsonEncodedText PropHealthApi = System.Text.Json.JsonEncodedText.Encode("health_api"); - private static readonly System.Text.Json.JsonEncodedText PropIlm = System.Text.Json.JsonEncodedText.Encode("ilm"); - private static readonly System.Text.Json.JsonEncodedText PropLogstash = System.Text.Json.JsonEncodedText.Encode("logstash"); - private static readonly System.Text.Json.JsonEncodedText PropMl = System.Text.Json.JsonEncodedText.Encode("ml"); - private static readonly System.Text.Json.JsonEncodedText PropMonitoring = System.Text.Json.JsonEncodedText.Encode("monitoring"); - private static readonly System.Text.Json.JsonEncodedText PropRollup = System.Text.Json.JsonEncodedText.Encode("rollup"); - private static readonly System.Text.Json.JsonEncodedText PropRuntimeFields = System.Text.Json.JsonEncodedText.Encode("runtime_fields"); - private static readonly System.Text.Json.JsonEncodedText PropSearchableSnapshots = System.Text.Json.JsonEncodedText.Encode("searchable_snapshots"); - private static readonly System.Text.Json.JsonEncodedText PropSecurity = System.Text.Json.JsonEncodedText.Encode("security"); - private static readonly System.Text.Json.JsonEncodedText PropSlm = System.Text.Json.JsonEncodedText.Encode("slm"); - private static readonly System.Text.Json.JsonEncodedText PropSpatial = System.Text.Json.JsonEncodedText.Encode("spatial"); - private static readonly System.Text.Json.JsonEncodedText PropSql = System.Text.Json.JsonEncodedText.Encode("sql"); - private static readonly System.Text.Json.JsonEncodedText PropTransform = System.Text.Json.JsonEncodedText.Encode("transform"); - private static readonly System.Text.Json.JsonEncodedText PropVectors = System.Text.Json.JsonEncodedText.Encode("vectors"); - private static readonly System.Text.Json.JsonEncodedText PropVotingOnly = System.Text.Json.JsonEncodedText.Encode("voting_only"); - private static readonly System.Text.Json.JsonEncodedText PropWatcher = System.Text.Json.JsonEncodedText.Encode("watcher"); - - public override Elastic.Clients.Elasticsearch.Xpack.XpackUsageResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAggregateMetric = default; - LocalJsonValue propAnalytics = default; - LocalJsonValue propArchive = default; - LocalJsonValue propCcr = default; - LocalJsonValue propDataFrame = default; - LocalJsonValue propDataScience = default; - LocalJsonValue propDataStreams = default; - LocalJsonValue propDataTiers = default; - LocalJsonValue propEnrich = default; - LocalJsonValue propEql = default; - LocalJsonValue propFlattened = default; - LocalJsonValue propGraph = default; - LocalJsonValue propHealthApi = default; - LocalJsonValue propIlm = default; - LocalJsonValue propLogstash = default; - LocalJsonValue propMl = default; - LocalJsonValue propMonitoring = default; - LocalJsonValue propRollup = default; - LocalJsonValue propRuntimeFields = default; - LocalJsonValue propSearchableSnapshots = default; - LocalJsonValue propSecurity = default; - LocalJsonValue propSlm = default; - LocalJsonValue propSpatial = default; - LocalJsonValue propSql = default; - LocalJsonValue propTransform = default; - LocalJsonValue propVectors = default; - LocalJsonValue propVotingOnly = default; - LocalJsonValue propWatcher = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregateMetric.TryReadProperty(ref reader, options, PropAggregateMetric, null)) - { - continue; - } - - if (propAnalytics.TryReadProperty(ref reader, options, PropAnalytics, null)) - { - continue; - } - - if (propArchive.TryReadProperty(ref reader, options, PropArchive, null)) - { - continue; - } - - if (propCcr.TryReadProperty(ref reader, options, PropCcr, null)) - { - continue; - } - - if (propDataFrame.TryReadProperty(ref reader, options, PropDataFrame, null)) - { - continue; - } - - if (propDataScience.TryReadProperty(ref reader, options, PropDataScience, null)) - { - continue; - } - - if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, null)) - { - continue; - } - - if (propDataTiers.TryReadProperty(ref reader, options, PropDataTiers, null)) - { - continue; - } - - if (propEnrich.TryReadProperty(ref reader, options, PropEnrich, null)) - { - continue; - } - - if (propEql.TryReadProperty(ref reader, options, PropEql, null)) - { - continue; - } - - if (propFlattened.TryReadProperty(ref reader, options, PropFlattened, null)) - { - continue; - } - - if (propGraph.TryReadProperty(ref reader, options, PropGraph, null)) - { - continue; - } - - if (propHealthApi.TryReadProperty(ref reader, options, PropHealthApi, null)) - { - continue; - } - - if (propIlm.TryReadProperty(ref reader, options, PropIlm, null)) - { - continue; - } - - if (propLogstash.TryReadProperty(ref reader, options, PropLogstash, null)) - { - continue; - } - - if (propMl.TryReadProperty(ref reader, options, PropMl, null)) - { - continue; - } - - if (propMonitoring.TryReadProperty(ref reader, options, PropMonitoring, null)) - { - continue; - } - - if (propRollup.TryReadProperty(ref reader, options, PropRollup, null)) - { - continue; - } - - if (propRuntimeFields.TryReadProperty(ref reader, options, PropRuntimeFields, null)) - { - continue; - } - - if (propSearchableSnapshots.TryReadProperty(ref reader, options, PropSearchableSnapshots, null)) - { - continue; - } - - if (propSecurity.TryReadProperty(ref reader, options, PropSecurity, null)) - { - continue; - } - - if (propSlm.TryReadProperty(ref reader, options, PropSlm, null)) - { - continue; - } - - if (propSpatial.TryReadProperty(ref reader, options, PropSpatial, null)) - { - continue; - } - - if (propSql.TryReadProperty(ref reader, options, PropSql, null)) - { - continue; - } - - if (propTransform.TryReadProperty(ref reader, options, PropTransform, null)) - { - continue; - } - - if (propVectors.TryReadProperty(ref reader, options, PropVectors, null)) - { - continue; - } - - if (propVotingOnly.TryReadProperty(ref reader, options, PropVotingOnly, null)) - { - continue; - } - - if (propWatcher.TryReadProperty(ref reader, options, PropWatcher, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.XpackUsageResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AggregateMetric = propAggregateMetric.Value, - Analytics = propAnalytics.Value, - Archive = propArchive.Value, - Ccr = propCcr.Value, - DataFrame = propDataFrame.Value, - DataScience = propDataScience.Value, - DataStreams = propDataStreams.Value, - DataTiers = propDataTiers.Value, - Enrich = propEnrich.Value, - Eql = propEql.Value, - Flattened = propFlattened.Value, - Graph = propGraph.Value, - HealthApi = propHealthApi.Value, - Ilm = propIlm.Value, - Logstash = propLogstash.Value, - Ml = propMl.Value, - Monitoring = propMonitoring.Value, - Rollup = propRollup.Value, - RuntimeFields = propRuntimeFields.Value, - SearchableSnapshots = propSearchableSnapshots.Value, - Security = propSecurity.Value, - Slm = propSlm.Value, - Spatial = propSpatial.Value, - Sql = propSql.Value, - Transform = propTransform.Value, - Vectors = propVectors.Value, - VotingOnly = propVotingOnly.Value, - Watcher = propWatcher.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.XpackUsageResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregateMetric, value.AggregateMetric, null, null); - writer.WriteProperty(options, PropAnalytics, value.Analytics, null, null); - writer.WriteProperty(options, PropArchive, value.Archive, null, null); - writer.WriteProperty(options, PropCcr, value.Ccr, null, null); - writer.WriteProperty(options, PropDataFrame, value.DataFrame, null, null); - writer.WriteProperty(options, PropDataScience, value.DataScience, null, null); - writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, null); - writer.WriteProperty(options, PropDataTiers, value.DataTiers, null, null); - writer.WriteProperty(options, PropEnrich, value.Enrich, null, null); - writer.WriteProperty(options, PropEql, value.Eql, null, null); - writer.WriteProperty(options, PropFlattened, value.Flattened, null, null); - writer.WriteProperty(options, PropGraph, value.Graph, null, null); - writer.WriteProperty(options, PropHealthApi, value.HealthApi, null, null); - writer.WriteProperty(options, PropIlm, value.Ilm, null, null); - writer.WriteProperty(options, PropLogstash, value.Logstash, null, null); - writer.WriteProperty(options, PropMl, value.Ml, null, null); - writer.WriteProperty(options, PropMonitoring, value.Monitoring, null, null); - writer.WriteProperty(options, PropRollup, value.Rollup, null, null); - writer.WriteProperty(options, PropRuntimeFields, value.RuntimeFields, null, null); - writer.WriteProperty(options, PropSearchableSnapshots, value.SearchableSnapshots, null, null); - writer.WriteProperty(options, PropSecurity, value.Security, null, null); - writer.WriteProperty(options, PropSlm, value.Slm, null, null); - writer.WriteProperty(options, PropSpatial, value.Spatial, null, null); - writer.WriteProperty(options, PropSql, value.Sql, null, null); - writer.WriteProperty(options, PropTransform, value.Transform, null, null); - writer.WriteProperty(options, PropVectors, value.Vectors, null, null); - writer.WriteProperty(options, PropVotingOnly, value.VotingOnly, null, null); - writer.WriteProperty(options, PropWatcher, value.Watcher, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.XpackUsageResponseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.XpackUsageResponseConverter))] public sealed partial class XpackUsageResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -321,110 +39,110 @@ internal XpackUsageResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCons public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Xpack.Base AggregateMetric { get; set; } +Elastic.Clients.Elasticsearch.Xpack.Base AggregateMetric { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Xpack.Analytics Analytics { get; set; } +Elastic.Clients.Elasticsearch.Xpack.Analytics Analytics { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Xpack.Archive Archive { get; set; } +Elastic.Clients.Elasticsearch.Xpack.Archive Archive { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Xpack.Ccr Ccr { get; set; } +Elastic.Clients.Elasticsearch.Xpack.Ccr Ccr { get; set; } public Elastic.Clients.Elasticsearch.Xpack.Base? DataFrame { get; set; } public Elastic.Clients.Elasticsearch.Xpack.Base? DataScience { get; set; } public Elastic.Clients.Elasticsearch.Xpack.DataStreams? DataStreams { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Xpack.DataTiers DataTiers { get; set; } +Elastic.Clients.Elasticsearch.Xpack.DataTiers DataTiers { get; set; } public Elastic.Clients.Elasticsearch.Xpack.Base? Enrich { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Xpack.Eql Eql { get; set; } +Elastic.Clients.Elasticsearch.Xpack.Eql Eql { get; set; } public Elastic.Clients.Elasticsearch.Xpack.Flattened? Flattened { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Xpack.Base Graph { get; set; } +Elastic.Clients.Elasticsearch.Xpack.Base Graph { get; set; } public Elastic.Clients.Elasticsearch.Xpack.HealthStatistics? HealthApi { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Xpack.Ilm Ilm { get; set; } +Elastic.Clients.Elasticsearch.Xpack.Ilm Ilm { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Xpack.Base Logstash { get; set; } +Elastic.Clients.Elasticsearch.Xpack.Base Logstash { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Xpack.MachineLearning Ml { get; set; } +Elastic.Clients.Elasticsearch.Xpack.MachineLearning Ml { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Xpack.Monitoring Monitoring { get; set; } +Elastic.Clients.Elasticsearch.Xpack.Monitoring Monitoring { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Xpack.Base Rollup { get; set; } +Elastic.Clients.Elasticsearch.Xpack.Base Rollup { get; set; } public Elastic.Clients.Elasticsearch.Xpack.RuntimeFieldTypes? RuntimeFields { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Xpack.SearchableSnapshots SearchableSnapshots { get; set; } +Elastic.Clients.Elasticsearch.Xpack.SearchableSnapshots SearchableSnapshots { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Xpack.Security Security { get; set; } +Elastic.Clients.Elasticsearch.Xpack.Security Security { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Xpack.Slm Slm { get; set; } +Elastic.Clients.Elasticsearch.Xpack.Slm Slm { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Xpack.Base Spatial { get; set; } +Elastic.Clients.Elasticsearch.Xpack.Base Spatial { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Xpack.Sql Sql { get; set; } +Elastic.Clients.Elasticsearch.Xpack.Sql Sql { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Xpack.Base Transform { get; set; } +Elastic.Clients.Elasticsearch.Xpack.Base Transform { get; set; } public Elastic.Clients.Elasticsearch.Xpack.Vector? Vectors { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Xpack.Base VotingOnly { get; set; } +Elastic.Clients.Elasticsearch.Xpack.Base VotingOnly { get; set; } public #if NET7_0_OR_GREATER - required +required #endif - Elastic.Clients.Elasticsearch.Xpack.Watcher Watcher { get; set; } +Elastic.Clients.Elasticsearch.Xpack.Watcher Watcher { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixAggregate.Converters.g.cs new file mode 100644 index 00000000000..2ee6e1f4b51 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class AdjacencyMatrixAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBuckets = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixAggregate.g.cs index 2ddbb9c2a0a..a7452cc1bcd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixAggregate.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class AdjacencyMatrixAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBuckets = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.AdjacencyMatrixAggregateConverter))] public sealed partial class AdjacencyMatrixAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixAggregation.Converters.g.cs new file mode 100644 index 00000000000..2ac4fc40c50 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixAggregation.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class AdjacencyMatrixAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFilters = System.Text.Json.JsonEncodedText.Encode("filters"); + private static readonly System.Text.Json.JsonEncodedText PropSeparator = System.Text.Json.JsonEncodedText.Encode("separator"); + + public override Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propFilters = default; + LocalJsonValue propSeparator = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFilters.TryReadProperty(ref reader, options, PropFilters, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propSeparator.TryReadProperty(ref reader, options, PropSeparator, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Filters = propFilters.Value, + Separator = propSeparator.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFilters, value.Filters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropSeparator, value.Separator, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixAggregation.g.cs index 30a38c20564..299e5fff347 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixAggregation.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class AdjacencyMatrixAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFilters = System.Text.Json.JsonEncodedText.Encode("filters"); - private static readonly System.Text.Json.JsonEncodedText PropSeparator = System.Text.Json.JsonEncodedText.Encode("separator"); - - public override Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propFilters = default; - LocalJsonValue propSeparator = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFilters.TryReadProperty(ref reader, options, PropFilters, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propSeparator.TryReadProperty(ref reader, options, PropSeparator, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Filters = propFilters.Value, - Separator = propSeparator.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFilters, value.Filters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropSeparator, value.Separator, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.AdjacencyMatrixAggregationConverter))] public sealed partial class AdjacencyMatrixAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixBucket.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixBucket.Converters.g.cs new file mode 100644 index 00000000000..b3e67adae63 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixBucket.Converters.g.cs @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class AdjacencyMatrixBucketConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); + + public override Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue propKey = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propKey.TryReadProperty(ref reader, options, PropKey, null)) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + Key = propKey.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixBucket value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropKey, value.Key, null, null); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixBucket.g.cs index 971fffd56ae..57473cd340c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixBucket.g.cs @@ -23,61 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class AdjacencyMatrixBucketConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); - - public override Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue propKey = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propKey.TryReadProperty(ref reader, options, PropKey, null)) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - Key = propKey.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixBucket value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropKey, value.Key, null, null); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixBucketConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.AdjacencyMatrixBucketConverter))] public sealed partial class AdjacencyMatrixBucket { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregateDictionary.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregateDictionary.Converters.g.cs new file mode 100644 index 00000000000..f993d2a12c8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregateDictionary.Converters.g.cs @@ -0,0 +1,360 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class AggregateDictionaryConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + var dictionary = new System.Collections.Generic.Dictionary(); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + ReadItem(ref reader, options, out string name, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + dictionary[name] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(dictionary); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + foreach (var pair in value) + { + WriteItem(writer, options, pair.Key, pair.Value); + } + + writer.WriteEndObject(); + } + + internal static void ReadItem(ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options, out string name, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value) + { + var key = reader.ReadPropertyName(options, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!); + reader.Read(); + var parts = key.Split('#'); + if (parts.Length != 2) + { + throw new System.Text.Json.JsonException($"Unable to parse typed-key '{key}' for variant '{nameof(Elastic.Clients.Elasticsearch.Aggregations.IAggregate)}'."); + } + + var discriminator = parts[0]; + name = parts[1]; + value = discriminator switch + { + "adjacency_matrix" => reader.ReadValue(options, null), + "auto_date_histogram" => reader.ReadValue(options, null), + "avg" => reader.ReadValue(options, null), + "boxplot" => reader.ReadValue(options, null), + "bucket_metric_value" => reader.ReadValue(options, null), + "cardinality" => reader.ReadValue(options, null), + "children" => reader.ReadValue(options, null), + "composite" => reader.ReadValue(options, null), + "date_histogram" => reader.ReadValue(options, null), + "date_range" => reader.ReadValue(options, null), + "derivative" => reader.ReadValue(options, null), + "dterms" => reader.ReadValue(options, null), + "extended_stats" => reader.ReadValue(options, null), + "extended_stats_bucket" => reader.ReadValue(options, null), + "filter" => reader.ReadValue(options, null), + "filters" => reader.ReadValue(options, null), + "frequent_item_sets" => reader.ReadValue(options, null), + "geo_bounds" => reader.ReadValue(options, null), + "geo_centroid" => reader.ReadValue(options, null), + "geo_distance" => reader.ReadValue(options, null), + "geo_line" => reader.ReadValue(options, null), + "geohash_grid" => reader.ReadValue(options, null), + "geohex_grid" => reader.ReadValue(options, null), + "geotile_grid" => reader.ReadValue(options, null), + "global" => reader.ReadValue(options, null), + "hdr_percentile_ranks" => reader.ReadValue(options, null), + "hdr_percentiles" => reader.ReadValue(options, null), + "histogram" => reader.ReadValue(options, null), + "inference" => reader.ReadValue(options, null), + "ip_prefix" => reader.ReadValue(options, null), + "ip_range" => reader.ReadValue(options, null), + "lrareterms" => reader.ReadValue(options, null), + "lterms" => reader.ReadValue(options, null), + "matrix_stats" => reader.ReadValue(options, null), + "max" => reader.ReadValue(options, null), + "median_absolute_deviation" => reader.ReadValue(options, null), + "min" => reader.ReadValue(options, null), + "missing" => reader.ReadValue(options, null), + "multi_terms" => reader.ReadValue(options, null), + "nested" => reader.ReadValue(options, null), + "parent" => reader.ReadValue(options, null), + "percentiles_bucket" => reader.ReadValue(options, null), + "range" => reader.ReadValue(options, null), + "rate" => reader.ReadValue(options, null), + "reverse_nested" => reader.ReadValue(options, null), + "sampler" => reader.ReadValue(options, null), + "scripted_metric" => reader.ReadValue(options, null), + "siglterms" => reader.ReadValue(options, null), + "sigsterms" => reader.ReadValue(options, null), + "simple_long_value" => reader.ReadValue(options, null), + "simple_value" => reader.ReadValue(options, null), + "srareterms" => reader.ReadValue(options, null), + "stats" => reader.ReadValue(options, null), + "stats_bucket" => reader.ReadValue(options, null), + "sterms" => reader.ReadValue(options, null), + "string_stats" => reader.ReadValue(options, null), + "sum" => reader.ReadValue(options, null), + "t_test" => reader.ReadValue(options, null), + "tdigest_percentile_ranks" => reader.ReadValue(options, null), + "tdigest_percentiles" => reader.ReadValue(options, null), + "time_series" => reader.ReadValue(options, null), + "top_hits" => reader.ReadValue(options, null), + "top_metrics" => reader.ReadValue(options, null), + "umrareterms" => reader.ReadValue(options, null), + "umsigterms" => reader.ReadValue(options, null), + "umterms" => reader.ReadValue(options, null), + "unmapped_sampler" => reader.ReadValue(options, null), + "value_count" => reader.ReadValue(options, null), + "variable_width_histogram" => reader.ReadValue(options, null), + "weighted_avg" => reader.ReadValue(options, null), + _ => throw new System.Text.Json.JsonException($"Variant '{discriminator}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Aggregations.IAggregate)}'.") + }; + } + + internal static void WriteItem(System.Text.Json.Utf8JsonWriter writer, System.Text.Json.JsonSerializerOptions options, string name, Elastic.Clients.Elasticsearch.Aggregations.IAggregate value) + { + var key = value.Type + '#' + name; + switch (value) + { + case Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.AutoDateHistogramAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.AutoDateHistogramAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.AverageAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.AverageAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.BucketMetricValueAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.BucketMetricValueAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.DerivativeAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.DerivativeAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.DoubleTermsAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.DoubleTermsAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsBucketAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsBucketAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.FilterAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.FilterAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.GeoDistanceAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GeoDistanceAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.GeohashGridAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GeohashGridAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.GeohexGridAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GeohexGridAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.GlobalAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GlobalAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.HdrPercentileRanksAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.HdrPercentileRanksAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.HdrPercentilesAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.HdrPercentilesAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.InferenceAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.InferenceAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.IpPrefixAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.IpPrefixAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.LongRareTermsAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.LongRareTermsAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.LongTermsAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.LongTermsAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.MaxAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.MaxAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviationAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviationAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.MinAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.MinAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.MissingAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.MissingAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.MultiTermsAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.MultiTermsAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.NestedAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.NestedAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.ParentAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.ParentAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.RangeAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.RangeAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.RateAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.RateAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.ReverseNestedAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.ReverseNestedAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.SignificantLongTermsAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.SignificantLongTermsAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.SignificantStringTermsAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.SignificantStringTermsAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.SimpleValueAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.SimpleValueAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.StringRareTermsAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.StringRareTermsAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.StatsAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.StatsAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.StatsBucketAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.StatsBucketAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.StringTermsAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.StringTermsAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.SumAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.SumAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.TTestAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TTestAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.TDigestPercentileRanksAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TDigestPercentileRanksAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.TDigestPercentilesAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TDigestPercentilesAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.UnmappedRareTermsAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.UnmappedRareTermsAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.UnmappedSignificantTermsAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.UnmappedSignificantTermsAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.UnmappedTermsAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.UnmappedTermsAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.UnmappedSamplerAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.UnmappedSamplerAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageAggregate v) => w.WritePropertyName(o, v)); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{0}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Aggregations.IAggregate)}'."); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregateDictionary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregateDictionary.g.cs index 66137cc65a7..2f4cb92fa5b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregateDictionary.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregateDictionary.g.cs @@ -23,343 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class AggregateDictionaryConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - var dictionary = new System.Collections.Generic.Dictionary(); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - ReadItem(ref reader, options, out string name, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - dictionary[name] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(dictionary); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - foreach (var pair in value) - { - WriteItem(writer, options, pair.Key, pair.Value); - } - - writer.WriteEndObject(); - } - - internal static void ReadItem(ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options, out string name, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value) - { - var key = reader.ReadPropertyName(options, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!); - reader.Read(); - var parts = key.Split('#'); - if (parts.Length != 2) - { - throw new System.Text.Json.JsonException($"Unable to parse typed-key '{key}' for variant '{nameof(Elastic.Clients.Elasticsearch.Aggregations.IAggregate)}'."); - } - - var discriminator = parts[0]; - name = parts[1]; - value = discriminator switch - { - "adjacency_matrix" => reader.ReadValue(options, null), - "auto_date_histogram" => reader.ReadValue(options, null), - "avg" => reader.ReadValue(options, null), - "boxplot" => reader.ReadValue(options, null), - "bucket_metric_value" => reader.ReadValue(options, null), - "cardinality" => reader.ReadValue(options, null), - "children" => reader.ReadValue(options, null), - "composite" => reader.ReadValue(options, null), - "date_histogram" => reader.ReadValue(options, null), - "date_range" => reader.ReadValue(options, null), - "derivative" => reader.ReadValue(options, null), - "dterms" => reader.ReadValue(options, null), - "extended_stats" => reader.ReadValue(options, null), - "extended_stats_bucket" => reader.ReadValue(options, null), - "filter" => reader.ReadValue(options, null), - "filters" => reader.ReadValue(options, null), - "frequent_item_sets" => reader.ReadValue(options, null), - "geo_bounds" => reader.ReadValue(options, null), - "geo_centroid" => reader.ReadValue(options, null), - "geo_distance" => reader.ReadValue(options, null), - "geo_line" => reader.ReadValue(options, null), - "geohash_grid" => reader.ReadValue(options, null), - "geohex_grid" => reader.ReadValue(options, null), - "geotile_grid" => reader.ReadValue(options, null), - "global" => reader.ReadValue(options, null), - "hdr_percentile_ranks" => reader.ReadValue(options, null), - "hdr_percentiles" => reader.ReadValue(options, null), - "histogram" => reader.ReadValue(options, null), - "inference" => reader.ReadValue(options, null), - "ip_prefix" => reader.ReadValue(options, null), - "ip_range" => reader.ReadValue(options, null), - "lrareterms" => reader.ReadValue(options, null), - "lterms" => reader.ReadValue(options, null), - "matrix_stats" => reader.ReadValue(options, null), - "max" => reader.ReadValue(options, null), - "median_absolute_deviation" => reader.ReadValue(options, null), - "min" => reader.ReadValue(options, null), - "missing" => reader.ReadValue(options, null), - "multi_terms" => reader.ReadValue(options, null), - "nested" => reader.ReadValue(options, null), - "parent" => reader.ReadValue(options, null), - "percentiles_bucket" => reader.ReadValue(options, null), - "range" => reader.ReadValue(options, null), - "rate" => reader.ReadValue(options, null), - "reverse_nested" => reader.ReadValue(options, null), - "sampler" => reader.ReadValue(options, null), - "scripted_metric" => reader.ReadValue(options, null), - "siglterms" => reader.ReadValue(options, null), - "sigsterms" => reader.ReadValue(options, null), - "simple_long_value" => reader.ReadValue(options, null), - "simple_value" => reader.ReadValue(options, null), - "srareterms" => reader.ReadValue(options, null), - "stats" => reader.ReadValue(options, null), - "stats_bucket" => reader.ReadValue(options, null), - "sterms" => reader.ReadValue(options, null), - "string_stats" => reader.ReadValue(options, null), - "sum" => reader.ReadValue(options, null), - "t_test" => reader.ReadValue(options, null), - "tdigest_percentile_ranks" => reader.ReadValue(options, null), - "tdigest_percentiles" => reader.ReadValue(options, null), - "time_series" => reader.ReadValue(options, null), - "top_hits" => reader.ReadValue(options, null), - "top_metrics" => reader.ReadValue(options, null), - "umrareterms" => reader.ReadValue(options, null), - "umsigterms" => reader.ReadValue(options, null), - "umterms" => reader.ReadValue(options, null), - "unmapped_sampler" => reader.ReadValue(options, null), - "value_count" => reader.ReadValue(options, null), - "variable_width_histogram" => reader.ReadValue(options, null), - "weighted_avg" => reader.ReadValue(options, null), - _ => throw new System.Text.Json.JsonException($"Variant '{discriminator}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Aggregations.IAggregate)}'.") - }; - } - - internal static void WriteItem(System.Text.Json.Utf8JsonWriter writer, System.Text.Json.JsonSerializerOptions options, string name, Elastic.Clients.Elasticsearch.Aggregations.IAggregate value) - { - var key = value.Type + '#' + name; - switch (value) - { - case Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.AutoDateHistogramAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.AutoDateHistogramAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.AverageAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.AverageAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.BucketMetricValueAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.BucketMetricValueAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.DerivativeAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.DerivativeAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.DoubleTermsAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.DoubleTermsAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsBucketAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsBucketAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.FilterAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.FilterAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.GeoDistanceAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GeoDistanceAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.GeohashGridAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GeohashGridAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.GeohexGridAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GeohexGridAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.GlobalAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GlobalAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.HdrPercentileRanksAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.HdrPercentileRanksAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.HdrPercentilesAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.HdrPercentilesAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.InferenceAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.InferenceAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.IpPrefixAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.IpPrefixAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.LongRareTermsAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.LongRareTermsAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.LongTermsAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.LongTermsAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.MaxAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.MaxAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviationAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviationAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.MinAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.MinAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.MissingAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.MissingAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.MultiTermsAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.MultiTermsAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.NestedAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.NestedAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.ParentAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.ParentAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.RangeAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.RangeAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.RateAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.RateAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.ReverseNestedAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.ReverseNestedAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.SignificantLongTermsAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.SignificantLongTermsAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.SignificantStringTermsAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.SignificantStringTermsAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.SimpleValueAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.SimpleValueAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.StringRareTermsAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.StringRareTermsAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.StatsAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.StatsAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.StatsBucketAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.StatsBucketAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.StringTermsAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.StringTermsAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.SumAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.SumAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.TTestAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TTestAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.TDigestPercentileRanksAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TDigestPercentileRanksAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.TDigestPercentilesAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TDigestPercentilesAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.UnmappedRareTermsAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.UnmappedRareTermsAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.UnmappedSignificantTermsAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.UnmappedSignificantTermsAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.UnmappedTermsAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.UnmappedTermsAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.UnmappedSamplerAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.UnmappedSamplerAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramAggregate v) => w.WritePropertyName(o, v)); - break; - case Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageAggregate v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageAggregate v) => w.WritePropertyName(o, v)); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{0}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Aggregations.IAggregate)}'."); - } - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter))] public sealed partial class AggregateDictionary : Elastic.Clients.Elasticsearch.IsAReadOnlyDictionary { public AggregateDictionary(System.Collections.Generic.IReadOnlyDictionary backingDictionary) : base(backingDictionary) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Aggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Aggregation.Converters.g.cs new file mode 100644 index 00000000000..6ebfae0b17a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Aggregation.Converters.g.cs @@ -0,0 +1,1009 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class AggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + 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 PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText VariantAdjacencyMatrix = System.Text.Json.JsonEncodedText.Encode("adjacency_matrix"); + private static readonly System.Text.Json.JsonEncodedText VariantAutoDateHistogram = System.Text.Json.JsonEncodedText.Encode("auto_date_histogram"); + private static readonly System.Text.Json.JsonEncodedText VariantAvg = System.Text.Json.JsonEncodedText.Encode("avg"); + private static readonly System.Text.Json.JsonEncodedText VariantAvgBucket = System.Text.Json.JsonEncodedText.Encode("avg_bucket"); + private static readonly System.Text.Json.JsonEncodedText VariantBoxplot = System.Text.Json.JsonEncodedText.Encode("boxplot"); + private static readonly System.Text.Json.JsonEncodedText VariantBucketCorrelation = System.Text.Json.JsonEncodedText.Encode("bucket_correlation"); + private static readonly System.Text.Json.JsonEncodedText VariantBucketCountKsTest = System.Text.Json.JsonEncodedText.Encode("bucket_count_ks_test"); + private static readonly System.Text.Json.JsonEncodedText VariantBucketScript = System.Text.Json.JsonEncodedText.Encode("bucket_script"); + private static readonly System.Text.Json.JsonEncodedText VariantBucketSelector = System.Text.Json.JsonEncodedText.Encode("bucket_selector"); + private static readonly System.Text.Json.JsonEncodedText VariantBucketSort = System.Text.Json.JsonEncodedText.Encode("bucket_sort"); + private static readonly System.Text.Json.JsonEncodedText VariantCardinality = System.Text.Json.JsonEncodedText.Encode("cardinality"); + private static readonly System.Text.Json.JsonEncodedText VariantCategorizeText = System.Text.Json.JsonEncodedText.Encode("categorize_text"); + private static readonly System.Text.Json.JsonEncodedText VariantChildren = System.Text.Json.JsonEncodedText.Encode("children"); + private static readonly System.Text.Json.JsonEncodedText VariantComposite = System.Text.Json.JsonEncodedText.Encode("composite"); + private static readonly System.Text.Json.JsonEncodedText VariantCumulativeCardinality = System.Text.Json.JsonEncodedText.Encode("cumulative_cardinality"); + private static readonly System.Text.Json.JsonEncodedText VariantCumulativeSum = System.Text.Json.JsonEncodedText.Encode("cumulative_sum"); + private static readonly System.Text.Json.JsonEncodedText VariantDateHistogram = System.Text.Json.JsonEncodedText.Encode("date_histogram"); + private static readonly System.Text.Json.JsonEncodedText VariantDateRange = System.Text.Json.JsonEncodedText.Encode("date_range"); + private static readonly System.Text.Json.JsonEncodedText VariantDerivative = System.Text.Json.JsonEncodedText.Encode("derivative"); + private static readonly System.Text.Json.JsonEncodedText VariantDiversifiedSampler = System.Text.Json.JsonEncodedText.Encode("diversified_sampler"); + private static readonly System.Text.Json.JsonEncodedText VariantExtendedStats = System.Text.Json.JsonEncodedText.Encode("extended_stats"); + private static readonly System.Text.Json.JsonEncodedText VariantExtendedStatsBucket = System.Text.Json.JsonEncodedText.Encode("extended_stats_bucket"); + private static readonly System.Text.Json.JsonEncodedText VariantFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText VariantFilters = System.Text.Json.JsonEncodedText.Encode("filters"); + private static readonly System.Text.Json.JsonEncodedText VariantFrequentItemSets = System.Text.Json.JsonEncodedText.Encode("frequent_item_sets"); + private static readonly System.Text.Json.JsonEncodedText VariantGeoBounds = System.Text.Json.JsonEncodedText.Encode("geo_bounds"); + private static readonly System.Text.Json.JsonEncodedText VariantGeoCentroid = System.Text.Json.JsonEncodedText.Encode("geo_centroid"); + private static readonly System.Text.Json.JsonEncodedText VariantGeoDistance = System.Text.Json.JsonEncodedText.Encode("geo_distance"); + private static readonly System.Text.Json.JsonEncodedText VariantGeohashGrid = System.Text.Json.JsonEncodedText.Encode("geohash_grid"); + private static readonly System.Text.Json.JsonEncodedText VariantGeohexGrid = System.Text.Json.JsonEncodedText.Encode("geohex_grid"); + private static readonly System.Text.Json.JsonEncodedText VariantGeoLine = System.Text.Json.JsonEncodedText.Encode("geo_line"); + private static readonly System.Text.Json.JsonEncodedText VariantGeotileGrid = System.Text.Json.JsonEncodedText.Encode("geotile_grid"); + private static readonly System.Text.Json.JsonEncodedText VariantGlobal = System.Text.Json.JsonEncodedText.Encode("global"); + private static readonly System.Text.Json.JsonEncodedText VariantHistogram = System.Text.Json.JsonEncodedText.Encode("histogram"); + private static readonly System.Text.Json.JsonEncodedText VariantInference = System.Text.Json.JsonEncodedText.Encode("inference"); + private static readonly System.Text.Json.JsonEncodedText VariantIpPrefix = System.Text.Json.JsonEncodedText.Encode("ip_prefix"); + private static readonly System.Text.Json.JsonEncodedText VariantIpRange = System.Text.Json.JsonEncodedText.Encode("ip_range"); + private static readonly System.Text.Json.JsonEncodedText VariantLine = System.Text.Json.JsonEncodedText.Encode("line"); + private static readonly System.Text.Json.JsonEncodedText VariantMatrixStats = System.Text.Json.JsonEncodedText.Encode("matrix_stats"); + private static readonly System.Text.Json.JsonEncodedText VariantMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText VariantMaxBucket = System.Text.Json.JsonEncodedText.Encode("max_bucket"); + private static readonly System.Text.Json.JsonEncodedText VariantMedianAbsoluteDeviation = System.Text.Json.JsonEncodedText.Encode("median_absolute_deviation"); + private static readonly System.Text.Json.JsonEncodedText VariantMin = System.Text.Json.JsonEncodedText.Encode("min"); + private static readonly System.Text.Json.JsonEncodedText VariantMinBucket = System.Text.Json.JsonEncodedText.Encode("min_bucket"); + private static readonly System.Text.Json.JsonEncodedText VariantMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText VariantMovingFn = System.Text.Json.JsonEncodedText.Encode("moving_fn"); + private static readonly System.Text.Json.JsonEncodedText VariantMovingPercentiles = System.Text.Json.JsonEncodedText.Encode("moving_percentiles"); + private static readonly System.Text.Json.JsonEncodedText VariantMultiTerms = System.Text.Json.JsonEncodedText.Encode("multi_terms"); + private static readonly System.Text.Json.JsonEncodedText VariantNested = System.Text.Json.JsonEncodedText.Encode("nested"); + private static readonly System.Text.Json.JsonEncodedText VariantNormalize = System.Text.Json.JsonEncodedText.Encode("normalize"); + private static readonly System.Text.Json.JsonEncodedText VariantParent = System.Text.Json.JsonEncodedText.Encode("parent"); + private static readonly System.Text.Json.JsonEncodedText VariantPercentileRanks = System.Text.Json.JsonEncodedText.Encode("percentile_ranks"); + private static readonly System.Text.Json.JsonEncodedText VariantPercentiles = System.Text.Json.JsonEncodedText.Encode("percentiles"); + private static readonly System.Text.Json.JsonEncodedText VariantPercentilesBucket = System.Text.Json.JsonEncodedText.Encode("percentiles_bucket"); + private static readonly System.Text.Json.JsonEncodedText VariantRandomSampler = System.Text.Json.JsonEncodedText.Encode("random_sampler"); + private static readonly System.Text.Json.JsonEncodedText VariantRange = System.Text.Json.JsonEncodedText.Encode("range"); + private static readonly System.Text.Json.JsonEncodedText VariantRareTerms = System.Text.Json.JsonEncodedText.Encode("rare_terms"); + private static readonly System.Text.Json.JsonEncodedText VariantRate = System.Text.Json.JsonEncodedText.Encode("rate"); + private static readonly System.Text.Json.JsonEncodedText VariantReverseNested = System.Text.Json.JsonEncodedText.Encode("reverse_nested"); + private static readonly System.Text.Json.JsonEncodedText VariantSampler = System.Text.Json.JsonEncodedText.Encode("sampler"); + private static readonly System.Text.Json.JsonEncodedText VariantScriptedMetric = System.Text.Json.JsonEncodedText.Encode("scripted_metric"); + private static readonly System.Text.Json.JsonEncodedText VariantSerialDiff = System.Text.Json.JsonEncodedText.Encode("serial_diff"); + private static readonly System.Text.Json.JsonEncodedText VariantSignificantTerms = System.Text.Json.JsonEncodedText.Encode("significant_terms"); + private static readonly System.Text.Json.JsonEncodedText VariantSignificantText = System.Text.Json.JsonEncodedText.Encode("significant_text"); + private static readonly System.Text.Json.JsonEncodedText VariantStats = System.Text.Json.JsonEncodedText.Encode("stats"); + private static readonly System.Text.Json.JsonEncodedText VariantStatsBucket = System.Text.Json.JsonEncodedText.Encode("stats_bucket"); + private static readonly System.Text.Json.JsonEncodedText VariantStringStats = System.Text.Json.JsonEncodedText.Encode("string_stats"); + private static readonly System.Text.Json.JsonEncodedText VariantSum = System.Text.Json.JsonEncodedText.Encode("sum"); + private static readonly System.Text.Json.JsonEncodedText VariantSumBucket = System.Text.Json.JsonEncodedText.Encode("sum_bucket"); + private static readonly System.Text.Json.JsonEncodedText VariantTerms = System.Text.Json.JsonEncodedText.Encode("terms"); + private static readonly System.Text.Json.JsonEncodedText VariantTimeSeries = System.Text.Json.JsonEncodedText.Encode("time_series"); + private static readonly System.Text.Json.JsonEncodedText VariantTopHits = System.Text.Json.JsonEncodedText.Encode("top_hits"); + private static readonly System.Text.Json.JsonEncodedText VariantTopMetrics = System.Text.Json.JsonEncodedText.Encode("top_metrics"); + private static readonly System.Text.Json.JsonEncodedText VariantTTest = System.Text.Json.JsonEncodedText.Encode("t_test"); + private static readonly System.Text.Json.JsonEncodedText VariantValueCount = System.Text.Json.JsonEncodedText.Encode("value_count"); + private static readonly System.Text.Json.JsonEncodedText VariantVariableWidthHistogram = System.Text.Json.JsonEncodedText.Encode("variable_width_histogram"); + private static readonly System.Text.Json.JsonEncodedText VariantWeightedAvg = System.Text.Json.JsonEncodedText.Encode("weighted_avg"); + + public override Elastic.Clients.Elasticsearch.Aggregations.Aggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAggregations = default; + LocalJsonValue?> propMeta = default; + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)) || propAggregations.TryReadProperty(ref reader, options, PropAggregations1, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (reader.ValueTextEquals(VariantAdjacencyMatrix)) + { + variantType = VariantAdjacencyMatrix.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantAutoDateHistogram)) + { + variantType = VariantAutoDateHistogram.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantAvg)) + { + variantType = VariantAvg.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantAvgBucket)) + { + variantType = VariantAvgBucket.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantBoxplot)) + { + variantType = VariantBoxplot.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantBucketCorrelation)) + { + variantType = VariantBucketCorrelation.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantBucketCountKsTest)) + { + variantType = VariantBucketCountKsTest.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantBucketScript)) + { + variantType = VariantBucketScript.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantBucketSelector)) + { + variantType = VariantBucketSelector.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantBucketSort)) + { + variantType = VariantBucketSort.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantCardinality)) + { + variantType = VariantCardinality.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantCategorizeText)) + { + variantType = VariantCategorizeText.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantChildren)) + { + variantType = VariantChildren.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantComposite)) + { + variantType = VariantComposite.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantCumulativeCardinality)) + { + variantType = VariantCumulativeCardinality.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantCumulativeSum)) + { + variantType = VariantCumulativeSum.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantDateHistogram)) + { + variantType = VariantDateHistogram.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantDateRange)) + { + variantType = VariantDateRange.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantDerivative)) + { + variantType = VariantDerivative.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantDiversifiedSampler)) + { + variantType = VariantDiversifiedSampler.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantExtendedStats)) + { + variantType = VariantExtendedStats.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantExtendedStatsBucket)) + { + variantType = VariantExtendedStatsBucket.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantFilter)) + { + variantType = VariantFilter.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantFilters)) + { + variantType = VariantFilters.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantFrequentItemSets)) + { + variantType = VariantFrequentItemSets.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantGeoBounds)) + { + variantType = VariantGeoBounds.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantGeoCentroid)) + { + variantType = VariantGeoCentroid.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantGeoDistance)) + { + variantType = VariantGeoDistance.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantGeohashGrid)) + { + variantType = VariantGeohashGrid.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantGeohexGrid)) + { + variantType = VariantGeohexGrid.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantGeoLine)) + { + variantType = VariantGeoLine.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantGeotileGrid)) + { + variantType = VariantGeotileGrid.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantGlobal)) + { + variantType = VariantGlobal.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantHistogram)) + { + variantType = VariantHistogram.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantInference)) + { + variantType = VariantInference.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantIpPrefix)) + { + variantType = VariantIpPrefix.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantIpRange)) + { + variantType = VariantIpRange.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantLine)) + { + variantType = VariantLine.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMatrixStats)) + { + variantType = VariantMatrixStats.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMax)) + { + variantType = VariantMax.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMaxBucket)) + { + variantType = VariantMaxBucket.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMedianAbsoluteDeviation)) + { + variantType = VariantMedianAbsoluteDeviation.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMin)) + { + variantType = VariantMin.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMinBucket)) + { + variantType = VariantMinBucket.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMissing)) + { + variantType = VariantMissing.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMovingFn)) + { + variantType = VariantMovingFn.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMovingPercentiles)) + { + variantType = VariantMovingPercentiles.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMultiTerms)) + { + variantType = VariantMultiTerms.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantNested)) + { + variantType = VariantNested.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantNormalize)) + { + variantType = VariantNormalize.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantParent)) + { + variantType = VariantParent.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantPercentileRanks)) + { + variantType = VariantPercentileRanks.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantPercentiles)) + { + variantType = VariantPercentiles.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantPercentilesBucket)) + { + variantType = VariantPercentilesBucket.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRandomSampler)) + { + variantType = VariantRandomSampler.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRange)) + { + variantType = VariantRange.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRareTerms)) + { + variantType = VariantRareTerms.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRate)) + { + variantType = VariantRate.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantReverseNested)) + { + variantType = VariantReverseNested.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSampler)) + { + variantType = VariantSampler.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantScriptedMetric)) + { + variantType = VariantScriptedMetric.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSerialDiff)) + { + variantType = VariantSerialDiff.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSignificantTerms)) + { + variantType = VariantSignificantTerms.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSignificantText)) + { + variantType = VariantSignificantText.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantStats)) + { + variantType = VariantStats.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantStatsBucket)) + { + variantType = VariantStatsBucket.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantStringStats)) + { + variantType = VariantStringStats.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSum)) + { + variantType = VariantSum.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSumBucket)) + { + variantType = VariantSumBucket.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTerms)) + { + variantType = VariantTerms.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTimeSeries)) + { + variantType = VariantTimeSeries.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTopHits)) + { + variantType = VariantTopHits.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTopMetrics)) + { + variantType = VariantTopMetrics.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTTest)) + { + variantType = VariantTTest.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantValueCount)) + { + variantType = VariantValueCount.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantVariableWidthHistogram)) + { + variantType = VariantVariableWidthHistogram.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantWeightedAvg)) + { + variantType = VariantWeightedAvg.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.Aggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant, + Aggregations = propAggregations.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.Aggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "adjacency_matrix": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregation)value.Variant, null, null); + break; + case "auto_date_histogram": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.AutoDateHistogramAggregation)value.Variant, null, null); + break; + case "avg": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.AverageAggregation)value.Variant, null, null); + break; + case "avg_bucket": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.AverageBucketAggregation)value.Variant, null, null); + break; + case "boxplot": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregation)value.Variant, null, null); + break; + case "bucket_correlation": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationAggregation)value.Variant, null, null); + break; + case "bucket_count_ks_test": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.BucketKsAggregation)value.Variant, null, null); + break; + case "bucket_script": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.BucketScriptAggregation)value.Variant, null, null); + break; + case "bucket_selector": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.BucketSelectorAggregation)value.Variant, null, null); + break; + case "bucket_sort": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.BucketSortAggregation)value.Variant, null, null); + break; + case "cardinality": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregation)value.Variant, null, null); + break; + case "categorize_text": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAggregation)value.Variant, null, null); + break; + case "children": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregation)value.Variant, null, null); + break; + case "composite": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregation)value.Variant, null, null); + break; + case "cumulative_cardinality": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregation)value.Variant, null, null); + break; + case "cumulative_sum": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.CumulativeSumAggregation)value.Variant, null, null); + break; + case "date_histogram": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregation)value.Variant, null, null); + break; + case "date_range": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregation)value.Variant, null, null); + break; + case "derivative": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.DerivativeAggregation)value.Variant, null, null); + break; + case "diversified_sampler": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.DiversifiedSamplerAggregation)value.Variant, null, null); + break; + case "extended_stats": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregation)value.Variant, null, null); + break; + case "extended_stats_bucket": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsBucketAggregation)value.Variant, null, null); + break; + case "filter": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.Query)value.Variant, null, null); + break; + case "filters": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregation)value.Variant, null, null); + break; + case "frequent_item_sets": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregation)value.Variant, null, null); + break; + case "geo_bounds": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregation)value.Variant, null, null); + break; + case "geo_centroid": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregation)value.Variant, null, null); + break; + case "geo_distance": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.GeoDistanceAggregation)value.Variant, null, null); + break; + case "geohash_grid": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.GeohashGridAggregation)value.Variant, null, null); + break; + case "geohex_grid": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.GeohexGridAggregation)value.Variant, null, null); + break; + case "geo_line": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregation)value.Variant, null, null); + break; + case "geotile_grid": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregation)value.Variant, null, null); + break; + case "global": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.GlobalAggregation)value.Variant, null, null); + break; + case "histogram": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregation)value.Variant, null, null); + break; + case "inference": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.InferenceAggregation)value.Variant, null, null); + break; + case "ip_prefix": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.IpPrefixAggregation)value.Variant, null, null); + break; + case "ip_range": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregation)value.Variant, null, null); + break; + case "line": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregation)value.Variant, null, null); + break; + case "matrix_stats": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsAggregation)value.Variant, null, null); + break; + case "max": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.MaxAggregation)value.Variant, null, null); + break; + case "max_bucket": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.MaxBucketAggregation)value.Variant, null, null); + break; + case "median_absolute_deviation": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviationAggregation)value.Variant, null, null); + break; + case "min": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.MinAggregation)value.Variant, null, null); + break; + case "min_bucket": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.MinBucketAggregation)value.Variant, null, null); + break; + case "missing": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.MissingAggregation)value.Variant, null, null); + break; + case "moving_fn": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.MovingFunctionAggregation)value.Variant, null, null); + break; + case "moving_percentiles": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.MovingPercentilesAggregation)value.Variant, null, null); + break; + case "multi_terms": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.MultiTermsAggregation)value.Variant, null, null); + break; + case "nested": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.NestedAggregation)value.Variant, null, null); + break; + case "normalize": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.NormalizeAggregation)value.Variant, null, null); + break; + case "parent": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.ParentAggregation)value.Variant, null, null); + break; + case "percentile_ranks": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.PercentileRanksAggregation)value.Variant, null, null); + break; + case "percentiles": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.PercentilesAggregation)value.Variant, null, null); + break; + case "percentiles_bucket": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregation)value.Variant, null, null); + break; + case "random_sampler": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.RandomSamplerAggregation)value.Variant, null, null); + break; + case "range": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.RangeAggregation)value.Variant, null, null); + break; + case "rare_terms": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.RareTermsAggregation)value.Variant, null, null); + break; + case "rate": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.RateAggregation)value.Variant, null, null); + break; + case "reverse_nested": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.ReverseNestedAggregation)value.Variant, null, null); + break; + case "sampler": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregation)value.Variant, null, null); + break; + case "scripted_metric": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggregation)value.Variant, null, null); + break; + case "serial_diff": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.SerialDifferencingAggregation)value.Variant, null, null); + break; + case "significant_terms": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.SignificantTermsAggregation)value.Variant, null, null); + break; + case "significant_text": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.SignificantTextAggregation)value.Variant, null, null); + break; + case "stats": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.StatsAggregation)value.Variant, null, null); + break; + case "stats_bucket": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.StatsBucketAggregation)value.Variant, null, null); + break; + case "string_stats": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregation)value.Variant, null, null); + break; + case "sum": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.SumAggregation)value.Variant, null, null); + break; + case "sum_bucket": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.SumBucketAggregation)value.Variant, null, null); + break; + case "terms": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.TermsAggregation)value.Variant, null, null); + break; + case "time_series": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesAggregation)value.Variant, null, null); + break; + case "top_hits": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregation)value.Variant, null, null); + break; + case "top_metrics": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregation)value.Variant, null, null); + break; + case "t_test": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.TTestAggregation)value.Variant, null, null); + break; + case "value_count": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregation)value.Variant, null, null); + break; + case "variable_width_histogram": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramAggregation)value.Variant, null, null); + break; + case "weighted_avg": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageAggregation)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Aggregations.Aggregation)}'."); + } + + writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Aggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Aggregation.g.cs index 6e72127b65e..97fc65d1d6b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Aggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Aggregation.g.cs @@ -23,992 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class AggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - 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 PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText VariantAdjacencyMatrix = System.Text.Json.JsonEncodedText.Encode("adjacency_matrix"); - private static readonly System.Text.Json.JsonEncodedText VariantAutoDateHistogram = System.Text.Json.JsonEncodedText.Encode("auto_date_histogram"); - private static readonly System.Text.Json.JsonEncodedText VariantAvg = System.Text.Json.JsonEncodedText.Encode("avg"); - private static readonly System.Text.Json.JsonEncodedText VariantAvgBucket = System.Text.Json.JsonEncodedText.Encode("avg_bucket"); - private static readonly System.Text.Json.JsonEncodedText VariantBoxplot = System.Text.Json.JsonEncodedText.Encode("boxplot"); - private static readonly System.Text.Json.JsonEncodedText VariantBucketCorrelation = System.Text.Json.JsonEncodedText.Encode("bucket_correlation"); - private static readonly System.Text.Json.JsonEncodedText VariantBucketCountKsTest = System.Text.Json.JsonEncodedText.Encode("bucket_count_ks_test"); - private static readonly System.Text.Json.JsonEncodedText VariantBucketScript = System.Text.Json.JsonEncodedText.Encode("bucket_script"); - private static readonly System.Text.Json.JsonEncodedText VariantBucketSelector = System.Text.Json.JsonEncodedText.Encode("bucket_selector"); - private static readonly System.Text.Json.JsonEncodedText VariantBucketSort = System.Text.Json.JsonEncodedText.Encode("bucket_sort"); - private static readonly System.Text.Json.JsonEncodedText VariantCardinality = System.Text.Json.JsonEncodedText.Encode("cardinality"); - private static readonly System.Text.Json.JsonEncodedText VariantCategorizeText = System.Text.Json.JsonEncodedText.Encode("categorize_text"); - private static readonly System.Text.Json.JsonEncodedText VariantChildren = System.Text.Json.JsonEncodedText.Encode("children"); - private static readonly System.Text.Json.JsonEncodedText VariantComposite = System.Text.Json.JsonEncodedText.Encode("composite"); - private static readonly System.Text.Json.JsonEncodedText VariantCumulativeCardinality = System.Text.Json.JsonEncodedText.Encode("cumulative_cardinality"); - private static readonly System.Text.Json.JsonEncodedText VariantCumulativeSum = System.Text.Json.JsonEncodedText.Encode("cumulative_sum"); - private static readonly System.Text.Json.JsonEncodedText VariantDateHistogram = System.Text.Json.JsonEncodedText.Encode("date_histogram"); - private static readonly System.Text.Json.JsonEncodedText VariantDateRange = System.Text.Json.JsonEncodedText.Encode("date_range"); - private static readonly System.Text.Json.JsonEncodedText VariantDerivative = System.Text.Json.JsonEncodedText.Encode("derivative"); - private static readonly System.Text.Json.JsonEncodedText VariantDiversifiedSampler = System.Text.Json.JsonEncodedText.Encode("diversified_sampler"); - private static readonly System.Text.Json.JsonEncodedText VariantExtendedStats = System.Text.Json.JsonEncodedText.Encode("extended_stats"); - private static readonly System.Text.Json.JsonEncodedText VariantExtendedStatsBucket = System.Text.Json.JsonEncodedText.Encode("extended_stats_bucket"); - private static readonly System.Text.Json.JsonEncodedText VariantFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText VariantFilters = System.Text.Json.JsonEncodedText.Encode("filters"); - private static readonly System.Text.Json.JsonEncodedText VariantFrequentItemSets = System.Text.Json.JsonEncodedText.Encode("frequent_item_sets"); - private static readonly System.Text.Json.JsonEncodedText VariantGeoBounds = System.Text.Json.JsonEncodedText.Encode("geo_bounds"); - private static readonly System.Text.Json.JsonEncodedText VariantGeoCentroid = System.Text.Json.JsonEncodedText.Encode("geo_centroid"); - private static readonly System.Text.Json.JsonEncodedText VariantGeoDistance = System.Text.Json.JsonEncodedText.Encode("geo_distance"); - private static readonly System.Text.Json.JsonEncodedText VariantGeohashGrid = System.Text.Json.JsonEncodedText.Encode("geohash_grid"); - private static readonly System.Text.Json.JsonEncodedText VariantGeohexGrid = System.Text.Json.JsonEncodedText.Encode("geohex_grid"); - private static readonly System.Text.Json.JsonEncodedText VariantGeoLine = System.Text.Json.JsonEncodedText.Encode("geo_line"); - private static readonly System.Text.Json.JsonEncodedText VariantGeotileGrid = System.Text.Json.JsonEncodedText.Encode("geotile_grid"); - private static readonly System.Text.Json.JsonEncodedText VariantGlobal = System.Text.Json.JsonEncodedText.Encode("global"); - private static readonly System.Text.Json.JsonEncodedText VariantHistogram = System.Text.Json.JsonEncodedText.Encode("histogram"); - private static readonly System.Text.Json.JsonEncodedText VariantInference = System.Text.Json.JsonEncodedText.Encode("inference"); - private static readonly System.Text.Json.JsonEncodedText VariantIpPrefix = System.Text.Json.JsonEncodedText.Encode("ip_prefix"); - private static readonly System.Text.Json.JsonEncodedText VariantIpRange = System.Text.Json.JsonEncodedText.Encode("ip_range"); - private static readonly System.Text.Json.JsonEncodedText VariantLine = System.Text.Json.JsonEncodedText.Encode("line"); - private static readonly System.Text.Json.JsonEncodedText VariantMatrixStats = System.Text.Json.JsonEncodedText.Encode("matrix_stats"); - private static readonly System.Text.Json.JsonEncodedText VariantMax = System.Text.Json.JsonEncodedText.Encode("max"); - private static readonly System.Text.Json.JsonEncodedText VariantMaxBucket = System.Text.Json.JsonEncodedText.Encode("max_bucket"); - private static readonly System.Text.Json.JsonEncodedText VariantMedianAbsoluteDeviation = System.Text.Json.JsonEncodedText.Encode("median_absolute_deviation"); - private static readonly System.Text.Json.JsonEncodedText VariantMin = System.Text.Json.JsonEncodedText.Encode("min"); - private static readonly System.Text.Json.JsonEncodedText VariantMinBucket = System.Text.Json.JsonEncodedText.Encode("min_bucket"); - private static readonly System.Text.Json.JsonEncodedText VariantMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText VariantMovingFn = System.Text.Json.JsonEncodedText.Encode("moving_fn"); - private static readonly System.Text.Json.JsonEncodedText VariantMovingPercentiles = System.Text.Json.JsonEncodedText.Encode("moving_percentiles"); - private static readonly System.Text.Json.JsonEncodedText VariantMultiTerms = System.Text.Json.JsonEncodedText.Encode("multi_terms"); - private static readonly System.Text.Json.JsonEncodedText VariantNested = System.Text.Json.JsonEncodedText.Encode("nested"); - private static readonly System.Text.Json.JsonEncodedText VariantNormalize = System.Text.Json.JsonEncodedText.Encode("normalize"); - private static readonly System.Text.Json.JsonEncodedText VariantParent = System.Text.Json.JsonEncodedText.Encode("parent"); - private static readonly System.Text.Json.JsonEncodedText VariantPercentileRanks = System.Text.Json.JsonEncodedText.Encode("percentile_ranks"); - private static readonly System.Text.Json.JsonEncodedText VariantPercentiles = System.Text.Json.JsonEncodedText.Encode("percentiles"); - private static readonly System.Text.Json.JsonEncodedText VariantPercentilesBucket = System.Text.Json.JsonEncodedText.Encode("percentiles_bucket"); - private static readonly System.Text.Json.JsonEncodedText VariantRandomSampler = System.Text.Json.JsonEncodedText.Encode("random_sampler"); - private static readonly System.Text.Json.JsonEncodedText VariantRange = System.Text.Json.JsonEncodedText.Encode("range"); - private static readonly System.Text.Json.JsonEncodedText VariantRareTerms = System.Text.Json.JsonEncodedText.Encode("rare_terms"); - private static readonly System.Text.Json.JsonEncodedText VariantRate = System.Text.Json.JsonEncodedText.Encode("rate"); - private static readonly System.Text.Json.JsonEncodedText VariantReverseNested = System.Text.Json.JsonEncodedText.Encode("reverse_nested"); - private static readonly System.Text.Json.JsonEncodedText VariantSampler = System.Text.Json.JsonEncodedText.Encode("sampler"); - private static readonly System.Text.Json.JsonEncodedText VariantScriptedMetric = System.Text.Json.JsonEncodedText.Encode("scripted_metric"); - private static readonly System.Text.Json.JsonEncodedText VariantSerialDiff = System.Text.Json.JsonEncodedText.Encode("serial_diff"); - private static readonly System.Text.Json.JsonEncodedText VariantSignificantTerms = System.Text.Json.JsonEncodedText.Encode("significant_terms"); - private static readonly System.Text.Json.JsonEncodedText VariantSignificantText = System.Text.Json.JsonEncodedText.Encode("significant_text"); - private static readonly System.Text.Json.JsonEncodedText VariantStats = System.Text.Json.JsonEncodedText.Encode("stats"); - private static readonly System.Text.Json.JsonEncodedText VariantStatsBucket = System.Text.Json.JsonEncodedText.Encode("stats_bucket"); - private static readonly System.Text.Json.JsonEncodedText VariantStringStats = System.Text.Json.JsonEncodedText.Encode("string_stats"); - private static readonly System.Text.Json.JsonEncodedText VariantSum = System.Text.Json.JsonEncodedText.Encode("sum"); - private static readonly System.Text.Json.JsonEncodedText VariantSumBucket = System.Text.Json.JsonEncodedText.Encode("sum_bucket"); - private static readonly System.Text.Json.JsonEncodedText VariantTerms = System.Text.Json.JsonEncodedText.Encode("terms"); - private static readonly System.Text.Json.JsonEncodedText VariantTimeSeries = System.Text.Json.JsonEncodedText.Encode("time_series"); - private static readonly System.Text.Json.JsonEncodedText VariantTopHits = System.Text.Json.JsonEncodedText.Encode("top_hits"); - private static readonly System.Text.Json.JsonEncodedText VariantTopMetrics = System.Text.Json.JsonEncodedText.Encode("top_metrics"); - private static readonly System.Text.Json.JsonEncodedText VariantTTest = System.Text.Json.JsonEncodedText.Encode("t_test"); - private static readonly System.Text.Json.JsonEncodedText VariantValueCount = System.Text.Json.JsonEncodedText.Encode("value_count"); - private static readonly System.Text.Json.JsonEncodedText VariantVariableWidthHistogram = System.Text.Json.JsonEncodedText.Encode("variable_width_histogram"); - private static readonly System.Text.Json.JsonEncodedText VariantWeightedAvg = System.Text.Json.JsonEncodedText.Encode("weighted_avg"); - - public override Elastic.Clients.Elasticsearch.Aggregations.Aggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAggregations = default; - LocalJsonValue?> propMeta = default; - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)) || propAggregations.TryReadProperty(ref reader, options, PropAggregations1, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (reader.ValueTextEquals(VariantAdjacencyMatrix)) - { - variantType = VariantAdjacencyMatrix.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantAutoDateHistogram)) - { - variantType = VariantAutoDateHistogram.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantAvg)) - { - variantType = VariantAvg.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantAvgBucket)) - { - variantType = VariantAvgBucket.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantBoxplot)) - { - variantType = VariantBoxplot.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantBucketCorrelation)) - { - variantType = VariantBucketCorrelation.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantBucketCountKsTest)) - { - variantType = VariantBucketCountKsTest.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantBucketScript)) - { - variantType = VariantBucketScript.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantBucketSelector)) - { - variantType = VariantBucketSelector.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantBucketSort)) - { - variantType = VariantBucketSort.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantCardinality)) - { - variantType = VariantCardinality.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantCategorizeText)) - { - variantType = VariantCategorizeText.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantChildren)) - { - variantType = VariantChildren.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantComposite)) - { - variantType = VariantComposite.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantCumulativeCardinality)) - { - variantType = VariantCumulativeCardinality.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantCumulativeSum)) - { - variantType = VariantCumulativeSum.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantDateHistogram)) - { - variantType = VariantDateHistogram.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantDateRange)) - { - variantType = VariantDateRange.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantDerivative)) - { - variantType = VariantDerivative.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantDiversifiedSampler)) - { - variantType = VariantDiversifiedSampler.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantExtendedStats)) - { - variantType = VariantExtendedStats.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantExtendedStatsBucket)) - { - variantType = VariantExtendedStatsBucket.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantFilter)) - { - variantType = VariantFilter.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantFilters)) - { - variantType = VariantFilters.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantFrequentItemSets)) - { - variantType = VariantFrequentItemSets.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantGeoBounds)) - { - variantType = VariantGeoBounds.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantGeoCentroid)) - { - variantType = VariantGeoCentroid.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantGeoDistance)) - { - variantType = VariantGeoDistance.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantGeohashGrid)) - { - variantType = VariantGeohashGrid.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantGeohexGrid)) - { - variantType = VariantGeohexGrid.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantGeoLine)) - { - variantType = VariantGeoLine.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantGeotileGrid)) - { - variantType = VariantGeotileGrid.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantGlobal)) - { - variantType = VariantGlobal.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantHistogram)) - { - variantType = VariantHistogram.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantInference)) - { - variantType = VariantInference.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantIpPrefix)) - { - variantType = VariantIpPrefix.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantIpRange)) - { - variantType = VariantIpRange.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantLine)) - { - variantType = VariantLine.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMatrixStats)) - { - variantType = VariantMatrixStats.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMax)) - { - variantType = VariantMax.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMaxBucket)) - { - variantType = VariantMaxBucket.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMedianAbsoluteDeviation)) - { - variantType = VariantMedianAbsoluteDeviation.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMin)) - { - variantType = VariantMin.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMinBucket)) - { - variantType = VariantMinBucket.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMissing)) - { - variantType = VariantMissing.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMovingFn)) - { - variantType = VariantMovingFn.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMovingPercentiles)) - { - variantType = VariantMovingPercentiles.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMultiTerms)) - { - variantType = VariantMultiTerms.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantNested)) - { - variantType = VariantNested.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantNormalize)) - { - variantType = VariantNormalize.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantParent)) - { - variantType = VariantParent.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantPercentileRanks)) - { - variantType = VariantPercentileRanks.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantPercentiles)) - { - variantType = VariantPercentiles.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantPercentilesBucket)) - { - variantType = VariantPercentilesBucket.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRandomSampler)) - { - variantType = VariantRandomSampler.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRange)) - { - variantType = VariantRange.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRareTerms)) - { - variantType = VariantRareTerms.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRate)) - { - variantType = VariantRate.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantReverseNested)) - { - variantType = VariantReverseNested.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSampler)) - { - variantType = VariantSampler.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantScriptedMetric)) - { - variantType = VariantScriptedMetric.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSerialDiff)) - { - variantType = VariantSerialDiff.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSignificantTerms)) - { - variantType = VariantSignificantTerms.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSignificantText)) - { - variantType = VariantSignificantText.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantStats)) - { - variantType = VariantStats.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantStatsBucket)) - { - variantType = VariantStatsBucket.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantStringStats)) - { - variantType = VariantStringStats.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSum)) - { - variantType = VariantSum.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSumBucket)) - { - variantType = VariantSumBucket.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTerms)) - { - variantType = VariantTerms.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTimeSeries)) - { - variantType = VariantTimeSeries.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTopHits)) - { - variantType = VariantTopHits.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTopMetrics)) - { - variantType = VariantTopMetrics.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTTest)) - { - variantType = VariantTTest.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantValueCount)) - { - variantType = VariantValueCount.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantVariableWidthHistogram)) - { - variantType = VariantVariableWidthHistogram.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantWeightedAvg)) - { - variantType = VariantWeightedAvg.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.Aggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant, - Aggregations = propAggregations.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.Aggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "adjacency_matrix": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.AdjacencyMatrixAggregation)value.Variant, null, null); - break; - case "auto_date_histogram": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.AutoDateHistogramAggregation)value.Variant, null, null); - break; - case "avg": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.AverageAggregation)value.Variant, null, null); - break; - case "avg_bucket": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.AverageBucketAggregation)value.Variant, null, null); - break; - case "boxplot": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregation)value.Variant, null, null); - break; - case "bucket_correlation": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationAggregation)value.Variant, null, null); - break; - case "bucket_count_ks_test": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.BucketKsAggregation)value.Variant, null, null); - break; - case "bucket_script": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.BucketScriptAggregation)value.Variant, null, null); - break; - case "bucket_selector": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.BucketSelectorAggregation)value.Variant, null, null); - break; - case "bucket_sort": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.BucketSortAggregation)value.Variant, null, null); - break; - case "cardinality": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregation)value.Variant, null, null); - break; - case "categorize_text": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAggregation)value.Variant, null, null); - break; - case "children": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregation)value.Variant, null, null); - break; - case "composite": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregation)value.Variant, null, null); - break; - case "cumulative_cardinality": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregation)value.Variant, null, null); - break; - case "cumulative_sum": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.CumulativeSumAggregation)value.Variant, null, null); - break; - case "date_histogram": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregation)value.Variant, null, null); - break; - case "date_range": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregation)value.Variant, null, null); - break; - case "derivative": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.DerivativeAggregation)value.Variant, null, null); - break; - case "diversified_sampler": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.DiversifiedSamplerAggregation)value.Variant, null, null); - break; - case "extended_stats": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregation)value.Variant, null, null); - break; - case "extended_stats_bucket": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsBucketAggregation)value.Variant, null, null); - break; - case "filter": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.Query)value.Variant, null, null); - break; - case "filters": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregation)value.Variant, null, null); - break; - case "frequent_item_sets": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregation)value.Variant, null, null); - break; - case "geo_bounds": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregation)value.Variant, null, null); - break; - case "geo_centroid": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregation)value.Variant, null, null); - break; - case "geo_distance": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.GeoDistanceAggregation)value.Variant, null, null); - break; - case "geohash_grid": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.GeohashGridAggregation)value.Variant, null, null); - break; - case "geohex_grid": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.GeohexGridAggregation)value.Variant, null, null); - break; - case "geo_line": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregation)value.Variant, null, null); - break; - case "geotile_grid": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregation)value.Variant, null, null); - break; - case "global": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.GlobalAggregation)value.Variant, null, null); - break; - case "histogram": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregation)value.Variant, null, null); - break; - case "inference": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.InferenceAggregation)value.Variant, null, null); - break; - case "ip_prefix": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.IpPrefixAggregation)value.Variant, null, null); - break; - case "ip_range": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregation)value.Variant, null, null); - break; - case "line": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregation)value.Variant, null, null); - break; - case "matrix_stats": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsAggregation)value.Variant, null, null); - break; - case "max": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.MaxAggregation)value.Variant, null, null); - break; - case "max_bucket": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.MaxBucketAggregation)value.Variant, null, null); - break; - case "median_absolute_deviation": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviationAggregation)value.Variant, null, null); - break; - case "min": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.MinAggregation)value.Variant, null, null); - break; - case "min_bucket": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.MinBucketAggregation)value.Variant, null, null); - break; - case "missing": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.MissingAggregation)value.Variant, null, null); - break; - case "moving_fn": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.MovingFunctionAggregation)value.Variant, null, null); - break; - case "moving_percentiles": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.MovingPercentilesAggregation)value.Variant, null, null); - break; - case "multi_terms": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.MultiTermsAggregation)value.Variant, null, null); - break; - case "nested": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.NestedAggregation)value.Variant, null, null); - break; - case "normalize": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.NormalizeAggregation)value.Variant, null, null); - break; - case "parent": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.ParentAggregation)value.Variant, null, null); - break; - case "percentile_ranks": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.PercentileRanksAggregation)value.Variant, null, null); - break; - case "percentiles": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.PercentilesAggregation)value.Variant, null, null); - break; - case "percentiles_bucket": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregation)value.Variant, null, null); - break; - case "random_sampler": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.RandomSamplerAggregation)value.Variant, null, null); - break; - case "range": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.RangeAggregation)value.Variant, null, null); - break; - case "rare_terms": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.RareTermsAggregation)value.Variant, null, null); - break; - case "rate": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.RateAggregation)value.Variant, null, null); - break; - case "reverse_nested": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.ReverseNestedAggregation)value.Variant, null, null); - break; - case "sampler": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregation)value.Variant, null, null); - break; - case "scripted_metric": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggregation)value.Variant, null, null); - break; - case "serial_diff": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.SerialDifferencingAggregation)value.Variant, null, null); - break; - case "significant_terms": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.SignificantTermsAggregation)value.Variant, null, null); - break; - case "significant_text": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.SignificantTextAggregation)value.Variant, null, null); - break; - case "stats": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.StatsAggregation)value.Variant, null, null); - break; - case "stats_bucket": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.StatsBucketAggregation)value.Variant, null, null); - break; - case "string_stats": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregation)value.Variant, null, null); - break; - case "sum": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.SumAggregation)value.Variant, null, null); - break; - case "sum_bucket": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.SumBucketAggregation)value.Variant, null, null); - break; - case "terms": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.TermsAggregation)value.Variant, null, null); - break; - case "time_series": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesAggregation)value.Variant, null, null); - break; - case "top_hits": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregation)value.Variant, null, null); - break; - case "top_metrics": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregation)value.Variant, null, null); - break; - case "t_test": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.TTestAggregation)value.Variant, null, null); - break; - case "value_count": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregation)value.Variant, null, null); - break; - case "variable_width_histogram": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramAggregation)value.Variant, null, null); - break; - case "weighted_avg": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageAggregation)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Aggregations.Aggregation)}'."); - } - - writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.AggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.AggregationConverter))] public sealed partial class Aggregation { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregationRange.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregationRange.Converters.g.cs new file mode 100644 index 00000000000..74da08857d1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregationRange.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class AggregationRangeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFrom = System.Text.Json.JsonEncodedText.Encode("from"); + private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); + private static readonly System.Text.Json.JsonEncodedText PropTo = System.Text.Json.JsonEncodedText.Encode("to"); + + public override Elastic.Clients.Elasticsearch.Aggregations.AggregationRange Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFrom = default; + LocalJsonValue propKey = default; + LocalJsonValue propTo = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFrom.TryReadProperty(ref reader, options, PropFrom, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propKey.TryReadProperty(ref reader, options, PropKey, null)) + { + continue; + } + + if (propTo.TryReadProperty(ref reader, options, PropTo, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.AggregationRange(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + From = propFrom.Value, + Key = propKey.Value, + To = propTo.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.AggregationRange value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFrom, value.From, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropKey, value.Key, null, null); + writer.WriteProperty(options, PropTo, value.To, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregationRange.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregationRange.g.cs index f0632e93961..ce28ae8c1dc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregationRange.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregationRange.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class AggregationRangeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFrom = System.Text.Json.JsonEncodedText.Encode("from"); - private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); - private static readonly System.Text.Json.JsonEncodedText PropTo = System.Text.Json.JsonEncodedText.Encode("to"); - - public override Elastic.Clients.Elasticsearch.Aggregations.AggregationRange Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFrom = default; - LocalJsonValue propKey = default; - LocalJsonValue propTo = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFrom.TryReadProperty(ref reader, options, PropFrom, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propKey.TryReadProperty(ref reader, options, PropKey, null)) - { - continue; - } - - if (propTo.TryReadProperty(ref reader, options, PropTo, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.AggregationRange(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - From = propFrom.Value, - Key = propKey.Value, - To = propTo.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.AggregationRange value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFrom, value.From, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropKey, value.Key, null, null); - writer.WriteProperty(options, PropTo, value.To, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.AggregationRangeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.AggregationRangeConverter))] public sealed partial class AggregationRange { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AutoDateHistogramAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AutoDateHistogramAggregate.Converters.g.cs new file mode 100644 index 00000000000..34b292caac8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AutoDateHistogramAggregate.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class AutoDateHistogramAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropInterval = System.Text.Json.JsonEncodedText.Encode("interval"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.AutoDateHistogramAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBuckets = default; + LocalJsonValue propInterval = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propInterval.TryReadProperty(ref reader, options, PropInterval, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.AutoDateHistogramAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + Interval = propInterval.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.AutoDateHistogramAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropInterval, value.Interval, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AutoDateHistogramAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AutoDateHistogramAggregate.g.cs index 734e58919ce..849f4639fbe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AutoDateHistogramAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AutoDateHistogramAggregate.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class AutoDateHistogramAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropInterval = System.Text.Json.JsonEncodedText.Encode("interval"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.AutoDateHistogramAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBuckets = default; - LocalJsonValue propInterval = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propInterval.TryReadProperty(ref reader, options, PropInterval, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.AutoDateHistogramAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - Interval = propInterval.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.AutoDateHistogramAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropInterval, value.Interval, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.AutoDateHistogramAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.AutoDateHistogramAggregateConverter))] public sealed partial class AutoDateHistogramAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AutoDateHistogramAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AutoDateHistogramAggregation.Converters.g.cs new file mode 100644 index 00000000000..5cac7dc9eee --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AutoDateHistogramAggregation.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class AutoDateHistogramAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropMinimumInterval = System.Text.Json.JsonEncodedText.Encode("minimum_interval"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropOffset = System.Text.Json.JsonEncodedText.Encode("offset"); + private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"); + + public override Elastic.Clients.Elasticsearch.Aggregations.AutoDateHistogramAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBuckets = default; + LocalJsonValue propField = default; + LocalJsonValue propFormat = default; + LocalJsonValue propMinimumInterval = default; + LocalJsonValue propMissing = default; + LocalJsonValue propOffset = default; + LocalJsonValue?> propParams = default; + LocalJsonValue propScript = default; + LocalJsonValue propTimeZone = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propMinimumInterval.TryReadProperty(ref reader, options, PropMinimumInterval, static Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propOffset.TryReadProperty(ref reader, options, PropOffset, null)) + { + continue; + } + + if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propTimeZone.TryReadProperty(ref reader, options, PropTimeZone, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.AutoDateHistogramAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + Field = propField.Value, + Format = propFormat.Value, + MinimumInterval = propMinimumInterval.Value, + Missing = propMissing.Value, + Offset = propOffset.Value, + Params = propParams.Value, + Script = propScript.Value, + TimeZone = propTimeZone.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.AutoDateHistogramAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropMinimumInterval, value.MinimumInterval, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMissing, value.Missing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropOffset, value.Offset, null, null); + writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AutoDateHistogramAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AutoDateHistogramAggregation.g.cs index e6a431ed4fd..17727fee494 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AutoDateHistogramAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AutoDateHistogramAggregation.g.cs @@ -23,118 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class AutoDateHistogramAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropMinimumInterval = System.Text.Json.JsonEncodedText.Encode("minimum_interval"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropOffset = System.Text.Json.JsonEncodedText.Encode("offset"); - private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"); - - public override Elastic.Clients.Elasticsearch.Aggregations.AutoDateHistogramAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBuckets = default; - LocalJsonValue propField = default; - LocalJsonValue propFormat = default; - LocalJsonValue propMinimumInterval = default; - LocalJsonValue propMissing = default; - LocalJsonValue propOffset = default; - LocalJsonValue?> propParams = default; - LocalJsonValue propScript = default; - LocalJsonValue propTimeZone = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propMinimumInterval.TryReadProperty(ref reader, options, PropMinimumInterval, static Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propOffset.TryReadProperty(ref reader, options, PropOffset, null)) - { - continue; - } - - if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propTimeZone.TryReadProperty(ref reader, options, PropTimeZone, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.AutoDateHistogramAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - Field = propField.Value, - Format = propFormat.Value, - MinimumInterval = propMinimumInterval.Value, - Missing = propMissing.Value, - Offset = propOffset.Value, - Params = propParams.Value, - Script = propScript.Value, - TimeZone = propTimeZone.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.AutoDateHistogramAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropMinimumInterval, value.MinimumInterval, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMissing, value.Missing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropOffset, value.Offset, null, null); - writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.AutoDateHistogramAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.AutoDateHistogramAggregationConverter))] public sealed partial class AutoDateHistogramAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregate.Converters.g.cs new file mode 100644 index 00000000000..aaba384c8ac --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregate.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class AverageAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.AverageAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propMeta = default; + LocalJsonValue propValue = default; + LocalJsonValue propValueAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.AverageAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Meta = propMeta.Value, + Value = propValue.Value, + ValueAsString = propValueAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.AverageAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregate.g.cs index db8a97af09b..451ee7a14ca 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregate.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class AverageAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.AverageAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propMeta = default; - LocalJsonValue propValue = default; - LocalJsonValue propValueAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.AverageAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Meta = propMeta.Value, - Value = propValue.Value, - ValueAsString = propValueAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.AverageAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.AverageAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.AverageAggregateConverter))] public sealed partial class AverageAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregation.Converters.g.cs new file mode 100644 index 00000000000..79c8b6a4c92 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregation.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class AverageAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.Aggregations.AverageAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propFormat = default; + LocalJsonValue propMissing = default; + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.AverageAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Format = propFormat.Value, + Missing = propMissing.Value, + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.AverageAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregation.g.cs index e57bcab8904..2f891890671 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregation.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class AverageAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.Aggregations.AverageAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propFormat = default; - LocalJsonValue propMissing = default; - LocalJsonValue propScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.AverageAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Format = propFormat.Value, - Missing = propMissing.Value, - Script = propScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.AverageAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropMissing, value.Missing, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.AverageAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.AverageAggregationConverter))] public sealed partial class AverageAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageBucketAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageBucketAggregation.Converters.g.cs new file mode 100644 index 00000000000..e1f64306df8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageBucketAggregation.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class AverageBucketAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); + + public override Elastic.Clients.Elasticsearch.Aggregations.AverageBucketAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucketsPath = default; + LocalJsonValue propFormat = default; + LocalJsonValue propGapPolicy = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.AverageBucketAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BucketsPath = propBucketsPath.Value, + Format = propFormat.Value, + GapPolicy = propGapPolicy.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.AverageBucketAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageBucketAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageBucketAggregation.g.cs index 1503eb6a700..07db59d81e8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageBucketAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageBucketAggregation.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class AverageBucketAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); - - public override Elastic.Clients.Elasticsearch.Aggregations.AverageBucketAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBucketsPath = default; - LocalJsonValue propFormat = default; - LocalJsonValue propGapPolicy = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.AverageBucketAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BucketsPath = propBucketsPath.Value, - Format = propFormat.Value, - GapPolicy = propGapPolicy.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.AverageBucketAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.AverageBucketAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.AverageBucketAggregationConverter))] public sealed partial class AverageBucketAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BoxplotAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BoxplotAggregate.Converters.g.cs new file mode 100644 index 00000000000..9b7757de49e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BoxplotAggregate.Converters.g.cs @@ -0,0 +1,189 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class BoxplotAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLower = System.Text.Json.JsonEncodedText.Encode("lower"); + private static readonly System.Text.Json.JsonEncodedText PropLowerAsString = System.Text.Json.JsonEncodedText.Encode("lower_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText PropMaxAsString = System.Text.Json.JsonEncodedText.Encode("max_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); + private static readonly System.Text.Json.JsonEncodedText PropMinAsString = System.Text.Json.JsonEncodedText.Encode("min_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropQ1 = System.Text.Json.JsonEncodedText.Encode("q1"); + private static readonly System.Text.Json.JsonEncodedText PropQ1AsString = System.Text.Json.JsonEncodedText.Encode("q1_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropQ2 = System.Text.Json.JsonEncodedText.Encode("q2"); + private static readonly System.Text.Json.JsonEncodedText PropQ2AsString = System.Text.Json.JsonEncodedText.Encode("q2_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropQ3 = System.Text.Json.JsonEncodedText.Encode("q3"); + private static readonly System.Text.Json.JsonEncodedText PropQ3AsString = System.Text.Json.JsonEncodedText.Encode("q3_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropUpper = System.Text.Json.JsonEncodedText.Encode("upper"); + private static readonly System.Text.Json.JsonEncodedText PropUpperAsString = System.Text.Json.JsonEncodedText.Encode("upper_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLower = default; + LocalJsonValue propLowerAsString = default; + LocalJsonValue propMax = default; + LocalJsonValue propMaxAsString = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propMin = default; + LocalJsonValue propMinAsString = default; + LocalJsonValue propQ1 = default; + LocalJsonValue propQ1AsString = default; + LocalJsonValue propQ2 = default; + LocalJsonValue propQ2AsString = default; + LocalJsonValue propQ3 = default; + LocalJsonValue propQ3AsString = default; + LocalJsonValue propUpper = default; + LocalJsonValue propUpperAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLower.TryReadProperty(ref reader, options, PropLower, null)) + { + continue; + } + + if (propLowerAsString.TryReadProperty(ref reader, options, PropLowerAsString, null)) + { + continue; + } + + if (propMax.TryReadProperty(ref reader, options, PropMax, null)) + { + continue; + } + + if (propMaxAsString.TryReadProperty(ref reader, options, PropMaxAsString, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propMin.TryReadProperty(ref reader, options, PropMin, null)) + { + continue; + } + + if (propMinAsString.TryReadProperty(ref reader, options, PropMinAsString, null)) + { + continue; + } + + if (propQ1.TryReadProperty(ref reader, options, PropQ1, null)) + { + continue; + } + + if (propQ1AsString.TryReadProperty(ref reader, options, PropQ1AsString, null)) + { + continue; + } + + if (propQ2.TryReadProperty(ref reader, options, PropQ2, null)) + { + continue; + } + + if (propQ2AsString.TryReadProperty(ref reader, options, PropQ2AsString, null)) + { + continue; + } + + if (propQ3.TryReadProperty(ref reader, options, PropQ3, null)) + { + continue; + } + + if (propQ3AsString.TryReadProperty(ref reader, options, PropQ3AsString, null)) + { + continue; + } + + if (propUpper.TryReadProperty(ref reader, options, PropUpper, null)) + { + continue; + } + + if (propUpperAsString.TryReadProperty(ref reader, options, PropUpperAsString, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Lower = propLower.Value, + LowerAsString = propLowerAsString.Value, + Max = propMax.Value, + MaxAsString = propMaxAsString.Value, + Meta = propMeta.Value, + Min = propMin.Value, + MinAsString = propMinAsString.Value, + Q1 = propQ1.Value, + Q1AsString = propQ1AsString.Value, + Q2 = propQ2.Value, + Q2AsString = propQ2AsString.Value, + Q3 = propQ3.Value, + Q3AsString = propQ3AsString.Value, + Upper = propUpper.Value, + UpperAsString = propUpperAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLower, value.Lower, null, null); + writer.WriteProperty(options, PropLowerAsString, value.LowerAsString, null, null); + writer.WriteProperty(options, PropMax, value.Max, null, null); + writer.WriteProperty(options, PropMaxAsString, value.MaxAsString, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropMin, value.Min, null, null); + writer.WriteProperty(options, PropMinAsString, value.MinAsString, null, null); + writer.WriteProperty(options, PropQ1, value.Q1, null, null); + writer.WriteProperty(options, PropQ1AsString, value.Q1AsString, null, null); + writer.WriteProperty(options, PropQ2, value.Q2, null, null); + writer.WriteProperty(options, PropQ2AsString, value.Q2AsString, null, null); + writer.WriteProperty(options, PropQ3, value.Q3, null, null); + writer.WriteProperty(options, PropQ3AsString, value.Q3AsString, null, null); + writer.WriteProperty(options, PropUpper, value.Upper, null, null); + writer.WriteProperty(options, PropUpperAsString, value.UpperAsString, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BoxplotAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BoxplotAggregate.g.cs index 9157c5a60c0..6efa263e782 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BoxplotAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BoxplotAggregate.g.cs @@ -23,172 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class BoxplotAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLower = System.Text.Json.JsonEncodedText.Encode("lower"); - private static readonly System.Text.Json.JsonEncodedText PropLowerAsString = System.Text.Json.JsonEncodedText.Encode("lower_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); - private static readonly System.Text.Json.JsonEncodedText PropMaxAsString = System.Text.Json.JsonEncodedText.Encode("max_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); - private static readonly System.Text.Json.JsonEncodedText PropMinAsString = System.Text.Json.JsonEncodedText.Encode("min_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropQ1 = System.Text.Json.JsonEncodedText.Encode("q1"); - private static readonly System.Text.Json.JsonEncodedText PropQ1AsString = System.Text.Json.JsonEncodedText.Encode("q1_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropQ2 = System.Text.Json.JsonEncodedText.Encode("q2"); - private static readonly System.Text.Json.JsonEncodedText PropQ2AsString = System.Text.Json.JsonEncodedText.Encode("q2_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropQ3 = System.Text.Json.JsonEncodedText.Encode("q3"); - private static readonly System.Text.Json.JsonEncodedText PropQ3AsString = System.Text.Json.JsonEncodedText.Encode("q3_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropUpper = System.Text.Json.JsonEncodedText.Encode("upper"); - private static readonly System.Text.Json.JsonEncodedText PropUpperAsString = System.Text.Json.JsonEncodedText.Encode("upper_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLower = default; - LocalJsonValue propLowerAsString = default; - LocalJsonValue propMax = default; - LocalJsonValue propMaxAsString = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propMin = default; - LocalJsonValue propMinAsString = default; - LocalJsonValue propQ1 = default; - LocalJsonValue propQ1AsString = default; - LocalJsonValue propQ2 = default; - LocalJsonValue propQ2AsString = default; - LocalJsonValue propQ3 = default; - LocalJsonValue propQ3AsString = default; - LocalJsonValue propUpper = default; - LocalJsonValue propUpperAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLower.TryReadProperty(ref reader, options, PropLower, null)) - { - continue; - } - - if (propLowerAsString.TryReadProperty(ref reader, options, PropLowerAsString, null)) - { - continue; - } - - if (propMax.TryReadProperty(ref reader, options, PropMax, null)) - { - continue; - } - - if (propMaxAsString.TryReadProperty(ref reader, options, PropMaxAsString, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propMin.TryReadProperty(ref reader, options, PropMin, null)) - { - continue; - } - - if (propMinAsString.TryReadProperty(ref reader, options, PropMinAsString, null)) - { - continue; - } - - if (propQ1.TryReadProperty(ref reader, options, PropQ1, null)) - { - continue; - } - - if (propQ1AsString.TryReadProperty(ref reader, options, PropQ1AsString, null)) - { - continue; - } - - if (propQ2.TryReadProperty(ref reader, options, PropQ2, null)) - { - continue; - } - - if (propQ2AsString.TryReadProperty(ref reader, options, PropQ2AsString, null)) - { - continue; - } - - if (propQ3.TryReadProperty(ref reader, options, PropQ3, null)) - { - continue; - } - - if (propQ3AsString.TryReadProperty(ref reader, options, PropQ3AsString, null)) - { - continue; - } - - if (propUpper.TryReadProperty(ref reader, options, PropUpper, null)) - { - continue; - } - - if (propUpperAsString.TryReadProperty(ref reader, options, PropUpperAsString, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Lower = propLower.Value, - LowerAsString = propLowerAsString.Value, - Max = propMax.Value, - MaxAsString = propMaxAsString.Value, - Meta = propMeta.Value, - Min = propMin.Value, - MinAsString = propMinAsString.Value, - Q1 = propQ1.Value, - Q1AsString = propQ1AsString.Value, - Q2 = propQ2.Value, - Q2AsString = propQ2AsString.Value, - Q3 = propQ3.Value, - Q3AsString = propQ3AsString.Value, - Upper = propUpper.Value, - UpperAsString = propUpperAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLower, value.Lower, null, null); - writer.WriteProperty(options, PropLowerAsString, value.LowerAsString, null, null); - writer.WriteProperty(options, PropMax, value.Max, null, null); - writer.WriteProperty(options, PropMaxAsString, value.MaxAsString, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropMin, value.Min, null, null); - writer.WriteProperty(options, PropMinAsString, value.MinAsString, null, null); - writer.WriteProperty(options, PropQ1, value.Q1, null, null); - writer.WriteProperty(options, PropQ1AsString, value.Q1AsString, null, null); - writer.WriteProperty(options, PropQ2, value.Q2, null, null); - writer.WriteProperty(options, PropQ2AsString, value.Q2AsString, null, null); - writer.WriteProperty(options, PropQ3, value.Q3, null, null); - writer.WriteProperty(options, PropQ3AsString, value.Q3AsString, null, null); - writer.WriteProperty(options, PropUpper, value.Upper, null, null); - writer.WriteProperty(options, PropUpperAsString, value.UpperAsString, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.BoxplotAggregateConverter))] public sealed partial class BoxplotAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BoxplotAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BoxplotAggregation.Converters.g.cs new file mode 100644 index 00000000000..e1e0cacbc3d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BoxplotAggregation.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class BoxplotAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCompression = System.Text.Json.JsonEncodedText.Encode("compression"); + private static readonly System.Text.Json.JsonEncodedText PropExecutionHint = System.Text.Json.JsonEncodedText.Encode("execution_hint"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCompression = default; + LocalJsonValue propExecutionHint = default; + LocalJsonValue propField = default; + LocalJsonValue propMissing = default; + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCompression.TryReadProperty(ref reader, options, PropCompression, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propExecutionHint.TryReadProperty(ref reader, options, PropExecutionHint, static Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Compression = propCompression.Value, + ExecutionHint = propExecutionHint.Value, + Field = propField.Value, + Missing = propMissing.Value, + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCompression, value.Compression, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropExecutionHint, value.ExecutionHint, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BoxplotAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BoxplotAggregation.g.cs index 82f5c2b326d..a943100f23c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BoxplotAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BoxplotAggregation.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class BoxplotAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCompression = System.Text.Json.JsonEncodedText.Encode("compression"); - private static readonly System.Text.Json.JsonEncodedText PropExecutionHint = System.Text.Json.JsonEncodedText.Encode("execution_hint"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCompression = default; - LocalJsonValue propExecutionHint = default; - LocalJsonValue propField = default; - LocalJsonValue propMissing = default; - LocalJsonValue propScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCompression.TryReadProperty(ref reader, options, PropCompression, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propExecutionHint.TryReadProperty(ref reader, options, PropExecutionHint, static Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Compression = propCompression.Value, - ExecutionHint = propExecutionHint.Value, - Field = propField.Value, - Missing = propMissing.Value, - Script = propScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCompression, value.Compression, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropExecutionHint, value.ExecutionHint, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropMissing, value.Missing, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.BoxplotAggregationConverter))] public sealed partial class BoxplotAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationAggregation.Converters.g.cs new file mode 100644 index 00000000000..bf6b45d66e2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationAggregation.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class BucketCorrelationAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); + private static readonly System.Text.Json.JsonEncodedText PropFunction = System.Text.Json.JsonEncodedText.Encode("function"); + + public override Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucketsPath = default; + LocalJsonValue propFunction = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) + { + continue; + } + + if (propFunction.TryReadProperty(ref reader, options, PropFunction, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BucketsPath = propBucketsPath.Value, + Function = propFunction.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); + writer.WriteProperty(options, PropFunction, value.Function, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationAggregation.g.cs index 19f9aa62061..24a69e03298 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationAggregation.g.cs @@ -23,60 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class BucketCorrelationAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); - private static readonly System.Text.Json.JsonEncodedText PropFunction = System.Text.Json.JsonEncodedText.Encode("function"); - - public override Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBucketsPath = default; - LocalJsonValue propFunction = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) - { - continue; - } - - if (propFunction.TryReadProperty(ref reader, options, PropFunction, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BucketsPath = propBucketsPath.Value, - Function = propFunction.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); - writer.WriteProperty(options, PropFunction, value.Function, null, null); - writer.WriteEndObject(); - } -} - /// /// /// A sibling pipeline aggregation which executes a correlation function on the configured sibling multi-bucket aggregation. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.BucketCorrelationAggregationConverter))] public sealed partial class BucketCorrelationAggregation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunction.Converters.g.cs new file mode 100644 index 00000000000..41b3e4201b9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunction.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class BucketCorrelationFunctionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCountCorrelation = System.Text.Json.JsonEncodedText.Encode("count_correlation"); + + public override Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCountCorrelation = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCountCorrelation.TryReadProperty(ref reader, options, PropCountCorrelation, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CountCorrelation = propCountCorrelation.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCountCorrelation, value.CountCorrelation, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunction.g.cs index 89f298991c9..f364290e766 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunction.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class BucketCorrelationFunctionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCountCorrelation = System.Text.Json.JsonEncodedText.Encode("count_correlation"); - - public override Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCountCorrelation = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCountCorrelation.TryReadProperty(ref reader, options, PropCountCorrelation, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CountCorrelation = propCountCorrelation.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCountCorrelation, value.CountCorrelation, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.BucketCorrelationFunctionConverter))] public sealed partial class BucketCorrelationFunction { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunctionCountCorrelation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunctionCountCorrelation.Converters.g.cs new file mode 100644 index 00000000000..a203326bfd5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunctionCountCorrelation.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class BucketCorrelationFunctionCountCorrelationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndicator = System.Text.Json.JsonEncodedText.Encode("indicator"); + + public override Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionCountCorrelation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndicator = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndicator.TryReadProperty(ref reader, options, PropIndicator, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionCountCorrelation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Indicator = propIndicator.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionCountCorrelation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndicator, value.Indicator, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunctionCountCorrelation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunctionCountCorrelation.g.cs index 16daedaa8f9..1db990f879a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunctionCountCorrelation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunctionCountCorrelation.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class BucketCorrelationFunctionCountCorrelationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndicator = System.Text.Json.JsonEncodedText.Encode("indicator"); - - public override Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionCountCorrelation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndicator = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndicator.TryReadProperty(ref reader, options, PropIndicator, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionCountCorrelation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Indicator = propIndicator.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionCountCorrelation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndicator, value.Indicator, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionCountCorrelationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.BucketCorrelationFunctionCountCorrelationConverter))] public sealed partial class BucketCorrelationFunctionCountCorrelation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunctionCountCorrelationIndicator.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunctionCountCorrelationIndicator.Converters.g.cs new file mode 100644 index 00000000000..c4f267088bc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunctionCountCorrelationIndicator.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class BucketCorrelationFunctionCountCorrelationIndicatorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropExpectations = System.Text.Json.JsonEncodedText.Encode("expectations"); + private static readonly System.Text.Json.JsonEncodedText PropFractions = System.Text.Json.JsonEncodedText.Encode("fractions"); + + public override Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionCountCorrelationIndicator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDocCount = default; + LocalJsonValue> propExpectations = default; + LocalJsonValue?> propFractions = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propExpectations.TryReadProperty(ref reader, options, PropExpectations, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propFractions.TryReadProperty(ref reader, options, PropFractions, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionCountCorrelationIndicator(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DocCount = propDocCount.Value, + Expectations = propExpectations.Value, + Fractions = propFractions.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionCountCorrelationIndicator value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropExpectations, value.Expectations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFractions, value.Fractions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunctionCountCorrelationIndicator.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunctionCountCorrelationIndicator.g.cs index a07a4a07667..8495bf4cac2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunctionCountCorrelationIndicator.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketCorrelationFunctionCountCorrelationIndicator.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class BucketCorrelationFunctionCountCorrelationIndicatorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropExpectations = System.Text.Json.JsonEncodedText.Encode("expectations"); - private static readonly System.Text.Json.JsonEncodedText PropFractions = System.Text.Json.JsonEncodedText.Encode("fractions"); - - public override Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionCountCorrelationIndicator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDocCount = default; - LocalJsonValue> propExpectations = default; - LocalJsonValue?> propFractions = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propExpectations.TryReadProperty(ref reader, options, PropExpectations, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propFractions.TryReadProperty(ref reader, options, PropFractions, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionCountCorrelationIndicator(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DocCount = propDocCount.Value, - Expectations = propExpectations.Value, - Fractions = propFractions.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionCountCorrelationIndicator value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropExpectations, value.Expectations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFractions, value.Fractions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.BucketCorrelationFunctionCountCorrelationIndicatorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.BucketCorrelationFunctionCountCorrelationIndicatorConverter))] public sealed partial class BucketCorrelationFunctionCountCorrelationIndicator { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketKsAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketKsAggregation.Converters.g.cs new file mode 100644 index 00000000000..3d7f1755361 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketKsAggregation.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class BucketKsAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAlternative = System.Text.Json.JsonEncodedText.Encode("alternative"); + private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); + private static readonly System.Text.Json.JsonEncodedText PropFractions = System.Text.Json.JsonEncodedText.Encode("fractions"); + private static readonly System.Text.Json.JsonEncodedText PropSamplingMethod = System.Text.Json.JsonEncodedText.Encode("sampling_method"); + + public override Elastic.Clients.Elasticsearch.Aggregations.BucketKsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAlternative = default; + LocalJsonValue propBucketsPath = default; + LocalJsonValue?> propFractions = default; + LocalJsonValue propSamplingMethod = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAlternative.TryReadProperty(ref reader, options, PropAlternative, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) + { + continue; + } + + if (propFractions.TryReadProperty(ref reader, options, PropFractions, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propSamplingMethod.TryReadProperty(ref reader, options, PropSamplingMethod, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.BucketKsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Alternative = propAlternative.Value, + BucketsPath = propBucketsPath.Value, + Fractions = propFractions.Value, + SamplingMethod = propSamplingMethod.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.BucketKsAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAlternative, value.Alternative, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); + writer.WriteProperty(options, PropFractions, value.Fractions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSamplingMethod, value.SamplingMethod, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketKsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketKsAggregation.g.cs index 864f6c6734a..086ac7f8dfd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketKsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketKsAggregation.g.cs @@ -23,72 +23,6 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class BucketKsAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAlternative = System.Text.Json.JsonEncodedText.Encode("alternative"); - private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); - private static readonly System.Text.Json.JsonEncodedText PropFractions = System.Text.Json.JsonEncodedText.Encode("fractions"); - private static readonly System.Text.Json.JsonEncodedText PropSamplingMethod = System.Text.Json.JsonEncodedText.Encode("sampling_method"); - - public override Elastic.Clients.Elasticsearch.Aggregations.BucketKsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAlternative = default; - LocalJsonValue propBucketsPath = default; - LocalJsonValue?> propFractions = default; - LocalJsonValue propSamplingMethod = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAlternative.TryReadProperty(ref reader, options, PropAlternative, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) - { - continue; - } - - if (propFractions.TryReadProperty(ref reader, options, PropFractions, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propSamplingMethod.TryReadProperty(ref reader, options, PropSamplingMethod, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.BucketKsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Alternative = propAlternative.Value, - BucketsPath = propBucketsPath.Value, - Fractions = propFractions.Value, - SamplingMethod = propSamplingMethod.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.BucketKsAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAlternative, value.Alternative, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); - writer.WriteProperty(options, PropFractions, value.Fractions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSamplingMethod, value.SamplingMethod, null, null); - writer.WriteEndObject(); - } -} - /// /// /// A sibling pipeline aggregation which executes a two sample Kolmogorov–Smirnov test (referred @@ -102,7 +36,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// to each term. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.BucketKsAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.BucketKsAggregationConverter))] public sealed partial class BucketKsAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketMetricValueAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketMetricValueAggregate.Converters.g.cs new file mode 100644 index 00000000000..8a5abb49630 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketMetricValueAggregate.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class BucketMetricValueAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropKeys = System.Text.Json.JsonEncodedText.Encode("keys"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.BucketMetricValueAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propKeys = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propValue = default; + LocalJsonValue propValueAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propKeys.TryReadProperty(ref reader, options, PropKeys, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.BucketMetricValueAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Keys = propKeys.Value, + Meta = propMeta.Value, + Value = propValue.Value, + ValueAsString = propValueAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.BucketMetricValueAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropKeys, value.Keys, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketMetricValueAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketMetricValueAggregate.g.cs index b6e414f57c5..75a6b59f744 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketMetricValueAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketMetricValueAggregate.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class BucketMetricValueAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropKeys = System.Text.Json.JsonEncodedText.Encode("keys"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.BucketMetricValueAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propKeys = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propValue = default; - LocalJsonValue propValueAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propKeys.TryReadProperty(ref reader, options, PropKeys, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.BucketMetricValueAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Keys = propKeys.Value, - Meta = propMeta.Value, - Value = propValue.Value, - ValueAsString = propValueAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.BucketMetricValueAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropKeys, value.Keys, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.BucketMetricValueAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.BucketMetricValueAggregateConverter))] public sealed partial class BucketMetricValueAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketScriptAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketScriptAggregation.Converters.g.cs new file mode 100644 index 00000000000..cdab03acc67 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketScriptAggregation.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class BucketScriptAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.Aggregations.BucketScriptAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucketsPath = default; + LocalJsonValue propFormat = default; + LocalJsonValue propGapPolicy = default; + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.BucketScriptAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BucketsPath = propBucketsPath.Value, + Format = propFormat.Value, + GapPolicy = propGapPolicy.Value, + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.BucketScriptAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketScriptAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketScriptAggregation.g.cs index 65febcbb61a..4759dcc1087 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketScriptAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketScriptAggregation.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class BucketScriptAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.Aggregations.BucketScriptAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBucketsPath = default; - LocalJsonValue propFormat = default; - LocalJsonValue propGapPolicy = default; - LocalJsonValue propScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.BucketScriptAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BucketsPath = propBucketsPath.Value, - Format = propFormat.Value, - GapPolicy = propGapPolicy.Value, - Script = propScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.BucketScriptAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.BucketScriptAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.BucketScriptAggregationConverter))] public sealed partial class BucketScriptAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketSelectorAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketSelectorAggregation.Converters.g.cs new file mode 100644 index 00000000000..c2fde8b9801 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketSelectorAggregation.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class BucketSelectorAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.Aggregations.BucketSelectorAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucketsPath = default; + LocalJsonValue propFormat = default; + LocalJsonValue propGapPolicy = default; + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.BucketSelectorAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BucketsPath = propBucketsPath.Value, + Format = propFormat.Value, + GapPolicy = propGapPolicy.Value, + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.BucketSelectorAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketSelectorAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketSelectorAggregation.g.cs index 560276291ff..07046f9bae0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketSelectorAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketSelectorAggregation.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class BucketSelectorAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.Aggregations.BucketSelectorAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBucketsPath = default; - LocalJsonValue propFormat = default; - LocalJsonValue propGapPolicy = default; - LocalJsonValue propScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.BucketSelectorAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BucketsPath = propBucketsPath.Value, - Format = propFormat.Value, - GapPolicy = propGapPolicy.Value, - Script = propScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.BucketSelectorAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.BucketSelectorAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.BucketSelectorAggregationConverter))] public sealed partial class BucketSelectorAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketSortAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketSortAggregation.Converters.g.cs new file mode 100644 index 00000000000..5fa4942e3c9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketSortAggregation.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class BucketSortAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFrom = System.Text.Json.JsonEncodedText.Encode("from"); + private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); + + public override Elastic.Clients.Elasticsearch.Aggregations.BucketSortAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFrom = default; + LocalJsonValue propGapPolicy = default; + LocalJsonValue propSize = default; + LocalJsonValue?> propSort = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFrom.TryReadProperty(ref reader, options, PropFrom, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.BucketSortAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + From = propFrom.Value, + GapPolicy = propGapPolicy.Value, + Size = propSize.Value, + Sort = propSort.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.BucketSortAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFrom, value.From, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketSortAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketSortAggregation.g.cs index e5fb71b1674..7fdbf43f659 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketSortAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BucketSortAggregation.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class BucketSortAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFrom = System.Text.Json.JsonEncodedText.Encode("from"); - private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); - - public override Elastic.Clients.Elasticsearch.Aggregations.BucketSortAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFrom = default; - LocalJsonValue propGapPolicy = default; - LocalJsonValue propSize = default; - LocalJsonValue?> propSort = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFrom.TryReadProperty(ref reader, options, PropFrom, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.BucketSortAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - From = propFrom.Value, - GapPolicy = propGapPolicy.Value, - Size = propSize.Value, - Sort = propSort.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.BucketSortAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFrom, value.From, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.BucketSortAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.BucketSortAggregationConverter))] public sealed partial class BucketSortAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Buckets.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Buckets.Converters.g.cs new file mode 100644 index 00000000000..b5ebeab0c01 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Buckets.Converters.g.cs @@ -0,0 +1,75 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class BucketsConverter : System.Text.Json.Serialization.JsonConverter> +{ + public override Elastic.Clients.Elasticsearch.Aggregations.Buckets Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray); + return selector(ref reader, options) switch + { + Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Aggregations.Buckets(reader.ReadValue>(options, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)), + Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Aggregations.Buckets(reader.ReadValue>(options, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)), + _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Aggregations.Buckets)}") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.Buckets value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Tag) + { + case Elastic.Clients.Elasticsearch.UnionTag.T1: + { + writer.WriteValue(options, value.Value1, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + break; + } + + case Elastic.Clients.Elasticsearch.UnionTag.T2: + { + writer.WriteValue(options, value.Value2, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + break; + } + + default: + throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); + } + } +} + +public sealed partial class BucketsConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(Buckets<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(BucketsConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Buckets.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Buckets.g.cs index c8e7ae45689..643839227ce 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Buckets.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Buckets.g.cs @@ -23,64 +23,13 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class BucketsConverter : System.Text.Json.Serialization.JsonConverter> -{ - public override Elastic.Clients.Elasticsearch.Aggregations.Buckets Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray); - return selector(ref reader, options) switch - { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Aggregations.Buckets(reader.ReadValue>(options, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Aggregations.Buckets(reader.ReadValue>(options, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)), - _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Aggregations.Buckets)}") - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.Buckets value, System.Text.Json.JsonSerializerOptions options) - { - switch (value.Tag) - { - case Elastic.Clients.Elasticsearch.UnionTag.T1: - { - writer.WriteValue(options, value.Value1, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - break; - } - - case Elastic.Clients.Elasticsearch.UnionTag.T2: - { - writer.WriteValue(options, value.Value2, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - break; - } - - default: - throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); - } - } -} - -internal sealed partial class BucketsConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(Buckets<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(BucketsConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - /// /// /// Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for /// the different buckets, the result is a dictionary. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.BucketsConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.BucketsConverterFactory))] public sealed partial class Buckets : Elastic.Clients.Elasticsearch.Union, System.Collections.Generic.ICollection> { public Buckets(System.Collections.Generic.IDictionary value) : base(value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CalendarInterval.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CalendarInterval.Converters.g.cs new file mode 100644 index 00000000000..cee5ec925b3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CalendarInterval.Converters.g.cs @@ -0,0 +1,173 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class CalendarIntervalConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberDay = System.Text.Json.JsonEncodedText.Encode("day"); + private static readonly System.Text.Json.JsonEncodedText MemberDay1 = System.Text.Json.JsonEncodedText.Encode("1d"); + private static readonly System.Text.Json.JsonEncodedText MemberHour = System.Text.Json.JsonEncodedText.Encode("hour"); + private static readonly System.Text.Json.JsonEncodedText MemberHour1 = System.Text.Json.JsonEncodedText.Encode("1h"); + private static readonly System.Text.Json.JsonEncodedText MemberMinute = System.Text.Json.JsonEncodedText.Encode("minute"); + private static readonly System.Text.Json.JsonEncodedText MemberMinute1 = System.Text.Json.JsonEncodedText.Encode("1m"); + private static readonly System.Text.Json.JsonEncodedText MemberMonth = System.Text.Json.JsonEncodedText.Encode("month"); + private static readonly System.Text.Json.JsonEncodedText MemberMonth1 = System.Text.Json.JsonEncodedText.Encode("1M"); + private static readonly System.Text.Json.JsonEncodedText MemberQuarter = System.Text.Json.JsonEncodedText.Encode("quarter"); + private static readonly System.Text.Json.JsonEncodedText MemberQuarter1 = System.Text.Json.JsonEncodedText.Encode("1q"); + private static readonly System.Text.Json.JsonEncodedText MemberSecond = System.Text.Json.JsonEncodedText.Encode("second"); + private static readonly System.Text.Json.JsonEncodedText MemberSecond1 = System.Text.Json.JsonEncodedText.Encode("1s"); + private static readonly System.Text.Json.JsonEncodedText MemberWeek = System.Text.Json.JsonEncodedText.Encode("week"); + private static readonly System.Text.Json.JsonEncodedText MemberWeek1 = System.Text.Json.JsonEncodedText.Encode("1w"); + private static readonly System.Text.Json.JsonEncodedText MemberYear = System.Text.Json.JsonEncodedText.Encode("year"); + private static readonly System.Text.Json.JsonEncodedText MemberYear1 = System.Text.Json.JsonEncodedText.Encode("1y"); + + public override Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberDay) || reader.ValueTextEquals(MemberDay1)) + { + return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Day; + } + + if (reader.ValueTextEquals(MemberHour) || reader.ValueTextEquals(MemberHour1)) + { + return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Hour; + } + + if (reader.ValueTextEquals(MemberMinute) || reader.ValueTextEquals(MemberMinute1)) + { + return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Minute; + } + + if (reader.ValueTextEquals(MemberMonth) || reader.ValueTextEquals(MemberMonth1)) + { + return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Month; + } + + if (reader.ValueTextEquals(MemberQuarter) || reader.ValueTextEquals(MemberQuarter1)) + { + return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Quarter; + } + + if (reader.ValueTextEquals(MemberSecond) || reader.ValueTextEquals(MemberSecond1)) + { + return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Second; + } + + if (reader.ValueTextEquals(MemberWeek) || reader.ValueTextEquals(MemberWeek1)) + { + return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Week; + } + + if (reader.ValueTextEquals(MemberYear) || reader.ValueTextEquals(MemberYear1)) + { + return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Year; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberDay.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberDay1.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Day; + } + + if (string.Equals(value, MemberHour.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberHour1.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Hour; + } + + if (string.Equals(value, MemberMinute.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberMinute1.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Minute; + } + + if (string.Equals(value, MemberMonth.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberMonth1.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Month; + } + + if (string.Equals(value, MemberQuarter.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberQuarter1.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Quarter; + } + + if (string.Equals(value, MemberSecond.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberSecond1.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Second; + } + + if (string.Equals(value, MemberWeek.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberWeek1.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Week; + } + + if (string.Equals(value, MemberYear.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberYear1.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Year; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Day: + writer.WriteStringValue(MemberDay); + break; + case Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Hour: + writer.WriteStringValue(MemberHour); + break; + case Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Minute: + writer.WriteStringValue(MemberMinute); + break; + case Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Month: + writer.WriteStringValue(MemberMonth); + break; + case Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Quarter: + writer.WriteStringValue(MemberQuarter); + break; + case Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Second: + writer.WriteStringValue(MemberSecond); + break; + case Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Week: + writer.WriteStringValue(MemberWeek); + break; + case Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Year: + writer.WriteStringValue(MemberYear); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CalendarInterval.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CalendarInterval.g.cs new file mode 100644 index 00000000000..1ed70044fde --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CalendarInterval.g.cs @@ -0,0 +1,45 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.CalendarIntervalConverter))] +public enum CalendarInterval +{ + [System.Runtime.Serialization.EnumMember(Value = "day")] + Day, + [System.Runtime.Serialization.EnumMember(Value = "hour")] + Hour, + [System.Runtime.Serialization.EnumMember(Value = "minute")] + Minute, + [System.Runtime.Serialization.EnumMember(Value = "month")] + Month, + [System.Runtime.Serialization.EnumMember(Value = "quarter")] + Quarter, + [System.Runtime.Serialization.EnumMember(Value = "second")] + Second, + [System.Runtime.Serialization.EnumMember(Value = "week")] + Week, + [System.Runtime.Serialization.EnumMember(Value = "year")] + Year +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityAggregate.Converters.g.cs new file mode 100644 index 00000000000..345ac954736 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class CardinalityAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + + public override Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propMeta = default; + LocalJsonValue propValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Meta = propMeta.Value, + Value = propValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropValue, value.Value, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityAggregate.g.cs index 4819c4a0f5c..92ef76fcf16 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityAggregate.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class CardinalityAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - - public override Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propMeta = default; - LocalJsonValue propValue = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Meta = propMeta.Value, - Value = propValue.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropValue, value.Value, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.CardinalityAggregateConverter))] public sealed partial class CardinalityAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityAggregation.Converters.g.cs new file mode 100644 index 00000000000..bb4332c953d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityAggregation.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class CardinalityAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExecutionHint = System.Text.Json.JsonEncodedText.Encode("execution_hint"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropPrecisionThreshold = System.Text.Json.JsonEncodedText.Encode("precision_threshold"); + private static readonly System.Text.Json.JsonEncodedText PropRehash = System.Text.Json.JsonEncodedText.Encode("rehash"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExecutionHint = default; + LocalJsonValue propField = default; + LocalJsonValue propMissing = default; + LocalJsonValue propPrecisionThreshold = default; + LocalJsonValue propRehash = default; + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExecutionHint.TryReadProperty(ref reader, options, PropExecutionHint, static Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (propPrecisionThreshold.TryReadProperty(ref reader, options, PropPrecisionThreshold, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRehash.TryReadProperty(ref reader, options, PropRehash, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ExecutionHint = propExecutionHint.Value, + Field = propField.Value, + Missing = propMissing.Value, + PrecisionThreshold = propPrecisionThreshold.Value, + Rehash = propRehash.Value, + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExecutionHint, value.ExecutionHint, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteProperty(options, PropPrecisionThreshold, value.PrecisionThreshold, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRehash, value.Rehash, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityAggregation.g.cs index 478e93172e3..a212f072e03 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityAggregation.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class CardinalityAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExecutionHint = System.Text.Json.JsonEncodedText.Encode("execution_hint"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropPrecisionThreshold = System.Text.Json.JsonEncodedText.Encode("precision_threshold"); - private static readonly System.Text.Json.JsonEncodedText PropRehash = System.Text.Json.JsonEncodedText.Encode("rehash"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propExecutionHint = default; - LocalJsonValue propField = default; - LocalJsonValue propMissing = default; - LocalJsonValue propPrecisionThreshold = default; - LocalJsonValue propRehash = default; - LocalJsonValue propScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExecutionHint.TryReadProperty(ref reader, options, PropExecutionHint, static Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) - { - continue; - } - - if (propPrecisionThreshold.TryReadProperty(ref reader, options, PropPrecisionThreshold, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRehash.TryReadProperty(ref reader, options, PropRehash, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ExecutionHint = propExecutionHint.Value, - Field = propField.Value, - Missing = propMissing.Value, - PrecisionThreshold = propPrecisionThreshold.Value, - Rehash = propRehash.Value, - Script = propScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExecutionHint, value.ExecutionHint, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropMissing, value.Missing, null, null); - writer.WriteProperty(options, PropPrecisionThreshold, value.PrecisionThreshold, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRehash, value.Rehash, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.CardinalityAggregationConverter))] public sealed partial class CardinalityAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityExecutionMode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityExecutionMode.Converters.g.cs new file mode 100644 index 00000000000..152eab6ba4a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityExecutionMode.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class CardinalityExecutionModeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberDirect = System.Text.Json.JsonEncodedText.Encode("direct"); + private static readonly System.Text.Json.JsonEncodedText MemberGlobalOrdinals = System.Text.Json.JsonEncodedText.Encode("global_ordinals"); + private static readonly System.Text.Json.JsonEncodedText MemberSaveMemoryHeuristic = System.Text.Json.JsonEncodedText.Encode("save_memory_heuristic"); + private static readonly System.Text.Json.JsonEncodedText MemberSaveTimeHeuristic = System.Text.Json.JsonEncodedText.Encode("save_time_heuristic"); + private static readonly System.Text.Json.JsonEncodedText MemberSegmentOrdinals = System.Text.Json.JsonEncodedText.Encode("segment_ordinals"); + + public override Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberDirect)) + { + return Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.Direct; + } + + if (reader.ValueTextEquals(MemberGlobalOrdinals)) + { + return Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.GlobalOrdinals; + } + + if (reader.ValueTextEquals(MemberSaveMemoryHeuristic)) + { + return Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.SaveMemoryHeuristic; + } + + if (reader.ValueTextEquals(MemberSaveTimeHeuristic)) + { + return Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.SaveTimeHeuristic; + } + + if (reader.ValueTextEquals(MemberSegmentOrdinals)) + { + return Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.SegmentOrdinals; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberDirect.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.Direct; + } + + if (string.Equals(value, MemberGlobalOrdinals.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.GlobalOrdinals; + } + + if (string.Equals(value, MemberSaveMemoryHeuristic.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.SaveMemoryHeuristic; + } + + if (string.Equals(value, MemberSaveTimeHeuristic.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.SaveTimeHeuristic; + } + + if (string.Equals(value, MemberSegmentOrdinals.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.SegmentOrdinals; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.Direct: + writer.WriteStringValue(MemberDirect); + break; + case Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.GlobalOrdinals: + writer.WriteStringValue(MemberGlobalOrdinals); + break; + case Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.SaveMemoryHeuristic: + writer.WriteStringValue(MemberSaveMemoryHeuristic); + break; + case Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.SaveTimeHeuristic: + writer.WriteStringValue(MemberSaveTimeHeuristic); + break; + case Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.SegmentOrdinals: + writer.WriteStringValue(MemberSegmentOrdinals); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityExecutionMode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityExecutionMode.g.cs new file mode 100644 index 00000000000..ecd168c18b0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityExecutionMode.g.cs @@ -0,0 +1,64 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.CardinalityExecutionModeConverter))] +public enum CardinalityExecutionMode +{ + /// + /// + /// Run the aggregation by using field values directly. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "direct")] + Direct, + /// + /// + /// Run the aggregation by using global ordinals of the field and resolving those values after finishing a shard. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "global_ordinals")] + GlobalOrdinals, + /// + /// + /// Heuristic-based mode, default in Elasticsearch 8.3 and earlier. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "save_memory_heuristic")] + SaveMemoryHeuristic, + /// + /// + /// Heuristic-based mode, default in Elasticsearch 8.4 and later. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "save_time_heuristic")] + SaveTimeHeuristic, + /// + /// + /// Run the aggregation by using segment ordinal values and resolving those values after each segment. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "segment_ordinals")] + SegmentOrdinals +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CategorizeTextAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CategorizeTextAggregation.Converters.g.cs new file mode 100644 index 00000000000..08fd8ca968c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CategorizeTextAggregation.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class CategorizeTextAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCategorizationAnalyzer = System.Text.Json.JsonEncodedText.Encode("categorization_analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropCategorizationFilters = System.Text.Json.JsonEncodedText.Encode("categorization_filters"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropMaxMatchedTokens = System.Text.Json.JsonEncodedText.Encode("max_matched_tokens"); + private static readonly System.Text.Json.JsonEncodedText PropMaxUniqueTokens = System.Text.Json.JsonEncodedText.Encode("max_unique_tokens"); + private static readonly System.Text.Json.JsonEncodedText PropMinDocCount = System.Text.Json.JsonEncodedText.Encode("min_doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropShardMinDocCount = System.Text.Json.JsonEncodedText.Encode("shard_min_doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"); + private static readonly System.Text.Json.JsonEncodedText PropSimilarityThreshold = System.Text.Json.JsonEncodedText.Encode("similarity_threshold"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + + public override Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCategorizationAnalyzer = default; + LocalJsonValue?> propCategorizationFilters = default; + LocalJsonValue propField = default; + LocalJsonValue propMaxMatchedTokens = default; + LocalJsonValue propMaxUniqueTokens = default; + LocalJsonValue propMinDocCount = default; + LocalJsonValue propShardMinDocCount = default; + LocalJsonValue propShardSize = default; + LocalJsonValue propSimilarityThreshold = default; + LocalJsonValue propSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCategorizationAnalyzer.TryReadProperty(ref reader, options, PropCategorizationAnalyzer, null)) + { + continue; + } + + if (propCategorizationFilters.TryReadProperty(ref reader, options, PropCategorizationFilters, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propMaxMatchedTokens.TryReadProperty(ref reader, options, PropMaxMatchedTokens, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxUniqueTokens.TryReadProperty(ref reader, options, PropMaxUniqueTokens, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinDocCount.TryReadProperty(ref reader, options, PropMinDocCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propShardMinDocCount.TryReadProperty(ref reader, options, PropShardMinDocCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propShardSize.TryReadProperty(ref reader, options, PropShardSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSimilarityThreshold.TryReadProperty(ref reader, options, PropSimilarityThreshold, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CategorizationAnalyzer = propCategorizationAnalyzer.Value, + CategorizationFilters = propCategorizationFilters.Value, + Field = propField.Value, + MaxMatchedTokens = propMaxMatchedTokens.Value, + MaxUniqueTokens = propMaxUniqueTokens.Value, + MinDocCount = propMinDocCount.Value, + ShardMinDocCount = propShardMinDocCount.Value, + ShardSize = propShardSize.Value, + SimilarityThreshold = propSimilarityThreshold.Value, + Size = propSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCategorizationAnalyzer, value.CategorizationAnalyzer, null, null); + writer.WriteProperty(options, PropCategorizationFilters, value.CategorizationFilters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropMaxMatchedTokens, value.MaxMatchedTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxUniqueTokens, value.MaxUniqueTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinDocCount, value.MinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropShardMinDocCount, value.ShardMinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSimilarityThreshold, value.SimilarityThreshold, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CategorizeTextAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CategorizeTextAggregation.g.cs index f0ddfad8a66..bf5c9dad576 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CategorizeTextAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CategorizeTextAggregation.g.cs @@ -23,126 +23,6 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class CategorizeTextAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCategorizationAnalyzer = System.Text.Json.JsonEncodedText.Encode("categorization_analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropCategorizationFilters = System.Text.Json.JsonEncodedText.Encode("categorization_filters"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropMaxMatchedTokens = System.Text.Json.JsonEncodedText.Encode("max_matched_tokens"); - private static readonly System.Text.Json.JsonEncodedText PropMaxUniqueTokens = System.Text.Json.JsonEncodedText.Encode("max_unique_tokens"); - private static readonly System.Text.Json.JsonEncodedText PropMinDocCount = System.Text.Json.JsonEncodedText.Encode("min_doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropShardMinDocCount = System.Text.Json.JsonEncodedText.Encode("shard_min_doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"); - private static readonly System.Text.Json.JsonEncodedText PropSimilarityThreshold = System.Text.Json.JsonEncodedText.Encode("similarity_threshold"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - - public override Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCategorizationAnalyzer = default; - LocalJsonValue?> propCategorizationFilters = default; - LocalJsonValue propField = default; - LocalJsonValue propMaxMatchedTokens = default; - LocalJsonValue propMaxUniqueTokens = default; - LocalJsonValue propMinDocCount = default; - LocalJsonValue propShardMinDocCount = default; - LocalJsonValue propShardSize = default; - LocalJsonValue propSimilarityThreshold = default; - LocalJsonValue propSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCategorizationAnalyzer.TryReadProperty(ref reader, options, PropCategorizationAnalyzer, null)) - { - continue; - } - - if (propCategorizationFilters.TryReadProperty(ref reader, options, PropCategorizationFilters, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propMaxMatchedTokens.TryReadProperty(ref reader, options, PropMaxMatchedTokens, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxUniqueTokens.TryReadProperty(ref reader, options, PropMaxUniqueTokens, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinDocCount.TryReadProperty(ref reader, options, PropMinDocCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propShardMinDocCount.TryReadProperty(ref reader, options, PropShardMinDocCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propShardSize.TryReadProperty(ref reader, options, PropShardSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSimilarityThreshold.TryReadProperty(ref reader, options, PropSimilarityThreshold, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CategorizationAnalyzer = propCategorizationAnalyzer.Value, - CategorizationFilters = propCategorizationFilters.Value, - Field = propField.Value, - MaxMatchedTokens = propMaxMatchedTokens.Value, - MaxUniqueTokens = propMaxUniqueTokens.Value, - MinDocCount = propMinDocCount.Value, - ShardMinDocCount = propShardMinDocCount.Value, - ShardSize = propShardSize.Value, - SimilarityThreshold = propSimilarityThreshold.Value, - Size = propSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCategorizationAnalyzer, value.CategorizationAnalyzer, null, null); - writer.WriteProperty(options, PropCategorizationFilters, value.CategorizationFilters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropMaxMatchedTokens, value.MaxMatchedTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxUniqueTokens, value.MaxUniqueTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinDocCount, value.MinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropShardMinDocCount, value.ShardMinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSimilarityThreshold, value.SimilarityThreshold, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// A multi-bucket aggregation that groups semi-structured text into buckets. Each text @@ -151,7 +31,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// generated text like system logs. Only the first 100 analyzed tokens are used to categorize the text. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.CategorizeTextAggregationConverter))] public sealed partial class CategorizeTextAggregation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CategorizeTextAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CategorizeTextAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..8428ee1f1ee --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CategorizeTextAnalyzer.Converters.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class CategorizeTextAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject); + return selector(ref reader, options) switch + { + Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAnalyzer(reader.ReadValue(options, null)), + Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAnalyzer(reader.ReadValue(options, null)), + _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAnalyzer)}") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Tag) + { + case Elastic.Clients.Elasticsearch.UnionTag.T1: + { + writer.WriteValue(options, value.Value1, null); + break; + } + + case Elastic.Clients.Elasticsearch.UnionTag.T2: + { + writer.WriteValue(options, value.Value2, null); + break; + } + + default: + throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CategorizeTextAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CategorizeTextAnalyzer.g.cs index 791c320f240..c3278c4ad83 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CategorizeTextAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CategorizeTextAnalyzer.g.cs @@ -23,42 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class CategorizeTextAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject); - return selector(ref reader, options) switch - { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAnalyzer(reader.ReadValue(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAnalyzer(reader.ReadValue(options, null)), - _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAnalyzer)}") - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - switch (value.Tag) - { - case Elastic.Clients.Elasticsearch.UnionTag.T1: - { - writer.WriteValue(options, value.Value1, null); - break; - } - - case Elastic.Clients.Elasticsearch.UnionTag.T2: - { - writer.WriteValue(options, value.Value2, null); - break; - } - - default: - throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); - } - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.CategorizeTextAnalyzerConverter))] public sealed partial class CategorizeTextAnalyzer : Elastic.Clients.Elasticsearch.Union { public CategorizeTextAnalyzer(string value) : base(value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChiSquareHeuristic.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChiSquareHeuristic.Converters.g.cs new file mode 100644 index 00000000000..71ac51fe5e5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChiSquareHeuristic.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class ChiSquareHeuristicConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBackgroundIsSuperset = System.Text.Json.JsonEncodedText.Encode("background_is_superset"); + private static readonly System.Text.Json.JsonEncodedText PropIncludeNegatives = System.Text.Json.JsonEncodedText.Encode("include_negatives"); + + public override Elastic.Clients.Elasticsearch.Aggregations.ChiSquareHeuristic Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBackgroundIsSuperset = default; + LocalJsonValue propIncludeNegatives = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBackgroundIsSuperset.TryReadProperty(ref reader, options, PropBackgroundIsSuperset, null)) + { + continue; + } + + if (propIncludeNegatives.TryReadProperty(ref reader, options, PropIncludeNegatives, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.ChiSquareHeuristic(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BackgroundIsSuperset = propBackgroundIsSuperset.Value, + IncludeNegatives = propIncludeNegatives.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ChiSquareHeuristic value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBackgroundIsSuperset, value.BackgroundIsSuperset, null, null); + writer.WriteProperty(options, PropIncludeNegatives, value.IncludeNegatives, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChiSquareHeuristic.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChiSquareHeuristic.g.cs index 4f6be03a106..4f58db2b3d2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChiSquareHeuristic.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChiSquareHeuristic.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class ChiSquareHeuristicConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBackgroundIsSuperset = System.Text.Json.JsonEncodedText.Encode("background_is_superset"); - private static readonly System.Text.Json.JsonEncodedText PropIncludeNegatives = System.Text.Json.JsonEncodedText.Encode("include_negatives"); - - public override Elastic.Clients.Elasticsearch.Aggregations.ChiSquareHeuristic Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBackgroundIsSuperset = default; - LocalJsonValue propIncludeNegatives = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBackgroundIsSuperset.TryReadProperty(ref reader, options, PropBackgroundIsSuperset, null)) - { - continue; - } - - if (propIncludeNegatives.TryReadProperty(ref reader, options, PropIncludeNegatives, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.ChiSquareHeuristic(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BackgroundIsSuperset = propBackgroundIsSuperset.Value, - IncludeNegatives = propIncludeNegatives.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ChiSquareHeuristic value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBackgroundIsSuperset, value.BackgroundIsSuperset, null, null); - writer.WriteProperty(options, PropIncludeNegatives, value.IncludeNegatives, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.ChiSquareHeuristicConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.ChiSquareHeuristicConverter))] public sealed partial class ChiSquareHeuristic { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChildrenAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChildrenAggregate.Converters.g.cs new file mode 100644 index 00000000000..d37c098dbe1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChildrenAggregate.Converters.g.cs @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class ChildrenAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChildrenAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChildrenAggregate.g.cs index 4534ff5bef7..9e222e0b7cf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChildrenAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChildrenAggregate.g.cs @@ -23,61 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class ChildrenAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.ChildrenAggregateConverter))] public sealed partial class ChildrenAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChildrenAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChildrenAggregation.Converters.g.cs new file mode 100644 index 00000000000..cd98b80fae1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChildrenAggregation.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class ChildrenAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChildrenAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChildrenAggregation.g.cs index 526fd385fc2..a02f17b8bf5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChildrenAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChildrenAggregation.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class ChildrenAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.ChildrenAggregationConverter))] public sealed partial class ChildrenAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregate.Converters.g.cs new file mode 100644 index 00000000000..4add754e165 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregate.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class CompositeAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAfterKey = System.Text.Json.JsonEncodedText.Encode("after_key"); + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAfterKey = default; + LocalJsonValue> propBuckets = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAfterKey.TryReadProperty(ref reader, options, PropAfterKey, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AfterKey = propAfterKey.Value, + Buckets = propBuckets.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAfterKey, value.AfterKey, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregate.g.cs index 59d96ba5368..11ad98d7a43 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregate.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class CompositeAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAfterKey = System.Text.Json.JsonEncodedText.Encode("after_key"); - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAfterKey = default; - LocalJsonValue> propBuckets = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAfterKey.TryReadProperty(ref reader, options, PropAfterKey, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AfterKey = propAfterKey.Value, - Buckets = propBuckets.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAfterKey, value.AfterKey, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.CompositeAggregateConverter))] public sealed partial class CompositeAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregation.Converters.g.cs new file mode 100644 index 00000000000..78a15fcb61e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregation.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class CompositeAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAfter = System.Text.Json.JsonEncodedText.Encode("after"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropSources = System.Text.Json.JsonEncodedText.Encode("sources"); + + public override Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAfter = default; + LocalJsonValue propSize = default; + LocalJsonValue>?> propSources = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAfter.TryReadProperty(ref reader, options, PropAfter, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSources.TryReadProperty(ref reader, options, PropSources, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + After = propAfter.Value, + Size = propSize.Value, + Sources = propSources.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAfter, value.After, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSources, value.Sources, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, null))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregation.g.cs index 2f842aaa9f4..c6aa0cf35b1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregation.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class CompositeAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAfter = System.Text.Json.JsonEncodedText.Encode("after"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropSources = System.Text.Json.JsonEncodedText.Encode("sources"); - - public override Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAfter = default; - LocalJsonValue propSize = default; - LocalJsonValue>?> propSources = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAfter.TryReadProperty(ref reader, options, PropAfter, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSources.TryReadProperty(ref reader, options, PropSources, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - After = propAfter.Value, - Size = propSize.Value, - Sources = propSources.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAfter, value.After, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSources, value.Sources, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, null))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.CompositeAggregationConverter))] public sealed partial class CompositeAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregationSource.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregationSource.Converters.g.cs new file mode 100644 index 00000000000..ece6288e156 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregationSource.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class CompositeAggregationSourceConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDateHistogram = System.Text.Json.JsonEncodedText.Encode("date_histogram"); + private static readonly System.Text.Json.JsonEncodedText PropGeotileGrid = System.Text.Json.JsonEncodedText.Encode("geotile_grid"); + private static readonly System.Text.Json.JsonEncodedText PropHistogram = System.Text.Json.JsonEncodedText.Encode("histogram"); + private static readonly System.Text.Json.JsonEncodedText PropTerms = System.Text.Json.JsonEncodedText.Encode("terms"); + + public override Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDateHistogram = default; + LocalJsonValue propGeotileGrid = default; + LocalJsonValue propHistogram = default; + LocalJsonValue propTerms = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDateHistogram.TryReadProperty(ref reader, options, PropDateHistogram, null)) + { + continue; + } + + if (propGeotileGrid.TryReadProperty(ref reader, options, PropGeotileGrid, null)) + { + continue; + } + + if (propHistogram.TryReadProperty(ref reader, options, PropHistogram, null)) + { + continue; + } + + if (propTerms.TryReadProperty(ref reader, options, PropTerms, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DateHistogram = propDateHistogram.Value, + GeotileGrid = propGeotileGrid.Value, + Histogram = propHistogram.Value, + Terms = propTerms.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDateHistogram, value.DateHistogram, null, null); + writer.WriteProperty(options, PropGeotileGrid, value.GeotileGrid, null, null); + writer.WriteProperty(options, PropHistogram, value.Histogram, null, null); + writer.WriteProperty(options, PropTerms, value.Terms, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregationSource.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregationSource.g.cs index 0ed504c8942..561f1205cea 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregationSource.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregationSource.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class CompositeAggregationSourceConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDateHistogram = System.Text.Json.JsonEncodedText.Encode("date_histogram"); - private static readonly System.Text.Json.JsonEncodedText PropGeotileGrid = System.Text.Json.JsonEncodedText.Encode("geotile_grid"); - private static readonly System.Text.Json.JsonEncodedText PropHistogram = System.Text.Json.JsonEncodedText.Encode("histogram"); - private static readonly System.Text.Json.JsonEncodedText PropTerms = System.Text.Json.JsonEncodedText.Encode("terms"); - - public override Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDateHistogram = default; - LocalJsonValue propGeotileGrid = default; - LocalJsonValue propHistogram = default; - LocalJsonValue propTerms = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDateHistogram.TryReadProperty(ref reader, options, PropDateHistogram, null)) - { - continue; - } - - if (propGeotileGrid.TryReadProperty(ref reader, options, PropGeotileGrid, null)) - { - continue; - } - - if (propHistogram.TryReadProperty(ref reader, options, PropHistogram, null)) - { - continue; - } - - if (propTerms.TryReadProperty(ref reader, options, PropTerms, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DateHistogram = propDateHistogram.Value, - GeotileGrid = propGeotileGrid.Value, - Histogram = propHistogram.Value, - Terms = propTerms.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSource value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDateHistogram, value.DateHistogram, null, null); - writer.WriteProperty(options, PropGeotileGrid, value.GeotileGrid, null, null); - writer.WriteProperty(options, PropHistogram, value.Histogram, null, null); - writer.WriteProperty(options, PropTerms, value.Terms, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregationSourceConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.CompositeAggregationSourceConverter))] public sealed partial class CompositeAggregationSource { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeBucket.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeBucket.Converters.g.cs new file mode 100644 index 00000000000..f36fa4580f1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeBucket.Converters.g.cs @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class CompositeBucketConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); + + public override Elastic.Clients.Elasticsearch.Aggregations.CompositeBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue> propKey = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propKey.TryReadProperty(ref reader, options, PropKey, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.CompositeBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + Key = propKey.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CompositeBucket value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropKey, value.Key, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeBucket.g.cs index 12feb26687f..44a80f38af9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeBucket.g.cs @@ -23,61 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class CompositeBucketConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); - - public override Elastic.Clients.Elasticsearch.Aggregations.CompositeBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue> propKey = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propKey.TryReadProperty(ref reader, options, PropKey, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.CompositeBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - Key = propKey.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CompositeBucket value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropKey, value.Key, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.CompositeBucketConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.CompositeBucketConverter))] public sealed partial class CompositeBucket { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeDateHistogramAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeDateHistogramAggregation.Converters.g.cs new file mode 100644 index 00000000000..26593fc41a3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeDateHistogramAggregation.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class CompositeDateHistogramAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCalendarInterval = System.Text.Json.JsonEncodedText.Encode("calendar_interval"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFixedInterval = System.Text.Json.JsonEncodedText.Encode("fixed_interval"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropMissingBucket = System.Text.Json.JsonEncodedText.Encode("missing_bucket"); + private static readonly System.Text.Json.JsonEncodedText PropMissingOrder = System.Text.Json.JsonEncodedText.Encode("missing_order"); + private static readonly System.Text.Json.JsonEncodedText PropOffset = System.Text.Json.JsonEncodedText.Encode("offset"); + private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"); + private static readonly System.Text.Json.JsonEncodedText PropValueType = System.Text.Json.JsonEncodedText.Encode("value_type"); + + public override Elastic.Clients.Elasticsearch.Aggregations.CompositeDateHistogramAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCalendarInterval = default; + LocalJsonValue propField = default; + LocalJsonValue propFixedInterval = default; + LocalJsonValue propFormat = default; + LocalJsonValue propMissingBucket = default; + LocalJsonValue propMissingOrder = default; + LocalJsonValue propOffset = default; + LocalJsonValue propOrder = default; + LocalJsonValue propScript = default; + LocalJsonValue propTimeZone = default; + LocalJsonValue propValueType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCalendarInterval.TryReadProperty(ref reader, options, PropCalendarInterval, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFixedInterval.TryReadProperty(ref reader, options, PropFixedInterval, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propMissingBucket.TryReadProperty(ref reader, options, PropMissingBucket, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMissingOrder.TryReadProperty(ref reader, options, PropMissingOrder, static Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOffset.TryReadProperty(ref reader, options, PropOffset, null)) + { + continue; + } + + if (propOrder.TryReadProperty(ref reader, options, PropOrder, static Elastic.Clients.Elasticsearch.SortOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propTimeZone.TryReadProperty(ref reader, options, PropTimeZone, null)) + { + continue; + } + + if (propValueType.TryReadProperty(ref reader, options, PropValueType, static Elastic.Clients.Elasticsearch.Aggregations.ValueType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.CompositeDateHistogramAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CalendarInterval = propCalendarInterval.Value, + Field = propField.Value, + FixedInterval = propFixedInterval.Value, + Format = propFormat.Value, + MissingBucket = propMissingBucket.Value, + MissingOrder = propMissingOrder.Value, + Offset = propOffset.Value, + Order = propOrder.Value, + Script = propScript.Value, + TimeZone = propTimeZone.Value, + ValueType = propValueType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CompositeDateHistogramAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCalendarInterval, value.CalendarInterval, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFixedInterval, value.FixedInterval, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropMissingBucket, value.MissingBucket, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMissingOrder, value.MissingOrder, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOffset, value.Offset, null, null); + writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortOrder? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); + writer.WriteProperty(options, PropValueType, value.ValueType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.ValueType? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeDateHistogramAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeDateHistogramAggregation.g.cs index d0e83214bab..b67bb89ba8c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeDateHistogramAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeDateHistogramAggregation.g.cs @@ -23,136 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class CompositeDateHistogramAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCalendarInterval = System.Text.Json.JsonEncodedText.Encode("calendar_interval"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFixedInterval = System.Text.Json.JsonEncodedText.Encode("fixed_interval"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropMissingBucket = System.Text.Json.JsonEncodedText.Encode("missing_bucket"); - private static readonly System.Text.Json.JsonEncodedText PropMissingOrder = System.Text.Json.JsonEncodedText.Encode("missing_order"); - private static readonly System.Text.Json.JsonEncodedText PropOffset = System.Text.Json.JsonEncodedText.Encode("offset"); - private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"); - private static readonly System.Text.Json.JsonEncodedText PropValueType = System.Text.Json.JsonEncodedText.Encode("value_type"); - - public override Elastic.Clients.Elasticsearch.Aggregations.CompositeDateHistogramAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCalendarInterval = default; - LocalJsonValue propField = default; - LocalJsonValue propFixedInterval = default; - LocalJsonValue propFormat = default; - LocalJsonValue propMissingBucket = default; - LocalJsonValue propMissingOrder = default; - LocalJsonValue propOffset = default; - LocalJsonValue propOrder = default; - LocalJsonValue propScript = default; - LocalJsonValue propTimeZone = default; - LocalJsonValue propValueType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCalendarInterval.TryReadProperty(ref reader, options, PropCalendarInterval, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFixedInterval.TryReadProperty(ref reader, options, PropFixedInterval, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propMissingBucket.TryReadProperty(ref reader, options, PropMissingBucket, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMissingOrder.TryReadProperty(ref reader, options, PropMissingOrder, static Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOffset.TryReadProperty(ref reader, options, PropOffset, null)) - { - continue; - } - - if (propOrder.TryReadProperty(ref reader, options, PropOrder, static Elastic.Clients.Elasticsearch.SortOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propTimeZone.TryReadProperty(ref reader, options, PropTimeZone, null)) - { - continue; - } - - if (propValueType.TryReadProperty(ref reader, options, PropValueType, static Elastic.Clients.Elasticsearch.Aggregations.ValueType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.CompositeDateHistogramAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CalendarInterval = propCalendarInterval.Value, - Field = propField.Value, - FixedInterval = propFixedInterval.Value, - Format = propFormat.Value, - MissingBucket = propMissingBucket.Value, - MissingOrder = propMissingOrder.Value, - Offset = propOffset.Value, - Order = propOrder.Value, - Script = propScript.Value, - TimeZone = propTimeZone.Value, - ValueType = propValueType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CompositeDateHistogramAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCalendarInterval, value.CalendarInterval, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFixedInterval, value.FixedInterval, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropMissingBucket, value.MissingBucket, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMissingOrder, value.MissingOrder, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOffset, value.Offset, null, null); - writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortOrder? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); - writer.WriteProperty(options, PropValueType, value.ValueType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.ValueType? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.CompositeDateHistogramAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.CompositeDateHistogramAggregationConverter))] public sealed partial class CompositeDateHistogramAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeGeoTileGridAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeGeoTileGridAggregation.Converters.g.cs new file mode 100644 index 00000000000..b2d8a78aae5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeGeoTileGridAggregation.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class CompositeGeoTileGridAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBounds = System.Text.Json.JsonEncodedText.Encode("bounds"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropMissingBucket = System.Text.Json.JsonEncodedText.Encode("missing_bucket"); + private static readonly System.Text.Json.JsonEncodedText PropMissingOrder = System.Text.Json.JsonEncodedText.Encode("missing_order"); + private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); + private static readonly System.Text.Json.JsonEncodedText PropPrecision = System.Text.Json.JsonEncodedText.Encode("precision"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropValueType = System.Text.Json.JsonEncodedText.Encode("value_type"); + + public override Elastic.Clients.Elasticsearch.Aggregations.CompositeGeoTileGridAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBounds = default; + LocalJsonValue propField = default; + LocalJsonValue propMissingBucket = default; + LocalJsonValue propMissingOrder = default; + LocalJsonValue propOrder = default; + LocalJsonValue propPrecision = default; + LocalJsonValue propScript = default; + LocalJsonValue propValueType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBounds.TryReadProperty(ref reader, options, PropBounds, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propMissingBucket.TryReadProperty(ref reader, options, PropMissingBucket, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMissingOrder.TryReadProperty(ref reader, options, PropMissingOrder, static Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOrder.TryReadProperty(ref reader, options, PropOrder, static Elastic.Clients.Elasticsearch.SortOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPrecision.TryReadProperty(ref reader, options, PropPrecision, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propValueType.TryReadProperty(ref reader, options, PropValueType, static Elastic.Clients.Elasticsearch.Aggregations.ValueType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.CompositeGeoTileGridAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Bounds = propBounds.Value, + Field = propField.Value, + MissingBucket = propMissingBucket.Value, + MissingOrder = propMissingOrder.Value, + Order = propOrder.Value, + Precision = propPrecision.Value, + Script = propScript.Value, + ValueType = propValueType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CompositeGeoTileGridAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBounds, value.Bounds, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropMissingBucket, value.MissingBucket, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMissingOrder, value.MissingOrder, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortOrder? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPrecision, value.Precision, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropValueType, value.ValueType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.ValueType? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeGeoTileGridAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeGeoTileGridAggregation.g.cs index 9080054cb1f..a8c24a7d1bc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeGeoTileGridAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeGeoTileGridAggregation.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class CompositeGeoTileGridAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBounds = System.Text.Json.JsonEncodedText.Encode("bounds"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropMissingBucket = System.Text.Json.JsonEncodedText.Encode("missing_bucket"); - private static readonly System.Text.Json.JsonEncodedText PropMissingOrder = System.Text.Json.JsonEncodedText.Encode("missing_order"); - private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); - private static readonly System.Text.Json.JsonEncodedText PropPrecision = System.Text.Json.JsonEncodedText.Encode("precision"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropValueType = System.Text.Json.JsonEncodedText.Encode("value_type"); - - public override Elastic.Clients.Elasticsearch.Aggregations.CompositeGeoTileGridAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBounds = default; - LocalJsonValue propField = default; - LocalJsonValue propMissingBucket = default; - LocalJsonValue propMissingOrder = default; - LocalJsonValue propOrder = default; - LocalJsonValue propPrecision = default; - LocalJsonValue propScript = default; - LocalJsonValue propValueType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBounds.TryReadProperty(ref reader, options, PropBounds, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propMissingBucket.TryReadProperty(ref reader, options, PropMissingBucket, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMissingOrder.TryReadProperty(ref reader, options, PropMissingOrder, static Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOrder.TryReadProperty(ref reader, options, PropOrder, static Elastic.Clients.Elasticsearch.SortOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPrecision.TryReadProperty(ref reader, options, PropPrecision, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propValueType.TryReadProperty(ref reader, options, PropValueType, static Elastic.Clients.Elasticsearch.Aggregations.ValueType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.CompositeGeoTileGridAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Bounds = propBounds.Value, - Field = propField.Value, - MissingBucket = propMissingBucket.Value, - MissingOrder = propMissingOrder.Value, - Order = propOrder.Value, - Precision = propPrecision.Value, - Script = propScript.Value, - ValueType = propValueType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CompositeGeoTileGridAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBounds, value.Bounds, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropMissingBucket, value.MissingBucket, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMissingOrder, value.MissingOrder, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortOrder? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPrecision, value.Precision, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropValueType, value.ValueType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.ValueType? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.CompositeGeoTileGridAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.CompositeGeoTileGridAggregationConverter))] public sealed partial class CompositeGeoTileGridAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeHistogramAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeHistogramAggregation.Converters.g.cs new file mode 100644 index 00000000000..dc802253410 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeHistogramAggregation.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class CompositeHistogramAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropInterval = System.Text.Json.JsonEncodedText.Encode("interval"); + private static readonly System.Text.Json.JsonEncodedText PropMissingBucket = System.Text.Json.JsonEncodedText.Encode("missing_bucket"); + private static readonly System.Text.Json.JsonEncodedText PropMissingOrder = System.Text.Json.JsonEncodedText.Encode("missing_order"); + private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropValueType = System.Text.Json.JsonEncodedText.Encode("value_type"); + + public override Elastic.Clients.Elasticsearch.Aggregations.CompositeHistogramAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propInterval = default; + LocalJsonValue propMissingBucket = default; + LocalJsonValue propMissingOrder = default; + LocalJsonValue propOrder = default; + LocalJsonValue propScript = default; + LocalJsonValue propValueType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propInterval.TryReadProperty(ref reader, options, PropInterval, null)) + { + continue; + } + + if (propMissingBucket.TryReadProperty(ref reader, options, PropMissingBucket, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMissingOrder.TryReadProperty(ref reader, options, PropMissingOrder, static Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOrder.TryReadProperty(ref reader, options, PropOrder, static Elastic.Clients.Elasticsearch.SortOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propValueType.TryReadProperty(ref reader, options, PropValueType, static Elastic.Clients.Elasticsearch.Aggregations.ValueType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.CompositeHistogramAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Interval = propInterval.Value, + MissingBucket = propMissingBucket.Value, + MissingOrder = propMissingOrder.Value, + Order = propOrder.Value, + Script = propScript.Value, + ValueType = propValueType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CompositeHistogramAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropInterval, value.Interval, null, null); + writer.WriteProperty(options, PropMissingBucket, value.MissingBucket, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMissingOrder, value.MissingOrder, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortOrder? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropValueType, value.ValueType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.ValueType? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeHistogramAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeHistogramAggregation.g.cs index f718be19eaa..27761520435 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeHistogramAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeHistogramAggregation.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class CompositeHistogramAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropInterval = System.Text.Json.JsonEncodedText.Encode("interval"); - private static readonly System.Text.Json.JsonEncodedText PropMissingBucket = System.Text.Json.JsonEncodedText.Encode("missing_bucket"); - private static readonly System.Text.Json.JsonEncodedText PropMissingOrder = System.Text.Json.JsonEncodedText.Encode("missing_order"); - private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropValueType = System.Text.Json.JsonEncodedText.Encode("value_type"); - - public override Elastic.Clients.Elasticsearch.Aggregations.CompositeHistogramAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propInterval = default; - LocalJsonValue propMissingBucket = default; - LocalJsonValue propMissingOrder = default; - LocalJsonValue propOrder = default; - LocalJsonValue propScript = default; - LocalJsonValue propValueType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propInterval.TryReadProperty(ref reader, options, PropInterval, null)) - { - continue; - } - - if (propMissingBucket.TryReadProperty(ref reader, options, PropMissingBucket, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMissingOrder.TryReadProperty(ref reader, options, PropMissingOrder, static Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOrder.TryReadProperty(ref reader, options, PropOrder, static Elastic.Clients.Elasticsearch.SortOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propValueType.TryReadProperty(ref reader, options, PropValueType, static Elastic.Clients.Elasticsearch.Aggregations.ValueType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.CompositeHistogramAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Interval = propInterval.Value, - MissingBucket = propMissingBucket.Value, - MissingOrder = propMissingOrder.Value, - Order = propOrder.Value, - Script = propScript.Value, - ValueType = propValueType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CompositeHistogramAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropInterval, value.Interval, null, null); - writer.WriteProperty(options, PropMissingBucket, value.MissingBucket, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMissingOrder, value.MissingOrder, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortOrder? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropValueType, value.ValueType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.ValueType? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.CompositeHistogramAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.CompositeHistogramAggregationConverter))] public sealed partial class CompositeHistogramAggregation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeTermsAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeTermsAggregation.Converters.g.cs new file mode 100644 index 00000000000..7ba8004c92d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeTermsAggregation.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class CompositeTermsAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropMissingBucket = System.Text.Json.JsonEncodedText.Encode("missing_bucket"); + private static readonly System.Text.Json.JsonEncodedText PropMissingOrder = System.Text.Json.JsonEncodedText.Encode("missing_order"); + private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropValueType = System.Text.Json.JsonEncodedText.Encode("value_type"); + + public override Elastic.Clients.Elasticsearch.Aggregations.CompositeTermsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propMissingBucket = default; + LocalJsonValue propMissingOrder = default; + LocalJsonValue propOrder = default; + LocalJsonValue propScript = default; + LocalJsonValue propValueType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propMissingBucket.TryReadProperty(ref reader, options, PropMissingBucket, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMissingOrder.TryReadProperty(ref reader, options, PropMissingOrder, static Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOrder.TryReadProperty(ref reader, options, PropOrder, static Elastic.Clients.Elasticsearch.SortOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propValueType.TryReadProperty(ref reader, options, PropValueType, static Elastic.Clients.Elasticsearch.Aggregations.ValueType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.CompositeTermsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + MissingBucket = propMissingBucket.Value, + MissingOrder = propMissingOrder.Value, + Order = propOrder.Value, + Script = propScript.Value, + ValueType = propValueType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CompositeTermsAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropMissingBucket, value.MissingBucket, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMissingOrder, value.MissingOrder, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortOrder? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropValueType, value.ValueType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.ValueType? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeTermsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeTermsAggregation.g.cs index c66a65e22a5..c773ad68d09 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeTermsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeTermsAggregation.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class CompositeTermsAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropMissingBucket = System.Text.Json.JsonEncodedText.Encode("missing_bucket"); - private static readonly System.Text.Json.JsonEncodedText PropMissingOrder = System.Text.Json.JsonEncodedText.Encode("missing_order"); - private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropValueType = System.Text.Json.JsonEncodedText.Encode("value_type"); - - public override Elastic.Clients.Elasticsearch.Aggregations.CompositeTermsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propMissingBucket = default; - LocalJsonValue propMissingOrder = default; - LocalJsonValue propOrder = default; - LocalJsonValue propScript = default; - LocalJsonValue propValueType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propMissingBucket.TryReadProperty(ref reader, options, PropMissingBucket, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMissingOrder.TryReadProperty(ref reader, options, PropMissingOrder, static Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOrder.TryReadProperty(ref reader, options, PropOrder, static Elastic.Clients.Elasticsearch.SortOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propValueType.TryReadProperty(ref reader, options, PropValueType, static Elastic.Clients.Elasticsearch.Aggregations.ValueType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.CompositeTermsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - MissingBucket = propMissingBucket.Value, - MissingOrder = propMissingOrder.Value, - Order = propOrder.Value, - Script = propScript.Value, - ValueType = propValueType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CompositeTermsAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropMissingBucket, value.MissingBucket, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMissingOrder, value.MissingOrder, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortOrder? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropValueType, value.ValueType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.ValueType? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.CompositeTermsAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.CompositeTermsAggregationConverter))] public sealed partial class CompositeTermsAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CumulativeCardinalityAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CumulativeCardinalityAggregate.Converters.g.cs new file mode 100644 index 00000000000..3094fba87e5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CumulativeCardinalityAggregate.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class CumulativeCardinalityAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propMeta = default; + LocalJsonValue propValue = default; + LocalJsonValue propValueAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, null)) + { + continue; + } + + if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Meta = propMeta.Value, + Value = propValue.Value, + ValueAsString = propValueAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropValue, value.Value, null, null); + writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CumulativeCardinalityAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CumulativeCardinalityAggregate.g.cs index bed5e176958..f65dc128cb2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CumulativeCardinalityAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CumulativeCardinalityAggregate.g.cs @@ -23,69 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class CumulativeCardinalityAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propMeta = default; - LocalJsonValue propValue = default; - LocalJsonValue propValueAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, null)) - { - continue; - } - - if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Meta = propMeta.Value, - Value = propValue.Value, - ValueAsString = propValueAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropValue, value.Value, null, null); - writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Result of the cumulative_cardinality aggregation /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.CumulativeCardinalityAggregateConverter))] public sealed partial class CumulativeCardinalityAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CumulativeCardinalityAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CumulativeCardinalityAggregation.Converters.g.cs new file mode 100644 index 00000000000..7be78645a5c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CumulativeCardinalityAggregation.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class CumulativeCardinalityAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); + + public override Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucketsPath = default; + LocalJsonValue propFormat = default; + LocalJsonValue propGapPolicy = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BucketsPath = propBucketsPath.Value, + Format = propFormat.Value, + GapPolicy = propGapPolicy.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CumulativeCardinalityAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CumulativeCardinalityAggregation.g.cs index 9ed709e697d..6bfe0511d25 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CumulativeCardinalityAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CumulativeCardinalityAggregation.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class CumulativeCardinalityAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); - - public override Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBucketsPath = default; - LocalJsonValue propFormat = default; - LocalJsonValue propGapPolicy = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BucketsPath = propBucketsPath.Value, - Format = propFormat.Value, - GapPolicy = propGapPolicy.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.CumulativeCardinalityAggregationConverter))] public sealed partial class CumulativeCardinalityAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CumulativeSumAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CumulativeSumAggregation.Converters.g.cs new file mode 100644 index 00000000000..3ea4f4f5aa0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CumulativeSumAggregation.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class CumulativeSumAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); + + public override Elastic.Clients.Elasticsearch.Aggregations.CumulativeSumAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucketsPath = default; + LocalJsonValue propFormat = default; + LocalJsonValue propGapPolicy = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.CumulativeSumAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BucketsPath = propBucketsPath.Value, + Format = propFormat.Value, + GapPolicy = propGapPolicy.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CumulativeSumAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CumulativeSumAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CumulativeSumAggregation.g.cs index 5549934b46e..dab416e4d20 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CumulativeSumAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CumulativeSumAggregation.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class CumulativeSumAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); - - public override Elastic.Clients.Elasticsearch.Aggregations.CumulativeSumAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBucketsPath = default; - LocalJsonValue propFormat = default; - LocalJsonValue propGapPolicy = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.CumulativeSumAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BucketsPath = propBucketsPath.Value, - Format = propFormat.Value, - GapPolicy = propGapPolicy.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CumulativeSumAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.CumulativeSumAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.CumulativeSumAggregationConverter))] public sealed partial class CumulativeSumAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CustomCategorizeTextAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CustomCategorizeTextAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..2aac4964b45 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CustomCategorizeTextAnalyzer.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class CustomCategorizeTextAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCharFilter = System.Text.Json.JsonEncodedText.Encode("char_filter"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropTokenizer = System.Text.Json.JsonEncodedText.Encode("tokenizer"); + + public override Elastic.Clients.Elasticsearch.Aggregations.CustomCategorizeTextAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propCharFilter = default; + LocalJsonValue?> propFilter = default; + LocalJsonValue propTokenizer = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCharFilter.TryReadProperty(ref reader, options, PropCharFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTokenizer.TryReadProperty(ref reader, options, PropTokenizer, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.CustomCategorizeTextAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CharFilter = propCharFilter.Value, + Filter = propFilter.Value, + Tokenizer = propTokenizer.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CustomCategorizeTextAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCharFilter, value.CharFilter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTokenizer, value.Tokenizer, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CustomCategorizeTextAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CustomCategorizeTextAnalyzer.g.cs index 33cdff91c76..1c0428535a4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CustomCategorizeTextAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CustomCategorizeTextAnalyzer.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class CustomCategorizeTextAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCharFilter = System.Text.Json.JsonEncodedText.Encode("char_filter"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropTokenizer = System.Text.Json.JsonEncodedText.Encode("tokenizer"); - - public override Elastic.Clients.Elasticsearch.Aggregations.CustomCategorizeTextAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propCharFilter = default; - LocalJsonValue?> propFilter = default; - LocalJsonValue propTokenizer = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCharFilter.TryReadProperty(ref reader, options, PropCharFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTokenizer.TryReadProperty(ref reader, options, PropTokenizer, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.CustomCategorizeTextAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CharFilter = propCharFilter.Value, - Filter = propFilter.Value, - Tokenizer = propTokenizer.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CustomCategorizeTextAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCharFilter, value.CharFilter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTokenizer, value.Tokenizer, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.CustomCategorizeTextAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.CustomCategorizeTextAnalyzerConverter))] public sealed partial class CustomCategorizeTextAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramAggregate.Converters.g.cs new file mode 100644 index 00000000000..82358c8f731 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class DateHistogramAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBuckets = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramAggregate.g.cs index f83291d38fc..a4761355a77 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramAggregate.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class DateHistogramAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBuckets = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.DateHistogramAggregateConverter))] public sealed partial class DateHistogramAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramAggregation.Converters.g.cs new file mode 100644 index 00000000000..5fe3c6368fd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramAggregation.Converters.g.cs @@ -0,0 +1,186 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class DateHistogramAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCalendarInterval = System.Text.Json.JsonEncodedText.Encode("calendar_interval"); + private static readonly System.Text.Json.JsonEncodedText PropExtendedBounds = System.Text.Json.JsonEncodedText.Encode("extended_bounds"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFixedInterval = System.Text.Json.JsonEncodedText.Encode("fixed_interval"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropHardBounds = System.Text.Json.JsonEncodedText.Encode("hard_bounds"); + private static readonly System.Text.Json.JsonEncodedText PropInterval = System.Text.Json.JsonEncodedText.Encode("interval"); + private static readonly System.Text.Json.JsonEncodedText PropMinDocCount = System.Text.Json.JsonEncodedText.Encode("min_doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropOffset = System.Text.Json.JsonEncodedText.Encode("offset"); + private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); + private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"); + + public override Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCalendarInterval = default; + LocalJsonValue?> propExtendedBounds = default; + LocalJsonValue propField = default; + LocalJsonValue propFixedInterval = default; + LocalJsonValue propFormat = default; + LocalJsonValue?> propHardBounds = default; + LocalJsonValue propInterval = default; + LocalJsonValue propMinDocCount = default; + LocalJsonValue propMissing = default; + LocalJsonValue propOffset = default; + LocalJsonValue>?> propOrder = default; + LocalJsonValue?> propParams = default; + LocalJsonValue propScript = default; + LocalJsonValue propTimeZone = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCalendarInterval.TryReadProperty(ref reader, options, PropCalendarInterval, static Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propExtendedBounds.TryReadProperty(ref reader, options, PropExtendedBounds, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFixedInterval.TryReadProperty(ref reader, options, PropFixedInterval, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propHardBounds.TryReadProperty(ref reader, options, PropHardBounds, null)) + { + continue; + } + + if (propInterval.TryReadProperty(ref reader, options, PropInterval, null)) + { + continue; + } + + if (propMinDocCount.TryReadProperty(ref reader, options, PropMinDocCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propOffset.TryReadProperty(ref reader, options, PropOffset, null)) + { + continue; + } + + if (propOrder.TryReadProperty(ref reader, options, PropOrder, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue>(o, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null)))) + { + continue; + } + + if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propTimeZone.TryReadProperty(ref reader, options, PropTimeZone, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CalendarInterval = propCalendarInterval.Value, + ExtendedBounds = propExtendedBounds.Value, + Field = propField.Value, + FixedInterval = propFixedInterval.Value, + Format = propFormat.Value, + HardBounds = propHardBounds.Value, +#pragma warning disable CS0618 + Interval = propInterval.Value +#pragma warning restore CS0618 +, + MinDocCount = propMinDocCount.Value, + Missing = propMissing.Value, + Offset = propOffset.Value, + Order = propOrder.Value, + Params = propParams.Value, + Script = propScript.Value, + TimeZone = propTimeZone.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCalendarInterval, value.CalendarInterval, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropExtendedBounds, value.ExtendedBounds, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFixedInterval, value.FixedInterval, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropHardBounds, value.HardBounds, null, null); +#pragma warning disable CS0618 + writer.WriteProperty(options, PropInterval, value.Interval, null, null) +#pragma warning restore CS0618 + ; + writer.WriteProperty(options, PropMinDocCount, value.MinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMissing, value.Missing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropOffset, value.Offset, null, null); + writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteSingleOrManyCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null))); + writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramAggregation.g.cs index bcfa4af4e6e..e68d5930369 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramAggregation.g.cs @@ -23,169 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class DateHistogramAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCalendarInterval = System.Text.Json.JsonEncodedText.Encode("calendar_interval"); - private static readonly System.Text.Json.JsonEncodedText PropExtendedBounds = System.Text.Json.JsonEncodedText.Encode("extended_bounds"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFixedInterval = System.Text.Json.JsonEncodedText.Encode("fixed_interval"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropHardBounds = System.Text.Json.JsonEncodedText.Encode("hard_bounds"); - private static readonly System.Text.Json.JsonEncodedText PropInterval = System.Text.Json.JsonEncodedText.Encode("interval"); - private static readonly System.Text.Json.JsonEncodedText PropMinDocCount = System.Text.Json.JsonEncodedText.Encode("min_doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropOffset = System.Text.Json.JsonEncodedText.Encode("offset"); - private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); - private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"); - - public override Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCalendarInterval = default; - LocalJsonValue?> propExtendedBounds = default; - LocalJsonValue propField = default; - LocalJsonValue propFixedInterval = default; - LocalJsonValue propFormat = default; - LocalJsonValue?> propHardBounds = default; - LocalJsonValue propInterval = default; - LocalJsonValue propMinDocCount = default; - LocalJsonValue propMissing = default; - LocalJsonValue propOffset = default; - LocalJsonValue>?> propOrder = default; - LocalJsonValue?> propParams = default; - LocalJsonValue propScript = default; - LocalJsonValue propTimeZone = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCalendarInterval.TryReadProperty(ref reader, options, PropCalendarInterval, static Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propExtendedBounds.TryReadProperty(ref reader, options, PropExtendedBounds, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFixedInterval.TryReadProperty(ref reader, options, PropFixedInterval, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propHardBounds.TryReadProperty(ref reader, options, PropHardBounds, null)) - { - continue; - } - - if (propInterval.TryReadProperty(ref reader, options, PropInterval, null)) - { - continue; - } - - if (propMinDocCount.TryReadProperty(ref reader, options, PropMinDocCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propOffset.TryReadProperty(ref reader, options, PropOffset, null)) - { - continue; - } - - if (propOrder.TryReadProperty(ref reader, options, PropOrder, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue>(o, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null)))) - { - continue; - } - - if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propTimeZone.TryReadProperty(ref reader, options, PropTimeZone, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CalendarInterval = propCalendarInterval.Value, - ExtendedBounds = propExtendedBounds.Value, - Field = propField.Value, - FixedInterval = propFixedInterval.Value, - Format = propFormat.Value, - HardBounds = propHardBounds.Value, -#pragma warning disable CS0618 - Interval = propInterval.Value -#pragma warning restore CS0618 -, - MinDocCount = propMinDocCount.Value, - Missing = propMissing.Value, - Offset = propOffset.Value, - Order = propOrder.Value, - Params = propParams.Value, - Script = propScript.Value, - TimeZone = propTimeZone.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCalendarInterval, value.CalendarInterval, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropExtendedBounds, value.ExtendedBounds, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFixedInterval, value.FixedInterval, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropHardBounds, value.HardBounds, null, null); -#pragma warning disable CS0618 - writer.WriteProperty(options, PropInterval, value.Interval, null, null) -#pragma warning restore CS0618 - ; - writer.WriteProperty(options, PropMinDocCount, value.MinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMissing, value.Missing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropOffset, value.Offset, null, null); - writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteSingleOrManyCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null))); - writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.DateHistogramAggregationConverter))] public sealed partial class DateHistogramAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramBucket.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramBucket.Converters.g.cs new file mode 100644 index 00000000000..6c77ed05e3e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramBucket.Converters.g.cs @@ -0,0 +1,87 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class DateHistogramBucketConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); + private static readonly System.Text.Json.JsonEncodedText PropKeyAsString = System.Text.Json.JsonEncodedText.Encode("key_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.DateHistogramBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue propKey = default; + LocalJsonValue propKeyAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propKey.TryReadProperty(ref reader, options, PropKey, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propKeyAsString.TryReadProperty(ref reader, options, PropKeyAsString, null)) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.DateHistogramBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + Key = propKey.Value, + KeyAsString = propKeyAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.DateHistogramBucket value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropKey, value.Key, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropKeyAsString, value.KeyAsString, null, null); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramBucket.g.cs index f14d08425ac..9a833bd74b7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateHistogramBucket.g.cs @@ -23,70 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class DateHistogramBucketConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); - private static readonly System.Text.Json.JsonEncodedText PropKeyAsString = System.Text.Json.JsonEncodedText.Encode("key_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.DateHistogramBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue propKey = default; - LocalJsonValue propKeyAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propKey.TryReadProperty(ref reader, options, PropKey, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propKeyAsString.TryReadProperty(ref reader, options, PropKeyAsString, null)) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.DateHistogramBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - Key = propKey.Value, - KeyAsString = propKeyAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.DateHistogramBucket value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropKey, value.Key, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropKeyAsString, value.KeyAsString, null, null); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.DateHistogramBucketConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.DateHistogramBucketConverter))] public sealed partial class DateHistogramBucket { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeAggregate.Converters.g.cs new file mode 100644 index 00000000000..bfb8dc2b4d6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class DateRangeAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBuckets = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeAggregate.g.cs index 1eb93d44c39..a800d42a728 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeAggregate.g.cs @@ -23,61 +23,13 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class DateRangeAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBuckets = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - /// /// /// Result of a date_range aggregation. Same format as a for a range aggregation: from and to /// in buckets are milliseconds since the Epoch, represented as a floating point number. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.DateRangeAggregateConverter))] public sealed partial class DateRangeAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeAggregation.Converters.g.cs new file mode 100644 index 00000000000..98b33bd43a5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeAggregation.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class DateRangeAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropRanges = System.Text.Json.JsonEncodedText.Encode("ranges"); + private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"); + + public override Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propFormat = default; + LocalJsonValue propMissing = default; + LocalJsonValue?> propRanges = default; + LocalJsonValue propTimeZone = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (propRanges.TryReadProperty(ref reader, options, PropRanges, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTimeZone.TryReadProperty(ref reader, options, PropTimeZone, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Format = propFormat.Value, + Missing = propMissing.Value, + Ranges = propRanges.Value, + TimeZone = propTimeZone.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteProperty(options, PropRanges, value.Ranges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeAggregation.g.cs index 71c1e59c207..a5ab145ab00 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeAggregation.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class DateRangeAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropRanges = System.Text.Json.JsonEncodedText.Encode("ranges"); - private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"); - - public override Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propFormat = default; - LocalJsonValue propMissing = default; - LocalJsonValue?> propRanges = default; - LocalJsonValue propTimeZone = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) - { - continue; - } - - if (propRanges.TryReadProperty(ref reader, options, PropRanges, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTimeZone.TryReadProperty(ref reader, options, PropTimeZone, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Format = propFormat.Value, - Missing = propMissing.Value, - Ranges = propRanges.Value, - TimeZone = propTimeZone.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropMissing, value.Missing, null, null); - writer.WriteProperty(options, PropRanges, value.Ranges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.DateRangeAggregationConverter))] public sealed partial class DateRangeAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeExpression.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeExpression.Converters.g.cs new file mode 100644 index 00000000000..b21c10d8c9e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeExpression.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class DateRangeExpressionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFrom = System.Text.Json.JsonEncodedText.Encode("from"); + private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); + private static readonly System.Text.Json.JsonEncodedText PropTo = System.Text.Json.JsonEncodedText.Encode("to"); + + public override Elastic.Clients.Elasticsearch.Aggregations.DateRangeExpression Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFrom = default; + LocalJsonValue propKey = default; + LocalJsonValue propTo = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFrom.TryReadProperty(ref reader, options, PropFrom, null)) + { + continue; + } + + if (propKey.TryReadProperty(ref reader, options, PropKey, null)) + { + continue; + } + + if (propTo.TryReadProperty(ref reader, options, PropTo, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.DateRangeExpression(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + From = propFrom.Value, + Key = propKey.Value, + To = propTo.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.DateRangeExpression value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFrom, value.From, null, null); + writer.WriteProperty(options, PropKey, value.Key, null, null); + writer.WriteProperty(options, PropTo, value.To, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeExpression.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeExpression.g.cs index b0c9400a3c6..1b86f71ee47 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeExpression.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeExpression.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class DateRangeExpressionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFrom = System.Text.Json.JsonEncodedText.Encode("from"); - private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); - private static readonly System.Text.Json.JsonEncodedText PropTo = System.Text.Json.JsonEncodedText.Encode("to"); - - public override Elastic.Clients.Elasticsearch.Aggregations.DateRangeExpression Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFrom = default; - LocalJsonValue propKey = default; - LocalJsonValue propTo = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFrom.TryReadProperty(ref reader, options, PropFrom, null)) - { - continue; - } - - if (propKey.TryReadProperty(ref reader, options, PropKey, null)) - { - continue; - } - - if (propTo.TryReadProperty(ref reader, options, PropTo, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.DateRangeExpression(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - From = propFrom.Value, - Key = propKey.Value, - To = propTo.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.DateRangeExpression value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFrom, value.From, null, null); - writer.WriteProperty(options, PropKey, value.Key, null, null); - writer.WriteProperty(options, PropTo, value.To, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.DateRangeExpressionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.DateRangeExpressionConverter))] public sealed partial class DateRangeExpression { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DerivativeAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DerivativeAggregate.Converters.g.cs new file mode 100644 index 00000000000..0d741abbaf3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DerivativeAggregate.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class DerivativeAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropNormalizedValue = System.Text.Json.JsonEncodedText.Encode("normalized_value"); + private static readonly System.Text.Json.JsonEncodedText PropNormalizedValueAsString = System.Text.Json.JsonEncodedText.Encode("normalized_value_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.DerivativeAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propMeta = default; + LocalJsonValue propNormalizedValue = default; + LocalJsonValue propNormalizedValueAsString = default; + LocalJsonValue propValue = default; + LocalJsonValue propValueAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propNormalizedValue.TryReadProperty(ref reader, options, PropNormalizedValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNormalizedValueAsString.TryReadProperty(ref reader, options, PropNormalizedValueAsString, null)) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.DerivativeAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Meta = propMeta.Value, + NormalizedValue = propNormalizedValue.Value, + NormalizedValueAsString = propNormalizedValueAsString.Value, + Value = propValue.Value, + ValueAsString = propValueAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.DerivativeAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropNormalizedValue, value.NormalizedValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNormalizedValueAsString, value.NormalizedValueAsString, null, null); + writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DerivativeAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DerivativeAggregate.g.cs index f1f310eda47..a9f1da3d72f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DerivativeAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DerivativeAggregate.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class DerivativeAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropNormalizedValue = System.Text.Json.JsonEncodedText.Encode("normalized_value"); - private static readonly System.Text.Json.JsonEncodedText PropNormalizedValueAsString = System.Text.Json.JsonEncodedText.Encode("normalized_value_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.DerivativeAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propMeta = default; - LocalJsonValue propNormalizedValue = default; - LocalJsonValue propNormalizedValueAsString = default; - LocalJsonValue propValue = default; - LocalJsonValue propValueAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propNormalizedValue.TryReadProperty(ref reader, options, PropNormalizedValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNormalizedValueAsString.TryReadProperty(ref reader, options, PropNormalizedValueAsString, null)) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.DerivativeAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Meta = propMeta.Value, - NormalizedValue = propNormalizedValue.Value, - NormalizedValueAsString = propNormalizedValueAsString.Value, - Value = propValue.Value, - ValueAsString = propValueAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.DerivativeAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropNormalizedValue, value.NormalizedValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNormalizedValueAsString, value.NormalizedValueAsString, null, null); - writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.DerivativeAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.DerivativeAggregateConverter))] public sealed partial class DerivativeAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DerivativeAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DerivativeAggregation.Converters.g.cs new file mode 100644 index 00000000000..7e6da95fc91 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DerivativeAggregation.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class DerivativeAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); + + public override Elastic.Clients.Elasticsearch.Aggregations.DerivativeAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucketsPath = default; + LocalJsonValue propFormat = default; + LocalJsonValue propGapPolicy = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.DerivativeAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BucketsPath = propBucketsPath.Value, + Format = propFormat.Value, + GapPolicy = propGapPolicy.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.DerivativeAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DerivativeAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DerivativeAggregation.g.cs index 8caea294504..967b004671b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DerivativeAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DerivativeAggregation.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class DerivativeAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); - - public override Elastic.Clients.Elasticsearch.Aggregations.DerivativeAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBucketsPath = default; - LocalJsonValue propFormat = default; - LocalJsonValue propGapPolicy = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.DerivativeAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BucketsPath = propBucketsPath.Value, - Format = propFormat.Value, - GapPolicy = propGapPolicy.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.DerivativeAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.DerivativeAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.DerivativeAggregationConverter))] public sealed partial class DerivativeAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DiversifiedSamplerAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DiversifiedSamplerAggregation.Converters.g.cs new file mode 100644 index 00000000000..798c3b8d885 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DiversifiedSamplerAggregation.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class DiversifiedSamplerAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExecutionHint = System.Text.Json.JsonEncodedText.Encode("execution_hint"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropMaxDocsPerValue = System.Text.Json.JsonEncodedText.Encode("max_docs_per_value"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"); + + public override Elastic.Clients.Elasticsearch.Aggregations.DiversifiedSamplerAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExecutionHint = default; + LocalJsonValue propField = default; + LocalJsonValue propMaxDocsPerValue = default; + LocalJsonValue propScript = default; + LocalJsonValue propShardSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExecutionHint.TryReadProperty(ref reader, options, PropExecutionHint, static Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propMaxDocsPerValue.TryReadProperty(ref reader, options, PropMaxDocsPerValue, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propShardSize.TryReadProperty(ref reader, options, PropShardSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.DiversifiedSamplerAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ExecutionHint = propExecutionHint.Value, + Field = propField.Value, + MaxDocsPerValue = propMaxDocsPerValue.Value, + Script = propScript.Value, + ShardSize = propShardSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.DiversifiedSamplerAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExecutionHint, value.ExecutionHint, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropMaxDocsPerValue, value.MaxDocsPerValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DiversifiedSamplerAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DiversifiedSamplerAggregation.g.cs index 068a831781b..28db858247b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DiversifiedSamplerAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DiversifiedSamplerAggregation.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class DiversifiedSamplerAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExecutionHint = System.Text.Json.JsonEncodedText.Encode("execution_hint"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropMaxDocsPerValue = System.Text.Json.JsonEncodedText.Encode("max_docs_per_value"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"); - - public override Elastic.Clients.Elasticsearch.Aggregations.DiversifiedSamplerAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propExecutionHint = default; - LocalJsonValue propField = default; - LocalJsonValue propMaxDocsPerValue = default; - LocalJsonValue propScript = default; - LocalJsonValue propShardSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExecutionHint.TryReadProperty(ref reader, options, PropExecutionHint, static Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propMaxDocsPerValue.TryReadProperty(ref reader, options, PropMaxDocsPerValue, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propShardSize.TryReadProperty(ref reader, options, PropShardSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.DiversifiedSamplerAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ExecutionHint = propExecutionHint.Value, - Field = propField.Value, - MaxDocsPerValue = propMaxDocsPerValue.Value, - Script = propScript.Value, - ShardSize = propShardSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.DiversifiedSamplerAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExecutionHint, value.ExecutionHint, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropMaxDocsPerValue, value.MaxDocsPerValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.DiversifiedSamplerAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.DiversifiedSamplerAggregationConverter))] public sealed partial class DiversifiedSamplerAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DoubleTermsAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DoubleTermsAggregate.Converters.g.cs new file mode 100644 index 00000000000..963ccb81f26 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DoubleTermsAggregate.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class DoubleTermsAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropDocCountErrorUpperBound = System.Text.Json.JsonEncodedText.Encode("doc_count_error_upper_bound"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropSumOtherDocCount = System.Text.Json.JsonEncodedText.Encode("sum_other_doc_count"); + + public override Elastic.Clients.Elasticsearch.Aggregations.DoubleTermsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBuckets = default; + LocalJsonValue propDocCountErrorUpperBound = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propSumOtherDocCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propDocCountErrorUpperBound.TryReadProperty(ref reader, options, PropDocCountErrorUpperBound, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propSumOtherDocCount.TryReadProperty(ref reader, options, PropSumOtherDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.DoubleTermsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + DocCountErrorUpperBound = propDocCountErrorUpperBound.Value, + Meta = propMeta.Value, + SumOtherDocCount = propSumOtherDocCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.DoubleTermsAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDocCountErrorUpperBound, value.DocCountErrorUpperBound, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropSumOtherDocCount, value.SumOtherDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DoubleTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DoubleTermsAggregate.g.cs index 21f39be7ea7..3d97ef37d7c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DoubleTermsAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DoubleTermsAggregate.g.cs @@ -23,78 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class DoubleTermsAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropDocCountErrorUpperBound = System.Text.Json.JsonEncodedText.Encode("doc_count_error_upper_bound"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropSumOtherDocCount = System.Text.Json.JsonEncodedText.Encode("sum_other_doc_count"); - - public override Elastic.Clients.Elasticsearch.Aggregations.DoubleTermsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBuckets = default; - LocalJsonValue propDocCountErrorUpperBound = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propSumOtherDocCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propDocCountErrorUpperBound.TryReadProperty(ref reader, options, PropDocCountErrorUpperBound, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propSumOtherDocCount.TryReadProperty(ref reader, options, PropSumOtherDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.DoubleTermsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - DocCountErrorUpperBound = propDocCountErrorUpperBound.Value, - Meta = propMeta.Value, - SumOtherDocCount = propSumOtherDocCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.DoubleTermsAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDocCountErrorUpperBound, value.DocCountErrorUpperBound, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropSumOtherDocCount, value.SumOtherDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Result of a terms aggregation when the field is some kind of decimal number like a float, double, or distance. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.DoubleTermsAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.DoubleTermsAggregateConverter))] public sealed partial class DoubleTermsAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DoubleTermsBucket.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DoubleTermsBucket.Converters.g.cs new file mode 100644 index 00000000000..07991fc00b1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DoubleTermsBucket.Converters.g.cs @@ -0,0 +1,96 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class DoubleTermsBucketConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropDocCountErrorUpperBound = System.Text.Json.JsonEncodedText.Encode("doc_count_error_upper_bound"); + private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); + private static readonly System.Text.Json.JsonEncodedText PropKeyAsString = System.Text.Json.JsonEncodedText.Encode("key_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.DoubleTermsBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue propDocCountErrorUpperBound = default; + LocalJsonValue propKey = default; + LocalJsonValue propKeyAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propDocCountErrorUpperBound.TryReadProperty(ref reader, options, PropDocCountErrorUpperBound, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propKey.TryReadProperty(ref reader, options, PropKey, null)) + { + continue; + } + + if (propKeyAsString.TryReadProperty(ref reader, options, PropKeyAsString, null)) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.DoubleTermsBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + DocCountErrorUpperBound = propDocCountErrorUpperBound.Value, + Key = propKey.Value, + KeyAsString = propKeyAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.DoubleTermsBucket value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropDocCountErrorUpperBound, value.DocCountErrorUpperBound, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropKey, value.Key, null, null); + writer.WriteProperty(options, PropKeyAsString, value.KeyAsString, null, null); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DoubleTermsBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DoubleTermsBucket.g.cs index 1d136f6238b..f47415d8979 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DoubleTermsBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DoubleTermsBucket.g.cs @@ -23,79 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class DoubleTermsBucketConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropDocCountErrorUpperBound = System.Text.Json.JsonEncodedText.Encode("doc_count_error_upper_bound"); - private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); - private static readonly System.Text.Json.JsonEncodedText PropKeyAsString = System.Text.Json.JsonEncodedText.Encode("key_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.DoubleTermsBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue propDocCountErrorUpperBound = default; - LocalJsonValue propKey = default; - LocalJsonValue propKeyAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propDocCountErrorUpperBound.TryReadProperty(ref reader, options, PropDocCountErrorUpperBound, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propKey.TryReadProperty(ref reader, options, PropKey, null)) - { - continue; - } - - if (propKeyAsString.TryReadProperty(ref reader, options, PropKeyAsString, null)) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.DoubleTermsBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - DocCountErrorUpperBound = propDocCountErrorUpperBound.Value, - Key = propKey.Value, - KeyAsString = propKeyAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.DoubleTermsBucket value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropDocCountErrorUpperBound, value.DocCountErrorUpperBound, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropKey, value.Key, null, null); - writer.WriteProperty(options, PropKeyAsString, value.KeyAsString, null, null); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.DoubleTermsBucketConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.DoubleTermsBucketConverter))] public sealed partial class DoubleTermsBucket { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedBounds.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedBounds.Converters.g.cs new file mode 100644 index 00000000000..0928ae5d28c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedBounds.Converters.g.cs @@ -0,0 +1,88 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class ExtendedBoundsConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); + + public override Elastic.Clients.Elasticsearch.Aggregations.ExtendedBounds Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMax = default; + LocalJsonValue propMin = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMax.TryReadProperty(ref reader, options, PropMax, null)) + { + continue; + } + + if (propMin.TryReadProperty(ref reader, options, PropMin, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.ExtendedBounds(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Max = propMax.Value, + Min = propMin.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ExtendedBounds value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMax, value.Max, null, null); + writer.WriteProperty(options, PropMin, value.Min, null, null); + writer.WriteEndObject(); + } +} + +public sealed partial class ExtendedBoundsConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(ExtendedBounds<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(ExtendedBoundsConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedBounds.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedBounds.g.cs index 9e0d9521609..dc30579192d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedBounds.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedBounds.g.cs @@ -23,71 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class ExtendedBoundsConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); - private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); - - public override Elastic.Clients.Elasticsearch.Aggregations.ExtendedBounds Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMax = default; - LocalJsonValue propMin = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMax.TryReadProperty(ref reader, options, PropMax, null)) - { - continue; - } - - if (propMin.TryReadProperty(ref reader, options, PropMin, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.ExtendedBounds(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Max = propMax.Value, - Min = propMin.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ExtendedBounds value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMax, value.Max, null, null); - writer.WriteProperty(options, PropMin, value.Min, null, null); - writer.WriteEndObject(); - } -} - -internal sealed partial class ExtendedBoundsConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(ExtendedBounds<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(ExtendedBoundsConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.ExtendedBoundsConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.ExtendedBoundsConverterFactory))] public sealed partial class ExtendedBounds { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregate.Converters.g.cs new file mode 100644 index 00000000000..5dc367edb20 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregate.Converters.g.cs @@ -0,0 +1,270 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class ExtendedStatsAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvg = System.Text.Json.JsonEncodedText.Encode("avg"); + private static readonly System.Text.Json.JsonEncodedText PropAvgAsString = System.Text.Json.JsonEncodedText.Encode("avg_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText PropMaxAsString = System.Text.Json.JsonEncodedText.Encode("max_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); + private static readonly System.Text.Json.JsonEncodedText PropMinAsString = System.Text.Json.JsonEncodedText.Encode("min_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropStdDeviation = System.Text.Json.JsonEncodedText.Encode("std_deviation"); + private static readonly System.Text.Json.JsonEncodedText PropStdDeviationAsString = System.Text.Json.JsonEncodedText.Encode("std_deviation_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropStdDeviationBounds = System.Text.Json.JsonEncodedText.Encode("std_deviation_bounds"); + private static readonly System.Text.Json.JsonEncodedText PropStdDeviationBoundsAsString = System.Text.Json.JsonEncodedText.Encode("std_deviation_bounds_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropStdDeviationPopulation = System.Text.Json.JsonEncodedText.Encode("std_deviation_population"); + private static readonly System.Text.Json.JsonEncodedText PropStdDeviationSampling = System.Text.Json.JsonEncodedText.Encode("std_deviation_sampling"); + private static readonly System.Text.Json.JsonEncodedText PropSum = System.Text.Json.JsonEncodedText.Encode("sum"); + private static readonly System.Text.Json.JsonEncodedText PropSumAsString = System.Text.Json.JsonEncodedText.Encode("sum_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropSumOfSquares = System.Text.Json.JsonEncodedText.Encode("sum_of_squares"); + private static readonly System.Text.Json.JsonEncodedText PropSumOfSquaresAsString = System.Text.Json.JsonEncodedText.Encode("sum_of_squares_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropVariance = System.Text.Json.JsonEncodedText.Encode("variance"); + private static readonly System.Text.Json.JsonEncodedText PropVarianceAsString = System.Text.Json.JsonEncodedText.Encode("variance_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropVariancePopulation = System.Text.Json.JsonEncodedText.Encode("variance_population"); + private static readonly System.Text.Json.JsonEncodedText PropVariancePopulationAsString = System.Text.Json.JsonEncodedText.Encode("variance_population_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropVarianceSampling = System.Text.Json.JsonEncodedText.Encode("variance_sampling"); + private static readonly System.Text.Json.JsonEncodedText PropVarianceSamplingAsString = System.Text.Json.JsonEncodedText.Encode("variance_sampling_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvg = default; + LocalJsonValue propAvgAsString = default; + LocalJsonValue propCount = default; + LocalJsonValue propMax = default; + LocalJsonValue propMaxAsString = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propMin = default; + LocalJsonValue propMinAsString = default; + LocalJsonValue propStdDeviation = default; + LocalJsonValue propStdDeviationAsString = default; + LocalJsonValue propStdDeviationBounds = default; + LocalJsonValue propStdDeviationBoundsAsString = default; + LocalJsonValue propStdDeviationPopulation = default; + LocalJsonValue propStdDeviationSampling = default; + LocalJsonValue propSum = default; + LocalJsonValue propSumAsString = default; + LocalJsonValue propSumOfSquares = default; + LocalJsonValue propSumOfSquaresAsString = default; + LocalJsonValue propVariance = default; + LocalJsonValue propVarianceAsString = default; + LocalJsonValue propVariancePopulation = default; + LocalJsonValue propVariancePopulationAsString = default; + LocalJsonValue propVarianceSampling = default; + LocalJsonValue propVarianceSamplingAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvg.TryReadProperty(ref reader, options, PropAvg, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propAvgAsString.TryReadProperty(ref reader, options, PropAvgAsString, null)) + { + continue; + } + + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propMax.TryReadProperty(ref reader, options, PropMax, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxAsString.TryReadProperty(ref reader, options, PropMaxAsString, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propMin.TryReadProperty(ref reader, options, PropMin, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinAsString.TryReadProperty(ref reader, options, PropMinAsString, null)) + { + continue; + } + + if (propStdDeviation.TryReadProperty(ref reader, options, PropStdDeviation, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propStdDeviationAsString.TryReadProperty(ref reader, options, PropStdDeviationAsString, null)) + { + continue; + } + + if (propStdDeviationBounds.TryReadProperty(ref reader, options, PropStdDeviationBounds, null)) + { + continue; + } + + if (propStdDeviationBoundsAsString.TryReadProperty(ref reader, options, PropStdDeviationBoundsAsString, null)) + { + continue; + } + + if (propStdDeviationPopulation.TryReadProperty(ref reader, options, PropStdDeviationPopulation, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propStdDeviationSampling.TryReadProperty(ref reader, options, PropStdDeviationSampling, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSum.TryReadProperty(ref reader, options, PropSum, null)) + { + continue; + } + + if (propSumAsString.TryReadProperty(ref reader, options, PropSumAsString, null)) + { + continue; + } + + if (propSumOfSquares.TryReadProperty(ref reader, options, PropSumOfSquares, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSumOfSquaresAsString.TryReadProperty(ref reader, options, PropSumOfSquaresAsString, null)) + { + continue; + } + + if (propVariance.TryReadProperty(ref reader, options, PropVariance, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propVarianceAsString.TryReadProperty(ref reader, options, PropVarianceAsString, null)) + { + continue; + } + + if (propVariancePopulation.TryReadProperty(ref reader, options, PropVariancePopulation, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propVariancePopulationAsString.TryReadProperty(ref reader, options, PropVariancePopulationAsString, null)) + { + continue; + } + + if (propVarianceSampling.TryReadProperty(ref reader, options, PropVarianceSampling, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propVarianceSamplingAsString.TryReadProperty(ref reader, options, PropVarianceSamplingAsString, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Avg = propAvg.Value, + AvgAsString = propAvgAsString.Value, + Count = propCount.Value, + Max = propMax.Value, + MaxAsString = propMaxAsString.Value, + Meta = propMeta.Value, + Min = propMin.Value, + MinAsString = propMinAsString.Value, + StdDeviation = propStdDeviation.Value, + StdDeviationAsString = propStdDeviationAsString.Value, + StdDeviationBounds = propStdDeviationBounds.Value, + StdDeviationBoundsAsString = propStdDeviationBoundsAsString.Value, + StdDeviationPopulation = propStdDeviationPopulation.Value, + StdDeviationSampling = propStdDeviationSampling.Value, + Sum = propSum.Value, + SumAsString = propSumAsString.Value, + SumOfSquares = propSumOfSquares.Value, + SumOfSquaresAsString = propSumOfSquaresAsString.Value, + Variance = propVariance.Value, + VarianceAsString = propVarianceAsString.Value, + VariancePopulation = propVariancePopulation.Value, + VariancePopulationAsString = propVariancePopulationAsString.Value, + VarianceSampling = propVarianceSampling.Value, + VarianceSamplingAsString = propVarianceSamplingAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvg, value.Avg, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropAvgAsString, value.AvgAsString, null, null); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropMax, value.Max, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxAsString, value.MaxAsString, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropMin, value.Min, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinAsString, value.MinAsString, null, null); + writer.WriteProperty(options, PropStdDeviation, value.StdDeviation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropStdDeviationAsString, value.StdDeviationAsString, null, null); + writer.WriteProperty(options, PropStdDeviationBounds, value.StdDeviationBounds, null, null); + writer.WriteProperty(options, PropStdDeviationBoundsAsString, value.StdDeviationBoundsAsString, null, null); + writer.WriteProperty(options, PropStdDeviationPopulation, value.StdDeviationPopulation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropStdDeviationSampling, value.StdDeviationSampling, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSum, value.Sum, null, null); + writer.WriteProperty(options, PropSumAsString, value.SumAsString, null, null); + writer.WriteProperty(options, PropSumOfSquares, value.SumOfSquares, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSumOfSquaresAsString, value.SumOfSquaresAsString, null, null); + writer.WriteProperty(options, PropVariance, value.Variance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVarianceAsString, value.VarianceAsString, null, null); + writer.WriteProperty(options, PropVariancePopulation, value.VariancePopulation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVariancePopulationAsString, value.VariancePopulationAsString, null, null); + writer.WriteProperty(options, PropVarianceSampling, value.VarianceSampling, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVarianceSamplingAsString, value.VarianceSamplingAsString, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregate.g.cs index 09b97d72359..fc108e5f563 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregate.g.cs @@ -23,253 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class ExtendedStatsAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvg = System.Text.Json.JsonEncodedText.Encode("avg"); - private static readonly System.Text.Json.JsonEncodedText PropAvgAsString = System.Text.Json.JsonEncodedText.Encode("avg_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); - private static readonly System.Text.Json.JsonEncodedText PropMaxAsString = System.Text.Json.JsonEncodedText.Encode("max_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); - private static readonly System.Text.Json.JsonEncodedText PropMinAsString = System.Text.Json.JsonEncodedText.Encode("min_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropStdDeviation = System.Text.Json.JsonEncodedText.Encode("std_deviation"); - private static readonly System.Text.Json.JsonEncodedText PropStdDeviationAsString = System.Text.Json.JsonEncodedText.Encode("std_deviation_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropStdDeviationBounds = System.Text.Json.JsonEncodedText.Encode("std_deviation_bounds"); - private static readonly System.Text.Json.JsonEncodedText PropStdDeviationBoundsAsString = System.Text.Json.JsonEncodedText.Encode("std_deviation_bounds_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropStdDeviationPopulation = System.Text.Json.JsonEncodedText.Encode("std_deviation_population"); - private static readonly System.Text.Json.JsonEncodedText PropStdDeviationSampling = System.Text.Json.JsonEncodedText.Encode("std_deviation_sampling"); - private static readonly System.Text.Json.JsonEncodedText PropSum = System.Text.Json.JsonEncodedText.Encode("sum"); - private static readonly System.Text.Json.JsonEncodedText PropSumAsString = System.Text.Json.JsonEncodedText.Encode("sum_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropSumOfSquares = System.Text.Json.JsonEncodedText.Encode("sum_of_squares"); - private static readonly System.Text.Json.JsonEncodedText PropSumOfSquaresAsString = System.Text.Json.JsonEncodedText.Encode("sum_of_squares_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropVariance = System.Text.Json.JsonEncodedText.Encode("variance"); - private static readonly System.Text.Json.JsonEncodedText PropVarianceAsString = System.Text.Json.JsonEncodedText.Encode("variance_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropVariancePopulation = System.Text.Json.JsonEncodedText.Encode("variance_population"); - private static readonly System.Text.Json.JsonEncodedText PropVariancePopulationAsString = System.Text.Json.JsonEncodedText.Encode("variance_population_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropVarianceSampling = System.Text.Json.JsonEncodedText.Encode("variance_sampling"); - private static readonly System.Text.Json.JsonEncodedText PropVarianceSamplingAsString = System.Text.Json.JsonEncodedText.Encode("variance_sampling_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvg = default; - LocalJsonValue propAvgAsString = default; - LocalJsonValue propCount = default; - LocalJsonValue propMax = default; - LocalJsonValue propMaxAsString = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propMin = default; - LocalJsonValue propMinAsString = default; - LocalJsonValue propStdDeviation = default; - LocalJsonValue propStdDeviationAsString = default; - LocalJsonValue propStdDeviationBounds = default; - LocalJsonValue propStdDeviationBoundsAsString = default; - LocalJsonValue propStdDeviationPopulation = default; - LocalJsonValue propStdDeviationSampling = default; - LocalJsonValue propSum = default; - LocalJsonValue propSumAsString = default; - LocalJsonValue propSumOfSquares = default; - LocalJsonValue propSumOfSquaresAsString = default; - LocalJsonValue propVariance = default; - LocalJsonValue propVarianceAsString = default; - LocalJsonValue propVariancePopulation = default; - LocalJsonValue propVariancePopulationAsString = default; - LocalJsonValue propVarianceSampling = default; - LocalJsonValue propVarianceSamplingAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvg.TryReadProperty(ref reader, options, PropAvg, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propAvgAsString.TryReadProperty(ref reader, options, PropAvgAsString, null)) - { - continue; - } - - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propMax.TryReadProperty(ref reader, options, PropMax, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxAsString.TryReadProperty(ref reader, options, PropMaxAsString, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propMin.TryReadProperty(ref reader, options, PropMin, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinAsString.TryReadProperty(ref reader, options, PropMinAsString, null)) - { - continue; - } - - if (propStdDeviation.TryReadProperty(ref reader, options, PropStdDeviation, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propStdDeviationAsString.TryReadProperty(ref reader, options, PropStdDeviationAsString, null)) - { - continue; - } - - if (propStdDeviationBounds.TryReadProperty(ref reader, options, PropStdDeviationBounds, null)) - { - continue; - } - - if (propStdDeviationBoundsAsString.TryReadProperty(ref reader, options, PropStdDeviationBoundsAsString, null)) - { - continue; - } - - if (propStdDeviationPopulation.TryReadProperty(ref reader, options, PropStdDeviationPopulation, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propStdDeviationSampling.TryReadProperty(ref reader, options, PropStdDeviationSampling, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSum.TryReadProperty(ref reader, options, PropSum, null)) - { - continue; - } - - if (propSumAsString.TryReadProperty(ref reader, options, PropSumAsString, null)) - { - continue; - } - - if (propSumOfSquares.TryReadProperty(ref reader, options, PropSumOfSquares, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSumOfSquaresAsString.TryReadProperty(ref reader, options, PropSumOfSquaresAsString, null)) - { - continue; - } - - if (propVariance.TryReadProperty(ref reader, options, PropVariance, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propVarianceAsString.TryReadProperty(ref reader, options, PropVarianceAsString, null)) - { - continue; - } - - if (propVariancePopulation.TryReadProperty(ref reader, options, PropVariancePopulation, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propVariancePopulationAsString.TryReadProperty(ref reader, options, PropVariancePopulationAsString, null)) - { - continue; - } - - if (propVarianceSampling.TryReadProperty(ref reader, options, PropVarianceSampling, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propVarianceSamplingAsString.TryReadProperty(ref reader, options, PropVarianceSamplingAsString, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Avg = propAvg.Value, - AvgAsString = propAvgAsString.Value, - Count = propCount.Value, - Max = propMax.Value, - MaxAsString = propMaxAsString.Value, - Meta = propMeta.Value, - Min = propMin.Value, - MinAsString = propMinAsString.Value, - StdDeviation = propStdDeviation.Value, - StdDeviationAsString = propStdDeviationAsString.Value, - StdDeviationBounds = propStdDeviationBounds.Value, - StdDeviationBoundsAsString = propStdDeviationBoundsAsString.Value, - StdDeviationPopulation = propStdDeviationPopulation.Value, - StdDeviationSampling = propStdDeviationSampling.Value, - Sum = propSum.Value, - SumAsString = propSumAsString.Value, - SumOfSquares = propSumOfSquares.Value, - SumOfSquaresAsString = propSumOfSquaresAsString.Value, - Variance = propVariance.Value, - VarianceAsString = propVarianceAsString.Value, - VariancePopulation = propVariancePopulation.Value, - VariancePopulationAsString = propVariancePopulationAsString.Value, - VarianceSampling = propVarianceSampling.Value, - VarianceSamplingAsString = propVarianceSamplingAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvg, value.Avg, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropAvgAsString, value.AvgAsString, null, null); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropMax, value.Max, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxAsString, value.MaxAsString, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropMin, value.Min, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinAsString, value.MinAsString, null, null); - writer.WriteProperty(options, PropStdDeviation, value.StdDeviation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropStdDeviationAsString, value.StdDeviationAsString, null, null); - writer.WriteProperty(options, PropStdDeviationBounds, value.StdDeviationBounds, null, null); - writer.WriteProperty(options, PropStdDeviationBoundsAsString, value.StdDeviationBoundsAsString, null, null); - writer.WriteProperty(options, PropStdDeviationPopulation, value.StdDeviationPopulation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropStdDeviationSampling, value.StdDeviationSampling, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSum, value.Sum, null, null); - writer.WriteProperty(options, PropSumAsString, value.SumAsString, null, null); - writer.WriteProperty(options, PropSumOfSquares, value.SumOfSquares, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSumOfSquaresAsString, value.SumOfSquaresAsString, null, null); - writer.WriteProperty(options, PropVariance, value.Variance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropVarianceAsString, value.VarianceAsString, null, null); - writer.WriteProperty(options, PropVariancePopulation, value.VariancePopulation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropVariancePopulationAsString, value.VariancePopulationAsString, null, null); - writer.WriteProperty(options, PropVarianceSampling, value.VarianceSampling, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropVarianceSamplingAsString, value.VarianceSamplingAsString, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.ExtendedStatsAggregateConverter))] public sealed partial class ExtendedStatsAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregation.Converters.g.cs new file mode 100644 index 00000000000..42473401ffe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregation.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class ExtendedStatsAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropSigma = System.Text.Json.JsonEncodedText.Encode("sigma"); + + public override Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propFormat = default; + LocalJsonValue propMissing = default; + LocalJsonValue propScript = default; + LocalJsonValue propSigma = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propSigma.TryReadProperty(ref reader, options, PropSigma, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Format = propFormat.Value, + Missing = propMissing.Value, + Script = propScript.Value, + Sigma = propSigma.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropSigma, value.Sigma, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregation.g.cs index 739830dc43b..c2e9fc36c58 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregation.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class ExtendedStatsAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropSigma = System.Text.Json.JsonEncodedText.Encode("sigma"); - - public override Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propFormat = default; - LocalJsonValue propMissing = default; - LocalJsonValue propScript = default; - LocalJsonValue propSigma = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propSigma.TryReadProperty(ref reader, options, PropSigma, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Format = propFormat.Value, - Missing = propMissing.Value, - Script = propScript.Value, - Sigma = propSigma.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropMissing, value.Missing, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropSigma, value.Sigma, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.ExtendedStatsAggregationConverter))] public sealed partial class ExtendedStatsAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsBucketAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsBucketAggregate.Converters.g.cs new file mode 100644 index 00000000000..279a3552ad8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsBucketAggregate.Converters.g.cs @@ -0,0 +1,270 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class ExtendedStatsBucketAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvg = System.Text.Json.JsonEncodedText.Encode("avg"); + private static readonly System.Text.Json.JsonEncodedText PropAvgAsString = System.Text.Json.JsonEncodedText.Encode("avg_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText PropMaxAsString = System.Text.Json.JsonEncodedText.Encode("max_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); + private static readonly System.Text.Json.JsonEncodedText PropMinAsString = System.Text.Json.JsonEncodedText.Encode("min_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropStdDeviation = System.Text.Json.JsonEncodedText.Encode("std_deviation"); + private static readonly System.Text.Json.JsonEncodedText PropStdDeviationAsString = System.Text.Json.JsonEncodedText.Encode("std_deviation_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropStdDeviationBounds = System.Text.Json.JsonEncodedText.Encode("std_deviation_bounds"); + private static readonly System.Text.Json.JsonEncodedText PropStdDeviationBoundsAsString = System.Text.Json.JsonEncodedText.Encode("std_deviation_bounds_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropStdDeviationPopulation = System.Text.Json.JsonEncodedText.Encode("std_deviation_population"); + private static readonly System.Text.Json.JsonEncodedText PropStdDeviationSampling = System.Text.Json.JsonEncodedText.Encode("std_deviation_sampling"); + private static readonly System.Text.Json.JsonEncodedText PropSum = System.Text.Json.JsonEncodedText.Encode("sum"); + private static readonly System.Text.Json.JsonEncodedText PropSumAsString = System.Text.Json.JsonEncodedText.Encode("sum_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropSumOfSquares = System.Text.Json.JsonEncodedText.Encode("sum_of_squares"); + private static readonly System.Text.Json.JsonEncodedText PropSumOfSquaresAsString = System.Text.Json.JsonEncodedText.Encode("sum_of_squares_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropVariance = System.Text.Json.JsonEncodedText.Encode("variance"); + private static readonly System.Text.Json.JsonEncodedText PropVarianceAsString = System.Text.Json.JsonEncodedText.Encode("variance_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropVariancePopulation = System.Text.Json.JsonEncodedText.Encode("variance_population"); + private static readonly System.Text.Json.JsonEncodedText PropVariancePopulationAsString = System.Text.Json.JsonEncodedText.Encode("variance_population_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropVarianceSampling = System.Text.Json.JsonEncodedText.Encode("variance_sampling"); + private static readonly System.Text.Json.JsonEncodedText PropVarianceSamplingAsString = System.Text.Json.JsonEncodedText.Encode("variance_sampling_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsBucketAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvg = default; + LocalJsonValue propAvgAsString = default; + LocalJsonValue propCount = default; + LocalJsonValue propMax = default; + LocalJsonValue propMaxAsString = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propMin = default; + LocalJsonValue propMinAsString = default; + LocalJsonValue propStdDeviation = default; + LocalJsonValue propStdDeviationAsString = default; + LocalJsonValue propStdDeviationBounds = default; + LocalJsonValue propStdDeviationBoundsAsString = default; + LocalJsonValue propStdDeviationPopulation = default; + LocalJsonValue propStdDeviationSampling = default; + LocalJsonValue propSum = default; + LocalJsonValue propSumAsString = default; + LocalJsonValue propSumOfSquares = default; + LocalJsonValue propSumOfSquaresAsString = default; + LocalJsonValue propVariance = default; + LocalJsonValue propVarianceAsString = default; + LocalJsonValue propVariancePopulation = default; + LocalJsonValue propVariancePopulationAsString = default; + LocalJsonValue propVarianceSampling = default; + LocalJsonValue propVarianceSamplingAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvg.TryReadProperty(ref reader, options, PropAvg, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propAvgAsString.TryReadProperty(ref reader, options, PropAvgAsString, null)) + { + continue; + } + + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propMax.TryReadProperty(ref reader, options, PropMax, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxAsString.TryReadProperty(ref reader, options, PropMaxAsString, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propMin.TryReadProperty(ref reader, options, PropMin, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinAsString.TryReadProperty(ref reader, options, PropMinAsString, null)) + { + continue; + } + + if (propStdDeviation.TryReadProperty(ref reader, options, PropStdDeviation, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propStdDeviationAsString.TryReadProperty(ref reader, options, PropStdDeviationAsString, null)) + { + continue; + } + + if (propStdDeviationBounds.TryReadProperty(ref reader, options, PropStdDeviationBounds, null)) + { + continue; + } + + if (propStdDeviationBoundsAsString.TryReadProperty(ref reader, options, PropStdDeviationBoundsAsString, null)) + { + continue; + } + + if (propStdDeviationPopulation.TryReadProperty(ref reader, options, PropStdDeviationPopulation, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propStdDeviationSampling.TryReadProperty(ref reader, options, PropStdDeviationSampling, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSum.TryReadProperty(ref reader, options, PropSum, null)) + { + continue; + } + + if (propSumAsString.TryReadProperty(ref reader, options, PropSumAsString, null)) + { + continue; + } + + if (propSumOfSquares.TryReadProperty(ref reader, options, PropSumOfSquares, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSumOfSquaresAsString.TryReadProperty(ref reader, options, PropSumOfSquaresAsString, null)) + { + continue; + } + + if (propVariance.TryReadProperty(ref reader, options, PropVariance, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propVarianceAsString.TryReadProperty(ref reader, options, PropVarianceAsString, null)) + { + continue; + } + + if (propVariancePopulation.TryReadProperty(ref reader, options, PropVariancePopulation, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propVariancePopulationAsString.TryReadProperty(ref reader, options, PropVariancePopulationAsString, null)) + { + continue; + } + + if (propVarianceSampling.TryReadProperty(ref reader, options, PropVarianceSampling, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propVarianceSamplingAsString.TryReadProperty(ref reader, options, PropVarianceSamplingAsString, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsBucketAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Avg = propAvg.Value, + AvgAsString = propAvgAsString.Value, + Count = propCount.Value, + Max = propMax.Value, + MaxAsString = propMaxAsString.Value, + Meta = propMeta.Value, + Min = propMin.Value, + MinAsString = propMinAsString.Value, + StdDeviation = propStdDeviation.Value, + StdDeviationAsString = propStdDeviationAsString.Value, + StdDeviationBounds = propStdDeviationBounds.Value, + StdDeviationBoundsAsString = propStdDeviationBoundsAsString.Value, + StdDeviationPopulation = propStdDeviationPopulation.Value, + StdDeviationSampling = propStdDeviationSampling.Value, + Sum = propSum.Value, + SumAsString = propSumAsString.Value, + SumOfSquares = propSumOfSquares.Value, + SumOfSquaresAsString = propSumOfSquaresAsString.Value, + Variance = propVariance.Value, + VarianceAsString = propVarianceAsString.Value, + VariancePopulation = propVariancePopulation.Value, + VariancePopulationAsString = propVariancePopulationAsString.Value, + VarianceSampling = propVarianceSampling.Value, + VarianceSamplingAsString = propVarianceSamplingAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsBucketAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvg, value.Avg, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropAvgAsString, value.AvgAsString, null, null); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropMax, value.Max, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxAsString, value.MaxAsString, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropMin, value.Min, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinAsString, value.MinAsString, null, null); + writer.WriteProperty(options, PropStdDeviation, value.StdDeviation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropStdDeviationAsString, value.StdDeviationAsString, null, null); + writer.WriteProperty(options, PropStdDeviationBounds, value.StdDeviationBounds, null, null); + writer.WriteProperty(options, PropStdDeviationBoundsAsString, value.StdDeviationBoundsAsString, null, null); + writer.WriteProperty(options, PropStdDeviationPopulation, value.StdDeviationPopulation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropStdDeviationSampling, value.StdDeviationSampling, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSum, value.Sum, null, null); + writer.WriteProperty(options, PropSumAsString, value.SumAsString, null, null); + writer.WriteProperty(options, PropSumOfSquares, value.SumOfSquares, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSumOfSquaresAsString, value.SumOfSquaresAsString, null, null); + writer.WriteProperty(options, PropVariance, value.Variance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVarianceAsString, value.VarianceAsString, null, null); + writer.WriteProperty(options, PropVariancePopulation, value.VariancePopulation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVariancePopulationAsString, value.VariancePopulationAsString, null, null); + writer.WriteProperty(options, PropVarianceSampling, value.VarianceSampling, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVarianceSamplingAsString, value.VarianceSamplingAsString, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsBucketAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsBucketAggregate.g.cs index ce73774100a..fbaa06abe53 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsBucketAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsBucketAggregate.g.cs @@ -23,253 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class ExtendedStatsBucketAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvg = System.Text.Json.JsonEncodedText.Encode("avg"); - private static readonly System.Text.Json.JsonEncodedText PropAvgAsString = System.Text.Json.JsonEncodedText.Encode("avg_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); - private static readonly System.Text.Json.JsonEncodedText PropMaxAsString = System.Text.Json.JsonEncodedText.Encode("max_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); - private static readonly System.Text.Json.JsonEncodedText PropMinAsString = System.Text.Json.JsonEncodedText.Encode("min_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropStdDeviation = System.Text.Json.JsonEncodedText.Encode("std_deviation"); - private static readonly System.Text.Json.JsonEncodedText PropStdDeviationAsString = System.Text.Json.JsonEncodedText.Encode("std_deviation_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropStdDeviationBounds = System.Text.Json.JsonEncodedText.Encode("std_deviation_bounds"); - private static readonly System.Text.Json.JsonEncodedText PropStdDeviationBoundsAsString = System.Text.Json.JsonEncodedText.Encode("std_deviation_bounds_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropStdDeviationPopulation = System.Text.Json.JsonEncodedText.Encode("std_deviation_population"); - private static readonly System.Text.Json.JsonEncodedText PropStdDeviationSampling = System.Text.Json.JsonEncodedText.Encode("std_deviation_sampling"); - private static readonly System.Text.Json.JsonEncodedText PropSum = System.Text.Json.JsonEncodedText.Encode("sum"); - private static readonly System.Text.Json.JsonEncodedText PropSumAsString = System.Text.Json.JsonEncodedText.Encode("sum_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropSumOfSquares = System.Text.Json.JsonEncodedText.Encode("sum_of_squares"); - private static readonly System.Text.Json.JsonEncodedText PropSumOfSquaresAsString = System.Text.Json.JsonEncodedText.Encode("sum_of_squares_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropVariance = System.Text.Json.JsonEncodedText.Encode("variance"); - private static readonly System.Text.Json.JsonEncodedText PropVarianceAsString = System.Text.Json.JsonEncodedText.Encode("variance_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropVariancePopulation = System.Text.Json.JsonEncodedText.Encode("variance_population"); - private static readonly System.Text.Json.JsonEncodedText PropVariancePopulationAsString = System.Text.Json.JsonEncodedText.Encode("variance_population_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropVarianceSampling = System.Text.Json.JsonEncodedText.Encode("variance_sampling"); - private static readonly System.Text.Json.JsonEncodedText PropVarianceSamplingAsString = System.Text.Json.JsonEncodedText.Encode("variance_sampling_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsBucketAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvg = default; - LocalJsonValue propAvgAsString = default; - LocalJsonValue propCount = default; - LocalJsonValue propMax = default; - LocalJsonValue propMaxAsString = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propMin = default; - LocalJsonValue propMinAsString = default; - LocalJsonValue propStdDeviation = default; - LocalJsonValue propStdDeviationAsString = default; - LocalJsonValue propStdDeviationBounds = default; - LocalJsonValue propStdDeviationBoundsAsString = default; - LocalJsonValue propStdDeviationPopulation = default; - LocalJsonValue propStdDeviationSampling = default; - LocalJsonValue propSum = default; - LocalJsonValue propSumAsString = default; - LocalJsonValue propSumOfSquares = default; - LocalJsonValue propSumOfSquaresAsString = default; - LocalJsonValue propVariance = default; - LocalJsonValue propVarianceAsString = default; - LocalJsonValue propVariancePopulation = default; - LocalJsonValue propVariancePopulationAsString = default; - LocalJsonValue propVarianceSampling = default; - LocalJsonValue propVarianceSamplingAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvg.TryReadProperty(ref reader, options, PropAvg, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propAvgAsString.TryReadProperty(ref reader, options, PropAvgAsString, null)) - { - continue; - } - - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propMax.TryReadProperty(ref reader, options, PropMax, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxAsString.TryReadProperty(ref reader, options, PropMaxAsString, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propMin.TryReadProperty(ref reader, options, PropMin, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinAsString.TryReadProperty(ref reader, options, PropMinAsString, null)) - { - continue; - } - - if (propStdDeviation.TryReadProperty(ref reader, options, PropStdDeviation, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propStdDeviationAsString.TryReadProperty(ref reader, options, PropStdDeviationAsString, null)) - { - continue; - } - - if (propStdDeviationBounds.TryReadProperty(ref reader, options, PropStdDeviationBounds, null)) - { - continue; - } - - if (propStdDeviationBoundsAsString.TryReadProperty(ref reader, options, PropStdDeviationBoundsAsString, null)) - { - continue; - } - - if (propStdDeviationPopulation.TryReadProperty(ref reader, options, PropStdDeviationPopulation, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propStdDeviationSampling.TryReadProperty(ref reader, options, PropStdDeviationSampling, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSum.TryReadProperty(ref reader, options, PropSum, null)) - { - continue; - } - - if (propSumAsString.TryReadProperty(ref reader, options, PropSumAsString, null)) - { - continue; - } - - if (propSumOfSquares.TryReadProperty(ref reader, options, PropSumOfSquares, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSumOfSquaresAsString.TryReadProperty(ref reader, options, PropSumOfSquaresAsString, null)) - { - continue; - } - - if (propVariance.TryReadProperty(ref reader, options, PropVariance, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propVarianceAsString.TryReadProperty(ref reader, options, PropVarianceAsString, null)) - { - continue; - } - - if (propVariancePopulation.TryReadProperty(ref reader, options, PropVariancePopulation, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propVariancePopulationAsString.TryReadProperty(ref reader, options, PropVariancePopulationAsString, null)) - { - continue; - } - - if (propVarianceSampling.TryReadProperty(ref reader, options, PropVarianceSampling, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propVarianceSamplingAsString.TryReadProperty(ref reader, options, PropVarianceSamplingAsString, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsBucketAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Avg = propAvg.Value, - AvgAsString = propAvgAsString.Value, - Count = propCount.Value, - Max = propMax.Value, - MaxAsString = propMaxAsString.Value, - Meta = propMeta.Value, - Min = propMin.Value, - MinAsString = propMinAsString.Value, - StdDeviation = propStdDeviation.Value, - StdDeviationAsString = propStdDeviationAsString.Value, - StdDeviationBounds = propStdDeviationBounds.Value, - StdDeviationBoundsAsString = propStdDeviationBoundsAsString.Value, - StdDeviationPopulation = propStdDeviationPopulation.Value, - StdDeviationSampling = propStdDeviationSampling.Value, - Sum = propSum.Value, - SumAsString = propSumAsString.Value, - SumOfSquares = propSumOfSquares.Value, - SumOfSquaresAsString = propSumOfSquaresAsString.Value, - Variance = propVariance.Value, - VarianceAsString = propVarianceAsString.Value, - VariancePopulation = propVariancePopulation.Value, - VariancePopulationAsString = propVariancePopulationAsString.Value, - VarianceSampling = propVarianceSampling.Value, - VarianceSamplingAsString = propVarianceSamplingAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsBucketAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvg, value.Avg, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropAvgAsString, value.AvgAsString, null, null); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropMax, value.Max, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxAsString, value.MaxAsString, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropMin, value.Min, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinAsString, value.MinAsString, null, null); - writer.WriteProperty(options, PropStdDeviation, value.StdDeviation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropStdDeviationAsString, value.StdDeviationAsString, null, null); - writer.WriteProperty(options, PropStdDeviationBounds, value.StdDeviationBounds, null, null); - writer.WriteProperty(options, PropStdDeviationBoundsAsString, value.StdDeviationBoundsAsString, null, null); - writer.WriteProperty(options, PropStdDeviationPopulation, value.StdDeviationPopulation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropStdDeviationSampling, value.StdDeviationSampling, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSum, value.Sum, null, null); - writer.WriteProperty(options, PropSumAsString, value.SumAsString, null, null); - writer.WriteProperty(options, PropSumOfSquares, value.SumOfSquares, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSumOfSquaresAsString, value.SumOfSquaresAsString, null, null); - writer.WriteProperty(options, PropVariance, value.Variance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropVarianceAsString, value.VarianceAsString, null, null); - writer.WriteProperty(options, PropVariancePopulation, value.VariancePopulation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropVariancePopulationAsString, value.VariancePopulationAsString, null, null); - writer.WriteProperty(options, PropVarianceSampling, value.VarianceSampling, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropVarianceSamplingAsString, value.VarianceSamplingAsString, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsBucketAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.ExtendedStatsBucketAggregateConverter))] public sealed partial class ExtendedStatsBucketAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsBucketAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsBucketAggregation.Converters.g.cs new file mode 100644 index 00000000000..e0c15f8f406 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsBucketAggregation.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class ExtendedStatsBucketAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); + private static readonly System.Text.Json.JsonEncodedText PropSigma = System.Text.Json.JsonEncodedText.Encode("sigma"); + + public override Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsBucketAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucketsPath = default; + LocalJsonValue propFormat = default; + LocalJsonValue propGapPolicy = default; + LocalJsonValue propSigma = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSigma.TryReadProperty(ref reader, options, PropSigma, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsBucketAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BucketsPath = propBucketsPath.Value, + Format = propFormat.Value, + GapPolicy = propGapPolicy.Value, + Sigma = propSigma.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsBucketAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSigma, value.Sigma, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsBucketAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsBucketAggregation.g.cs index 4758f4d1bcc..840e601b8a0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsBucketAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsBucketAggregation.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class ExtendedStatsBucketAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); - private static readonly System.Text.Json.JsonEncodedText PropSigma = System.Text.Json.JsonEncodedText.Encode("sigma"); - - public override Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsBucketAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBucketsPath = default; - LocalJsonValue propFormat = default; - LocalJsonValue propGapPolicy = default; - LocalJsonValue propSigma = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSigma.TryReadProperty(ref reader, options, PropSigma, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsBucketAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BucketsPath = propBucketsPath.Value, - Format = propFormat.Value, - GapPolicy = propGapPolicy.Value, - Sigma = propSigma.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsBucketAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSigma, value.Sigma, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.ExtendedStatsBucketAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.ExtendedStatsBucketAggregationConverter))] public sealed partial class ExtendedStatsBucketAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FieldDateMath.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FieldDateMath.Converters.g.cs new file mode 100644 index 00000000000..dc1bc06371b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FieldDateMath.Converters.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class FieldDateMathConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Aggregations.FieldDateMath Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number); + return selector(ref reader, options) switch + { + Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Aggregations.FieldDateMath(reader.ReadValue(options, null)), + Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Aggregations.FieldDateMath(reader.ReadValue(options, null)), + _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Aggregations.FieldDateMath)}") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.FieldDateMath value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Tag) + { + case Elastic.Clients.Elasticsearch.UnionTag.T1: + { + writer.WriteValue(options, value.Value1, null); + break; + } + + case Elastic.Clients.Elasticsearch.UnionTag.T2: + { + writer.WriteValue(options, value.Value2, null); + break; + } + + default: + throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FieldDateMath.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FieldDateMath.g.cs index 60495285dc7..b0f87f382b2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FieldDateMath.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FieldDateMath.g.cs @@ -23,48 +23,13 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class FieldDateMathConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Aggregations.FieldDateMath Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number); - return selector(ref reader, options) switch - { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Aggregations.FieldDateMath(reader.ReadValue(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Aggregations.FieldDateMath(reader.ReadValue(options, null)), - _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Aggregations.FieldDateMath)}") - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.FieldDateMath value, System.Text.Json.JsonSerializerOptions options) - { - switch (value.Tag) - { - case Elastic.Clients.Elasticsearch.UnionTag.T1: - { - writer.WriteValue(options, value.Value1, null); - break; - } - - case Elastic.Clients.Elasticsearch.UnionTag.T2: - { - writer.WriteValue(options, value.Value2, null); - break; - } - - default: - throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); - } - } -} - /// /// /// A date range limit, represented either as a DateMath expression or a number expressed /// according to the target field's precision. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.FieldDateMathConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.FieldDateMathConverter))] public sealed partial class FieldDateMath : Elastic.Clients.Elasticsearch.Union { public FieldDateMath(Elastic.Clients.Elasticsearch.DateMath value) : base(value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FilterAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FilterAggregate.Converters.g.cs new file mode 100644 index 00000000000..97e418ed135 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FilterAggregate.Converters.g.cs @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class FilterAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.FilterAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.FilterAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.FilterAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FilterAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FilterAggregate.g.cs index 9bb7d345f13..b58f2f85adf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FilterAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FilterAggregate.g.cs @@ -23,61 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class FilterAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.FilterAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.FilterAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.FilterAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.FilterAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.FilterAggregateConverter))] public sealed partial class FilterAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersAggregate.Converters.g.cs new file mode 100644 index 00000000000..35de28cc70e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class FiltersAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBuckets = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersAggregate.g.cs index 82677461b4f..75f6b14d5a9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersAggregate.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class FiltersAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBuckets = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.FiltersAggregateConverter))] public sealed partial class FiltersAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersAggregation.Converters.g.cs new file mode 100644 index 00000000000..f386953e916 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersAggregation.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class FiltersAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFilters = System.Text.Json.JsonEncodedText.Encode("filters"); + private static readonly System.Text.Json.JsonEncodedText PropOtherBucket = System.Text.Json.JsonEncodedText.Encode("other_bucket"); + private static readonly System.Text.Json.JsonEncodedText PropOtherBucketKey = System.Text.Json.JsonEncodedText.Encode("other_bucket_key"); + + public override Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propFilters = default; + LocalJsonValue propOtherBucket = default; + LocalJsonValue propOtherBucketKey = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFilters.TryReadProperty(ref reader, options, PropFilters, null)) + { + continue; + } + + if (propOtherBucket.TryReadProperty(ref reader, options, PropOtherBucket, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOtherBucketKey.TryReadProperty(ref reader, options, PropOtherBucketKey, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Filters = propFilters.Value, + OtherBucket = propOtherBucket.Value, + OtherBucketKey = propOtherBucketKey.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFilters, value.Filters, null, null); + writer.WriteProperty(options, PropOtherBucket, value.OtherBucket, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOtherBucketKey, value.OtherBucketKey, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersAggregation.g.cs index 9b3ed24ccd7..8b14feb8a90 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersAggregation.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class FiltersAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFilters = System.Text.Json.JsonEncodedText.Encode("filters"); - private static readonly System.Text.Json.JsonEncodedText PropOtherBucket = System.Text.Json.JsonEncodedText.Encode("other_bucket"); - private static readonly System.Text.Json.JsonEncodedText PropOtherBucketKey = System.Text.Json.JsonEncodedText.Encode("other_bucket_key"); - - public override Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propFilters = default; - LocalJsonValue propOtherBucket = default; - LocalJsonValue propOtherBucketKey = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFilters.TryReadProperty(ref reader, options, PropFilters, null)) - { - continue; - } - - if (propOtherBucket.TryReadProperty(ref reader, options, PropOtherBucket, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOtherBucketKey.TryReadProperty(ref reader, options, PropOtherBucketKey, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Filters = propFilters.Value, - OtherBucket = propOtherBucket.Value, - OtherBucketKey = propOtherBucketKey.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFilters, value.Filters, null, null); - writer.WriteProperty(options, PropOtherBucket, value.OtherBucket, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOtherBucketKey, value.OtherBucketKey, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.FiltersAggregationConverter))] public sealed partial class FiltersAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersBucket.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersBucket.Converters.g.cs new file mode 100644 index 00000000000..843acda5cfe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersBucket.Converters.g.cs @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class FiltersBucketConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); + + public override Elastic.Clients.Elasticsearch.Aggregations.FiltersBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue propKey = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propKey.TryReadProperty(ref reader, options, PropKey, null)) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.FiltersBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + Key = propKey.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.FiltersBucket value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropKey, value.Key, null, null); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersBucket.g.cs index 298a9a03583..63d112791bb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersBucket.g.cs @@ -23,61 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class FiltersBucketConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); - - public override Elastic.Clients.Elasticsearch.Aggregations.FiltersBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue propKey = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propKey.TryReadProperty(ref reader, options, PropKey, null)) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.FiltersBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - Key = propKey.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.FiltersBucket value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropKey, value.Key, null, null); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.FiltersBucketConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.FiltersBucketConverter))] public sealed partial class FiltersBucket { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsAggregate.Converters.g.cs new file mode 100644 index 00000000000..0b3fa8e563a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class FrequentItemSetsAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBuckets = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsAggregate.g.cs index 2ef5ba1e539..d653c5c8672 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsAggregate.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class FrequentItemSetsAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBuckets = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.FrequentItemSetsAggregateConverter))] public sealed partial class FrequentItemSetsAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsAggregation.Converters.g.cs new file mode 100644 index 00000000000..ed0ee712a70 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsAggregation.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class FrequentItemSetsAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropMinimumSetSize = System.Text.Json.JsonEncodedText.Encode("minimum_set_size"); + private static readonly System.Text.Json.JsonEncodedText PropMinimumSupport = System.Text.Json.JsonEncodedText.Encode("minimum_support"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + + public override Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propFields = default; + LocalJsonValue propFilter = default; + LocalJsonValue propMinimumSetSize = default; + LocalJsonValue propMinimumSupport = default; + LocalJsonValue propSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) + { + continue; + } + + if (propMinimumSetSize.TryReadProperty(ref reader, options, PropMinimumSetSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinimumSupport.TryReadProperty(ref reader, options, PropMinimumSupport, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Fields = propFields.Value, + Filter = propFilter.Value, + MinimumSetSize = propMinimumSetSize.Value, + MinimumSupport = propMinimumSupport.Value, + Size = propSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFilter, value.Filter, null, null); + writer.WriteProperty(options, PropMinimumSetSize, value.MinimumSetSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinimumSupport, value.MinimumSupport, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsAggregation.g.cs index 92835521685..2c6dca18d00 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsAggregation.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class FrequentItemSetsAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropMinimumSetSize = System.Text.Json.JsonEncodedText.Encode("minimum_set_size"); - private static readonly System.Text.Json.JsonEncodedText PropMinimumSupport = System.Text.Json.JsonEncodedText.Encode("minimum_support"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - - public override Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propFields = default; - LocalJsonValue propFilter = default; - LocalJsonValue propMinimumSetSize = default; - LocalJsonValue propMinimumSupport = default; - LocalJsonValue propSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) - { - continue; - } - - if (propMinimumSetSize.TryReadProperty(ref reader, options, PropMinimumSetSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinimumSupport.TryReadProperty(ref reader, options, PropMinimumSupport, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Fields = propFields.Value, - Filter = propFilter.Value, - MinimumSetSize = propMinimumSetSize.Value, - MinimumSupport = propMinimumSupport.Value, - Size = propSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFilter, value.Filter, null, null); - writer.WriteProperty(options, PropMinimumSetSize, value.MinimumSetSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinimumSupport, value.MinimumSupport, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.FrequentItemSetsAggregationConverter))] public sealed partial class FrequentItemSetsAggregation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsBucket.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsBucket.Converters.g.cs new file mode 100644 index 00000000000..1d0a3addca5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsBucket.Converters.g.cs @@ -0,0 +1,87 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class FrequentItemSetsBucketConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); + private static readonly System.Text.Json.JsonEncodedText PropSupport = System.Text.Json.JsonEncodedText.Encode("support"); + + public override Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue>> propKey = default; + LocalJsonValue propSupport = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propKey.TryReadProperty(ref reader, options, PropKey, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)!)) + { + continue; + } + + if (propSupport.TryReadProperty(ref reader, options, PropSupport, null)) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + Key = propKey.Value, + Support = propSupport.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsBucket value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropKey, value.Key, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropSupport, value.Support, null, null); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsBucket.g.cs index 61db1257b76..050950610fa 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsBucket.g.cs @@ -23,70 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class FrequentItemSetsBucketConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); - private static readonly System.Text.Json.JsonEncodedText PropSupport = System.Text.Json.JsonEncodedText.Encode("support"); - - public override Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue>> propKey = default; - LocalJsonValue propSupport = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propKey.TryReadProperty(ref reader, options, PropKey, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)!)) - { - continue; - } - - if (propSupport.TryReadProperty(ref reader, options, PropSupport, null)) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - Key = propKey.Value, - Support = propSupport.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsBucket value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropKey, value.Key, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropSupport, value.Support, null, null); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsBucketConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.FrequentItemSetsBucketConverter))] public sealed partial class FrequentItemSetsBucket { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsField.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsField.Converters.g.cs new file mode 100644 index 00000000000..ac5b7bcce3c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsField.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class FrequentItemSetsFieldConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExclude = System.Text.Json.JsonEncodedText.Encode("exclude"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropInclude = System.Text.Json.JsonEncodedText.Encode("include"); + + public override Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExclude = default; + LocalJsonValue propField = default; + LocalJsonValue propInclude = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExclude.TryReadProperty(ref reader, options, PropExclude, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propInclude.TryReadProperty(ref reader, options, PropInclude, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Exclude = propExclude.Value, + Field = propField.Value, + Include = propInclude.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsField value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExclude, value.Exclude, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropInclude, value.Include, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsField.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsField.g.cs index 41084151230..6b4863d7961 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsField.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FrequentItemSetsField.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class FrequentItemSetsFieldConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExclude = System.Text.Json.JsonEncodedText.Encode("exclude"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropInclude = System.Text.Json.JsonEncodedText.Encode("include"); - - public override Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propExclude = default; - LocalJsonValue propField = default; - LocalJsonValue propInclude = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExclude.TryReadProperty(ref reader, options, PropExclude, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propInclude.TryReadProperty(ref reader, options, PropInclude, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Exclude = propExclude.Value, - Field = propField.Value, - Include = propInclude.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsField value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExclude, value.Exclude, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropInclude, value.Include, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsFieldConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.FrequentItemSetsFieldConverter))] public sealed partial class FrequentItemSetsField { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GapPolicy.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GapPolicy.Converters.g.cs new file mode 100644 index 00000000000..0fa05f5d466 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GapPolicy.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class GapPolicyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberInsertZeros = System.Text.Json.JsonEncodedText.Encode("insert_zeros"); + private static readonly System.Text.Json.JsonEncodedText MemberKeepValues = System.Text.Json.JsonEncodedText.Encode("keep_values"); + private static readonly System.Text.Json.JsonEncodedText MemberSkip = System.Text.Json.JsonEncodedText.Encode("skip"); + + public override Elastic.Clients.Elasticsearch.Aggregations.GapPolicy Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberInsertZeros)) + { + return Elastic.Clients.Elasticsearch.Aggregations.GapPolicy.InsertZeros; + } + + if (reader.ValueTextEquals(MemberKeepValues)) + { + return Elastic.Clients.Elasticsearch.Aggregations.GapPolicy.KeepValues; + } + + if (reader.ValueTextEquals(MemberSkip)) + { + return Elastic.Clients.Elasticsearch.Aggregations.GapPolicy.Skip; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberInsertZeros.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.GapPolicy.InsertZeros; + } + + if (string.Equals(value, MemberKeepValues.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.GapPolicy.KeepValues; + } + + if (string.Equals(value, MemberSkip.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.GapPolicy.Skip; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.GapPolicy)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Aggregations.GapPolicy.InsertZeros: + writer.WriteStringValue(MemberInsertZeros); + break; + case Elastic.Clients.Elasticsearch.Aggregations.GapPolicy.KeepValues: + writer.WriteStringValue(MemberKeepValues); + break; + case Elastic.Clients.Elasticsearch.Aggregations.GapPolicy.Skip: + writer.WriteStringValue(MemberSkip); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.GapPolicy)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Aggregations.GapPolicy ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GapPolicy.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GapPolicy.g.cs new file mode 100644 index 00000000000..6bc9c1a0150 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GapPolicy.g.cs @@ -0,0 +1,52 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.GapPolicyConverter))] +public enum GapPolicy +{ + /// + /// + /// Replace missing values with a zero (0) and pipeline aggregation computation will proceed as normal. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "insert_zeros")] + InsertZeros, + /// + /// + /// Similar to skip, except if the metric provides a non-null, non-NaN value this value is used, + /// otherwise the empty bucket is skipped. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "keep_values")] + KeepValues, + /// + /// + /// Treats missing data as if the bucket does not exist. It will skip the bucket and + /// continue calculating using the next available value. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "skip")] + Skip +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoBoundsAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoBoundsAggregate.Converters.g.cs new file mode 100644 index 00000000000..50acc965248 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoBoundsAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class GeoBoundsAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBounds = System.Text.Json.JsonEncodedText.Encode("bounds"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBounds = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBounds.TryReadProperty(ref reader, options, PropBounds, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Bounds = propBounds.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBounds, value.Bounds, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoBoundsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoBoundsAggregate.g.cs index 036de0a115d..a270d7e4d53 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoBoundsAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoBoundsAggregate.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class GeoBoundsAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBounds = System.Text.Json.JsonEncodedText.Encode("bounds"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBounds = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBounds.TryReadProperty(ref reader, options, PropBounds, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Bounds = propBounds.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBounds, value.Bounds, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.GeoBoundsAggregateConverter))] public sealed partial class GeoBoundsAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoBoundsAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoBoundsAggregation.Converters.g.cs new file mode 100644 index 00000000000..84f3100ca15 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoBoundsAggregation.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class GeoBoundsAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropWrapLongitude = System.Text.Json.JsonEncodedText.Encode("wrap_longitude"); + + public override Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propMissing = default; + LocalJsonValue propScript = default; + LocalJsonValue propWrapLongitude = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propWrapLongitude.TryReadProperty(ref reader, options, PropWrapLongitude, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Missing = propMissing.Value, + Script = propScript.Value, + WrapLongitude = propWrapLongitude.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropWrapLongitude, value.WrapLongitude, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoBoundsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoBoundsAggregation.g.cs index 792ceb67c9e..86710ec3558 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoBoundsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoBoundsAggregation.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class GeoBoundsAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropWrapLongitude = System.Text.Json.JsonEncodedText.Encode("wrap_longitude"); - - public override Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propMissing = default; - LocalJsonValue propScript = default; - LocalJsonValue propWrapLongitude = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propWrapLongitude.TryReadProperty(ref reader, options, PropWrapLongitude, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Missing = propMissing.Value, - Script = propScript.Value, - WrapLongitude = propWrapLongitude.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropMissing, value.Missing, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropWrapLongitude, value.WrapLongitude, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.GeoBoundsAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.GeoBoundsAggregationConverter))] public sealed partial class GeoBoundsAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoCentroidAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoCentroidAggregate.Converters.g.cs new file mode 100644 index 00000000000..17c227a4c99 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoCentroidAggregate.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class GeoCentroidAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropLocation = System.Text.Json.JsonEncodedText.Encode("location"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propLocation = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propLocation.TryReadProperty(ref reader, options, PropLocation, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Location = propLocation.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropLocation, value.Location, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoCentroidAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoCentroidAggregate.g.cs index 4539cfca6a2..97a52782fc2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoCentroidAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoCentroidAggregate.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class GeoCentroidAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropLocation = System.Text.Json.JsonEncodedText.Encode("location"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propLocation = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propLocation.TryReadProperty(ref reader, options, PropLocation, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Location = propLocation.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropLocation, value.Location, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.GeoCentroidAggregateConverter))] public sealed partial class GeoCentroidAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoCentroidAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoCentroidAggregation.Converters.g.cs new file mode 100644 index 00000000000..567c1f89531 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoCentroidAggregation.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class GeoCentroidAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropLocation = System.Text.Json.JsonEncodedText.Encode("location"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propField = default; + LocalJsonValue propLocation = default; + LocalJsonValue propMissing = default; + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propLocation.TryReadProperty(ref reader, options, PropLocation, null)) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Field = propField.Value, + Location = propLocation.Value, + Missing = propMissing.Value, + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropLocation, value.Location, null, null); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoCentroidAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoCentroidAggregation.g.cs index abcdc4b48bc..1c421b5d9d8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoCentroidAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoCentroidAggregation.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class GeoCentroidAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropLocation = System.Text.Json.JsonEncodedText.Encode("location"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propField = default; - LocalJsonValue propLocation = default; - LocalJsonValue propMissing = default; - LocalJsonValue propScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propLocation.TryReadProperty(ref reader, options, PropLocation, null)) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Field = propField.Value, - Location = propLocation.Value, - Missing = propMissing.Value, - Script = propScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropLocation, value.Location, null, null); - writer.WriteProperty(options, PropMissing, value.Missing, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.GeoCentroidAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.GeoCentroidAggregationConverter))] public sealed partial class GeoCentroidAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoDistanceAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoDistanceAggregate.Converters.g.cs new file mode 100644 index 00000000000..a088a9c80e0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoDistanceAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class GeoDistanceAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.GeoDistanceAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBuckets = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.GeoDistanceAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeoDistanceAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoDistanceAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoDistanceAggregate.g.cs index 96a74e41add..096956d6bfd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoDistanceAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoDistanceAggregate.g.cs @@ -23,60 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class GeoDistanceAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.GeoDistanceAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBuckets = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.GeoDistanceAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeoDistanceAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - /// /// /// Result of a geo_distance aggregation. The unit for from and to is meters by default. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.GeoDistanceAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.GeoDistanceAggregateConverter))] public sealed partial class GeoDistanceAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoDistanceAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoDistanceAggregation.Converters.g.cs new file mode 100644 index 00000000000..0ab576ee3e0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoDistanceAggregation.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class GeoDistanceAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDistanceType = System.Text.Json.JsonEncodedText.Encode("distance_type"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropOrigin = System.Text.Json.JsonEncodedText.Encode("origin"); + private static readonly System.Text.Json.JsonEncodedText PropRanges = System.Text.Json.JsonEncodedText.Encode("ranges"); + private static readonly System.Text.Json.JsonEncodedText PropUnit = System.Text.Json.JsonEncodedText.Encode("unit"); + + public override Elastic.Clients.Elasticsearch.Aggregations.GeoDistanceAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDistanceType = default; + LocalJsonValue propField = default; + LocalJsonValue propOrigin = default; + LocalJsonValue?> propRanges = default; + LocalJsonValue propUnit = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDistanceType.TryReadProperty(ref reader, options, PropDistanceType, static Elastic.Clients.Elasticsearch.GeoDistanceType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propOrigin.TryReadProperty(ref reader, options, PropOrigin, null)) + { + continue; + } + + if (propRanges.TryReadProperty(ref reader, options, PropRanges, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propUnit.TryReadProperty(ref reader, options, PropUnit, static Elastic.Clients.Elasticsearch.DistanceUnit? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.GeoDistanceAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DistanceType = propDistanceType.Value, + Field = propField.Value, + Origin = propOrigin.Value, + Ranges = propRanges.Value, + Unit = propUnit.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeoDistanceAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDistanceType, value.DistanceType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.GeoDistanceType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropOrigin, value.Origin, null, null); + writer.WriteProperty(options, PropRanges, value.Ranges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropUnit, value.Unit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.DistanceUnit? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoDistanceAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoDistanceAggregation.g.cs index fe58dfd2cd5..f3419e63555 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoDistanceAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoDistanceAggregation.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class GeoDistanceAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDistanceType = System.Text.Json.JsonEncodedText.Encode("distance_type"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropOrigin = System.Text.Json.JsonEncodedText.Encode("origin"); - private static readonly System.Text.Json.JsonEncodedText PropRanges = System.Text.Json.JsonEncodedText.Encode("ranges"); - private static readonly System.Text.Json.JsonEncodedText PropUnit = System.Text.Json.JsonEncodedText.Encode("unit"); - - public override Elastic.Clients.Elasticsearch.Aggregations.GeoDistanceAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDistanceType = default; - LocalJsonValue propField = default; - LocalJsonValue propOrigin = default; - LocalJsonValue?> propRanges = default; - LocalJsonValue propUnit = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDistanceType.TryReadProperty(ref reader, options, PropDistanceType, static Elastic.Clients.Elasticsearch.GeoDistanceType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propOrigin.TryReadProperty(ref reader, options, PropOrigin, null)) - { - continue; - } - - if (propRanges.TryReadProperty(ref reader, options, PropRanges, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propUnit.TryReadProperty(ref reader, options, PropUnit, static Elastic.Clients.Elasticsearch.DistanceUnit? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.GeoDistanceAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DistanceType = propDistanceType.Value, - Field = propField.Value, - Origin = propOrigin.Value, - Ranges = propRanges.Value, - Unit = propUnit.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeoDistanceAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDistanceType, value.DistanceType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.GeoDistanceType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropOrigin, value.Origin, null, null); - writer.WriteProperty(options, PropRanges, value.Ranges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropUnit, value.Unit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.DistanceUnit? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.GeoDistanceAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.GeoDistanceAggregationConverter))] public sealed partial class GeoDistanceAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineAggregate.Converters.g.cs new file mode 100644 index 00000000000..377d3e02361 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineAggregate.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class GeoLineAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropGeometry = System.Text.Json.JsonEncodedText.Encode("geometry"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propGeometry = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propProperties = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propGeometry.TryReadProperty(ref reader, options, PropGeometry, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Geometry = propGeometry.Value, + Meta = propMeta.Value, + Properties = propProperties.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropGeometry, value.Geometry, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropProperties, value.Properties, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineAggregate.g.cs index 8c4eca0846c..1abda8c8dfc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineAggregate.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class GeoLineAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropGeometry = System.Text.Json.JsonEncodedText.Encode("geometry"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propGeometry = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propProperties = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propGeometry.TryReadProperty(ref reader, options, PropGeometry, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Geometry = propGeometry.Value, - Meta = propMeta.Value, - Properties = propProperties.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropGeometry, value.Geometry, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropProperties, value.Properties, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.GeoLineAggregateConverter))] public sealed partial class GeoLineAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineAggregation.Converters.g.cs new file mode 100644 index 00000000000..ba2855a3c89 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineAggregation.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class GeoLineAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIncludeSort = System.Text.Json.JsonEncodedText.Encode("include_sort"); + private static readonly System.Text.Json.JsonEncodedText PropPoint = System.Text.Json.JsonEncodedText.Encode("point"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); + private static readonly System.Text.Json.JsonEncodedText PropSortOrder = System.Text.Json.JsonEncodedText.Encode("sort_order"); + + public override Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIncludeSort = default; + LocalJsonValue propPoint = default; + LocalJsonValue propSize = default; + LocalJsonValue propSort = default; + LocalJsonValue propSortOrder = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIncludeSort.TryReadProperty(ref reader, options, PropIncludeSort, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPoint.TryReadProperty(ref reader, options, PropPoint, null)) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, null)) + { + continue; + } + + if (propSortOrder.TryReadProperty(ref reader, options, PropSortOrder, static Elastic.Clients.Elasticsearch.SortOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + IncludeSort = propIncludeSort.Value, + Point = propPoint.Value, + Size = propSize.Value, + Sort = propSort.Value, + SortOrder = propSortOrder.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIncludeSort, value.IncludeSort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPoint, value.Point, null, null); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSort, value.Sort, null, null); + writer.WriteProperty(options, PropSortOrder, value.SortOrder, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortOrder? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineAggregation.g.cs index c6bb8dd7e17..49629d30757 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineAggregation.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class GeoLineAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIncludeSort = System.Text.Json.JsonEncodedText.Encode("include_sort"); - private static readonly System.Text.Json.JsonEncodedText PropPoint = System.Text.Json.JsonEncodedText.Encode("point"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); - private static readonly System.Text.Json.JsonEncodedText PropSortOrder = System.Text.Json.JsonEncodedText.Encode("sort_order"); - - public override Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIncludeSort = default; - LocalJsonValue propPoint = default; - LocalJsonValue propSize = default; - LocalJsonValue propSort = default; - LocalJsonValue propSortOrder = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIncludeSort.TryReadProperty(ref reader, options, PropIncludeSort, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPoint.TryReadProperty(ref reader, options, PropPoint, null)) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSort.TryReadProperty(ref reader, options, PropSort, null)) - { - continue; - } - - if (propSortOrder.TryReadProperty(ref reader, options, PropSortOrder, static Elastic.Clients.Elasticsearch.SortOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - IncludeSort = propIncludeSort.Value, - Point = propPoint.Value, - Size = propSize.Value, - Sort = propSort.Value, - SortOrder = propSortOrder.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIncludeSort, value.IncludeSort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPoint, value.Point, null, null); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSort, value.Sort, null, null); - writer.WriteProperty(options, PropSortOrder, value.SortOrder, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortOrder? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.GeoLineAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.GeoLineAggregationConverter))] public sealed partial class GeoLineAggregation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLinePoint.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLinePoint.Converters.g.cs new file mode 100644 index 00000000000..195b166abe0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLinePoint.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class GeoLinePointConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + + public override Elastic.Clients.Elasticsearch.Aggregations.GeoLinePoint Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.GeoLinePoint(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeoLinePoint value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLinePoint.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLinePoint.g.cs index 474d13c6e0f..eced6fda414 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLinePoint.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLinePoint.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class GeoLinePointConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - - public override Elastic.Clients.Elasticsearch.Aggregations.GeoLinePoint Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.GeoLinePoint(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeoLinePoint value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.GeoLinePointConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.GeoLinePointConverter))] public sealed partial class GeoLinePoint { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineSort.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineSort.Converters.g.cs new file mode 100644 index 00000000000..e130d0ee5dc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineSort.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class GeoLineSortConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + + public override Elastic.Clients.Elasticsearch.Aggregations.GeoLineSort Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.GeoLineSort(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeoLineSort value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineSort.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineSort.g.cs index f4d22eeb20a..2bdc1e5ba99 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineSort.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeoLineSort.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class GeoLineSortConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - - public override Elastic.Clients.Elasticsearch.Aggregations.GeoLineSort Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.GeoLineSort(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeoLineSort value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.GeoLineSortConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.GeoLineSortConverter))] public sealed partial class GeoLineSort { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridAggregate.Converters.g.cs new file mode 100644 index 00000000000..1b38616a0cb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class GeohashGridAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.GeohashGridAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBuckets = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.GeohashGridAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeohashGridAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridAggregate.g.cs index 115bba9542e..c94e880c378 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridAggregate.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class GeohashGridAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.GeohashGridAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBuckets = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.GeohashGridAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeohashGridAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.GeohashGridAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.GeohashGridAggregateConverter))] public sealed partial class GeohashGridAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridAggregation.Converters.g.cs new file mode 100644 index 00000000000..320711945e5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridAggregation.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class GeohashGridAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBounds = System.Text.Json.JsonEncodedText.Encode("bounds"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropPrecision = System.Text.Json.JsonEncodedText.Encode("precision"); + private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + + public override Elastic.Clients.Elasticsearch.Aggregations.GeohashGridAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBounds = default; + LocalJsonValue propField = default; + LocalJsonValue propPrecision = default; + LocalJsonValue propShardSize = default; + LocalJsonValue propSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBounds.TryReadProperty(ref reader, options, PropBounds, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propPrecision.TryReadProperty(ref reader, options, PropPrecision, null)) + { + continue; + } + + if (propShardSize.TryReadProperty(ref reader, options, PropShardSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.GeohashGridAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Bounds = propBounds.Value, + Field = propField.Value, + Precision = propPrecision.Value, + ShardSize = propShardSize.Value, + Size = propSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeohashGridAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBounds, value.Bounds, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropPrecision, value.Precision, null, null); + writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridAggregation.g.cs index 9f3599ad592..55d03e51af4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridAggregation.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class GeohashGridAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBounds = System.Text.Json.JsonEncodedText.Encode("bounds"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropPrecision = System.Text.Json.JsonEncodedText.Encode("precision"); - private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - - public override Elastic.Clients.Elasticsearch.Aggregations.GeohashGridAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBounds = default; - LocalJsonValue propField = default; - LocalJsonValue propPrecision = default; - LocalJsonValue propShardSize = default; - LocalJsonValue propSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBounds.TryReadProperty(ref reader, options, PropBounds, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propPrecision.TryReadProperty(ref reader, options, PropPrecision, null)) - { - continue; - } - - if (propShardSize.TryReadProperty(ref reader, options, PropShardSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.GeohashGridAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Bounds = propBounds.Value, - Field = propField.Value, - Precision = propPrecision.Value, - ShardSize = propShardSize.Value, - Size = propSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeohashGridAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBounds, value.Bounds, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropPrecision, value.Precision, null, null); - writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.GeohashGridAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.GeohashGridAggregationConverter))] public sealed partial class GeohashGridAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridBucket.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridBucket.Converters.g.cs new file mode 100644 index 00000000000..e48d0d38b84 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridBucket.Converters.g.cs @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class GeohashGridBucketConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); + + public override Elastic.Clients.Elasticsearch.Aggregations.GeohashGridBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue propKey = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propKey.TryReadProperty(ref reader, options, PropKey, null)) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.GeohashGridBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + Key = propKey.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeohashGridBucket value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropKey, value.Key, null, null); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridBucket.g.cs index a144a6f66ee..8c340ce43fe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohashGridBucket.g.cs @@ -23,61 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class GeohashGridBucketConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); - - public override Elastic.Clients.Elasticsearch.Aggregations.GeohashGridBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue propKey = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propKey.TryReadProperty(ref reader, options, PropKey, null)) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.GeohashGridBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - Key = propKey.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeohashGridBucket value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropKey, value.Key, null, null); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.GeohashGridBucketConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.GeohashGridBucketConverter))] public sealed partial class GeohashGridBucket { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridAggregate.Converters.g.cs new file mode 100644 index 00000000000..fe59b6d24e1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class GeohexGridAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.GeohexGridAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBuckets = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.GeohexGridAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeohexGridAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridAggregate.g.cs index 783165f0f9f..ca6d2f99c98 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridAggregate.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class GeohexGridAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.GeohexGridAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBuckets = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.GeohexGridAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeohexGridAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.GeohexGridAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.GeohexGridAggregateConverter))] public sealed partial class GeohexGridAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridAggregation.Converters.g.cs new file mode 100644 index 00000000000..3fa02c162ea --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridAggregation.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class GeohexGridAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBounds = System.Text.Json.JsonEncodedText.Encode("bounds"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropPrecision = System.Text.Json.JsonEncodedText.Encode("precision"); + private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + + public override Elastic.Clients.Elasticsearch.Aggregations.GeohexGridAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBounds = default; + LocalJsonValue propField = default; + LocalJsonValue propPrecision = default; + LocalJsonValue propShardSize = default; + LocalJsonValue propSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBounds.TryReadProperty(ref reader, options, PropBounds, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propPrecision.TryReadProperty(ref reader, options, PropPrecision, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propShardSize.TryReadProperty(ref reader, options, PropShardSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.GeohexGridAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Bounds = propBounds.Value, + Field = propField.Value, + Precision = propPrecision.Value, + ShardSize = propShardSize.Value, + Size = propSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeohexGridAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBounds, value.Bounds, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropPrecision, value.Precision, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridAggregation.g.cs index 51303ba9264..9bb71c2e330 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridAggregation.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class GeohexGridAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBounds = System.Text.Json.JsonEncodedText.Encode("bounds"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropPrecision = System.Text.Json.JsonEncodedText.Encode("precision"); - private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - - public override Elastic.Clients.Elasticsearch.Aggregations.GeohexGridAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBounds = default; - LocalJsonValue propField = default; - LocalJsonValue propPrecision = default; - LocalJsonValue propShardSize = default; - LocalJsonValue propSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBounds.TryReadProperty(ref reader, options, PropBounds, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propPrecision.TryReadProperty(ref reader, options, PropPrecision, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propShardSize.TryReadProperty(ref reader, options, PropShardSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.GeohexGridAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Bounds = propBounds.Value, - Field = propField.Value, - Precision = propPrecision.Value, - ShardSize = propShardSize.Value, - Size = propSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeohexGridAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBounds, value.Bounds, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropPrecision, value.Precision, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.GeohexGridAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.GeohexGridAggregationConverter))] public sealed partial class GeohexGridAggregation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridBucket.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridBucket.Converters.g.cs new file mode 100644 index 00000000000..f33c1f95366 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridBucket.Converters.g.cs @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class GeohexGridBucketConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); + + public override Elastic.Clients.Elasticsearch.Aggregations.GeohexGridBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue propKey = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propKey.TryReadProperty(ref reader, options, PropKey, null)) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.GeohexGridBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + Key = propKey.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeohexGridBucket value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropKey, value.Key, null, null); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridBucket.g.cs index 3e0f128d904..806c3412d65 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeohexGridBucket.g.cs @@ -23,61 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class GeohexGridBucketConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); - - public override Elastic.Clients.Elasticsearch.Aggregations.GeohexGridBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue propKey = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propKey.TryReadProperty(ref reader, options, PropKey, null)) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.GeohexGridBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - Key = propKey.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeohexGridBucket value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropKey, value.Key, null, null); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.GeohexGridBucketConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.GeohexGridBucketConverter))] public sealed partial class GeohexGridBucket { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridAggregate.Converters.g.cs new file mode 100644 index 00000000000..726bb80524b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class GeotileGridAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBuckets = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridAggregate.g.cs index 007bef00673..b89e0dc8433 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridAggregate.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class GeotileGridAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBuckets = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.GeotileGridAggregateConverter))] public sealed partial class GeotileGridAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridAggregation.Converters.g.cs new file mode 100644 index 00000000000..be975d737be --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridAggregation.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class GeotileGridAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBounds = System.Text.Json.JsonEncodedText.Encode("bounds"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropPrecision = System.Text.Json.JsonEncodedText.Encode("precision"); + private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + + public override Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBounds = default; + LocalJsonValue propField = default; + LocalJsonValue propPrecision = default; + LocalJsonValue propShardSize = default; + LocalJsonValue propSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBounds.TryReadProperty(ref reader, options, PropBounds, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propPrecision.TryReadProperty(ref reader, options, PropPrecision, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propShardSize.TryReadProperty(ref reader, options, PropShardSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Bounds = propBounds.Value, + Field = propField.Value, + Precision = propPrecision.Value, + ShardSize = propShardSize.Value, + Size = propSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBounds, value.Bounds, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropPrecision, value.Precision, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridAggregation.g.cs index 0ef4f073622..ddd884eeb53 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridAggregation.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class GeotileGridAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBounds = System.Text.Json.JsonEncodedText.Encode("bounds"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropPrecision = System.Text.Json.JsonEncodedText.Encode("precision"); - private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - - public override Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBounds = default; - LocalJsonValue propField = default; - LocalJsonValue propPrecision = default; - LocalJsonValue propShardSize = default; - LocalJsonValue propSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBounds.TryReadProperty(ref reader, options, PropBounds, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propPrecision.TryReadProperty(ref reader, options, PropPrecision, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propShardSize.TryReadProperty(ref reader, options, PropShardSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Bounds = propBounds.Value, - Field = propField.Value, - Precision = propPrecision.Value, - ShardSize = propShardSize.Value, - Size = propSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBounds, value.Bounds, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropPrecision, value.Precision, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.GeotileGridAggregationConverter))] public sealed partial class GeotileGridAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridBucket.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridBucket.Converters.g.cs new file mode 100644 index 00000000000..0de30d64eb1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridBucket.Converters.g.cs @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class GeotileGridBucketConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); + + public override Elastic.Clients.Elasticsearch.Aggregations.GeotileGridBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue propKey = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propKey.TryReadProperty(ref reader, options, PropKey, null)) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.GeotileGridBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + Key = propKey.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeotileGridBucket value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropKey, value.Key, null, null); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridBucket.g.cs index 56fc98b6504..b124042f16f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GeotileGridBucket.g.cs @@ -23,61 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class GeotileGridBucketConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); - - public override Elastic.Clients.Elasticsearch.Aggregations.GeotileGridBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue propKey = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propKey.TryReadProperty(ref reader, options, PropKey, null)) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.GeotileGridBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - Key = propKey.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GeotileGridBucket value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropKey, value.Key, null, null); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.GeotileGridBucketConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.GeotileGridBucketConverter))] public sealed partial class GeotileGridBucket { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GlobalAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GlobalAggregate.Converters.g.cs new file mode 100644 index 00000000000..79b31131c44 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GlobalAggregate.Converters.g.cs @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class GlobalAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.GlobalAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.GlobalAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GlobalAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GlobalAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GlobalAggregate.g.cs index 821d150c3b2..9c361b2656d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GlobalAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GlobalAggregate.g.cs @@ -23,61 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class GlobalAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.GlobalAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.GlobalAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GlobalAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.GlobalAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.GlobalAggregateConverter))] public sealed partial class GlobalAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GlobalAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GlobalAggregation.Converters.g.cs new file mode 100644 index 00000000000..9fccac28694 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GlobalAggregation.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class GlobalAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Aggregations.GlobalAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.GlobalAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GlobalAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GlobalAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GlobalAggregation.g.cs index d344c6d50b8..05d6ab77add 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GlobalAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GlobalAggregation.g.cs @@ -23,36 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class GlobalAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Aggregations.GlobalAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.GlobalAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GlobalAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.GlobalAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.GlobalAggregationConverter))] public sealed partial class GlobalAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GoogleNormalizedDistanceHeuristic.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GoogleNormalizedDistanceHeuristic.Converters.g.cs new file mode 100644 index 00000000000..019dbd86700 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GoogleNormalizedDistanceHeuristic.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class GoogleNormalizedDistanceHeuristicConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBackgroundIsSuperset = System.Text.Json.JsonEncodedText.Encode("background_is_superset"); + + public override Elastic.Clients.Elasticsearch.Aggregations.GoogleNormalizedDistanceHeuristic Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBackgroundIsSuperset = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBackgroundIsSuperset.TryReadProperty(ref reader, options, PropBackgroundIsSuperset, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.GoogleNormalizedDistanceHeuristic(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BackgroundIsSuperset = propBackgroundIsSuperset.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GoogleNormalizedDistanceHeuristic value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBackgroundIsSuperset, value.BackgroundIsSuperset, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GoogleNormalizedDistanceHeuristic.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GoogleNormalizedDistanceHeuristic.g.cs index d88c435c532..5b600e8ad8f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GoogleNormalizedDistanceHeuristic.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/GoogleNormalizedDistanceHeuristic.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class GoogleNormalizedDistanceHeuristicConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBackgroundIsSuperset = System.Text.Json.JsonEncodedText.Encode("background_is_superset"); - - public override Elastic.Clients.Elasticsearch.Aggregations.GoogleNormalizedDistanceHeuristic Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBackgroundIsSuperset = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBackgroundIsSuperset.TryReadProperty(ref reader, options, PropBackgroundIsSuperset, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.GoogleNormalizedDistanceHeuristic(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BackgroundIsSuperset = propBackgroundIsSuperset.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GoogleNormalizedDistanceHeuristic value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBackgroundIsSuperset, value.BackgroundIsSuperset, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.GoogleNormalizedDistanceHeuristicConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.GoogleNormalizedDistanceHeuristicConverter))] public sealed partial class GoogleNormalizedDistanceHeuristic { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrMethod.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrMethod.Converters.g.cs new file mode 100644 index 00000000000..b47023cdfb4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrMethod.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class HdrMethodConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNumberOfSignificantValueDigits = System.Text.Json.JsonEncodedText.Encode("number_of_significant_value_digits"); + + public override Elastic.Clients.Elasticsearch.Aggregations.HdrMethod Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propNumberOfSignificantValueDigits = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNumberOfSignificantValueDigits.TryReadProperty(ref reader, options, PropNumberOfSignificantValueDigits, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.HdrMethod(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + NumberOfSignificantValueDigits = propNumberOfSignificantValueDigits.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.HdrMethod value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNumberOfSignificantValueDigits, value.NumberOfSignificantValueDigits, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrMethod.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrMethod.g.cs index b671c1629c8..8ca7f06a52e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrMethod.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrMethod.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class HdrMethodConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNumberOfSignificantValueDigits = System.Text.Json.JsonEncodedText.Encode("number_of_significant_value_digits"); - - public override Elastic.Clients.Elasticsearch.Aggregations.HdrMethod Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propNumberOfSignificantValueDigits = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNumberOfSignificantValueDigits.TryReadProperty(ref reader, options, PropNumberOfSignificantValueDigits, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.HdrMethod(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - NumberOfSignificantValueDigits = propNumberOfSignificantValueDigits.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.HdrMethod value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNumberOfSignificantValueDigits, value.NumberOfSignificantValueDigits, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.HdrMethodConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.HdrMethodConverter))] public sealed partial class HdrMethod { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrPercentileRanksAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrPercentileRanksAggregate.Converters.g.cs new file mode 100644 index 00000000000..4c9348b0957 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrPercentileRanksAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class HdrPercentileRanksAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropValues = System.Text.Json.JsonEncodedText.Encode("values"); + + public override Elastic.Clients.Elasticsearch.Aggregations.HdrPercentileRanksAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propMeta = default; + LocalJsonValue> propValues = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propValues.TryReadProperty(ref reader, options, PropValues, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.HdrPercentileRanksAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Meta = propMeta.Value, + Values = propValues.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.HdrPercentileRanksAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropValues, value.Values, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrPercentileRanksAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrPercentileRanksAggregate.g.cs index 13ebc60e840..c064345fb19 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrPercentileRanksAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrPercentileRanksAggregate.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class HdrPercentileRanksAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropValues = System.Text.Json.JsonEncodedText.Encode("values"); - - public override Elastic.Clients.Elasticsearch.Aggregations.HdrPercentileRanksAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propMeta = default; - LocalJsonValue> propValues = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propValues.TryReadProperty(ref reader, options, PropValues, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.HdrPercentileRanksAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Meta = propMeta.Value, - Values = propValues.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.HdrPercentileRanksAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropValues, value.Values, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.HdrPercentileRanksAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.HdrPercentileRanksAggregateConverter))] public sealed partial class HdrPercentileRanksAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrPercentilesAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrPercentilesAggregate.Converters.g.cs new file mode 100644 index 00000000000..ceac3519632 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrPercentilesAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class HdrPercentilesAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropValues = System.Text.Json.JsonEncodedText.Encode("values"); + + public override Elastic.Clients.Elasticsearch.Aggregations.HdrPercentilesAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propMeta = default; + LocalJsonValue> propValues = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propValues.TryReadProperty(ref reader, options, PropValues, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.HdrPercentilesAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Meta = propMeta.Value, + Values = propValues.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.HdrPercentilesAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropValues, value.Values, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrPercentilesAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrPercentilesAggregate.g.cs index 9e93b65550a..fc1e53f5735 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrPercentilesAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HdrPercentilesAggregate.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class HdrPercentilesAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropValues = System.Text.Json.JsonEncodedText.Encode("values"); - - public override Elastic.Clients.Elasticsearch.Aggregations.HdrPercentilesAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propMeta = default; - LocalJsonValue> propValues = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propValues.TryReadProperty(ref reader, options, PropValues, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.HdrPercentilesAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Meta = propMeta.Value, - Values = propValues.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.HdrPercentilesAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropValues, value.Values, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.HdrPercentilesAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.HdrPercentilesAggregateConverter))] public sealed partial class HdrPercentilesAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramAggregate.Converters.g.cs new file mode 100644 index 00000000000..ba053d3d16a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class HistogramAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBuckets = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramAggregate.g.cs index bc6d1d0ead0..01b24803ed5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramAggregate.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class HistogramAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBuckets = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.HistogramAggregateConverter))] public sealed partial class HistogramAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramAggregation.Converters.g.cs new file mode 100644 index 00000000000..bc31850f4eb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramAggregation.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class HistogramAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExtendedBounds = System.Text.Json.JsonEncodedText.Encode("extended_bounds"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropHardBounds = System.Text.Json.JsonEncodedText.Encode("hard_bounds"); + private static readonly System.Text.Json.JsonEncodedText PropInterval = System.Text.Json.JsonEncodedText.Encode("interval"); + private static readonly System.Text.Json.JsonEncodedText PropMinDocCount = System.Text.Json.JsonEncodedText.Encode("min_doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropOffset = System.Text.Json.JsonEncodedText.Encode("offset"); + private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propExtendedBounds = default; + LocalJsonValue propField = default; + LocalJsonValue propFormat = default; + LocalJsonValue?> propHardBounds = default; + LocalJsonValue propInterval = default; + LocalJsonValue propMinDocCount = default; + LocalJsonValue propMissing = default; + LocalJsonValue propOffset = default; + LocalJsonValue>?> propOrder = default; + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExtendedBounds.TryReadProperty(ref reader, options, PropExtendedBounds, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propHardBounds.TryReadProperty(ref reader, options, PropHardBounds, null)) + { + continue; + } + + if (propInterval.TryReadProperty(ref reader, options, PropInterval, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinDocCount.TryReadProperty(ref reader, options, PropMinDocCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOffset.TryReadProperty(ref reader, options, PropOffset, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOrder.TryReadProperty(ref reader, options, PropOrder, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue>(o, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null)))) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ExtendedBounds = propExtendedBounds.Value, + Field = propField.Value, + Format = propFormat.Value, + HardBounds = propHardBounds.Value, + Interval = propInterval.Value, + MinDocCount = propMinDocCount.Value, + Missing = propMissing.Value, + Offset = propOffset.Value, + Order = propOrder.Value, + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExtendedBounds, value.ExtendedBounds, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropHardBounds, value.HardBounds, null, null); + writer.WriteProperty(options, PropInterval, value.Interval, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinDocCount, value.MinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMissing, value.Missing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOffset, value.Offset, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteSingleOrManyCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null))); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramAggregation.g.cs index 4ee48d07f34..3fa25c359c2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramAggregation.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class HistogramAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExtendedBounds = System.Text.Json.JsonEncodedText.Encode("extended_bounds"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropHardBounds = System.Text.Json.JsonEncodedText.Encode("hard_bounds"); - private static readonly System.Text.Json.JsonEncodedText PropInterval = System.Text.Json.JsonEncodedText.Encode("interval"); - private static readonly System.Text.Json.JsonEncodedText PropMinDocCount = System.Text.Json.JsonEncodedText.Encode("min_doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropOffset = System.Text.Json.JsonEncodedText.Encode("offset"); - private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propExtendedBounds = default; - LocalJsonValue propField = default; - LocalJsonValue propFormat = default; - LocalJsonValue?> propHardBounds = default; - LocalJsonValue propInterval = default; - LocalJsonValue propMinDocCount = default; - LocalJsonValue propMissing = default; - LocalJsonValue propOffset = default; - LocalJsonValue>?> propOrder = default; - LocalJsonValue propScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExtendedBounds.TryReadProperty(ref reader, options, PropExtendedBounds, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propHardBounds.TryReadProperty(ref reader, options, PropHardBounds, null)) - { - continue; - } - - if (propInterval.TryReadProperty(ref reader, options, PropInterval, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinDocCount.TryReadProperty(ref reader, options, PropMinDocCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOffset.TryReadProperty(ref reader, options, PropOffset, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOrder.TryReadProperty(ref reader, options, PropOrder, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue>(o, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null)))) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ExtendedBounds = propExtendedBounds.Value, - Field = propField.Value, - Format = propFormat.Value, - HardBounds = propHardBounds.Value, - Interval = propInterval.Value, - MinDocCount = propMinDocCount.Value, - Missing = propMissing.Value, - Offset = propOffset.Value, - Order = propOrder.Value, - Script = propScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExtendedBounds, value.ExtendedBounds, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropHardBounds, value.HardBounds, null, null); - writer.WriteProperty(options, PropInterval, value.Interval, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinDocCount, value.MinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMissing, value.Missing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOffset, value.Offset, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteSingleOrManyCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null))); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.HistogramAggregationConverter))] public sealed partial class HistogramAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramBucket.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramBucket.Converters.g.cs new file mode 100644 index 00000000000..fca10125708 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramBucket.Converters.g.cs @@ -0,0 +1,87 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class HistogramBucketConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); + private static readonly System.Text.Json.JsonEncodedText PropKeyAsString = System.Text.Json.JsonEncodedText.Encode("key_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.HistogramBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue propKey = default; + LocalJsonValue propKeyAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propKey.TryReadProperty(ref reader, options, PropKey, null)) + { + continue; + } + + if (propKeyAsString.TryReadProperty(ref reader, options, PropKeyAsString, null)) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.HistogramBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + Key = propKey.Value, + KeyAsString = propKeyAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.HistogramBucket value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropKey, value.Key, null, null); + writer.WriteProperty(options, PropKeyAsString, value.KeyAsString, null, null); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramBucket.g.cs index 99a84ea60e2..9b98fd11dec 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/HistogramBucket.g.cs @@ -23,70 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class HistogramBucketConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); - private static readonly System.Text.Json.JsonEncodedText PropKeyAsString = System.Text.Json.JsonEncodedText.Encode("key_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.HistogramBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue propKey = default; - LocalJsonValue propKeyAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propKey.TryReadProperty(ref reader, options, PropKey, null)) - { - continue; - } - - if (propKeyAsString.TryReadProperty(ref reader, options, PropKeyAsString, null)) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.HistogramBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - Key = propKey.Value, - KeyAsString = propKeyAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.HistogramBucket value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropKey, value.Key, null, null); - writer.WriteProperty(options, PropKeyAsString, value.KeyAsString, null, null); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.HistogramBucketConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.HistogramBucketConverter))] public sealed partial class HistogramBucket { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceAggregate.Converters.g.cs new file mode 100644 index 00000000000..866e361e882 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceAggregate.Converters.g.cs @@ -0,0 +1,105 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class InferenceAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFeatureImportance = System.Text.Json.JsonEncodedText.Encode("feature_importance"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropTopClasses = System.Text.Json.JsonEncodedText.Encode("top_classes"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + private static readonly System.Text.Json.JsonEncodedText PropWarning = System.Text.Json.JsonEncodedText.Encode("warning"); + + public override Elastic.Clients.Elasticsearch.Aggregations.InferenceAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propData = default; + LocalJsonValue?> propFeatureImportance = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue?> propTopClasses = default; + LocalJsonValue propValue = default; + LocalJsonValue propWarning = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFeatureImportance.TryReadProperty(ref reader, options, PropFeatureImportance, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propTopClasses.TryReadProperty(ref reader, options, PropTopClasses, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, null)) + { + continue; + } + + if (propWarning.TryReadProperty(ref reader, options, PropWarning, null)) + { + continue; + } + + propData ??= new System.Collections.Generic.Dictionary(); + reader.ReadProperty(options, out string key, out object value, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!); + propData[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.InferenceAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Data = propData, + FeatureImportance = propFeatureImportance.Value, + Meta = propMeta.Value, + TopClasses = propTopClasses.Value, + Value = propValue.Value, + Warning = propWarning.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.InferenceAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFeatureImportance, value.FeatureImportance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropTopClasses, value.TopClasses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropValue, value.Value, null, null); + writer.WriteProperty(options, PropWarning, value.Warning, null, null); + if (value.Data is not null) + { + foreach (var item in value.Data) + { + writer.WriteProperty(options, item.Key, item.Value, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceAggregate.g.cs index a5fc8df66ec..fff6593fc63 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceAggregate.g.cs @@ -23,88 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class InferenceAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFeatureImportance = System.Text.Json.JsonEncodedText.Encode("feature_importance"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropTopClasses = System.Text.Json.JsonEncodedText.Encode("top_classes"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - private static readonly System.Text.Json.JsonEncodedText PropWarning = System.Text.Json.JsonEncodedText.Encode("warning"); - - public override Elastic.Clients.Elasticsearch.Aggregations.InferenceAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propData = default; - LocalJsonValue?> propFeatureImportance = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue?> propTopClasses = default; - LocalJsonValue propValue = default; - LocalJsonValue propWarning = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFeatureImportance.TryReadProperty(ref reader, options, PropFeatureImportance, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propTopClasses.TryReadProperty(ref reader, options, PropTopClasses, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, null)) - { - continue; - } - - if (propWarning.TryReadProperty(ref reader, options, PropWarning, null)) - { - continue; - } - - propData ??= new System.Collections.Generic.Dictionary(); - reader.ReadProperty(options, out string key, out object value, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!); - propData[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.InferenceAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Data = propData, - FeatureImportance = propFeatureImportance.Value, - Meta = propMeta.Value, - TopClasses = propTopClasses.Value, - Value = propValue.Value, - Warning = propWarning.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.InferenceAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFeatureImportance, value.FeatureImportance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropTopClasses, value.TopClasses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropValue, value.Value, null, null); - writer.WriteProperty(options, PropWarning, value.Warning, null, null); - if (value.Data is not null) - { - foreach (var item in value.Data) - { - writer.WriteProperty(options, item.Key, item.Value, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.InferenceAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.InferenceAggregateConverter))] public sealed partial class InferenceAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceAggregation.Converters.g.cs new file mode 100644 index 00000000000..bac20f3fae9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceAggregation.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class InferenceAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceConfig = System.Text.Json.JsonEncodedText.Encode("inference_config"); + private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); + + public override Elastic.Clients.Elasticsearch.Aggregations.InferenceAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucketsPath = default; + LocalJsonValue propFormat = default; + LocalJsonValue propGapPolicy = default; + LocalJsonValue propInferenceConfig = default; + LocalJsonValue propModelId = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propInferenceConfig.TryReadProperty(ref reader, options, PropInferenceConfig, null)) + { + continue; + } + + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.InferenceAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BucketsPath = propBucketsPath.Value, + Format = propFormat.Value, + GapPolicy = propGapPolicy.Value, + InferenceConfig = propInferenceConfig.Value, + ModelId = propModelId.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.InferenceAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropInferenceConfig, value.InferenceConfig, null, null); + writer.WriteProperty(options, PropModelId, value.ModelId, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceAggregation.g.cs index fabc87ffba9..144fe0d85a7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceAggregation.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class InferenceAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceConfig = System.Text.Json.JsonEncodedText.Encode("inference_config"); - private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); - - public override Elastic.Clients.Elasticsearch.Aggregations.InferenceAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBucketsPath = default; - LocalJsonValue propFormat = default; - LocalJsonValue propGapPolicy = default; - LocalJsonValue propInferenceConfig = default; - LocalJsonValue propModelId = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propInferenceConfig.TryReadProperty(ref reader, options, PropInferenceConfig, null)) - { - continue; - } - - if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.InferenceAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BucketsPath = propBucketsPath.Value, - Format = propFormat.Value, - GapPolicy = propGapPolicy.Value, - InferenceConfig = propInferenceConfig.Value, - ModelId = propModelId.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.InferenceAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropInferenceConfig, value.InferenceConfig, null, null); - writer.WriteProperty(options, PropModelId, value.ModelId, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.InferenceAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.InferenceAggregationConverter))] public sealed partial class InferenceAggregation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceClassImportance.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceClassImportance.Converters.g.cs new file mode 100644 index 00000000000..4941b94ab6c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceClassImportance.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class InferenceClassImportanceConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClassName = System.Text.Json.JsonEncodedText.Encode("class_name"); + private static readonly System.Text.Json.JsonEncodedText PropImportance = System.Text.Json.JsonEncodedText.Encode("importance"); + + public override Elastic.Clients.Elasticsearch.Aggregations.InferenceClassImportance Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClassName = default; + LocalJsonValue propImportance = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClassName.TryReadProperty(ref reader, options, PropClassName, null)) + { + continue; + } + + if (propImportance.TryReadProperty(ref reader, options, PropImportance, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.InferenceClassImportance(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClassName = propClassName.Value, + Importance = propImportance.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.InferenceClassImportance value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClassName, value.ClassName, null, null); + writer.WriteProperty(options, PropImportance, value.Importance, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceClassImportance.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceClassImportance.g.cs index 36ac476f7b9..c9014d1cfd6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceClassImportance.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceClassImportance.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class InferenceClassImportanceConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClassName = System.Text.Json.JsonEncodedText.Encode("class_name"); - private static readonly System.Text.Json.JsonEncodedText PropImportance = System.Text.Json.JsonEncodedText.Encode("importance"); - - public override Elastic.Clients.Elasticsearch.Aggregations.InferenceClassImportance Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClassName = default; - LocalJsonValue propImportance = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClassName.TryReadProperty(ref reader, options, PropClassName, null)) - { - continue; - } - - if (propImportance.TryReadProperty(ref reader, options, PropImportance, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.InferenceClassImportance(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClassName = propClassName.Value, - Importance = propImportance.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.InferenceClassImportance value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClassName, value.ClassName, null, null); - writer.WriteProperty(options, PropImportance, value.Importance, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.InferenceClassImportanceConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.InferenceClassImportanceConverter))] public sealed partial class InferenceClassImportance { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceConfig.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceConfig.Converters.g.cs new file mode 100644 index 00000000000..1e718f10e99 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceConfig.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class InferenceConfigConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantClassification = System.Text.Json.JsonEncodedText.Encode("classification"); + private static readonly System.Text.Json.JsonEncodedText VariantRegression = System.Text.Json.JsonEncodedText.Encode("regression"); + + public override Elastic.Clients.Elasticsearch.Aggregations.InferenceConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantClassification)) + { + variantType = VariantClassification.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRegression)) + { + variantType = VariantRegression.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.InferenceConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.InferenceConfig value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "classification": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.ClassificationInferenceOptions)value.Variant, null, null); + break; + case "regression": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.RegressionInferenceOptions)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Aggregations.InferenceConfig)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceConfig.g.cs index a17fae69236..b7e0ec39afb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceConfig.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class InferenceConfigConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantClassification = System.Text.Json.JsonEncodedText.Encode("classification"); - private static readonly System.Text.Json.JsonEncodedText VariantRegression = System.Text.Json.JsonEncodedText.Encode("regression"); - - public override Elastic.Clients.Elasticsearch.Aggregations.InferenceConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantClassification)) - { - variantType = VariantClassification.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRegression)) - { - variantType = VariantRegression.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.InferenceConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.InferenceConfig value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "classification": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.ClassificationInferenceOptions)value.Variant, null, null); - break; - case "regression": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.RegressionInferenceOptions)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Aggregations.InferenceConfig)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.InferenceConfigConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.InferenceConfigConverter))] public sealed partial class InferenceConfig { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceFeatureImportance.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceFeatureImportance.Converters.g.cs new file mode 100644 index 00000000000..7eb8c4b6822 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceFeatureImportance.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class InferenceFeatureImportanceConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClasses = System.Text.Json.JsonEncodedText.Encode("classes"); + private static readonly System.Text.Json.JsonEncodedText PropFeatureName = System.Text.Json.JsonEncodedText.Encode("feature_name"); + private static readonly System.Text.Json.JsonEncodedText PropImportance = System.Text.Json.JsonEncodedText.Encode("importance"); + + public override Elastic.Clients.Elasticsearch.Aggregations.InferenceFeatureImportance Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propClasses = default; + LocalJsonValue propFeatureName = default; + LocalJsonValue propImportance = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClasses.TryReadProperty(ref reader, options, PropClasses, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propFeatureName.TryReadProperty(ref reader, options, PropFeatureName, null)) + { + continue; + } + + if (propImportance.TryReadProperty(ref reader, options, PropImportance, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.InferenceFeatureImportance(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Classes = propClasses.Value, + FeatureName = propFeatureName.Value, + Importance = propImportance.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.InferenceFeatureImportance value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClasses, value.Classes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFeatureName, value.FeatureName, null, null); + writer.WriteProperty(options, PropImportance, value.Importance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceFeatureImportance.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceFeatureImportance.g.cs index 785d79418f6..c23a3af062a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceFeatureImportance.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceFeatureImportance.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class InferenceFeatureImportanceConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClasses = System.Text.Json.JsonEncodedText.Encode("classes"); - private static readonly System.Text.Json.JsonEncodedText PropFeatureName = System.Text.Json.JsonEncodedText.Encode("feature_name"); - private static readonly System.Text.Json.JsonEncodedText PropImportance = System.Text.Json.JsonEncodedText.Encode("importance"); - - public override Elastic.Clients.Elasticsearch.Aggregations.InferenceFeatureImportance Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propClasses = default; - LocalJsonValue propFeatureName = default; - LocalJsonValue propImportance = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClasses.TryReadProperty(ref reader, options, PropClasses, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propFeatureName.TryReadProperty(ref reader, options, PropFeatureName, null)) - { - continue; - } - - if (propImportance.TryReadProperty(ref reader, options, PropImportance, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.InferenceFeatureImportance(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Classes = propClasses.Value, - FeatureName = propFeatureName.Value, - Importance = propImportance.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.InferenceFeatureImportance value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClasses, value.Classes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFeatureName, value.FeatureName, null, null); - writer.WriteProperty(options, PropImportance, value.Importance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.InferenceFeatureImportanceConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.InferenceFeatureImportanceConverter))] public sealed partial class InferenceFeatureImportance { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceTopClassEntry.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceTopClassEntry.Converters.g.cs new file mode 100644 index 00000000000..fc6c947b0df --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceTopClassEntry.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class InferenceTopClassEntryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClassName = System.Text.Json.JsonEncodedText.Encode("class_name"); + private static readonly System.Text.Json.JsonEncodedText PropClassProbability = System.Text.Json.JsonEncodedText.Encode("class_probability"); + private static readonly System.Text.Json.JsonEncodedText PropClassScore = System.Text.Json.JsonEncodedText.Encode("class_score"); + + public override Elastic.Clients.Elasticsearch.Aggregations.InferenceTopClassEntry Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClassName = default; + LocalJsonValue propClassProbability = default; + LocalJsonValue propClassScore = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClassName.TryReadProperty(ref reader, options, PropClassName, null)) + { + continue; + } + + if (propClassProbability.TryReadProperty(ref reader, options, PropClassProbability, null)) + { + continue; + } + + if (propClassScore.TryReadProperty(ref reader, options, PropClassScore, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.InferenceTopClassEntry(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClassName = propClassName.Value, + ClassProbability = propClassProbability.Value, + ClassScore = propClassScore.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.InferenceTopClassEntry value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClassName, value.ClassName, null, null); + writer.WriteProperty(options, PropClassProbability, value.ClassProbability, null, null); + writer.WriteProperty(options, PropClassScore, value.ClassScore, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceTopClassEntry.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceTopClassEntry.g.cs index 3cede6ead3e..fcf8fd5aa57 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceTopClassEntry.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/InferenceTopClassEntry.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class InferenceTopClassEntryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClassName = System.Text.Json.JsonEncodedText.Encode("class_name"); - private static readonly System.Text.Json.JsonEncodedText PropClassProbability = System.Text.Json.JsonEncodedText.Encode("class_probability"); - private static readonly System.Text.Json.JsonEncodedText PropClassScore = System.Text.Json.JsonEncodedText.Encode("class_score"); - - public override Elastic.Clients.Elasticsearch.Aggregations.InferenceTopClassEntry Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClassName = default; - LocalJsonValue propClassProbability = default; - LocalJsonValue propClassScore = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClassName.TryReadProperty(ref reader, options, PropClassName, null)) - { - continue; - } - - if (propClassProbability.TryReadProperty(ref reader, options, PropClassProbability, null)) - { - continue; - } - - if (propClassScore.TryReadProperty(ref reader, options, PropClassScore, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.InferenceTopClassEntry(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClassName = propClassName.Value, - ClassProbability = propClassProbability.Value, - ClassScore = propClassScore.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.InferenceTopClassEntry value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClassName, value.ClassName, null, null); - writer.WriteProperty(options, PropClassProbability, value.ClassProbability, null, null); - writer.WriteProperty(options, PropClassScore, value.ClassScore, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.InferenceTopClassEntryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.InferenceTopClassEntryConverter))] public sealed partial class InferenceTopClassEntry { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixAggregate.Converters.g.cs new file mode 100644 index 00000000000..19233f656c8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class IpPrefixAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.IpPrefixAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBuckets = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.IpPrefixAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.IpPrefixAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixAggregate.g.cs index d60de554fc0..5b92cd4ce82 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixAggregate.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class IpPrefixAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.IpPrefixAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBuckets = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.IpPrefixAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.IpPrefixAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.IpPrefixAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.IpPrefixAggregateConverter))] public sealed partial class IpPrefixAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixAggregation.Converters.g.cs new file mode 100644 index 00000000000..36898e94c9e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixAggregation.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class IpPrefixAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAppendPrefixLength = System.Text.Json.JsonEncodedText.Encode("append_prefix_length"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIsIpv6 = System.Text.Json.JsonEncodedText.Encode("is_ipv6"); + private static readonly System.Text.Json.JsonEncodedText PropMinDocCount = System.Text.Json.JsonEncodedText.Encode("min_doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropPrefixLength = System.Text.Json.JsonEncodedText.Encode("prefix_length"); + + public override Elastic.Clients.Elasticsearch.Aggregations.IpPrefixAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAppendPrefixLength = default; + LocalJsonValue propField = default; + LocalJsonValue propIsIpv6 = default; + LocalJsonValue propMinDocCount = default; + LocalJsonValue propPrefixLength = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAppendPrefixLength.TryReadProperty(ref reader, options, PropAppendPrefixLength, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIsIpv6.TryReadProperty(ref reader, options, PropIsIpv6, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinDocCount.TryReadProperty(ref reader, options, PropMinDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPrefixLength.TryReadProperty(ref reader, options, PropPrefixLength, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.IpPrefixAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AppendPrefixLength = propAppendPrefixLength.Value, + Field = propField.Value, + IsIpv6 = propIsIpv6.Value, + MinDocCount = propMinDocCount.Value, + PrefixLength = propPrefixLength.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.IpPrefixAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAppendPrefixLength, value.AppendPrefixLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIsIpv6, value.IsIpv6, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinDocCount, value.MinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPrefixLength, value.PrefixLength, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixAggregation.g.cs index 9abc4716ff1..82cf06fd3d1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixAggregation.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class IpPrefixAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAppendPrefixLength = System.Text.Json.JsonEncodedText.Encode("append_prefix_length"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIsIpv6 = System.Text.Json.JsonEncodedText.Encode("is_ipv6"); - private static readonly System.Text.Json.JsonEncodedText PropMinDocCount = System.Text.Json.JsonEncodedText.Encode("min_doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropPrefixLength = System.Text.Json.JsonEncodedText.Encode("prefix_length"); - - public override Elastic.Clients.Elasticsearch.Aggregations.IpPrefixAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAppendPrefixLength = default; - LocalJsonValue propField = default; - LocalJsonValue propIsIpv6 = default; - LocalJsonValue propMinDocCount = default; - LocalJsonValue propPrefixLength = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAppendPrefixLength.TryReadProperty(ref reader, options, PropAppendPrefixLength, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIsIpv6.TryReadProperty(ref reader, options, PropIsIpv6, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinDocCount.TryReadProperty(ref reader, options, PropMinDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPrefixLength.TryReadProperty(ref reader, options, PropPrefixLength, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.IpPrefixAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AppendPrefixLength = propAppendPrefixLength.Value, - Field = propField.Value, - IsIpv6 = propIsIpv6.Value, - MinDocCount = propMinDocCount.Value, - PrefixLength = propPrefixLength.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.IpPrefixAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAppendPrefixLength, value.AppendPrefixLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIsIpv6, value.IsIpv6, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinDocCount, value.MinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPrefixLength, value.PrefixLength, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.IpPrefixAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.IpPrefixAggregationConverter))] public sealed partial class IpPrefixAggregation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixBucket.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixBucket.Converters.g.cs new file mode 100644 index 00000000000..99f574ee473 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixBucket.Converters.g.cs @@ -0,0 +1,105 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class IpPrefixBucketConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropIsIpv6 = System.Text.Json.JsonEncodedText.Encode("is_ipv6"); + private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); + private static readonly System.Text.Json.JsonEncodedText PropNetmask = System.Text.Json.JsonEncodedText.Encode("netmask"); + private static readonly System.Text.Json.JsonEncodedText PropPrefixLength = System.Text.Json.JsonEncodedText.Encode("prefix_length"); + + public override Elastic.Clients.Elasticsearch.Aggregations.IpPrefixBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue propIsIpv6 = default; + LocalJsonValue propKey = default; + LocalJsonValue propNetmask = default; + LocalJsonValue propPrefixLength = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propIsIpv6.TryReadProperty(ref reader, options, PropIsIpv6, null)) + { + continue; + } + + if (propKey.TryReadProperty(ref reader, options, PropKey, null)) + { + continue; + } + + if (propNetmask.TryReadProperty(ref reader, options, PropNetmask, null)) + { + continue; + } + + if (propPrefixLength.TryReadProperty(ref reader, options, PropPrefixLength, null)) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.IpPrefixBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + IsIpv6 = propIsIpv6.Value, + Key = propKey.Value, + Netmask = propNetmask.Value, + PrefixLength = propPrefixLength.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.IpPrefixBucket value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropIsIpv6, value.IsIpv6, null, null); + writer.WriteProperty(options, PropKey, value.Key, null, null); + writer.WriteProperty(options, PropNetmask, value.Netmask, null, null); + writer.WriteProperty(options, PropPrefixLength, value.PrefixLength, null, null); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixBucket.g.cs index b4a40bb59ae..56365ecea6b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpPrefixBucket.g.cs @@ -23,88 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class IpPrefixBucketConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropIsIpv6 = System.Text.Json.JsonEncodedText.Encode("is_ipv6"); - private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); - private static readonly System.Text.Json.JsonEncodedText PropNetmask = System.Text.Json.JsonEncodedText.Encode("netmask"); - private static readonly System.Text.Json.JsonEncodedText PropPrefixLength = System.Text.Json.JsonEncodedText.Encode("prefix_length"); - - public override Elastic.Clients.Elasticsearch.Aggregations.IpPrefixBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue propIsIpv6 = default; - LocalJsonValue propKey = default; - LocalJsonValue propNetmask = default; - LocalJsonValue propPrefixLength = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propIsIpv6.TryReadProperty(ref reader, options, PropIsIpv6, null)) - { - continue; - } - - if (propKey.TryReadProperty(ref reader, options, PropKey, null)) - { - continue; - } - - if (propNetmask.TryReadProperty(ref reader, options, PropNetmask, null)) - { - continue; - } - - if (propPrefixLength.TryReadProperty(ref reader, options, PropPrefixLength, null)) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.IpPrefixBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - IsIpv6 = propIsIpv6.Value, - Key = propKey.Value, - Netmask = propNetmask.Value, - PrefixLength = propPrefixLength.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.IpPrefixBucket value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropIsIpv6, value.IsIpv6, null, null); - writer.WriteProperty(options, PropKey, value.Key, null, null); - writer.WriteProperty(options, PropNetmask, value.Netmask, null, null); - writer.WriteProperty(options, PropPrefixLength, value.PrefixLength, null, null); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.IpPrefixBucketConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.IpPrefixBucketConverter))] public sealed partial class IpPrefixBucket { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeAggregate.Converters.g.cs new file mode 100644 index 00000000000..5412769efe7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class IpRangeAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBuckets = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeAggregate.g.cs index 1e7ab07f9e4..c8119353fa3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeAggregate.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class IpRangeAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBuckets = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.IpRangeAggregateConverter))] public sealed partial class IpRangeAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeAggregation.Converters.g.cs new file mode 100644 index 00000000000..04f499618ef --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeAggregation.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class IpRangeAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropRanges = System.Text.Json.JsonEncodedText.Encode("ranges"); + + public override Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue?> propRanges = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propRanges.TryReadProperty(ref reader, options, PropRanges, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Ranges = propRanges.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropRanges, value.Ranges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeAggregation.g.cs index bf36469b27b..c0501b20771 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeAggregation.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class IpRangeAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropRanges = System.Text.Json.JsonEncodedText.Encode("ranges"); - - public override Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue?> propRanges = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propRanges.TryReadProperty(ref reader, options, PropRanges, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Ranges = propRanges.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropRanges, value.Ranges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.IpRangeAggregationConverter))] public sealed partial class IpRangeAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeAggregationRange.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeAggregationRange.Converters.g.cs new file mode 100644 index 00000000000..cff16224d47 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeAggregationRange.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class IpRangeAggregationRangeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFrom = System.Text.Json.JsonEncodedText.Encode("from"); + private static readonly System.Text.Json.JsonEncodedText PropMask = System.Text.Json.JsonEncodedText.Encode("mask"); + private static readonly System.Text.Json.JsonEncodedText PropTo = System.Text.Json.JsonEncodedText.Encode("to"); + + public override Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregationRange Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFrom = default; + LocalJsonValue propMask = default; + LocalJsonValue propTo = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFrom.TryReadProperty(ref reader, options, PropFrom, null)) + { + continue; + } + + if (propMask.TryReadProperty(ref reader, options, PropMask, null)) + { + continue; + } + + if (propTo.TryReadProperty(ref reader, options, PropTo, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregationRange(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + From = propFrom.Value, + Mask = propMask.Value, + To = propTo.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregationRange value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFrom, value.From, null, null); + writer.WriteProperty(options, PropMask, value.Mask, null, null); + writer.WriteProperty(options, PropTo, value.To, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeAggregationRange.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeAggregationRange.g.cs index cc7069d33dc..70d9a41272f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeAggregationRange.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeAggregationRange.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class IpRangeAggregationRangeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFrom = System.Text.Json.JsonEncodedText.Encode("from"); - private static readonly System.Text.Json.JsonEncodedText PropMask = System.Text.Json.JsonEncodedText.Encode("mask"); - private static readonly System.Text.Json.JsonEncodedText PropTo = System.Text.Json.JsonEncodedText.Encode("to"); - - public override Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregationRange Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFrom = default; - LocalJsonValue propMask = default; - LocalJsonValue propTo = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFrom.TryReadProperty(ref reader, options, PropFrom, null)) - { - continue; - } - - if (propMask.TryReadProperty(ref reader, options, PropMask, null)) - { - continue; - } - - if (propTo.TryReadProperty(ref reader, options, PropTo, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregationRange(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - From = propFrom.Value, - Mask = propMask.Value, - To = propTo.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregationRange value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFrom, value.From, null, null); - writer.WriteProperty(options, PropMask, value.Mask, null, null); - writer.WriteProperty(options, PropTo, value.To, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.IpRangeAggregationRangeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.IpRangeAggregationRangeConverter))] public sealed partial class IpRangeAggregationRange { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeBucket.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeBucket.Converters.g.cs new file mode 100644 index 00000000000..afde9e7c2f9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeBucket.Converters.g.cs @@ -0,0 +1,96 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class IpRangeBucketConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropFrom = System.Text.Json.JsonEncodedText.Encode("from"); + private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); + private static readonly System.Text.Json.JsonEncodedText PropTo = System.Text.Json.JsonEncodedText.Encode("to"); + + public override Elastic.Clients.Elasticsearch.Aggregations.IpRangeBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue propFrom = default; + LocalJsonValue propKey = default; + LocalJsonValue propTo = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propFrom.TryReadProperty(ref reader, options, PropFrom, null)) + { + continue; + } + + if (propKey.TryReadProperty(ref reader, options, PropKey, null)) + { + continue; + } + + if (propTo.TryReadProperty(ref reader, options, PropTo, null)) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.IpRangeBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + From = propFrom.Value, + Key = propKey.Value, + To = propTo.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.IpRangeBucket value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropFrom, value.From, null, null); + writer.WriteProperty(options, PropKey, value.Key, null, null); + writer.WriteProperty(options, PropTo, value.To, null, null); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeBucket.g.cs index 448479ac7b9..c8323fecfdc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/IpRangeBucket.g.cs @@ -23,79 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class IpRangeBucketConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropFrom = System.Text.Json.JsonEncodedText.Encode("from"); - private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); - private static readonly System.Text.Json.JsonEncodedText PropTo = System.Text.Json.JsonEncodedText.Encode("to"); - - public override Elastic.Clients.Elasticsearch.Aggregations.IpRangeBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue propFrom = default; - LocalJsonValue propKey = default; - LocalJsonValue propTo = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propFrom.TryReadProperty(ref reader, options, PropFrom, null)) - { - continue; - } - - if (propKey.TryReadProperty(ref reader, options, PropKey, null)) - { - continue; - } - - if (propTo.TryReadProperty(ref reader, options, PropTo, null)) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.IpRangeBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - From = propFrom.Value, - Key = propKey.Value, - To = propTo.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.IpRangeBucket value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropFrom, value.From, null, null); - writer.WriteProperty(options, PropKey, value.Key, null, null); - writer.WriteProperty(options, PropTo, value.To, null, null); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.IpRangeBucketConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.IpRangeBucketConverter))] public sealed partial class IpRangeBucket { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongRareTermsAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongRareTermsAggregate.Converters.g.cs new file mode 100644 index 00000000000..ff0185226de --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongRareTermsAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class LongRareTermsAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.LongRareTermsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBuckets = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.LongRareTermsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.LongRareTermsAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongRareTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongRareTermsAggregate.g.cs index 0f0ae486361..2d82691a220 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongRareTermsAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongRareTermsAggregate.g.cs @@ -23,60 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class LongRareTermsAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.LongRareTermsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBuckets = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.LongRareTermsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.LongRareTermsAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - /// /// /// Result of the rare_terms aggregation when the field is some kind of whole number like a integer, long, or a date. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.LongRareTermsAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.LongRareTermsAggregateConverter))] public sealed partial class LongRareTermsAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongRareTermsBucket.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongRareTermsBucket.Converters.g.cs new file mode 100644 index 00000000000..7894a1ea37c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongRareTermsBucket.Converters.g.cs @@ -0,0 +1,87 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class LongRareTermsBucketConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); + private static readonly System.Text.Json.JsonEncodedText PropKeyAsString = System.Text.Json.JsonEncodedText.Encode("key_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.LongRareTermsBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue propKey = default; + LocalJsonValue propKeyAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propKey.TryReadProperty(ref reader, options, PropKey, null)) + { + continue; + } + + if (propKeyAsString.TryReadProperty(ref reader, options, PropKeyAsString, null)) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.LongRareTermsBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + Key = propKey.Value, + KeyAsString = propKeyAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.LongRareTermsBucket value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropKey, value.Key, null, null); + writer.WriteProperty(options, PropKeyAsString, value.KeyAsString, null, null); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongRareTermsBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongRareTermsBucket.g.cs index 0a7ae421481..08279380950 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongRareTermsBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongRareTermsBucket.g.cs @@ -23,70 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class LongRareTermsBucketConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); - private static readonly System.Text.Json.JsonEncodedText PropKeyAsString = System.Text.Json.JsonEncodedText.Encode("key_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.LongRareTermsBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue propKey = default; - LocalJsonValue propKeyAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propKey.TryReadProperty(ref reader, options, PropKey, null)) - { - continue; - } - - if (propKeyAsString.TryReadProperty(ref reader, options, PropKeyAsString, null)) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.LongRareTermsBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - Key = propKey.Value, - KeyAsString = propKeyAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.LongRareTermsBucket value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropKey, value.Key, null, null); - writer.WriteProperty(options, PropKeyAsString, value.KeyAsString, null, null); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.LongRareTermsBucketConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.LongRareTermsBucketConverter))] public sealed partial class LongRareTermsBucket { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongTermsAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongTermsAggregate.Converters.g.cs new file mode 100644 index 00000000000..414cda2aed9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongTermsAggregate.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class LongTermsAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropDocCountErrorUpperBound = System.Text.Json.JsonEncodedText.Encode("doc_count_error_upper_bound"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropSumOtherDocCount = System.Text.Json.JsonEncodedText.Encode("sum_other_doc_count"); + + public override Elastic.Clients.Elasticsearch.Aggregations.LongTermsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBuckets = default; + LocalJsonValue propDocCountErrorUpperBound = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propSumOtherDocCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propDocCountErrorUpperBound.TryReadProperty(ref reader, options, PropDocCountErrorUpperBound, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propSumOtherDocCount.TryReadProperty(ref reader, options, PropSumOtherDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.LongTermsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + DocCountErrorUpperBound = propDocCountErrorUpperBound.Value, + Meta = propMeta.Value, + SumOtherDocCount = propSumOtherDocCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.LongTermsAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDocCountErrorUpperBound, value.DocCountErrorUpperBound, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropSumOtherDocCount, value.SumOtherDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongTermsAggregate.g.cs index a507b5f5339..3a58afc8e95 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongTermsAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongTermsAggregate.g.cs @@ -23,78 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class LongTermsAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropDocCountErrorUpperBound = System.Text.Json.JsonEncodedText.Encode("doc_count_error_upper_bound"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropSumOtherDocCount = System.Text.Json.JsonEncodedText.Encode("sum_other_doc_count"); - - public override Elastic.Clients.Elasticsearch.Aggregations.LongTermsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBuckets = default; - LocalJsonValue propDocCountErrorUpperBound = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propSumOtherDocCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propDocCountErrorUpperBound.TryReadProperty(ref reader, options, PropDocCountErrorUpperBound, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propSumOtherDocCount.TryReadProperty(ref reader, options, PropSumOtherDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.LongTermsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - DocCountErrorUpperBound = propDocCountErrorUpperBound.Value, - Meta = propMeta.Value, - SumOtherDocCount = propSumOtherDocCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.LongTermsAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDocCountErrorUpperBound, value.DocCountErrorUpperBound, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropSumOtherDocCount, value.SumOtherDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Result of a terms aggregation when the field is some kind of whole number like a integer, long, or a date. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.LongTermsAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.LongTermsAggregateConverter))] public sealed partial class LongTermsAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongTermsBucket.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongTermsBucket.Converters.g.cs new file mode 100644 index 00000000000..3ebf740a147 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongTermsBucket.Converters.g.cs @@ -0,0 +1,96 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class LongTermsBucketConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropDocCountErrorUpperBound = System.Text.Json.JsonEncodedText.Encode("doc_count_error_upper_bound"); + private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); + private static readonly System.Text.Json.JsonEncodedText PropKeyAsString = System.Text.Json.JsonEncodedText.Encode("key_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.LongTermsBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue propDocCountErrorUpperBound = default; + LocalJsonValue propKey = default; + LocalJsonValue propKeyAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propDocCountErrorUpperBound.TryReadProperty(ref reader, options, PropDocCountErrorUpperBound, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propKey.TryReadProperty(ref reader, options, PropKey, null)) + { + continue; + } + + if (propKeyAsString.TryReadProperty(ref reader, options, PropKeyAsString, null)) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.LongTermsBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + DocCountErrorUpperBound = propDocCountErrorUpperBound.Value, + Key = propKey.Value, + KeyAsString = propKeyAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.LongTermsBucket value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropDocCountErrorUpperBound, value.DocCountErrorUpperBound, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropKey, value.Key, null, null); + writer.WriteProperty(options, PropKeyAsString, value.KeyAsString, null, null); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongTermsBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongTermsBucket.g.cs index 46ee6ad1505..b9da33f4d27 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongTermsBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongTermsBucket.g.cs @@ -23,79 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class LongTermsBucketConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropDocCountErrorUpperBound = System.Text.Json.JsonEncodedText.Encode("doc_count_error_upper_bound"); - private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); - private static readonly System.Text.Json.JsonEncodedText PropKeyAsString = System.Text.Json.JsonEncodedText.Encode("key_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.LongTermsBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue propDocCountErrorUpperBound = default; - LocalJsonValue propKey = default; - LocalJsonValue propKeyAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propDocCountErrorUpperBound.TryReadProperty(ref reader, options, PropDocCountErrorUpperBound, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propKey.TryReadProperty(ref reader, options, PropKey, null)) - { - continue; - } - - if (propKeyAsString.TryReadProperty(ref reader, options, PropKeyAsString, null)) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.LongTermsBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - DocCountErrorUpperBound = propDocCountErrorUpperBound.Value, - Key = propKey.Value, - KeyAsString = propKeyAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.LongTermsBucket value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropDocCountErrorUpperBound, value.DocCountErrorUpperBound, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropKey, value.Key, null, null); - writer.WriteProperty(options, PropKeyAsString, value.KeyAsString, null, null); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.LongTermsBucketConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.LongTermsBucketConverter))] public sealed partial class LongTermsBucket { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsAggregate.Converters.g.cs new file mode 100644 index 00000000000..71c2e11056a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsAggregate.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class MatrixStatsAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDocCount = default; + LocalJsonValue?> propFields = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DocCount = propDocCount.Value, + Fields = propFields.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsAggregate.g.cs index 6509c120572..59db5fed9e2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsAggregate.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class MatrixStatsAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDocCount = default; - LocalJsonValue?> propFields = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DocCount = propDocCount.Value, - Fields = propFields.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.MatrixStatsAggregateConverter))] public sealed partial class MatrixStatsAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsAggregation.Converters.g.cs new file mode 100644 index 00000000000..26280691c73 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsAggregation.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class MatrixStatsAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); + + public override Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFields = default; + LocalJsonValue?> propMissing = default; + LocalJsonValue propMode = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFields.TryReadProperty(ref reader, options, PropFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propMode.TryReadProperty(ref reader, options, PropMode, static Elastic.Clients.Elasticsearch.SortMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Fields = propFields.Value, + Missing = propMissing.Value, + Mode = propMode.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropMissing, value.Missing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropMode, value.Mode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortMode? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsAggregation.g.cs index d28c57ffd0c..d6eac7b4613 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsAggregation.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class MatrixStatsAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); - - public override Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFields = default; - LocalJsonValue?> propMissing = default; - LocalJsonValue propMode = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFields.TryReadProperty(ref reader, options, PropFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propMode.TryReadProperty(ref reader, options, PropMode, static Elastic.Clients.Elasticsearch.SortMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Fields = propFields.Value, - Missing = propMissing.Value, - Mode = propMode.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropMissing, value.Missing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropMode, value.Mode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortMode? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.MatrixStatsAggregationConverter))] public sealed partial class MatrixStatsAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsFields.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsFields.Converters.g.cs new file mode 100644 index 00000000000..c464888955c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsFields.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class MatrixStatsFieldsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCorrelation = System.Text.Json.JsonEncodedText.Encode("correlation"); + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropCovariance = System.Text.Json.JsonEncodedText.Encode("covariance"); + private static readonly System.Text.Json.JsonEncodedText PropKurtosis = System.Text.Json.JsonEncodedText.Encode("kurtosis"); + private static readonly System.Text.Json.JsonEncodedText PropMean = System.Text.Json.JsonEncodedText.Encode("mean"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropSkewness = System.Text.Json.JsonEncodedText.Encode("skewness"); + private static readonly System.Text.Json.JsonEncodedText PropVariance = System.Text.Json.JsonEncodedText.Encode("variance"); + + public override Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsFields Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propCorrelation = default; + LocalJsonValue propCount = default; + LocalJsonValue> propCovariance = default; + LocalJsonValue propKurtosis = default; + LocalJsonValue propMean = default; + LocalJsonValue propName = default; + LocalJsonValue propSkewness = default; + LocalJsonValue propVariance = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCorrelation.TryReadProperty(ref reader, options, PropCorrelation, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propCovariance.TryReadProperty(ref reader, options, PropCovariance, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propKurtosis.TryReadProperty(ref reader, options, PropKurtosis, null)) + { + continue; + } + + if (propMean.TryReadProperty(ref reader, options, PropMean, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propSkewness.TryReadProperty(ref reader, options, PropSkewness, null)) + { + continue; + } + + if (propVariance.TryReadProperty(ref reader, options, PropVariance, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsFields(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Correlation = propCorrelation.Value, + Count = propCount.Value, + Covariance = propCovariance.Value, + Kurtosis = propKurtosis.Value, + Mean = propMean.Value, + Name = propName.Value, + Skewness = propSkewness.Value, + Variance = propVariance.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsFields value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCorrelation, value.Correlation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropCovariance, value.Covariance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropKurtosis, value.Kurtosis, null, null); + writer.WriteProperty(options, PropMean, value.Mean, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropSkewness, value.Skewness, null, null); + writer.WriteProperty(options, PropVariance, value.Variance, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsFields.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsFields.g.cs index 202857599a2..f4c8370c36a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsFields.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsFields.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class MatrixStatsFieldsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCorrelation = System.Text.Json.JsonEncodedText.Encode("correlation"); - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropCovariance = System.Text.Json.JsonEncodedText.Encode("covariance"); - private static readonly System.Text.Json.JsonEncodedText PropKurtosis = System.Text.Json.JsonEncodedText.Encode("kurtosis"); - private static readonly System.Text.Json.JsonEncodedText PropMean = System.Text.Json.JsonEncodedText.Encode("mean"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropSkewness = System.Text.Json.JsonEncodedText.Encode("skewness"); - private static readonly System.Text.Json.JsonEncodedText PropVariance = System.Text.Json.JsonEncodedText.Encode("variance"); - - public override Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsFields Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propCorrelation = default; - LocalJsonValue propCount = default; - LocalJsonValue> propCovariance = default; - LocalJsonValue propKurtosis = default; - LocalJsonValue propMean = default; - LocalJsonValue propName = default; - LocalJsonValue propSkewness = default; - LocalJsonValue propVariance = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCorrelation.TryReadProperty(ref reader, options, PropCorrelation, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propCovariance.TryReadProperty(ref reader, options, PropCovariance, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propKurtosis.TryReadProperty(ref reader, options, PropKurtosis, null)) - { - continue; - } - - if (propMean.TryReadProperty(ref reader, options, PropMean, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propSkewness.TryReadProperty(ref reader, options, PropSkewness, null)) - { - continue; - } - - if (propVariance.TryReadProperty(ref reader, options, PropVariance, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsFields(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Correlation = propCorrelation.Value, - Count = propCount.Value, - Covariance = propCovariance.Value, - Kurtosis = propKurtosis.Value, - Mean = propMean.Value, - Name = propName.Value, - Skewness = propSkewness.Value, - Variance = propVariance.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsFields value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCorrelation, value.Correlation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropCovariance, value.Covariance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropKurtosis, value.Kurtosis, null, null); - writer.WriteProperty(options, PropMean, value.Mean, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropSkewness, value.Skewness, null, null); - writer.WriteProperty(options, PropVariance, value.Variance, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.MatrixStatsFieldsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.MatrixStatsFieldsConverter))] public sealed partial class MatrixStatsFields { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregate.Converters.g.cs new file mode 100644 index 00000000000..8baec11945d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregate.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class MaxAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.MaxAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propMeta = default; + LocalJsonValue propValue = default; + LocalJsonValue propValueAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.MaxAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Meta = propMeta.Value, + Value = propValue.Value, + ValueAsString = propValueAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MaxAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregate.g.cs index 1588129aa4a..37a3f40e27d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregate.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class MaxAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.MaxAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propMeta = default; - LocalJsonValue propValue = default; - LocalJsonValue propValueAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.MaxAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Meta = propMeta.Value, - Value = propValue.Value, - ValueAsString = propValueAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MaxAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.MaxAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.MaxAggregateConverter))] public sealed partial class MaxAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregation.Converters.g.cs new file mode 100644 index 00000000000..358d10b67e5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregation.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class MaxAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.Aggregations.MaxAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propFormat = default; + LocalJsonValue propMissing = default; + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.MaxAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Format = propFormat.Value, + Missing = propMissing.Value, + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MaxAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregation.g.cs index 5a9f459e1f4..e213192caec 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregation.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class MaxAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.Aggregations.MaxAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propFormat = default; - LocalJsonValue propMissing = default; - LocalJsonValue propScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.MaxAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Format = propFormat.Value, - Missing = propMissing.Value, - Script = propScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MaxAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropMissing, value.Missing, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.MaxAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.MaxAggregationConverter))] public sealed partial class MaxAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxBucketAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxBucketAggregation.Converters.g.cs new file mode 100644 index 00000000000..9546d7bd470 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxBucketAggregation.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class MaxBucketAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); + + public override Elastic.Clients.Elasticsearch.Aggregations.MaxBucketAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucketsPath = default; + LocalJsonValue propFormat = default; + LocalJsonValue propGapPolicy = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.MaxBucketAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BucketsPath = propBucketsPath.Value, + Format = propFormat.Value, + GapPolicy = propGapPolicy.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MaxBucketAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxBucketAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxBucketAggregation.g.cs index 8aaebee83de..5c73e9182cc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxBucketAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxBucketAggregation.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class MaxBucketAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); - - public override Elastic.Clients.Elasticsearch.Aggregations.MaxBucketAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBucketsPath = default; - LocalJsonValue propFormat = default; - LocalJsonValue propGapPolicy = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.MaxBucketAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BucketsPath = propBucketsPath.Value, - Format = propFormat.Value, - GapPolicy = propGapPolicy.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MaxBucketAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.MaxBucketAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.MaxBucketAggregationConverter))] public sealed partial class MaxBucketAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregate.Converters.g.cs new file mode 100644 index 00000000000..b4486d5deca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregate.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class MedianAbsoluteDeviationAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviationAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propMeta = default; + LocalJsonValue propValue = default; + LocalJsonValue propValueAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviationAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Meta = propMeta.Value, + Value = propValue.Value, + ValueAsString = propValueAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviationAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregate.g.cs index 33590566071..07d098d7ebf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregate.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class MedianAbsoluteDeviationAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviationAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propMeta = default; - LocalJsonValue propValue = default; - LocalJsonValue propValueAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviationAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Meta = propMeta.Value, - Value = propValue.Value, - ValueAsString = propValueAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviationAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviationAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.MedianAbsoluteDeviationAggregateConverter))] public sealed partial class MedianAbsoluteDeviationAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregation.Converters.g.cs new file mode 100644 index 00000000000..98808274b25 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregation.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class MedianAbsoluteDeviationAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCompression = System.Text.Json.JsonEncodedText.Encode("compression"); + private static readonly System.Text.Json.JsonEncodedText PropExecutionHint = System.Text.Json.JsonEncodedText.Encode("execution_hint"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviationAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCompression = default; + LocalJsonValue propExecutionHint = default; + LocalJsonValue propField = default; + LocalJsonValue propFormat = default; + LocalJsonValue propMissing = default; + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCompression.TryReadProperty(ref reader, options, PropCompression, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propExecutionHint.TryReadProperty(ref reader, options, PropExecutionHint, static Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviationAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Compression = propCompression.Value, + ExecutionHint = propExecutionHint.Value, + Field = propField.Value, + Format = propFormat.Value, + Missing = propMissing.Value, + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviationAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCompression, value.Compression, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropExecutionHint, value.ExecutionHint, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregation.g.cs index abffa87005f..a5870c606e8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregation.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class MedianAbsoluteDeviationAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCompression = System.Text.Json.JsonEncodedText.Encode("compression"); - private static readonly System.Text.Json.JsonEncodedText PropExecutionHint = System.Text.Json.JsonEncodedText.Encode("execution_hint"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviationAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCompression = default; - LocalJsonValue propExecutionHint = default; - LocalJsonValue propField = default; - LocalJsonValue propFormat = default; - LocalJsonValue propMissing = default; - LocalJsonValue propScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCompression.TryReadProperty(ref reader, options, PropCompression, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propExecutionHint.TryReadProperty(ref reader, options, PropExecutionHint, static Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviationAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Compression = propCompression.Value, - ExecutionHint = propExecutionHint.Value, - Field = propField.Value, - Format = propFormat.Value, - Missing = propMissing.Value, - Script = propScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviationAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCompression, value.Compression, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropExecutionHint, value.ExecutionHint, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropMissing, value.Missing, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.MedianAbsoluteDeviationAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.MedianAbsoluteDeviationAggregationConverter))] public sealed partial class MedianAbsoluteDeviationAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinAggregate.Converters.g.cs new file mode 100644 index 00000000000..12480553fb3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinAggregate.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class MinAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.MinAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propMeta = default; + LocalJsonValue propValue = default; + LocalJsonValue propValueAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.MinAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Meta = propMeta.Value, + Value = propValue.Value, + ValueAsString = propValueAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MinAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinAggregate.g.cs index 0db698df412..d8a3fdf059a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinAggregate.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class MinAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.MinAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propMeta = default; - LocalJsonValue propValue = default; - LocalJsonValue propValueAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.MinAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Meta = propMeta.Value, - Value = propValue.Value, - ValueAsString = propValueAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MinAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.MinAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.MinAggregateConverter))] public sealed partial class MinAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinAggregation.Converters.g.cs new file mode 100644 index 00000000000..b1a09415cb3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinAggregation.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class MinAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.Aggregations.MinAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propFormat = default; + LocalJsonValue propMissing = default; + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.MinAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Format = propFormat.Value, + Missing = propMissing.Value, + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MinAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinAggregation.g.cs index e815b21b449..59f36ca87ec 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinAggregation.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class MinAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.Aggregations.MinAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propFormat = default; - LocalJsonValue propMissing = default; - LocalJsonValue propScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.MinAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Format = propFormat.Value, - Missing = propMissing.Value, - Script = propScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MinAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropMissing, value.Missing, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.MinAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.MinAggregationConverter))] public sealed partial class MinAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinBucketAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinBucketAggregation.Converters.g.cs new file mode 100644 index 00000000000..082793e8540 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinBucketAggregation.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class MinBucketAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); + + public override Elastic.Clients.Elasticsearch.Aggregations.MinBucketAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucketsPath = default; + LocalJsonValue propFormat = default; + LocalJsonValue propGapPolicy = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.MinBucketAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BucketsPath = propBucketsPath.Value, + Format = propFormat.Value, + GapPolicy = propGapPolicy.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MinBucketAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinBucketAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinBucketAggregation.g.cs index 89e00fe3777..b2b400cb2b9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinBucketAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinBucketAggregation.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class MinBucketAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); - - public override Elastic.Clients.Elasticsearch.Aggregations.MinBucketAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBucketsPath = default; - LocalJsonValue propFormat = default; - LocalJsonValue propGapPolicy = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.MinBucketAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BucketsPath = propBucketsPath.Value, - Format = propFormat.Value, - GapPolicy = propGapPolicy.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MinBucketAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.MinBucketAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.MinBucketAggregationConverter))] public sealed partial class MinBucketAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinimumInterval.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinimumInterval.Converters.g.cs new file mode 100644 index 00000000000..65cacba4740 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinimumInterval.Converters.g.cs @@ -0,0 +1,137 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class MinimumIntervalConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberDay = System.Text.Json.JsonEncodedText.Encode("day"); + private static readonly System.Text.Json.JsonEncodedText MemberHour = System.Text.Json.JsonEncodedText.Encode("hour"); + private static readonly System.Text.Json.JsonEncodedText MemberMinute = System.Text.Json.JsonEncodedText.Encode("minute"); + private static readonly System.Text.Json.JsonEncodedText MemberMonth = System.Text.Json.JsonEncodedText.Encode("month"); + private static readonly System.Text.Json.JsonEncodedText MemberSecond = System.Text.Json.JsonEncodedText.Encode("second"); + private static readonly System.Text.Json.JsonEncodedText MemberYear = System.Text.Json.JsonEncodedText.Encode("year"); + + public override Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberDay)) + { + return Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Day; + } + + if (reader.ValueTextEquals(MemberHour)) + { + return Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Hour; + } + + if (reader.ValueTextEquals(MemberMinute)) + { + return Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Minute; + } + + if (reader.ValueTextEquals(MemberMonth)) + { + return Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Month; + } + + if (reader.ValueTextEquals(MemberSecond)) + { + return Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Second; + } + + if (reader.ValueTextEquals(MemberYear)) + { + return Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Year; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberDay.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Day; + } + + if (string.Equals(value, MemberHour.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Hour; + } + + if (string.Equals(value, MemberMinute.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Minute; + } + + if (string.Equals(value, MemberMonth.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Month; + } + + if (string.Equals(value, MemberSecond.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Second; + } + + if (string.Equals(value, MemberYear.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Year; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Day: + writer.WriteStringValue(MemberDay); + break; + case Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Hour: + writer.WriteStringValue(MemberHour); + break; + case Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Minute: + writer.WriteStringValue(MemberMinute); + break; + case Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Month: + writer.WriteStringValue(MemberMonth); + break; + case Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Second: + writer.WriteStringValue(MemberSecond); + break; + case Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Year: + writer.WriteStringValue(MemberYear); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinimumInterval.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinimumInterval.g.cs new file mode 100644 index 00000000000..04f97f55086 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MinimumInterval.g.cs @@ -0,0 +1,41 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.MinimumIntervalConverter))] +public enum MinimumInterval +{ + [System.Runtime.Serialization.EnumMember(Value = "day")] + Day, + [System.Runtime.Serialization.EnumMember(Value = "hour")] + Hour, + [System.Runtime.Serialization.EnumMember(Value = "minute")] + Minute, + [System.Runtime.Serialization.EnumMember(Value = "month")] + Month, + [System.Runtime.Serialization.EnumMember(Value = "second")] + Second, + [System.Runtime.Serialization.EnumMember(Value = "year")] + Year +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregate.Converters.g.cs new file mode 100644 index 00000000000..0d1bdcd6fb8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregate.Converters.g.cs @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class MissingAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.MissingAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.MissingAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MissingAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregate.g.cs index db6bf806e6e..70a8ab7f1bb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregate.g.cs @@ -23,61 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class MissingAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.MissingAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.MissingAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MissingAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.MissingAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.MissingAggregateConverter))] public sealed partial class MissingAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregation.Converters.g.cs new file mode 100644 index 00000000000..70a172f1685 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregation.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class MissingAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + + public override Elastic.Clients.Elasticsearch.Aggregations.MissingAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propMissing = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.MissingAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Missing = propMissing.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MissingAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregation.g.cs index 4009bb4b421..033563a21ef 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregation.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class MissingAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - - public override Elastic.Clients.Elasticsearch.Aggregations.MissingAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propMissing = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.MissingAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Missing = propMissing.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MissingAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropMissing, value.Missing, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.MissingAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.MissingAggregationConverter))] public sealed partial class MissingAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingOrder.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingOrder.Converters.g.cs new file mode 100644 index 00000000000..cf1e63f7c38 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingOrder.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class MissingOrderConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberDefault = System.Text.Json.JsonEncodedText.Encode("default"); + private static readonly System.Text.Json.JsonEncodedText MemberFirst = System.Text.Json.JsonEncodedText.Encode("first"); + private static readonly System.Text.Json.JsonEncodedText MemberLast = System.Text.Json.JsonEncodedText.Encode("last"); + + public override Elastic.Clients.Elasticsearch.Aggregations.MissingOrder Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberDefault)) + { + return Elastic.Clients.Elasticsearch.Aggregations.MissingOrder.Default; + } + + if (reader.ValueTextEquals(MemberFirst)) + { + return Elastic.Clients.Elasticsearch.Aggregations.MissingOrder.First; + } + + if (reader.ValueTextEquals(MemberLast)) + { + return Elastic.Clients.Elasticsearch.Aggregations.MissingOrder.Last; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberDefault.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.MissingOrder.Default; + } + + if (string.Equals(value, MemberFirst.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.MissingOrder.First; + } + + if (string.Equals(value, MemberLast.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.MissingOrder.Last; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.MissingOrder)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MissingOrder value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Aggregations.MissingOrder.Default: + writer.WriteStringValue(MemberDefault); + break; + case Elastic.Clients.Elasticsearch.Aggregations.MissingOrder.First: + writer.WriteStringValue(MemberFirst); + break; + case Elastic.Clients.Elasticsearch.Aggregations.MissingOrder.Last: + writer.WriteStringValue(MemberLast); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.MissingOrder)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Aggregations.MissingOrder ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MissingOrder value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingOrder.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingOrder.g.cs new file mode 100644 index 00000000000..a90130449fc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingOrder.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.MissingOrderConverter))] +public enum MissingOrder +{ + [System.Runtime.Serialization.EnumMember(Value = "default")] + Default, + [System.Runtime.Serialization.EnumMember(Value = "first")] + First, + [System.Runtime.Serialization.EnumMember(Value = "last")] + Last +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MovingFunctionAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MovingFunctionAggregation.Converters.g.cs new file mode 100644 index 00000000000..37783d145f8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MovingFunctionAggregation.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class MovingFunctionAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropShift = System.Text.Json.JsonEncodedText.Encode("shift"); + private static readonly System.Text.Json.JsonEncodedText PropWindow = System.Text.Json.JsonEncodedText.Encode("window"); + + public override Elastic.Clients.Elasticsearch.Aggregations.MovingFunctionAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucketsPath = default; + LocalJsonValue propFormat = default; + LocalJsonValue propGapPolicy = default; + LocalJsonValue propScript = default; + LocalJsonValue propShift = default; + LocalJsonValue propWindow = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propShift.TryReadProperty(ref reader, options, PropShift, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propWindow.TryReadProperty(ref reader, options, PropWindow, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.MovingFunctionAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BucketsPath = propBucketsPath.Value, + Format = propFormat.Value, + GapPolicy = propGapPolicy.Value, + Script = propScript.Value, + Shift = propShift.Value, + Window = propWindow.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MovingFunctionAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropShift, value.Shift, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropWindow, value.Window, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MovingFunctionAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MovingFunctionAggregation.g.cs index 81a6036f0ff..24606bd4434 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MovingFunctionAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MovingFunctionAggregation.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class MovingFunctionAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropShift = System.Text.Json.JsonEncodedText.Encode("shift"); - private static readonly System.Text.Json.JsonEncodedText PropWindow = System.Text.Json.JsonEncodedText.Encode("window"); - - public override Elastic.Clients.Elasticsearch.Aggregations.MovingFunctionAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBucketsPath = default; - LocalJsonValue propFormat = default; - LocalJsonValue propGapPolicy = default; - LocalJsonValue propScript = default; - LocalJsonValue propShift = default; - LocalJsonValue propWindow = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propShift.TryReadProperty(ref reader, options, PropShift, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propWindow.TryReadProperty(ref reader, options, PropWindow, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.MovingFunctionAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BucketsPath = propBucketsPath.Value, - Format = propFormat.Value, - GapPolicy = propGapPolicy.Value, - Script = propScript.Value, - Shift = propShift.Value, - Window = propWindow.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MovingFunctionAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropShift, value.Shift, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropWindow, value.Window, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.MovingFunctionAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.MovingFunctionAggregationConverter))] public sealed partial class MovingFunctionAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MovingPercentilesAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MovingPercentilesAggregation.Converters.g.cs new file mode 100644 index 00000000000..c84b0456064 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MovingPercentilesAggregation.Converters.g.cs @@ -0,0 +1,107 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class MovingPercentilesAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); + private static readonly System.Text.Json.JsonEncodedText PropKeyed = System.Text.Json.JsonEncodedText.Encode("keyed"); + private static readonly System.Text.Json.JsonEncodedText PropShift = System.Text.Json.JsonEncodedText.Encode("shift"); + private static readonly System.Text.Json.JsonEncodedText PropWindow = System.Text.Json.JsonEncodedText.Encode("window"); + + public override Elastic.Clients.Elasticsearch.Aggregations.MovingPercentilesAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucketsPath = default; + LocalJsonValue propFormat = default; + LocalJsonValue propGapPolicy = default; + LocalJsonValue propShift = default; + LocalJsonValue propWindow = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropKeyed)) + { + reader.Skip(); + continue; + } + + if (propShift.TryReadProperty(ref reader, options, PropShift, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propWindow.TryReadProperty(ref reader, options, PropWindow, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.MovingPercentilesAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BucketsPath = propBucketsPath.Value, + Format = propFormat.Value, + GapPolicy = propGapPolicy.Value, + Shift = propShift.Value, + Window = propWindow.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MovingPercentilesAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropKeyed, value.Keyed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropShift, value.Shift, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropWindow, value.Window, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MovingPercentilesAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MovingPercentilesAggregation.g.cs index 17b94b69147..8b822f3223f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MovingPercentilesAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MovingPercentilesAggregation.g.cs @@ -23,90 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class MovingPercentilesAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); - private static readonly System.Text.Json.JsonEncodedText PropKeyed = System.Text.Json.JsonEncodedText.Encode("keyed"); - private static readonly System.Text.Json.JsonEncodedText PropShift = System.Text.Json.JsonEncodedText.Encode("shift"); - private static readonly System.Text.Json.JsonEncodedText PropWindow = System.Text.Json.JsonEncodedText.Encode("window"); - - public override Elastic.Clients.Elasticsearch.Aggregations.MovingPercentilesAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBucketsPath = default; - LocalJsonValue propFormat = default; - LocalJsonValue propGapPolicy = default; - LocalJsonValue propShift = default; - LocalJsonValue propWindow = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropKeyed)) - { - reader.Skip(); - continue; - } - - if (propShift.TryReadProperty(ref reader, options, PropShift, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propWindow.TryReadProperty(ref reader, options, PropWindow, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.MovingPercentilesAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BucketsPath = propBucketsPath.Value, - Format = propFormat.Value, - GapPolicy = propGapPolicy.Value, - Shift = propShift.Value, - Window = propWindow.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MovingPercentilesAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropKeyed, value.Keyed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropShift, value.Shift, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropWindow, value.Window, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.MovingPercentilesAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.MovingPercentilesAggregationConverter))] public sealed partial class MovingPercentilesAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermLookup.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermLookup.Converters.g.cs new file mode 100644 index 00000000000..2ec2da2e3e6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermLookup.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class MultiTermLookupConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + + public override Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookup Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propMissing = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookup(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Missing = propMissing.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookup value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermLookup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermLookup.g.cs index ac4c9538efc..191a9d007d6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermLookup.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermLookup.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class MultiTermLookupConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - - public override Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookup Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propMissing = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookup(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Missing = propMissing.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookup value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropMissing, value.Missing, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.MultiTermLookupConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.MultiTermLookupConverter))] public sealed partial class MultiTermLookup { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsAggregate.Converters.g.cs new file mode 100644 index 00000000000..d258a26efee --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsAggregate.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class MultiTermsAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropDocCountErrorUpperBound = System.Text.Json.JsonEncodedText.Encode("doc_count_error_upper_bound"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropSumOtherDocCount = System.Text.Json.JsonEncodedText.Encode("sum_other_doc_count"); + + public override Elastic.Clients.Elasticsearch.Aggregations.MultiTermsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBuckets = default; + LocalJsonValue propDocCountErrorUpperBound = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propSumOtherDocCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propDocCountErrorUpperBound.TryReadProperty(ref reader, options, PropDocCountErrorUpperBound, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propSumOtherDocCount.TryReadProperty(ref reader, options, PropSumOtherDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.MultiTermsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + DocCountErrorUpperBound = propDocCountErrorUpperBound.Value, + Meta = propMeta.Value, + SumOtherDocCount = propSumOtherDocCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MultiTermsAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDocCountErrorUpperBound, value.DocCountErrorUpperBound, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropSumOtherDocCount, value.SumOtherDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsAggregate.g.cs index bff5a9e9a4e..c896db3e61e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsAggregate.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class MultiTermsAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropDocCountErrorUpperBound = System.Text.Json.JsonEncodedText.Encode("doc_count_error_upper_bound"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropSumOtherDocCount = System.Text.Json.JsonEncodedText.Encode("sum_other_doc_count"); - - public override Elastic.Clients.Elasticsearch.Aggregations.MultiTermsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBuckets = default; - LocalJsonValue propDocCountErrorUpperBound = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propSumOtherDocCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propDocCountErrorUpperBound.TryReadProperty(ref reader, options, PropDocCountErrorUpperBound, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propSumOtherDocCount.TryReadProperty(ref reader, options, PropSumOtherDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.MultiTermsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - DocCountErrorUpperBound = propDocCountErrorUpperBound.Value, - Meta = propMeta.Value, - SumOtherDocCount = propSumOtherDocCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MultiTermsAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDocCountErrorUpperBound, value.DocCountErrorUpperBound, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropSumOtherDocCount, value.SumOtherDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.MultiTermsAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.MultiTermsAggregateConverter))] public sealed partial class MultiTermsAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsAggregation.Converters.g.cs new file mode 100644 index 00000000000..a80953b8a76 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsAggregation.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class MultiTermsAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCollectMode = System.Text.Json.JsonEncodedText.Encode("collect_mode"); + private static readonly System.Text.Json.JsonEncodedText PropMinDocCount = System.Text.Json.JsonEncodedText.Encode("min_doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); + private static readonly System.Text.Json.JsonEncodedText PropShardMinDocCount = System.Text.Json.JsonEncodedText.Encode("shard_min_doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"); + private static readonly System.Text.Json.JsonEncodedText PropShowTermDocCountError = System.Text.Json.JsonEncodedText.Encode("show_term_doc_count_error"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropTerms = System.Text.Json.JsonEncodedText.Encode("terms"); + + public override Elastic.Clients.Elasticsearch.Aggregations.MultiTermsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCollectMode = default; + LocalJsonValue propMinDocCount = default; + LocalJsonValue>?> propOrder = default; + LocalJsonValue propShardMinDocCount = default; + LocalJsonValue propShardSize = default; + LocalJsonValue propShowTermDocCountError = default; + LocalJsonValue propSize = default; + LocalJsonValue> propTerms = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCollectMode.TryReadProperty(ref reader, options, PropCollectMode, static Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinDocCount.TryReadProperty(ref reader, options, PropMinDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOrder.TryReadProperty(ref reader, options, PropOrder, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue>(o, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null)))) + { + continue; + } + + if (propShardMinDocCount.TryReadProperty(ref reader, options, PropShardMinDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propShardSize.TryReadProperty(ref reader, options, PropShardSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propShowTermDocCountError.TryReadProperty(ref reader, options, PropShowTermDocCountError, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTerms.TryReadProperty(ref reader, options, PropTerms, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.MultiTermsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CollectMode = propCollectMode.Value, + MinDocCount = propMinDocCount.Value, + Order = propOrder.Value, + ShardMinDocCount = propShardMinDocCount.Value, + ShardSize = propShardSize.Value, + ShowTermDocCountError = propShowTermDocCountError.Value, + Size = propSize.Value, + Terms = propTerms.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MultiTermsAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCollectMode, value.CollectMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinDocCount, value.MinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteSingleOrManyCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null))); + writer.WriteProperty(options, PropShardMinDocCount, value.ShardMinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropShowTermDocCountError, value.ShowTermDocCountError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTerms, value.Terms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsAggregation.g.cs index 11ee589eb32..47cddfda921 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsAggregation.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class MultiTermsAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCollectMode = System.Text.Json.JsonEncodedText.Encode("collect_mode"); - private static readonly System.Text.Json.JsonEncodedText PropMinDocCount = System.Text.Json.JsonEncodedText.Encode("min_doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); - private static readonly System.Text.Json.JsonEncodedText PropShardMinDocCount = System.Text.Json.JsonEncodedText.Encode("shard_min_doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"); - private static readonly System.Text.Json.JsonEncodedText PropShowTermDocCountError = System.Text.Json.JsonEncodedText.Encode("show_term_doc_count_error"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropTerms = System.Text.Json.JsonEncodedText.Encode("terms"); - - public override Elastic.Clients.Elasticsearch.Aggregations.MultiTermsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCollectMode = default; - LocalJsonValue propMinDocCount = default; - LocalJsonValue>?> propOrder = default; - LocalJsonValue propShardMinDocCount = default; - LocalJsonValue propShardSize = default; - LocalJsonValue propShowTermDocCountError = default; - LocalJsonValue propSize = default; - LocalJsonValue> propTerms = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCollectMode.TryReadProperty(ref reader, options, PropCollectMode, static Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinDocCount.TryReadProperty(ref reader, options, PropMinDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOrder.TryReadProperty(ref reader, options, PropOrder, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue>(o, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null)))) - { - continue; - } - - if (propShardMinDocCount.TryReadProperty(ref reader, options, PropShardMinDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propShardSize.TryReadProperty(ref reader, options, PropShardSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propShowTermDocCountError.TryReadProperty(ref reader, options, PropShowTermDocCountError, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTerms.TryReadProperty(ref reader, options, PropTerms, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.MultiTermsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CollectMode = propCollectMode.Value, - MinDocCount = propMinDocCount.Value, - Order = propOrder.Value, - ShardMinDocCount = propShardMinDocCount.Value, - ShardSize = propShardSize.Value, - ShowTermDocCountError = propShowTermDocCountError.Value, - Size = propSize.Value, - Terms = propTerms.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MultiTermsAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCollectMode, value.CollectMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinDocCount, value.MinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteSingleOrManyCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null))); - writer.WriteProperty(options, PropShardMinDocCount, value.ShardMinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropShowTermDocCountError, value.ShowTermDocCountError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTerms, value.Terms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.MultiTermsAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.MultiTermsAggregationConverter))] public sealed partial class MultiTermsAggregation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsBucket.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsBucket.Converters.g.cs new file mode 100644 index 00000000000..30eb542a537 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsBucket.Converters.g.cs @@ -0,0 +1,96 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class MultiTermsBucketConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropDocCountErrorUpperBound = System.Text.Json.JsonEncodedText.Encode("doc_count_error_upper_bound"); + private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); + private static readonly System.Text.Json.JsonEncodedText PropKeyAsString = System.Text.Json.JsonEncodedText.Encode("key_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.MultiTermsBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue propDocCountErrorUpperBound = default; + LocalJsonValue> propKey = default; + LocalJsonValue propKeyAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propDocCountErrorUpperBound.TryReadProperty(ref reader, options, PropDocCountErrorUpperBound, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propKey.TryReadProperty(ref reader, options, PropKey, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propKeyAsString.TryReadProperty(ref reader, options, PropKeyAsString, null)) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.MultiTermsBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + DocCountErrorUpperBound = propDocCountErrorUpperBound.Value, + Key = propKey.Value, + KeyAsString = propKeyAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MultiTermsBucket value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropDocCountErrorUpperBound, value.DocCountErrorUpperBound, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropKey, value.Key, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropKeyAsString, value.KeyAsString, null, null); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsBucket.g.cs index 2c0c41f16a4..550ea285f80 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsBucket.g.cs @@ -23,79 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class MultiTermsBucketConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropDocCountErrorUpperBound = System.Text.Json.JsonEncodedText.Encode("doc_count_error_upper_bound"); - private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); - private static readonly System.Text.Json.JsonEncodedText PropKeyAsString = System.Text.Json.JsonEncodedText.Encode("key_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.MultiTermsBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue propDocCountErrorUpperBound = default; - LocalJsonValue> propKey = default; - LocalJsonValue propKeyAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propDocCountErrorUpperBound.TryReadProperty(ref reader, options, PropDocCountErrorUpperBound, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propKey.TryReadProperty(ref reader, options, PropKey, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propKeyAsString.TryReadProperty(ref reader, options, PropKeyAsString, null)) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.MultiTermsBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - DocCountErrorUpperBound = propDocCountErrorUpperBound.Value, - Key = propKey.Value, - KeyAsString = propKeyAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MultiTermsBucket value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropDocCountErrorUpperBound, value.DocCountErrorUpperBound, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropKey, value.Key, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropKeyAsString, value.KeyAsString, null, null); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.MultiTermsBucketConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.MultiTermsBucketConverter))] public sealed partial class MultiTermsBucket { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MutualInformationHeuristic.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MutualInformationHeuristic.Converters.g.cs new file mode 100644 index 00000000000..18707effaaf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MutualInformationHeuristic.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class MutualInformationHeuristicConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBackgroundIsSuperset = System.Text.Json.JsonEncodedText.Encode("background_is_superset"); + private static readonly System.Text.Json.JsonEncodedText PropIncludeNegatives = System.Text.Json.JsonEncodedText.Encode("include_negatives"); + + public override Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristic Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBackgroundIsSuperset = default; + LocalJsonValue propIncludeNegatives = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBackgroundIsSuperset.TryReadProperty(ref reader, options, PropBackgroundIsSuperset, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIncludeNegatives.TryReadProperty(ref reader, options, PropIncludeNegatives, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristic(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BackgroundIsSuperset = propBackgroundIsSuperset.Value, + IncludeNegatives = propIncludeNegatives.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristic value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBackgroundIsSuperset, value.BackgroundIsSuperset, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIncludeNegatives, value.IncludeNegatives, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MutualInformationHeuristic.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MutualInformationHeuristic.g.cs index b996de763b0..5076b931287 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MutualInformationHeuristic.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MutualInformationHeuristic.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class MutualInformationHeuristicConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBackgroundIsSuperset = System.Text.Json.JsonEncodedText.Encode("background_is_superset"); - private static readonly System.Text.Json.JsonEncodedText PropIncludeNegatives = System.Text.Json.JsonEncodedText.Encode("include_negatives"); - - public override Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristic Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBackgroundIsSuperset = default; - LocalJsonValue propIncludeNegatives = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBackgroundIsSuperset.TryReadProperty(ref reader, options, PropBackgroundIsSuperset, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIncludeNegatives.TryReadProperty(ref reader, options, PropIncludeNegatives, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristic(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BackgroundIsSuperset = propBackgroundIsSuperset.Value, - IncludeNegatives = propIncludeNegatives.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristic value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBackgroundIsSuperset, value.BackgroundIsSuperset, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIncludeNegatives, value.IncludeNegatives, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.MutualInformationHeuristicConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.MutualInformationHeuristicConverter))] public sealed partial class MutualInformationHeuristic { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NestedAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NestedAggregate.Converters.g.cs new file mode 100644 index 00000000000..33945d3c6bb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NestedAggregate.Converters.g.cs @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class NestedAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.NestedAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.NestedAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.NestedAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NestedAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NestedAggregate.g.cs index 11e61ab8b5e..63a07a9ea04 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NestedAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NestedAggregate.g.cs @@ -23,61 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class NestedAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.NestedAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.NestedAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.NestedAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.NestedAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.NestedAggregateConverter))] public sealed partial class NestedAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NestedAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NestedAggregation.Converters.g.cs new file mode 100644 index 00000000000..2fd2791403f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NestedAggregation.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class NestedAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); + + public override Elastic.Clients.Elasticsearch.Aggregations.NestedAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPath.TryReadProperty(ref reader, options, PropPath, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.NestedAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Path = propPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.NestedAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPath, value.Path, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NestedAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NestedAggregation.g.cs index cd41d2cd53c..a62744c951a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NestedAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NestedAggregation.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class NestedAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); - - public override Elastic.Clients.Elasticsearch.Aggregations.NestedAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPath.TryReadProperty(ref reader, options, PropPath, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.NestedAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Path = propPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.NestedAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPath, value.Path, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.NestedAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.NestedAggregationConverter))] public sealed partial class NestedAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NormalizeAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NormalizeAggregation.Converters.g.cs new file mode 100644 index 00000000000..0d10255035a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NormalizeAggregation.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class NormalizeAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); + private static readonly System.Text.Json.JsonEncodedText PropMethod = System.Text.Json.JsonEncodedText.Encode("method"); + + public override Elastic.Clients.Elasticsearch.Aggregations.NormalizeAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucketsPath = default; + LocalJsonValue propFormat = default; + LocalJsonValue propGapPolicy = default; + LocalJsonValue propMethod = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMethod.TryReadProperty(ref reader, options, PropMethod, static Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.NormalizeAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BucketsPath = propBucketsPath.Value, + Format = propFormat.Value, + GapPolicy = propGapPolicy.Value, + Method = propMethod.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.NormalizeAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMethod, value.Method, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NormalizeAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NormalizeAggregation.g.cs index 92ff657b603..d4faee53861 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NormalizeAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NormalizeAggregation.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class NormalizeAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); - private static readonly System.Text.Json.JsonEncodedText PropMethod = System.Text.Json.JsonEncodedText.Encode("method"); - - public override Elastic.Clients.Elasticsearch.Aggregations.NormalizeAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBucketsPath = default; - LocalJsonValue propFormat = default; - LocalJsonValue propGapPolicy = default; - LocalJsonValue propMethod = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMethod.TryReadProperty(ref reader, options, PropMethod, static Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.NormalizeAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BucketsPath = propBucketsPath.Value, - Format = propFormat.Value, - GapPolicy = propGapPolicy.Value, - Method = propMethod.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.NormalizeAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMethod, value.Method, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.NormalizeAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.NormalizeAggregationConverter))] public sealed partial class NormalizeAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NormalizeMethod.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NormalizeMethod.Converters.g.cs new file mode 100644 index 00000000000..e938ea673aa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NormalizeMethod.Converters.g.cs @@ -0,0 +1,137 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class NormalizeMethodConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberMean = System.Text.Json.JsonEncodedText.Encode("mean"); + private static readonly System.Text.Json.JsonEncodedText MemberPercentOfSum = System.Text.Json.JsonEncodedText.Encode("percent_of_sum"); + private static readonly System.Text.Json.JsonEncodedText MemberRescale01 = System.Text.Json.JsonEncodedText.Encode("rescale_0_1"); + private static readonly System.Text.Json.JsonEncodedText MemberRescale0100 = System.Text.Json.JsonEncodedText.Encode("rescale_0_100"); + private static readonly System.Text.Json.JsonEncodedText MemberSoftmax = System.Text.Json.JsonEncodedText.Encode("softmax"); + private static readonly System.Text.Json.JsonEncodedText MemberZScore = System.Text.Json.JsonEncodedText.Encode("z-score"); + + public override Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberMean)) + { + return Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.Mean; + } + + if (reader.ValueTextEquals(MemberPercentOfSum)) + { + return Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.PercentOfSum; + } + + if (reader.ValueTextEquals(MemberRescale01)) + { + return Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.Rescale01; + } + + if (reader.ValueTextEquals(MemberRescale0100)) + { + return Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.Rescale0100; + } + + if (reader.ValueTextEquals(MemberSoftmax)) + { + return Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.Softmax; + } + + if (reader.ValueTextEquals(MemberZScore)) + { + return Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.ZScore; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberMean.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.Mean; + } + + if (string.Equals(value, MemberPercentOfSum.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.PercentOfSum; + } + + if (string.Equals(value, MemberRescale01.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.Rescale01; + } + + if (string.Equals(value, MemberRescale0100.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.Rescale0100; + } + + if (string.Equals(value, MemberSoftmax.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.Softmax; + } + + if (string.Equals(value, MemberZScore.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.ZScore; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.Mean: + writer.WriteStringValue(MemberMean); + break; + case Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.PercentOfSum: + writer.WriteStringValue(MemberPercentOfSum); + break; + case Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.Rescale01: + writer.WriteStringValue(MemberRescale01); + break; + case Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.Rescale0100: + writer.WriteStringValue(MemberRescale0100); + break; + case Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.Softmax: + writer.WriteStringValue(MemberSoftmax); + break; + case Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.ZScore: + writer.WriteStringValue(MemberZScore); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NormalizeMethod.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NormalizeMethod.g.cs new file mode 100644 index 00000000000..32a01f3b41e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NormalizeMethod.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.NormalizeMethodConverter))] +public enum NormalizeMethod +{ + /// + /// + /// This method normalizes such that each value is normalized by how much it differs from the average. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "mean")] + Mean, + /// + /// + /// This method normalizes each value so that it represents a percentage of the total sum it attributes to. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "percent_of_sum")] + PercentOfSum, + /// + /// + /// This method rescales the data such that the minimum number is 0, and the maximum number is 1, with the rest normalized linearly in-between. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "rescale_0_1")] + Rescale01, + /// + /// + /// This method rescales the data such that the minimum number is 0, and the maximum number is 100, with the rest normalized linearly in-between. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "rescale_0_100")] + Rescale0100, + /// + /// + /// This method normalizes such that each value is exponentiated and relative to the sum of the exponents of the original values. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "softmax")] + Softmax, + /// + /// + /// This method normalizes such that each value represents how far it is from the mean relative to the standard deviation. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "z-score")] + ZScore +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ParentAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ParentAggregate.Converters.g.cs new file mode 100644 index 00000000000..fad245dd7fb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ParentAggregate.Converters.g.cs @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class ParentAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.ParentAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.ParentAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ParentAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ParentAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ParentAggregate.g.cs index 07d76c0445b..fe5cfe8b4df 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ParentAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ParentAggregate.g.cs @@ -23,61 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class ParentAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.ParentAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.ParentAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ParentAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.ParentAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.ParentAggregateConverter))] public sealed partial class ParentAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ParentAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ParentAggregation.Converters.g.cs new file mode 100644 index 00000000000..5dc2718fa5d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ParentAggregation.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class ParentAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Aggregations.ParentAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.ParentAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ParentAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ParentAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ParentAggregation.g.cs index fc5bb0e7386..aa9509ce647 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ParentAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ParentAggregation.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class ParentAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Aggregations.ParentAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.ParentAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ParentAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.ParentAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.ParentAggregationConverter))] public sealed partial class ParentAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentageScoreHeuristic.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentageScoreHeuristic.Converters.g.cs new file mode 100644 index 00000000000..fd863045091 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentageScoreHeuristic.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class PercentageScoreHeuristicConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Aggregations.PercentageScoreHeuristic Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.PercentageScoreHeuristic(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.PercentageScoreHeuristic value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentageScoreHeuristic.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentageScoreHeuristic.g.cs index 11e55ab31fe..def8c617e12 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentageScoreHeuristic.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentageScoreHeuristic.g.cs @@ -23,36 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class PercentageScoreHeuristicConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Aggregations.PercentageScoreHeuristic Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.PercentageScoreHeuristic(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.PercentageScoreHeuristic value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.PercentageScoreHeuristicConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.PercentageScoreHeuristicConverter))] public sealed partial class PercentageScoreHeuristic { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentileRanksAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentileRanksAggregation.Converters.g.cs new file mode 100644 index 00000000000..0dd8ee71098 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentileRanksAggregation.Converters.g.cs @@ -0,0 +1,125 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class PercentileRanksAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropHdr = System.Text.Json.JsonEncodedText.Encode("hdr"); + private static readonly System.Text.Json.JsonEncodedText PropKeyed = System.Text.Json.JsonEncodedText.Encode("keyed"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropTDigest = System.Text.Json.JsonEncodedText.Encode("tdigest"); + private static readonly System.Text.Json.JsonEncodedText PropValues = System.Text.Json.JsonEncodedText.Encode("values"); + + public override Elastic.Clients.Elasticsearch.Aggregations.PercentileRanksAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propFormat = default; + LocalJsonValue propHdr = default; + LocalJsonValue propMissing = default; + LocalJsonValue propScript = default; + LocalJsonValue propTDigest = default; + LocalJsonValue?> propValues = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propHdr.TryReadProperty(ref reader, options, PropHdr, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropKeyed)) + { + reader.Skip(); + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propTDigest.TryReadProperty(ref reader, options, PropTDigest, null)) + { + continue; + } + + if (propValues.TryReadProperty(ref reader, options, PropValues, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.PercentileRanksAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Format = propFormat.Value, + Hdr = propHdr.Value, + Missing = propMissing.Value, + Script = propScript.Value, + TDigest = propTDigest.Value, + Values = propValues.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.PercentileRanksAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropHdr, value.Hdr, null, null); + writer.WriteProperty(options, PropKeyed, value.Keyed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropTDigest, value.TDigest, null, null); + writer.WriteProperty(options, PropValues, value.Values, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentileRanksAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentileRanksAggregation.g.cs index 553cec31b85..58cdd79fddb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentileRanksAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentileRanksAggregation.g.cs @@ -23,108 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class PercentileRanksAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropHdr = System.Text.Json.JsonEncodedText.Encode("hdr"); - private static readonly System.Text.Json.JsonEncodedText PropKeyed = System.Text.Json.JsonEncodedText.Encode("keyed"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropTDigest = System.Text.Json.JsonEncodedText.Encode("tdigest"); - private static readonly System.Text.Json.JsonEncodedText PropValues = System.Text.Json.JsonEncodedText.Encode("values"); - - public override Elastic.Clients.Elasticsearch.Aggregations.PercentileRanksAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propFormat = default; - LocalJsonValue propHdr = default; - LocalJsonValue propMissing = default; - LocalJsonValue propScript = default; - LocalJsonValue propTDigest = default; - LocalJsonValue?> propValues = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propHdr.TryReadProperty(ref reader, options, PropHdr, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropKeyed)) - { - reader.Skip(); - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propTDigest.TryReadProperty(ref reader, options, PropTDigest, null)) - { - continue; - } - - if (propValues.TryReadProperty(ref reader, options, PropValues, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.PercentileRanksAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Format = propFormat.Value, - Hdr = propHdr.Value, - Missing = propMissing.Value, - Script = propScript.Value, - TDigest = propTDigest.Value, - Values = propValues.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.PercentileRanksAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropHdr, value.Hdr, null, null); - writer.WriteProperty(options, PropKeyed, value.Keyed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMissing, value.Missing, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropTDigest, value.TDigest, null, null); - writer.WriteProperty(options, PropValues, value.Values, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.PercentileRanksAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.PercentileRanksAggregationConverter))] public sealed partial class PercentileRanksAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesAggregation.Converters.g.cs new file mode 100644 index 00000000000..158135b7125 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesAggregation.Converters.g.cs @@ -0,0 +1,125 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class PercentilesAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropHdr = System.Text.Json.JsonEncodedText.Encode("hdr"); + private static readonly System.Text.Json.JsonEncodedText PropKeyed = System.Text.Json.JsonEncodedText.Encode("keyed"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropPercents = System.Text.Json.JsonEncodedText.Encode("percents"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropTDigest = System.Text.Json.JsonEncodedText.Encode("tdigest"); + + public override Elastic.Clients.Elasticsearch.Aggregations.PercentilesAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propFormat = default; + LocalJsonValue propHdr = default; + LocalJsonValue propMissing = default; + LocalJsonValue?> propPercents = default; + LocalJsonValue propScript = default; + LocalJsonValue propTDigest = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propHdr.TryReadProperty(ref reader, options, PropHdr, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropKeyed)) + { + reader.Skip(); + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (propPercents.TryReadProperty(ref reader, options, PropPercents, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propTDigest.TryReadProperty(ref reader, options, PropTDigest, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.PercentilesAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Format = propFormat.Value, + Hdr = propHdr.Value, + Missing = propMissing.Value, + Percents = propPercents.Value, + Script = propScript.Value, + TDigest = propTDigest.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.PercentilesAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropHdr, value.Hdr, null, null); + writer.WriteProperty(options, PropKeyed, value.Keyed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteProperty(options, PropPercents, value.Percents, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropTDigest, value.TDigest, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesAggregation.g.cs index fb9245f2f98..d650650a0ef 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesAggregation.g.cs @@ -23,108 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class PercentilesAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropHdr = System.Text.Json.JsonEncodedText.Encode("hdr"); - private static readonly System.Text.Json.JsonEncodedText PropKeyed = System.Text.Json.JsonEncodedText.Encode("keyed"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropPercents = System.Text.Json.JsonEncodedText.Encode("percents"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropTDigest = System.Text.Json.JsonEncodedText.Encode("tdigest"); - - public override Elastic.Clients.Elasticsearch.Aggregations.PercentilesAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propFormat = default; - LocalJsonValue propHdr = default; - LocalJsonValue propMissing = default; - LocalJsonValue?> propPercents = default; - LocalJsonValue propScript = default; - LocalJsonValue propTDigest = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propHdr.TryReadProperty(ref reader, options, PropHdr, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropKeyed)) - { - reader.Skip(); - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) - { - continue; - } - - if (propPercents.TryReadProperty(ref reader, options, PropPercents, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propTDigest.TryReadProperty(ref reader, options, PropTDigest, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.PercentilesAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Format = propFormat.Value, - Hdr = propHdr.Value, - Missing = propMissing.Value, - Percents = propPercents.Value, - Script = propScript.Value, - TDigest = propTDigest.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.PercentilesAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropHdr, value.Hdr, null, null); - writer.WriteProperty(options, PropKeyed, value.Keyed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMissing, value.Missing, null, null); - writer.WriteProperty(options, PropPercents, value.Percents, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropTDigest, value.TDigest, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.PercentilesAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.PercentilesAggregationConverter))] public sealed partial class PercentilesAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesBucketAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesBucketAggregate.Converters.g.cs new file mode 100644 index 00000000000..eaeabb3ab29 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesBucketAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class PercentilesBucketAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropValues = System.Text.Json.JsonEncodedText.Encode("values"); + + public override Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propMeta = default; + LocalJsonValue> propValues = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propValues.TryReadProperty(ref reader, options, PropValues, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Meta = propMeta.Value, + Values = propValues.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropValues, value.Values, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesBucketAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesBucketAggregate.g.cs index 7021a0ad1ef..02dbd2a5c1d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesBucketAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesBucketAggregate.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class PercentilesBucketAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropValues = System.Text.Json.JsonEncodedText.Encode("values"); - - public override Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propMeta = default; - LocalJsonValue> propValues = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propValues.TryReadProperty(ref reader, options, PropValues, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Meta = propMeta.Value, - Values = propValues.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropValues, value.Values, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.PercentilesBucketAggregateConverter))] public sealed partial class PercentilesBucketAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesBucketAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesBucketAggregation.Converters.g.cs new file mode 100644 index 00000000000..c0273dbf9c5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesBucketAggregation.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class PercentilesBucketAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); + private static readonly System.Text.Json.JsonEncodedText PropPercents = System.Text.Json.JsonEncodedText.Encode("percents"); + + public override Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucketsPath = default; + LocalJsonValue propFormat = default; + LocalJsonValue propGapPolicy = default; + LocalJsonValue?> propPercents = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPercents.TryReadProperty(ref reader, options, PropPercents, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BucketsPath = propBucketsPath.Value, + Format = propFormat.Value, + GapPolicy = propGapPolicy.Value, + Percents = propPercents.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPercents, value.Percents, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesBucketAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesBucketAggregation.g.cs index 6824db8445a..c0fa850887a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesBucketAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesBucketAggregation.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class PercentilesBucketAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); - private static readonly System.Text.Json.JsonEncodedText PropPercents = System.Text.Json.JsonEncodedText.Encode("percents"); - - public override Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBucketsPath = default; - LocalJsonValue propFormat = default; - LocalJsonValue propGapPolicy = default; - LocalJsonValue?> propPercents = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPercents.TryReadProperty(ref reader, options, PropPercents, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BucketsPath = propBucketsPath.Value, - Format = propFormat.Value, - GapPolicy = propGapPolicy.Value, - Percents = propPercents.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPercents, value.Percents, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.PercentilesBucketAggregationConverter))] public sealed partial class PercentilesBucketAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesItem.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesItem.Converters.g.cs new file mode 100644 index 00000000000..91eeeb03646 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesItem.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class PercentilesItemConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.PercentilesItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propKey = default; + LocalJsonValue propValue = default; + LocalJsonValue propValueAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propKey.TryReadProperty(ref reader, options, PropKey, null)) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.PercentilesItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Key = propKey.Value, + Value = propValue.Value, + ValueAsString = propValueAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.PercentilesItem value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropKey, value.Key, null, null); + writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesItem.g.cs index c0ecdcf546e..3da06978160 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/PercentilesItem.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class PercentilesItemConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.PercentilesItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propKey = default; - LocalJsonValue propValue = default; - LocalJsonValue propValueAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propKey.TryReadProperty(ref reader, options, PropKey, null)) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.PercentilesItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Key = propKey.Value, - Value = propValue.Value, - ValueAsString = propValueAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.PercentilesItem value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropKey, value.Key, null, null); - writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.PercentilesItemConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.PercentilesItemConverter))] public sealed partial class PercentilesItem { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RandomSamplerAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RandomSamplerAggregation.Converters.g.cs new file mode 100644 index 00000000000..7021f353a7f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RandomSamplerAggregation.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class RandomSamplerAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropProbability = System.Text.Json.JsonEncodedText.Encode("probability"); + private static readonly System.Text.Json.JsonEncodedText PropSeed = System.Text.Json.JsonEncodedText.Encode("seed"); + private static readonly System.Text.Json.JsonEncodedText PropShardSeed = System.Text.Json.JsonEncodedText.Encode("shard_seed"); + + public override Elastic.Clients.Elasticsearch.Aggregations.RandomSamplerAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propProbability = default; + LocalJsonValue propSeed = default; + LocalJsonValue propShardSeed = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propProbability.TryReadProperty(ref reader, options, PropProbability, null)) + { + continue; + } + + if (propSeed.TryReadProperty(ref reader, options, PropSeed, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propShardSeed.TryReadProperty(ref reader, options, PropShardSeed, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.RandomSamplerAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Probability = propProbability.Value, + Seed = propSeed.Value, + ShardSeed = propShardSeed.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.RandomSamplerAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropProbability, value.Probability, null, null); + writer.WriteProperty(options, PropSeed, value.Seed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropShardSeed, value.ShardSeed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RandomSamplerAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RandomSamplerAggregation.g.cs index cbc28c8eccb..b5fdef79beb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RandomSamplerAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RandomSamplerAggregation.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class RandomSamplerAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropProbability = System.Text.Json.JsonEncodedText.Encode("probability"); - private static readonly System.Text.Json.JsonEncodedText PropSeed = System.Text.Json.JsonEncodedText.Encode("seed"); - private static readonly System.Text.Json.JsonEncodedText PropShardSeed = System.Text.Json.JsonEncodedText.Encode("shard_seed"); - - public override Elastic.Clients.Elasticsearch.Aggregations.RandomSamplerAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propProbability = default; - LocalJsonValue propSeed = default; - LocalJsonValue propShardSeed = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propProbability.TryReadProperty(ref reader, options, PropProbability, null)) - { - continue; - } - - if (propSeed.TryReadProperty(ref reader, options, PropSeed, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propShardSeed.TryReadProperty(ref reader, options, PropShardSeed, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.RandomSamplerAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Probability = propProbability.Value, - Seed = propSeed.Value, - ShardSeed = propShardSeed.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.RandomSamplerAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropProbability, value.Probability, null, null); - writer.WriteProperty(options, PropSeed, value.Seed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropShardSeed, value.ShardSeed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.RandomSamplerAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.RandomSamplerAggregationConverter))] public sealed partial class RandomSamplerAggregation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeAggregate.Converters.g.cs new file mode 100644 index 00000000000..d3e85c055fc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class RangeAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.RangeAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBuckets = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.RangeAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.RangeAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeAggregate.g.cs index 23d47335ac1..eb812bebbd1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeAggregate.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class RangeAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.RangeAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBuckets = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.RangeAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.RangeAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.RangeAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.RangeAggregateConverter))] public sealed partial class RangeAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeAggregation.Converters.g.cs new file mode 100644 index 00000000000..e021718b31f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeAggregation.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class RangeAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropRanges = System.Text.Json.JsonEncodedText.Encode("ranges"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.Aggregations.RangeAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propFormat = default; + LocalJsonValue propMissing = default; + LocalJsonValue?> propRanges = default; + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRanges.TryReadProperty(ref reader, options, PropRanges, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.RangeAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Format = propFormat.Value, + Missing = propMissing.Value, + Ranges = propRanges.Value, + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.RangeAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropMissing, value.Missing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRanges, value.Ranges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeAggregation.g.cs index 74ce51b86d6..b13eb8d6f49 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeAggregation.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class RangeAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropRanges = System.Text.Json.JsonEncodedText.Encode("ranges"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.Aggregations.RangeAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propFormat = default; - LocalJsonValue propMissing = default; - LocalJsonValue?> propRanges = default; - LocalJsonValue propScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRanges.TryReadProperty(ref reader, options, PropRanges, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.RangeAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Format = propFormat.Value, - Missing = propMissing.Value, - Ranges = propRanges.Value, - Script = propScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.RangeAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropMissing, value.Missing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRanges, value.Ranges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.RangeAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.RangeAggregationConverter))] public sealed partial class RangeAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeBucket.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeBucket.Converters.g.cs new file mode 100644 index 00000000000..87184b18c4d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeBucket.Converters.g.cs @@ -0,0 +1,114 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class RangeBucketConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropFrom = System.Text.Json.JsonEncodedText.Encode("from"); + private static readonly System.Text.Json.JsonEncodedText PropFromAsString = System.Text.Json.JsonEncodedText.Encode("from_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); + private static readonly System.Text.Json.JsonEncodedText PropTo = System.Text.Json.JsonEncodedText.Encode("to"); + private static readonly System.Text.Json.JsonEncodedText PropToAsString = System.Text.Json.JsonEncodedText.Encode("to_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.RangeBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue propFrom = default; + LocalJsonValue propFromAsString = default; + LocalJsonValue propKey = default; + LocalJsonValue propTo = default; + LocalJsonValue propToAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propFrom.TryReadProperty(ref reader, options, PropFrom, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFromAsString.TryReadProperty(ref reader, options, PropFromAsString, null)) + { + continue; + } + + if (propKey.TryReadProperty(ref reader, options, PropKey, null)) + { + continue; + } + + if (propTo.TryReadProperty(ref reader, options, PropTo, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propToAsString.TryReadProperty(ref reader, options, PropToAsString, null)) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.RangeBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + From = propFrom.Value, + FromAsString = propFromAsString.Value, + Key = propKey.Value, + To = propTo.Value, + ToAsString = propToAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.RangeBucket value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropFrom, value.From, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFromAsString, value.FromAsString, null, null); + writer.WriteProperty(options, PropKey, value.Key, null, null); + writer.WriteProperty(options, PropTo, value.To, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropToAsString, value.ToAsString, null, null); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeBucket.g.cs index 4e398981a50..8740c22e8ad 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RangeBucket.g.cs @@ -23,97 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class RangeBucketConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropFrom = System.Text.Json.JsonEncodedText.Encode("from"); - private static readonly System.Text.Json.JsonEncodedText PropFromAsString = System.Text.Json.JsonEncodedText.Encode("from_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); - private static readonly System.Text.Json.JsonEncodedText PropTo = System.Text.Json.JsonEncodedText.Encode("to"); - private static readonly System.Text.Json.JsonEncodedText PropToAsString = System.Text.Json.JsonEncodedText.Encode("to_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.RangeBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue propFrom = default; - LocalJsonValue propFromAsString = default; - LocalJsonValue propKey = default; - LocalJsonValue propTo = default; - LocalJsonValue propToAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propFrom.TryReadProperty(ref reader, options, PropFrom, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFromAsString.TryReadProperty(ref reader, options, PropFromAsString, null)) - { - continue; - } - - if (propKey.TryReadProperty(ref reader, options, PropKey, null)) - { - continue; - } - - if (propTo.TryReadProperty(ref reader, options, PropTo, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propToAsString.TryReadProperty(ref reader, options, PropToAsString, null)) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.RangeBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - From = propFrom.Value, - FromAsString = propFromAsString.Value, - Key = propKey.Value, - To = propTo.Value, - ToAsString = propToAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.RangeBucket value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropFrom, value.From, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFromAsString, value.FromAsString, null, null); - writer.WriteProperty(options, PropKey, value.Key, null, null); - writer.WriteProperty(options, PropTo, value.To, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropToAsString, value.ToAsString, null, null); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.RangeBucketConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.RangeBucketConverter))] public sealed partial class RangeBucket { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RareTermsAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RareTermsAggregation.Converters.g.cs new file mode 100644 index 00000000000..bf43c06fdb1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RareTermsAggregation.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class RareTermsAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExclude = System.Text.Json.JsonEncodedText.Encode("exclude"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropInclude = System.Text.Json.JsonEncodedText.Encode("include"); + private static readonly System.Text.Json.JsonEncodedText PropMaxDocCount = System.Text.Json.JsonEncodedText.Encode("max_doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropPrecision = System.Text.Json.JsonEncodedText.Encode("precision"); + private static readonly System.Text.Json.JsonEncodedText PropValueType = System.Text.Json.JsonEncodedText.Encode("value_type"); + + public override Elastic.Clients.Elasticsearch.Aggregations.RareTermsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExclude = default; + LocalJsonValue propField = default; + LocalJsonValue propInclude = default; + LocalJsonValue propMaxDocCount = default; + LocalJsonValue propMissing = default; + LocalJsonValue propPrecision = default; + LocalJsonValue propValueType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExclude.TryReadProperty(ref reader, options, PropExclude, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propInclude.TryReadProperty(ref reader, options, PropInclude, null)) + { + continue; + } + + if (propMaxDocCount.TryReadProperty(ref reader, options, PropMaxDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (propPrecision.TryReadProperty(ref reader, options, PropPrecision, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propValueType.TryReadProperty(ref reader, options, PropValueType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.RareTermsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Exclude = propExclude.Value, + Field = propField.Value, + Include = propInclude.Value, + MaxDocCount = propMaxDocCount.Value, + Missing = propMissing.Value, + Precision = propPrecision.Value, + ValueType = propValueType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.RareTermsAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExclude, value.Exclude, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropInclude, value.Include, null, null); + writer.WriteProperty(options, PropMaxDocCount, value.MaxDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteProperty(options, PropPrecision, value.Precision, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropValueType, value.ValueType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RareTermsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RareTermsAggregation.g.cs index e8dc4bc1655..532d5a247b6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RareTermsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RareTermsAggregation.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class RareTermsAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExclude = System.Text.Json.JsonEncodedText.Encode("exclude"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropInclude = System.Text.Json.JsonEncodedText.Encode("include"); - private static readonly System.Text.Json.JsonEncodedText PropMaxDocCount = System.Text.Json.JsonEncodedText.Encode("max_doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropPrecision = System.Text.Json.JsonEncodedText.Encode("precision"); - private static readonly System.Text.Json.JsonEncodedText PropValueType = System.Text.Json.JsonEncodedText.Encode("value_type"); - - public override Elastic.Clients.Elasticsearch.Aggregations.RareTermsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propExclude = default; - LocalJsonValue propField = default; - LocalJsonValue propInclude = default; - LocalJsonValue propMaxDocCount = default; - LocalJsonValue propMissing = default; - LocalJsonValue propPrecision = default; - LocalJsonValue propValueType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExclude.TryReadProperty(ref reader, options, PropExclude, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propInclude.TryReadProperty(ref reader, options, PropInclude, null)) - { - continue; - } - - if (propMaxDocCount.TryReadProperty(ref reader, options, PropMaxDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) - { - continue; - } - - if (propPrecision.TryReadProperty(ref reader, options, PropPrecision, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propValueType.TryReadProperty(ref reader, options, PropValueType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.RareTermsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Exclude = propExclude.Value, - Field = propField.Value, - Include = propInclude.Value, - MaxDocCount = propMaxDocCount.Value, - Missing = propMissing.Value, - Precision = propPrecision.Value, - ValueType = propValueType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.RareTermsAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExclude, value.Exclude, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropInclude, value.Include, null, null); - writer.WriteProperty(options, PropMaxDocCount, value.MaxDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMissing, value.Missing, null, null); - writer.WriteProperty(options, PropPrecision, value.Precision, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropValueType, value.ValueType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.RareTermsAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.RareTermsAggregationConverter))] public sealed partial class RareTermsAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateAggregate.Converters.g.cs new file mode 100644 index 00000000000..bc4e36fb4fc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateAggregate.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class RateAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.RateAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propMeta = default; + LocalJsonValue propValue = default; + LocalJsonValue propValueAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, null)) + { + continue; + } + + if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.RateAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Meta = propMeta.Value, + Value = propValue.Value, + ValueAsString = propValueAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.RateAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropValue, value.Value, null, null); + writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateAggregate.g.cs index c951fa9cd24..c30ff35c2ff 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateAggregate.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class RateAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.RateAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propMeta = default; - LocalJsonValue propValue = default; - LocalJsonValue propValueAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, null)) - { - continue; - } - - if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.RateAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Meta = propMeta.Value, - Value = propValue.Value, - ValueAsString = propValueAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.RateAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropValue, value.Value, null, null); - writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.RateAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.RateAggregateConverter))] public sealed partial class RateAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateAggregation.Converters.g.cs new file mode 100644 index 00000000000..7e8e47f30f6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateAggregation.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class RateAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropUnit = System.Text.Json.JsonEncodedText.Encode("unit"); + + public override Elastic.Clients.Elasticsearch.Aggregations.RateAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propFormat = default; + LocalJsonValue propMissing = default; + LocalJsonValue propMode = default; + LocalJsonValue propScript = default; + LocalJsonValue propUnit = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (propMode.TryReadProperty(ref reader, options, PropMode, static Elastic.Clients.Elasticsearch.Aggregations.RateMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propUnit.TryReadProperty(ref reader, options, PropUnit, static Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.RateAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Format = propFormat.Value, + Missing = propMissing.Value, + Mode = propMode.Value, + Script = propScript.Value, + Unit = propUnit.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.RateAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteProperty(options, PropMode, value.Mode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.RateMode? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropUnit, value.Unit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateAggregation.g.cs index 7a244d5b769..9f7ce4448a0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateAggregation.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class RateAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropUnit = System.Text.Json.JsonEncodedText.Encode("unit"); - - public override Elastic.Clients.Elasticsearch.Aggregations.RateAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propFormat = default; - LocalJsonValue propMissing = default; - LocalJsonValue propMode = default; - LocalJsonValue propScript = default; - LocalJsonValue propUnit = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) - { - continue; - } - - if (propMode.TryReadProperty(ref reader, options, PropMode, static Elastic.Clients.Elasticsearch.Aggregations.RateMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propUnit.TryReadProperty(ref reader, options, PropUnit, static Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.RateAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Format = propFormat.Value, - Missing = propMissing.Value, - Mode = propMode.Value, - Script = propScript.Value, - Unit = propUnit.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.RateAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropMissing, value.Missing, null, null); - writer.WriteProperty(options, PropMode, value.Mode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.RateMode? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropUnit, value.Unit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.RateAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.RateAggregationConverter))] public sealed partial class RateAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateMode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateMode.Converters.g.cs new file mode 100644 index 00000000000..32c8bf818e4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateMode.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class RateModeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberSum = System.Text.Json.JsonEncodedText.Encode("sum"); + private static readonly System.Text.Json.JsonEncodedText MemberValueCount = System.Text.Json.JsonEncodedText.Encode("value_count"); + + public override Elastic.Clients.Elasticsearch.Aggregations.RateMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberSum)) + { + return Elastic.Clients.Elasticsearch.Aggregations.RateMode.Sum; + } + + if (reader.ValueTextEquals(MemberValueCount)) + { + return Elastic.Clients.Elasticsearch.Aggregations.RateMode.ValueCount; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberSum.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.RateMode.Sum; + } + + if (string.Equals(value, MemberValueCount.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.RateMode.ValueCount; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.RateMode)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.RateMode value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Aggregations.RateMode.Sum: + writer.WriteStringValue(MemberSum); + break; + case Elastic.Clients.Elasticsearch.Aggregations.RateMode.ValueCount: + writer.WriteStringValue(MemberValueCount); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.RateMode)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Aggregations.RateMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.RateMode value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateMode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateMode.g.cs new file mode 100644 index 00000000000..04c5776c74b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateMode.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.RateModeConverter))] +public enum RateMode +{ + /// + /// + /// Calculates the sum of all values of the field. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "sum")] + Sum, + /// + /// + /// Uses the number of values of the field. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "value_count")] + ValueCount +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ReverseNestedAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ReverseNestedAggregate.Converters.g.cs new file mode 100644 index 00000000000..8eb8ac7abd3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ReverseNestedAggregate.Converters.g.cs @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class ReverseNestedAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.ReverseNestedAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.ReverseNestedAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ReverseNestedAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ReverseNestedAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ReverseNestedAggregate.g.cs index bcbd28710c4..fa14b89f45b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ReverseNestedAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ReverseNestedAggregate.g.cs @@ -23,61 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class ReverseNestedAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.ReverseNestedAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.ReverseNestedAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ReverseNestedAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.ReverseNestedAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.ReverseNestedAggregateConverter))] public sealed partial class ReverseNestedAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ReverseNestedAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ReverseNestedAggregation.Converters.g.cs new file mode 100644 index 00000000000..3a59b51fc06 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ReverseNestedAggregation.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class ReverseNestedAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); + + public override Elastic.Clients.Elasticsearch.Aggregations.ReverseNestedAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPath.TryReadProperty(ref reader, options, PropPath, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.ReverseNestedAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Path = propPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ReverseNestedAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPath, value.Path, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ReverseNestedAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ReverseNestedAggregation.g.cs index 0e4a027ed2e..32b34b97d5a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ReverseNestedAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ReverseNestedAggregation.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class ReverseNestedAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); - - public override Elastic.Clients.Elasticsearch.Aggregations.ReverseNestedAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPath.TryReadProperty(ref reader, options, PropPath, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.ReverseNestedAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Path = propPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ReverseNestedAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPath, value.Path, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.ReverseNestedAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.ReverseNestedAggregationConverter))] public sealed partial class ReverseNestedAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SamplerAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SamplerAggregate.Converters.g.cs new file mode 100644 index 00000000000..a6280a6735a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SamplerAggregate.Converters.g.cs @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class SamplerAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SamplerAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SamplerAggregate.g.cs index 3b6432c1621..5dcdd3d1102 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SamplerAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SamplerAggregate.g.cs @@ -23,61 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class SamplerAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.SamplerAggregateConverter))] public sealed partial class SamplerAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SamplerAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SamplerAggregation.Converters.g.cs new file mode 100644 index 00000000000..e28ee1d25f9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SamplerAggregation.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class SamplerAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"); + + public override Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propShardSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propShardSize.TryReadProperty(ref reader, options, PropShardSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ShardSize = propShardSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SamplerAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SamplerAggregation.g.cs index a80c50cca2d..7b3f5fe70b3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SamplerAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SamplerAggregation.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class SamplerAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"); - - public override Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propShardSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propShardSize.TryReadProperty(ref reader, options, PropShardSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ShardSize = propShardSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.SamplerAggregationConverter))] public sealed partial class SamplerAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SamplerAggregationExecutionHint.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SamplerAggregationExecutionHint.Converters.g.cs new file mode 100644 index 00000000000..8db10edc5cf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SamplerAggregationExecutionHint.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class SamplerAggregationExecutionHintConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberBytesHash = System.Text.Json.JsonEncodedText.Encode("bytes_hash"); + private static readonly System.Text.Json.JsonEncodedText MemberGlobalOrdinals = System.Text.Json.JsonEncodedText.Encode("global_ordinals"); + private static readonly System.Text.Json.JsonEncodedText MemberMap = System.Text.Json.JsonEncodedText.Encode("map"); + + public override Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberBytesHash)) + { + return Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint.BytesHash; + } + + if (reader.ValueTextEquals(MemberGlobalOrdinals)) + { + return Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint.GlobalOrdinals; + } + + if (reader.ValueTextEquals(MemberMap)) + { + return Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint.Map; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberBytesHash.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint.BytesHash; + } + + if (string.Equals(value, MemberGlobalOrdinals.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint.GlobalOrdinals; + } + + if (string.Equals(value, MemberMap.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint.Map; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint.BytesHash: + writer.WriteStringValue(MemberBytesHash); + break; + case Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint.GlobalOrdinals: + writer.WriteStringValue(MemberGlobalOrdinals); + break; + case Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint.Map: + writer.WriteStringValue(MemberMap); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SamplerAggregationExecutionHint.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SamplerAggregationExecutionHint.g.cs new file mode 100644 index 00000000000..6cb8c69bc91 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SamplerAggregationExecutionHint.g.cs @@ -0,0 +1,50 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.SamplerAggregationExecutionHintConverter))] +public enum SamplerAggregationExecutionHint +{ + /// + /// + /// Hold hashes of the field values - with potential for hash collisions. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "bytes_hash")] + BytesHash, + /// + /// + /// Hold ordinals of the field as determined by the Lucene index. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "global_ordinals")] + GlobalOrdinals, + /// + /// + /// Hold field values directly. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "map")] + Map +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedHeuristic.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedHeuristic.Converters.g.cs new file mode 100644 index 00000000000..e0b7be022ae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedHeuristic.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class ScriptedHeuristicConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.Aggregations.ScriptedHeuristic Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.ScriptedHeuristic(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ScriptedHeuristic value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedHeuristic.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedHeuristic.g.cs index a39deb092f2..2c99d2c0add 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedHeuristic.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedHeuristic.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class ScriptedHeuristicConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.Aggregations.ScriptedHeuristic Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.ScriptedHeuristic(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Script = propScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ScriptedHeuristic value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.ScriptedHeuristicConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.ScriptedHeuristicConverter))] public sealed partial class ScriptedHeuristic { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedMetricAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedMetricAggregate.Converters.g.cs new file mode 100644 index 00000000000..cff74f52edb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedMetricAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class ScriptedMetricAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + + public override Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propMeta = default; + LocalJsonValue propValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Meta = propMeta.Value, + Value = propValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedMetricAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedMetricAggregate.g.cs index f830d5c8c49..e15bf8b2ee3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedMetricAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedMetricAggregate.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class ScriptedMetricAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - - public override Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propMeta = default; - LocalJsonValue propValue = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Meta = propMeta.Value, - Value = propValue.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.ScriptedMetricAggregateConverter))] public sealed partial class ScriptedMetricAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedMetricAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedMetricAggregation.Converters.g.cs new file mode 100644 index 00000000000..767c529e847 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedMetricAggregation.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class ScriptedMetricAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCombineScript = System.Text.Json.JsonEncodedText.Encode("combine_script"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropInitScript = System.Text.Json.JsonEncodedText.Encode("init_script"); + private static readonly System.Text.Json.JsonEncodedText PropMapScript = System.Text.Json.JsonEncodedText.Encode("map_script"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); + private static readonly System.Text.Json.JsonEncodedText PropReduceScript = System.Text.Json.JsonEncodedText.Encode("reduce_script"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCombineScript = default; + LocalJsonValue propField = default; + LocalJsonValue propInitScript = default; + LocalJsonValue propMapScript = default; + LocalJsonValue propMissing = default; + LocalJsonValue?> propParams = default; + LocalJsonValue propReduceScript = default; + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCombineScript.TryReadProperty(ref reader, options, PropCombineScript, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propInitScript.TryReadProperty(ref reader, options, PropInitScript, null)) + { + continue; + } + + if (propMapScript.TryReadProperty(ref reader, options, PropMapScript, null)) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propReduceScript.TryReadProperty(ref reader, options, PropReduceScript, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CombineScript = propCombineScript.Value, + Field = propField.Value, + InitScript = propInitScript.Value, + MapScript = propMapScript.Value, + Missing = propMissing.Value, + Params = propParams.Value, + ReduceScript = propReduceScript.Value, + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCombineScript, value.CombineScript, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropInitScript, value.InitScript, null, null); + writer.WriteProperty(options, PropMapScript, value.MapScript, null, null); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropReduceScript, value.ReduceScript, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedMetricAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedMetricAggregation.g.cs index 3ff63bf165d..952a0a8ae3e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedMetricAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedMetricAggregation.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class ScriptedMetricAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCombineScript = System.Text.Json.JsonEncodedText.Encode("combine_script"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropInitScript = System.Text.Json.JsonEncodedText.Encode("init_script"); - private static readonly System.Text.Json.JsonEncodedText PropMapScript = System.Text.Json.JsonEncodedText.Encode("map_script"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); - private static readonly System.Text.Json.JsonEncodedText PropReduceScript = System.Text.Json.JsonEncodedText.Encode("reduce_script"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCombineScript = default; - LocalJsonValue propField = default; - LocalJsonValue propInitScript = default; - LocalJsonValue propMapScript = default; - LocalJsonValue propMissing = default; - LocalJsonValue?> propParams = default; - LocalJsonValue propReduceScript = default; - LocalJsonValue propScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCombineScript.TryReadProperty(ref reader, options, PropCombineScript, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propInitScript.TryReadProperty(ref reader, options, PropInitScript, null)) - { - continue; - } - - if (propMapScript.TryReadProperty(ref reader, options, PropMapScript, null)) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) - { - continue; - } - - if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propReduceScript.TryReadProperty(ref reader, options, PropReduceScript, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CombineScript = propCombineScript.Value, - Field = propField.Value, - InitScript = propInitScript.Value, - MapScript = propMapScript.Value, - Missing = propMissing.Value, - Params = propParams.Value, - ReduceScript = propReduceScript.Value, - Script = propScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCombineScript, value.CombineScript, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropInitScript, value.InitScript, null, null); - writer.WriteProperty(options, PropMapScript, value.MapScript, null, null); - writer.WriteProperty(options, PropMissing, value.Missing, null, null); - writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropReduceScript, value.ReduceScript, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.ScriptedMetricAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.ScriptedMetricAggregationConverter))] public sealed partial class ScriptedMetricAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SerialDifferencingAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SerialDifferencingAggregation.Converters.g.cs new file mode 100644 index 00000000000..f4b6c6833d6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SerialDifferencingAggregation.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class SerialDifferencingAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); + private static readonly System.Text.Json.JsonEncodedText PropLag = System.Text.Json.JsonEncodedText.Encode("lag"); + + public override Elastic.Clients.Elasticsearch.Aggregations.SerialDifferencingAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucketsPath = default; + LocalJsonValue propFormat = default; + LocalJsonValue propGapPolicy = default; + LocalJsonValue propLag = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLag.TryReadProperty(ref reader, options, PropLag, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.SerialDifferencingAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BucketsPath = propBucketsPath.Value, + Format = propFormat.Value, + GapPolicy = propGapPolicy.Value, + Lag = propLag.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SerialDifferencingAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLag, value.Lag, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SerialDifferencingAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SerialDifferencingAggregation.g.cs index 19b6d628615..a3fbf4e81a6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SerialDifferencingAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SerialDifferencingAggregation.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class SerialDifferencingAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); - private static readonly System.Text.Json.JsonEncodedText PropLag = System.Text.Json.JsonEncodedText.Encode("lag"); - - public override Elastic.Clients.Elasticsearch.Aggregations.SerialDifferencingAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBucketsPath = default; - LocalJsonValue propFormat = default; - LocalJsonValue propGapPolicy = default; - LocalJsonValue propLag = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLag.TryReadProperty(ref reader, options, PropLag, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.SerialDifferencingAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BucketsPath = propBucketsPath.Value, - Format = propFormat.Value, - GapPolicy = propGapPolicy.Value, - Lag = propLag.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SerialDifferencingAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLag, value.Lag, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.SerialDifferencingAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.SerialDifferencingAggregationConverter))] public sealed partial class SerialDifferencingAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantLongTermsAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantLongTermsAggregate.Converters.g.cs new file mode 100644 index 00000000000..430786f15c5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantLongTermsAggregate.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class SignificantLongTermsAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBgCount = System.Text.Json.JsonEncodedText.Encode("bg_count"); + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.SignificantLongTermsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBgCount = default; + LocalJsonValue> propBuckets = default; + LocalJsonValue propDocCount = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBgCount.TryReadProperty(ref reader, options, PropBgCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.SignificantLongTermsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BgCount = propBgCount.Value, + Buckets = propBuckets.Value, + DocCount = propDocCount.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SignificantLongTermsAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBgCount, value.BgCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantLongTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantLongTermsAggregate.g.cs index c7918cd3b9a..d88d04af5ea 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantLongTermsAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantLongTermsAggregate.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class SignificantLongTermsAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBgCount = System.Text.Json.JsonEncodedText.Encode("bg_count"); - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.SignificantLongTermsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBgCount = default; - LocalJsonValue> propBuckets = default; - LocalJsonValue propDocCount = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBgCount.TryReadProperty(ref reader, options, PropBgCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.SignificantLongTermsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BgCount = propBgCount.Value, - Buckets = propBuckets.Value, - DocCount = propDocCount.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SignificantLongTermsAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBgCount, value.BgCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.SignificantLongTermsAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.SignificantLongTermsAggregateConverter))] public sealed partial class SignificantLongTermsAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantLongTermsBucket.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantLongTermsBucket.Converters.g.cs new file mode 100644 index 00000000000..740e077dfb4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantLongTermsBucket.Converters.g.cs @@ -0,0 +1,105 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class SignificantLongTermsBucketConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBgCount = System.Text.Json.JsonEncodedText.Encode("bg_count"); + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); + private static readonly System.Text.Json.JsonEncodedText PropKeyAsString = System.Text.Json.JsonEncodedText.Encode("key_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropScore = System.Text.Json.JsonEncodedText.Encode("score"); + + public override Elastic.Clients.Elasticsearch.Aggregations.SignificantLongTermsBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propBgCount = default; + LocalJsonValue propDocCount = default; + LocalJsonValue propKey = default; + LocalJsonValue propKeyAsString = default; + LocalJsonValue propScore = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBgCount.TryReadProperty(ref reader, options, PropBgCount, null)) + { + continue; + } + + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propKey.TryReadProperty(ref reader, options, PropKey, null)) + { + continue; + } + + if (propKeyAsString.TryReadProperty(ref reader, options, PropKeyAsString, null)) + { + continue; + } + + if (propScore.TryReadProperty(ref reader, options, PropScore, null)) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.SignificantLongTermsBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + BgCount = propBgCount.Value, + DocCount = propDocCount.Value, + Key = propKey.Value, + KeyAsString = propKeyAsString.Value, + Score = propScore.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SignificantLongTermsBucket value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBgCount, value.BgCount, null, null); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropKey, value.Key, null, null); + writer.WriteProperty(options, PropKeyAsString, value.KeyAsString, null, null); + writer.WriteProperty(options, PropScore, value.Score, null, null); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantLongTermsBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantLongTermsBucket.g.cs index 08f79c017bb..d87f74fec18 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantLongTermsBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantLongTermsBucket.g.cs @@ -23,88 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class SignificantLongTermsBucketConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBgCount = System.Text.Json.JsonEncodedText.Encode("bg_count"); - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); - private static readonly System.Text.Json.JsonEncodedText PropKeyAsString = System.Text.Json.JsonEncodedText.Encode("key_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropScore = System.Text.Json.JsonEncodedText.Encode("score"); - - public override Elastic.Clients.Elasticsearch.Aggregations.SignificantLongTermsBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propBgCount = default; - LocalJsonValue propDocCount = default; - LocalJsonValue propKey = default; - LocalJsonValue propKeyAsString = default; - LocalJsonValue propScore = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBgCount.TryReadProperty(ref reader, options, PropBgCount, null)) - { - continue; - } - - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propKey.TryReadProperty(ref reader, options, PropKey, null)) - { - continue; - } - - if (propKeyAsString.TryReadProperty(ref reader, options, PropKeyAsString, null)) - { - continue; - } - - if (propScore.TryReadProperty(ref reader, options, PropScore, null)) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.SignificantLongTermsBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - BgCount = propBgCount.Value, - DocCount = propDocCount.Value, - Key = propKey.Value, - KeyAsString = propKeyAsString.Value, - Score = propScore.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SignificantLongTermsBucket value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBgCount, value.BgCount, null, null); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropKey, value.Key, null, null); - writer.WriteProperty(options, PropKeyAsString, value.KeyAsString, null, null); - writer.WriteProperty(options, PropScore, value.Score, null, null); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.SignificantLongTermsBucketConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.SignificantLongTermsBucketConverter))] public sealed partial class SignificantLongTermsBucket { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantStringTermsAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantStringTermsAggregate.Converters.g.cs new file mode 100644 index 00000000000..4b781a58764 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantStringTermsAggregate.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class SignificantStringTermsAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBgCount = System.Text.Json.JsonEncodedText.Encode("bg_count"); + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.SignificantStringTermsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBgCount = default; + LocalJsonValue> propBuckets = default; + LocalJsonValue propDocCount = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBgCount.TryReadProperty(ref reader, options, PropBgCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.SignificantStringTermsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BgCount = propBgCount.Value, + Buckets = propBuckets.Value, + DocCount = propDocCount.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SignificantStringTermsAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBgCount, value.BgCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantStringTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantStringTermsAggregate.g.cs index b805b2137e3..22ec9fb1abd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantStringTermsAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantStringTermsAggregate.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class SignificantStringTermsAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBgCount = System.Text.Json.JsonEncodedText.Encode("bg_count"); - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.SignificantStringTermsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBgCount = default; - LocalJsonValue> propBuckets = default; - LocalJsonValue propDocCount = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBgCount.TryReadProperty(ref reader, options, PropBgCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.SignificantStringTermsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BgCount = propBgCount.Value, - Buckets = propBuckets.Value, - DocCount = propDocCount.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SignificantStringTermsAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBgCount, value.BgCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.SignificantStringTermsAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.SignificantStringTermsAggregateConverter))] public sealed partial class SignificantStringTermsAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantStringTermsBucket.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantStringTermsBucket.Converters.g.cs new file mode 100644 index 00000000000..1f308d3e633 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantStringTermsBucket.Converters.g.cs @@ -0,0 +1,96 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class SignificantStringTermsBucketConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBgCount = System.Text.Json.JsonEncodedText.Encode("bg_count"); + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); + private static readonly System.Text.Json.JsonEncodedText PropScore = System.Text.Json.JsonEncodedText.Encode("score"); + + public override Elastic.Clients.Elasticsearch.Aggregations.SignificantStringTermsBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propBgCount = default; + LocalJsonValue propDocCount = default; + LocalJsonValue propKey = default; + LocalJsonValue propScore = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBgCount.TryReadProperty(ref reader, options, PropBgCount, null)) + { + continue; + } + + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propKey.TryReadProperty(ref reader, options, PropKey, null)) + { + continue; + } + + if (propScore.TryReadProperty(ref reader, options, PropScore, null)) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.SignificantStringTermsBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + BgCount = propBgCount.Value, + DocCount = propDocCount.Value, + Key = propKey.Value, + Score = propScore.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SignificantStringTermsBucket value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBgCount, value.BgCount, null, null); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropKey, value.Key, null, null); + writer.WriteProperty(options, PropScore, value.Score, null, null); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantStringTermsBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantStringTermsBucket.g.cs index 38877eda609..1be9e216af6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantStringTermsBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantStringTermsBucket.g.cs @@ -23,79 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class SignificantStringTermsBucketConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBgCount = System.Text.Json.JsonEncodedText.Encode("bg_count"); - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); - private static readonly System.Text.Json.JsonEncodedText PropScore = System.Text.Json.JsonEncodedText.Encode("score"); - - public override Elastic.Clients.Elasticsearch.Aggregations.SignificantStringTermsBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propBgCount = default; - LocalJsonValue propDocCount = default; - LocalJsonValue propKey = default; - LocalJsonValue propScore = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBgCount.TryReadProperty(ref reader, options, PropBgCount, null)) - { - continue; - } - - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propKey.TryReadProperty(ref reader, options, PropKey, null)) - { - continue; - } - - if (propScore.TryReadProperty(ref reader, options, PropScore, null)) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.SignificantStringTermsBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - BgCount = propBgCount.Value, - DocCount = propDocCount.Value, - Key = propKey.Value, - Score = propScore.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SignificantStringTermsBucket value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBgCount, value.BgCount, null, null); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropKey, value.Key, null, null); - writer.WriteProperty(options, PropScore, value.Score, null, null); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.SignificantStringTermsBucketConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.SignificantStringTermsBucketConverter))] public sealed partial class SignificantStringTermsBucket { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantTermsAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantTermsAggregation.Converters.g.cs new file mode 100644 index 00000000000..7977a9fcf22 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantTermsAggregation.Converters.g.cs @@ -0,0 +1,189 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class SignificantTermsAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBackgroundFilter = System.Text.Json.JsonEncodedText.Encode("background_filter"); + private static readonly System.Text.Json.JsonEncodedText PropChiSquare = System.Text.Json.JsonEncodedText.Encode("chi_square"); + private static readonly System.Text.Json.JsonEncodedText PropExclude = System.Text.Json.JsonEncodedText.Encode("exclude"); + private static readonly System.Text.Json.JsonEncodedText PropExecutionHint = System.Text.Json.JsonEncodedText.Encode("execution_hint"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropGnd = System.Text.Json.JsonEncodedText.Encode("gnd"); + private static readonly System.Text.Json.JsonEncodedText PropInclude = System.Text.Json.JsonEncodedText.Encode("include"); + private static readonly System.Text.Json.JsonEncodedText PropJlh = System.Text.Json.JsonEncodedText.Encode("jlh"); + private static readonly System.Text.Json.JsonEncodedText PropMinDocCount = System.Text.Json.JsonEncodedText.Encode("min_doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropMutualInformation = System.Text.Json.JsonEncodedText.Encode("mutual_information"); + private static readonly System.Text.Json.JsonEncodedText PropPercentage = System.Text.Json.JsonEncodedText.Encode("percentage"); + private static readonly System.Text.Json.JsonEncodedText PropScriptHeuristic = System.Text.Json.JsonEncodedText.Encode("script_heuristic"); + private static readonly System.Text.Json.JsonEncodedText PropShardMinDocCount = System.Text.Json.JsonEncodedText.Encode("shard_min_doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + + public override Elastic.Clients.Elasticsearch.Aggregations.SignificantTermsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBackgroundFilter = default; + LocalJsonValue propChiSquare = default; + LocalJsonValue propExclude = default; + LocalJsonValue propExecutionHint = default; + LocalJsonValue propField = default; + LocalJsonValue propGnd = default; + LocalJsonValue propInclude = default; + LocalJsonValue propJlh = default; + LocalJsonValue propMinDocCount = default; + LocalJsonValue propMutualInformation = default; + LocalJsonValue propPercentage = default; + LocalJsonValue propScriptHeuristic = default; + LocalJsonValue propShardMinDocCount = default; + LocalJsonValue propShardSize = default; + LocalJsonValue propSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBackgroundFilter.TryReadProperty(ref reader, options, PropBackgroundFilter, null)) + { + continue; + } + + if (propChiSquare.TryReadProperty(ref reader, options, PropChiSquare, null)) + { + continue; + } + + if (propExclude.TryReadProperty(ref reader, options, PropExclude, null)) + { + continue; + } + + if (propExecutionHint.TryReadProperty(ref reader, options, PropExecutionHint, static Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propGnd.TryReadProperty(ref reader, options, PropGnd, null)) + { + continue; + } + + if (propInclude.TryReadProperty(ref reader, options, PropInclude, null)) + { + continue; + } + + if (propJlh.TryReadProperty(ref reader, options, PropJlh, null)) + { + continue; + } + + if (propMinDocCount.TryReadProperty(ref reader, options, PropMinDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMutualInformation.TryReadProperty(ref reader, options, PropMutualInformation, null)) + { + continue; + } + + if (propPercentage.TryReadProperty(ref reader, options, PropPercentage, null)) + { + continue; + } + + if (propScriptHeuristic.TryReadProperty(ref reader, options, PropScriptHeuristic, null)) + { + continue; + } + + if (propShardMinDocCount.TryReadProperty(ref reader, options, PropShardMinDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propShardSize.TryReadProperty(ref reader, options, PropShardSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.SignificantTermsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BackgroundFilter = propBackgroundFilter.Value, + ChiSquare = propChiSquare.Value, + Exclude = propExclude.Value, + ExecutionHint = propExecutionHint.Value, + Field = propField.Value, + Gnd = propGnd.Value, + Include = propInclude.Value, + Jlh = propJlh.Value, + MinDocCount = propMinDocCount.Value, + MutualInformation = propMutualInformation.Value, + Percentage = propPercentage.Value, + ScriptHeuristic = propScriptHeuristic.Value, + ShardMinDocCount = propShardMinDocCount.Value, + ShardSize = propShardSize.Value, + Size = propSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SignificantTermsAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBackgroundFilter, value.BackgroundFilter, null, null); + writer.WriteProperty(options, PropChiSquare, value.ChiSquare, null, null); + writer.WriteProperty(options, PropExclude, value.Exclude, null, null); + writer.WriteProperty(options, PropExecutionHint, value.ExecutionHint, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropGnd, value.Gnd, null, null); + writer.WriteProperty(options, PropInclude, value.Include, null, null); + writer.WriteProperty(options, PropJlh, value.Jlh, null, null); + writer.WriteProperty(options, PropMinDocCount, value.MinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMutualInformation, value.MutualInformation, null, null); + writer.WriteProperty(options, PropPercentage, value.Percentage, null, null); + writer.WriteProperty(options, PropScriptHeuristic, value.ScriptHeuristic, null, null); + writer.WriteProperty(options, PropShardMinDocCount, value.ShardMinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantTermsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantTermsAggregation.g.cs index 6f3bc516c9c..ef4cc306454 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantTermsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantTermsAggregation.g.cs @@ -23,172 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class SignificantTermsAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBackgroundFilter = System.Text.Json.JsonEncodedText.Encode("background_filter"); - private static readonly System.Text.Json.JsonEncodedText PropChiSquare = System.Text.Json.JsonEncodedText.Encode("chi_square"); - private static readonly System.Text.Json.JsonEncodedText PropExclude = System.Text.Json.JsonEncodedText.Encode("exclude"); - private static readonly System.Text.Json.JsonEncodedText PropExecutionHint = System.Text.Json.JsonEncodedText.Encode("execution_hint"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropGnd = System.Text.Json.JsonEncodedText.Encode("gnd"); - private static readonly System.Text.Json.JsonEncodedText PropInclude = System.Text.Json.JsonEncodedText.Encode("include"); - private static readonly System.Text.Json.JsonEncodedText PropJlh = System.Text.Json.JsonEncodedText.Encode("jlh"); - private static readonly System.Text.Json.JsonEncodedText PropMinDocCount = System.Text.Json.JsonEncodedText.Encode("min_doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropMutualInformation = System.Text.Json.JsonEncodedText.Encode("mutual_information"); - private static readonly System.Text.Json.JsonEncodedText PropPercentage = System.Text.Json.JsonEncodedText.Encode("percentage"); - private static readonly System.Text.Json.JsonEncodedText PropScriptHeuristic = System.Text.Json.JsonEncodedText.Encode("script_heuristic"); - private static readonly System.Text.Json.JsonEncodedText PropShardMinDocCount = System.Text.Json.JsonEncodedText.Encode("shard_min_doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - - public override Elastic.Clients.Elasticsearch.Aggregations.SignificantTermsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBackgroundFilter = default; - LocalJsonValue propChiSquare = default; - LocalJsonValue propExclude = default; - LocalJsonValue propExecutionHint = default; - LocalJsonValue propField = default; - LocalJsonValue propGnd = default; - LocalJsonValue propInclude = default; - LocalJsonValue propJlh = default; - LocalJsonValue propMinDocCount = default; - LocalJsonValue propMutualInformation = default; - LocalJsonValue propPercentage = default; - LocalJsonValue propScriptHeuristic = default; - LocalJsonValue propShardMinDocCount = default; - LocalJsonValue propShardSize = default; - LocalJsonValue propSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBackgroundFilter.TryReadProperty(ref reader, options, PropBackgroundFilter, null)) - { - continue; - } - - if (propChiSquare.TryReadProperty(ref reader, options, PropChiSquare, null)) - { - continue; - } - - if (propExclude.TryReadProperty(ref reader, options, PropExclude, null)) - { - continue; - } - - if (propExecutionHint.TryReadProperty(ref reader, options, PropExecutionHint, static Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propGnd.TryReadProperty(ref reader, options, PropGnd, null)) - { - continue; - } - - if (propInclude.TryReadProperty(ref reader, options, PropInclude, null)) - { - continue; - } - - if (propJlh.TryReadProperty(ref reader, options, PropJlh, null)) - { - continue; - } - - if (propMinDocCount.TryReadProperty(ref reader, options, PropMinDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMutualInformation.TryReadProperty(ref reader, options, PropMutualInformation, null)) - { - continue; - } - - if (propPercentage.TryReadProperty(ref reader, options, PropPercentage, null)) - { - continue; - } - - if (propScriptHeuristic.TryReadProperty(ref reader, options, PropScriptHeuristic, null)) - { - continue; - } - - if (propShardMinDocCount.TryReadProperty(ref reader, options, PropShardMinDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propShardSize.TryReadProperty(ref reader, options, PropShardSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.SignificantTermsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BackgroundFilter = propBackgroundFilter.Value, - ChiSquare = propChiSquare.Value, - Exclude = propExclude.Value, - ExecutionHint = propExecutionHint.Value, - Field = propField.Value, - Gnd = propGnd.Value, - Include = propInclude.Value, - Jlh = propJlh.Value, - MinDocCount = propMinDocCount.Value, - MutualInformation = propMutualInformation.Value, - Percentage = propPercentage.Value, - ScriptHeuristic = propScriptHeuristic.Value, - ShardMinDocCount = propShardMinDocCount.Value, - ShardSize = propShardSize.Value, - Size = propSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SignificantTermsAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBackgroundFilter, value.BackgroundFilter, null, null); - writer.WriteProperty(options, PropChiSquare, value.ChiSquare, null, null); - writer.WriteProperty(options, PropExclude, value.Exclude, null, null); - writer.WriteProperty(options, PropExecutionHint, value.ExecutionHint, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropGnd, value.Gnd, null, null); - writer.WriteProperty(options, PropInclude, value.Include, null, null); - writer.WriteProperty(options, PropJlh, value.Jlh, null, null); - writer.WriteProperty(options, PropMinDocCount, value.MinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMutualInformation, value.MutualInformation, null, null); - writer.WriteProperty(options, PropPercentage, value.Percentage, null, null); - writer.WriteProperty(options, PropScriptHeuristic, value.ScriptHeuristic, null, null); - writer.WriteProperty(options, PropShardMinDocCount, value.ShardMinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.SignificantTermsAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.SignificantTermsAggregationConverter))] public sealed partial class SignificantTermsAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantTextAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantTextAggregation.Converters.g.cs new file mode 100644 index 00000000000..8d6ebf64ed2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantTextAggregation.Converters.g.cs @@ -0,0 +1,207 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class SignificantTextAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBackgroundFilter = System.Text.Json.JsonEncodedText.Encode("background_filter"); + private static readonly System.Text.Json.JsonEncodedText PropChiSquare = System.Text.Json.JsonEncodedText.Encode("chi_square"); + private static readonly System.Text.Json.JsonEncodedText PropExclude = System.Text.Json.JsonEncodedText.Encode("exclude"); + private static readonly System.Text.Json.JsonEncodedText PropExecutionHint = System.Text.Json.JsonEncodedText.Encode("execution_hint"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFilterDuplicateText = System.Text.Json.JsonEncodedText.Encode("filter_duplicate_text"); + private static readonly System.Text.Json.JsonEncodedText PropGnd = System.Text.Json.JsonEncodedText.Encode("gnd"); + private static readonly System.Text.Json.JsonEncodedText PropInclude = System.Text.Json.JsonEncodedText.Encode("include"); + private static readonly System.Text.Json.JsonEncodedText PropJlh = System.Text.Json.JsonEncodedText.Encode("jlh"); + private static readonly System.Text.Json.JsonEncodedText PropMinDocCount = System.Text.Json.JsonEncodedText.Encode("min_doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropMutualInformation = System.Text.Json.JsonEncodedText.Encode("mutual_information"); + private static readonly System.Text.Json.JsonEncodedText PropPercentage = System.Text.Json.JsonEncodedText.Encode("percentage"); + private static readonly System.Text.Json.JsonEncodedText PropScriptHeuristic = System.Text.Json.JsonEncodedText.Encode("script_heuristic"); + private static readonly System.Text.Json.JsonEncodedText PropShardMinDocCount = System.Text.Json.JsonEncodedText.Encode("shard_min_doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropSourceFields = System.Text.Json.JsonEncodedText.Encode("source_fields"); + + public override Elastic.Clients.Elasticsearch.Aggregations.SignificantTextAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBackgroundFilter = default; + LocalJsonValue propChiSquare = default; + LocalJsonValue propExclude = default; + LocalJsonValue propExecutionHint = default; + LocalJsonValue propField = default; + LocalJsonValue propFilterDuplicateText = default; + LocalJsonValue propGnd = default; + LocalJsonValue propInclude = default; + LocalJsonValue propJlh = default; + LocalJsonValue propMinDocCount = default; + LocalJsonValue propMutualInformation = default; + LocalJsonValue propPercentage = default; + LocalJsonValue propScriptHeuristic = default; + LocalJsonValue propShardMinDocCount = default; + LocalJsonValue propShardSize = default; + LocalJsonValue propSize = default; + LocalJsonValue propSourceFields = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBackgroundFilter.TryReadProperty(ref reader, options, PropBackgroundFilter, null)) + { + continue; + } + + if (propChiSquare.TryReadProperty(ref reader, options, PropChiSquare, null)) + { + continue; + } + + if (propExclude.TryReadProperty(ref reader, options, PropExclude, null)) + { + continue; + } + + if (propExecutionHint.TryReadProperty(ref reader, options, PropExecutionHint, static Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFilterDuplicateText.TryReadProperty(ref reader, options, PropFilterDuplicateText, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propGnd.TryReadProperty(ref reader, options, PropGnd, null)) + { + continue; + } + + if (propInclude.TryReadProperty(ref reader, options, PropInclude, null)) + { + continue; + } + + if (propJlh.TryReadProperty(ref reader, options, PropJlh, null)) + { + continue; + } + + if (propMinDocCount.TryReadProperty(ref reader, options, PropMinDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMutualInformation.TryReadProperty(ref reader, options, PropMutualInformation, null)) + { + continue; + } + + if (propPercentage.TryReadProperty(ref reader, options, PropPercentage, null)) + { + continue; + } + + if (propScriptHeuristic.TryReadProperty(ref reader, options, PropScriptHeuristic, null)) + { + continue; + } + + if (propShardMinDocCount.TryReadProperty(ref reader, options, PropShardMinDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propShardSize.TryReadProperty(ref reader, options, PropShardSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSourceFields.TryReadProperty(ref reader, options, PropSourceFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.SignificantTextAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BackgroundFilter = propBackgroundFilter.Value, + ChiSquare = propChiSquare.Value, + Exclude = propExclude.Value, + ExecutionHint = propExecutionHint.Value, + Field = propField.Value, + FilterDuplicateText = propFilterDuplicateText.Value, + Gnd = propGnd.Value, + Include = propInclude.Value, + Jlh = propJlh.Value, + MinDocCount = propMinDocCount.Value, + MutualInformation = propMutualInformation.Value, + Percentage = propPercentage.Value, + ScriptHeuristic = propScriptHeuristic.Value, + ShardMinDocCount = propShardMinDocCount.Value, + ShardSize = propShardSize.Value, + Size = propSize.Value, + SourceFields = propSourceFields.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SignificantTextAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBackgroundFilter, value.BackgroundFilter, null, null); + writer.WriteProperty(options, PropChiSquare, value.ChiSquare, null, null); + writer.WriteProperty(options, PropExclude, value.Exclude, null, null); + writer.WriteProperty(options, PropExecutionHint, value.ExecutionHint, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFilterDuplicateText, value.FilterDuplicateText, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropGnd, value.Gnd, null, null); + writer.WriteProperty(options, PropInclude, value.Include, null, null); + writer.WriteProperty(options, PropJlh, value.Jlh, null, null); + writer.WriteProperty(options, PropMinDocCount, value.MinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMutualInformation, value.MutualInformation, null, null); + writer.WriteProperty(options, PropPercentage, value.Percentage, null, null); + writer.WriteProperty(options, PropScriptHeuristic, value.ScriptHeuristic, null, null); + writer.WriteProperty(options, PropShardMinDocCount, value.ShardMinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSourceFields, value.SourceFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantTextAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantTextAggregation.g.cs index 270b5938c61..d678c5c6dac 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantTextAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SignificantTextAggregation.g.cs @@ -23,190 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class SignificantTextAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBackgroundFilter = System.Text.Json.JsonEncodedText.Encode("background_filter"); - private static readonly System.Text.Json.JsonEncodedText PropChiSquare = System.Text.Json.JsonEncodedText.Encode("chi_square"); - private static readonly System.Text.Json.JsonEncodedText PropExclude = System.Text.Json.JsonEncodedText.Encode("exclude"); - private static readonly System.Text.Json.JsonEncodedText PropExecutionHint = System.Text.Json.JsonEncodedText.Encode("execution_hint"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFilterDuplicateText = System.Text.Json.JsonEncodedText.Encode("filter_duplicate_text"); - private static readonly System.Text.Json.JsonEncodedText PropGnd = System.Text.Json.JsonEncodedText.Encode("gnd"); - private static readonly System.Text.Json.JsonEncodedText PropInclude = System.Text.Json.JsonEncodedText.Encode("include"); - private static readonly System.Text.Json.JsonEncodedText PropJlh = System.Text.Json.JsonEncodedText.Encode("jlh"); - private static readonly System.Text.Json.JsonEncodedText PropMinDocCount = System.Text.Json.JsonEncodedText.Encode("min_doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropMutualInformation = System.Text.Json.JsonEncodedText.Encode("mutual_information"); - private static readonly System.Text.Json.JsonEncodedText PropPercentage = System.Text.Json.JsonEncodedText.Encode("percentage"); - private static readonly System.Text.Json.JsonEncodedText PropScriptHeuristic = System.Text.Json.JsonEncodedText.Encode("script_heuristic"); - private static readonly System.Text.Json.JsonEncodedText PropShardMinDocCount = System.Text.Json.JsonEncodedText.Encode("shard_min_doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropSourceFields = System.Text.Json.JsonEncodedText.Encode("source_fields"); - - public override Elastic.Clients.Elasticsearch.Aggregations.SignificantTextAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBackgroundFilter = default; - LocalJsonValue propChiSquare = default; - LocalJsonValue propExclude = default; - LocalJsonValue propExecutionHint = default; - LocalJsonValue propField = default; - LocalJsonValue propFilterDuplicateText = default; - LocalJsonValue propGnd = default; - LocalJsonValue propInclude = default; - LocalJsonValue propJlh = default; - LocalJsonValue propMinDocCount = default; - LocalJsonValue propMutualInformation = default; - LocalJsonValue propPercentage = default; - LocalJsonValue propScriptHeuristic = default; - LocalJsonValue propShardMinDocCount = default; - LocalJsonValue propShardSize = default; - LocalJsonValue propSize = default; - LocalJsonValue propSourceFields = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBackgroundFilter.TryReadProperty(ref reader, options, PropBackgroundFilter, null)) - { - continue; - } - - if (propChiSquare.TryReadProperty(ref reader, options, PropChiSquare, null)) - { - continue; - } - - if (propExclude.TryReadProperty(ref reader, options, PropExclude, null)) - { - continue; - } - - if (propExecutionHint.TryReadProperty(ref reader, options, PropExecutionHint, static Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFilterDuplicateText.TryReadProperty(ref reader, options, PropFilterDuplicateText, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propGnd.TryReadProperty(ref reader, options, PropGnd, null)) - { - continue; - } - - if (propInclude.TryReadProperty(ref reader, options, PropInclude, null)) - { - continue; - } - - if (propJlh.TryReadProperty(ref reader, options, PropJlh, null)) - { - continue; - } - - if (propMinDocCount.TryReadProperty(ref reader, options, PropMinDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMutualInformation.TryReadProperty(ref reader, options, PropMutualInformation, null)) - { - continue; - } - - if (propPercentage.TryReadProperty(ref reader, options, PropPercentage, null)) - { - continue; - } - - if (propScriptHeuristic.TryReadProperty(ref reader, options, PropScriptHeuristic, null)) - { - continue; - } - - if (propShardMinDocCount.TryReadProperty(ref reader, options, PropShardMinDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propShardSize.TryReadProperty(ref reader, options, PropShardSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSourceFields.TryReadProperty(ref reader, options, PropSourceFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.SignificantTextAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BackgroundFilter = propBackgroundFilter.Value, - ChiSquare = propChiSquare.Value, - Exclude = propExclude.Value, - ExecutionHint = propExecutionHint.Value, - Field = propField.Value, - FilterDuplicateText = propFilterDuplicateText.Value, - Gnd = propGnd.Value, - Include = propInclude.Value, - Jlh = propJlh.Value, - MinDocCount = propMinDocCount.Value, - MutualInformation = propMutualInformation.Value, - Percentage = propPercentage.Value, - ScriptHeuristic = propScriptHeuristic.Value, - ShardMinDocCount = propShardMinDocCount.Value, - ShardSize = propShardSize.Value, - Size = propSize.Value, - SourceFields = propSourceFields.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SignificantTextAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBackgroundFilter, value.BackgroundFilter, null, null); - writer.WriteProperty(options, PropChiSquare, value.ChiSquare, null, null); - writer.WriteProperty(options, PropExclude, value.Exclude, null, null); - writer.WriteProperty(options, PropExecutionHint, value.ExecutionHint, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFilterDuplicateText, value.FilterDuplicateText, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropGnd, value.Gnd, null, null); - writer.WriteProperty(options, PropInclude, value.Include, null, null); - writer.WriteProperty(options, PropJlh, value.Jlh, null, null); - writer.WriteProperty(options, PropMinDocCount, value.MinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMutualInformation, value.MutualInformation, null, null); - writer.WriteProperty(options, PropPercentage, value.Percentage, null, null); - writer.WriteProperty(options, PropScriptHeuristic, value.ScriptHeuristic, null, null); - writer.WriteProperty(options, PropShardMinDocCount, value.ShardMinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSourceFields, value.SourceFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.SignificantTextAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.SignificantTextAggregationConverter))] public sealed partial class SignificantTextAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SimpleValueAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SimpleValueAggregate.Converters.g.cs new file mode 100644 index 00000000000..8ad4a1db255 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SimpleValueAggregate.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class SimpleValueAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.SimpleValueAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propMeta = default; + LocalJsonValue propValue = default; + LocalJsonValue propValueAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.SimpleValueAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Meta = propMeta.Value, + Value = propValue.Value, + ValueAsString = propValueAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SimpleValueAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SimpleValueAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SimpleValueAggregate.g.cs index 36fba68e0f6..3b5e9c9a70b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SimpleValueAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SimpleValueAggregate.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class SimpleValueAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.SimpleValueAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propMeta = default; - LocalJsonValue propValue = default; - LocalJsonValue propValueAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.SimpleValueAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Meta = propMeta.Value, - Value = propValue.Value, - ValueAsString = propValueAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SimpleValueAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.SimpleValueAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.SimpleValueAggregateConverter))] public sealed partial class SimpleValueAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StandardDeviationBounds.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StandardDeviationBounds.Converters.g.cs new file mode 100644 index 00000000000..1782763d7de --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StandardDeviationBounds.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class StandardDeviationBoundsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLower = System.Text.Json.JsonEncodedText.Encode("lower"); + private static readonly System.Text.Json.JsonEncodedText PropLowerPopulation = System.Text.Json.JsonEncodedText.Encode("lower_population"); + private static readonly System.Text.Json.JsonEncodedText PropLowerSampling = System.Text.Json.JsonEncodedText.Encode("lower_sampling"); + private static readonly System.Text.Json.JsonEncodedText PropUpper = System.Text.Json.JsonEncodedText.Encode("upper"); + private static readonly System.Text.Json.JsonEncodedText PropUpperPopulation = System.Text.Json.JsonEncodedText.Encode("upper_population"); + private static readonly System.Text.Json.JsonEncodedText PropUpperSampling = System.Text.Json.JsonEncodedText.Encode("upper_sampling"); + + public override Elastic.Clients.Elasticsearch.Aggregations.StandardDeviationBounds Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLower = default; + LocalJsonValue propLowerPopulation = default; + LocalJsonValue propLowerSampling = default; + LocalJsonValue propUpper = default; + LocalJsonValue propUpperPopulation = default; + LocalJsonValue propUpperSampling = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLower.TryReadProperty(ref reader, options, PropLower, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLowerPopulation.TryReadProperty(ref reader, options, PropLowerPopulation, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLowerSampling.TryReadProperty(ref reader, options, PropLowerSampling, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propUpper.TryReadProperty(ref reader, options, PropUpper, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propUpperPopulation.TryReadProperty(ref reader, options, PropUpperPopulation, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propUpperSampling.TryReadProperty(ref reader, options, PropUpperSampling, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.StandardDeviationBounds(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Lower = propLower.Value, + LowerPopulation = propLowerPopulation.Value, + LowerSampling = propLowerSampling.Value, + Upper = propUpper.Value, + UpperPopulation = propUpperPopulation.Value, + UpperSampling = propUpperSampling.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.StandardDeviationBounds value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLower, value.Lower, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLowerPopulation, value.LowerPopulation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLowerSampling, value.LowerSampling, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropUpper, value.Upper, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropUpperPopulation, value.UpperPopulation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropUpperSampling, value.UpperSampling, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StandardDeviationBounds.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StandardDeviationBounds.g.cs index 92b68ff1ac6..5cb79aa885a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StandardDeviationBounds.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StandardDeviationBounds.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class StandardDeviationBoundsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLower = System.Text.Json.JsonEncodedText.Encode("lower"); - private static readonly System.Text.Json.JsonEncodedText PropLowerPopulation = System.Text.Json.JsonEncodedText.Encode("lower_population"); - private static readonly System.Text.Json.JsonEncodedText PropLowerSampling = System.Text.Json.JsonEncodedText.Encode("lower_sampling"); - private static readonly System.Text.Json.JsonEncodedText PropUpper = System.Text.Json.JsonEncodedText.Encode("upper"); - private static readonly System.Text.Json.JsonEncodedText PropUpperPopulation = System.Text.Json.JsonEncodedText.Encode("upper_population"); - private static readonly System.Text.Json.JsonEncodedText PropUpperSampling = System.Text.Json.JsonEncodedText.Encode("upper_sampling"); - - public override Elastic.Clients.Elasticsearch.Aggregations.StandardDeviationBounds Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLower = default; - LocalJsonValue propLowerPopulation = default; - LocalJsonValue propLowerSampling = default; - LocalJsonValue propUpper = default; - LocalJsonValue propUpperPopulation = default; - LocalJsonValue propUpperSampling = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLower.TryReadProperty(ref reader, options, PropLower, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLowerPopulation.TryReadProperty(ref reader, options, PropLowerPopulation, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLowerSampling.TryReadProperty(ref reader, options, PropLowerSampling, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propUpper.TryReadProperty(ref reader, options, PropUpper, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propUpperPopulation.TryReadProperty(ref reader, options, PropUpperPopulation, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propUpperSampling.TryReadProperty(ref reader, options, PropUpperSampling, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.StandardDeviationBounds(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Lower = propLower.Value, - LowerPopulation = propLowerPopulation.Value, - LowerSampling = propLowerSampling.Value, - Upper = propUpper.Value, - UpperPopulation = propUpperPopulation.Value, - UpperSampling = propUpperSampling.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.StandardDeviationBounds value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLower, value.Lower, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLowerPopulation, value.LowerPopulation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLowerSampling, value.LowerSampling, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropUpper, value.Upper, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropUpperPopulation, value.UpperPopulation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropUpperSampling, value.UpperSampling, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.StandardDeviationBoundsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.StandardDeviationBoundsConverter))] public sealed partial class StandardDeviationBounds { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StandardDeviationBoundsAsString.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StandardDeviationBoundsAsString.Converters.g.cs new file mode 100644 index 00000000000..aec5e4cba33 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StandardDeviationBoundsAsString.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class StandardDeviationBoundsAsStringConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLower = System.Text.Json.JsonEncodedText.Encode("lower"); + private static readonly System.Text.Json.JsonEncodedText PropLowerPopulation = System.Text.Json.JsonEncodedText.Encode("lower_population"); + private static readonly System.Text.Json.JsonEncodedText PropLowerSampling = System.Text.Json.JsonEncodedText.Encode("lower_sampling"); + private static readonly System.Text.Json.JsonEncodedText PropUpper = System.Text.Json.JsonEncodedText.Encode("upper"); + private static readonly System.Text.Json.JsonEncodedText PropUpperPopulation = System.Text.Json.JsonEncodedText.Encode("upper_population"); + private static readonly System.Text.Json.JsonEncodedText PropUpperSampling = System.Text.Json.JsonEncodedText.Encode("upper_sampling"); + + public override Elastic.Clients.Elasticsearch.Aggregations.StandardDeviationBoundsAsString Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLower = default; + LocalJsonValue propLowerPopulation = default; + LocalJsonValue propLowerSampling = default; + LocalJsonValue propUpper = default; + LocalJsonValue propUpperPopulation = default; + LocalJsonValue propUpperSampling = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLower.TryReadProperty(ref reader, options, PropLower, null)) + { + continue; + } + + if (propLowerPopulation.TryReadProperty(ref reader, options, PropLowerPopulation, null)) + { + continue; + } + + if (propLowerSampling.TryReadProperty(ref reader, options, PropLowerSampling, null)) + { + continue; + } + + if (propUpper.TryReadProperty(ref reader, options, PropUpper, null)) + { + continue; + } + + if (propUpperPopulation.TryReadProperty(ref reader, options, PropUpperPopulation, null)) + { + continue; + } + + if (propUpperSampling.TryReadProperty(ref reader, options, PropUpperSampling, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.StandardDeviationBoundsAsString(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Lower = propLower.Value, + LowerPopulation = propLowerPopulation.Value, + LowerSampling = propLowerSampling.Value, + Upper = propUpper.Value, + UpperPopulation = propUpperPopulation.Value, + UpperSampling = propUpperSampling.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.StandardDeviationBoundsAsString value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLower, value.Lower, null, null); + writer.WriteProperty(options, PropLowerPopulation, value.LowerPopulation, null, null); + writer.WriteProperty(options, PropLowerSampling, value.LowerSampling, null, null); + writer.WriteProperty(options, PropUpper, value.Upper, null, null); + writer.WriteProperty(options, PropUpperPopulation, value.UpperPopulation, null, null); + writer.WriteProperty(options, PropUpperSampling, value.UpperSampling, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StandardDeviationBoundsAsString.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StandardDeviationBoundsAsString.g.cs index 1a9721540b5..7f38862362f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StandardDeviationBoundsAsString.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StandardDeviationBoundsAsString.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class StandardDeviationBoundsAsStringConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLower = System.Text.Json.JsonEncodedText.Encode("lower"); - private static readonly System.Text.Json.JsonEncodedText PropLowerPopulation = System.Text.Json.JsonEncodedText.Encode("lower_population"); - private static readonly System.Text.Json.JsonEncodedText PropLowerSampling = System.Text.Json.JsonEncodedText.Encode("lower_sampling"); - private static readonly System.Text.Json.JsonEncodedText PropUpper = System.Text.Json.JsonEncodedText.Encode("upper"); - private static readonly System.Text.Json.JsonEncodedText PropUpperPopulation = System.Text.Json.JsonEncodedText.Encode("upper_population"); - private static readonly System.Text.Json.JsonEncodedText PropUpperSampling = System.Text.Json.JsonEncodedText.Encode("upper_sampling"); - - public override Elastic.Clients.Elasticsearch.Aggregations.StandardDeviationBoundsAsString Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLower = default; - LocalJsonValue propLowerPopulation = default; - LocalJsonValue propLowerSampling = default; - LocalJsonValue propUpper = default; - LocalJsonValue propUpperPopulation = default; - LocalJsonValue propUpperSampling = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLower.TryReadProperty(ref reader, options, PropLower, null)) - { - continue; - } - - if (propLowerPopulation.TryReadProperty(ref reader, options, PropLowerPopulation, null)) - { - continue; - } - - if (propLowerSampling.TryReadProperty(ref reader, options, PropLowerSampling, null)) - { - continue; - } - - if (propUpper.TryReadProperty(ref reader, options, PropUpper, null)) - { - continue; - } - - if (propUpperPopulation.TryReadProperty(ref reader, options, PropUpperPopulation, null)) - { - continue; - } - - if (propUpperSampling.TryReadProperty(ref reader, options, PropUpperSampling, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.StandardDeviationBoundsAsString(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Lower = propLower.Value, - LowerPopulation = propLowerPopulation.Value, - LowerSampling = propLowerSampling.Value, - Upper = propUpper.Value, - UpperPopulation = propUpperPopulation.Value, - UpperSampling = propUpperSampling.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.StandardDeviationBoundsAsString value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLower, value.Lower, null, null); - writer.WriteProperty(options, PropLowerPopulation, value.LowerPopulation, null, null); - writer.WriteProperty(options, PropLowerSampling, value.LowerSampling, null, null); - writer.WriteProperty(options, PropUpper, value.Upper, null, null); - writer.WriteProperty(options, PropUpperPopulation, value.UpperPopulation, null, null); - writer.WriteProperty(options, PropUpperSampling, value.UpperSampling, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.StandardDeviationBoundsAsStringConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.StandardDeviationBoundsAsStringConverter))] public sealed partial class StandardDeviationBoundsAsString { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsAggregate.Converters.g.cs new file mode 100644 index 00000000000..04eec0ddad3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsAggregate.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class StatsAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvg = System.Text.Json.JsonEncodedText.Encode("avg"); + private static readonly System.Text.Json.JsonEncodedText PropAvgAsString = System.Text.Json.JsonEncodedText.Encode("avg_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText PropMaxAsString = System.Text.Json.JsonEncodedText.Encode("max_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); + private static readonly System.Text.Json.JsonEncodedText PropMinAsString = System.Text.Json.JsonEncodedText.Encode("min_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropSum = System.Text.Json.JsonEncodedText.Encode("sum"); + private static readonly System.Text.Json.JsonEncodedText PropSumAsString = System.Text.Json.JsonEncodedText.Encode("sum_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.StatsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvg = default; + LocalJsonValue propAvgAsString = default; + LocalJsonValue propCount = default; + LocalJsonValue propMax = default; + LocalJsonValue propMaxAsString = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propMin = default; + LocalJsonValue propMinAsString = default; + LocalJsonValue propSum = default; + LocalJsonValue propSumAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvg.TryReadProperty(ref reader, options, PropAvg, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propAvgAsString.TryReadProperty(ref reader, options, PropAvgAsString, null)) + { + continue; + } + + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propMax.TryReadProperty(ref reader, options, PropMax, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxAsString.TryReadProperty(ref reader, options, PropMaxAsString, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propMin.TryReadProperty(ref reader, options, PropMin, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinAsString.TryReadProperty(ref reader, options, PropMinAsString, null)) + { + continue; + } + + if (propSum.TryReadProperty(ref reader, options, PropSum, null)) + { + continue; + } + + if (propSumAsString.TryReadProperty(ref reader, options, PropSumAsString, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.StatsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Avg = propAvg.Value, + AvgAsString = propAvgAsString.Value, + Count = propCount.Value, + Max = propMax.Value, + MaxAsString = propMaxAsString.Value, + Meta = propMeta.Value, + Min = propMin.Value, + MinAsString = propMinAsString.Value, + Sum = propSum.Value, + SumAsString = propSumAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.StatsAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvg, value.Avg, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropAvgAsString, value.AvgAsString, null, null); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropMax, value.Max, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxAsString, value.MaxAsString, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropMin, value.Min, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinAsString, value.MinAsString, null, null); + writer.WriteProperty(options, PropSum, value.Sum, null, null); + writer.WriteProperty(options, PropSumAsString, value.SumAsString, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsAggregate.g.cs index 698c1168418..f0a90a14a4c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsAggregate.g.cs @@ -23,133 +23,13 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class StatsAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvg = System.Text.Json.JsonEncodedText.Encode("avg"); - private static readonly System.Text.Json.JsonEncodedText PropAvgAsString = System.Text.Json.JsonEncodedText.Encode("avg_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); - private static readonly System.Text.Json.JsonEncodedText PropMaxAsString = System.Text.Json.JsonEncodedText.Encode("max_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); - private static readonly System.Text.Json.JsonEncodedText PropMinAsString = System.Text.Json.JsonEncodedText.Encode("min_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropSum = System.Text.Json.JsonEncodedText.Encode("sum"); - private static readonly System.Text.Json.JsonEncodedText PropSumAsString = System.Text.Json.JsonEncodedText.Encode("sum_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.StatsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvg = default; - LocalJsonValue propAvgAsString = default; - LocalJsonValue propCount = default; - LocalJsonValue propMax = default; - LocalJsonValue propMaxAsString = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propMin = default; - LocalJsonValue propMinAsString = default; - LocalJsonValue propSum = default; - LocalJsonValue propSumAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvg.TryReadProperty(ref reader, options, PropAvg, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propAvgAsString.TryReadProperty(ref reader, options, PropAvgAsString, null)) - { - continue; - } - - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propMax.TryReadProperty(ref reader, options, PropMax, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxAsString.TryReadProperty(ref reader, options, PropMaxAsString, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propMin.TryReadProperty(ref reader, options, PropMin, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinAsString.TryReadProperty(ref reader, options, PropMinAsString, null)) - { - continue; - } - - if (propSum.TryReadProperty(ref reader, options, PropSum, null)) - { - continue; - } - - if (propSumAsString.TryReadProperty(ref reader, options, PropSumAsString, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.StatsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Avg = propAvg.Value, - AvgAsString = propAvgAsString.Value, - Count = propCount.Value, - Max = propMax.Value, - MaxAsString = propMaxAsString.Value, - Meta = propMeta.Value, - Min = propMin.Value, - MinAsString = propMinAsString.Value, - Sum = propSum.Value, - SumAsString = propSumAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.StatsAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvg, value.Avg, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropAvgAsString, value.AvgAsString, null, null); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropMax, value.Max, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxAsString, value.MaxAsString, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropMin, value.Min, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinAsString, value.MinAsString, null, null); - writer.WriteProperty(options, PropSum, value.Sum, null, null); - writer.WriteProperty(options, PropSumAsString, value.SumAsString, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Statistics aggregation result. min, max and avg are missing if there were no values to process /// (count is zero). /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.StatsAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.StatsAggregateConverter))] public sealed partial class StatsAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsAggregation.Converters.g.cs new file mode 100644 index 00000000000..8be84427009 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsAggregation.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class StatsAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.Aggregations.StatsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propFormat = default; + LocalJsonValue propMissing = default; + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.StatsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Format = propFormat.Value, + Missing = propMissing.Value, + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.StatsAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsAggregation.g.cs index 624492983f7..818fb92daa0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsAggregation.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class StatsAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.Aggregations.StatsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propFormat = default; - LocalJsonValue propMissing = default; - LocalJsonValue propScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.StatsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Format = propFormat.Value, - Missing = propMissing.Value, - Script = propScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.StatsAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropMissing, value.Missing, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.StatsAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.StatsAggregationConverter))] public sealed partial class StatsAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsBucketAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsBucketAggregate.Converters.g.cs new file mode 100644 index 00000000000..689d1fb255a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsBucketAggregate.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class StatsBucketAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvg = System.Text.Json.JsonEncodedText.Encode("avg"); + private static readonly System.Text.Json.JsonEncodedText PropAvgAsString = System.Text.Json.JsonEncodedText.Encode("avg_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText PropMaxAsString = System.Text.Json.JsonEncodedText.Encode("max_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); + private static readonly System.Text.Json.JsonEncodedText PropMinAsString = System.Text.Json.JsonEncodedText.Encode("min_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropSum = System.Text.Json.JsonEncodedText.Encode("sum"); + private static readonly System.Text.Json.JsonEncodedText PropSumAsString = System.Text.Json.JsonEncodedText.Encode("sum_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.StatsBucketAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvg = default; + LocalJsonValue propAvgAsString = default; + LocalJsonValue propCount = default; + LocalJsonValue propMax = default; + LocalJsonValue propMaxAsString = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propMin = default; + LocalJsonValue propMinAsString = default; + LocalJsonValue propSum = default; + LocalJsonValue propSumAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvg.TryReadProperty(ref reader, options, PropAvg, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propAvgAsString.TryReadProperty(ref reader, options, PropAvgAsString, null)) + { + continue; + } + + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propMax.TryReadProperty(ref reader, options, PropMax, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxAsString.TryReadProperty(ref reader, options, PropMaxAsString, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propMin.TryReadProperty(ref reader, options, PropMin, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinAsString.TryReadProperty(ref reader, options, PropMinAsString, null)) + { + continue; + } + + if (propSum.TryReadProperty(ref reader, options, PropSum, null)) + { + continue; + } + + if (propSumAsString.TryReadProperty(ref reader, options, PropSumAsString, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.StatsBucketAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Avg = propAvg.Value, + AvgAsString = propAvgAsString.Value, + Count = propCount.Value, + Max = propMax.Value, + MaxAsString = propMaxAsString.Value, + Meta = propMeta.Value, + Min = propMin.Value, + MinAsString = propMinAsString.Value, + Sum = propSum.Value, + SumAsString = propSumAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.StatsBucketAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvg, value.Avg, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropAvgAsString, value.AvgAsString, null, null); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropMax, value.Max, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxAsString, value.MaxAsString, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropMin, value.Min, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinAsString, value.MinAsString, null, null); + writer.WriteProperty(options, PropSum, value.Sum, null, null); + writer.WriteProperty(options, PropSumAsString, value.SumAsString, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsBucketAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsBucketAggregate.g.cs index 1b2815c8a5b..952c5fe5aa7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsBucketAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsBucketAggregate.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class StatsBucketAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvg = System.Text.Json.JsonEncodedText.Encode("avg"); - private static readonly System.Text.Json.JsonEncodedText PropAvgAsString = System.Text.Json.JsonEncodedText.Encode("avg_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); - private static readonly System.Text.Json.JsonEncodedText PropMaxAsString = System.Text.Json.JsonEncodedText.Encode("max_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); - private static readonly System.Text.Json.JsonEncodedText PropMinAsString = System.Text.Json.JsonEncodedText.Encode("min_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropSum = System.Text.Json.JsonEncodedText.Encode("sum"); - private static readonly System.Text.Json.JsonEncodedText PropSumAsString = System.Text.Json.JsonEncodedText.Encode("sum_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.StatsBucketAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvg = default; - LocalJsonValue propAvgAsString = default; - LocalJsonValue propCount = default; - LocalJsonValue propMax = default; - LocalJsonValue propMaxAsString = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propMin = default; - LocalJsonValue propMinAsString = default; - LocalJsonValue propSum = default; - LocalJsonValue propSumAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvg.TryReadProperty(ref reader, options, PropAvg, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propAvgAsString.TryReadProperty(ref reader, options, PropAvgAsString, null)) - { - continue; - } - - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propMax.TryReadProperty(ref reader, options, PropMax, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxAsString.TryReadProperty(ref reader, options, PropMaxAsString, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propMin.TryReadProperty(ref reader, options, PropMin, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinAsString.TryReadProperty(ref reader, options, PropMinAsString, null)) - { - continue; - } - - if (propSum.TryReadProperty(ref reader, options, PropSum, null)) - { - continue; - } - - if (propSumAsString.TryReadProperty(ref reader, options, PropSumAsString, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.StatsBucketAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Avg = propAvg.Value, - AvgAsString = propAvgAsString.Value, - Count = propCount.Value, - Max = propMax.Value, - MaxAsString = propMaxAsString.Value, - Meta = propMeta.Value, - Min = propMin.Value, - MinAsString = propMinAsString.Value, - Sum = propSum.Value, - SumAsString = propSumAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.StatsBucketAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvg, value.Avg, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropAvgAsString, value.AvgAsString, null, null); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropMax, value.Max, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxAsString, value.MaxAsString, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropMin, value.Min, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinAsString, value.MinAsString, null, null); - writer.WriteProperty(options, PropSum, value.Sum, null, null); - writer.WriteProperty(options, PropSumAsString, value.SumAsString, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.StatsBucketAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.StatsBucketAggregateConverter))] public sealed partial class StatsBucketAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsBucketAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsBucketAggregation.Converters.g.cs new file mode 100644 index 00000000000..9934c468116 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsBucketAggregation.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class StatsBucketAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); + + public override Elastic.Clients.Elasticsearch.Aggregations.StatsBucketAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucketsPath = default; + LocalJsonValue propFormat = default; + LocalJsonValue propGapPolicy = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.StatsBucketAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BucketsPath = propBucketsPath.Value, + Format = propFormat.Value, + GapPolicy = propGapPolicy.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.StatsBucketAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsBucketAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsBucketAggregation.g.cs index 3f0d4e4d486..c7f5818bf3a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsBucketAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsBucketAggregation.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class StatsBucketAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); - - public override Elastic.Clients.Elasticsearch.Aggregations.StatsBucketAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBucketsPath = default; - LocalJsonValue propFormat = default; - LocalJsonValue propGapPolicy = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.StatsBucketAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BucketsPath = propBucketsPath.Value, - Format = propFormat.Value, - GapPolicy = propGapPolicy.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.StatsBucketAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.StatsBucketAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.StatsBucketAggregationConverter))] public sealed partial class StatsBucketAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringRareTermsAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringRareTermsAggregate.Converters.g.cs new file mode 100644 index 00000000000..772a13d8c36 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringRareTermsAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class StringRareTermsAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.StringRareTermsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBuckets = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.StringRareTermsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.StringRareTermsAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringRareTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringRareTermsAggregate.g.cs index 67dd03faa3c..ee42e85ab51 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringRareTermsAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringRareTermsAggregate.g.cs @@ -23,60 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class StringRareTermsAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.StringRareTermsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBuckets = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.StringRareTermsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.StringRareTermsAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - /// /// /// Result of the rare_terms aggregation when the field is a string. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.StringRareTermsAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.StringRareTermsAggregateConverter))] public sealed partial class StringRareTermsAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringRareTermsBucket.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringRareTermsBucket.Converters.g.cs new file mode 100644 index 00000000000..2777dd98afd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringRareTermsBucket.Converters.g.cs @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class StringRareTermsBucketConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); + + public override Elastic.Clients.Elasticsearch.Aggregations.StringRareTermsBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue propKey = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propKey.TryReadProperty(ref reader, options, PropKey, null)) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.StringRareTermsBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + Key = propKey.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.StringRareTermsBucket value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropKey, value.Key, null, null); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringRareTermsBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringRareTermsBucket.g.cs index 7678b689572..7f4153655ad 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringRareTermsBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringRareTermsBucket.g.cs @@ -23,61 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class StringRareTermsBucketConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); - - public override Elastic.Clients.Elasticsearch.Aggregations.StringRareTermsBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue propKey = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propKey.TryReadProperty(ref reader, options, PropKey, null)) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.StringRareTermsBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - Key = propKey.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.StringRareTermsBucket value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropKey, value.Key, null, null); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.StringRareTermsBucketConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.StringRareTermsBucketConverter))] public sealed partial class StringRareTermsBucket { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringStatsAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringStatsAggregate.Converters.g.cs new file mode 100644 index 00000000000..2872463fa3c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringStatsAggregate.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class StringStatsAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvgLength = System.Text.Json.JsonEncodedText.Encode("avg_length"); + private static readonly System.Text.Json.JsonEncodedText PropAvgLengthAsString = System.Text.Json.JsonEncodedText.Encode("avg_length_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropDistribution = System.Text.Json.JsonEncodedText.Encode("distribution"); + private static readonly System.Text.Json.JsonEncodedText PropEntropy = System.Text.Json.JsonEncodedText.Encode("entropy"); + private static readonly System.Text.Json.JsonEncodedText PropMaxLength = System.Text.Json.JsonEncodedText.Encode("max_length"); + private static readonly System.Text.Json.JsonEncodedText PropMaxLengthAsString = System.Text.Json.JsonEncodedText.Encode("max_length_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropMinLength = System.Text.Json.JsonEncodedText.Encode("min_length"); + private static readonly System.Text.Json.JsonEncodedText PropMinLengthAsString = System.Text.Json.JsonEncodedText.Encode("min_length_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvgLength = default; + LocalJsonValue propAvgLengthAsString = default; + LocalJsonValue propCount = default; + LocalJsonValue?> propDistribution = default; + LocalJsonValue propEntropy = default; + LocalJsonValue propMaxLength = default; + LocalJsonValue propMaxLengthAsString = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propMinLength = default; + LocalJsonValue propMinLengthAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvgLength.TryReadProperty(ref reader, options, PropAvgLength, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propAvgLengthAsString.TryReadProperty(ref reader, options, PropAvgLengthAsString, null)) + { + continue; + } + + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propDistribution.TryReadProperty(ref reader, options, PropDistribution, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propEntropy.TryReadProperty(ref reader, options, PropEntropy, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxLength.TryReadProperty(ref reader, options, PropMaxLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxLengthAsString.TryReadProperty(ref reader, options, PropMaxLengthAsString, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propMinLength.TryReadProperty(ref reader, options, PropMinLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinLengthAsString.TryReadProperty(ref reader, options, PropMinLengthAsString, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AvgLength = propAvgLength.Value, + AvgLengthAsString = propAvgLengthAsString.Value, + Count = propCount.Value, + Distribution = propDistribution.Value, + Entropy = propEntropy.Value, + MaxLength = propMaxLength.Value, + MaxLengthAsString = propMaxLengthAsString.Value, + Meta = propMeta.Value, + MinLength = propMinLength.Value, + MinLengthAsString = propMinLengthAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvgLength, value.AvgLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropAvgLengthAsString, value.AvgLengthAsString, null, null); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropDistribution, value.Distribution, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropEntropy, value.Entropy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxLength, value.MaxLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxLengthAsString, value.MaxLengthAsString, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropMinLength, value.MinLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinLengthAsString, value.MinLengthAsString, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringStatsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringStatsAggregate.g.cs index 0683216ed7d..e33264b88ae 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringStatsAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringStatsAggregate.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class StringStatsAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvgLength = System.Text.Json.JsonEncodedText.Encode("avg_length"); - private static readonly System.Text.Json.JsonEncodedText PropAvgLengthAsString = System.Text.Json.JsonEncodedText.Encode("avg_length_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropDistribution = System.Text.Json.JsonEncodedText.Encode("distribution"); - private static readonly System.Text.Json.JsonEncodedText PropEntropy = System.Text.Json.JsonEncodedText.Encode("entropy"); - private static readonly System.Text.Json.JsonEncodedText PropMaxLength = System.Text.Json.JsonEncodedText.Encode("max_length"); - private static readonly System.Text.Json.JsonEncodedText PropMaxLengthAsString = System.Text.Json.JsonEncodedText.Encode("max_length_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropMinLength = System.Text.Json.JsonEncodedText.Encode("min_length"); - private static readonly System.Text.Json.JsonEncodedText PropMinLengthAsString = System.Text.Json.JsonEncodedText.Encode("min_length_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvgLength = default; - LocalJsonValue propAvgLengthAsString = default; - LocalJsonValue propCount = default; - LocalJsonValue?> propDistribution = default; - LocalJsonValue propEntropy = default; - LocalJsonValue propMaxLength = default; - LocalJsonValue propMaxLengthAsString = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propMinLength = default; - LocalJsonValue propMinLengthAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvgLength.TryReadProperty(ref reader, options, PropAvgLength, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propAvgLengthAsString.TryReadProperty(ref reader, options, PropAvgLengthAsString, null)) - { - continue; - } - - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propDistribution.TryReadProperty(ref reader, options, PropDistribution, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propEntropy.TryReadProperty(ref reader, options, PropEntropy, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxLength.TryReadProperty(ref reader, options, PropMaxLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxLengthAsString.TryReadProperty(ref reader, options, PropMaxLengthAsString, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propMinLength.TryReadProperty(ref reader, options, PropMinLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinLengthAsString.TryReadProperty(ref reader, options, PropMinLengthAsString, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AvgLength = propAvgLength.Value, - AvgLengthAsString = propAvgLengthAsString.Value, - Count = propCount.Value, - Distribution = propDistribution.Value, - Entropy = propEntropy.Value, - MaxLength = propMaxLength.Value, - MaxLengthAsString = propMaxLengthAsString.Value, - Meta = propMeta.Value, - MinLength = propMinLength.Value, - MinLengthAsString = propMinLengthAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvgLength, value.AvgLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropAvgLengthAsString, value.AvgLengthAsString, null, null); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropDistribution, value.Distribution, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropEntropy, value.Entropy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxLength, value.MaxLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxLengthAsString, value.MaxLengthAsString, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropMinLength, value.MinLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinLengthAsString, value.MinLengthAsString, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.StringStatsAggregateConverter))] public sealed partial class StringStatsAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringStatsAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringStatsAggregation.Converters.g.cs new file mode 100644 index 00000000000..38abbe113ad --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringStatsAggregation.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class StringStatsAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropShowDistribution = System.Text.Json.JsonEncodedText.Encode("show_distribution"); + + public override Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propMissing = default; + LocalJsonValue propScript = default; + LocalJsonValue propShowDistribution = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propShowDistribution.TryReadProperty(ref reader, options, PropShowDistribution, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Missing = propMissing.Value, + Script = propScript.Value, + ShowDistribution = propShowDistribution.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropShowDistribution, value.ShowDistribution, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringStatsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringStatsAggregation.g.cs index 6083804d97c..6deabe3bb7b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringStatsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringStatsAggregation.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class StringStatsAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropShowDistribution = System.Text.Json.JsonEncodedText.Encode("show_distribution"); - - public override Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propMissing = default; - LocalJsonValue propScript = default; - LocalJsonValue propShowDistribution = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propShowDistribution.TryReadProperty(ref reader, options, PropShowDistribution, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Missing = propMissing.Value, - Script = propScript.Value, - ShowDistribution = propShowDistribution.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropMissing, value.Missing, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropShowDistribution, value.ShowDistribution, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.StringStatsAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.StringStatsAggregationConverter))] public sealed partial class StringStatsAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringTermsAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringTermsAggregate.Converters.g.cs new file mode 100644 index 00000000000..76db65ea317 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringTermsAggregate.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class StringTermsAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropDocCountErrorUpperBound = System.Text.Json.JsonEncodedText.Encode("doc_count_error_upper_bound"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropSumOtherDocCount = System.Text.Json.JsonEncodedText.Encode("sum_other_doc_count"); + + public override Elastic.Clients.Elasticsearch.Aggregations.StringTermsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBuckets = default; + LocalJsonValue propDocCountErrorUpperBound = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propSumOtherDocCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propDocCountErrorUpperBound.TryReadProperty(ref reader, options, PropDocCountErrorUpperBound, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propSumOtherDocCount.TryReadProperty(ref reader, options, PropSumOtherDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.StringTermsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + DocCountErrorUpperBound = propDocCountErrorUpperBound.Value, + Meta = propMeta.Value, + SumOtherDocCount = propSumOtherDocCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.StringTermsAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDocCountErrorUpperBound, value.DocCountErrorUpperBound, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropSumOtherDocCount, value.SumOtherDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringTermsAggregate.g.cs index 0bf7ac493c3..18f74be5fb3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringTermsAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringTermsAggregate.g.cs @@ -23,78 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class StringTermsAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropDocCountErrorUpperBound = System.Text.Json.JsonEncodedText.Encode("doc_count_error_upper_bound"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropSumOtherDocCount = System.Text.Json.JsonEncodedText.Encode("sum_other_doc_count"); - - public override Elastic.Clients.Elasticsearch.Aggregations.StringTermsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBuckets = default; - LocalJsonValue propDocCountErrorUpperBound = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propSumOtherDocCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propDocCountErrorUpperBound.TryReadProperty(ref reader, options, PropDocCountErrorUpperBound, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propSumOtherDocCount.TryReadProperty(ref reader, options, PropSumOtherDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.StringTermsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - DocCountErrorUpperBound = propDocCountErrorUpperBound.Value, - Meta = propMeta.Value, - SumOtherDocCount = propSumOtherDocCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.StringTermsAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDocCountErrorUpperBound, value.DocCountErrorUpperBound, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropSumOtherDocCount, value.SumOtherDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Result of a terms aggregation when the field is a string. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.StringTermsAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.StringTermsAggregateConverter))] public sealed partial class StringTermsAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringTermsBucket.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringTermsBucket.Converters.g.cs new file mode 100644 index 00000000000..71eb823102e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringTermsBucket.Converters.g.cs @@ -0,0 +1,87 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class StringTermsBucketConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropDocCountErrorUpperBound = System.Text.Json.JsonEncodedText.Encode("doc_count_error_upper_bound"); + private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); + + public override Elastic.Clients.Elasticsearch.Aggregations.StringTermsBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue propDocCountErrorUpperBound = default; + LocalJsonValue propKey = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propDocCountErrorUpperBound.TryReadProperty(ref reader, options, PropDocCountErrorUpperBound, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propKey.TryReadProperty(ref reader, options, PropKey, null)) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.StringTermsBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + DocCountErrorUpperBound = propDocCountErrorUpperBound.Value, + Key = propKey.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.StringTermsBucket value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropDocCountErrorUpperBound, value.DocCountErrorUpperBound, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropKey, value.Key, null, null); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringTermsBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringTermsBucket.g.cs index ea1a0f5470d..c0541d2fd41 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringTermsBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringTermsBucket.g.cs @@ -23,70 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class StringTermsBucketConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropDocCountErrorUpperBound = System.Text.Json.JsonEncodedText.Encode("doc_count_error_upper_bound"); - private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); - - public override Elastic.Clients.Elasticsearch.Aggregations.StringTermsBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue propDocCountErrorUpperBound = default; - LocalJsonValue propKey = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propDocCountErrorUpperBound.TryReadProperty(ref reader, options, PropDocCountErrorUpperBound, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propKey.TryReadProperty(ref reader, options, PropKey, null)) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.StringTermsBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - DocCountErrorUpperBound = propDocCountErrorUpperBound.Value, - Key = propKey.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.StringTermsBucket value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropDocCountErrorUpperBound, value.DocCountErrorUpperBound, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropKey, value.Key, null, null); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.StringTermsBucketConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.StringTermsBucketConverter))] public sealed partial class StringTermsBucket { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregate.Converters.g.cs new file mode 100644 index 00000000000..601f1c08f56 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregate.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class SumAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.SumAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propMeta = default; + LocalJsonValue propValue = default; + LocalJsonValue propValueAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.SumAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Meta = propMeta.Value, + Value = propValue.Value, + ValueAsString = propValueAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SumAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregate.g.cs index a1b7494a90b..05ad66a7a50 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregate.g.cs @@ -23,69 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class SumAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.SumAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propMeta = default; - LocalJsonValue propValue = default; - LocalJsonValue propValueAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.SumAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Meta = propMeta.Value, - Value = propValue.Value, - ValueAsString = propValueAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SumAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Sum aggregation result. value is always present and is zero if there were no values to process. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.SumAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.SumAggregateConverter))] public sealed partial class SumAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregation.Converters.g.cs new file mode 100644 index 00000000000..771bcf603bf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregation.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class SumAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.Aggregations.SumAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propFormat = default; + LocalJsonValue propMissing = default; + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.SumAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Format = propFormat.Value, + Missing = propMissing.Value, + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SumAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregation.g.cs index 7ae8a5328df..74636094297 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregation.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class SumAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.Aggregations.SumAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propFormat = default; - LocalJsonValue propMissing = default; - LocalJsonValue propScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.SumAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Format = propFormat.Value, - Missing = propMissing.Value, - Script = propScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SumAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropMissing, value.Missing, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.SumAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.SumAggregationConverter))] public sealed partial class SumAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumBucketAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumBucketAggregation.Converters.g.cs new file mode 100644 index 00000000000..12742436712 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumBucketAggregation.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class SumBucketAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); + + public override Elastic.Clients.Elasticsearch.Aggregations.SumBucketAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucketsPath = default; + LocalJsonValue propFormat = default; + LocalJsonValue propGapPolicy = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.SumBucketAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BucketsPath = propBucketsPath.Value, + Format = propFormat.Value, + GapPolicy = propGapPolicy.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SumBucketAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumBucketAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumBucketAggregation.g.cs index 53f2d0da912..9a3cfa98b2d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumBucketAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumBucketAggregation.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class SumBucketAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); - - public override Elastic.Clients.Elasticsearch.Aggregations.SumBucketAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBucketsPath = default; - LocalJsonValue propFormat = default; - LocalJsonValue propGapPolicy = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.SumBucketAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BucketsPath = propBucketsPath.Value, - Format = propFormat.Value, - GapPolicy = propGapPolicy.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SumBucketAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.SumBucketAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.SumBucketAggregationConverter))] public sealed partial class SumBucketAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigest.Converters.g.cs new file mode 100644 index 00000000000..45b1c2af372 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class TDigestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCompression = System.Text.Json.JsonEncodedText.Encode("compression"); + private static readonly System.Text.Json.JsonEncodedText PropExecutionHint = System.Text.Json.JsonEncodedText.Encode("execution_hint"); + + public override Elastic.Clients.Elasticsearch.Aggregations.TDigest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCompression = default; + LocalJsonValue propExecutionHint = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCompression.TryReadProperty(ref reader, options, PropCompression, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propExecutionHint.TryReadProperty(ref reader, options, PropExecutionHint, static Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.TDigest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Compression = propCompression.Value, + ExecutionHint = propExecutionHint.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TDigest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCompression, value.Compression, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropExecutionHint, value.ExecutionHint, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigest.g.cs index e0939c5f418..0e1349c44da 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigest.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class TDigestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCompression = System.Text.Json.JsonEncodedText.Encode("compression"); - private static readonly System.Text.Json.JsonEncodedText PropExecutionHint = System.Text.Json.JsonEncodedText.Encode("execution_hint"); - - public override Elastic.Clients.Elasticsearch.Aggregations.TDigest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCompression = default; - LocalJsonValue propExecutionHint = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCompression.TryReadProperty(ref reader, options, PropCompression, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propExecutionHint.TryReadProperty(ref reader, options, PropExecutionHint, static Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.TDigest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Compression = propCompression.Value, - ExecutionHint = propExecutionHint.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TDigest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCompression, value.Compression, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropExecutionHint, value.ExecutionHint, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.TDigestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.TDigestConverter))] public sealed partial class TDigest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigestExecutionHint.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigestExecutionHint.Converters.g.cs new file mode 100644 index 00000000000..98901f996ea --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigestExecutionHint.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class TDigestExecutionHintConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberDefault = System.Text.Json.JsonEncodedText.Encode("default"); + private static readonly System.Text.Json.JsonEncodedText MemberHighAccuracy = System.Text.Json.JsonEncodedText.Encode("high_accuracy"); + + public override Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberDefault)) + { + return Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint.Default; + } + + if (reader.ValueTextEquals(MemberHighAccuracy)) + { + return Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint.HighAccuracy; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberDefault.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint.Default; + } + + if (string.Equals(value, MemberHighAccuracy.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint.HighAccuracy; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint.Default: + writer.WriteStringValue(MemberDefault); + break; + case Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint.HighAccuracy: + writer.WriteStringValue(MemberHighAccuracy); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigestExecutionHint.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigestExecutionHint.g.cs new file mode 100644 index 00000000000..b21c5786499 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigestExecutionHint.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.TDigestExecutionHintConverter))] +public enum TDigestExecutionHint +{ + [System.Runtime.Serialization.EnumMember(Value = "default")] + Default, + [System.Runtime.Serialization.EnumMember(Value = "high_accuracy")] + HighAccuracy +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigestPercentileRanksAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigestPercentileRanksAggregate.Converters.g.cs new file mode 100644 index 00000000000..7a3f16b1bb3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigestPercentileRanksAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class TDigestPercentileRanksAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropValues = System.Text.Json.JsonEncodedText.Encode("values"); + + public override Elastic.Clients.Elasticsearch.Aggregations.TDigestPercentileRanksAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propMeta = default; + LocalJsonValue> propValues = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propValues.TryReadProperty(ref reader, options, PropValues, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.TDigestPercentileRanksAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Meta = propMeta.Value, + Values = propValues.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TDigestPercentileRanksAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropValues, value.Values, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigestPercentileRanksAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigestPercentileRanksAggregate.g.cs index 402d20c682a..71f6737ed55 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigestPercentileRanksAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigestPercentileRanksAggregate.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class TDigestPercentileRanksAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropValues = System.Text.Json.JsonEncodedText.Encode("values"); - - public override Elastic.Clients.Elasticsearch.Aggregations.TDigestPercentileRanksAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propMeta = default; - LocalJsonValue> propValues = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propValues.TryReadProperty(ref reader, options, PropValues, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.TDigestPercentileRanksAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Meta = propMeta.Value, - Values = propValues.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TDigestPercentileRanksAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropValues, value.Values, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.TDigestPercentileRanksAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.TDigestPercentileRanksAggregateConverter))] public sealed partial class TDigestPercentileRanksAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigestPercentilesAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigestPercentilesAggregate.Converters.g.cs new file mode 100644 index 00000000000..c5604fc74b0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigestPercentilesAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class TDigestPercentilesAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropValues = System.Text.Json.JsonEncodedText.Encode("values"); + + public override Elastic.Clients.Elasticsearch.Aggregations.TDigestPercentilesAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propMeta = default; + LocalJsonValue> propValues = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propValues.TryReadProperty(ref reader, options, PropValues, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.TDigestPercentilesAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Meta = propMeta.Value, + Values = propValues.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TDigestPercentilesAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropValues, value.Values, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigestPercentilesAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigestPercentilesAggregate.g.cs index e536c0aa6c6..8e89b98bd5d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigestPercentilesAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TDigestPercentilesAggregate.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class TDigestPercentilesAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropValues = System.Text.Json.JsonEncodedText.Encode("values"); - - public override Elastic.Clients.Elasticsearch.Aggregations.TDigestPercentilesAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propMeta = default; - LocalJsonValue> propValues = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propValues.TryReadProperty(ref reader, options, PropValues, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.TDigestPercentilesAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Meta = propMeta.Value, - Values = propValues.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TDigestPercentilesAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropValues, value.Values, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.TDigestPercentilesAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.TDigestPercentilesAggregateConverter))] public sealed partial class TDigestPercentilesAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TTestAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TTestAggregate.Converters.g.cs new file mode 100644 index 00000000000..2c606ceb027 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TTestAggregate.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class TTestAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.TTestAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propMeta = default; + LocalJsonValue propValue = default; + LocalJsonValue propValueAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.TTestAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Meta = propMeta.Value, + Value = propValue.Value, + ValueAsString = propValueAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TTestAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TTestAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TTestAggregate.g.cs index aebffee538e..2c15dcce0bc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TTestAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TTestAggregate.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class TTestAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.TTestAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propMeta = default; - LocalJsonValue propValue = default; - LocalJsonValue propValueAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.TTestAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Meta = propMeta.Value, - Value = propValue.Value, - ValueAsString = propValueAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TTestAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.TTestAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.TTestAggregateConverter))] public sealed partial class TTestAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TTestAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TTestAggregation.Converters.g.cs new file mode 100644 index 00000000000..0ef8f87b2bc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TTestAggregation.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class TTestAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropA = System.Text.Json.JsonEncodedText.Encode("a"); + private static readonly System.Text.Json.JsonEncodedText PropB = System.Text.Json.JsonEncodedText.Encode("b"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Aggregations.TTestAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propA = default; + LocalJsonValue propB = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propA.TryReadProperty(ref reader, options, PropA, null)) + { + continue; + } + + if (propB.TryReadProperty(ref reader, options, PropB, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, static Elastic.Clients.Elasticsearch.Aggregations.TTestType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.TTestAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + A = propA.Value, + B = propB.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TTestAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropA, value.A, null, null); + writer.WriteProperty(options, PropB, value.B, null, null); + writer.WriteProperty(options, PropType, value.Type, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TTestType? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TTestAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TTestAggregation.g.cs index f32a7e688fb..17c31f93ebe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TTestAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TTestAggregation.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class TTestAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropA = System.Text.Json.JsonEncodedText.Encode("a"); - private static readonly System.Text.Json.JsonEncodedText PropB = System.Text.Json.JsonEncodedText.Encode("b"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Aggregations.TTestAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propA = default; - LocalJsonValue propB = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propA.TryReadProperty(ref reader, options, PropA, null)) - { - continue; - } - - if (propB.TryReadProperty(ref reader, options, PropB, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, static Elastic.Clients.Elasticsearch.Aggregations.TTestType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.TTestAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - A = propA.Value, - B = propB.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TTestAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropA, value.A, null, null); - writer.WriteProperty(options, PropB, value.B, null, null); - writer.WriteProperty(options, PropType, value.Type, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TTestType? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.TTestAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.TTestAggregationConverter))] public sealed partial class TTestAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TTestType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TTestType.Converters.g.cs new file mode 100644 index 00000000000..9ee1edc036c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TTestType.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class TTestTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberHeteroscedastic = System.Text.Json.JsonEncodedText.Encode("heteroscedastic"); + private static readonly System.Text.Json.JsonEncodedText MemberHomoscedastic = System.Text.Json.JsonEncodedText.Encode("homoscedastic"); + private static readonly System.Text.Json.JsonEncodedText MemberPaired = System.Text.Json.JsonEncodedText.Encode("paired"); + + public override Elastic.Clients.Elasticsearch.Aggregations.TTestType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberHeteroscedastic)) + { + return Elastic.Clients.Elasticsearch.Aggregations.TTestType.Heteroscedastic; + } + + if (reader.ValueTextEquals(MemberHomoscedastic)) + { + return Elastic.Clients.Elasticsearch.Aggregations.TTestType.Homoscedastic; + } + + if (reader.ValueTextEquals(MemberPaired)) + { + return Elastic.Clients.Elasticsearch.Aggregations.TTestType.Paired; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberHeteroscedastic.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.TTestType.Heteroscedastic; + } + + if (string.Equals(value, MemberHomoscedastic.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.TTestType.Homoscedastic; + } + + if (string.Equals(value, MemberPaired.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.TTestType.Paired; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.TTestType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TTestType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Aggregations.TTestType.Heteroscedastic: + writer.WriteStringValue(MemberHeteroscedastic); + break; + case Elastic.Clients.Elasticsearch.Aggregations.TTestType.Homoscedastic: + writer.WriteStringValue(MemberHomoscedastic); + break; + case Elastic.Clients.Elasticsearch.Aggregations.TTestType.Paired: + writer.WriteStringValue(MemberPaired); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.TTestType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Aggregations.TTestType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TTestType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TTestType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TTestType.g.cs new file mode 100644 index 00000000000..f9566677146 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TTestType.g.cs @@ -0,0 +1,50 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.TTestTypeConverter))] +public enum TTestType +{ + /// + /// + /// Performs two-sample unequal variance test. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "heteroscedastic")] + Heteroscedastic, + /// + /// + /// Performs two-sample equal variance test. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "homoscedastic")] + Homoscedastic, + /// + /// + /// Performs paired t-test. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "paired")] + Paired +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.Converters.g.cs new file mode 100644 index 00000000000..28775cfc7ca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.Converters.g.cs @@ -0,0 +1,207 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class TermsAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCollectMode = System.Text.Json.JsonEncodedText.Encode("collect_mode"); + private static readonly System.Text.Json.JsonEncodedText PropExclude = System.Text.Json.JsonEncodedText.Encode("exclude"); + private static readonly System.Text.Json.JsonEncodedText PropExecutionHint = System.Text.Json.JsonEncodedText.Encode("execution_hint"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropInclude = System.Text.Json.JsonEncodedText.Encode("include"); + private static readonly System.Text.Json.JsonEncodedText PropMinDocCount = System.Text.Json.JsonEncodedText.Encode("min_doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropMissingBucket = System.Text.Json.JsonEncodedText.Encode("missing_bucket"); + private static readonly System.Text.Json.JsonEncodedText PropMissingOrder = System.Text.Json.JsonEncodedText.Encode("missing_order"); + private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropShardMinDocCount = System.Text.Json.JsonEncodedText.Encode("shard_min_doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"); + private static readonly System.Text.Json.JsonEncodedText PropShowTermDocCountError = System.Text.Json.JsonEncodedText.Encode("show_term_doc_count_error"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropValueType = System.Text.Json.JsonEncodedText.Encode("value_type"); + + public override Elastic.Clients.Elasticsearch.Aggregations.TermsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCollectMode = default; + LocalJsonValue propExclude = default; + LocalJsonValue propExecutionHint = default; + LocalJsonValue propField = default; + LocalJsonValue propFormat = default; + LocalJsonValue propInclude = default; + LocalJsonValue propMinDocCount = default; + LocalJsonValue propMissing = default; + LocalJsonValue propMissingBucket = default; + LocalJsonValue propMissingOrder = default; + LocalJsonValue>?> propOrder = default; + LocalJsonValue propScript = default; + LocalJsonValue propShardMinDocCount = default; + LocalJsonValue propShardSize = default; + LocalJsonValue propShowTermDocCountError = default; + LocalJsonValue propSize = default; + LocalJsonValue propValueType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCollectMode.TryReadProperty(ref reader, options, PropCollectMode, static Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propExclude.TryReadProperty(ref reader, options, PropExclude, null)) + { + continue; + } + + if (propExecutionHint.TryReadProperty(ref reader, options, PropExecutionHint, static Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propInclude.TryReadProperty(ref reader, options, PropInclude, null)) + { + continue; + } + + if (propMinDocCount.TryReadProperty(ref reader, options, PropMinDocCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (propMissingBucket.TryReadProperty(ref reader, options, PropMissingBucket, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMissingOrder.TryReadProperty(ref reader, options, PropMissingOrder, static Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOrder.TryReadProperty(ref reader, options, PropOrder, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue>(o, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null)))) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propShardMinDocCount.TryReadProperty(ref reader, options, PropShardMinDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propShardSize.TryReadProperty(ref reader, options, PropShardSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propShowTermDocCountError.TryReadProperty(ref reader, options, PropShowTermDocCountError, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propValueType.TryReadProperty(ref reader, options, PropValueType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.TermsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CollectMode = propCollectMode.Value, + Exclude = propExclude.Value, + ExecutionHint = propExecutionHint.Value, + Field = propField.Value, + Format = propFormat.Value, + Include = propInclude.Value, + MinDocCount = propMinDocCount.Value, + Missing = propMissing.Value, + MissingBucket = propMissingBucket.Value, + MissingOrder = propMissingOrder.Value, + Order = propOrder.Value, + Script = propScript.Value, + ShardMinDocCount = propShardMinDocCount.Value, + ShardSize = propShardSize.Value, + ShowTermDocCountError = propShowTermDocCountError.Value, + Size = propSize.Value, + ValueType = propValueType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TermsAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCollectMode, value.CollectMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropExclude, value.Exclude, null, null); + writer.WriteProperty(options, PropExecutionHint, value.ExecutionHint, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropInclude, value.Include, null, null); + writer.WriteProperty(options, PropMinDocCount, value.MinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteProperty(options, PropMissingBucket, value.MissingBucket, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMissingOrder, value.MissingOrder, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteSingleOrManyCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null))); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropShardMinDocCount, value.ShardMinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropShowTermDocCountError, value.ShowTermDocCountError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropValueType, value.ValueType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.g.cs index 0afa09eb5ca..6e2e644fc93 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.g.cs @@ -23,190 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class TermsAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCollectMode = System.Text.Json.JsonEncodedText.Encode("collect_mode"); - private static readonly System.Text.Json.JsonEncodedText PropExclude = System.Text.Json.JsonEncodedText.Encode("exclude"); - private static readonly System.Text.Json.JsonEncodedText PropExecutionHint = System.Text.Json.JsonEncodedText.Encode("execution_hint"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropInclude = System.Text.Json.JsonEncodedText.Encode("include"); - private static readonly System.Text.Json.JsonEncodedText PropMinDocCount = System.Text.Json.JsonEncodedText.Encode("min_doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropMissingBucket = System.Text.Json.JsonEncodedText.Encode("missing_bucket"); - private static readonly System.Text.Json.JsonEncodedText PropMissingOrder = System.Text.Json.JsonEncodedText.Encode("missing_order"); - private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropShardMinDocCount = System.Text.Json.JsonEncodedText.Encode("shard_min_doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"); - private static readonly System.Text.Json.JsonEncodedText PropShowTermDocCountError = System.Text.Json.JsonEncodedText.Encode("show_term_doc_count_error"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropValueType = System.Text.Json.JsonEncodedText.Encode("value_type"); - - public override Elastic.Clients.Elasticsearch.Aggregations.TermsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCollectMode = default; - LocalJsonValue propExclude = default; - LocalJsonValue propExecutionHint = default; - LocalJsonValue propField = default; - LocalJsonValue propFormat = default; - LocalJsonValue propInclude = default; - LocalJsonValue propMinDocCount = default; - LocalJsonValue propMissing = default; - LocalJsonValue propMissingBucket = default; - LocalJsonValue propMissingOrder = default; - LocalJsonValue>?> propOrder = default; - LocalJsonValue propScript = default; - LocalJsonValue propShardMinDocCount = default; - LocalJsonValue propShardSize = default; - LocalJsonValue propShowTermDocCountError = default; - LocalJsonValue propSize = default; - LocalJsonValue propValueType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCollectMode.TryReadProperty(ref reader, options, PropCollectMode, static Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propExclude.TryReadProperty(ref reader, options, PropExclude, null)) - { - continue; - } - - if (propExecutionHint.TryReadProperty(ref reader, options, PropExecutionHint, static Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propInclude.TryReadProperty(ref reader, options, PropInclude, null)) - { - continue; - } - - if (propMinDocCount.TryReadProperty(ref reader, options, PropMinDocCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) - { - continue; - } - - if (propMissingBucket.TryReadProperty(ref reader, options, PropMissingBucket, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMissingOrder.TryReadProperty(ref reader, options, PropMissingOrder, static Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOrder.TryReadProperty(ref reader, options, PropOrder, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue>(o, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null)))) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propShardMinDocCount.TryReadProperty(ref reader, options, PropShardMinDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propShardSize.TryReadProperty(ref reader, options, PropShardSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propShowTermDocCountError.TryReadProperty(ref reader, options, PropShowTermDocCountError, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propValueType.TryReadProperty(ref reader, options, PropValueType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.TermsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CollectMode = propCollectMode.Value, - Exclude = propExclude.Value, - ExecutionHint = propExecutionHint.Value, - Field = propField.Value, - Format = propFormat.Value, - Include = propInclude.Value, - MinDocCount = propMinDocCount.Value, - Missing = propMissing.Value, - MissingBucket = propMissingBucket.Value, - MissingOrder = propMissingOrder.Value, - Order = propOrder.Value, - Script = propScript.Value, - ShardMinDocCount = propShardMinDocCount.Value, - ShardSize = propShardSize.Value, - ShowTermDocCountError = propShowTermDocCountError.Value, - Size = propSize.Value, - ValueType = propValueType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TermsAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCollectMode, value.CollectMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropExclude, value.Exclude, null, null); - writer.WriteProperty(options, PropExecutionHint, value.ExecutionHint, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropInclude, value.Include, null, null); - writer.WriteProperty(options, PropMinDocCount, value.MinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMissing, value.Missing, null, null); - writer.WriteProperty(options, PropMissingBucket, value.MissingBucket, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMissingOrder, value.MissingOrder, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteSingleOrManyCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null))); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropShardMinDocCount, value.ShardMinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropShowTermDocCountError, value.ShowTermDocCountError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropValueType, value.ValueType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.TermsAggregationConverter))] public sealed partial class TermsAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregationCollectMode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregationCollectMode.Converters.g.cs new file mode 100644 index 00000000000..fb3dafd7110 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregationCollectMode.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class TermsAggregationCollectModeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberBreadthFirst = System.Text.Json.JsonEncodedText.Encode("breadth_first"); + private static readonly System.Text.Json.JsonEncodedText MemberDepthFirst = System.Text.Json.JsonEncodedText.Encode("depth_first"); + + public override Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberBreadthFirst)) + { + return Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode.BreadthFirst; + } + + if (reader.ValueTextEquals(MemberDepthFirst)) + { + return Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode.DepthFirst; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberBreadthFirst.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode.BreadthFirst; + } + + if (string.Equals(value, MemberDepthFirst.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode.DepthFirst; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode.BreadthFirst: + writer.WriteStringValue(MemberBreadthFirst); + break; + case Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode.DepthFirst: + writer.WriteStringValue(MemberDepthFirst); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregationCollectMode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregationCollectMode.g.cs new file mode 100644 index 00000000000..4b7f372449a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregationCollectMode.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.TermsAggregationCollectModeConverter))] +public enum TermsAggregationCollectMode +{ + /// + /// + /// Caches the set of documents that fall into the uppermost buckets for subsequent replay. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "breadth_first")] + BreadthFirst, + /// + /// + /// Expands all branches of the aggregation tree in one depth-first pass, before any pruning occurs. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "depth_first")] + DepthFirst +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregationExecutionHint.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregationExecutionHint.Converters.g.cs new file mode 100644 index 00000000000..f7080ba363f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregationExecutionHint.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class TermsAggregationExecutionHintConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberGlobalOrdinals = System.Text.Json.JsonEncodedText.Encode("global_ordinals"); + private static readonly System.Text.Json.JsonEncodedText MemberGlobalOrdinalsHash = System.Text.Json.JsonEncodedText.Encode("global_ordinals_hash"); + private static readonly System.Text.Json.JsonEncodedText MemberGlobalOrdinalsLowCardinality = System.Text.Json.JsonEncodedText.Encode("global_ordinals_low_cardinality"); + private static readonly System.Text.Json.JsonEncodedText MemberMap = System.Text.Json.JsonEncodedText.Encode("map"); + + public override Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberGlobalOrdinals)) + { + return Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint.GlobalOrdinals; + } + + if (reader.ValueTextEquals(MemberGlobalOrdinalsHash)) + { + return Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint.GlobalOrdinalsHash; + } + + if (reader.ValueTextEquals(MemberGlobalOrdinalsLowCardinality)) + { + return Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint.GlobalOrdinalsLowCardinality; + } + + if (reader.ValueTextEquals(MemberMap)) + { + return Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint.Map; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberGlobalOrdinals.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint.GlobalOrdinals; + } + + if (string.Equals(value, MemberGlobalOrdinalsHash.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint.GlobalOrdinalsHash; + } + + if (string.Equals(value, MemberGlobalOrdinalsLowCardinality.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint.GlobalOrdinalsLowCardinality; + } + + if (string.Equals(value, MemberMap.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint.Map; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint.GlobalOrdinals: + writer.WriteStringValue(MemberGlobalOrdinals); + break; + case Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint.GlobalOrdinalsHash: + writer.WriteStringValue(MemberGlobalOrdinalsHash); + break; + case Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint.GlobalOrdinalsLowCardinality: + writer.WriteStringValue(MemberGlobalOrdinalsLowCardinality); + break; + case Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint.Map: + writer.WriteStringValue(MemberMap); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregationExecutionHint.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregationExecutionHint.g.cs new file mode 100644 index 00000000000..6aab7ffac75 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregationExecutionHint.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.TermsAggregationExecutionHintConverter))] +public enum TermsAggregationExecutionHint +{ + [System.Runtime.Serialization.EnumMember(Value = "global_ordinals")] + GlobalOrdinals, + [System.Runtime.Serialization.EnumMember(Value = "global_ordinals_hash")] + GlobalOrdinalsHash, + [System.Runtime.Serialization.EnumMember(Value = "global_ordinals_low_cardinality")] + GlobalOrdinalsLowCardinality, + [System.Runtime.Serialization.EnumMember(Value = "map")] + Map +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsPartition.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsPartition.Converters.g.cs new file mode 100644 index 00000000000..3f4aad2af6c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsPartition.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class TermsPartitionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNumPartitions = System.Text.Json.JsonEncodedText.Encode("num_partitions"); + private static readonly System.Text.Json.JsonEncodedText PropPartition = System.Text.Json.JsonEncodedText.Encode("partition"); + + public override Elastic.Clients.Elasticsearch.Aggregations.TermsPartition Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propNumPartitions = default; + LocalJsonValue propPartition = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNumPartitions.TryReadProperty(ref reader, options, PropNumPartitions, null)) + { + continue; + } + + if (propPartition.TryReadProperty(ref reader, options, PropPartition, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.TermsPartition(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + NumPartitions = propNumPartitions.Value, + Partition = propPartition.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TermsPartition value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNumPartitions, value.NumPartitions, null, null); + writer.WriteProperty(options, PropPartition, value.Partition, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsPartition.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsPartition.g.cs index c6e71b9673f..f04d6ee99c9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsPartition.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsPartition.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class TermsPartitionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNumPartitions = System.Text.Json.JsonEncodedText.Encode("num_partitions"); - private static readonly System.Text.Json.JsonEncodedText PropPartition = System.Text.Json.JsonEncodedText.Encode("partition"); - - public override Elastic.Clients.Elasticsearch.Aggregations.TermsPartition Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propNumPartitions = default; - LocalJsonValue propPartition = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNumPartitions.TryReadProperty(ref reader, options, PropNumPartitions, null)) - { - continue; - } - - if (propPartition.TryReadProperty(ref reader, options, PropPartition, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.TermsPartition(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - NumPartitions = propNumPartitions.Value, - Partition = propPartition.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TermsPartition value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNumPartitions, value.NumPartitions, null, null); - writer.WriteProperty(options, PropPartition, value.Partition, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.TermsPartitionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.TermsPartitionConverter))] public sealed partial class TermsPartition { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TestPopulation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TestPopulation.Converters.g.cs new file mode 100644 index 00000000000..e55b212b209 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TestPopulation.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class TestPopulationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.Aggregations.TestPopulation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propFilter = default; + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.TestPopulation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Filter = propFilter.Value, + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TestPopulation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFilter, value.Filter, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TestPopulation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TestPopulation.g.cs index 53f5f7987de..9f82ddccabf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TestPopulation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TestPopulation.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class TestPopulationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.Aggregations.TestPopulation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propFilter = default; - LocalJsonValue propScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.TestPopulation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Filter = propFilter.Value, - Script = propScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TestPopulation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFilter, value.Filter, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.TestPopulationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.TestPopulationConverter))] public sealed partial class TestPopulation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TimeSeriesAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TimeSeriesAggregate.Converters.g.cs new file mode 100644 index 00000000000..40a4608b305 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TimeSeriesAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class TimeSeriesAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBuckets = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TimeSeriesAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TimeSeriesAggregate.g.cs index 6b7cbf6507d..b8cc73d4771 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TimeSeriesAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TimeSeriesAggregate.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class TimeSeriesAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBuckets = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.TimeSeriesAggregateConverter))] public sealed partial class TimeSeriesAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TimeSeriesAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TimeSeriesAggregation.Converters.g.cs new file mode 100644 index 00000000000..9da32eafbb5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TimeSeriesAggregation.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class TimeSeriesAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropKeyed = System.Text.Json.JsonEncodedText.Encode("keyed"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + + public override Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propKeyed = default; + LocalJsonValue propSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propKeyed.TryReadProperty(ref reader, options, PropKeyed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Keyed = propKeyed.Value, + Size = propSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropKeyed, value.Keyed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TimeSeriesAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TimeSeriesAggregation.g.cs index 16c6bf6addb..75327294a33 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TimeSeriesAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TimeSeriesAggregation.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class TimeSeriesAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropKeyed = System.Text.Json.JsonEncodedText.Encode("keyed"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - - public override Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propKeyed = default; - LocalJsonValue propSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propKeyed.TryReadProperty(ref reader, options, PropKeyed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Keyed = propKeyed.Value, - Size = propSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropKeyed, value.Keyed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.TimeSeriesAggregationConverter))] public sealed partial class TimeSeriesAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TimeSeriesBucket.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TimeSeriesBucket.Converters.g.cs new file mode 100644 index 00000000000..a467dd92e1d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TimeSeriesBucket.Converters.g.cs @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class TimeSeriesBucketConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); + + public override Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue> propKey = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propKey.TryReadProperty(ref reader, options, PropKey, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + Key = propKey.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesBucket value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropKey, value.Key, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TimeSeriesBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TimeSeriesBucket.g.cs index f18116bb2b3..c0a0223047d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TimeSeriesBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TimeSeriesBucket.g.cs @@ -23,61 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class TimeSeriesBucketConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); - - public override Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue> propKey = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propKey.TryReadProperty(ref reader, options, PropKey, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - Key = propKey.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesBucket value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropKey, value.Key, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.TimeSeriesBucketConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.TimeSeriesBucketConverter))] public sealed partial class TimeSeriesBucket { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregate.Converters.g.cs new file mode 100644 index 00000000000..2dadf100609 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class TopHitsAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropHits = System.Text.Json.JsonEncodedText.Encode("hits"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propHits = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propHits.TryReadProperty(ref reader, options, PropHits, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Hits = propHits.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropHits, value.Hits, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregate.g.cs index 040f1571e46..fbc40c7206f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregate.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class TopHitsAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropHits = System.Text.Json.JsonEncodedText.Encode("hits"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propHits = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propHits.TryReadProperty(ref reader, options, PropHits, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Hits = propHits.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropHits, value.Hits, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.TopHitsAggregateConverter))] public sealed partial class TopHitsAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregation.Converters.g.cs new file mode 100644 index 00000000000..4aa2ee2d745 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregation.Converters.g.cs @@ -0,0 +1,198 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class TopHitsAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + 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 PropField = System.Text.Json.JsonEncodedText.Encode("field"); + 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 PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropScriptFields = System.Text.Json.JsonEncodedText.Encode("script_fields"); + 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 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 PropStoredFields = System.Text.Json.JsonEncodedText.Encode("stored_fields"); + private static readonly System.Text.Json.JsonEncodedText PropTrackScores = System.Text.Json.JsonEncodedText.Encode("track_scores"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propDocvalueFields = default; + LocalJsonValue propExplain = default; + LocalJsonValue propField = default; + LocalJsonValue?> propFields = default; + LocalJsonValue propFrom = default; + LocalJsonValue propHighlight = default; + LocalJsonValue propMissing = default; + LocalJsonValue propScript = default; + LocalJsonValue?> propScriptFields = default; + LocalJsonValue propSeqNoPrimaryTerm = default; + LocalJsonValue propSize = default; + LocalJsonValue?> propSort = default; + LocalJsonValue propSource = default; + LocalJsonValue propStoredFields = default; + LocalJsonValue propTrackScores = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocvalueFields.TryReadProperty(ref reader, options, PropDocvalueFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propExplain.TryReadProperty(ref reader, options, PropExplain, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propFrom.TryReadProperty(ref reader, options, PropFrom, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propHighlight.TryReadProperty(ref reader, options, PropHighlight, null)) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propScriptFields.TryReadProperty(ref reader, options, PropScriptFields, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propSeqNoPrimaryTerm.TryReadProperty(ref reader, options, PropSeqNoPrimaryTerm, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (propStoredFields.TryReadProperty(ref reader, options, PropStoredFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propTrackScores.TryReadProperty(ref reader, options, PropTrackScores, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DocvalueFields = propDocvalueFields.Value, + Explain = propExplain.Value, + Field = propField.Value, + Fields = propFields.Value, + From = propFrom.Value, + Highlight = propHighlight.Value, + Missing = propMissing.Value, + Script = propScript.Value, + ScriptFields = propScriptFields.Value, + SeqNoPrimaryTerm = propSeqNoPrimaryTerm.Value, + Size = propSize.Value, + Sort = propSort.Value, + Source = propSource.Value, + StoredFields = propStoredFields.Value, + TrackScores = propTrackScores.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocvalueFields, value.DocvalueFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropExplain, value.Explain, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFrom, value.From, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropHighlight, value.Highlight, null, null); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropScriptFields, value.ScriptFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropSeqNoPrimaryTerm, value.SeqNoPrimaryTerm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteProperty(options, PropStoredFields, value.StoredFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropTrackScores, value.TrackScores, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregation.g.cs index 99caeb897eb..9d451527d1d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregation.g.cs @@ -23,181 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class TopHitsAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - 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 PropField = System.Text.Json.JsonEncodedText.Encode("field"); - 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 PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropScriptFields = System.Text.Json.JsonEncodedText.Encode("script_fields"); - 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 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 PropStoredFields = System.Text.Json.JsonEncodedText.Encode("stored_fields"); - private static readonly System.Text.Json.JsonEncodedText PropTrackScores = System.Text.Json.JsonEncodedText.Encode("track_scores"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propDocvalueFields = default; - LocalJsonValue propExplain = default; - LocalJsonValue propField = default; - LocalJsonValue?> propFields = default; - LocalJsonValue propFrom = default; - LocalJsonValue propHighlight = default; - LocalJsonValue propMissing = default; - LocalJsonValue propScript = default; - LocalJsonValue?> propScriptFields = default; - LocalJsonValue propSeqNoPrimaryTerm = default; - LocalJsonValue propSize = default; - LocalJsonValue?> propSort = default; - LocalJsonValue propSource = default; - LocalJsonValue propStoredFields = default; - LocalJsonValue propTrackScores = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocvalueFields.TryReadProperty(ref reader, options, PropDocvalueFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propExplain.TryReadProperty(ref reader, options, PropExplain, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propFrom.TryReadProperty(ref reader, options, PropFrom, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propHighlight.TryReadProperty(ref reader, options, PropHighlight, null)) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propScriptFields.TryReadProperty(ref reader, options, PropScriptFields, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propSeqNoPrimaryTerm.TryReadProperty(ref reader, options, PropSeqNoPrimaryTerm, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (propStoredFields.TryReadProperty(ref reader, options, PropStoredFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propTrackScores.TryReadProperty(ref reader, options, PropTrackScores, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DocvalueFields = propDocvalueFields.Value, - Explain = propExplain.Value, - Field = propField.Value, - Fields = propFields.Value, - From = propFrom.Value, - Highlight = propHighlight.Value, - Missing = propMissing.Value, - Script = propScript.Value, - ScriptFields = propScriptFields.Value, - SeqNoPrimaryTerm = propSeqNoPrimaryTerm.Value, - Size = propSize.Value, - Sort = propSort.Value, - Source = propSource.Value, - StoredFields = propStoredFields.Value, - TrackScores = propTrackScores.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocvalueFields, value.DocvalueFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropExplain, value.Explain, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFrom, value.From, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropHighlight, value.Highlight, null, null); - writer.WriteProperty(options, PropMissing, value.Missing, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropScriptFields, value.ScriptFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropSeqNoPrimaryTerm, value.SeqNoPrimaryTerm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteProperty(options, PropStoredFields, value.StoredFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropTrackScores, value.TrackScores, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.TopHitsAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.TopHitsAggregationConverter))] public sealed partial class TopHitsAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetrics.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetrics.Converters.g.cs new file mode 100644 index 00000000000..2c576fe20ea --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetrics.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class TopMetricsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMetrics = System.Text.Json.JsonEncodedText.Encode("metrics"); + private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); + + public override Elastic.Clients.Elasticsearch.Aggregations.TopMetrics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propMetrics = default; + LocalJsonValue> propSort = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMetrics.TryReadProperty(ref reader, options, PropMetrics, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.TopMetrics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Metrics = propMetrics.Value, + Sort = propSort.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TopMetrics value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMetrics, value.Metrics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetrics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetrics.g.cs index aca57615f22..a15311ef4e3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetrics.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetrics.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class TopMetricsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMetrics = System.Text.Json.JsonEncodedText.Encode("metrics"); - private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); - - public override Elastic.Clients.Elasticsearch.Aggregations.TopMetrics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propMetrics = default; - LocalJsonValue> propSort = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMetrics.TryReadProperty(ref reader, options, PropMetrics, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.TopMetrics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Metrics = propMetrics.Value, - Sort = propSort.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TopMetrics value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMetrics, value.Metrics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.TopMetricsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.TopMetricsConverter))] public sealed partial class TopMetrics { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsAggregate.Converters.g.cs new file mode 100644 index 00000000000..eb81095a3e3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class TopMetricsAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropTop = System.Text.Json.JsonEncodedText.Encode("top"); + + public override Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propMeta = default; + LocalJsonValue> propTop = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propTop.TryReadProperty(ref reader, options, PropTop, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Meta = propMeta.Value, + Top = propTop.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropTop, value.Top, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsAggregate.g.cs index 7025b59532a..87be61b2dd1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsAggregate.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class TopMetricsAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropTop = System.Text.Json.JsonEncodedText.Encode("top"); - - public override Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propMeta = default; - LocalJsonValue> propTop = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propTop.TryReadProperty(ref reader, options, PropTop, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Meta = propMeta.Value, - Top = propTop.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropTop, value.Top, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.TopMetricsAggregateConverter))] public sealed partial class TopMetricsAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsAggregation.Converters.g.cs new file mode 100644 index 00000000000..bcb918cf47c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsAggregation.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class TopMetricsAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropMetrics = System.Text.Json.JsonEncodedText.Encode("metrics"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); + + public override Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue?> propMetrics = default; + LocalJsonValue propMissing = default; + LocalJsonValue propScript = default; + LocalJsonValue propSize = default; + LocalJsonValue?> propSort = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propMetrics.TryReadProperty(ref reader, options, PropMetrics, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Metrics = propMetrics.Value, + Missing = propMissing.Value, + Script = propScript.Value, + Size = propSize.Value, + Sort = propSort.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropMetrics, value.Metrics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsAggregation.g.cs index 42a9e7bbfba..32554d5cad9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsAggregation.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class TopMetricsAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropMetrics = System.Text.Json.JsonEncodedText.Encode("metrics"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); - - public override Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue?> propMetrics = default; - LocalJsonValue propMissing = default; - LocalJsonValue propScript = default; - LocalJsonValue propSize = default; - LocalJsonValue?> propSort = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propMetrics.TryReadProperty(ref reader, options, PropMetrics, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Metrics = propMetrics.Value, - Missing = propMissing.Value, - Script = propScript.Value, - Size = propSize.Value, - Sort = propSort.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropMetrics, value.Metrics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMissing, value.Missing, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.TopMetricsAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.TopMetricsAggregationConverter))] public sealed partial class TopMetricsAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsValue.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsValue.Converters.g.cs new file mode 100644 index 00000000000..e8c17936b32 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsValue.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class TopMetricsValueConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + + public override Elastic.Clients.Elasticsearch.Aggregations.TopMetricsValue Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.TopMetricsValue(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TopMetricsValue value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsValue.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsValue.g.cs index 02f207ecb9b..dcfafc48d16 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsValue.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsValue.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class TopMetricsValueConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - - public override Elastic.Clients.Elasticsearch.Aggregations.TopMetricsValue Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.TopMetricsValue(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TopMetricsValue value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.TopMetricsValueConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.TopMetricsValueConverter))] public sealed partial class TopMetricsValue { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedRareTermsAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedRareTermsAggregate.Converters.g.cs new file mode 100644 index 00000000000..9e2a47f3c84 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedRareTermsAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class UnmappedRareTermsAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.UnmappedRareTermsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBuckets = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.UnmappedRareTermsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.UnmappedRareTermsAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedRareTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedRareTermsAggregate.g.cs index 1d59d2aea52..50fb89ff8ad 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedRareTermsAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedRareTermsAggregate.g.cs @@ -23,60 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class UnmappedRareTermsAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.UnmappedRareTermsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBuckets = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.UnmappedRareTermsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.UnmappedRareTermsAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - /// /// /// Result of a rare_terms aggregation when the field is unmapped. buckets is always empty. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.UnmappedRareTermsAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.UnmappedRareTermsAggregateConverter))] public sealed partial class UnmappedRareTermsAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedSamplerAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedSamplerAggregate.Converters.g.cs new file mode 100644 index 00000000000..a39b57adadf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedSamplerAggregate.Converters.g.cs @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class UnmappedSamplerAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.UnmappedSamplerAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.UnmappedSamplerAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.UnmappedSamplerAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedSamplerAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedSamplerAggregate.g.cs index 5bcc7ccb23d..086957648c1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedSamplerAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedSamplerAggregate.g.cs @@ -23,61 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class UnmappedSamplerAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.UnmappedSamplerAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.UnmappedSamplerAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.UnmappedSamplerAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.UnmappedSamplerAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.UnmappedSamplerAggregateConverter))] public sealed partial class UnmappedSamplerAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedSignificantTermsAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedSignificantTermsAggregate.Converters.g.cs new file mode 100644 index 00000000000..baca012ba93 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedSignificantTermsAggregate.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class UnmappedSignificantTermsAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBgCount = System.Text.Json.JsonEncodedText.Encode("bg_count"); + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.UnmappedSignificantTermsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBgCount = default; + LocalJsonValue> propBuckets = default; + LocalJsonValue propDocCount = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBgCount.TryReadProperty(ref reader, options, PropBgCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.UnmappedSignificantTermsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BgCount = propBgCount.Value, + Buckets = propBuckets.Value, + DocCount = propDocCount.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.UnmappedSignificantTermsAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBgCount, value.BgCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedSignificantTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedSignificantTermsAggregate.g.cs index b32bb5acae6..35cf75e5792 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedSignificantTermsAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedSignificantTermsAggregate.g.cs @@ -23,78 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class UnmappedSignificantTermsAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBgCount = System.Text.Json.JsonEncodedText.Encode("bg_count"); - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.UnmappedSignificantTermsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBgCount = default; - LocalJsonValue> propBuckets = default; - LocalJsonValue propDocCount = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBgCount.TryReadProperty(ref reader, options, PropBgCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.UnmappedSignificantTermsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BgCount = propBgCount.Value, - Buckets = propBuckets.Value, - DocCount = propDocCount.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.UnmappedSignificantTermsAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBgCount, value.BgCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - /// /// /// Result of the significant_terms aggregation on an unmapped field. buckets is always empty. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.UnmappedSignificantTermsAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.UnmappedSignificantTermsAggregateConverter))] public sealed partial class UnmappedSignificantTermsAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedTermsAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedTermsAggregate.Converters.g.cs new file mode 100644 index 00000000000..98a88b52b67 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedTermsAggregate.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class UnmappedTermsAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropDocCountErrorUpperBound = System.Text.Json.JsonEncodedText.Encode("doc_count_error_upper_bound"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropSumOtherDocCount = System.Text.Json.JsonEncodedText.Encode("sum_other_doc_count"); + + public override Elastic.Clients.Elasticsearch.Aggregations.UnmappedTermsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBuckets = default; + LocalJsonValue propDocCountErrorUpperBound = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propSumOtherDocCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propDocCountErrorUpperBound.TryReadProperty(ref reader, options, PropDocCountErrorUpperBound, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propSumOtherDocCount.TryReadProperty(ref reader, options, PropSumOtherDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.UnmappedTermsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + DocCountErrorUpperBound = propDocCountErrorUpperBound.Value, + Meta = propMeta.Value, + SumOtherDocCount = propSumOtherDocCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.UnmappedTermsAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDocCountErrorUpperBound, value.DocCountErrorUpperBound, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropSumOtherDocCount, value.SumOtherDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedTermsAggregate.g.cs index 216add16d1e..d0c9548e24b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedTermsAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/UnmappedTermsAggregate.g.cs @@ -23,78 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class UnmappedTermsAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropDocCountErrorUpperBound = System.Text.Json.JsonEncodedText.Encode("doc_count_error_upper_bound"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropSumOtherDocCount = System.Text.Json.JsonEncodedText.Encode("sum_other_doc_count"); - - public override Elastic.Clients.Elasticsearch.Aggregations.UnmappedTermsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBuckets = default; - LocalJsonValue propDocCountErrorUpperBound = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propSumOtherDocCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propDocCountErrorUpperBound.TryReadProperty(ref reader, options, PropDocCountErrorUpperBound, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propSumOtherDocCount.TryReadProperty(ref reader, options, PropSumOtherDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.UnmappedTermsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - DocCountErrorUpperBound = propDocCountErrorUpperBound.Value, - Meta = propMeta.Value, - SumOtherDocCount = propSumOtherDocCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.UnmappedTermsAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDocCountErrorUpperBound, value.DocCountErrorUpperBound, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropSumOtherDocCount, value.SumOtherDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Result of a terms aggregation when the field is unmapped. buckets is always empty. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.UnmappedTermsAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.UnmappedTermsAggregateConverter))] public sealed partial class UnmappedTermsAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueCountAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueCountAggregate.Converters.g.cs new file mode 100644 index 00000000000..5fca2181c5d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueCountAggregate.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class ValueCountAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propMeta = default; + LocalJsonValue propValue = default; + LocalJsonValue propValueAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Meta = propMeta.Value, + Value = propValue.Value, + ValueAsString = propValueAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueCountAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueCountAggregate.g.cs index 36a48638393..71442d6c844 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueCountAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueCountAggregate.g.cs @@ -23,69 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class ValueCountAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propMeta = default; - LocalJsonValue propValue = default; - LocalJsonValue propValueAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Meta = propMeta.Value, - Value = propValue.Value, - ValueAsString = propValueAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Value count aggregation result. value is always present. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.ValueCountAggregateConverter))] public sealed partial class ValueCountAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueCountAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueCountAggregation.Converters.g.cs new file mode 100644 index 00000000000..0a809978b58 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueCountAggregation.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class ValueCountAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propFormat = default; + LocalJsonValue propMissing = default; + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Format = propFormat.Value, + Missing = propMissing.Value, + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueCountAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueCountAggregation.g.cs index 938a94b1ec6..a2968946129 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueCountAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueCountAggregation.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class ValueCountAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propFormat = default; - LocalJsonValue propMissing = default; - LocalJsonValue propScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Format = propFormat.Value, - Missing = propMissing.Value, - Script = propScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropMissing, value.Missing, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.ValueCountAggregationConverter))] public sealed partial class ValueCountAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueType.Converters.g.cs new file mode 100644 index 00000000000..6f11586f140 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueType.Converters.g.cs @@ -0,0 +1,193 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class ValueTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberBoolean = System.Text.Json.JsonEncodedText.Encode("boolean"); + private static readonly System.Text.Json.JsonEncodedText MemberDate = System.Text.Json.JsonEncodedText.Encode("date"); + private static readonly System.Text.Json.JsonEncodedText MemberDateNanos = System.Text.Json.JsonEncodedText.Encode("date_nanos"); + private static readonly System.Text.Json.JsonEncodedText MemberDouble = System.Text.Json.JsonEncodedText.Encode("double"); + private static readonly System.Text.Json.JsonEncodedText MemberGeoPoint = System.Text.Json.JsonEncodedText.Encode("geo_point"); + private static readonly System.Text.Json.JsonEncodedText MemberIp = System.Text.Json.JsonEncodedText.Encode("ip"); + private static readonly System.Text.Json.JsonEncodedText MemberLong = System.Text.Json.JsonEncodedText.Encode("long"); + private static readonly System.Text.Json.JsonEncodedText MemberNumber = System.Text.Json.JsonEncodedText.Encode("number"); + private static readonly System.Text.Json.JsonEncodedText MemberNumeric = System.Text.Json.JsonEncodedText.Encode("numeric"); + private static readonly System.Text.Json.JsonEncodedText MemberString = System.Text.Json.JsonEncodedText.Encode("string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.ValueType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberBoolean)) + { + return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Boolean; + } + + if (reader.ValueTextEquals(MemberDate)) + { + return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Date; + } + + if (reader.ValueTextEquals(MemberDateNanos)) + { + return Elastic.Clients.Elasticsearch.Aggregations.ValueType.DateNanos; + } + + if (reader.ValueTextEquals(MemberDouble)) + { + return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Double; + } + + if (reader.ValueTextEquals(MemberGeoPoint)) + { + return Elastic.Clients.Elasticsearch.Aggregations.ValueType.GeoPoint; + } + + if (reader.ValueTextEquals(MemberIp)) + { + return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Ip; + } + + if (reader.ValueTextEquals(MemberLong)) + { + return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Long; + } + + if (reader.ValueTextEquals(MemberNumber)) + { + return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Number; + } + + if (reader.ValueTextEquals(MemberNumeric)) + { + return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Numeric; + } + + if (reader.ValueTextEquals(MemberString)) + { + return Elastic.Clients.Elasticsearch.Aggregations.ValueType.String; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberBoolean.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Boolean; + } + + if (string.Equals(value, MemberDate.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Date; + } + + if (string.Equals(value, MemberDateNanos.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.ValueType.DateNanos; + } + + if (string.Equals(value, MemberDouble.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Double; + } + + if (string.Equals(value, MemberGeoPoint.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.ValueType.GeoPoint; + } + + if (string.Equals(value, MemberIp.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Ip; + } + + if (string.Equals(value, MemberLong.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Long; + } + + if (string.Equals(value, MemberNumber.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Number; + } + + if (string.Equals(value, MemberNumeric.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Numeric; + } + + if (string.Equals(value, MemberString.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Aggregations.ValueType.String; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.ValueType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ValueType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Aggregations.ValueType.Boolean: + writer.WriteStringValue(MemberBoolean); + break; + case Elastic.Clients.Elasticsearch.Aggregations.ValueType.Date: + writer.WriteStringValue(MemberDate); + break; + case Elastic.Clients.Elasticsearch.Aggregations.ValueType.DateNanos: + writer.WriteStringValue(MemberDateNanos); + break; + case Elastic.Clients.Elasticsearch.Aggregations.ValueType.Double: + writer.WriteStringValue(MemberDouble); + break; + case Elastic.Clients.Elasticsearch.Aggregations.ValueType.GeoPoint: + writer.WriteStringValue(MemberGeoPoint); + break; + case Elastic.Clients.Elasticsearch.Aggregations.ValueType.Ip: + writer.WriteStringValue(MemberIp); + break; + case Elastic.Clients.Elasticsearch.Aggregations.ValueType.Long: + writer.WriteStringValue(MemberLong); + break; + case Elastic.Clients.Elasticsearch.Aggregations.ValueType.Number: + writer.WriteStringValue(MemberNumber); + break; + case Elastic.Clients.Elasticsearch.Aggregations.ValueType.Numeric: + writer.WriteStringValue(MemberNumeric); + break; + case Elastic.Clients.Elasticsearch.Aggregations.ValueType.String: + writer.WriteStringValue(MemberString); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.ValueType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Aggregations.ValueType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ValueType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueType.g.cs new file mode 100644 index 00000000000..de2ec3ef2d9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ValueType.g.cs @@ -0,0 +1,49 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.ValueTypeConverter))] +public enum ValueType +{ + [System.Runtime.Serialization.EnumMember(Value = "boolean")] + Boolean, + [System.Runtime.Serialization.EnumMember(Value = "date")] + Date, + [System.Runtime.Serialization.EnumMember(Value = "date_nanos")] + DateNanos, + [System.Runtime.Serialization.EnumMember(Value = "double")] + Double, + [System.Runtime.Serialization.EnumMember(Value = "geo_point")] + GeoPoint, + [System.Runtime.Serialization.EnumMember(Value = "ip")] + Ip, + [System.Runtime.Serialization.EnumMember(Value = "long")] + Long, + [System.Runtime.Serialization.EnumMember(Value = "number")] + Number, + [System.Runtime.Serialization.EnumMember(Value = "numeric")] + Numeric, + [System.Runtime.Serialization.EnumMember(Value = "string")] + String +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramAggregate.Converters.g.cs new file mode 100644 index 00000000000..abd2c902a82 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramAggregate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class VariableWidthHistogramAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBuckets = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramAggregate.g.cs index ffafae3ea40..a55f3dc2143 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramAggregate.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class VariableWidthHistogramAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - - public override Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBuckets = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.VariableWidthHistogramAggregateConverter))] public sealed partial class VariableWidthHistogramAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramAggregation.Converters.g.cs new file mode 100644 index 00000000000..31ef52ac1de --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramAggregation.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class VariableWidthHistogramAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropInitialBuffer = System.Text.Json.JsonEncodedText.Encode("initial_buffer"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"); + + public override Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBuckets = default; + LocalJsonValue propField = default; + LocalJsonValue propInitialBuffer = default; + LocalJsonValue propScript = default; + LocalJsonValue propShardSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propInitialBuffer.TryReadProperty(ref reader, options, PropInitialBuffer, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propShardSize.TryReadProperty(ref reader, options, PropShardSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Buckets = propBuckets.Value, + Field = propField.Value, + InitialBuffer = propInitialBuffer.Value, + Script = propScript.Value, + ShardSize = propShardSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropInitialBuffer, value.InitialBuffer, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramAggregation.g.cs index 27f367ade40..b076d1372ff 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramAggregation.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class VariableWidthHistogramAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuckets = System.Text.Json.JsonEncodedText.Encode("buckets"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropInitialBuffer = System.Text.Json.JsonEncodedText.Encode("initial_buffer"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"); - - public override Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBuckets = default; - LocalJsonValue propField = default; - LocalJsonValue propInitialBuffer = default; - LocalJsonValue propScript = default; - LocalJsonValue propShardSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuckets.TryReadProperty(ref reader, options, PropBuckets, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propInitialBuffer.TryReadProperty(ref reader, options, PropInitialBuffer, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propShardSize.TryReadProperty(ref reader, options, PropShardSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Buckets = propBuckets.Value, - Field = propField.Value, - InitialBuffer = propInitialBuffer.Value, - Script = propScript.Value, - ShardSize = propShardSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuckets, value.Buckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropInitialBuffer, value.InitialBuffer, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.VariableWidthHistogramAggregationConverter))] public sealed partial class VariableWidthHistogramAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramBucket.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramBucket.Converters.g.cs new file mode 100644 index 00000000000..18178649bab --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramBucket.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class VariableWidthHistogramBucketConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); + private static readonly System.Text.Json.JsonEncodedText PropKeyAsString = System.Text.Json.JsonEncodedText.Encode("key_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText PropMaxAsString = System.Text.Json.JsonEncodedText.Encode("max_as_string"); + private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); + private static readonly System.Text.Json.JsonEncodedText PropMinAsString = System.Text.Json.JsonEncodedText.Encode("min_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue propKey = default; + LocalJsonValue propKeyAsString = default; + LocalJsonValue propMax = default; + LocalJsonValue propMaxAsString = default; + LocalJsonValue propMin = default; + LocalJsonValue propMinAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propKey.TryReadProperty(ref reader, options, PropKey, null)) + { + continue; + } + + if (propKeyAsString.TryReadProperty(ref reader, options, PropKeyAsString, null)) + { + continue; + } + + if (propMax.TryReadProperty(ref reader, options, PropMax, null)) + { + continue; + } + + if (propMaxAsString.TryReadProperty(ref reader, options, PropMaxAsString, null)) + { + continue; + } + + if (propMin.TryReadProperty(ref reader, options, PropMin, null)) + { + continue; + } + + if (propMinAsString.TryReadProperty(ref reader, options, PropMinAsString, null)) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + Key = propKey.Value, + KeyAsString = propKeyAsString.Value, + Max = propMax.Value, + MaxAsString = propMaxAsString.Value, + Min = propMin.Value, + MinAsString = propMinAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramBucket value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropKey, value.Key, null, null); + writer.WriteProperty(options, PropKeyAsString, value.KeyAsString, null, null); + writer.WriteProperty(options, PropMax, value.Max, null, null); + writer.WriteProperty(options, PropMaxAsString, value.MaxAsString, null, null); + writer.WriteProperty(options, PropMin, value.Min, null, null); + writer.WriteProperty(options, PropMinAsString, value.MinAsString, null, null); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramBucket.g.cs index 20d89a89113..ba9d7558eae 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/VariableWidthHistogramBucket.g.cs @@ -23,106 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class VariableWidthHistogramBucketConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); - private static readonly System.Text.Json.JsonEncodedText PropKeyAsString = System.Text.Json.JsonEncodedText.Encode("key_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); - private static readonly System.Text.Json.JsonEncodedText PropMaxAsString = System.Text.Json.JsonEncodedText.Encode("max_as_string"); - private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); - private static readonly System.Text.Json.JsonEncodedText PropMinAsString = System.Text.Json.JsonEncodedText.Encode("min_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAggregations = default; - LocalJsonValue propDocCount = default; - LocalJsonValue propKey = default; - LocalJsonValue propKeyAsString = default; - LocalJsonValue propMax = default; - LocalJsonValue propMaxAsString = default; - LocalJsonValue propMin = default; - LocalJsonValue propMinAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propKey.TryReadProperty(ref reader, options, PropKey, null)) - { - continue; - } - - if (propKeyAsString.TryReadProperty(ref reader, options, PropKeyAsString, null)) - { - continue; - } - - if (propMax.TryReadProperty(ref reader, options, PropMax, null)) - { - continue; - } - - if (propMaxAsString.TryReadProperty(ref reader, options, PropMaxAsString, null)) - { - continue; - } - - if (propMin.TryReadProperty(ref reader, options, PropMin, null)) - { - continue; - } - - if (propMinAsString.TryReadProperty(ref reader, options, PropMinAsString, null)) - { - continue; - } - - propAggregations ??= new System.Collections.Generic.Dictionary(); - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); - propAggregations[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), - DocCount = propDocCount.Value, - Key = propKey.Value, - KeyAsString = propKeyAsString.Value, - Max = propMax.Value, - MaxAsString = propMaxAsString.Value, - Min = propMin.Value, - MinAsString = propMinAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramBucket value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropKey, value.Key, null, null); - writer.WriteProperty(options, PropKeyAsString, value.KeyAsString, null, null); - writer.WriteProperty(options, PropMax, value.Max, null, null); - writer.WriteProperty(options, PropMaxAsString, value.MaxAsString, null, null); - writer.WriteProperty(options, PropMin, value.Min, null, null); - writer.WriteProperty(options, PropMinAsString, value.MinAsString, null, null); - if (value.Aggregations is not null) - { - foreach (var item in value.Aggregations) - { - Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.VariableWidthHistogramBucketConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.VariableWidthHistogramBucketConverter))] public sealed partial class VariableWidthHistogramBucket { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageAggregate.Converters.g.cs new file mode 100644 index 00000000000..1c9b2dff9b1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageAggregate.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class WeightedAverageAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); + + public override Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propMeta = default; + LocalJsonValue propValue = default; + LocalJsonValue propValueAsString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Meta = propMeta.Value, + Value = propValue.Value, + ValueAsString = propValueAsString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageAggregate.g.cs index 2806f01f9e4..9d2f5819db8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageAggregate.g.cs @@ -23,69 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class WeightedAverageAggregateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - private static readonly System.Text.Json.JsonEncodedText PropValueAsString = System.Text.Json.JsonEncodedText.Encode("value_as_string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propMeta = default; - LocalJsonValue propValue = default; - LocalJsonValue propValueAsString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propValueAsString.TryReadProperty(ref reader, options, PropValueAsString, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Meta = propMeta.Value, - Value = propValue.Value, - ValueAsString = propValueAsString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageAggregate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropValueAsString, value.ValueAsString, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Weighted average aggregation result. value is missing if the weight was set to zero. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageAggregateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.WeightedAverageAggregateConverter))] public sealed partial class WeightedAverageAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageAggregation.Converters.g.cs new file mode 100644 index 00000000000..5e6457aa2b8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageAggregation.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class WeightedAverageAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + private static readonly System.Text.Json.JsonEncodedText PropValueType = System.Text.Json.JsonEncodedText.Encode("value_type"); + private static readonly System.Text.Json.JsonEncodedText PropWeight = System.Text.Json.JsonEncodedText.Encode("weight"); + + public override Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFormat = default; + LocalJsonValue propValue = default; + LocalJsonValue propValueType = default; + LocalJsonValue propWeight = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, null)) + { + continue; + } + + if (propValueType.TryReadProperty(ref reader, options, PropValueType, static Elastic.Clients.Elasticsearch.Aggregations.ValueType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propWeight.TryReadProperty(ref reader, options, PropWeight, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Format = propFormat.Value, + Value = propValue.Value, + ValueType = propValueType.Value, + Weight = propWeight.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropValue, value.Value, null, null); + writer.WriteProperty(options, PropValueType, value.ValueType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.ValueType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropWeight, value.Weight, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageAggregation.g.cs index 40cb5cc7971..69f43709732 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageAggregation.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class WeightedAverageAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - private static readonly System.Text.Json.JsonEncodedText PropValueType = System.Text.Json.JsonEncodedText.Encode("value_type"); - private static readonly System.Text.Json.JsonEncodedText PropWeight = System.Text.Json.JsonEncodedText.Encode("weight"); - - public override Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFormat = default; - LocalJsonValue propValue = default; - LocalJsonValue propValueType = default; - LocalJsonValue propWeight = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, null)) - { - continue; - } - - if (propValueType.TryReadProperty(ref reader, options, PropValueType, static Elastic.Clients.Elasticsearch.Aggregations.ValueType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propWeight.TryReadProperty(ref reader, options, PropWeight, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Format = propFormat.Value, - Value = propValue.Value, - ValueType = propValueType.Value, - Weight = propWeight.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropValue, value.Value, null, null); - writer.WriteProperty(options, PropValueType, value.ValueType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.ValueType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropWeight, value.Weight, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.WeightedAverageAggregationConverter))] public sealed partial class WeightedAverageAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageValue.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageValue.Converters.g.cs new file mode 100644 index 00000000000..ad41fcbfdc9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageValue.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class WeightedAverageValueConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageValue Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propMissing = default; + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageValue(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Missing = propMissing.Value, + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageValue value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropMissing, value.Missing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageValue.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageValue.g.cs index 68fa603270f..a9409ad8a97 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageValue.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/WeightedAverageValue.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations; -internal sealed partial class WeightedAverageValueConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageValue Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propMissing = default; - LocalJsonValue propScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageValue(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Missing = propMissing.Value, - Script = propScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageValue value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropMissing, value.Missing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.WeightedAverageValueConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.WeightedAverageValueConverter))] public sealed partial class WeightedAverageValue { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Analyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Analyzer.Converters.g.cs new file mode 100644 index 00000000000..651159ebc06 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Analyzer.Converters.g.cs @@ -0,0 +1,256 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class IAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDiscriminator = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.IAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + var readerSnapshot = reader; + string? discriminator = "custom"; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.TryReadProperty(options, PropDiscriminator, ref discriminator, null)) + { + break; + } + + reader.Skip(); + } + + reader = readerSnapshot; + return discriminator switch + { + "arabic" => reader.ReadValue(options, null), + "armenian" => reader.ReadValue(options, null), + "basque" => reader.ReadValue(options, null), + "bengali" => reader.ReadValue(options, null), + "brazilian" => reader.ReadValue(options, null), + "bulgarian" => reader.ReadValue(options, null), + "catalan" => reader.ReadValue(options, null), + "chinese" => reader.ReadValue(options, null), + "cjk" => reader.ReadValue(options, null), + "custom" => reader.ReadValue(options, null), + "czech" => reader.ReadValue(options, null), + "danish" => reader.ReadValue(options, null), + "dutch" => reader.ReadValue(options, null), + "english" => reader.ReadValue(options, null), + "estonian" => reader.ReadValue(options, null), + "fingerprint" => reader.ReadValue(options, null), + "finnish" => reader.ReadValue(options, null), + "french" => reader.ReadValue(options, null), + "galician" => reader.ReadValue(options, null), + "german" => reader.ReadValue(options, null), + "greek" => reader.ReadValue(options, null), + "hindi" => reader.ReadValue(options, null), + "hungarian" => reader.ReadValue(options, null), + "icu_analyzer" => reader.ReadValue(options, null), + "indonesian" => reader.ReadValue(options, null), + "irish" => reader.ReadValue(options, null), + "italian" => reader.ReadValue(options, null), + "keyword" => reader.ReadValue(options, null), + "kuromoji" => reader.ReadValue(options, null), + "latvian" => reader.ReadValue(options, null), + "lithuanian" => reader.ReadValue(options, null), + "nori" => reader.ReadValue(options, null), + "norwegian" => reader.ReadValue(options, null), + "pattern" => reader.ReadValue(options, null), + "persian" => reader.ReadValue(options, null), + "portuguese" => reader.ReadValue(options, null), + "romanian" => reader.ReadValue(options, null), + "russian" => reader.ReadValue(options, null), + "serbian" => reader.ReadValue(options, null), + "simple" => reader.ReadValue(options, null), + "snowball" => reader.ReadValue(options, null), + "sorani" => reader.ReadValue(options, null), + "spanish" => reader.ReadValue(options, null), + "standard" => reader.ReadValue(options, null), + "stop" => reader.ReadValue(options, null), + "swedish" => reader.ReadValue(options, null), + "thai" => reader.ReadValue(options, null), + "turkish" => reader.ReadValue(options, null), + "whitespace" => reader.ReadValue(options, null), + _ => throw new System.Text.Json.JsonException($"Variant '{discriminator}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Analysis.IAnalyzer)}'.") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Type) + { + case "arabic": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ArabicAnalyzer)value, null); + break; + case "armenian": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ArmenianAnalyzer)value, null); + break; + case "basque": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.BasqueAnalyzer)value, null); + break; + case "bengali": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.BengaliAnalyzer)value, null); + break; + case "brazilian": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.BrazilianAnalyzer)value, null); + break; + case "bulgarian": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.BulgarianAnalyzer)value, null); + break; + case "catalan": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.CatalanAnalyzer)value, null); + break; + case "chinese": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ChineseAnalyzer)value, null); + break; + case "cjk": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.CjkAnalyzer)value, null); + break; + case "custom": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.CustomAnalyzer)value, null); + break; + case "czech": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.CzechAnalyzer)value, null); + break; + case "danish": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.DanishAnalyzer)value, null); + break; + case "dutch": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.DutchAnalyzer)value, null); + break; + case "english": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.EnglishAnalyzer)value, null); + break; + case "estonian": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.EstonianAnalyzer)value, null); + break; + case "fingerprint": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.FingerprintAnalyzer)value, null); + break; + case "finnish": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.FinnishAnalyzer)value, null); + break; + case "french": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.FrenchAnalyzer)value, null); + break; + case "galician": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.GalicianAnalyzer)value, null); + break; + case "german": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.GermanAnalyzer)value, null); + break; + case "greek": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.GreekAnalyzer)value, null); + break; + case "hindi": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.HindiAnalyzer)value, null); + break; + case "hungarian": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.HungarianAnalyzer)value, null); + break; + case "icu_analyzer": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.IcuAnalyzer)value, null); + break; + case "indonesian": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.IndonesianAnalyzer)value, null); + break; + case "irish": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.IrishAnalyzer)value, null); + break; + case "italian": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ItalianAnalyzer)value, null); + break; + case "keyword": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KeywordAnalyzer)value, null); + break; + case "kuromoji": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzer)value, null); + break; + case "latvian": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.LatvianAnalyzer)value, null); + break; + case "lithuanian": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.LithuanianAnalyzer)value, null); + break; + case "nori": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.NoriAnalyzer)value, null); + break; + case "norwegian": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.NorwegianAnalyzer)value, null); + break; + case "pattern": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PatternAnalyzer)value, null); + break; + case "persian": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PersianAnalyzer)value, null); + break; + case "portuguese": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PortugueseAnalyzer)value, null); + break; + case "romanian": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.RomanianAnalyzer)value, null); + break; + case "russian": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.RussianAnalyzer)value, null); + break; + case "serbian": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SerbianAnalyzer)value, null); + break; + case "simple": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SimpleAnalyzer)value, null); + break; + case "snowball": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SnowballAnalyzer)value, null); + break; + case "sorani": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SoraniAnalyzer)value, null); + break; + case "spanish": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SpanishAnalyzer)value, null); + break; + case "standard": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.StandardAnalyzer)value, null); + break; + case "stop": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.StopAnalyzer)value, null); + break; + case "swedish": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SwedishAnalyzer)value, null); + break; + case "thai": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ThaiAnalyzer)value, null); + break; + case "turkish": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.TurkishAnalyzer)value, null); + break; + case "whitespace": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.WhitespaceAnalyzer)value, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.Type}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Analysis.IAnalyzer)}'."); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Analyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Analyzer.g.cs index e22f01ff982..37cb46dfee6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Analyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Analyzer.g.cs @@ -23,239 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class IAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDiscriminator = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.IAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - var readerSnapshot = reader; - string? discriminator = "custom"; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.TryReadProperty(options, PropDiscriminator, ref discriminator, null)) - { - break; - } - - reader.Skip(); - } - - reader = readerSnapshot; - return discriminator switch - { - "arabic" => reader.ReadValue(options, null), - "armenian" => reader.ReadValue(options, null), - "basque" => reader.ReadValue(options, null), - "bengali" => reader.ReadValue(options, null), - "brazilian" => reader.ReadValue(options, null), - "bulgarian" => reader.ReadValue(options, null), - "catalan" => reader.ReadValue(options, null), - "chinese" => reader.ReadValue(options, null), - "cjk" => reader.ReadValue(options, null), - "custom" => reader.ReadValue(options, null), - "czech" => reader.ReadValue(options, null), - "danish" => reader.ReadValue(options, null), - "dutch" => reader.ReadValue(options, null), - "english" => reader.ReadValue(options, null), - "estonian" => reader.ReadValue(options, null), - "fingerprint" => reader.ReadValue(options, null), - "finnish" => reader.ReadValue(options, null), - "french" => reader.ReadValue(options, null), - "galician" => reader.ReadValue(options, null), - "german" => reader.ReadValue(options, null), - "greek" => reader.ReadValue(options, null), - "hindi" => reader.ReadValue(options, null), - "hungarian" => reader.ReadValue(options, null), - "icu_analyzer" => reader.ReadValue(options, null), - "indonesian" => reader.ReadValue(options, null), - "irish" => reader.ReadValue(options, null), - "italian" => reader.ReadValue(options, null), - "keyword" => reader.ReadValue(options, null), - "kuromoji" => reader.ReadValue(options, null), - "latvian" => reader.ReadValue(options, null), - "lithuanian" => reader.ReadValue(options, null), - "nori" => reader.ReadValue(options, null), - "norwegian" => reader.ReadValue(options, null), - "pattern" => reader.ReadValue(options, null), - "persian" => reader.ReadValue(options, null), - "portuguese" => reader.ReadValue(options, null), - "romanian" => reader.ReadValue(options, null), - "russian" => reader.ReadValue(options, null), - "serbian" => reader.ReadValue(options, null), - "simple" => reader.ReadValue(options, null), - "snowball" => reader.ReadValue(options, null), - "sorani" => reader.ReadValue(options, null), - "spanish" => reader.ReadValue(options, null), - "standard" => reader.ReadValue(options, null), - "stop" => reader.ReadValue(options, null), - "swedish" => reader.ReadValue(options, null), - "thai" => reader.ReadValue(options, null), - "turkish" => reader.ReadValue(options, null), - "whitespace" => reader.ReadValue(options, null), - _ => throw new System.Text.Json.JsonException($"Variant '{discriminator}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Analysis.IAnalyzer)}'.") - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - switch (value.Type) - { - case "arabic": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ArabicAnalyzer)value, null); - break; - case "armenian": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ArmenianAnalyzer)value, null); - break; - case "basque": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.BasqueAnalyzer)value, null); - break; - case "bengali": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.BengaliAnalyzer)value, null); - break; - case "brazilian": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.BrazilianAnalyzer)value, null); - break; - case "bulgarian": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.BulgarianAnalyzer)value, null); - break; - case "catalan": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.CatalanAnalyzer)value, null); - break; - case "chinese": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ChineseAnalyzer)value, null); - break; - case "cjk": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.CjkAnalyzer)value, null); - break; - case "custom": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.CustomAnalyzer)value, null); - break; - case "czech": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.CzechAnalyzer)value, null); - break; - case "danish": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.DanishAnalyzer)value, null); - break; - case "dutch": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.DutchAnalyzer)value, null); - break; - case "english": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.EnglishAnalyzer)value, null); - break; - case "estonian": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.EstonianAnalyzer)value, null); - break; - case "fingerprint": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.FingerprintAnalyzer)value, null); - break; - case "finnish": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.FinnishAnalyzer)value, null); - break; - case "french": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.FrenchAnalyzer)value, null); - break; - case "galician": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.GalicianAnalyzer)value, null); - break; - case "german": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.GermanAnalyzer)value, null); - break; - case "greek": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.GreekAnalyzer)value, null); - break; - case "hindi": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.HindiAnalyzer)value, null); - break; - case "hungarian": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.HungarianAnalyzer)value, null); - break; - case "icu_analyzer": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.IcuAnalyzer)value, null); - break; - case "indonesian": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.IndonesianAnalyzer)value, null); - break; - case "irish": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.IrishAnalyzer)value, null); - break; - case "italian": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ItalianAnalyzer)value, null); - break; - case "keyword": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KeywordAnalyzer)value, null); - break; - case "kuromoji": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzer)value, null); - break; - case "latvian": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.LatvianAnalyzer)value, null); - break; - case "lithuanian": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.LithuanianAnalyzer)value, null); - break; - case "nori": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.NoriAnalyzer)value, null); - break; - case "norwegian": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.NorwegianAnalyzer)value, null); - break; - case "pattern": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PatternAnalyzer)value, null); - break; - case "persian": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PersianAnalyzer)value, null); - break; - case "portuguese": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PortugueseAnalyzer)value, null); - break; - case "romanian": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.RomanianAnalyzer)value, null); - break; - case "russian": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.RussianAnalyzer)value, null); - break; - case "serbian": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SerbianAnalyzer)value, null); - break; - case "simple": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SimpleAnalyzer)value, null); - break; - case "snowball": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SnowballAnalyzer)value, null); - break; - case "sorani": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SoraniAnalyzer)value, null); - break; - case "spanish": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SpanishAnalyzer)value, null); - break; - case "standard": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.StandardAnalyzer)value, null); - break; - case "stop": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.StopAnalyzer)value, null); - break; - case "swedish": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SwedishAnalyzer)value, null); - break; - case "thai": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ThaiAnalyzer)value, null); - break; - case "turkish": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.TurkishAnalyzer)value, null); - break; - case "whitespace": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.WhitespaceAnalyzer)value, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.Type}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Analysis.IAnalyzer)}'."); - } - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.IAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.IAnalyzerConverter))] public partial interface IAnalyzer { public string Type { get; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Analyzers.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Analyzers.Converters.g.cs new file mode 100644 index 00000000000..c2e2e2a640a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Analyzers.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class AnalyzersConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Analysis.Analyzers Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Analysis.Analyzers(reader.ReadValue?>(options, static System.Collections.Generic.Dictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.Analyzers value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.BackingDictionary, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.Dictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Analyzers.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Analyzers.g.cs index db904fdeee7..1363b56cfa8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Analyzers.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Analyzers.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class AnalyzersConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Analysis.Analyzers Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Analysis.Analyzers(reader.ReadValue?>(options, static System.Collections.Generic.Dictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.Analyzers value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.BackingDictionary, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.Dictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.AnalyzersConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.AnalyzersConverter))] public sealed partial class Analyzers : Elastic.Clients.Elasticsearch.IsADictionary { public Analyzers() diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ApostropheTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ApostropheTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..96bdfcab336 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ApostropheTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class ApostropheTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ApostropheTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ApostropheTokenFilter.g.cs index 138264a8390..34c0b5093f5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ApostropheTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ApostropheTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class ApostropheTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.ApostropheTokenFilterConverter))] public sealed partial class ApostropheTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..56905710fbd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class ArabicAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.ArabicAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.ArabicAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ArabicAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicAnalyzer.g.cs index fd06a888fc6..22c605c3545 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class ArabicAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.ArabicAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.ArabicAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ArabicAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.ArabicAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.ArabicAnalyzerConverter))] public sealed partial class ArabicAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicNormalizationTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicNormalizationTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..d393339fdf7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicNormalizationTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class ArabicNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicNormalizationTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicNormalizationTokenFilter.g.cs index 1c9ca2562e7..5567706d283 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicNormalizationTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicNormalizationTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class ArabicNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.ArabicNormalizationTokenFilterConverter))] public sealed partial class ArabicNormalizationTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicStemTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicStemTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..b7b63239eec --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicStemTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class ArabicStemTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.ArabicStemTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.ArabicStemTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ArabicStemTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicStemTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicStemTokenFilter.g.cs index 2e694ffea49..a623b40a32a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicStemTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicStemTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class ArabicStemTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.ArabicStemTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.ArabicStemTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ArabicStemTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.ArabicStemTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.ArabicStemTokenFilterConverter))] public sealed partial class ArabicStemTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArmenianAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArmenianAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..fc682ec100d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArmenianAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class ArmenianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.ArmenianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.ArmenianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ArmenianAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArmenianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArmenianAnalyzer.g.cs index b615506beb3..1cdd899cb34 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArmenianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArmenianAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class ArmenianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.ArmenianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.ArmenianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ArmenianAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.ArmenianAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.ArmenianAnalyzerConverter))] public sealed partial class ArmenianAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/AsciiFoldingTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/AsciiFoldingTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..849dbbe8ddb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/AsciiFoldingTokenFilter.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class AsciiFoldingTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPreserveOriginal = System.Text.Json.JsonEncodedText.Encode("preserve_original"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.AsciiFoldingTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPreserveOriginal = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPreserveOriginal.TryReadProperty(ref reader, options, PropPreserveOriginal, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.AsciiFoldingTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + PreserveOriginal = propPreserveOriginal.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.AsciiFoldingTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPreserveOriginal, value.PreserveOriginal, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/AsciiFoldingTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/AsciiFoldingTokenFilter.g.cs index 418cd1bf828..b508cbb66c5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/AsciiFoldingTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/AsciiFoldingTokenFilter.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class AsciiFoldingTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPreserveOriginal = System.Text.Json.JsonEncodedText.Encode("preserve_original"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.AsciiFoldingTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPreserveOriginal = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPreserveOriginal.TryReadProperty(ref reader, options, PropPreserveOriginal, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.AsciiFoldingTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - PreserveOriginal = propPreserveOriginal.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.AsciiFoldingTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPreserveOriginal, value.PreserveOriginal, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.AsciiFoldingTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.AsciiFoldingTokenFilterConverter))] public sealed partial class AsciiFoldingTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BasqueAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BasqueAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..1f64b73054b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BasqueAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class BasqueAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.BasqueAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.BasqueAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.BasqueAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BasqueAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BasqueAnalyzer.g.cs index c32c8bfc3b9..4e0fa9726c7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BasqueAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BasqueAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class BasqueAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.BasqueAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.BasqueAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.BasqueAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.BasqueAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.BasqueAnalyzerConverter))] public sealed partial class BasqueAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BengaliAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BengaliAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..59ed145ae28 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BengaliAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class BengaliAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.BengaliAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.BengaliAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.BengaliAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BengaliAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BengaliAnalyzer.g.cs index b564cc4e3c3..1a5471260a7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BengaliAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BengaliAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class BengaliAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.BengaliAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.BengaliAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.BengaliAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.BengaliAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.BengaliAnalyzerConverter))] public sealed partial class BengaliAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BengaliNormalizationTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BengaliNormalizationTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..0c83d3fd738 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BengaliNormalizationTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class BengaliNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.BengaliNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.BengaliNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.BengaliNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BengaliNormalizationTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BengaliNormalizationTokenFilter.g.cs index 2eada95512d..64d58469e6a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BengaliNormalizationTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BengaliNormalizationTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class BengaliNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.BengaliNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.BengaliNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.BengaliNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.BengaliNormalizationTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.BengaliNormalizationTokenFilterConverter))] public sealed partial class BengaliNormalizationTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BrazilianAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BrazilianAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..166bed101dc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BrazilianAnalyzer.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class BrazilianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.BrazilianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.BrazilianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.BrazilianAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BrazilianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BrazilianAnalyzer.g.cs index ed9a7760e4d..39cd0c22a09 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BrazilianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BrazilianAnalyzer.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class BrazilianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.BrazilianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.BrazilianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.BrazilianAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.BrazilianAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.BrazilianAnalyzerConverter))] public sealed partial class BrazilianAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BrazilianStemTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BrazilianStemTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..94a2941122e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BrazilianStemTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class BrazilianStemTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.BrazilianStemTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.BrazilianStemTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.BrazilianStemTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BrazilianStemTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BrazilianStemTokenFilter.g.cs index c5a3c05a8c9..ca14ace9691 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BrazilianStemTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BrazilianStemTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class BrazilianStemTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.BrazilianStemTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.BrazilianStemTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.BrazilianStemTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.BrazilianStemTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.BrazilianStemTokenFilterConverter))] public sealed partial class BrazilianStemTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BulgarianAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BulgarianAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..c3975377903 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BulgarianAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class BulgarianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.BulgarianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.BulgarianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.BulgarianAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BulgarianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BulgarianAnalyzer.g.cs index 8586c7670a6..19e0d2202df 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BulgarianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BulgarianAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class BulgarianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.BulgarianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.BulgarianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.BulgarianAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.BulgarianAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.BulgarianAnalyzerConverter))] public sealed partial class BulgarianAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CatalanAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CatalanAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..4e490603ab9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CatalanAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class CatalanAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.CatalanAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.CatalanAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CatalanAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CatalanAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CatalanAnalyzer.g.cs index 570381d736a..195933086b8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CatalanAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CatalanAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class CatalanAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.CatalanAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.CatalanAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CatalanAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.CatalanAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.CatalanAnalyzerConverter))] public sealed partial class CatalanAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharFilter.Converters.g.cs new file mode 100644 index 00000000000..e03603b37b4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharFilter.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class ICharFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDiscriminator = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.ICharFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + var readerSnapshot = reader; + string? discriminator = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.TryReadProperty(options, PropDiscriminator, ref discriminator, null)) + { + break; + } + + reader.Skip(); + } + + reader = readerSnapshot; + return discriminator switch + { + "html_strip" => reader.ReadValue(options, null), + "icu_normalizer" => reader.ReadValue(options, null), + "kuromoji_iteration_mark" => reader.ReadValue(options, null), + "mapping" => reader.ReadValue(options, null), + "pattern_replace" => reader.ReadValue(options, null), + _ => throw new System.Text.Json.JsonException($"Variant '{discriminator}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Analysis.ICharFilter)}'.") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ICharFilter value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Type) + { + case "html_strip": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.HtmlStripCharFilter)value, null); + break; + case "icu_normalizer": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationCharFilter)value, null); + break; + case "kuromoji_iteration_mark": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KuromojiIterationMarkCharFilter)value, null); + break; + case "mapping": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.MappingCharFilter)value, null); + break; + case "pattern_replace": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PatternReplaceCharFilter)value, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.Type}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Analysis.ICharFilter)}'."); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharFilter.g.cs index 730e1c86b9b..cb93ac17bc6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharFilter.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class ICharFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDiscriminator = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.ICharFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - var readerSnapshot = reader; - string? discriminator = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.TryReadProperty(options, PropDiscriminator, ref discriminator, null)) - { - break; - } - - reader.Skip(); - } - - reader = readerSnapshot; - return discriminator switch - { - "html_strip" => reader.ReadValue(options, null), - "icu_normalizer" => reader.ReadValue(options, null), - "kuromoji_iteration_mark" => reader.ReadValue(options, null), - "mapping" => reader.ReadValue(options, null), - "pattern_replace" => reader.ReadValue(options, null), - _ => throw new System.Text.Json.JsonException($"Variant '{discriminator}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Analysis.ICharFilter)}'.") - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ICharFilter value, System.Text.Json.JsonSerializerOptions options) - { - switch (value.Type) - { - case "html_strip": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.HtmlStripCharFilter)value, null); - break; - case "icu_normalizer": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationCharFilter)value, null); - break; - case "kuromoji_iteration_mark": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KuromojiIterationMarkCharFilter)value, null); - break; - case "mapping": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.MappingCharFilter)value, null); - break; - case "pattern_replace": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PatternReplaceCharFilter)value, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.Type}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Analysis.ICharFilter)}'."); - } - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.ICharFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.ICharFilterConverter))] public partial interface ICharFilter { public string Type { get; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharFilters.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharFilters.Converters.g.cs new file mode 100644 index 00000000000..445d52052b3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharFilters.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class CharFiltersConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Analysis.CharFilters Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Analysis.CharFilters(reader.ReadValue?>(options, static System.Collections.Generic.Dictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CharFilters value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.BackingDictionary, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.Dictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharFilters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharFilters.g.cs index 2f2bd2daf19..c0833211202 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharFilters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharFilters.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class CharFiltersConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Analysis.CharFilters Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Analysis.CharFilters(reader.ReadValue?>(options, static System.Collections.Generic.Dictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CharFilters value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.BackingDictionary, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.Dictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.CharFiltersConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.CharFiltersConverter))] public sealed partial class CharFilters : Elastic.Clients.Elasticsearch.IsADictionary { public CharFilters() diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharGroupTokenizer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharGroupTokenizer.Converters.g.cs new file mode 100644 index 00000000000..8dec1cae3b6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharGroupTokenizer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class CharGroupTokenizerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxTokenLength = System.Text.Json.JsonEncodedText.Encode("max_token_length"); + private static readonly System.Text.Json.JsonEncodedText PropTokenizeOnChars = System.Text.Json.JsonEncodedText.Encode("tokenize_on_chars"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.CharGroupTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxTokenLength = default; + LocalJsonValue> propTokenizeOnChars = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxTokenLength.TryReadProperty(ref reader, options, PropMaxTokenLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTokenizeOnChars.TryReadProperty(ref reader, options, PropTokenizeOnChars, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.CharGroupTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxTokenLength = propMaxTokenLength.Value, + TokenizeOnChars = propTokenizeOnChars.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CharGroupTokenizer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxTokenLength, value.MaxTokenLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTokenizeOnChars, value.TokenizeOnChars, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharGroupTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharGroupTokenizer.g.cs index 23bfd4ec5b2..67d03a24da3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharGroupTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CharGroupTokenizer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class CharGroupTokenizerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxTokenLength = System.Text.Json.JsonEncodedText.Encode("max_token_length"); - private static readonly System.Text.Json.JsonEncodedText PropTokenizeOnChars = System.Text.Json.JsonEncodedText.Encode("tokenize_on_chars"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.CharGroupTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxTokenLength = default; - LocalJsonValue> propTokenizeOnChars = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxTokenLength.TryReadProperty(ref reader, options, PropMaxTokenLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTokenizeOnChars.TryReadProperty(ref reader, options, PropTokenizeOnChars, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.CharGroupTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxTokenLength = propMaxTokenLength.Value, - TokenizeOnChars = propTokenizeOnChars.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CharGroupTokenizer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxTokenLength, value.MaxTokenLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTokenizeOnChars, value.TokenizeOnChars, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.CharGroupTokenizerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.CharGroupTokenizerConverter))] public sealed partial class CharGroupTokenizer : Elastic.Clients.Elasticsearch.Analysis.ITokenizer { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ChineseAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ChineseAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..9e04c264f2b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ChineseAnalyzer.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class ChineseAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.ChineseAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.ChineseAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ChineseAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ChineseAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ChineseAnalyzer.g.cs index 099ece35793..5322058698f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ChineseAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ChineseAnalyzer.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class ChineseAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.ChineseAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.ChineseAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ChineseAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.ChineseAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.ChineseAnalyzerConverter))] public sealed partial class ChineseAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..111e422f30e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkAnalyzer.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class CjkAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.CjkAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.CjkAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CjkAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkAnalyzer.g.cs index 75cda96ddf9..3e5f260b17a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkAnalyzer.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class CjkAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.CjkAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.CjkAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CjkAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.CjkAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.CjkAnalyzerConverter))] public sealed partial class CjkAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkBigramIgnoredScript.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkBigramIgnoredScript.Converters.g.cs new file mode 100644 index 00000000000..170d0bd9813 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkBigramIgnoredScript.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class CjkBigramIgnoredScriptConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberHan = System.Text.Json.JsonEncodedText.Encode("han"); + private static readonly System.Text.Json.JsonEncodedText MemberHangul = System.Text.Json.JsonEncodedText.Encode("hangul"); + private static readonly System.Text.Json.JsonEncodedText MemberHiragana = System.Text.Json.JsonEncodedText.Encode("hiragana"); + private static readonly System.Text.Json.JsonEncodedText MemberKatakana = System.Text.Json.JsonEncodedText.Encode("katakana"); + + public override Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberHan)) + { + return Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Han; + } + + if (reader.ValueTextEquals(MemberHangul)) + { + return Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Hangul; + } + + if (reader.ValueTextEquals(MemberHiragana)) + { + return Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Hiragana; + } + + if (reader.ValueTextEquals(MemberKatakana)) + { + return Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Katakana; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberHan.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Han; + } + + if (string.Equals(value, MemberHangul.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Hangul; + } + + if (string.Equals(value, MemberHiragana.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Hiragana; + } + + if (string.Equals(value, MemberKatakana.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Katakana; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Han: + writer.WriteStringValue(MemberHan); + break; + case Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Hangul: + writer.WriteStringValue(MemberHangul); + break; + case Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Hiragana: + writer.WriteStringValue(MemberHiragana); + break; + case Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Katakana: + writer.WriteStringValue(MemberKatakana); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkBigramIgnoredScript.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkBigramIgnoredScript.g.cs new file mode 100644 index 00000000000..23a88cb3afe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkBigramIgnoredScript.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.CjkBigramIgnoredScriptConverter))] +public enum CjkBigramIgnoredScript +{ + [System.Runtime.Serialization.EnumMember(Value = "han")] + Han, + [System.Runtime.Serialization.EnumMember(Value = "hangul")] + Hangul, + [System.Runtime.Serialization.EnumMember(Value = "hiragana")] + Hiragana, + [System.Runtime.Serialization.EnumMember(Value = "katakana")] + Katakana +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkBigramTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkBigramTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..b0df79302d1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkBigramTokenFilter.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class CjkBigramTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIgnoredScripts = System.Text.Json.JsonEncodedText.Encode("ignored_scripts"); + private static readonly System.Text.Json.JsonEncodedText PropOutputUnigrams = System.Text.Json.JsonEncodedText.Encode("output_unigrams"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propIgnoredScripts = default; + LocalJsonValue propOutputUnigrams = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIgnoredScripts.TryReadProperty(ref reader, options, PropIgnoredScripts, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propOutputUnigrams.TryReadProperty(ref reader, options, PropOutputUnigrams, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + IgnoredScripts = propIgnoredScripts.Value, + OutputUnigrams = propOutputUnigrams.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIgnoredScripts, value.IgnoredScripts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropOutputUnigrams, value.OutputUnigrams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkBigramTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkBigramTokenFilter.g.cs index 344a5d87c52..c51c13d5c82 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkBigramTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkBigramTokenFilter.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class CjkBigramTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIgnoredScripts = System.Text.Json.JsonEncodedText.Encode("ignored_scripts"); - private static readonly System.Text.Json.JsonEncodedText PropOutputUnigrams = System.Text.Json.JsonEncodedText.Encode("output_unigrams"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propIgnoredScripts = default; - LocalJsonValue propOutputUnigrams = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIgnoredScripts.TryReadProperty(ref reader, options, PropIgnoredScripts, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propOutputUnigrams.TryReadProperty(ref reader, options, PropOutputUnigrams, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - IgnoredScripts = propIgnoredScripts.Value, - OutputUnigrams = propOutputUnigrams.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIgnoredScripts, value.IgnoredScripts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropOutputUnigrams, value.OutputUnigrams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.CjkBigramTokenFilterConverter))] public sealed partial class CjkBigramTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkWidthTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkWidthTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..450b5a03b5b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkWidthTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class CjkWidthTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkWidthTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkWidthTokenFilter.g.cs index a19848c4ab1..d8f4b2bc1a8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkWidthTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkWidthTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class CjkWidthTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.CjkWidthTokenFilterConverter))] public sealed partial class CjkWidthTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ClassicTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ClassicTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..3b9c7f30513 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ClassicTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class ClassicTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ClassicTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ClassicTokenFilter.g.cs index 04cc94440ad..9986eb0b32d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ClassicTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ClassicTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class ClassicTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.ClassicTokenFilterConverter))] public sealed partial class ClassicTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ClassicTokenizer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ClassicTokenizer.Converters.g.cs new file mode 100644 index 00000000000..5d590bc2688 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ClassicTokenizer.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class ClassicTokenizerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxTokenLength = System.Text.Json.JsonEncodedText.Encode("max_token_length"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.ClassicTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxTokenLength = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxTokenLength.TryReadProperty(ref reader, options, PropMaxTokenLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.ClassicTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxTokenLength = propMaxTokenLength.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ClassicTokenizer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxTokenLength, value.MaxTokenLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ClassicTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ClassicTokenizer.g.cs index 353bce02eb3..f6a21dde5a9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ClassicTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ClassicTokenizer.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class ClassicTokenizerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxTokenLength = System.Text.Json.JsonEncodedText.Encode("max_token_length"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.ClassicTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxTokenLength = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxTokenLength.TryReadProperty(ref reader, options, PropMaxTokenLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.ClassicTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxTokenLength = propMaxTokenLength.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ClassicTokenizer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxTokenLength, value.MaxTokenLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.ClassicTokenizerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.ClassicTokenizerConverter))] public sealed partial class ClassicTokenizer : Elastic.Clients.Elasticsearch.Analysis.ITokenizer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CommonGramsTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CommonGramsTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..4f5ad399304 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CommonGramsTokenFilter.Converters.g.cs @@ -0,0 +1,107 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class CommonGramsTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCommonWords = System.Text.Json.JsonEncodedText.Encode("common_words"); + private static readonly System.Text.Json.JsonEncodedText PropCommonWordsPath = System.Text.Json.JsonEncodedText.Encode("common_words_path"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreCase = System.Text.Json.JsonEncodedText.Encode("ignore_case"); + private static readonly System.Text.Json.JsonEncodedText PropQueryMode = System.Text.Json.JsonEncodedText.Encode("query_mode"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.CommonGramsTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propCommonWords = default; + LocalJsonValue propCommonWordsPath = default; + LocalJsonValue propIgnoreCase = default; + LocalJsonValue propQueryMode = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCommonWords.TryReadProperty(ref reader, options, PropCommonWords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propCommonWordsPath.TryReadProperty(ref reader, options, PropCommonWordsPath, null)) + { + continue; + } + + if (propIgnoreCase.TryReadProperty(ref reader, options, PropIgnoreCase, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryMode.TryReadProperty(ref reader, options, PropQueryMode, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.CommonGramsTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CommonWords = propCommonWords.Value, + CommonWordsPath = propCommonWordsPath.Value, + IgnoreCase = propIgnoreCase.Value, + QueryMode = propQueryMode.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CommonGramsTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCommonWords, value.CommonWords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCommonWordsPath, value.CommonWordsPath, null, null); + writer.WriteProperty(options, PropIgnoreCase, value.IgnoreCase, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryMode, value.QueryMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CommonGramsTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CommonGramsTokenFilter.g.cs index 1acc3186394..a44c51d0b20 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CommonGramsTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CommonGramsTokenFilter.g.cs @@ -23,90 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class CommonGramsTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCommonWords = System.Text.Json.JsonEncodedText.Encode("common_words"); - private static readonly System.Text.Json.JsonEncodedText PropCommonWordsPath = System.Text.Json.JsonEncodedText.Encode("common_words_path"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreCase = System.Text.Json.JsonEncodedText.Encode("ignore_case"); - private static readonly System.Text.Json.JsonEncodedText PropQueryMode = System.Text.Json.JsonEncodedText.Encode("query_mode"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.CommonGramsTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propCommonWords = default; - LocalJsonValue propCommonWordsPath = default; - LocalJsonValue propIgnoreCase = default; - LocalJsonValue propQueryMode = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCommonWords.TryReadProperty(ref reader, options, PropCommonWords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propCommonWordsPath.TryReadProperty(ref reader, options, PropCommonWordsPath, null)) - { - continue; - } - - if (propIgnoreCase.TryReadProperty(ref reader, options, PropIgnoreCase, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryMode.TryReadProperty(ref reader, options, PropQueryMode, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.CommonGramsTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CommonWords = propCommonWords.Value, - CommonWordsPath = propCommonWordsPath.Value, - IgnoreCase = propIgnoreCase.Value, - QueryMode = propQueryMode.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CommonGramsTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCommonWords, value.CommonWords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCommonWordsPath, value.CommonWordsPath, null, null); - writer.WriteProperty(options, PropIgnoreCase, value.IgnoreCase, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryMode, value.QueryMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.CommonGramsTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.CommonGramsTokenFilterConverter))] public sealed partial class CommonGramsTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ConditionTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ConditionTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..b20f5fc62e4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ConditionTokenFilter.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class ConditionTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.ConditionTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propFilter = default; + LocalJsonValue propScript = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.ConditionTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Filter = propFilter.Value, + Script = propScript.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ConditionTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ConditionTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ConditionTokenFilter.g.cs index 0c1b8cd96ea..a8c67833aa7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ConditionTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ConditionTokenFilter.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class ConditionTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.ConditionTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propFilter = default; - LocalJsonValue propScript = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.ConditionTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Filter = propFilter.Value, - Script = propScript.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ConditionTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.ConditionTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.ConditionTokenFilterConverter))] public sealed partial class ConditionTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CustomAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CustomAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..051861a86f0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CustomAnalyzer.Converters.g.cs @@ -0,0 +1,107 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class CustomAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCharFilter = System.Text.Json.JsonEncodedText.Encode("char_filter"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropPositionIncrementGap = System.Text.Json.JsonEncodedText.Encode("position_increment_gap"); + private static readonly System.Text.Json.JsonEncodedText PropPositionOffsetGap = System.Text.Json.JsonEncodedText.Encode("position_offset_gap"); + private static readonly System.Text.Json.JsonEncodedText PropTokenizer = System.Text.Json.JsonEncodedText.Encode("tokenizer"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.CustomAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propCharFilter = default; + LocalJsonValue?> propFilter = default; + LocalJsonValue propPositionIncrementGap = default; + LocalJsonValue propPositionOffsetGap = default; + LocalJsonValue propTokenizer = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCharFilter.TryReadProperty(ref reader, options, PropCharFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propPositionIncrementGap.TryReadProperty(ref reader, options, PropPositionIncrementGap, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPositionOffsetGap.TryReadProperty(ref reader, options, PropPositionOffsetGap, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTokenizer.TryReadProperty(ref reader, options, PropTokenizer, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.CustomAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CharFilter = propCharFilter.Value, + Filter = propFilter.Value, + PositionIncrementGap = propPositionIncrementGap.Value, + PositionOffsetGap = propPositionOffsetGap.Value, + Tokenizer = propTokenizer.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CustomAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCharFilter, value.CharFilter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPositionIncrementGap, value.PositionIncrementGap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPositionOffsetGap, value.PositionOffsetGap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTokenizer, value.Tokenizer, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CustomAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CustomAnalyzer.g.cs index 38292b123cf..a0e5d7dcc07 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CustomAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CustomAnalyzer.g.cs @@ -23,90 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class CustomAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCharFilter = System.Text.Json.JsonEncodedText.Encode("char_filter"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropPositionIncrementGap = System.Text.Json.JsonEncodedText.Encode("position_increment_gap"); - private static readonly System.Text.Json.JsonEncodedText PropPositionOffsetGap = System.Text.Json.JsonEncodedText.Encode("position_offset_gap"); - private static readonly System.Text.Json.JsonEncodedText PropTokenizer = System.Text.Json.JsonEncodedText.Encode("tokenizer"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.CustomAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propCharFilter = default; - LocalJsonValue?> propFilter = default; - LocalJsonValue propPositionIncrementGap = default; - LocalJsonValue propPositionOffsetGap = default; - LocalJsonValue propTokenizer = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCharFilter.TryReadProperty(ref reader, options, PropCharFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propPositionIncrementGap.TryReadProperty(ref reader, options, PropPositionIncrementGap, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPositionOffsetGap.TryReadProperty(ref reader, options, PropPositionOffsetGap, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTokenizer.TryReadProperty(ref reader, options, PropTokenizer, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.CustomAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CharFilter = propCharFilter.Value, - Filter = propFilter.Value, - PositionIncrementGap = propPositionIncrementGap.Value, - PositionOffsetGap = propPositionOffsetGap.Value, - Tokenizer = propTokenizer.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CustomAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCharFilter, value.CharFilter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPositionIncrementGap, value.PositionIncrementGap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPositionOffsetGap, value.PositionOffsetGap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTokenizer, value.Tokenizer, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.CustomAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.CustomAnalyzerConverter))] public sealed partial class CustomAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CustomNormalizer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CustomNormalizer.Converters.g.cs new file mode 100644 index 00000000000..c77e5ffb2c8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CustomNormalizer.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class CustomNormalizerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCharFilter = System.Text.Json.JsonEncodedText.Encode("char_filter"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.CustomNormalizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propCharFilter = default; + LocalJsonValue?> propFilter = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCharFilter.TryReadProperty(ref reader, options, PropCharFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.CustomNormalizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CharFilter = propCharFilter.Value, + Filter = propFilter.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CustomNormalizer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCharFilter, value.CharFilter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CustomNormalizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CustomNormalizer.g.cs index 6029c630f6a..b928ed43dfb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CustomNormalizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CustomNormalizer.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class CustomNormalizerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCharFilter = System.Text.Json.JsonEncodedText.Encode("char_filter"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.CustomNormalizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propCharFilter = default; - LocalJsonValue?> propFilter = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCharFilter.TryReadProperty(ref reader, options, PropCharFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.CustomNormalizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CharFilter = propCharFilter.Value, - Filter = propFilter.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CustomNormalizer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCharFilter, value.CharFilter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.CustomNormalizerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.CustomNormalizerConverter))] public sealed partial class CustomNormalizer : Elastic.Clients.Elasticsearch.Analysis.INormalizer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CzechAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CzechAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..3e8d65b967d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CzechAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class CzechAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.CzechAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.CzechAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CzechAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CzechAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CzechAnalyzer.g.cs index 716a20a2d5f..04747261ab6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CzechAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CzechAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class CzechAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.CzechAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.CzechAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CzechAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.CzechAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.CzechAnalyzerConverter))] public sealed partial class CzechAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CzechStemTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CzechStemTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..81ae310af91 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CzechStemTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class CzechStemTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.CzechStemTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.CzechStemTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CzechStemTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CzechStemTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CzechStemTokenFilter.g.cs index 76b622f98d5..5e143128163 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CzechStemTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CzechStemTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class CzechStemTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.CzechStemTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.CzechStemTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CzechStemTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.CzechStemTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.CzechStemTokenFilterConverter))] public sealed partial class CzechStemTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DanishAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DanishAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..08a5a9782a4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DanishAnalyzer.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class DanishAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.DanishAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.DanishAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.DanishAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DanishAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DanishAnalyzer.g.cs index e90faefe6a8..56653c1ad36 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DanishAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DanishAnalyzer.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class DanishAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.DanishAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.DanishAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.DanishAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.DanishAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.DanishAnalyzerConverter))] public sealed partial class DanishAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DecimalDigitTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DecimalDigitTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..36437bbceb8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DecimalDigitTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class DecimalDigitTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DecimalDigitTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DecimalDigitTokenFilter.g.cs index 9215467d75c..34f9ff3997e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DecimalDigitTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DecimalDigitTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class DecimalDigitTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.DecimalDigitTokenFilterConverter))] public sealed partial class DecimalDigitTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DelimitedPayloadEncoding.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DelimitedPayloadEncoding.Converters.g.cs new file mode 100644 index 00000000000..08b9c7464e6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DelimitedPayloadEncoding.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class DelimitedPayloadEncodingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberFloat = System.Text.Json.JsonEncodedText.Encode("float"); + private static readonly System.Text.Json.JsonEncodedText MemberIdentity = System.Text.Json.JsonEncodedText.Encode("identity"); + private static readonly System.Text.Json.JsonEncodedText MemberInteger = System.Text.Json.JsonEncodedText.Encode("int"); + + public override Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberFloat)) + { + return Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding.Float; + } + + if (reader.ValueTextEquals(MemberIdentity)) + { + return Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding.Identity; + } + + if (reader.ValueTextEquals(MemberInteger)) + { + return Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding.Integer; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberFloat.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding.Float; + } + + if (string.Equals(value, MemberIdentity.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding.Identity; + } + + if (string.Equals(value, MemberInteger.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding.Integer; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding.Float: + writer.WriteStringValue(MemberFloat); + break; + case Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding.Identity: + writer.WriteStringValue(MemberIdentity); + break; + case Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding.Integer: + writer.WriteStringValue(MemberInteger); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DelimitedPayloadEncoding.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DelimitedPayloadEncoding.g.cs new file mode 100644 index 00000000000..e0ad7dfbf20 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DelimitedPayloadEncoding.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.DelimitedPayloadEncodingConverter))] +public enum DelimitedPayloadEncoding +{ + [System.Runtime.Serialization.EnumMember(Value = "float")] + Float, + [System.Runtime.Serialization.EnumMember(Value = "identity")] + Identity, + [System.Runtime.Serialization.EnumMember(Value = "int")] + Integer +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DelimitedPayloadTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DelimitedPayloadTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..8e8fdfe5f32 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DelimitedPayloadTokenFilter.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class DelimitedPayloadTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDelimiter = System.Text.Json.JsonEncodedText.Encode("delimiter"); + private static readonly System.Text.Json.JsonEncodedText PropEncoding = System.Text.Json.JsonEncodedText.Encode("encoding"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDelimiter = default; + LocalJsonValue propEncoding = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDelimiter.TryReadProperty(ref reader, options, PropDelimiter, null)) + { + continue; + } + + if (propEncoding.TryReadProperty(ref reader, options, PropEncoding, static Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Delimiter = propDelimiter.Value, + Encoding = propEncoding.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDelimiter, value.Delimiter, null, null); + writer.WriteProperty(options, PropEncoding, value.Encoding, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DelimitedPayloadTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DelimitedPayloadTokenFilter.g.cs index d6be2f9523c..1b3e67fd571 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DelimitedPayloadTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DelimitedPayloadTokenFilter.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class DelimitedPayloadTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDelimiter = System.Text.Json.JsonEncodedText.Encode("delimiter"); - private static readonly System.Text.Json.JsonEncodedText PropEncoding = System.Text.Json.JsonEncodedText.Encode("encoding"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDelimiter = default; - LocalJsonValue propEncoding = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDelimiter.TryReadProperty(ref reader, options, PropDelimiter, null)) - { - continue; - } - - if (propEncoding.TryReadProperty(ref reader, options, PropEncoding, static Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Delimiter = propDelimiter.Value, - Encoding = propEncoding.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDelimiter, value.Delimiter, null, null); - writer.WriteProperty(options, PropEncoding, value.Encoding, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.DelimitedPayloadTokenFilterConverter))] public sealed partial class DelimitedPayloadTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DictionaryDecompounderTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DictionaryDecompounderTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..4e28f6ef5cd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DictionaryDecompounderTokenFilter.Converters.g.cs @@ -0,0 +1,125 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class DictionaryDecompounderTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxSubwordSize = System.Text.Json.JsonEncodedText.Encode("max_subword_size"); + private static readonly System.Text.Json.JsonEncodedText PropMinSubwordSize = System.Text.Json.JsonEncodedText.Encode("min_subword_size"); + private static readonly System.Text.Json.JsonEncodedText PropMinWordSize = System.Text.Json.JsonEncodedText.Encode("min_word_size"); + private static readonly System.Text.Json.JsonEncodedText PropOnlyLongestMatch = System.Text.Json.JsonEncodedText.Encode("only_longest_match"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + private static readonly System.Text.Json.JsonEncodedText PropWordList = System.Text.Json.JsonEncodedText.Encode("word_list"); + private static readonly System.Text.Json.JsonEncodedText PropWordListPath = System.Text.Json.JsonEncodedText.Encode("word_list_path"); + + public override Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxSubwordSize = default; + LocalJsonValue propMinSubwordSize = default; + LocalJsonValue propMinWordSize = default; + LocalJsonValue propOnlyLongestMatch = default; + LocalJsonValue propVersion = default; + LocalJsonValue?> propWordList = default; + LocalJsonValue propWordListPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxSubwordSize.TryReadProperty(ref reader, options, PropMaxSubwordSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinSubwordSize.TryReadProperty(ref reader, options, PropMinSubwordSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinWordSize.TryReadProperty(ref reader, options, PropMinWordSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnlyLongestMatch.TryReadProperty(ref reader, options, PropOnlyLongestMatch, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (propWordList.TryReadProperty(ref reader, options, PropWordList, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propWordListPath.TryReadProperty(ref reader, options, PropWordListPath, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxSubwordSize = propMaxSubwordSize.Value, + MinSubwordSize = propMinSubwordSize.Value, + MinWordSize = propMinWordSize.Value, + OnlyLongestMatch = propOnlyLongestMatch.Value, + Version = propVersion.Value, + WordList = propWordList.Value, + WordListPath = propWordListPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxSubwordSize, value.MaxSubwordSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinSubwordSize, value.MinSubwordSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinWordSize, value.MinWordSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnlyLongestMatch, value.OnlyLongestMatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteProperty(options, PropWordList, value.WordList, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropWordListPath, value.WordListPath, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DictionaryDecompounderTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DictionaryDecompounderTokenFilter.g.cs index 8060f3042ea..d567494e22a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DictionaryDecompounderTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DictionaryDecompounderTokenFilter.g.cs @@ -23,108 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class DictionaryDecompounderTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxSubwordSize = System.Text.Json.JsonEncodedText.Encode("max_subword_size"); - private static readonly System.Text.Json.JsonEncodedText PropMinSubwordSize = System.Text.Json.JsonEncodedText.Encode("min_subword_size"); - private static readonly System.Text.Json.JsonEncodedText PropMinWordSize = System.Text.Json.JsonEncodedText.Encode("min_word_size"); - private static readonly System.Text.Json.JsonEncodedText PropOnlyLongestMatch = System.Text.Json.JsonEncodedText.Encode("only_longest_match"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - private static readonly System.Text.Json.JsonEncodedText PropWordList = System.Text.Json.JsonEncodedText.Encode("word_list"); - private static readonly System.Text.Json.JsonEncodedText PropWordListPath = System.Text.Json.JsonEncodedText.Encode("word_list_path"); - - public override Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxSubwordSize = default; - LocalJsonValue propMinSubwordSize = default; - LocalJsonValue propMinWordSize = default; - LocalJsonValue propOnlyLongestMatch = default; - LocalJsonValue propVersion = default; - LocalJsonValue?> propWordList = default; - LocalJsonValue propWordListPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxSubwordSize.TryReadProperty(ref reader, options, PropMaxSubwordSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinSubwordSize.TryReadProperty(ref reader, options, PropMinSubwordSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinWordSize.TryReadProperty(ref reader, options, PropMinWordSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnlyLongestMatch.TryReadProperty(ref reader, options, PropOnlyLongestMatch, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (propWordList.TryReadProperty(ref reader, options, PropWordList, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propWordListPath.TryReadProperty(ref reader, options, PropWordListPath, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxSubwordSize = propMaxSubwordSize.Value, - MinSubwordSize = propMinSubwordSize.Value, - MinWordSize = propMinWordSize.Value, - OnlyLongestMatch = propOnlyLongestMatch.Value, - Version = propVersion.Value, - WordList = propWordList.Value, - WordListPath = propWordListPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxSubwordSize, value.MaxSubwordSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinSubwordSize, value.MinSubwordSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinWordSize, value.MinWordSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnlyLongestMatch, value.OnlyLongestMatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteProperty(options, PropWordList, value.WordList, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropWordListPath, value.WordListPath, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.DictionaryDecompounderTokenFilterConverter))] public sealed partial class DictionaryDecompounderTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DutchAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DutchAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..ca3d2ec678b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DutchAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class DutchAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.DutchAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.DutchAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.DutchAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DutchAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DutchAnalyzer.g.cs index 60a66c863e8..28b1b75a353 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DutchAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DutchAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class DutchAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.DutchAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.DutchAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.DutchAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.DutchAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.DutchAnalyzerConverter))] public sealed partial class DutchAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DutchStemTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DutchStemTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..21e13ee9279 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DutchStemTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class DutchStemTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.DutchStemTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.DutchStemTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.DutchStemTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DutchStemTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DutchStemTokenFilter.g.cs index 7575a5d5708..f43e923e196 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DutchStemTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DutchStemTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class DutchStemTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.DutchStemTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.DutchStemTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.DutchStemTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.DutchStemTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.DutchStemTokenFilterConverter))] public sealed partial class DutchStemTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramSide.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramSide.Converters.g.cs new file mode 100644 index 00000000000..477147d99f1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramSide.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class EdgeNGramSideConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberBack = System.Text.Json.JsonEncodedText.Encode("back"); + private static readonly System.Text.Json.JsonEncodedText MemberFront = System.Text.Json.JsonEncodedText.Encode("front"); + + public override Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberBack)) + { + return Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide.Back; + } + + if (reader.ValueTextEquals(MemberFront)) + { + return Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide.Front; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberBack.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide.Back; + } + + if (string.Equals(value, MemberFront.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide.Front; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide.Back: + writer.WriteStringValue(MemberBack); + break; + case Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide.Front: + writer.WriteStringValue(MemberFront); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramSide.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramSide.g.cs new file mode 100644 index 00000000000..b0b9cc4431e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramSide.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.EdgeNGramSideConverter))] +public enum EdgeNGramSide +{ + [System.Runtime.Serialization.EnumMember(Value = "back")] + Back, + [System.Runtime.Serialization.EnumMember(Value = "front")] + Front +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..71a51dbd89d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenFilter.Converters.g.cs @@ -0,0 +1,107 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class EdgeNGramTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxGram = System.Text.Json.JsonEncodedText.Encode("max_gram"); + private static readonly System.Text.Json.JsonEncodedText PropMinGram = System.Text.Json.JsonEncodedText.Encode("min_gram"); + private static readonly System.Text.Json.JsonEncodedText PropPreserveOriginal = System.Text.Json.JsonEncodedText.Encode("preserve_original"); + private static readonly System.Text.Json.JsonEncodedText PropSide = System.Text.Json.JsonEncodedText.Encode("side"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxGram = default; + LocalJsonValue propMinGram = default; + LocalJsonValue propPreserveOriginal = default; + LocalJsonValue propSide = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxGram.TryReadProperty(ref reader, options, PropMaxGram, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinGram.TryReadProperty(ref reader, options, PropMinGram, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPreserveOriginal.TryReadProperty(ref reader, options, PropPreserveOriginal, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSide.TryReadProperty(ref reader, options, PropSide, static Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxGram = propMaxGram.Value, + MinGram = propMinGram.Value, + PreserveOriginal = propPreserveOriginal.Value, + Side = propSide.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxGram, value.MaxGram, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinGram, value.MinGram, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPreserveOriginal, value.PreserveOriginal, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSide, value.Side, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenFilter.g.cs index a4004af4c26..0182066b4c4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenFilter.g.cs @@ -23,90 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class EdgeNGramTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxGram = System.Text.Json.JsonEncodedText.Encode("max_gram"); - private static readonly System.Text.Json.JsonEncodedText PropMinGram = System.Text.Json.JsonEncodedText.Encode("min_gram"); - private static readonly System.Text.Json.JsonEncodedText PropPreserveOriginal = System.Text.Json.JsonEncodedText.Encode("preserve_original"); - private static readonly System.Text.Json.JsonEncodedText PropSide = System.Text.Json.JsonEncodedText.Encode("side"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxGram = default; - LocalJsonValue propMinGram = default; - LocalJsonValue propPreserveOriginal = default; - LocalJsonValue propSide = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxGram.TryReadProperty(ref reader, options, PropMaxGram, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinGram.TryReadProperty(ref reader, options, PropMinGram, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPreserveOriginal.TryReadProperty(ref reader, options, PropPreserveOriginal, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSide.TryReadProperty(ref reader, options, PropSide, static Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxGram = propMaxGram.Value, - MinGram = propMinGram.Value, - PreserveOriginal = propPreserveOriginal.Value, - Side = propSide.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxGram, value.MaxGram, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinGram, value.MinGram, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPreserveOriginal, value.PreserveOriginal, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSide, value.Side, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.EdgeNGramTokenFilterConverter))] public sealed partial class EdgeNGramTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenizer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenizer.Converters.g.cs new file mode 100644 index 00000000000..43487a85a7c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenizer.Converters.g.cs @@ -0,0 +1,107 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class EdgeNGramTokenizerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCustomTokenChars = System.Text.Json.JsonEncodedText.Encode("custom_token_chars"); + private static readonly System.Text.Json.JsonEncodedText PropMaxGram = System.Text.Json.JsonEncodedText.Encode("max_gram"); + private static readonly System.Text.Json.JsonEncodedText PropMinGram = System.Text.Json.JsonEncodedText.Encode("min_gram"); + private static readonly System.Text.Json.JsonEncodedText PropTokenChars = System.Text.Json.JsonEncodedText.Encode("token_chars"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCustomTokenChars = default; + LocalJsonValue propMaxGram = default; + LocalJsonValue propMinGram = default; + LocalJsonValue?> propTokenChars = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCustomTokenChars.TryReadProperty(ref reader, options, PropCustomTokenChars, null)) + { + continue; + } + + if (propMaxGram.TryReadProperty(ref reader, options, PropMaxGram, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinGram.TryReadProperty(ref reader, options, PropMinGram, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTokenChars.TryReadProperty(ref reader, options, PropTokenChars, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CustomTokenChars = propCustomTokenChars.Value, + MaxGram = propMaxGram.Value, + MinGram = propMinGram.Value, + TokenChars = propTokenChars.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenizer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCustomTokenChars, value.CustomTokenChars, null, null); + writer.WriteProperty(options, PropMaxGram, value.MaxGram, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinGram, value.MinGram, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTokenChars, value.TokenChars, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenizer.g.cs index 848f134f92c..b0c604fbc9b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenizer.g.cs @@ -23,90 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class EdgeNGramTokenizerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCustomTokenChars = System.Text.Json.JsonEncodedText.Encode("custom_token_chars"); - private static readonly System.Text.Json.JsonEncodedText PropMaxGram = System.Text.Json.JsonEncodedText.Encode("max_gram"); - private static readonly System.Text.Json.JsonEncodedText PropMinGram = System.Text.Json.JsonEncodedText.Encode("min_gram"); - private static readonly System.Text.Json.JsonEncodedText PropTokenChars = System.Text.Json.JsonEncodedText.Encode("token_chars"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCustomTokenChars = default; - LocalJsonValue propMaxGram = default; - LocalJsonValue propMinGram = default; - LocalJsonValue?> propTokenChars = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCustomTokenChars.TryReadProperty(ref reader, options, PropCustomTokenChars, null)) - { - continue; - } - - if (propMaxGram.TryReadProperty(ref reader, options, PropMaxGram, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinGram.TryReadProperty(ref reader, options, PropMinGram, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTokenChars.TryReadProperty(ref reader, options, PropTokenChars, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CustomTokenChars = propCustomTokenChars.Value, - MaxGram = propMaxGram.Value, - MinGram = propMinGram.Value, - TokenChars = propTokenChars.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenizer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCustomTokenChars, value.CustomTokenChars, null, null); - writer.WriteProperty(options, PropMaxGram, value.MaxGram, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinGram, value.MinGram, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTokenChars, value.TokenChars, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenizerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.EdgeNGramTokenizerConverter))] public sealed partial class EdgeNGramTokenizer : Elastic.Clients.Elasticsearch.Analysis.ITokenizer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ElisionTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ElisionTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..6f5549eb727 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ElisionTokenFilter.Converters.g.cs @@ -0,0 +1,98 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class ElisionTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropArticles = System.Text.Json.JsonEncodedText.Encode("articles"); + private static readonly System.Text.Json.JsonEncodedText PropArticlesCase = System.Text.Json.JsonEncodedText.Encode("articles_case"); + private static readonly System.Text.Json.JsonEncodedText PropArticlesPath = System.Text.Json.JsonEncodedText.Encode("articles_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.ElisionTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propArticles = default; + LocalJsonValue propArticlesCase = default; + LocalJsonValue propArticlesPath = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propArticles.TryReadProperty(ref reader, options, PropArticles, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propArticlesCase.TryReadProperty(ref reader, options, PropArticlesCase, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propArticlesPath.TryReadProperty(ref reader, options, PropArticlesPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.ElisionTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Articles = propArticles.Value, + ArticlesCase = propArticlesCase.Value, + ArticlesPath = propArticlesPath.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ElisionTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropArticles, value.Articles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropArticlesCase, value.ArticlesCase, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropArticlesPath, value.ArticlesPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ElisionTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ElisionTokenFilter.g.cs index e9c2b257854..addd04aef08 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ElisionTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ElisionTokenFilter.g.cs @@ -23,81 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class ElisionTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropArticles = System.Text.Json.JsonEncodedText.Encode("articles"); - private static readonly System.Text.Json.JsonEncodedText PropArticlesCase = System.Text.Json.JsonEncodedText.Encode("articles_case"); - private static readonly System.Text.Json.JsonEncodedText PropArticlesPath = System.Text.Json.JsonEncodedText.Encode("articles_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.ElisionTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propArticles = default; - LocalJsonValue propArticlesCase = default; - LocalJsonValue propArticlesPath = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propArticles.TryReadProperty(ref reader, options, PropArticles, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propArticlesCase.TryReadProperty(ref reader, options, PropArticlesCase, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propArticlesPath.TryReadProperty(ref reader, options, PropArticlesPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.ElisionTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Articles = propArticles.Value, - ArticlesCase = propArticlesCase.Value, - ArticlesPath = propArticlesPath.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ElisionTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropArticles, value.Articles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropArticlesCase, value.ArticlesCase, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropArticlesPath, value.ArticlesPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.ElisionTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.ElisionTokenFilterConverter))] public sealed partial class ElisionTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EnglishAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EnglishAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..887a93d4b65 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EnglishAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class EnglishAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.EnglishAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.EnglishAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.EnglishAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EnglishAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EnglishAnalyzer.g.cs index 6d9df6980a1..93b78d60748 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EnglishAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EnglishAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class EnglishAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.EnglishAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.EnglishAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.EnglishAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.EnglishAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.EnglishAnalyzerConverter))] public sealed partial class EnglishAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EstonianAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EstonianAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..42ed269ac71 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EstonianAnalyzer.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class EstonianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.EstonianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.EstonianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.EstonianAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EstonianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EstonianAnalyzer.g.cs index 09c3993afe8..73a5a35cbcc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EstonianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EstonianAnalyzer.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class EstonianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.EstonianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.EstonianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.EstonianAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.EstonianAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.EstonianAnalyzerConverter))] public sealed partial class EstonianAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..07a5b7f4d92 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintAnalyzer.Converters.g.cs @@ -0,0 +1,112 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class FingerprintAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxOutputSize = System.Text.Json.JsonEncodedText.Encode("max_output_size"); + private static readonly System.Text.Json.JsonEncodedText PropSeparator = System.Text.Json.JsonEncodedText.Encode("separator"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.FingerprintAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxOutputSize = default; + LocalJsonValue propSeparator = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxOutputSize.TryReadProperty(ref reader, options, PropMaxOutputSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSeparator.TryReadProperty(ref reader, options, PropSeparator, null)) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.FingerprintAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxOutputSize = propMaxOutputSize.Value, + Separator = propSeparator.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value, +#pragma warning disable CS0618 + Version = propVersion.Value +#pragma warning restore CS0618 + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.FingerprintAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxOutputSize, value.MaxOutputSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSeparator, value.Separator, null, null); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); +#pragma warning disable CS0618 + writer.WriteProperty(options, PropVersion, value.Version, null, null) +#pragma warning restore CS0618 + ; + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintAnalyzer.g.cs index 9fb8028f144..426200d80bb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintAnalyzer.g.cs @@ -23,95 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class FingerprintAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxOutputSize = System.Text.Json.JsonEncodedText.Encode("max_output_size"); - private static readonly System.Text.Json.JsonEncodedText PropSeparator = System.Text.Json.JsonEncodedText.Encode("separator"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.FingerprintAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxOutputSize = default; - LocalJsonValue propSeparator = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxOutputSize.TryReadProperty(ref reader, options, PropMaxOutputSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSeparator.TryReadProperty(ref reader, options, PropSeparator, null)) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.FingerprintAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxOutputSize = propMaxOutputSize.Value, - Separator = propSeparator.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value, -#pragma warning disable CS0618 - Version = propVersion.Value -#pragma warning restore CS0618 - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.FingerprintAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxOutputSize, value.MaxOutputSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSeparator, value.Separator, null, null); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); -#pragma warning disable CS0618 - writer.WriteProperty(options, PropVersion, value.Version, null, null) -#pragma warning restore CS0618 - ; - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.FingerprintAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.FingerprintAnalyzerConverter))] public sealed partial class FingerprintAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..b03d7d89478 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintTokenFilter.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class FingerprintTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxOutputSize = System.Text.Json.JsonEncodedText.Encode("max_output_size"); + private static readonly System.Text.Json.JsonEncodedText PropSeparator = System.Text.Json.JsonEncodedText.Encode("separator"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.FingerprintTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxOutputSize = default; + LocalJsonValue propSeparator = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxOutputSize.TryReadProperty(ref reader, options, PropMaxOutputSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSeparator.TryReadProperty(ref reader, options, PropSeparator, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.FingerprintTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxOutputSize = propMaxOutputSize.Value, + Separator = propSeparator.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.FingerprintTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxOutputSize, value.MaxOutputSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSeparator, value.Separator, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintTokenFilter.g.cs index 00ab377a34c..61d98387096 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintTokenFilter.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class FingerprintTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxOutputSize = System.Text.Json.JsonEncodedText.Encode("max_output_size"); - private static readonly System.Text.Json.JsonEncodedText PropSeparator = System.Text.Json.JsonEncodedText.Encode("separator"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.FingerprintTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxOutputSize = default; - LocalJsonValue propSeparator = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxOutputSize.TryReadProperty(ref reader, options, PropMaxOutputSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSeparator.TryReadProperty(ref reader, options, PropSeparator, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.FingerprintTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxOutputSize = propMaxOutputSize.Value, - Separator = propSeparator.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.FingerprintTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxOutputSize, value.MaxOutputSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSeparator, value.Separator, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.FingerprintTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.FingerprintTokenFilterConverter))] public sealed partial class FingerprintTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FinnishAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FinnishAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..8067ee89b7f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FinnishAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class FinnishAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.FinnishAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.FinnishAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.FinnishAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FinnishAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FinnishAnalyzer.g.cs index d8982dd30d9..0db5adb9ef1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FinnishAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FinnishAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class FinnishAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.FinnishAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.FinnishAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.FinnishAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.FinnishAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.FinnishAnalyzerConverter))] public sealed partial class FinnishAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FlattenGraphTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FlattenGraphTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..0e072c9fd68 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FlattenGraphTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class FlattenGraphTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FlattenGraphTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FlattenGraphTokenFilter.g.cs index d522c9ad8a3..302911e3cfe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FlattenGraphTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FlattenGraphTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class FlattenGraphTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.FlattenGraphTokenFilterConverter))] public sealed partial class FlattenGraphTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FrenchAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FrenchAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..1961b60a10d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FrenchAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class FrenchAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.FrenchAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.FrenchAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.FrenchAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FrenchAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FrenchAnalyzer.g.cs index b5b08bacf0f..25bccb0ae09 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FrenchAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FrenchAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class FrenchAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.FrenchAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.FrenchAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.FrenchAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.FrenchAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.FrenchAnalyzerConverter))] public sealed partial class FrenchAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FrenchStemTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FrenchStemTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..14de65ba423 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FrenchStemTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class FrenchStemTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.FrenchStemTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.FrenchStemTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.FrenchStemTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FrenchStemTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FrenchStemTokenFilter.g.cs index 1e13477ea82..241392cdad7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FrenchStemTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FrenchStemTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class FrenchStemTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.FrenchStemTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.FrenchStemTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.FrenchStemTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.FrenchStemTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.FrenchStemTokenFilterConverter))] public sealed partial class FrenchStemTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GalicianAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GalicianAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..4a5f1ccdadd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GalicianAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class GalicianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.GalicianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.GalicianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.GalicianAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GalicianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GalicianAnalyzer.g.cs index 18df0c1850c..bc3ab65d03e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GalicianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GalicianAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class GalicianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.GalicianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.GalicianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.GalicianAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.GalicianAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.GalicianAnalyzerConverter))] public sealed partial class GalicianAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..2db3b381f5a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class GermanAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.GermanAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.GermanAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.GermanAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanAnalyzer.g.cs index fa87c243d35..a6ddbab502e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class GermanAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.GermanAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.GermanAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.GermanAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.GermanAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.GermanAnalyzerConverter))] public sealed partial class GermanAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanNormalizationTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanNormalizationTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..0827c1e9cc3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanNormalizationTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class GermanNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanNormalizationTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanNormalizationTokenFilter.g.cs index 28f532a6b3f..7d1636b9d02 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanNormalizationTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanNormalizationTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class GermanNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.GermanNormalizationTokenFilterConverter))] public sealed partial class GermanNormalizationTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanStemTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanStemTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..e1691dc24c6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanStemTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class GermanStemTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.GermanStemTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.GermanStemTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.GermanStemTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanStemTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanStemTokenFilter.g.cs index fca2e43f404..6017fdc91d6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanStemTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanStemTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class GermanStemTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.GermanStemTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.GermanStemTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.GermanStemTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.GermanStemTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.GermanStemTokenFilterConverter))] public sealed partial class GermanStemTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GreekAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GreekAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..f72e24d4db3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GreekAnalyzer.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class GreekAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.GreekAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.GreekAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.GreekAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GreekAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GreekAnalyzer.g.cs index 39782e1f0b8..14d2264ae65 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GreekAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GreekAnalyzer.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class GreekAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.GreekAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.GreekAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.GreekAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.GreekAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.GreekAnalyzerConverter))] public sealed partial class GreekAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HindiAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HindiAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..674fd0560fa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HindiAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class HindiAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.HindiAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.HindiAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.HindiAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HindiAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HindiAnalyzer.g.cs index e0832e8ec42..1b212b3462e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HindiAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HindiAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class HindiAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.HindiAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.HindiAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.HindiAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.HindiAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.HindiAnalyzerConverter))] public sealed partial class HindiAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HindiNormalizationTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HindiNormalizationTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..b525fbf3223 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HindiNormalizationTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class HindiNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HindiNormalizationTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HindiNormalizationTokenFilter.g.cs index 0caac9c381f..d6e3bd1655e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HindiNormalizationTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HindiNormalizationTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class HindiNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.HindiNormalizationTokenFilterConverter))] public sealed partial class HindiNormalizationTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HtmlStripCharFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HtmlStripCharFilter.Converters.g.cs new file mode 100644 index 00000000000..20c0262b4aa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HtmlStripCharFilter.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class HtmlStripCharFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEscapedTags = System.Text.Json.JsonEncodedText.Encode("escaped_tags"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.HtmlStripCharFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propEscapedTags = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEscapedTags.TryReadProperty(ref reader, options, PropEscapedTags, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.HtmlStripCharFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + EscapedTags = propEscapedTags.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.HtmlStripCharFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEscapedTags, value.EscapedTags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HtmlStripCharFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HtmlStripCharFilter.g.cs index 13d78139f75..a73fd51ecc9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HtmlStripCharFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HtmlStripCharFilter.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class HtmlStripCharFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEscapedTags = System.Text.Json.JsonEncodedText.Encode("escaped_tags"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.HtmlStripCharFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propEscapedTags = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEscapedTags.TryReadProperty(ref reader, options, PropEscapedTags, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.HtmlStripCharFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - EscapedTags = propEscapedTags.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.HtmlStripCharFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEscapedTags, value.EscapedTags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.HtmlStripCharFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.HtmlStripCharFilterConverter))] public sealed partial class HtmlStripCharFilter : Elastic.Clients.Elasticsearch.Analysis.ICharFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HungarianAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HungarianAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..8df533c7c2a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HungarianAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class HungarianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.HungarianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.HungarianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.HungarianAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HungarianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HungarianAnalyzer.g.cs index b762535c211..b0316def14c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HungarianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HungarianAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class HungarianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.HungarianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.HungarianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.HungarianAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.HungarianAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.HungarianAnalyzerConverter))] public sealed partial class HungarianAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HunspellTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HunspellTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..60d36efbf2d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HunspellTokenFilter.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class HunspellTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDedup = System.Text.Json.JsonEncodedText.Encode("dedup"); + private static readonly System.Text.Json.JsonEncodedText PropDictionary = System.Text.Json.JsonEncodedText.Encode("dictionary"); + private static readonly System.Text.Json.JsonEncodedText PropLocale = System.Text.Json.JsonEncodedText.Encode("locale"); + private static readonly System.Text.Json.JsonEncodedText PropLocale1 = System.Text.Json.JsonEncodedText.Encode("lang"); + private static readonly System.Text.Json.JsonEncodedText PropLocale2 = System.Text.Json.JsonEncodedText.Encode("language"); + private static readonly System.Text.Json.JsonEncodedText PropLongestOnly = System.Text.Json.JsonEncodedText.Encode("longest_only"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.HunspellTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDedup = default; + LocalJsonValue propDictionary = default; + LocalJsonValue propLocale = default; + LocalJsonValue propLongestOnly = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDedup.TryReadProperty(ref reader, options, PropDedup, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDictionary.TryReadProperty(ref reader, options, PropDictionary, null)) + { + continue; + } + + if (propLocale.TryReadProperty(ref reader, options, PropLocale, null) || propLocale.TryReadProperty(ref reader, options, PropLocale1, null) || propLocale.TryReadProperty(ref reader, options, PropLocale2, null)) + { + continue; + } + + if (propLongestOnly.TryReadProperty(ref reader, options, PropLongestOnly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.HunspellTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Dedup = propDedup.Value, + Dictionary = propDictionary.Value, + Locale = propLocale.Value, + LongestOnly = propLongestOnly.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.HunspellTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDedup, value.Dedup, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDictionary, value.Dictionary, null, null); + writer.WriteProperty(options, PropLocale, value.Locale, null, null); + writer.WriteProperty(options, PropLongestOnly, value.LongestOnly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HunspellTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HunspellTokenFilter.g.cs index 6bea2b928d4..22eef111a6c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HunspellTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HunspellTokenFilter.g.cs @@ -23,92 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class HunspellTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDedup = System.Text.Json.JsonEncodedText.Encode("dedup"); - private static readonly System.Text.Json.JsonEncodedText PropDictionary = System.Text.Json.JsonEncodedText.Encode("dictionary"); - private static readonly System.Text.Json.JsonEncodedText PropLocale = System.Text.Json.JsonEncodedText.Encode("locale"); - private static readonly System.Text.Json.JsonEncodedText PropLocale1 = System.Text.Json.JsonEncodedText.Encode("lang"); - private static readonly System.Text.Json.JsonEncodedText PropLocale2 = System.Text.Json.JsonEncodedText.Encode("language"); - private static readonly System.Text.Json.JsonEncodedText PropLongestOnly = System.Text.Json.JsonEncodedText.Encode("longest_only"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.HunspellTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDedup = default; - LocalJsonValue propDictionary = default; - LocalJsonValue propLocale = default; - LocalJsonValue propLongestOnly = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDedup.TryReadProperty(ref reader, options, PropDedup, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDictionary.TryReadProperty(ref reader, options, PropDictionary, null)) - { - continue; - } - - if (propLocale.TryReadProperty(ref reader, options, PropLocale, null) || propLocale.TryReadProperty(ref reader, options, PropLocale1, null) || propLocale.TryReadProperty(ref reader, options, PropLocale2, null)) - { - continue; - } - - if (propLongestOnly.TryReadProperty(ref reader, options, PropLongestOnly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.HunspellTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Dedup = propDedup.Value, - Dictionary = propDictionary.Value, - Locale = propLocale.Value, - LongestOnly = propLongestOnly.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.HunspellTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDedup, value.Dedup, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDictionary, value.Dictionary, null, null); - writer.WriteProperty(options, PropLocale, value.Locale, null, null); - writer.WriteProperty(options, PropLongestOnly, value.LongestOnly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.HunspellTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.HunspellTokenFilterConverter))] public sealed partial class HunspellTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HyphenationDecompounderTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HyphenationDecompounderTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..3207e401e88 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HyphenationDecompounderTokenFilter.Converters.g.cs @@ -0,0 +1,152 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class HyphenationDecompounderTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropHyphenationPatternsPath = System.Text.Json.JsonEncodedText.Encode("hyphenation_patterns_path"); + private static readonly System.Text.Json.JsonEncodedText PropMaxSubwordSize = System.Text.Json.JsonEncodedText.Encode("max_subword_size"); + private static readonly System.Text.Json.JsonEncodedText PropMinSubwordSize = System.Text.Json.JsonEncodedText.Encode("min_subword_size"); + private static readonly System.Text.Json.JsonEncodedText PropMinWordSize = System.Text.Json.JsonEncodedText.Encode("min_word_size"); + private static readonly System.Text.Json.JsonEncodedText PropNoOverlappingMatches = System.Text.Json.JsonEncodedText.Encode("no_overlapping_matches"); + private static readonly System.Text.Json.JsonEncodedText PropNoSubMatches = System.Text.Json.JsonEncodedText.Encode("no_sub_matches"); + private static readonly System.Text.Json.JsonEncodedText PropOnlyLongestMatch = System.Text.Json.JsonEncodedText.Encode("only_longest_match"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + private static readonly System.Text.Json.JsonEncodedText PropWordList = System.Text.Json.JsonEncodedText.Encode("word_list"); + private static readonly System.Text.Json.JsonEncodedText PropWordListPath = System.Text.Json.JsonEncodedText.Encode("word_list_path"); + + public override Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propHyphenationPatternsPath = default; + LocalJsonValue propMaxSubwordSize = default; + LocalJsonValue propMinSubwordSize = default; + LocalJsonValue propMinWordSize = default; + LocalJsonValue propNoOverlappingMatches = default; + LocalJsonValue propNoSubMatches = default; + LocalJsonValue propOnlyLongestMatch = default; + LocalJsonValue propVersion = default; + LocalJsonValue?> propWordList = default; + LocalJsonValue propWordListPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propHyphenationPatternsPath.TryReadProperty(ref reader, options, PropHyphenationPatternsPath, null)) + { + continue; + } + + if (propMaxSubwordSize.TryReadProperty(ref reader, options, PropMaxSubwordSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinSubwordSize.TryReadProperty(ref reader, options, PropMinSubwordSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinWordSize.TryReadProperty(ref reader, options, PropMinWordSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNoOverlappingMatches.TryReadProperty(ref reader, options, PropNoOverlappingMatches, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNoSubMatches.TryReadProperty(ref reader, options, PropNoSubMatches, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnlyLongestMatch.TryReadProperty(ref reader, options, PropOnlyLongestMatch, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (propWordList.TryReadProperty(ref reader, options, PropWordList, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propWordListPath.TryReadProperty(ref reader, options, PropWordListPath, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + HyphenationPatternsPath = propHyphenationPatternsPath.Value, + MaxSubwordSize = propMaxSubwordSize.Value, + MinSubwordSize = propMinSubwordSize.Value, + MinWordSize = propMinWordSize.Value, + NoOverlappingMatches = propNoOverlappingMatches.Value, + NoSubMatches = propNoSubMatches.Value, + OnlyLongestMatch = propOnlyLongestMatch.Value, + Version = propVersion.Value, + WordList = propWordList.Value, + WordListPath = propWordListPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropHyphenationPatternsPath, value.HyphenationPatternsPath, null, null); + writer.WriteProperty(options, PropMaxSubwordSize, value.MaxSubwordSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinSubwordSize, value.MinSubwordSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinWordSize, value.MinWordSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNoOverlappingMatches, value.NoOverlappingMatches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNoSubMatches, value.NoSubMatches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnlyLongestMatch, value.OnlyLongestMatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteProperty(options, PropWordList, value.WordList, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropWordListPath, value.WordListPath, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HyphenationDecompounderTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HyphenationDecompounderTokenFilter.g.cs index 8b58e336627..885ce9a2e08 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HyphenationDecompounderTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HyphenationDecompounderTokenFilter.g.cs @@ -23,135 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class HyphenationDecompounderTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropHyphenationPatternsPath = System.Text.Json.JsonEncodedText.Encode("hyphenation_patterns_path"); - private static readonly System.Text.Json.JsonEncodedText PropMaxSubwordSize = System.Text.Json.JsonEncodedText.Encode("max_subword_size"); - private static readonly System.Text.Json.JsonEncodedText PropMinSubwordSize = System.Text.Json.JsonEncodedText.Encode("min_subword_size"); - private static readonly System.Text.Json.JsonEncodedText PropMinWordSize = System.Text.Json.JsonEncodedText.Encode("min_word_size"); - private static readonly System.Text.Json.JsonEncodedText PropNoOverlappingMatches = System.Text.Json.JsonEncodedText.Encode("no_overlapping_matches"); - private static readonly System.Text.Json.JsonEncodedText PropNoSubMatches = System.Text.Json.JsonEncodedText.Encode("no_sub_matches"); - private static readonly System.Text.Json.JsonEncodedText PropOnlyLongestMatch = System.Text.Json.JsonEncodedText.Encode("only_longest_match"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - private static readonly System.Text.Json.JsonEncodedText PropWordList = System.Text.Json.JsonEncodedText.Encode("word_list"); - private static readonly System.Text.Json.JsonEncodedText PropWordListPath = System.Text.Json.JsonEncodedText.Encode("word_list_path"); - - public override Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propHyphenationPatternsPath = default; - LocalJsonValue propMaxSubwordSize = default; - LocalJsonValue propMinSubwordSize = default; - LocalJsonValue propMinWordSize = default; - LocalJsonValue propNoOverlappingMatches = default; - LocalJsonValue propNoSubMatches = default; - LocalJsonValue propOnlyLongestMatch = default; - LocalJsonValue propVersion = default; - LocalJsonValue?> propWordList = default; - LocalJsonValue propWordListPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propHyphenationPatternsPath.TryReadProperty(ref reader, options, PropHyphenationPatternsPath, null)) - { - continue; - } - - if (propMaxSubwordSize.TryReadProperty(ref reader, options, PropMaxSubwordSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinSubwordSize.TryReadProperty(ref reader, options, PropMinSubwordSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinWordSize.TryReadProperty(ref reader, options, PropMinWordSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNoOverlappingMatches.TryReadProperty(ref reader, options, PropNoOverlappingMatches, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNoSubMatches.TryReadProperty(ref reader, options, PropNoSubMatches, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnlyLongestMatch.TryReadProperty(ref reader, options, PropOnlyLongestMatch, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (propWordList.TryReadProperty(ref reader, options, PropWordList, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propWordListPath.TryReadProperty(ref reader, options, PropWordListPath, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - HyphenationPatternsPath = propHyphenationPatternsPath.Value, - MaxSubwordSize = propMaxSubwordSize.Value, - MinSubwordSize = propMinSubwordSize.Value, - MinWordSize = propMinWordSize.Value, - NoOverlappingMatches = propNoOverlappingMatches.Value, - NoSubMatches = propNoSubMatches.Value, - OnlyLongestMatch = propOnlyLongestMatch.Value, - Version = propVersion.Value, - WordList = propWordList.Value, - WordListPath = propWordListPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropHyphenationPatternsPath, value.HyphenationPatternsPath, null, null); - writer.WriteProperty(options, PropMaxSubwordSize, value.MaxSubwordSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinSubwordSize, value.MinSubwordSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinWordSize, value.MinWordSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNoOverlappingMatches, value.NoOverlappingMatches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNoSubMatches, value.NoSubMatches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnlyLongestMatch, value.OnlyLongestMatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteProperty(options, PropWordList, value.WordList, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropWordListPath, value.WordListPath, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.HyphenationDecompounderTokenFilterConverter))] public sealed partial class HyphenationDecompounderTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..41fd976a817 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuAnalyzer.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class IcuAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMethod = System.Text.Json.JsonEncodedText.Encode("method"); + private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.IcuAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMethod = default; + LocalJsonValue propMode = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMethod.TryReadProperty(ref reader, options, PropMethod, null)) + { + continue; + } + + if (propMode.TryReadProperty(ref reader, options, PropMode, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.IcuAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Method = propMethod.Value, + Mode = propMode.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMethod, value.Method, null, null); + writer.WriteProperty(options, PropMode, value.Mode, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuAnalyzer.g.cs index 8dc4ab5afbc..4150f83550a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuAnalyzer.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class IcuAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMethod = System.Text.Json.JsonEncodedText.Encode("method"); - private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.IcuAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMethod = default; - LocalJsonValue propMode = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMethod.TryReadProperty(ref reader, options, PropMethod, null)) - { - continue; - } - - if (propMode.TryReadProperty(ref reader, options, PropMode, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.IcuAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Method = propMethod.Value, - Mode = propMode.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMethod, value.Method, null, null); - writer.WriteProperty(options, PropMode, value.Mode, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.IcuAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.IcuAnalyzerConverter))] public sealed partial class IcuAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationAlternate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationAlternate.Converters.g.cs new file mode 100644 index 00000000000..4021fa35bc2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationAlternate.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class IcuCollationAlternateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberNonIgnorable = System.Text.Json.JsonEncodedText.Encode("non-ignorable"); + private static readonly System.Text.Json.JsonEncodedText MemberShifted = System.Text.Json.JsonEncodedText.Encode("shifted"); + + public override Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberNonIgnorable)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate.NonIgnorable; + } + + if (reader.ValueTextEquals(MemberShifted)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate.Shifted; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberNonIgnorable.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate.NonIgnorable; + } + + if (string.Equals(value, MemberShifted.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate.Shifted; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate.NonIgnorable: + writer.WriteStringValue(MemberNonIgnorable); + break; + case Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate.Shifted: + writer.WriteStringValue(MemberShifted); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationAlternate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationAlternate.g.cs new file mode 100644 index 00000000000..f033e4441fa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationAlternate.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.IcuCollationAlternateConverter))] +public enum IcuCollationAlternate +{ + [System.Runtime.Serialization.EnumMember(Value = "non-ignorable")] + NonIgnorable, + [System.Runtime.Serialization.EnumMember(Value = "shifted")] + Shifted +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationCaseFirst.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationCaseFirst.Converters.g.cs new file mode 100644 index 00000000000..5dda9a265b8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationCaseFirst.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class IcuCollationCaseFirstConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberLower = System.Text.Json.JsonEncodedText.Encode("lower"); + private static readonly System.Text.Json.JsonEncodedText MemberUpper = System.Text.Json.JsonEncodedText.Encode("upper"); + + public override Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberLower)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst.Lower; + } + + if (reader.ValueTextEquals(MemberUpper)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst.Upper; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberLower.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst.Lower; + } + + if (string.Equals(value, MemberUpper.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst.Upper; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst.Lower: + writer.WriteStringValue(MemberLower); + break; + case Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst.Upper: + writer.WriteStringValue(MemberUpper); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationCaseFirst.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationCaseFirst.g.cs new file mode 100644 index 00000000000..34bc1496d5a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationCaseFirst.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.IcuCollationCaseFirstConverter))] +public enum IcuCollationCaseFirst +{ + [System.Runtime.Serialization.EnumMember(Value = "lower")] + Lower, + [System.Runtime.Serialization.EnumMember(Value = "upper")] + Upper +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationDecomposition.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationDecomposition.Converters.g.cs new file mode 100644 index 00000000000..bb5c9fee50e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationDecomposition.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class IcuCollationDecompositionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberIdentical = System.Text.Json.JsonEncodedText.Encode("identical"); + private static readonly System.Text.Json.JsonEncodedText MemberNo = System.Text.Json.JsonEncodedText.Encode("no"); + + public override Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberIdentical)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition.Identical; + } + + if (reader.ValueTextEquals(MemberNo)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition.No; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberIdentical.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition.Identical; + } + + if (string.Equals(value, MemberNo.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition.No; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition.Identical: + writer.WriteStringValue(MemberIdentical); + break; + case Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition.No: + writer.WriteStringValue(MemberNo); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationDecomposition.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationDecomposition.g.cs new file mode 100644 index 00000000000..537b9dddcf8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationDecomposition.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.IcuCollationDecompositionConverter))] +public enum IcuCollationDecomposition +{ + [System.Runtime.Serialization.EnumMember(Value = "identical")] + Identical, + [System.Runtime.Serialization.EnumMember(Value = "no")] + No +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationStrength.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationStrength.Converters.g.cs new file mode 100644 index 00000000000..38507502edc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationStrength.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class IcuCollationStrengthConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberIdentical = System.Text.Json.JsonEncodedText.Encode("identical"); + private static readonly System.Text.Json.JsonEncodedText MemberPrimary = System.Text.Json.JsonEncodedText.Encode("primary"); + private static readonly System.Text.Json.JsonEncodedText MemberQuaternary = System.Text.Json.JsonEncodedText.Encode("quaternary"); + private static readonly System.Text.Json.JsonEncodedText MemberSecondary = System.Text.Json.JsonEncodedText.Encode("secondary"); + private static readonly System.Text.Json.JsonEncodedText MemberTertiary = System.Text.Json.JsonEncodedText.Encode("tertiary"); + + public override Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberIdentical)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Identical; + } + + if (reader.ValueTextEquals(MemberPrimary)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Primary; + } + + if (reader.ValueTextEquals(MemberQuaternary)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Quaternary; + } + + if (reader.ValueTextEquals(MemberSecondary)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Secondary; + } + + if (reader.ValueTextEquals(MemberTertiary)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Tertiary; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberIdentical.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Identical; + } + + if (string.Equals(value, MemberPrimary.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Primary; + } + + if (string.Equals(value, MemberQuaternary.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Quaternary; + } + + if (string.Equals(value, MemberSecondary.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Secondary; + } + + if (string.Equals(value, MemberTertiary.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Tertiary; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Identical: + writer.WriteStringValue(MemberIdentical); + break; + case Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Primary: + writer.WriteStringValue(MemberPrimary); + break; + case Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Quaternary: + writer.WriteStringValue(MemberQuaternary); + break; + case Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Secondary: + writer.WriteStringValue(MemberSecondary); + break; + case Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Tertiary: + writer.WriteStringValue(MemberTertiary); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationStrength.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationStrength.g.cs new file mode 100644 index 00000000000..2aa00495844 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationStrength.g.cs @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.IcuCollationStrengthConverter))] +public enum IcuCollationStrength +{ + [System.Runtime.Serialization.EnumMember(Value = "identical")] + Identical, + [System.Runtime.Serialization.EnumMember(Value = "primary")] + Primary, + [System.Runtime.Serialization.EnumMember(Value = "quaternary")] + Quaternary, + [System.Runtime.Serialization.EnumMember(Value = "secondary")] + Secondary, + [System.Runtime.Serialization.EnumMember(Value = "tertiary")] + Tertiary +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..b12f0f95baa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationTokenFilter.Converters.g.cs @@ -0,0 +1,179 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class IcuCollationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAlternate = System.Text.Json.JsonEncodedText.Encode("alternate"); + private static readonly System.Text.Json.JsonEncodedText PropCaseFirst = System.Text.Json.JsonEncodedText.Encode("caseFirst"); + private static readonly System.Text.Json.JsonEncodedText PropCaseLevel = System.Text.Json.JsonEncodedText.Encode("caseLevel"); + private static readonly System.Text.Json.JsonEncodedText PropCountry = System.Text.Json.JsonEncodedText.Encode("country"); + private static readonly System.Text.Json.JsonEncodedText PropDecomposition = System.Text.Json.JsonEncodedText.Encode("decomposition"); + private static readonly System.Text.Json.JsonEncodedText PropHiraganaQuaternaryMode = System.Text.Json.JsonEncodedText.Encode("hiraganaQuaternaryMode"); + private static readonly System.Text.Json.JsonEncodedText PropLanguage = System.Text.Json.JsonEncodedText.Encode("language"); + private static readonly System.Text.Json.JsonEncodedText PropNumeric = System.Text.Json.JsonEncodedText.Encode("numeric"); + private static readonly System.Text.Json.JsonEncodedText PropRules = System.Text.Json.JsonEncodedText.Encode("rules"); + private static readonly System.Text.Json.JsonEncodedText PropStrength = System.Text.Json.JsonEncodedText.Encode("strength"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVariableTop = System.Text.Json.JsonEncodedText.Encode("variableTop"); + private static readonly System.Text.Json.JsonEncodedText PropVariant = System.Text.Json.JsonEncodedText.Encode("variant"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAlternate = default; + LocalJsonValue propCaseFirst = default; + LocalJsonValue propCaseLevel = default; + LocalJsonValue propCountry = default; + LocalJsonValue propDecomposition = default; + LocalJsonValue propHiraganaQuaternaryMode = default; + LocalJsonValue propLanguage = default; + LocalJsonValue propNumeric = default; + LocalJsonValue propRules = default; + LocalJsonValue propStrength = default; + LocalJsonValue propVariableTop = default; + LocalJsonValue propVariant = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAlternate.TryReadProperty(ref reader, options, PropAlternate, static Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCaseFirst.TryReadProperty(ref reader, options, PropCaseFirst, static Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCaseLevel.TryReadProperty(ref reader, options, PropCaseLevel, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCountry.TryReadProperty(ref reader, options, PropCountry, null)) + { + continue; + } + + if (propDecomposition.TryReadProperty(ref reader, options, PropDecomposition, static Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propHiraganaQuaternaryMode.TryReadProperty(ref reader, options, PropHiraganaQuaternaryMode, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLanguage.TryReadProperty(ref reader, options, PropLanguage, null)) + { + continue; + } + + if (propNumeric.TryReadProperty(ref reader, options, PropNumeric, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRules.TryReadProperty(ref reader, options, PropRules, null)) + { + continue; + } + + if (propStrength.TryReadProperty(ref reader, options, PropStrength, static Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVariableTop.TryReadProperty(ref reader, options, PropVariableTop, null)) + { + continue; + } + + if (propVariant.TryReadProperty(ref reader, options, PropVariant, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Alternate = propAlternate.Value, + CaseFirst = propCaseFirst.Value, + CaseLevel = propCaseLevel.Value, + Country = propCountry.Value, + Decomposition = propDecomposition.Value, + HiraganaQuaternaryMode = propHiraganaQuaternaryMode.Value, + Language = propLanguage.Value, + Numeric = propNumeric.Value, + Rules = propRules.Value, + Strength = propStrength.Value, + VariableTop = propVariableTop.Value, + Variant = propVariant.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAlternate, value.Alternate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCaseFirst, value.CaseFirst, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCaseLevel, value.CaseLevel, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCountry, value.Country, null, null); + writer.WriteProperty(options, PropDecomposition, value.Decomposition, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropHiraganaQuaternaryMode, value.HiraganaQuaternaryMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLanguage, value.Language, null, null); + writer.WriteProperty(options, PropNumeric, value.Numeric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRules, value.Rules, null, null); + writer.WriteProperty(options, PropStrength, value.Strength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVariableTop, value.VariableTop, null, null); + writer.WriteProperty(options, PropVariant, value.Variant, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationTokenFilter.g.cs index d99554f2afd..63053ec906a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuCollationTokenFilter.g.cs @@ -23,162 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class IcuCollationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAlternate = System.Text.Json.JsonEncodedText.Encode("alternate"); - private static readonly System.Text.Json.JsonEncodedText PropCaseFirst = System.Text.Json.JsonEncodedText.Encode("caseFirst"); - private static readonly System.Text.Json.JsonEncodedText PropCaseLevel = System.Text.Json.JsonEncodedText.Encode("caseLevel"); - private static readonly System.Text.Json.JsonEncodedText PropCountry = System.Text.Json.JsonEncodedText.Encode("country"); - private static readonly System.Text.Json.JsonEncodedText PropDecomposition = System.Text.Json.JsonEncodedText.Encode("decomposition"); - private static readonly System.Text.Json.JsonEncodedText PropHiraganaQuaternaryMode = System.Text.Json.JsonEncodedText.Encode("hiraganaQuaternaryMode"); - private static readonly System.Text.Json.JsonEncodedText PropLanguage = System.Text.Json.JsonEncodedText.Encode("language"); - private static readonly System.Text.Json.JsonEncodedText PropNumeric = System.Text.Json.JsonEncodedText.Encode("numeric"); - private static readonly System.Text.Json.JsonEncodedText PropRules = System.Text.Json.JsonEncodedText.Encode("rules"); - private static readonly System.Text.Json.JsonEncodedText PropStrength = System.Text.Json.JsonEncodedText.Encode("strength"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVariableTop = System.Text.Json.JsonEncodedText.Encode("variableTop"); - private static readonly System.Text.Json.JsonEncodedText PropVariant = System.Text.Json.JsonEncodedText.Encode("variant"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAlternate = default; - LocalJsonValue propCaseFirst = default; - LocalJsonValue propCaseLevel = default; - LocalJsonValue propCountry = default; - LocalJsonValue propDecomposition = default; - LocalJsonValue propHiraganaQuaternaryMode = default; - LocalJsonValue propLanguage = default; - LocalJsonValue propNumeric = default; - LocalJsonValue propRules = default; - LocalJsonValue propStrength = default; - LocalJsonValue propVariableTop = default; - LocalJsonValue propVariant = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAlternate.TryReadProperty(ref reader, options, PropAlternate, static Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCaseFirst.TryReadProperty(ref reader, options, PropCaseFirst, static Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCaseLevel.TryReadProperty(ref reader, options, PropCaseLevel, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCountry.TryReadProperty(ref reader, options, PropCountry, null)) - { - continue; - } - - if (propDecomposition.TryReadProperty(ref reader, options, PropDecomposition, static Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propHiraganaQuaternaryMode.TryReadProperty(ref reader, options, PropHiraganaQuaternaryMode, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLanguage.TryReadProperty(ref reader, options, PropLanguage, null)) - { - continue; - } - - if (propNumeric.TryReadProperty(ref reader, options, PropNumeric, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRules.TryReadProperty(ref reader, options, PropRules, null)) - { - continue; - } - - if (propStrength.TryReadProperty(ref reader, options, PropStrength, static Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVariableTop.TryReadProperty(ref reader, options, PropVariableTop, null)) - { - continue; - } - - if (propVariant.TryReadProperty(ref reader, options, PropVariant, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Alternate = propAlternate.Value, - CaseFirst = propCaseFirst.Value, - CaseLevel = propCaseLevel.Value, - Country = propCountry.Value, - Decomposition = propDecomposition.Value, - HiraganaQuaternaryMode = propHiraganaQuaternaryMode.Value, - Language = propLanguage.Value, - Numeric = propNumeric.Value, - Rules = propRules.Value, - Strength = propStrength.Value, - VariableTop = propVariableTop.Value, - Variant = propVariant.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAlternate, value.Alternate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCaseFirst, value.CaseFirst, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCaseLevel, value.CaseLevel, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCountry, value.Country, null, null); - writer.WriteProperty(options, PropDecomposition, value.Decomposition, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropHiraganaQuaternaryMode, value.HiraganaQuaternaryMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLanguage, value.Language, null, null); - writer.WriteProperty(options, PropNumeric, value.Numeric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRules, value.Rules, null, null); - writer.WriteProperty(options, PropStrength, value.Strength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVariableTop, value.VariableTop, null, null); - writer.WriteProperty(options, PropVariant, value.Variant, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.IcuCollationTokenFilterConverter))] public sealed partial class IcuCollationTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuFoldingTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuFoldingTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..b37c141d503 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuFoldingTokenFilter.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class IcuFoldingTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropUnicodeSetFilter = System.Text.Json.JsonEncodedText.Encode("unicode_set_filter"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.IcuFoldingTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propUnicodeSetFilter = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propUnicodeSetFilter.TryReadProperty(ref reader, options, PropUnicodeSetFilter, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.IcuFoldingTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + UnicodeSetFilter = propUnicodeSetFilter.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuFoldingTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropUnicodeSetFilter, value.UnicodeSetFilter, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuFoldingTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuFoldingTokenFilter.g.cs index 331241ae28f..029411c5c13 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuFoldingTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuFoldingTokenFilter.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class IcuFoldingTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropUnicodeSetFilter = System.Text.Json.JsonEncodedText.Encode("unicode_set_filter"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.IcuFoldingTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propUnicodeSetFilter = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propUnicodeSetFilter.TryReadProperty(ref reader, options, PropUnicodeSetFilter, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.IcuFoldingTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - UnicodeSetFilter = propUnicodeSetFilter.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuFoldingTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropUnicodeSetFilter, value.UnicodeSetFilter, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.IcuFoldingTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.IcuFoldingTokenFilterConverter))] public sealed partial class IcuFoldingTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationCharFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationCharFilter.Converters.g.cs new file mode 100644 index 00000000000..4068626b75e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationCharFilter.Converters.g.cs @@ -0,0 +1,98 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class IcuNormalizationCharFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropUnicodeSetFilter = System.Text.Json.JsonEncodedText.Encode("unicode_set_filter"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationCharFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMode = default; + LocalJsonValue propName = default; + LocalJsonValue propUnicodeSetFilter = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMode.TryReadProperty(ref reader, options, PropMode, static Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, static Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propUnicodeSetFilter.TryReadProperty(ref reader, options, PropUnicodeSetFilter, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationCharFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Mode = propMode.Value, + Name = propName.Value, + UnicodeSetFilter = propUnicodeSetFilter.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationCharFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMode, value.Mode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropName, value.Name, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropUnicodeSetFilter, value.UnicodeSetFilter, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationCharFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationCharFilter.g.cs index 81e7ca447b7..cbea94f886b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationCharFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationCharFilter.g.cs @@ -23,81 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class IcuNormalizationCharFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropUnicodeSetFilter = System.Text.Json.JsonEncodedText.Encode("unicode_set_filter"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationCharFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMode = default; - LocalJsonValue propName = default; - LocalJsonValue propUnicodeSetFilter = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMode.TryReadProperty(ref reader, options, PropMode, static Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, static Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propUnicodeSetFilter.TryReadProperty(ref reader, options, PropUnicodeSetFilter, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationCharFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Mode = propMode.Value, - Name = propName.Value, - UnicodeSetFilter = propUnicodeSetFilter.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationCharFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMode, value.Mode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropName, value.Name, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropUnicodeSetFilter, value.UnicodeSetFilter, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationCharFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.IcuNormalizationCharFilterConverter))] public sealed partial class IcuNormalizationCharFilter : Elastic.Clients.Elasticsearch.Analysis.ICharFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationMode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationMode.Converters.g.cs new file mode 100644 index 00000000000..55b2b044e07 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationMode.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class IcuNormalizationModeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCompose = System.Text.Json.JsonEncodedText.Encode("compose"); + private static readonly System.Text.Json.JsonEncodedText MemberDecompose = System.Text.Json.JsonEncodedText.Encode("decompose"); + + public override Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCompose)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode.Compose; + } + + if (reader.ValueTextEquals(MemberDecompose)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode.Decompose; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCompose.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode.Compose; + } + + if (string.Equals(value, MemberDecompose.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode.Decompose; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode.Compose: + writer.WriteStringValue(MemberCompose); + break; + case Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode.Decompose: + writer.WriteStringValue(MemberDecompose); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationMode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationMode.g.cs new file mode 100644 index 00000000000..776ac2c6445 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationMode.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.IcuNormalizationModeConverter))] +public enum IcuNormalizationMode +{ + [System.Runtime.Serialization.EnumMember(Value = "compose")] + Compose, + [System.Runtime.Serialization.EnumMember(Value = "decompose")] + Decompose +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..7fc6f076b1b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationTokenFilter.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class IcuNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationTokenFilter.g.cs index 1929ff2a0a6..7da9c930281 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationTokenFilter.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class IcuNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.IcuNormalizationTokenFilterConverter))] public sealed partial class IcuNormalizationTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationType.Converters.g.cs new file mode 100644 index 00000000000..c16aeffe97e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationType.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class IcuNormalizationTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberNfc = System.Text.Json.JsonEncodedText.Encode("nfc"); + private static readonly System.Text.Json.JsonEncodedText MemberNfkc = System.Text.Json.JsonEncodedText.Encode("nfkc"); + private static readonly System.Text.Json.JsonEncodedText MemberNfkcCf = System.Text.Json.JsonEncodedText.Encode("nfkc_cf"); + + public override Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberNfc)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType.Nfc; + } + + if (reader.ValueTextEquals(MemberNfkc)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType.Nfkc; + } + + if (reader.ValueTextEquals(MemberNfkcCf)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType.NfkcCf; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberNfc.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType.Nfc; + } + + if (string.Equals(value, MemberNfkc.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType.Nfkc; + } + + if (string.Equals(value, MemberNfkcCf.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType.NfkcCf; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType.Nfc: + writer.WriteStringValue(MemberNfc); + break; + case Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType.Nfkc: + writer.WriteStringValue(MemberNfkc); + break; + case Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType.NfkcCf: + writer.WriteStringValue(MemberNfkcCf); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationType.g.cs new file mode 100644 index 00000000000..c38b68c8d29 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationType.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.IcuNormalizationTypeConverter))] +public enum IcuNormalizationType +{ + [System.Runtime.Serialization.EnumMember(Value = "nfc")] + Nfc, + [System.Runtime.Serialization.EnumMember(Value = "nfkc")] + Nfkc, + [System.Runtime.Serialization.EnumMember(Value = "nfkc_cf")] + NfkcCf +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTokenizer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTokenizer.Converters.g.cs new file mode 100644 index 00000000000..4899e941272 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTokenizer.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class IcuTokenizerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRuleFiles = System.Text.Json.JsonEncodedText.Encode("rule_files"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.IcuTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propRuleFiles = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRuleFiles.TryReadProperty(ref reader, options, PropRuleFiles, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.IcuTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + RuleFiles = propRuleFiles.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuTokenizer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRuleFiles, value.RuleFiles, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTokenizer.g.cs index 390331362b3..404f552deef 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTokenizer.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class IcuTokenizerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRuleFiles = System.Text.Json.JsonEncodedText.Encode("rule_files"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.IcuTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propRuleFiles = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRuleFiles.TryReadProperty(ref reader, options, PropRuleFiles, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.IcuTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - RuleFiles = propRuleFiles.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuTokenizer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRuleFiles, value.RuleFiles, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.IcuTokenizerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.IcuTokenizerConverter))] public sealed partial class IcuTokenizer : Elastic.Clients.Elasticsearch.Analysis.ITokenizer { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTransformDirection.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTransformDirection.Converters.g.cs new file mode 100644 index 00000000000..a2f3fbdd09a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTransformDirection.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class IcuTransformDirectionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberForward = System.Text.Json.JsonEncodedText.Encode("forward"); + private static readonly System.Text.Json.JsonEncodedText MemberReverse = System.Text.Json.JsonEncodedText.Encode("reverse"); + + public override Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberForward)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection.Forward; + } + + if (reader.ValueTextEquals(MemberReverse)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection.Reverse; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberForward.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection.Forward; + } + + if (string.Equals(value, MemberReverse.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection.Reverse; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection.Forward: + writer.WriteStringValue(MemberForward); + break; + case Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection.Reverse: + writer.WriteStringValue(MemberReverse); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTransformDirection.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTransformDirection.g.cs new file mode 100644 index 00000000000..825deb16781 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTransformDirection.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.IcuTransformDirectionConverter))] +public enum IcuTransformDirection +{ + [System.Runtime.Serialization.EnumMember(Value = "forward")] + Forward, + [System.Runtime.Serialization.EnumMember(Value = "reverse")] + Reverse +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTransformTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTransformTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..b1af48239f2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTransformTokenFilter.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class IcuTransformTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDir = System.Text.Json.JsonEncodedText.Encode("dir"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.IcuTransformTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDir = default; + LocalJsonValue propId = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDir.TryReadProperty(ref reader, options, PropDir, static Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.IcuTransformTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Dir = propDir.Value, + Id = propId.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuTransformTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDir, value.Dir, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTransformTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTransformTokenFilter.g.cs index 32db6ce2ee7..f72089ff4d2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTransformTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuTransformTokenFilter.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class IcuTransformTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDir = System.Text.Json.JsonEncodedText.Encode("dir"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.IcuTransformTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDir = default; - LocalJsonValue propId = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDir.TryReadProperty(ref reader, options, PropDir, static Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.IcuTransformTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Dir = propDir.Value, - Id = propId.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuTransformTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDir, value.Dir, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.IcuTransformTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.IcuTransformTokenFilterConverter))] public sealed partial class IcuTransformTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IndicNormalizationTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IndicNormalizationTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..faee050c2a0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IndicNormalizationTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class IndicNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IndicNormalizationTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IndicNormalizationTokenFilter.g.cs index a69f133e9b0..dce49a51ac2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IndicNormalizationTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IndicNormalizationTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class IndicNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.IndicNormalizationTokenFilterConverter))] public sealed partial class IndicNormalizationTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IndonesianAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IndonesianAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..87020b4f805 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IndonesianAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class IndonesianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.IndonesianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.IndonesianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IndonesianAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IndonesianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IndonesianAnalyzer.g.cs index 23a9fb9ad1f..40cd7078fb0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IndonesianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IndonesianAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class IndonesianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.IndonesianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.IndonesianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IndonesianAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.IndonesianAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.IndonesianAnalyzerConverter))] public sealed partial class IndonesianAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IrishAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IrishAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..d55d9217079 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IrishAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class IrishAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.IrishAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.IrishAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IrishAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IrishAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IrishAnalyzer.g.cs index a16138cd1f4..17f974b6ff9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IrishAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IrishAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class IrishAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.IrishAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.IrishAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IrishAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.IrishAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.IrishAnalyzerConverter))] public sealed partial class IrishAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ItalianAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ItalianAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..e104b3d3ddb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ItalianAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class ItalianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.ItalianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.ItalianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ItalianAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ItalianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ItalianAnalyzer.g.cs index 38c2d72e4e7..da902ab3017 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ItalianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ItalianAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class ItalianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.ItalianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.ItalianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ItalianAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.ItalianAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.ItalianAnalyzerConverter))] public sealed partial class ItalianAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/JaStopTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/JaStopTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..d57b4e1b2fc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/JaStopTokenFilter.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class JaStopTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Stopwords = propStopwords.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/JaStopTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/JaStopTokenFilter.g.cs index 929634d800c..1d86ffeedc4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/JaStopTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/JaStopTokenFilter.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class JaStopTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Stopwords = propStopwords.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.JaStopTokenFilterConverter))] public sealed partial class JaStopTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KStemTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KStemTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..99a8b1b8b4d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KStemTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class KStemTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.KStemTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.KStemTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KStemTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KStemTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KStemTokenFilter.g.cs index 53b18170f8c..d3af6877598 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KStemTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KStemTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class KStemTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.KStemTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.KStemTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KStemTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.KStemTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.KStemTokenFilterConverter))] public sealed partial class KStemTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepTypesMode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepTypesMode.Converters.g.cs new file mode 100644 index 00000000000..8b15737e23d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepTypesMode.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class KeepTypesModeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberExclude = System.Text.Json.JsonEncodedText.Encode("exclude"); + private static readonly System.Text.Json.JsonEncodedText MemberInclude = System.Text.Json.JsonEncodedText.Encode("include"); + + public override Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberExclude)) + { + return Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode.Exclude; + } + + if (reader.ValueTextEquals(MemberInclude)) + { + return Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode.Include; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberExclude.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode.Exclude; + } + + if (string.Equals(value, MemberInclude.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode.Include; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode.Exclude: + writer.WriteStringValue(MemberExclude); + break; + case Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode.Include: + writer.WriteStringValue(MemberInclude); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepTypesMode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepTypesMode.g.cs new file mode 100644 index 00000000000..b5737fac7f7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepTypesMode.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.KeepTypesModeConverter))] +public enum KeepTypesMode +{ + [System.Runtime.Serialization.EnumMember(Value = "exclude")] + Exclude, + [System.Runtime.Serialization.EnumMember(Value = "include")] + Include +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepTypesTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepTypesTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..97b9e9d8fa1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepTypesTokenFilter.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class KeepTypesTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropTypes = System.Text.Json.JsonEncodedText.Encode("types"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMode = default; + LocalJsonValue> propTypes = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMode.TryReadProperty(ref reader, options, PropMode, static Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propTypes.TryReadProperty(ref reader, options, PropTypes, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Mode = propMode.Value, + Types = propTypes.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMode, value.Mode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropTypes, value.Types, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepTypesTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepTypesTokenFilter.g.cs index 48cab5a8cc1..7701a40d791 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepTypesTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepTypesTokenFilter.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class KeepTypesTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropTypes = System.Text.Json.JsonEncodedText.Encode("types"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMode = default; - LocalJsonValue> propTypes = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMode.TryReadProperty(ref reader, options, PropMode, static Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propTypes.TryReadProperty(ref reader, options, PropTypes, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Mode = propMode.Value, - Types = propTypes.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMode, value.Mode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropTypes, value.Types, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.KeepTypesTokenFilterConverter))] public sealed partial class KeepTypesTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepWordsTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepWordsTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..776b668e942 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepWordsTokenFilter.Converters.g.cs @@ -0,0 +1,98 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class KeepWordsTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropKeepWords = System.Text.Json.JsonEncodedText.Encode("keep_words"); + private static readonly System.Text.Json.JsonEncodedText PropKeepWordsCase = System.Text.Json.JsonEncodedText.Encode("keep_words_case"); + private static readonly System.Text.Json.JsonEncodedText PropKeepWordsPath = System.Text.Json.JsonEncodedText.Encode("keep_words_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.KeepWordsTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propKeepWords = default; + LocalJsonValue propKeepWordsCase = default; + LocalJsonValue propKeepWordsPath = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propKeepWords.TryReadProperty(ref reader, options, PropKeepWords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propKeepWordsCase.TryReadProperty(ref reader, options, PropKeepWordsCase, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propKeepWordsPath.TryReadProperty(ref reader, options, PropKeepWordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.KeepWordsTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + KeepWords = propKeepWords.Value, + KeepWordsCase = propKeepWordsCase.Value, + KeepWordsPath = propKeepWordsPath.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KeepWordsTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropKeepWords, value.KeepWords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropKeepWordsCase, value.KeepWordsCase, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropKeepWordsPath, value.KeepWordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepWordsTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepWordsTokenFilter.g.cs index f9b74b24d97..a468f51e285 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepWordsTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepWordsTokenFilter.g.cs @@ -23,81 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class KeepWordsTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropKeepWords = System.Text.Json.JsonEncodedText.Encode("keep_words"); - private static readonly System.Text.Json.JsonEncodedText PropKeepWordsCase = System.Text.Json.JsonEncodedText.Encode("keep_words_case"); - private static readonly System.Text.Json.JsonEncodedText PropKeepWordsPath = System.Text.Json.JsonEncodedText.Encode("keep_words_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.KeepWordsTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propKeepWords = default; - LocalJsonValue propKeepWordsCase = default; - LocalJsonValue propKeepWordsPath = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propKeepWords.TryReadProperty(ref reader, options, PropKeepWords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propKeepWordsCase.TryReadProperty(ref reader, options, PropKeepWordsCase, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propKeepWordsPath.TryReadProperty(ref reader, options, PropKeepWordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.KeepWordsTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - KeepWords = propKeepWords.Value, - KeepWordsCase = propKeepWordsCase.Value, - KeepWordsPath = propKeepWordsPath.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KeepWordsTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropKeepWords, value.KeepWords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropKeepWordsCase, value.KeepWordsCase, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropKeepWordsPath, value.KeepWordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.KeepWordsTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.KeepWordsTokenFilterConverter))] public sealed partial class KeepWordsTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..7039a27b325 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordAnalyzer.Converters.g.cs @@ -0,0 +1,76 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class KeywordAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.KeywordAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.KeywordAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { +#pragma warning disable CS0618 + Version = propVersion.Value +#pragma warning restore CS0618 + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KeywordAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); +#pragma warning disable CS0618 + writer.WriteProperty(options, PropVersion, value.Version, null, null) +#pragma warning restore CS0618 + ; + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordAnalyzer.g.cs index 24c4a82743c..a67dd6e246a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordAnalyzer.g.cs @@ -23,59 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class KeywordAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.KeywordAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.KeywordAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { -#pragma warning disable CS0618 - Version = propVersion.Value -#pragma warning restore CS0618 - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KeywordAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); -#pragma warning disable CS0618 - writer.WriteProperty(options, PropVersion, value.Version, null, null) -#pragma warning restore CS0618 - ; - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.KeywordAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.KeywordAnalyzerConverter))] public sealed partial class KeywordAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordMarkerTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordMarkerTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..bd48a8d26c4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordMarkerTokenFilter.Converters.g.cs @@ -0,0 +1,107 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class KeywordMarkerTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIgnoreCase = System.Text.Json.JsonEncodedText.Encode("ignore_case"); + private static readonly System.Text.Json.JsonEncodedText PropKeywords = System.Text.Json.JsonEncodedText.Encode("keywords"); + private static readonly System.Text.Json.JsonEncodedText PropKeywordsPath = System.Text.Json.JsonEncodedText.Encode("keywords_path"); + private static readonly System.Text.Json.JsonEncodedText PropKeywordsPattern = System.Text.Json.JsonEncodedText.Encode("keywords_pattern"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.KeywordMarkerTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIgnoreCase = default; + LocalJsonValue?> propKeywords = default; + LocalJsonValue propKeywordsPath = default; + LocalJsonValue propKeywordsPattern = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIgnoreCase.TryReadProperty(ref reader, options, PropIgnoreCase, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propKeywords.TryReadProperty(ref reader, options, PropKeywords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propKeywordsPath.TryReadProperty(ref reader, options, PropKeywordsPath, null)) + { + continue; + } + + if (propKeywordsPattern.TryReadProperty(ref reader, options, PropKeywordsPattern, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.KeywordMarkerTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + IgnoreCase = propIgnoreCase.Value, + Keywords = propKeywords.Value, + KeywordsPath = propKeywordsPath.Value, + KeywordsPattern = propKeywordsPattern.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KeywordMarkerTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIgnoreCase, value.IgnoreCase, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropKeywords, value.Keywords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropKeywordsPath, value.KeywordsPath, null, null); + writer.WriteProperty(options, PropKeywordsPattern, value.KeywordsPattern, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordMarkerTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordMarkerTokenFilter.g.cs index 7d55986d52f..01fdee858c9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordMarkerTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordMarkerTokenFilter.g.cs @@ -23,90 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class KeywordMarkerTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIgnoreCase = System.Text.Json.JsonEncodedText.Encode("ignore_case"); - private static readonly System.Text.Json.JsonEncodedText PropKeywords = System.Text.Json.JsonEncodedText.Encode("keywords"); - private static readonly System.Text.Json.JsonEncodedText PropKeywordsPath = System.Text.Json.JsonEncodedText.Encode("keywords_path"); - private static readonly System.Text.Json.JsonEncodedText PropKeywordsPattern = System.Text.Json.JsonEncodedText.Encode("keywords_pattern"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.KeywordMarkerTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIgnoreCase = default; - LocalJsonValue?> propKeywords = default; - LocalJsonValue propKeywordsPath = default; - LocalJsonValue propKeywordsPattern = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIgnoreCase.TryReadProperty(ref reader, options, PropIgnoreCase, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propKeywords.TryReadProperty(ref reader, options, PropKeywords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propKeywordsPath.TryReadProperty(ref reader, options, PropKeywordsPath, null)) - { - continue; - } - - if (propKeywordsPattern.TryReadProperty(ref reader, options, PropKeywordsPattern, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.KeywordMarkerTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - IgnoreCase = propIgnoreCase.Value, - Keywords = propKeywords.Value, - KeywordsPath = propKeywordsPath.Value, - KeywordsPattern = propKeywordsPattern.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KeywordMarkerTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIgnoreCase, value.IgnoreCase, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropKeywords, value.Keywords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropKeywordsPath, value.KeywordsPath, null, null); - writer.WriteProperty(options, PropKeywordsPattern, value.KeywordsPattern, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.KeywordMarkerTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.KeywordMarkerTokenFilterConverter))] public sealed partial class KeywordMarkerTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordRepeatTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordRepeatTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..43b03aeecc8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordRepeatTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class KeywordRepeatTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordRepeatTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordRepeatTokenFilter.g.cs index 99aaa10cae6..be2340985e0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordRepeatTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordRepeatTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class KeywordRepeatTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.KeywordRepeatTokenFilterConverter))] public sealed partial class KeywordRepeatTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordTokenizer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordTokenizer.Converters.g.cs new file mode 100644 index 00000000000..a9815330d16 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordTokenizer.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class KeywordTokenizerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBufferSize = System.Text.Json.JsonEncodedText.Encode("buffer_size"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.KeywordTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBufferSize = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBufferSize.TryReadProperty(ref reader, options, PropBufferSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.KeywordTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BufferSize = propBufferSize.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KeywordTokenizer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBufferSize, value.BufferSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordTokenizer.g.cs index 8851792af46..97799609e43 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordTokenizer.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class KeywordTokenizerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBufferSize = System.Text.Json.JsonEncodedText.Encode("buffer_size"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.KeywordTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBufferSize = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBufferSize.TryReadProperty(ref reader, options, PropBufferSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.KeywordTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BufferSize = propBufferSize.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KeywordTokenizer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBufferSize, value.BufferSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.KeywordTokenizerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.KeywordTokenizerConverter))] public sealed partial class KeywordTokenizer : Elastic.Clients.Elasticsearch.Analysis.ITokenizer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..d9a75de9c04 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiAnalyzer.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class KuromojiAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropUserDictionary = System.Text.Json.JsonEncodedText.Encode("user_dictionary"); + + public override Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMode = default; + LocalJsonValue propUserDictionary = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMode.TryReadProperty(ref reader, options, PropMode, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propUserDictionary.TryReadProperty(ref reader, options, PropUserDictionary, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Mode = propMode.Value, + UserDictionary = propUserDictionary.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMode, value.Mode, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropUserDictionary, value.UserDictionary, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiAnalyzer.g.cs index 495eb4a511a..2bab4a43412 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiAnalyzer.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class KuromojiAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropUserDictionary = System.Text.Json.JsonEncodedText.Encode("user_dictionary"); - - public override Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMode = default; - LocalJsonValue propUserDictionary = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMode.TryReadProperty(ref reader, options, PropMode, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propUserDictionary.TryReadProperty(ref reader, options, PropUserDictionary, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Mode = propMode.Value, - UserDictionary = propUserDictionary.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMode, value.Mode, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropUserDictionary, value.UserDictionary, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.KuromojiAnalyzerConverter))] public sealed partial class KuromojiAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiIterationMarkCharFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiIterationMarkCharFilter.Converters.g.cs new file mode 100644 index 00000000000..81b5c23a945 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiIterationMarkCharFilter.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class KuromojiIterationMarkCharFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNormalizeKana = System.Text.Json.JsonEncodedText.Encode("normalize_kana"); + private static readonly System.Text.Json.JsonEncodedText PropNormalizeKanji = System.Text.Json.JsonEncodedText.Encode("normalize_kanji"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.KuromojiIterationMarkCharFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propNormalizeKana = default; + LocalJsonValue propNormalizeKanji = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNormalizeKana.TryReadProperty(ref reader, options, PropNormalizeKana, null)) + { + continue; + } + + if (propNormalizeKanji.TryReadProperty(ref reader, options, PropNormalizeKanji, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.KuromojiIterationMarkCharFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + NormalizeKana = propNormalizeKana.Value, + NormalizeKanji = propNormalizeKanji.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KuromojiIterationMarkCharFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNormalizeKana, value.NormalizeKana, null, null); + writer.WriteProperty(options, PropNormalizeKanji, value.NormalizeKanji, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiIterationMarkCharFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiIterationMarkCharFilter.g.cs index e0e102222db..5c92a120d61 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiIterationMarkCharFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiIterationMarkCharFilter.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class KuromojiIterationMarkCharFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNormalizeKana = System.Text.Json.JsonEncodedText.Encode("normalize_kana"); - private static readonly System.Text.Json.JsonEncodedText PropNormalizeKanji = System.Text.Json.JsonEncodedText.Encode("normalize_kanji"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.KuromojiIterationMarkCharFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propNormalizeKana = default; - LocalJsonValue propNormalizeKanji = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNormalizeKana.TryReadProperty(ref reader, options, PropNormalizeKana, null)) - { - continue; - } - - if (propNormalizeKanji.TryReadProperty(ref reader, options, PropNormalizeKanji, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.KuromojiIterationMarkCharFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - NormalizeKana = propNormalizeKana.Value, - NormalizeKanji = propNormalizeKanji.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KuromojiIterationMarkCharFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNormalizeKana, value.NormalizeKana, null, null); - writer.WriteProperty(options, PropNormalizeKanji, value.NormalizeKanji, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.KuromojiIterationMarkCharFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.KuromojiIterationMarkCharFilterConverter))] public sealed partial class KuromojiIterationMarkCharFilter : Elastic.Clients.Elasticsearch.Analysis.ICharFilter { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiPartOfSpeechTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiPartOfSpeechTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..e3513edfad5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiPartOfSpeechTokenFilter.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class KuromojiPartOfSpeechTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStoptags = System.Text.Json.JsonEncodedText.Encode("stoptags"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.KuromojiPartOfSpeechTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propStoptags = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStoptags.TryReadProperty(ref reader, options, PropStoptags, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.KuromojiPartOfSpeechTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Stoptags = propStoptags.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KuromojiPartOfSpeechTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStoptags, value.Stoptags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiPartOfSpeechTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiPartOfSpeechTokenFilter.g.cs index 4376c893f3f..e9c4ca0bcc2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiPartOfSpeechTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiPartOfSpeechTokenFilter.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class KuromojiPartOfSpeechTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStoptags = System.Text.Json.JsonEncodedText.Encode("stoptags"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.KuromojiPartOfSpeechTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propStoptags = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStoptags.TryReadProperty(ref reader, options, PropStoptags, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.KuromojiPartOfSpeechTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Stoptags = propStoptags.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KuromojiPartOfSpeechTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStoptags, value.Stoptags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.KuromojiPartOfSpeechTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.KuromojiPartOfSpeechTokenFilterConverter))] public sealed partial class KuromojiPartOfSpeechTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiReadingFormTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiReadingFormTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..5c7fdef8604 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiReadingFormTokenFilter.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class KuromojiReadingFormTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropUseRomaji = System.Text.Json.JsonEncodedText.Encode("use_romaji"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.KuromojiReadingFormTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propUseRomaji = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propUseRomaji.TryReadProperty(ref reader, options, PropUseRomaji, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.KuromojiReadingFormTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + UseRomaji = propUseRomaji.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KuromojiReadingFormTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropUseRomaji, value.UseRomaji, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiReadingFormTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiReadingFormTokenFilter.g.cs index e466a487e82..26104d01384 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiReadingFormTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiReadingFormTokenFilter.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class KuromojiReadingFormTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropUseRomaji = System.Text.Json.JsonEncodedText.Encode("use_romaji"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.KuromojiReadingFormTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propUseRomaji = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propUseRomaji.TryReadProperty(ref reader, options, PropUseRomaji, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.KuromojiReadingFormTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - UseRomaji = propUseRomaji.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KuromojiReadingFormTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropUseRomaji, value.UseRomaji, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.KuromojiReadingFormTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.KuromojiReadingFormTokenFilterConverter))] public sealed partial class KuromojiReadingFormTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiStemmerTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiStemmerTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..883eff98e4a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiStemmerTokenFilter.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class KuromojiStemmerTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMinimumLength = System.Text.Json.JsonEncodedText.Encode("minimum_length"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.KuromojiStemmerTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMinimumLength = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMinimumLength.TryReadProperty(ref reader, options, PropMinimumLength, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.KuromojiStemmerTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MinimumLength = propMinimumLength.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KuromojiStemmerTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMinimumLength, value.MinimumLength, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiStemmerTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiStemmerTokenFilter.g.cs index e4dad723398..38324024bc7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiStemmerTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiStemmerTokenFilter.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class KuromojiStemmerTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMinimumLength = System.Text.Json.JsonEncodedText.Encode("minimum_length"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.KuromojiStemmerTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMinimumLength = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMinimumLength.TryReadProperty(ref reader, options, PropMinimumLength, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.KuromojiStemmerTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MinimumLength = propMinimumLength.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KuromojiStemmerTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMinimumLength, value.MinimumLength, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.KuromojiStemmerTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.KuromojiStemmerTokenFilterConverter))] public sealed partial class KuromojiStemmerTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiTokenizationMode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiTokenizationMode.Converters.g.cs new file mode 100644 index 00000000000..268ab4ecdb8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiTokenizationMode.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class KuromojiTokenizationModeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberExtended = System.Text.Json.JsonEncodedText.Encode("extended"); + private static readonly System.Text.Json.JsonEncodedText MemberNormal = System.Text.Json.JsonEncodedText.Encode("normal"); + private static readonly System.Text.Json.JsonEncodedText MemberSearch = System.Text.Json.JsonEncodedText.Encode("search"); + + public override Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberExtended)) + { + return Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode.Extended; + } + + if (reader.ValueTextEquals(MemberNormal)) + { + return Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode.Normal; + } + + if (reader.ValueTextEquals(MemberSearch)) + { + return Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode.Search; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberExtended.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode.Extended; + } + + if (string.Equals(value, MemberNormal.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode.Normal; + } + + if (string.Equals(value, MemberSearch.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode.Search; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode.Extended: + writer.WriteStringValue(MemberExtended); + break; + case Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode.Normal: + writer.WriteStringValue(MemberNormal); + break; + case Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode.Search: + writer.WriteStringValue(MemberSearch); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiTokenizationMode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiTokenizationMode.g.cs new file mode 100644 index 00000000000..21be9287813 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiTokenizationMode.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.KuromojiTokenizationModeConverter))] +public enum KuromojiTokenizationMode +{ + [System.Runtime.Serialization.EnumMember(Value = "extended")] + Extended, + [System.Runtime.Serialization.EnumMember(Value = "normal")] + Normal, + [System.Runtime.Serialization.EnumMember(Value = "search")] + Search +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiTokenizer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiTokenizer.Converters.g.cs new file mode 100644 index 00000000000..5ac6abcf024 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiTokenizer.Converters.g.cs @@ -0,0 +1,134 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class KuromojiTokenizerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDiscardCompoundToken = System.Text.Json.JsonEncodedText.Encode("discard_compound_token"); + private static readonly System.Text.Json.JsonEncodedText PropDiscardPunctuation = System.Text.Json.JsonEncodedText.Encode("discard_punctuation"); + private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); + private static readonly System.Text.Json.JsonEncodedText PropNbestCost = System.Text.Json.JsonEncodedText.Encode("nbest_cost"); + private static readonly System.Text.Json.JsonEncodedText PropNbestExamples = System.Text.Json.JsonEncodedText.Encode("nbest_examples"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropUserDictionary = System.Text.Json.JsonEncodedText.Encode("user_dictionary"); + private static readonly System.Text.Json.JsonEncodedText PropUserDictionaryRules = System.Text.Json.JsonEncodedText.Encode("user_dictionary_rules"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDiscardCompoundToken = default; + LocalJsonValue propDiscardPunctuation = default; + LocalJsonValue propMode = default; + LocalJsonValue propNbestCost = default; + LocalJsonValue propNbestExamples = default; + LocalJsonValue propUserDictionary = default; + LocalJsonValue?> propUserDictionaryRules = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDiscardCompoundToken.TryReadProperty(ref reader, options, PropDiscardCompoundToken, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDiscardPunctuation.TryReadProperty(ref reader, options, PropDiscardPunctuation, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMode.TryReadProperty(ref reader, options, PropMode, null)) + { + continue; + } + + if (propNbestCost.TryReadProperty(ref reader, options, PropNbestCost, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNbestExamples.TryReadProperty(ref reader, options, PropNbestExamples, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propUserDictionary.TryReadProperty(ref reader, options, PropUserDictionary, null)) + { + continue; + } + + if (propUserDictionaryRules.TryReadProperty(ref reader, options, PropUserDictionaryRules, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DiscardCompoundToken = propDiscardCompoundToken.Value, + DiscardPunctuation = propDiscardPunctuation.Value, + Mode = propMode.Value, + NbestCost = propNbestCost.Value, + NbestExamples = propNbestExamples.Value, + UserDictionary = propUserDictionary.Value, + UserDictionaryRules = propUserDictionaryRules.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDiscardCompoundToken, value.DiscardCompoundToken, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDiscardPunctuation, value.DiscardPunctuation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMode, value.Mode, null, null); + writer.WriteProperty(options, PropNbestCost, value.NbestCost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNbestExamples, value.NbestExamples, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropUserDictionary, value.UserDictionary, null, null); + writer.WriteProperty(options, PropUserDictionaryRules, value.UserDictionaryRules, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiTokenizer.g.cs index 98461adc384..e429d4a1e9e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiTokenizer.g.cs @@ -23,117 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class KuromojiTokenizerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDiscardCompoundToken = System.Text.Json.JsonEncodedText.Encode("discard_compound_token"); - private static readonly System.Text.Json.JsonEncodedText PropDiscardPunctuation = System.Text.Json.JsonEncodedText.Encode("discard_punctuation"); - private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); - private static readonly System.Text.Json.JsonEncodedText PropNbestCost = System.Text.Json.JsonEncodedText.Encode("nbest_cost"); - private static readonly System.Text.Json.JsonEncodedText PropNbestExamples = System.Text.Json.JsonEncodedText.Encode("nbest_examples"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropUserDictionary = System.Text.Json.JsonEncodedText.Encode("user_dictionary"); - private static readonly System.Text.Json.JsonEncodedText PropUserDictionaryRules = System.Text.Json.JsonEncodedText.Encode("user_dictionary_rules"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDiscardCompoundToken = default; - LocalJsonValue propDiscardPunctuation = default; - LocalJsonValue propMode = default; - LocalJsonValue propNbestCost = default; - LocalJsonValue propNbestExamples = default; - LocalJsonValue propUserDictionary = default; - LocalJsonValue?> propUserDictionaryRules = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDiscardCompoundToken.TryReadProperty(ref reader, options, PropDiscardCompoundToken, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDiscardPunctuation.TryReadProperty(ref reader, options, PropDiscardPunctuation, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMode.TryReadProperty(ref reader, options, PropMode, null)) - { - continue; - } - - if (propNbestCost.TryReadProperty(ref reader, options, PropNbestCost, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNbestExamples.TryReadProperty(ref reader, options, PropNbestExamples, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propUserDictionary.TryReadProperty(ref reader, options, PropUserDictionary, null)) - { - continue; - } - - if (propUserDictionaryRules.TryReadProperty(ref reader, options, PropUserDictionaryRules, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DiscardCompoundToken = propDiscardCompoundToken.Value, - DiscardPunctuation = propDiscardPunctuation.Value, - Mode = propMode.Value, - NbestCost = propNbestCost.Value, - NbestExamples = propNbestExamples.Value, - UserDictionary = propUserDictionary.Value, - UserDictionaryRules = propUserDictionaryRules.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDiscardCompoundToken, value.DiscardCompoundToken, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDiscardPunctuation, value.DiscardPunctuation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMode, value.Mode, null, null); - writer.WriteProperty(options, PropNbestCost, value.NbestCost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNbestExamples, value.NbestExamples, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropUserDictionary, value.UserDictionary, null, null); - writer.WriteProperty(options, PropUserDictionaryRules, value.UserDictionaryRules, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.KuromojiTokenizerConverter))] public sealed partial class KuromojiTokenizer : Elastic.Clients.Elasticsearch.Analysis.ITokenizer { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LatvianAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LatvianAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..47c1459dfac --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LatvianAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class LatvianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.LatvianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.LatvianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.LatvianAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LatvianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LatvianAnalyzer.g.cs index 36aebd55fc0..a8a13a34b37 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LatvianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LatvianAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class LatvianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.LatvianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.LatvianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.LatvianAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.LatvianAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.LatvianAnalyzerConverter))] public sealed partial class LatvianAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LengthTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LengthTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..de1eb3b0004 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LengthTokenFilter.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class LengthTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.LengthTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMax = default; + LocalJsonValue propMin = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMax.TryReadProperty(ref reader, options, PropMax, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMin.TryReadProperty(ref reader, options, PropMin, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.LengthTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Max = propMax.Value, + Min = propMin.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.LengthTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMax, value.Max, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMin, value.Min, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LengthTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LengthTokenFilter.g.cs index 85a00529de4..4ef9ecdc70d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LengthTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LengthTokenFilter.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class LengthTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); - private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.LengthTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMax = default; - LocalJsonValue propMin = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMax.TryReadProperty(ref reader, options, PropMax, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMin.TryReadProperty(ref reader, options, PropMin, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.LengthTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Max = propMax.Value, - Min = propMin.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.LengthTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMax, value.Max, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMin, value.Min, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.LengthTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.LengthTokenFilterConverter))] public sealed partial class LengthTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LetterTokenizer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LetterTokenizer.Converters.g.cs new file mode 100644 index 00000000000..120ac117c74 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LetterTokenizer.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class LetterTokenizerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.LetterTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.LetterTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.LetterTokenizer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LetterTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LetterTokenizer.g.cs index 2dcf2358c38..845bd5b7973 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LetterTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LetterTokenizer.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class LetterTokenizerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.LetterTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.LetterTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.LetterTokenizer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.LetterTokenizerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.LetterTokenizerConverter))] public sealed partial class LetterTokenizer : Elastic.Clients.Elasticsearch.Analysis.ITokenizer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LimitTokenCountTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LimitTokenCountTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..0a1507ad551 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LimitTokenCountTokenFilter.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class LimitTokenCountTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropConsumeAllTokens = System.Text.Json.JsonEncodedText.Encode("consume_all_tokens"); + private static readonly System.Text.Json.JsonEncodedText PropMaxTokenCount = System.Text.Json.JsonEncodedText.Encode("max_token_count"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.LimitTokenCountTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propConsumeAllTokens = default; + LocalJsonValue propMaxTokenCount = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propConsumeAllTokens.TryReadProperty(ref reader, options, PropConsumeAllTokens, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxTokenCount.TryReadProperty(ref reader, options, PropMaxTokenCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.LimitTokenCountTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ConsumeAllTokens = propConsumeAllTokens.Value, + MaxTokenCount = propMaxTokenCount.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.LimitTokenCountTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropConsumeAllTokens, value.ConsumeAllTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxTokenCount, value.MaxTokenCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LimitTokenCountTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LimitTokenCountTokenFilter.g.cs index 0ffbb5a1b2e..7c2300eadde 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LimitTokenCountTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LimitTokenCountTokenFilter.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class LimitTokenCountTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropConsumeAllTokens = System.Text.Json.JsonEncodedText.Encode("consume_all_tokens"); - private static readonly System.Text.Json.JsonEncodedText PropMaxTokenCount = System.Text.Json.JsonEncodedText.Encode("max_token_count"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.LimitTokenCountTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propConsumeAllTokens = default; - LocalJsonValue propMaxTokenCount = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propConsumeAllTokens.TryReadProperty(ref reader, options, PropConsumeAllTokens, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxTokenCount.TryReadProperty(ref reader, options, PropMaxTokenCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.LimitTokenCountTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ConsumeAllTokens = propConsumeAllTokens.Value, - MaxTokenCount = propMaxTokenCount.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.LimitTokenCountTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropConsumeAllTokens, value.ConsumeAllTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxTokenCount, value.MaxTokenCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.LimitTokenCountTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.LimitTokenCountTokenFilterConverter))] public sealed partial class LimitTokenCountTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LithuanianAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LithuanianAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..25a511a623a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LithuanianAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class LithuanianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.LithuanianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.LithuanianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.LithuanianAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LithuanianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LithuanianAnalyzer.g.cs index b1f03299939..1c1980a1877 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LithuanianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LithuanianAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class LithuanianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.LithuanianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.LithuanianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.LithuanianAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.LithuanianAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.LithuanianAnalyzerConverter))] public sealed partial class LithuanianAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseNormalizer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseNormalizer.Converters.g.cs new file mode 100644 index 00000000000..656e428e6db --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseNormalizer.Converters.g.cs @@ -0,0 +1,62 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class LowercaseNormalizerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.LowercaseNormalizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.LowercaseNormalizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.LowercaseNormalizer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseNormalizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseNormalizer.g.cs index e27b218e23f..ac6b403e8b0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseNormalizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseNormalizer.g.cs @@ -23,45 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class LowercaseNormalizerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.LowercaseNormalizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.LowercaseNormalizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.LowercaseNormalizer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.LowercaseNormalizerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.LowercaseNormalizerConverter))] public sealed partial class LowercaseNormalizer : Elastic.Clients.Elasticsearch.Analysis.INormalizer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..0384a68c0d4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenFilter.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class LowercaseTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLanguage = System.Text.Json.JsonEncodedText.Encode("language"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLanguage = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLanguage.TryReadProperty(ref reader, options, PropLanguage, static Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Language = propLanguage.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLanguage, value.Language, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenFilter.g.cs index 90625895839..13e33c615c1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenFilter.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class LowercaseTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLanguage = System.Text.Json.JsonEncodedText.Encode("language"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLanguage = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLanguage.TryReadProperty(ref reader, options, PropLanguage, static Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Language = propLanguage.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLanguage, value.Language, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.LowercaseTokenFilterConverter))] public sealed partial class LowercaseTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenFilterLanguages.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenFilterLanguages.Converters.g.cs new file mode 100644 index 00000000000..05516b5f4cd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenFilterLanguages.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class LowercaseTokenFilterLanguagesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberGreek = System.Text.Json.JsonEncodedText.Encode("greek"); + private static readonly System.Text.Json.JsonEncodedText MemberIrish = System.Text.Json.JsonEncodedText.Encode("irish"); + private static readonly System.Text.Json.JsonEncodedText MemberTurkish = System.Text.Json.JsonEncodedText.Encode("turkish"); + + public override Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberGreek)) + { + return Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Greek; + } + + if (reader.ValueTextEquals(MemberIrish)) + { + return Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Irish; + } + + if (reader.ValueTextEquals(MemberTurkish)) + { + return Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Turkish; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberGreek.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Greek; + } + + if (string.Equals(value, MemberIrish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Irish; + } + + if (string.Equals(value, MemberTurkish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Turkish; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Greek: + writer.WriteStringValue(MemberGreek); + break; + case Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Irish: + writer.WriteStringValue(MemberIrish); + break; + case Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Turkish: + writer.WriteStringValue(MemberTurkish); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenFilterLanguages.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenFilterLanguages.g.cs new file mode 100644 index 00000000000..d6833846fc0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenFilterLanguages.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.LowercaseTokenFilterLanguagesConverter))] +public enum LowercaseTokenFilterLanguages +{ + [System.Runtime.Serialization.EnumMember(Value = "greek")] + Greek, + [System.Runtime.Serialization.EnumMember(Value = "irish")] + Irish, + [System.Runtime.Serialization.EnumMember(Value = "turkish")] + Turkish +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenizer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenizer.Converters.g.cs new file mode 100644 index 00000000000..7f7ac8a388c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenizer.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class LowercaseTokenizerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenizer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenizer.g.cs index 661bfed7104..bfc5c97b232 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenizer.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class LowercaseTokenizerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenizer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenizerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.LowercaseTokenizerConverter))] public sealed partial class LowercaseTokenizer : Elastic.Clients.Elasticsearch.Analysis.ITokenizer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MappingCharFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MappingCharFilter.Converters.g.cs new file mode 100644 index 00000000000..69b934fc99b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MappingCharFilter.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class MappingCharFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); + private static readonly System.Text.Json.JsonEncodedText PropMappingsPath = System.Text.Json.JsonEncodedText.Encode("mappings_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.MappingCharFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propMappings = default; + LocalJsonValue propMappingsPath = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMappings.TryReadProperty(ref reader, options, PropMappings, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propMappingsPath.TryReadProperty(ref reader, options, PropMappingsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.MappingCharFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Mappings = propMappings.Value, + MappingsPath = propMappingsPath.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.MappingCharFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMappings, value.Mappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMappingsPath, value.MappingsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MappingCharFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MappingCharFilter.g.cs index c4d62e44b00..2ea77d9dd1a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MappingCharFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MappingCharFilter.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class MappingCharFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); - private static readonly System.Text.Json.JsonEncodedText PropMappingsPath = System.Text.Json.JsonEncodedText.Encode("mappings_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.MappingCharFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propMappings = default; - LocalJsonValue propMappingsPath = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMappings.TryReadProperty(ref reader, options, PropMappings, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propMappingsPath.TryReadProperty(ref reader, options, PropMappingsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.MappingCharFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Mappings = propMappings.Value, - MappingsPath = propMappingsPath.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.MappingCharFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMappings, value.Mappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMappingsPath, value.MappingsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.MappingCharFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.MappingCharFilterConverter))] public sealed partial class MappingCharFilter : Elastic.Clients.Elasticsearch.Analysis.ICharFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MinHashTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MinHashTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..f0b3f876ca1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MinHashTokenFilter.Converters.g.cs @@ -0,0 +1,107 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class MinHashTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucketCount = System.Text.Json.JsonEncodedText.Encode("bucket_count"); + private static readonly System.Text.Json.JsonEncodedText PropHashCount = System.Text.Json.JsonEncodedText.Encode("hash_count"); + private static readonly System.Text.Json.JsonEncodedText PropHashSetSize = System.Text.Json.JsonEncodedText.Encode("hash_set_size"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + private static readonly System.Text.Json.JsonEncodedText PropWithRotation = System.Text.Json.JsonEncodedText.Encode("with_rotation"); + + public override Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucketCount = default; + LocalJsonValue propHashCount = default; + LocalJsonValue propHashSetSize = default; + LocalJsonValue propVersion = default; + LocalJsonValue propWithRotation = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucketCount.TryReadProperty(ref reader, options, PropBucketCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propHashCount.TryReadProperty(ref reader, options, PropHashCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propHashSetSize.TryReadProperty(ref reader, options, PropHashSetSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (propWithRotation.TryReadProperty(ref reader, options, PropWithRotation, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BucketCount = propBucketCount.Value, + HashCount = propHashCount.Value, + HashSetSize = propHashSetSize.Value, + Version = propVersion.Value, + WithRotation = propWithRotation.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucketCount, value.BucketCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropHashCount, value.HashCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropHashSetSize, value.HashSetSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteProperty(options, PropWithRotation, value.WithRotation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MinHashTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MinHashTokenFilter.g.cs index 71c87bdca19..5e3fa814345 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MinHashTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MinHashTokenFilter.g.cs @@ -23,90 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class MinHashTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBucketCount = System.Text.Json.JsonEncodedText.Encode("bucket_count"); - private static readonly System.Text.Json.JsonEncodedText PropHashCount = System.Text.Json.JsonEncodedText.Encode("hash_count"); - private static readonly System.Text.Json.JsonEncodedText PropHashSetSize = System.Text.Json.JsonEncodedText.Encode("hash_set_size"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - private static readonly System.Text.Json.JsonEncodedText PropWithRotation = System.Text.Json.JsonEncodedText.Encode("with_rotation"); - - public override Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBucketCount = default; - LocalJsonValue propHashCount = default; - LocalJsonValue propHashSetSize = default; - LocalJsonValue propVersion = default; - LocalJsonValue propWithRotation = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBucketCount.TryReadProperty(ref reader, options, PropBucketCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propHashCount.TryReadProperty(ref reader, options, PropHashCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propHashSetSize.TryReadProperty(ref reader, options, PropHashSetSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (propWithRotation.TryReadProperty(ref reader, options, PropWithRotation, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BucketCount = propBucketCount.Value, - HashCount = propHashCount.Value, - HashSetSize = propHashSetSize.Value, - Version = propVersion.Value, - WithRotation = propWithRotation.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBucketCount, value.BucketCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropHashCount, value.HashCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropHashSetSize, value.HashSetSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteProperty(options, PropWithRotation, value.WithRotation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.MinHashTokenFilterConverter))] public sealed partial class MinHashTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MultiplexerTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MultiplexerTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..f84a1e59401 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MultiplexerTokenFilter.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class MultiplexerTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFilters = System.Text.Json.JsonEncodedText.Encode("filters"); + private static readonly System.Text.Json.JsonEncodedText PropPreserveOriginal = System.Text.Json.JsonEncodedText.Encode("preserve_original"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.MultiplexerTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propFilters = default; + LocalJsonValue propPreserveOriginal = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFilters.TryReadProperty(ref reader, options, PropFilters, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propPreserveOriginal.TryReadProperty(ref reader, options, PropPreserveOriginal, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.MultiplexerTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Filters = propFilters.Value, + PreserveOriginal = propPreserveOriginal.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.MultiplexerTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFilters, value.Filters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPreserveOriginal, value.PreserveOriginal, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MultiplexerTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MultiplexerTokenFilter.g.cs index 8912a81dc0e..6d8140b268a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MultiplexerTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MultiplexerTokenFilter.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class MultiplexerTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFilters = System.Text.Json.JsonEncodedText.Encode("filters"); - private static readonly System.Text.Json.JsonEncodedText PropPreserveOriginal = System.Text.Json.JsonEncodedText.Encode("preserve_original"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.MultiplexerTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propFilters = default; - LocalJsonValue propPreserveOriginal = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFilters.TryReadProperty(ref reader, options, PropFilters, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propPreserveOriginal.TryReadProperty(ref reader, options, PropPreserveOriginal, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.MultiplexerTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Filters = propFilters.Value, - PreserveOriginal = propPreserveOriginal.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.MultiplexerTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFilters, value.Filters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPreserveOriginal, value.PreserveOriginal, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.MultiplexerTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.MultiplexerTokenFilterConverter))] public sealed partial class MultiplexerTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..8fd28b5ccd4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenFilter.Converters.g.cs @@ -0,0 +1,98 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class NGramTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxGram = System.Text.Json.JsonEncodedText.Encode("max_gram"); + private static readonly System.Text.Json.JsonEncodedText PropMinGram = System.Text.Json.JsonEncodedText.Encode("min_gram"); + private static readonly System.Text.Json.JsonEncodedText PropPreserveOriginal = System.Text.Json.JsonEncodedText.Encode("preserve_original"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.NGramTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxGram = default; + LocalJsonValue propMinGram = default; + LocalJsonValue propPreserveOriginal = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxGram.TryReadProperty(ref reader, options, PropMaxGram, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinGram.TryReadProperty(ref reader, options, PropMinGram, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPreserveOriginal.TryReadProperty(ref reader, options, PropPreserveOriginal, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.NGramTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxGram = propMaxGram.Value, + MinGram = propMinGram.Value, + PreserveOriginal = propPreserveOriginal.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.NGramTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxGram, value.MaxGram, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinGram, value.MinGram, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPreserveOriginal, value.PreserveOriginal, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenFilter.g.cs index b6888c851aa..4d06e64b3e9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenFilter.g.cs @@ -23,81 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class NGramTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxGram = System.Text.Json.JsonEncodedText.Encode("max_gram"); - private static readonly System.Text.Json.JsonEncodedText PropMinGram = System.Text.Json.JsonEncodedText.Encode("min_gram"); - private static readonly System.Text.Json.JsonEncodedText PropPreserveOriginal = System.Text.Json.JsonEncodedText.Encode("preserve_original"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.NGramTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxGram = default; - LocalJsonValue propMinGram = default; - LocalJsonValue propPreserveOriginal = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxGram.TryReadProperty(ref reader, options, PropMaxGram, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinGram.TryReadProperty(ref reader, options, PropMinGram, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPreserveOriginal.TryReadProperty(ref reader, options, PropPreserveOriginal, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.NGramTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxGram = propMaxGram.Value, - MinGram = propMinGram.Value, - PreserveOriginal = propPreserveOriginal.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.NGramTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxGram, value.MaxGram, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinGram, value.MinGram, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPreserveOriginal, value.PreserveOriginal, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.NGramTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.NGramTokenFilterConverter))] public sealed partial class NGramTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenizer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenizer.Converters.g.cs new file mode 100644 index 00000000000..d7cf8ca4949 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenizer.Converters.g.cs @@ -0,0 +1,107 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class NGramTokenizerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCustomTokenChars = System.Text.Json.JsonEncodedText.Encode("custom_token_chars"); + private static readonly System.Text.Json.JsonEncodedText PropMaxGram = System.Text.Json.JsonEncodedText.Encode("max_gram"); + private static readonly System.Text.Json.JsonEncodedText PropMinGram = System.Text.Json.JsonEncodedText.Encode("min_gram"); + private static readonly System.Text.Json.JsonEncodedText PropTokenChars = System.Text.Json.JsonEncodedText.Encode("token_chars"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.NGramTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCustomTokenChars = default; + LocalJsonValue propMaxGram = default; + LocalJsonValue propMinGram = default; + LocalJsonValue?> propTokenChars = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCustomTokenChars.TryReadProperty(ref reader, options, PropCustomTokenChars, null)) + { + continue; + } + + if (propMaxGram.TryReadProperty(ref reader, options, PropMaxGram, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinGram.TryReadProperty(ref reader, options, PropMinGram, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTokenChars.TryReadProperty(ref reader, options, PropTokenChars, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.NGramTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CustomTokenChars = propCustomTokenChars.Value, + MaxGram = propMaxGram.Value, + MinGram = propMinGram.Value, + TokenChars = propTokenChars.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.NGramTokenizer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCustomTokenChars, value.CustomTokenChars, null, null); + writer.WriteProperty(options, PropMaxGram, value.MaxGram, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinGram, value.MinGram, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTokenChars, value.TokenChars, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenizer.g.cs index f13a810e4bc..9af20067b9f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenizer.g.cs @@ -23,90 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class NGramTokenizerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCustomTokenChars = System.Text.Json.JsonEncodedText.Encode("custom_token_chars"); - private static readonly System.Text.Json.JsonEncodedText PropMaxGram = System.Text.Json.JsonEncodedText.Encode("max_gram"); - private static readonly System.Text.Json.JsonEncodedText PropMinGram = System.Text.Json.JsonEncodedText.Encode("min_gram"); - private static readonly System.Text.Json.JsonEncodedText PropTokenChars = System.Text.Json.JsonEncodedText.Encode("token_chars"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.NGramTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCustomTokenChars = default; - LocalJsonValue propMaxGram = default; - LocalJsonValue propMinGram = default; - LocalJsonValue?> propTokenChars = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCustomTokenChars.TryReadProperty(ref reader, options, PropCustomTokenChars, null)) - { - continue; - } - - if (propMaxGram.TryReadProperty(ref reader, options, PropMaxGram, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinGram.TryReadProperty(ref reader, options, PropMinGram, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTokenChars.TryReadProperty(ref reader, options, PropTokenChars, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.NGramTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CustomTokenChars = propCustomTokenChars.Value, - MaxGram = propMaxGram.Value, - MinGram = propMinGram.Value, - TokenChars = propTokenChars.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.NGramTokenizer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCustomTokenChars, value.CustomTokenChars, null, null); - writer.WriteProperty(options, PropMaxGram, value.MaxGram, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinGram, value.MinGram, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTokenChars, value.TokenChars, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.NGramTokenizerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.NGramTokenizerConverter))] public sealed partial class NGramTokenizer : Elastic.Clients.Elasticsearch.Analysis.ITokenizer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..d81ca09631a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriAnalyzer.Converters.g.cs @@ -0,0 +1,103 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class NoriAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDecompoundMode = System.Text.Json.JsonEncodedText.Encode("decompound_mode"); + private static readonly System.Text.Json.JsonEncodedText PropStoptags = System.Text.Json.JsonEncodedText.Encode("stoptags"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropUserDictionary = System.Text.Json.JsonEncodedText.Encode("user_dictionary"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.NoriAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDecompoundMode = default; + LocalJsonValue?> propStoptags = default; + LocalJsonValue propUserDictionary = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDecompoundMode.TryReadProperty(ref reader, options, PropDecompoundMode, static Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propStoptags.TryReadProperty(ref reader, options, PropStoptags, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propUserDictionary.TryReadProperty(ref reader, options, PropUserDictionary, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.NoriAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DecompoundMode = propDecompoundMode.Value, + Stoptags = propStoptags.Value, + UserDictionary = propUserDictionary.Value, +#pragma warning disable CS0618 + Version = propVersion.Value +#pragma warning restore CS0618 + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.NoriAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDecompoundMode, value.DecompoundMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropStoptags, value.Stoptags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropUserDictionary, value.UserDictionary, null, null); +#pragma warning disable CS0618 + writer.WriteProperty(options, PropVersion, value.Version, null, null) +#pragma warning restore CS0618 + ; + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriAnalyzer.g.cs index cca5f645ee4..ac801286c37 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriAnalyzer.g.cs @@ -23,86 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class NoriAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDecompoundMode = System.Text.Json.JsonEncodedText.Encode("decompound_mode"); - private static readonly System.Text.Json.JsonEncodedText PropStoptags = System.Text.Json.JsonEncodedText.Encode("stoptags"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropUserDictionary = System.Text.Json.JsonEncodedText.Encode("user_dictionary"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.NoriAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDecompoundMode = default; - LocalJsonValue?> propStoptags = default; - LocalJsonValue propUserDictionary = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDecompoundMode.TryReadProperty(ref reader, options, PropDecompoundMode, static Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propStoptags.TryReadProperty(ref reader, options, PropStoptags, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propUserDictionary.TryReadProperty(ref reader, options, PropUserDictionary, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.NoriAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DecompoundMode = propDecompoundMode.Value, - Stoptags = propStoptags.Value, - UserDictionary = propUserDictionary.Value, -#pragma warning disable CS0618 - Version = propVersion.Value -#pragma warning restore CS0618 - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.NoriAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDecompoundMode, value.DecompoundMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropStoptags, value.Stoptags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropUserDictionary, value.UserDictionary, null, null); -#pragma warning disable CS0618 - writer.WriteProperty(options, PropVersion, value.Version, null, null) -#pragma warning restore CS0618 - ; - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.NoriAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.NoriAnalyzerConverter))] public sealed partial class NoriAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriDecompoundMode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriDecompoundMode.Converters.g.cs new file mode 100644 index 00000000000..26276417738 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriDecompoundMode.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class NoriDecompoundModeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberDiscard = System.Text.Json.JsonEncodedText.Encode("discard"); + private static readonly System.Text.Json.JsonEncodedText MemberMixed = System.Text.Json.JsonEncodedText.Encode("mixed"); + private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); + + public override Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberDiscard)) + { + return Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode.Discard; + } + + if (reader.ValueTextEquals(MemberMixed)) + { + return Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode.Mixed; + } + + if (reader.ValueTextEquals(MemberNone)) + { + return Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode.None; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberDiscard.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode.Discard; + } + + if (string.Equals(value, MemberMixed.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode.Mixed; + } + + if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode.None; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode.Discard: + writer.WriteStringValue(MemberDiscard); + break; + case Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode.Mixed: + writer.WriteStringValue(MemberMixed); + break; + case Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode.None: + writer.WriteStringValue(MemberNone); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriDecompoundMode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriDecompoundMode.g.cs new file mode 100644 index 00000000000..5ed2de0c728 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriDecompoundMode.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.NoriDecompoundModeConverter))] +public enum NoriDecompoundMode +{ + [System.Runtime.Serialization.EnumMember(Value = "discard")] + Discard, + [System.Runtime.Serialization.EnumMember(Value = "mixed")] + Mixed, + [System.Runtime.Serialization.EnumMember(Value = "none")] + None +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriPartOfSpeechTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriPartOfSpeechTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..fcc208a9b28 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriPartOfSpeechTokenFilter.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class NoriPartOfSpeechTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStoptags = System.Text.Json.JsonEncodedText.Encode("stoptags"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.NoriPartOfSpeechTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStoptags = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStoptags.TryReadProperty(ref reader, options, PropStoptags, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.NoriPartOfSpeechTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Stoptags = propStoptags.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.NoriPartOfSpeechTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStoptags, value.Stoptags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriPartOfSpeechTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriPartOfSpeechTokenFilter.g.cs index 4a2f9a75e55..ed82cde23f4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriPartOfSpeechTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriPartOfSpeechTokenFilter.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class NoriPartOfSpeechTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStoptags = System.Text.Json.JsonEncodedText.Encode("stoptags"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.NoriPartOfSpeechTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStoptags = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStoptags.TryReadProperty(ref reader, options, PropStoptags, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.NoriPartOfSpeechTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Stoptags = propStoptags.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.NoriPartOfSpeechTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStoptags, value.Stoptags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.NoriPartOfSpeechTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.NoriPartOfSpeechTokenFilterConverter))] public sealed partial class NoriPartOfSpeechTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriTokenizer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriTokenizer.Converters.g.cs new file mode 100644 index 00000000000..14e33a1a8b6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriTokenizer.Converters.g.cs @@ -0,0 +1,107 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class NoriTokenizerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDecompoundMode = System.Text.Json.JsonEncodedText.Encode("decompound_mode"); + private static readonly System.Text.Json.JsonEncodedText PropDiscardPunctuation = System.Text.Json.JsonEncodedText.Encode("discard_punctuation"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropUserDictionary = System.Text.Json.JsonEncodedText.Encode("user_dictionary"); + private static readonly System.Text.Json.JsonEncodedText PropUserDictionaryRules = System.Text.Json.JsonEncodedText.Encode("user_dictionary_rules"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.NoriTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDecompoundMode = default; + LocalJsonValue propDiscardPunctuation = default; + LocalJsonValue propUserDictionary = default; + LocalJsonValue?> propUserDictionaryRules = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDecompoundMode.TryReadProperty(ref reader, options, PropDecompoundMode, static Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDiscardPunctuation.TryReadProperty(ref reader, options, PropDiscardPunctuation, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propUserDictionary.TryReadProperty(ref reader, options, PropUserDictionary, null)) + { + continue; + } + + if (propUserDictionaryRules.TryReadProperty(ref reader, options, PropUserDictionaryRules, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.NoriTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DecompoundMode = propDecompoundMode.Value, + DiscardPunctuation = propDiscardPunctuation.Value, + UserDictionary = propUserDictionary.Value, + UserDictionaryRules = propUserDictionaryRules.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.NoriTokenizer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDecompoundMode, value.DecompoundMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDiscardPunctuation, value.DiscardPunctuation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropUserDictionary, value.UserDictionary, null, null); + writer.WriteProperty(options, PropUserDictionaryRules, value.UserDictionaryRules, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriTokenizer.g.cs index 940e7a560be..d3fe810e835 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriTokenizer.g.cs @@ -23,90 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class NoriTokenizerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDecompoundMode = System.Text.Json.JsonEncodedText.Encode("decompound_mode"); - private static readonly System.Text.Json.JsonEncodedText PropDiscardPunctuation = System.Text.Json.JsonEncodedText.Encode("discard_punctuation"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropUserDictionary = System.Text.Json.JsonEncodedText.Encode("user_dictionary"); - private static readonly System.Text.Json.JsonEncodedText PropUserDictionaryRules = System.Text.Json.JsonEncodedText.Encode("user_dictionary_rules"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.NoriTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDecompoundMode = default; - LocalJsonValue propDiscardPunctuation = default; - LocalJsonValue propUserDictionary = default; - LocalJsonValue?> propUserDictionaryRules = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDecompoundMode.TryReadProperty(ref reader, options, PropDecompoundMode, static Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDiscardPunctuation.TryReadProperty(ref reader, options, PropDiscardPunctuation, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propUserDictionary.TryReadProperty(ref reader, options, PropUserDictionary, null)) - { - continue; - } - - if (propUserDictionaryRules.TryReadProperty(ref reader, options, PropUserDictionaryRules, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.NoriTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DecompoundMode = propDecompoundMode.Value, - DiscardPunctuation = propDiscardPunctuation.Value, - UserDictionary = propUserDictionary.Value, - UserDictionaryRules = propUserDictionaryRules.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.NoriTokenizer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDecompoundMode, value.DecompoundMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDiscardPunctuation, value.DiscardPunctuation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropUserDictionary, value.UserDictionary, null, null); - writer.WriteProperty(options, PropUserDictionaryRules, value.UserDictionaryRules, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.NoriTokenizerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.NoriTokenizerConverter))] public sealed partial class NoriTokenizer : Elastic.Clients.Elasticsearch.Analysis.ITokenizer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Normalizer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Normalizer.Converters.g.cs new file mode 100644 index 00000000000..0987cca451f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Normalizer.Converters.g.cs @@ -0,0 +1,68 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class INormalizerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDiscriminator = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.INormalizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + var readerSnapshot = reader; + string? discriminator = "custom"; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.TryReadProperty(options, PropDiscriminator, ref discriminator, null)) + { + break; + } + + reader.Skip(); + } + + reader = readerSnapshot; + return discriminator switch + { + "custom" => reader.ReadValue(options, null), + "lowercase" => reader.ReadValue(options, null), + _ => throw new System.Text.Json.JsonException($"Variant '{discriminator}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Analysis.INormalizer)}'.") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.INormalizer value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Type) + { + case "custom": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.CustomNormalizer)value, null); + break; + case "lowercase": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.LowercaseNormalizer)value, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.Type}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Analysis.INormalizer)}'."); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Normalizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Normalizer.g.cs index 9cfc5af48be..5b86a622b2e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Normalizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Normalizer.g.cs @@ -23,51 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class INormalizerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDiscriminator = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.INormalizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - var readerSnapshot = reader; - string? discriminator = "custom"; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.TryReadProperty(options, PropDiscriminator, ref discriminator, null)) - { - break; - } - - reader.Skip(); - } - - reader = readerSnapshot; - return discriminator switch - { - "custom" => reader.ReadValue(options, null), - "lowercase" => reader.ReadValue(options, null), - _ => throw new System.Text.Json.JsonException($"Variant '{discriminator}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Analysis.INormalizer)}'.") - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.INormalizer value, System.Text.Json.JsonSerializerOptions options) - { - switch (value.Type) - { - case "custom": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.CustomNormalizer)value, null); - break; - case "lowercase": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.LowercaseNormalizer)value, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.Type}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Analysis.INormalizer)}'."); - } - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.INormalizerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.INormalizerConverter))] public partial interface INormalizer { public string Type { get; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Normalizers.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Normalizers.Converters.g.cs new file mode 100644 index 00000000000..f43769cb2fe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Normalizers.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class NormalizersConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Analysis.Normalizers Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Analysis.Normalizers(reader.ReadValue?>(options, static System.Collections.Generic.Dictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.Normalizers value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.BackingDictionary, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.Dictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Normalizers.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Normalizers.g.cs index f35486224fb..3b8765a5a30 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Normalizers.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Normalizers.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class NormalizersConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Analysis.Normalizers Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Analysis.Normalizers(reader.ReadValue?>(options, static System.Collections.Generic.Dictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.Normalizers value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.BackingDictionary, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.Dictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.NormalizersConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.NormalizersConverter))] public sealed partial class Normalizers : Elastic.Clients.Elasticsearch.IsADictionary { public Normalizers() diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NorwegianAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NorwegianAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..4e56dedfc4b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NorwegianAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class NorwegianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.NorwegianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.NorwegianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.NorwegianAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NorwegianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NorwegianAnalyzer.g.cs index f2db3bead9e..6228f048052 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NorwegianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NorwegianAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class NorwegianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.NorwegianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.NorwegianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.NorwegianAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.NorwegianAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.NorwegianAnalyzerConverter))] public sealed partial class NorwegianAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PathHierarchyTokenizer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PathHierarchyTokenizer.Converters.g.cs new file mode 100644 index 00000000000..93ff240a97a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PathHierarchyTokenizer.Converters.g.cs @@ -0,0 +1,116 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class PathHierarchyTokenizerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBufferSize = System.Text.Json.JsonEncodedText.Encode("buffer_size"); + private static readonly System.Text.Json.JsonEncodedText PropDelimiter = System.Text.Json.JsonEncodedText.Encode("delimiter"); + private static readonly System.Text.Json.JsonEncodedText PropReplacement = System.Text.Json.JsonEncodedText.Encode("replacement"); + private static readonly System.Text.Json.JsonEncodedText PropReverse = System.Text.Json.JsonEncodedText.Encode("reverse"); + private static readonly System.Text.Json.JsonEncodedText PropSkip = System.Text.Json.JsonEncodedText.Encode("skip"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.PathHierarchyTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBufferSize = default; + LocalJsonValue propDelimiter = default; + LocalJsonValue propReplacement = default; + LocalJsonValue propReverse = default; + LocalJsonValue propSkip = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBufferSize.TryReadProperty(ref reader, options, PropBufferSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDelimiter.TryReadProperty(ref reader, options, PropDelimiter, null)) + { + continue; + } + + if (propReplacement.TryReadProperty(ref reader, options, PropReplacement, null)) + { + continue; + } + + if (propReverse.TryReadProperty(ref reader, options, PropReverse, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSkip.TryReadProperty(ref reader, options, PropSkip, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.PathHierarchyTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BufferSize = propBufferSize.Value, + Delimiter = propDelimiter.Value, + Replacement = propReplacement.Value, + Reverse = propReverse.Value, + Skip = propSkip.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PathHierarchyTokenizer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBufferSize, value.BufferSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDelimiter, value.Delimiter, null, null); + writer.WriteProperty(options, PropReplacement, value.Replacement, null, null); + writer.WriteProperty(options, PropReverse, value.Reverse, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSkip, value.Skip, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PathHierarchyTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PathHierarchyTokenizer.g.cs index 1cbc043ca87..d4f53eeab3f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PathHierarchyTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PathHierarchyTokenizer.g.cs @@ -23,99 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class PathHierarchyTokenizerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBufferSize = System.Text.Json.JsonEncodedText.Encode("buffer_size"); - private static readonly System.Text.Json.JsonEncodedText PropDelimiter = System.Text.Json.JsonEncodedText.Encode("delimiter"); - private static readonly System.Text.Json.JsonEncodedText PropReplacement = System.Text.Json.JsonEncodedText.Encode("replacement"); - private static readonly System.Text.Json.JsonEncodedText PropReverse = System.Text.Json.JsonEncodedText.Encode("reverse"); - private static readonly System.Text.Json.JsonEncodedText PropSkip = System.Text.Json.JsonEncodedText.Encode("skip"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.PathHierarchyTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBufferSize = default; - LocalJsonValue propDelimiter = default; - LocalJsonValue propReplacement = default; - LocalJsonValue propReverse = default; - LocalJsonValue propSkip = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBufferSize.TryReadProperty(ref reader, options, PropBufferSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDelimiter.TryReadProperty(ref reader, options, PropDelimiter, null)) - { - continue; - } - - if (propReplacement.TryReadProperty(ref reader, options, PropReplacement, null)) - { - continue; - } - - if (propReverse.TryReadProperty(ref reader, options, PropReverse, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSkip.TryReadProperty(ref reader, options, PropSkip, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.PathHierarchyTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BufferSize = propBufferSize.Value, - Delimiter = propDelimiter.Value, - Replacement = propReplacement.Value, - Reverse = propReverse.Value, - Skip = propSkip.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PathHierarchyTokenizer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBufferSize, value.BufferSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDelimiter, value.Delimiter, null, null); - writer.WriteProperty(options, PropReplacement, value.Replacement, null, null); - writer.WriteProperty(options, PropReverse, value.Reverse, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSkip, value.Skip, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.PathHierarchyTokenizerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.PathHierarchyTokenizerConverter))] public sealed partial class PathHierarchyTokenizer : Elastic.Clients.Elasticsearch.Analysis.ITokenizer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..832ae6b8a40 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternAnalyzer.Converters.g.cs @@ -0,0 +1,121 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class PatternAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFlags = System.Text.Json.JsonEncodedText.Encode("flags"); + private static readonly System.Text.Json.JsonEncodedText PropLowercase = System.Text.Json.JsonEncodedText.Encode("lowercase"); + private static readonly System.Text.Json.JsonEncodedText PropPattern = System.Text.Json.JsonEncodedText.Encode("pattern"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.PatternAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFlags = default; + LocalJsonValue propLowercase = default; + LocalJsonValue propPattern = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFlags.TryReadProperty(ref reader, options, PropFlags, null)) + { + continue; + } + + if (propLowercase.TryReadProperty(ref reader, options, PropLowercase, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPattern.TryReadProperty(ref reader, options, PropPattern, null)) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.PatternAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Flags = propFlags.Value, + Lowercase = propLowercase.Value, + Pattern = propPattern.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value, +#pragma warning disable CS0618 + Version = propVersion.Value +#pragma warning restore CS0618 + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PatternAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFlags, value.Flags, null, null); + writer.WriteProperty(options, PropLowercase, value.Lowercase, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPattern, value.Pattern, null, null); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); +#pragma warning disable CS0618 + writer.WriteProperty(options, PropVersion, value.Version, null, null) +#pragma warning restore CS0618 + ; + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternAnalyzer.g.cs index 353327ff5d4..c8a6b350677 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternAnalyzer.g.cs @@ -23,104 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class PatternAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFlags = System.Text.Json.JsonEncodedText.Encode("flags"); - private static readonly System.Text.Json.JsonEncodedText PropLowercase = System.Text.Json.JsonEncodedText.Encode("lowercase"); - private static readonly System.Text.Json.JsonEncodedText PropPattern = System.Text.Json.JsonEncodedText.Encode("pattern"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.PatternAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFlags = default; - LocalJsonValue propLowercase = default; - LocalJsonValue propPattern = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFlags.TryReadProperty(ref reader, options, PropFlags, null)) - { - continue; - } - - if (propLowercase.TryReadProperty(ref reader, options, PropLowercase, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPattern.TryReadProperty(ref reader, options, PropPattern, null)) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.PatternAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Flags = propFlags.Value, - Lowercase = propLowercase.Value, - Pattern = propPattern.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value, -#pragma warning disable CS0618 - Version = propVersion.Value -#pragma warning restore CS0618 - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PatternAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFlags, value.Flags, null, null); - writer.WriteProperty(options, PropLowercase, value.Lowercase, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPattern, value.Pattern, null, null); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); -#pragma warning disable CS0618 - writer.WriteProperty(options, PropVersion, value.Version, null, null) -#pragma warning restore CS0618 - ; - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.PatternAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.PatternAnalyzerConverter))] public sealed partial class PatternAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternCaptureTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternCaptureTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..7c64654aa61 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternCaptureTokenFilter.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class PatternCaptureTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPatterns = System.Text.Json.JsonEncodedText.Encode("patterns"); + private static readonly System.Text.Json.JsonEncodedText PropPreserveOriginal = System.Text.Json.JsonEncodedText.Encode("preserve_original"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.PatternCaptureTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propPatterns = default; + LocalJsonValue propPreserveOriginal = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPatterns.TryReadProperty(ref reader, options, PropPatterns, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propPreserveOriginal.TryReadProperty(ref reader, options, PropPreserveOriginal, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.PatternCaptureTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Patterns = propPatterns.Value, + PreserveOriginal = propPreserveOriginal.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PatternCaptureTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPatterns, value.Patterns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPreserveOriginal, value.PreserveOriginal, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternCaptureTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternCaptureTokenFilter.g.cs index 273c531a964..5527f5659d1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternCaptureTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternCaptureTokenFilter.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class PatternCaptureTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPatterns = System.Text.Json.JsonEncodedText.Encode("patterns"); - private static readonly System.Text.Json.JsonEncodedText PropPreserveOriginal = System.Text.Json.JsonEncodedText.Encode("preserve_original"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.PatternCaptureTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propPatterns = default; - LocalJsonValue propPreserveOriginal = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPatterns.TryReadProperty(ref reader, options, PropPatterns, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propPreserveOriginal.TryReadProperty(ref reader, options, PropPreserveOriginal, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.PatternCaptureTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Patterns = propPatterns.Value, - PreserveOriginal = propPreserveOriginal.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PatternCaptureTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPatterns, value.Patterns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPreserveOriginal, value.PreserveOriginal, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.PatternCaptureTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.PatternCaptureTokenFilterConverter))] public sealed partial class PatternCaptureTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternReplaceCharFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternReplaceCharFilter.Converters.g.cs new file mode 100644 index 00000000000..e2e857d4431 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternReplaceCharFilter.Converters.g.cs @@ -0,0 +1,98 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class PatternReplaceCharFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFlags = System.Text.Json.JsonEncodedText.Encode("flags"); + private static readonly System.Text.Json.JsonEncodedText PropPattern = System.Text.Json.JsonEncodedText.Encode("pattern"); + private static readonly System.Text.Json.JsonEncodedText PropReplacement = System.Text.Json.JsonEncodedText.Encode("replacement"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.PatternReplaceCharFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFlags = default; + LocalJsonValue propPattern = default; + LocalJsonValue propReplacement = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFlags.TryReadProperty(ref reader, options, PropFlags, null)) + { + continue; + } + + if (propPattern.TryReadProperty(ref reader, options, PropPattern, null)) + { + continue; + } + + if (propReplacement.TryReadProperty(ref reader, options, PropReplacement, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.PatternReplaceCharFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Flags = propFlags.Value, + Pattern = propPattern.Value, + Replacement = propReplacement.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PatternReplaceCharFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFlags, value.Flags, null, null); + writer.WriteProperty(options, PropPattern, value.Pattern, null, null); + writer.WriteProperty(options, PropReplacement, value.Replacement, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternReplaceCharFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternReplaceCharFilter.g.cs index 4a280b0615c..dab6d324b2f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternReplaceCharFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternReplaceCharFilter.g.cs @@ -23,81 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class PatternReplaceCharFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFlags = System.Text.Json.JsonEncodedText.Encode("flags"); - private static readonly System.Text.Json.JsonEncodedText PropPattern = System.Text.Json.JsonEncodedText.Encode("pattern"); - private static readonly System.Text.Json.JsonEncodedText PropReplacement = System.Text.Json.JsonEncodedText.Encode("replacement"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.PatternReplaceCharFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFlags = default; - LocalJsonValue propPattern = default; - LocalJsonValue propReplacement = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFlags.TryReadProperty(ref reader, options, PropFlags, null)) - { - continue; - } - - if (propPattern.TryReadProperty(ref reader, options, PropPattern, null)) - { - continue; - } - - if (propReplacement.TryReadProperty(ref reader, options, PropReplacement, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.PatternReplaceCharFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Flags = propFlags.Value, - Pattern = propPattern.Value, - Replacement = propReplacement.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PatternReplaceCharFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFlags, value.Flags, null, null); - writer.WriteProperty(options, PropPattern, value.Pattern, null, null); - writer.WriteProperty(options, PropReplacement, value.Replacement, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.PatternReplaceCharFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.PatternReplaceCharFilterConverter))] public sealed partial class PatternReplaceCharFilter : Elastic.Clients.Elasticsearch.Analysis.ICharFilter { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternReplaceTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternReplaceTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..ef7f5f5141b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternReplaceTokenFilter.Converters.g.cs @@ -0,0 +1,107 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class PatternReplaceTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAll = System.Text.Json.JsonEncodedText.Encode("all"); + private static readonly System.Text.Json.JsonEncodedText PropFlags = System.Text.Json.JsonEncodedText.Encode("flags"); + private static readonly System.Text.Json.JsonEncodedText PropPattern = System.Text.Json.JsonEncodedText.Encode("pattern"); + private static readonly System.Text.Json.JsonEncodedText PropReplacement = System.Text.Json.JsonEncodedText.Encode("replacement"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.PatternReplaceTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAll = default; + LocalJsonValue propFlags = default; + LocalJsonValue propPattern = default; + LocalJsonValue propReplacement = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAll.TryReadProperty(ref reader, options, PropAll, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFlags.TryReadProperty(ref reader, options, PropFlags, null)) + { + continue; + } + + if (propPattern.TryReadProperty(ref reader, options, PropPattern, null)) + { + continue; + } + + if (propReplacement.TryReadProperty(ref reader, options, PropReplacement, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.PatternReplaceTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + All = propAll.Value, + Flags = propFlags.Value, + Pattern = propPattern.Value, + Replacement = propReplacement.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PatternReplaceTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAll, value.All, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFlags, value.Flags, null, null); + writer.WriteProperty(options, PropPattern, value.Pattern, null, null); + writer.WriteProperty(options, PropReplacement, value.Replacement, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternReplaceTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternReplaceTokenFilter.g.cs index 40e53984bb9..fbf26ab2a3a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternReplaceTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternReplaceTokenFilter.g.cs @@ -23,90 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class PatternReplaceTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAll = System.Text.Json.JsonEncodedText.Encode("all"); - private static readonly System.Text.Json.JsonEncodedText PropFlags = System.Text.Json.JsonEncodedText.Encode("flags"); - private static readonly System.Text.Json.JsonEncodedText PropPattern = System.Text.Json.JsonEncodedText.Encode("pattern"); - private static readonly System.Text.Json.JsonEncodedText PropReplacement = System.Text.Json.JsonEncodedText.Encode("replacement"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.PatternReplaceTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAll = default; - LocalJsonValue propFlags = default; - LocalJsonValue propPattern = default; - LocalJsonValue propReplacement = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAll.TryReadProperty(ref reader, options, PropAll, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFlags.TryReadProperty(ref reader, options, PropFlags, null)) - { - continue; - } - - if (propPattern.TryReadProperty(ref reader, options, PropPattern, null)) - { - continue; - } - - if (propReplacement.TryReadProperty(ref reader, options, PropReplacement, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.PatternReplaceTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - All = propAll.Value, - Flags = propFlags.Value, - Pattern = propPattern.Value, - Replacement = propReplacement.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PatternReplaceTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAll, value.All, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFlags, value.Flags, null, null); - writer.WriteProperty(options, PropPattern, value.Pattern, null, null); - writer.WriteProperty(options, PropReplacement, value.Replacement, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.PatternReplaceTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.PatternReplaceTokenFilterConverter))] public sealed partial class PatternReplaceTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternTokenizer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternTokenizer.Converters.g.cs new file mode 100644 index 00000000000..cc9723f94c3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternTokenizer.Converters.g.cs @@ -0,0 +1,98 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class PatternTokenizerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFlags = System.Text.Json.JsonEncodedText.Encode("flags"); + private static readonly System.Text.Json.JsonEncodedText PropGroup = System.Text.Json.JsonEncodedText.Encode("group"); + private static readonly System.Text.Json.JsonEncodedText PropPattern = System.Text.Json.JsonEncodedText.Encode("pattern"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.PatternTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFlags = default; + LocalJsonValue propGroup = default; + LocalJsonValue propPattern = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFlags.TryReadProperty(ref reader, options, PropFlags, null)) + { + continue; + } + + if (propGroup.TryReadProperty(ref reader, options, PropGroup, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPattern.TryReadProperty(ref reader, options, PropPattern, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.PatternTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Flags = propFlags.Value, + Group = propGroup.Value, + Pattern = propPattern.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PatternTokenizer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFlags, value.Flags, null, null); + writer.WriteProperty(options, PropGroup, value.Group, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPattern, value.Pattern, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternTokenizer.g.cs index 0801a33e1db..5ddf5eca599 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternTokenizer.g.cs @@ -23,81 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class PatternTokenizerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFlags = System.Text.Json.JsonEncodedText.Encode("flags"); - private static readonly System.Text.Json.JsonEncodedText PropGroup = System.Text.Json.JsonEncodedText.Encode("group"); - private static readonly System.Text.Json.JsonEncodedText PropPattern = System.Text.Json.JsonEncodedText.Encode("pattern"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.PatternTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFlags = default; - LocalJsonValue propGroup = default; - LocalJsonValue propPattern = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFlags.TryReadProperty(ref reader, options, PropFlags, null)) - { - continue; - } - - if (propGroup.TryReadProperty(ref reader, options, PropGroup, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPattern.TryReadProperty(ref reader, options, PropPattern, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.PatternTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Flags = propFlags.Value, - Group = propGroup.Value, - Pattern = propPattern.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PatternTokenizer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFlags, value.Flags, null, null); - writer.WriteProperty(options, PropGroup, value.Group, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPattern, value.Pattern, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.PatternTokenizerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.PatternTokenizerConverter))] public sealed partial class PatternTokenizer : Elastic.Clients.Elasticsearch.Analysis.ITokenizer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..2a4f2fae034 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianAnalyzer.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class PersianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.PersianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.PersianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PersianAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianAnalyzer.g.cs index 37d2add67a8..5735fcdfd1e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianAnalyzer.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class PersianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.PersianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.PersianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PersianAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.PersianAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.PersianAnalyzerConverter))] public sealed partial class PersianAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianNormalizationTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianNormalizationTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..2ec47b1b498 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianNormalizationTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class PersianNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianNormalizationTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianNormalizationTokenFilter.g.cs index e273787b1ba..5bff390cdda 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianNormalizationTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianNormalizationTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class PersianNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.PersianNormalizationTokenFilterConverter))] public sealed partial class PersianNormalizationTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianStemTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianStemTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..d94c837e839 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianStemTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class PersianStemTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.PersianStemTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.PersianStemTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PersianStemTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianStemTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianStemTokenFilter.g.cs index 2904ffc3e89..6c0c7046371 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianStemTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianStemTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class PersianStemTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.PersianStemTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.PersianStemTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PersianStemTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.PersianStemTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.PersianStemTokenFilterConverter))] public sealed partial class PersianStemTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticEncoder.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticEncoder.Converters.g.cs new file mode 100644 index 00000000000..52077d55095 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticEncoder.Converters.g.cs @@ -0,0 +1,221 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class PhoneticEncoderConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberBeiderMorse = System.Text.Json.JsonEncodedText.Encode("beider_morse"); + private static readonly System.Text.Json.JsonEncodedText MemberCaverphone1 = System.Text.Json.JsonEncodedText.Encode("caverphone1"); + private static readonly System.Text.Json.JsonEncodedText MemberCaverphone2 = System.Text.Json.JsonEncodedText.Encode("caverphone2"); + private static readonly System.Text.Json.JsonEncodedText MemberCologne = System.Text.Json.JsonEncodedText.Encode("cologne"); + private static readonly System.Text.Json.JsonEncodedText MemberDaitchMokotoff = System.Text.Json.JsonEncodedText.Encode("daitch_mokotoff"); + private static readonly System.Text.Json.JsonEncodedText MemberDoubleMetaphone = System.Text.Json.JsonEncodedText.Encode("double_metaphone"); + private static readonly System.Text.Json.JsonEncodedText MemberHaasephonetik = System.Text.Json.JsonEncodedText.Encode("haasephonetik"); + private static readonly System.Text.Json.JsonEncodedText MemberKoelnerphonetik = System.Text.Json.JsonEncodedText.Encode("koelnerphonetik"); + private static readonly System.Text.Json.JsonEncodedText MemberMetaphone = System.Text.Json.JsonEncodedText.Encode("metaphone"); + private static readonly System.Text.Json.JsonEncodedText MemberNysiis = System.Text.Json.JsonEncodedText.Encode("nysiis"); + private static readonly System.Text.Json.JsonEncodedText MemberRefinedSoundex = System.Text.Json.JsonEncodedText.Encode("refined_soundex"); + private static readonly System.Text.Json.JsonEncodedText MemberSoundex = System.Text.Json.JsonEncodedText.Encode("soundex"); + + public override Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberBeiderMorse)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.BeiderMorse; + } + + if (reader.ValueTextEquals(MemberCaverphone1)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Caverphone1; + } + + if (reader.ValueTextEquals(MemberCaverphone2)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Caverphone2; + } + + if (reader.ValueTextEquals(MemberCologne)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Cologne; + } + + if (reader.ValueTextEquals(MemberDaitchMokotoff)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.DaitchMokotoff; + } + + if (reader.ValueTextEquals(MemberDoubleMetaphone)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.DoubleMetaphone; + } + + if (reader.ValueTextEquals(MemberHaasephonetik)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Haasephonetik; + } + + if (reader.ValueTextEquals(MemberKoelnerphonetik)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Koelnerphonetik; + } + + if (reader.ValueTextEquals(MemberMetaphone)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Metaphone; + } + + if (reader.ValueTextEquals(MemberNysiis)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Nysiis; + } + + if (reader.ValueTextEquals(MemberRefinedSoundex)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.RefinedSoundex; + } + + if (reader.ValueTextEquals(MemberSoundex)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Soundex; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberBeiderMorse.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.BeiderMorse; + } + + if (string.Equals(value, MemberCaverphone1.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Caverphone1; + } + + if (string.Equals(value, MemberCaverphone2.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Caverphone2; + } + + if (string.Equals(value, MemberCologne.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Cologne; + } + + if (string.Equals(value, MemberDaitchMokotoff.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.DaitchMokotoff; + } + + if (string.Equals(value, MemberDoubleMetaphone.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.DoubleMetaphone; + } + + if (string.Equals(value, MemberHaasephonetik.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Haasephonetik; + } + + if (string.Equals(value, MemberKoelnerphonetik.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Koelnerphonetik; + } + + if (string.Equals(value, MemberMetaphone.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Metaphone; + } + + if (string.Equals(value, MemberNysiis.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Nysiis; + } + + if (string.Equals(value, MemberRefinedSoundex.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.RefinedSoundex; + } + + if (string.Equals(value, MemberSoundex.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Soundex; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.BeiderMorse: + writer.WriteStringValue(MemberBeiderMorse); + break; + case Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Caverphone1: + writer.WriteStringValue(MemberCaverphone1); + break; + case Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Caverphone2: + writer.WriteStringValue(MemberCaverphone2); + break; + case Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Cologne: + writer.WriteStringValue(MemberCologne); + break; + case Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.DaitchMokotoff: + writer.WriteStringValue(MemberDaitchMokotoff); + break; + case Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.DoubleMetaphone: + writer.WriteStringValue(MemberDoubleMetaphone); + break; + case Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Haasephonetik: + writer.WriteStringValue(MemberHaasephonetik); + break; + case Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Koelnerphonetik: + writer.WriteStringValue(MemberKoelnerphonetik); + break; + case Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Metaphone: + writer.WriteStringValue(MemberMetaphone); + break; + case Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Nysiis: + writer.WriteStringValue(MemberNysiis); + break; + case Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.RefinedSoundex: + writer.WriteStringValue(MemberRefinedSoundex); + break; + case Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Soundex: + writer.WriteStringValue(MemberSoundex); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticEncoder.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticEncoder.g.cs new file mode 100644 index 00000000000..684d36a8277 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticEncoder.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.PhoneticEncoderConverter))] +public enum PhoneticEncoder +{ + [System.Runtime.Serialization.EnumMember(Value = "beider_morse")] + BeiderMorse, + [System.Runtime.Serialization.EnumMember(Value = "caverphone1")] + Caverphone1, + [System.Runtime.Serialization.EnumMember(Value = "caverphone2")] + Caverphone2, + [System.Runtime.Serialization.EnumMember(Value = "cologne")] + Cologne, + [System.Runtime.Serialization.EnumMember(Value = "daitch_mokotoff")] + DaitchMokotoff, + [System.Runtime.Serialization.EnumMember(Value = "double_metaphone")] + DoubleMetaphone, + [System.Runtime.Serialization.EnumMember(Value = "haasephonetik")] + Haasephonetik, + [System.Runtime.Serialization.EnumMember(Value = "koelnerphonetik")] + Koelnerphonetik, + [System.Runtime.Serialization.EnumMember(Value = "metaphone")] + Metaphone, + [System.Runtime.Serialization.EnumMember(Value = "nysiis")] + Nysiis, + [System.Runtime.Serialization.EnumMember(Value = "refined_soundex")] + RefinedSoundex, + [System.Runtime.Serialization.EnumMember(Value = "soundex")] + Soundex +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticLanguage.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticLanguage.Converters.g.cs new file mode 100644 index 00000000000..b62a4bb7324 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticLanguage.Converters.g.cs @@ -0,0 +1,221 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class PhoneticLanguageConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAny = System.Text.Json.JsonEncodedText.Encode("any"); + private static readonly System.Text.Json.JsonEncodedText MemberCommon = System.Text.Json.JsonEncodedText.Encode("common"); + private static readonly System.Text.Json.JsonEncodedText MemberCyrillic = System.Text.Json.JsonEncodedText.Encode("cyrillic"); + private static readonly System.Text.Json.JsonEncodedText MemberEnglish = System.Text.Json.JsonEncodedText.Encode("english"); + private static readonly System.Text.Json.JsonEncodedText MemberFrench = System.Text.Json.JsonEncodedText.Encode("french"); + private static readonly System.Text.Json.JsonEncodedText MemberGerman = System.Text.Json.JsonEncodedText.Encode("german"); + private static readonly System.Text.Json.JsonEncodedText MemberHebrew = System.Text.Json.JsonEncodedText.Encode("hebrew"); + private static readonly System.Text.Json.JsonEncodedText MemberHungarian = System.Text.Json.JsonEncodedText.Encode("hungarian"); + private static readonly System.Text.Json.JsonEncodedText MemberPolish = System.Text.Json.JsonEncodedText.Encode("polish"); + private static readonly System.Text.Json.JsonEncodedText MemberRomanian = System.Text.Json.JsonEncodedText.Encode("romanian"); + private static readonly System.Text.Json.JsonEncodedText MemberRussian = System.Text.Json.JsonEncodedText.Encode("russian"); + private static readonly System.Text.Json.JsonEncodedText MemberSpanish = System.Text.Json.JsonEncodedText.Encode("spanish"); + + public override Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAny)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Any; + } + + if (reader.ValueTextEquals(MemberCommon)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Common; + } + + if (reader.ValueTextEquals(MemberCyrillic)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Cyrillic; + } + + if (reader.ValueTextEquals(MemberEnglish)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.English; + } + + if (reader.ValueTextEquals(MemberFrench)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.French; + } + + if (reader.ValueTextEquals(MemberGerman)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.German; + } + + if (reader.ValueTextEquals(MemberHebrew)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Hebrew; + } + + if (reader.ValueTextEquals(MemberHungarian)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Hungarian; + } + + if (reader.ValueTextEquals(MemberPolish)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Polish; + } + + if (reader.ValueTextEquals(MemberRomanian)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Romanian; + } + + if (reader.ValueTextEquals(MemberRussian)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Russian; + } + + if (reader.ValueTextEquals(MemberSpanish)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Spanish; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAny.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Any; + } + + if (string.Equals(value, MemberCommon.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Common; + } + + if (string.Equals(value, MemberCyrillic.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Cyrillic; + } + + if (string.Equals(value, MemberEnglish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.English; + } + + if (string.Equals(value, MemberFrench.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.French; + } + + if (string.Equals(value, MemberGerman.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.German; + } + + if (string.Equals(value, MemberHebrew.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Hebrew; + } + + if (string.Equals(value, MemberHungarian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Hungarian; + } + + if (string.Equals(value, MemberPolish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Polish; + } + + if (string.Equals(value, MemberRomanian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Romanian; + } + + if (string.Equals(value, MemberRussian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Russian; + } + + if (string.Equals(value, MemberSpanish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Spanish; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Any: + writer.WriteStringValue(MemberAny); + break; + case Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Common: + writer.WriteStringValue(MemberCommon); + break; + case Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Cyrillic: + writer.WriteStringValue(MemberCyrillic); + break; + case Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.English: + writer.WriteStringValue(MemberEnglish); + break; + case Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.French: + writer.WriteStringValue(MemberFrench); + break; + case Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.German: + writer.WriteStringValue(MemberGerman); + break; + case Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Hebrew: + writer.WriteStringValue(MemberHebrew); + break; + case Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Hungarian: + writer.WriteStringValue(MemberHungarian); + break; + case Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Polish: + writer.WriteStringValue(MemberPolish); + break; + case Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Romanian: + writer.WriteStringValue(MemberRomanian); + break; + case Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Russian: + writer.WriteStringValue(MemberRussian); + break; + case Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Spanish: + writer.WriteStringValue(MemberSpanish); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticLanguage.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticLanguage.g.cs new file mode 100644 index 00000000000..75b0fa611c1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticLanguage.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.PhoneticLanguageConverter))] +public enum PhoneticLanguage +{ + [System.Runtime.Serialization.EnumMember(Value = "any")] + Any, + [System.Runtime.Serialization.EnumMember(Value = "common")] + Common, + [System.Runtime.Serialization.EnumMember(Value = "cyrillic")] + Cyrillic, + [System.Runtime.Serialization.EnumMember(Value = "english")] + English, + [System.Runtime.Serialization.EnumMember(Value = "french")] + French, + [System.Runtime.Serialization.EnumMember(Value = "german")] + German, + [System.Runtime.Serialization.EnumMember(Value = "hebrew")] + Hebrew, + [System.Runtime.Serialization.EnumMember(Value = "hungarian")] + Hungarian, + [System.Runtime.Serialization.EnumMember(Value = "polish")] + Polish, + [System.Runtime.Serialization.EnumMember(Value = "romanian")] + Romanian, + [System.Runtime.Serialization.EnumMember(Value = "russian")] + Russian, + [System.Runtime.Serialization.EnumMember(Value = "spanish")] + Spanish +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticNameType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticNameType.Converters.g.cs new file mode 100644 index 00000000000..c0be9959727 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticNameType.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class PhoneticNameTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAshkenazi = System.Text.Json.JsonEncodedText.Encode("ashkenazi"); + private static readonly System.Text.Json.JsonEncodedText MemberGeneric = System.Text.Json.JsonEncodedText.Encode("generic"); + private static readonly System.Text.Json.JsonEncodedText MemberSephardic = System.Text.Json.JsonEncodedText.Encode("sephardic"); + + public override Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAshkenazi)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType.Ashkenazi; + } + + if (reader.ValueTextEquals(MemberGeneric)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType.Generic; + } + + if (reader.ValueTextEquals(MemberSephardic)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType.Sephardic; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAshkenazi.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType.Ashkenazi; + } + + if (string.Equals(value, MemberGeneric.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType.Generic; + } + + if (string.Equals(value, MemberSephardic.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType.Sephardic; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType.Ashkenazi: + writer.WriteStringValue(MemberAshkenazi); + break; + case Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType.Generic: + writer.WriteStringValue(MemberGeneric); + break; + case Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType.Sephardic: + writer.WriteStringValue(MemberSephardic); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticNameType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticNameType.g.cs new file mode 100644 index 00000000000..5ce81d74baa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticNameType.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.PhoneticNameTypeConverter))] +public enum PhoneticNameType +{ + [System.Runtime.Serialization.EnumMember(Value = "ashkenazi")] + Ashkenazi, + [System.Runtime.Serialization.EnumMember(Value = "generic")] + Generic, + [System.Runtime.Serialization.EnumMember(Value = "sephardic")] + Sephardic +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticRuleType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticRuleType.Converters.g.cs new file mode 100644 index 00000000000..2d1c1c0c054 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticRuleType.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class PhoneticRuleTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberApprox = System.Text.Json.JsonEncodedText.Encode("approx"); + private static readonly System.Text.Json.JsonEncodedText MemberExact = System.Text.Json.JsonEncodedText.Encode("exact"); + + public override Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberApprox)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType.Approx; + } + + if (reader.ValueTextEquals(MemberExact)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType.Exact; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberApprox.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType.Approx; + } + + if (string.Equals(value, MemberExact.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType.Exact; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType.Approx: + writer.WriteStringValue(MemberApprox); + break; + case Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType.Exact: + writer.WriteStringValue(MemberExact); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticRuleType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticRuleType.g.cs new file mode 100644 index 00000000000..57077d5e7a6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticRuleType.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.PhoneticRuleTypeConverter))] +public enum PhoneticRuleType +{ + [System.Runtime.Serialization.EnumMember(Value = "approx")] + Approx, + [System.Runtime.Serialization.EnumMember(Value = "exact")] + Exact +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..87aa937a9b8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticTokenFilter.Converters.g.cs @@ -0,0 +1,125 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class PhoneticTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEncoder = System.Text.Json.JsonEncodedText.Encode("encoder"); + private static readonly System.Text.Json.JsonEncodedText PropLanguageset = System.Text.Json.JsonEncodedText.Encode("languageset"); + private static readonly System.Text.Json.JsonEncodedText PropMaxCodeLen = System.Text.Json.JsonEncodedText.Encode("max_code_len"); + private static readonly System.Text.Json.JsonEncodedText PropNameType = System.Text.Json.JsonEncodedText.Encode("name_type"); + private static readonly System.Text.Json.JsonEncodedText PropReplace = System.Text.Json.JsonEncodedText.Encode("replace"); + private static readonly System.Text.Json.JsonEncodedText PropRuleType = System.Text.Json.JsonEncodedText.Encode("rule_type"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.PhoneticTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEncoder = default; + LocalJsonValue?> propLanguageset = default; + LocalJsonValue propMaxCodeLen = default; + LocalJsonValue propNameType = default; + LocalJsonValue propReplace = default; + LocalJsonValue propRuleType = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEncoder.TryReadProperty(ref reader, options, PropEncoder, null)) + { + continue; + } + + if (propLanguageset.TryReadProperty(ref reader, options, PropLanguageset, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propMaxCodeLen.TryReadProperty(ref reader, options, PropMaxCodeLen, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNameType.TryReadProperty(ref reader, options, PropNameType, static Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propReplace.TryReadProperty(ref reader, options, PropReplace, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRuleType.TryReadProperty(ref reader, options, PropRuleType, static Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.PhoneticTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Encoder = propEncoder.Value, + Languageset = propLanguageset.Value, + MaxCodeLen = propMaxCodeLen.Value, + NameType = propNameType.Value, + Replace = propReplace.Value, + RuleType = propRuleType.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PhoneticTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEncoder, value.Encoder, null, null); + writer.WriteProperty(options, PropLanguageset, value.Languageset, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMaxCodeLen, value.MaxCodeLen, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNameType, value.NameType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropReplace, value.Replace, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRuleType, value.RuleType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticTokenFilter.g.cs index 9b2f95430dd..2a24598858a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PhoneticTokenFilter.g.cs @@ -23,108 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class PhoneticTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEncoder = System.Text.Json.JsonEncodedText.Encode("encoder"); - private static readonly System.Text.Json.JsonEncodedText PropLanguageset = System.Text.Json.JsonEncodedText.Encode("languageset"); - private static readonly System.Text.Json.JsonEncodedText PropMaxCodeLen = System.Text.Json.JsonEncodedText.Encode("max_code_len"); - private static readonly System.Text.Json.JsonEncodedText PropNameType = System.Text.Json.JsonEncodedText.Encode("name_type"); - private static readonly System.Text.Json.JsonEncodedText PropReplace = System.Text.Json.JsonEncodedText.Encode("replace"); - private static readonly System.Text.Json.JsonEncodedText PropRuleType = System.Text.Json.JsonEncodedText.Encode("rule_type"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.PhoneticTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEncoder = default; - LocalJsonValue?> propLanguageset = default; - LocalJsonValue propMaxCodeLen = default; - LocalJsonValue propNameType = default; - LocalJsonValue propReplace = default; - LocalJsonValue propRuleType = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEncoder.TryReadProperty(ref reader, options, PropEncoder, null)) - { - continue; - } - - if (propLanguageset.TryReadProperty(ref reader, options, PropLanguageset, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propMaxCodeLen.TryReadProperty(ref reader, options, PropMaxCodeLen, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNameType.TryReadProperty(ref reader, options, PropNameType, static Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propReplace.TryReadProperty(ref reader, options, PropReplace, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRuleType.TryReadProperty(ref reader, options, PropRuleType, static Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.PhoneticTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Encoder = propEncoder.Value, - Languageset = propLanguageset.Value, - MaxCodeLen = propMaxCodeLen.Value, - NameType = propNameType.Value, - Replace = propReplace.Value, - RuleType = propRuleType.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PhoneticTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEncoder, value.Encoder, null, null); - writer.WriteProperty(options, PropLanguageset, value.Languageset, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMaxCodeLen, value.MaxCodeLen, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNameType, value.NameType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropReplace, value.Replace, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRuleType, value.RuleType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.PhoneticTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.PhoneticTokenFilterConverter))] public sealed partial class PhoneticTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PorterStemTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PorterStemTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..e21e4e9efc6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PorterStemTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class PorterStemTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.PorterStemTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.PorterStemTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PorterStemTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PorterStemTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PorterStemTokenFilter.g.cs index f5c3f3c3972..0559c4954a7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PorterStemTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PorterStemTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class PorterStemTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.PorterStemTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.PorterStemTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PorterStemTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.PorterStemTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.PorterStemTokenFilterConverter))] public sealed partial class PorterStemTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PortugueseAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PortugueseAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..dda84774cde --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PortugueseAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class PortugueseAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.PortugueseAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.PortugueseAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PortugueseAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PortugueseAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PortugueseAnalyzer.g.cs index c9f24c432b5..9471b725704 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PortugueseAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PortugueseAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class PortugueseAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.PortugueseAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.PortugueseAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PortugueseAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.PortugueseAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.PortugueseAnalyzerConverter))] public sealed partial class PortugueseAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PredicateTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PredicateTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..77c73b67ddd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PredicateTokenFilter.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class PredicateTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.PredicateTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propScript = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.PredicateTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Script = propScript.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PredicateTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PredicateTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PredicateTokenFilter.g.cs index 06a8296c0be..1defe159077 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PredicateTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PredicateTokenFilter.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class PredicateTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.PredicateTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propScript = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.PredicateTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Script = propScript.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PredicateTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.PredicateTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.PredicateTokenFilterConverter))] public sealed partial class PredicateTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RemoveDuplicatesTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RemoveDuplicatesTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..04d2c415254 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RemoveDuplicatesTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class RemoveDuplicatesTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.RemoveDuplicatesTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.RemoveDuplicatesTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.RemoveDuplicatesTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RemoveDuplicatesTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RemoveDuplicatesTokenFilter.g.cs index 2e58bf1d107..aac4d93891f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RemoveDuplicatesTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RemoveDuplicatesTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class RemoveDuplicatesTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.RemoveDuplicatesTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.RemoveDuplicatesTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.RemoveDuplicatesTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.RemoveDuplicatesTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.RemoveDuplicatesTokenFilterConverter))] public sealed partial class RemoveDuplicatesTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ReverseTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ReverseTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..cd8019ab386 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ReverseTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class ReverseTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.ReverseTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.ReverseTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ReverseTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ReverseTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ReverseTokenFilter.g.cs index 338ae854100..07b38ecaca5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ReverseTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ReverseTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class ReverseTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.ReverseTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.ReverseTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ReverseTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.ReverseTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.ReverseTokenFilterConverter))] public sealed partial class ReverseTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RomanianAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RomanianAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..c6788dac565 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RomanianAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class RomanianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.RomanianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.RomanianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.RomanianAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RomanianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RomanianAnalyzer.g.cs index bbf46773b9c..5ffc5fdf27c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RomanianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RomanianAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class RomanianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.RomanianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.RomanianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.RomanianAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.RomanianAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.RomanianAnalyzerConverter))] public sealed partial class RomanianAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RussianAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RussianAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..d619549f596 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RussianAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class RussianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.RussianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.RussianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.RussianAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RussianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RussianAnalyzer.g.cs index 4f1ab97e99e..fec97cdaf8c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RussianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RussianAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class RussianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.RussianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.RussianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.RussianAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.RussianAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.RussianAnalyzerConverter))] public sealed partial class RussianAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RussianStemTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RussianStemTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..14590502186 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RussianStemTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class RussianStemTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.RussianStemTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.RussianStemTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.RussianStemTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RussianStemTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RussianStemTokenFilter.g.cs index fbf9fe2dd85..4ca454614b3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RussianStemTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RussianStemTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class RussianStemTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.RussianStemTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.RussianStemTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.RussianStemTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.RussianStemTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.RussianStemTokenFilterConverter))] public sealed partial class RussianStemTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ScandinavianFoldingTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ScandinavianFoldingTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..591e891e0db --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ScandinavianFoldingTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class ScandinavianFoldingTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ScandinavianFoldingTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ScandinavianFoldingTokenFilter.g.cs index ccfef8c6247..de6c21d8f6f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ScandinavianFoldingTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ScandinavianFoldingTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class ScandinavianFoldingTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.ScandinavianFoldingTokenFilterConverter))] public sealed partial class ScandinavianFoldingTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ScandinavianNormalizationTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ScandinavianNormalizationTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..4241fdd7e0d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ScandinavianNormalizationTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class ScandinavianNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ScandinavianNormalizationTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ScandinavianNormalizationTokenFilter.g.cs index 5d3db139531..b23185f5298 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ScandinavianNormalizationTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ScandinavianNormalizationTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class ScandinavianNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.ScandinavianNormalizationTokenFilterConverter))] public sealed partial class ScandinavianNormalizationTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SerbianAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SerbianAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..07e0b7edd75 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SerbianAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class SerbianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.SerbianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.SerbianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SerbianAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SerbianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SerbianAnalyzer.g.cs index cf3dee03355..732bd2760c6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SerbianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SerbianAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class SerbianAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.SerbianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.SerbianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SerbianAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.SerbianAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.SerbianAnalyzerConverter))] public sealed partial class SerbianAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SerbianNormalizationTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SerbianNormalizationTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..831ce75ce60 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SerbianNormalizationTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class SerbianNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SerbianNormalizationTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SerbianNormalizationTokenFilter.g.cs index b4396e17261..a72a10ea555 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SerbianNormalizationTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SerbianNormalizationTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class SerbianNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.SerbianNormalizationTokenFilterConverter))] public sealed partial class SerbianNormalizationTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ShingleTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ShingleTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..0f251f88519 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ShingleTokenFilter.Converters.g.cs @@ -0,0 +1,125 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class ShingleTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFillerToken = System.Text.Json.JsonEncodedText.Encode("filler_token"); + private static readonly System.Text.Json.JsonEncodedText PropMaxShingleSize = System.Text.Json.JsonEncodedText.Encode("max_shingle_size"); + private static readonly System.Text.Json.JsonEncodedText PropMinShingleSize = System.Text.Json.JsonEncodedText.Encode("min_shingle_size"); + private static readonly System.Text.Json.JsonEncodedText PropOutputUnigrams = System.Text.Json.JsonEncodedText.Encode("output_unigrams"); + private static readonly System.Text.Json.JsonEncodedText PropOutputUnigramsIfNoShingles = System.Text.Json.JsonEncodedText.Encode("output_unigrams_if_no_shingles"); + private static readonly System.Text.Json.JsonEncodedText PropTokenSeparator = System.Text.Json.JsonEncodedText.Encode("token_separator"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFillerToken = default; + LocalJsonValue propMaxShingleSize = default; + LocalJsonValue propMinShingleSize = default; + LocalJsonValue propOutputUnigrams = default; + LocalJsonValue propOutputUnigramsIfNoShingles = default; + LocalJsonValue propTokenSeparator = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFillerToken.TryReadProperty(ref reader, options, PropFillerToken, null)) + { + continue; + } + + if (propMaxShingleSize.TryReadProperty(ref reader, options, PropMaxShingleSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinShingleSize.TryReadProperty(ref reader, options, PropMinShingleSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOutputUnigrams.TryReadProperty(ref reader, options, PropOutputUnigrams, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOutputUnigramsIfNoShingles.TryReadProperty(ref reader, options, PropOutputUnigramsIfNoShingles, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTokenSeparator.TryReadProperty(ref reader, options, PropTokenSeparator, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FillerToken = propFillerToken.Value, + MaxShingleSize = propMaxShingleSize.Value, + MinShingleSize = propMinShingleSize.Value, + OutputUnigrams = propOutputUnigrams.Value, + OutputUnigramsIfNoShingles = propOutputUnigramsIfNoShingles.Value, + TokenSeparator = propTokenSeparator.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFillerToken, value.FillerToken, null, null); + writer.WriteProperty(options, PropMaxShingleSize, value.MaxShingleSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinShingleSize, value.MinShingleSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOutputUnigrams, value.OutputUnigrams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOutputUnigramsIfNoShingles, value.OutputUnigramsIfNoShingles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTokenSeparator, value.TokenSeparator, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ShingleTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ShingleTokenFilter.g.cs index d647e119aff..cccc89374d6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ShingleTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ShingleTokenFilter.g.cs @@ -23,108 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class ShingleTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFillerToken = System.Text.Json.JsonEncodedText.Encode("filler_token"); - private static readonly System.Text.Json.JsonEncodedText PropMaxShingleSize = System.Text.Json.JsonEncodedText.Encode("max_shingle_size"); - private static readonly System.Text.Json.JsonEncodedText PropMinShingleSize = System.Text.Json.JsonEncodedText.Encode("min_shingle_size"); - private static readonly System.Text.Json.JsonEncodedText PropOutputUnigrams = System.Text.Json.JsonEncodedText.Encode("output_unigrams"); - private static readonly System.Text.Json.JsonEncodedText PropOutputUnigramsIfNoShingles = System.Text.Json.JsonEncodedText.Encode("output_unigrams_if_no_shingles"); - private static readonly System.Text.Json.JsonEncodedText PropTokenSeparator = System.Text.Json.JsonEncodedText.Encode("token_separator"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFillerToken = default; - LocalJsonValue propMaxShingleSize = default; - LocalJsonValue propMinShingleSize = default; - LocalJsonValue propOutputUnigrams = default; - LocalJsonValue propOutputUnigramsIfNoShingles = default; - LocalJsonValue propTokenSeparator = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFillerToken.TryReadProperty(ref reader, options, PropFillerToken, null)) - { - continue; - } - - if (propMaxShingleSize.TryReadProperty(ref reader, options, PropMaxShingleSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinShingleSize.TryReadProperty(ref reader, options, PropMinShingleSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOutputUnigrams.TryReadProperty(ref reader, options, PropOutputUnigrams, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOutputUnigramsIfNoShingles.TryReadProperty(ref reader, options, PropOutputUnigramsIfNoShingles, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTokenSeparator.TryReadProperty(ref reader, options, PropTokenSeparator, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FillerToken = propFillerToken.Value, - MaxShingleSize = propMaxShingleSize.Value, - MinShingleSize = propMinShingleSize.Value, - OutputUnigrams = propOutputUnigrams.Value, - OutputUnigramsIfNoShingles = propOutputUnigramsIfNoShingles.Value, - TokenSeparator = propTokenSeparator.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFillerToken, value.FillerToken, null, null); - writer.WriteProperty(options, PropMaxShingleSize, value.MaxShingleSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinShingleSize, value.MinShingleSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOutputUnigrams, value.OutputUnigrams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOutputUnigramsIfNoShingles, value.OutputUnigramsIfNoShingles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTokenSeparator, value.TokenSeparator, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.ShingleTokenFilterConverter))] public sealed partial class ShingleTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SimpleAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SimpleAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..c45dc1c9f70 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SimpleAnalyzer.Converters.g.cs @@ -0,0 +1,76 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class SimpleAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.SimpleAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.SimpleAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { +#pragma warning disable CS0618 + Version = propVersion.Value +#pragma warning restore CS0618 + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SimpleAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); +#pragma warning disable CS0618 + writer.WriteProperty(options, PropVersion, value.Version, null, null) +#pragma warning restore CS0618 + ; + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SimpleAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SimpleAnalyzer.g.cs index a6db86ae336..ec92e17d680 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SimpleAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SimpleAnalyzer.g.cs @@ -23,59 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class SimpleAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.SimpleAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.SimpleAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { -#pragma warning disable CS0618 - Version = propVersion.Value -#pragma warning restore CS0618 - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SimpleAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); -#pragma warning disable CS0618 - writer.WriteProperty(options, PropVersion, value.Version, null, null) -#pragma warning restore CS0618 - ; - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.SimpleAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.SimpleAnalyzerConverter))] public sealed partial class SimpleAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SimplePatternSplitTokenizer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SimplePatternSplitTokenizer.Converters.g.cs new file mode 100644 index 00000000000..d56cc7f68d2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SimplePatternSplitTokenizer.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class SimplePatternSplitTokenizerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPattern = System.Text.Json.JsonEncodedText.Encode("pattern"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.SimplePatternSplitTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPattern = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPattern.TryReadProperty(ref reader, options, PropPattern, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.SimplePatternSplitTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Pattern = propPattern.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SimplePatternSplitTokenizer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPattern, value.Pattern, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SimplePatternSplitTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SimplePatternSplitTokenizer.g.cs index b8e6780e346..34c33fc8752 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SimplePatternSplitTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SimplePatternSplitTokenizer.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class SimplePatternSplitTokenizerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPattern = System.Text.Json.JsonEncodedText.Encode("pattern"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.SimplePatternSplitTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPattern = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPattern.TryReadProperty(ref reader, options, PropPattern, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.SimplePatternSplitTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Pattern = propPattern.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SimplePatternSplitTokenizer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPattern, value.Pattern, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.SimplePatternSplitTokenizerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.SimplePatternSplitTokenizerConverter))] public sealed partial class SimplePatternSplitTokenizer : Elastic.Clients.Elasticsearch.Analysis.ITokenizer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SimplePatternTokenizer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SimplePatternTokenizer.Converters.g.cs new file mode 100644 index 00000000000..37c5f66bc26 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SimplePatternTokenizer.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class SimplePatternTokenizerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPattern = System.Text.Json.JsonEncodedText.Encode("pattern"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.SimplePatternTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPattern = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPattern.TryReadProperty(ref reader, options, PropPattern, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.SimplePatternTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Pattern = propPattern.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SimplePatternTokenizer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPattern, value.Pattern, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SimplePatternTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SimplePatternTokenizer.g.cs index 8b5f067d5e0..66544c01b24 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SimplePatternTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SimplePatternTokenizer.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class SimplePatternTokenizerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPattern = System.Text.Json.JsonEncodedText.Encode("pattern"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.SimplePatternTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPattern = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPattern.TryReadProperty(ref reader, options, PropPattern, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.SimplePatternTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Pattern = propPattern.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SimplePatternTokenizer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPattern, value.Pattern, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.SimplePatternTokenizerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.SimplePatternTokenizerConverter))] public sealed partial class SimplePatternTokenizer : Elastic.Clients.Elasticsearch.Analysis.ITokenizer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..2910fb1beb5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballAnalyzer.Converters.g.cs @@ -0,0 +1,94 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class SnowballAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLanguage = System.Text.Json.JsonEncodedText.Encode("language"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.SnowballAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLanguage = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLanguage.TryReadProperty(ref reader, options, PropLanguage, null)) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.SnowballAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Language = propLanguage.Value, + Stopwords = propStopwords.Value, +#pragma warning disable CS0618 + Version = propVersion.Value +#pragma warning restore CS0618 + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SnowballAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLanguage, value.Language, null, null); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropType, value.Type, null, null); +#pragma warning disable CS0618 + writer.WriteProperty(options, PropVersion, value.Version, null, null) +#pragma warning restore CS0618 + ; + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballAnalyzer.g.cs index e867ad9845f..048d7e3a2ea 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballAnalyzer.g.cs @@ -23,77 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class SnowballAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLanguage = System.Text.Json.JsonEncodedText.Encode("language"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.SnowballAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLanguage = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLanguage.TryReadProperty(ref reader, options, PropLanguage, null)) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.SnowballAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Language = propLanguage.Value, - Stopwords = propStopwords.Value, -#pragma warning disable CS0618 - Version = propVersion.Value -#pragma warning restore CS0618 - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SnowballAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLanguage, value.Language, null, null); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropType, value.Type, null, null); -#pragma warning disable CS0618 - writer.WriteProperty(options, PropVersion, value.Version, null, null) -#pragma warning restore CS0618 - ; - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.SnowballAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.SnowballAnalyzerConverter))] public sealed partial class SnowballAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballLanguage.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballLanguage.Converters.g.cs new file mode 100644 index 00000000000..ef7612d7caf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballLanguage.Converters.g.cs @@ -0,0 +1,431 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class SnowballLanguageConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberArabic = System.Text.Json.JsonEncodedText.Encode("Arabic"); + private static readonly System.Text.Json.JsonEncodedText MemberArmenian = System.Text.Json.JsonEncodedText.Encode("Armenian"); + private static readonly System.Text.Json.JsonEncodedText MemberBasque = System.Text.Json.JsonEncodedText.Encode("Basque"); + private static readonly System.Text.Json.JsonEncodedText MemberCatalan = System.Text.Json.JsonEncodedText.Encode("Catalan"); + private static readonly System.Text.Json.JsonEncodedText MemberDanish = System.Text.Json.JsonEncodedText.Encode("Danish"); + private static readonly System.Text.Json.JsonEncodedText MemberDutch = System.Text.Json.JsonEncodedText.Encode("Dutch"); + private static readonly System.Text.Json.JsonEncodedText MemberEnglish = System.Text.Json.JsonEncodedText.Encode("English"); + private static readonly System.Text.Json.JsonEncodedText MemberEstonian = System.Text.Json.JsonEncodedText.Encode("Estonian"); + private static readonly System.Text.Json.JsonEncodedText MemberFinnish = System.Text.Json.JsonEncodedText.Encode("Finnish"); + private static readonly System.Text.Json.JsonEncodedText MemberFrench = System.Text.Json.JsonEncodedText.Encode("French"); + private static readonly System.Text.Json.JsonEncodedText MemberGerman = System.Text.Json.JsonEncodedText.Encode("German"); + private static readonly System.Text.Json.JsonEncodedText MemberGerman2 = System.Text.Json.JsonEncodedText.Encode("German2"); + private static readonly System.Text.Json.JsonEncodedText MemberHungarian = System.Text.Json.JsonEncodedText.Encode("Hungarian"); + private static readonly System.Text.Json.JsonEncodedText MemberIrish = System.Text.Json.JsonEncodedText.Encode("Irish"); + private static readonly System.Text.Json.JsonEncodedText MemberItalian = System.Text.Json.JsonEncodedText.Encode("Italian"); + private static readonly System.Text.Json.JsonEncodedText MemberKp = System.Text.Json.JsonEncodedText.Encode("Kp"); + private static readonly System.Text.Json.JsonEncodedText MemberLithuanian = System.Text.Json.JsonEncodedText.Encode("Lithuanian"); + private static readonly System.Text.Json.JsonEncodedText MemberLovins = System.Text.Json.JsonEncodedText.Encode("Lovins"); + private static readonly System.Text.Json.JsonEncodedText MemberNorwegian = System.Text.Json.JsonEncodedText.Encode("Norwegian"); + private static readonly System.Text.Json.JsonEncodedText MemberPorter = System.Text.Json.JsonEncodedText.Encode("Porter"); + private static readonly System.Text.Json.JsonEncodedText MemberPortuguese = System.Text.Json.JsonEncodedText.Encode("Portuguese"); + private static readonly System.Text.Json.JsonEncodedText MemberRomanian = System.Text.Json.JsonEncodedText.Encode("Romanian"); + private static readonly System.Text.Json.JsonEncodedText MemberRussian = System.Text.Json.JsonEncodedText.Encode("Russian"); + private static readonly System.Text.Json.JsonEncodedText MemberSerbian = System.Text.Json.JsonEncodedText.Encode("Serbian"); + private static readonly System.Text.Json.JsonEncodedText MemberSpanish = System.Text.Json.JsonEncodedText.Encode("Spanish"); + private static readonly System.Text.Json.JsonEncodedText MemberSwedish = System.Text.Json.JsonEncodedText.Encode("Swedish"); + private static readonly System.Text.Json.JsonEncodedText MemberTurkish = System.Text.Json.JsonEncodedText.Encode("Turkish"); + + public override Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberArabic)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Arabic; + } + + if (reader.ValueTextEquals(MemberArmenian)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Armenian; + } + + if (reader.ValueTextEquals(MemberBasque)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Basque; + } + + if (reader.ValueTextEquals(MemberCatalan)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Catalan; + } + + if (reader.ValueTextEquals(MemberDanish)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Danish; + } + + if (reader.ValueTextEquals(MemberDutch)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Dutch; + } + + if (reader.ValueTextEquals(MemberEnglish)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.English; + } + + if (reader.ValueTextEquals(MemberEstonian)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Estonian; + } + + if (reader.ValueTextEquals(MemberFinnish)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Finnish; + } + + if (reader.ValueTextEquals(MemberFrench)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.French; + } + + if (reader.ValueTextEquals(MemberGerman)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.German; + } + + if (reader.ValueTextEquals(MemberGerman2)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.German2; + } + + if (reader.ValueTextEquals(MemberHungarian)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Hungarian; + } + + if (reader.ValueTextEquals(MemberIrish)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Irish; + } + + if (reader.ValueTextEquals(MemberItalian)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Italian; + } + + if (reader.ValueTextEquals(MemberKp)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Kp; + } + + if (reader.ValueTextEquals(MemberLithuanian)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Lithuanian; + } + + if (reader.ValueTextEquals(MemberLovins)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Lovins; + } + + if (reader.ValueTextEquals(MemberNorwegian)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Norwegian; + } + + if (reader.ValueTextEquals(MemberPorter)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Porter; + } + + if (reader.ValueTextEquals(MemberPortuguese)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Portuguese; + } + + if (reader.ValueTextEquals(MemberRomanian)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Romanian; + } + + if (reader.ValueTextEquals(MemberRussian)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Russian; + } + + if (reader.ValueTextEquals(MemberSerbian)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Serbian; + } + + if (reader.ValueTextEquals(MemberSpanish)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Spanish; + } + + if (reader.ValueTextEquals(MemberSwedish)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Swedish; + } + + if (reader.ValueTextEquals(MemberTurkish)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Turkish; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberArabic.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Arabic; + } + + if (string.Equals(value, MemberArmenian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Armenian; + } + + if (string.Equals(value, MemberBasque.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Basque; + } + + if (string.Equals(value, MemberCatalan.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Catalan; + } + + if (string.Equals(value, MemberDanish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Danish; + } + + if (string.Equals(value, MemberDutch.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Dutch; + } + + if (string.Equals(value, MemberEnglish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.English; + } + + if (string.Equals(value, MemberEstonian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Estonian; + } + + if (string.Equals(value, MemberFinnish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Finnish; + } + + if (string.Equals(value, MemberFrench.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.French; + } + + if (string.Equals(value, MemberGerman.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.German; + } + + if (string.Equals(value, MemberGerman2.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.German2; + } + + if (string.Equals(value, MemberHungarian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Hungarian; + } + + if (string.Equals(value, MemberIrish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Irish; + } + + if (string.Equals(value, MemberItalian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Italian; + } + + if (string.Equals(value, MemberKp.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Kp; + } + + if (string.Equals(value, MemberLithuanian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Lithuanian; + } + + if (string.Equals(value, MemberLovins.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Lovins; + } + + if (string.Equals(value, MemberNorwegian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Norwegian; + } + + if (string.Equals(value, MemberPorter.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Porter; + } + + if (string.Equals(value, MemberPortuguese.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Portuguese; + } + + if (string.Equals(value, MemberRomanian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Romanian; + } + + if (string.Equals(value, MemberRussian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Russian; + } + + if (string.Equals(value, MemberSerbian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Serbian; + } + + if (string.Equals(value, MemberSpanish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Spanish; + } + + if (string.Equals(value, MemberSwedish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Swedish; + } + + if (string.Equals(value, MemberTurkish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Turkish; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Arabic: + writer.WriteStringValue(MemberArabic); + break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Armenian: + writer.WriteStringValue(MemberArmenian); + break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Basque: + writer.WriteStringValue(MemberBasque); + break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Catalan: + writer.WriteStringValue(MemberCatalan); + break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Danish: + writer.WriteStringValue(MemberDanish); + break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Dutch: + writer.WriteStringValue(MemberDutch); + break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.English: + writer.WriteStringValue(MemberEnglish); + break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Estonian: + writer.WriteStringValue(MemberEstonian); + break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Finnish: + writer.WriteStringValue(MemberFinnish); + break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.French: + writer.WriteStringValue(MemberFrench); + break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.German: + writer.WriteStringValue(MemberGerman); + break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.German2: + writer.WriteStringValue(MemberGerman2); + break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Hungarian: + writer.WriteStringValue(MemberHungarian); + break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Irish: + writer.WriteStringValue(MemberIrish); + break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Italian: + writer.WriteStringValue(MemberItalian); + break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Kp: + writer.WriteStringValue(MemberKp); + break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Lithuanian: + writer.WriteStringValue(MemberLithuanian); + break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Lovins: + writer.WriteStringValue(MemberLovins); + break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Norwegian: + writer.WriteStringValue(MemberNorwegian); + break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Porter: + writer.WriteStringValue(MemberPorter); + break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Portuguese: + writer.WriteStringValue(MemberPortuguese); + break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Romanian: + writer.WriteStringValue(MemberRomanian); + break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Russian: + writer.WriteStringValue(MemberRussian); + break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Serbian: + writer.WriteStringValue(MemberSerbian); + break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Spanish: + writer.WriteStringValue(MemberSpanish); + break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Swedish: + writer.WriteStringValue(MemberSwedish); + break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Turkish: + writer.WriteStringValue(MemberTurkish); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballLanguage.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballLanguage.g.cs new file mode 100644 index 00000000000..86e85888d7d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballLanguage.g.cs @@ -0,0 +1,83 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.SnowballLanguageConverter))] +public enum SnowballLanguage +{ + [System.Runtime.Serialization.EnumMember(Value = "Arabic")] + Arabic, + [System.Runtime.Serialization.EnumMember(Value = "Armenian")] + Armenian, + [System.Runtime.Serialization.EnumMember(Value = "Basque")] + Basque, + [System.Runtime.Serialization.EnumMember(Value = "Catalan")] + Catalan, + [System.Runtime.Serialization.EnumMember(Value = "Danish")] + Danish, + [System.Runtime.Serialization.EnumMember(Value = "Dutch")] + Dutch, + [System.Runtime.Serialization.EnumMember(Value = "English")] + English, + [System.Runtime.Serialization.EnumMember(Value = "Estonian")] + Estonian, + [System.Runtime.Serialization.EnumMember(Value = "Finnish")] + Finnish, + [System.Runtime.Serialization.EnumMember(Value = "French")] + French, + [System.Runtime.Serialization.EnumMember(Value = "German")] + German, + [System.Runtime.Serialization.EnumMember(Value = "German2")] + German2, + [System.Runtime.Serialization.EnumMember(Value = "Hungarian")] + Hungarian, + [System.Runtime.Serialization.EnumMember(Value = "Irish")] + Irish, + [System.Runtime.Serialization.EnumMember(Value = "Italian")] + Italian, + [System.Runtime.Serialization.EnumMember(Value = "Kp")] + Kp, + [System.Runtime.Serialization.EnumMember(Value = "Lithuanian")] + Lithuanian, + [System.Runtime.Serialization.EnumMember(Value = "Lovins")] + Lovins, + [System.Runtime.Serialization.EnumMember(Value = "Norwegian")] + Norwegian, + [System.Runtime.Serialization.EnumMember(Value = "Porter")] + Porter, + [System.Runtime.Serialization.EnumMember(Value = "Portuguese")] + Portuguese, + [System.Runtime.Serialization.EnumMember(Value = "Romanian")] + Romanian, + [System.Runtime.Serialization.EnumMember(Value = "Russian")] + Russian, + [System.Runtime.Serialization.EnumMember(Value = "Serbian")] + Serbian, + [System.Runtime.Serialization.EnumMember(Value = "Spanish")] + Spanish, + [System.Runtime.Serialization.EnumMember(Value = "Swedish")] + Swedish, + [System.Runtime.Serialization.EnumMember(Value = "Turkish")] + Turkish +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..66872ce29aa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballTokenFilter.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class SnowballTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLanguage = System.Text.Json.JsonEncodedText.Encode("language"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.SnowballTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLanguage = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLanguage.TryReadProperty(ref reader, options, PropLanguage, static Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.SnowballTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Language = propLanguage.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SnowballTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLanguage, value.Language, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballTokenFilter.g.cs index 00389a91b6f..aa8eb80642d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballTokenFilter.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class SnowballTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLanguage = System.Text.Json.JsonEncodedText.Encode("language"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.SnowballTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLanguage = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLanguage.TryReadProperty(ref reader, options, PropLanguage, static Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.SnowballTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Language = propLanguage.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SnowballTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLanguage, value.Language, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.SnowballTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.SnowballTokenFilterConverter))] public sealed partial class SnowballTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SoraniAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SoraniAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..6f935a68843 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SoraniAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class SoraniAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.SoraniAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.SoraniAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SoraniAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SoraniAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SoraniAnalyzer.g.cs index 0e102f02c24..ee6a1298129 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SoraniAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SoraniAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class SoraniAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.SoraniAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.SoraniAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SoraniAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.SoraniAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.SoraniAnalyzerConverter))] public sealed partial class SoraniAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SoraniNormalizationTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SoraniNormalizationTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..a45500e9f06 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SoraniNormalizationTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class SoraniNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SoraniNormalizationTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SoraniNormalizationTokenFilter.g.cs index 8ed49808a15..9257a0a56a9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SoraniNormalizationTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SoraniNormalizationTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class SoraniNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.SoraniNormalizationTokenFilterConverter))] public sealed partial class SoraniNormalizationTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SpanishAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SpanishAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..6a2e6a603cf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SpanishAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class SpanishAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.SpanishAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.SpanishAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SpanishAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SpanishAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SpanishAnalyzer.g.cs index a27a593d5ad..e8cf0c4a86c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SpanishAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SpanishAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class SpanishAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.SpanishAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.SpanishAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SpanishAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.SpanishAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.SpanishAnalyzerConverter))] public sealed partial class SpanishAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StandardAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StandardAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..ca8cfc5908e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StandardAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class StandardAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxTokenLength = System.Text.Json.JsonEncodedText.Encode("max_token_length"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.StandardAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxTokenLength = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxTokenLength.TryReadProperty(ref reader, options, PropMaxTokenLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.StandardAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxTokenLength = propMaxTokenLength.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.StandardAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxTokenLength, value.MaxTokenLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StandardAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StandardAnalyzer.g.cs index 6709dba4867..82379a34218 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StandardAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StandardAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class StandardAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxTokenLength = System.Text.Json.JsonEncodedText.Encode("max_token_length"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.StandardAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxTokenLength = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxTokenLength.TryReadProperty(ref reader, options, PropMaxTokenLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.StandardAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxTokenLength = propMaxTokenLength.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.StandardAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxTokenLength, value.MaxTokenLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.StandardAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.StandardAnalyzerConverter))] public sealed partial class StandardAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StandardTokenizer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StandardTokenizer.Converters.g.cs new file mode 100644 index 00000000000..fa895666d0f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StandardTokenizer.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class StandardTokenizerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxTokenLength = System.Text.Json.JsonEncodedText.Encode("max_token_length"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.StandardTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxTokenLength = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxTokenLength.TryReadProperty(ref reader, options, PropMaxTokenLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.StandardTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxTokenLength = propMaxTokenLength.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.StandardTokenizer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxTokenLength, value.MaxTokenLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StandardTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StandardTokenizer.g.cs index 8a33f3ef0d2..e6aa10aa7e0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StandardTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StandardTokenizer.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class StandardTokenizerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxTokenLength = System.Text.Json.JsonEncodedText.Encode("max_token_length"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.StandardTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxTokenLength = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxTokenLength.TryReadProperty(ref reader, options, PropMaxTokenLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.StandardTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxTokenLength = propMaxTokenLength.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.StandardTokenizer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxTokenLength, value.MaxTokenLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.StandardTokenizerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.StandardTokenizerConverter))] public sealed partial class StandardTokenizer : Elastic.Clients.Elasticsearch.Analysis.ITokenizer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StemmerOverrideTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StemmerOverrideTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..e9ffc1a0d20 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StemmerOverrideTokenFilter.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class StemmerOverrideTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRules = System.Text.Json.JsonEncodedText.Encode("rules"); + private static readonly System.Text.Json.JsonEncodedText PropRulesPath = System.Text.Json.JsonEncodedText.Encode("rules_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.StemmerOverrideTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propRules = default; + LocalJsonValue propRulesPath = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRules.TryReadProperty(ref reader, options, PropRules, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propRulesPath.TryReadProperty(ref reader, options, PropRulesPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.StemmerOverrideTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Rules = propRules.Value, + RulesPath = propRulesPath.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.StemmerOverrideTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRules, value.Rules, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRulesPath, value.RulesPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StemmerOverrideTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StemmerOverrideTokenFilter.g.cs index cb5bd76537a..4d86f0842fb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StemmerOverrideTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StemmerOverrideTokenFilter.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class StemmerOverrideTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRules = System.Text.Json.JsonEncodedText.Encode("rules"); - private static readonly System.Text.Json.JsonEncodedText PropRulesPath = System.Text.Json.JsonEncodedText.Encode("rules_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.StemmerOverrideTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propRules = default; - LocalJsonValue propRulesPath = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRules.TryReadProperty(ref reader, options, PropRules, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propRulesPath.TryReadProperty(ref reader, options, PropRulesPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.StemmerOverrideTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Rules = propRules.Value, - RulesPath = propRulesPath.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.StemmerOverrideTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRules, value.Rules, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRulesPath, value.RulesPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.StemmerOverrideTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.StemmerOverrideTokenFilterConverter))] public sealed partial class StemmerOverrideTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StemmerTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StemmerTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..9248cb66010 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StemmerTokenFilter.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class StemmerTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLanguage = System.Text.Json.JsonEncodedText.Encode("language"); + private static readonly System.Text.Json.JsonEncodedText PropLanguage1 = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.StemmerTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLanguage = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLanguage.TryReadProperty(ref reader, options, PropLanguage, null) || propLanguage.TryReadProperty(ref reader, options, PropLanguage1, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.StemmerTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Language = propLanguage.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.StemmerTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLanguage, value.Language, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StemmerTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StemmerTokenFilter.g.cs index ac1c19813d2..67307700218 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StemmerTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StemmerTokenFilter.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class StemmerTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLanguage = System.Text.Json.JsonEncodedText.Encode("language"); - private static readonly System.Text.Json.JsonEncodedText PropLanguage1 = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.StemmerTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLanguage = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLanguage.TryReadProperty(ref reader, options, PropLanguage, null) || propLanguage.TryReadProperty(ref reader, options, PropLanguage1, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.StemmerTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Language = propLanguage.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.StemmerTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLanguage, value.Language, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.StemmerTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.StemmerTokenFilterConverter))] public sealed partial class StemmerTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..64ead4f0df6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopAnalyzer.Converters.g.cs @@ -0,0 +1,94 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class StopAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.StopAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.StopAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value, +#pragma warning disable CS0618 + Version = propVersion.Value +#pragma warning restore CS0618 + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.StopAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); +#pragma warning disable CS0618 + writer.WriteProperty(options, PropVersion, value.Version, null, null) +#pragma warning restore CS0618 + ; + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopAnalyzer.g.cs index 155fcaa4ab5..0239e03698f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopAnalyzer.g.cs @@ -23,77 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class StopAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.StopAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.StopAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value, -#pragma warning disable CS0618 - Version = propVersion.Value -#pragma warning restore CS0618 - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.StopAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); -#pragma warning disable CS0618 - writer.WriteProperty(options, PropVersion, value.Version, null, null) -#pragma warning restore CS0618 - ; - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.StopAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.StopAnalyzerConverter))] public sealed partial class StopAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..41bd8ec41b9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopTokenFilter.Converters.g.cs @@ -0,0 +1,107 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class StopTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIgnoreCase = System.Text.Json.JsonEncodedText.Encode("ignore_case"); + private static readonly System.Text.Json.JsonEncodedText PropRemoveTrailing = System.Text.Json.JsonEncodedText.Encode("remove_trailing"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.StopTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIgnoreCase = default; + LocalJsonValue propRemoveTrailing = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIgnoreCase.TryReadProperty(ref reader, options, PropIgnoreCase, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRemoveTrailing.TryReadProperty(ref reader, options, PropRemoveTrailing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.StopTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + IgnoreCase = propIgnoreCase.Value, + RemoveTrailing = propRemoveTrailing.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.StopTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIgnoreCase, value.IgnoreCase, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRemoveTrailing, value.RemoveTrailing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopTokenFilter.g.cs index bbfc607674e..8ac165fef83 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopTokenFilter.g.cs @@ -23,90 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class StopTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIgnoreCase = System.Text.Json.JsonEncodedText.Encode("ignore_case"); - private static readonly System.Text.Json.JsonEncodedText PropRemoveTrailing = System.Text.Json.JsonEncodedText.Encode("remove_trailing"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.StopTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIgnoreCase = default; - LocalJsonValue propRemoveTrailing = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIgnoreCase.TryReadProperty(ref reader, options, PropIgnoreCase, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRemoveTrailing.TryReadProperty(ref reader, options, PropRemoveTrailing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.StopTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - IgnoreCase = propIgnoreCase.Value, - RemoveTrailing = propRemoveTrailing.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.StopTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIgnoreCase, value.IgnoreCase, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRemoveTrailing, value.RemoveTrailing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.StopTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.StopTokenFilterConverter))] public sealed partial class StopTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopWordLanguage.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopWordLanguage.Converters.g.cs new file mode 100644 index 00000000000..1d86713aa55 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopWordLanguage.Converters.g.cs @@ -0,0 +1,571 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class StopWordLanguageConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberArabic = System.Text.Json.JsonEncodedText.Encode("_arabic_"); + private static readonly System.Text.Json.JsonEncodedText MemberArmenian = System.Text.Json.JsonEncodedText.Encode("_armenian_"); + private static readonly System.Text.Json.JsonEncodedText MemberBasque = System.Text.Json.JsonEncodedText.Encode("_basque_"); + private static readonly System.Text.Json.JsonEncodedText MemberBengali = System.Text.Json.JsonEncodedText.Encode("_bengali_"); + private static readonly System.Text.Json.JsonEncodedText MemberBrazilian = System.Text.Json.JsonEncodedText.Encode("_brazilian_"); + private static readonly System.Text.Json.JsonEncodedText MemberBulgarian = System.Text.Json.JsonEncodedText.Encode("_bulgarian_"); + private static readonly System.Text.Json.JsonEncodedText MemberCatalan = System.Text.Json.JsonEncodedText.Encode("_catalan_"); + private static readonly System.Text.Json.JsonEncodedText MemberCjk = System.Text.Json.JsonEncodedText.Encode("_cjk_"); + private static readonly System.Text.Json.JsonEncodedText MemberCzech = System.Text.Json.JsonEncodedText.Encode("_czech_"); + private static readonly System.Text.Json.JsonEncodedText MemberDanish = System.Text.Json.JsonEncodedText.Encode("_danish_"); + private static readonly System.Text.Json.JsonEncodedText MemberDutch = System.Text.Json.JsonEncodedText.Encode("_dutch_"); + private static readonly System.Text.Json.JsonEncodedText MemberEnglish = System.Text.Json.JsonEncodedText.Encode("_english_"); + private static readonly System.Text.Json.JsonEncodedText MemberEstonian = System.Text.Json.JsonEncodedText.Encode("_estonian_"); + private static readonly System.Text.Json.JsonEncodedText MemberFinnish = System.Text.Json.JsonEncodedText.Encode("_finnish_"); + private static readonly System.Text.Json.JsonEncodedText MemberFrench = System.Text.Json.JsonEncodedText.Encode("_french_"); + private static readonly System.Text.Json.JsonEncodedText MemberGalician = System.Text.Json.JsonEncodedText.Encode("_galician_"); + private static readonly System.Text.Json.JsonEncodedText MemberGerman = System.Text.Json.JsonEncodedText.Encode("_german_"); + private static readonly System.Text.Json.JsonEncodedText MemberGreek = System.Text.Json.JsonEncodedText.Encode("_greek_"); + private static readonly System.Text.Json.JsonEncodedText MemberHindi = System.Text.Json.JsonEncodedText.Encode("_hindi_"); + private static readonly System.Text.Json.JsonEncodedText MemberHungarian = System.Text.Json.JsonEncodedText.Encode("_hungarian_"); + private static readonly System.Text.Json.JsonEncodedText MemberIndonesian = System.Text.Json.JsonEncodedText.Encode("_indonesian_"); + private static readonly System.Text.Json.JsonEncodedText MemberIrish = System.Text.Json.JsonEncodedText.Encode("_irish_"); + private static readonly System.Text.Json.JsonEncodedText MemberItalian = System.Text.Json.JsonEncodedText.Encode("_italian_"); + private static readonly System.Text.Json.JsonEncodedText MemberLatvian = System.Text.Json.JsonEncodedText.Encode("_latvian_"); + private static readonly System.Text.Json.JsonEncodedText MemberLithuanian = System.Text.Json.JsonEncodedText.Encode("_lithuanian_"); + private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("_none_"); + private static readonly System.Text.Json.JsonEncodedText MemberNorwegian = System.Text.Json.JsonEncodedText.Encode("_norwegian_"); + private static readonly System.Text.Json.JsonEncodedText MemberPersian = System.Text.Json.JsonEncodedText.Encode("_persian_"); + private static readonly System.Text.Json.JsonEncodedText MemberPortuguese = System.Text.Json.JsonEncodedText.Encode("_portuguese_"); + private static readonly System.Text.Json.JsonEncodedText MemberRomanian = System.Text.Json.JsonEncodedText.Encode("_romanian_"); + private static readonly System.Text.Json.JsonEncodedText MemberRussian = System.Text.Json.JsonEncodedText.Encode("_russian_"); + private static readonly System.Text.Json.JsonEncodedText MemberSerbian = System.Text.Json.JsonEncodedText.Encode("_serbian_"); + private static readonly System.Text.Json.JsonEncodedText MemberSorani = System.Text.Json.JsonEncodedText.Encode("_sorani_"); + private static readonly System.Text.Json.JsonEncodedText MemberSpanish = System.Text.Json.JsonEncodedText.Encode("_spanish_"); + private static readonly System.Text.Json.JsonEncodedText MemberSwedish = System.Text.Json.JsonEncodedText.Encode("_swedish_"); + private static readonly System.Text.Json.JsonEncodedText MemberThai = System.Text.Json.JsonEncodedText.Encode("_thai_"); + private static readonly System.Text.Json.JsonEncodedText MemberTurkish = System.Text.Json.JsonEncodedText.Encode("_turkish_"); + + public override Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberArabic)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Arabic; + } + + if (reader.ValueTextEquals(MemberArmenian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Armenian; + } + + if (reader.ValueTextEquals(MemberBasque)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Basque; + } + + if (reader.ValueTextEquals(MemberBengali)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Bengali; + } + + if (reader.ValueTextEquals(MemberBrazilian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Brazilian; + } + + if (reader.ValueTextEquals(MemberBulgarian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Bulgarian; + } + + if (reader.ValueTextEquals(MemberCatalan)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Catalan; + } + + if (reader.ValueTextEquals(MemberCjk)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Cjk; + } + + if (reader.ValueTextEquals(MemberCzech)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Czech; + } + + if (reader.ValueTextEquals(MemberDanish)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Danish; + } + + if (reader.ValueTextEquals(MemberDutch)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Dutch; + } + + if (reader.ValueTextEquals(MemberEnglish)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.English; + } + + if (reader.ValueTextEquals(MemberEstonian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Estonian; + } + + if (reader.ValueTextEquals(MemberFinnish)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Finnish; + } + + if (reader.ValueTextEquals(MemberFrench)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.French; + } + + if (reader.ValueTextEquals(MemberGalician)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Galician; + } + + if (reader.ValueTextEquals(MemberGerman)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.German; + } + + if (reader.ValueTextEquals(MemberGreek)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Greek; + } + + if (reader.ValueTextEquals(MemberHindi)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Hindi; + } + + if (reader.ValueTextEquals(MemberHungarian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Hungarian; + } + + if (reader.ValueTextEquals(MemberIndonesian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Indonesian; + } + + if (reader.ValueTextEquals(MemberIrish)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Irish; + } + + if (reader.ValueTextEquals(MemberItalian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Italian; + } + + if (reader.ValueTextEquals(MemberLatvian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Latvian; + } + + if (reader.ValueTextEquals(MemberLithuanian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Lithuanian; + } + + if (reader.ValueTextEquals(MemberNone)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.None; + } + + if (reader.ValueTextEquals(MemberNorwegian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Norwegian; + } + + if (reader.ValueTextEquals(MemberPersian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Persian; + } + + if (reader.ValueTextEquals(MemberPortuguese)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Portuguese; + } + + if (reader.ValueTextEquals(MemberRomanian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Romanian; + } + + if (reader.ValueTextEquals(MemberRussian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Russian; + } + + if (reader.ValueTextEquals(MemberSerbian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Serbian; + } + + if (reader.ValueTextEquals(MemberSorani)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Sorani; + } + + if (reader.ValueTextEquals(MemberSpanish)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Spanish; + } + + if (reader.ValueTextEquals(MemberSwedish)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Swedish; + } + + if (reader.ValueTextEquals(MemberThai)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Thai; + } + + if (reader.ValueTextEquals(MemberTurkish)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Turkish; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberArabic.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Arabic; + } + + if (string.Equals(value, MemberArmenian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Armenian; + } + + if (string.Equals(value, MemberBasque.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Basque; + } + + if (string.Equals(value, MemberBengali.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Bengali; + } + + if (string.Equals(value, MemberBrazilian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Brazilian; + } + + if (string.Equals(value, MemberBulgarian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Bulgarian; + } + + if (string.Equals(value, MemberCatalan.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Catalan; + } + + if (string.Equals(value, MemberCjk.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Cjk; + } + + if (string.Equals(value, MemberCzech.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Czech; + } + + if (string.Equals(value, MemberDanish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Danish; + } + + if (string.Equals(value, MemberDutch.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Dutch; + } + + if (string.Equals(value, MemberEnglish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.English; + } + + if (string.Equals(value, MemberEstonian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Estonian; + } + + if (string.Equals(value, MemberFinnish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Finnish; + } + + if (string.Equals(value, MemberFrench.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.French; + } + + if (string.Equals(value, MemberGalician.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Galician; + } + + if (string.Equals(value, MemberGerman.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.German; + } + + if (string.Equals(value, MemberGreek.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Greek; + } + + if (string.Equals(value, MemberHindi.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Hindi; + } + + if (string.Equals(value, MemberHungarian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Hungarian; + } + + if (string.Equals(value, MemberIndonesian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Indonesian; + } + + if (string.Equals(value, MemberIrish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Irish; + } + + if (string.Equals(value, MemberItalian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Italian; + } + + if (string.Equals(value, MemberLatvian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Latvian; + } + + if (string.Equals(value, MemberLithuanian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Lithuanian; + } + + if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.None; + } + + if (string.Equals(value, MemberNorwegian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Norwegian; + } + + if (string.Equals(value, MemberPersian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Persian; + } + + if (string.Equals(value, MemberPortuguese.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Portuguese; + } + + if (string.Equals(value, MemberRomanian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Romanian; + } + + if (string.Equals(value, MemberRussian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Russian; + } + + if (string.Equals(value, MemberSerbian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Serbian; + } + + if (string.Equals(value, MemberSorani.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Sorani; + } + + if (string.Equals(value, MemberSpanish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Spanish; + } + + if (string.Equals(value, MemberSwedish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Swedish; + } + + if (string.Equals(value, MemberThai.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Thai; + } + + if (string.Equals(value, MemberTurkish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Turkish; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Arabic: + writer.WriteStringValue(MemberArabic); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Armenian: + writer.WriteStringValue(MemberArmenian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Basque: + writer.WriteStringValue(MemberBasque); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Bengali: + writer.WriteStringValue(MemberBengali); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Brazilian: + writer.WriteStringValue(MemberBrazilian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Bulgarian: + writer.WriteStringValue(MemberBulgarian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Catalan: + writer.WriteStringValue(MemberCatalan); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Cjk: + writer.WriteStringValue(MemberCjk); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Czech: + writer.WriteStringValue(MemberCzech); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Danish: + writer.WriteStringValue(MemberDanish); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Dutch: + writer.WriteStringValue(MemberDutch); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.English: + writer.WriteStringValue(MemberEnglish); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Estonian: + writer.WriteStringValue(MemberEstonian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Finnish: + writer.WriteStringValue(MemberFinnish); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.French: + writer.WriteStringValue(MemberFrench); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Galician: + writer.WriteStringValue(MemberGalician); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.German: + writer.WriteStringValue(MemberGerman); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Greek: + writer.WriteStringValue(MemberGreek); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Hindi: + writer.WriteStringValue(MemberHindi); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Hungarian: + writer.WriteStringValue(MemberHungarian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Indonesian: + writer.WriteStringValue(MemberIndonesian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Irish: + writer.WriteStringValue(MemberIrish); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Italian: + writer.WriteStringValue(MemberItalian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Latvian: + writer.WriteStringValue(MemberLatvian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Lithuanian: + writer.WriteStringValue(MemberLithuanian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.None: + writer.WriteStringValue(MemberNone); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Norwegian: + writer.WriteStringValue(MemberNorwegian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Persian: + writer.WriteStringValue(MemberPersian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Portuguese: + writer.WriteStringValue(MemberPortuguese); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Romanian: + writer.WriteStringValue(MemberRomanian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Russian: + writer.WriteStringValue(MemberRussian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Serbian: + writer.WriteStringValue(MemberSerbian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Sorani: + writer.WriteStringValue(MemberSorani); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Spanish: + writer.WriteStringValue(MemberSpanish); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Swedish: + writer.WriteStringValue(MemberSwedish); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Thai: + writer.WriteStringValue(MemberThai); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Turkish: + writer.WriteStringValue(MemberTurkish); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopWordLanguage.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopWordLanguage.g.cs new file mode 100644 index 00000000000..0d5140f905e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopWordLanguage.g.cs @@ -0,0 +1,103 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.StopWordLanguageConverter))] +public enum StopWordLanguage +{ + [System.Runtime.Serialization.EnumMember(Value = "_arabic_")] + Arabic, + [System.Runtime.Serialization.EnumMember(Value = "_armenian_")] + Armenian, + [System.Runtime.Serialization.EnumMember(Value = "_basque_")] + Basque, + [System.Runtime.Serialization.EnumMember(Value = "_bengali_")] + Bengali, + [System.Runtime.Serialization.EnumMember(Value = "_brazilian_")] + Brazilian, + [System.Runtime.Serialization.EnumMember(Value = "_bulgarian_")] + Bulgarian, + [System.Runtime.Serialization.EnumMember(Value = "_catalan_")] + Catalan, + [System.Runtime.Serialization.EnumMember(Value = "_cjk_")] + Cjk, + [System.Runtime.Serialization.EnumMember(Value = "_czech_")] + Czech, + [System.Runtime.Serialization.EnumMember(Value = "_danish_")] + Danish, + [System.Runtime.Serialization.EnumMember(Value = "_dutch_")] + Dutch, + [System.Runtime.Serialization.EnumMember(Value = "_english_")] + English, + [System.Runtime.Serialization.EnumMember(Value = "_estonian_")] + Estonian, + [System.Runtime.Serialization.EnumMember(Value = "_finnish_")] + Finnish, + [System.Runtime.Serialization.EnumMember(Value = "_french_")] + French, + [System.Runtime.Serialization.EnumMember(Value = "_galician_")] + Galician, + [System.Runtime.Serialization.EnumMember(Value = "_german_")] + German, + [System.Runtime.Serialization.EnumMember(Value = "_greek_")] + Greek, + [System.Runtime.Serialization.EnumMember(Value = "_hindi_")] + Hindi, + [System.Runtime.Serialization.EnumMember(Value = "_hungarian_")] + Hungarian, + [System.Runtime.Serialization.EnumMember(Value = "_indonesian_")] + Indonesian, + [System.Runtime.Serialization.EnumMember(Value = "_irish_")] + Irish, + [System.Runtime.Serialization.EnumMember(Value = "_italian_")] + Italian, + [System.Runtime.Serialization.EnumMember(Value = "_latvian_")] + Latvian, + [System.Runtime.Serialization.EnumMember(Value = "_lithuanian_")] + Lithuanian, + [System.Runtime.Serialization.EnumMember(Value = "_none_")] + None, + [System.Runtime.Serialization.EnumMember(Value = "_norwegian_")] + Norwegian, + [System.Runtime.Serialization.EnumMember(Value = "_persian_")] + Persian, + [System.Runtime.Serialization.EnumMember(Value = "_portuguese_")] + Portuguese, + [System.Runtime.Serialization.EnumMember(Value = "_romanian_")] + Romanian, + [System.Runtime.Serialization.EnumMember(Value = "_russian_")] + Russian, + [System.Runtime.Serialization.EnumMember(Value = "_serbian_")] + Serbian, + [System.Runtime.Serialization.EnumMember(Value = "_sorani_")] + Sorani, + [System.Runtime.Serialization.EnumMember(Value = "_spanish_")] + Spanish, + [System.Runtime.Serialization.EnumMember(Value = "_swedish_")] + Swedish, + [System.Runtime.Serialization.EnumMember(Value = "_thai_")] + Thai, + [System.Runtime.Serialization.EnumMember(Value = "_turkish_")] + Turkish +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SwedishAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SwedishAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..2cff3a8b132 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SwedishAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class SwedishAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.SwedishAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.SwedishAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SwedishAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SwedishAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SwedishAnalyzer.g.cs index 38a2cebbe0a..2d0a8efb4a2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SwedishAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SwedishAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class SwedishAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.SwedishAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.SwedishAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SwedishAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.SwedishAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.SwedishAnalyzerConverter))] public sealed partial class SwedishAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymFormat.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymFormat.Converters.g.cs new file mode 100644 index 00000000000..3d0cffee04d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymFormat.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class SynonymFormatConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberSolr = System.Text.Json.JsonEncodedText.Encode("solr"); + private static readonly System.Text.Json.JsonEncodedText MemberWordnet = System.Text.Json.JsonEncodedText.Encode("wordnet"); + + public override Elastic.Clients.Elasticsearch.Analysis.SynonymFormat Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberSolr)) + { + return Elastic.Clients.Elasticsearch.Analysis.SynonymFormat.Solr; + } + + if (reader.ValueTextEquals(MemberWordnet)) + { + return Elastic.Clients.Elasticsearch.Analysis.SynonymFormat.Wordnet; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberSolr.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SynonymFormat.Solr; + } + + if (string.Equals(value, MemberWordnet.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SynonymFormat.Wordnet; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.SynonymFormat)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SynonymFormat value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Analysis.SynonymFormat.Solr: + writer.WriteStringValue(MemberSolr); + break; + case Elastic.Clients.Elasticsearch.Analysis.SynonymFormat.Wordnet: + writer.WriteStringValue(MemberWordnet); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.SynonymFormat)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Analysis.SynonymFormat ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SynonymFormat value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymFormat.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymFormat.g.cs new file mode 100644 index 00000000000..4554130a9ab --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymFormat.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.SynonymFormatConverter))] +public enum SynonymFormat +{ + [System.Runtime.Serialization.EnumMember(Value = "solr")] + Solr, + [System.Runtime.Serialization.EnumMember(Value = "wordnet")] + Wordnet +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymGraphTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymGraphTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..95e1bf00e08 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymGraphTokenFilter.Converters.g.cs @@ -0,0 +1,143 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class SynonymGraphTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExpand = System.Text.Json.JsonEncodedText.Encode("expand"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropLenient = System.Text.Json.JsonEncodedText.Encode("lenient"); + private static readonly System.Text.Json.JsonEncodedText PropSynonyms = System.Text.Json.JsonEncodedText.Encode("synonyms"); + private static readonly System.Text.Json.JsonEncodedText PropSynonymsPath = System.Text.Json.JsonEncodedText.Encode("synonyms_path"); + private static readonly System.Text.Json.JsonEncodedText PropSynonymsSet = System.Text.Json.JsonEncodedText.Encode("synonyms_set"); + private static readonly System.Text.Json.JsonEncodedText PropTokenizer = System.Text.Json.JsonEncodedText.Encode("tokenizer"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropUpdateable = System.Text.Json.JsonEncodedText.Encode("updateable"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.SynonymGraphTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExpand = default; + LocalJsonValue propFormat = default; + LocalJsonValue propLenient = default; + LocalJsonValue?> propSynonyms = default; + LocalJsonValue propSynonymsPath = default; + LocalJsonValue propSynonymsSet = default; + LocalJsonValue propTokenizer = default; + LocalJsonValue propUpdateable = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExpand.TryReadProperty(ref reader, options, PropExpand, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, static Elastic.Clients.Elasticsearch.Analysis.SynonymFormat? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLenient.TryReadProperty(ref reader, options, PropLenient, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSynonyms.TryReadProperty(ref reader, options, PropSynonyms, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propSynonymsPath.TryReadProperty(ref reader, options, PropSynonymsPath, null)) + { + continue; + } + + if (propSynonymsSet.TryReadProperty(ref reader, options, PropSynonymsSet, null)) + { + continue; + } + + if (propTokenizer.TryReadProperty(ref reader, options, PropTokenizer, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propUpdateable.TryReadProperty(ref reader, options, PropUpdateable, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.SynonymGraphTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Expand = propExpand.Value, + Format = propFormat.Value, + Lenient = propLenient.Value, + Synonyms = propSynonyms.Value, + SynonymsPath = propSynonymsPath.Value, + SynonymsSet = propSynonymsSet.Value, + Tokenizer = propTokenizer.Value, + Updateable = propUpdateable.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SynonymGraphTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExpand, value.Expand, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFormat, value.Format, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.SynonymFormat? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLenient, value.Lenient, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSynonyms, value.Synonyms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSynonymsPath, value.SynonymsPath, null, null); + writer.WriteProperty(options, PropSynonymsSet, value.SynonymsSet, null, null); + writer.WriteProperty(options, PropTokenizer, value.Tokenizer, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropUpdateable, value.Updateable, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymGraphTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymGraphTokenFilter.g.cs index 8d6a594e7a2..82a9f66f640 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymGraphTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymGraphTokenFilter.g.cs @@ -23,126 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class SynonymGraphTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExpand = System.Text.Json.JsonEncodedText.Encode("expand"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropLenient = System.Text.Json.JsonEncodedText.Encode("lenient"); - private static readonly System.Text.Json.JsonEncodedText PropSynonyms = System.Text.Json.JsonEncodedText.Encode("synonyms"); - private static readonly System.Text.Json.JsonEncodedText PropSynonymsPath = System.Text.Json.JsonEncodedText.Encode("synonyms_path"); - private static readonly System.Text.Json.JsonEncodedText PropSynonymsSet = System.Text.Json.JsonEncodedText.Encode("synonyms_set"); - private static readonly System.Text.Json.JsonEncodedText PropTokenizer = System.Text.Json.JsonEncodedText.Encode("tokenizer"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropUpdateable = System.Text.Json.JsonEncodedText.Encode("updateable"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.SynonymGraphTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propExpand = default; - LocalJsonValue propFormat = default; - LocalJsonValue propLenient = default; - LocalJsonValue?> propSynonyms = default; - LocalJsonValue propSynonymsPath = default; - LocalJsonValue propSynonymsSet = default; - LocalJsonValue propTokenizer = default; - LocalJsonValue propUpdateable = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExpand.TryReadProperty(ref reader, options, PropExpand, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, static Elastic.Clients.Elasticsearch.Analysis.SynonymFormat? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLenient.TryReadProperty(ref reader, options, PropLenient, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSynonyms.TryReadProperty(ref reader, options, PropSynonyms, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propSynonymsPath.TryReadProperty(ref reader, options, PropSynonymsPath, null)) - { - continue; - } - - if (propSynonymsSet.TryReadProperty(ref reader, options, PropSynonymsSet, null)) - { - continue; - } - - if (propTokenizer.TryReadProperty(ref reader, options, PropTokenizer, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propUpdateable.TryReadProperty(ref reader, options, PropUpdateable, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.SynonymGraphTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Expand = propExpand.Value, - Format = propFormat.Value, - Lenient = propLenient.Value, - Synonyms = propSynonyms.Value, - SynonymsPath = propSynonymsPath.Value, - SynonymsSet = propSynonymsSet.Value, - Tokenizer = propTokenizer.Value, - Updateable = propUpdateable.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SynonymGraphTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExpand, value.Expand, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFormat, value.Format, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.SynonymFormat? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLenient, value.Lenient, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSynonyms, value.Synonyms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSynonymsPath, value.SynonymsPath, null, null); - writer.WriteProperty(options, PropSynonymsSet, value.SynonymsSet, null, null); - writer.WriteProperty(options, PropTokenizer, value.Tokenizer, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropUpdateable, value.Updateable, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.SynonymGraphTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.SynonymGraphTokenFilterConverter))] public sealed partial class SynonymGraphTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..ab082a3efa7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymTokenFilter.Converters.g.cs @@ -0,0 +1,143 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class SynonymTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExpand = System.Text.Json.JsonEncodedText.Encode("expand"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropLenient = System.Text.Json.JsonEncodedText.Encode("lenient"); + private static readonly System.Text.Json.JsonEncodedText PropSynonyms = System.Text.Json.JsonEncodedText.Encode("synonyms"); + private static readonly System.Text.Json.JsonEncodedText PropSynonymsPath = System.Text.Json.JsonEncodedText.Encode("synonyms_path"); + private static readonly System.Text.Json.JsonEncodedText PropSynonymsSet = System.Text.Json.JsonEncodedText.Encode("synonyms_set"); + private static readonly System.Text.Json.JsonEncodedText PropTokenizer = System.Text.Json.JsonEncodedText.Encode("tokenizer"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropUpdateable = System.Text.Json.JsonEncodedText.Encode("updateable"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.SynonymTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExpand = default; + LocalJsonValue propFormat = default; + LocalJsonValue propLenient = default; + LocalJsonValue?> propSynonyms = default; + LocalJsonValue propSynonymsPath = default; + LocalJsonValue propSynonymsSet = default; + LocalJsonValue propTokenizer = default; + LocalJsonValue propUpdateable = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExpand.TryReadProperty(ref reader, options, PropExpand, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, static Elastic.Clients.Elasticsearch.Analysis.SynonymFormat? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLenient.TryReadProperty(ref reader, options, PropLenient, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSynonyms.TryReadProperty(ref reader, options, PropSynonyms, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propSynonymsPath.TryReadProperty(ref reader, options, PropSynonymsPath, null)) + { + continue; + } + + if (propSynonymsSet.TryReadProperty(ref reader, options, PropSynonymsSet, null)) + { + continue; + } + + if (propTokenizer.TryReadProperty(ref reader, options, PropTokenizer, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propUpdateable.TryReadProperty(ref reader, options, PropUpdateable, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.SynonymTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Expand = propExpand.Value, + Format = propFormat.Value, + Lenient = propLenient.Value, + Synonyms = propSynonyms.Value, + SynonymsPath = propSynonymsPath.Value, + SynonymsSet = propSynonymsSet.Value, + Tokenizer = propTokenizer.Value, + Updateable = propUpdateable.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SynonymTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExpand, value.Expand, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFormat, value.Format, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.SynonymFormat? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLenient, value.Lenient, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSynonyms, value.Synonyms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSynonymsPath, value.SynonymsPath, null, null); + writer.WriteProperty(options, PropSynonymsSet, value.SynonymsSet, null, null); + writer.WriteProperty(options, PropTokenizer, value.Tokenizer, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropUpdateable, value.Updateable, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymTokenFilter.g.cs index 5efef1a0ded..c2e77ae4a40 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymTokenFilter.g.cs @@ -23,126 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class SynonymTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExpand = System.Text.Json.JsonEncodedText.Encode("expand"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropLenient = System.Text.Json.JsonEncodedText.Encode("lenient"); - private static readonly System.Text.Json.JsonEncodedText PropSynonyms = System.Text.Json.JsonEncodedText.Encode("synonyms"); - private static readonly System.Text.Json.JsonEncodedText PropSynonymsPath = System.Text.Json.JsonEncodedText.Encode("synonyms_path"); - private static readonly System.Text.Json.JsonEncodedText PropSynonymsSet = System.Text.Json.JsonEncodedText.Encode("synonyms_set"); - private static readonly System.Text.Json.JsonEncodedText PropTokenizer = System.Text.Json.JsonEncodedText.Encode("tokenizer"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropUpdateable = System.Text.Json.JsonEncodedText.Encode("updateable"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.SynonymTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propExpand = default; - LocalJsonValue propFormat = default; - LocalJsonValue propLenient = default; - LocalJsonValue?> propSynonyms = default; - LocalJsonValue propSynonymsPath = default; - LocalJsonValue propSynonymsSet = default; - LocalJsonValue propTokenizer = default; - LocalJsonValue propUpdateable = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExpand.TryReadProperty(ref reader, options, PropExpand, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, static Elastic.Clients.Elasticsearch.Analysis.SynonymFormat? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLenient.TryReadProperty(ref reader, options, PropLenient, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSynonyms.TryReadProperty(ref reader, options, PropSynonyms, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propSynonymsPath.TryReadProperty(ref reader, options, PropSynonymsPath, null)) - { - continue; - } - - if (propSynonymsSet.TryReadProperty(ref reader, options, PropSynonymsSet, null)) - { - continue; - } - - if (propTokenizer.TryReadProperty(ref reader, options, PropTokenizer, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propUpdateable.TryReadProperty(ref reader, options, PropUpdateable, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.SynonymTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Expand = propExpand.Value, - Format = propFormat.Value, - Lenient = propLenient.Value, - Synonyms = propSynonyms.Value, - SynonymsPath = propSynonymsPath.Value, - SynonymsSet = propSynonymsSet.Value, - Tokenizer = propTokenizer.Value, - Updateable = propUpdateable.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SynonymTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExpand, value.Expand, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFormat, value.Format, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.SynonymFormat? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLenient, value.Lenient, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSynonyms, value.Synonyms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSynonymsPath, value.SynonymsPath, null, null); - writer.WriteProperty(options, PropSynonymsSet, value.SynonymsSet, null, null); - writer.WriteProperty(options, PropTokenizer, value.Tokenizer, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropUpdateable, value.Updateable, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.SynonymTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.SynonymTokenFilterConverter))] public sealed partial class SynonymTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ThaiAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ThaiAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..07827963c2b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ThaiAnalyzer.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class ThaiAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.ThaiAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.ThaiAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ThaiAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ThaiAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ThaiAnalyzer.g.cs index 45d72005ccf..620af080bdc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ThaiAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ThaiAnalyzer.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class ThaiAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.ThaiAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.ThaiAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ThaiAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.ThaiAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.ThaiAnalyzerConverter))] public sealed partial class ThaiAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ThaiTokenizer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ThaiTokenizer.Converters.g.cs new file mode 100644 index 00000000000..b41af6ae14a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ThaiTokenizer.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class ThaiTokenizerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.ThaiTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.ThaiTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ThaiTokenizer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ThaiTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ThaiTokenizer.g.cs index d4dfab85713..b8072fcdc19 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ThaiTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ThaiTokenizer.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class ThaiTokenizerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.ThaiTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.ThaiTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ThaiTokenizer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.ThaiTokenizerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.ThaiTokenizerConverter))] public sealed partial class ThaiTokenizer : Elastic.Clients.Elasticsearch.Analysis.ITokenizer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenChar.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenChar.Converters.g.cs new file mode 100644 index 00000000000..d3b5078bb88 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenChar.Converters.g.cs @@ -0,0 +1,137 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class TokenCharConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCustom = System.Text.Json.JsonEncodedText.Encode("custom"); + private static readonly System.Text.Json.JsonEncodedText MemberDigit = System.Text.Json.JsonEncodedText.Encode("digit"); + private static readonly System.Text.Json.JsonEncodedText MemberLetter = System.Text.Json.JsonEncodedText.Encode("letter"); + private static readonly System.Text.Json.JsonEncodedText MemberPunctuation = System.Text.Json.JsonEncodedText.Encode("punctuation"); + private static readonly System.Text.Json.JsonEncodedText MemberSymbol = System.Text.Json.JsonEncodedText.Encode("symbol"); + private static readonly System.Text.Json.JsonEncodedText MemberWhitespace = System.Text.Json.JsonEncodedText.Encode("whitespace"); + + public override Elastic.Clients.Elasticsearch.Analysis.TokenChar Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCustom)) + { + return Elastic.Clients.Elasticsearch.Analysis.TokenChar.Custom; + } + + if (reader.ValueTextEquals(MemberDigit)) + { + return Elastic.Clients.Elasticsearch.Analysis.TokenChar.Digit; + } + + if (reader.ValueTextEquals(MemberLetter)) + { + return Elastic.Clients.Elasticsearch.Analysis.TokenChar.Letter; + } + + if (reader.ValueTextEquals(MemberPunctuation)) + { + return Elastic.Clients.Elasticsearch.Analysis.TokenChar.Punctuation; + } + + if (reader.ValueTextEquals(MemberSymbol)) + { + return Elastic.Clients.Elasticsearch.Analysis.TokenChar.Symbol; + } + + if (reader.ValueTextEquals(MemberWhitespace)) + { + return Elastic.Clients.Elasticsearch.Analysis.TokenChar.Whitespace; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCustom.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.TokenChar.Custom; + } + + if (string.Equals(value, MemberDigit.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.TokenChar.Digit; + } + + if (string.Equals(value, MemberLetter.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.TokenChar.Letter; + } + + if (string.Equals(value, MemberPunctuation.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.TokenChar.Punctuation; + } + + if (string.Equals(value, MemberSymbol.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.TokenChar.Symbol; + } + + if (string.Equals(value, MemberWhitespace.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.TokenChar.Whitespace; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.TokenChar)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.TokenChar value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Analysis.TokenChar.Custom: + writer.WriteStringValue(MemberCustom); + break; + case Elastic.Clients.Elasticsearch.Analysis.TokenChar.Digit: + writer.WriteStringValue(MemberDigit); + break; + case Elastic.Clients.Elasticsearch.Analysis.TokenChar.Letter: + writer.WriteStringValue(MemberLetter); + break; + case Elastic.Clients.Elasticsearch.Analysis.TokenChar.Punctuation: + writer.WriteStringValue(MemberPunctuation); + break; + case Elastic.Clients.Elasticsearch.Analysis.TokenChar.Symbol: + writer.WriteStringValue(MemberSymbol); + break; + case Elastic.Clients.Elasticsearch.Analysis.TokenChar.Whitespace: + writer.WriteStringValue(MemberWhitespace); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.TokenChar)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Analysis.TokenChar ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.TokenChar value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenChar.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenChar.g.cs new file mode 100644 index 00000000000..8d0f65d24a2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenChar.g.cs @@ -0,0 +1,41 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.TokenCharConverter))] +public enum TokenChar +{ + [System.Runtime.Serialization.EnumMember(Value = "custom")] + Custom, + [System.Runtime.Serialization.EnumMember(Value = "digit")] + Digit, + [System.Runtime.Serialization.EnumMember(Value = "letter")] + Letter, + [System.Runtime.Serialization.EnumMember(Value = "punctuation")] + Punctuation, + [System.Runtime.Serialization.EnumMember(Value = "symbol")] + Symbol, + [System.Runtime.Serialization.EnumMember(Value = "whitespace")] + Whitespace +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenFilter.Converters.g.cs new file mode 100644 index 00000000000..82696978c9e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenFilter.Converters.g.cs @@ -0,0 +1,356 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class ITokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDiscriminator = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.ITokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + var readerSnapshot = reader; + string? discriminator = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.TryReadProperty(options, PropDiscriminator, ref discriminator, null)) + { + break; + } + + reader.Skip(); + } + + reader = readerSnapshot; + return discriminator switch + { + "apostrophe" => reader.ReadValue(options, null), + "arabic_normalization" => reader.ReadValue(options, null), + "arabic_stem" => reader.ReadValue(options, null), + "asciifolding" => reader.ReadValue(options, null), + "bengali_normalization" => reader.ReadValue(options, null), + "brazilian_stem" => reader.ReadValue(options, null), + "cjk_bigram" => reader.ReadValue(options, null), + "cjk_width" => reader.ReadValue(options, null), + "classic" => reader.ReadValue(options, null), + "common_grams" => reader.ReadValue(options, null), + "condition" => reader.ReadValue(options, null), + "czech_stem" => reader.ReadValue(options, null), + "decimal_digit" => reader.ReadValue(options, null), + "delimited_payload" => reader.ReadValue(options, null), + "dictionary_decompounder" => reader.ReadValue(options, null), + "dutch_stem" => reader.ReadValue(options, null), + "edge_ngram" => reader.ReadValue(options, null), + "elision" => reader.ReadValue(options, null), + "fingerprint" => reader.ReadValue(options, null), + "flatten_graph" => reader.ReadValue(options, null), + "french_stem" => reader.ReadValue(options, null), + "german_normalization" => reader.ReadValue(options, null), + "german_stem" => reader.ReadValue(options, null), + "hindi_normalization" => reader.ReadValue(options, null), + "hunspell" => reader.ReadValue(options, null), + "hyphenation_decompounder" => reader.ReadValue(options, null), + "icu_collation" => reader.ReadValue(options, null), + "icu_folding" => reader.ReadValue(options, null), + "icu_normalizer" => reader.ReadValue(options, null), + "icu_transform" => reader.ReadValue(options, null), + "indic_normalization" => reader.ReadValue(options, null), + "ja_stop" => reader.ReadValue(options, null), + "keep" => reader.ReadValue(options, null), + "keep_types" => reader.ReadValue(options, null), + "keyword_marker" => reader.ReadValue(options, null), + "keyword_repeat" => reader.ReadValue(options, null), + "kstem" => reader.ReadValue(options, null), + "kuromoji_part_of_speech" => reader.ReadValue(options, null), + "kuromoji_readingform" => reader.ReadValue(options, null), + "kuromoji_stemmer" => reader.ReadValue(options, null), + "length" => reader.ReadValue(options, null), + "limit" => reader.ReadValue(options, null), + "lowercase" => reader.ReadValue(options, null), + "min_hash" => reader.ReadValue(options, null), + "multiplexer" => reader.ReadValue(options, null), + "ngram" => reader.ReadValue(options, null), + "nori_part_of_speech" => reader.ReadValue(options, null), + "pattern_capture" => reader.ReadValue(options, null), + "pattern_replace" => reader.ReadValue(options, null), + "persian_normalization" => reader.ReadValue(options, null), + "persian_stem" => reader.ReadValue(options, null), + "phonetic" => reader.ReadValue(options, null), + "porter_stem" => reader.ReadValue(options, null), + "predicate_token_filter" => reader.ReadValue(options, null), + "remove_duplicates" => reader.ReadValue(options, null), + "reverse" => reader.ReadValue(options, null), + "russian_stem" => reader.ReadValue(options, null), + "scandinavian_folding" => reader.ReadValue(options, null), + "scandinavian_normalization" => reader.ReadValue(options, null), + "serbian_normalization" => reader.ReadValue(options, null), + "shingle" => reader.ReadValue(options, null), + "snowball" => reader.ReadValue(options, null), + "sorani_normalization" => reader.ReadValue(options, null), + "stemmer" => reader.ReadValue(options, null), + "stemmer_override" => reader.ReadValue(options, null), + "stop" => reader.ReadValue(options, null), + "synonym" => reader.ReadValue(options, null), + "synonym_graph" => reader.ReadValue(options, null), + "trim" => reader.ReadValue(options, null), + "truncate" => reader.ReadValue(options, null), + "unique" => reader.ReadValue(options, null), + "uppercase" => reader.ReadValue(options, null), + "word_delimiter" => reader.ReadValue(options, null), + "word_delimiter_graph" => reader.ReadValue(options, null), + _ => throw new System.Text.Json.JsonException($"Variant '{discriminator}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Analysis.ITokenFilter)}'.") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ITokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Type) + { + case "apostrophe": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilter)value, null); + break; + case "arabic_normalization": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilter)value, null); + break; + case "arabic_stem": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ArabicStemTokenFilter)value, null); + break; + case "asciifolding": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.AsciiFoldingTokenFilter)value, null); + break; + case "bengali_normalization": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.BengaliNormalizationTokenFilter)value, null); + break; + case "brazilian_stem": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.BrazilianStemTokenFilter)value, null); + break; + case "cjk_bigram": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilter)value, null); + break; + case "cjk_width": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilter)value, null); + break; + case "classic": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilter)value, null); + break; + case "common_grams": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.CommonGramsTokenFilter)value, null); + break; + case "condition": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ConditionTokenFilter)value, null); + break; + case "czech_stem": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.CzechStemTokenFilter)value, null); + break; + case "decimal_digit": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilter)value, null); + break; + case "delimited_payload": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadTokenFilter)value, null); + break; + case "dictionary_decompounder": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilter)value, null); + break; + case "dutch_stem": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.DutchStemTokenFilter)value, null); + break; + case "edge_ngram": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenFilter)value, null); + break; + case "elision": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ElisionTokenFilter)value, null); + break; + case "fingerprint": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.FingerprintTokenFilter)value, null); + break; + case "flatten_graph": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilter)value, null); + break; + case "french_stem": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.FrenchStemTokenFilter)value, null); + break; + case "german_normalization": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilter)value, null); + break; + case "german_stem": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.GermanStemTokenFilter)value, null); + break; + case "hindi_normalization": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilter)value, null); + break; + case "hunspell": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.HunspellTokenFilter)value, null); + break; + case "hyphenation_decompounder": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilter)value, null); + break; + case "icu_collation": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilter)value, null); + break; + case "icu_folding": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.IcuFoldingTokenFilter)value, null); + break; + case "icu_normalizer": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationTokenFilter)value, null); + break; + case "icu_transform": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.IcuTransformTokenFilter)value, null); + break; + case "indic_normalization": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilter)value, null); + break; + case "ja_stop": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilter)value, null); + break; + case "keep": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KeepWordsTokenFilter)value, null); + break; + case "keep_types": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilter)value, null); + break; + case "keyword_marker": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KeywordMarkerTokenFilter)value, null); + break; + case "keyword_repeat": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilter)value, null); + break; + case "kstem": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KStemTokenFilter)value, null); + break; + case "kuromoji_part_of_speech": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KuromojiPartOfSpeechTokenFilter)value, null); + break; + case "kuromoji_readingform": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KuromojiReadingFormTokenFilter)value, null); + break; + case "kuromoji_stemmer": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KuromojiStemmerTokenFilter)value, null); + break; + case "length": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.LengthTokenFilter)value, null); + break; + case "limit": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.LimitTokenCountTokenFilter)value, null); + break; + case "lowercase": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilter)value, null); + break; + case "min_hash": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilter)value, null); + break; + case "multiplexer": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.MultiplexerTokenFilter)value, null); + break; + case "ngram": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.NGramTokenFilter)value, null); + break; + case "nori_part_of_speech": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.NoriPartOfSpeechTokenFilter)value, null); + break; + case "pattern_capture": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PatternCaptureTokenFilter)value, null); + break; + case "pattern_replace": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PatternReplaceTokenFilter)value, null); + break; + case "persian_normalization": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilter)value, null); + break; + case "persian_stem": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PersianStemTokenFilter)value, null); + break; + case "phonetic": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PhoneticTokenFilter)value, null); + break; + case "porter_stem": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PorterStemTokenFilter)value, null); + break; + case "predicate_token_filter": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PredicateTokenFilter)value, null); + break; + case "remove_duplicates": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.RemoveDuplicatesTokenFilter)value, null); + break; + case "reverse": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ReverseTokenFilter)value, null); + break; + case "russian_stem": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.RussianStemTokenFilter)value, null); + break; + case "scandinavian_folding": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilter)value, null); + break; + case "scandinavian_normalization": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilter)value, null); + break; + case "serbian_normalization": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilter)value, null); + break; + case "shingle": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilter)value, null); + break; + case "snowball": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SnowballTokenFilter)value, null); + break; + case "sorani_normalization": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilter)value, null); + break; + case "stemmer": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.StemmerTokenFilter)value, null); + break; + case "stemmer_override": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.StemmerOverrideTokenFilter)value, null); + break; + case "stop": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.StopTokenFilter)value, null); + break; + case "synonym": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SynonymTokenFilter)value, null); + break; + case "synonym_graph": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SynonymGraphTokenFilter)value, null); + break; + case "trim": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.TrimTokenFilter)value, null); + break; + case "truncate": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.TruncateTokenFilter)value, null); + break; + case "unique": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.UniqueTokenFilter)value, null); + break; + case "uppercase": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.UppercaseTokenFilter)value, null); + break; + case "word_delimiter": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilter)value, null); + break; + case "word_delimiter_graph": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilter)value, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.Type}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Analysis.ITokenFilter)}'."); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenFilter.g.cs index 05361066917..243803d49a3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenFilter.g.cs @@ -23,339 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class ITokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDiscriminator = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.ITokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - var readerSnapshot = reader; - string? discriminator = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.TryReadProperty(options, PropDiscriminator, ref discriminator, null)) - { - break; - } - - reader.Skip(); - } - - reader = readerSnapshot; - return discriminator switch - { - "apostrophe" => reader.ReadValue(options, null), - "arabic_normalization" => reader.ReadValue(options, null), - "arabic_stem" => reader.ReadValue(options, null), - "asciifolding" => reader.ReadValue(options, null), - "bengali_normalization" => reader.ReadValue(options, null), - "brazilian_stem" => reader.ReadValue(options, null), - "cjk_bigram" => reader.ReadValue(options, null), - "cjk_width" => reader.ReadValue(options, null), - "classic" => reader.ReadValue(options, null), - "common_grams" => reader.ReadValue(options, null), - "condition" => reader.ReadValue(options, null), - "czech_stem" => reader.ReadValue(options, null), - "decimal_digit" => reader.ReadValue(options, null), - "delimited_payload" => reader.ReadValue(options, null), - "dictionary_decompounder" => reader.ReadValue(options, null), - "dutch_stem" => reader.ReadValue(options, null), - "edge_ngram" => reader.ReadValue(options, null), - "elision" => reader.ReadValue(options, null), - "fingerprint" => reader.ReadValue(options, null), - "flatten_graph" => reader.ReadValue(options, null), - "french_stem" => reader.ReadValue(options, null), - "german_normalization" => reader.ReadValue(options, null), - "german_stem" => reader.ReadValue(options, null), - "hindi_normalization" => reader.ReadValue(options, null), - "hunspell" => reader.ReadValue(options, null), - "hyphenation_decompounder" => reader.ReadValue(options, null), - "icu_collation" => reader.ReadValue(options, null), - "icu_folding" => reader.ReadValue(options, null), - "icu_normalizer" => reader.ReadValue(options, null), - "icu_transform" => reader.ReadValue(options, null), - "indic_normalization" => reader.ReadValue(options, null), - "ja_stop" => reader.ReadValue(options, null), - "keep" => reader.ReadValue(options, null), - "keep_types" => reader.ReadValue(options, null), - "keyword_marker" => reader.ReadValue(options, null), - "keyword_repeat" => reader.ReadValue(options, null), - "kstem" => reader.ReadValue(options, null), - "kuromoji_part_of_speech" => reader.ReadValue(options, null), - "kuromoji_readingform" => reader.ReadValue(options, null), - "kuromoji_stemmer" => reader.ReadValue(options, null), - "length" => reader.ReadValue(options, null), - "limit" => reader.ReadValue(options, null), - "lowercase" => reader.ReadValue(options, null), - "min_hash" => reader.ReadValue(options, null), - "multiplexer" => reader.ReadValue(options, null), - "ngram" => reader.ReadValue(options, null), - "nori_part_of_speech" => reader.ReadValue(options, null), - "pattern_capture" => reader.ReadValue(options, null), - "pattern_replace" => reader.ReadValue(options, null), - "persian_normalization" => reader.ReadValue(options, null), - "persian_stem" => reader.ReadValue(options, null), - "phonetic" => reader.ReadValue(options, null), - "porter_stem" => reader.ReadValue(options, null), - "predicate_token_filter" => reader.ReadValue(options, null), - "remove_duplicates" => reader.ReadValue(options, null), - "reverse" => reader.ReadValue(options, null), - "russian_stem" => reader.ReadValue(options, null), - "scandinavian_folding" => reader.ReadValue(options, null), - "scandinavian_normalization" => reader.ReadValue(options, null), - "serbian_normalization" => reader.ReadValue(options, null), - "shingle" => reader.ReadValue(options, null), - "snowball" => reader.ReadValue(options, null), - "sorani_normalization" => reader.ReadValue(options, null), - "stemmer" => reader.ReadValue(options, null), - "stemmer_override" => reader.ReadValue(options, null), - "stop" => reader.ReadValue(options, null), - "synonym" => reader.ReadValue(options, null), - "synonym_graph" => reader.ReadValue(options, null), - "trim" => reader.ReadValue(options, null), - "truncate" => reader.ReadValue(options, null), - "unique" => reader.ReadValue(options, null), - "uppercase" => reader.ReadValue(options, null), - "word_delimiter" => reader.ReadValue(options, null), - "word_delimiter_graph" => reader.ReadValue(options, null), - _ => throw new System.Text.Json.JsonException($"Variant '{discriminator}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Analysis.ITokenFilter)}'.") - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ITokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - switch (value.Type) - { - case "apostrophe": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilter)value, null); - break; - case "arabic_normalization": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilter)value, null); - break; - case "arabic_stem": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ArabicStemTokenFilter)value, null); - break; - case "asciifolding": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.AsciiFoldingTokenFilter)value, null); - break; - case "bengali_normalization": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.BengaliNormalizationTokenFilter)value, null); - break; - case "brazilian_stem": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.BrazilianStemTokenFilter)value, null); - break; - case "cjk_bigram": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilter)value, null); - break; - case "cjk_width": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilter)value, null); - break; - case "classic": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilter)value, null); - break; - case "common_grams": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.CommonGramsTokenFilter)value, null); - break; - case "condition": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ConditionTokenFilter)value, null); - break; - case "czech_stem": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.CzechStemTokenFilter)value, null); - break; - case "decimal_digit": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilter)value, null); - break; - case "delimited_payload": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadTokenFilter)value, null); - break; - case "dictionary_decompounder": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilter)value, null); - break; - case "dutch_stem": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.DutchStemTokenFilter)value, null); - break; - case "edge_ngram": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenFilter)value, null); - break; - case "elision": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ElisionTokenFilter)value, null); - break; - case "fingerprint": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.FingerprintTokenFilter)value, null); - break; - case "flatten_graph": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilter)value, null); - break; - case "french_stem": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.FrenchStemTokenFilter)value, null); - break; - case "german_normalization": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilter)value, null); - break; - case "german_stem": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.GermanStemTokenFilter)value, null); - break; - case "hindi_normalization": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilter)value, null); - break; - case "hunspell": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.HunspellTokenFilter)value, null); - break; - case "hyphenation_decompounder": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilter)value, null); - break; - case "icu_collation": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.IcuCollationTokenFilter)value, null); - break; - case "icu_folding": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.IcuFoldingTokenFilter)value, null); - break; - case "icu_normalizer": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationTokenFilter)value, null); - break; - case "icu_transform": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.IcuTransformTokenFilter)value, null); - break; - case "indic_normalization": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilter)value, null); - break; - case "ja_stop": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilter)value, null); - break; - case "keep": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KeepWordsTokenFilter)value, null); - break; - case "keep_types": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilter)value, null); - break; - case "keyword_marker": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KeywordMarkerTokenFilter)value, null); - break; - case "keyword_repeat": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilter)value, null); - break; - case "kstem": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KStemTokenFilter)value, null); - break; - case "kuromoji_part_of_speech": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KuromojiPartOfSpeechTokenFilter)value, null); - break; - case "kuromoji_readingform": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KuromojiReadingFormTokenFilter)value, null); - break; - case "kuromoji_stemmer": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KuromojiStemmerTokenFilter)value, null); - break; - case "length": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.LengthTokenFilter)value, null); - break; - case "limit": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.LimitTokenCountTokenFilter)value, null); - break; - case "lowercase": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilter)value, null); - break; - case "min_hash": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilter)value, null); - break; - case "multiplexer": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.MultiplexerTokenFilter)value, null); - break; - case "ngram": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.NGramTokenFilter)value, null); - break; - case "nori_part_of_speech": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.NoriPartOfSpeechTokenFilter)value, null); - break; - case "pattern_capture": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PatternCaptureTokenFilter)value, null); - break; - case "pattern_replace": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PatternReplaceTokenFilter)value, null); - break; - case "persian_normalization": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilter)value, null); - break; - case "persian_stem": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PersianStemTokenFilter)value, null); - break; - case "phonetic": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PhoneticTokenFilter)value, null); - break; - case "porter_stem": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PorterStemTokenFilter)value, null); - break; - case "predicate_token_filter": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PredicateTokenFilter)value, null); - break; - case "remove_duplicates": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.RemoveDuplicatesTokenFilter)value, null); - break; - case "reverse": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ReverseTokenFilter)value, null); - break; - case "russian_stem": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.RussianStemTokenFilter)value, null); - break; - case "scandinavian_folding": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilter)value, null); - break; - case "scandinavian_normalization": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilter)value, null); - break; - case "serbian_normalization": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilter)value, null); - break; - case "shingle": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilter)value, null); - break; - case "snowball": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SnowballTokenFilter)value, null); - break; - case "sorani_normalization": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilter)value, null); - break; - case "stemmer": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.StemmerTokenFilter)value, null); - break; - case "stemmer_override": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.StemmerOverrideTokenFilter)value, null); - break; - case "stop": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.StopTokenFilter)value, null); - break; - case "synonym": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SynonymTokenFilter)value, null); - break; - case "synonym_graph": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SynonymGraphTokenFilter)value, null); - break; - case "trim": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.TrimTokenFilter)value, null); - break; - case "truncate": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.TruncateTokenFilter)value, null); - break; - case "unique": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.UniqueTokenFilter)value, null); - break; - case "uppercase": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.UppercaseTokenFilter)value, null); - break; - case "word_delimiter": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilter)value, null); - break; - case "word_delimiter_graph": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilter)value, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.Type}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Analysis.ITokenFilter)}'."); - } - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.ITokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.ITokenFilterConverter))] public partial interface ITokenFilter { public string Type { get; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenFilters.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenFilters.Converters.g.cs new file mode 100644 index 00000000000..2581ef51795 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenFilters.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class TokenFiltersConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Analysis.TokenFilters Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Analysis.TokenFilters(reader.ReadValue?>(options, static System.Collections.Generic.Dictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.TokenFilters value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.BackingDictionary, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.Dictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenFilters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenFilters.g.cs index aa1b0330ff1..97488c64c53 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenFilters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenFilters.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class TokenFiltersConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Analysis.TokenFilters Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Analysis.TokenFilters(reader.ReadValue?>(options, static System.Collections.Generic.Dictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.TokenFilters value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.BackingDictionary, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.Dictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.TokenFiltersConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.TokenFiltersConverter))] public sealed partial class TokenFilters : Elastic.Clients.Elasticsearch.IsADictionary { public TokenFilters() diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Tokenizer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Tokenizer.Converters.g.cs new file mode 100644 index 00000000000..3218e8b99f1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Tokenizer.Converters.g.cs @@ -0,0 +1,132 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class ITokenizerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDiscriminator = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.ITokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + var readerSnapshot = reader; + string? discriminator = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.TryReadProperty(options, PropDiscriminator, ref discriminator, null)) + { + break; + } + + reader.Skip(); + } + + reader = readerSnapshot; + return discriminator switch + { + "char_group" => reader.ReadValue(options, null), + "classic" => reader.ReadValue(options, null), + "edge_ngram" => reader.ReadValue(options, null), + "icu_tokenizer" => reader.ReadValue(options, null), + "keyword" => reader.ReadValue(options, null), + "kuromoji_tokenizer" => reader.ReadValue(options, null), + "letter" => reader.ReadValue(options, null), + "lowercase" => reader.ReadValue(options, null), + "ngram" => reader.ReadValue(options, null), + "nori_tokenizer" => reader.ReadValue(options, null), + "path_hierarchy" => reader.ReadValue(options, null), + "pattern" => reader.ReadValue(options, null), + "simple_pattern" => reader.ReadValue(options, null), + "simple_pattern_split" => reader.ReadValue(options, null), + "standard" => reader.ReadValue(options, null), + "thai" => reader.ReadValue(options, null), + "uax_url_email" => reader.ReadValue(options, null), + "whitespace" => reader.ReadValue(options, null), + _ => throw new System.Text.Json.JsonException($"Variant '{discriminator}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Analysis.ITokenizer)}'.") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ITokenizer value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Type) + { + case "char_group": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.CharGroupTokenizer)value, null); + break; + case "classic": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ClassicTokenizer)value, null); + break; + case "edge_ngram": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenizer)value, null); + break; + case "icu_tokenizer": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.IcuTokenizer)value, null); + break; + case "keyword": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KeywordTokenizer)value, null); + break; + case "kuromoji_tokenizer": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizer)value, null); + break; + case "letter": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.LetterTokenizer)value, null); + break; + case "lowercase": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenizer)value, null); + break; + case "ngram": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.NGramTokenizer)value, null); + break; + case "nori_tokenizer": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.NoriTokenizer)value, null); + break; + case "path_hierarchy": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PathHierarchyTokenizer)value, null); + break; + case "pattern": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PatternTokenizer)value, null); + break; + case "simple_pattern": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SimplePatternTokenizer)value, null); + break; + case "simple_pattern_split": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SimplePatternSplitTokenizer)value, null); + break; + case "standard": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.StandardTokenizer)value, null); + break; + case "thai": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ThaiTokenizer)value, null); + break; + case "uax_url_email": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.UaxEmailUrlTokenizer)value, null); + break; + case "whitespace": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.WhitespaceTokenizer)value, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.Type}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Analysis.ITokenizer)}'."); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Tokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Tokenizer.g.cs index 7c0cf471c9d..0d379fca015 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Tokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Tokenizer.g.cs @@ -23,115 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class ITokenizerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDiscriminator = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.ITokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - var readerSnapshot = reader; - string? discriminator = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.TryReadProperty(options, PropDiscriminator, ref discriminator, null)) - { - break; - } - - reader.Skip(); - } - - reader = readerSnapshot; - return discriminator switch - { - "char_group" => reader.ReadValue(options, null), - "classic" => reader.ReadValue(options, null), - "edge_ngram" => reader.ReadValue(options, null), - "icu_tokenizer" => reader.ReadValue(options, null), - "keyword" => reader.ReadValue(options, null), - "kuromoji_tokenizer" => reader.ReadValue(options, null), - "letter" => reader.ReadValue(options, null), - "lowercase" => reader.ReadValue(options, null), - "ngram" => reader.ReadValue(options, null), - "nori_tokenizer" => reader.ReadValue(options, null), - "path_hierarchy" => reader.ReadValue(options, null), - "pattern" => reader.ReadValue(options, null), - "simple_pattern" => reader.ReadValue(options, null), - "simple_pattern_split" => reader.ReadValue(options, null), - "standard" => reader.ReadValue(options, null), - "thai" => reader.ReadValue(options, null), - "uax_url_email" => reader.ReadValue(options, null), - "whitespace" => reader.ReadValue(options, null), - _ => throw new System.Text.Json.JsonException($"Variant '{discriminator}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Analysis.ITokenizer)}'.") - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ITokenizer value, System.Text.Json.JsonSerializerOptions options) - { - switch (value.Type) - { - case "char_group": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.CharGroupTokenizer)value, null); - break; - case "classic": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ClassicTokenizer)value, null); - break; - case "edge_ngram": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenizer)value, null); - break; - case "icu_tokenizer": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.IcuTokenizer)value, null); - break; - case "keyword": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KeywordTokenizer)value, null); - break; - case "kuromoji_tokenizer": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizer)value, null); - break; - case "letter": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.LetterTokenizer)value, null); - break; - case "lowercase": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenizer)value, null); - break; - case "ngram": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.NGramTokenizer)value, null); - break; - case "nori_tokenizer": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.NoriTokenizer)value, null); - break; - case "path_hierarchy": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PathHierarchyTokenizer)value, null); - break; - case "pattern": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PatternTokenizer)value, null); - break; - case "simple_pattern": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SimplePatternTokenizer)value, null); - break; - case "simple_pattern_split": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SimplePatternSplitTokenizer)value, null); - break; - case "standard": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.StandardTokenizer)value, null); - break; - case "thai": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ThaiTokenizer)value, null); - break; - case "uax_url_email": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.UaxEmailUrlTokenizer)value, null); - break; - case "whitespace": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.WhitespaceTokenizer)value, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.Type}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Analysis.ITokenizer)}'."); - } - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.ITokenizerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.ITokenizerConverter))] public partial interface ITokenizer { public string Type { get; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Tokenizers.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Tokenizers.Converters.g.cs new file mode 100644 index 00000000000..5d244b044e3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Tokenizers.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class TokenizersConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Analysis.Tokenizers Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Analysis.Tokenizers(reader.ReadValue?>(options, static System.Collections.Generic.Dictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.Tokenizers value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.BackingDictionary, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.Dictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Tokenizers.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Tokenizers.g.cs index 98b7b77fc06..1c398e2766e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Tokenizers.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Tokenizers.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class TokenizersConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Analysis.Tokenizers Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Analysis.Tokenizers(reader.ReadValue?>(options, static System.Collections.Generic.Dictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.Tokenizers value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.BackingDictionary, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.Dictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.TokenizersConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.TokenizersConverter))] public sealed partial class Tokenizers : Elastic.Clients.Elasticsearch.IsADictionary { public Tokenizers() diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TrimTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TrimTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..c5cda5bf8c0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TrimTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class TrimTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.TrimTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.TrimTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.TrimTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TrimTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TrimTokenFilter.g.cs index ed16b0df320..aed3dc5281c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TrimTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TrimTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class TrimTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.TrimTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.TrimTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.TrimTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.TrimTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.TrimTokenFilterConverter))] public sealed partial class TrimTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TruncateTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TruncateTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..40f2fdef700 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TruncateTokenFilter.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class TruncateTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLength = System.Text.Json.JsonEncodedText.Encode("length"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.TruncateTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLength = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLength.TryReadProperty(ref reader, options, PropLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.TruncateTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Length = propLength.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.TruncateTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLength, value.Length, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TruncateTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TruncateTokenFilter.g.cs index 55e7986321a..88cd038663d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TruncateTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TruncateTokenFilter.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class TruncateTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLength = System.Text.Json.JsonEncodedText.Encode("length"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.TruncateTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLength = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLength.TryReadProperty(ref reader, options, PropLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.TruncateTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Length = propLength.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.TruncateTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLength, value.Length, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.TruncateTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.TruncateTokenFilterConverter))] public sealed partial class TruncateTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TurkishAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TurkishAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..835b19af730 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TurkishAnalyzer.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class TurkishAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Analysis.TurkishAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStemExclusion = default; + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propStopwordsPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.TurkishAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StemExclusion = propStemExclusion.Value, + Stopwords = propStopwords.Value, + StopwordsPath = propStopwordsPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.TurkishAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TurkishAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TurkishAnalyzer.g.cs index 684b6c077cd..1bcda451eb3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TurkishAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TurkishAnalyzer.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class TurkishAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStemExclusion = System.Text.Json.JsonEncodedText.Encode("stem_exclusion"); - private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); - private static readonly System.Text.Json.JsonEncodedText PropStopwordsPath = System.Text.Json.JsonEncodedText.Encode("stopwords_path"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Analysis.TurkishAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStemExclusion = default; - LocalJsonValue>?> propStopwords = default; - LocalJsonValue propStopwordsPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStemExclusion.TryReadProperty(ref reader, options, PropStemExclusion, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStopwordsPath.TryReadProperty(ref reader, options, PropStopwordsPath, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.TurkishAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StemExclusion = propStemExclusion.Value, - Stopwords = propStopwords.Value, - StopwordsPath = propStopwordsPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.TurkishAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.TurkishAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.TurkishAnalyzerConverter))] public sealed partial class TurkishAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UaxEmailUrlTokenizer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UaxEmailUrlTokenizer.Converters.g.cs new file mode 100644 index 00000000000..bd0b57fc99a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UaxEmailUrlTokenizer.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class UaxEmailUrlTokenizerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxTokenLength = System.Text.Json.JsonEncodedText.Encode("max_token_length"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.UaxEmailUrlTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxTokenLength = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxTokenLength.TryReadProperty(ref reader, options, PropMaxTokenLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.UaxEmailUrlTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxTokenLength = propMaxTokenLength.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.UaxEmailUrlTokenizer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxTokenLength, value.MaxTokenLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UaxEmailUrlTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UaxEmailUrlTokenizer.g.cs index 43738a2ed69..89dadd887eb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UaxEmailUrlTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UaxEmailUrlTokenizer.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class UaxEmailUrlTokenizerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxTokenLength = System.Text.Json.JsonEncodedText.Encode("max_token_length"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.UaxEmailUrlTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxTokenLength = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxTokenLength.TryReadProperty(ref reader, options, PropMaxTokenLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.UaxEmailUrlTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxTokenLength = propMaxTokenLength.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.UaxEmailUrlTokenizer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxTokenLength, value.MaxTokenLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.UaxEmailUrlTokenizerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.UaxEmailUrlTokenizerConverter))] public sealed partial class UaxEmailUrlTokenizer : Elastic.Clients.Elasticsearch.Analysis.ITokenizer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UniqueTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UniqueTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..61592b77c27 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UniqueTokenFilter.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class UniqueTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropOnlyOnSamePosition = System.Text.Json.JsonEncodedText.Encode("only_on_same_position"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.UniqueTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propOnlyOnSamePosition = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propOnlyOnSamePosition.TryReadProperty(ref reader, options, PropOnlyOnSamePosition, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.UniqueTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + OnlyOnSamePosition = propOnlyOnSamePosition.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.UniqueTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropOnlyOnSamePosition, value.OnlyOnSamePosition, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UniqueTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UniqueTokenFilter.g.cs index dae6f360301..119246f1669 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UniqueTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UniqueTokenFilter.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class UniqueTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropOnlyOnSamePosition = System.Text.Json.JsonEncodedText.Encode("only_on_same_position"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.UniqueTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propOnlyOnSamePosition = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propOnlyOnSamePosition.TryReadProperty(ref reader, options, PropOnlyOnSamePosition, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.UniqueTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - OnlyOnSamePosition = propOnlyOnSamePosition.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.UniqueTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropOnlyOnSamePosition, value.OnlyOnSamePosition, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.UniqueTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.UniqueTokenFilterConverter))] public sealed partial class UniqueTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UppercaseTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UppercaseTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..40ab6e64613 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UppercaseTokenFilter.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class UppercaseTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.UppercaseTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.UppercaseTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.UppercaseTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UppercaseTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UppercaseTokenFilter.g.cs index e5dd366e298..abccf99f304 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UppercaseTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UppercaseTokenFilter.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class UppercaseTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.UppercaseTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.UppercaseTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.UppercaseTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.UppercaseTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.UppercaseTokenFilterConverter))] public sealed partial class UppercaseTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WhitespaceAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WhitespaceAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..43f4c260722 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WhitespaceAnalyzer.Converters.g.cs @@ -0,0 +1,76 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class WhitespaceAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.WhitespaceAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.WhitespaceAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { +#pragma warning disable CS0618 + Version = propVersion.Value +#pragma warning restore CS0618 + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.WhitespaceAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); +#pragma warning disable CS0618 + writer.WriteProperty(options, PropVersion, value.Version, null, null) +#pragma warning restore CS0618 + ; + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WhitespaceAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WhitespaceAnalyzer.g.cs index 6f06290ca9c..cd8bdce582e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WhitespaceAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WhitespaceAnalyzer.g.cs @@ -23,59 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class WhitespaceAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.WhitespaceAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.WhitespaceAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { -#pragma warning disable CS0618 - Version = propVersion.Value -#pragma warning restore CS0618 - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.WhitespaceAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); -#pragma warning disable CS0618 - writer.WriteProperty(options, PropVersion, value.Version, null, null) -#pragma warning restore CS0618 - ; - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.WhitespaceAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.WhitespaceAnalyzerConverter))] public sealed partial class WhitespaceAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WhitespaceTokenizer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WhitespaceTokenizer.Converters.g.cs new file mode 100644 index 00000000000..136d25369cb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WhitespaceTokenizer.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class WhitespaceTokenizerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxTokenLength = System.Text.Json.JsonEncodedText.Encode("max_token_length"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.WhitespaceTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxTokenLength = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxTokenLength.TryReadProperty(ref reader, options, PropMaxTokenLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.WhitespaceTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxTokenLength = propMaxTokenLength.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.WhitespaceTokenizer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxTokenLength, value.MaxTokenLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WhitespaceTokenizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WhitespaceTokenizer.g.cs index 033b4bf176a..30301fbda7c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WhitespaceTokenizer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WhitespaceTokenizer.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class WhitespaceTokenizerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxTokenLength = System.Text.Json.JsonEncodedText.Encode("max_token_length"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.WhitespaceTokenizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxTokenLength = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxTokenLength.TryReadProperty(ref reader, options, PropMaxTokenLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.WhitespaceTokenizer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxTokenLength = propMaxTokenLength.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.WhitespaceTokenizer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxTokenLength, value.MaxTokenLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.WhitespaceTokenizerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.WhitespaceTokenizerConverter))] public sealed partial class WhitespaceTokenizer : Elastic.Clients.Elasticsearch.Analysis.ITokenizer { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterGraphTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterGraphTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..f62cd60a6a9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterGraphTokenFilter.Converters.g.cs @@ -0,0 +1,206 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class WordDelimiterGraphTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAdjustOffsets = System.Text.Json.JsonEncodedText.Encode("adjust_offsets"); + private static readonly System.Text.Json.JsonEncodedText PropCatenateAll = System.Text.Json.JsonEncodedText.Encode("catenate_all"); + private static readonly System.Text.Json.JsonEncodedText PropCatenateNumbers = System.Text.Json.JsonEncodedText.Encode("catenate_numbers"); + private static readonly System.Text.Json.JsonEncodedText PropCatenateWords = System.Text.Json.JsonEncodedText.Encode("catenate_words"); + private static readonly System.Text.Json.JsonEncodedText PropGenerateNumberParts = System.Text.Json.JsonEncodedText.Encode("generate_number_parts"); + private static readonly System.Text.Json.JsonEncodedText PropGenerateWordParts = System.Text.Json.JsonEncodedText.Encode("generate_word_parts"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreKeywords = System.Text.Json.JsonEncodedText.Encode("ignore_keywords"); + private static readonly System.Text.Json.JsonEncodedText PropPreserveOriginal = System.Text.Json.JsonEncodedText.Encode("preserve_original"); + private static readonly System.Text.Json.JsonEncodedText PropProtectedWords = System.Text.Json.JsonEncodedText.Encode("protected_words"); + private static readonly System.Text.Json.JsonEncodedText PropProtectedWordsPath = System.Text.Json.JsonEncodedText.Encode("protected_words_path"); + private static readonly System.Text.Json.JsonEncodedText PropSplitOnCaseChange = System.Text.Json.JsonEncodedText.Encode("split_on_case_change"); + private static readonly System.Text.Json.JsonEncodedText PropSplitOnNumerics = System.Text.Json.JsonEncodedText.Encode("split_on_numerics"); + private static readonly System.Text.Json.JsonEncodedText PropStemEnglishPossessive = System.Text.Json.JsonEncodedText.Encode("stem_english_possessive"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropTypeTable = System.Text.Json.JsonEncodedText.Encode("type_table"); + private static readonly System.Text.Json.JsonEncodedText PropTypeTablePath = System.Text.Json.JsonEncodedText.Encode("type_table_path"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAdjustOffsets = default; + LocalJsonValue propCatenateAll = default; + LocalJsonValue propCatenateNumbers = default; + LocalJsonValue propCatenateWords = default; + LocalJsonValue propGenerateNumberParts = default; + LocalJsonValue propGenerateWordParts = default; + LocalJsonValue propIgnoreKeywords = default; + LocalJsonValue propPreserveOriginal = default; + LocalJsonValue?> propProtectedWords = default; + LocalJsonValue propProtectedWordsPath = default; + LocalJsonValue propSplitOnCaseChange = default; + LocalJsonValue propSplitOnNumerics = default; + LocalJsonValue propStemEnglishPossessive = default; + LocalJsonValue?> propTypeTable = default; + LocalJsonValue propTypeTablePath = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAdjustOffsets.TryReadProperty(ref reader, options, PropAdjustOffsets, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCatenateAll.TryReadProperty(ref reader, options, PropCatenateAll, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCatenateNumbers.TryReadProperty(ref reader, options, PropCatenateNumbers, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCatenateWords.TryReadProperty(ref reader, options, PropCatenateWords, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propGenerateNumberParts.TryReadProperty(ref reader, options, PropGenerateNumberParts, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propGenerateWordParts.TryReadProperty(ref reader, options, PropGenerateWordParts, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreKeywords.TryReadProperty(ref reader, options, PropIgnoreKeywords, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPreserveOriginal.TryReadProperty(ref reader, options, PropPreserveOriginal, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProtectedWords.TryReadProperty(ref reader, options, PropProtectedWords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propProtectedWordsPath.TryReadProperty(ref reader, options, PropProtectedWordsPath, null)) + { + continue; + } + + if (propSplitOnCaseChange.TryReadProperty(ref reader, options, PropSplitOnCaseChange, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSplitOnNumerics.TryReadProperty(ref reader, options, PropSplitOnNumerics, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propStemEnglishPossessive.TryReadProperty(ref reader, options, PropStemEnglishPossessive, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propTypeTable.TryReadProperty(ref reader, options, PropTypeTable, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTypeTablePath.TryReadProperty(ref reader, options, PropTypeTablePath, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AdjustOffsets = propAdjustOffsets.Value, + CatenateAll = propCatenateAll.Value, + CatenateNumbers = propCatenateNumbers.Value, + CatenateWords = propCatenateWords.Value, + GenerateNumberParts = propGenerateNumberParts.Value, + GenerateWordParts = propGenerateWordParts.Value, + IgnoreKeywords = propIgnoreKeywords.Value, + PreserveOriginal = propPreserveOriginal.Value, + ProtectedWords = propProtectedWords.Value, + ProtectedWordsPath = propProtectedWordsPath.Value, + SplitOnCaseChange = propSplitOnCaseChange.Value, + SplitOnNumerics = propSplitOnNumerics.Value, + StemEnglishPossessive = propStemEnglishPossessive.Value, + TypeTable = propTypeTable.Value, + TypeTablePath = propTypeTablePath.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAdjustOffsets, value.AdjustOffsets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCatenateAll, value.CatenateAll, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCatenateNumbers, value.CatenateNumbers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCatenateWords, value.CatenateWords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropGenerateNumberParts, value.GenerateNumberParts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropGenerateWordParts, value.GenerateWordParts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreKeywords, value.IgnoreKeywords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPreserveOriginal, value.PreserveOriginal, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProtectedWords, value.ProtectedWords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropProtectedWordsPath, value.ProtectedWordsPath, null, null); + writer.WriteProperty(options, PropSplitOnCaseChange, value.SplitOnCaseChange, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSplitOnNumerics, value.SplitOnNumerics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropStemEnglishPossessive, value.StemEnglishPossessive, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropTypeTable, value.TypeTable, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTypeTablePath, value.TypeTablePath, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterGraphTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterGraphTokenFilter.g.cs index 006eb44787d..64f836e0ebf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterGraphTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterGraphTokenFilter.g.cs @@ -23,189 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class WordDelimiterGraphTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAdjustOffsets = System.Text.Json.JsonEncodedText.Encode("adjust_offsets"); - private static readonly System.Text.Json.JsonEncodedText PropCatenateAll = System.Text.Json.JsonEncodedText.Encode("catenate_all"); - private static readonly System.Text.Json.JsonEncodedText PropCatenateNumbers = System.Text.Json.JsonEncodedText.Encode("catenate_numbers"); - private static readonly System.Text.Json.JsonEncodedText PropCatenateWords = System.Text.Json.JsonEncodedText.Encode("catenate_words"); - private static readonly System.Text.Json.JsonEncodedText PropGenerateNumberParts = System.Text.Json.JsonEncodedText.Encode("generate_number_parts"); - private static readonly System.Text.Json.JsonEncodedText PropGenerateWordParts = System.Text.Json.JsonEncodedText.Encode("generate_word_parts"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreKeywords = System.Text.Json.JsonEncodedText.Encode("ignore_keywords"); - private static readonly System.Text.Json.JsonEncodedText PropPreserveOriginal = System.Text.Json.JsonEncodedText.Encode("preserve_original"); - private static readonly System.Text.Json.JsonEncodedText PropProtectedWords = System.Text.Json.JsonEncodedText.Encode("protected_words"); - private static readonly System.Text.Json.JsonEncodedText PropProtectedWordsPath = System.Text.Json.JsonEncodedText.Encode("protected_words_path"); - private static readonly System.Text.Json.JsonEncodedText PropSplitOnCaseChange = System.Text.Json.JsonEncodedText.Encode("split_on_case_change"); - private static readonly System.Text.Json.JsonEncodedText PropSplitOnNumerics = System.Text.Json.JsonEncodedText.Encode("split_on_numerics"); - private static readonly System.Text.Json.JsonEncodedText PropStemEnglishPossessive = System.Text.Json.JsonEncodedText.Encode("stem_english_possessive"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropTypeTable = System.Text.Json.JsonEncodedText.Encode("type_table"); - private static readonly System.Text.Json.JsonEncodedText PropTypeTablePath = System.Text.Json.JsonEncodedText.Encode("type_table_path"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAdjustOffsets = default; - LocalJsonValue propCatenateAll = default; - LocalJsonValue propCatenateNumbers = default; - LocalJsonValue propCatenateWords = default; - LocalJsonValue propGenerateNumberParts = default; - LocalJsonValue propGenerateWordParts = default; - LocalJsonValue propIgnoreKeywords = default; - LocalJsonValue propPreserveOriginal = default; - LocalJsonValue?> propProtectedWords = default; - LocalJsonValue propProtectedWordsPath = default; - LocalJsonValue propSplitOnCaseChange = default; - LocalJsonValue propSplitOnNumerics = default; - LocalJsonValue propStemEnglishPossessive = default; - LocalJsonValue?> propTypeTable = default; - LocalJsonValue propTypeTablePath = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAdjustOffsets.TryReadProperty(ref reader, options, PropAdjustOffsets, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCatenateAll.TryReadProperty(ref reader, options, PropCatenateAll, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCatenateNumbers.TryReadProperty(ref reader, options, PropCatenateNumbers, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCatenateWords.TryReadProperty(ref reader, options, PropCatenateWords, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propGenerateNumberParts.TryReadProperty(ref reader, options, PropGenerateNumberParts, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propGenerateWordParts.TryReadProperty(ref reader, options, PropGenerateWordParts, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreKeywords.TryReadProperty(ref reader, options, PropIgnoreKeywords, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPreserveOriginal.TryReadProperty(ref reader, options, PropPreserveOriginal, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProtectedWords.TryReadProperty(ref reader, options, PropProtectedWords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propProtectedWordsPath.TryReadProperty(ref reader, options, PropProtectedWordsPath, null)) - { - continue; - } - - if (propSplitOnCaseChange.TryReadProperty(ref reader, options, PropSplitOnCaseChange, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSplitOnNumerics.TryReadProperty(ref reader, options, PropSplitOnNumerics, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propStemEnglishPossessive.TryReadProperty(ref reader, options, PropStemEnglishPossessive, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propTypeTable.TryReadProperty(ref reader, options, PropTypeTable, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTypeTablePath.TryReadProperty(ref reader, options, PropTypeTablePath, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AdjustOffsets = propAdjustOffsets.Value, - CatenateAll = propCatenateAll.Value, - CatenateNumbers = propCatenateNumbers.Value, - CatenateWords = propCatenateWords.Value, - GenerateNumberParts = propGenerateNumberParts.Value, - GenerateWordParts = propGenerateWordParts.Value, - IgnoreKeywords = propIgnoreKeywords.Value, - PreserveOriginal = propPreserveOriginal.Value, - ProtectedWords = propProtectedWords.Value, - ProtectedWordsPath = propProtectedWordsPath.Value, - SplitOnCaseChange = propSplitOnCaseChange.Value, - SplitOnNumerics = propSplitOnNumerics.Value, - StemEnglishPossessive = propStemEnglishPossessive.Value, - TypeTable = propTypeTable.Value, - TypeTablePath = propTypeTablePath.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAdjustOffsets, value.AdjustOffsets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCatenateAll, value.CatenateAll, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCatenateNumbers, value.CatenateNumbers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCatenateWords, value.CatenateWords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropGenerateNumberParts, value.GenerateNumberParts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropGenerateWordParts, value.GenerateWordParts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreKeywords, value.IgnoreKeywords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPreserveOriginal, value.PreserveOriginal, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProtectedWords, value.ProtectedWords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropProtectedWordsPath, value.ProtectedWordsPath, null, null); - writer.WriteProperty(options, PropSplitOnCaseChange, value.SplitOnCaseChange, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSplitOnNumerics, value.SplitOnNumerics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropStemEnglishPossessive, value.StemEnglishPossessive, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropTypeTable, value.TypeTable, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTypeTablePath, value.TypeTablePath, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.WordDelimiterGraphTokenFilterConverter))] public sealed partial class WordDelimiterGraphTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterTokenFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterTokenFilter.Converters.g.cs new file mode 100644 index 00000000000..9962a910f5a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterTokenFilter.Converters.g.cs @@ -0,0 +1,188 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis.Json; + +public sealed partial class WordDelimiterTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCatenateAll = System.Text.Json.JsonEncodedText.Encode("catenate_all"); + private static readonly System.Text.Json.JsonEncodedText PropCatenateNumbers = System.Text.Json.JsonEncodedText.Encode("catenate_numbers"); + private static readonly System.Text.Json.JsonEncodedText PropCatenateWords = System.Text.Json.JsonEncodedText.Encode("catenate_words"); + private static readonly System.Text.Json.JsonEncodedText PropGenerateNumberParts = System.Text.Json.JsonEncodedText.Encode("generate_number_parts"); + private static readonly System.Text.Json.JsonEncodedText PropGenerateWordParts = System.Text.Json.JsonEncodedText.Encode("generate_word_parts"); + private static readonly System.Text.Json.JsonEncodedText PropPreserveOriginal = System.Text.Json.JsonEncodedText.Encode("preserve_original"); + private static readonly System.Text.Json.JsonEncodedText PropProtectedWords = System.Text.Json.JsonEncodedText.Encode("protected_words"); + private static readonly System.Text.Json.JsonEncodedText PropProtectedWordsPath = System.Text.Json.JsonEncodedText.Encode("protected_words_path"); + private static readonly System.Text.Json.JsonEncodedText PropSplitOnCaseChange = System.Text.Json.JsonEncodedText.Encode("split_on_case_change"); + private static readonly System.Text.Json.JsonEncodedText PropSplitOnNumerics = System.Text.Json.JsonEncodedText.Encode("split_on_numerics"); + private static readonly System.Text.Json.JsonEncodedText PropStemEnglishPossessive = System.Text.Json.JsonEncodedText.Encode("stem_english_possessive"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropTypeTable = System.Text.Json.JsonEncodedText.Encode("type_table"); + private static readonly System.Text.Json.JsonEncodedText PropTypeTablePath = System.Text.Json.JsonEncodedText.Encode("type_table_path"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCatenateAll = default; + LocalJsonValue propCatenateNumbers = default; + LocalJsonValue propCatenateWords = default; + LocalJsonValue propGenerateNumberParts = default; + LocalJsonValue propGenerateWordParts = default; + LocalJsonValue propPreserveOriginal = default; + LocalJsonValue?> propProtectedWords = default; + LocalJsonValue propProtectedWordsPath = default; + LocalJsonValue propSplitOnCaseChange = default; + LocalJsonValue propSplitOnNumerics = default; + LocalJsonValue propStemEnglishPossessive = default; + LocalJsonValue?> propTypeTable = default; + LocalJsonValue propTypeTablePath = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCatenateAll.TryReadProperty(ref reader, options, PropCatenateAll, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCatenateNumbers.TryReadProperty(ref reader, options, PropCatenateNumbers, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCatenateWords.TryReadProperty(ref reader, options, PropCatenateWords, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propGenerateNumberParts.TryReadProperty(ref reader, options, PropGenerateNumberParts, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propGenerateWordParts.TryReadProperty(ref reader, options, PropGenerateWordParts, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPreserveOriginal.TryReadProperty(ref reader, options, PropPreserveOriginal, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProtectedWords.TryReadProperty(ref reader, options, PropProtectedWords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propProtectedWordsPath.TryReadProperty(ref reader, options, PropProtectedWordsPath, null)) + { + continue; + } + + if (propSplitOnCaseChange.TryReadProperty(ref reader, options, PropSplitOnCaseChange, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSplitOnNumerics.TryReadProperty(ref reader, options, PropSplitOnNumerics, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propStemEnglishPossessive.TryReadProperty(ref reader, options, PropStemEnglishPossessive, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propTypeTable.TryReadProperty(ref reader, options, PropTypeTable, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTypeTablePath.TryReadProperty(ref reader, options, PropTypeTablePath, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CatenateAll = propCatenateAll.Value, + CatenateNumbers = propCatenateNumbers.Value, + CatenateWords = propCatenateWords.Value, + GenerateNumberParts = propGenerateNumberParts.Value, + GenerateWordParts = propGenerateWordParts.Value, + PreserveOriginal = propPreserveOriginal.Value, + ProtectedWords = propProtectedWords.Value, + ProtectedWordsPath = propProtectedWordsPath.Value, + SplitOnCaseChange = propSplitOnCaseChange.Value, + SplitOnNumerics = propSplitOnNumerics.Value, + StemEnglishPossessive = propStemEnglishPossessive.Value, + TypeTable = propTypeTable.Value, + TypeTablePath = propTypeTablePath.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCatenateAll, value.CatenateAll, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCatenateNumbers, value.CatenateNumbers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCatenateWords, value.CatenateWords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropGenerateNumberParts, value.GenerateNumberParts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropGenerateWordParts, value.GenerateWordParts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPreserveOriginal, value.PreserveOriginal, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProtectedWords, value.ProtectedWords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropProtectedWordsPath, value.ProtectedWordsPath, null, null); + writer.WriteProperty(options, PropSplitOnCaseChange, value.SplitOnCaseChange, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSplitOnNumerics, value.SplitOnNumerics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropStemEnglishPossessive, value.StemEnglishPossessive, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropTypeTable, value.TypeTable, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTypeTablePath, value.TypeTablePath, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterTokenFilter.g.cs index c589af17379..6bbc468f63c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterTokenFilter.g.cs @@ -23,171 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Analysis; -internal sealed partial class WordDelimiterTokenFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCatenateAll = System.Text.Json.JsonEncodedText.Encode("catenate_all"); - private static readonly System.Text.Json.JsonEncodedText PropCatenateNumbers = System.Text.Json.JsonEncodedText.Encode("catenate_numbers"); - private static readonly System.Text.Json.JsonEncodedText PropCatenateWords = System.Text.Json.JsonEncodedText.Encode("catenate_words"); - private static readonly System.Text.Json.JsonEncodedText PropGenerateNumberParts = System.Text.Json.JsonEncodedText.Encode("generate_number_parts"); - private static readonly System.Text.Json.JsonEncodedText PropGenerateWordParts = System.Text.Json.JsonEncodedText.Encode("generate_word_parts"); - private static readonly System.Text.Json.JsonEncodedText PropPreserveOriginal = System.Text.Json.JsonEncodedText.Encode("preserve_original"); - private static readonly System.Text.Json.JsonEncodedText PropProtectedWords = System.Text.Json.JsonEncodedText.Encode("protected_words"); - private static readonly System.Text.Json.JsonEncodedText PropProtectedWordsPath = System.Text.Json.JsonEncodedText.Encode("protected_words_path"); - private static readonly System.Text.Json.JsonEncodedText PropSplitOnCaseChange = System.Text.Json.JsonEncodedText.Encode("split_on_case_change"); - private static readonly System.Text.Json.JsonEncodedText PropSplitOnNumerics = System.Text.Json.JsonEncodedText.Encode("split_on_numerics"); - private static readonly System.Text.Json.JsonEncodedText PropStemEnglishPossessive = System.Text.Json.JsonEncodedText.Encode("stem_english_possessive"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropTypeTable = System.Text.Json.JsonEncodedText.Encode("type_table"); - private static readonly System.Text.Json.JsonEncodedText PropTypeTablePath = System.Text.Json.JsonEncodedText.Encode("type_table_path"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCatenateAll = default; - LocalJsonValue propCatenateNumbers = default; - LocalJsonValue propCatenateWords = default; - LocalJsonValue propGenerateNumberParts = default; - LocalJsonValue propGenerateWordParts = default; - LocalJsonValue propPreserveOriginal = default; - LocalJsonValue?> propProtectedWords = default; - LocalJsonValue propProtectedWordsPath = default; - LocalJsonValue propSplitOnCaseChange = default; - LocalJsonValue propSplitOnNumerics = default; - LocalJsonValue propStemEnglishPossessive = default; - LocalJsonValue?> propTypeTable = default; - LocalJsonValue propTypeTablePath = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCatenateAll.TryReadProperty(ref reader, options, PropCatenateAll, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCatenateNumbers.TryReadProperty(ref reader, options, PropCatenateNumbers, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCatenateWords.TryReadProperty(ref reader, options, PropCatenateWords, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propGenerateNumberParts.TryReadProperty(ref reader, options, PropGenerateNumberParts, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propGenerateWordParts.TryReadProperty(ref reader, options, PropGenerateWordParts, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPreserveOriginal.TryReadProperty(ref reader, options, PropPreserveOriginal, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProtectedWords.TryReadProperty(ref reader, options, PropProtectedWords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propProtectedWordsPath.TryReadProperty(ref reader, options, PropProtectedWordsPath, null)) - { - continue; - } - - if (propSplitOnCaseChange.TryReadProperty(ref reader, options, PropSplitOnCaseChange, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSplitOnNumerics.TryReadProperty(ref reader, options, PropSplitOnNumerics, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propStemEnglishPossessive.TryReadProperty(ref reader, options, PropStemEnglishPossessive, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propTypeTable.TryReadProperty(ref reader, options, PropTypeTable, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTypeTablePath.TryReadProperty(ref reader, options, PropTypeTablePath, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CatenateAll = propCatenateAll.Value, - CatenateNumbers = propCatenateNumbers.Value, - CatenateWords = propCatenateWords.Value, - GenerateNumberParts = propGenerateNumberParts.Value, - GenerateWordParts = propGenerateWordParts.Value, - PreserveOriginal = propPreserveOriginal.Value, - ProtectedWords = propProtectedWords.Value, - ProtectedWordsPath = propProtectedWordsPath.Value, - SplitOnCaseChange = propSplitOnCaseChange.Value, - SplitOnNumerics = propSplitOnNumerics.Value, - StemEnglishPossessive = propStemEnglishPossessive.Value, - TypeTable = propTypeTable.Value, - TypeTablePath = propTypeTablePath.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCatenateAll, value.CatenateAll, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCatenateNumbers, value.CatenateNumbers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCatenateWords, value.CatenateWords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropGenerateNumberParts, value.GenerateNumberParts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropGenerateWordParts, value.GenerateWordParts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPreserveOriginal, value.PreserveOriginal, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProtectedWords, value.ProtectedWords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropProtectedWordsPath, value.ProtectedWordsPath, null, null); - writer.WriteProperty(options, PropSplitOnCaseChange, value.SplitOnCaseChange, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSplitOnNumerics, value.SplitOnNumerics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropStemEnglishPossessive, value.StemEnglishPossessive, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropTypeTable, value.TypeTable, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTypeTablePath, value.TypeTablePath, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.WordDelimiterTokenFilterConverter))] public sealed partial class WordDelimiterTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/AsyncSearch/AsyncSearch.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/AsyncSearch/AsyncSearch.Converters.g.cs new file mode 100644 index 00000000000..16ca90c365c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/AsyncSearch/AsyncSearch.Converters.g.cs @@ -0,0 +1,196 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.AsyncSearch.Json; + +public sealed partial class AsyncSearchConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); + private static readonly System.Text.Json.JsonEncodedText PropClusters = System.Text.Json.JsonEncodedText.Encode("_clusters"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropHitsMetadata = System.Text.Json.JsonEncodedText.Encode("hits"); + private static readonly System.Text.Json.JsonEncodedText PropMaxScore = System.Text.Json.JsonEncodedText.Encode("max_score"); + private static readonly System.Text.Json.JsonEncodedText PropNumReducePhases = System.Text.Json.JsonEncodedText.Encode("num_reduce_phases"); + private static readonly System.Text.Json.JsonEncodedText PropPitId = System.Text.Json.JsonEncodedText.Encode("pit_id"); + private static readonly System.Text.Json.JsonEncodedText PropProfile = System.Text.Json.JsonEncodedText.Encode("profile"); + private static readonly System.Text.Json.JsonEncodedText PropScrollId = System.Text.Json.JsonEncodedText.Encode("_scroll_id"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + private static readonly System.Text.Json.JsonEncodedText PropSuggest = System.Text.Json.JsonEncodedText.Encode("suggest"); + private static readonly System.Text.Json.JsonEncodedText PropTerminatedEarly = System.Text.Json.JsonEncodedText.Encode("terminated_early"); + private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); + private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); + + public override Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearch Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAggregations = default; + LocalJsonValue propClusters = default; + LocalJsonValue?> propFields = default; + LocalJsonValue> propHitsMetadata = default; + LocalJsonValue propMaxScore = default; + LocalJsonValue propNumReducePhases = default; + LocalJsonValue propPitId = default; + LocalJsonValue propProfile = default; + LocalJsonValue propScrollId = default; + LocalJsonValue propShards = default; + LocalJsonValue?> propSuggest = default; + LocalJsonValue propTerminatedEarly = default; + LocalJsonValue propTimedOut = default; + LocalJsonValue propTook = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, null)) + { + continue; + } + + if (propClusters.TryReadProperty(ref reader, options, PropClusters, null)) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propHitsMetadata.TryReadProperty(ref reader, options, PropHitsMetadata, null)) + { + continue; + } + + if (propMaxScore.TryReadProperty(ref reader, options, PropMaxScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNumReducePhases.TryReadProperty(ref reader, options, PropNumReducePhases, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPitId.TryReadProperty(ref reader, options, PropPitId, null)) + { + continue; + } + + if (propProfile.TryReadProperty(ref reader, options, PropProfile, null)) + { + continue; + } + + if (propScrollId.TryReadProperty(ref reader, options, PropScrollId, null)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (propSuggest.TryReadProperty(ref reader, options, PropSuggest, null)) + { + continue; + } + + if (propTerminatedEarly.TryReadProperty(ref reader, options, PropTerminatedEarly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, null)) + { + continue; + } + + if (propTook.TryReadProperty(ref reader, options, PropTook, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearch(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = propAggregations.Value, + Clusters = propClusters.Value, + Fields = propFields.Value, + HitsMetadata = propHitsMetadata.Value, + MaxScore = propMaxScore.Value, + NumReducePhases = propNumReducePhases.Value, + PitId = propPitId.Value, + Profile = propProfile.Value, + ScrollId = propScrollId.Value, + Shards = propShards.Value, + Suggest = propSuggest.Value, + TerminatedEarly = propTerminatedEarly.Value, + TimedOut = propTimedOut.Value, + Took = propTook.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearch value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregations, value.Aggregations, null, null); + writer.WriteProperty(options, PropClusters, value.Clusters, null, null); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropHitsMetadata, value.HitsMetadata, null, null); + writer.WriteProperty(options, PropMaxScore, value.MaxScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNumReducePhases, value.NumReducePhases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPitId, value.PitId, null, null); + writer.WriteProperty(options, PropProfile, value.Profile, null, null); + writer.WriteProperty(options, PropScrollId, value.ScrollId, null, null); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteProperty(options, PropSuggest, value.Suggest, null, null); + writer.WriteProperty(options, PropTerminatedEarly, value.TerminatedEarly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, null); + writer.WriteProperty(options, PropTook, value.Took, null, null); + writer.WriteEndObject(); + } +} + +public sealed partial class AsyncSearchConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(AsyncSearch<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(AsyncSearchConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/AsyncSearch/AsyncSearch.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/AsyncSearch/AsyncSearch.g.cs index 602d5ff8b53..8fc1e268c99 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/AsyncSearch/AsyncSearch.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/AsyncSearch/AsyncSearch.g.cs @@ -23,179 +23,7 @@ namespace Elastic.Clients.Elasticsearch.AsyncSearch; -internal sealed partial class AsyncSearchConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); - private static readonly System.Text.Json.JsonEncodedText PropClusters = System.Text.Json.JsonEncodedText.Encode("_clusters"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropHitsMetadata = System.Text.Json.JsonEncodedText.Encode("hits"); - private static readonly System.Text.Json.JsonEncodedText PropMaxScore = System.Text.Json.JsonEncodedText.Encode("max_score"); - private static readonly System.Text.Json.JsonEncodedText PropNumReducePhases = System.Text.Json.JsonEncodedText.Encode("num_reduce_phases"); - private static readonly System.Text.Json.JsonEncodedText PropPitId = System.Text.Json.JsonEncodedText.Encode("pit_id"); - private static readonly System.Text.Json.JsonEncodedText PropProfile = System.Text.Json.JsonEncodedText.Encode("profile"); - private static readonly System.Text.Json.JsonEncodedText PropScrollId = System.Text.Json.JsonEncodedText.Encode("_scroll_id"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - private static readonly System.Text.Json.JsonEncodedText PropSuggest = System.Text.Json.JsonEncodedText.Encode("suggest"); - private static readonly System.Text.Json.JsonEncodedText PropTerminatedEarly = System.Text.Json.JsonEncodedText.Encode("terminated_early"); - private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); - private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); - - public override Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearch Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAggregations = default; - LocalJsonValue propClusters = default; - LocalJsonValue?> propFields = default; - LocalJsonValue> propHitsMetadata = default; - LocalJsonValue propMaxScore = default; - LocalJsonValue propNumReducePhases = default; - LocalJsonValue propPitId = default; - LocalJsonValue propProfile = default; - LocalJsonValue propScrollId = default; - LocalJsonValue propShards = default; - LocalJsonValue?> propSuggest = default; - LocalJsonValue propTerminatedEarly = default; - LocalJsonValue propTimedOut = default; - LocalJsonValue propTook = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, null)) - { - continue; - } - - if (propClusters.TryReadProperty(ref reader, options, PropClusters, null)) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propHitsMetadata.TryReadProperty(ref reader, options, PropHitsMetadata, null)) - { - continue; - } - - if (propMaxScore.TryReadProperty(ref reader, options, PropMaxScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNumReducePhases.TryReadProperty(ref reader, options, PropNumReducePhases, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPitId.TryReadProperty(ref reader, options, PropPitId, null)) - { - continue; - } - - if (propProfile.TryReadProperty(ref reader, options, PropProfile, null)) - { - continue; - } - - if (propScrollId.TryReadProperty(ref reader, options, PropScrollId, null)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (propSuggest.TryReadProperty(ref reader, options, PropSuggest, null)) - { - continue; - } - - if (propTerminatedEarly.TryReadProperty(ref reader, options, PropTerminatedEarly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, null)) - { - continue; - } - - if (propTook.TryReadProperty(ref reader, options, PropTook, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearch(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = propAggregations.Value, - Clusters = propClusters.Value, - Fields = propFields.Value, - HitsMetadata = propHitsMetadata.Value, - MaxScore = propMaxScore.Value, - NumReducePhases = propNumReducePhases.Value, - PitId = propPitId.Value, - Profile = propProfile.Value, - ScrollId = propScrollId.Value, - Shards = propShards.Value, - Suggest = propSuggest.Value, - TerminatedEarly = propTerminatedEarly.Value, - TimedOut = propTimedOut.Value, - Took = propTook.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearch value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregations, value.Aggregations, null, null); - writer.WriteProperty(options, PropClusters, value.Clusters, null, null); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropHitsMetadata, value.HitsMetadata, null, null); - writer.WriteProperty(options, PropMaxScore, value.MaxScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNumReducePhases, value.NumReducePhases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPitId, value.PitId, null, null); - writer.WriteProperty(options, PropProfile, value.Profile, null, null); - writer.WriteProperty(options, PropScrollId, value.ScrollId, null, null); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteProperty(options, PropSuggest, value.Suggest, null, null); - writer.WriteProperty(options, PropTerminatedEarly, value.TerminatedEarly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, null); - writer.WriteProperty(options, PropTook, value.Took, null, null); - writer.WriteEndObject(); - } -} - -internal sealed partial class AsyncSearchConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(AsyncSearch<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(AsyncSearchConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.AsyncSearch.Json.AsyncSearchConverterFactory))] public partial class AsyncSearch { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/BulkIndexByScrollFailure.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/BulkIndexByScrollFailure.Converters.g.cs new file mode 100644 index 00000000000..ac5c2b9ecb7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/BulkIndexByScrollFailure.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class BulkIndexByScrollFailureConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCause = System.Text.Json.JsonEncodedText.Encode("cause"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + + public override Elastic.Clients.Elasticsearch.BulkIndexByScrollFailure Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCause = default; + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + LocalJsonValue propStatus = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCause.TryReadProperty(ref reader, options, PropCause, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.BulkIndexByScrollFailure(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Cause = propCause.Value, + Id = propId.Value, + Index = propIndex.Value, + Status = propStatus.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.BulkIndexByScrollFailure value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCause, value.Cause, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/BulkIndexByScrollFailure.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/BulkIndexByScrollFailure.g.cs index 49c35a32fb1..1a967f318d2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/BulkIndexByScrollFailure.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/BulkIndexByScrollFailure.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class BulkIndexByScrollFailureConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCause = System.Text.Json.JsonEncodedText.Encode("cause"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - - public override Elastic.Clients.Elasticsearch.BulkIndexByScrollFailure Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCause = default; - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - LocalJsonValue propStatus = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCause.TryReadProperty(ref reader, options, PropCause, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.BulkIndexByScrollFailure(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Cause = propCause.Value, - Id = propId.Value, - Index = propIndex.Value, - Status = propStatus.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.BulkIndexByScrollFailure value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCause, value.Cause, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.BulkIndexByScrollFailureConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.BulkIndexByScrollFailureConverter))] public sealed partial class BulkIndexByScrollFailure { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/BulkStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/BulkStats.Converters.g.cs new file mode 100644 index 00000000000..a79ed4e0cfc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/BulkStats.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class BulkStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvgSize = System.Text.Json.JsonEncodedText.Encode("avg_size"); + private static readonly System.Text.Json.JsonEncodedText PropAvgSizeInBytes = System.Text.Json.JsonEncodedText.Encode("avg_size_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropAvgTime = System.Text.Json.JsonEncodedText.Encode("avg_time"); + private static readonly System.Text.Json.JsonEncodedText PropAvgTimeInMillis = System.Text.Json.JsonEncodedText.Encode("avg_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTotalOperations = System.Text.Json.JsonEncodedText.Encode("total_operations"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSize = System.Text.Json.JsonEncodedText.Encode("total_size"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSizeInBytes = System.Text.Json.JsonEncodedText.Encode("total_size_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTotalTime = System.Text.Json.JsonEncodedText.Encode("total_time"); + private static readonly System.Text.Json.JsonEncodedText PropTotalTimeInMillis = System.Text.Json.JsonEncodedText.Encode("total_time_in_millis"); + + public override Elastic.Clients.Elasticsearch.BulkStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvgSize = default; + LocalJsonValue propAvgSizeInBytes = default; + LocalJsonValue propAvgTime = default; + LocalJsonValue propAvgTimeInMillis = default; + LocalJsonValue propTotalOperations = default; + LocalJsonValue propTotalSize = default; + LocalJsonValue propTotalSizeInBytes = default; + LocalJsonValue propTotalTime = default; + LocalJsonValue propTotalTimeInMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvgSize.TryReadProperty(ref reader, options, PropAvgSize, null)) + { + continue; + } + + if (propAvgSizeInBytes.TryReadProperty(ref reader, options, PropAvgSizeInBytes, null)) + { + continue; + } + + if (propAvgTime.TryReadProperty(ref reader, options, PropAvgTime, null)) + { + continue; + } + + if (propAvgTimeInMillis.TryReadProperty(ref reader, options, PropAvgTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTotalOperations.TryReadProperty(ref reader, options, PropTotalOperations, null)) + { + continue; + } + + if (propTotalSize.TryReadProperty(ref reader, options, PropTotalSize, null)) + { + continue; + } + + if (propTotalSizeInBytes.TryReadProperty(ref reader, options, PropTotalSizeInBytes, null)) + { + continue; + } + + if (propTotalTime.TryReadProperty(ref reader, options, PropTotalTime, null)) + { + continue; + } + + if (propTotalTimeInMillis.TryReadProperty(ref reader, options, PropTotalTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.BulkStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AvgSize = propAvgSize.Value, + AvgSizeInBytes = propAvgSizeInBytes.Value, + AvgTime = propAvgTime.Value, + AvgTimeInMillis = propAvgTimeInMillis.Value, + TotalOperations = propTotalOperations.Value, + TotalSize = propTotalSize.Value, + TotalSizeInBytes = propTotalSizeInBytes.Value, + TotalTime = propTotalTime.Value, + TotalTimeInMillis = propTotalTimeInMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.BulkStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvgSize, value.AvgSize, null, null); + writer.WriteProperty(options, PropAvgSizeInBytes, value.AvgSizeInBytes, null, null); + writer.WriteProperty(options, PropAvgTime, value.AvgTime, null, null); + writer.WriteProperty(options, PropAvgTimeInMillis, value.AvgTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTotalOperations, value.TotalOperations, null, null); + writer.WriteProperty(options, PropTotalSize, value.TotalSize, null, null); + writer.WriteProperty(options, PropTotalSizeInBytes, value.TotalSizeInBytes, null, null); + writer.WriteProperty(options, PropTotalTime, value.TotalTime, null, null); + writer.WriteProperty(options, PropTotalTimeInMillis, value.TotalTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/BulkStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/BulkStats.g.cs index c5e25ec9131..9fdd9cd4670 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/BulkStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/BulkStats.g.cs @@ -23,118 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class BulkStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvgSize = System.Text.Json.JsonEncodedText.Encode("avg_size"); - private static readonly System.Text.Json.JsonEncodedText PropAvgSizeInBytes = System.Text.Json.JsonEncodedText.Encode("avg_size_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropAvgTime = System.Text.Json.JsonEncodedText.Encode("avg_time"); - private static readonly System.Text.Json.JsonEncodedText PropAvgTimeInMillis = System.Text.Json.JsonEncodedText.Encode("avg_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTotalOperations = System.Text.Json.JsonEncodedText.Encode("total_operations"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSize = System.Text.Json.JsonEncodedText.Encode("total_size"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSizeInBytes = System.Text.Json.JsonEncodedText.Encode("total_size_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTotalTime = System.Text.Json.JsonEncodedText.Encode("total_time"); - private static readonly System.Text.Json.JsonEncodedText PropTotalTimeInMillis = System.Text.Json.JsonEncodedText.Encode("total_time_in_millis"); - - public override Elastic.Clients.Elasticsearch.BulkStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvgSize = default; - LocalJsonValue propAvgSizeInBytes = default; - LocalJsonValue propAvgTime = default; - LocalJsonValue propAvgTimeInMillis = default; - LocalJsonValue propTotalOperations = default; - LocalJsonValue propTotalSize = default; - LocalJsonValue propTotalSizeInBytes = default; - LocalJsonValue propTotalTime = default; - LocalJsonValue propTotalTimeInMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvgSize.TryReadProperty(ref reader, options, PropAvgSize, null)) - { - continue; - } - - if (propAvgSizeInBytes.TryReadProperty(ref reader, options, PropAvgSizeInBytes, null)) - { - continue; - } - - if (propAvgTime.TryReadProperty(ref reader, options, PropAvgTime, null)) - { - continue; - } - - if (propAvgTimeInMillis.TryReadProperty(ref reader, options, PropAvgTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTotalOperations.TryReadProperty(ref reader, options, PropTotalOperations, null)) - { - continue; - } - - if (propTotalSize.TryReadProperty(ref reader, options, PropTotalSize, null)) - { - continue; - } - - if (propTotalSizeInBytes.TryReadProperty(ref reader, options, PropTotalSizeInBytes, null)) - { - continue; - } - - if (propTotalTime.TryReadProperty(ref reader, options, PropTotalTime, null)) - { - continue; - } - - if (propTotalTimeInMillis.TryReadProperty(ref reader, options, PropTotalTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.BulkStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AvgSize = propAvgSize.Value, - AvgSizeInBytes = propAvgSizeInBytes.Value, - AvgTime = propAvgTime.Value, - AvgTimeInMillis = propAvgTimeInMillis.Value, - TotalOperations = propTotalOperations.Value, - TotalSize = propTotalSize.Value, - TotalSizeInBytes = propTotalSizeInBytes.Value, - TotalTime = propTotalTime.Value, - TotalTimeInMillis = propTotalTimeInMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.BulkStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvgSize, value.AvgSize, null, null); - writer.WriteProperty(options, PropAvgSizeInBytes, value.AvgSizeInBytes, null, null); - writer.WriteProperty(options, PropAvgTime, value.AvgTime, null, null); - writer.WriteProperty(options, PropAvgTimeInMillis, value.AvgTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTotalOperations, value.TotalOperations, null, null); - writer.WriteProperty(options, PropTotalSize, value.TotalSize, null, null); - writer.WriteProperty(options, PropTotalSizeInBytes, value.TotalSizeInBytes, null, null); - writer.WriteProperty(options, PropTotalTime, value.TotalTime, null, null); - writer.WriteProperty(options, PropTotalTimeInMillis, value.TotalTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.BulkStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.BulkStatsConverter))] public sealed partial class BulkStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ByteSize.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ByteSize.Converters.g.cs new file mode 100644 index 00000000000..bbd7ce430eb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ByteSize.Converters.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ByteSizeConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.ByteSize Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String); + return selector(ref reader, options) switch + { + Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.ByteSize(reader.ReadValue(options, null)), + Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.ByteSize(reader.ReadValue(options, null)), + _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.ByteSize)}") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ByteSize value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Tag) + { + case Elastic.Clients.Elasticsearch.UnionTag.T1: + { + writer.WriteValue(options, value.Value1, null); + break; + } + + case Elastic.Clients.Elasticsearch.UnionTag.T2: + { + writer.WriteValue(options, value.Value2, null); + break; + } + + default: + throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ByteSize.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ByteSize.g.cs index 4ebc1a8d7b5..1bcbfc036bc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ByteSize.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ByteSize.g.cs @@ -23,45 +23,10 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class ByteSizeConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.ByteSize Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String); - return selector(ref reader, options) switch - { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.ByteSize(reader.ReadValue(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.ByteSize(reader.ReadValue(options, null)), - _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.ByteSize)}") - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ByteSize value, System.Text.Json.JsonSerializerOptions options) - { - switch (value.Tag) - { - case Elastic.Clients.Elasticsearch.UnionTag.T1: - { - writer.WriteValue(options, value.Value1, null); - break; - } - - case Elastic.Clients.Elasticsearch.UnionTag.T2: - { - writer.WriteValue(options, value.Value2, null); - break; - } - - default: - throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); - } - } -} - /// /// Learn more about this API in the Elasticsearch documentation. /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ByteSizeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ByteSizeConverter))] public sealed partial class ByteSize : Elastic.Clients.Elasticsearch.Union { public ByteSize(long value) : base(value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/AllocationDecision.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/AllocationDecision.Converters.g.cs new file mode 100644 index 00000000000..ec8e4fd52e0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/AllocationDecision.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class AllocationDecisionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDecider = System.Text.Json.JsonEncodedText.Encode("decider"); + private static readonly System.Text.Json.JsonEncodedText PropDecision = System.Text.Json.JsonEncodedText.Encode("decision"); + private static readonly System.Text.Json.JsonEncodedText PropExplanation = System.Text.Json.JsonEncodedText.Encode("explanation"); + + public override Elastic.Clients.Elasticsearch.Cluster.AllocationDecision Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDecider = default; + LocalJsonValue propDecision = default; + LocalJsonValue propExplanation = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDecider.TryReadProperty(ref reader, options, PropDecider, null)) + { + continue; + } + + if (propDecision.TryReadProperty(ref reader, options, PropDecision, null)) + { + continue; + } + + if (propExplanation.TryReadProperty(ref reader, options, PropExplanation, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.AllocationDecision(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Decider = propDecider.Value, + Decision = propDecision.Value, + Explanation = propExplanation.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.AllocationDecision value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDecider, value.Decider, null, null); + writer.WriteProperty(options, PropDecision, value.Decision, null, null); + writer.WriteProperty(options, PropExplanation, value.Explanation, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/AllocationDecision.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/AllocationDecision.g.cs index 589b17e912e..ebbf93f0a93 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/AllocationDecision.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/AllocationDecision.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class AllocationDecisionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDecider = System.Text.Json.JsonEncodedText.Encode("decider"); - private static readonly System.Text.Json.JsonEncodedText PropDecision = System.Text.Json.JsonEncodedText.Encode("decision"); - private static readonly System.Text.Json.JsonEncodedText PropExplanation = System.Text.Json.JsonEncodedText.Encode("explanation"); - - public override Elastic.Clients.Elasticsearch.Cluster.AllocationDecision Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDecider = default; - LocalJsonValue propDecision = default; - LocalJsonValue propExplanation = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDecider.TryReadProperty(ref reader, options, PropDecider, null)) - { - continue; - } - - if (propDecision.TryReadProperty(ref reader, options, PropDecision, null)) - { - continue; - } - - if (propExplanation.TryReadProperty(ref reader, options, PropExplanation, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.AllocationDecision(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Decider = propDecider.Value, - Decision = propDecision.Value, - Explanation = propExplanation.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.AllocationDecision value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDecider, value.Decider, null, null); - writer.WriteProperty(options, PropDecision, value.Decision, null, null); - writer.WriteProperty(options, PropExplanation, value.Explanation, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.AllocationDecisionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.AllocationDecisionConverter))] public sealed partial class AllocationDecision { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/AllocationExplainDecision.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/AllocationExplainDecision.Converters.g.cs new file mode 100644 index 00000000000..ab2cdfb132b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/AllocationExplainDecision.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class AllocationExplainDecisionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAlways = System.Text.Json.JsonEncodedText.Encode("ALWAYS"); + private static readonly System.Text.Json.JsonEncodedText MemberNo = System.Text.Json.JsonEncodedText.Encode("NO"); + private static readonly System.Text.Json.JsonEncodedText MemberThrottle = System.Text.Json.JsonEncodedText.Encode("THROTTLE"); + private static readonly System.Text.Json.JsonEncodedText MemberYes = System.Text.Json.JsonEncodedText.Encode("YES"); + + public override Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAlways)) + { + return Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision.Always; + } + + if (reader.ValueTextEquals(MemberNo)) + { + return Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision.No; + } + + if (reader.ValueTextEquals(MemberThrottle)) + { + return Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision.Throttle; + } + + if (reader.ValueTextEquals(MemberYes)) + { + return Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision.Yes; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAlways.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision.Always; + } + + if (string.Equals(value, MemberNo.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision.No; + } + + if (string.Equals(value, MemberThrottle.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision.Throttle; + } + + if (string.Equals(value, MemberYes.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision.Yes; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision.Always: + writer.WriteStringValue(MemberAlways); + break; + case Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision.No: + writer.WriteStringValue(MemberNo); + break; + case Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision.Throttle: + writer.WriteStringValue(MemberThrottle); + break; + case Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision.Yes: + writer.WriteStringValue(MemberYes); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/AllocationExplainDecision.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/AllocationExplainDecision.g.cs new file mode 100644 index 00000000000..389fae30d5a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/AllocationExplainDecision.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.AllocationExplainDecisionConverter))] +public enum AllocationExplainDecision +{ + [System.Runtime.Serialization.EnumMember(Value = "ALWAYS")] + Always, + [System.Runtime.Serialization.EnumMember(Value = "NO")] + No, + [System.Runtime.Serialization.EnumMember(Value = "THROTTLE")] + Throttle, + [System.Runtime.Serialization.EnumMember(Value = "YES")] + Yes +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/AllocationStore.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/AllocationStore.Converters.g.cs new file mode 100644 index 00000000000..27a37718486 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/AllocationStore.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class AllocationStoreConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllocationId = System.Text.Json.JsonEncodedText.Encode("allocation_id"); + private static readonly System.Text.Json.JsonEncodedText PropFound = System.Text.Json.JsonEncodedText.Encode("found"); + private static readonly System.Text.Json.JsonEncodedText PropInSync = System.Text.Json.JsonEncodedText.Encode("in_sync"); + private static readonly System.Text.Json.JsonEncodedText PropMatchingSizeInBytes = System.Text.Json.JsonEncodedText.Encode("matching_size_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropMatchingSyncId = System.Text.Json.JsonEncodedText.Encode("matching_sync_id"); + private static readonly System.Text.Json.JsonEncodedText PropStoreException = System.Text.Json.JsonEncodedText.Encode("store_exception"); + + public override Elastic.Clients.Elasticsearch.Cluster.AllocationStore Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllocationId = default; + LocalJsonValue propFound = default; + LocalJsonValue propInSync = default; + LocalJsonValue propMatchingSizeInBytes = default; + LocalJsonValue propMatchingSyncId = default; + LocalJsonValue propStoreException = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllocationId.TryReadProperty(ref reader, options, PropAllocationId, null)) + { + continue; + } + + if (propFound.TryReadProperty(ref reader, options, PropFound, null)) + { + continue; + } + + if (propInSync.TryReadProperty(ref reader, options, PropInSync, null)) + { + continue; + } + + if (propMatchingSizeInBytes.TryReadProperty(ref reader, options, PropMatchingSizeInBytes, null)) + { + continue; + } + + if (propMatchingSyncId.TryReadProperty(ref reader, options, PropMatchingSyncId, null)) + { + continue; + } + + if (propStoreException.TryReadProperty(ref reader, options, PropStoreException, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.AllocationStore(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllocationId = propAllocationId.Value, + Found = propFound.Value, + InSync = propInSync.Value, + MatchingSizeInBytes = propMatchingSizeInBytes.Value, + MatchingSyncId = propMatchingSyncId.Value, + StoreException = propStoreException.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.AllocationStore value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllocationId, value.AllocationId, null, null); + writer.WriteProperty(options, PropFound, value.Found, null, null); + writer.WriteProperty(options, PropInSync, value.InSync, null, null); + writer.WriteProperty(options, PropMatchingSizeInBytes, value.MatchingSizeInBytes, null, null); + writer.WriteProperty(options, PropMatchingSyncId, value.MatchingSyncId, null, null); + writer.WriteProperty(options, PropStoreException, value.StoreException, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/AllocationStore.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/AllocationStore.g.cs index 50ab1862289..4965d5e10c5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/AllocationStore.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/AllocationStore.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class AllocationStoreConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllocationId = System.Text.Json.JsonEncodedText.Encode("allocation_id"); - private static readonly System.Text.Json.JsonEncodedText PropFound = System.Text.Json.JsonEncodedText.Encode("found"); - private static readonly System.Text.Json.JsonEncodedText PropInSync = System.Text.Json.JsonEncodedText.Encode("in_sync"); - private static readonly System.Text.Json.JsonEncodedText PropMatchingSizeInBytes = System.Text.Json.JsonEncodedText.Encode("matching_size_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropMatchingSyncId = System.Text.Json.JsonEncodedText.Encode("matching_sync_id"); - private static readonly System.Text.Json.JsonEncodedText PropStoreException = System.Text.Json.JsonEncodedText.Encode("store_exception"); - - public override Elastic.Clients.Elasticsearch.Cluster.AllocationStore Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllocationId = default; - LocalJsonValue propFound = default; - LocalJsonValue propInSync = default; - LocalJsonValue propMatchingSizeInBytes = default; - LocalJsonValue propMatchingSyncId = default; - LocalJsonValue propStoreException = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllocationId.TryReadProperty(ref reader, options, PropAllocationId, null)) - { - continue; - } - - if (propFound.TryReadProperty(ref reader, options, PropFound, null)) - { - continue; - } - - if (propInSync.TryReadProperty(ref reader, options, PropInSync, null)) - { - continue; - } - - if (propMatchingSizeInBytes.TryReadProperty(ref reader, options, PropMatchingSizeInBytes, null)) - { - continue; - } - - if (propMatchingSyncId.TryReadProperty(ref reader, options, PropMatchingSyncId, null)) - { - continue; - } - - if (propStoreException.TryReadProperty(ref reader, options, PropStoreException, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.AllocationStore(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllocationId = propAllocationId.Value, - Found = propFound.Value, - InSync = propInSync.Value, - MatchingSizeInBytes = propMatchingSizeInBytes.Value, - MatchingSyncId = propMatchingSyncId.Value, - StoreException = propStoreException.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.AllocationStore value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllocationId, value.AllocationId, null, null); - writer.WriteProperty(options, PropFound, value.Found, null, null); - writer.WriteProperty(options, PropInSync, value.InSync, null, null); - writer.WriteProperty(options, PropMatchingSizeInBytes, value.MatchingSizeInBytes, null, null); - writer.WriteProperty(options, PropMatchingSyncId, value.MatchingSyncId, null, null); - writer.WriteProperty(options, PropStoreException, value.StoreException, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.AllocationStoreConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.AllocationStoreConverter))] public sealed partial class AllocationStore { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSStats.Converters.g.cs new file mode 100644 index 00000000000..409c67c31c5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSStats.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class CCSStatsConverter : 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 PropEsql = System.Text.Json.JsonEncodedText.Encode("_esql"); + private static readonly System.Text.Json.JsonEncodedText PropSearch = System.Text.Json.JsonEncodedText.Encode("_search"); + + public override Elastic.Clients.Elasticsearch.Cluster.CCSStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propClusters = default; + LocalJsonValue propEsql = default; + LocalJsonValue propSearch = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClusters.TryReadProperty(ref reader, options, PropClusters, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propEsql.TryReadProperty(ref reader, options, PropEsql, null)) + { + continue; + } + + if (propSearch.TryReadProperty(ref reader, options, PropSearch, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.CCSStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Clusters = propClusters.Value, + Esql = propEsql.Value, + Search = propSearch.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.CCSStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClusters, value.Clusters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropEsql, value.Esql, null, null); + writer.WriteProperty(options, PropSearch, value.Search, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSStats.g.cs index c7cf186b2c3..c3e290c6376 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSStats.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class CCSStatsConverter : 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 PropEsql = System.Text.Json.JsonEncodedText.Encode("_esql"); - private static readonly System.Text.Json.JsonEncodedText PropSearch = System.Text.Json.JsonEncodedText.Encode("_search"); - - public override Elastic.Clients.Elasticsearch.Cluster.CCSStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propClusters = default; - LocalJsonValue propEsql = default; - LocalJsonValue propSearch = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClusters.TryReadProperty(ref reader, options, PropClusters, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propEsql.TryReadProperty(ref reader, options, PropEsql, null)) - { - continue; - } - - if (propSearch.TryReadProperty(ref reader, options, PropSearch, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.CCSStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Clusters = propClusters.Value, - Esql = propEsql.Value, - Search = propSearch.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.CCSStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClusters, value.Clusters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropEsql, value.Esql, null, null); - writer.WriteProperty(options, PropSearch, value.Search, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.CCSStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.CCSStatsConverter))] public sealed partial class CCSStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageClusterStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageClusterStats.Converters.g.cs new file mode 100644 index 00000000000..159fbad146d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageClusterStats.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class CCSUsageClusterStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSkipped = System.Text.Json.JsonEncodedText.Encode("skipped"); + private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Cluster.CCSUsageClusterStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propSkipped = default; + LocalJsonValue propTook = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSkipped.TryReadProperty(ref reader, options, PropSkipped, null)) + { + continue; + } + + if (propTook.TryReadProperty(ref reader, options, PropTook, null)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.CCSUsageClusterStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Skipped = propSkipped.Value, + Took = propTook.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.CCSUsageClusterStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSkipped, value.Skipped, null, null); + writer.WriteProperty(options, PropTook, value.Took, null, null); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageClusterStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageClusterStats.g.cs index 8465c8bd206..21eb678fd26 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageClusterStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageClusterStats.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class CCSUsageClusterStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSkipped = System.Text.Json.JsonEncodedText.Encode("skipped"); - private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Cluster.CCSUsageClusterStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propSkipped = default; - LocalJsonValue propTook = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSkipped.TryReadProperty(ref reader, options, PropSkipped, null)) - { - continue; - } - - if (propTook.TryReadProperty(ref reader, options, PropTook, null)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.CCSUsageClusterStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Skipped = propSkipped.Value, - Took = propTook.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.CCSUsageClusterStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSkipped, value.Skipped, null, null); - writer.WriteProperty(options, PropTook, value.Took, null, null); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.CCSUsageClusterStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.CCSUsageClusterStatsConverter))] public sealed partial class CCSUsageClusterStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageStats.Converters.g.cs new file mode 100644 index 00000000000..e9cf492128e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageStats.Converters.g.cs @@ -0,0 +1,162 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class CCSUsageStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClients = System.Text.Json.JsonEncodedText.Encode("clients"); + private static readonly System.Text.Json.JsonEncodedText PropClusters = System.Text.Json.JsonEncodedText.Encode("clusters"); + private static readonly System.Text.Json.JsonEncodedText PropFailureReasons = System.Text.Json.JsonEncodedText.Encode("failure_reasons"); + private static readonly System.Text.Json.JsonEncodedText PropFeatures = System.Text.Json.JsonEncodedText.Encode("features"); + private static readonly System.Text.Json.JsonEncodedText PropRemotesPerSearchAvg = System.Text.Json.JsonEncodedText.Encode("remotes_per_search_avg"); + private static readonly System.Text.Json.JsonEncodedText PropRemotesPerSearchMax = System.Text.Json.JsonEncodedText.Encode("remotes_per_search_max"); + private static readonly System.Text.Json.JsonEncodedText PropSkipped = System.Text.Json.JsonEncodedText.Encode("skipped"); + private static readonly System.Text.Json.JsonEncodedText PropSuccess = System.Text.Json.JsonEncodedText.Encode("success"); + private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); + private static readonly System.Text.Json.JsonEncodedText PropTookMrtFalse = System.Text.Json.JsonEncodedText.Encode("took_mrt_false"); + private static readonly System.Text.Json.JsonEncodedText PropTookMrtTrue = System.Text.Json.JsonEncodedText.Encode("took_mrt_true"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Cluster.CCSUsageStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propClients = default; + LocalJsonValue> propClusters = default; + LocalJsonValue> propFailureReasons = default; + LocalJsonValue> propFeatures = default; + LocalJsonValue propRemotesPerSearchAvg = default; + LocalJsonValue propRemotesPerSearchMax = default; + LocalJsonValue propSkipped = default; + LocalJsonValue propSuccess = default; + LocalJsonValue propTook = default; + LocalJsonValue propTookMrtFalse = default; + LocalJsonValue propTookMrtTrue = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClients.TryReadProperty(ref reader, options, PropClients, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propClusters.TryReadProperty(ref reader, options, PropClusters, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propFailureReasons.TryReadProperty(ref reader, options, PropFailureReasons, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propFeatures.TryReadProperty(ref reader, options, PropFeatures, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propRemotesPerSearchAvg.TryReadProperty(ref reader, options, PropRemotesPerSearchAvg, null)) + { + continue; + } + + if (propRemotesPerSearchMax.TryReadProperty(ref reader, options, PropRemotesPerSearchMax, null)) + { + continue; + } + + if (propSkipped.TryReadProperty(ref reader, options, PropSkipped, null)) + { + continue; + } + + if (propSuccess.TryReadProperty(ref reader, options, PropSuccess, null)) + { + continue; + } + + if (propTook.TryReadProperty(ref reader, options, PropTook, null)) + { + continue; + } + + if (propTookMrtFalse.TryReadProperty(ref reader, options, PropTookMrtFalse, null)) + { + continue; + } + + if (propTookMrtTrue.TryReadProperty(ref reader, options, PropTookMrtTrue, null)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.CCSUsageStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Clients = propClients.Value, + Clusters = propClusters.Value, + FailureReasons = propFailureReasons.Value, + Features = propFeatures.Value, + RemotesPerSearchAvg = propRemotesPerSearchAvg.Value, + RemotesPerSearchMax = propRemotesPerSearchMax.Value, + Skipped = propSkipped.Value, + Success = propSuccess.Value, + Took = propTook.Value, + TookMrtFalse = propTookMrtFalse.Value, + TookMrtTrue = propTookMrtTrue.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.CCSUsageStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClients, value.Clients, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropClusters, value.Clusters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropFailureReasons, value.FailureReasons, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropFeatures, value.Features, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropRemotesPerSearchAvg, value.RemotesPerSearchAvg, null, null); + writer.WriteProperty(options, PropRemotesPerSearchMax, value.RemotesPerSearchMax, null, null); + writer.WriteProperty(options, PropSkipped, value.Skipped, null, null); + writer.WriteProperty(options, PropSuccess, value.Success, null, null); + writer.WriteProperty(options, PropTook, value.Took, null, null); + writer.WriteProperty(options, PropTookMrtFalse, value.TookMrtFalse, null, null); + writer.WriteProperty(options, PropTookMrtTrue, value.TookMrtTrue, null, null); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageStats.g.cs index e16cc91c4dd..b400f0763c4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageStats.g.cs @@ -23,145 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class CCSUsageStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClients = System.Text.Json.JsonEncodedText.Encode("clients"); - private static readonly System.Text.Json.JsonEncodedText PropClusters = System.Text.Json.JsonEncodedText.Encode("clusters"); - private static readonly System.Text.Json.JsonEncodedText PropFailureReasons = System.Text.Json.JsonEncodedText.Encode("failure_reasons"); - private static readonly System.Text.Json.JsonEncodedText PropFeatures = System.Text.Json.JsonEncodedText.Encode("features"); - private static readonly System.Text.Json.JsonEncodedText PropRemotesPerSearchAvg = System.Text.Json.JsonEncodedText.Encode("remotes_per_search_avg"); - private static readonly System.Text.Json.JsonEncodedText PropRemotesPerSearchMax = System.Text.Json.JsonEncodedText.Encode("remotes_per_search_max"); - private static readonly System.Text.Json.JsonEncodedText PropSkipped = System.Text.Json.JsonEncodedText.Encode("skipped"); - private static readonly System.Text.Json.JsonEncodedText PropSuccess = System.Text.Json.JsonEncodedText.Encode("success"); - private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); - private static readonly System.Text.Json.JsonEncodedText PropTookMrtFalse = System.Text.Json.JsonEncodedText.Encode("took_mrt_false"); - private static readonly System.Text.Json.JsonEncodedText PropTookMrtTrue = System.Text.Json.JsonEncodedText.Encode("took_mrt_true"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Cluster.CCSUsageStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propClients = default; - LocalJsonValue> propClusters = default; - LocalJsonValue> propFailureReasons = default; - LocalJsonValue> propFeatures = default; - LocalJsonValue propRemotesPerSearchAvg = default; - LocalJsonValue propRemotesPerSearchMax = default; - LocalJsonValue propSkipped = default; - LocalJsonValue propSuccess = default; - LocalJsonValue propTook = default; - LocalJsonValue propTookMrtFalse = default; - LocalJsonValue propTookMrtTrue = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClients.TryReadProperty(ref reader, options, PropClients, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propClusters.TryReadProperty(ref reader, options, PropClusters, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propFailureReasons.TryReadProperty(ref reader, options, PropFailureReasons, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propFeatures.TryReadProperty(ref reader, options, PropFeatures, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propRemotesPerSearchAvg.TryReadProperty(ref reader, options, PropRemotesPerSearchAvg, null)) - { - continue; - } - - if (propRemotesPerSearchMax.TryReadProperty(ref reader, options, PropRemotesPerSearchMax, null)) - { - continue; - } - - if (propSkipped.TryReadProperty(ref reader, options, PropSkipped, null)) - { - continue; - } - - if (propSuccess.TryReadProperty(ref reader, options, PropSuccess, null)) - { - continue; - } - - if (propTook.TryReadProperty(ref reader, options, PropTook, null)) - { - continue; - } - - if (propTookMrtFalse.TryReadProperty(ref reader, options, PropTookMrtFalse, null)) - { - continue; - } - - if (propTookMrtTrue.TryReadProperty(ref reader, options, PropTookMrtTrue, null)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.CCSUsageStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Clients = propClients.Value, - Clusters = propClusters.Value, - FailureReasons = propFailureReasons.Value, - Features = propFeatures.Value, - RemotesPerSearchAvg = propRemotesPerSearchAvg.Value, - RemotesPerSearchMax = propRemotesPerSearchMax.Value, - Skipped = propSkipped.Value, - Success = propSuccess.Value, - Took = propTook.Value, - TookMrtFalse = propTookMrtFalse.Value, - TookMrtTrue = propTookMrtTrue.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.CCSUsageStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClients, value.Clients, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropClusters, value.Clusters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropFailureReasons, value.FailureReasons, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropFeatures, value.Features, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropRemotesPerSearchAvg, value.RemotesPerSearchAvg, null, null); - writer.WriteProperty(options, PropRemotesPerSearchMax, value.RemotesPerSearchMax, null, null); - writer.WriteProperty(options, PropSkipped, value.Skipped, null, null); - writer.WriteProperty(options, PropSuccess, value.Success, null, null); - writer.WriteProperty(options, PropTook, value.Took, null, null); - writer.WriteProperty(options, PropTookMrtFalse, value.TookMrtFalse, null, null); - writer.WriteProperty(options, PropTookMrtTrue, value.TookMrtTrue, null, null); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.CCSUsageStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.CCSUsageStatsConverter))] public sealed partial class CCSUsageStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageTimeValue.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageTimeValue.Converters.g.cs new file mode 100644 index 00000000000..d3f6cf20cb9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageTimeValue.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class CCSUsageTimeValueConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvg = System.Text.Json.JsonEncodedText.Encode("avg"); + private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText PropP90 = System.Text.Json.JsonEncodedText.Encode("p90"); + + public override Elastic.Clients.Elasticsearch.Cluster.CCSUsageTimeValue Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvg = default; + LocalJsonValue propMax = default; + LocalJsonValue propP90 = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvg.TryReadProperty(ref reader, options, PropAvg, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propMax.TryReadProperty(ref reader, options, PropMax, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propP90.TryReadProperty(ref reader, options, PropP90, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.CCSUsageTimeValue(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Avg = propAvg.Value, + Max = propMax.Value, + P90 = propP90.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.CCSUsageTimeValue value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvg, value.Avg, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropMax, value.Max, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropP90, value.P90, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageTimeValue.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageTimeValue.g.cs index 396735b2cd1..fb3ba4c9ebc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageTimeValue.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageTimeValue.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class CCSUsageTimeValueConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvg = System.Text.Json.JsonEncodedText.Encode("avg"); - private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); - private static readonly System.Text.Json.JsonEncodedText PropP90 = System.Text.Json.JsonEncodedText.Encode("p90"); - - public override Elastic.Clients.Elasticsearch.Cluster.CCSUsageTimeValue Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvg = default; - LocalJsonValue propMax = default; - LocalJsonValue propP90 = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvg.TryReadProperty(ref reader, options, PropAvg, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propMax.TryReadProperty(ref reader, options, PropMax, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propP90.TryReadProperty(ref reader, options, PropP90, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.CCSUsageTimeValue(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Avg = propAvg.Value, - Max = propMax.Value, - P90 = propP90.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.CCSUsageTimeValue value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvg, value.Avg, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropMax, value.Max, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropP90, value.P90, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.CCSUsageTimeValueConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.CCSUsageTimeValueConverter))] public sealed partial class CCSUsageTimeValue { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CharFilterTypes.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CharFilterTypes.Converters.g.cs new file mode 100644 index 00000000000..5455d058c8b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CharFilterTypes.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class CharFilterTypesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzerTypes = System.Text.Json.JsonEncodedText.Encode("analyzer_types"); + private static readonly System.Text.Json.JsonEncodedText PropBuiltInAnalyzers = System.Text.Json.JsonEncodedText.Encode("built_in_analyzers"); + private static readonly System.Text.Json.JsonEncodedText PropBuiltInCharFilters = System.Text.Json.JsonEncodedText.Encode("built_in_char_filters"); + private static readonly System.Text.Json.JsonEncodedText PropBuiltInFilters = System.Text.Json.JsonEncodedText.Encode("built_in_filters"); + private static readonly System.Text.Json.JsonEncodedText PropBuiltInTokenizers = System.Text.Json.JsonEncodedText.Encode("built_in_tokenizers"); + private static readonly System.Text.Json.JsonEncodedText PropCharFilterTypes2 = System.Text.Json.JsonEncodedText.Encode("char_filter_types"); + private static readonly System.Text.Json.JsonEncodedText PropFilterTypes = System.Text.Json.JsonEncodedText.Encode("filter_types"); + private static readonly System.Text.Json.JsonEncodedText PropSynonyms = System.Text.Json.JsonEncodedText.Encode("synonyms"); + private static readonly System.Text.Json.JsonEncodedText PropTokenizerTypes = System.Text.Json.JsonEncodedText.Encode("tokenizer_types"); + + public override Elastic.Clients.Elasticsearch.Cluster.CharFilterTypes Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propAnalyzerTypes = default; + LocalJsonValue> propBuiltInAnalyzers = default; + LocalJsonValue> propBuiltInCharFilters = default; + LocalJsonValue> propBuiltInFilters = default; + LocalJsonValue> propBuiltInTokenizers = default; + LocalJsonValue> propCharFilterTypes2 = default; + LocalJsonValue> propFilterTypes = default; + LocalJsonValue> propSynonyms = default; + LocalJsonValue> propTokenizerTypes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzerTypes.TryReadProperty(ref reader, options, PropAnalyzerTypes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propBuiltInAnalyzers.TryReadProperty(ref reader, options, PropBuiltInAnalyzers, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propBuiltInCharFilters.TryReadProperty(ref reader, options, PropBuiltInCharFilters, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propBuiltInFilters.TryReadProperty(ref reader, options, PropBuiltInFilters, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propBuiltInTokenizers.TryReadProperty(ref reader, options, PropBuiltInTokenizers, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propCharFilterTypes2.TryReadProperty(ref reader, options, PropCharFilterTypes2, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propFilterTypes.TryReadProperty(ref reader, options, PropFilterTypes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propSynonyms.TryReadProperty(ref reader, options, PropSynonyms, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propTokenizerTypes.TryReadProperty(ref reader, options, PropTokenizerTypes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.CharFilterTypes(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AnalyzerTypes = propAnalyzerTypes.Value, + BuiltInAnalyzers = propBuiltInAnalyzers.Value, + BuiltInCharFilters = propBuiltInCharFilters.Value, + BuiltInFilters = propBuiltInFilters.Value, + BuiltInTokenizers = propBuiltInTokenizers.Value, + CharFilterTypes2 = propCharFilterTypes2.Value, + FilterTypes = propFilterTypes.Value, + Synonyms = propSynonyms.Value, + TokenizerTypes = propTokenizerTypes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.CharFilterTypes value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzerTypes, value.AnalyzerTypes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropBuiltInAnalyzers, value.BuiltInAnalyzers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropBuiltInCharFilters, value.BuiltInCharFilters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropBuiltInFilters, value.BuiltInFilters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropBuiltInTokenizers, value.BuiltInTokenizers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCharFilterTypes2, value.CharFilterTypes2, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFilterTypes, value.FilterTypes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSynonyms, value.Synonyms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropTokenizerTypes, value.TokenizerTypes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CharFilterTypes.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CharFilterTypes.g.cs index f081a10085d..f8b74f7f1d5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CharFilterTypes.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CharFilterTypes.g.cs @@ -23,118 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class CharFilterTypesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzerTypes = System.Text.Json.JsonEncodedText.Encode("analyzer_types"); - private static readonly System.Text.Json.JsonEncodedText PropBuiltInAnalyzers = System.Text.Json.JsonEncodedText.Encode("built_in_analyzers"); - private static readonly System.Text.Json.JsonEncodedText PropBuiltInCharFilters = System.Text.Json.JsonEncodedText.Encode("built_in_char_filters"); - private static readonly System.Text.Json.JsonEncodedText PropBuiltInFilters = System.Text.Json.JsonEncodedText.Encode("built_in_filters"); - private static readonly System.Text.Json.JsonEncodedText PropBuiltInTokenizers = System.Text.Json.JsonEncodedText.Encode("built_in_tokenizers"); - private static readonly System.Text.Json.JsonEncodedText PropCharFilterTypes2 = System.Text.Json.JsonEncodedText.Encode("char_filter_types"); - private static readonly System.Text.Json.JsonEncodedText PropFilterTypes = System.Text.Json.JsonEncodedText.Encode("filter_types"); - private static readonly System.Text.Json.JsonEncodedText PropSynonyms = System.Text.Json.JsonEncodedText.Encode("synonyms"); - private static readonly System.Text.Json.JsonEncodedText PropTokenizerTypes = System.Text.Json.JsonEncodedText.Encode("tokenizer_types"); - - public override Elastic.Clients.Elasticsearch.Cluster.CharFilterTypes Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propAnalyzerTypes = default; - LocalJsonValue> propBuiltInAnalyzers = default; - LocalJsonValue> propBuiltInCharFilters = default; - LocalJsonValue> propBuiltInFilters = default; - LocalJsonValue> propBuiltInTokenizers = default; - LocalJsonValue> propCharFilterTypes2 = default; - LocalJsonValue> propFilterTypes = default; - LocalJsonValue> propSynonyms = default; - LocalJsonValue> propTokenizerTypes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzerTypes.TryReadProperty(ref reader, options, PropAnalyzerTypes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propBuiltInAnalyzers.TryReadProperty(ref reader, options, PropBuiltInAnalyzers, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propBuiltInCharFilters.TryReadProperty(ref reader, options, PropBuiltInCharFilters, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propBuiltInFilters.TryReadProperty(ref reader, options, PropBuiltInFilters, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propBuiltInTokenizers.TryReadProperty(ref reader, options, PropBuiltInTokenizers, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propCharFilterTypes2.TryReadProperty(ref reader, options, PropCharFilterTypes2, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propFilterTypes.TryReadProperty(ref reader, options, PropFilterTypes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propSynonyms.TryReadProperty(ref reader, options, PropSynonyms, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propTokenizerTypes.TryReadProperty(ref reader, options, PropTokenizerTypes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.CharFilterTypes(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AnalyzerTypes = propAnalyzerTypes.Value, - BuiltInAnalyzers = propBuiltInAnalyzers.Value, - BuiltInCharFilters = propBuiltInCharFilters.Value, - BuiltInFilters = propBuiltInFilters.Value, - BuiltInTokenizers = propBuiltInTokenizers.Value, - CharFilterTypes2 = propCharFilterTypes2.Value, - FilterTypes = propFilterTypes.Value, - Synonyms = propSynonyms.Value, - TokenizerTypes = propTokenizerTypes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.CharFilterTypes value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzerTypes, value.AnalyzerTypes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropBuiltInAnalyzers, value.BuiltInAnalyzers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropBuiltInCharFilters, value.BuiltInCharFilters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropBuiltInFilters, value.BuiltInFilters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropBuiltInTokenizers, value.BuiltInTokenizers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCharFilterTypes2, value.CharFilterTypes2, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFilterTypes, value.FilterTypes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSynonyms, value.Synonyms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropTokenizerTypes, value.TokenizerTypes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.CharFilterTypesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.CharFilterTypesConverter))] public sealed partial class CharFilterTypes { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterFileSystem.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterFileSystem.Converters.g.cs new file mode 100644 index 00000000000..014d8b22e7a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterFileSystem.Converters.g.cs @@ -0,0 +1,207 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ClusterFileSystemConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); + private static readonly System.Text.Json.JsonEncodedText PropAvailableInBytes = System.Text.Json.JsonEncodedText.Encode("available_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropFloodStageFreeSpace = System.Text.Json.JsonEncodedText.Encode("flood_stage_free_space"); + private static readonly System.Text.Json.JsonEncodedText PropFloodStageFreeSpaceInBytes = System.Text.Json.JsonEncodedText.Encode("flood_stage_free_space_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropFree = System.Text.Json.JsonEncodedText.Encode("free"); + private static readonly System.Text.Json.JsonEncodedText PropFreeInBytes = System.Text.Json.JsonEncodedText.Encode("free_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropFrozenFloodStageFreeSpace = System.Text.Json.JsonEncodedText.Encode("frozen_flood_stage_free_space"); + private static readonly System.Text.Json.JsonEncodedText PropFrozenFloodStageFreeSpaceInBytes = System.Text.Json.JsonEncodedText.Encode("frozen_flood_stage_free_space_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropHighWatermarkFreeSpace = System.Text.Json.JsonEncodedText.Encode("high_watermark_free_space"); + private static readonly System.Text.Json.JsonEncodedText PropHighWatermarkFreeSpaceInBytes = System.Text.Json.JsonEncodedText.Encode("high_watermark_free_space_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropLowWatermarkFreeSpace = System.Text.Json.JsonEncodedText.Encode("low_watermark_free_space"); + private static readonly System.Text.Json.JsonEncodedText PropLowWatermarkFreeSpaceInBytes = System.Text.Json.JsonEncodedText.Encode("low_watermark_free_space_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropMount = System.Text.Json.JsonEncodedText.Encode("mount"); + private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + private static readonly System.Text.Json.JsonEncodedText PropTotalInBytes = System.Text.Json.JsonEncodedText.Encode("total_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Cluster.ClusterFileSystem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvailable = default; + LocalJsonValue propAvailableInBytes = default; + LocalJsonValue propFloodStageFreeSpace = default; + LocalJsonValue propFloodStageFreeSpaceInBytes = default; + LocalJsonValue propFree = default; + LocalJsonValue propFreeInBytes = default; + LocalJsonValue propFrozenFloodStageFreeSpace = default; + LocalJsonValue propFrozenFloodStageFreeSpaceInBytes = default; + LocalJsonValue propHighWatermarkFreeSpace = default; + LocalJsonValue propHighWatermarkFreeSpaceInBytes = default; + LocalJsonValue propLowWatermarkFreeSpace = default; + LocalJsonValue propLowWatermarkFreeSpaceInBytes = default; + LocalJsonValue propMount = default; + LocalJsonValue propPath = default; + LocalJsonValue propTotal = default; + LocalJsonValue propTotalInBytes = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) + { + continue; + } + + if (propAvailableInBytes.TryReadProperty(ref reader, options, PropAvailableInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFloodStageFreeSpace.TryReadProperty(ref reader, options, PropFloodStageFreeSpace, null)) + { + continue; + } + + if (propFloodStageFreeSpaceInBytes.TryReadProperty(ref reader, options, PropFloodStageFreeSpaceInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFree.TryReadProperty(ref reader, options, PropFree, null)) + { + continue; + } + + if (propFreeInBytes.TryReadProperty(ref reader, options, PropFreeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFrozenFloodStageFreeSpace.TryReadProperty(ref reader, options, PropFrozenFloodStageFreeSpace, null)) + { + continue; + } + + if (propFrozenFloodStageFreeSpaceInBytes.TryReadProperty(ref reader, options, PropFrozenFloodStageFreeSpaceInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propHighWatermarkFreeSpace.TryReadProperty(ref reader, options, PropHighWatermarkFreeSpace, null)) + { + continue; + } + + if (propHighWatermarkFreeSpaceInBytes.TryReadProperty(ref reader, options, PropHighWatermarkFreeSpaceInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLowWatermarkFreeSpace.TryReadProperty(ref reader, options, PropLowWatermarkFreeSpace, null)) + { + continue; + } + + if (propLowWatermarkFreeSpaceInBytes.TryReadProperty(ref reader, options, PropLowWatermarkFreeSpaceInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMount.TryReadProperty(ref reader, options, PropMount, null)) + { + continue; + } + + if (propPath.TryReadProperty(ref reader, options, PropPath, null)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (propTotalInBytes.TryReadProperty(ref reader, options, PropTotalInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ClusterFileSystem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Available = propAvailable.Value, + AvailableInBytes = propAvailableInBytes.Value, + FloodStageFreeSpace = propFloodStageFreeSpace.Value, + FloodStageFreeSpaceInBytes = propFloodStageFreeSpaceInBytes.Value, + Free = propFree.Value, + FreeInBytes = propFreeInBytes.Value, + FrozenFloodStageFreeSpace = propFrozenFloodStageFreeSpace.Value, + FrozenFloodStageFreeSpaceInBytes = propFrozenFloodStageFreeSpaceInBytes.Value, + HighWatermarkFreeSpace = propHighWatermarkFreeSpace.Value, + HighWatermarkFreeSpaceInBytes = propHighWatermarkFreeSpaceInBytes.Value, + LowWatermarkFreeSpace = propLowWatermarkFreeSpace.Value, + LowWatermarkFreeSpaceInBytes = propLowWatermarkFreeSpaceInBytes.Value, + Mount = propMount.Value, + Path = propPath.Value, + Total = propTotal.Value, + TotalInBytes = propTotalInBytes.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterFileSystem value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvailable, value.Available, null, null); + writer.WriteProperty(options, PropAvailableInBytes, value.AvailableInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFloodStageFreeSpace, value.FloodStageFreeSpace, null, null); + writer.WriteProperty(options, PropFloodStageFreeSpaceInBytes, value.FloodStageFreeSpaceInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFree, value.Free, null, null); + writer.WriteProperty(options, PropFreeInBytes, value.FreeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFrozenFloodStageFreeSpace, value.FrozenFloodStageFreeSpace, null, null); + writer.WriteProperty(options, PropFrozenFloodStageFreeSpaceInBytes, value.FrozenFloodStageFreeSpaceInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropHighWatermarkFreeSpace, value.HighWatermarkFreeSpace, null, null); + writer.WriteProperty(options, PropHighWatermarkFreeSpaceInBytes, value.HighWatermarkFreeSpaceInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLowWatermarkFreeSpace, value.LowWatermarkFreeSpace, null, null); + writer.WriteProperty(options, PropLowWatermarkFreeSpaceInBytes, value.LowWatermarkFreeSpaceInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMount, value.Mount, null, null); + writer.WriteProperty(options, PropPath, value.Path, null, null); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteProperty(options, PropTotalInBytes, value.TotalInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterFileSystem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterFileSystem.g.cs index 7e627e4195f..9a86e54015b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterFileSystem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterFileSystem.g.cs @@ -23,190 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ClusterFileSystemConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); - private static readonly System.Text.Json.JsonEncodedText PropAvailableInBytes = System.Text.Json.JsonEncodedText.Encode("available_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropFloodStageFreeSpace = System.Text.Json.JsonEncodedText.Encode("flood_stage_free_space"); - private static readonly System.Text.Json.JsonEncodedText PropFloodStageFreeSpaceInBytes = System.Text.Json.JsonEncodedText.Encode("flood_stage_free_space_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropFree = System.Text.Json.JsonEncodedText.Encode("free"); - private static readonly System.Text.Json.JsonEncodedText PropFreeInBytes = System.Text.Json.JsonEncodedText.Encode("free_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropFrozenFloodStageFreeSpace = System.Text.Json.JsonEncodedText.Encode("frozen_flood_stage_free_space"); - private static readonly System.Text.Json.JsonEncodedText PropFrozenFloodStageFreeSpaceInBytes = System.Text.Json.JsonEncodedText.Encode("frozen_flood_stage_free_space_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropHighWatermarkFreeSpace = System.Text.Json.JsonEncodedText.Encode("high_watermark_free_space"); - private static readonly System.Text.Json.JsonEncodedText PropHighWatermarkFreeSpaceInBytes = System.Text.Json.JsonEncodedText.Encode("high_watermark_free_space_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropLowWatermarkFreeSpace = System.Text.Json.JsonEncodedText.Encode("low_watermark_free_space"); - private static readonly System.Text.Json.JsonEncodedText PropLowWatermarkFreeSpaceInBytes = System.Text.Json.JsonEncodedText.Encode("low_watermark_free_space_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropMount = System.Text.Json.JsonEncodedText.Encode("mount"); - private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - private static readonly System.Text.Json.JsonEncodedText PropTotalInBytes = System.Text.Json.JsonEncodedText.Encode("total_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Cluster.ClusterFileSystem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvailable = default; - LocalJsonValue propAvailableInBytes = default; - LocalJsonValue propFloodStageFreeSpace = default; - LocalJsonValue propFloodStageFreeSpaceInBytes = default; - LocalJsonValue propFree = default; - LocalJsonValue propFreeInBytes = default; - LocalJsonValue propFrozenFloodStageFreeSpace = default; - LocalJsonValue propFrozenFloodStageFreeSpaceInBytes = default; - LocalJsonValue propHighWatermarkFreeSpace = default; - LocalJsonValue propHighWatermarkFreeSpaceInBytes = default; - LocalJsonValue propLowWatermarkFreeSpace = default; - LocalJsonValue propLowWatermarkFreeSpaceInBytes = default; - LocalJsonValue propMount = default; - LocalJsonValue propPath = default; - LocalJsonValue propTotal = default; - LocalJsonValue propTotalInBytes = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) - { - continue; - } - - if (propAvailableInBytes.TryReadProperty(ref reader, options, PropAvailableInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFloodStageFreeSpace.TryReadProperty(ref reader, options, PropFloodStageFreeSpace, null)) - { - continue; - } - - if (propFloodStageFreeSpaceInBytes.TryReadProperty(ref reader, options, PropFloodStageFreeSpaceInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFree.TryReadProperty(ref reader, options, PropFree, null)) - { - continue; - } - - if (propFreeInBytes.TryReadProperty(ref reader, options, PropFreeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFrozenFloodStageFreeSpace.TryReadProperty(ref reader, options, PropFrozenFloodStageFreeSpace, null)) - { - continue; - } - - if (propFrozenFloodStageFreeSpaceInBytes.TryReadProperty(ref reader, options, PropFrozenFloodStageFreeSpaceInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propHighWatermarkFreeSpace.TryReadProperty(ref reader, options, PropHighWatermarkFreeSpace, null)) - { - continue; - } - - if (propHighWatermarkFreeSpaceInBytes.TryReadProperty(ref reader, options, PropHighWatermarkFreeSpaceInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLowWatermarkFreeSpace.TryReadProperty(ref reader, options, PropLowWatermarkFreeSpace, null)) - { - continue; - } - - if (propLowWatermarkFreeSpaceInBytes.TryReadProperty(ref reader, options, PropLowWatermarkFreeSpaceInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMount.TryReadProperty(ref reader, options, PropMount, null)) - { - continue; - } - - if (propPath.TryReadProperty(ref reader, options, PropPath, null)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (propTotalInBytes.TryReadProperty(ref reader, options, PropTotalInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ClusterFileSystem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Available = propAvailable.Value, - AvailableInBytes = propAvailableInBytes.Value, - FloodStageFreeSpace = propFloodStageFreeSpace.Value, - FloodStageFreeSpaceInBytes = propFloodStageFreeSpaceInBytes.Value, - Free = propFree.Value, - FreeInBytes = propFreeInBytes.Value, - FrozenFloodStageFreeSpace = propFrozenFloodStageFreeSpace.Value, - FrozenFloodStageFreeSpaceInBytes = propFrozenFloodStageFreeSpaceInBytes.Value, - HighWatermarkFreeSpace = propHighWatermarkFreeSpace.Value, - HighWatermarkFreeSpaceInBytes = propHighWatermarkFreeSpaceInBytes.Value, - LowWatermarkFreeSpace = propLowWatermarkFreeSpace.Value, - LowWatermarkFreeSpaceInBytes = propLowWatermarkFreeSpaceInBytes.Value, - Mount = propMount.Value, - Path = propPath.Value, - Total = propTotal.Value, - TotalInBytes = propTotalInBytes.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterFileSystem value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvailable, value.Available, null, null); - writer.WriteProperty(options, PropAvailableInBytes, value.AvailableInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFloodStageFreeSpace, value.FloodStageFreeSpace, null, null); - writer.WriteProperty(options, PropFloodStageFreeSpaceInBytes, value.FloodStageFreeSpaceInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFree, value.Free, null, null); - writer.WriteProperty(options, PropFreeInBytes, value.FreeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFrozenFloodStageFreeSpace, value.FrozenFloodStageFreeSpace, null, null); - writer.WriteProperty(options, PropFrozenFloodStageFreeSpaceInBytes, value.FrozenFloodStageFreeSpaceInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropHighWatermarkFreeSpace, value.HighWatermarkFreeSpace, null, null); - writer.WriteProperty(options, PropHighWatermarkFreeSpaceInBytes, value.HighWatermarkFreeSpaceInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLowWatermarkFreeSpace, value.LowWatermarkFreeSpace, null, null); - writer.WriteProperty(options, PropLowWatermarkFreeSpaceInBytes, value.LowWatermarkFreeSpaceInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMount, value.Mount, null, null); - writer.WriteProperty(options, PropPath, value.Path, null, null); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteProperty(options, PropTotalInBytes, value.TotalInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ClusterFileSystemConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ClusterFileSystemConverter))] public sealed partial class ClusterFileSystem { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIndices.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIndices.Converters.g.cs new file mode 100644 index 00000000000..72774982823 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIndices.Converters.g.cs @@ -0,0 +1,180 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ClusterIndicesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalysis = System.Text.Json.JsonEncodedText.Encode("analysis"); + private static readonly System.Text.Json.JsonEncodedText PropCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropDenseVector = System.Text.Json.JsonEncodedText.Encode("dense_vector"); + private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); + private static readonly System.Text.Json.JsonEncodedText PropFielddata = System.Text.Json.JsonEncodedText.Encode("fielddata"); + private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); + private static readonly System.Text.Json.JsonEncodedText PropQueryCache = System.Text.Json.JsonEncodedText.Encode("query_cache"); + private static readonly System.Text.Json.JsonEncodedText PropSearch = System.Text.Json.JsonEncodedText.Encode("search"); + private static readonly System.Text.Json.JsonEncodedText PropSegments = System.Text.Json.JsonEncodedText.Encode("segments"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); + private static readonly System.Text.Json.JsonEncodedText PropSparseVector = System.Text.Json.JsonEncodedText.Encode("sparse_vector"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropVersions = System.Text.Json.JsonEncodedText.Encode("versions"); + + public override Elastic.Clients.Elasticsearch.Cluster.ClusterIndices Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalysis = default; + LocalJsonValue propCompletion = default; + LocalJsonValue propCount = default; + LocalJsonValue propDenseVector = default; + LocalJsonValue propDocs = default; + LocalJsonValue propFielddata = default; + LocalJsonValue propMappings = default; + LocalJsonValue propQueryCache = default; + LocalJsonValue propSearch = default; + LocalJsonValue propSegments = default; + LocalJsonValue propShards = default; + LocalJsonValue propSparseVector = default; + LocalJsonValue propStore = default; + LocalJsonValue?> propVersions = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalysis.TryReadProperty(ref reader, options, PropAnalysis, null)) + { + continue; + } + + if (propCompletion.TryReadProperty(ref reader, options, PropCompletion, null)) + { + continue; + } + + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propDenseVector.TryReadProperty(ref reader, options, PropDenseVector, null)) + { + continue; + } + + if (propDocs.TryReadProperty(ref reader, options, PropDocs, null)) + { + continue; + } + + if (propFielddata.TryReadProperty(ref reader, options, PropFielddata, null)) + { + continue; + } + + if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) + { + continue; + } + + if (propQueryCache.TryReadProperty(ref reader, options, PropQueryCache, null)) + { + continue; + } + + if (propSearch.TryReadProperty(ref reader, options, PropSearch, null)) + { + continue; + } + + if (propSegments.TryReadProperty(ref reader, options, PropSegments, null)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (propSparseVector.TryReadProperty(ref reader, options, PropSparseVector, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, null)) + { + continue; + } + + if (propVersions.TryReadProperty(ref reader, options, PropVersions, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ClusterIndices(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analysis = propAnalysis.Value, + Completion = propCompletion.Value, + Count = propCount.Value, + DenseVector = propDenseVector.Value, + Docs = propDocs.Value, + Fielddata = propFielddata.Value, + Mappings = propMappings.Value, + QueryCache = propQueryCache.Value, + Search = propSearch.Value, + Segments = propSegments.Value, + Shards = propShards.Value, + SparseVector = propSparseVector.Value, + Store = propStore.Value, + Versions = propVersions.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterIndices value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalysis, value.Analysis, null, null); + writer.WriteProperty(options, PropCompletion, value.Completion, null, null); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropDenseVector, value.DenseVector, null, null); + writer.WriteProperty(options, PropDocs, value.Docs, null, null); + writer.WriteProperty(options, PropFielddata, value.Fielddata, null, null); + writer.WriteProperty(options, PropMappings, value.Mappings, null, null); + writer.WriteProperty(options, PropQueryCache, value.QueryCache, null, null); + writer.WriteProperty(options, PropSearch, value.Search, null, null); + writer.WriteProperty(options, PropSegments, value.Segments, null, null); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteProperty(options, PropSparseVector, value.SparseVector, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, null); + writer.WriteProperty(options, PropVersions, value.Versions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIndices.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIndices.g.cs index 6004635535b..8b1fea046e3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIndices.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIndices.g.cs @@ -23,163 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ClusterIndicesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalysis = System.Text.Json.JsonEncodedText.Encode("analysis"); - private static readonly System.Text.Json.JsonEncodedText PropCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropDenseVector = System.Text.Json.JsonEncodedText.Encode("dense_vector"); - private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); - private static readonly System.Text.Json.JsonEncodedText PropFielddata = System.Text.Json.JsonEncodedText.Encode("fielddata"); - private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); - private static readonly System.Text.Json.JsonEncodedText PropQueryCache = System.Text.Json.JsonEncodedText.Encode("query_cache"); - private static readonly System.Text.Json.JsonEncodedText PropSearch = System.Text.Json.JsonEncodedText.Encode("search"); - private static readonly System.Text.Json.JsonEncodedText PropSegments = System.Text.Json.JsonEncodedText.Encode("segments"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); - private static readonly System.Text.Json.JsonEncodedText PropSparseVector = System.Text.Json.JsonEncodedText.Encode("sparse_vector"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropVersions = System.Text.Json.JsonEncodedText.Encode("versions"); - - public override Elastic.Clients.Elasticsearch.Cluster.ClusterIndices Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalysis = default; - LocalJsonValue propCompletion = default; - LocalJsonValue propCount = default; - LocalJsonValue propDenseVector = default; - LocalJsonValue propDocs = default; - LocalJsonValue propFielddata = default; - LocalJsonValue propMappings = default; - LocalJsonValue propQueryCache = default; - LocalJsonValue propSearch = default; - LocalJsonValue propSegments = default; - LocalJsonValue propShards = default; - LocalJsonValue propSparseVector = default; - LocalJsonValue propStore = default; - LocalJsonValue?> propVersions = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalysis.TryReadProperty(ref reader, options, PropAnalysis, null)) - { - continue; - } - - if (propCompletion.TryReadProperty(ref reader, options, PropCompletion, null)) - { - continue; - } - - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propDenseVector.TryReadProperty(ref reader, options, PropDenseVector, null)) - { - continue; - } - - if (propDocs.TryReadProperty(ref reader, options, PropDocs, null)) - { - continue; - } - - if (propFielddata.TryReadProperty(ref reader, options, PropFielddata, null)) - { - continue; - } - - if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) - { - continue; - } - - if (propQueryCache.TryReadProperty(ref reader, options, PropQueryCache, null)) - { - continue; - } - - if (propSearch.TryReadProperty(ref reader, options, PropSearch, null)) - { - continue; - } - - if (propSegments.TryReadProperty(ref reader, options, PropSegments, null)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (propSparseVector.TryReadProperty(ref reader, options, PropSparseVector, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, null)) - { - continue; - } - - if (propVersions.TryReadProperty(ref reader, options, PropVersions, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ClusterIndices(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analysis = propAnalysis.Value, - Completion = propCompletion.Value, - Count = propCount.Value, - DenseVector = propDenseVector.Value, - Docs = propDocs.Value, - Fielddata = propFielddata.Value, - Mappings = propMappings.Value, - QueryCache = propQueryCache.Value, - Search = propSearch.Value, - Segments = propSegments.Value, - Shards = propShards.Value, - SparseVector = propSparseVector.Value, - Store = propStore.Value, - Versions = propVersions.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterIndices value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalysis, value.Analysis, null, null); - writer.WriteProperty(options, PropCompletion, value.Completion, null, null); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropDenseVector, value.DenseVector, null, null); - writer.WriteProperty(options, PropDocs, value.Docs, null, null); - writer.WriteProperty(options, PropFielddata, value.Fielddata, null, null); - writer.WriteProperty(options, PropMappings, value.Mappings, null, null); - writer.WriteProperty(options, PropQueryCache, value.QueryCache, null, null); - writer.WriteProperty(options, PropSearch, value.Search, null, null); - writer.WriteProperty(options, PropSegments, value.Segments, null, null); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteProperty(options, PropSparseVector, value.SparseVector, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, null); - writer.WriteProperty(options, PropVersions, value.Versions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ClusterIndicesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ClusterIndicesConverter))] public sealed partial class ClusterIndices { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIndicesShards.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIndicesShards.Converters.g.cs new file mode 100644 index 00000000000..4b4d2fb5795 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIndicesShards.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ClusterIndicesShardsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropPrimaries = System.Text.Json.JsonEncodedText.Encode("primaries"); + private static readonly System.Text.Json.JsonEncodedText PropReplication = System.Text.Json.JsonEncodedText.Encode("replication"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Cluster.ClusterIndicesShards Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndex = default; + LocalJsonValue propPrimaries = default; + LocalJsonValue propReplication = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propPrimaries.TryReadProperty(ref reader, options, PropPrimaries, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propReplication.TryReadProperty(ref reader, options, PropReplication, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ClusterIndicesShards(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Index = propIndex.Value, + Primaries = propPrimaries.Value, + Replication = propReplication.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterIndicesShards value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropPrimaries, value.Primaries, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropReplication, value.Replication, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotal, value.Total, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIndicesShards.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIndicesShards.g.cs index 7ddd0ec3bde..82656e2ebe5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIndicesShards.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIndicesShards.g.cs @@ -23,78 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ClusterIndicesShardsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropPrimaries = System.Text.Json.JsonEncodedText.Encode("primaries"); - private static readonly System.Text.Json.JsonEncodedText PropReplication = System.Text.Json.JsonEncodedText.Encode("replication"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Cluster.ClusterIndicesShards Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndex = default; - LocalJsonValue propPrimaries = default; - LocalJsonValue propReplication = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propPrimaries.TryReadProperty(ref reader, options, PropPrimaries, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propReplication.TryReadProperty(ref reader, options, PropReplication, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ClusterIndicesShards(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Index = propIndex.Value, - Primaries = propPrimaries.Value, - Replication = propReplication.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterIndicesShards value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropPrimaries, value.Primaries, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropReplication, value.Replication, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotal, value.Total, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Contains statistics about shards assigned to selected nodes. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ClusterIndicesShardsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ClusterIndicesShardsConverter))] public sealed partial class ClusterIndicesShards { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIndicesShardsIndex.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIndicesShardsIndex.Converters.g.cs new file mode 100644 index 00000000000..e80d7326940 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIndicesShardsIndex.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ClusterIndicesShardsIndexConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPrimaries = System.Text.Json.JsonEncodedText.Encode("primaries"); + private static readonly System.Text.Json.JsonEncodedText PropReplication = System.Text.Json.JsonEncodedText.Encode("replication"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); + + public override Elastic.Clients.Elasticsearch.Cluster.ClusterIndicesShardsIndex Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPrimaries = default; + LocalJsonValue propReplication = default; + LocalJsonValue propShards = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPrimaries.TryReadProperty(ref reader, options, PropPrimaries, null)) + { + continue; + } + + if (propReplication.TryReadProperty(ref reader, options, PropReplication, null)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ClusterIndicesShardsIndex(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Primaries = propPrimaries.Value, + Replication = propReplication.Value, + Shards = propShards.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterIndicesShardsIndex value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPrimaries, value.Primaries, null, null); + writer.WriteProperty(options, PropReplication, value.Replication, null, null); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIndicesShardsIndex.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIndicesShardsIndex.g.cs index e81401e87d3..4c033920144 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIndicesShardsIndex.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIndicesShardsIndex.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ClusterIndicesShardsIndexConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPrimaries = System.Text.Json.JsonEncodedText.Encode("primaries"); - private static readonly System.Text.Json.JsonEncodedText PropReplication = System.Text.Json.JsonEncodedText.Encode("replication"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); - - public override Elastic.Clients.Elasticsearch.Cluster.ClusterIndicesShardsIndex Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPrimaries = default; - LocalJsonValue propReplication = default; - LocalJsonValue propShards = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPrimaries.TryReadProperty(ref reader, options, PropPrimaries, null)) - { - continue; - } - - if (propReplication.TryReadProperty(ref reader, options, PropReplication, null)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ClusterIndicesShardsIndex(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Primaries = propPrimaries.Value, - Replication = propReplication.Value, - Shards = propShards.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterIndicesShardsIndex value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPrimaries, value.Primaries, null, null); - writer.WriteProperty(options, PropReplication, value.Replication, null, null); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ClusterIndicesShardsIndexConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ClusterIndicesShardsIndexConverter))] public sealed partial class ClusterIndicesShardsIndex { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterInfo.Converters.g.cs new file mode 100644 index 00000000000..02c66bc0e5a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterInfo.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ClusterInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); + private static readonly System.Text.Json.JsonEncodedText PropReservedSizes = System.Text.Json.JsonEncodedText.Encode("reserved_sizes"); + private static readonly System.Text.Json.JsonEncodedText PropShardDataSetSizes = System.Text.Json.JsonEncodedText.Encode("shard_data_set_sizes"); + private static readonly System.Text.Json.JsonEncodedText PropShardPaths = System.Text.Json.JsonEncodedText.Encode("shard_paths"); + private static readonly System.Text.Json.JsonEncodedText PropShardSizes = System.Text.Json.JsonEncodedText.Encode("shard_sizes"); + + public override Elastic.Clients.Elasticsearch.Cluster.ClusterInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propNodes = default; + LocalJsonValue> propReservedSizes = default; + LocalJsonValue?> propShardDataSetSizes = default; + LocalJsonValue> propShardPaths = default; + LocalJsonValue> propShardSizes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propReservedSizes.TryReadProperty(ref reader, options, PropReservedSizes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propShardDataSetSizes.TryReadProperty(ref reader, options, PropShardDataSetSizes, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propShardPaths.TryReadProperty(ref reader, options, PropShardPaths, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propShardSizes.TryReadProperty(ref reader, options, PropShardSizes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ClusterInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Nodes = propNodes.Value, + ReservedSizes = propReservedSizes.Value, + ShardDataSetSizes = propShardDataSetSizes.Value, + ShardPaths = propShardPaths.Value, + ShardSizes = propShardSizes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropReservedSizes, value.ReservedSizes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropShardDataSetSizes, value.ShardDataSetSizes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropShardPaths, value.ShardPaths, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropShardSizes, value.ShardSizes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterInfo.g.cs index ba4b2a47b88..5600e5989ab 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterInfo.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ClusterInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); - private static readonly System.Text.Json.JsonEncodedText PropReservedSizes = System.Text.Json.JsonEncodedText.Encode("reserved_sizes"); - private static readonly System.Text.Json.JsonEncodedText PropShardDataSetSizes = System.Text.Json.JsonEncodedText.Encode("shard_data_set_sizes"); - private static readonly System.Text.Json.JsonEncodedText PropShardPaths = System.Text.Json.JsonEncodedText.Encode("shard_paths"); - private static readonly System.Text.Json.JsonEncodedText PropShardSizes = System.Text.Json.JsonEncodedText.Encode("shard_sizes"); - - public override Elastic.Clients.Elasticsearch.Cluster.ClusterInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propNodes = default; - LocalJsonValue> propReservedSizes = default; - LocalJsonValue?> propShardDataSetSizes = default; - LocalJsonValue> propShardPaths = default; - LocalJsonValue> propShardSizes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propReservedSizes.TryReadProperty(ref reader, options, PropReservedSizes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propShardDataSetSizes.TryReadProperty(ref reader, options, PropShardDataSetSizes, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propShardPaths.TryReadProperty(ref reader, options, PropShardPaths, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propShardSizes.TryReadProperty(ref reader, options, PropShardSizes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ClusterInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Nodes = propNodes.Value, - ReservedSizes = propReservedSizes.Value, - ShardDataSetSizes = propShardDataSetSizes.Value, - ShardPaths = propShardPaths.Value, - ShardSizes = propShardSizes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropReservedSizes, value.ReservedSizes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropShardDataSetSizes, value.ShardDataSetSizes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropShardPaths, value.ShardPaths, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropShardSizes, value.ShardSizes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ClusterInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ClusterInfoConverter))] public sealed partial class ClusterInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIngest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIngest.Converters.g.cs new file mode 100644 index 00000000000..54824005c55 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIngest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ClusterIngestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNumberOfPipelines = System.Text.Json.JsonEncodedText.Encode("number_of_pipelines"); + private static readonly System.Text.Json.JsonEncodedText PropProcessorStats = System.Text.Json.JsonEncodedText.Encode("processor_stats"); + + public override Elastic.Clients.Elasticsearch.Cluster.ClusterIngest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propNumberOfPipelines = default; + LocalJsonValue> propProcessorStats = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNumberOfPipelines.TryReadProperty(ref reader, options, PropNumberOfPipelines, null)) + { + continue; + } + + if (propProcessorStats.TryReadProperty(ref reader, options, PropProcessorStats, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ClusterIngest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + NumberOfPipelines = propNumberOfPipelines.Value, + ProcessorStats = propProcessorStats.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterIngest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNumberOfPipelines, value.NumberOfPipelines, null, null); + writer.WriteProperty(options, PropProcessorStats, value.ProcessorStats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIngest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIngest.g.cs index 0fe69b862b4..3f33efecbd1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIngest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterIngest.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ClusterIngestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNumberOfPipelines = System.Text.Json.JsonEncodedText.Encode("number_of_pipelines"); - private static readonly System.Text.Json.JsonEncodedText PropProcessorStats = System.Text.Json.JsonEncodedText.Encode("processor_stats"); - - public override Elastic.Clients.Elasticsearch.Cluster.ClusterIngest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propNumberOfPipelines = default; - LocalJsonValue> propProcessorStats = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNumberOfPipelines.TryReadProperty(ref reader, options, PropNumberOfPipelines, null)) - { - continue; - } - - if (propProcessorStats.TryReadProperty(ref reader, options, PropProcessorStats, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ClusterIngest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - NumberOfPipelines = propNumberOfPipelines.Value, - ProcessorStats = propProcessorStats.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterIngest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNumberOfPipelines, value.NumberOfPipelines, null, null); - writer.WriteProperty(options, PropProcessorStats, value.ProcessorStats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ClusterIngestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ClusterIngestConverter))] public sealed partial class ClusterIngest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterJvm.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterJvm.Converters.g.cs new file mode 100644 index 00000000000..b5c99c1a011 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterJvm.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ClusterJvmConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxUptime = System.Text.Json.JsonEncodedText.Encode("max_uptime"); + private static readonly System.Text.Json.JsonEncodedText PropMaxUptimeInMillis = System.Text.Json.JsonEncodedText.Encode("max_uptime_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropMem = System.Text.Json.JsonEncodedText.Encode("mem"); + private static readonly System.Text.Json.JsonEncodedText PropThreads = System.Text.Json.JsonEncodedText.Encode("threads"); + private static readonly System.Text.Json.JsonEncodedText PropVersions = System.Text.Json.JsonEncodedText.Encode("versions"); + + public override Elastic.Clients.Elasticsearch.Cluster.ClusterJvm Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxUptime = default; + LocalJsonValue propMaxUptimeInMillis = default; + LocalJsonValue propMem = default; + LocalJsonValue propThreads = default; + LocalJsonValue> propVersions = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxUptime.TryReadProperty(ref reader, options, PropMaxUptime, null)) + { + continue; + } + + if (propMaxUptimeInMillis.TryReadProperty(ref reader, options, PropMaxUptimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propMem.TryReadProperty(ref reader, options, PropMem, null)) + { + continue; + } + + if (propThreads.TryReadProperty(ref reader, options, PropThreads, null)) + { + continue; + } + + if (propVersions.TryReadProperty(ref reader, options, PropVersions, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ClusterJvm(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxUptime = propMaxUptime.Value, + MaxUptimeInMillis = propMaxUptimeInMillis.Value, + Mem = propMem.Value, + Threads = propThreads.Value, + Versions = propVersions.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterJvm value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxUptime, value.MaxUptime, null, null); + writer.WriteProperty(options, PropMaxUptimeInMillis, value.MaxUptimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropMem, value.Mem, null, null); + writer.WriteProperty(options, PropThreads, value.Threads, null, null); + writer.WriteProperty(options, PropVersions, value.Versions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterJvm.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterJvm.g.cs index 9c5ede79bd9..ce852e85145 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterJvm.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterJvm.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ClusterJvmConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxUptime = System.Text.Json.JsonEncodedText.Encode("max_uptime"); - private static readonly System.Text.Json.JsonEncodedText PropMaxUptimeInMillis = System.Text.Json.JsonEncodedText.Encode("max_uptime_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropMem = System.Text.Json.JsonEncodedText.Encode("mem"); - private static readonly System.Text.Json.JsonEncodedText PropThreads = System.Text.Json.JsonEncodedText.Encode("threads"); - private static readonly System.Text.Json.JsonEncodedText PropVersions = System.Text.Json.JsonEncodedText.Encode("versions"); - - public override Elastic.Clients.Elasticsearch.Cluster.ClusterJvm Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxUptime = default; - LocalJsonValue propMaxUptimeInMillis = default; - LocalJsonValue propMem = default; - LocalJsonValue propThreads = default; - LocalJsonValue> propVersions = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxUptime.TryReadProperty(ref reader, options, PropMaxUptime, null)) - { - continue; - } - - if (propMaxUptimeInMillis.TryReadProperty(ref reader, options, PropMaxUptimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propMem.TryReadProperty(ref reader, options, PropMem, null)) - { - continue; - } - - if (propThreads.TryReadProperty(ref reader, options, PropThreads, null)) - { - continue; - } - - if (propVersions.TryReadProperty(ref reader, options, PropVersions, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ClusterJvm(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxUptime = propMaxUptime.Value, - MaxUptimeInMillis = propMaxUptimeInMillis.Value, - Mem = propMem.Value, - Threads = propThreads.Value, - Versions = propVersions.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterJvm value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxUptime, value.MaxUptime, null, null); - writer.WriteProperty(options, PropMaxUptimeInMillis, value.MaxUptimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropMem, value.Mem, null, null); - writer.WriteProperty(options, PropThreads, value.Threads, null, null); - writer.WriteProperty(options, PropVersions, value.Versions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ClusterJvmConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ClusterJvmConverter))] public sealed partial class ClusterJvm { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterJvmMemory.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterJvmMemory.Converters.g.cs new file mode 100644 index 00000000000..6076f642fd2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterJvmMemory.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ClusterJvmMemoryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropHeapMax = System.Text.Json.JsonEncodedText.Encode("heap_max"); + private static readonly System.Text.Json.JsonEncodedText PropHeapMaxInBytes = System.Text.Json.JsonEncodedText.Encode("heap_max_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropHeapUsed = System.Text.Json.JsonEncodedText.Encode("heap_used"); + private static readonly System.Text.Json.JsonEncodedText PropHeapUsedInBytes = System.Text.Json.JsonEncodedText.Encode("heap_used_in_bytes"); + + public override Elastic.Clients.Elasticsearch.Cluster.ClusterJvmMemory Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propHeapMax = default; + LocalJsonValue propHeapMaxInBytes = default; + LocalJsonValue propHeapUsed = default; + LocalJsonValue propHeapUsedInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propHeapMax.TryReadProperty(ref reader, options, PropHeapMax, null)) + { + continue; + } + + if (propHeapMaxInBytes.TryReadProperty(ref reader, options, PropHeapMaxInBytes, null)) + { + continue; + } + + if (propHeapUsed.TryReadProperty(ref reader, options, PropHeapUsed, null)) + { + continue; + } + + if (propHeapUsedInBytes.TryReadProperty(ref reader, options, PropHeapUsedInBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ClusterJvmMemory(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + HeapMax = propHeapMax.Value, + HeapMaxInBytes = propHeapMaxInBytes.Value, + HeapUsed = propHeapUsed.Value, + HeapUsedInBytes = propHeapUsedInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterJvmMemory value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropHeapMax, value.HeapMax, null, null); + writer.WriteProperty(options, PropHeapMaxInBytes, value.HeapMaxInBytes, null, null); + writer.WriteProperty(options, PropHeapUsed, value.HeapUsed, null, null); + writer.WriteProperty(options, PropHeapUsedInBytes, value.HeapUsedInBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterJvmMemory.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterJvmMemory.g.cs index 63ec8b09cf5..63b2f04c702 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterJvmMemory.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterJvmMemory.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ClusterJvmMemoryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropHeapMax = System.Text.Json.JsonEncodedText.Encode("heap_max"); - private static readonly System.Text.Json.JsonEncodedText PropHeapMaxInBytes = System.Text.Json.JsonEncodedText.Encode("heap_max_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropHeapUsed = System.Text.Json.JsonEncodedText.Encode("heap_used"); - private static readonly System.Text.Json.JsonEncodedText PropHeapUsedInBytes = System.Text.Json.JsonEncodedText.Encode("heap_used_in_bytes"); - - public override Elastic.Clients.Elasticsearch.Cluster.ClusterJvmMemory Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propHeapMax = default; - LocalJsonValue propHeapMaxInBytes = default; - LocalJsonValue propHeapUsed = default; - LocalJsonValue propHeapUsedInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propHeapMax.TryReadProperty(ref reader, options, PropHeapMax, null)) - { - continue; - } - - if (propHeapMaxInBytes.TryReadProperty(ref reader, options, PropHeapMaxInBytes, null)) - { - continue; - } - - if (propHeapUsed.TryReadProperty(ref reader, options, PropHeapUsed, null)) - { - continue; - } - - if (propHeapUsedInBytes.TryReadProperty(ref reader, options, PropHeapUsedInBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ClusterJvmMemory(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - HeapMax = propHeapMax.Value, - HeapMaxInBytes = propHeapMaxInBytes.Value, - HeapUsed = propHeapUsed.Value, - HeapUsedInBytes = propHeapUsedInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterJvmMemory value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropHeapMax, value.HeapMax, null, null); - writer.WriteProperty(options, PropHeapMaxInBytes, value.HeapMaxInBytes, null, null); - writer.WriteProperty(options, PropHeapUsed, value.HeapUsed, null, null); - writer.WriteProperty(options, PropHeapUsedInBytes, value.HeapUsedInBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ClusterJvmMemoryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ClusterJvmMemoryConverter))] public sealed partial class ClusterJvmMemory { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterJvmVersion.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterJvmVersion.Converters.g.cs new file mode 100644 index 00000000000..93c55214d08 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterJvmVersion.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ClusterJvmVersionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBundledJdk = System.Text.Json.JsonEncodedText.Encode("bundled_jdk"); + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropUsingBundledJdk = System.Text.Json.JsonEncodedText.Encode("using_bundled_jdk"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + private static readonly System.Text.Json.JsonEncodedText PropVmName = System.Text.Json.JsonEncodedText.Encode("vm_name"); + private static readonly System.Text.Json.JsonEncodedText PropVmVendor = System.Text.Json.JsonEncodedText.Encode("vm_vendor"); + private static readonly System.Text.Json.JsonEncodedText PropVmVersion = System.Text.Json.JsonEncodedText.Encode("vm_version"); + + public override Elastic.Clients.Elasticsearch.Cluster.ClusterJvmVersion Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBundledJdk = default; + LocalJsonValue propCount = default; + LocalJsonValue propUsingBundledJdk = default; + LocalJsonValue propVersion = default; + LocalJsonValue propVmName = default; + LocalJsonValue propVmVendor = default; + LocalJsonValue propVmVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBundledJdk.TryReadProperty(ref reader, options, PropBundledJdk, null)) + { + continue; + } + + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propUsingBundledJdk.TryReadProperty(ref reader, options, PropUsingBundledJdk, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (propVmName.TryReadProperty(ref reader, options, PropVmName, null)) + { + continue; + } + + if (propVmVendor.TryReadProperty(ref reader, options, PropVmVendor, null)) + { + continue; + } + + if (propVmVersion.TryReadProperty(ref reader, options, PropVmVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ClusterJvmVersion(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BundledJdk = propBundledJdk.Value, + Count = propCount.Value, + UsingBundledJdk = propUsingBundledJdk.Value, + Version = propVersion.Value, + VmName = propVmName.Value, + VmVendor = propVmVendor.Value, + VmVersion = propVmVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterJvmVersion value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBundledJdk, value.BundledJdk, null, null); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropUsingBundledJdk, value.UsingBundledJdk, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteProperty(options, PropVmName, value.VmName, null, null); + writer.WriteProperty(options, PropVmVendor, value.VmVendor, null, null); + writer.WriteProperty(options, PropVmVersion, value.VmVersion, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterJvmVersion.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterJvmVersion.g.cs index acdcde51d9d..fcfd3bbe1f9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterJvmVersion.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterJvmVersion.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ClusterJvmVersionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBundledJdk = System.Text.Json.JsonEncodedText.Encode("bundled_jdk"); - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropUsingBundledJdk = System.Text.Json.JsonEncodedText.Encode("using_bundled_jdk"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - private static readonly System.Text.Json.JsonEncodedText PropVmName = System.Text.Json.JsonEncodedText.Encode("vm_name"); - private static readonly System.Text.Json.JsonEncodedText PropVmVendor = System.Text.Json.JsonEncodedText.Encode("vm_vendor"); - private static readonly System.Text.Json.JsonEncodedText PropVmVersion = System.Text.Json.JsonEncodedText.Encode("vm_version"); - - public override Elastic.Clients.Elasticsearch.Cluster.ClusterJvmVersion Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBundledJdk = default; - LocalJsonValue propCount = default; - LocalJsonValue propUsingBundledJdk = default; - LocalJsonValue propVersion = default; - LocalJsonValue propVmName = default; - LocalJsonValue propVmVendor = default; - LocalJsonValue propVmVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBundledJdk.TryReadProperty(ref reader, options, PropBundledJdk, null)) - { - continue; - } - - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propUsingBundledJdk.TryReadProperty(ref reader, options, PropUsingBundledJdk, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (propVmName.TryReadProperty(ref reader, options, PropVmName, null)) - { - continue; - } - - if (propVmVendor.TryReadProperty(ref reader, options, PropVmVendor, null)) - { - continue; - } - - if (propVmVersion.TryReadProperty(ref reader, options, PropVmVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ClusterJvmVersion(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BundledJdk = propBundledJdk.Value, - Count = propCount.Value, - UsingBundledJdk = propUsingBundledJdk.Value, - Version = propVersion.Value, - VmName = propVmName.Value, - VmVendor = propVmVendor.Value, - VmVersion = propVmVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterJvmVersion value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBundledJdk, value.BundledJdk, null, null); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropUsingBundledJdk, value.UsingBundledJdk, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteProperty(options, PropVmName, value.VmName, null, null); - writer.WriteProperty(options, PropVmVendor, value.VmVendor, null, null); - writer.WriteProperty(options, PropVmVersion, value.VmVersion, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ClusterJvmVersionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ClusterJvmVersionConverter))] public sealed partial class ClusterJvmVersion { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterNetworkTypes.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterNetworkTypes.Converters.g.cs new file mode 100644 index 00000000000..4c4dbdc8e79 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterNetworkTypes.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ClusterNetworkTypesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropHttpTypes = System.Text.Json.JsonEncodedText.Encode("http_types"); + private static readonly System.Text.Json.JsonEncodedText PropTransportTypes = System.Text.Json.JsonEncodedText.Encode("transport_types"); + + public override Elastic.Clients.Elasticsearch.Cluster.ClusterNetworkTypes Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propHttpTypes = default; + LocalJsonValue> propTransportTypes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propHttpTypes.TryReadProperty(ref reader, options, PropHttpTypes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propTransportTypes.TryReadProperty(ref reader, options, PropTransportTypes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ClusterNetworkTypes(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + HttpTypes = propHttpTypes.Value, + TransportTypes = propTransportTypes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterNetworkTypes value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropHttpTypes, value.HttpTypes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropTransportTypes, value.TransportTypes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterNetworkTypes.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterNetworkTypes.g.cs index ed526ef57ac..590541fa516 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterNetworkTypes.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterNetworkTypes.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ClusterNetworkTypesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropHttpTypes = System.Text.Json.JsonEncodedText.Encode("http_types"); - private static readonly System.Text.Json.JsonEncodedText PropTransportTypes = System.Text.Json.JsonEncodedText.Encode("transport_types"); - - public override Elastic.Clients.Elasticsearch.Cluster.ClusterNetworkTypes Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propHttpTypes = default; - LocalJsonValue> propTransportTypes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propHttpTypes.TryReadProperty(ref reader, options, PropHttpTypes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propTransportTypes.TryReadProperty(ref reader, options, PropTransportTypes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ClusterNetworkTypes(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - HttpTypes = propHttpTypes.Value, - TransportTypes = propTransportTypes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterNetworkTypes value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropHttpTypes, value.HttpTypes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropTransportTypes, value.TransportTypes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ClusterNetworkTypesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ClusterNetworkTypesConverter))] public sealed partial class ClusterNetworkTypes { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterNodeCount.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterNodeCount.Converters.g.cs new file mode 100644 index 00000000000..4dcece37ba2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterNodeCount.Converters.g.cs @@ -0,0 +1,198 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ClusterNodeCountConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCoordinatingOnly = System.Text.Json.JsonEncodedText.Encode("coordinating_only"); + private static readonly System.Text.Json.JsonEncodedText PropData = System.Text.Json.JsonEncodedText.Encode("data"); + private static readonly System.Text.Json.JsonEncodedText PropDataCold = System.Text.Json.JsonEncodedText.Encode("data_cold"); + private static readonly System.Text.Json.JsonEncodedText PropDataContent = System.Text.Json.JsonEncodedText.Encode("data_content"); + private static readonly System.Text.Json.JsonEncodedText PropDataFrozen = System.Text.Json.JsonEncodedText.Encode("data_frozen"); + private static readonly System.Text.Json.JsonEncodedText PropDataHot = System.Text.Json.JsonEncodedText.Encode("data_hot"); + private static readonly System.Text.Json.JsonEncodedText PropDataWarm = System.Text.Json.JsonEncodedText.Encode("data_warm"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropIngest = System.Text.Json.JsonEncodedText.Encode("ingest"); + private static readonly System.Text.Json.JsonEncodedText PropMaster = System.Text.Json.JsonEncodedText.Encode("master"); + private static readonly System.Text.Json.JsonEncodedText PropMl = System.Text.Json.JsonEncodedText.Encode("ml"); + private static readonly System.Text.Json.JsonEncodedText PropRemoteClusterClient = System.Text.Json.JsonEncodedText.Encode("remote_cluster_client"); + private static readonly System.Text.Json.JsonEncodedText PropSearch = System.Text.Json.JsonEncodedText.Encode("search"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + private static readonly System.Text.Json.JsonEncodedText PropTransform = System.Text.Json.JsonEncodedText.Encode("transform"); + private static readonly System.Text.Json.JsonEncodedText PropVotingOnly = System.Text.Json.JsonEncodedText.Encode("voting_only"); + + public override Elastic.Clients.Elasticsearch.Cluster.ClusterNodeCount Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCoordinatingOnly = default; + LocalJsonValue propData = default; + LocalJsonValue propDataCold = default; + LocalJsonValue propDataContent = default; + LocalJsonValue propDataFrozen = default; + LocalJsonValue propDataHot = default; + LocalJsonValue propDataWarm = default; + LocalJsonValue propIndex = default; + LocalJsonValue propIngest = default; + LocalJsonValue propMaster = default; + LocalJsonValue propMl = default; + LocalJsonValue propRemoteClusterClient = default; + LocalJsonValue propSearch = default; + LocalJsonValue propTotal = default; + LocalJsonValue propTransform = default; + LocalJsonValue propVotingOnly = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCoordinatingOnly.TryReadProperty(ref reader, options, PropCoordinatingOnly, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propData.TryReadProperty(ref reader, options, PropData, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDataCold.TryReadProperty(ref reader, options, PropDataCold, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDataContent.TryReadProperty(ref reader, options, PropDataContent, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDataFrozen.TryReadProperty(ref reader, options, PropDataFrozen, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDataHot.TryReadProperty(ref reader, options, PropDataHot, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDataWarm.TryReadProperty(ref reader, options, PropDataWarm, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIngest.TryReadProperty(ref reader, options, PropIngest, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaster.TryReadProperty(ref reader, options, PropMaster, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMl.TryReadProperty(ref reader, options, PropMl, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRemoteClusterClient.TryReadProperty(ref reader, options, PropRemoteClusterClient, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSearch.TryReadProperty(ref reader, options, PropSearch, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (propTransform.TryReadProperty(ref reader, options, PropTransform, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propVotingOnly.TryReadProperty(ref reader, options, PropVotingOnly, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ClusterNodeCount(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CoordinatingOnly = propCoordinatingOnly.Value, + Data = propData.Value, + DataCold = propDataCold.Value, + DataContent = propDataContent.Value, + DataFrozen = propDataFrozen.Value, + DataHot = propDataHot.Value, + DataWarm = propDataWarm.Value, + Index = propIndex.Value, + Ingest = propIngest.Value, + Master = propMaster.Value, + Ml = propMl.Value, + RemoteClusterClient = propRemoteClusterClient.Value, + Search = propSearch.Value, + Total = propTotal.Value, + Transform = propTransform.Value, + VotingOnly = propVotingOnly.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterNodeCount value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCoordinatingOnly, value.CoordinatingOnly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropData, value.Data, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDataCold, value.DataCold, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDataContent, value.DataContent, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDataFrozen, value.DataFrozen, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDataHot, value.DataHot, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDataWarm, value.DataWarm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIngest, value.Ingest, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaster, value.Master, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMl, value.Ml, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRemoteClusterClient, value.RemoteClusterClient, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSearch, value.Search, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteProperty(options, PropTransform, value.Transform, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVotingOnly, value.VotingOnly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterNodeCount.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterNodeCount.g.cs index 0e6c7d9b777..f2896748f39 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterNodeCount.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterNodeCount.g.cs @@ -23,181 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ClusterNodeCountConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCoordinatingOnly = System.Text.Json.JsonEncodedText.Encode("coordinating_only"); - private static readonly System.Text.Json.JsonEncodedText PropData = System.Text.Json.JsonEncodedText.Encode("data"); - private static readonly System.Text.Json.JsonEncodedText PropDataCold = System.Text.Json.JsonEncodedText.Encode("data_cold"); - private static readonly System.Text.Json.JsonEncodedText PropDataContent = System.Text.Json.JsonEncodedText.Encode("data_content"); - private static readonly System.Text.Json.JsonEncodedText PropDataFrozen = System.Text.Json.JsonEncodedText.Encode("data_frozen"); - private static readonly System.Text.Json.JsonEncodedText PropDataHot = System.Text.Json.JsonEncodedText.Encode("data_hot"); - private static readonly System.Text.Json.JsonEncodedText PropDataWarm = System.Text.Json.JsonEncodedText.Encode("data_warm"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropIngest = System.Text.Json.JsonEncodedText.Encode("ingest"); - private static readonly System.Text.Json.JsonEncodedText PropMaster = System.Text.Json.JsonEncodedText.Encode("master"); - private static readonly System.Text.Json.JsonEncodedText PropMl = System.Text.Json.JsonEncodedText.Encode("ml"); - private static readonly System.Text.Json.JsonEncodedText PropRemoteClusterClient = System.Text.Json.JsonEncodedText.Encode("remote_cluster_client"); - private static readonly System.Text.Json.JsonEncodedText PropSearch = System.Text.Json.JsonEncodedText.Encode("search"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - private static readonly System.Text.Json.JsonEncodedText PropTransform = System.Text.Json.JsonEncodedText.Encode("transform"); - private static readonly System.Text.Json.JsonEncodedText PropVotingOnly = System.Text.Json.JsonEncodedText.Encode("voting_only"); - - public override Elastic.Clients.Elasticsearch.Cluster.ClusterNodeCount Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCoordinatingOnly = default; - LocalJsonValue propData = default; - LocalJsonValue propDataCold = default; - LocalJsonValue propDataContent = default; - LocalJsonValue propDataFrozen = default; - LocalJsonValue propDataHot = default; - LocalJsonValue propDataWarm = default; - LocalJsonValue propIndex = default; - LocalJsonValue propIngest = default; - LocalJsonValue propMaster = default; - LocalJsonValue propMl = default; - LocalJsonValue propRemoteClusterClient = default; - LocalJsonValue propSearch = default; - LocalJsonValue propTotal = default; - LocalJsonValue propTransform = default; - LocalJsonValue propVotingOnly = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCoordinatingOnly.TryReadProperty(ref reader, options, PropCoordinatingOnly, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propData.TryReadProperty(ref reader, options, PropData, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDataCold.TryReadProperty(ref reader, options, PropDataCold, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDataContent.TryReadProperty(ref reader, options, PropDataContent, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDataFrozen.TryReadProperty(ref reader, options, PropDataFrozen, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDataHot.TryReadProperty(ref reader, options, PropDataHot, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDataWarm.TryReadProperty(ref reader, options, PropDataWarm, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIngest.TryReadProperty(ref reader, options, PropIngest, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaster.TryReadProperty(ref reader, options, PropMaster, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMl.TryReadProperty(ref reader, options, PropMl, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRemoteClusterClient.TryReadProperty(ref reader, options, PropRemoteClusterClient, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSearch.TryReadProperty(ref reader, options, PropSearch, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (propTransform.TryReadProperty(ref reader, options, PropTransform, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propVotingOnly.TryReadProperty(ref reader, options, PropVotingOnly, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ClusterNodeCount(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CoordinatingOnly = propCoordinatingOnly.Value, - Data = propData.Value, - DataCold = propDataCold.Value, - DataContent = propDataContent.Value, - DataFrozen = propDataFrozen.Value, - DataHot = propDataHot.Value, - DataWarm = propDataWarm.Value, - Index = propIndex.Value, - Ingest = propIngest.Value, - Master = propMaster.Value, - Ml = propMl.Value, - RemoteClusterClient = propRemoteClusterClient.Value, - Search = propSearch.Value, - Total = propTotal.Value, - Transform = propTransform.Value, - VotingOnly = propVotingOnly.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterNodeCount value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCoordinatingOnly, value.CoordinatingOnly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropData, value.Data, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDataCold, value.DataCold, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDataContent, value.DataContent, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDataFrozen, value.DataFrozen, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDataHot, value.DataHot, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDataWarm, value.DataWarm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIngest, value.Ingest, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaster, value.Master, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMl, value.Ml, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRemoteClusterClient, value.RemoteClusterClient, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSearch, value.Search, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteProperty(options, PropTransform, value.Transform, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropVotingOnly, value.VotingOnly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ClusterNodeCountConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ClusterNodeCountConverter))] public sealed partial class ClusterNodeCount { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterNodes.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterNodes.Converters.g.cs new file mode 100644 index 00000000000..4464f5d006a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterNodes.Converters.g.cs @@ -0,0 +1,162 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ClusterNodesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropDiscoveryTypes = System.Text.Json.JsonEncodedText.Encode("discovery_types"); + private static readonly System.Text.Json.JsonEncodedText PropFs = System.Text.Json.JsonEncodedText.Encode("fs"); + private static readonly System.Text.Json.JsonEncodedText PropIndexingPressure = System.Text.Json.JsonEncodedText.Encode("indexing_pressure"); + private static readonly System.Text.Json.JsonEncodedText PropIngest = System.Text.Json.JsonEncodedText.Encode("ingest"); + private static readonly System.Text.Json.JsonEncodedText PropJvm = System.Text.Json.JsonEncodedText.Encode("jvm"); + private static readonly System.Text.Json.JsonEncodedText PropNetworkTypes = System.Text.Json.JsonEncodedText.Encode("network_types"); + private static readonly System.Text.Json.JsonEncodedText PropOs = System.Text.Json.JsonEncodedText.Encode("os"); + private static readonly System.Text.Json.JsonEncodedText PropPackagingTypes = System.Text.Json.JsonEncodedText.Encode("packaging_types"); + private static readonly System.Text.Json.JsonEncodedText PropPlugins = System.Text.Json.JsonEncodedText.Encode("plugins"); + private static readonly System.Text.Json.JsonEncodedText PropProcess = System.Text.Json.JsonEncodedText.Encode("process"); + private static readonly System.Text.Json.JsonEncodedText PropVersions = System.Text.Json.JsonEncodedText.Encode("versions"); + + public override Elastic.Clients.Elasticsearch.Cluster.ClusterNodes Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propDiscoveryTypes = default; + LocalJsonValue propFs = default; + LocalJsonValue propIndexingPressure = default; + LocalJsonValue propIngest = default; + LocalJsonValue propJvm = default; + LocalJsonValue propNetworkTypes = default; + LocalJsonValue propOs = default; + LocalJsonValue> propPackagingTypes = default; + LocalJsonValue> propPlugins = default; + LocalJsonValue propProcess = default; + LocalJsonValue> propVersions = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propDiscoveryTypes.TryReadProperty(ref reader, options, PropDiscoveryTypes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propFs.TryReadProperty(ref reader, options, PropFs, null)) + { + continue; + } + + if (propIndexingPressure.TryReadProperty(ref reader, options, PropIndexingPressure, null)) + { + continue; + } + + if (propIngest.TryReadProperty(ref reader, options, PropIngest, null)) + { + continue; + } + + if (propJvm.TryReadProperty(ref reader, options, PropJvm, null)) + { + continue; + } + + if (propNetworkTypes.TryReadProperty(ref reader, options, PropNetworkTypes, null)) + { + continue; + } + + if (propOs.TryReadProperty(ref reader, options, PropOs, null)) + { + continue; + } + + if (propPackagingTypes.TryReadProperty(ref reader, options, PropPackagingTypes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propPlugins.TryReadProperty(ref reader, options, PropPlugins, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propProcess.TryReadProperty(ref reader, options, PropProcess, null)) + { + continue; + } + + if (propVersions.TryReadProperty(ref reader, options, PropVersions, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ClusterNodes(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + DiscoveryTypes = propDiscoveryTypes.Value, + Fs = propFs.Value, + IndexingPressure = propIndexingPressure.Value, + Ingest = propIngest.Value, + Jvm = propJvm.Value, + NetworkTypes = propNetworkTypes.Value, + Os = propOs.Value, + PackagingTypes = propPackagingTypes.Value, + Plugins = propPlugins.Value, + Process = propProcess.Value, + Versions = propVersions.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterNodes value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropDiscoveryTypes, value.DiscoveryTypes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropFs, value.Fs, null, null); + writer.WriteProperty(options, PropIndexingPressure, value.IndexingPressure, null, null); + writer.WriteProperty(options, PropIngest, value.Ingest, null, null); + writer.WriteProperty(options, PropJvm, value.Jvm, null, null); + writer.WriteProperty(options, PropNetworkTypes, value.NetworkTypes, null, null); + writer.WriteProperty(options, PropOs, value.Os, null, null); + writer.WriteProperty(options, PropPackagingTypes, value.PackagingTypes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPlugins, value.Plugins, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropProcess, value.Process, null, null); + writer.WriteProperty(options, PropVersions, value.Versions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterNodes.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterNodes.g.cs index 23a89dd4cda..12b4696cb9f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterNodes.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterNodes.g.cs @@ -23,145 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ClusterNodesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropDiscoveryTypes = System.Text.Json.JsonEncodedText.Encode("discovery_types"); - private static readonly System.Text.Json.JsonEncodedText PropFs = System.Text.Json.JsonEncodedText.Encode("fs"); - private static readonly System.Text.Json.JsonEncodedText PropIndexingPressure = System.Text.Json.JsonEncodedText.Encode("indexing_pressure"); - private static readonly System.Text.Json.JsonEncodedText PropIngest = System.Text.Json.JsonEncodedText.Encode("ingest"); - private static readonly System.Text.Json.JsonEncodedText PropJvm = System.Text.Json.JsonEncodedText.Encode("jvm"); - private static readonly System.Text.Json.JsonEncodedText PropNetworkTypes = System.Text.Json.JsonEncodedText.Encode("network_types"); - private static readonly System.Text.Json.JsonEncodedText PropOs = System.Text.Json.JsonEncodedText.Encode("os"); - private static readonly System.Text.Json.JsonEncodedText PropPackagingTypes = System.Text.Json.JsonEncodedText.Encode("packaging_types"); - private static readonly System.Text.Json.JsonEncodedText PropPlugins = System.Text.Json.JsonEncodedText.Encode("plugins"); - private static readonly System.Text.Json.JsonEncodedText PropProcess = System.Text.Json.JsonEncodedText.Encode("process"); - private static readonly System.Text.Json.JsonEncodedText PropVersions = System.Text.Json.JsonEncodedText.Encode("versions"); - - public override Elastic.Clients.Elasticsearch.Cluster.ClusterNodes Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propDiscoveryTypes = default; - LocalJsonValue propFs = default; - LocalJsonValue propIndexingPressure = default; - LocalJsonValue propIngest = default; - LocalJsonValue propJvm = default; - LocalJsonValue propNetworkTypes = default; - LocalJsonValue propOs = default; - LocalJsonValue> propPackagingTypes = default; - LocalJsonValue> propPlugins = default; - LocalJsonValue propProcess = default; - LocalJsonValue> propVersions = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propDiscoveryTypes.TryReadProperty(ref reader, options, PropDiscoveryTypes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propFs.TryReadProperty(ref reader, options, PropFs, null)) - { - continue; - } - - if (propIndexingPressure.TryReadProperty(ref reader, options, PropIndexingPressure, null)) - { - continue; - } - - if (propIngest.TryReadProperty(ref reader, options, PropIngest, null)) - { - continue; - } - - if (propJvm.TryReadProperty(ref reader, options, PropJvm, null)) - { - continue; - } - - if (propNetworkTypes.TryReadProperty(ref reader, options, PropNetworkTypes, null)) - { - continue; - } - - if (propOs.TryReadProperty(ref reader, options, PropOs, null)) - { - continue; - } - - if (propPackagingTypes.TryReadProperty(ref reader, options, PropPackagingTypes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propPlugins.TryReadProperty(ref reader, options, PropPlugins, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propProcess.TryReadProperty(ref reader, options, PropProcess, null)) - { - continue; - } - - if (propVersions.TryReadProperty(ref reader, options, PropVersions, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ClusterNodes(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - DiscoveryTypes = propDiscoveryTypes.Value, - Fs = propFs.Value, - IndexingPressure = propIndexingPressure.Value, - Ingest = propIngest.Value, - Jvm = propJvm.Value, - NetworkTypes = propNetworkTypes.Value, - Os = propOs.Value, - PackagingTypes = propPackagingTypes.Value, - Plugins = propPlugins.Value, - Process = propProcess.Value, - Versions = propVersions.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterNodes value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropDiscoveryTypes, value.DiscoveryTypes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropFs, value.Fs, null, null); - writer.WriteProperty(options, PropIndexingPressure, value.IndexingPressure, null, null); - writer.WriteProperty(options, PropIngest, value.Ingest, null, null); - writer.WriteProperty(options, PropJvm, value.Jvm, null, null); - writer.WriteProperty(options, PropNetworkTypes, value.NetworkTypes, null, null); - writer.WriteProperty(options, PropOs, value.Os, null, null); - writer.WriteProperty(options, PropPackagingTypes, value.PackagingTypes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPlugins, value.Plugins, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropProcess, value.Process, null, null); - writer.WriteProperty(options, PropVersions, value.Versions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ClusterNodesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ClusterNodesConverter))] public sealed partial class ClusterNodes { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystem.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystem.Converters.g.cs new file mode 100644 index 00000000000..fce2738ead4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystem.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ClusterOperatingSystemConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllocatedProcessors = System.Text.Json.JsonEncodedText.Encode("allocated_processors"); + private static readonly System.Text.Json.JsonEncodedText PropArchitectures = System.Text.Json.JsonEncodedText.Encode("architectures"); + private static readonly System.Text.Json.JsonEncodedText PropAvailableProcessors = System.Text.Json.JsonEncodedText.Encode("available_processors"); + private static readonly System.Text.Json.JsonEncodedText PropMem = System.Text.Json.JsonEncodedText.Encode("mem"); + private static readonly System.Text.Json.JsonEncodedText PropNames = System.Text.Json.JsonEncodedText.Encode("names"); + private static readonly System.Text.Json.JsonEncodedText PropPrettyNames = System.Text.Json.JsonEncodedText.Encode("pretty_names"); + + public override Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllocatedProcessors = default; + LocalJsonValue?> propArchitectures = default; + LocalJsonValue propAvailableProcessors = default; + LocalJsonValue propMem = default; + LocalJsonValue> propNames = default; + LocalJsonValue> propPrettyNames = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllocatedProcessors.TryReadProperty(ref reader, options, PropAllocatedProcessors, null)) + { + continue; + } + + if (propArchitectures.TryReadProperty(ref reader, options, PropArchitectures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propAvailableProcessors.TryReadProperty(ref reader, options, PropAvailableProcessors, null)) + { + continue; + } + + if (propMem.TryReadProperty(ref reader, options, PropMem, null)) + { + continue; + } + + if (propNames.TryReadProperty(ref reader, options, PropNames, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propPrettyNames.TryReadProperty(ref reader, options, PropPrettyNames, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllocatedProcessors = propAllocatedProcessors.Value, + Architectures = propArchitectures.Value, + AvailableProcessors = propAvailableProcessors.Value, + Mem = propMem.Value, + Names = propNames.Value, + PrettyNames = propPrettyNames.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystem value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllocatedProcessors, value.AllocatedProcessors, null, null); + writer.WriteProperty(options, PropArchitectures, value.Architectures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropAvailableProcessors, value.AvailableProcessors, null, null); + writer.WriteProperty(options, PropMem, value.Mem, null, null); + writer.WriteProperty(options, PropNames, value.Names, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPrettyNames, value.PrettyNames, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystem.g.cs index 11f1d39d9ce..5b5396b2ed7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystem.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ClusterOperatingSystemConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllocatedProcessors = System.Text.Json.JsonEncodedText.Encode("allocated_processors"); - private static readonly System.Text.Json.JsonEncodedText PropArchitectures = System.Text.Json.JsonEncodedText.Encode("architectures"); - private static readonly System.Text.Json.JsonEncodedText PropAvailableProcessors = System.Text.Json.JsonEncodedText.Encode("available_processors"); - private static readonly System.Text.Json.JsonEncodedText PropMem = System.Text.Json.JsonEncodedText.Encode("mem"); - private static readonly System.Text.Json.JsonEncodedText PropNames = System.Text.Json.JsonEncodedText.Encode("names"); - private static readonly System.Text.Json.JsonEncodedText PropPrettyNames = System.Text.Json.JsonEncodedText.Encode("pretty_names"); - - public override Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllocatedProcessors = default; - LocalJsonValue?> propArchitectures = default; - LocalJsonValue propAvailableProcessors = default; - LocalJsonValue propMem = default; - LocalJsonValue> propNames = default; - LocalJsonValue> propPrettyNames = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllocatedProcessors.TryReadProperty(ref reader, options, PropAllocatedProcessors, null)) - { - continue; - } - - if (propArchitectures.TryReadProperty(ref reader, options, PropArchitectures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propAvailableProcessors.TryReadProperty(ref reader, options, PropAvailableProcessors, null)) - { - continue; - } - - if (propMem.TryReadProperty(ref reader, options, PropMem, null)) - { - continue; - } - - if (propNames.TryReadProperty(ref reader, options, PropNames, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propPrettyNames.TryReadProperty(ref reader, options, PropPrettyNames, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllocatedProcessors = propAllocatedProcessors.Value, - Architectures = propArchitectures.Value, - AvailableProcessors = propAvailableProcessors.Value, - Mem = propMem.Value, - Names = propNames.Value, - PrettyNames = propPrettyNames.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystem value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllocatedProcessors, value.AllocatedProcessors, null, null); - writer.WriteProperty(options, PropArchitectures, value.Architectures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropAvailableProcessors, value.AvailableProcessors, null, null); - writer.WriteProperty(options, PropMem, value.Mem, null, null); - writer.WriteProperty(options, PropNames, value.Names, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPrettyNames, value.PrettyNames, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystemConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ClusterOperatingSystemConverter))] public sealed partial class ClusterOperatingSystem { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystemArchitecture.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystemArchitecture.Converters.g.cs new file mode 100644 index 00000000000..46ae4cd466c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystemArchitecture.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ClusterOperatingSystemArchitectureConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropArch = System.Text.Json.JsonEncodedText.Encode("arch"); + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + + public override Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystemArchitecture Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propArch = default; + LocalJsonValue propCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propArch.TryReadProperty(ref reader, options, PropArch, null)) + { + continue; + } + + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystemArchitecture(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Arch = propArch.Value, + Count = propCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystemArchitecture value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropArch, value.Arch, null, null); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystemArchitecture.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystemArchitecture.g.cs index 6039f5f179a..3cd10efa898 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystemArchitecture.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystemArchitecture.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ClusterOperatingSystemArchitectureConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropArch = System.Text.Json.JsonEncodedText.Encode("arch"); - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - - public override Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystemArchitecture Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propArch = default; - LocalJsonValue propCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propArch.TryReadProperty(ref reader, options, PropArch, null)) - { - continue; - } - - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystemArchitecture(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Arch = propArch.Value, - Count = propCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystemArchitecture value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropArch, value.Arch, null, null); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystemArchitectureConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ClusterOperatingSystemArchitectureConverter))] public sealed partial class ClusterOperatingSystemArchitecture { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystemName.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystemName.Converters.g.cs new file mode 100644 index 00000000000..142e3deda4f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystemName.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ClusterOperatingSystemNameConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystemName Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystemName(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystemName value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystemName.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystemName.g.cs index 18e0f12c490..cd8db5b6b28 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystemName.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystemName.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ClusterOperatingSystemNameConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystemName Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystemName(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystemName value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystemNameConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ClusterOperatingSystemNameConverter))] public sealed partial class ClusterOperatingSystemName { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystemPrettyName.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystemPrettyName.Converters.g.cs new file mode 100644 index 00000000000..47b7698a4ce --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystemPrettyName.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ClusterOperatingSystemPrettyNameConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropPrettyName = System.Text.Json.JsonEncodedText.Encode("pretty_name"); + + public override Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystemPrettyName Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propPrettyName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propPrettyName.TryReadProperty(ref reader, options, PropPrettyName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystemPrettyName(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + PrettyName = propPrettyName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystemPrettyName value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropPrettyName, value.PrettyName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystemPrettyName.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystemPrettyName.g.cs index c64772c0b9f..2bd2f8a19d8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystemPrettyName.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterOperatingSystemPrettyName.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ClusterOperatingSystemPrettyNameConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropPrettyName = System.Text.Json.JsonEncodedText.Encode("pretty_name"); - - public override Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystemPrettyName Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propPrettyName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propPrettyName.TryReadProperty(ref reader, options, PropPrettyName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystemPrettyName(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - PrettyName = propPrettyName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystemPrettyName value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropPrettyName, value.PrettyName, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ClusterOperatingSystemPrettyNameConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ClusterOperatingSystemPrettyNameConverter))] public sealed partial class ClusterOperatingSystemPrettyName { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcess.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcess.Converters.g.cs new file mode 100644 index 00000000000..1e5ec324b48 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcess.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ClusterProcessConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCpu = System.Text.Json.JsonEncodedText.Encode("cpu"); + private static readonly System.Text.Json.JsonEncodedText PropOpenFileDescriptors = System.Text.Json.JsonEncodedText.Encode("open_file_descriptors"); + + public override Elastic.Clients.Elasticsearch.Cluster.ClusterProcess Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCpu = default; + LocalJsonValue propOpenFileDescriptors = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCpu.TryReadProperty(ref reader, options, PropCpu, null)) + { + continue; + } + + if (propOpenFileDescriptors.TryReadProperty(ref reader, options, PropOpenFileDescriptors, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ClusterProcess(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Cpu = propCpu.Value, + OpenFileDescriptors = propOpenFileDescriptors.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterProcess value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCpu, value.Cpu, null, null); + writer.WriteProperty(options, PropOpenFileDescriptors, value.OpenFileDescriptors, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcess.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcess.g.cs index 6face07cf0c..da1e9ec6358 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcess.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcess.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ClusterProcessConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCpu = System.Text.Json.JsonEncodedText.Encode("cpu"); - private static readonly System.Text.Json.JsonEncodedText PropOpenFileDescriptors = System.Text.Json.JsonEncodedText.Encode("open_file_descriptors"); - - public override Elastic.Clients.Elasticsearch.Cluster.ClusterProcess Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCpu = default; - LocalJsonValue propOpenFileDescriptors = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCpu.TryReadProperty(ref reader, options, PropCpu, null)) - { - continue; - } - - if (propOpenFileDescriptors.TryReadProperty(ref reader, options, PropOpenFileDescriptors, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ClusterProcess(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Cpu = propCpu.Value, - OpenFileDescriptors = propOpenFileDescriptors.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterProcess value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCpu, value.Cpu, null, null); - writer.WriteProperty(options, PropOpenFileDescriptors, value.OpenFileDescriptors, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ClusterProcessConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ClusterProcessConverter))] public sealed partial class ClusterProcess { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcessCpu.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcessCpu.Converters.g.cs new file mode 100644 index 00000000000..b8f4df385fc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcessCpu.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ClusterProcessCpuConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPercent = System.Text.Json.JsonEncodedText.Encode("percent"); + + public override Elastic.Clients.Elasticsearch.Cluster.ClusterProcessCpu Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPercent = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPercent.TryReadProperty(ref reader, options, PropPercent, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ClusterProcessCpu(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Percent = propPercent.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterProcessCpu value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPercent, value.Percent, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcessCpu.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcessCpu.g.cs index b7daa478778..d0f6d8ede9a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcessCpu.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcessCpu.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ClusterProcessCpuConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPercent = System.Text.Json.JsonEncodedText.Encode("percent"); - - public override Elastic.Clients.Elasticsearch.Cluster.ClusterProcessCpu Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPercent = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPercent.TryReadProperty(ref reader, options, PropPercent, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ClusterProcessCpu(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Percent = propPercent.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterProcessCpu value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPercent, value.Percent, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ClusterProcessCpuConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ClusterProcessCpuConverter))] public sealed partial class ClusterProcessCpu { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcessOpenFileDescriptors.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcessOpenFileDescriptors.Converters.g.cs new file mode 100644 index 00000000000..3f466b215b0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcessOpenFileDescriptors.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ClusterProcessOpenFileDescriptorsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvg = System.Text.Json.JsonEncodedText.Encode("avg"); + private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); + + public override Elastic.Clients.Elasticsearch.Cluster.ClusterProcessOpenFileDescriptors Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvg = default; + LocalJsonValue propMax = default; + LocalJsonValue propMin = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvg.TryReadProperty(ref reader, options, PropAvg, null)) + { + continue; + } + + if (propMax.TryReadProperty(ref reader, options, PropMax, null)) + { + continue; + } + + if (propMin.TryReadProperty(ref reader, options, PropMin, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ClusterProcessOpenFileDescriptors(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Avg = propAvg.Value, + Max = propMax.Value, + Min = propMin.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterProcessOpenFileDescriptors value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvg, value.Avg, null, null); + writer.WriteProperty(options, PropMax, value.Max, null, null); + writer.WriteProperty(options, PropMin, value.Min, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcessOpenFileDescriptors.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcessOpenFileDescriptors.g.cs index 4cde99e09eb..c334cc662b2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcessOpenFileDescriptors.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcessOpenFileDescriptors.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ClusterProcessOpenFileDescriptorsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvg = System.Text.Json.JsonEncodedText.Encode("avg"); - private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); - private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); - - public override Elastic.Clients.Elasticsearch.Cluster.ClusterProcessOpenFileDescriptors Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvg = default; - LocalJsonValue propMax = default; - LocalJsonValue propMin = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvg.TryReadProperty(ref reader, options, PropAvg, null)) - { - continue; - } - - if (propMax.TryReadProperty(ref reader, options, PropMax, null)) - { - continue; - } - - if (propMin.TryReadProperty(ref reader, options, PropMin, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ClusterProcessOpenFileDescriptors(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Avg = propAvg.Value, - Max = propMax.Value, - Min = propMin.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterProcessOpenFileDescriptors value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvg, value.Avg, null, null); - writer.WriteProperty(options, PropMax, value.Max, null, null); - writer.WriteProperty(options, PropMin, value.Min, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ClusterProcessOpenFileDescriptorsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ClusterProcessOpenFileDescriptorsConverter))] public sealed partial class ClusterProcessOpenFileDescriptors { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcessor.Converters.g.cs new file mode 100644 index 00000000000..7a1b010908c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcessor.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ClusterProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropCurrent = System.Text.Json.JsonEncodedText.Encode("current"); + private static readonly System.Text.Json.JsonEncodedText PropFailed = System.Text.Json.JsonEncodedText.Encode("failed"); + private static readonly System.Text.Json.JsonEncodedText PropTime = System.Text.Json.JsonEncodedText.Encode("time"); + private static readonly System.Text.Json.JsonEncodedText PropTimeInMillis = System.Text.Json.JsonEncodedText.Encode("time_in_millis"); + + public override Elastic.Clients.Elasticsearch.Cluster.ClusterProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propCurrent = default; + LocalJsonValue propFailed = default; + LocalJsonValue propTime = default; + LocalJsonValue propTimeInMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propCurrent.TryReadProperty(ref reader, options, PropCurrent, null)) + { + continue; + } + + if (propFailed.TryReadProperty(ref reader, options, PropFailed, null)) + { + continue; + } + + if (propTime.TryReadProperty(ref reader, options, PropTime, null)) + { + continue; + } + + if (propTimeInMillis.TryReadProperty(ref reader, options, PropTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ClusterProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Current = propCurrent.Value, + Failed = propFailed.Value, + Time = propTime.Value, + TimeInMillis = propTimeInMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropCurrent, value.Current, null, null); + writer.WriteProperty(options, PropFailed, value.Failed, null, null); + writer.WriteProperty(options, PropTime, value.Time, null, null); + writer.WriteProperty(options, PropTimeInMillis, value.TimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcessor.g.cs index e774f5e8e81..4b89705cdc3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterProcessor.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ClusterProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropCurrent = System.Text.Json.JsonEncodedText.Encode("current"); - private static readonly System.Text.Json.JsonEncodedText PropFailed = System.Text.Json.JsonEncodedText.Encode("failed"); - private static readonly System.Text.Json.JsonEncodedText PropTime = System.Text.Json.JsonEncodedText.Encode("time"); - private static readonly System.Text.Json.JsonEncodedText PropTimeInMillis = System.Text.Json.JsonEncodedText.Encode("time_in_millis"); - - public override Elastic.Clients.Elasticsearch.Cluster.ClusterProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propCurrent = default; - LocalJsonValue propFailed = default; - LocalJsonValue propTime = default; - LocalJsonValue propTimeInMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propCurrent.TryReadProperty(ref reader, options, PropCurrent, null)) - { - continue; - } - - if (propFailed.TryReadProperty(ref reader, options, PropFailed, null)) - { - continue; - } - - if (propTime.TryReadProperty(ref reader, options, PropTime, null)) - { - continue; - } - - if (propTimeInMillis.TryReadProperty(ref reader, options, PropTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ClusterProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Current = propCurrent.Value, - Failed = propFailed.Value, - Time = propTime.Value, - TimeInMillis = propTimeInMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropCurrent, value.Current, null, null); - writer.WriteProperty(options, PropFailed, value.Failed, null, null); - writer.WriteProperty(options, PropTime, value.Time, null, null); - writer.WriteProperty(options, PropTimeInMillis, value.TimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ClusterProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ClusterProcessorConverter))] public sealed partial class ClusterProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterShardMetrics.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterShardMetrics.Converters.g.cs new file mode 100644 index 00000000000..9133fa37fb5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterShardMetrics.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ClusterShardMetricsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvg = System.Text.Json.JsonEncodedText.Encode("avg"); + private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); + + public override Elastic.Clients.Elasticsearch.Cluster.ClusterShardMetrics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvg = default; + LocalJsonValue propMax = default; + LocalJsonValue propMin = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvg.TryReadProperty(ref reader, options, PropAvg, null)) + { + continue; + } + + if (propMax.TryReadProperty(ref reader, options, PropMax, null)) + { + continue; + } + + if (propMin.TryReadProperty(ref reader, options, PropMin, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ClusterShardMetrics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Avg = propAvg.Value, + Max = propMax.Value, + Min = propMin.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterShardMetrics value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvg, value.Avg, null, null); + writer.WriteProperty(options, PropMax, value.Max, null, null); + writer.WriteProperty(options, PropMin, value.Min, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterShardMetrics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterShardMetrics.g.cs index 541b989dc46..b82974a5949 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterShardMetrics.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterShardMetrics.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ClusterShardMetricsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvg = System.Text.Json.JsonEncodedText.Encode("avg"); - private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); - private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); - - public override Elastic.Clients.Elasticsearch.Cluster.ClusterShardMetrics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvg = default; - LocalJsonValue propMax = default; - LocalJsonValue propMin = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvg.TryReadProperty(ref reader, options, PropAvg, null)) - { - continue; - } - - if (propMax.TryReadProperty(ref reader, options, PropMax, null)) - { - continue; - } - - if (propMin.TryReadProperty(ref reader, options, PropMin, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ClusterShardMetrics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Avg = propAvg.Value, - Max = propMax.Value, - Min = propMin.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterShardMetrics value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvg, value.Avg, null, null); - writer.WriteProperty(options, PropMax, value.Max, null, null); - writer.WriteProperty(options, PropMin, value.Min, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ClusterShardMetricsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ClusterShardMetricsConverter))] public sealed partial class ClusterShardMetrics { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterSnapshotStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterSnapshotStats.Converters.g.cs new file mode 100644 index 00000000000..3f73579b283 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterSnapshotStats.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ClusterSnapshotStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCurrentCounts = System.Text.Json.JsonEncodedText.Encode("current_counts"); + private static readonly System.Text.Json.JsonEncodedText PropRepositories = System.Text.Json.JsonEncodedText.Encode("repositories"); + + public override Elastic.Clients.Elasticsearch.Cluster.ClusterSnapshotStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCurrentCounts = default; + LocalJsonValue> propRepositories = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCurrentCounts.TryReadProperty(ref reader, options, PropCurrentCounts, null)) + { + continue; + } + + if (propRepositories.TryReadProperty(ref reader, options, PropRepositories, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ClusterSnapshotStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CurrentCounts = propCurrentCounts.Value, + Repositories = propRepositories.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterSnapshotStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCurrentCounts, value.CurrentCounts, null, null); + writer.WriteProperty(options, PropRepositories, value.Repositories, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterSnapshotStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterSnapshotStats.g.cs index 80c08ea5622..5d47786a2b6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterSnapshotStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ClusterSnapshotStats.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ClusterSnapshotStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCurrentCounts = System.Text.Json.JsonEncodedText.Encode("current_counts"); - private static readonly System.Text.Json.JsonEncodedText PropRepositories = System.Text.Json.JsonEncodedText.Encode("repositories"); - - public override Elastic.Clients.Elasticsearch.Cluster.ClusterSnapshotStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCurrentCounts = default; - LocalJsonValue> propRepositories = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCurrentCounts.TryReadProperty(ref reader, options, PropCurrentCounts, null)) - { - continue; - } - - if (propRepositories.TryReadProperty(ref reader, options, PropRepositories, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ClusterSnapshotStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CurrentCounts = propCurrentCounts.Value, - Repositories = propRepositories.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterSnapshotStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCurrentCounts, value.CurrentCounts, null, null); - writer.WriteProperty(options, PropRepositories, value.Repositories, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ClusterSnapshotStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ClusterSnapshotStatsConverter))] public sealed partial class ClusterSnapshotStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplate.Converters.g.cs new file mode 100644 index 00000000000..c87b453712d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ComponentTemplateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropComponentTemplateNode = System.Text.Json.JsonEncodedText.Encode("component_template"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.Cluster.ComponentTemplate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propComponentTemplateNode = default; + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propComponentTemplateNode.TryReadProperty(ref reader, options, PropComponentTemplateNode, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ComponentTemplate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ComponentTemplateNode = propComponentTemplateNode.Value, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ComponentTemplate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropComponentTemplateNode, value.ComponentTemplateNode, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplate.g.cs index d1edb2edcea..49afecc42c9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplate.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ComponentTemplateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropComponentTemplateNode = System.Text.Json.JsonEncodedText.Encode("component_template"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.Cluster.ComponentTemplate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propComponentTemplateNode = default; - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propComponentTemplateNode.TryReadProperty(ref reader, options, PropComponentTemplateNode, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ComponentTemplate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ComponentTemplateNode = propComponentTemplateNode.Value, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ComponentTemplate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropComponentTemplateNode, value.ComponentTemplateNode, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ComponentTemplateConverter))] public sealed partial class ComponentTemplate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateNode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateNode.Converters.g.cs new file mode 100644 index 00000000000..3f3da6d031b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateNode.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ComponentTemplateNodeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCreatedDate = System.Text.Json.JsonEncodedText.Encode("created_date"); + private static readonly System.Text.Json.JsonEncodedText PropCreatedDateMillis = System.Text.Json.JsonEncodedText.Encode("created_date_millis"); + private static readonly System.Text.Json.JsonEncodedText PropDeprecated = System.Text.Json.JsonEncodedText.Encode("deprecated"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); + private static readonly System.Text.Json.JsonEncodedText PropModifiedDate = System.Text.Json.JsonEncodedText.Encode("modified_date"); + private static readonly System.Text.Json.JsonEncodedText PropModifiedDateMillis = System.Text.Json.JsonEncodedText.Encode("modified_date_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCreatedDate = default; + LocalJsonValue propCreatedDateMillis = default; + LocalJsonValue propDeprecated = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propModifiedDate = default; + LocalJsonValue propModifiedDateMillis = default; + LocalJsonValue propTemplate = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCreatedDate.TryReadProperty(ref reader, options, PropCreatedDate, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propCreatedDateMillis.TryReadProperty(ref reader, options, PropCreatedDateMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propDeprecated.TryReadProperty(ref reader, options, PropDeprecated, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propModifiedDate.TryReadProperty(ref reader, options, PropModifiedDate, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propModifiedDateMillis.TryReadProperty(ref reader, options, PropModifiedDateMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CreatedDate = propCreatedDate.Value, + CreatedDateMillis = propCreatedDateMillis.Value, + Deprecated = propDeprecated.Value, + Meta = propMeta.Value, + ModifiedDate = propModifiedDate.Value, + ModifiedDateMillis = propModifiedDateMillis.Value, + Template = propTemplate.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNode value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCreatedDate, value.CreatedDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropCreatedDateMillis, value.CreatedDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropDeprecated, value.Deprecated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropModifiedDate, value.ModifiedDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropModifiedDateMillis, value.ModifiedDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropTemplate, value.Template, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateNode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateNode.g.cs index 7d59df2b20d..fad5cb231ef 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateNode.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateNode.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ComponentTemplateNodeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCreatedDate = System.Text.Json.JsonEncodedText.Encode("created_date"); - private static readonly System.Text.Json.JsonEncodedText PropCreatedDateMillis = System.Text.Json.JsonEncodedText.Encode("created_date_millis"); - private static readonly System.Text.Json.JsonEncodedText PropDeprecated = System.Text.Json.JsonEncodedText.Encode("deprecated"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); - private static readonly System.Text.Json.JsonEncodedText PropModifiedDate = System.Text.Json.JsonEncodedText.Encode("modified_date"); - private static readonly System.Text.Json.JsonEncodedText PropModifiedDateMillis = System.Text.Json.JsonEncodedText.Encode("modified_date_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCreatedDate = default; - LocalJsonValue propCreatedDateMillis = default; - LocalJsonValue propDeprecated = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propModifiedDate = default; - LocalJsonValue propModifiedDateMillis = default; - LocalJsonValue propTemplate = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCreatedDate.TryReadProperty(ref reader, options, PropCreatedDate, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propCreatedDateMillis.TryReadProperty(ref reader, options, PropCreatedDateMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propDeprecated.TryReadProperty(ref reader, options, PropDeprecated, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propModifiedDate.TryReadProperty(ref reader, options, PropModifiedDate, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propModifiedDateMillis.TryReadProperty(ref reader, options, PropModifiedDateMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CreatedDate = propCreatedDate.Value, - CreatedDateMillis = propCreatedDateMillis.Value, - Deprecated = propDeprecated.Value, - Meta = propMeta.Value, - ModifiedDate = propModifiedDate.Value, - ModifiedDateMillis = propModifiedDateMillis.Value, - Template = propTemplate.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNode value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCreatedDate, value.CreatedDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropCreatedDateMillis, value.CreatedDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropDeprecated, value.Deprecated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropModifiedDate, value.ModifiedDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropModifiedDateMillis, value.ModifiedDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropTemplate, value.Template, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ComponentTemplateNodeConverter))] public sealed partial class ComponentTemplateNode { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateSummary.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateSummary.Converters.g.cs new file mode 100644 index 00000000000..1d01c47485a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateSummary.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ComponentTemplateSummaryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); + private static readonly System.Text.Json.JsonEncodedText PropDataStreamOptions = System.Text.Json.JsonEncodedText.Encode("data_stream_options"); + private static readonly System.Text.Json.JsonEncodedText PropLifecycle = System.Text.Json.JsonEncodedText.Encode("lifecycle"); + private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAliases = default; + LocalJsonValue propDataStreamOptions = default; + LocalJsonValue propLifecycle = default; + LocalJsonValue propMappings = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue?> propSettings = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propDataStreamOptions.TryReadProperty(ref reader, options, PropDataStreamOptions, null)) + { + continue; + } + + if (propLifecycle.TryReadProperty(ref reader, options, PropLifecycle, null)) + { + continue; + } + + if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propSettings.TryReadProperty(ref reader, options, PropSettings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aliases = propAliases.Value, + DataStreamOptions = propDataStreamOptions.Value, + Lifecycle = propLifecycle.Value, + Mappings = propMappings.Value, + Meta = propMeta.Value, + Settings = propSettings.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummary value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropDataStreamOptions, value.DataStreamOptions, null, null); + writer.WriteProperty(options, PropLifecycle, value.Lifecycle, null, null); + writer.WriteProperty(options, PropMappings, value.Mappings, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropSettings, value.Settings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateSummary.g.cs index bb0dab6e86a..df24b95ccdf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateSummary.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateSummary.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ComponentTemplateSummaryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); - private static readonly System.Text.Json.JsonEncodedText PropDataStreamOptions = System.Text.Json.JsonEncodedText.Encode("data_stream_options"); - private static readonly System.Text.Json.JsonEncodedText PropLifecycle = System.Text.Json.JsonEncodedText.Encode("lifecycle"); - private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAliases = default; - LocalJsonValue propDataStreamOptions = default; - LocalJsonValue propLifecycle = default; - LocalJsonValue propMappings = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue?> propSettings = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propDataStreamOptions.TryReadProperty(ref reader, options, PropDataStreamOptions, null)) - { - continue; - } - - if (propLifecycle.TryReadProperty(ref reader, options, PropLifecycle, null)) - { - continue; - } - - if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propSettings.TryReadProperty(ref reader, options, PropSettings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aliases = propAliases.Value, - DataStreamOptions = propDataStreamOptions.Value, - Lifecycle = propLifecycle.Value, - Mappings = propMappings.Value, - Meta = propMeta.Value, - Settings = propSettings.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummary value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropDataStreamOptions, value.DataStreamOptions, null, null); - writer.WriteProperty(options, PropLifecycle, value.Lifecycle, null, null); - writer.WriteProperty(options, PropMappings, value.Mappings, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropSettings, value.Settings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ComponentTemplateSummaryConverter))] public sealed partial class ComponentTemplateSummary { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CurrentNode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CurrentNode.Converters.g.cs new file mode 100644 index 00000000000..ca58fca1878 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CurrentNode.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class CurrentNodeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); + private static readonly System.Text.Json.JsonEncodedText PropWeightRanking = System.Text.Json.JsonEncodedText.Encode("weight_ranking"); + + public override Elastic.Clients.Elasticsearch.Cluster.CurrentNode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propAttributes = default; + LocalJsonValue propId = default; + LocalJsonValue propName = default; + LocalJsonValue> propRoles = default; + LocalJsonValue propTransportAddress = default; + LocalJsonValue propWeightRanking = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) + { + continue; + } + + if (propWeightRanking.TryReadProperty(ref reader, options, PropWeightRanking, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.CurrentNode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Attributes = propAttributes.Value, + Id = propId.Value, + Name = propName.Value, + Roles = propRoles.Value, + TransportAddress = propTransportAddress.Value, + WeightRanking = propWeightRanking.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.CurrentNode value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); + writer.WriteProperty(options, PropWeightRanking, value.WeightRanking, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CurrentNode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CurrentNode.g.cs index ce2f43055c5..3c3018ea716 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CurrentNode.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CurrentNode.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class CurrentNodeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); - private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); - private static readonly System.Text.Json.JsonEncodedText PropWeightRanking = System.Text.Json.JsonEncodedText.Encode("weight_ranking"); - - public override Elastic.Clients.Elasticsearch.Cluster.CurrentNode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propAttributes = default; - LocalJsonValue propId = default; - LocalJsonValue propName = default; - LocalJsonValue> propRoles = default; - LocalJsonValue propTransportAddress = default; - LocalJsonValue propWeightRanking = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) - { - continue; - } - - if (propWeightRanking.TryReadProperty(ref reader, options, PropWeightRanking, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.CurrentNode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Attributes = propAttributes.Value, - Id = propId.Value, - Name = propName.Value, - Roles = propRoles.Value, - TransportAddress = propTransportAddress.Value, - WeightRanking = propWeightRanking.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.CurrentNode value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); - writer.WriteProperty(options, PropWeightRanking, value.WeightRanking, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.CurrentNodeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.CurrentNodeConverter))] public sealed partial class CurrentNode { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/Decision.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/Decision.Converters.g.cs new file mode 100644 index 00000000000..0b6484db3b8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/Decision.Converters.g.cs @@ -0,0 +1,165 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class DecisionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAllocationDelayed = System.Text.Json.JsonEncodedText.Encode("allocation_delayed"); + private static readonly System.Text.Json.JsonEncodedText MemberAwaitingInfo = System.Text.Json.JsonEncodedText.Encode("awaiting_info"); + private static readonly System.Text.Json.JsonEncodedText MemberNo = System.Text.Json.JsonEncodedText.Encode("no"); + private static readonly System.Text.Json.JsonEncodedText MemberNoAttempt = System.Text.Json.JsonEncodedText.Encode("no_attempt"); + private static readonly System.Text.Json.JsonEncodedText MemberNoValidShardCopy = System.Text.Json.JsonEncodedText.Encode("no_valid_shard_copy"); + private static readonly System.Text.Json.JsonEncodedText MemberThrottled = System.Text.Json.JsonEncodedText.Encode("throttled"); + private static readonly System.Text.Json.JsonEncodedText MemberWorseBalance = System.Text.Json.JsonEncodedText.Encode("worse_balance"); + private static readonly System.Text.Json.JsonEncodedText MemberYes = System.Text.Json.JsonEncodedText.Encode("yes"); + + public override Elastic.Clients.Elasticsearch.Cluster.Decision Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAllocationDelayed)) + { + return Elastic.Clients.Elasticsearch.Cluster.Decision.AllocationDelayed; + } + + if (reader.ValueTextEquals(MemberAwaitingInfo)) + { + return Elastic.Clients.Elasticsearch.Cluster.Decision.AwaitingInfo; + } + + if (reader.ValueTextEquals(MemberNo)) + { + return Elastic.Clients.Elasticsearch.Cluster.Decision.No; + } + + if (reader.ValueTextEquals(MemberNoAttempt)) + { + return Elastic.Clients.Elasticsearch.Cluster.Decision.NoAttempt; + } + + if (reader.ValueTextEquals(MemberNoValidShardCopy)) + { + return Elastic.Clients.Elasticsearch.Cluster.Decision.NoValidShardCopy; + } + + if (reader.ValueTextEquals(MemberThrottled)) + { + return Elastic.Clients.Elasticsearch.Cluster.Decision.Throttled; + } + + if (reader.ValueTextEquals(MemberWorseBalance)) + { + return Elastic.Clients.Elasticsearch.Cluster.Decision.WorseBalance; + } + + if (reader.ValueTextEquals(MemberYes)) + { + return Elastic.Clients.Elasticsearch.Cluster.Decision.Yes; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAllocationDelayed.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.Decision.AllocationDelayed; + } + + if (string.Equals(value, MemberAwaitingInfo.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.Decision.AwaitingInfo; + } + + if (string.Equals(value, MemberNo.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.Decision.No; + } + + if (string.Equals(value, MemberNoAttempt.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.Decision.NoAttempt; + } + + if (string.Equals(value, MemberNoValidShardCopy.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.Decision.NoValidShardCopy; + } + + if (string.Equals(value, MemberThrottled.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.Decision.Throttled; + } + + if (string.Equals(value, MemberWorseBalance.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.Decision.WorseBalance; + } + + if (string.Equals(value, MemberYes.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.Decision.Yes; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Cluster.Decision)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.Decision value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Cluster.Decision.AllocationDelayed: + writer.WriteStringValue(MemberAllocationDelayed); + break; + case Elastic.Clients.Elasticsearch.Cluster.Decision.AwaitingInfo: + writer.WriteStringValue(MemberAwaitingInfo); + break; + case Elastic.Clients.Elasticsearch.Cluster.Decision.No: + writer.WriteStringValue(MemberNo); + break; + case Elastic.Clients.Elasticsearch.Cluster.Decision.NoAttempt: + writer.WriteStringValue(MemberNoAttempt); + break; + case Elastic.Clients.Elasticsearch.Cluster.Decision.NoValidShardCopy: + writer.WriteStringValue(MemberNoValidShardCopy); + break; + case Elastic.Clients.Elasticsearch.Cluster.Decision.Throttled: + writer.WriteStringValue(MemberThrottled); + break; + case Elastic.Clients.Elasticsearch.Cluster.Decision.WorseBalance: + writer.WriteStringValue(MemberWorseBalance); + break; + case Elastic.Clients.Elasticsearch.Cluster.Decision.Yes: + writer.WriteStringValue(MemberYes); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Cluster.Decision)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Cluster.Decision ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.Decision value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/Decision.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/Decision.g.cs new file mode 100644 index 00000000000..36cbe31e6e2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/Decision.g.cs @@ -0,0 +1,45 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.DecisionConverter))] +public enum Decision +{ + [System.Runtime.Serialization.EnumMember(Value = "allocation_delayed")] + AllocationDelayed, + [System.Runtime.Serialization.EnumMember(Value = "awaiting_info")] + AwaitingInfo, + [System.Runtime.Serialization.EnumMember(Value = "no")] + No, + [System.Runtime.Serialization.EnumMember(Value = "no_attempt")] + NoAttempt, + [System.Runtime.Serialization.EnumMember(Value = "no_valid_shard_copy")] + NoValidShardCopy, + [System.Runtime.Serialization.EnumMember(Value = "throttled")] + Throttled, + [System.Runtime.Serialization.EnumMember(Value = "worse_balance")] + WorseBalance, + [System.Runtime.Serialization.EnumMember(Value = "yes")] + Yes +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/DenseVectorOffHeapStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/DenseVectorOffHeapStats.Converters.g.cs new file mode 100644 index 00000000000..933395ba657 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/DenseVectorOffHeapStats.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class DenseVectorOffHeapStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFielddata = System.Text.Json.JsonEncodedText.Encode("fielddata"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSize = System.Text.Json.JsonEncodedText.Encode("total_size"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSizeBytes = System.Text.Json.JsonEncodedText.Encode("total_size_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTotalVebSize = System.Text.Json.JsonEncodedText.Encode("total_veb_size"); + private static readonly System.Text.Json.JsonEncodedText PropTotalVebSizeBytes = System.Text.Json.JsonEncodedText.Encode("total_veb_size_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTotalVecSize = System.Text.Json.JsonEncodedText.Encode("total_vec_size"); + private static readonly System.Text.Json.JsonEncodedText PropTotalVecSizeBytes = System.Text.Json.JsonEncodedText.Encode("total_vec_size_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTotalVeqSize = System.Text.Json.JsonEncodedText.Encode("total_veq_size"); + private static readonly System.Text.Json.JsonEncodedText PropTotalVeqSizeBytes = System.Text.Json.JsonEncodedText.Encode("total_veq_size_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTotalVexSize = System.Text.Json.JsonEncodedText.Encode("total_vex_size"); + private static readonly System.Text.Json.JsonEncodedText PropTotalVexSizeBytes = System.Text.Json.JsonEncodedText.Encode("total_vex_size_bytes"); + + public override Elastic.Clients.Elasticsearch.Cluster.DenseVectorOffHeapStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>?> propFielddata = default; + LocalJsonValue propTotalSize = default; + LocalJsonValue propTotalSizeBytes = default; + LocalJsonValue propTotalVebSize = default; + LocalJsonValue propTotalVebSizeBytes = default; + LocalJsonValue propTotalVecSize = default; + LocalJsonValue propTotalVecSizeBytes = default; + LocalJsonValue propTotalVeqSize = default; + LocalJsonValue propTotalVeqSizeBytes = default; + LocalJsonValue propTotalVexSize = default; + LocalJsonValue propTotalVexSizeBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFielddata.TryReadProperty(ref reader, options, PropFielddata, static System.Collections.Generic.IReadOnlyDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!))) + { + continue; + } + + if (propTotalSize.TryReadProperty(ref reader, options, PropTotalSize, null)) + { + continue; + } + + if (propTotalSizeBytes.TryReadProperty(ref reader, options, PropTotalSizeBytes, null)) + { + continue; + } + + if (propTotalVebSize.TryReadProperty(ref reader, options, PropTotalVebSize, null)) + { + continue; + } + + if (propTotalVebSizeBytes.TryReadProperty(ref reader, options, PropTotalVebSizeBytes, null)) + { + continue; + } + + if (propTotalVecSize.TryReadProperty(ref reader, options, PropTotalVecSize, null)) + { + continue; + } + + if (propTotalVecSizeBytes.TryReadProperty(ref reader, options, PropTotalVecSizeBytes, null)) + { + continue; + } + + if (propTotalVeqSize.TryReadProperty(ref reader, options, PropTotalVeqSize, null)) + { + continue; + } + + if (propTotalVeqSizeBytes.TryReadProperty(ref reader, options, PropTotalVeqSizeBytes, null)) + { + continue; + } + + if (propTotalVexSize.TryReadProperty(ref reader, options, PropTotalVexSize, null)) + { + continue; + } + + if (propTotalVexSizeBytes.TryReadProperty(ref reader, options, PropTotalVexSizeBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.DenseVectorOffHeapStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Fielddata = propFielddata.Value, + TotalSize = propTotalSize.Value, + TotalSizeBytes = propTotalSizeBytes.Value, + TotalVebSize = propTotalVebSize.Value, + TotalVebSizeBytes = propTotalVebSizeBytes.Value, + TotalVecSize = propTotalVecSize.Value, + TotalVecSizeBytes = propTotalVecSizeBytes.Value, + TotalVeqSize = propTotalVeqSize.Value, + TotalVeqSizeBytes = propTotalVeqSizeBytes.Value, + TotalVexSize = propTotalVexSize.Value, + TotalVexSizeBytes = propTotalVexSizeBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.DenseVectorOffHeapStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFielddata, value.Fielddata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null))); + writer.WriteProperty(options, PropTotalSize, value.TotalSize, null, null); + writer.WriteProperty(options, PropTotalSizeBytes, value.TotalSizeBytes, null, null); + writer.WriteProperty(options, PropTotalVebSize, value.TotalVebSize, null, null); + writer.WriteProperty(options, PropTotalVebSizeBytes, value.TotalVebSizeBytes, null, null); + writer.WriteProperty(options, PropTotalVecSize, value.TotalVecSize, null, null); + writer.WriteProperty(options, PropTotalVecSizeBytes, value.TotalVecSizeBytes, null, null); + writer.WriteProperty(options, PropTotalVeqSize, value.TotalVeqSize, null, null); + writer.WriteProperty(options, PropTotalVeqSizeBytes, value.TotalVeqSizeBytes, null, null); + writer.WriteProperty(options, PropTotalVexSize, value.TotalVexSize, null, null); + writer.WriteProperty(options, PropTotalVexSizeBytes, value.TotalVexSizeBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/DenseVectorOffHeapStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/DenseVectorOffHeapStats.g.cs index c66d0acf1d4..794a0a93aba 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/DenseVectorOffHeapStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/DenseVectorOffHeapStats.g.cs @@ -23,136 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class DenseVectorOffHeapStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFielddata = System.Text.Json.JsonEncodedText.Encode("fielddata"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSize = System.Text.Json.JsonEncodedText.Encode("total_size"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSizeBytes = System.Text.Json.JsonEncodedText.Encode("total_size_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTotalVebSize = System.Text.Json.JsonEncodedText.Encode("total_veb_size"); - private static readonly System.Text.Json.JsonEncodedText PropTotalVebSizeBytes = System.Text.Json.JsonEncodedText.Encode("total_veb_size_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTotalVecSize = System.Text.Json.JsonEncodedText.Encode("total_vec_size"); - private static readonly System.Text.Json.JsonEncodedText PropTotalVecSizeBytes = System.Text.Json.JsonEncodedText.Encode("total_vec_size_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTotalVeqSize = System.Text.Json.JsonEncodedText.Encode("total_veq_size"); - private static readonly System.Text.Json.JsonEncodedText PropTotalVeqSizeBytes = System.Text.Json.JsonEncodedText.Encode("total_veq_size_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTotalVexSize = System.Text.Json.JsonEncodedText.Encode("total_vex_size"); - private static readonly System.Text.Json.JsonEncodedText PropTotalVexSizeBytes = System.Text.Json.JsonEncodedText.Encode("total_vex_size_bytes"); - - public override Elastic.Clients.Elasticsearch.Cluster.DenseVectorOffHeapStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>?> propFielddata = default; - LocalJsonValue propTotalSize = default; - LocalJsonValue propTotalSizeBytes = default; - LocalJsonValue propTotalVebSize = default; - LocalJsonValue propTotalVebSizeBytes = default; - LocalJsonValue propTotalVecSize = default; - LocalJsonValue propTotalVecSizeBytes = default; - LocalJsonValue propTotalVeqSize = default; - LocalJsonValue propTotalVeqSizeBytes = default; - LocalJsonValue propTotalVexSize = default; - LocalJsonValue propTotalVexSizeBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFielddata.TryReadProperty(ref reader, options, PropFielddata, static System.Collections.Generic.IReadOnlyDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!))) - { - continue; - } - - if (propTotalSize.TryReadProperty(ref reader, options, PropTotalSize, null)) - { - continue; - } - - if (propTotalSizeBytes.TryReadProperty(ref reader, options, PropTotalSizeBytes, null)) - { - continue; - } - - if (propTotalVebSize.TryReadProperty(ref reader, options, PropTotalVebSize, null)) - { - continue; - } - - if (propTotalVebSizeBytes.TryReadProperty(ref reader, options, PropTotalVebSizeBytes, null)) - { - continue; - } - - if (propTotalVecSize.TryReadProperty(ref reader, options, PropTotalVecSize, null)) - { - continue; - } - - if (propTotalVecSizeBytes.TryReadProperty(ref reader, options, PropTotalVecSizeBytes, null)) - { - continue; - } - - if (propTotalVeqSize.TryReadProperty(ref reader, options, PropTotalVeqSize, null)) - { - continue; - } - - if (propTotalVeqSizeBytes.TryReadProperty(ref reader, options, PropTotalVeqSizeBytes, null)) - { - continue; - } - - if (propTotalVexSize.TryReadProperty(ref reader, options, PropTotalVexSize, null)) - { - continue; - } - - if (propTotalVexSizeBytes.TryReadProperty(ref reader, options, PropTotalVexSizeBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.DenseVectorOffHeapStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Fielddata = propFielddata.Value, - TotalSize = propTotalSize.Value, - TotalSizeBytes = propTotalSizeBytes.Value, - TotalVebSize = propTotalVebSize.Value, - TotalVebSizeBytes = propTotalVebSizeBytes.Value, - TotalVecSize = propTotalVecSize.Value, - TotalVecSizeBytes = propTotalVecSizeBytes.Value, - TotalVeqSize = propTotalVeqSize.Value, - TotalVeqSizeBytes = propTotalVeqSizeBytes.Value, - TotalVexSize = propTotalVexSize.Value, - TotalVexSizeBytes = propTotalVexSizeBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.DenseVectorOffHeapStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFielddata, value.Fielddata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null))); - writer.WriteProperty(options, PropTotalSize, value.TotalSize, null, null); - writer.WriteProperty(options, PropTotalSizeBytes, value.TotalSizeBytes, null, null); - writer.WriteProperty(options, PropTotalVebSize, value.TotalVebSize, null, null); - writer.WriteProperty(options, PropTotalVebSizeBytes, value.TotalVebSizeBytes, null, null); - writer.WriteProperty(options, PropTotalVecSize, value.TotalVecSize, null, null); - writer.WriteProperty(options, PropTotalVecSizeBytes, value.TotalVecSizeBytes, null, null); - writer.WriteProperty(options, PropTotalVeqSize, value.TotalVeqSize, null, null); - writer.WriteProperty(options, PropTotalVeqSizeBytes, value.TotalVeqSizeBytes, null, null); - writer.WriteProperty(options, PropTotalVexSize, value.TotalVexSize, null, null); - writer.WriteProperty(options, PropTotalVexSizeBytes, value.TotalVexSizeBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.DenseVectorOffHeapStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.DenseVectorOffHeapStatsConverter))] public sealed partial class DenseVectorOffHeapStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/DenseVectorStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/DenseVectorStats.Converters.g.cs new file mode 100644 index 00000000000..d72212da8dd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/DenseVectorStats.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class DenseVectorStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropOffHeap = System.Text.Json.JsonEncodedText.Encode("off_heap"); + private static readonly System.Text.Json.JsonEncodedText PropValueCount = System.Text.Json.JsonEncodedText.Encode("value_count"); + + public override Elastic.Clients.Elasticsearch.Cluster.DenseVectorStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propOffHeap = default; + LocalJsonValue propValueCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propOffHeap.TryReadProperty(ref reader, options, PropOffHeap, null)) + { + continue; + } + + if (propValueCount.TryReadProperty(ref reader, options, PropValueCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.DenseVectorStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + OffHeap = propOffHeap.Value, + ValueCount = propValueCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.DenseVectorStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropOffHeap, value.OffHeap, null, null); + writer.WriteProperty(options, PropValueCount, value.ValueCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/DenseVectorStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/DenseVectorStats.g.cs index 841b0c09ba8..c197bcfdfee 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/DenseVectorStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/DenseVectorStats.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class DenseVectorStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropOffHeap = System.Text.Json.JsonEncodedText.Encode("off_heap"); - private static readonly System.Text.Json.JsonEncodedText PropValueCount = System.Text.Json.JsonEncodedText.Encode("value_count"); - - public override Elastic.Clients.Elasticsearch.Cluster.DenseVectorStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propOffHeap = default; - LocalJsonValue propValueCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propOffHeap.TryReadProperty(ref reader, options, PropOffHeap, null)) - { - continue; - } - - if (propValueCount.TryReadProperty(ref reader, options, PropValueCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.DenseVectorStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - OffHeap = propOffHeap.Value, - ValueCount = propValueCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.DenseVectorStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropOffHeap, value.OffHeap, null, null); - writer.WriteProperty(options, PropValueCount, value.ValueCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.DenseVectorStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.DenseVectorStatsConverter))] public sealed partial class DenseVectorStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/DiskUsage.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/DiskUsage.Converters.g.cs new file mode 100644 index 00000000000..74eaf703e0e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/DiskUsage.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class DiskUsageConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFreeBytes = System.Text.Json.JsonEncodedText.Encode("free_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropFreeDiskPercent = System.Text.Json.JsonEncodedText.Encode("free_disk_percent"); + private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); + private static readonly System.Text.Json.JsonEncodedText PropTotalBytes = System.Text.Json.JsonEncodedText.Encode("total_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropUsedBytes = System.Text.Json.JsonEncodedText.Encode("used_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropUsedDiskPercent = System.Text.Json.JsonEncodedText.Encode("used_disk_percent"); + + public override Elastic.Clients.Elasticsearch.Cluster.DiskUsage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFreeBytes = default; + LocalJsonValue propFreeDiskPercent = default; + LocalJsonValue propPath = default; + LocalJsonValue propTotalBytes = default; + LocalJsonValue propUsedBytes = default; + LocalJsonValue propUsedDiskPercent = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFreeBytes.TryReadProperty(ref reader, options, PropFreeBytes, null)) + { + continue; + } + + if (propFreeDiskPercent.TryReadProperty(ref reader, options, PropFreeDiskPercent, null)) + { + continue; + } + + if (propPath.TryReadProperty(ref reader, options, PropPath, null)) + { + continue; + } + + if (propTotalBytes.TryReadProperty(ref reader, options, PropTotalBytes, null)) + { + continue; + } + + if (propUsedBytes.TryReadProperty(ref reader, options, PropUsedBytes, null)) + { + continue; + } + + if (propUsedDiskPercent.TryReadProperty(ref reader, options, PropUsedDiskPercent, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.DiskUsage(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FreeBytes = propFreeBytes.Value, + FreeDiskPercent = propFreeDiskPercent.Value, + Path = propPath.Value, + TotalBytes = propTotalBytes.Value, + UsedBytes = propUsedBytes.Value, + UsedDiskPercent = propUsedDiskPercent.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.DiskUsage value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFreeBytes, value.FreeBytes, null, null); + writer.WriteProperty(options, PropFreeDiskPercent, value.FreeDiskPercent, null, null); + writer.WriteProperty(options, PropPath, value.Path, null, null); + writer.WriteProperty(options, PropTotalBytes, value.TotalBytes, null, null); + writer.WriteProperty(options, PropUsedBytes, value.UsedBytes, null, null); + writer.WriteProperty(options, PropUsedDiskPercent, value.UsedDiskPercent, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/DiskUsage.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/DiskUsage.g.cs index 70a42e0c196..ec7d1c941e4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/DiskUsage.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/DiskUsage.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class DiskUsageConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFreeBytes = System.Text.Json.JsonEncodedText.Encode("free_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropFreeDiskPercent = System.Text.Json.JsonEncodedText.Encode("free_disk_percent"); - private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); - private static readonly System.Text.Json.JsonEncodedText PropTotalBytes = System.Text.Json.JsonEncodedText.Encode("total_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropUsedBytes = System.Text.Json.JsonEncodedText.Encode("used_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropUsedDiskPercent = System.Text.Json.JsonEncodedText.Encode("used_disk_percent"); - - public override Elastic.Clients.Elasticsearch.Cluster.DiskUsage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFreeBytes = default; - LocalJsonValue propFreeDiskPercent = default; - LocalJsonValue propPath = default; - LocalJsonValue propTotalBytes = default; - LocalJsonValue propUsedBytes = default; - LocalJsonValue propUsedDiskPercent = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFreeBytes.TryReadProperty(ref reader, options, PropFreeBytes, null)) - { - continue; - } - - if (propFreeDiskPercent.TryReadProperty(ref reader, options, PropFreeDiskPercent, null)) - { - continue; - } - - if (propPath.TryReadProperty(ref reader, options, PropPath, null)) - { - continue; - } - - if (propTotalBytes.TryReadProperty(ref reader, options, PropTotalBytes, null)) - { - continue; - } - - if (propUsedBytes.TryReadProperty(ref reader, options, PropUsedBytes, null)) - { - continue; - } - - if (propUsedDiskPercent.TryReadProperty(ref reader, options, PropUsedDiskPercent, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.DiskUsage(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FreeBytes = propFreeBytes.Value, - FreeDiskPercent = propFreeDiskPercent.Value, - Path = propPath.Value, - TotalBytes = propTotalBytes.Value, - UsedBytes = propUsedBytes.Value, - UsedDiskPercent = propUsedDiskPercent.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.DiskUsage value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFreeBytes, value.FreeBytes, null, null); - writer.WriteProperty(options, PropFreeDiskPercent, value.FreeDiskPercent, null, null); - writer.WriteProperty(options, PropPath, value.Path, null, null); - writer.WriteProperty(options, PropTotalBytes, value.TotalBytes, null, null); - writer.WriteProperty(options, PropUsedBytes, value.UsedBytes, null, null); - writer.WriteProperty(options, PropUsedDiskPercent, value.UsedDiskPercent, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.DiskUsageConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.DiskUsageConverter))] public sealed partial class DiskUsage { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/FieldTypes.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/FieldTypes.Converters.g.cs new file mode 100644 index 00000000000..a5f97f40205 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/FieldTypes.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class FieldTypesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropIndexCount = System.Text.Json.JsonEncodedText.Encode("index_count"); + private static readonly System.Text.Json.JsonEncodedText PropIndexedVectorCount = System.Text.Json.JsonEncodedText.Encode("indexed_vector_count"); + private static readonly System.Text.Json.JsonEncodedText PropIndexedVectorDimMax = System.Text.Json.JsonEncodedText.Encode("indexed_vector_dim_max"); + private static readonly System.Text.Json.JsonEncodedText PropIndexedVectorDimMin = System.Text.Json.JsonEncodedText.Encode("indexed_vector_dim_min"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropScriptCount = System.Text.Json.JsonEncodedText.Encode("script_count"); + private static readonly System.Text.Json.JsonEncodedText PropVectorElementTypeCount = System.Text.Json.JsonEncodedText.Encode("vector_element_type_count"); + private static readonly System.Text.Json.JsonEncodedText PropVectorIndexTypeCount = System.Text.Json.JsonEncodedText.Encode("vector_index_type_count"); + private static readonly System.Text.Json.JsonEncodedText PropVectorSimilarityTypeCount = System.Text.Json.JsonEncodedText.Encode("vector_similarity_type_count"); + + public override Elastic.Clients.Elasticsearch.Cluster.FieldTypes Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propIndexCount = default; + LocalJsonValue propIndexedVectorCount = default; + LocalJsonValue propIndexedVectorDimMax = default; + LocalJsonValue propIndexedVectorDimMin = default; + LocalJsonValue propName = default; + LocalJsonValue propScriptCount = default; + LocalJsonValue?> propVectorElementTypeCount = default; + LocalJsonValue?> propVectorIndexTypeCount = default; + LocalJsonValue?> propVectorSimilarityTypeCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propIndexCount.TryReadProperty(ref reader, options, PropIndexCount, null)) + { + continue; + } + + if (propIndexedVectorCount.TryReadProperty(ref reader, options, PropIndexedVectorCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndexedVectorDimMax.TryReadProperty(ref reader, options, PropIndexedVectorDimMax, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndexedVectorDimMin.TryReadProperty(ref reader, options, PropIndexedVectorDimMin, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propScriptCount.TryReadProperty(ref reader, options, PropScriptCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propVectorElementTypeCount.TryReadProperty(ref reader, options, PropVectorElementTypeCount, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propVectorIndexTypeCount.TryReadProperty(ref reader, options, PropVectorIndexTypeCount, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propVectorSimilarityTypeCount.TryReadProperty(ref reader, options, PropVectorSimilarityTypeCount, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.FieldTypes(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + IndexCount = propIndexCount.Value, + IndexedVectorCount = propIndexedVectorCount.Value, + IndexedVectorDimMax = propIndexedVectorDimMax.Value, + IndexedVectorDimMin = propIndexedVectorDimMin.Value, + Name = propName.Value, + ScriptCount = propScriptCount.Value, + VectorElementTypeCount = propVectorElementTypeCount.Value, + VectorIndexTypeCount = propVectorIndexTypeCount.Value, + VectorSimilarityTypeCount = propVectorSimilarityTypeCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.FieldTypes value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropIndexCount, value.IndexCount, null, null); + writer.WriteProperty(options, PropIndexedVectorCount, value.IndexedVectorCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndexedVectorDimMax, value.IndexedVectorDimMax, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndexedVectorDimMin, value.IndexedVectorDimMin, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropScriptCount, value.ScriptCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVectorElementTypeCount, value.VectorElementTypeCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropVectorIndexTypeCount, value.VectorIndexTypeCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropVectorSimilarityTypeCount, value.VectorSimilarityTypeCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/FieldTypes.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/FieldTypes.g.cs index 1ef96afc613..8b8550f3c8e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/FieldTypes.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/FieldTypes.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class FieldTypesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropIndexCount = System.Text.Json.JsonEncodedText.Encode("index_count"); - private static readonly System.Text.Json.JsonEncodedText PropIndexedVectorCount = System.Text.Json.JsonEncodedText.Encode("indexed_vector_count"); - private static readonly System.Text.Json.JsonEncodedText PropIndexedVectorDimMax = System.Text.Json.JsonEncodedText.Encode("indexed_vector_dim_max"); - private static readonly System.Text.Json.JsonEncodedText PropIndexedVectorDimMin = System.Text.Json.JsonEncodedText.Encode("indexed_vector_dim_min"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropScriptCount = System.Text.Json.JsonEncodedText.Encode("script_count"); - private static readonly System.Text.Json.JsonEncodedText PropVectorElementTypeCount = System.Text.Json.JsonEncodedText.Encode("vector_element_type_count"); - private static readonly System.Text.Json.JsonEncodedText PropVectorIndexTypeCount = System.Text.Json.JsonEncodedText.Encode("vector_index_type_count"); - private static readonly System.Text.Json.JsonEncodedText PropVectorSimilarityTypeCount = System.Text.Json.JsonEncodedText.Encode("vector_similarity_type_count"); - - public override Elastic.Clients.Elasticsearch.Cluster.FieldTypes Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propIndexCount = default; - LocalJsonValue propIndexedVectorCount = default; - LocalJsonValue propIndexedVectorDimMax = default; - LocalJsonValue propIndexedVectorDimMin = default; - LocalJsonValue propName = default; - LocalJsonValue propScriptCount = default; - LocalJsonValue?> propVectorElementTypeCount = default; - LocalJsonValue?> propVectorIndexTypeCount = default; - LocalJsonValue?> propVectorSimilarityTypeCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propIndexCount.TryReadProperty(ref reader, options, PropIndexCount, null)) - { - continue; - } - - if (propIndexedVectorCount.TryReadProperty(ref reader, options, PropIndexedVectorCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndexedVectorDimMax.TryReadProperty(ref reader, options, PropIndexedVectorDimMax, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndexedVectorDimMin.TryReadProperty(ref reader, options, PropIndexedVectorDimMin, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propScriptCount.TryReadProperty(ref reader, options, PropScriptCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propVectorElementTypeCount.TryReadProperty(ref reader, options, PropVectorElementTypeCount, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propVectorIndexTypeCount.TryReadProperty(ref reader, options, PropVectorIndexTypeCount, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propVectorSimilarityTypeCount.TryReadProperty(ref reader, options, PropVectorSimilarityTypeCount, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.FieldTypes(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - IndexCount = propIndexCount.Value, - IndexedVectorCount = propIndexedVectorCount.Value, - IndexedVectorDimMax = propIndexedVectorDimMax.Value, - IndexedVectorDimMin = propIndexedVectorDimMin.Value, - Name = propName.Value, - ScriptCount = propScriptCount.Value, - VectorElementTypeCount = propVectorElementTypeCount.Value, - VectorIndexTypeCount = propVectorIndexTypeCount.Value, - VectorSimilarityTypeCount = propVectorSimilarityTypeCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.FieldTypes value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropIndexCount, value.IndexCount, null, null); - writer.WriteProperty(options, PropIndexedVectorCount, value.IndexedVectorCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndexedVectorDimMax, value.IndexedVectorDimMax, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndexedVectorDimMin, value.IndexedVectorDimMin, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropScriptCount, value.ScriptCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropVectorElementTypeCount, value.VectorElementTypeCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropVectorIndexTypeCount, value.VectorIndexTypeCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropVectorSimilarityTypeCount, value.VectorSimilarityTypeCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.FieldTypesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.FieldTypesConverter))] public sealed partial class FieldTypes { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/FieldTypesMappings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/FieldTypesMappings.Converters.g.cs new file mode 100644 index 00000000000..8ba8b52f92f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/FieldTypesMappings.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class FieldTypesMappingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFieldTypes = System.Text.Json.JsonEncodedText.Encode("field_types"); + private static readonly System.Text.Json.JsonEncodedText PropRuntimeFieldTypes = System.Text.Json.JsonEncodedText.Encode("runtime_field_types"); + private static readonly System.Text.Json.JsonEncodedText PropSourceModes = System.Text.Json.JsonEncodedText.Encode("source_modes"); + private static readonly System.Text.Json.JsonEncodedText PropTotalDeduplicatedFieldCount = System.Text.Json.JsonEncodedText.Encode("total_deduplicated_field_count"); + private static readonly System.Text.Json.JsonEncodedText PropTotalDeduplicatedMappingSize = System.Text.Json.JsonEncodedText.Encode("total_deduplicated_mapping_size"); + private static readonly System.Text.Json.JsonEncodedText PropTotalDeduplicatedMappingSizeInBytes = System.Text.Json.JsonEncodedText.Encode("total_deduplicated_mapping_size_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTotalFieldCount = System.Text.Json.JsonEncodedText.Encode("total_field_count"); + + public override Elastic.Clients.Elasticsearch.Cluster.FieldTypesMappings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propFieldTypes = default; + LocalJsonValue> propRuntimeFieldTypes = default; + LocalJsonValue> propSourceModes = default; + LocalJsonValue propTotalDeduplicatedFieldCount = default; + LocalJsonValue propTotalDeduplicatedMappingSize = default; + LocalJsonValue propTotalDeduplicatedMappingSizeInBytes = default; + LocalJsonValue propTotalFieldCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFieldTypes.TryReadProperty(ref reader, options, PropFieldTypes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propRuntimeFieldTypes.TryReadProperty(ref reader, options, PropRuntimeFieldTypes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propSourceModes.TryReadProperty(ref reader, options, PropSourceModes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propTotalDeduplicatedFieldCount.TryReadProperty(ref reader, options, PropTotalDeduplicatedFieldCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotalDeduplicatedMappingSize.TryReadProperty(ref reader, options, PropTotalDeduplicatedMappingSize, null)) + { + continue; + } + + if (propTotalDeduplicatedMappingSizeInBytes.TryReadProperty(ref reader, options, PropTotalDeduplicatedMappingSizeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotalFieldCount.TryReadProperty(ref reader, options, PropTotalFieldCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.FieldTypesMappings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FieldTypes = propFieldTypes.Value, + RuntimeFieldTypes = propRuntimeFieldTypes.Value, + SourceModes = propSourceModes.Value, + TotalDeduplicatedFieldCount = propTotalDeduplicatedFieldCount.Value, + TotalDeduplicatedMappingSize = propTotalDeduplicatedMappingSize.Value, + TotalDeduplicatedMappingSizeInBytes = propTotalDeduplicatedMappingSizeInBytes.Value, + TotalFieldCount = propTotalFieldCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.FieldTypesMappings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFieldTypes, value.FieldTypes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRuntimeFieldTypes, value.RuntimeFieldTypes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSourceModes, value.SourceModes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropTotalDeduplicatedFieldCount, value.TotalDeduplicatedFieldCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotalDeduplicatedMappingSize, value.TotalDeduplicatedMappingSize, null, null); + writer.WriteProperty(options, PropTotalDeduplicatedMappingSizeInBytes, value.TotalDeduplicatedMappingSizeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotalFieldCount, value.TotalFieldCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/FieldTypesMappings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/FieldTypesMappings.g.cs index 5727dd901f7..2a682e7a8e6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/FieldTypesMappings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/FieldTypesMappings.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class FieldTypesMappingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFieldTypes = System.Text.Json.JsonEncodedText.Encode("field_types"); - private static readonly System.Text.Json.JsonEncodedText PropRuntimeFieldTypes = System.Text.Json.JsonEncodedText.Encode("runtime_field_types"); - private static readonly System.Text.Json.JsonEncodedText PropSourceModes = System.Text.Json.JsonEncodedText.Encode("source_modes"); - private static readonly System.Text.Json.JsonEncodedText PropTotalDeduplicatedFieldCount = System.Text.Json.JsonEncodedText.Encode("total_deduplicated_field_count"); - private static readonly System.Text.Json.JsonEncodedText PropTotalDeduplicatedMappingSize = System.Text.Json.JsonEncodedText.Encode("total_deduplicated_mapping_size"); - private static readonly System.Text.Json.JsonEncodedText PropTotalDeduplicatedMappingSizeInBytes = System.Text.Json.JsonEncodedText.Encode("total_deduplicated_mapping_size_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTotalFieldCount = System.Text.Json.JsonEncodedText.Encode("total_field_count"); - - public override Elastic.Clients.Elasticsearch.Cluster.FieldTypesMappings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propFieldTypes = default; - LocalJsonValue> propRuntimeFieldTypes = default; - LocalJsonValue> propSourceModes = default; - LocalJsonValue propTotalDeduplicatedFieldCount = default; - LocalJsonValue propTotalDeduplicatedMappingSize = default; - LocalJsonValue propTotalDeduplicatedMappingSizeInBytes = default; - LocalJsonValue propTotalFieldCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFieldTypes.TryReadProperty(ref reader, options, PropFieldTypes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propRuntimeFieldTypes.TryReadProperty(ref reader, options, PropRuntimeFieldTypes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propSourceModes.TryReadProperty(ref reader, options, PropSourceModes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propTotalDeduplicatedFieldCount.TryReadProperty(ref reader, options, PropTotalDeduplicatedFieldCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotalDeduplicatedMappingSize.TryReadProperty(ref reader, options, PropTotalDeduplicatedMappingSize, null)) - { - continue; - } - - if (propTotalDeduplicatedMappingSizeInBytes.TryReadProperty(ref reader, options, PropTotalDeduplicatedMappingSizeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotalFieldCount.TryReadProperty(ref reader, options, PropTotalFieldCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.FieldTypesMappings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FieldTypes = propFieldTypes.Value, - RuntimeFieldTypes = propRuntimeFieldTypes.Value, - SourceModes = propSourceModes.Value, - TotalDeduplicatedFieldCount = propTotalDeduplicatedFieldCount.Value, - TotalDeduplicatedMappingSize = propTotalDeduplicatedMappingSize.Value, - TotalDeduplicatedMappingSizeInBytes = propTotalDeduplicatedMappingSizeInBytes.Value, - TotalFieldCount = propTotalFieldCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.FieldTypesMappings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFieldTypes, value.FieldTypes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRuntimeFieldTypes, value.RuntimeFieldTypes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSourceModes, value.SourceModes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropTotalDeduplicatedFieldCount, value.TotalDeduplicatedFieldCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotalDeduplicatedMappingSize, value.TotalDeduplicatedMappingSize, null, null); - writer.WriteProperty(options, PropTotalDeduplicatedMappingSizeInBytes, value.TotalDeduplicatedMappingSizeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotalFieldCount, value.TotalFieldCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.FieldTypesMappingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.FieldTypesMappingsConverter))] public sealed partial class FieldTypesMappings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/IndexHealthStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/IndexHealthStats.Converters.g.cs new file mode 100644 index 00000000000..66f66117527 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/IndexHealthStats.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class IndexHealthStatsConverter : 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 PropInitializingShards = System.Text.Json.JsonEncodedText.Encode("initializing_shards"); + private static readonly System.Text.Json.JsonEncodedText PropNumberOfReplicas = System.Text.Json.JsonEncodedText.Encode("number_of_replicas"); + private static readonly System.Text.Json.JsonEncodedText PropNumberOfShards = System.Text.Json.JsonEncodedText.Encode("number_of_shards"); + private static readonly System.Text.Json.JsonEncodedText PropRelocatingShards = System.Text.Json.JsonEncodedText.Encode("relocating_shards"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + 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 Elastic.Clients.Elasticsearch.Cluster.IndexHealthStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propActivePrimaryShards = default; + LocalJsonValue propActiveShards = default; + LocalJsonValue propInitializingShards = default; + LocalJsonValue propNumberOfReplicas = default; + LocalJsonValue propNumberOfShards = default; + LocalJsonValue propRelocatingShards = default; + LocalJsonValue?> propShards = default; + LocalJsonValue propStatus = default; + LocalJsonValue propUnassignedPrimaryShards = default; + LocalJsonValue propUnassignedShards = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propActivePrimaryShards.TryReadProperty(ref reader, options, PropActivePrimaryShards, null)) + { + continue; + } + + if (propActiveShards.TryReadProperty(ref reader, options, PropActiveShards, null)) + { + continue; + } + + if (propInitializingShards.TryReadProperty(ref reader, options, PropInitializingShards, null)) + { + continue; + } + + if (propNumberOfReplicas.TryReadProperty(ref reader, options, PropNumberOfReplicas, null)) + { + continue; + } + + if (propNumberOfShards.TryReadProperty(ref reader, options, PropNumberOfShards, null)) + { + continue; + } + + if (propRelocatingShards.TryReadProperty(ref reader, options, PropRelocatingShards, null)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (propUnassignedPrimaryShards.TryReadProperty(ref reader, options, PropUnassignedPrimaryShards, null)) + { + continue; + } + + if (propUnassignedShards.TryReadProperty(ref reader, options, PropUnassignedShards, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.IndexHealthStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ActivePrimaryShards = propActivePrimaryShards.Value, + ActiveShards = propActiveShards.Value, + InitializingShards = propInitializingShards.Value, + NumberOfReplicas = propNumberOfReplicas.Value, + NumberOfShards = propNumberOfShards.Value, + RelocatingShards = propRelocatingShards.Value, + Shards = propShards.Value, + Status = propStatus.Value, + UnassignedPrimaryShards = propUnassignedPrimaryShards.Value, + UnassignedShards = propUnassignedShards.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.IndexHealthStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropActivePrimaryShards, value.ActivePrimaryShards, null, null); + writer.WriteProperty(options, PropActiveShards, value.ActiveShards, null, null); + writer.WriteProperty(options, PropInitializingShards, value.InitializingShards, null, null); + writer.WriteProperty(options, PropNumberOfReplicas, value.NumberOfReplicas, null, null); + writer.WriteProperty(options, PropNumberOfShards, value.NumberOfShards, null, null); + writer.WriteProperty(options, PropRelocatingShards, value.RelocatingShards, null, null); + writer.WriteProperty(options, PropShards, value.Shards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteProperty(options, PropUnassignedPrimaryShards, value.UnassignedPrimaryShards, null, null); + writer.WriteProperty(options, PropUnassignedShards, value.UnassignedShards, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/IndexHealthStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/IndexHealthStats.g.cs index 0fd83e39b2f..77d1b599823 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/IndexHealthStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/IndexHealthStats.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class IndexHealthStatsConverter : 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 PropInitializingShards = System.Text.Json.JsonEncodedText.Encode("initializing_shards"); - private static readonly System.Text.Json.JsonEncodedText PropNumberOfReplicas = System.Text.Json.JsonEncodedText.Encode("number_of_replicas"); - private static readonly System.Text.Json.JsonEncodedText PropNumberOfShards = System.Text.Json.JsonEncodedText.Encode("number_of_shards"); - private static readonly System.Text.Json.JsonEncodedText PropRelocatingShards = System.Text.Json.JsonEncodedText.Encode("relocating_shards"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - 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 Elastic.Clients.Elasticsearch.Cluster.IndexHealthStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propActivePrimaryShards = default; - LocalJsonValue propActiveShards = default; - LocalJsonValue propInitializingShards = default; - LocalJsonValue propNumberOfReplicas = default; - LocalJsonValue propNumberOfShards = default; - LocalJsonValue propRelocatingShards = default; - LocalJsonValue?> propShards = default; - LocalJsonValue propStatus = default; - LocalJsonValue propUnassignedPrimaryShards = default; - LocalJsonValue propUnassignedShards = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propActivePrimaryShards.TryReadProperty(ref reader, options, PropActivePrimaryShards, null)) - { - continue; - } - - if (propActiveShards.TryReadProperty(ref reader, options, PropActiveShards, null)) - { - continue; - } - - if (propInitializingShards.TryReadProperty(ref reader, options, PropInitializingShards, null)) - { - continue; - } - - if (propNumberOfReplicas.TryReadProperty(ref reader, options, PropNumberOfReplicas, null)) - { - continue; - } - - if (propNumberOfShards.TryReadProperty(ref reader, options, PropNumberOfShards, null)) - { - continue; - } - - if (propRelocatingShards.TryReadProperty(ref reader, options, PropRelocatingShards, null)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (propUnassignedPrimaryShards.TryReadProperty(ref reader, options, PropUnassignedPrimaryShards, null)) - { - continue; - } - - if (propUnassignedShards.TryReadProperty(ref reader, options, PropUnassignedShards, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.IndexHealthStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ActivePrimaryShards = propActivePrimaryShards.Value, - ActiveShards = propActiveShards.Value, - InitializingShards = propInitializingShards.Value, - NumberOfReplicas = propNumberOfReplicas.Value, - NumberOfShards = propNumberOfShards.Value, - RelocatingShards = propRelocatingShards.Value, - Shards = propShards.Value, - Status = propStatus.Value, - UnassignedPrimaryShards = propUnassignedPrimaryShards.Value, - UnassignedShards = propUnassignedShards.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.IndexHealthStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropActivePrimaryShards, value.ActivePrimaryShards, null, null); - writer.WriteProperty(options, PropActiveShards, value.ActiveShards, null, null); - writer.WriteProperty(options, PropInitializingShards, value.InitializingShards, null, null); - writer.WriteProperty(options, PropNumberOfReplicas, value.NumberOfReplicas, null, null); - writer.WriteProperty(options, PropNumberOfShards, value.NumberOfShards, null, null); - writer.WriteProperty(options, PropRelocatingShards, value.RelocatingShards, null, null); - writer.WriteProperty(options, PropShards, value.Shards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteProperty(options, PropUnassignedPrimaryShards, value.UnassignedPrimaryShards, null, null); - writer.WriteProperty(options, PropUnassignedShards, value.UnassignedShards, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.IndexHealthStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.IndexHealthStatsConverter))] public sealed partial class IndexHealthStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/IndexingPressure.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/IndexingPressure.Converters.g.cs new file mode 100644 index 00000000000..ccb101e8bda --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/IndexingPressure.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class IndexingPressureConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMemory = System.Text.Json.JsonEncodedText.Encode("memory"); + + public override Elastic.Clients.Elasticsearch.Cluster.IndexingPressure Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMemory = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMemory.TryReadProperty(ref reader, options, PropMemory, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.IndexingPressure(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Memory = propMemory.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.IndexingPressure value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMemory, value.Memory, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/IndexingPressure.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/IndexingPressure.g.cs index 98de64cd39f..bb7f803f23a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/IndexingPressure.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/IndexingPressure.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class IndexingPressureConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMemory = System.Text.Json.JsonEncodedText.Encode("memory"); - - public override Elastic.Clients.Elasticsearch.Cluster.IndexingPressure Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMemory = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMemory.TryReadProperty(ref reader, options, PropMemory, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.IndexingPressure(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Memory = propMemory.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.IndexingPressure value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMemory, value.Memory, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.IndexingPressureConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.IndexingPressureConverter))] public sealed partial class IndexingPressure { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/IndicesVersions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/IndicesVersions.Converters.g.cs new file mode 100644 index 00000000000..fbf507d91e5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/IndicesVersions.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class IndicesVersionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndexCount = System.Text.Json.JsonEncodedText.Encode("index_count"); + private static readonly System.Text.Json.JsonEncodedText PropPrimaryShardCount = System.Text.Json.JsonEncodedText.Encode("primary_shard_count"); + private static readonly System.Text.Json.JsonEncodedText PropTotalPrimaryBytes = System.Text.Json.JsonEncodedText.Encode("total_primary_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTotalPrimarySize = System.Text.Json.JsonEncodedText.Encode("total_primary_size"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Cluster.IndicesVersions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndexCount = default; + LocalJsonValue propPrimaryShardCount = default; + LocalJsonValue propTotalPrimaryBytes = default; + LocalJsonValue propTotalPrimarySize = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndexCount.TryReadProperty(ref reader, options, PropIndexCount, null)) + { + continue; + } + + if (propPrimaryShardCount.TryReadProperty(ref reader, options, PropPrimaryShardCount, null)) + { + continue; + } + + if (propTotalPrimaryBytes.TryReadProperty(ref reader, options, PropTotalPrimaryBytes, null)) + { + continue; + } + + if (propTotalPrimarySize.TryReadProperty(ref reader, options, PropTotalPrimarySize, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.IndicesVersions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + IndexCount = propIndexCount.Value, + PrimaryShardCount = propPrimaryShardCount.Value, + TotalPrimaryBytes = propTotalPrimaryBytes.Value, + TotalPrimarySize = propTotalPrimarySize.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.IndicesVersions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndexCount, value.IndexCount, null, null); + writer.WriteProperty(options, PropPrimaryShardCount, value.PrimaryShardCount, null, null); + writer.WriteProperty(options, PropTotalPrimaryBytes, value.TotalPrimaryBytes, null, null); + writer.WriteProperty(options, PropTotalPrimarySize, value.TotalPrimarySize, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/IndicesVersions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/IndicesVersions.g.cs index 8412fd177ea..5dcd4cf2e14 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/IndicesVersions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/IndicesVersions.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class IndicesVersionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndexCount = System.Text.Json.JsonEncodedText.Encode("index_count"); - private static readonly System.Text.Json.JsonEncodedText PropPrimaryShardCount = System.Text.Json.JsonEncodedText.Encode("primary_shard_count"); - private static readonly System.Text.Json.JsonEncodedText PropTotalPrimaryBytes = System.Text.Json.JsonEncodedText.Encode("total_primary_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTotalPrimarySize = System.Text.Json.JsonEncodedText.Encode("total_primary_size"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Cluster.IndicesVersions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndexCount = default; - LocalJsonValue propPrimaryShardCount = default; - LocalJsonValue propTotalPrimaryBytes = default; - LocalJsonValue propTotalPrimarySize = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndexCount.TryReadProperty(ref reader, options, PropIndexCount, null)) - { - continue; - } - - if (propPrimaryShardCount.TryReadProperty(ref reader, options, PropPrimaryShardCount, null)) - { - continue; - } - - if (propTotalPrimaryBytes.TryReadProperty(ref reader, options, PropTotalPrimaryBytes, null)) - { - continue; - } - - if (propTotalPrimarySize.TryReadProperty(ref reader, options, PropTotalPrimarySize, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.IndicesVersions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - IndexCount = propIndexCount.Value, - PrimaryShardCount = propPrimaryShardCount.Value, - TotalPrimaryBytes = propTotalPrimaryBytes.Value, - TotalPrimarySize = propTotalPrimarySize.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.IndicesVersions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndexCount, value.IndexCount, null, null); - writer.WriteProperty(options, PropPrimaryShardCount, value.PrimaryShardCount, null, null); - writer.WriteProperty(options, PropTotalPrimaryBytes, value.TotalPrimaryBytes, null, null); - writer.WriteProperty(options, PropTotalPrimarySize, value.TotalPrimarySize, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.IndicesVersionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.IndicesVersionsConverter))] public sealed partial class IndicesVersions { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/NodeAllocationExplanation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/NodeAllocationExplanation.Converters.g.cs new file mode 100644 index 00000000000..8d541507a3a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/NodeAllocationExplanation.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class NodeAllocationExplanationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDeciders = System.Text.Json.JsonEncodedText.Encode("deciders"); + private static readonly System.Text.Json.JsonEncodedText PropNodeAttributes = System.Text.Json.JsonEncodedText.Encode("node_attributes"); + private static readonly System.Text.Json.JsonEncodedText PropNodeDecision = System.Text.Json.JsonEncodedText.Encode("node_decision"); + private static readonly System.Text.Json.JsonEncodedText PropNodeId = System.Text.Json.JsonEncodedText.Encode("node_id"); + private static readonly System.Text.Json.JsonEncodedText PropNodeName = System.Text.Json.JsonEncodedText.Encode("node_name"); + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); + private static readonly System.Text.Json.JsonEncodedText PropWeightRanking = System.Text.Json.JsonEncodedText.Encode("weight_ranking"); + + public override Elastic.Clients.Elasticsearch.Cluster.NodeAllocationExplanation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propDeciders = default; + LocalJsonValue> propNodeAttributes = default; + LocalJsonValue propNodeDecision = default; + LocalJsonValue propNodeId = default; + LocalJsonValue propNodeName = default; + LocalJsonValue> propRoles = default; + LocalJsonValue propStore = default; + LocalJsonValue propTransportAddress = default; + LocalJsonValue propWeightRanking = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDeciders.TryReadProperty(ref reader, options, PropDeciders, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propNodeAttributes.TryReadProperty(ref reader, options, PropNodeAttributes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propNodeDecision.TryReadProperty(ref reader, options, PropNodeDecision, null)) + { + continue; + } + + if (propNodeId.TryReadProperty(ref reader, options, PropNodeId, null)) + { + continue; + } + + if (propNodeName.TryReadProperty(ref reader, options, PropNodeName, null)) + { + continue; + } + + if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, null)) + { + continue; + } + + if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) + { + continue; + } + + if (propWeightRanking.TryReadProperty(ref reader, options, PropWeightRanking, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.NodeAllocationExplanation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Deciders = propDeciders.Value, + NodeAttributes = propNodeAttributes.Value, + NodeDecision = propNodeDecision.Value, + NodeId = propNodeId.Value, + NodeName = propNodeName.Value, + Roles = propRoles.Value, + Store = propStore.Value, + TransportAddress = propTransportAddress.Value, + WeightRanking = propWeightRanking.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.NodeAllocationExplanation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDeciders, value.Deciders, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropNodeAttributes, value.NodeAttributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNodeDecision, value.NodeDecision, null, null); + writer.WriteProperty(options, PropNodeId, value.NodeId, null, null); + writer.WriteProperty(options, PropNodeName, value.NodeName, null, null); + writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStore, value.Store, null, null); + writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); + writer.WriteProperty(options, PropWeightRanking, value.WeightRanking, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/NodeAllocationExplanation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/NodeAllocationExplanation.g.cs index 6d913d3667e..2cf26319516 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/NodeAllocationExplanation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/NodeAllocationExplanation.g.cs @@ -23,118 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class NodeAllocationExplanationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDeciders = System.Text.Json.JsonEncodedText.Encode("deciders"); - private static readonly System.Text.Json.JsonEncodedText PropNodeAttributes = System.Text.Json.JsonEncodedText.Encode("node_attributes"); - private static readonly System.Text.Json.JsonEncodedText PropNodeDecision = System.Text.Json.JsonEncodedText.Encode("node_decision"); - private static readonly System.Text.Json.JsonEncodedText PropNodeId = System.Text.Json.JsonEncodedText.Encode("node_id"); - private static readonly System.Text.Json.JsonEncodedText PropNodeName = System.Text.Json.JsonEncodedText.Encode("node_name"); - private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); - private static readonly System.Text.Json.JsonEncodedText PropWeightRanking = System.Text.Json.JsonEncodedText.Encode("weight_ranking"); - - public override Elastic.Clients.Elasticsearch.Cluster.NodeAllocationExplanation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propDeciders = default; - LocalJsonValue> propNodeAttributes = default; - LocalJsonValue propNodeDecision = default; - LocalJsonValue propNodeId = default; - LocalJsonValue propNodeName = default; - LocalJsonValue> propRoles = default; - LocalJsonValue propStore = default; - LocalJsonValue propTransportAddress = default; - LocalJsonValue propWeightRanking = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDeciders.TryReadProperty(ref reader, options, PropDeciders, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propNodeAttributes.TryReadProperty(ref reader, options, PropNodeAttributes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propNodeDecision.TryReadProperty(ref reader, options, PropNodeDecision, null)) - { - continue; - } - - if (propNodeId.TryReadProperty(ref reader, options, PropNodeId, null)) - { - continue; - } - - if (propNodeName.TryReadProperty(ref reader, options, PropNodeName, null)) - { - continue; - } - - if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, null)) - { - continue; - } - - if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) - { - continue; - } - - if (propWeightRanking.TryReadProperty(ref reader, options, PropWeightRanking, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.NodeAllocationExplanation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Deciders = propDeciders.Value, - NodeAttributes = propNodeAttributes.Value, - NodeDecision = propNodeDecision.Value, - NodeId = propNodeId.Value, - NodeName = propNodeName.Value, - Roles = propRoles.Value, - Store = propStore.Value, - TransportAddress = propTransportAddress.Value, - WeightRanking = propWeightRanking.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.NodeAllocationExplanation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDeciders, value.Deciders, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropNodeAttributes, value.NodeAttributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNodeDecision, value.NodeDecision, null, null); - writer.WriteProperty(options, PropNodeId, value.NodeId, null, null); - writer.WriteProperty(options, PropNodeName, value.NodeName, null, null); - writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStore, value.Store, null, null); - writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); - writer.WriteProperty(options, PropWeightRanking, value.WeightRanking, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.NodeAllocationExplanationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.NodeAllocationExplanationConverter))] public sealed partial class NodeAllocationExplanation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/NodeDiskUsage.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/NodeDiskUsage.Converters.g.cs new file mode 100644 index 00000000000..acd940e81d5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/NodeDiskUsage.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class NodeDiskUsageConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLeastAvailable = System.Text.Json.JsonEncodedText.Encode("least_available"); + private static readonly System.Text.Json.JsonEncodedText PropMostAvailable = System.Text.Json.JsonEncodedText.Encode("most_available"); + private static readonly System.Text.Json.JsonEncodedText PropNodeName = System.Text.Json.JsonEncodedText.Encode("node_name"); + + public override Elastic.Clients.Elasticsearch.Cluster.NodeDiskUsage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLeastAvailable = default; + LocalJsonValue propMostAvailable = default; + LocalJsonValue propNodeName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLeastAvailable.TryReadProperty(ref reader, options, PropLeastAvailable, null)) + { + continue; + } + + if (propMostAvailable.TryReadProperty(ref reader, options, PropMostAvailable, null)) + { + continue; + } + + if (propNodeName.TryReadProperty(ref reader, options, PropNodeName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.NodeDiskUsage(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + LeastAvailable = propLeastAvailable.Value, + MostAvailable = propMostAvailable.Value, + NodeName = propNodeName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.NodeDiskUsage value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLeastAvailable, value.LeastAvailable, null, null); + writer.WriteProperty(options, PropMostAvailable, value.MostAvailable, null, null); + writer.WriteProperty(options, PropNodeName, value.NodeName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/NodeDiskUsage.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/NodeDiskUsage.g.cs index 3d2fcb71ae7..8cdfea1d861 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/NodeDiskUsage.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/NodeDiskUsage.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class NodeDiskUsageConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLeastAvailable = System.Text.Json.JsonEncodedText.Encode("least_available"); - private static readonly System.Text.Json.JsonEncodedText PropMostAvailable = System.Text.Json.JsonEncodedText.Encode("most_available"); - private static readonly System.Text.Json.JsonEncodedText PropNodeName = System.Text.Json.JsonEncodedText.Encode("node_name"); - - public override Elastic.Clients.Elasticsearch.Cluster.NodeDiskUsage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLeastAvailable = default; - LocalJsonValue propMostAvailable = default; - LocalJsonValue propNodeName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLeastAvailable.TryReadProperty(ref reader, options, PropLeastAvailable, null)) - { - continue; - } - - if (propMostAvailable.TryReadProperty(ref reader, options, PropMostAvailable, null)) - { - continue; - } - - if (propNodeName.TryReadProperty(ref reader, options, PropNodeName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.NodeDiskUsage(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - LeastAvailable = propLeastAvailable.Value, - MostAvailable = propMostAvailable.Value, - NodeName = propNodeName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.NodeDiskUsage value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLeastAvailable, value.LeastAvailable, null, null); - writer.WriteProperty(options, PropMostAvailable, value.MostAvailable, null, null); - writer.WriteProperty(options, PropNodeName, value.NodeName, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.NodeDiskUsageConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.NodeDiskUsageConverter))] public sealed partial class NodeDiskUsage { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/NodePackagingType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/NodePackagingType.Converters.g.cs new file mode 100644 index 00000000000..44240a8fc93 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/NodePackagingType.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class NodePackagingTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropFlavor = System.Text.Json.JsonEncodedText.Encode("flavor"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Cluster.NodePackagingType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propFlavor = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propFlavor.TryReadProperty(ref reader, options, PropFlavor, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.NodePackagingType(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Flavor = propFlavor.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.NodePackagingType value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropFlavor, value.Flavor, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/NodePackagingType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/NodePackagingType.g.cs index 18282d0f003..fdb77ad5210 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/NodePackagingType.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/NodePackagingType.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class NodePackagingTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropFlavor = System.Text.Json.JsonEncodedText.Encode("flavor"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Cluster.NodePackagingType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propFlavor = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propFlavor.TryReadProperty(ref reader, options, PropFlavor, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.NodePackagingType(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Flavor = propFlavor.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.NodePackagingType value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropFlavor, value.Flavor, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.NodePackagingTypeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.NodePackagingTypeConverter))] public sealed partial class NodePackagingType { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/OperatingSystemMemoryInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/OperatingSystemMemoryInfo.Converters.g.cs new file mode 100644 index 00000000000..f0f37e30bff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/OperatingSystemMemoryInfo.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class OperatingSystemMemoryInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAdjustedTotal = System.Text.Json.JsonEncodedText.Encode("adjusted_total"); + private static readonly System.Text.Json.JsonEncodedText PropAdjustedTotalInBytes = System.Text.Json.JsonEncodedText.Encode("adjusted_total_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropFree = System.Text.Json.JsonEncodedText.Encode("free"); + private static readonly System.Text.Json.JsonEncodedText PropFreeInBytes = System.Text.Json.JsonEncodedText.Encode("free_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropFreePercent = System.Text.Json.JsonEncodedText.Encode("free_percent"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + private static readonly System.Text.Json.JsonEncodedText PropTotalInBytes = System.Text.Json.JsonEncodedText.Encode("total_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropUsed = System.Text.Json.JsonEncodedText.Encode("used"); + private static readonly System.Text.Json.JsonEncodedText PropUsedInBytes = System.Text.Json.JsonEncodedText.Encode("used_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropUsedPercent = System.Text.Json.JsonEncodedText.Encode("used_percent"); + + public override Elastic.Clients.Elasticsearch.Cluster.OperatingSystemMemoryInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAdjustedTotal = default; + LocalJsonValue propAdjustedTotalInBytes = default; + LocalJsonValue propFree = default; + LocalJsonValue propFreeInBytes = default; + LocalJsonValue propFreePercent = default; + LocalJsonValue propTotal = default; + LocalJsonValue propTotalInBytes = default; + LocalJsonValue propUsed = default; + LocalJsonValue propUsedInBytes = default; + LocalJsonValue propUsedPercent = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAdjustedTotal.TryReadProperty(ref reader, options, PropAdjustedTotal, null)) + { + continue; + } + + if (propAdjustedTotalInBytes.TryReadProperty(ref reader, options, PropAdjustedTotalInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFree.TryReadProperty(ref reader, options, PropFree, null)) + { + continue; + } + + if (propFreeInBytes.TryReadProperty(ref reader, options, PropFreeInBytes, null)) + { + continue; + } + + if (propFreePercent.TryReadProperty(ref reader, options, PropFreePercent, null)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (propTotalInBytes.TryReadProperty(ref reader, options, PropTotalInBytes, null)) + { + continue; + } + + if (propUsed.TryReadProperty(ref reader, options, PropUsed, null)) + { + continue; + } + + if (propUsedInBytes.TryReadProperty(ref reader, options, PropUsedInBytes, null)) + { + continue; + } + + if (propUsedPercent.TryReadProperty(ref reader, options, PropUsedPercent, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.OperatingSystemMemoryInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AdjustedTotal = propAdjustedTotal.Value, + AdjustedTotalInBytes = propAdjustedTotalInBytes.Value, + Free = propFree.Value, + FreeInBytes = propFreeInBytes.Value, + FreePercent = propFreePercent.Value, + Total = propTotal.Value, + TotalInBytes = propTotalInBytes.Value, + Used = propUsed.Value, + UsedInBytes = propUsedInBytes.Value, + UsedPercent = propUsedPercent.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.OperatingSystemMemoryInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAdjustedTotal, value.AdjustedTotal, null, null); + writer.WriteProperty(options, PropAdjustedTotalInBytes, value.AdjustedTotalInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFree, value.Free, null, null); + writer.WriteProperty(options, PropFreeInBytes, value.FreeInBytes, null, null); + writer.WriteProperty(options, PropFreePercent, value.FreePercent, null, null); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteProperty(options, PropTotalInBytes, value.TotalInBytes, null, null); + writer.WriteProperty(options, PropUsed, value.Used, null, null); + writer.WriteProperty(options, PropUsedInBytes, value.UsedInBytes, null, null); + writer.WriteProperty(options, PropUsedPercent, value.UsedPercent, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/OperatingSystemMemoryInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/OperatingSystemMemoryInfo.g.cs index c1d23bb0e26..b85f9b8f9c1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/OperatingSystemMemoryInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/OperatingSystemMemoryInfo.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class OperatingSystemMemoryInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAdjustedTotal = System.Text.Json.JsonEncodedText.Encode("adjusted_total"); - private static readonly System.Text.Json.JsonEncodedText PropAdjustedTotalInBytes = System.Text.Json.JsonEncodedText.Encode("adjusted_total_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropFree = System.Text.Json.JsonEncodedText.Encode("free"); - private static readonly System.Text.Json.JsonEncodedText PropFreeInBytes = System.Text.Json.JsonEncodedText.Encode("free_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropFreePercent = System.Text.Json.JsonEncodedText.Encode("free_percent"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - private static readonly System.Text.Json.JsonEncodedText PropTotalInBytes = System.Text.Json.JsonEncodedText.Encode("total_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropUsed = System.Text.Json.JsonEncodedText.Encode("used"); - private static readonly System.Text.Json.JsonEncodedText PropUsedInBytes = System.Text.Json.JsonEncodedText.Encode("used_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropUsedPercent = System.Text.Json.JsonEncodedText.Encode("used_percent"); - - public override Elastic.Clients.Elasticsearch.Cluster.OperatingSystemMemoryInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAdjustedTotal = default; - LocalJsonValue propAdjustedTotalInBytes = default; - LocalJsonValue propFree = default; - LocalJsonValue propFreeInBytes = default; - LocalJsonValue propFreePercent = default; - LocalJsonValue propTotal = default; - LocalJsonValue propTotalInBytes = default; - LocalJsonValue propUsed = default; - LocalJsonValue propUsedInBytes = default; - LocalJsonValue propUsedPercent = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAdjustedTotal.TryReadProperty(ref reader, options, PropAdjustedTotal, null)) - { - continue; - } - - if (propAdjustedTotalInBytes.TryReadProperty(ref reader, options, PropAdjustedTotalInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFree.TryReadProperty(ref reader, options, PropFree, null)) - { - continue; - } - - if (propFreeInBytes.TryReadProperty(ref reader, options, PropFreeInBytes, null)) - { - continue; - } - - if (propFreePercent.TryReadProperty(ref reader, options, PropFreePercent, null)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (propTotalInBytes.TryReadProperty(ref reader, options, PropTotalInBytes, null)) - { - continue; - } - - if (propUsed.TryReadProperty(ref reader, options, PropUsed, null)) - { - continue; - } - - if (propUsedInBytes.TryReadProperty(ref reader, options, PropUsedInBytes, null)) - { - continue; - } - - if (propUsedPercent.TryReadProperty(ref reader, options, PropUsedPercent, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.OperatingSystemMemoryInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AdjustedTotal = propAdjustedTotal.Value, - AdjustedTotalInBytes = propAdjustedTotalInBytes.Value, - Free = propFree.Value, - FreeInBytes = propFreeInBytes.Value, - FreePercent = propFreePercent.Value, - Total = propTotal.Value, - TotalInBytes = propTotalInBytes.Value, - Used = propUsed.Value, - UsedInBytes = propUsedInBytes.Value, - UsedPercent = propUsedPercent.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.OperatingSystemMemoryInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAdjustedTotal, value.AdjustedTotal, null, null); - writer.WriteProperty(options, PropAdjustedTotalInBytes, value.AdjustedTotalInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFree, value.Free, null, null); - writer.WriteProperty(options, PropFreeInBytes, value.FreeInBytes, null, null); - writer.WriteProperty(options, PropFreePercent, value.FreePercent, null, null); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteProperty(options, PropTotalInBytes, value.TotalInBytes, null, null); - writer.WriteProperty(options, PropUsed, value.Used, null, null); - writer.WriteProperty(options, PropUsedInBytes, value.UsedInBytes, null, null); - writer.WriteProperty(options, PropUsedPercent, value.UsedPercent, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.OperatingSystemMemoryInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.OperatingSystemMemoryInfoConverter))] public sealed partial class OperatingSystemMemoryInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/PendingTask.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/PendingTask.Converters.g.cs new file mode 100644 index 00000000000..b907d9fd1ad --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/PendingTask.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class PendingTaskConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExecuting = System.Text.Json.JsonEncodedText.Encode("executing"); + private static readonly System.Text.Json.JsonEncodedText PropInsertOrder = System.Text.Json.JsonEncodedText.Encode("insert_order"); + private static readonly System.Text.Json.JsonEncodedText PropPriority = System.Text.Json.JsonEncodedText.Encode("priority"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + private static readonly System.Text.Json.JsonEncodedText PropTimeInQueue = System.Text.Json.JsonEncodedText.Encode("time_in_queue"); + private static readonly System.Text.Json.JsonEncodedText PropTimeInQueueMillis = System.Text.Json.JsonEncodedText.Encode("time_in_queue_millis"); + + public override Elastic.Clients.Elasticsearch.Cluster.PendingTask Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExecuting = default; + LocalJsonValue propInsertOrder = default; + LocalJsonValue propPriority = default; + LocalJsonValue propSource = default; + LocalJsonValue propTimeInQueue = default; + LocalJsonValue propTimeInQueueMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExecuting.TryReadProperty(ref reader, options, PropExecuting, null)) + { + continue; + } + + if (propInsertOrder.TryReadProperty(ref reader, options, PropInsertOrder, null)) + { + continue; + } + + if (propPriority.TryReadProperty(ref reader, options, PropPriority, null)) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (propTimeInQueue.TryReadProperty(ref reader, options, PropTimeInQueue, null)) + { + continue; + } + + if (propTimeInQueueMillis.TryReadProperty(ref reader, options, PropTimeInQueueMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.PendingTask(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Executing = propExecuting.Value, + InsertOrder = propInsertOrder.Value, + Priority = propPriority.Value, + Source = propSource.Value, + TimeInQueue = propTimeInQueue.Value, + TimeInQueueMillis = propTimeInQueueMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.PendingTask value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExecuting, value.Executing, null, null); + writer.WriteProperty(options, PropInsertOrder, value.InsertOrder, null, null); + writer.WriteProperty(options, PropPriority, value.Priority, null, null); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteProperty(options, PropTimeInQueue, value.TimeInQueue, null, null); + writer.WriteProperty(options, PropTimeInQueueMillis, value.TimeInQueueMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/PendingTask.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/PendingTask.g.cs index 2bfef429ee1..acdbff3afdd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/PendingTask.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/PendingTask.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class PendingTaskConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExecuting = System.Text.Json.JsonEncodedText.Encode("executing"); - private static readonly System.Text.Json.JsonEncodedText PropInsertOrder = System.Text.Json.JsonEncodedText.Encode("insert_order"); - private static readonly System.Text.Json.JsonEncodedText PropPriority = System.Text.Json.JsonEncodedText.Encode("priority"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - private static readonly System.Text.Json.JsonEncodedText PropTimeInQueue = System.Text.Json.JsonEncodedText.Encode("time_in_queue"); - private static readonly System.Text.Json.JsonEncodedText PropTimeInQueueMillis = System.Text.Json.JsonEncodedText.Encode("time_in_queue_millis"); - - public override Elastic.Clients.Elasticsearch.Cluster.PendingTask Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propExecuting = default; - LocalJsonValue propInsertOrder = default; - LocalJsonValue propPriority = default; - LocalJsonValue propSource = default; - LocalJsonValue propTimeInQueue = default; - LocalJsonValue propTimeInQueueMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExecuting.TryReadProperty(ref reader, options, PropExecuting, null)) - { - continue; - } - - if (propInsertOrder.TryReadProperty(ref reader, options, PropInsertOrder, null)) - { - continue; - } - - if (propPriority.TryReadProperty(ref reader, options, PropPriority, null)) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (propTimeInQueue.TryReadProperty(ref reader, options, PropTimeInQueue, null)) - { - continue; - } - - if (propTimeInQueueMillis.TryReadProperty(ref reader, options, PropTimeInQueueMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.PendingTask(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Executing = propExecuting.Value, - InsertOrder = propInsertOrder.Value, - Priority = propPriority.Value, - Source = propSource.Value, - TimeInQueue = propTimeInQueue.Value, - TimeInQueueMillis = propTimeInQueueMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.PendingTask value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExecuting, value.Executing, null, null); - writer.WriteProperty(options, PropInsertOrder, value.InsertOrder, null, null); - writer.WriteProperty(options, PropPriority, value.Priority, null, null); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteProperty(options, PropTimeInQueue, value.TimeInQueue, null, null); - writer.WriteProperty(options, PropTimeInQueueMillis, value.TimeInQueueMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.PendingTaskConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.PendingTaskConverter))] public sealed partial class PendingTask { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/PerRepositoryStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/PerRepositoryStats.Converters.g.cs new file mode 100644 index 00000000000..095ced9d235 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/PerRepositoryStats.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class PerRepositoryStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCurrentCounts = System.Text.Json.JsonEncodedText.Encode("current_counts"); + private static readonly System.Text.Json.JsonEncodedText PropOldestStartTime = System.Text.Json.JsonEncodedText.Encode("oldest_start_time"); + private static readonly System.Text.Json.JsonEncodedText PropOldestStartTimeMillis = System.Text.Json.JsonEncodedText.Encode("oldest_start_time_millis"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Cluster.PerRepositoryStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCurrentCounts = default; + LocalJsonValue propOldestStartTime = default; + LocalJsonValue propOldestStartTimeMillis = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCurrentCounts.TryReadProperty(ref reader, options, PropCurrentCounts, null)) + { + continue; + } + + if (propOldestStartTime.TryReadProperty(ref reader, options, PropOldestStartTime, null)) + { + continue; + } + + if (propOldestStartTimeMillis.TryReadProperty(ref reader, options, PropOldestStartTimeMillis, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.PerRepositoryStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CurrentCounts = propCurrentCounts.Value, + OldestStartTime = propOldestStartTime.Value, + OldestStartTimeMillis = propOldestStartTimeMillis.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.PerRepositoryStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCurrentCounts, value.CurrentCounts, null, null); + writer.WriteProperty(options, PropOldestStartTime, value.OldestStartTime, null, null); + writer.WriteProperty(options, PropOldestStartTimeMillis, value.OldestStartTimeMillis, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/PerRepositoryStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/PerRepositoryStats.g.cs index fe304108163..b43a3123fed 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/PerRepositoryStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/PerRepositoryStats.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class PerRepositoryStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCurrentCounts = System.Text.Json.JsonEncodedText.Encode("current_counts"); - private static readonly System.Text.Json.JsonEncodedText PropOldestStartTime = System.Text.Json.JsonEncodedText.Encode("oldest_start_time"); - private static readonly System.Text.Json.JsonEncodedText PropOldestStartTimeMillis = System.Text.Json.JsonEncodedText.Encode("oldest_start_time_millis"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Cluster.PerRepositoryStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCurrentCounts = default; - LocalJsonValue propOldestStartTime = default; - LocalJsonValue propOldestStartTimeMillis = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCurrentCounts.TryReadProperty(ref reader, options, PropCurrentCounts, null)) - { - continue; - } - - if (propOldestStartTime.TryReadProperty(ref reader, options, PropOldestStartTime, null)) - { - continue; - } - - if (propOldestStartTimeMillis.TryReadProperty(ref reader, options, PropOldestStartTimeMillis, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.PerRepositoryStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CurrentCounts = propCurrentCounts.Value, - OldestStartTime = propOldestStartTime.Value, - OldestStartTimeMillis = propOldestStartTimeMillis.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.PerRepositoryStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCurrentCounts, value.CurrentCounts, null, null); - writer.WriteProperty(options, PropOldestStartTime, value.OldestStartTime, null, null); - writer.WriteProperty(options, PropOldestStartTimeMillis, value.OldestStartTimeMillis, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.PerRepositoryStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.PerRepositoryStatsConverter))] public sealed partial class PerRepositoryStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RemoteClusterInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RemoteClusterInfo.Converters.g.cs new file mode 100644 index 00000000000..ee79299dd2c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RemoteClusterInfo.Converters.g.cs @@ -0,0 +1,189 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class RemoteClusterInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClusterUuid = System.Text.Json.JsonEncodedText.Encode("cluster_uuid"); + private static readonly System.Text.Json.JsonEncodedText PropIndicesCount = System.Text.Json.JsonEncodedText.Encode("indices_count"); + private static readonly System.Text.Json.JsonEncodedText PropIndicesTotalSize = System.Text.Json.JsonEncodedText.Encode("indices_total_size"); + private static readonly System.Text.Json.JsonEncodedText PropIndicesTotalSizeInBytes = System.Text.Json.JsonEncodedText.Encode("indices_total_size_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropMaxHeap = System.Text.Json.JsonEncodedText.Encode("max_heap"); + private static readonly System.Text.Json.JsonEncodedText PropMaxHeapInBytes = System.Text.Json.JsonEncodedText.Encode("max_heap_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropMemTotal = System.Text.Json.JsonEncodedText.Encode("mem_total"); + private static readonly System.Text.Json.JsonEncodedText PropMemTotalInBytes = System.Text.Json.JsonEncodedText.Encode("mem_total_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); + private static readonly System.Text.Json.JsonEncodedText PropNodesCount = System.Text.Json.JsonEncodedText.Encode("nodes_count"); + private static readonly System.Text.Json.JsonEncodedText PropShardsCount = System.Text.Json.JsonEncodedText.Encode("shards_count"); + private static readonly System.Text.Json.JsonEncodedText PropSkipUnavailable = System.Text.Json.JsonEncodedText.Encode("skip_unavailable"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + private static readonly System.Text.Json.JsonEncodedText PropTransportCompress = System.Text.Json.JsonEncodedText.Encode("transport.compress"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Cluster.RemoteClusterInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClusterUuid = default; + LocalJsonValue propIndicesCount = default; + LocalJsonValue propIndicesTotalSize = default; + LocalJsonValue propIndicesTotalSizeInBytes = default; + LocalJsonValue propMaxHeap = default; + LocalJsonValue propMaxHeapInBytes = default; + LocalJsonValue propMemTotal = default; + LocalJsonValue propMemTotalInBytes = default; + LocalJsonValue propMode = default; + LocalJsonValue propNodesCount = default; + LocalJsonValue propShardsCount = default; + LocalJsonValue propSkipUnavailable = default; + LocalJsonValue propStatus = default; + LocalJsonValue propTransportCompress = default; + LocalJsonValue> propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClusterUuid.TryReadProperty(ref reader, options, PropClusterUuid, null)) + { + continue; + } + + if (propIndicesCount.TryReadProperty(ref reader, options, PropIndicesCount, null)) + { + continue; + } + + if (propIndicesTotalSize.TryReadProperty(ref reader, options, PropIndicesTotalSize, null)) + { + continue; + } + + if (propIndicesTotalSizeInBytes.TryReadProperty(ref reader, options, PropIndicesTotalSizeInBytes, null)) + { + continue; + } + + if (propMaxHeap.TryReadProperty(ref reader, options, PropMaxHeap, null)) + { + continue; + } + + if (propMaxHeapInBytes.TryReadProperty(ref reader, options, PropMaxHeapInBytes, null)) + { + continue; + } + + if (propMemTotal.TryReadProperty(ref reader, options, PropMemTotal, null)) + { + continue; + } + + if (propMemTotalInBytes.TryReadProperty(ref reader, options, PropMemTotalInBytes, null)) + { + continue; + } + + if (propMode.TryReadProperty(ref reader, options, PropMode, null)) + { + continue; + } + + if (propNodesCount.TryReadProperty(ref reader, options, PropNodesCount, null)) + { + continue; + } + + if (propShardsCount.TryReadProperty(ref reader, options, PropShardsCount, null)) + { + continue; + } + + if (propSkipUnavailable.TryReadProperty(ref reader, options, PropSkipUnavailable, null)) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (propTransportCompress.TryReadProperty(ref reader, options, PropTransportCompress, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.RemoteClusterInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClusterUuid = propClusterUuid.Value, + IndicesCount = propIndicesCount.Value, + IndicesTotalSize = propIndicesTotalSize.Value, + IndicesTotalSizeInBytes = propIndicesTotalSizeInBytes.Value, + MaxHeap = propMaxHeap.Value, + MaxHeapInBytes = propMaxHeapInBytes.Value, + MemTotal = propMemTotal.Value, + MemTotalInBytes = propMemTotalInBytes.Value, + Mode = propMode.Value, + NodesCount = propNodesCount.Value, + ShardsCount = propShardsCount.Value, + SkipUnavailable = propSkipUnavailable.Value, + Status = propStatus.Value, + TransportCompress = propTransportCompress.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.RemoteClusterInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClusterUuid, value.ClusterUuid, null, null); + writer.WriteProperty(options, PropIndicesCount, value.IndicesCount, null, null); + writer.WriteProperty(options, PropIndicesTotalSize, value.IndicesTotalSize, null, null); + writer.WriteProperty(options, PropIndicesTotalSizeInBytes, value.IndicesTotalSizeInBytes, null, null); + writer.WriteProperty(options, PropMaxHeap, value.MaxHeap, null, null); + writer.WriteProperty(options, PropMaxHeapInBytes, value.MaxHeapInBytes, null, null); + writer.WriteProperty(options, PropMemTotal, value.MemTotal, null, null); + writer.WriteProperty(options, PropMemTotalInBytes, value.MemTotalInBytes, null, null); + writer.WriteProperty(options, PropMode, value.Mode, null, null); + writer.WriteProperty(options, PropNodesCount, value.NodesCount, null, null); + writer.WriteProperty(options, PropShardsCount, value.ShardsCount, null, null); + writer.WriteProperty(options, PropSkipUnavailable, value.SkipUnavailable, null, null); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteProperty(options, PropTransportCompress, value.TransportCompress, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RemoteClusterInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RemoteClusterInfo.g.cs index 3698ba0a69f..aec1eccf50b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RemoteClusterInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RemoteClusterInfo.g.cs @@ -23,172 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class RemoteClusterInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClusterUuid = System.Text.Json.JsonEncodedText.Encode("cluster_uuid"); - private static readonly System.Text.Json.JsonEncodedText PropIndicesCount = System.Text.Json.JsonEncodedText.Encode("indices_count"); - private static readonly System.Text.Json.JsonEncodedText PropIndicesTotalSize = System.Text.Json.JsonEncodedText.Encode("indices_total_size"); - private static readonly System.Text.Json.JsonEncodedText PropIndicesTotalSizeInBytes = System.Text.Json.JsonEncodedText.Encode("indices_total_size_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropMaxHeap = System.Text.Json.JsonEncodedText.Encode("max_heap"); - private static readonly System.Text.Json.JsonEncodedText PropMaxHeapInBytes = System.Text.Json.JsonEncodedText.Encode("max_heap_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropMemTotal = System.Text.Json.JsonEncodedText.Encode("mem_total"); - private static readonly System.Text.Json.JsonEncodedText PropMemTotalInBytes = System.Text.Json.JsonEncodedText.Encode("mem_total_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); - private static readonly System.Text.Json.JsonEncodedText PropNodesCount = System.Text.Json.JsonEncodedText.Encode("nodes_count"); - private static readonly System.Text.Json.JsonEncodedText PropShardsCount = System.Text.Json.JsonEncodedText.Encode("shards_count"); - private static readonly System.Text.Json.JsonEncodedText PropSkipUnavailable = System.Text.Json.JsonEncodedText.Encode("skip_unavailable"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - private static readonly System.Text.Json.JsonEncodedText PropTransportCompress = System.Text.Json.JsonEncodedText.Encode("transport.compress"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Cluster.RemoteClusterInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClusterUuid = default; - LocalJsonValue propIndicesCount = default; - LocalJsonValue propIndicesTotalSize = default; - LocalJsonValue propIndicesTotalSizeInBytes = default; - LocalJsonValue propMaxHeap = default; - LocalJsonValue propMaxHeapInBytes = default; - LocalJsonValue propMemTotal = default; - LocalJsonValue propMemTotalInBytes = default; - LocalJsonValue propMode = default; - LocalJsonValue propNodesCount = default; - LocalJsonValue propShardsCount = default; - LocalJsonValue propSkipUnavailable = default; - LocalJsonValue propStatus = default; - LocalJsonValue propTransportCompress = default; - LocalJsonValue> propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClusterUuid.TryReadProperty(ref reader, options, PropClusterUuid, null)) - { - continue; - } - - if (propIndicesCount.TryReadProperty(ref reader, options, PropIndicesCount, null)) - { - continue; - } - - if (propIndicesTotalSize.TryReadProperty(ref reader, options, PropIndicesTotalSize, null)) - { - continue; - } - - if (propIndicesTotalSizeInBytes.TryReadProperty(ref reader, options, PropIndicesTotalSizeInBytes, null)) - { - continue; - } - - if (propMaxHeap.TryReadProperty(ref reader, options, PropMaxHeap, null)) - { - continue; - } - - if (propMaxHeapInBytes.TryReadProperty(ref reader, options, PropMaxHeapInBytes, null)) - { - continue; - } - - if (propMemTotal.TryReadProperty(ref reader, options, PropMemTotal, null)) - { - continue; - } - - if (propMemTotalInBytes.TryReadProperty(ref reader, options, PropMemTotalInBytes, null)) - { - continue; - } - - if (propMode.TryReadProperty(ref reader, options, PropMode, null)) - { - continue; - } - - if (propNodesCount.TryReadProperty(ref reader, options, PropNodesCount, null)) - { - continue; - } - - if (propShardsCount.TryReadProperty(ref reader, options, PropShardsCount, null)) - { - continue; - } - - if (propSkipUnavailable.TryReadProperty(ref reader, options, PropSkipUnavailable, null)) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (propTransportCompress.TryReadProperty(ref reader, options, PropTransportCompress, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.RemoteClusterInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClusterUuid = propClusterUuid.Value, - IndicesCount = propIndicesCount.Value, - IndicesTotalSize = propIndicesTotalSize.Value, - IndicesTotalSizeInBytes = propIndicesTotalSizeInBytes.Value, - MaxHeap = propMaxHeap.Value, - MaxHeapInBytes = propMaxHeapInBytes.Value, - MemTotal = propMemTotal.Value, - MemTotalInBytes = propMemTotalInBytes.Value, - Mode = propMode.Value, - NodesCount = propNodesCount.Value, - ShardsCount = propShardsCount.Value, - SkipUnavailable = propSkipUnavailable.Value, - Status = propStatus.Value, - TransportCompress = propTransportCompress.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.RemoteClusterInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClusterUuid, value.ClusterUuid, null, null); - writer.WriteProperty(options, PropIndicesCount, value.IndicesCount, null, null); - writer.WriteProperty(options, PropIndicesTotalSize, value.IndicesTotalSize, null, null); - writer.WriteProperty(options, PropIndicesTotalSizeInBytes, value.IndicesTotalSizeInBytes, null, null); - writer.WriteProperty(options, PropMaxHeap, value.MaxHeap, null, null); - writer.WriteProperty(options, PropMaxHeapInBytes, value.MaxHeapInBytes, null, null); - writer.WriteProperty(options, PropMemTotal, value.MemTotal, null, null); - writer.WriteProperty(options, PropMemTotalInBytes, value.MemTotalInBytes, null, null); - writer.WriteProperty(options, PropMode, value.Mode, null, null); - writer.WriteProperty(options, PropNodesCount, value.NodesCount, null, null); - writer.WriteProperty(options, PropShardsCount, value.ShardsCount, null, null); - writer.WriteProperty(options, PropSkipUnavailable, value.SkipUnavailable, null, null); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteProperty(options, PropTransportCompress, value.TransportCompress, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.RemoteClusterInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.RemoteClusterInfoConverter))] public sealed partial class RemoteClusterInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RepositoryStatsCurrentCounts.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RepositoryStatsCurrentCounts.Converters.g.cs new file mode 100644 index 00000000000..ecdd01be4e1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RepositoryStatsCurrentCounts.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class RepositoryStatsCurrentCountsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropActiveDeletions = System.Text.Json.JsonEncodedText.Encode("active_deletions"); + private static readonly System.Text.Json.JsonEncodedText PropClones = System.Text.Json.JsonEncodedText.Encode("clones"); + private static readonly System.Text.Json.JsonEncodedText PropDeletions = System.Text.Json.JsonEncodedText.Encode("deletions"); + private static readonly System.Text.Json.JsonEncodedText PropFinalizations = System.Text.Json.JsonEncodedText.Encode("finalizations"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); + private static readonly System.Text.Json.JsonEncodedText PropSnapshotDeletions = System.Text.Json.JsonEncodedText.Encode("snapshot_deletions"); + private static readonly System.Text.Json.JsonEncodedText PropSnapshots = System.Text.Json.JsonEncodedText.Encode("snapshots"); + + public override Elastic.Clients.Elasticsearch.Cluster.RepositoryStatsCurrentCounts Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propActiveDeletions = default; + LocalJsonValue propClones = default; + LocalJsonValue propDeletions = default; + LocalJsonValue propFinalizations = default; + LocalJsonValue propShards = default; + LocalJsonValue propSnapshotDeletions = default; + LocalJsonValue propSnapshots = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propActiveDeletions.TryReadProperty(ref reader, options, PropActiveDeletions, null)) + { + continue; + } + + if (propClones.TryReadProperty(ref reader, options, PropClones, null)) + { + continue; + } + + if (propDeletions.TryReadProperty(ref reader, options, PropDeletions, null)) + { + continue; + } + + if (propFinalizations.TryReadProperty(ref reader, options, PropFinalizations, null)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (propSnapshotDeletions.TryReadProperty(ref reader, options, PropSnapshotDeletions, null)) + { + continue; + } + + if (propSnapshots.TryReadProperty(ref reader, options, PropSnapshots, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.RepositoryStatsCurrentCounts(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ActiveDeletions = propActiveDeletions.Value, + Clones = propClones.Value, + Deletions = propDeletions.Value, + Finalizations = propFinalizations.Value, + Shards = propShards.Value, + SnapshotDeletions = propSnapshotDeletions.Value, + Snapshots = propSnapshots.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.RepositoryStatsCurrentCounts value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropActiveDeletions, value.ActiveDeletions, null, null); + writer.WriteProperty(options, PropClones, value.Clones, null, null); + writer.WriteProperty(options, PropDeletions, value.Deletions, null, null); + writer.WriteProperty(options, PropFinalizations, value.Finalizations, null, null); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteProperty(options, PropSnapshotDeletions, value.SnapshotDeletions, null, null); + writer.WriteProperty(options, PropSnapshots, value.Snapshots, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RepositoryStatsCurrentCounts.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RepositoryStatsCurrentCounts.g.cs index 62a4b8bde65..382732c6938 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RepositoryStatsCurrentCounts.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RepositoryStatsCurrentCounts.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class RepositoryStatsCurrentCountsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropActiveDeletions = System.Text.Json.JsonEncodedText.Encode("active_deletions"); - private static readonly System.Text.Json.JsonEncodedText PropClones = System.Text.Json.JsonEncodedText.Encode("clones"); - private static readonly System.Text.Json.JsonEncodedText PropDeletions = System.Text.Json.JsonEncodedText.Encode("deletions"); - private static readonly System.Text.Json.JsonEncodedText PropFinalizations = System.Text.Json.JsonEncodedText.Encode("finalizations"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); - private static readonly System.Text.Json.JsonEncodedText PropSnapshotDeletions = System.Text.Json.JsonEncodedText.Encode("snapshot_deletions"); - private static readonly System.Text.Json.JsonEncodedText PropSnapshots = System.Text.Json.JsonEncodedText.Encode("snapshots"); - - public override Elastic.Clients.Elasticsearch.Cluster.RepositoryStatsCurrentCounts Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propActiveDeletions = default; - LocalJsonValue propClones = default; - LocalJsonValue propDeletions = default; - LocalJsonValue propFinalizations = default; - LocalJsonValue propShards = default; - LocalJsonValue propSnapshotDeletions = default; - LocalJsonValue propSnapshots = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propActiveDeletions.TryReadProperty(ref reader, options, PropActiveDeletions, null)) - { - continue; - } - - if (propClones.TryReadProperty(ref reader, options, PropClones, null)) - { - continue; - } - - if (propDeletions.TryReadProperty(ref reader, options, PropDeletions, null)) - { - continue; - } - - if (propFinalizations.TryReadProperty(ref reader, options, PropFinalizations, null)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (propSnapshotDeletions.TryReadProperty(ref reader, options, PropSnapshotDeletions, null)) - { - continue; - } - - if (propSnapshots.TryReadProperty(ref reader, options, PropSnapshots, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.RepositoryStatsCurrentCounts(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ActiveDeletions = propActiveDeletions.Value, - Clones = propClones.Value, - Deletions = propDeletions.Value, - Finalizations = propFinalizations.Value, - Shards = propShards.Value, - SnapshotDeletions = propSnapshotDeletions.Value, - Snapshots = propSnapshots.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.RepositoryStatsCurrentCounts value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropActiveDeletions, value.ActiveDeletions, null, null); - writer.WriteProperty(options, PropClones, value.Clones, null, null); - writer.WriteProperty(options, PropDeletions, value.Deletions, null, null); - writer.WriteProperty(options, PropFinalizations, value.Finalizations, null, null); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteProperty(options, PropSnapshotDeletions, value.SnapshotDeletions, null, null); - writer.WriteProperty(options, PropSnapshots, value.Snapshots, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.RepositoryStatsCurrentCountsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.RepositoryStatsCurrentCountsConverter))] public sealed partial class RepositoryStatsCurrentCounts { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RepositoryStatsShards.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RepositoryStatsShards.Converters.g.cs new file mode 100644 index 00000000000..53ca3a4e6eb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RepositoryStatsShards.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class RepositoryStatsShardsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropComplete = System.Text.Json.JsonEncodedText.Encode("complete"); + private static readonly System.Text.Json.JsonEncodedText PropIncomplete = System.Text.Json.JsonEncodedText.Encode("incomplete"); + private static readonly System.Text.Json.JsonEncodedText PropStates = System.Text.Json.JsonEncodedText.Encode("states"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Cluster.RepositoryStatsShards Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propComplete = default; + LocalJsonValue propIncomplete = default; + LocalJsonValue> propStates = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propComplete.TryReadProperty(ref reader, options, PropComplete, null)) + { + continue; + } + + if (propIncomplete.TryReadProperty(ref reader, options, PropIncomplete, null)) + { + continue; + } + + if (propStates.TryReadProperty(ref reader, options, PropStates, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.RepositoryStatsShards(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Complete = propComplete.Value, + Incomplete = propIncomplete.Value, + States = propStates.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.RepositoryStatsShards value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropComplete, value.Complete, null, null); + writer.WriteProperty(options, PropIncomplete, value.Incomplete, null, null); + writer.WriteProperty(options, PropStates, value.States, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RepositoryStatsShards.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RepositoryStatsShards.g.cs index 9ff7c0ae711..a7a68f3e94f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RepositoryStatsShards.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RepositoryStatsShards.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class RepositoryStatsShardsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropComplete = System.Text.Json.JsonEncodedText.Encode("complete"); - private static readonly System.Text.Json.JsonEncodedText PropIncomplete = System.Text.Json.JsonEncodedText.Encode("incomplete"); - private static readonly System.Text.Json.JsonEncodedText PropStates = System.Text.Json.JsonEncodedText.Encode("states"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Cluster.RepositoryStatsShards Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propComplete = default; - LocalJsonValue propIncomplete = default; - LocalJsonValue> propStates = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propComplete.TryReadProperty(ref reader, options, PropComplete, null)) - { - continue; - } - - if (propIncomplete.TryReadProperty(ref reader, options, PropIncomplete, null)) - { - continue; - } - - if (propStates.TryReadProperty(ref reader, options, PropStates, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.RepositoryStatsShards(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Complete = propComplete.Value, - Incomplete = propIncomplete.Value, - States = propStates.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.RepositoryStatsShards value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropComplete, value.Complete, null, null); - writer.WriteProperty(options, PropIncomplete, value.Incomplete, null, null); - writer.WriteProperty(options, PropStates, value.States, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.RepositoryStatsShardsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.RepositoryStatsShardsConverter))] public sealed partial class RepositoryStatsShards { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ReservedSize.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ReservedSize.Converters.g.cs new file mode 100644 index 00000000000..03d7702f6b7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ReservedSize.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ReservedSizeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNodeId = System.Text.Json.JsonEncodedText.Encode("node_id"); + private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Cluster.ReservedSize Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propNodeId = default; + LocalJsonValue propPath = default; + LocalJsonValue> propShards = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNodeId.TryReadProperty(ref reader, options, PropNodeId, null)) + { + continue; + } + + if (propPath.TryReadProperty(ref reader, options, PropPath, null)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ReservedSize(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + NodeId = propNodeId.Value, + Path = propPath.Value, + Shards = propShards.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ReservedSize value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNodeId, value.NodeId, null, null); + writer.WriteProperty(options, PropPath, value.Path, null, null); + writer.WriteProperty(options, PropShards, value.Shards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ReservedSize.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ReservedSize.g.cs index 2adff4578b6..6acfa3c17b6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ReservedSize.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ReservedSize.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ReservedSizeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNodeId = System.Text.Json.JsonEncodedText.Encode("node_id"); - private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Cluster.ReservedSize Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propNodeId = default; - LocalJsonValue propPath = default; - LocalJsonValue> propShards = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNodeId.TryReadProperty(ref reader, options, PropNodeId, null)) - { - continue; - } - - if (propPath.TryReadProperty(ref reader, options, PropPath, null)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ReservedSize(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - NodeId = propNodeId.Value, - Path = propPath.Value, - Shards = propShards.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ReservedSize value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNodeId, value.NodeId, null, null); - writer.WriteProperty(options, PropPath, value.Path, null, null); - writer.WriteProperty(options, PropShards, value.Shards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ReservedSizeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ReservedSizeConverter))] public sealed partial class ReservedSize { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RuntimeFieldTypes.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RuntimeFieldTypes.Converters.g.cs new file mode 100644 index 00000000000..f962260757b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RuntimeFieldTypes.Converters.g.cs @@ -0,0 +1,180 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class RuntimeFieldTypesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCharsMax = System.Text.Json.JsonEncodedText.Encode("chars_max"); + private static readonly System.Text.Json.JsonEncodedText PropCharsTotal = System.Text.Json.JsonEncodedText.Encode("chars_total"); + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropDocMax = System.Text.Json.JsonEncodedText.Encode("doc_max"); + private static readonly System.Text.Json.JsonEncodedText PropDocTotal = System.Text.Json.JsonEncodedText.Encode("doc_total"); + private static readonly System.Text.Json.JsonEncodedText PropIndexCount = System.Text.Json.JsonEncodedText.Encode("index_count"); + private static readonly System.Text.Json.JsonEncodedText PropLang = System.Text.Json.JsonEncodedText.Encode("lang"); + private static readonly System.Text.Json.JsonEncodedText PropLinesMax = System.Text.Json.JsonEncodedText.Encode("lines_max"); + private static readonly System.Text.Json.JsonEncodedText PropLinesTotal = System.Text.Json.JsonEncodedText.Encode("lines_total"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropScriptlessCount = System.Text.Json.JsonEncodedText.Encode("scriptless_count"); + private static readonly System.Text.Json.JsonEncodedText PropShadowedCount = System.Text.Json.JsonEncodedText.Encode("shadowed_count"); + private static readonly System.Text.Json.JsonEncodedText PropSourceMax = System.Text.Json.JsonEncodedText.Encode("source_max"); + private static readonly System.Text.Json.JsonEncodedText PropSourceTotal = System.Text.Json.JsonEncodedText.Encode("source_total"); + + public override Elastic.Clients.Elasticsearch.Cluster.RuntimeFieldTypes Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCharsMax = default; + LocalJsonValue propCharsTotal = default; + LocalJsonValue propCount = default; + LocalJsonValue propDocMax = default; + LocalJsonValue propDocTotal = default; + LocalJsonValue propIndexCount = default; + LocalJsonValue> propLang = default; + LocalJsonValue propLinesMax = default; + LocalJsonValue propLinesTotal = default; + LocalJsonValue propName = default; + LocalJsonValue propScriptlessCount = default; + LocalJsonValue propShadowedCount = default; + LocalJsonValue propSourceMax = default; + LocalJsonValue propSourceTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCharsMax.TryReadProperty(ref reader, options, PropCharsMax, null)) + { + continue; + } + + if (propCharsTotal.TryReadProperty(ref reader, options, PropCharsTotal, null)) + { + continue; + } + + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propDocMax.TryReadProperty(ref reader, options, PropDocMax, null)) + { + continue; + } + + if (propDocTotal.TryReadProperty(ref reader, options, PropDocTotal, null)) + { + continue; + } + + if (propIndexCount.TryReadProperty(ref reader, options, PropIndexCount, null)) + { + continue; + } + + if (propLang.TryReadProperty(ref reader, options, PropLang, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propLinesMax.TryReadProperty(ref reader, options, PropLinesMax, null)) + { + continue; + } + + if (propLinesTotal.TryReadProperty(ref reader, options, PropLinesTotal, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propScriptlessCount.TryReadProperty(ref reader, options, PropScriptlessCount, null)) + { + continue; + } + + if (propShadowedCount.TryReadProperty(ref reader, options, PropShadowedCount, null)) + { + continue; + } + + if (propSourceMax.TryReadProperty(ref reader, options, PropSourceMax, null)) + { + continue; + } + + if (propSourceTotal.TryReadProperty(ref reader, options, PropSourceTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.RuntimeFieldTypes(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CharsMax = propCharsMax.Value, + CharsTotal = propCharsTotal.Value, + Count = propCount.Value, + DocMax = propDocMax.Value, + DocTotal = propDocTotal.Value, + IndexCount = propIndexCount.Value, + Lang = propLang.Value, + LinesMax = propLinesMax.Value, + LinesTotal = propLinesTotal.Value, + Name = propName.Value, + ScriptlessCount = propScriptlessCount.Value, + ShadowedCount = propShadowedCount.Value, + SourceMax = propSourceMax.Value, + SourceTotal = propSourceTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.RuntimeFieldTypes value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCharsMax, value.CharsMax, null, null); + writer.WriteProperty(options, PropCharsTotal, value.CharsTotal, null, null); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropDocMax, value.DocMax, null, null); + writer.WriteProperty(options, PropDocTotal, value.DocTotal, null, null); + writer.WriteProperty(options, PropIndexCount, value.IndexCount, null, null); + writer.WriteProperty(options, PropLang, value.Lang, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropLinesMax, value.LinesMax, null, null); + writer.WriteProperty(options, PropLinesTotal, value.LinesTotal, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropScriptlessCount, value.ScriptlessCount, null, null); + writer.WriteProperty(options, PropShadowedCount, value.ShadowedCount, null, null); + writer.WriteProperty(options, PropSourceMax, value.SourceMax, null, null); + writer.WriteProperty(options, PropSourceTotal, value.SourceTotal, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RuntimeFieldTypes.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RuntimeFieldTypes.g.cs index c874d589c31..07c662942d0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RuntimeFieldTypes.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RuntimeFieldTypes.g.cs @@ -23,163 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class RuntimeFieldTypesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCharsMax = System.Text.Json.JsonEncodedText.Encode("chars_max"); - private static readonly System.Text.Json.JsonEncodedText PropCharsTotal = System.Text.Json.JsonEncodedText.Encode("chars_total"); - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropDocMax = System.Text.Json.JsonEncodedText.Encode("doc_max"); - private static readonly System.Text.Json.JsonEncodedText PropDocTotal = System.Text.Json.JsonEncodedText.Encode("doc_total"); - private static readonly System.Text.Json.JsonEncodedText PropIndexCount = System.Text.Json.JsonEncodedText.Encode("index_count"); - private static readonly System.Text.Json.JsonEncodedText PropLang = System.Text.Json.JsonEncodedText.Encode("lang"); - private static readonly System.Text.Json.JsonEncodedText PropLinesMax = System.Text.Json.JsonEncodedText.Encode("lines_max"); - private static readonly System.Text.Json.JsonEncodedText PropLinesTotal = System.Text.Json.JsonEncodedText.Encode("lines_total"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropScriptlessCount = System.Text.Json.JsonEncodedText.Encode("scriptless_count"); - private static readonly System.Text.Json.JsonEncodedText PropShadowedCount = System.Text.Json.JsonEncodedText.Encode("shadowed_count"); - private static readonly System.Text.Json.JsonEncodedText PropSourceMax = System.Text.Json.JsonEncodedText.Encode("source_max"); - private static readonly System.Text.Json.JsonEncodedText PropSourceTotal = System.Text.Json.JsonEncodedText.Encode("source_total"); - - public override Elastic.Clients.Elasticsearch.Cluster.RuntimeFieldTypes Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCharsMax = default; - LocalJsonValue propCharsTotal = default; - LocalJsonValue propCount = default; - LocalJsonValue propDocMax = default; - LocalJsonValue propDocTotal = default; - LocalJsonValue propIndexCount = default; - LocalJsonValue> propLang = default; - LocalJsonValue propLinesMax = default; - LocalJsonValue propLinesTotal = default; - LocalJsonValue propName = default; - LocalJsonValue propScriptlessCount = default; - LocalJsonValue propShadowedCount = default; - LocalJsonValue propSourceMax = default; - LocalJsonValue propSourceTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCharsMax.TryReadProperty(ref reader, options, PropCharsMax, null)) - { - continue; - } - - if (propCharsTotal.TryReadProperty(ref reader, options, PropCharsTotal, null)) - { - continue; - } - - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propDocMax.TryReadProperty(ref reader, options, PropDocMax, null)) - { - continue; - } - - if (propDocTotal.TryReadProperty(ref reader, options, PropDocTotal, null)) - { - continue; - } - - if (propIndexCount.TryReadProperty(ref reader, options, PropIndexCount, null)) - { - continue; - } - - if (propLang.TryReadProperty(ref reader, options, PropLang, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propLinesMax.TryReadProperty(ref reader, options, PropLinesMax, null)) - { - continue; - } - - if (propLinesTotal.TryReadProperty(ref reader, options, PropLinesTotal, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propScriptlessCount.TryReadProperty(ref reader, options, PropScriptlessCount, null)) - { - continue; - } - - if (propShadowedCount.TryReadProperty(ref reader, options, PropShadowedCount, null)) - { - continue; - } - - if (propSourceMax.TryReadProperty(ref reader, options, PropSourceMax, null)) - { - continue; - } - - if (propSourceTotal.TryReadProperty(ref reader, options, PropSourceTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.RuntimeFieldTypes(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CharsMax = propCharsMax.Value, - CharsTotal = propCharsTotal.Value, - Count = propCount.Value, - DocMax = propDocMax.Value, - DocTotal = propDocTotal.Value, - IndexCount = propIndexCount.Value, - Lang = propLang.Value, - LinesMax = propLinesMax.Value, - LinesTotal = propLinesTotal.Value, - Name = propName.Value, - ScriptlessCount = propScriptlessCount.Value, - ShadowedCount = propShadowedCount.Value, - SourceMax = propSourceMax.Value, - SourceTotal = propSourceTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.RuntimeFieldTypes value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCharsMax, value.CharsMax, null, null); - writer.WriteProperty(options, PropCharsTotal, value.CharsTotal, null, null); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropDocMax, value.DocMax, null, null); - writer.WriteProperty(options, PropDocTotal, value.DocTotal, null, null); - writer.WriteProperty(options, PropIndexCount, value.IndexCount, null, null); - writer.WriteProperty(options, PropLang, value.Lang, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropLinesMax, value.LinesMax, null, null); - writer.WriteProperty(options, PropLinesTotal, value.LinesTotal, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropScriptlessCount, value.ScriptlessCount, null, null); - writer.WriteProperty(options, PropShadowedCount, value.ShadowedCount, null, null); - writer.WriteProperty(options, PropSourceMax, value.SourceMax, null, null); - writer.WriteProperty(options, PropSourceTotal, value.SourceTotal, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.RuntimeFieldTypesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.RuntimeFieldTypesConverter))] public sealed partial class RuntimeFieldTypes { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SearchUsageStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SearchUsageStats.Converters.g.cs new file mode 100644 index 00000000000..993451236ba --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SearchUsageStats.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class SearchUsageStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropQueries = System.Text.Json.JsonEncodedText.Encode("queries"); + private static readonly System.Text.Json.JsonEncodedText PropRescorers = System.Text.Json.JsonEncodedText.Encode("rescorers"); + private static readonly System.Text.Json.JsonEncodedText PropRetrievers = System.Text.Json.JsonEncodedText.Encode("retrievers"); + private static readonly System.Text.Json.JsonEncodedText PropSections = System.Text.Json.JsonEncodedText.Encode("sections"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Cluster.SearchUsageStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propQueries = default; + LocalJsonValue> propRescorers = default; + LocalJsonValue> propRetrievers = default; + LocalJsonValue> propSections = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propQueries.TryReadProperty(ref reader, options, PropQueries, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propRescorers.TryReadProperty(ref reader, options, PropRescorers, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propRetrievers.TryReadProperty(ref reader, options, PropRetrievers, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propSections.TryReadProperty(ref reader, options, PropSections, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.SearchUsageStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Queries = propQueries.Value, + Rescorers = propRescorers.Value, + Retrievers = propRetrievers.Value, + Sections = propSections.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.SearchUsageStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropQueries, value.Queries, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropRescorers, value.Rescorers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropRetrievers, value.Retrievers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropSections, value.Sections, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SearchUsageStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SearchUsageStats.g.cs index 0ad308cf849..7423b0fa304 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SearchUsageStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SearchUsageStats.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class SearchUsageStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropQueries = System.Text.Json.JsonEncodedText.Encode("queries"); - private static readonly System.Text.Json.JsonEncodedText PropRescorers = System.Text.Json.JsonEncodedText.Encode("rescorers"); - private static readonly System.Text.Json.JsonEncodedText PropRetrievers = System.Text.Json.JsonEncodedText.Encode("retrievers"); - private static readonly System.Text.Json.JsonEncodedText PropSections = System.Text.Json.JsonEncodedText.Encode("sections"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Cluster.SearchUsageStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propQueries = default; - LocalJsonValue> propRescorers = default; - LocalJsonValue> propRetrievers = default; - LocalJsonValue> propSections = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propQueries.TryReadProperty(ref reader, options, PropQueries, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propRescorers.TryReadProperty(ref reader, options, PropRescorers, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propRetrievers.TryReadProperty(ref reader, options, PropRetrievers, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propSections.TryReadProperty(ref reader, options, PropSections, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.SearchUsageStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Queries = propQueries.Value, - Rescorers = propRescorers.Value, - Retrievers = propRetrievers.Value, - Sections = propSections.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.SearchUsageStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropQueries, value.Queries, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropRescorers, value.Rescorers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropRetrievers, value.Retrievers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropSections, value.Sections, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.SearchUsageStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.SearchUsageStatsConverter))] public sealed partial class SearchUsageStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ShardHealthStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ShardHealthStats.Converters.g.cs new file mode 100644 index 00000000000..b214d6f1b26 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ShardHealthStats.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ShardHealthStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropActiveShards = System.Text.Json.JsonEncodedText.Encode("active_shards"); + private static readonly System.Text.Json.JsonEncodedText PropInitializingShards = System.Text.Json.JsonEncodedText.Encode("initializing_shards"); + private static readonly System.Text.Json.JsonEncodedText PropPrimaryActive = System.Text.Json.JsonEncodedText.Encode("primary_active"); + 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 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 Elastic.Clients.Elasticsearch.Cluster.ShardHealthStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propActiveShards = default; + LocalJsonValue propInitializingShards = default; + LocalJsonValue propPrimaryActive = default; + LocalJsonValue propRelocatingShards = default; + LocalJsonValue propStatus = default; + LocalJsonValue propUnassignedPrimaryShards = default; + LocalJsonValue propUnassignedShards = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propActiveShards.TryReadProperty(ref reader, options, PropActiveShards, null)) + { + continue; + } + + if (propInitializingShards.TryReadProperty(ref reader, options, PropInitializingShards, null)) + { + continue; + } + + if (propPrimaryActive.TryReadProperty(ref reader, options, PropPrimaryActive, null)) + { + continue; + } + + if (propRelocatingShards.TryReadProperty(ref reader, options, PropRelocatingShards, null)) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (propUnassignedPrimaryShards.TryReadProperty(ref reader, options, PropUnassignedPrimaryShards, null)) + { + continue; + } + + if (propUnassignedShards.TryReadProperty(ref reader, options, PropUnassignedShards, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.ShardHealthStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ActiveShards = propActiveShards.Value, + InitializingShards = propInitializingShards.Value, + PrimaryActive = propPrimaryActive.Value, + RelocatingShards = propRelocatingShards.Value, + Status = propStatus.Value, + UnassignedPrimaryShards = propUnassignedPrimaryShards.Value, + UnassignedShards = propUnassignedShards.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ShardHealthStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropActiveShards, value.ActiveShards, null, null); + writer.WriteProperty(options, PropInitializingShards, value.InitializingShards, null, null); + writer.WriteProperty(options, PropPrimaryActive, value.PrimaryActive, null, null); + writer.WriteProperty(options, PropRelocatingShards, value.RelocatingShards, null, null); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteProperty(options, PropUnassignedPrimaryShards, value.UnassignedPrimaryShards, null, null); + writer.WriteProperty(options, PropUnassignedShards, value.UnassignedShards, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ShardHealthStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ShardHealthStats.g.cs index ac485463044..51e5217675c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ShardHealthStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ShardHealthStats.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class ShardHealthStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropActiveShards = System.Text.Json.JsonEncodedText.Encode("active_shards"); - private static readonly System.Text.Json.JsonEncodedText PropInitializingShards = System.Text.Json.JsonEncodedText.Encode("initializing_shards"); - private static readonly System.Text.Json.JsonEncodedText PropPrimaryActive = System.Text.Json.JsonEncodedText.Encode("primary_active"); - 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 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 Elastic.Clients.Elasticsearch.Cluster.ShardHealthStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propActiveShards = default; - LocalJsonValue propInitializingShards = default; - LocalJsonValue propPrimaryActive = default; - LocalJsonValue propRelocatingShards = default; - LocalJsonValue propStatus = default; - LocalJsonValue propUnassignedPrimaryShards = default; - LocalJsonValue propUnassignedShards = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propActiveShards.TryReadProperty(ref reader, options, PropActiveShards, null)) - { - continue; - } - - if (propInitializingShards.TryReadProperty(ref reader, options, PropInitializingShards, null)) - { - continue; - } - - if (propPrimaryActive.TryReadProperty(ref reader, options, PropPrimaryActive, null)) - { - continue; - } - - if (propRelocatingShards.TryReadProperty(ref reader, options, PropRelocatingShards, null)) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (propUnassignedPrimaryShards.TryReadProperty(ref reader, options, PropUnassignedPrimaryShards, null)) - { - continue; - } - - if (propUnassignedShards.TryReadProperty(ref reader, options, PropUnassignedShards, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.ShardHealthStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ActiveShards = propActiveShards.Value, - InitializingShards = propInitializingShards.Value, - PrimaryActive = propPrimaryActive.Value, - RelocatingShards = propRelocatingShards.Value, - Status = propStatus.Value, - UnassignedPrimaryShards = propUnassignedPrimaryShards.Value, - UnassignedShards = propUnassignedShards.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ShardHealthStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropActiveShards, value.ActiveShards, null, null); - writer.WriteProperty(options, PropInitializingShards, value.InitializingShards, null, null); - writer.WriteProperty(options, PropPrimaryActive, value.PrimaryActive, null, null); - writer.WriteProperty(options, PropRelocatingShards, value.RelocatingShards, null, null); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteProperty(options, PropUnassignedPrimaryShards, value.UnassignedPrimaryShards, null, null); - writer.WriteProperty(options, PropUnassignedShards, value.UnassignedShards, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ShardHealthStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ShardHealthStatsConverter))] public sealed partial class ShardHealthStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ShardState.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ShardState.Converters.g.cs new file mode 100644 index 00000000000..5b9c68f1298 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ShardState.Converters.g.cs @@ -0,0 +1,165 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class ShardStateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAborted = System.Text.Json.JsonEncodedText.Encode("ABORTED"); + private static readonly System.Text.Json.JsonEncodedText MemberFailed = System.Text.Json.JsonEncodedText.Encode("FAILED"); + private static readonly System.Text.Json.JsonEncodedText MemberInit = System.Text.Json.JsonEncodedText.Encode("INIT"); + private static readonly System.Text.Json.JsonEncodedText MemberMissing = System.Text.Json.JsonEncodedText.Encode("MISSING"); + private static readonly System.Text.Json.JsonEncodedText MemberPausedForNodeRemoval = System.Text.Json.JsonEncodedText.Encode("PAUSED_FOR_NODE_REMOVAL"); + private static readonly System.Text.Json.JsonEncodedText MemberQueued = System.Text.Json.JsonEncodedText.Encode("QUEUED"); + private static readonly System.Text.Json.JsonEncodedText MemberSuccess = System.Text.Json.JsonEncodedText.Encode("SUCCESS"); + private static readonly System.Text.Json.JsonEncodedText MemberWaiting = System.Text.Json.JsonEncodedText.Encode("WAITING"); + + public override Elastic.Clients.Elasticsearch.Cluster.ShardState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAborted)) + { + return Elastic.Clients.Elasticsearch.Cluster.ShardState.Aborted; + } + + if (reader.ValueTextEquals(MemberFailed)) + { + return Elastic.Clients.Elasticsearch.Cluster.ShardState.Failed; + } + + if (reader.ValueTextEquals(MemberInit)) + { + return Elastic.Clients.Elasticsearch.Cluster.ShardState.Init; + } + + if (reader.ValueTextEquals(MemberMissing)) + { + return Elastic.Clients.Elasticsearch.Cluster.ShardState.Missing; + } + + if (reader.ValueTextEquals(MemberPausedForNodeRemoval)) + { + return Elastic.Clients.Elasticsearch.Cluster.ShardState.PausedForNodeRemoval; + } + + if (reader.ValueTextEquals(MemberQueued)) + { + return Elastic.Clients.Elasticsearch.Cluster.ShardState.Queued; + } + + if (reader.ValueTextEquals(MemberSuccess)) + { + return Elastic.Clients.Elasticsearch.Cluster.ShardState.Success; + } + + if (reader.ValueTextEquals(MemberWaiting)) + { + return Elastic.Clients.Elasticsearch.Cluster.ShardState.Waiting; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAborted.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.ShardState.Aborted; + } + + if (string.Equals(value, MemberFailed.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.ShardState.Failed; + } + + if (string.Equals(value, MemberInit.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.ShardState.Init; + } + + if (string.Equals(value, MemberMissing.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.ShardState.Missing; + } + + if (string.Equals(value, MemberPausedForNodeRemoval.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.ShardState.PausedForNodeRemoval; + } + + if (string.Equals(value, MemberQueued.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.ShardState.Queued; + } + + if (string.Equals(value, MemberSuccess.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.ShardState.Success; + } + + if (string.Equals(value, MemberWaiting.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.ShardState.Waiting; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Cluster.ShardState)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ShardState value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Cluster.ShardState.Aborted: + writer.WriteStringValue(MemberAborted); + break; + case Elastic.Clients.Elasticsearch.Cluster.ShardState.Failed: + writer.WriteStringValue(MemberFailed); + break; + case Elastic.Clients.Elasticsearch.Cluster.ShardState.Init: + writer.WriteStringValue(MemberInit); + break; + case Elastic.Clients.Elasticsearch.Cluster.ShardState.Missing: + writer.WriteStringValue(MemberMissing); + break; + case Elastic.Clients.Elasticsearch.Cluster.ShardState.PausedForNodeRemoval: + writer.WriteStringValue(MemberPausedForNodeRemoval); + break; + case Elastic.Clients.Elasticsearch.Cluster.ShardState.Queued: + writer.WriteStringValue(MemberQueued); + break; + case Elastic.Clients.Elasticsearch.Cluster.ShardState.Success: + writer.WriteStringValue(MemberSuccess); + break; + case Elastic.Clients.Elasticsearch.Cluster.ShardState.Waiting: + writer.WriteStringValue(MemberWaiting); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Cluster.ShardState)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Cluster.ShardState ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ShardState value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ShardState.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ShardState.g.cs new file mode 100644 index 00000000000..fe1f13be19b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ShardState.g.cs @@ -0,0 +1,45 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.ShardStateConverter))] +public enum ShardState +{ + [System.Runtime.Serialization.EnumMember(Value = "ABORTED")] + Aborted, + [System.Runtime.Serialization.EnumMember(Value = "FAILED")] + Failed, + [System.Runtime.Serialization.EnumMember(Value = "INIT")] + Init, + [System.Runtime.Serialization.EnumMember(Value = "MISSING")] + Missing, + [System.Runtime.Serialization.EnumMember(Value = "PAUSED_FOR_NODE_REMOVAL")] + PausedForNodeRemoval, + [System.Runtime.Serialization.EnumMember(Value = "QUEUED")] + Queued, + [System.Runtime.Serialization.EnumMember(Value = "SUCCESS")] + Success, + [System.Runtime.Serialization.EnumMember(Value = "WAITING")] + Waiting +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SnapshotCurrentCounts.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SnapshotCurrentCounts.Converters.g.cs new file mode 100644 index 00000000000..8ee6995015e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SnapshotCurrentCounts.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class SnapshotCurrentCountsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCleanups = System.Text.Json.JsonEncodedText.Encode("cleanups"); + private static readonly System.Text.Json.JsonEncodedText PropConcurrentOperations = System.Text.Json.JsonEncodedText.Encode("concurrent_operations"); + private static readonly System.Text.Json.JsonEncodedText PropShardSnapshots = System.Text.Json.JsonEncodedText.Encode("shard_snapshots"); + private static readonly System.Text.Json.JsonEncodedText PropSnapshotDeletions = System.Text.Json.JsonEncodedText.Encode("snapshot_deletions"); + private static readonly System.Text.Json.JsonEncodedText PropSnapshots = System.Text.Json.JsonEncodedText.Encode("snapshots"); + + public override Elastic.Clients.Elasticsearch.Cluster.SnapshotCurrentCounts Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCleanups = default; + LocalJsonValue propConcurrentOperations = default; + LocalJsonValue propShardSnapshots = default; + LocalJsonValue propSnapshotDeletions = default; + LocalJsonValue propSnapshots = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCleanups.TryReadProperty(ref reader, options, PropCleanups, null)) + { + continue; + } + + if (propConcurrentOperations.TryReadProperty(ref reader, options, PropConcurrentOperations, null)) + { + continue; + } + + if (propShardSnapshots.TryReadProperty(ref reader, options, PropShardSnapshots, null)) + { + continue; + } + + if (propSnapshotDeletions.TryReadProperty(ref reader, options, PropSnapshotDeletions, null)) + { + continue; + } + + if (propSnapshots.TryReadProperty(ref reader, options, PropSnapshots, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.SnapshotCurrentCounts(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Cleanups = propCleanups.Value, + ConcurrentOperations = propConcurrentOperations.Value, + ShardSnapshots = propShardSnapshots.Value, + SnapshotDeletions = propSnapshotDeletions.Value, + Snapshots = propSnapshots.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.SnapshotCurrentCounts value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCleanups, value.Cleanups, null, null); + writer.WriteProperty(options, PropConcurrentOperations, value.ConcurrentOperations, null, null); + writer.WriteProperty(options, PropShardSnapshots, value.ShardSnapshots, null, null); + writer.WriteProperty(options, PropSnapshotDeletions, value.SnapshotDeletions, null, null); + writer.WriteProperty(options, PropSnapshots, value.Snapshots, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SnapshotCurrentCounts.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SnapshotCurrentCounts.g.cs index 7a21c0e38ae..1f05103aeef 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SnapshotCurrentCounts.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SnapshotCurrentCounts.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class SnapshotCurrentCountsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCleanups = System.Text.Json.JsonEncodedText.Encode("cleanups"); - private static readonly System.Text.Json.JsonEncodedText PropConcurrentOperations = System.Text.Json.JsonEncodedText.Encode("concurrent_operations"); - private static readonly System.Text.Json.JsonEncodedText PropShardSnapshots = System.Text.Json.JsonEncodedText.Encode("shard_snapshots"); - private static readonly System.Text.Json.JsonEncodedText PropSnapshotDeletions = System.Text.Json.JsonEncodedText.Encode("snapshot_deletions"); - private static readonly System.Text.Json.JsonEncodedText PropSnapshots = System.Text.Json.JsonEncodedText.Encode("snapshots"); - - public override Elastic.Clients.Elasticsearch.Cluster.SnapshotCurrentCounts Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCleanups = default; - LocalJsonValue propConcurrentOperations = default; - LocalJsonValue propShardSnapshots = default; - LocalJsonValue propSnapshotDeletions = default; - LocalJsonValue propSnapshots = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCleanups.TryReadProperty(ref reader, options, PropCleanups, null)) - { - continue; - } - - if (propConcurrentOperations.TryReadProperty(ref reader, options, PropConcurrentOperations, null)) - { - continue; - } - - if (propShardSnapshots.TryReadProperty(ref reader, options, PropShardSnapshots, null)) - { - continue; - } - - if (propSnapshotDeletions.TryReadProperty(ref reader, options, PropSnapshotDeletions, null)) - { - continue; - } - - if (propSnapshots.TryReadProperty(ref reader, options, PropSnapshots, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.SnapshotCurrentCounts(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Cleanups = propCleanups.Value, - ConcurrentOperations = propConcurrentOperations.Value, - ShardSnapshots = propShardSnapshots.Value, - SnapshotDeletions = propSnapshotDeletions.Value, - Snapshots = propSnapshots.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.SnapshotCurrentCounts value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCleanups, value.Cleanups, null, null); - writer.WriteProperty(options, PropConcurrentOperations, value.ConcurrentOperations, null, null); - writer.WriteProperty(options, PropShardSnapshots, value.ShardSnapshots, null, null); - writer.WriteProperty(options, PropSnapshotDeletions, value.SnapshotDeletions, null, null); - writer.WriteProperty(options, PropSnapshots, value.Snapshots, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.SnapshotCurrentCountsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.SnapshotCurrentCountsConverter))] public sealed partial class SnapshotCurrentCounts { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SparseVectorStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SparseVectorStats.Converters.g.cs new file mode 100644 index 00000000000..1b9d780f1f6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SparseVectorStats.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class SparseVectorStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropValueCount = System.Text.Json.JsonEncodedText.Encode("value_count"); + + public override Elastic.Clients.Elasticsearch.Cluster.SparseVectorStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propValueCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propValueCount.TryReadProperty(ref reader, options, PropValueCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.SparseVectorStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ValueCount = propValueCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.SparseVectorStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropValueCount, value.ValueCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SparseVectorStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SparseVectorStats.g.cs index ef3ff1fbf6a..c482f0e9762 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SparseVectorStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SparseVectorStats.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class SparseVectorStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropValueCount = System.Text.Json.JsonEncodedText.Encode("value_count"); - - public override Elastic.Clients.Elasticsearch.Cluster.SparseVectorStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propValueCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propValueCount.TryReadProperty(ref reader, options, PropValueCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.SparseVectorStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ValueCount = propValueCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.SparseVectorStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropValueCount, value.ValueCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.SparseVectorStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.SparseVectorStatsConverter))] public sealed partial class SparseVectorStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SynonymsStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SynonymsStats.Converters.g.cs new file mode 100644 index 00000000000..c04b339b2e1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SynonymsStats.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class SynonymsStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropIndexCount = System.Text.Json.JsonEncodedText.Encode("index_count"); + + public override Elastic.Clients.Elasticsearch.Cluster.SynonymsStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propIndexCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propIndexCount.TryReadProperty(ref reader, options, PropIndexCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.SynonymsStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + IndexCount = propIndexCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.SynonymsStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropIndexCount, value.IndexCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SynonymsStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SynonymsStats.g.cs index bc059b5063c..317957196ca 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SynonymsStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SynonymsStats.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class SynonymsStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropIndexCount = System.Text.Json.JsonEncodedText.Encode("index_count"); - - public override Elastic.Clients.Elasticsearch.Cluster.SynonymsStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propIndexCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propIndexCount.TryReadProperty(ref reader, options, PropIndexCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.SynonymsStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - IndexCount = propIndexCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.SynonymsStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropIndexCount, value.IndexCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.SynonymsStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.SynonymsStatsConverter))] public sealed partial class SynonymsStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/UnassignedInformation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/UnassignedInformation.Converters.g.cs new file mode 100644 index 00000000000..c67945365c0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/UnassignedInformation.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class UnassignedInformationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllocationStatus = System.Text.Json.JsonEncodedText.Encode("allocation_status"); + private static readonly System.Text.Json.JsonEncodedText PropAt = System.Text.Json.JsonEncodedText.Encode("at"); + private static readonly System.Text.Json.JsonEncodedText PropDelayed = System.Text.Json.JsonEncodedText.Encode("delayed"); + private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); + private static readonly System.Text.Json.JsonEncodedText PropFailedAllocationAttempts = System.Text.Json.JsonEncodedText.Encode("failed_allocation_attempts"); + private static readonly System.Text.Json.JsonEncodedText PropLastAllocationStatus = System.Text.Json.JsonEncodedText.Encode("last_allocation_status"); + private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); + + public override Elastic.Clients.Elasticsearch.Cluster.UnassignedInformation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllocationStatus = default; + LocalJsonValue propAt = default; + LocalJsonValue propDelayed = default; + LocalJsonValue propDetails = default; + LocalJsonValue propFailedAllocationAttempts = default; + LocalJsonValue propLastAllocationStatus = default; + LocalJsonValue propReason = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllocationStatus.TryReadProperty(ref reader, options, PropAllocationStatus, null)) + { + continue; + } + + if (propAt.TryReadProperty(ref reader, options, PropAt, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propDelayed.TryReadProperty(ref reader, options, PropDelayed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDetails.TryReadProperty(ref reader, options, PropDetails, null)) + { + continue; + } + + if (propFailedAllocationAttempts.TryReadProperty(ref reader, options, PropFailedAllocationAttempts, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLastAllocationStatus.TryReadProperty(ref reader, options, PropLastAllocationStatus, null)) + { + continue; + } + + if (propReason.TryReadProperty(ref reader, options, PropReason, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.UnassignedInformation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllocationStatus = propAllocationStatus.Value, + At = propAt.Value, + Delayed = propDelayed.Value, + Details = propDetails.Value, + FailedAllocationAttempts = propFailedAllocationAttempts.Value, + LastAllocationStatus = propLastAllocationStatus.Value, + Reason = propReason.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.UnassignedInformation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllocationStatus, value.AllocationStatus, null, null); + writer.WriteProperty(options, PropAt, value.At, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropDelayed, value.Delayed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDetails, value.Details, null, null); + writer.WriteProperty(options, PropFailedAllocationAttempts, value.FailedAllocationAttempts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLastAllocationStatus, value.LastAllocationStatus, null, null); + writer.WriteProperty(options, PropReason, value.Reason, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/UnassignedInformation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/UnassignedInformation.g.cs index 2025f641819..9f9c03bf859 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/UnassignedInformation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/UnassignedInformation.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; -internal sealed partial class UnassignedInformationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllocationStatus = System.Text.Json.JsonEncodedText.Encode("allocation_status"); - private static readonly System.Text.Json.JsonEncodedText PropAt = System.Text.Json.JsonEncodedText.Encode("at"); - private static readonly System.Text.Json.JsonEncodedText PropDelayed = System.Text.Json.JsonEncodedText.Encode("delayed"); - private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); - private static readonly System.Text.Json.JsonEncodedText PropFailedAllocationAttempts = System.Text.Json.JsonEncodedText.Encode("failed_allocation_attempts"); - private static readonly System.Text.Json.JsonEncodedText PropLastAllocationStatus = System.Text.Json.JsonEncodedText.Encode("last_allocation_status"); - private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); - - public override Elastic.Clients.Elasticsearch.Cluster.UnassignedInformation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllocationStatus = default; - LocalJsonValue propAt = default; - LocalJsonValue propDelayed = default; - LocalJsonValue propDetails = default; - LocalJsonValue propFailedAllocationAttempts = default; - LocalJsonValue propLastAllocationStatus = default; - LocalJsonValue propReason = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllocationStatus.TryReadProperty(ref reader, options, PropAllocationStatus, null)) - { - continue; - } - - if (propAt.TryReadProperty(ref reader, options, PropAt, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propDelayed.TryReadProperty(ref reader, options, PropDelayed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDetails.TryReadProperty(ref reader, options, PropDetails, null)) - { - continue; - } - - if (propFailedAllocationAttempts.TryReadProperty(ref reader, options, PropFailedAllocationAttempts, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLastAllocationStatus.TryReadProperty(ref reader, options, PropLastAllocationStatus, null)) - { - continue; - } - - if (propReason.TryReadProperty(ref reader, options, PropReason, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Cluster.UnassignedInformation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllocationStatus = propAllocationStatus.Value, - At = propAt.Value, - Delayed = propDelayed.Value, - Details = propDetails.Value, - FailedAllocationAttempts = propFailedAllocationAttempts.Value, - LastAllocationStatus = propLastAllocationStatus.Value, - Reason = propReason.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.UnassignedInformation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllocationStatus, value.AllocationStatus, null, null); - writer.WriteProperty(options, PropAt, value.At, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropDelayed, value.Delayed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDetails, value.Details, null, null); - writer.WriteProperty(options, PropFailedAllocationAttempts, value.FailedAllocationAttempts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLastAllocationStatus, value.LastAllocationStatus, null, null); - writer.WriteProperty(options, PropReason, value.Reason, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.UnassignedInformationConverter))] public sealed partial class UnassignedInformation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/UnassignedInformationReason.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/UnassignedInformationReason.Converters.g.cs new file mode 100644 index 00000000000..41ecb209b9b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/UnassignedInformationReason.Converters.g.cs @@ -0,0 +1,263 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class UnassignedInformationReasonConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAllocationFailed = System.Text.Json.JsonEncodedText.Encode("ALLOCATION_FAILED"); + private static readonly System.Text.Json.JsonEncodedText MemberClusterRecovered = System.Text.Json.JsonEncodedText.Encode("CLUSTER_RECOVERED"); + private static readonly System.Text.Json.JsonEncodedText MemberDanglingIndexImported = System.Text.Json.JsonEncodedText.Encode("DANGLING_INDEX_IMPORTED"); + private static readonly System.Text.Json.JsonEncodedText MemberExistingIndexRestored = System.Text.Json.JsonEncodedText.Encode("EXISTING_INDEX_RESTORED"); + private static readonly System.Text.Json.JsonEncodedText MemberForcedEmptyPrimary = System.Text.Json.JsonEncodedText.Encode("FORCED_EMPTY_PRIMARY"); + private static readonly System.Text.Json.JsonEncodedText MemberIndexCreated = System.Text.Json.JsonEncodedText.Encode("INDEX_CREATED"); + private static readonly System.Text.Json.JsonEncodedText MemberIndexReopened = System.Text.Json.JsonEncodedText.Encode("INDEX_REOPENED"); + private static readonly System.Text.Json.JsonEncodedText MemberManualAllocation = System.Text.Json.JsonEncodedText.Encode("MANUAL_ALLOCATION"); + private static readonly System.Text.Json.JsonEncodedText MemberNewIndexRestored = System.Text.Json.JsonEncodedText.Encode("NEW_INDEX_RESTORED"); + private static readonly System.Text.Json.JsonEncodedText MemberNodeLeft = System.Text.Json.JsonEncodedText.Encode("NODE_LEFT"); + private static readonly System.Text.Json.JsonEncodedText MemberPrimaryFailed = System.Text.Json.JsonEncodedText.Encode("PRIMARY_FAILED"); + private static readonly System.Text.Json.JsonEncodedText MemberReallocatedReplica = System.Text.Json.JsonEncodedText.Encode("REALLOCATED_REPLICA"); + private static readonly System.Text.Json.JsonEncodedText MemberReinitialized = System.Text.Json.JsonEncodedText.Encode("REINITIALIZED"); + private static readonly System.Text.Json.JsonEncodedText MemberReplicaAdded = System.Text.Json.JsonEncodedText.Encode("REPLICA_ADDED"); + private static readonly System.Text.Json.JsonEncodedText MemberRerouteCancelled = System.Text.Json.JsonEncodedText.Encode("REROUTE_CANCELLED"); + + public override Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAllocationFailed)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.AllocationFailed; + } + + if (reader.ValueTextEquals(MemberClusterRecovered)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ClusterRecovered; + } + + if (reader.ValueTextEquals(MemberDanglingIndexImported)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.DanglingIndexImported; + } + + if (reader.ValueTextEquals(MemberExistingIndexRestored)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ExistingIndexRestored; + } + + if (reader.ValueTextEquals(MemberForcedEmptyPrimary)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ForcedEmptyPrimary; + } + + if (reader.ValueTextEquals(MemberIndexCreated)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.IndexCreated; + } + + if (reader.ValueTextEquals(MemberIndexReopened)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.IndexReopened; + } + + if (reader.ValueTextEquals(MemberManualAllocation)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ManualAllocation; + } + + if (reader.ValueTextEquals(MemberNewIndexRestored)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.NewIndexRestored; + } + + if (reader.ValueTextEquals(MemberNodeLeft)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.NodeLeft; + } + + if (reader.ValueTextEquals(MemberPrimaryFailed)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.PrimaryFailed; + } + + if (reader.ValueTextEquals(MemberReallocatedReplica)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ReallocatedReplica; + } + + if (reader.ValueTextEquals(MemberReinitialized)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.Reinitialized; + } + + if (reader.ValueTextEquals(MemberReplicaAdded)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ReplicaAdded; + } + + if (reader.ValueTextEquals(MemberRerouteCancelled)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.RerouteCancelled; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAllocationFailed.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.AllocationFailed; + } + + if (string.Equals(value, MemberClusterRecovered.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ClusterRecovered; + } + + if (string.Equals(value, MemberDanglingIndexImported.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.DanglingIndexImported; + } + + if (string.Equals(value, MemberExistingIndexRestored.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ExistingIndexRestored; + } + + if (string.Equals(value, MemberForcedEmptyPrimary.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ForcedEmptyPrimary; + } + + if (string.Equals(value, MemberIndexCreated.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.IndexCreated; + } + + if (string.Equals(value, MemberIndexReopened.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.IndexReopened; + } + + if (string.Equals(value, MemberManualAllocation.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ManualAllocation; + } + + if (string.Equals(value, MemberNewIndexRestored.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.NewIndexRestored; + } + + if (string.Equals(value, MemberNodeLeft.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.NodeLeft; + } + + if (string.Equals(value, MemberPrimaryFailed.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.PrimaryFailed; + } + + if (string.Equals(value, MemberReallocatedReplica.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ReallocatedReplica; + } + + if (string.Equals(value, MemberReinitialized.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.Reinitialized; + } + + if (string.Equals(value, MemberReplicaAdded.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ReplicaAdded; + } + + if (string.Equals(value, MemberRerouteCancelled.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.RerouteCancelled; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.AllocationFailed: + writer.WriteStringValue(MemberAllocationFailed); + break; + case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ClusterRecovered: + writer.WriteStringValue(MemberClusterRecovered); + break; + case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.DanglingIndexImported: + writer.WriteStringValue(MemberDanglingIndexImported); + break; + case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ExistingIndexRestored: + writer.WriteStringValue(MemberExistingIndexRestored); + break; + case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ForcedEmptyPrimary: + writer.WriteStringValue(MemberForcedEmptyPrimary); + break; + case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.IndexCreated: + writer.WriteStringValue(MemberIndexCreated); + break; + case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.IndexReopened: + writer.WriteStringValue(MemberIndexReopened); + break; + case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ManualAllocation: + writer.WriteStringValue(MemberManualAllocation); + break; + case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.NewIndexRestored: + writer.WriteStringValue(MemberNewIndexRestored); + break; + case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.NodeLeft: + writer.WriteStringValue(MemberNodeLeft); + break; + case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.PrimaryFailed: + writer.WriteStringValue(MemberPrimaryFailed); + break; + case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ReallocatedReplica: + writer.WriteStringValue(MemberReallocatedReplica); + break; + case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.Reinitialized: + writer.WriteStringValue(MemberReinitialized); + break; + case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ReplicaAdded: + writer.WriteStringValue(MemberReplicaAdded); + break; + case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.RerouteCancelled: + writer.WriteStringValue(MemberRerouteCancelled); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/UnassignedInformationReason.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/UnassignedInformationReason.g.cs new file mode 100644 index 00000000000..d1ce9c40ca5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/UnassignedInformationReason.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.UnassignedInformationReasonConverter))] +public enum UnassignedInformationReason +{ + [System.Runtime.Serialization.EnumMember(Value = "ALLOCATION_FAILED")] + AllocationFailed, + [System.Runtime.Serialization.EnumMember(Value = "CLUSTER_RECOVERED")] + ClusterRecovered, + [System.Runtime.Serialization.EnumMember(Value = "DANGLING_INDEX_IMPORTED")] + DanglingIndexImported, + [System.Runtime.Serialization.EnumMember(Value = "EXISTING_INDEX_RESTORED")] + ExistingIndexRestored, + [System.Runtime.Serialization.EnumMember(Value = "FORCED_EMPTY_PRIMARY")] + ForcedEmptyPrimary, + [System.Runtime.Serialization.EnumMember(Value = "INDEX_CREATED")] + IndexCreated, + [System.Runtime.Serialization.EnumMember(Value = "INDEX_REOPENED")] + IndexReopened, + [System.Runtime.Serialization.EnumMember(Value = "MANUAL_ALLOCATION")] + ManualAllocation, + [System.Runtime.Serialization.EnumMember(Value = "NEW_INDEX_RESTORED")] + NewIndexRestored, + [System.Runtime.Serialization.EnumMember(Value = "NODE_LEFT")] + NodeLeft, + [System.Runtime.Serialization.EnumMember(Value = "PRIMARY_FAILED")] + PrimaryFailed, + [System.Runtime.Serialization.EnumMember(Value = "REALLOCATED_REPLICA")] + ReallocatedReplica, + [System.Runtime.Serialization.EnumMember(Value = "REINITIALIZED")] + Reinitialized, + [System.Runtime.Serialization.EnumMember(Value = "REPLICA_ADDED")] + ReplicaAdded, + [System.Runtime.Serialization.EnumMember(Value = "REROUTE_CANCELLED")] + RerouteCancelled +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterDetails.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterDetails.Converters.g.cs new file mode 100644 index 00000000000..653c80e0d38 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterDetails.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ClusterDetailsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFailures = System.Text.Json.JsonEncodedText.Encode("failures"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); + private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); + + public override Elastic.Clients.Elasticsearch.ClusterDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propFailures = default; + LocalJsonValue propIndices = default; + LocalJsonValue propShards = default; + LocalJsonValue propStatus = default; + LocalJsonValue propTimedOut = default; + LocalJsonValue propTook = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFailures.TryReadProperty(ref reader, options, PropFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, null)) + { + continue; + } + + if (propTook.TryReadProperty(ref reader, options, PropTook, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ClusterDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Failures = propFailures.Value, + Indices = propIndices.Value, + Shards = propShards.Value, + Status = propStatus.Value, + TimedOut = propTimedOut.Value, + Took = propTook.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ClusterDetails value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFailures, value.Failures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIndices, value.Indices, null, null); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, null); + writer.WriteProperty(options, PropTook, value.Took, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterDetails.g.cs index a792384130b..3bc255bd2c5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterDetails.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterDetails.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class ClusterDetailsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFailures = System.Text.Json.JsonEncodedText.Encode("failures"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); - private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); - - public override Elastic.Clients.Elasticsearch.ClusterDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propFailures = default; - LocalJsonValue propIndices = default; - LocalJsonValue propShards = default; - LocalJsonValue propStatus = default; - LocalJsonValue propTimedOut = default; - LocalJsonValue propTook = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFailures.TryReadProperty(ref reader, options, PropFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, null)) - { - continue; - } - - if (propTook.TryReadProperty(ref reader, options, PropTook, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ClusterDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Failures = propFailures.Value, - Indices = propIndices.Value, - Shards = propShards.Value, - Status = propStatus.Value, - TimedOut = propTimedOut.Value, - Took = propTook.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ClusterDetails value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFailures, value.Failures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIndices, value.Indices, null, null); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, null); - writer.WriteProperty(options, PropTook, value.Took, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ClusterDetailsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ClusterDetailsConverter))] public sealed partial class ClusterDetails { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterInfoTarget.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterInfoTarget.Converters.g.cs new file mode 100644 index 00000000000..061fff08ce2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterInfoTarget.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ClusterInfoTargetConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAll = System.Text.Json.JsonEncodedText.Encode("_all"); + private static readonly System.Text.Json.JsonEncodedText MemberHttp = System.Text.Json.JsonEncodedText.Encode("http"); + private static readonly System.Text.Json.JsonEncodedText MemberIngest = System.Text.Json.JsonEncodedText.Encode("ingest"); + private static readonly System.Text.Json.JsonEncodedText MemberScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText MemberThreadPool = System.Text.Json.JsonEncodedText.Encode("thread_pool"); + + public override Elastic.Clients.Elasticsearch.ClusterInfoTarget Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAll)) + { + return Elastic.Clients.Elasticsearch.ClusterInfoTarget.All; + } + + if (reader.ValueTextEquals(MemberHttp)) + { + return Elastic.Clients.Elasticsearch.ClusterInfoTarget.Http; + } + + if (reader.ValueTextEquals(MemberIngest)) + { + return Elastic.Clients.Elasticsearch.ClusterInfoTarget.Ingest; + } + + if (reader.ValueTextEquals(MemberScript)) + { + return Elastic.Clients.Elasticsearch.ClusterInfoTarget.Script; + } + + if (reader.ValueTextEquals(MemberThreadPool)) + { + return Elastic.Clients.Elasticsearch.ClusterInfoTarget.ThreadPool; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAll.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.ClusterInfoTarget.All; + } + + if (string.Equals(value, MemberHttp.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.ClusterInfoTarget.Http; + } + + if (string.Equals(value, MemberIngest.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.ClusterInfoTarget.Ingest; + } + + if (string.Equals(value, MemberScript.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.ClusterInfoTarget.Script; + } + + if (string.Equals(value, MemberThreadPool.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.ClusterInfoTarget.ThreadPool; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.ClusterInfoTarget)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ClusterInfoTarget value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.ClusterInfoTarget.All: + writer.WriteStringValue(MemberAll); + break; + case Elastic.Clients.Elasticsearch.ClusterInfoTarget.Http: + writer.WriteStringValue(MemberHttp); + break; + case Elastic.Clients.Elasticsearch.ClusterInfoTarget.Ingest: + writer.WriteStringValue(MemberIngest); + break; + case Elastic.Clients.Elasticsearch.ClusterInfoTarget.Script: + writer.WriteStringValue(MemberScript); + break; + case Elastic.Clients.Elasticsearch.ClusterInfoTarget.ThreadPool: + writer.WriteStringValue(MemberThreadPool); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.ClusterInfoTarget)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.ClusterInfoTarget ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ClusterInfoTarget value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterInfoTarget.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterInfoTarget.g.cs new file mode 100644 index 00000000000..303e1d440af --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterInfoTarget.g.cs @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ClusterInfoTargetConverter))] +public enum ClusterInfoTarget +{ + [System.Runtime.Serialization.EnumMember(Value = "_all")] + All, + [System.Runtime.Serialization.EnumMember(Value = "http")] + Http, + [System.Runtime.Serialization.EnumMember(Value = "ingest")] + Ingest, + [System.Runtime.Serialization.EnumMember(Value = "script")] + Script, + [System.Runtime.Serialization.EnumMember(Value = "thread_pool")] + ThreadPool +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterSearchStatus.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterSearchStatus.Converters.g.cs new file mode 100644 index 00000000000..c178b2a1ac6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterSearchStatus.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ClusterSearchStatusConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberFailed = System.Text.Json.JsonEncodedText.Encode("failed"); + private static readonly System.Text.Json.JsonEncodedText MemberPartial = System.Text.Json.JsonEncodedText.Encode("partial"); + private static readonly System.Text.Json.JsonEncodedText MemberRunning = System.Text.Json.JsonEncodedText.Encode("running"); + private static readonly System.Text.Json.JsonEncodedText MemberSkipped = System.Text.Json.JsonEncodedText.Encode("skipped"); + private static readonly System.Text.Json.JsonEncodedText MemberSuccessful = System.Text.Json.JsonEncodedText.Encode("successful"); + + public override Elastic.Clients.Elasticsearch.ClusterSearchStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberFailed)) + { + return Elastic.Clients.Elasticsearch.ClusterSearchStatus.Failed; + } + + if (reader.ValueTextEquals(MemberPartial)) + { + return Elastic.Clients.Elasticsearch.ClusterSearchStatus.Partial; + } + + if (reader.ValueTextEquals(MemberRunning)) + { + return Elastic.Clients.Elasticsearch.ClusterSearchStatus.Running; + } + + if (reader.ValueTextEquals(MemberSkipped)) + { + return Elastic.Clients.Elasticsearch.ClusterSearchStatus.Skipped; + } + + if (reader.ValueTextEquals(MemberSuccessful)) + { + return Elastic.Clients.Elasticsearch.ClusterSearchStatus.Successful; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberFailed.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.ClusterSearchStatus.Failed; + } + + if (string.Equals(value, MemberPartial.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.ClusterSearchStatus.Partial; + } + + if (string.Equals(value, MemberRunning.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.ClusterSearchStatus.Running; + } + + if (string.Equals(value, MemberSkipped.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.ClusterSearchStatus.Skipped; + } + + if (string.Equals(value, MemberSuccessful.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.ClusterSearchStatus.Successful; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.ClusterSearchStatus)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ClusterSearchStatus value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.ClusterSearchStatus.Failed: + writer.WriteStringValue(MemberFailed); + break; + case Elastic.Clients.Elasticsearch.ClusterSearchStatus.Partial: + writer.WriteStringValue(MemberPartial); + break; + case Elastic.Clients.Elasticsearch.ClusterSearchStatus.Running: + writer.WriteStringValue(MemberRunning); + break; + case Elastic.Clients.Elasticsearch.ClusterSearchStatus.Skipped: + writer.WriteStringValue(MemberSkipped); + break; + case Elastic.Clients.Elasticsearch.ClusterSearchStatus.Successful: + writer.WriteStringValue(MemberSuccessful); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.ClusterSearchStatus)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.ClusterSearchStatus ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ClusterSearchStatus value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterSearchStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterSearchStatus.g.cs new file mode 100644 index 00000000000..4ea6637e5f7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterSearchStatus.g.cs @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ClusterSearchStatusConverter))] +public enum ClusterSearchStatus +{ + [System.Runtime.Serialization.EnumMember(Value = "failed")] + Failed, + [System.Runtime.Serialization.EnumMember(Value = "partial")] + Partial, + [System.Runtime.Serialization.EnumMember(Value = "running")] + Running, + [System.Runtime.Serialization.EnumMember(Value = "skipped")] + Skipped, + [System.Runtime.Serialization.EnumMember(Value = "successful")] + Successful +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterStatistics.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterStatistics.Converters.g.cs new file mode 100644 index 00000000000..25bf07baa5c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterStatistics.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ClusterStatisticsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); + private static readonly System.Text.Json.JsonEncodedText PropFailed = System.Text.Json.JsonEncodedText.Encode("failed"); + private static readonly System.Text.Json.JsonEncodedText PropPartial = System.Text.Json.JsonEncodedText.Encode("partial"); + private static readonly System.Text.Json.JsonEncodedText PropRunning = System.Text.Json.JsonEncodedText.Encode("running"); + private static readonly System.Text.Json.JsonEncodedText PropSkipped = System.Text.Json.JsonEncodedText.Encode("skipped"); + private static readonly System.Text.Json.JsonEncodedText PropSuccessful = System.Text.Json.JsonEncodedText.Encode("successful"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.ClusterStatistics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propDetails = default; + LocalJsonValue propFailed = default; + LocalJsonValue propPartial = default; + LocalJsonValue propRunning = default; + LocalJsonValue propSkipped = default; + LocalJsonValue propSuccessful = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDetails.TryReadProperty(ref reader, options, PropDetails, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propFailed.TryReadProperty(ref reader, options, PropFailed, null)) + { + continue; + } + + if (propPartial.TryReadProperty(ref reader, options, PropPartial, null)) + { + continue; + } + + if (propRunning.TryReadProperty(ref reader, options, PropRunning, null)) + { + continue; + } + + if (propSkipped.TryReadProperty(ref reader, options, PropSkipped, null)) + { + continue; + } + + if (propSuccessful.TryReadProperty(ref reader, options, PropSuccessful, null)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ClusterStatistics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Details = propDetails.Value, + Failed = propFailed.Value, + Partial = propPartial.Value, + Running = propRunning.Value, + Skipped = propSkipped.Value, + Successful = propSuccessful.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ClusterStatistics value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDetails, value.Details, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropFailed, value.Failed, null, null); + writer.WriteProperty(options, PropPartial, value.Partial, null, null); + writer.WriteProperty(options, PropRunning, value.Running, null, null); + writer.WriteProperty(options, PropSkipped, value.Skipped, null, null); + writer.WriteProperty(options, PropSuccessful, value.Successful, null, null); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterStatistics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterStatistics.g.cs index 9585f280cf5..db40852155d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterStatistics.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ClusterStatistics.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class ClusterStatisticsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); - private static readonly System.Text.Json.JsonEncodedText PropFailed = System.Text.Json.JsonEncodedText.Encode("failed"); - private static readonly System.Text.Json.JsonEncodedText PropPartial = System.Text.Json.JsonEncodedText.Encode("partial"); - private static readonly System.Text.Json.JsonEncodedText PropRunning = System.Text.Json.JsonEncodedText.Encode("running"); - private static readonly System.Text.Json.JsonEncodedText PropSkipped = System.Text.Json.JsonEncodedText.Encode("skipped"); - private static readonly System.Text.Json.JsonEncodedText PropSuccessful = System.Text.Json.JsonEncodedText.Encode("successful"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.ClusterStatistics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propDetails = default; - LocalJsonValue propFailed = default; - LocalJsonValue propPartial = default; - LocalJsonValue propRunning = default; - LocalJsonValue propSkipped = default; - LocalJsonValue propSuccessful = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDetails.TryReadProperty(ref reader, options, PropDetails, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propFailed.TryReadProperty(ref reader, options, PropFailed, null)) - { - continue; - } - - if (propPartial.TryReadProperty(ref reader, options, PropPartial, null)) - { - continue; - } - - if (propRunning.TryReadProperty(ref reader, options, PropRunning, null)) - { - continue; - } - - if (propSkipped.TryReadProperty(ref reader, options, PropSkipped, null)) - { - continue; - } - - if (propSuccessful.TryReadProperty(ref reader, options, PropSuccessful, null)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ClusterStatistics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Details = propDetails.Value, - Failed = propFailed.Value, - Partial = propPartial.Value, - Running = propRunning.Value, - Skipped = propSkipped.Value, - Successful = propSuccessful.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ClusterStatistics value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDetails, value.Details, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropFailed, value.Failed, null, null); - writer.WriteProperty(options, PropPartial, value.Partial, null, null); - writer.WriteProperty(options, PropRunning, value.Running, null, null); - writer.WriteProperty(options, PropSkipped, value.Skipped, null, null); - writer.WriteProperty(options, PropSuccessful, value.Successful, null, null); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ClusterStatisticsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ClusterStatisticsConverter))] public sealed partial class ClusterStatistics { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CompletionStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CompletionStats.Converters.g.cs new file mode 100644 index 00000000000..8cf2eda34a1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CompletionStats.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class CompletionStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropSizeInBytes = System.Text.Json.JsonEncodedText.Encode("size_in_bytes"); + + public override Elastic.Clients.Elasticsearch.CompletionStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propFields = default; + LocalJsonValue propSize = default; + LocalJsonValue propSizeInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, null)) + { + continue; + } + + if (propSizeInBytes.TryReadProperty(ref reader, options, PropSizeInBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CompletionStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Fields = propFields.Value, + Size = propSize.Value, + SizeInBytes = propSizeInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CompletionStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropSize, value.Size, null, null); + writer.WriteProperty(options, PropSizeInBytes, value.SizeInBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CompletionStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CompletionStats.g.cs index b53c1f40b98..7acc4031103 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CompletionStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CompletionStats.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class CompletionStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropSizeInBytes = System.Text.Json.JsonEncodedText.Encode("size_in_bytes"); - - public override Elastic.Clients.Elasticsearch.CompletionStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propFields = default; - LocalJsonValue propSize = default; - LocalJsonValue propSizeInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, null)) - { - continue; - } - - if (propSizeInBytes.TryReadProperty(ref reader, options, PropSizeInBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CompletionStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Fields = propFields.Value, - Size = propSize.Value, - SizeInBytes = propSizeInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CompletionStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropSize, value.Size, null, null); - writer.WriteProperty(options, PropSizeInBytes, value.SizeInBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CompletionStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.CompletionStatsConverter))] public sealed partial class CompletionStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Conflicts.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Conflicts.Converters.g.cs new file mode 100644 index 00000000000..6ae8edc722e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Conflicts.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ConflictsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAbort = System.Text.Json.JsonEncodedText.Encode("abort"); + private static readonly System.Text.Json.JsonEncodedText MemberProceed = System.Text.Json.JsonEncodedText.Encode("proceed"); + + public override Elastic.Clients.Elasticsearch.Conflicts Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAbort)) + { + return Elastic.Clients.Elasticsearch.Conflicts.Abort; + } + + if (reader.ValueTextEquals(MemberProceed)) + { + return Elastic.Clients.Elasticsearch.Conflicts.Proceed; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAbort.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Conflicts.Abort; + } + + if (string.Equals(value, MemberProceed.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Conflicts.Proceed; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Conflicts)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Conflicts value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Conflicts.Abort: + writer.WriteStringValue(MemberAbort); + break; + case Elastic.Clients.Elasticsearch.Conflicts.Proceed: + writer.WriteStringValue(MemberProceed); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Conflicts)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Conflicts ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Conflicts value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Conflicts.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Conflicts.g.cs new file mode 100644 index 00000000000..25c954296a3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Conflicts.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ConflictsConverter))] +public enum Conflicts +{ + /// + /// + /// Stop reindexing if there are conflicts. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "abort")] + Abort, + /// + /// + /// Continue reindexing even if there are conflicts. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "proceed")] + Proceed +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CoordsGeoBounds.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CoordsGeoBounds.Converters.g.cs new file mode 100644 index 00000000000..2e7ce039ead --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CoordsGeoBounds.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class CoordsGeoBoundsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBottom = System.Text.Json.JsonEncodedText.Encode("bottom"); + private static readonly System.Text.Json.JsonEncodedText PropLeft = System.Text.Json.JsonEncodedText.Encode("left"); + private static readonly System.Text.Json.JsonEncodedText PropRight = System.Text.Json.JsonEncodedText.Encode("right"); + private static readonly System.Text.Json.JsonEncodedText PropTop = System.Text.Json.JsonEncodedText.Encode("top"); + + public override Elastic.Clients.Elasticsearch.CoordsGeoBounds Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBottom = default; + LocalJsonValue propLeft = default; + LocalJsonValue propRight = default; + LocalJsonValue propTop = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBottom.TryReadProperty(ref reader, options, PropBottom, null)) + { + continue; + } + + if (propLeft.TryReadProperty(ref reader, options, PropLeft, null)) + { + continue; + } + + if (propRight.TryReadProperty(ref reader, options, PropRight, null)) + { + continue; + } + + if (propTop.TryReadProperty(ref reader, options, PropTop, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CoordsGeoBounds(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Bottom = propBottom.Value, + Left = propLeft.Value, + Right = propRight.Value, + Top = propTop.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CoordsGeoBounds value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBottom, value.Bottom, null, null); + writer.WriteProperty(options, PropLeft, value.Left, null, null); + writer.WriteProperty(options, PropRight, value.Right, null, null); + writer.WriteProperty(options, PropTop, value.Top, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CoordsGeoBounds.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CoordsGeoBounds.g.cs index 6d0ebd2f646..31358b5587c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CoordsGeoBounds.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CoordsGeoBounds.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class CoordsGeoBoundsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBottom = System.Text.Json.JsonEncodedText.Encode("bottom"); - private static readonly System.Text.Json.JsonEncodedText PropLeft = System.Text.Json.JsonEncodedText.Encode("left"); - private static readonly System.Text.Json.JsonEncodedText PropRight = System.Text.Json.JsonEncodedText.Encode("right"); - private static readonly System.Text.Json.JsonEncodedText PropTop = System.Text.Json.JsonEncodedText.Encode("top"); - - public override Elastic.Clients.Elasticsearch.CoordsGeoBounds Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBottom = default; - LocalJsonValue propLeft = default; - LocalJsonValue propRight = default; - LocalJsonValue propTop = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBottom.TryReadProperty(ref reader, options, PropBottom, null)) - { - continue; - } - - if (propLeft.TryReadProperty(ref reader, options, PropLeft, null)) - { - continue; - } - - if (propRight.TryReadProperty(ref reader, options, PropRight, null)) - { - continue; - } - - if (propTop.TryReadProperty(ref reader, options, PropTop, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CoordsGeoBounds(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Bottom = propBottom.Value, - Left = propLeft.Value, - Right = propRight.Value, - Top = propTop.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CoordsGeoBounds value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBottom, value.Bottom, null, null); - writer.WriteProperty(options, PropLeft, value.Left, null, null); - writer.WriteProperty(options, PropRight, value.Right, null, null); - writer.WriteProperty(options, PropTop, value.Top, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CoordsGeoBoundsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.CoordsGeoBoundsConverter))] public sealed partial class CoordsGeoBounds { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.Bulk.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Bulk/FailureStoreStatus.Converters.g.cs similarity index 51% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.Bulk.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Bulk/FailureStoreStatus.Converters.g.cs index 3a4c44361b0..e9960c33cbf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.Bulk.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Bulk/FailureStoreStatus.Converters.g.cs @@ -21,94 +21,9 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.Core.Bulk; +namespace Elastic.Clients.Elasticsearch.Core.Bulk.Json; -internal sealed partial class OperationTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCreate = System.Text.Json.JsonEncodedText.Encode("create"); - private static readonly System.Text.Json.JsonEncodedText MemberDelete = System.Text.Json.JsonEncodedText.Encode("delete"); - private static readonly System.Text.Json.JsonEncodedText MemberIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText MemberUpdate = System.Text.Json.JsonEncodedText.Encode("update"); - - public override Elastic.Clients.Elasticsearch.Core.Bulk.OperationType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCreate)) - { - return Elastic.Clients.Elasticsearch.Core.Bulk.OperationType.Create; - } - - if (reader.ValueTextEquals(MemberDelete)) - { - return Elastic.Clients.Elasticsearch.Core.Bulk.OperationType.Delete; - } - - if (reader.ValueTextEquals(MemberIndex)) - { - return Elastic.Clients.Elasticsearch.Core.Bulk.OperationType.Index; - } - - if (reader.ValueTextEquals(MemberUpdate)) - { - return Elastic.Clients.Elasticsearch.Core.Bulk.OperationType.Update; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCreate.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Bulk.OperationType.Create; - } - - if (string.Equals(value, MemberDelete.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Bulk.OperationType.Delete; - } - - if (string.Equals(value, MemberIndex.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Bulk.OperationType.Index; - } - - if (string.Equals(value, MemberUpdate.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Bulk.OperationType.Update; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Bulk.OperationType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Bulk.OperationType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Core.Bulk.OperationType.Create: - writer.WriteStringValue(MemberCreate); - break; - case Elastic.Clients.Elasticsearch.Core.Bulk.OperationType.Delete: - writer.WriteStringValue(MemberDelete); - break; - case Elastic.Clients.Elasticsearch.Core.Bulk.OperationType.Index: - writer.WriteStringValue(MemberIndex); - break; - case Elastic.Clients.Elasticsearch.Core.Bulk.OperationType.Update: - writer.WriteStringValue(MemberUpdate); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Bulk.OperationType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Core.Bulk.OperationType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Bulk.OperationType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class FailureStoreStatusConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class FailureStoreStatusConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText MemberFailed = System.Text.Json.JsonEncodedText.Encode("failed"); private static readonly System.Text.Json.JsonEncodedText MemberNotApplicableOrUnknown = System.Text.Json.JsonEncodedText.Encode("not_applicable_or_unknown"); @@ -191,30 +106,4 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, { Write(writer, value, options); } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Bulk.OperationTypeConverter))] -public enum OperationType -{ - [System.Runtime.Serialization.EnumMember(Value = "create")] - Create, - [System.Runtime.Serialization.EnumMember(Value = "delete")] - Delete, - [System.Runtime.Serialization.EnumMember(Value = "index")] - Index, - [System.Runtime.Serialization.EnumMember(Value = "update")] - Update -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Bulk.FailureStoreStatusConverter))] -public enum FailureStoreStatus -{ - [System.Runtime.Serialization.EnumMember(Value = "failed")] - Failed, - [System.Runtime.Serialization.EnumMember(Value = "not_applicable_or_unknown")] - NotApplicableOrUnknown, - [System.Runtime.Serialization.EnumMember(Value = "not_enabled")] - NotEnabled, - [System.Runtime.Serialization.EnumMember(Value = "used")] - Used } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Bulk/FailureStoreStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Bulk/FailureStoreStatus.g.cs new file mode 100644 index 00000000000..3094b801d96 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Bulk/FailureStoreStatus.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Bulk; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Bulk.Json.FailureStoreStatusConverter))] +public enum FailureStoreStatus +{ + [System.Runtime.Serialization.EnumMember(Value = "failed")] + Failed, + [System.Runtime.Serialization.EnumMember(Value = "not_applicable_or_unknown")] + NotApplicableOrUnknown, + [System.Runtime.Serialization.EnumMember(Value = "not_enabled")] + NotEnabled, + [System.Runtime.Serialization.EnumMember(Value = "used")] + Used +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Bulk/OperationType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Bulk/OperationType.Converters.g.cs new file mode 100644 index 00000000000..57a42d30ff5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Bulk/OperationType.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Bulk.Json; + +public sealed partial class OperationTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCreate = System.Text.Json.JsonEncodedText.Encode("create"); + private static readonly System.Text.Json.JsonEncodedText MemberDelete = System.Text.Json.JsonEncodedText.Encode("delete"); + private static readonly System.Text.Json.JsonEncodedText MemberIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText MemberUpdate = System.Text.Json.JsonEncodedText.Encode("update"); + + public override Elastic.Clients.Elasticsearch.Core.Bulk.OperationType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCreate)) + { + return Elastic.Clients.Elasticsearch.Core.Bulk.OperationType.Create; + } + + if (reader.ValueTextEquals(MemberDelete)) + { + return Elastic.Clients.Elasticsearch.Core.Bulk.OperationType.Delete; + } + + if (reader.ValueTextEquals(MemberIndex)) + { + return Elastic.Clients.Elasticsearch.Core.Bulk.OperationType.Index; + } + + if (reader.ValueTextEquals(MemberUpdate)) + { + return Elastic.Clients.Elasticsearch.Core.Bulk.OperationType.Update; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCreate.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Bulk.OperationType.Create; + } + + if (string.Equals(value, MemberDelete.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Bulk.OperationType.Delete; + } + + if (string.Equals(value, MemberIndex.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Bulk.OperationType.Index; + } + + if (string.Equals(value, MemberUpdate.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Bulk.OperationType.Update; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Bulk.OperationType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Bulk.OperationType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Core.Bulk.OperationType.Create: + writer.WriteStringValue(MemberCreate); + break; + case Elastic.Clients.Elasticsearch.Core.Bulk.OperationType.Delete: + writer.WriteStringValue(MemberDelete); + break; + case Elastic.Clients.Elasticsearch.Core.Bulk.OperationType.Index: + writer.WriteStringValue(MemberIndex); + break; + case Elastic.Clients.Elasticsearch.Core.Bulk.OperationType.Update: + writer.WriteStringValue(MemberUpdate); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Bulk.OperationType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Core.Bulk.OperationType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Bulk.OperationType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Bulk/OperationType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Bulk/OperationType.g.cs new file mode 100644 index 00000000000..c42c4de83a6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Bulk/OperationType.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Bulk; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Bulk.Json.OperationTypeConverter))] +public enum OperationType +{ + [System.Runtime.Serialization.EnumMember(Value = "create")] + Create, + [System.Runtime.Serialization.EnumMember(Value = "delete")] + Delete, + [System.Runtime.Serialization.EnumMember(Value = "index")] + Index, + [System.Runtime.Serialization.EnumMember(Value = "update")] + Update +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Context.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Context.Converters.g.cs new file mode 100644 index 00000000000..10a7d6440eb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Context.Converters.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class ContextConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Core.Search.Context Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByPropertyOfT1(ref r, o, "dummy"); + return selector(ref reader, options) switch + { + Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Core.Search.Context(reader.ReadValue(options, null)), + Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Core.Search.Context(reader.ReadValue(options, null)), + _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Core.Search.Context)}") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.Context value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Tag) + { + case Elastic.Clients.Elasticsearch.UnionTag.T1: + { + writer.WriteValue(options, value.Value1, null); + break; + } + + case Elastic.Clients.Elasticsearch.UnionTag.T2: + { + writer.WriteValue(options, value.Value2, null); + break; + } + + default: + throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Context.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Context.g.cs index 9e64566295b..57fac2201f9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Context.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Context.g.cs @@ -23,48 +23,13 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class ContextConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Core.Search.Context Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByPropertyOfT1(ref r, o, "dummy"); - return selector(ref reader, options) switch - { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Core.Search.Context(reader.ReadValue(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Core.Search.Context(reader.ReadValue(options, null)), - _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Core.Search.Context)}") - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.Context value, System.Text.Json.JsonSerializerOptions options) - { - switch (value.Tag) - { - case Elastic.Clients.Elasticsearch.UnionTag.T1: - { - writer.WriteValue(options, value.Value1, null); - break; - } - - case Elastic.Clients.Elasticsearch.UnionTag.T2: - { - writer.WriteValue(options, value.Value2, null); - break; - } - - default: - throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); - } - } -} - /// /// /// Text or location that we want similar documents for or a lookup to a document's field for the text. /// /// Learn more about this API in the Elasticsearch documentation. /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.ContextConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.ContextConverter))] public sealed partial class Context : Elastic.Clients.Elasticsearch.Union { public Context(string value) : base(value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Explain/Explanation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Explain/Explanation.Converters.g.cs new file mode 100644 index 00000000000..98198c64143 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Explain/Explanation.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Explain.Json; + +public sealed partial class ExplanationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + + public override Elastic.Clients.Elasticsearch.Core.Explain.Explanation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue> propDetails = default; + LocalJsonValue propValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propDetails.TryReadProperty(ref reader, options, PropDetails, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Explain.Explanation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Details = propDetails.Value, + Value = propValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Explain.Explanation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropDetails, value.Details, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropValue, value.Value, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Explain/Explanation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Explain/Explanation.g.cs index 0e6417ef16e..aeba6f28602 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Explain/Explanation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Explain/Explanation.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Explain; -internal sealed partial class ExplanationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - - public override Elastic.Clients.Elasticsearch.Core.Explain.Explanation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue> propDetails = default; - LocalJsonValue propValue = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propDetails.TryReadProperty(ref reader, options, PropDetails, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Explain.Explanation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Details = propDetails.Value, - Value = propValue.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Explain.Explanation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropDetails, value.Details, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropValue, value.Value, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Explain.ExplanationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Explain.Json.ExplanationConverter))] public sealed partial class Explanation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Explain/ExplanationDetail.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Explain/ExplanationDetail.Converters.g.cs new file mode 100644 index 00000000000..3d406f7a343 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Explain/ExplanationDetail.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Explain.Json; + +public sealed partial class ExplanationDetailConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + + public override Elastic.Clients.Elasticsearch.Core.Explain.ExplanationDetail Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue?> propDetails = default; + LocalJsonValue propValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propDetails.TryReadProperty(ref reader, options, PropDetails, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Explain.ExplanationDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Details = propDetails.Value, + Value = propValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Explain.ExplanationDetail value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropDetails, value.Details, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropValue, value.Value, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Explain/ExplanationDetail.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Explain/ExplanationDetail.g.cs index a6983b2d117..db51140eab8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Explain/ExplanationDetail.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Explain/ExplanationDetail.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Explain; -internal sealed partial class ExplanationDetailConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - - public override Elastic.Clients.Elasticsearch.Core.Explain.ExplanationDetail Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue?> propDetails = default; - LocalJsonValue propValue = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propDetails.TryReadProperty(ref reader, options, PropDetails, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Explain.ExplanationDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Details = propDetails.Value, - Value = propValue.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Explain.ExplanationDetail value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropDetails, value.Details, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropValue, value.Value, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Explain.ExplanationDetailConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Explain.Json.ExplanationDetailConverter))] public sealed partial class ExplanationDetail { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/FieldCaps/FieldCapability.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/FieldCaps/FieldCapability.Converters.g.cs new file mode 100644 index 00000000000..8a946fa1fb7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/FieldCaps/FieldCapability.Converters.g.cs @@ -0,0 +1,162 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.FieldCaps.Json; + +public sealed partial class FieldCapabilityConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAggregatable = System.Text.Json.JsonEncodedText.Encode("aggregatable"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropMetadataField = System.Text.Json.JsonEncodedText.Encode("metadata_field"); + private static readonly System.Text.Json.JsonEncodedText PropMetricConflictsIndices = System.Text.Json.JsonEncodedText.Encode("metric_conflicts_indices"); + private static readonly System.Text.Json.JsonEncodedText PropNonAggregatableIndices = System.Text.Json.JsonEncodedText.Encode("non_aggregatable_indices"); + private static readonly System.Text.Json.JsonEncodedText PropNonDimensionIndices = System.Text.Json.JsonEncodedText.Encode("non_dimension_indices"); + private static readonly System.Text.Json.JsonEncodedText PropNonSearchableIndices = System.Text.Json.JsonEncodedText.Encode("non_searchable_indices"); + private static readonly System.Text.Json.JsonEncodedText PropSearchable = System.Text.Json.JsonEncodedText.Encode("searchable"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Core.FieldCaps.FieldCapability Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAggregatable = default; + LocalJsonValue?> propIndices = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propMetadataField = default; + LocalJsonValue?> propMetricConflictsIndices = default; + LocalJsonValue?> propNonAggregatableIndices = default; + LocalJsonValue?> propNonDimensionIndices = default; + LocalJsonValue?> propNonSearchableIndices = default; + LocalJsonValue propSearchable = default; + LocalJsonValue propTimeSeriesDimension = default; + LocalJsonValue propTimeSeriesMetric = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregatable.TryReadProperty(ref reader, options, PropAggregatable, null)) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propMetadataField.TryReadProperty(ref reader, options, PropMetadataField, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMetricConflictsIndices.TryReadProperty(ref reader, options, PropMetricConflictsIndices, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propNonAggregatableIndices.TryReadProperty(ref reader, options, PropNonAggregatableIndices, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propNonDimensionIndices.TryReadProperty(ref reader, options, PropNonDimensionIndices, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propNonSearchableIndices.TryReadProperty(ref reader, options, PropNonSearchableIndices, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propSearchable.TryReadProperty(ref reader, options, PropSearchable, null)) + { + continue; + } + + if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.FieldCaps.FieldCapability(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregatable = propAggregatable.Value, + Indices = propIndices.Value, + Meta = propMeta.Value, + MetadataField = propMetadataField.Value, + MetricConflictsIndices = propMetricConflictsIndices.Value, + NonAggregatableIndices = propNonAggregatableIndices.Value, + NonDimensionIndices = propNonDimensionIndices.Value, + NonSearchableIndices = propNonSearchableIndices.Value, + Searchable = propSearchable.Value, + TimeSeriesDimension = propTimeSeriesDimension.Value, + TimeSeriesMetric = propTimeSeriesMetric.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.FieldCaps.FieldCapability value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregatable, value.Aggregatable, null, null); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropMetadataField, value.MetadataField, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMetricConflictsIndices, value.MetricConflictsIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropNonAggregatableIndices, value.NonAggregatableIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropNonDimensionIndices, value.NonDimensionIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropNonSearchableIndices, value.NonSearchableIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSearchable, value.Searchable, null, null); + writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/FieldCaps/FieldCapability.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/FieldCaps/FieldCapability.g.cs index 1fd9eea9514..05ab43bd359 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/FieldCaps/FieldCapability.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/FieldCaps/FieldCapability.g.cs @@ -23,145 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.FieldCaps; -internal sealed partial class FieldCapabilityConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAggregatable = System.Text.Json.JsonEncodedText.Encode("aggregatable"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropMetadataField = System.Text.Json.JsonEncodedText.Encode("metadata_field"); - private static readonly System.Text.Json.JsonEncodedText PropMetricConflictsIndices = System.Text.Json.JsonEncodedText.Encode("metric_conflicts_indices"); - private static readonly System.Text.Json.JsonEncodedText PropNonAggregatableIndices = System.Text.Json.JsonEncodedText.Encode("non_aggregatable_indices"); - private static readonly System.Text.Json.JsonEncodedText PropNonDimensionIndices = System.Text.Json.JsonEncodedText.Encode("non_dimension_indices"); - private static readonly System.Text.Json.JsonEncodedText PropNonSearchableIndices = System.Text.Json.JsonEncodedText.Encode("non_searchable_indices"); - private static readonly System.Text.Json.JsonEncodedText PropSearchable = System.Text.Json.JsonEncodedText.Encode("searchable"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Core.FieldCaps.FieldCapability Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAggregatable = default; - LocalJsonValue?> propIndices = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propMetadataField = default; - LocalJsonValue?> propMetricConflictsIndices = default; - LocalJsonValue?> propNonAggregatableIndices = default; - LocalJsonValue?> propNonDimensionIndices = default; - LocalJsonValue?> propNonSearchableIndices = default; - LocalJsonValue propSearchable = default; - LocalJsonValue propTimeSeriesDimension = default; - LocalJsonValue propTimeSeriesMetric = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregatable.TryReadProperty(ref reader, options, PropAggregatable, null)) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propMetadataField.TryReadProperty(ref reader, options, PropMetadataField, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMetricConflictsIndices.TryReadProperty(ref reader, options, PropMetricConflictsIndices, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propNonAggregatableIndices.TryReadProperty(ref reader, options, PropNonAggregatableIndices, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propNonDimensionIndices.TryReadProperty(ref reader, options, PropNonDimensionIndices, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propNonSearchableIndices.TryReadProperty(ref reader, options, PropNonSearchableIndices, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propSearchable.TryReadProperty(ref reader, options, PropSearchable, null)) - { - continue; - } - - if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.FieldCaps.FieldCapability(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregatable = propAggregatable.Value, - Indices = propIndices.Value, - Meta = propMeta.Value, - MetadataField = propMetadataField.Value, - MetricConflictsIndices = propMetricConflictsIndices.Value, - NonAggregatableIndices = propNonAggregatableIndices.Value, - NonDimensionIndices = propNonDimensionIndices.Value, - NonSearchableIndices = propNonSearchableIndices.Value, - Searchable = propSearchable.Value, - TimeSeriesDimension = propTimeSeriesDimension.Value, - TimeSeriesMetric = propTimeSeriesMetric.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.FieldCaps.FieldCapability value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregatable, value.Aggregatable, null, null); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropMetadataField, value.MetadataField, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMetricConflictsIndices, value.MetricConflictsIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropNonAggregatableIndices, value.NonAggregatableIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropNonDimensionIndices, value.NonDimensionIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropNonSearchableIndices, value.NonSearchableIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSearchable, value.Searchable, null, null); - writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.FieldCaps.FieldCapabilityConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.FieldCaps.Json.FieldCapabilityConverter))] public sealed partial class FieldCapability { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Get/GetResult.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Get/GetResult.Converters.g.cs new file mode 100644 index 00000000000..be38851ee4e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Get/GetResult.Converters.g.cs @@ -0,0 +1,160 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Get.Json; + +public sealed partial class GetResultConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(GetResult<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(GetResultConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} + +public sealed partial class GetResultConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropFound = System.Text.Json.JsonEncodedText.Encode("found"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); + private static readonly System.Text.Json.JsonEncodedText PropIgnored = System.Text.Json.JsonEncodedText.Encode("_ignored"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); + private static readonly System.Text.Json.JsonEncodedText PropPrimaryTerm = System.Text.Json.JsonEncodedText.Encode("_primary_term"); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("_routing"); + private static readonly System.Text.Json.JsonEncodedText PropSeqNo = System.Text.Json.JsonEncodedText.Encode("_seq_no"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("_version"); + + public override Elastic.Clients.Elasticsearch.Core.Get.GetResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propFields = default; + LocalJsonValue propFound = default; + LocalJsonValue propId = default; + LocalJsonValue?> propIgnored = default; + LocalJsonValue propIndex = default; + LocalJsonValue propPrimaryTerm = default; + LocalJsonValue propRouting = default; + LocalJsonValue propSeqNo = default; + LocalJsonValue propSource = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propFound.TryReadProperty(ref reader, options, PropFound, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIgnored.TryReadProperty(ref reader, options, PropIgnored, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propPrimaryTerm.TryReadProperty(ref reader, options, PropPrimaryTerm, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (propSeqNo.TryReadProperty(ref reader, options, PropSeqNo, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, static TDocument? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Get.GetResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Fields = propFields.Value, + Found = propFound.Value, + Id = propId.Value, + Ignored = propIgnored.Value, + Index = propIndex.Value, + PrimaryTerm = propPrimaryTerm.Value, + Routing = propRouting.Value, + SeqNo = propSeqNo.Value, + Source = propSource.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Get.GetResult value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropFound, value.Found, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIgnored, value.Ignored, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropPrimaryTerm, value.PrimaryTerm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteProperty(options, PropSeqNo, value.SeqNo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSource, value.Source, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TDocument? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Get/GetResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Get/GetResult.g.cs index 9a5f33d982a..652b950312e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Get/GetResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Get/GetResult.g.cs @@ -23,143 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Get; -internal sealed partial class GetResultConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropFound = System.Text.Json.JsonEncodedText.Encode("found"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - private static readonly System.Text.Json.JsonEncodedText PropIgnored = System.Text.Json.JsonEncodedText.Encode("_ignored"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); - private static readonly System.Text.Json.JsonEncodedText PropPrimaryTerm = System.Text.Json.JsonEncodedText.Encode("_primary_term"); - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("_routing"); - private static readonly System.Text.Json.JsonEncodedText PropSeqNo = System.Text.Json.JsonEncodedText.Encode("_seq_no"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("_version"); - - public override Elastic.Clients.Elasticsearch.Core.Get.GetResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propFields = default; - LocalJsonValue propFound = default; - LocalJsonValue propId = default; - LocalJsonValue?> propIgnored = default; - LocalJsonValue propIndex = default; - LocalJsonValue propPrimaryTerm = default; - LocalJsonValue propRouting = default; - LocalJsonValue propSeqNo = default; - LocalJsonValue propSource = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propFound.TryReadProperty(ref reader, options, PropFound, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIgnored.TryReadProperty(ref reader, options, PropIgnored, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propPrimaryTerm.TryReadProperty(ref reader, options, PropPrimaryTerm, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (propSeqNo.TryReadProperty(ref reader, options, PropSeqNo, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, static TDocument? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Get.GetResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Fields = propFields.Value, - Found = propFound.Value, - Id = propId.Value, - Ignored = propIgnored.Value, - Index = propIndex.Value, - PrimaryTerm = propPrimaryTerm.Value, - Routing = propRouting.Value, - SeqNo = propSeqNo.Value, - Source = propSource.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Get.GetResult value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropFound, value.Found, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIgnored, value.Ignored, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropPrimaryTerm, value.PrimaryTerm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteProperty(options, PropSeqNo, value.SeqNo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSource, value.Source, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TDocument? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -internal sealed partial class GetResultConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(GetResult<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(GetResultConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Get.GetResultConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Get.Json.GetResultConverterFactory))] public sealed partial class GetResult { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptContext/Context.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptContext/Context.Converters.g.cs new file mode 100644 index 00000000000..147acfae423 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptContext/Context.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.GetScriptContext.Json; + +public sealed partial class ContextConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMethods = System.Text.Json.JsonEncodedText.Encode("methods"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.Core.GetScriptContext.Context Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propMethods = default; + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMethods.TryReadProperty(ref reader, options, PropMethods, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.GetScriptContext.Context(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Methods = propMethods.Value, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.GetScriptContext.Context value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMethods, value.Methods, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptContext/Context.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptContext/Context.g.cs index 499d0a3d160..5ca90383a26 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptContext/Context.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptContext/Context.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.GetScriptContext; -internal sealed partial class ContextConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMethods = System.Text.Json.JsonEncodedText.Encode("methods"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.Core.GetScriptContext.Context Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propMethods = default; - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMethods.TryReadProperty(ref reader, options, PropMethods, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.GetScriptContext.Context(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Methods = propMethods.Value, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.GetScriptContext.Context value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMethods, value.Methods, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.GetScriptContext.ContextConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.GetScriptContext.Json.ContextConverter))] public sealed partial class Context { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptContext/ContextMethod.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptContext/ContextMethod.Converters.g.cs new file mode 100644 index 00000000000..600361a79a7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptContext/ContextMethod.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.GetScriptContext.Json; + +public sealed partial class ContextMethodConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); + private static readonly System.Text.Json.JsonEncodedText PropReturnType = System.Text.Json.JsonEncodedText.Encode("return_type"); + + public override Elastic.Clients.Elasticsearch.Core.GetScriptContext.ContextMethod Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + LocalJsonValue> propParams = default; + LocalJsonValue propReturnType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propReturnType.TryReadProperty(ref reader, options, PropReturnType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.GetScriptContext.ContextMethod(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value, + Params = propParams.Value, + ReturnType = propReturnType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.GetScriptContext.ContextMethod value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropReturnType, value.ReturnType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptContext/ContextMethod.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptContext/ContextMethod.g.cs index 7a54dec75c8..8e43e384908 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptContext/ContextMethod.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptContext/ContextMethod.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.GetScriptContext; -internal sealed partial class ContextMethodConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); - private static readonly System.Text.Json.JsonEncodedText PropReturnType = System.Text.Json.JsonEncodedText.Encode("return_type"); - - public override Elastic.Clients.Elasticsearch.Core.GetScriptContext.ContextMethod Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - LocalJsonValue> propParams = default; - LocalJsonValue propReturnType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propReturnType.TryReadProperty(ref reader, options, PropReturnType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.GetScriptContext.ContextMethod(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value, - Params = propParams.Value, - ReturnType = propReturnType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.GetScriptContext.ContextMethod value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropReturnType, value.ReturnType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.GetScriptContext.ContextMethodConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.GetScriptContext.Json.ContextMethodConverter))] public sealed partial class ContextMethod { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptContext/ContextMethodParam.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptContext/ContextMethodParam.Converters.g.cs new file mode 100644 index 00000000000..14be166d388 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptContext/ContextMethodParam.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.GetScriptContext.Json; + +public sealed partial class ContextMethodParamConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Core.GetScriptContext.ContextMethodParam Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.GetScriptContext.ContextMethodParam(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.GetScriptContext.ContextMethodParam value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptContext/ContextMethodParam.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptContext/ContextMethodParam.g.cs index 8f6370d24d7..a94883cb1ab 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptContext/ContextMethodParam.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptContext/ContextMethodParam.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.GetScriptContext; -internal sealed partial class ContextMethodParamConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Core.GetScriptContext.ContextMethodParam Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.GetScriptContext.ContextMethodParam(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.GetScriptContext.ContextMethodParam value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.GetScriptContext.ContextMethodParamConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.GetScriptContext.Json.ContextMethodParamConverter))] public sealed partial class ContextMethodParam { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptLanguages/LanguageContext.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptLanguages/LanguageContext.Converters.g.cs new file mode 100644 index 00000000000..84b74485846 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptLanguages/LanguageContext.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.GetScriptLanguages.Json; + +public sealed partial class LanguageContextConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropContexts = System.Text.Json.JsonEncodedText.Encode("contexts"); + private static readonly System.Text.Json.JsonEncodedText PropLanguage = System.Text.Json.JsonEncodedText.Encode("language"); + + public override Elastic.Clients.Elasticsearch.Core.GetScriptLanguages.LanguageContext Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propContexts = default; + LocalJsonValue propLanguage = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propContexts.TryReadProperty(ref reader, options, PropContexts, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propLanguage.TryReadProperty(ref reader, options, PropLanguage, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.GetScriptLanguages.LanguageContext(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Contexts = propContexts.Value, + Language = propLanguage.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.GetScriptLanguages.LanguageContext value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropContexts, value.Contexts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropLanguage, value.Language, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptLanguages/LanguageContext.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptLanguages/LanguageContext.g.cs index 7907fb70e62..5dcf35ac47f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptLanguages/LanguageContext.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/GetScriptLanguages/LanguageContext.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.GetScriptLanguages; -internal sealed partial class LanguageContextConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropContexts = System.Text.Json.JsonEncodedText.Encode("contexts"); - private static readonly System.Text.Json.JsonEncodedText PropLanguage = System.Text.Json.JsonEncodedText.Encode("language"); - - public override Elastic.Clients.Elasticsearch.Core.GetScriptLanguages.LanguageContext Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propContexts = default; - LocalJsonValue propLanguage = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propContexts.TryReadProperty(ref reader, options, PropContexts, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propLanguage.TryReadProperty(ref reader, options, PropLanguage, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.GetScriptLanguages.LanguageContext(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Contexts = propContexts.Value, - Language = propLanguage.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.GetScriptLanguages.LanguageContext value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropContexts, value.Contexts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropLanguage, value.Language, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.GetScriptLanguages.LanguageContextConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.GetScriptLanguages.Json.LanguageContextConverter))] public sealed partial class LanguageContext { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DataStreamLifecycleDetails.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DataStreamLifecycleDetails.Converters.g.cs new file mode 100644 index 00000000000..fc3cedd7054 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DataStreamLifecycleDetails.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class DataStreamLifecycleDetailsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStagnatingBackingIndices = System.Text.Json.JsonEncodedText.Encode("stagnating_backing_indices"); + private static readonly System.Text.Json.JsonEncodedText PropStagnatingBackingIndicesCount = System.Text.Json.JsonEncodedText.Encode("stagnating_backing_indices_count"); + private static readonly System.Text.Json.JsonEncodedText PropTotalBackingIndicesInError = System.Text.Json.JsonEncodedText.Encode("total_backing_indices_in_error"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.DataStreamLifecycleDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propStagnatingBackingIndices = default; + LocalJsonValue propStagnatingBackingIndicesCount = default; + LocalJsonValue propTotalBackingIndicesInError = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStagnatingBackingIndices.TryReadProperty(ref reader, options, PropStagnatingBackingIndices, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStagnatingBackingIndicesCount.TryReadProperty(ref reader, options, PropStagnatingBackingIndicesCount, null)) + { + continue; + } + + if (propTotalBackingIndicesInError.TryReadProperty(ref reader, options, PropTotalBackingIndicesInError, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.DataStreamLifecycleDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + StagnatingBackingIndices = propStagnatingBackingIndices.Value, + StagnatingBackingIndicesCount = propStagnatingBackingIndicesCount.Value, + TotalBackingIndicesInError = propTotalBackingIndicesInError.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.DataStreamLifecycleDetails value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStagnatingBackingIndices, value.StagnatingBackingIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStagnatingBackingIndicesCount, value.StagnatingBackingIndicesCount, null, null); + writer.WriteProperty(options, PropTotalBackingIndicesInError, value.TotalBackingIndicesInError, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DataStreamLifecycleDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DataStreamLifecycleDetails.g.cs index 804cd593874..0f3800cf8a8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DataStreamLifecycleDetails.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DataStreamLifecycleDetails.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class DataStreamLifecycleDetailsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStagnatingBackingIndices = System.Text.Json.JsonEncodedText.Encode("stagnating_backing_indices"); - private static readonly System.Text.Json.JsonEncodedText PropStagnatingBackingIndicesCount = System.Text.Json.JsonEncodedText.Encode("stagnating_backing_indices_count"); - private static readonly System.Text.Json.JsonEncodedText PropTotalBackingIndicesInError = System.Text.Json.JsonEncodedText.Encode("total_backing_indices_in_error"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.DataStreamLifecycleDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStagnatingBackingIndices = default; - LocalJsonValue propStagnatingBackingIndicesCount = default; - LocalJsonValue propTotalBackingIndicesInError = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStagnatingBackingIndices.TryReadProperty(ref reader, options, PropStagnatingBackingIndices, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStagnatingBackingIndicesCount.TryReadProperty(ref reader, options, PropStagnatingBackingIndicesCount, null)) - { - continue; - } - - if (propTotalBackingIndicesInError.TryReadProperty(ref reader, options, PropTotalBackingIndicesInError, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.DataStreamLifecycleDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - StagnatingBackingIndices = propStagnatingBackingIndices.Value, - StagnatingBackingIndicesCount = propStagnatingBackingIndicesCount.Value, - TotalBackingIndicesInError = propTotalBackingIndicesInError.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.DataStreamLifecycleDetails value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStagnatingBackingIndices, value.StagnatingBackingIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStagnatingBackingIndicesCount, value.StagnatingBackingIndicesCount, null, null); - writer.WriteProperty(options, PropTotalBackingIndicesInError, value.TotalBackingIndicesInError, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.DataStreamLifecycleDetailsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.DataStreamLifecycleDetailsConverter))] public sealed partial class DataStreamLifecycleDetails { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DataStreamLifecycleIndicator.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DataStreamLifecycleIndicator.Converters.g.cs new file mode 100644 index 00000000000..ca2cf9841e9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DataStreamLifecycleIndicator.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class DataStreamLifecycleIndicatorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); + private static readonly System.Text.Json.JsonEncodedText PropDiagnosis = System.Text.Json.JsonEncodedText.Encode("diagnosis"); + private static readonly System.Text.Json.JsonEncodedText PropImpacts = System.Text.Json.JsonEncodedText.Encode("impacts"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + private static readonly System.Text.Json.JsonEncodedText PropSymptom = System.Text.Json.JsonEncodedText.Encode("symptom"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.DataStreamLifecycleIndicator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDetails = default; + LocalJsonValue?> propDiagnosis = default; + LocalJsonValue?> propImpacts = default; + LocalJsonValue propStatus = default; + LocalJsonValue propSymptom = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDetails.TryReadProperty(ref reader, options, PropDetails, null)) + { + continue; + } + + if (propDiagnosis.TryReadProperty(ref reader, options, PropDiagnosis, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propImpacts.TryReadProperty(ref reader, options, PropImpacts, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (propSymptom.TryReadProperty(ref reader, options, PropSymptom, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.DataStreamLifecycleIndicator(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Details = propDetails.Value, + Diagnosis = propDiagnosis.Value, + Impacts = propImpacts.Value, + Status = propStatus.Value, + Symptom = propSymptom.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.DataStreamLifecycleIndicator value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDetails, value.Details, null, null); + writer.WriteProperty(options, PropDiagnosis, value.Diagnosis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropImpacts, value.Impacts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteProperty(options, PropSymptom, value.Symptom, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DataStreamLifecycleIndicator.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DataStreamLifecycleIndicator.g.cs index c382b1d0990..9f7b1e166cc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DataStreamLifecycleIndicator.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DataStreamLifecycleIndicator.g.cs @@ -23,87 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class DataStreamLifecycleIndicatorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); - private static readonly System.Text.Json.JsonEncodedText PropDiagnosis = System.Text.Json.JsonEncodedText.Encode("diagnosis"); - private static readonly System.Text.Json.JsonEncodedText PropImpacts = System.Text.Json.JsonEncodedText.Encode("impacts"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - private static readonly System.Text.Json.JsonEncodedText PropSymptom = System.Text.Json.JsonEncodedText.Encode("symptom"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.DataStreamLifecycleIndicator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDetails = default; - LocalJsonValue?> propDiagnosis = default; - LocalJsonValue?> propImpacts = default; - LocalJsonValue propStatus = default; - LocalJsonValue propSymptom = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDetails.TryReadProperty(ref reader, options, PropDetails, null)) - { - continue; - } - - if (propDiagnosis.TryReadProperty(ref reader, options, PropDiagnosis, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propImpacts.TryReadProperty(ref reader, options, PropImpacts, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (propSymptom.TryReadProperty(ref reader, options, PropSymptom, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.DataStreamLifecycleIndicator(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Details = propDetails.Value, - Diagnosis = propDiagnosis.Value, - Impacts = propImpacts.Value, - Status = propStatus.Value, - Symptom = propSymptom.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.DataStreamLifecycleIndicator value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDetails, value.Details, null, null); - writer.WriteProperty(options, PropDiagnosis, value.Diagnosis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropImpacts, value.Impacts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteProperty(options, PropSymptom, value.Symptom, null, null); - writer.WriteEndObject(); - } -} - /// /// /// DATA_STREAM_LIFECYCLE /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.DataStreamLifecycleIndicatorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.DataStreamLifecycleIndicatorConverter))] public sealed partial class DataStreamLifecycleIndicator { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Diagnosis.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Diagnosis.Converters.g.cs new file mode 100644 index 00000000000..bcff9643b2e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Diagnosis.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class DiagnosisConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAction = System.Text.Json.JsonEncodedText.Encode("action"); + private static readonly System.Text.Json.JsonEncodedText PropAffectedResources = System.Text.Json.JsonEncodedText.Encode("affected_resources"); + private static readonly System.Text.Json.JsonEncodedText PropCause = System.Text.Json.JsonEncodedText.Encode("cause"); + private static readonly System.Text.Json.JsonEncodedText PropHelpUrl = System.Text.Json.JsonEncodedText.Encode("help_url"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.Diagnosis Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAction = default; + LocalJsonValue propAffectedResources = default; + LocalJsonValue propCause = default; + LocalJsonValue propHelpUrl = default; + LocalJsonValue propId = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAction.TryReadProperty(ref reader, options, PropAction, null)) + { + continue; + } + + if (propAffectedResources.TryReadProperty(ref reader, options, PropAffectedResources, null)) + { + continue; + } + + if (propCause.TryReadProperty(ref reader, options, PropCause, null)) + { + continue; + } + + if (propHelpUrl.TryReadProperty(ref reader, options, PropHelpUrl, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.Diagnosis(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Action = propAction.Value, + AffectedResources = propAffectedResources.Value, + Cause = propCause.Value, + HelpUrl = propHelpUrl.Value, + Id = propId.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.Diagnosis value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAction, value.Action, null, null); + writer.WriteProperty(options, PropAffectedResources, value.AffectedResources, null, null); + writer.WriteProperty(options, PropCause, value.Cause, null, null); + writer.WriteProperty(options, PropHelpUrl, value.HelpUrl, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Diagnosis.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Diagnosis.g.cs index 95bb252d511..0882092822c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Diagnosis.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Diagnosis.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class DiagnosisConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAction = System.Text.Json.JsonEncodedText.Encode("action"); - private static readonly System.Text.Json.JsonEncodedText PropAffectedResources = System.Text.Json.JsonEncodedText.Encode("affected_resources"); - private static readonly System.Text.Json.JsonEncodedText PropCause = System.Text.Json.JsonEncodedText.Encode("cause"); - private static readonly System.Text.Json.JsonEncodedText PropHelpUrl = System.Text.Json.JsonEncodedText.Encode("help_url"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.Diagnosis Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAction = default; - LocalJsonValue propAffectedResources = default; - LocalJsonValue propCause = default; - LocalJsonValue propHelpUrl = default; - LocalJsonValue propId = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAction.TryReadProperty(ref reader, options, PropAction, null)) - { - continue; - } - - if (propAffectedResources.TryReadProperty(ref reader, options, PropAffectedResources, null)) - { - continue; - } - - if (propCause.TryReadProperty(ref reader, options, PropCause, null)) - { - continue; - } - - if (propHelpUrl.TryReadProperty(ref reader, options, PropHelpUrl, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.Diagnosis(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Action = propAction.Value, - AffectedResources = propAffectedResources.Value, - Cause = propCause.Value, - HelpUrl = propHelpUrl.Value, - Id = propId.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.Diagnosis value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAction, value.Action, null, null); - writer.WriteProperty(options, PropAffectedResources, value.AffectedResources, null, null); - writer.WriteProperty(options, PropCause, value.Cause, null, null); - writer.WriteProperty(options, PropHelpUrl, value.HelpUrl, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.DiagnosisConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.DiagnosisConverter))] public sealed partial class Diagnosis { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiagnosisAffectedResources.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiagnosisAffectedResources.Converters.g.cs new file mode 100644 index 00000000000..a41e1562d09 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiagnosisAffectedResources.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class DiagnosisAffectedResourcesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFeatureStates = System.Text.Json.JsonEncodedText.Encode("feature_states"); + 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 PropSlmPolicies = System.Text.Json.JsonEncodedText.Encode("slm_policies"); + private static readonly System.Text.Json.JsonEncodedText PropSnapshotRepositories = System.Text.Json.JsonEncodedText.Encode("snapshot_repositories"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.DiagnosisAffectedResources Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propFeatureStates = default; + LocalJsonValue?> propIndices = default; + LocalJsonValue?> propNodes = default; + LocalJsonValue?> propSlmPolicies = default; + LocalJsonValue?> propSnapshotRepositories = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFeatureStates.TryReadProperty(ref reader, options, PropFeatureStates, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propSlmPolicies.TryReadProperty(ref reader, options, PropSlmPolicies, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propSnapshotRepositories.TryReadProperty(ref reader, options, PropSnapshotRepositories, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.DiagnosisAffectedResources(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FeatureStates = propFeatureStates.Value, + Indices = propIndices.Value, + Nodes = propNodes.Value, + SlmPolicies = propSlmPolicies.Value, + SnapshotRepositories = propSnapshotRepositories.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.DiagnosisAffectedResources value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFeatureStates, value.FeatureStates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSlmPolicies, value.SlmPolicies, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSnapshotRepositories, value.SnapshotRepositories, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiagnosisAffectedResources.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiagnosisAffectedResources.g.cs index d4fab0d3db3..944ce31eedc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiagnosisAffectedResources.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiagnosisAffectedResources.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class DiagnosisAffectedResourcesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFeatureStates = System.Text.Json.JsonEncodedText.Encode("feature_states"); - 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 PropSlmPolicies = System.Text.Json.JsonEncodedText.Encode("slm_policies"); - private static readonly System.Text.Json.JsonEncodedText PropSnapshotRepositories = System.Text.Json.JsonEncodedText.Encode("snapshot_repositories"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.DiagnosisAffectedResources Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propFeatureStates = default; - LocalJsonValue?> propIndices = default; - LocalJsonValue?> propNodes = default; - LocalJsonValue?> propSlmPolicies = default; - LocalJsonValue?> propSnapshotRepositories = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFeatureStates.TryReadProperty(ref reader, options, PropFeatureStates, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propSlmPolicies.TryReadProperty(ref reader, options, PropSlmPolicies, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propSnapshotRepositories.TryReadProperty(ref reader, options, PropSnapshotRepositories, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.DiagnosisAffectedResources(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FeatureStates = propFeatureStates.Value, - Indices = propIndices.Value, - Nodes = propNodes.Value, - SlmPolicies = propSlmPolicies.Value, - SnapshotRepositories = propSnapshotRepositories.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.DiagnosisAffectedResources value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFeatureStates, value.FeatureStates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSlmPolicies, value.SlmPolicies, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSnapshotRepositories, value.SnapshotRepositories, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.DiagnosisAffectedResourcesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.DiagnosisAffectedResourcesConverter))] public sealed partial class DiagnosisAffectedResources { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiskIndicator.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiskIndicator.Converters.g.cs new file mode 100644 index 00000000000..3292f4347ff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiskIndicator.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class DiskIndicatorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); + private static readonly System.Text.Json.JsonEncodedText PropDiagnosis = System.Text.Json.JsonEncodedText.Encode("diagnosis"); + private static readonly System.Text.Json.JsonEncodedText PropImpacts = System.Text.Json.JsonEncodedText.Encode("impacts"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + private static readonly System.Text.Json.JsonEncodedText PropSymptom = System.Text.Json.JsonEncodedText.Encode("symptom"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.DiskIndicator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDetails = default; + LocalJsonValue?> propDiagnosis = default; + LocalJsonValue?> propImpacts = default; + LocalJsonValue propStatus = default; + LocalJsonValue propSymptom = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDetails.TryReadProperty(ref reader, options, PropDetails, null)) + { + continue; + } + + if (propDiagnosis.TryReadProperty(ref reader, options, PropDiagnosis, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propImpacts.TryReadProperty(ref reader, options, PropImpacts, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (propSymptom.TryReadProperty(ref reader, options, PropSymptom, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.DiskIndicator(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Details = propDetails.Value, + Diagnosis = propDiagnosis.Value, + Impacts = propImpacts.Value, + Status = propStatus.Value, + Symptom = propSymptom.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.DiskIndicator value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDetails, value.Details, null, null); + writer.WriteProperty(options, PropDiagnosis, value.Diagnosis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropImpacts, value.Impacts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteProperty(options, PropSymptom, value.Symptom, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiskIndicator.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiskIndicator.g.cs index 92b28149d84..0f8b42eaac0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiskIndicator.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiskIndicator.g.cs @@ -23,87 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class DiskIndicatorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); - private static readonly System.Text.Json.JsonEncodedText PropDiagnosis = System.Text.Json.JsonEncodedText.Encode("diagnosis"); - private static readonly System.Text.Json.JsonEncodedText PropImpacts = System.Text.Json.JsonEncodedText.Encode("impacts"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - private static readonly System.Text.Json.JsonEncodedText PropSymptom = System.Text.Json.JsonEncodedText.Encode("symptom"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.DiskIndicator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDetails = default; - LocalJsonValue?> propDiagnosis = default; - LocalJsonValue?> propImpacts = default; - LocalJsonValue propStatus = default; - LocalJsonValue propSymptom = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDetails.TryReadProperty(ref reader, options, PropDetails, null)) - { - continue; - } - - if (propDiagnosis.TryReadProperty(ref reader, options, PropDiagnosis, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propImpacts.TryReadProperty(ref reader, options, PropImpacts, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (propSymptom.TryReadProperty(ref reader, options, PropSymptom, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.DiskIndicator(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Details = propDetails.Value, - Diagnosis = propDiagnosis.Value, - Impacts = propImpacts.Value, - Status = propStatus.Value, - Symptom = propSymptom.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.DiskIndicator value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDetails, value.Details, null, null); - writer.WriteProperty(options, PropDiagnosis, value.Diagnosis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropImpacts, value.Impacts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteProperty(options, PropSymptom, value.Symptom, null, null); - writer.WriteEndObject(); - } -} - /// /// /// DISK /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.DiskIndicatorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.DiskIndicatorConverter))] public sealed partial class DiskIndicator { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiskIndicatorDetails.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiskIndicatorDetails.Converters.g.cs new file mode 100644 index 00000000000..87e92176918 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiskIndicatorDetails.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class DiskIndicatorDetailsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndicesWithReadonlyBlock = System.Text.Json.JsonEncodedText.Encode("indices_with_readonly_block"); + private static readonly System.Text.Json.JsonEncodedText PropNodesOverFloodStageWatermark = System.Text.Json.JsonEncodedText.Encode("nodes_over_flood_stage_watermark"); + private static readonly System.Text.Json.JsonEncodedText PropNodesOverHighWatermark = System.Text.Json.JsonEncodedText.Encode("nodes_over_high_watermark"); + private static readonly System.Text.Json.JsonEncodedText PropNodesWithEnoughDiskSpace = System.Text.Json.JsonEncodedText.Encode("nodes_with_enough_disk_space"); + private static readonly System.Text.Json.JsonEncodedText PropNodesWithUnknownDiskStatus = System.Text.Json.JsonEncodedText.Encode("nodes_with_unknown_disk_status"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.DiskIndicatorDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndicesWithReadonlyBlock = default; + LocalJsonValue propNodesOverFloodStageWatermark = default; + LocalJsonValue propNodesOverHighWatermark = default; + LocalJsonValue propNodesWithEnoughDiskSpace = default; + LocalJsonValue propNodesWithUnknownDiskStatus = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndicesWithReadonlyBlock.TryReadProperty(ref reader, options, PropIndicesWithReadonlyBlock, null)) + { + continue; + } + + if (propNodesOverFloodStageWatermark.TryReadProperty(ref reader, options, PropNodesOverFloodStageWatermark, null)) + { + continue; + } + + if (propNodesOverHighWatermark.TryReadProperty(ref reader, options, PropNodesOverHighWatermark, null)) + { + continue; + } + + if (propNodesWithEnoughDiskSpace.TryReadProperty(ref reader, options, PropNodesWithEnoughDiskSpace, null)) + { + continue; + } + + if (propNodesWithUnknownDiskStatus.TryReadProperty(ref reader, options, PropNodesWithUnknownDiskStatus, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.DiskIndicatorDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + IndicesWithReadonlyBlock = propIndicesWithReadonlyBlock.Value, + NodesOverFloodStageWatermark = propNodesOverFloodStageWatermark.Value, + NodesOverHighWatermark = propNodesOverHighWatermark.Value, + NodesWithEnoughDiskSpace = propNodesWithEnoughDiskSpace.Value, + NodesWithUnknownDiskStatus = propNodesWithUnknownDiskStatus.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.DiskIndicatorDetails value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndicesWithReadonlyBlock, value.IndicesWithReadonlyBlock, null, null); + writer.WriteProperty(options, PropNodesOverFloodStageWatermark, value.NodesOverFloodStageWatermark, null, null); + writer.WriteProperty(options, PropNodesOverHighWatermark, value.NodesOverHighWatermark, null, null); + writer.WriteProperty(options, PropNodesWithEnoughDiskSpace, value.NodesWithEnoughDiskSpace, null, null); + writer.WriteProperty(options, PropNodesWithUnknownDiskStatus, value.NodesWithUnknownDiskStatus, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiskIndicatorDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiskIndicatorDetails.g.cs index 5f5b071a6d9..605a1381f8d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiskIndicatorDetails.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/DiskIndicatorDetails.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class DiskIndicatorDetailsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndicesWithReadonlyBlock = System.Text.Json.JsonEncodedText.Encode("indices_with_readonly_block"); - private static readonly System.Text.Json.JsonEncodedText PropNodesOverFloodStageWatermark = System.Text.Json.JsonEncodedText.Encode("nodes_over_flood_stage_watermark"); - private static readonly System.Text.Json.JsonEncodedText PropNodesOverHighWatermark = System.Text.Json.JsonEncodedText.Encode("nodes_over_high_watermark"); - private static readonly System.Text.Json.JsonEncodedText PropNodesWithEnoughDiskSpace = System.Text.Json.JsonEncodedText.Encode("nodes_with_enough_disk_space"); - private static readonly System.Text.Json.JsonEncodedText PropNodesWithUnknownDiskStatus = System.Text.Json.JsonEncodedText.Encode("nodes_with_unknown_disk_status"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.DiskIndicatorDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndicesWithReadonlyBlock = default; - LocalJsonValue propNodesOverFloodStageWatermark = default; - LocalJsonValue propNodesOverHighWatermark = default; - LocalJsonValue propNodesWithEnoughDiskSpace = default; - LocalJsonValue propNodesWithUnknownDiskStatus = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndicesWithReadonlyBlock.TryReadProperty(ref reader, options, PropIndicesWithReadonlyBlock, null)) - { - continue; - } - - if (propNodesOverFloodStageWatermark.TryReadProperty(ref reader, options, PropNodesOverFloodStageWatermark, null)) - { - continue; - } - - if (propNodesOverHighWatermark.TryReadProperty(ref reader, options, PropNodesOverHighWatermark, null)) - { - continue; - } - - if (propNodesWithEnoughDiskSpace.TryReadProperty(ref reader, options, PropNodesWithEnoughDiskSpace, null)) - { - continue; - } - - if (propNodesWithUnknownDiskStatus.TryReadProperty(ref reader, options, PropNodesWithUnknownDiskStatus, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.DiskIndicatorDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - IndicesWithReadonlyBlock = propIndicesWithReadonlyBlock.Value, - NodesOverFloodStageWatermark = propNodesOverFloodStageWatermark.Value, - NodesOverHighWatermark = propNodesOverHighWatermark.Value, - NodesWithEnoughDiskSpace = propNodesWithEnoughDiskSpace.Value, - NodesWithUnknownDiskStatus = propNodesWithUnknownDiskStatus.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.DiskIndicatorDetails value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndicesWithReadonlyBlock, value.IndicesWithReadonlyBlock, null, null); - writer.WriteProperty(options, PropNodesOverFloodStageWatermark, value.NodesOverFloodStageWatermark, null, null); - writer.WriteProperty(options, PropNodesOverHighWatermark, value.NodesOverHighWatermark, null, null); - writer.WriteProperty(options, PropNodesWithEnoughDiskSpace, value.NodesWithEnoughDiskSpace, null, null); - writer.WriteProperty(options, PropNodesWithUnknownDiskStatus, value.NodesWithUnknownDiskStatus, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.DiskIndicatorDetailsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.DiskIndicatorDetailsConverter))] public sealed partial class DiskIndicatorDetails { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/FileSettingsIndicator.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/FileSettingsIndicator.Converters.g.cs new file mode 100644 index 00000000000..9d884686846 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/FileSettingsIndicator.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class FileSettingsIndicatorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); + private static readonly System.Text.Json.JsonEncodedText PropDiagnosis = System.Text.Json.JsonEncodedText.Encode("diagnosis"); + private static readonly System.Text.Json.JsonEncodedText PropImpacts = System.Text.Json.JsonEncodedText.Encode("impacts"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + private static readonly System.Text.Json.JsonEncodedText PropSymptom = System.Text.Json.JsonEncodedText.Encode("symptom"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.FileSettingsIndicator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDetails = default; + LocalJsonValue?> propDiagnosis = default; + LocalJsonValue?> propImpacts = default; + LocalJsonValue propStatus = default; + LocalJsonValue propSymptom = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDetails.TryReadProperty(ref reader, options, PropDetails, null)) + { + continue; + } + + if (propDiagnosis.TryReadProperty(ref reader, options, PropDiagnosis, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propImpacts.TryReadProperty(ref reader, options, PropImpacts, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (propSymptom.TryReadProperty(ref reader, options, PropSymptom, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.FileSettingsIndicator(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Details = propDetails.Value, + Diagnosis = propDiagnosis.Value, + Impacts = propImpacts.Value, + Status = propStatus.Value, + Symptom = propSymptom.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.FileSettingsIndicator value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDetails, value.Details, null, null); + writer.WriteProperty(options, PropDiagnosis, value.Diagnosis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropImpacts, value.Impacts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteProperty(options, PropSymptom, value.Symptom, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/FileSettingsIndicator.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/FileSettingsIndicator.g.cs index 140a2cc94c5..a8a064cbc23 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/FileSettingsIndicator.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/FileSettingsIndicator.g.cs @@ -23,87 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class FileSettingsIndicatorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); - private static readonly System.Text.Json.JsonEncodedText PropDiagnosis = System.Text.Json.JsonEncodedText.Encode("diagnosis"); - private static readonly System.Text.Json.JsonEncodedText PropImpacts = System.Text.Json.JsonEncodedText.Encode("impacts"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - private static readonly System.Text.Json.JsonEncodedText PropSymptom = System.Text.Json.JsonEncodedText.Encode("symptom"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.FileSettingsIndicator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDetails = default; - LocalJsonValue?> propDiagnosis = default; - LocalJsonValue?> propImpacts = default; - LocalJsonValue propStatus = default; - LocalJsonValue propSymptom = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDetails.TryReadProperty(ref reader, options, PropDetails, null)) - { - continue; - } - - if (propDiagnosis.TryReadProperty(ref reader, options, PropDiagnosis, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propImpacts.TryReadProperty(ref reader, options, PropImpacts, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (propSymptom.TryReadProperty(ref reader, options, PropSymptom, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.FileSettingsIndicator(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Details = propDetails.Value, - Diagnosis = propDiagnosis.Value, - Impacts = propImpacts.Value, - Status = propStatus.Value, - Symptom = propSymptom.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.FileSettingsIndicator value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDetails, value.Details, null, null); - writer.WriteProperty(options, PropDiagnosis, value.Diagnosis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropImpacts, value.Impacts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteProperty(options, PropSymptom, value.Symptom, null, null); - writer.WriteEndObject(); - } -} - /// /// /// FILE_SETTINGS /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.FileSettingsIndicatorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.FileSettingsIndicatorConverter))] public sealed partial class FileSettingsIndicator { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/FileSettingsIndicatorDetails.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/FileSettingsIndicatorDetails.Converters.g.cs new file mode 100644 index 00000000000..cfb236fa11a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/FileSettingsIndicatorDetails.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class FileSettingsIndicatorDetailsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFailureStreak = System.Text.Json.JsonEncodedText.Encode("failure_streak"); + private static readonly System.Text.Json.JsonEncodedText PropMostRecentFailure = System.Text.Json.JsonEncodedText.Encode("most_recent_failure"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.FileSettingsIndicatorDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFailureStreak = default; + LocalJsonValue propMostRecentFailure = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFailureStreak.TryReadProperty(ref reader, options, PropFailureStreak, null)) + { + continue; + } + + if (propMostRecentFailure.TryReadProperty(ref reader, options, PropMostRecentFailure, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.FileSettingsIndicatorDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FailureStreak = propFailureStreak.Value, + MostRecentFailure = propMostRecentFailure.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.FileSettingsIndicatorDetails value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFailureStreak, value.FailureStreak, null, null); + writer.WriteProperty(options, PropMostRecentFailure, value.MostRecentFailure, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/FileSettingsIndicatorDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/FileSettingsIndicatorDetails.g.cs index d113cb95709..18e26684ed1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/FileSettingsIndicatorDetails.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/FileSettingsIndicatorDetails.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class FileSettingsIndicatorDetailsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFailureStreak = System.Text.Json.JsonEncodedText.Encode("failure_streak"); - private static readonly System.Text.Json.JsonEncodedText PropMostRecentFailure = System.Text.Json.JsonEncodedText.Encode("most_recent_failure"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.FileSettingsIndicatorDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFailureStreak = default; - LocalJsonValue propMostRecentFailure = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFailureStreak.TryReadProperty(ref reader, options, PropFailureStreak, null)) - { - continue; - } - - if (propMostRecentFailure.TryReadProperty(ref reader, options, PropMostRecentFailure, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.FileSettingsIndicatorDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FailureStreak = propFailureStreak.Value, - MostRecentFailure = propMostRecentFailure.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.FileSettingsIndicatorDetails value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFailureStreak, value.FailureStreak, null, null); - writer.WriteProperty(options, PropMostRecentFailure, value.MostRecentFailure, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.FileSettingsIndicatorDetailsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.FileSettingsIndicatorDetailsConverter))] public sealed partial class FileSettingsIndicatorDetails { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IlmIndicator.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IlmIndicator.Converters.g.cs new file mode 100644 index 00000000000..a0d31c35d9b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IlmIndicator.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class IlmIndicatorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); + private static readonly System.Text.Json.JsonEncodedText PropDiagnosis = System.Text.Json.JsonEncodedText.Encode("diagnosis"); + private static readonly System.Text.Json.JsonEncodedText PropImpacts = System.Text.Json.JsonEncodedText.Encode("impacts"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + private static readonly System.Text.Json.JsonEncodedText PropSymptom = System.Text.Json.JsonEncodedText.Encode("symptom"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.IlmIndicator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDetails = default; + LocalJsonValue?> propDiagnosis = default; + LocalJsonValue?> propImpacts = default; + LocalJsonValue propStatus = default; + LocalJsonValue propSymptom = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDetails.TryReadProperty(ref reader, options, PropDetails, null)) + { + continue; + } + + if (propDiagnosis.TryReadProperty(ref reader, options, PropDiagnosis, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propImpacts.TryReadProperty(ref reader, options, PropImpacts, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (propSymptom.TryReadProperty(ref reader, options, PropSymptom, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.IlmIndicator(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Details = propDetails.Value, + Diagnosis = propDiagnosis.Value, + Impacts = propImpacts.Value, + Status = propStatus.Value, + Symptom = propSymptom.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.IlmIndicator value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDetails, value.Details, null, null); + writer.WriteProperty(options, PropDiagnosis, value.Diagnosis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropImpacts, value.Impacts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteProperty(options, PropSymptom, value.Symptom, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IlmIndicator.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IlmIndicator.g.cs index 96684de2ad6..9f4eecca617 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IlmIndicator.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IlmIndicator.g.cs @@ -23,87 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class IlmIndicatorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); - private static readonly System.Text.Json.JsonEncodedText PropDiagnosis = System.Text.Json.JsonEncodedText.Encode("diagnosis"); - private static readonly System.Text.Json.JsonEncodedText PropImpacts = System.Text.Json.JsonEncodedText.Encode("impacts"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - private static readonly System.Text.Json.JsonEncodedText PropSymptom = System.Text.Json.JsonEncodedText.Encode("symptom"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.IlmIndicator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDetails = default; - LocalJsonValue?> propDiagnosis = default; - LocalJsonValue?> propImpacts = default; - LocalJsonValue propStatus = default; - LocalJsonValue propSymptom = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDetails.TryReadProperty(ref reader, options, PropDetails, null)) - { - continue; - } - - if (propDiagnosis.TryReadProperty(ref reader, options, PropDiagnosis, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propImpacts.TryReadProperty(ref reader, options, PropImpacts, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (propSymptom.TryReadProperty(ref reader, options, PropSymptom, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.IlmIndicator(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Details = propDetails.Value, - Diagnosis = propDiagnosis.Value, - Impacts = propImpacts.Value, - Status = propStatus.Value, - Symptom = propSymptom.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.IlmIndicator value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDetails, value.Details, null, null); - writer.WriteProperty(options, PropDiagnosis, value.Diagnosis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropImpacts, value.Impacts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteProperty(options, PropSymptom, value.Symptom, null, null); - writer.WriteEndObject(); - } -} - /// /// /// ILM /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.IlmIndicatorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.IlmIndicatorConverter))] public sealed partial class IlmIndicator { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IlmIndicatorDetails.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IlmIndicatorDetails.Converters.g.cs new file mode 100644 index 00000000000..f7e7db4ae86 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IlmIndicatorDetails.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class IlmIndicatorDetailsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIlmStatus = System.Text.Json.JsonEncodedText.Encode("ilm_status"); + private static readonly System.Text.Json.JsonEncodedText PropPolicies = System.Text.Json.JsonEncodedText.Encode("policies"); + private static readonly System.Text.Json.JsonEncodedText PropStagnatingIndices = System.Text.Json.JsonEncodedText.Encode("stagnating_indices"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.IlmIndicatorDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIlmStatus = default; + LocalJsonValue propPolicies = default; + LocalJsonValue propStagnatingIndices = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIlmStatus.TryReadProperty(ref reader, options, PropIlmStatus, null)) + { + continue; + } + + if (propPolicies.TryReadProperty(ref reader, options, PropPolicies, null)) + { + continue; + } + + if (propStagnatingIndices.TryReadProperty(ref reader, options, PropStagnatingIndices, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.IlmIndicatorDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + IlmStatus = propIlmStatus.Value, + Policies = propPolicies.Value, + StagnatingIndices = propStagnatingIndices.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.IlmIndicatorDetails value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIlmStatus, value.IlmStatus, null, null); + writer.WriteProperty(options, PropPolicies, value.Policies, null, null); + writer.WriteProperty(options, PropStagnatingIndices, value.StagnatingIndices, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IlmIndicatorDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IlmIndicatorDetails.g.cs index 22a03d24d07..00c95000fe4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IlmIndicatorDetails.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IlmIndicatorDetails.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class IlmIndicatorDetailsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIlmStatus = System.Text.Json.JsonEncodedText.Encode("ilm_status"); - private static readonly System.Text.Json.JsonEncodedText PropPolicies = System.Text.Json.JsonEncodedText.Encode("policies"); - private static readonly System.Text.Json.JsonEncodedText PropStagnatingIndices = System.Text.Json.JsonEncodedText.Encode("stagnating_indices"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.IlmIndicatorDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIlmStatus = default; - LocalJsonValue propPolicies = default; - LocalJsonValue propStagnatingIndices = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIlmStatus.TryReadProperty(ref reader, options, PropIlmStatus, null)) - { - continue; - } - - if (propPolicies.TryReadProperty(ref reader, options, PropPolicies, null)) - { - continue; - } - - if (propStagnatingIndices.TryReadProperty(ref reader, options, PropStagnatingIndices, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.IlmIndicatorDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - IlmStatus = propIlmStatus.Value, - Policies = propPolicies.Value, - StagnatingIndices = propStagnatingIndices.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.IlmIndicatorDetails value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIlmStatus, value.IlmStatus, null, null); - writer.WriteProperty(options, PropPolicies, value.Policies, null, null); - writer.WriteProperty(options, PropStagnatingIndices, value.StagnatingIndices, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.IlmIndicatorDetailsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.IlmIndicatorDetailsConverter))] public sealed partial class IlmIndicatorDetails { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Impact.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Impact.Converters.g.cs new file mode 100644 index 00000000000..d67498886b9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Impact.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class ImpactConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropImpactAreas = System.Text.Json.JsonEncodedText.Encode("impact_areas"); + private static readonly System.Text.Json.JsonEncodedText PropSeverity = System.Text.Json.JsonEncodedText.Encode("severity"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.Impact Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propId = default; + LocalJsonValue> propImpactAreas = default; + LocalJsonValue propSeverity = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propImpactAreas.TryReadProperty(ref reader, options, PropImpactAreas, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propSeverity.TryReadProperty(ref reader, options, PropSeverity, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.Impact(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Id = propId.Value, + ImpactAreas = propImpactAreas.Value, + Severity = propSeverity.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.Impact value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropImpactAreas, value.ImpactAreas, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSeverity, value.Severity, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Impact.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Impact.g.cs index 8cda5cd7b6f..8ec70ce9945 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Impact.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Impact.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class ImpactConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropImpactAreas = System.Text.Json.JsonEncodedText.Encode("impact_areas"); - private static readonly System.Text.Json.JsonEncodedText PropSeverity = System.Text.Json.JsonEncodedText.Encode("severity"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.Impact Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propId = default; - LocalJsonValue> propImpactAreas = default; - LocalJsonValue propSeverity = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propImpactAreas.TryReadProperty(ref reader, options, PropImpactAreas, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propSeverity.TryReadProperty(ref reader, options, PropSeverity, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.Impact(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Id = propId.Value, - ImpactAreas = propImpactAreas.Value, - Severity = propSeverity.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.Impact value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropImpactAreas, value.ImpactAreas, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSeverity, value.Severity, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.ImpactConverter))] public sealed partial class Impact { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ImpactArea.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ImpactArea.Converters.g.cs new file mode 100644 index 00000000000..df4cfc192e0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ImpactArea.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class ImpactAreaConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberBackup = System.Text.Json.JsonEncodedText.Encode("backup"); + private static readonly System.Text.Json.JsonEncodedText MemberDeploymentManagement = System.Text.Json.JsonEncodedText.Encode("deployment_management"); + private static readonly System.Text.Json.JsonEncodedText MemberIngest = System.Text.Json.JsonEncodedText.Encode("ingest"); + private static readonly System.Text.Json.JsonEncodedText MemberSearch = System.Text.Json.JsonEncodedText.Encode("search"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberBackup)) + { + return Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea.Backup; + } + + if (reader.ValueTextEquals(MemberDeploymentManagement)) + { + return Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea.DeploymentManagement; + } + + if (reader.ValueTextEquals(MemberIngest)) + { + return Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea.Ingest; + } + + if (reader.ValueTextEquals(MemberSearch)) + { + return Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea.Search; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberBackup.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea.Backup; + } + + if (string.Equals(value, MemberDeploymentManagement.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea.DeploymentManagement; + } + + if (string.Equals(value, MemberIngest.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea.Ingest; + } + + if (string.Equals(value, MemberSearch.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea.Search; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea.Backup: + writer.WriteStringValue(MemberBackup); + break; + case Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea.DeploymentManagement: + writer.WriteStringValue(MemberDeploymentManagement); + break; + case Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea.Ingest: + writer.WriteStringValue(MemberIngest); + break; + case Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea.Search: + writer.WriteStringValue(MemberSearch); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ImpactArea.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ImpactArea.g.cs new file mode 100644 index 00000000000..604664a15c5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ImpactArea.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.ImpactAreaConverter))] +public enum ImpactArea +{ + [System.Runtime.Serialization.EnumMember(Value = "backup")] + Backup, + [System.Runtime.Serialization.EnumMember(Value = "deployment_management")] + DeploymentManagement, + [System.Runtime.Serialization.EnumMember(Value = "ingest")] + Ingest, + [System.Runtime.Serialization.EnumMember(Value = "search")] + Search +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.HealthReport.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IndicatorHealthStatus.Converters.g.cs similarity index 52% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.HealthReport.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IndicatorHealthStatus.Converters.g.cs index e30ce85921e..5be96f8d46a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.HealthReport.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IndicatorHealthStatus.Converters.g.cs @@ -21,9 +21,9 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.Core.HealthReport; +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; -internal sealed partial class IndicatorHealthStatusConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class IndicatorHealthStatusConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText MemberGreen = System.Text.Json.JsonEncodedText.Encode("green"); private static readonly System.Text.Json.JsonEncodedText MemberRed = System.Text.Json.JsonEncodedText.Encode("red"); @@ -120,117 +120,4 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, { Write(writer, value, options); } -} - -internal sealed partial class ImpactAreaConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberBackup = System.Text.Json.JsonEncodedText.Encode("backup"); - private static readonly System.Text.Json.JsonEncodedText MemberDeploymentManagement = System.Text.Json.JsonEncodedText.Encode("deployment_management"); - private static readonly System.Text.Json.JsonEncodedText MemberIngest = System.Text.Json.JsonEncodedText.Encode("ingest"); - private static readonly System.Text.Json.JsonEncodedText MemberSearch = System.Text.Json.JsonEncodedText.Encode("search"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberBackup)) - { - return Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea.Backup; - } - - if (reader.ValueTextEquals(MemberDeploymentManagement)) - { - return Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea.DeploymentManagement; - } - - if (reader.ValueTextEquals(MemberIngest)) - { - return Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea.Ingest; - } - - if (reader.ValueTextEquals(MemberSearch)) - { - return Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea.Search; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberBackup.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea.Backup; - } - - if (string.Equals(value, MemberDeploymentManagement.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea.DeploymentManagement; - } - - if (string.Equals(value, MemberIngest.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea.Ingest; - } - - if (string.Equals(value, MemberSearch.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea.Search; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea.Backup: - writer.WriteStringValue(MemberBackup); - break; - case Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea.DeploymentManagement: - writer.WriteStringValue(MemberDeploymentManagement); - break; - case Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea.Ingest: - writer.WriteStringValue(MemberIngest); - break; - case Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea.Search: - writer.WriteStringValue(MemberSearch); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactArea value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.IndicatorHealthStatusConverter))] -public enum IndicatorHealthStatus -{ - [System.Runtime.Serialization.EnumMember(Value = "green")] - Green, - [System.Runtime.Serialization.EnumMember(Value = "red")] - Red, - [System.Runtime.Serialization.EnumMember(Value = "unavailable")] - Unavailable, - [System.Runtime.Serialization.EnumMember(Value = "unknown")] - Unknown, - [System.Runtime.Serialization.EnumMember(Value = "yellow")] - Yellow -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.ImpactAreaConverter))] -public enum ImpactArea -{ - [System.Runtime.Serialization.EnumMember(Value = "backup")] - Backup, - [System.Runtime.Serialization.EnumMember(Value = "deployment_management")] - DeploymentManagement, - [System.Runtime.Serialization.EnumMember(Value = "ingest")] - Ingest, - [System.Runtime.Serialization.EnumMember(Value = "search")] - Search } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IndicatorHealthStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IndicatorHealthStatus.g.cs new file mode 100644 index 00000000000..99ee4178fe1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IndicatorHealthStatus.g.cs @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.IndicatorHealthStatusConverter))] +public enum IndicatorHealthStatus +{ + [System.Runtime.Serialization.EnumMember(Value = "green")] + Green, + [System.Runtime.Serialization.EnumMember(Value = "red")] + Red, + [System.Runtime.Serialization.EnumMember(Value = "unavailable")] + Unavailable, + [System.Runtime.Serialization.EnumMember(Value = "unknown")] + Unknown, + [System.Runtime.Serialization.EnumMember(Value = "yellow")] + Yellow +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IndicatorNode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IndicatorNode.Converters.g.cs new file mode 100644 index 00000000000..51ed6a36581 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IndicatorNode.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class IndicatorNodeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropNodeId = System.Text.Json.JsonEncodedText.Encode("node_id"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.IndicatorNode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + LocalJsonValue propNodeId = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propNodeId.TryReadProperty(ref reader, options, PropNodeId, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.IndicatorNode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value, + NodeId = propNodeId.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.IndicatorNode value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropNodeId, value.NodeId, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IndicatorNode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IndicatorNode.g.cs index a4ed00408f5..0a569875e25 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IndicatorNode.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/IndicatorNode.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class IndicatorNodeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropNodeId = System.Text.Json.JsonEncodedText.Encode("node_id"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.IndicatorNode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - LocalJsonValue propNodeId = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propNodeId.TryReadProperty(ref reader, options, PropNodeId, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.IndicatorNode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value, - NodeId = propNodeId.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.IndicatorNode value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropNodeId, value.NodeId, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.IndicatorNodeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.IndicatorNodeConverter))] public sealed partial class IndicatorNode { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Indicators.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Indicators.Converters.g.cs new file mode 100644 index 00000000000..d80f3098e79 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Indicators.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class IndicatorsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDataStreamLifecycle = System.Text.Json.JsonEncodedText.Encode("data_stream_lifecycle"); + private static readonly System.Text.Json.JsonEncodedText PropDisk = System.Text.Json.JsonEncodedText.Encode("disk"); + private static readonly System.Text.Json.JsonEncodedText PropFileSettings = System.Text.Json.JsonEncodedText.Encode("file_settings"); + private static readonly System.Text.Json.JsonEncodedText PropIlm = System.Text.Json.JsonEncodedText.Encode("ilm"); + private static readonly System.Text.Json.JsonEncodedText PropMasterIsStable = System.Text.Json.JsonEncodedText.Encode("master_is_stable"); + private static readonly System.Text.Json.JsonEncodedText PropRepositoryIntegrity = System.Text.Json.JsonEncodedText.Encode("repository_integrity"); + private static readonly System.Text.Json.JsonEncodedText PropShardsAvailability = System.Text.Json.JsonEncodedText.Encode("shards_availability"); + private static readonly System.Text.Json.JsonEncodedText PropShardsCapacity = System.Text.Json.JsonEncodedText.Encode("shards_capacity"); + private static readonly System.Text.Json.JsonEncodedText PropSlm = System.Text.Json.JsonEncodedText.Encode("slm"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.Indicators Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDataStreamLifecycle = default; + LocalJsonValue propDisk = default; + LocalJsonValue propFileSettings = default; + LocalJsonValue propIlm = default; + LocalJsonValue propMasterIsStable = default; + LocalJsonValue propRepositoryIntegrity = default; + LocalJsonValue propShardsAvailability = default; + LocalJsonValue propShardsCapacity = default; + LocalJsonValue propSlm = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDataStreamLifecycle.TryReadProperty(ref reader, options, PropDataStreamLifecycle, null)) + { + continue; + } + + if (propDisk.TryReadProperty(ref reader, options, PropDisk, null)) + { + continue; + } + + if (propFileSettings.TryReadProperty(ref reader, options, PropFileSettings, null)) + { + continue; + } + + if (propIlm.TryReadProperty(ref reader, options, PropIlm, null)) + { + continue; + } + + if (propMasterIsStable.TryReadProperty(ref reader, options, PropMasterIsStable, null)) + { + continue; + } + + if (propRepositoryIntegrity.TryReadProperty(ref reader, options, PropRepositoryIntegrity, null)) + { + continue; + } + + if (propShardsAvailability.TryReadProperty(ref reader, options, PropShardsAvailability, null)) + { + continue; + } + + if (propShardsCapacity.TryReadProperty(ref reader, options, PropShardsCapacity, null)) + { + continue; + } + + if (propSlm.TryReadProperty(ref reader, options, PropSlm, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.Indicators(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DataStreamLifecycle = propDataStreamLifecycle.Value, + Disk = propDisk.Value, + FileSettings = propFileSettings.Value, + Ilm = propIlm.Value, + MasterIsStable = propMasterIsStable.Value, + RepositoryIntegrity = propRepositoryIntegrity.Value, + ShardsAvailability = propShardsAvailability.Value, + ShardsCapacity = propShardsCapacity.Value, + Slm = propSlm.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.Indicators value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDataStreamLifecycle, value.DataStreamLifecycle, null, null); + writer.WriteProperty(options, PropDisk, value.Disk, null, null); + writer.WriteProperty(options, PropFileSettings, value.FileSettings, null, null); + writer.WriteProperty(options, PropIlm, value.Ilm, null, null); + writer.WriteProperty(options, PropMasterIsStable, value.MasterIsStable, null, null); + writer.WriteProperty(options, PropRepositoryIntegrity, value.RepositoryIntegrity, null, null); + writer.WriteProperty(options, PropShardsAvailability, value.ShardsAvailability, null, null); + writer.WriteProperty(options, PropShardsCapacity, value.ShardsCapacity, null, null); + writer.WriteProperty(options, PropSlm, value.Slm, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Indicators.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Indicators.g.cs index 64d7278cad7..62bda50f357 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Indicators.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/Indicators.g.cs @@ -23,118 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class IndicatorsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDataStreamLifecycle = System.Text.Json.JsonEncodedText.Encode("data_stream_lifecycle"); - private static readonly System.Text.Json.JsonEncodedText PropDisk = System.Text.Json.JsonEncodedText.Encode("disk"); - private static readonly System.Text.Json.JsonEncodedText PropFileSettings = System.Text.Json.JsonEncodedText.Encode("file_settings"); - private static readonly System.Text.Json.JsonEncodedText PropIlm = System.Text.Json.JsonEncodedText.Encode("ilm"); - private static readonly System.Text.Json.JsonEncodedText PropMasterIsStable = System.Text.Json.JsonEncodedText.Encode("master_is_stable"); - private static readonly System.Text.Json.JsonEncodedText PropRepositoryIntegrity = System.Text.Json.JsonEncodedText.Encode("repository_integrity"); - private static readonly System.Text.Json.JsonEncodedText PropShardsAvailability = System.Text.Json.JsonEncodedText.Encode("shards_availability"); - private static readonly System.Text.Json.JsonEncodedText PropShardsCapacity = System.Text.Json.JsonEncodedText.Encode("shards_capacity"); - private static readonly System.Text.Json.JsonEncodedText PropSlm = System.Text.Json.JsonEncodedText.Encode("slm"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.Indicators Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDataStreamLifecycle = default; - LocalJsonValue propDisk = default; - LocalJsonValue propFileSettings = default; - LocalJsonValue propIlm = default; - LocalJsonValue propMasterIsStable = default; - LocalJsonValue propRepositoryIntegrity = default; - LocalJsonValue propShardsAvailability = default; - LocalJsonValue propShardsCapacity = default; - LocalJsonValue propSlm = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDataStreamLifecycle.TryReadProperty(ref reader, options, PropDataStreamLifecycle, null)) - { - continue; - } - - if (propDisk.TryReadProperty(ref reader, options, PropDisk, null)) - { - continue; - } - - if (propFileSettings.TryReadProperty(ref reader, options, PropFileSettings, null)) - { - continue; - } - - if (propIlm.TryReadProperty(ref reader, options, PropIlm, null)) - { - continue; - } - - if (propMasterIsStable.TryReadProperty(ref reader, options, PropMasterIsStable, null)) - { - continue; - } - - if (propRepositoryIntegrity.TryReadProperty(ref reader, options, PropRepositoryIntegrity, null)) - { - continue; - } - - if (propShardsAvailability.TryReadProperty(ref reader, options, PropShardsAvailability, null)) - { - continue; - } - - if (propShardsCapacity.TryReadProperty(ref reader, options, PropShardsCapacity, null)) - { - continue; - } - - if (propSlm.TryReadProperty(ref reader, options, PropSlm, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.Indicators(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DataStreamLifecycle = propDataStreamLifecycle.Value, - Disk = propDisk.Value, - FileSettings = propFileSettings.Value, - Ilm = propIlm.Value, - MasterIsStable = propMasterIsStable.Value, - RepositoryIntegrity = propRepositoryIntegrity.Value, - ShardsAvailability = propShardsAvailability.Value, - ShardsCapacity = propShardsCapacity.Value, - Slm = propSlm.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.Indicators value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDataStreamLifecycle, value.DataStreamLifecycle, null, null); - writer.WriteProperty(options, PropDisk, value.Disk, null, null); - writer.WriteProperty(options, PropFileSettings, value.FileSettings, null, null); - writer.WriteProperty(options, PropIlm, value.Ilm, null, null); - writer.WriteProperty(options, PropMasterIsStable, value.MasterIsStable, null, null); - writer.WriteProperty(options, PropRepositoryIntegrity, value.RepositoryIntegrity, null, null); - writer.WriteProperty(options, PropShardsAvailability, value.ShardsAvailability, null, null); - writer.WriteProperty(options, PropShardsCapacity, value.ShardsCapacity, null, null); - writer.WriteProperty(options, PropSlm, value.Slm, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.IndicatorsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.IndicatorsConverter))] public sealed partial class Indicators { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicator.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicator.Converters.g.cs new file mode 100644 index 00000000000..45c625019cd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicator.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class MasterIsStableIndicatorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); + private static readonly System.Text.Json.JsonEncodedText PropDiagnosis = System.Text.Json.JsonEncodedText.Encode("diagnosis"); + private static readonly System.Text.Json.JsonEncodedText PropImpacts = System.Text.Json.JsonEncodedText.Encode("impacts"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + private static readonly System.Text.Json.JsonEncodedText PropSymptom = System.Text.Json.JsonEncodedText.Encode("symptom"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDetails = default; + LocalJsonValue?> propDiagnosis = default; + LocalJsonValue?> propImpacts = default; + LocalJsonValue propStatus = default; + LocalJsonValue propSymptom = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDetails.TryReadProperty(ref reader, options, PropDetails, null)) + { + continue; + } + + if (propDiagnosis.TryReadProperty(ref reader, options, PropDiagnosis, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propImpacts.TryReadProperty(ref reader, options, PropImpacts, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (propSymptom.TryReadProperty(ref reader, options, PropSymptom, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicator(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Details = propDetails.Value, + Diagnosis = propDiagnosis.Value, + Impacts = propImpacts.Value, + Status = propStatus.Value, + Symptom = propSymptom.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicator value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDetails, value.Details, null, null); + writer.WriteProperty(options, PropDiagnosis, value.Diagnosis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropImpacts, value.Impacts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteProperty(options, PropSymptom, value.Symptom, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicator.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicator.g.cs index 025fd034ae3..ce3a4c8f554 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicator.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicator.g.cs @@ -23,87 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class MasterIsStableIndicatorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); - private static readonly System.Text.Json.JsonEncodedText PropDiagnosis = System.Text.Json.JsonEncodedText.Encode("diagnosis"); - private static readonly System.Text.Json.JsonEncodedText PropImpacts = System.Text.Json.JsonEncodedText.Encode("impacts"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - private static readonly System.Text.Json.JsonEncodedText PropSymptom = System.Text.Json.JsonEncodedText.Encode("symptom"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDetails = default; - LocalJsonValue?> propDiagnosis = default; - LocalJsonValue?> propImpacts = default; - LocalJsonValue propStatus = default; - LocalJsonValue propSymptom = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDetails.TryReadProperty(ref reader, options, PropDetails, null)) - { - continue; - } - - if (propDiagnosis.TryReadProperty(ref reader, options, PropDiagnosis, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propImpacts.TryReadProperty(ref reader, options, PropImpacts, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (propSymptom.TryReadProperty(ref reader, options, PropSymptom, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicator(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Details = propDetails.Value, - Diagnosis = propDiagnosis.Value, - Impacts = propImpacts.Value, - Status = propStatus.Value, - Symptom = propSymptom.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicator value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDetails, value.Details, null, null); - writer.WriteProperty(options, PropDiagnosis, value.Diagnosis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropImpacts, value.Impacts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteProperty(options, PropSymptom, value.Symptom, null, null); - writer.WriteEndObject(); - } -} - /// /// /// MASTER_IS_STABLE /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicatorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.MasterIsStableIndicatorConverter))] public sealed partial class MasterIsStableIndicator { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorClusterFormationNode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorClusterFormationNode.Converters.g.cs new file mode 100644 index 00000000000..3d6f5c50fec --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorClusterFormationNode.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class MasterIsStableIndicatorClusterFormationNodeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClusterFormationMessage = System.Text.Json.JsonEncodedText.Encode("cluster_formation_message"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropNodeId = System.Text.Json.JsonEncodedText.Encode("node_id"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicatorClusterFormationNode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClusterFormationMessage = default; + LocalJsonValue propName = default; + LocalJsonValue propNodeId = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClusterFormationMessage.TryReadProperty(ref reader, options, PropClusterFormationMessage, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propNodeId.TryReadProperty(ref reader, options, PropNodeId, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicatorClusterFormationNode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClusterFormationMessage = propClusterFormationMessage.Value, + Name = propName.Value, + NodeId = propNodeId.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicatorClusterFormationNode value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClusterFormationMessage, value.ClusterFormationMessage, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropNodeId, value.NodeId, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorClusterFormationNode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorClusterFormationNode.g.cs index d1ece701e59..3acba17b3f5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorClusterFormationNode.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorClusterFormationNode.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class MasterIsStableIndicatorClusterFormationNodeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClusterFormationMessage = System.Text.Json.JsonEncodedText.Encode("cluster_formation_message"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropNodeId = System.Text.Json.JsonEncodedText.Encode("node_id"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicatorClusterFormationNode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClusterFormationMessage = default; - LocalJsonValue propName = default; - LocalJsonValue propNodeId = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClusterFormationMessage.TryReadProperty(ref reader, options, PropClusterFormationMessage, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propNodeId.TryReadProperty(ref reader, options, PropNodeId, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicatorClusterFormationNode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClusterFormationMessage = propClusterFormationMessage.Value, - Name = propName.Value, - NodeId = propNodeId.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicatorClusterFormationNode value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClusterFormationMessage, value.ClusterFormationMessage, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropNodeId, value.NodeId, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicatorClusterFormationNodeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.MasterIsStableIndicatorClusterFormationNodeConverter))] public sealed partial class MasterIsStableIndicatorClusterFormationNode { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorDetails.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorDetails.Converters.g.cs new file mode 100644 index 00000000000..1c067a1364b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorDetails.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class MasterIsStableIndicatorDetailsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClusterFormation = System.Text.Json.JsonEncodedText.Encode("cluster_formation"); + private static readonly System.Text.Json.JsonEncodedText PropCurrentMaster = System.Text.Json.JsonEncodedText.Encode("current_master"); + private static readonly System.Text.Json.JsonEncodedText PropExceptionFetchingHistory = System.Text.Json.JsonEncodedText.Encode("exception_fetching_history"); + private static readonly System.Text.Json.JsonEncodedText PropRecentMasters = System.Text.Json.JsonEncodedText.Encode("recent_masters"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicatorDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propClusterFormation = default; + LocalJsonValue propCurrentMaster = default; + LocalJsonValue propExceptionFetchingHistory = default; + LocalJsonValue> propRecentMasters = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClusterFormation.TryReadProperty(ref reader, options, PropClusterFormation, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propCurrentMaster.TryReadProperty(ref reader, options, PropCurrentMaster, null)) + { + continue; + } + + if (propExceptionFetchingHistory.TryReadProperty(ref reader, options, PropExceptionFetchingHistory, null)) + { + continue; + } + + if (propRecentMasters.TryReadProperty(ref reader, options, PropRecentMasters, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicatorDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClusterFormation = propClusterFormation.Value, + CurrentMaster = propCurrentMaster.Value, + ExceptionFetchingHistory = propExceptionFetchingHistory.Value, + RecentMasters = propRecentMasters.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicatorDetails value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClusterFormation, value.ClusterFormation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCurrentMaster, value.CurrentMaster, null, null); + writer.WriteProperty(options, PropExceptionFetchingHistory, value.ExceptionFetchingHistory, null, null); + writer.WriteProperty(options, PropRecentMasters, value.RecentMasters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorDetails.g.cs index c3664f684d3..dae3fd6a43c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorDetails.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorDetails.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class MasterIsStableIndicatorDetailsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClusterFormation = System.Text.Json.JsonEncodedText.Encode("cluster_formation"); - private static readonly System.Text.Json.JsonEncodedText PropCurrentMaster = System.Text.Json.JsonEncodedText.Encode("current_master"); - private static readonly System.Text.Json.JsonEncodedText PropExceptionFetchingHistory = System.Text.Json.JsonEncodedText.Encode("exception_fetching_history"); - private static readonly System.Text.Json.JsonEncodedText PropRecentMasters = System.Text.Json.JsonEncodedText.Encode("recent_masters"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicatorDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propClusterFormation = default; - LocalJsonValue propCurrentMaster = default; - LocalJsonValue propExceptionFetchingHistory = default; - LocalJsonValue> propRecentMasters = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClusterFormation.TryReadProperty(ref reader, options, PropClusterFormation, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propCurrentMaster.TryReadProperty(ref reader, options, PropCurrentMaster, null)) - { - continue; - } - - if (propExceptionFetchingHistory.TryReadProperty(ref reader, options, PropExceptionFetchingHistory, null)) - { - continue; - } - - if (propRecentMasters.TryReadProperty(ref reader, options, PropRecentMasters, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicatorDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClusterFormation = propClusterFormation.Value, - CurrentMaster = propCurrentMaster.Value, - ExceptionFetchingHistory = propExceptionFetchingHistory.Value, - RecentMasters = propRecentMasters.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicatorDetails value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClusterFormation, value.ClusterFormation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCurrentMaster, value.CurrentMaster, null, null); - writer.WriteProperty(options, PropExceptionFetchingHistory, value.ExceptionFetchingHistory, null, null); - writer.WriteProperty(options, PropRecentMasters, value.RecentMasters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicatorDetailsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.MasterIsStableIndicatorDetailsConverter))] public sealed partial class MasterIsStableIndicatorDetails { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorExceptionFetchingHistory.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorExceptionFetchingHistory.Converters.g.cs new file mode 100644 index 00000000000..a2ff9643e24 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorExceptionFetchingHistory.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class MasterIsStableIndicatorExceptionFetchingHistoryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMessage = System.Text.Json.JsonEncodedText.Encode("message"); + private static readonly System.Text.Json.JsonEncodedText PropStackTrace = System.Text.Json.JsonEncodedText.Encode("stack_trace"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicatorExceptionFetchingHistory Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMessage = default; + LocalJsonValue propStackTrace = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMessage.TryReadProperty(ref reader, options, PropMessage, null)) + { + continue; + } + + if (propStackTrace.TryReadProperty(ref reader, options, PropStackTrace, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicatorExceptionFetchingHistory(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Message = propMessage.Value, + StackTrace = propStackTrace.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicatorExceptionFetchingHistory value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMessage, value.Message, null, null); + writer.WriteProperty(options, PropStackTrace, value.StackTrace, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorExceptionFetchingHistory.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorExceptionFetchingHistory.g.cs index 4d5d9659491..b2270861176 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorExceptionFetchingHistory.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/MasterIsStableIndicatorExceptionFetchingHistory.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class MasterIsStableIndicatorExceptionFetchingHistoryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMessage = System.Text.Json.JsonEncodedText.Encode("message"); - private static readonly System.Text.Json.JsonEncodedText PropStackTrace = System.Text.Json.JsonEncodedText.Encode("stack_trace"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicatorExceptionFetchingHistory Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMessage = default; - LocalJsonValue propStackTrace = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMessage.TryReadProperty(ref reader, options, PropMessage, null)) - { - continue; - } - - if (propStackTrace.TryReadProperty(ref reader, options, PropStackTrace, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicatorExceptionFetchingHistory(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Message = propMessage.Value, - StackTrace = propStackTrace.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicatorExceptionFetchingHistory value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMessage, value.Message, null, null); - writer.WriteProperty(options, PropStackTrace, value.StackTrace, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.MasterIsStableIndicatorExceptionFetchingHistoryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.MasterIsStableIndicatorExceptionFetchingHistoryConverter))] public sealed partial class MasterIsStableIndicatorExceptionFetchingHistory { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicator.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicator.Converters.g.cs new file mode 100644 index 00000000000..edc0e07afbc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicator.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class RepositoryIntegrityIndicatorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); + private static readonly System.Text.Json.JsonEncodedText PropDiagnosis = System.Text.Json.JsonEncodedText.Encode("diagnosis"); + private static readonly System.Text.Json.JsonEncodedText PropImpacts = System.Text.Json.JsonEncodedText.Encode("impacts"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + private static readonly System.Text.Json.JsonEncodedText PropSymptom = System.Text.Json.JsonEncodedText.Encode("symptom"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.RepositoryIntegrityIndicator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDetails = default; + LocalJsonValue?> propDiagnosis = default; + LocalJsonValue?> propImpacts = default; + LocalJsonValue propStatus = default; + LocalJsonValue propSymptom = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDetails.TryReadProperty(ref reader, options, PropDetails, null)) + { + continue; + } + + if (propDiagnosis.TryReadProperty(ref reader, options, PropDiagnosis, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propImpacts.TryReadProperty(ref reader, options, PropImpacts, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (propSymptom.TryReadProperty(ref reader, options, PropSymptom, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.RepositoryIntegrityIndicator(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Details = propDetails.Value, + Diagnosis = propDiagnosis.Value, + Impacts = propImpacts.Value, + Status = propStatus.Value, + Symptom = propSymptom.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.RepositoryIntegrityIndicator value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDetails, value.Details, null, null); + writer.WriteProperty(options, PropDiagnosis, value.Diagnosis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropImpacts, value.Impacts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteProperty(options, PropSymptom, value.Symptom, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicator.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicator.g.cs index 0f48dfc1ab1..0a8d96e0baa 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicator.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicator.g.cs @@ -23,87 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class RepositoryIntegrityIndicatorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); - private static readonly System.Text.Json.JsonEncodedText PropDiagnosis = System.Text.Json.JsonEncodedText.Encode("diagnosis"); - private static readonly System.Text.Json.JsonEncodedText PropImpacts = System.Text.Json.JsonEncodedText.Encode("impacts"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - private static readonly System.Text.Json.JsonEncodedText PropSymptom = System.Text.Json.JsonEncodedText.Encode("symptom"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.RepositoryIntegrityIndicator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDetails = default; - LocalJsonValue?> propDiagnosis = default; - LocalJsonValue?> propImpacts = default; - LocalJsonValue propStatus = default; - LocalJsonValue propSymptom = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDetails.TryReadProperty(ref reader, options, PropDetails, null)) - { - continue; - } - - if (propDiagnosis.TryReadProperty(ref reader, options, PropDiagnosis, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propImpacts.TryReadProperty(ref reader, options, PropImpacts, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (propSymptom.TryReadProperty(ref reader, options, PropSymptom, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.RepositoryIntegrityIndicator(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Details = propDetails.Value, - Diagnosis = propDiagnosis.Value, - Impacts = propImpacts.Value, - Status = propStatus.Value, - Symptom = propSymptom.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.RepositoryIntegrityIndicator value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDetails, value.Details, null, null); - writer.WriteProperty(options, PropDiagnosis, value.Diagnosis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropImpacts, value.Impacts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteProperty(options, PropSymptom, value.Symptom, null, null); - writer.WriteEndObject(); - } -} - /// /// /// REPOSITORY_INTEGRITY /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.RepositoryIntegrityIndicatorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.RepositoryIntegrityIndicatorConverter))] public sealed partial class RepositoryIntegrityIndicator { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicatorDetails.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicatorDetails.Converters.g.cs new file mode 100644 index 00000000000..aac0cb81881 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicatorDetails.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class RepositoryIntegrityIndicatorDetailsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCorrupted = System.Text.Json.JsonEncodedText.Encode("corrupted"); + private static readonly System.Text.Json.JsonEncodedText PropCorruptedRepositories = System.Text.Json.JsonEncodedText.Encode("corrupted_repositories"); + private static readonly System.Text.Json.JsonEncodedText PropTotalRepositories = System.Text.Json.JsonEncodedText.Encode("total_repositories"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.RepositoryIntegrityIndicatorDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propCorrupted = default; + LocalJsonValue propCorruptedRepositories = default; + LocalJsonValue propTotalRepositories = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCorrupted.TryReadProperty(ref reader, options, PropCorrupted, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propCorruptedRepositories.TryReadProperty(ref reader, options, PropCorruptedRepositories, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotalRepositories.TryReadProperty(ref reader, options, PropTotalRepositories, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.RepositoryIntegrityIndicatorDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Corrupted = propCorrupted.Value, + CorruptedRepositories = propCorruptedRepositories.Value, + TotalRepositories = propTotalRepositories.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.RepositoryIntegrityIndicatorDetails value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCorrupted, value.Corrupted, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCorruptedRepositories, value.CorruptedRepositories, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotalRepositories, value.TotalRepositories, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicatorDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicatorDetails.g.cs index e75aaba1ebe..c29464a41cc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicatorDetails.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/RepositoryIntegrityIndicatorDetails.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class RepositoryIntegrityIndicatorDetailsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCorrupted = System.Text.Json.JsonEncodedText.Encode("corrupted"); - private static readonly System.Text.Json.JsonEncodedText PropCorruptedRepositories = System.Text.Json.JsonEncodedText.Encode("corrupted_repositories"); - private static readonly System.Text.Json.JsonEncodedText PropTotalRepositories = System.Text.Json.JsonEncodedText.Encode("total_repositories"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.RepositoryIntegrityIndicatorDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propCorrupted = default; - LocalJsonValue propCorruptedRepositories = default; - LocalJsonValue propTotalRepositories = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCorrupted.TryReadProperty(ref reader, options, PropCorrupted, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propCorruptedRepositories.TryReadProperty(ref reader, options, PropCorruptedRepositories, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotalRepositories.TryReadProperty(ref reader, options, PropTotalRepositories, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.RepositoryIntegrityIndicatorDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Corrupted = propCorrupted.Value, - CorruptedRepositories = propCorruptedRepositories.Value, - TotalRepositories = propTotalRepositories.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.RepositoryIntegrityIndicatorDetails value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCorrupted, value.Corrupted, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCorruptedRepositories, value.CorruptedRepositories, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotalRepositories, value.TotalRepositories, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.RepositoryIntegrityIndicatorDetailsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.RepositoryIntegrityIndicatorDetailsConverter))] public sealed partial class RepositoryIntegrityIndicatorDetails { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicator.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicator.Converters.g.cs new file mode 100644 index 00000000000..617cf073c1c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicator.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class ShardsAvailabilityIndicatorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); + private static readonly System.Text.Json.JsonEncodedText PropDiagnosis = System.Text.Json.JsonEncodedText.Encode("diagnosis"); + private static readonly System.Text.Json.JsonEncodedText PropImpacts = System.Text.Json.JsonEncodedText.Encode("impacts"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + private static readonly System.Text.Json.JsonEncodedText PropSymptom = System.Text.Json.JsonEncodedText.Encode("symptom"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsAvailabilityIndicator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDetails = default; + LocalJsonValue?> propDiagnosis = default; + LocalJsonValue?> propImpacts = default; + LocalJsonValue propStatus = default; + LocalJsonValue propSymptom = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDetails.TryReadProperty(ref reader, options, PropDetails, null)) + { + continue; + } + + if (propDiagnosis.TryReadProperty(ref reader, options, PropDiagnosis, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propImpacts.TryReadProperty(ref reader, options, PropImpacts, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (propSymptom.TryReadProperty(ref reader, options, PropSymptom, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsAvailabilityIndicator(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Details = propDetails.Value, + Diagnosis = propDiagnosis.Value, + Impacts = propImpacts.Value, + Status = propStatus.Value, + Symptom = propSymptom.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsAvailabilityIndicator value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDetails, value.Details, null, null); + writer.WriteProperty(options, PropDiagnosis, value.Diagnosis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropImpacts, value.Impacts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteProperty(options, PropSymptom, value.Symptom, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicator.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicator.g.cs index 9cde7a38b03..af1cb7f7320 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicator.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicator.g.cs @@ -23,87 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class ShardsAvailabilityIndicatorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); - private static readonly System.Text.Json.JsonEncodedText PropDiagnosis = System.Text.Json.JsonEncodedText.Encode("diagnosis"); - private static readonly System.Text.Json.JsonEncodedText PropImpacts = System.Text.Json.JsonEncodedText.Encode("impacts"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - private static readonly System.Text.Json.JsonEncodedText PropSymptom = System.Text.Json.JsonEncodedText.Encode("symptom"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsAvailabilityIndicator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDetails = default; - LocalJsonValue?> propDiagnosis = default; - LocalJsonValue?> propImpacts = default; - LocalJsonValue propStatus = default; - LocalJsonValue propSymptom = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDetails.TryReadProperty(ref reader, options, PropDetails, null)) - { - continue; - } - - if (propDiagnosis.TryReadProperty(ref reader, options, PropDiagnosis, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propImpacts.TryReadProperty(ref reader, options, PropImpacts, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (propSymptom.TryReadProperty(ref reader, options, PropSymptom, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsAvailabilityIndicator(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Details = propDetails.Value, - Diagnosis = propDiagnosis.Value, - Impacts = propImpacts.Value, - Status = propStatus.Value, - Symptom = propSymptom.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsAvailabilityIndicator value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDetails, value.Details, null, null); - writer.WriteProperty(options, PropDiagnosis, value.Diagnosis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropImpacts, value.Impacts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteProperty(options, PropSymptom, value.Symptom, null, null); - writer.WriteEndObject(); - } -} - /// /// /// SHARDS_AVAILABILITY /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsAvailabilityIndicatorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.ShardsAvailabilityIndicatorConverter))] public sealed partial class ShardsAvailabilityIndicator { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicatorDetails.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicatorDetails.Converters.g.cs new file mode 100644 index 00000000000..390196b76cd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicatorDetails.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class ShardsAvailabilityIndicatorDetailsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCreatingPrimaries = System.Text.Json.JsonEncodedText.Encode("creating_primaries"); + private static readonly System.Text.Json.JsonEncodedText PropCreatingReplicas = System.Text.Json.JsonEncodedText.Encode("creating_replicas"); + private static readonly System.Text.Json.JsonEncodedText PropInitializingPrimaries = System.Text.Json.JsonEncodedText.Encode("initializing_primaries"); + private static readonly System.Text.Json.JsonEncodedText PropInitializingReplicas = System.Text.Json.JsonEncodedText.Encode("initializing_replicas"); + private static readonly System.Text.Json.JsonEncodedText PropRestartingPrimaries = System.Text.Json.JsonEncodedText.Encode("restarting_primaries"); + private static readonly System.Text.Json.JsonEncodedText PropRestartingReplicas = System.Text.Json.JsonEncodedText.Encode("restarting_replicas"); + private static readonly System.Text.Json.JsonEncodedText PropStartedPrimaries = System.Text.Json.JsonEncodedText.Encode("started_primaries"); + private static readonly System.Text.Json.JsonEncodedText PropStartedReplicas = System.Text.Json.JsonEncodedText.Encode("started_replicas"); + private static readonly System.Text.Json.JsonEncodedText PropUnassignedPrimaries = System.Text.Json.JsonEncodedText.Encode("unassigned_primaries"); + private static readonly System.Text.Json.JsonEncodedText PropUnassignedReplicas = System.Text.Json.JsonEncodedText.Encode("unassigned_replicas"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsAvailabilityIndicatorDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCreatingPrimaries = default; + LocalJsonValue propCreatingReplicas = default; + LocalJsonValue propInitializingPrimaries = default; + LocalJsonValue propInitializingReplicas = default; + LocalJsonValue propRestartingPrimaries = default; + LocalJsonValue propRestartingReplicas = default; + LocalJsonValue propStartedPrimaries = default; + LocalJsonValue propStartedReplicas = default; + LocalJsonValue propUnassignedPrimaries = default; + LocalJsonValue propUnassignedReplicas = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCreatingPrimaries.TryReadProperty(ref reader, options, PropCreatingPrimaries, null)) + { + continue; + } + + if (propCreatingReplicas.TryReadProperty(ref reader, options, PropCreatingReplicas, null)) + { + continue; + } + + if (propInitializingPrimaries.TryReadProperty(ref reader, options, PropInitializingPrimaries, null)) + { + continue; + } + + if (propInitializingReplicas.TryReadProperty(ref reader, options, PropInitializingReplicas, null)) + { + continue; + } + + if (propRestartingPrimaries.TryReadProperty(ref reader, options, PropRestartingPrimaries, null)) + { + continue; + } + + if (propRestartingReplicas.TryReadProperty(ref reader, options, PropRestartingReplicas, null)) + { + continue; + } + + if (propStartedPrimaries.TryReadProperty(ref reader, options, PropStartedPrimaries, null)) + { + continue; + } + + if (propStartedReplicas.TryReadProperty(ref reader, options, PropStartedReplicas, null)) + { + continue; + } + + if (propUnassignedPrimaries.TryReadProperty(ref reader, options, PropUnassignedPrimaries, null)) + { + continue; + } + + if (propUnassignedReplicas.TryReadProperty(ref reader, options, PropUnassignedReplicas, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsAvailabilityIndicatorDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CreatingPrimaries = propCreatingPrimaries.Value, + CreatingReplicas = propCreatingReplicas.Value, + InitializingPrimaries = propInitializingPrimaries.Value, + InitializingReplicas = propInitializingReplicas.Value, + RestartingPrimaries = propRestartingPrimaries.Value, + RestartingReplicas = propRestartingReplicas.Value, + StartedPrimaries = propStartedPrimaries.Value, + StartedReplicas = propStartedReplicas.Value, + UnassignedPrimaries = propUnassignedPrimaries.Value, + UnassignedReplicas = propUnassignedReplicas.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsAvailabilityIndicatorDetails value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCreatingPrimaries, value.CreatingPrimaries, null, null); + writer.WriteProperty(options, PropCreatingReplicas, value.CreatingReplicas, null, null); + writer.WriteProperty(options, PropInitializingPrimaries, value.InitializingPrimaries, null, null); + writer.WriteProperty(options, PropInitializingReplicas, value.InitializingReplicas, null, null); + writer.WriteProperty(options, PropRestartingPrimaries, value.RestartingPrimaries, null, null); + writer.WriteProperty(options, PropRestartingReplicas, value.RestartingReplicas, null, null); + writer.WriteProperty(options, PropStartedPrimaries, value.StartedPrimaries, null, null); + writer.WriteProperty(options, PropStartedReplicas, value.StartedReplicas, null, null); + writer.WriteProperty(options, PropUnassignedPrimaries, value.UnassignedPrimaries, null, null); + writer.WriteProperty(options, PropUnassignedReplicas, value.UnassignedReplicas, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicatorDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicatorDetails.g.cs index 09fd6b4f247..029eeed1cff 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicatorDetails.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsAvailabilityIndicatorDetails.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class ShardsAvailabilityIndicatorDetailsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCreatingPrimaries = System.Text.Json.JsonEncodedText.Encode("creating_primaries"); - private static readonly System.Text.Json.JsonEncodedText PropCreatingReplicas = System.Text.Json.JsonEncodedText.Encode("creating_replicas"); - private static readonly System.Text.Json.JsonEncodedText PropInitializingPrimaries = System.Text.Json.JsonEncodedText.Encode("initializing_primaries"); - private static readonly System.Text.Json.JsonEncodedText PropInitializingReplicas = System.Text.Json.JsonEncodedText.Encode("initializing_replicas"); - private static readonly System.Text.Json.JsonEncodedText PropRestartingPrimaries = System.Text.Json.JsonEncodedText.Encode("restarting_primaries"); - private static readonly System.Text.Json.JsonEncodedText PropRestartingReplicas = System.Text.Json.JsonEncodedText.Encode("restarting_replicas"); - private static readonly System.Text.Json.JsonEncodedText PropStartedPrimaries = System.Text.Json.JsonEncodedText.Encode("started_primaries"); - private static readonly System.Text.Json.JsonEncodedText PropStartedReplicas = System.Text.Json.JsonEncodedText.Encode("started_replicas"); - private static readonly System.Text.Json.JsonEncodedText PropUnassignedPrimaries = System.Text.Json.JsonEncodedText.Encode("unassigned_primaries"); - private static readonly System.Text.Json.JsonEncodedText PropUnassignedReplicas = System.Text.Json.JsonEncodedText.Encode("unassigned_replicas"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsAvailabilityIndicatorDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCreatingPrimaries = default; - LocalJsonValue propCreatingReplicas = default; - LocalJsonValue propInitializingPrimaries = default; - LocalJsonValue propInitializingReplicas = default; - LocalJsonValue propRestartingPrimaries = default; - LocalJsonValue propRestartingReplicas = default; - LocalJsonValue propStartedPrimaries = default; - LocalJsonValue propStartedReplicas = default; - LocalJsonValue propUnassignedPrimaries = default; - LocalJsonValue propUnassignedReplicas = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCreatingPrimaries.TryReadProperty(ref reader, options, PropCreatingPrimaries, null)) - { - continue; - } - - if (propCreatingReplicas.TryReadProperty(ref reader, options, PropCreatingReplicas, null)) - { - continue; - } - - if (propInitializingPrimaries.TryReadProperty(ref reader, options, PropInitializingPrimaries, null)) - { - continue; - } - - if (propInitializingReplicas.TryReadProperty(ref reader, options, PropInitializingReplicas, null)) - { - continue; - } - - if (propRestartingPrimaries.TryReadProperty(ref reader, options, PropRestartingPrimaries, null)) - { - continue; - } - - if (propRestartingReplicas.TryReadProperty(ref reader, options, PropRestartingReplicas, null)) - { - continue; - } - - if (propStartedPrimaries.TryReadProperty(ref reader, options, PropStartedPrimaries, null)) - { - continue; - } - - if (propStartedReplicas.TryReadProperty(ref reader, options, PropStartedReplicas, null)) - { - continue; - } - - if (propUnassignedPrimaries.TryReadProperty(ref reader, options, PropUnassignedPrimaries, null)) - { - continue; - } - - if (propUnassignedReplicas.TryReadProperty(ref reader, options, PropUnassignedReplicas, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsAvailabilityIndicatorDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CreatingPrimaries = propCreatingPrimaries.Value, - CreatingReplicas = propCreatingReplicas.Value, - InitializingPrimaries = propInitializingPrimaries.Value, - InitializingReplicas = propInitializingReplicas.Value, - RestartingPrimaries = propRestartingPrimaries.Value, - RestartingReplicas = propRestartingReplicas.Value, - StartedPrimaries = propStartedPrimaries.Value, - StartedReplicas = propStartedReplicas.Value, - UnassignedPrimaries = propUnassignedPrimaries.Value, - UnassignedReplicas = propUnassignedReplicas.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsAvailabilityIndicatorDetails value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCreatingPrimaries, value.CreatingPrimaries, null, null); - writer.WriteProperty(options, PropCreatingReplicas, value.CreatingReplicas, null, null); - writer.WriteProperty(options, PropInitializingPrimaries, value.InitializingPrimaries, null, null); - writer.WriteProperty(options, PropInitializingReplicas, value.InitializingReplicas, null, null); - writer.WriteProperty(options, PropRestartingPrimaries, value.RestartingPrimaries, null, null); - writer.WriteProperty(options, PropRestartingReplicas, value.RestartingReplicas, null, null); - writer.WriteProperty(options, PropStartedPrimaries, value.StartedPrimaries, null, null); - writer.WriteProperty(options, PropStartedReplicas, value.StartedReplicas, null, null); - writer.WriteProperty(options, PropUnassignedPrimaries, value.UnassignedPrimaries, null, null); - writer.WriteProperty(options, PropUnassignedReplicas, value.UnassignedReplicas, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsAvailabilityIndicatorDetailsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.ShardsAvailabilityIndicatorDetailsConverter))] public sealed partial class ShardsAvailabilityIndicatorDetails { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicator.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicator.Converters.g.cs new file mode 100644 index 00000000000..f736840217a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicator.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class ShardsCapacityIndicatorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); + private static readonly System.Text.Json.JsonEncodedText PropDiagnosis = System.Text.Json.JsonEncodedText.Encode("diagnosis"); + private static readonly System.Text.Json.JsonEncodedText PropImpacts = System.Text.Json.JsonEncodedText.Encode("impacts"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + private static readonly System.Text.Json.JsonEncodedText PropSymptom = System.Text.Json.JsonEncodedText.Encode("symptom"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsCapacityIndicator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDetails = default; + LocalJsonValue?> propDiagnosis = default; + LocalJsonValue?> propImpacts = default; + LocalJsonValue propStatus = default; + LocalJsonValue propSymptom = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDetails.TryReadProperty(ref reader, options, PropDetails, null)) + { + continue; + } + + if (propDiagnosis.TryReadProperty(ref reader, options, PropDiagnosis, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propImpacts.TryReadProperty(ref reader, options, PropImpacts, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (propSymptom.TryReadProperty(ref reader, options, PropSymptom, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsCapacityIndicator(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Details = propDetails.Value, + Diagnosis = propDiagnosis.Value, + Impacts = propImpacts.Value, + Status = propStatus.Value, + Symptom = propSymptom.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsCapacityIndicator value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDetails, value.Details, null, null); + writer.WriteProperty(options, PropDiagnosis, value.Diagnosis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropImpacts, value.Impacts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteProperty(options, PropSymptom, value.Symptom, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicator.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicator.g.cs index 8c21ebf559a..5fbbccf0fbc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicator.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicator.g.cs @@ -23,87 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class ShardsCapacityIndicatorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); - private static readonly System.Text.Json.JsonEncodedText PropDiagnosis = System.Text.Json.JsonEncodedText.Encode("diagnosis"); - private static readonly System.Text.Json.JsonEncodedText PropImpacts = System.Text.Json.JsonEncodedText.Encode("impacts"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - private static readonly System.Text.Json.JsonEncodedText PropSymptom = System.Text.Json.JsonEncodedText.Encode("symptom"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsCapacityIndicator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDetails = default; - LocalJsonValue?> propDiagnosis = default; - LocalJsonValue?> propImpacts = default; - LocalJsonValue propStatus = default; - LocalJsonValue propSymptom = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDetails.TryReadProperty(ref reader, options, PropDetails, null)) - { - continue; - } - - if (propDiagnosis.TryReadProperty(ref reader, options, PropDiagnosis, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propImpacts.TryReadProperty(ref reader, options, PropImpacts, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (propSymptom.TryReadProperty(ref reader, options, PropSymptom, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsCapacityIndicator(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Details = propDetails.Value, - Diagnosis = propDiagnosis.Value, - Impacts = propImpacts.Value, - Status = propStatus.Value, - Symptom = propSymptom.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsCapacityIndicator value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDetails, value.Details, null, null); - writer.WriteProperty(options, PropDiagnosis, value.Diagnosis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropImpacts, value.Impacts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteProperty(options, PropSymptom, value.Symptom, null, null); - writer.WriteEndObject(); - } -} - /// /// /// SHARDS_CAPACITY /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsCapacityIndicatorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.ShardsCapacityIndicatorConverter))] public sealed partial class ShardsCapacityIndicator { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorDetails.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorDetails.Converters.g.cs new file mode 100644 index 00000000000..c1f25c20f34 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorDetails.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class ShardsCapacityIndicatorDetailsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropData = System.Text.Json.JsonEncodedText.Encode("data"); + private static readonly System.Text.Json.JsonEncodedText PropFrozen = System.Text.Json.JsonEncodedText.Encode("frozen"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsCapacityIndicatorDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propData = default; + LocalJsonValue propFrozen = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propData.TryReadProperty(ref reader, options, PropData, null)) + { + continue; + } + + if (propFrozen.TryReadProperty(ref reader, options, PropFrozen, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsCapacityIndicatorDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Data = propData.Value, + Frozen = propFrozen.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsCapacityIndicatorDetails value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropData, value.Data, null, null); + writer.WriteProperty(options, PropFrozen, value.Frozen, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorDetails.g.cs index c3c8b2fe25f..0b51f892fc1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorDetails.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorDetails.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class ShardsCapacityIndicatorDetailsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropData = System.Text.Json.JsonEncodedText.Encode("data"); - private static readonly System.Text.Json.JsonEncodedText PropFrozen = System.Text.Json.JsonEncodedText.Encode("frozen"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsCapacityIndicatorDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propData = default; - LocalJsonValue propFrozen = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propData.TryReadProperty(ref reader, options, PropData, null)) - { - continue; - } - - if (propFrozen.TryReadProperty(ref reader, options, PropFrozen, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsCapacityIndicatorDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Data = propData.Value, - Frozen = propFrozen.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsCapacityIndicatorDetails value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropData, value.Data, null, null); - writer.WriteProperty(options, PropFrozen, value.Frozen, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsCapacityIndicatorDetailsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.ShardsCapacityIndicatorDetailsConverter))] public sealed partial class ShardsCapacityIndicatorDetails { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorTierDetail.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorTierDetail.Converters.g.cs new file mode 100644 index 00000000000..894343aa0b4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorTierDetail.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class ShardsCapacityIndicatorTierDetailConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCurrentUsedShards = System.Text.Json.JsonEncodedText.Encode("current_used_shards"); + private static readonly System.Text.Json.JsonEncodedText PropMaxShardsInCluster = System.Text.Json.JsonEncodedText.Encode("max_shards_in_cluster"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsCapacityIndicatorTierDetail Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCurrentUsedShards = default; + LocalJsonValue propMaxShardsInCluster = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCurrentUsedShards.TryReadProperty(ref reader, options, PropCurrentUsedShards, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxShardsInCluster.TryReadProperty(ref reader, options, PropMaxShardsInCluster, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsCapacityIndicatorTierDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CurrentUsedShards = propCurrentUsedShards.Value, + MaxShardsInCluster = propMaxShardsInCluster.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsCapacityIndicatorTierDetail value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCurrentUsedShards, value.CurrentUsedShards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxShardsInCluster, value.MaxShardsInCluster, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorTierDetail.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorTierDetail.g.cs index 4a176bec4ee..cf0baaf8835 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorTierDetail.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/ShardsCapacityIndicatorTierDetail.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class ShardsCapacityIndicatorTierDetailConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCurrentUsedShards = System.Text.Json.JsonEncodedText.Encode("current_used_shards"); - private static readonly System.Text.Json.JsonEncodedText PropMaxShardsInCluster = System.Text.Json.JsonEncodedText.Encode("max_shards_in_cluster"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsCapacityIndicatorTierDetail Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCurrentUsedShards = default; - LocalJsonValue propMaxShardsInCluster = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCurrentUsedShards.TryReadProperty(ref reader, options, PropCurrentUsedShards, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxShardsInCluster.TryReadProperty(ref reader, options, PropMaxShardsInCluster, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsCapacityIndicatorTierDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CurrentUsedShards = propCurrentUsedShards.Value, - MaxShardsInCluster = propMaxShardsInCluster.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsCapacityIndicatorTierDetail value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCurrentUsedShards, value.CurrentUsedShards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxShardsInCluster, value.MaxShardsInCluster, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.ShardsCapacityIndicatorTierDetailConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.ShardsCapacityIndicatorTierDetailConverter))] public sealed partial class ShardsCapacityIndicatorTierDetail { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicator.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicator.Converters.g.cs new file mode 100644 index 00000000000..b060d7a1e7f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicator.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class SlmIndicatorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); + private static readonly System.Text.Json.JsonEncodedText PropDiagnosis = System.Text.Json.JsonEncodedText.Encode("diagnosis"); + private static readonly System.Text.Json.JsonEncodedText PropImpacts = System.Text.Json.JsonEncodedText.Encode("impacts"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + private static readonly System.Text.Json.JsonEncodedText PropSymptom = System.Text.Json.JsonEncodedText.Encode("symptom"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.SlmIndicator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDetails = default; + LocalJsonValue?> propDiagnosis = default; + LocalJsonValue?> propImpacts = default; + LocalJsonValue propStatus = default; + LocalJsonValue propSymptom = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDetails.TryReadProperty(ref reader, options, PropDetails, null)) + { + continue; + } + + if (propDiagnosis.TryReadProperty(ref reader, options, PropDiagnosis, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propImpacts.TryReadProperty(ref reader, options, PropImpacts, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (propSymptom.TryReadProperty(ref reader, options, PropSymptom, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.SlmIndicator(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Details = propDetails.Value, + Diagnosis = propDiagnosis.Value, + Impacts = propImpacts.Value, + Status = propStatus.Value, + Symptom = propSymptom.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.SlmIndicator value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDetails, value.Details, null, null); + writer.WriteProperty(options, PropDiagnosis, value.Diagnosis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropImpacts, value.Impacts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteProperty(options, PropSymptom, value.Symptom, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicator.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicator.g.cs index e608353c7ec..d4d1985ba0a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicator.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicator.g.cs @@ -23,87 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class SlmIndicatorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); - private static readonly System.Text.Json.JsonEncodedText PropDiagnosis = System.Text.Json.JsonEncodedText.Encode("diagnosis"); - private static readonly System.Text.Json.JsonEncodedText PropImpacts = System.Text.Json.JsonEncodedText.Encode("impacts"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - private static readonly System.Text.Json.JsonEncodedText PropSymptom = System.Text.Json.JsonEncodedText.Encode("symptom"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.SlmIndicator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDetails = default; - LocalJsonValue?> propDiagnosis = default; - LocalJsonValue?> propImpacts = default; - LocalJsonValue propStatus = default; - LocalJsonValue propSymptom = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDetails.TryReadProperty(ref reader, options, PropDetails, null)) - { - continue; - } - - if (propDiagnosis.TryReadProperty(ref reader, options, PropDiagnosis, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propImpacts.TryReadProperty(ref reader, options, PropImpacts, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (propSymptom.TryReadProperty(ref reader, options, PropSymptom, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.SlmIndicator(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Details = propDetails.Value, - Diagnosis = propDiagnosis.Value, - Impacts = propImpacts.Value, - Status = propStatus.Value, - Symptom = propSymptom.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.SlmIndicator value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDetails, value.Details, null, null); - writer.WriteProperty(options, PropDiagnosis, value.Diagnosis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropImpacts, value.Impacts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteProperty(options, PropSymptom, value.Symptom, null, null); - writer.WriteEndObject(); - } -} - /// /// /// SLM /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.SlmIndicatorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.SlmIndicatorConverter))] public sealed partial class SlmIndicator { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicatorDetails.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicatorDetails.Converters.g.cs new file mode 100644 index 00000000000..978e2f99e88 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicatorDetails.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class SlmIndicatorDetailsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPolicies = System.Text.Json.JsonEncodedText.Encode("policies"); + private static readonly System.Text.Json.JsonEncodedText PropSlmStatus = System.Text.Json.JsonEncodedText.Encode("slm_status"); + private static readonly System.Text.Json.JsonEncodedText PropUnhealthyPolicies = System.Text.Json.JsonEncodedText.Encode("unhealthy_policies"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.SlmIndicatorDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPolicies = default; + LocalJsonValue propSlmStatus = default; + LocalJsonValue propUnhealthyPolicies = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPolicies.TryReadProperty(ref reader, options, PropPolicies, null)) + { + continue; + } + + if (propSlmStatus.TryReadProperty(ref reader, options, PropSlmStatus, null)) + { + continue; + } + + if (propUnhealthyPolicies.TryReadProperty(ref reader, options, PropUnhealthyPolicies, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.SlmIndicatorDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Policies = propPolicies.Value, + SlmStatus = propSlmStatus.Value, + UnhealthyPolicies = propUnhealthyPolicies.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.SlmIndicatorDetails value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPolicies, value.Policies, null, null); + writer.WriteProperty(options, PropSlmStatus, value.SlmStatus, null, null); + writer.WriteProperty(options, PropUnhealthyPolicies, value.UnhealthyPolicies, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicatorDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicatorDetails.g.cs index 684f17c2059..a1c7f2ce925 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicatorDetails.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicatorDetails.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class SlmIndicatorDetailsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPolicies = System.Text.Json.JsonEncodedText.Encode("policies"); - private static readonly System.Text.Json.JsonEncodedText PropSlmStatus = System.Text.Json.JsonEncodedText.Encode("slm_status"); - private static readonly System.Text.Json.JsonEncodedText PropUnhealthyPolicies = System.Text.Json.JsonEncodedText.Encode("unhealthy_policies"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.SlmIndicatorDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPolicies = default; - LocalJsonValue propSlmStatus = default; - LocalJsonValue propUnhealthyPolicies = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPolicies.TryReadProperty(ref reader, options, PropPolicies, null)) - { - continue; - } - - if (propSlmStatus.TryReadProperty(ref reader, options, PropSlmStatus, null)) - { - continue; - } - - if (propUnhealthyPolicies.TryReadProperty(ref reader, options, PropUnhealthyPolicies, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.SlmIndicatorDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Policies = propPolicies.Value, - SlmStatus = propSlmStatus.Value, - UnhealthyPolicies = propUnhealthyPolicies.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.SlmIndicatorDetails value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPolicies, value.Policies, null, null); - writer.WriteProperty(options, PropSlmStatus, value.SlmStatus, null, null); - writer.WriteProperty(options, PropUnhealthyPolicies, value.UnhealthyPolicies, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.SlmIndicatorDetailsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.SlmIndicatorDetailsConverter))] public sealed partial class SlmIndicatorDetails { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicatorUnhealthyPolicies.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicatorUnhealthyPolicies.Converters.g.cs new file mode 100644 index 00000000000..07ac2e6f167 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicatorUnhealthyPolicies.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class SlmIndicatorUnhealthyPoliciesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropInvocationsSinceLastSuccess = System.Text.Json.JsonEncodedText.Encode("invocations_since_last_success"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.SlmIndicatorUnhealthyPolicies Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue?> propInvocationsSinceLastSuccess = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propInvocationsSinceLastSuccess.TryReadProperty(ref reader, options, PropInvocationsSinceLastSuccess, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.SlmIndicatorUnhealthyPolicies(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + InvocationsSinceLastSuccess = propInvocationsSinceLastSuccess.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.SlmIndicatorUnhealthyPolicies value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropInvocationsSinceLastSuccess, value.InvocationsSinceLastSuccess, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicatorUnhealthyPolicies.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicatorUnhealthyPolicies.g.cs index aeb8f07a57c..e7950dfcd99 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicatorUnhealthyPolicies.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/SlmIndicatorUnhealthyPolicies.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class SlmIndicatorUnhealthyPoliciesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropInvocationsSinceLastSuccess = System.Text.Json.JsonEncodedText.Encode("invocations_since_last_success"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.SlmIndicatorUnhealthyPolicies Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue?> propInvocationsSinceLastSuccess = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propInvocationsSinceLastSuccess.TryReadProperty(ref reader, options, PropInvocationsSinceLastSuccess, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.SlmIndicatorUnhealthyPolicies(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - InvocationsSinceLastSuccess = propInvocationsSinceLastSuccess.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.SlmIndicatorUnhealthyPolicies value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropInvocationsSinceLastSuccess, value.InvocationsSinceLastSuccess, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.SlmIndicatorUnhealthyPoliciesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.SlmIndicatorUnhealthyPoliciesConverter))] public sealed partial class SlmIndicatorUnhealthyPolicies { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/StagnatingBackingIndices.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/StagnatingBackingIndices.Converters.g.cs new file mode 100644 index 00000000000..648f81b88b7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/StagnatingBackingIndices.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.HealthReport.Json; + +public sealed partial class StagnatingBackingIndicesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFirstOccurrenceTimestamp = System.Text.Json.JsonEncodedText.Encode("first_occurrence_timestamp"); + private static readonly System.Text.Json.JsonEncodedText PropIndexName = System.Text.Json.JsonEncodedText.Encode("index_name"); + private static readonly System.Text.Json.JsonEncodedText PropRetryCount = System.Text.Json.JsonEncodedText.Encode("retry_count"); + + public override Elastic.Clients.Elasticsearch.Core.HealthReport.StagnatingBackingIndices Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFirstOccurrenceTimestamp = default; + LocalJsonValue propIndexName = default; + LocalJsonValue propRetryCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFirstOccurrenceTimestamp.TryReadProperty(ref reader, options, PropFirstOccurrenceTimestamp, null)) + { + continue; + } + + if (propIndexName.TryReadProperty(ref reader, options, PropIndexName, null)) + { + continue; + } + + if (propRetryCount.TryReadProperty(ref reader, options, PropRetryCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.HealthReport.StagnatingBackingIndices(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FirstOccurrenceTimestamp = propFirstOccurrenceTimestamp.Value, + IndexName = propIndexName.Value, + RetryCount = propRetryCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.StagnatingBackingIndices value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFirstOccurrenceTimestamp, value.FirstOccurrenceTimestamp, null, null); + writer.WriteProperty(options, PropIndexName, value.IndexName, null, null); + writer.WriteProperty(options, PropRetryCount, value.RetryCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/StagnatingBackingIndices.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/StagnatingBackingIndices.g.cs index c6055d0bdf2..0339df7b2bc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/StagnatingBackingIndices.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/HealthReport/StagnatingBackingIndices.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.HealthReport; -internal sealed partial class StagnatingBackingIndicesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFirstOccurrenceTimestamp = System.Text.Json.JsonEncodedText.Encode("first_occurrence_timestamp"); - private static readonly System.Text.Json.JsonEncodedText PropIndexName = System.Text.Json.JsonEncodedText.Encode("index_name"); - private static readonly System.Text.Json.JsonEncodedText PropRetryCount = System.Text.Json.JsonEncodedText.Encode("retry_count"); - - public override Elastic.Clients.Elasticsearch.Core.HealthReport.StagnatingBackingIndices Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFirstOccurrenceTimestamp = default; - LocalJsonValue propIndexName = default; - LocalJsonValue propRetryCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFirstOccurrenceTimestamp.TryReadProperty(ref reader, options, PropFirstOccurrenceTimestamp, null)) - { - continue; - } - - if (propIndexName.TryReadProperty(ref reader, options, PropIndexName, null)) - { - continue; - } - - if (propRetryCount.TryReadProperty(ref reader, options, PropRetryCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.HealthReport.StagnatingBackingIndices(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FirstOccurrenceTimestamp = propFirstOccurrenceTimestamp.Value, - IndexName = propIndexName.Value, - RetryCount = propRetryCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.HealthReport.StagnatingBackingIndices value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFirstOccurrenceTimestamp, value.FirstOccurrenceTimestamp, null, null); - writer.WriteProperty(options, PropIndexName, value.IndexName, null, null); - writer.WriteProperty(options, PropRetryCount, value.RetryCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.StagnatingBackingIndicesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.HealthReport.Json.StagnatingBackingIndicesConverter))] public sealed partial class StagnatingBackingIndices { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MGet/MultiGetError.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MGet/MultiGetError.Converters.g.cs new file mode 100644 index 00000000000..980eb334d4b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MGet/MultiGetError.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.MGet.Json; + +public sealed partial class MultiGetErrorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); + + public override Elastic.Clients.Elasticsearch.Core.MGet.MultiGetError Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propError = default; + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propError.TryReadProperty(ref reader, options, PropError, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.MGet.MultiGetError(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Error = propError.Value, + Id = propId.Value, + Index = propIndex.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.MGet.MultiGetError value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropError, value.Error, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MGet/MultiGetError.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MGet/MultiGetError.g.cs index 8e3ca186d39..fa1028ac258 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MGet/MultiGetError.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MGet/MultiGetError.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.MGet; -internal sealed partial class MultiGetErrorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); - - public override Elastic.Clients.Elasticsearch.Core.MGet.MultiGetError Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propError = default; - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propError.TryReadProperty(ref reader, options, PropError, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.MGet.MultiGetError(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Error = propError.Value, - Id = propId.Value, - Index = propIndex.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.MGet.MultiGetError value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropError, value.Error, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.MGet.MultiGetErrorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.MGet.Json.MultiGetErrorConverter))] public sealed partial class MultiGetError { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MGet/MultiGetOperation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MGet/MultiGetOperation.Converters.g.cs new file mode 100644 index 00000000000..a959596675f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MGet/MultiGetOperation.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.MGet.Json; + +public sealed partial class MultiGetOperationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); + private static readonly System.Text.Json.JsonEncodedText PropStoredFields = System.Text.Json.JsonEncodedText.Encode("stored_fields"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + private static readonly System.Text.Json.JsonEncodedText PropVersionType = System.Text.Json.JsonEncodedText.Encode("version_type"); + + public override Elastic.Clients.Elasticsearch.Core.MGet.MultiGetOperation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + LocalJsonValue propRouting = default; + LocalJsonValue propSource = default; + LocalJsonValue propStoredFields = default; + LocalJsonValue propVersion = default; + LocalJsonValue propVersionType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (propStoredFields.TryReadProperty(ref reader, options, PropStoredFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propVersionType.TryReadProperty(ref reader, options, PropVersionType, static Elastic.Clients.Elasticsearch.VersionType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.MGet.MultiGetOperation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + Index = propIndex.Value, + Routing = propRouting.Value, + Source = propSource.Value, + StoredFields = propStoredFields.Value, + Version = propVersion.Value, + VersionType = propVersionType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.MGet.MultiGetOperation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteProperty(options, PropStoredFields, value.StoredFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVersionType, value.VersionType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.VersionType? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MGet/MultiGetOperation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MGet/MultiGetOperation.g.cs index 6d27bc7bb5c..376221e6474 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MGet/MultiGetOperation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MGet/MultiGetOperation.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.MGet; -internal sealed partial class MultiGetOperationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); - private static readonly System.Text.Json.JsonEncodedText PropStoredFields = System.Text.Json.JsonEncodedText.Encode("stored_fields"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - private static readonly System.Text.Json.JsonEncodedText PropVersionType = System.Text.Json.JsonEncodedText.Encode("version_type"); - - public override Elastic.Clients.Elasticsearch.Core.MGet.MultiGetOperation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - LocalJsonValue propRouting = default; - LocalJsonValue propSource = default; - LocalJsonValue propStoredFields = default; - LocalJsonValue propVersion = default; - LocalJsonValue propVersionType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (propStoredFields.TryReadProperty(ref reader, options, PropStoredFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propVersionType.TryReadProperty(ref reader, options, PropVersionType, static Elastic.Clients.Elasticsearch.VersionType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.MGet.MultiGetOperation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - Index = propIndex.Value, - Routing = propRouting.Value, - Source = propSource.Value, - StoredFields = propStoredFields.Value, - Version = propVersion.Value, - VersionType = propVersionType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.MGet.MultiGetOperation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteProperty(options, PropStoredFields, value.StoredFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropVersionType, value.VersionType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.VersionType? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.MGet.MultiGetOperationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.MGet.Json.MultiGetOperationConverter))] public sealed partial class MultiGetOperation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultiSearchItem.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultiSearchItem.Converters.g.cs new file mode 100644 index 00000000000..4132056d8ea --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultiSearchItem.Converters.g.cs @@ -0,0 +1,205 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.MSearch.Json; + +public sealed partial class MultiSearchItemConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); + private static readonly System.Text.Json.JsonEncodedText PropClusters = System.Text.Json.JsonEncodedText.Encode("_clusters"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropHitsMetadata = System.Text.Json.JsonEncodedText.Encode("hits"); + private static readonly System.Text.Json.JsonEncodedText PropMaxScore = System.Text.Json.JsonEncodedText.Encode("max_score"); + private static readonly System.Text.Json.JsonEncodedText PropNumReducePhases = System.Text.Json.JsonEncodedText.Encode("num_reduce_phases"); + private static readonly System.Text.Json.JsonEncodedText PropPitId = System.Text.Json.JsonEncodedText.Encode("pit_id"); + private static readonly System.Text.Json.JsonEncodedText PropProfile = System.Text.Json.JsonEncodedText.Encode("profile"); + private static readonly System.Text.Json.JsonEncodedText PropScrollId = System.Text.Json.JsonEncodedText.Encode("_scroll_id"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + private static readonly System.Text.Json.JsonEncodedText PropSuggest = System.Text.Json.JsonEncodedText.Encode("suggest"); + private static readonly System.Text.Json.JsonEncodedText PropTerminatedEarly = System.Text.Json.JsonEncodedText.Encode("terminated_early"); + private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); + private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); + + public override Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAggregations = default; + LocalJsonValue propClusters = default; + LocalJsonValue?> propFields = default; + LocalJsonValue> propHitsMetadata = default; + LocalJsonValue propMaxScore = default; + LocalJsonValue propNumReducePhases = default; + LocalJsonValue propPitId = default; + LocalJsonValue propProfile = default; + LocalJsonValue propScrollId = default; + LocalJsonValue propShards = default; + LocalJsonValue propStatus = default; + LocalJsonValue?> propSuggest = default; + LocalJsonValue propTerminatedEarly = default; + LocalJsonValue propTimedOut = default; + LocalJsonValue propTook = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, null)) + { + continue; + } + + if (propClusters.TryReadProperty(ref reader, options, PropClusters, null)) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propHitsMetadata.TryReadProperty(ref reader, options, PropHitsMetadata, null)) + { + continue; + } + + if (propMaxScore.TryReadProperty(ref reader, options, PropMaxScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNumReducePhases.TryReadProperty(ref reader, options, PropNumReducePhases, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPitId.TryReadProperty(ref reader, options, PropPitId, null)) + { + continue; + } + + if (propProfile.TryReadProperty(ref reader, options, PropProfile, null)) + { + continue; + } + + if (propScrollId.TryReadProperty(ref reader, options, PropScrollId, null)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSuggest.TryReadProperty(ref reader, options, PropSuggest, null)) + { + continue; + } + + if (propTerminatedEarly.TryReadProperty(ref reader, options, PropTerminatedEarly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, null)) + { + continue; + } + + if (propTook.TryReadProperty(ref reader, options, PropTook, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = propAggregations.Value, + Clusters = propClusters.Value, + Fields = propFields.Value, + HitsMetadata = propHitsMetadata.Value, + MaxScore = propMaxScore.Value, + NumReducePhases = propNumReducePhases.Value, + PitId = propPitId.Value, + Profile = propProfile.Value, + ScrollId = propScrollId.Value, + Shards = propShards.Value, + Status = propStatus.Value, + Suggest = propSuggest.Value, + TerminatedEarly = propTerminatedEarly.Value, + TimedOut = propTimedOut.Value, + Took = propTook.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchItem value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregations, value.Aggregations, null, null); + writer.WriteProperty(options, PropClusters, value.Clusters, null, null); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropHitsMetadata, value.HitsMetadata, null, null); + writer.WriteProperty(options, PropMaxScore, value.MaxScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNumReducePhases, value.NumReducePhases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPitId, value.PitId, null, null); + writer.WriteProperty(options, PropProfile, value.Profile, null, null); + writer.WriteProperty(options, PropScrollId, value.ScrollId, null, null); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteProperty(options, PropStatus, value.Status, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSuggest, value.Suggest, null, null); + writer.WriteProperty(options, PropTerminatedEarly, value.TerminatedEarly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, null); + writer.WriteProperty(options, PropTook, value.Took, null, null); + writer.WriteEndObject(); + } +} + +public sealed partial class MultiSearchItemConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(MultiSearchItem<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(MultiSearchItemConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultiSearchItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultiSearchItem.g.cs index 7d4fb2c9ef1..14edff2d879 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultiSearchItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultiSearchItem.g.cs @@ -23,188 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.MSearch; -internal sealed partial class MultiSearchItemConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); - private static readonly System.Text.Json.JsonEncodedText PropClusters = System.Text.Json.JsonEncodedText.Encode("_clusters"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropHitsMetadata = System.Text.Json.JsonEncodedText.Encode("hits"); - private static readonly System.Text.Json.JsonEncodedText PropMaxScore = System.Text.Json.JsonEncodedText.Encode("max_score"); - private static readonly System.Text.Json.JsonEncodedText PropNumReducePhases = System.Text.Json.JsonEncodedText.Encode("num_reduce_phases"); - private static readonly System.Text.Json.JsonEncodedText PropPitId = System.Text.Json.JsonEncodedText.Encode("pit_id"); - private static readonly System.Text.Json.JsonEncodedText PropProfile = System.Text.Json.JsonEncodedText.Encode("profile"); - private static readonly System.Text.Json.JsonEncodedText PropScrollId = System.Text.Json.JsonEncodedText.Encode("_scroll_id"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - private static readonly System.Text.Json.JsonEncodedText PropSuggest = System.Text.Json.JsonEncodedText.Encode("suggest"); - private static readonly System.Text.Json.JsonEncodedText PropTerminatedEarly = System.Text.Json.JsonEncodedText.Encode("terminated_early"); - private static readonly System.Text.Json.JsonEncodedText PropTimedOut = System.Text.Json.JsonEncodedText.Encode("timed_out"); - private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); - - public override Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAggregations = default; - LocalJsonValue propClusters = default; - LocalJsonValue?> propFields = default; - LocalJsonValue> propHitsMetadata = default; - LocalJsonValue propMaxScore = default; - LocalJsonValue propNumReducePhases = default; - LocalJsonValue propPitId = default; - LocalJsonValue propProfile = default; - LocalJsonValue propScrollId = default; - LocalJsonValue propShards = default; - LocalJsonValue propStatus = default; - LocalJsonValue?> propSuggest = default; - LocalJsonValue propTerminatedEarly = default; - LocalJsonValue propTimedOut = default; - LocalJsonValue propTook = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, null)) - { - continue; - } - - if (propClusters.TryReadProperty(ref reader, options, PropClusters, null)) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propHitsMetadata.TryReadProperty(ref reader, options, PropHitsMetadata, null)) - { - continue; - } - - if (propMaxScore.TryReadProperty(ref reader, options, PropMaxScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNumReducePhases.TryReadProperty(ref reader, options, PropNumReducePhases, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPitId.TryReadProperty(ref reader, options, PropPitId, null)) - { - continue; - } - - if (propProfile.TryReadProperty(ref reader, options, PropProfile, null)) - { - continue; - } - - if (propScrollId.TryReadProperty(ref reader, options, PropScrollId, null)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSuggest.TryReadProperty(ref reader, options, PropSuggest, null)) - { - continue; - } - - if (propTerminatedEarly.TryReadProperty(ref reader, options, PropTerminatedEarly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimedOut.TryReadProperty(ref reader, options, PropTimedOut, null)) - { - continue; - } - - if (propTook.TryReadProperty(ref reader, options, PropTook, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = propAggregations.Value, - Clusters = propClusters.Value, - Fields = propFields.Value, - HitsMetadata = propHitsMetadata.Value, - MaxScore = propMaxScore.Value, - NumReducePhases = propNumReducePhases.Value, - PitId = propPitId.Value, - Profile = propProfile.Value, - ScrollId = propScrollId.Value, - Shards = propShards.Value, - Status = propStatus.Value, - Suggest = propSuggest.Value, - TerminatedEarly = propTerminatedEarly.Value, - TimedOut = propTimedOut.Value, - Took = propTook.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchItem value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregations, value.Aggregations, null, null); - writer.WriteProperty(options, PropClusters, value.Clusters, null, null); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropHitsMetadata, value.HitsMetadata, null, null); - writer.WriteProperty(options, PropMaxScore, value.MaxScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNumReducePhases, value.NumReducePhases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPitId, value.PitId, null, null); - writer.WriteProperty(options, PropProfile, value.Profile, null, null); - writer.WriteProperty(options, PropScrollId, value.ScrollId, null, null); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteProperty(options, PropStatus, value.Status, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSuggest, value.Suggest, null, null); - writer.WriteProperty(options, PropTerminatedEarly, value.TerminatedEarly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimedOut, value.TimedOut, null, null); - writer.WriteProperty(options, PropTook, value.Took, null, null); - writer.WriteEndObject(); - } -} - -internal sealed partial class MultiSearchItemConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(MultiSearchItem<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(MultiSearchItemConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchItemConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.MSearch.Json.MultiSearchItemConverterFactory))] public partial class MultiSearchItem { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultisearchBody.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultisearchBody.Converters.g.cs new file mode 100644 index 00000000000..52be8835765 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultisearchBody.Converters.g.cs @@ -0,0 +1,361 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.MSearch.Json; + +public sealed partial class MultisearchBodyConverter : System.Text.Json.Serialization.JsonConverter +{ + 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 PropRank = System.Text.Json.JsonEncodedText.Encode("rank"); + private static readonly System.Text.Json.JsonEncodedText PropRescore = System.Text.Json.JsonEncodedText.Encode("rescore"); + private static readonly System.Text.Json.JsonEncodedText PropRetriever = System.Text.Json.JsonEncodedText.Encode("retriever"); + 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 Elastic.Clients.Elasticsearch.Core.MSearch.MultisearchBody Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAggregations = default; + LocalJsonValue propCollapse = default; + LocalJsonValue?> propDocvalueFields = default; + LocalJsonValue propExplain = default; + LocalJsonValue?> propExt = default; + LocalJsonValue?> propFields = default; + LocalJsonValue propFrom = default; + LocalJsonValue propHighlight = default; + LocalJsonValue>?> propIndicesBoost = default; + LocalJsonValue?> propKnn = default; + LocalJsonValue propMinScore = default; + LocalJsonValue propPit = default; + LocalJsonValue propPostFilter = default; + LocalJsonValue propProfile = default; + LocalJsonValue propQuery = default; + LocalJsonValue propRank = default; + LocalJsonValue?> propRescore = default; + LocalJsonValue propRetriever = default; + LocalJsonValue?> propRuntimeMappings = default; + LocalJsonValue?> propScriptFields = default; + LocalJsonValue?> propSearchAfter = default; + LocalJsonValue propSeqNoPrimaryTerm = default; + LocalJsonValue propSize = default; + LocalJsonValue propSlice = default; + LocalJsonValue?> propSort = default; + LocalJsonValue propSource = default; + LocalJsonValue?> propStats = default; + LocalJsonValue propStoredFields = default; + LocalJsonValue propSuggest = default; + LocalJsonValue propTerminateAfter = default; + LocalJsonValue propTimeout = default; + LocalJsonValue propTrackScores = default; + LocalJsonValue propTrackTotalHits = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)) || propAggregations.TryReadProperty(ref reader, options, PropAggregations1, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propCollapse.TryReadProperty(ref reader, options, PropCollapse, null)) + { + continue; + } + + if (propDocvalueFields.TryReadProperty(ref reader, options, PropDocvalueFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propExplain.TryReadProperty(ref reader, options, PropExplain, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propExt.TryReadProperty(ref reader, options, PropExt, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propFrom.TryReadProperty(ref reader, options, PropFrom, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propHighlight.TryReadProperty(ref reader, options, PropHighlight, null)) + { + continue; + } + + if (propIndicesBoost.TryReadProperty(ref reader, options, PropIndicesBoost, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null)))) + { + continue; + } + + if (propKnn.TryReadProperty(ref reader, options, PropKnn, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPit.TryReadProperty(ref reader, options, PropPit, null)) + { + continue; + } + + if (propPostFilter.TryReadProperty(ref reader, options, PropPostFilter, null)) + { + continue; + } + + if (propProfile.TryReadProperty(ref reader, options, PropProfile, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propRank.TryReadProperty(ref reader, options, PropRank, null)) + { + continue; + } + + if (propRescore.TryReadProperty(ref reader, options, PropRescore, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propRetriever.TryReadProperty(ref reader, options, PropRetriever, null)) + { + continue; + } + + if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propScriptFields.TryReadProperty(ref reader, options, PropScriptFields, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propSearchAfter.TryReadProperty(ref reader, options, PropSearchAfter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propSeqNoPrimaryTerm.TryReadProperty(ref reader, options, PropSeqNoPrimaryTerm, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSlice.TryReadProperty(ref reader, options, PropSlice, null)) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (propStats.TryReadProperty(ref reader, options, PropStats, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStoredFields.TryReadProperty(ref reader, options, PropStoredFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propSuggest.TryReadProperty(ref reader, options, PropSuggest, null)) + { + continue; + } + + if (propTerminateAfter.TryReadProperty(ref reader, options, PropTerminateAfter, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeout.TryReadProperty(ref reader, options, PropTimeout, null)) + { + continue; + } + + if (propTrackScores.TryReadProperty(ref reader, options, PropTrackScores, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTrackTotalHits.TryReadProperty(ref reader, options, PropTrackTotalHits, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.MSearch.MultisearchBody(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + 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, + Rank = propRank.Value, + Rescore = propRescore.Value, + Retriever = propRetriever.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, Elastic.Clients.Elasticsearch.Core.MSearch.MultisearchBody value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropCollapse, value.Collapse, null, null); + writer.WriteProperty(options, PropDocvalueFields, value.DocvalueFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropExplain, value.Explain, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropExt, value.Ext, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFrom, value.From, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropHighlight, value.Highlight, null, null); + writer.WriteProperty(options, PropIndicesBoost, value.IndicesBoost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null))); + writer.WriteProperty(options, PropKnn, value.Knn, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPit, value.Pit, null, null); + writer.WriteProperty(options, PropPostFilter, value.PostFilter, null, null); + writer.WriteProperty(options, PropProfile, value.Profile, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropRank, value.Rank, null, null); + writer.WriteProperty(options, PropRescore, value.Rescore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRetriever, value.Retriever, null, null); + writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropScriptFields, value.ScriptFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropSearchAfter, value.SearchAfter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSeqNoPrimaryTerm, value.SeqNoPrimaryTerm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSlice, value.Slice, null, null); + writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteProperty(options, PropStats, value.Stats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStoredFields, value.StoredFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropSuggest, value.Suggest, null, null); + writer.WriteProperty(options, PropTerminateAfter, value.TerminateAfter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeout, value.Timeout, null, null); + writer.WriteProperty(options, PropTrackScores, value.TrackScores, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTrackTotalHits, value.TrackTotalHits, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultisearchBody.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultisearchBody.g.cs index ec1d06e28c3..ade39d01368 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultisearchBody.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultisearchBody.g.cs @@ -23,344 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.MSearch; -internal sealed partial class MultisearchBodyConverter : System.Text.Json.Serialization.JsonConverter -{ - 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 PropRank = System.Text.Json.JsonEncodedText.Encode("rank"); - private static readonly System.Text.Json.JsonEncodedText PropRescore = System.Text.Json.JsonEncodedText.Encode("rescore"); - private static readonly System.Text.Json.JsonEncodedText PropRetriever = System.Text.Json.JsonEncodedText.Encode("retriever"); - 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 Elastic.Clients.Elasticsearch.Core.MSearch.MultisearchBody Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAggregations = default; - LocalJsonValue propCollapse = default; - LocalJsonValue?> propDocvalueFields = default; - LocalJsonValue propExplain = default; - LocalJsonValue?> propExt = default; - LocalJsonValue?> propFields = default; - LocalJsonValue propFrom = default; - LocalJsonValue propHighlight = default; - LocalJsonValue>?> propIndicesBoost = default; - LocalJsonValue?> propKnn = default; - LocalJsonValue propMinScore = default; - LocalJsonValue propPit = default; - LocalJsonValue propPostFilter = default; - LocalJsonValue propProfile = default; - LocalJsonValue propQuery = default; - LocalJsonValue propRank = default; - LocalJsonValue?> propRescore = default; - LocalJsonValue propRetriever = default; - LocalJsonValue?> propRuntimeMappings = default; - LocalJsonValue?> propScriptFields = default; - LocalJsonValue?> propSearchAfter = default; - LocalJsonValue propSeqNoPrimaryTerm = default; - LocalJsonValue propSize = default; - LocalJsonValue propSlice = default; - LocalJsonValue?> propSort = default; - LocalJsonValue propSource = default; - LocalJsonValue?> propStats = default; - LocalJsonValue propStoredFields = default; - LocalJsonValue propSuggest = default; - LocalJsonValue propTerminateAfter = default; - LocalJsonValue propTimeout = default; - LocalJsonValue propTrackScores = default; - LocalJsonValue propTrackTotalHits = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)) || propAggregations.TryReadProperty(ref reader, options, PropAggregations1, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propCollapse.TryReadProperty(ref reader, options, PropCollapse, null)) - { - continue; - } - - if (propDocvalueFields.TryReadProperty(ref reader, options, PropDocvalueFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propExplain.TryReadProperty(ref reader, options, PropExplain, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propExt.TryReadProperty(ref reader, options, PropExt, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propFrom.TryReadProperty(ref reader, options, PropFrom, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propHighlight.TryReadProperty(ref reader, options, PropHighlight, null)) - { - continue; - } - - if (propIndicesBoost.TryReadProperty(ref reader, options, PropIndicesBoost, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null)))) - { - continue; - } - - if (propKnn.TryReadProperty(ref reader, options, PropKnn, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPit.TryReadProperty(ref reader, options, PropPit, null)) - { - continue; - } - - if (propPostFilter.TryReadProperty(ref reader, options, PropPostFilter, null)) - { - continue; - } - - if (propProfile.TryReadProperty(ref reader, options, PropProfile, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propRank.TryReadProperty(ref reader, options, PropRank, null)) - { - continue; - } - - if (propRescore.TryReadProperty(ref reader, options, PropRescore, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propRetriever.TryReadProperty(ref reader, options, PropRetriever, null)) - { - continue; - } - - if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propScriptFields.TryReadProperty(ref reader, options, PropScriptFields, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propSearchAfter.TryReadProperty(ref reader, options, PropSearchAfter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propSeqNoPrimaryTerm.TryReadProperty(ref reader, options, PropSeqNoPrimaryTerm, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSlice.TryReadProperty(ref reader, options, PropSlice, null)) - { - continue; - } - - if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (propStats.TryReadProperty(ref reader, options, PropStats, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStoredFields.TryReadProperty(ref reader, options, PropStoredFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propSuggest.TryReadProperty(ref reader, options, PropSuggest, null)) - { - continue; - } - - if (propTerminateAfter.TryReadProperty(ref reader, options, PropTerminateAfter, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeout.TryReadProperty(ref reader, options, PropTimeout, null)) - { - continue; - } - - if (propTrackScores.TryReadProperty(ref reader, options, PropTrackScores, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTrackTotalHits.TryReadProperty(ref reader, options, PropTrackTotalHits, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.MSearch.MultisearchBody(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - 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, - Rank = propRank.Value, - Rescore = propRescore.Value, - Retriever = propRetriever.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, Elastic.Clients.Elasticsearch.Core.MSearch.MultisearchBody value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropCollapse, value.Collapse, null, null); - writer.WriteProperty(options, PropDocvalueFields, value.DocvalueFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropExplain, value.Explain, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropExt, value.Ext, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFrom, value.From, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropHighlight, value.Highlight, null, null); - writer.WriteProperty(options, PropIndicesBoost, value.IndicesBoost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null))); - writer.WriteProperty(options, PropKnn, value.Knn, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPit, value.Pit, null, null); - writer.WriteProperty(options, PropPostFilter, value.PostFilter, null, null); - writer.WriteProperty(options, PropProfile, value.Profile, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropRank, value.Rank, null, null); - writer.WriteProperty(options, PropRescore, value.Rescore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRetriever, value.Retriever, null, null); - writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropScriptFields, value.ScriptFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropSearchAfter, value.SearchAfter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSeqNoPrimaryTerm, value.SeqNoPrimaryTerm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSlice, value.Slice, null, null); - writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteProperty(options, PropStats, value.Stats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStoredFields, value.StoredFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropSuggest, value.Suggest, null, null); - writer.WriteProperty(options, PropTerminateAfter, value.TerminateAfter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeout, value.Timeout, null, null); - writer.WriteProperty(options, PropTrackScores, value.TrackScores, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTrackTotalHits, value.TrackTotalHits, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.MSearch.MultisearchBodyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.MSearch.Json.MultisearchBodyConverter))] public sealed partial class MultisearchBody { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultisearchHeader.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultisearchHeader.Converters.g.cs new file mode 100644 index 00000000000..89bb1717d02 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultisearchHeader.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.MSearch.Json; + +public sealed partial class MultisearchHeaderConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowNoIndices = System.Text.Json.JsonEncodedText.Encode("allow_no_indices"); + private static readonly System.Text.Json.JsonEncodedText PropAllowPartialSearchResults = System.Text.Json.JsonEncodedText.Encode("allow_partial_search_results"); + private static readonly System.Text.Json.JsonEncodedText PropCcsMinimizeRoundtrips = System.Text.Json.JsonEncodedText.Encode("ccs_minimize_roundtrips"); + private static readonly System.Text.Json.JsonEncodedText PropExpandWildcards = System.Text.Json.JsonEncodedText.Encode("expand_wildcards"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreThrottled = System.Text.Json.JsonEncodedText.Encode("ignore_throttled"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnavailable = System.Text.Json.JsonEncodedText.Encode("ignore_unavailable"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropPreference = System.Text.Json.JsonEncodedText.Encode("preference"); + private static readonly System.Text.Json.JsonEncodedText PropRequestCache = System.Text.Json.JsonEncodedText.Encode("request_cache"); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); + private static readonly System.Text.Json.JsonEncodedText PropSearchType = System.Text.Json.JsonEncodedText.Encode("search_type"); + + public override Elastic.Clients.Elasticsearch.Core.MSearch.MultisearchHeader Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowNoIndices = default; + LocalJsonValue propAllowPartialSearchResults = default; + LocalJsonValue propCcsMinimizeRoundtrips = default; + LocalJsonValue?> propExpandWildcards = default; + LocalJsonValue propIgnoreThrottled = default; + LocalJsonValue propIgnoreUnavailable = default; + LocalJsonValue propIndices = default; + LocalJsonValue propPreference = default; + LocalJsonValue propRequestCache = default; + LocalJsonValue propRouting = default; + LocalJsonValue propSearchType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowNoIndices.TryReadProperty(ref reader, options, PropAllowNoIndices, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propAllowPartialSearchResults.TryReadProperty(ref reader, options, PropAllowPartialSearchResults, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCcsMinimizeRoundtrips.TryReadProperty(ref reader, options, PropCcsMinimizeRoundtrips, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propExpandWildcards.TryReadProperty(ref reader, options, PropExpandWildcards, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propIgnoreThrottled.TryReadProperty(ref reader, options, PropIgnoreThrottled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreUnavailable.TryReadProperty(ref reader, options, PropIgnoreUnavailable, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) + { + continue; + } + + if (propPreference.TryReadProperty(ref reader, options, PropPreference, null)) + { + continue; + } + + if (propRequestCache.TryReadProperty(ref reader, options, PropRequestCache, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (propSearchType.TryReadProperty(ref reader, options, PropSearchType, static Elastic.Clients.Elasticsearch.SearchType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.MSearch.MultisearchHeader(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowNoIndices = propAllowNoIndices.Value, + AllowPartialSearchResults = propAllowPartialSearchResults.Value, + CcsMinimizeRoundtrips = propCcsMinimizeRoundtrips.Value, + ExpandWildcards = propExpandWildcards.Value, + IgnoreThrottled = propIgnoreThrottled.Value, + IgnoreUnavailable = propIgnoreUnavailable.Value, + Indices = propIndices.Value, + Preference = propPreference.Value, + RequestCache = propRequestCache.Value, + Routing = propRouting.Value, + SearchType = propSearchType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.MSearch.MultisearchHeader value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowNoIndices, value.AllowNoIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropAllowPartialSearchResults, value.AllowPartialSearchResults, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCcsMinimizeRoundtrips, value.CcsMinimizeRoundtrips, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropExpandWildcards, value.ExpandWildcards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIgnoreThrottled, value.IgnoreThrottled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreUnavailable, value.IgnoreUnavailable, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndices, value.Indices, null, null); + writer.WriteProperty(options, PropPreference, value.Preference, null, null); + writer.WriteProperty(options, PropRequestCache, value.RequestCache, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteProperty(options, PropSearchType, value.SearchType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SearchType? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultisearchHeader.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultisearchHeader.g.cs index 8ee573c000a..9cc6226bc6c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultisearchHeader.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearch/MultisearchHeader.g.cs @@ -23,141 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Core.MSearch; -internal sealed partial class MultisearchHeaderConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowNoIndices = System.Text.Json.JsonEncodedText.Encode("allow_no_indices"); - private static readonly System.Text.Json.JsonEncodedText PropAllowPartialSearchResults = System.Text.Json.JsonEncodedText.Encode("allow_partial_search_results"); - private static readonly System.Text.Json.JsonEncodedText PropCcsMinimizeRoundtrips = System.Text.Json.JsonEncodedText.Encode("ccs_minimize_roundtrips"); - private static readonly System.Text.Json.JsonEncodedText PropExpandWildcards = System.Text.Json.JsonEncodedText.Encode("expand_wildcards"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreThrottled = System.Text.Json.JsonEncodedText.Encode("ignore_throttled"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnavailable = System.Text.Json.JsonEncodedText.Encode("ignore_unavailable"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropPreference = System.Text.Json.JsonEncodedText.Encode("preference"); - private static readonly System.Text.Json.JsonEncodedText PropRequestCache = System.Text.Json.JsonEncodedText.Encode("request_cache"); - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); - private static readonly System.Text.Json.JsonEncodedText PropSearchType = System.Text.Json.JsonEncodedText.Encode("search_type"); - - public override Elastic.Clients.Elasticsearch.Core.MSearch.MultisearchHeader Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowNoIndices = default; - LocalJsonValue propAllowPartialSearchResults = default; - LocalJsonValue propCcsMinimizeRoundtrips = default; - LocalJsonValue?> propExpandWildcards = default; - LocalJsonValue propIgnoreThrottled = default; - LocalJsonValue propIgnoreUnavailable = default; - LocalJsonValue propIndices = default; - LocalJsonValue propPreference = default; - LocalJsonValue propRequestCache = default; - LocalJsonValue propRouting = default; - LocalJsonValue propSearchType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowNoIndices.TryReadProperty(ref reader, options, PropAllowNoIndices, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propAllowPartialSearchResults.TryReadProperty(ref reader, options, PropAllowPartialSearchResults, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCcsMinimizeRoundtrips.TryReadProperty(ref reader, options, PropCcsMinimizeRoundtrips, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propExpandWildcards.TryReadProperty(ref reader, options, PropExpandWildcards, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propIgnoreThrottled.TryReadProperty(ref reader, options, PropIgnoreThrottled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreUnavailable.TryReadProperty(ref reader, options, PropIgnoreUnavailable, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) - { - continue; - } - - if (propPreference.TryReadProperty(ref reader, options, PropPreference, null)) - { - continue; - } - - if (propRequestCache.TryReadProperty(ref reader, options, PropRequestCache, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (propSearchType.TryReadProperty(ref reader, options, PropSearchType, static Elastic.Clients.Elasticsearch.SearchType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.MSearch.MultisearchHeader(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowNoIndices = propAllowNoIndices.Value, - AllowPartialSearchResults = propAllowPartialSearchResults.Value, - CcsMinimizeRoundtrips = propCcsMinimizeRoundtrips.Value, - ExpandWildcards = propExpandWildcards.Value, - IgnoreThrottled = propIgnoreThrottled.Value, - IgnoreUnavailable = propIgnoreUnavailable.Value, - Indices = propIndices.Value, - Preference = propPreference.Value, - RequestCache = propRequestCache.Value, - Routing = propRouting.Value, - SearchType = propSearchType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.MSearch.MultisearchHeader value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowNoIndices, value.AllowNoIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropAllowPartialSearchResults, value.AllowPartialSearchResults, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCcsMinimizeRoundtrips, value.CcsMinimizeRoundtrips, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropExpandWildcards, value.ExpandWildcards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIgnoreThrottled, value.IgnoreThrottled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreUnavailable, value.IgnoreUnavailable, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndices, value.Indices, null, null); - writer.WriteProperty(options, PropPreference, value.Preference, null, null); - writer.WriteProperty(options, PropRequestCache, value.RequestCache, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteProperty(options, PropSearchType, value.SearchType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SearchType? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Contains parameters used to limit or change the subsequent search body request. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.MSearch.MultisearchHeaderConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.MSearch.Json.MultisearchHeaderConverter))] public sealed partial class MultisearchHeader { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearchTemplate/TemplateConfig.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearchTemplate/TemplateConfig.Converters.g.cs new file mode 100644 index 00000000000..abdc18592ab --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearchTemplate/TemplateConfig.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.MSearchTemplate.Json; + +public sealed partial class TemplateConfigConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExplain = System.Text.Json.JsonEncodedText.Encode("explain"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); + private static readonly System.Text.Json.JsonEncodedText PropProfile = System.Text.Json.JsonEncodedText.Encode("profile"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + + public override Elastic.Clients.Elasticsearch.Core.MSearchTemplate.TemplateConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExplain = default; + LocalJsonValue propId = default; + LocalJsonValue?> propParams = default; + LocalJsonValue propProfile = default; + LocalJsonValue propSource = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExplain.TryReadProperty(ref reader, options, PropExplain, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propProfile.TryReadProperty(ref reader, options, PropProfile, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.MSearchTemplate.TemplateConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Explain = propExplain.Value, + Id = propId.Value, + Params = propParams.Value, + Profile = propProfile.Value, + Source = propSource.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.MSearchTemplate.TemplateConfig value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExplain, value.Explain, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropProfile, value.Profile, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearchTemplate/TemplateConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearchTemplate/TemplateConfig.g.cs index 4bbf6d2dd5c..2c8526318b7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearchTemplate/TemplateConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MSearchTemplate/TemplateConfig.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.MSearchTemplate; -internal sealed partial class TemplateConfigConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExplain = System.Text.Json.JsonEncodedText.Encode("explain"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); - private static readonly System.Text.Json.JsonEncodedText PropProfile = System.Text.Json.JsonEncodedText.Encode("profile"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - - public override Elastic.Clients.Elasticsearch.Core.MSearchTemplate.TemplateConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propExplain = default; - LocalJsonValue propId = default; - LocalJsonValue?> propParams = default; - LocalJsonValue propProfile = default; - LocalJsonValue propSource = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExplain.TryReadProperty(ref reader, options, PropExplain, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propProfile.TryReadProperty(ref reader, options, PropProfile, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.MSearchTemplate.TemplateConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Explain = propExplain.Value, - Id = propId.Value, - Params = propParams.Value, - Profile = propProfile.Value, - Source = propSource.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.MSearchTemplate.TemplateConfig value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExplain, value.Explain, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropProfile, value.Profile, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.MSearchTemplate.TemplateConfigConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.MSearchTemplate.Json.TemplateConfigConverter))] public sealed partial class TemplateConfig { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Mtermvectors/MultiTermVectorsOperation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Mtermvectors/MultiTermVectorsOperation.Converters.g.cs new file mode 100644 index 00000000000..f323a558b71 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Mtermvectors/MultiTermVectorsOperation.Converters.g.cs @@ -0,0 +1,171 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Mtermvectors.Json; + +public sealed partial class MultiTermVectorsOperationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDoc = System.Text.Json.JsonEncodedText.Encode("doc"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropFieldStatistics = System.Text.Json.JsonEncodedText.Encode("field_statistics"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); + private static readonly System.Text.Json.JsonEncodedText PropOffsets = System.Text.Json.JsonEncodedText.Encode("offsets"); + private static readonly System.Text.Json.JsonEncodedText PropPayloads = System.Text.Json.JsonEncodedText.Encode("payloads"); + private static readonly System.Text.Json.JsonEncodedText PropPositions = System.Text.Json.JsonEncodedText.Encode("positions"); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); + private static readonly System.Text.Json.JsonEncodedText PropTermStatistics = System.Text.Json.JsonEncodedText.Encode("term_statistics"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + private static readonly System.Text.Json.JsonEncodedText PropVersionType = System.Text.Json.JsonEncodedText.Encode("version_type"); + + public override Elastic.Clients.Elasticsearch.Core.Mtermvectors.MultiTermVectorsOperation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDoc = default; + LocalJsonValue propFields = default; + LocalJsonValue propFieldStatistics = default; + LocalJsonValue propFilter = default; + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + LocalJsonValue propOffsets = default; + LocalJsonValue propPayloads = default; + LocalJsonValue propPositions = default; + LocalJsonValue propRouting = default; + LocalJsonValue propTermStatistics = default; + LocalJsonValue propVersion = default; + LocalJsonValue propVersionType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDoc.TryReadProperty(ref reader, options, PropDoc, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propFieldStatistics.TryReadProperty(ref reader, options, PropFieldStatistics, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propOffsets.TryReadProperty(ref reader, options, PropOffsets, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPayloads.TryReadProperty(ref reader, options, PropPayloads, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPositions.TryReadProperty(ref reader, options, PropPositions, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (propTermStatistics.TryReadProperty(ref reader, options, PropTermStatistics, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propVersionType.TryReadProperty(ref reader, options, PropVersionType, static Elastic.Clients.Elasticsearch.VersionType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Mtermvectors.MultiTermVectorsOperation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Doc = propDoc.Value, + Fields = propFields.Value, + FieldStatistics = propFieldStatistics.Value, + Filter = propFilter.Value, + Id = propId.Value, + Index = propIndex.Value, + Offsets = propOffsets.Value, + Payloads = propPayloads.Value, + Positions = propPositions.Value, + Routing = propRouting.Value, + TermStatistics = propTermStatistics.Value, + Version = propVersion.Value, + VersionType = propVersionType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Mtermvectors.MultiTermVectorsOperation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDoc, value.Doc, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropFieldStatistics, value.FieldStatistics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFilter, value.Filter, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropOffsets, value.Offsets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPayloads, value.Payloads, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPositions, value.Positions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteProperty(options, PropTermStatistics, value.TermStatistics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVersionType, value.VersionType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.VersionType? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Mtermvectors/MultiTermVectorsOperation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Mtermvectors/MultiTermVectorsOperation.g.cs index e18acac47ab..8c9237087ff 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Mtermvectors/MultiTermVectorsOperation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Mtermvectors/MultiTermVectorsOperation.g.cs @@ -23,154 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Mtermvectors; -internal sealed partial class MultiTermVectorsOperationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDoc = System.Text.Json.JsonEncodedText.Encode("doc"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropFieldStatistics = System.Text.Json.JsonEncodedText.Encode("field_statistics"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); - private static readonly System.Text.Json.JsonEncodedText PropOffsets = System.Text.Json.JsonEncodedText.Encode("offsets"); - private static readonly System.Text.Json.JsonEncodedText PropPayloads = System.Text.Json.JsonEncodedText.Encode("payloads"); - private static readonly System.Text.Json.JsonEncodedText PropPositions = System.Text.Json.JsonEncodedText.Encode("positions"); - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); - private static readonly System.Text.Json.JsonEncodedText PropTermStatistics = System.Text.Json.JsonEncodedText.Encode("term_statistics"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - private static readonly System.Text.Json.JsonEncodedText PropVersionType = System.Text.Json.JsonEncodedText.Encode("version_type"); - - public override Elastic.Clients.Elasticsearch.Core.Mtermvectors.MultiTermVectorsOperation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDoc = default; - LocalJsonValue propFields = default; - LocalJsonValue propFieldStatistics = default; - LocalJsonValue propFilter = default; - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - LocalJsonValue propOffsets = default; - LocalJsonValue propPayloads = default; - LocalJsonValue propPositions = default; - LocalJsonValue propRouting = default; - LocalJsonValue propTermStatistics = default; - LocalJsonValue propVersion = default; - LocalJsonValue propVersionType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDoc.TryReadProperty(ref reader, options, PropDoc, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propFieldStatistics.TryReadProperty(ref reader, options, PropFieldStatistics, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propOffsets.TryReadProperty(ref reader, options, PropOffsets, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPayloads.TryReadProperty(ref reader, options, PropPayloads, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPositions.TryReadProperty(ref reader, options, PropPositions, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (propTermStatistics.TryReadProperty(ref reader, options, PropTermStatistics, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propVersionType.TryReadProperty(ref reader, options, PropVersionType, static Elastic.Clients.Elasticsearch.VersionType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Mtermvectors.MultiTermVectorsOperation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Doc = propDoc.Value, - Fields = propFields.Value, - FieldStatistics = propFieldStatistics.Value, - Filter = propFilter.Value, - Id = propId.Value, - Index = propIndex.Value, - Offsets = propOffsets.Value, - Payloads = propPayloads.Value, - Positions = propPositions.Value, - Routing = propRouting.Value, - TermStatistics = propTermStatistics.Value, - Version = propVersion.Value, - VersionType = propVersionType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Mtermvectors.MultiTermVectorsOperation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDoc, value.Doc, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropFieldStatistics, value.FieldStatistics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFilter, value.Filter, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropOffsets, value.Offsets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPayloads, value.Payloads, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPositions, value.Positions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteProperty(options, PropTermStatistics, value.TermStatistics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropVersionType, value.VersionType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.VersionType? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Mtermvectors.MultiTermVectorsOperationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Mtermvectors.Json.MultiTermVectorsOperationConverter))] public sealed partial class MultiTermVectorsOperation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Mtermvectors/MultiTermVectorsResult.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Mtermvectors/MultiTermVectorsResult.Converters.g.cs new file mode 100644 index 00000000000..569785f5c11 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Mtermvectors/MultiTermVectorsResult.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Mtermvectors.Json; + +public sealed partial class MultiTermVectorsResultConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); + private static readonly System.Text.Json.JsonEncodedText PropFound = System.Text.Json.JsonEncodedText.Encode("found"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); + private static readonly System.Text.Json.JsonEncodedText PropTermVectors = System.Text.Json.JsonEncodedText.Encode("term_vectors"); + private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("_version"); + + public override Elastic.Clients.Elasticsearch.Core.Mtermvectors.MultiTermVectorsResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propError = default; + LocalJsonValue propFound = default; + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propTermVectors = default; + LocalJsonValue propTook = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propError.TryReadProperty(ref reader, options, PropError, null)) + { + continue; + } + + if (propFound.TryReadProperty(ref reader, options, PropFound, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propTermVectors.TryReadProperty(ref reader, options, PropTermVectors, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propTook.TryReadProperty(ref reader, options, PropTook, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Mtermvectors.MultiTermVectorsResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Error = propError.Value, + Found = propFound.Value, + Id = propId.Value, + Index = propIndex.Value, + TermVectors = propTermVectors.Value, + Took = propTook.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Mtermvectors.MultiTermVectorsResult value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropError, value.Error, null, null); + writer.WriteProperty(options, PropFound, value.Found, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropTermVectors, value.TermVectors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropTook, value.Took, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Mtermvectors/MultiTermVectorsResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Mtermvectors/MultiTermVectorsResult.g.cs index d9c065d07d3..7e6cc7f5f6a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Mtermvectors/MultiTermVectorsResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Mtermvectors/MultiTermVectorsResult.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Mtermvectors; -internal sealed partial class MultiTermVectorsResultConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); - private static readonly System.Text.Json.JsonEncodedText PropFound = System.Text.Json.JsonEncodedText.Encode("found"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); - private static readonly System.Text.Json.JsonEncodedText PropTermVectors = System.Text.Json.JsonEncodedText.Encode("term_vectors"); - private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("_version"); - - public override Elastic.Clients.Elasticsearch.Core.Mtermvectors.MultiTermVectorsResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propError = default; - LocalJsonValue propFound = default; - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propTermVectors = default; - LocalJsonValue propTook = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propError.TryReadProperty(ref reader, options, PropError, null)) - { - continue; - } - - if (propFound.TryReadProperty(ref reader, options, PropFound, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propTermVectors.TryReadProperty(ref reader, options, PropTermVectors, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propTook.TryReadProperty(ref reader, options, PropTook, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Mtermvectors.MultiTermVectorsResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Error = propError.Value, - Found = propFound.Value, - Id = propId.Value, - Index = propIndex.Value, - TermVectors = propTermVectors.Value, - Took = propTook.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Mtermvectors.MultiTermVectorsResult value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropError, value.Error, null, null); - writer.WriteProperty(options, PropFound, value.Found, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropTermVectors, value.TermVectors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropTook, value.Took, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Mtermvectors.MultiTermVectorsResultConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Mtermvectors.Json.MultiTermVectorsResultConverter))] public sealed partial class MultiTermVectorsResult { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiGetResponseItem.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiGetResponseItem.Converters.g.cs new file mode 100644 index 00000000000..aaff2169b96 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiGetResponseItem.Converters.g.cs @@ -0,0 +1,75 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.MGet.Json; + +public sealed partial class MultiGetResponseItemConverter : System.Text.Json.Serialization.JsonConverter> +{ + public override Elastic.Clients.Elasticsearch.Core.MGet.MultiGetResponseItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByPropertyOfT1(ref r, o, "found"); + return selector(ref reader, options) switch + { + Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Core.MGet.MultiGetResponseItem(reader.ReadValue>(options, null)), + Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Core.MGet.MultiGetResponseItem(reader.ReadValue(options, null)), + _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Core.MGet.MultiGetResponseItem)}") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.MGet.MultiGetResponseItem value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Tag) + { + case Elastic.Clients.Elasticsearch.UnionTag.T1: + { + writer.WriteValue(options, value.Value1, null); + break; + } + + case Elastic.Clients.Elasticsearch.UnionTag.T2: + { + writer.WriteValue(options, value.Value2, null); + break; + } + + default: + throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); + } + } +} + +public sealed partial class MultiGetResponseItemConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(MultiGetResponseItem<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(MultiGetResponseItemConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiGetResponseItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiGetResponseItem.g.cs index 9246eee590b..1dcbcea25cc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiGetResponseItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiGetResponseItem.g.cs @@ -23,58 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.MGet; -internal sealed partial class MultiGetResponseItemConverter : System.Text.Json.Serialization.JsonConverter> -{ - public override Elastic.Clients.Elasticsearch.Core.MGet.MultiGetResponseItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByPropertyOfT1(ref r, o, "found"); - return selector(ref reader, options) switch - { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Core.MGet.MultiGetResponseItem(reader.ReadValue>(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Core.MGet.MultiGetResponseItem(reader.ReadValue(options, null)), - _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Core.MGet.MultiGetResponseItem)}") - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.MGet.MultiGetResponseItem value, System.Text.Json.JsonSerializerOptions options) - { - switch (value.Tag) - { - case Elastic.Clients.Elasticsearch.UnionTag.T1: - { - writer.WriteValue(options, value.Value1, null); - break; - } - - case Elastic.Clients.Elasticsearch.UnionTag.T2: - { - writer.WriteValue(options, value.Value2, null); - break; - } - - default: - throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); - } - } -} - -internal sealed partial class MultiGetResponseItemConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(MultiGetResponseItem<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(MultiGetResponseItemConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.MGet.MultiGetResponseItemConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.MGet.Json.MultiGetResponseItemConverterFactory))] public sealed partial class MultiGetResponseItem : Elastic.Clients.Elasticsearch.Union, Elastic.Clients.Elasticsearch.Core.MGet.MultiGetError> { public MultiGetResponseItem(Elastic.Clients.Elasticsearch.Core.Get.GetResult value) : base(value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiSearchResponseItem.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiSearchResponseItem.Converters.g.cs new file mode 100644 index 00000000000..8c3e92c4c08 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiSearchResponseItem.Converters.g.cs @@ -0,0 +1,75 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.MSearch.Json; + +public sealed partial class MultiSearchResponseItemConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(MultiSearchResponseItem<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(MultiSearchResponseItemConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} + +public sealed partial class MultiSearchResponseItemConverter : System.Text.Json.Serialization.JsonConverter> +{ + public override Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchResponseItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByPropertyOfT1(ref r, o, "took"); + return selector(ref reader, options) switch + { + Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchResponseItem(reader.ReadValue>(options, null)), + Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchResponseItem(reader.ReadValue(options, null)), + _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchResponseItem)}") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchResponseItem value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Tag) + { + case Elastic.Clients.Elasticsearch.UnionTag.T1: + { + writer.WriteValue(options, value.Value1, null); + break; + } + + case Elastic.Clients.Elasticsearch.UnionTag.T2: + { + writer.WriteValue(options, value.Value2, null); + break; + } + + default: + throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiSearchResponseItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiSearchResponseItem.g.cs index 52d7c2436f6..e28f096237b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiSearchResponseItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/MultiSearchResponseItem.g.cs @@ -23,58 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.MSearch; -internal sealed partial class MultiSearchResponseItemConverter : System.Text.Json.Serialization.JsonConverter> -{ - public override Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchResponseItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByPropertyOfT1(ref r, o, "took"); - return selector(ref reader, options) switch - { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchResponseItem(reader.ReadValue>(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchResponseItem(reader.ReadValue(options, null)), - _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchResponseItem)}") - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchResponseItem value, System.Text.Json.JsonSerializerOptions options) - { - switch (value.Tag) - { - case Elastic.Clients.Elasticsearch.UnionTag.T1: - { - writer.WriteValue(options, value.Value1, null); - break; - } - - case Elastic.Clients.Elasticsearch.UnionTag.T2: - { - writer.WriteValue(options, value.Value2, null); - break; - } - - default: - throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); - } - } -} - -internal sealed partial class MultiSearchResponseItemConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(MultiSearchResponseItem<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(MultiSearchResponseItemConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchResponseItemConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.MSearch.Json.MultiSearchResponseItemConverterFactory))] public sealed partial class MultiSearchResponseItem : Elastic.Clients.Elasticsearch.Union, Elastic.Clients.Elasticsearch.ErrorResponseBase> { public MultiSearchResponseItem(Elastic.Clients.Elasticsearch.Core.MSearch.MultiSearchItem value) : base(value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/DocumentRating.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/DocumentRating.Converters.g.cs new file mode 100644 index 00000000000..1be085979a0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/DocumentRating.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.RankEval.Json; + +public sealed partial class DocumentRatingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); + private static readonly System.Text.Json.JsonEncodedText PropRating = System.Text.Json.JsonEncodedText.Encode("rating"); + + public override Elastic.Clients.Elasticsearch.Core.RankEval.DocumentRating Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + LocalJsonValue propRating = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propRating.TryReadProperty(ref reader, options, PropRating, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.RankEval.DocumentRating(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + Index = propIndex.Value, + Rating = propRating.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.RankEval.DocumentRating value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropRating, value.Rating, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/DocumentRating.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/DocumentRating.g.cs index b0eed3ee2a6..f49775b830d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/DocumentRating.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/DocumentRating.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.RankEval; -internal sealed partial class DocumentRatingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); - private static readonly System.Text.Json.JsonEncodedText PropRating = System.Text.Json.JsonEncodedText.Encode("rating"); - - public override Elastic.Clients.Elasticsearch.Core.RankEval.DocumentRating Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - LocalJsonValue propRating = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propRating.TryReadProperty(ref reader, options, PropRating, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.RankEval.DocumentRating(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - Index = propIndex.Value, - Rating = propRating.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.RankEval.DocumentRating value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropRating, value.Rating, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.DocumentRatingConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.Json.DocumentRatingConverter))] public sealed partial class DocumentRating { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalHit.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalHit.Converters.g.cs new file mode 100644 index 00000000000..0c178d2949d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalHit.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.RankEval.Json; + +public sealed partial class RankEvalHitConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); + private static readonly System.Text.Json.JsonEncodedText PropScore = System.Text.Json.JsonEncodedText.Encode("_score"); + + public override Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalHit Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + LocalJsonValue propScore = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propScore.TryReadProperty(ref reader, options, PropScore, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalHit(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + Index = propIndex.Value, + Score = propScore.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalHit value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropScore, value.Score, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalHit.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalHit.g.cs index 75969eace8c..675751a4edc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalHit.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalHit.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.RankEval; -internal sealed partial class RankEvalHitConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); - private static readonly System.Text.Json.JsonEncodedText PropScore = System.Text.Json.JsonEncodedText.Encode("_score"); - - public override Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalHit Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - LocalJsonValue propScore = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propScore.TryReadProperty(ref reader, options, PropScore, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalHit(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - Index = propIndex.Value, - Score = propScore.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalHit value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropScore, value.Score, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalHitConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.Json.RankEvalHitConverter))] public sealed partial class RankEvalHit { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalHitItem.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalHitItem.Converters.g.cs new file mode 100644 index 00000000000..f47e3318ced --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalHitItem.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.RankEval.Json; + +public sealed partial class RankEvalHitItemConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropHit = System.Text.Json.JsonEncodedText.Encode("hit"); + private static readonly System.Text.Json.JsonEncodedText PropRating = System.Text.Json.JsonEncodedText.Encode("rating"); + + public override Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalHitItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propHit = default; + LocalJsonValue propRating = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propHit.TryReadProperty(ref reader, options, PropHit, null)) + { + continue; + } + + if (propRating.TryReadProperty(ref reader, options, PropRating, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalHitItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Hit = propHit.Value, + Rating = propRating.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalHitItem value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropHit, value.Hit, null, null); + writer.WriteProperty(options, PropRating, value.Rating, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalHitItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalHitItem.g.cs index 82061a62867..9696075ab3a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalHitItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalHitItem.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.RankEval; -internal sealed partial class RankEvalHitItemConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropHit = System.Text.Json.JsonEncodedText.Encode("hit"); - private static readonly System.Text.Json.JsonEncodedText PropRating = System.Text.Json.JsonEncodedText.Encode("rating"); - - public override Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalHitItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propHit = default; - LocalJsonValue propRating = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propHit.TryReadProperty(ref reader, options, PropHit, null)) - { - continue; - } - - if (propRating.TryReadProperty(ref reader, options, PropRating, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalHitItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Hit = propHit.Value, - Rating = propRating.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalHitItem value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropHit, value.Hit, null, null); - writer.WriteProperty(options, PropRating, value.Rating, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalHitItemConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.Json.RankEvalHitItemConverter))] public sealed partial class RankEvalHitItem { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetric.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetric.Converters.g.cs new file mode 100644 index 00000000000..1a7b8660b66 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetric.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.RankEval.Json; + +public sealed partial class RankEvalMetricConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDcg = System.Text.Json.JsonEncodedText.Encode("dcg"); + private static readonly System.Text.Json.JsonEncodedText PropExpectedReciprocalRank = System.Text.Json.JsonEncodedText.Encode("expected_reciprocal_rank"); + private static readonly System.Text.Json.JsonEncodedText PropMeanReciprocalRank = System.Text.Json.JsonEncodedText.Encode("mean_reciprocal_rank"); + private static readonly System.Text.Json.JsonEncodedText PropPrecision = System.Text.Json.JsonEncodedText.Encode("precision"); + private static readonly System.Text.Json.JsonEncodedText PropRecall = System.Text.Json.JsonEncodedText.Encode("recall"); + + public override Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetric Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDcg = default; + LocalJsonValue propExpectedReciprocalRank = default; + LocalJsonValue propMeanReciprocalRank = default; + LocalJsonValue propPrecision = default; + LocalJsonValue propRecall = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDcg.TryReadProperty(ref reader, options, PropDcg, null)) + { + continue; + } + + if (propExpectedReciprocalRank.TryReadProperty(ref reader, options, PropExpectedReciprocalRank, null)) + { + continue; + } + + if (propMeanReciprocalRank.TryReadProperty(ref reader, options, PropMeanReciprocalRank, null)) + { + continue; + } + + if (propPrecision.TryReadProperty(ref reader, options, PropPrecision, null)) + { + continue; + } + + if (propRecall.TryReadProperty(ref reader, options, PropRecall, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetric(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Dcg = propDcg.Value, + ExpectedReciprocalRank = propExpectedReciprocalRank.Value, + MeanReciprocalRank = propMeanReciprocalRank.Value, + Precision = propPrecision.Value, + Recall = propRecall.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetric value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDcg, value.Dcg, null, null); + writer.WriteProperty(options, PropExpectedReciprocalRank, value.ExpectedReciprocalRank, null, null); + writer.WriteProperty(options, PropMeanReciprocalRank, value.MeanReciprocalRank, null, null); + writer.WriteProperty(options, PropPrecision, value.Precision, null, null); + writer.WriteProperty(options, PropRecall, value.Recall, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetric.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetric.g.cs index e8c4d7f64bf..4e7e08c9151 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetric.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetric.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.RankEval; -internal sealed partial class RankEvalMetricConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDcg = System.Text.Json.JsonEncodedText.Encode("dcg"); - private static readonly System.Text.Json.JsonEncodedText PropExpectedReciprocalRank = System.Text.Json.JsonEncodedText.Encode("expected_reciprocal_rank"); - private static readonly System.Text.Json.JsonEncodedText PropMeanReciprocalRank = System.Text.Json.JsonEncodedText.Encode("mean_reciprocal_rank"); - private static readonly System.Text.Json.JsonEncodedText PropPrecision = System.Text.Json.JsonEncodedText.Encode("precision"); - private static readonly System.Text.Json.JsonEncodedText PropRecall = System.Text.Json.JsonEncodedText.Encode("recall"); - - public override Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetric Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDcg = default; - LocalJsonValue propExpectedReciprocalRank = default; - LocalJsonValue propMeanReciprocalRank = default; - LocalJsonValue propPrecision = default; - LocalJsonValue propRecall = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDcg.TryReadProperty(ref reader, options, PropDcg, null)) - { - continue; - } - - if (propExpectedReciprocalRank.TryReadProperty(ref reader, options, PropExpectedReciprocalRank, null)) - { - continue; - } - - if (propMeanReciprocalRank.TryReadProperty(ref reader, options, PropMeanReciprocalRank, null)) - { - continue; - } - - if (propPrecision.TryReadProperty(ref reader, options, PropPrecision, null)) - { - continue; - } - - if (propRecall.TryReadProperty(ref reader, options, PropRecall, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetric(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Dcg = propDcg.Value, - ExpectedReciprocalRank = propExpectedReciprocalRank.Value, - MeanReciprocalRank = propMeanReciprocalRank.Value, - Precision = propPrecision.Value, - Recall = propRecall.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetric value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDcg, value.Dcg, null, null); - writer.WriteProperty(options, PropExpectedReciprocalRank, value.ExpectedReciprocalRank, null, null); - writer.WriteProperty(options, PropMeanReciprocalRank, value.MeanReciprocalRank, null, null); - writer.WriteProperty(options, PropPrecision, value.Precision, null, null); - writer.WriteProperty(options, PropRecall, value.Recall, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.Json.RankEvalMetricConverter))] public sealed partial class RankEvalMetric { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricDetail.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricDetail.Converters.g.cs new file mode 100644 index 00000000000..fe1d8b5f793 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricDetail.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.RankEval.Json; + +public sealed partial class RankEvalMetricDetailConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropHits = System.Text.Json.JsonEncodedText.Encode("hits"); + private static readonly System.Text.Json.JsonEncodedText PropMetricDetails = System.Text.Json.JsonEncodedText.Encode("metric_details"); + private static readonly System.Text.Json.JsonEncodedText PropMetricScore = System.Text.Json.JsonEncodedText.Encode("metric_score"); + private static readonly System.Text.Json.JsonEncodedText PropUnratedDocs = System.Text.Json.JsonEncodedText.Encode("unrated_docs"); + + public override Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricDetail Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propHits = default; + LocalJsonValue>> propMetricDetails = default; + LocalJsonValue propMetricScore = default; + LocalJsonValue> propUnratedDocs = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propHits.TryReadProperty(ref reader, options, PropHits, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMetricDetails.TryReadProperty(ref reader, options, PropMetricDetails, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)!)) + { + continue; + } + + if (propMetricScore.TryReadProperty(ref reader, options, PropMetricScore, null)) + { + continue; + } + + if (propUnratedDocs.TryReadProperty(ref reader, options, PropUnratedDocs, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Hits = propHits.Value, + MetricDetails = propMetricDetails.Value, + MetricScore = propMetricScore.Value, + UnratedDocs = propUnratedDocs.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricDetail value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropHits, value.Hits, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMetricDetails, value.MetricDetails, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))))); + writer.WriteProperty(options, PropMetricScore, value.MetricScore, null, null); + writer.WriteProperty(options, PropUnratedDocs, value.UnratedDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricDetail.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricDetail.g.cs index 064fe58660d..00f0167db89 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricDetail.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricDetail.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.RankEval; -internal sealed partial class RankEvalMetricDetailConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropHits = System.Text.Json.JsonEncodedText.Encode("hits"); - private static readonly System.Text.Json.JsonEncodedText PropMetricDetails = System.Text.Json.JsonEncodedText.Encode("metric_details"); - private static readonly System.Text.Json.JsonEncodedText PropMetricScore = System.Text.Json.JsonEncodedText.Encode("metric_score"); - private static readonly System.Text.Json.JsonEncodedText PropUnratedDocs = System.Text.Json.JsonEncodedText.Encode("unrated_docs"); - - public override Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricDetail Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propHits = default; - LocalJsonValue>> propMetricDetails = default; - LocalJsonValue propMetricScore = default; - LocalJsonValue> propUnratedDocs = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propHits.TryReadProperty(ref reader, options, PropHits, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMetricDetails.TryReadProperty(ref reader, options, PropMetricDetails, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)!)) - { - continue; - } - - if (propMetricScore.TryReadProperty(ref reader, options, PropMetricScore, null)) - { - continue; - } - - if (propUnratedDocs.TryReadProperty(ref reader, options, PropUnratedDocs, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Hits = propHits.Value, - MetricDetails = propMetricDetails.Value, - MetricScore = propMetricScore.Value, - UnratedDocs = propUnratedDocs.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricDetail value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropHits, value.Hits, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMetricDetails, value.MetricDetails, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))))); - writer.WriteProperty(options, PropMetricScore, value.MetricScore, null, null); - writer.WriteProperty(options, PropUnratedDocs, value.UnratedDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricDetailConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.Json.RankEvalMetricDetailConverter))] public sealed partial class RankEvalMetricDetail { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricDiscountedCumulativeGain.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricDiscountedCumulativeGain.Converters.g.cs new file mode 100644 index 00000000000..0daf6169fca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricDiscountedCumulativeGain.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.RankEval.Json; + +public sealed partial class RankEvalMetricDiscountedCumulativeGainConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropK = System.Text.Json.JsonEncodedText.Encode("k"); + private static readonly System.Text.Json.JsonEncodedText PropNormalize = System.Text.Json.JsonEncodedText.Encode("normalize"); + + public override Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricDiscountedCumulativeGain Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propK = default; + LocalJsonValue propNormalize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propK.TryReadProperty(ref reader, options, PropK, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNormalize.TryReadProperty(ref reader, options, PropNormalize, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricDiscountedCumulativeGain(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + K = propK.Value, + Normalize = propNormalize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricDiscountedCumulativeGain value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropK, value.K, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNormalize, value.Normalize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricDiscountedCumulativeGain.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricDiscountedCumulativeGain.g.cs index c642238b124..693d4527f19 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricDiscountedCumulativeGain.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricDiscountedCumulativeGain.g.cs @@ -23,61 +23,13 @@ namespace Elastic.Clients.Elasticsearch.Core.RankEval; -internal sealed partial class RankEvalMetricDiscountedCumulativeGainConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropK = System.Text.Json.JsonEncodedText.Encode("k"); - private static readonly System.Text.Json.JsonEncodedText PropNormalize = System.Text.Json.JsonEncodedText.Encode("normalize"); - - public override Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricDiscountedCumulativeGain Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propK = default; - LocalJsonValue propNormalize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propK.TryReadProperty(ref reader, options, PropK, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNormalize.TryReadProperty(ref reader, options, PropNormalize, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricDiscountedCumulativeGain(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - K = propK.Value, - Normalize = propNormalize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricDiscountedCumulativeGain value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropK, value.K, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNormalize, value.Normalize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Discounted cumulative gain (DCG) /// /// Learn more about this API in the Elasticsearch documentation. /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricDiscountedCumulativeGainConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.Json.RankEvalMetricDiscountedCumulativeGainConverter))] public sealed partial class RankEvalMetricDiscountedCumulativeGain { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricExpectedReciprocalRank.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricExpectedReciprocalRank.Converters.g.cs new file mode 100644 index 00000000000..b3b855c4e61 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricExpectedReciprocalRank.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.RankEval.Json; + +public sealed partial class RankEvalMetricExpectedReciprocalRankConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropK = System.Text.Json.JsonEncodedText.Encode("k"); + private static readonly System.Text.Json.JsonEncodedText PropMaximumRelevance = System.Text.Json.JsonEncodedText.Encode("maximum_relevance"); + + public override Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricExpectedReciprocalRank Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propK = default; + LocalJsonValue propMaximumRelevance = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propK.TryReadProperty(ref reader, options, PropK, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaximumRelevance.TryReadProperty(ref reader, options, PropMaximumRelevance, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricExpectedReciprocalRank(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + K = propK.Value, + MaximumRelevance = propMaximumRelevance.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricExpectedReciprocalRank value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropK, value.K, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaximumRelevance, value.MaximumRelevance, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricExpectedReciprocalRank.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricExpectedReciprocalRank.g.cs index 6d6a9864ed3..6adc54c6fed 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricExpectedReciprocalRank.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricExpectedReciprocalRank.g.cs @@ -23,61 +23,13 @@ namespace Elastic.Clients.Elasticsearch.Core.RankEval; -internal sealed partial class RankEvalMetricExpectedReciprocalRankConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropK = System.Text.Json.JsonEncodedText.Encode("k"); - private static readonly System.Text.Json.JsonEncodedText PropMaximumRelevance = System.Text.Json.JsonEncodedText.Encode("maximum_relevance"); - - public override Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricExpectedReciprocalRank Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propK = default; - LocalJsonValue propMaximumRelevance = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propK.TryReadProperty(ref reader, options, PropK, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaximumRelevance.TryReadProperty(ref reader, options, PropMaximumRelevance, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricExpectedReciprocalRank(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - K = propK.Value, - MaximumRelevance = propMaximumRelevance.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricExpectedReciprocalRank value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropK, value.K, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaximumRelevance, value.MaximumRelevance, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Expected Reciprocal Rank (ERR) /// /// Learn more about this API in the Elasticsearch documentation. /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricExpectedReciprocalRankConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.Json.RankEvalMetricExpectedReciprocalRankConverter))] public sealed partial class RankEvalMetricExpectedReciprocalRank { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricMeanReciprocalRank.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricMeanReciprocalRank.Converters.g.cs new file mode 100644 index 00000000000..98284f79a27 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricMeanReciprocalRank.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.RankEval.Json; + +public sealed partial class RankEvalMetricMeanReciprocalRankConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropK = System.Text.Json.JsonEncodedText.Encode("k"); + private static readonly System.Text.Json.JsonEncodedText PropRelevantRatingThreshold = System.Text.Json.JsonEncodedText.Encode("relevant_rating_threshold"); + + public override Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricMeanReciprocalRank Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propK = default; + LocalJsonValue propRelevantRatingThreshold = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propK.TryReadProperty(ref reader, options, PropK, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRelevantRatingThreshold.TryReadProperty(ref reader, options, PropRelevantRatingThreshold, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricMeanReciprocalRank(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + K = propK.Value, + RelevantRatingThreshold = propRelevantRatingThreshold.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricMeanReciprocalRank value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropK, value.K, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRelevantRatingThreshold, value.RelevantRatingThreshold, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricMeanReciprocalRank.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricMeanReciprocalRank.g.cs index 6604ffd97b2..584df83c814 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricMeanReciprocalRank.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricMeanReciprocalRank.g.cs @@ -23,61 +23,13 @@ namespace Elastic.Clients.Elasticsearch.Core.RankEval; -internal sealed partial class RankEvalMetricMeanReciprocalRankConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropK = System.Text.Json.JsonEncodedText.Encode("k"); - private static readonly System.Text.Json.JsonEncodedText PropRelevantRatingThreshold = System.Text.Json.JsonEncodedText.Encode("relevant_rating_threshold"); - - public override Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricMeanReciprocalRank Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propK = default; - LocalJsonValue propRelevantRatingThreshold = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propK.TryReadProperty(ref reader, options, PropK, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRelevantRatingThreshold.TryReadProperty(ref reader, options, PropRelevantRatingThreshold, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricMeanReciprocalRank(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - K = propK.Value, - RelevantRatingThreshold = propRelevantRatingThreshold.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricMeanReciprocalRank value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropK, value.K, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRelevantRatingThreshold, value.RelevantRatingThreshold, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Mean Reciprocal Rank /// /// Learn more about this API in the Elasticsearch documentation. /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricMeanReciprocalRankConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.Json.RankEvalMetricMeanReciprocalRankConverter))] public sealed partial class RankEvalMetricMeanReciprocalRank { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricPrecision.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricPrecision.Converters.g.cs new file mode 100644 index 00000000000..d5aabda5815 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricPrecision.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.RankEval.Json; + +public sealed partial class RankEvalMetricPrecisionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnlabeled = System.Text.Json.JsonEncodedText.Encode("ignore_unlabeled"); + private static readonly System.Text.Json.JsonEncodedText PropK = System.Text.Json.JsonEncodedText.Encode("k"); + private static readonly System.Text.Json.JsonEncodedText PropRelevantRatingThreshold = System.Text.Json.JsonEncodedText.Encode("relevant_rating_threshold"); + + public override Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricPrecision Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIgnoreUnlabeled = default; + LocalJsonValue propK = default; + LocalJsonValue propRelevantRatingThreshold = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIgnoreUnlabeled.TryReadProperty(ref reader, options, PropIgnoreUnlabeled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propK.TryReadProperty(ref reader, options, PropK, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRelevantRatingThreshold.TryReadProperty(ref reader, options, PropRelevantRatingThreshold, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricPrecision(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + IgnoreUnlabeled = propIgnoreUnlabeled.Value, + K = propK.Value, + RelevantRatingThreshold = propRelevantRatingThreshold.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricPrecision value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIgnoreUnlabeled, value.IgnoreUnlabeled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropK, value.K, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRelevantRatingThreshold, value.RelevantRatingThreshold, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricPrecision.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricPrecision.g.cs index 7155241a46c..ae6004ae5a7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricPrecision.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricPrecision.g.cs @@ -23,70 +23,13 @@ namespace Elastic.Clients.Elasticsearch.Core.RankEval; -internal sealed partial class RankEvalMetricPrecisionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnlabeled = System.Text.Json.JsonEncodedText.Encode("ignore_unlabeled"); - private static readonly System.Text.Json.JsonEncodedText PropK = System.Text.Json.JsonEncodedText.Encode("k"); - private static readonly System.Text.Json.JsonEncodedText PropRelevantRatingThreshold = System.Text.Json.JsonEncodedText.Encode("relevant_rating_threshold"); - - public override Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricPrecision Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIgnoreUnlabeled = default; - LocalJsonValue propK = default; - LocalJsonValue propRelevantRatingThreshold = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIgnoreUnlabeled.TryReadProperty(ref reader, options, PropIgnoreUnlabeled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propK.TryReadProperty(ref reader, options, PropK, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRelevantRatingThreshold.TryReadProperty(ref reader, options, PropRelevantRatingThreshold, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricPrecision(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - IgnoreUnlabeled = propIgnoreUnlabeled.Value, - K = propK.Value, - RelevantRatingThreshold = propRelevantRatingThreshold.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricPrecision value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIgnoreUnlabeled, value.IgnoreUnlabeled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropK, value.K, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRelevantRatingThreshold, value.RelevantRatingThreshold, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Precision at K (P@k) /// /// Learn more about this API in the Elasticsearch documentation. /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricPrecisionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.Json.RankEvalMetricPrecisionConverter))] public sealed partial class RankEvalMetricPrecision { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricRecall.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricRecall.Converters.g.cs new file mode 100644 index 00000000000..9581567dfb8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricRecall.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.RankEval.Json; + +public sealed partial class RankEvalMetricRecallConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropK = System.Text.Json.JsonEncodedText.Encode("k"); + private static readonly System.Text.Json.JsonEncodedText PropRelevantRatingThreshold = System.Text.Json.JsonEncodedText.Encode("relevant_rating_threshold"); + + public override Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricRecall Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propK = default; + LocalJsonValue propRelevantRatingThreshold = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propK.TryReadProperty(ref reader, options, PropK, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRelevantRatingThreshold.TryReadProperty(ref reader, options, PropRelevantRatingThreshold, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricRecall(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + K = propK.Value, + RelevantRatingThreshold = propRelevantRatingThreshold.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricRecall value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropK, value.K, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRelevantRatingThreshold, value.RelevantRatingThreshold, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricRecall.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricRecall.g.cs index 27c9556761f..656ab8e73d6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricRecall.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalMetricRecall.g.cs @@ -23,61 +23,13 @@ namespace Elastic.Clients.Elasticsearch.Core.RankEval; -internal sealed partial class RankEvalMetricRecallConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropK = System.Text.Json.JsonEncodedText.Encode("k"); - private static readonly System.Text.Json.JsonEncodedText PropRelevantRatingThreshold = System.Text.Json.JsonEncodedText.Encode("relevant_rating_threshold"); - - public override Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricRecall Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propK = default; - LocalJsonValue propRelevantRatingThreshold = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propK.TryReadProperty(ref reader, options, PropK, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRelevantRatingThreshold.TryReadProperty(ref reader, options, PropRelevantRatingThreshold, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricRecall(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - K = propK.Value, - RelevantRatingThreshold = propRelevantRatingThreshold.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricRecall value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropK, value.K, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRelevantRatingThreshold, value.RelevantRatingThreshold, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Recall at K (R@k) /// /// Learn more about this API in the Elasticsearch documentation. /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalMetricRecallConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.Json.RankEvalMetricRecallConverter))] public sealed partial class RankEvalMetricRecall { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalQuery.Converters.g.cs new file mode 100644 index 00000000000..72a043c57e7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalQuery.Converters.g.cs @@ -0,0 +1,79 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.RankEval.Json; + +public sealed partial class RankEvalQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + + public override Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var readerSnapshot = reader; + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propQuery = default; + LocalJsonValue propSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + try + { + reader = readerSnapshot; + var result = reader.ReadValue(options, null); + return new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Query = result + }; + } + catch (System.Text.Json.JsonException) + { + throw; + } + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Query = propQuery.Value, + Size = propSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalQuery.g.cs index afeaaaf0b46..fb47bf9c838 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalQuery.g.cs @@ -23,62 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.RankEval; -internal sealed partial class RankEvalQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - - public override Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var readerSnapshot = reader; - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propQuery = default; - LocalJsonValue propSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - try - { - reader = readerSnapshot; - var result = reader.ReadValue(options, null); - return new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Query = result - }; - } - catch (System.Text.Json.JsonException) - { - throw; - } - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Query = propQuery.Value, - Size = propSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.Json.RankEvalQueryConverter))] public sealed partial class RankEvalQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalRequestItem.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalRequestItem.Converters.g.cs new file mode 100644 index 00000000000..649f6807638 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalRequestItem.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.RankEval.Json; + +public sealed partial class RankEvalRequestItemConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); + private static readonly System.Text.Json.JsonEncodedText PropRatings = System.Text.Json.JsonEncodedText.Encode("ratings"); + private static readonly System.Text.Json.JsonEncodedText PropRequest = System.Text.Json.JsonEncodedText.Encode("request"); + private static readonly System.Text.Json.JsonEncodedText PropTemplateId = System.Text.Json.JsonEncodedText.Encode("template_id"); + + public override Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalRequestItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue?> propParams = default; + LocalJsonValue> propRatings = default; + LocalJsonValue propRequest = default; + LocalJsonValue propTemplateId = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propRatings.TryReadProperty(ref reader, options, PropRatings, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propRequest.TryReadProperty(ref reader, options, PropRequest, null)) + { + continue; + } + + if (propTemplateId.TryReadProperty(ref reader, options, PropTemplateId, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalRequestItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + Params = propParams.Value, + Ratings = propRatings.Value, + Request = propRequest.Value, + TemplateId = propTemplateId.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalRequestItem value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropRatings, value.Ratings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRequest, value.Request, null, null); + writer.WriteProperty(options, PropTemplateId, value.TemplateId, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalRequestItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalRequestItem.g.cs index beb946981e8..9fb027697bb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalRequestItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/RankEvalRequestItem.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.RankEval; -internal sealed partial class RankEvalRequestItemConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); - private static readonly System.Text.Json.JsonEncodedText PropRatings = System.Text.Json.JsonEncodedText.Encode("ratings"); - private static readonly System.Text.Json.JsonEncodedText PropRequest = System.Text.Json.JsonEncodedText.Encode("request"); - private static readonly System.Text.Json.JsonEncodedText PropTemplateId = System.Text.Json.JsonEncodedText.Encode("template_id"); - - public override Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalRequestItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue?> propParams = default; - LocalJsonValue> propRatings = default; - LocalJsonValue propRequest = default; - LocalJsonValue propTemplateId = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propRatings.TryReadProperty(ref reader, options, PropRatings, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propRequest.TryReadProperty(ref reader, options, PropRequest, null)) - { - continue; - } - - if (propTemplateId.TryReadProperty(ref reader, options, PropTemplateId, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalRequestItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - Params = propParams.Value, - Ratings = propRatings.Value, - Request = propRequest.Value, - TemplateId = propTemplateId.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalRequestItem value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropRatings, value.Ratings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRequest, value.Request, null, null); - writer.WriteProperty(options, PropTemplateId, value.TemplateId, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.RankEvalRequestItemConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.Json.RankEvalRequestItemConverter))] public sealed partial class RankEvalRequestItem { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/UnratedDocument.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/UnratedDocument.Converters.g.cs new file mode 100644 index 00000000000..13f5ee9a770 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/UnratedDocument.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.RankEval.Json; + +public sealed partial class UnratedDocumentConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); + + public override Elastic.Clients.Elasticsearch.Core.RankEval.UnratedDocument Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.RankEval.UnratedDocument(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + Index = propIndex.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.RankEval.UnratedDocument value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/UnratedDocument.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/UnratedDocument.g.cs index ac338edd823..da84d0bcea8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/UnratedDocument.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/RankEval/UnratedDocument.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.RankEval; -internal sealed partial class UnratedDocumentConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); - - public override Elastic.Clients.Elasticsearch.Core.RankEval.UnratedDocument Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.RankEval.UnratedDocument(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - Index = propIndex.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.RankEval.UnratedDocument value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.UnratedDocumentConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.RankEval.Json.UnratedDocumentConverter))] public sealed partial class UnratedDocument { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Destination.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Destination.Converters.g.cs new file mode 100644 index 00000000000..a94dea9506f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Destination.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Reindex.Json; + +public sealed partial class DestinationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropOpType = System.Text.Json.JsonEncodedText.Encode("op_type"); + private static readonly System.Text.Json.JsonEncodedText PropPipeline = System.Text.Json.JsonEncodedText.Encode("pipeline"); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); + private static readonly System.Text.Json.JsonEncodedText PropVersionType = System.Text.Json.JsonEncodedText.Encode("version_type"); + + public override Elastic.Clients.Elasticsearch.Core.Reindex.Destination Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndex = default; + LocalJsonValue propOpType = default; + LocalJsonValue propPipeline = default; + LocalJsonValue propRouting = default; + LocalJsonValue propVersionType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propOpType.TryReadProperty(ref reader, options, PropOpType, static Elastic.Clients.Elasticsearch.OpType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPipeline.TryReadProperty(ref reader, options, PropPipeline, null)) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (propVersionType.TryReadProperty(ref reader, options, PropVersionType, static Elastic.Clients.Elasticsearch.VersionType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Reindex.Destination(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Index = propIndex.Value, + OpType = propOpType.Value, + Pipeline = propPipeline.Value, + Routing = propRouting.Value, + VersionType = propVersionType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Reindex.Destination value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropOpType, value.OpType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.OpType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPipeline, value.Pipeline, null, null); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteProperty(options, PropVersionType, value.VersionType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.VersionType? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Destination.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Destination.g.cs index 9d22f8a6aa4..1b52bedbaa8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Destination.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Destination.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Reindex; -internal sealed partial class DestinationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropOpType = System.Text.Json.JsonEncodedText.Encode("op_type"); - private static readonly System.Text.Json.JsonEncodedText PropPipeline = System.Text.Json.JsonEncodedText.Encode("pipeline"); - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); - private static readonly System.Text.Json.JsonEncodedText PropVersionType = System.Text.Json.JsonEncodedText.Encode("version_type"); - - public override Elastic.Clients.Elasticsearch.Core.Reindex.Destination Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndex = default; - LocalJsonValue propOpType = default; - LocalJsonValue propPipeline = default; - LocalJsonValue propRouting = default; - LocalJsonValue propVersionType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propOpType.TryReadProperty(ref reader, options, PropOpType, static Elastic.Clients.Elasticsearch.OpType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPipeline.TryReadProperty(ref reader, options, PropPipeline, null)) - { - continue; - } - - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (propVersionType.TryReadProperty(ref reader, options, PropVersionType, static Elastic.Clients.Elasticsearch.VersionType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Reindex.Destination(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Index = propIndex.Value, - OpType = propOpType.Value, - Pipeline = propPipeline.Value, - Routing = propRouting.Value, - VersionType = propVersionType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Reindex.Destination value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropOpType, value.OpType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.OpType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPipeline, value.Pipeline, null, null); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteProperty(options, PropVersionType, value.VersionType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.VersionType? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Reindex.DestinationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Reindex.Json.DestinationConverter))] public sealed partial class Destination { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/RemoteSource.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/RemoteSource.Converters.g.cs new file mode 100644 index 00000000000..113232b3b57 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/RemoteSource.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Reindex.Json; + +public sealed partial class RemoteSourceConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropConnectTimeout = System.Text.Json.JsonEncodedText.Encode("connect_timeout"); + private static readonly System.Text.Json.JsonEncodedText PropHeaders = System.Text.Json.JsonEncodedText.Encode("headers"); + private static readonly System.Text.Json.JsonEncodedText PropHost = System.Text.Json.JsonEncodedText.Encode("host"); + private static readonly System.Text.Json.JsonEncodedText PropPassword = System.Text.Json.JsonEncodedText.Encode("password"); + private static readonly System.Text.Json.JsonEncodedText PropSocketTimeout = System.Text.Json.JsonEncodedText.Encode("socket_timeout"); + private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); + + public override Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSource Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propConnectTimeout = default; + LocalJsonValue?> propHeaders = default; + LocalJsonValue propHost = default; + LocalJsonValue propPassword = default; + LocalJsonValue propSocketTimeout = default; + LocalJsonValue propUsername = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propConnectTimeout.TryReadProperty(ref reader, options, PropConnectTimeout, null)) + { + continue; + } + + if (propHeaders.TryReadProperty(ref reader, options, PropHeaders, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propHost.TryReadProperty(ref reader, options, PropHost, null)) + { + continue; + } + + if (propPassword.TryReadProperty(ref reader, options, PropPassword, null)) + { + continue; + } + + if (propSocketTimeout.TryReadProperty(ref reader, options, PropSocketTimeout, null)) + { + continue; + } + + if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSource(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ConnectTimeout = propConnectTimeout.Value, + Headers = propHeaders.Value, + Host = propHost.Value, + Password = propPassword.Value, + SocketTimeout = propSocketTimeout.Value, + Username = propUsername.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSource value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropConnectTimeout, value.ConnectTimeout, null, null); + writer.WriteProperty(options, PropHeaders, value.Headers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropHost, value.Host, null, null); + writer.WriteProperty(options, PropPassword, value.Password, null, null); + writer.WriteProperty(options, PropSocketTimeout, value.SocketTimeout, null, null); + writer.WriteProperty(options, PropUsername, value.Username, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/RemoteSource.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/RemoteSource.g.cs index 892b356b8fc..374eee32d51 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/RemoteSource.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/RemoteSource.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Reindex; -internal sealed partial class RemoteSourceConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropConnectTimeout = System.Text.Json.JsonEncodedText.Encode("connect_timeout"); - private static readonly System.Text.Json.JsonEncodedText PropHeaders = System.Text.Json.JsonEncodedText.Encode("headers"); - private static readonly System.Text.Json.JsonEncodedText PropHost = System.Text.Json.JsonEncodedText.Encode("host"); - private static readonly System.Text.Json.JsonEncodedText PropPassword = System.Text.Json.JsonEncodedText.Encode("password"); - private static readonly System.Text.Json.JsonEncodedText PropSocketTimeout = System.Text.Json.JsonEncodedText.Encode("socket_timeout"); - private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); - - public override Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSource Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propConnectTimeout = default; - LocalJsonValue?> propHeaders = default; - LocalJsonValue propHost = default; - LocalJsonValue propPassword = default; - LocalJsonValue propSocketTimeout = default; - LocalJsonValue propUsername = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propConnectTimeout.TryReadProperty(ref reader, options, PropConnectTimeout, null)) - { - continue; - } - - if (propHeaders.TryReadProperty(ref reader, options, PropHeaders, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propHost.TryReadProperty(ref reader, options, PropHost, null)) - { - continue; - } - - if (propPassword.TryReadProperty(ref reader, options, PropPassword, null)) - { - continue; - } - - if (propSocketTimeout.TryReadProperty(ref reader, options, PropSocketTimeout, null)) - { - continue; - } - - if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSource(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ConnectTimeout = propConnectTimeout.Value, - Headers = propHeaders.Value, - Host = propHost.Value, - Password = propPassword.Value, - SocketTimeout = propSocketTimeout.Value, - Username = propUsername.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSource value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropConnectTimeout, value.ConnectTimeout, null, null); - writer.WriteProperty(options, PropHeaders, value.Headers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropHost, value.Host, null, null); - writer.WriteProperty(options, PropPassword, value.Password, null, null); - writer.WriteProperty(options, PropSocketTimeout, value.SocketTimeout, null, null); - writer.WriteProperty(options, PropUsername, value.Username, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSourceConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Reindex.Json.RemoteSourceConverter))] public sealed partial class RemoteSource { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Source.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Source.Converters.g.cs new file mode 100644 index 00000000000..2621621ea74 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Source.Converters.g.cs @@ -0,0 +1,132 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Reindex.Json; + +public sealed partial class SourceConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropRemote = System.Text.Json.JsonEncodedText.Encode("remote"); + private static readonly System.Text.Json.JsonEncodedText PropRuntimeMappings = System.Text.Json.JsonEncodedText.Encode("runtime_mappings"); + 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 PropSourceFields = System.Text.Json.JsonEncodedText.Encode("_source"); + + public override Elastic.Clients.Elasticsearch.Core.Reindex.Source Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndices = default; + LocalJsonValue propQuery = default; + LocalJsonValue propRemote = default; + LocalJsonValue?> propRuntimeMappings = default; + LocalJsonValue propSize = default; + LocalJsonValue propSlice = default; + LocalJsonValue?> propSort = default; + LocalJsonValue propSourceFields = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propRemote.TryReadProperty(ref reader, options, PropRemote, null)) + { + continue; + } + + if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSlice.TryReadProperty(ref reader, options, PropSlice, null)) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propSourceFields.TryReadProperty(ref reader, options, PropSourceFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Reindex.Source(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Indices = propIndices.Value, + Query = propQuery.Value, + Remote = propRemote.Value, + RuntimeMappings = propRuntimeMappings.Value, + Size = propSize.Value, + Slice = propSlice.Value, +#pragma warning disable CS0618 + Sort = propSort.Value +#pragma warning restore CS0618 +, + SourceFields = propSourceFields.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Reindex.Source value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndices, value.Indices, null, null); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropRemote, value.Remote, null, null); + writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSlice, value.Slice, null, null); +#pragma warning disable CS0618 + writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)) +#pragma warning restore CS0618 + ; + writer.WriteProperty(options, PropSourceFields, value.SourceFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Source.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Source.g.cs index 63ce9dfcf53..a747b1fb165 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Source.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Source.g.cs @@ -23,115 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Reindex; -internal sealed partial class SourceConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropRemote = System.Text.Json.JsonEncodedText.Encode("remote"); - private static readonly System.Text.Json.JsonEncodedText PropRuntimeMappings = System.Text.Json.JsonEncodedText.Encode("runtime_mappings"); - 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 PropSourceFields = System.Text.Json.JsonEncodedText.Encode("_source"); - - public override Elastic.Clients.Elasticsearch.Core.Reindex.Source Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndices = default; - LocalJsonValue propQuery = default; - LocalJsonValue propRemote = default; - LocalJsonValue?> propRuntimeMappings = default; - LocalJsonValue propSize = default; - LocalJsonValue propSlice = default; - LocalJsonValue?> propSort = default; - LocalJsonValue propSourceFields = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propRemote.TryReadProperty(ref reader, options, PropRemote, null)) - { - continue; - } - - if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSlice.TryReadProperty(ref reader, options, PropSlice, null)) - { - continue; - } - - if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propSourceFields.TryReadProperty(ref reader, options, PropSourceFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Reindex.Source(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Indices = propIndices.Value, - Query = propQuery.Value, - Remote = propRemote.Value, - RuntimeMappings = propRuntimeMappings.Value, - Size = propSize.Value, - Slice = propSlice.Value, -#pragma warning disable CS0618 - Sort = propSort.Value -#pragma warning restore CS0618 -, - SourceFields = propSourceFields.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Reindex.Source value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndices, value.Indices, null, null); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropRemote, value.Remote, null, null); - writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSlice, value.Slice, null, null); -#pragma warning disable CS0618 - writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)) -#pragma warning restore CS0618 - ; - writer.WriteProperty(options, PropSourceFields, value.SourceFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Reindex.SourceConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Reindex.Json.SourceConverter))] public sealed partial class Source { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexNode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexNode.Converters.g.cs new file mode 100644 index 00000000000..097fc99c761 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexNode.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.Json; + +public sealed partial class ReindexNodeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); + private static readonly System.Text.Json.JsonEncodedText PropHost = System.Text.Json.JsonEncodedText.Encode("host"); + private static readonly System.Text.Json.JsonEncodedText PropIp = System.Text.Json.JsonEncodedText.Encode("ip"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + private static readonly System.Text.Json.JsonEncodedText PropTasks = System.Text.Json.JsonEncodedText.Encode("tasks"); + private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); + + public override Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexNode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propAttributes = default; + LocalJsonValue propHost = default; + LocalJsonValue propIp = default; + LocalJsonValue propName = default; + LocalJsonValue?> propRoles = default; + LocalJsonValue> propTasks = default; + LocalJsonValue propTransportAddress = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propHost.TryReadProperty(ref reader, options, PropHost, null)) + { + continue; + } + + if (propIp.TryReadProperty(ref reader, options, PropIp, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTasks.TryReadProperty(ref reader, options, PropTasks, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexNode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Attributes = propAttributes.Value, + Host = propHost.Value, + Ip = propIp.Value, + Name = propName.Value, + Roles = propRoles.Value, + Tasks = propTasks.Value, + TransportAddress = propTransportAddress.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexNode value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropHost, value.Host, null, null); + writer.WriteProperty(options, PropIp, value.Ip, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTasks, value.Tasks, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexNode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexNode.g.cs index 085506fdc73..ac4d5365c3a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexNode.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexNode.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.ReindexRethrottle; -internal sealed partial class ReindexNodeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); - private static readonly System.Text.Json.JsonEncodedText PropHost = System.Text.Json.JsonEncodedText.Encode("host"); - private static readonly System.Text.Json.JsonEncodedText PropIp = System.Text.Json.JsonEncodedText.Encode("ip"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); - private static readonly System.Text.Json.JsonEncodedText PropTasks = System.Text.Json.JsonEncodedText.Encode("tasks"); - private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); - - public override Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexNode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propAttributes = default; - LocalJsonValue propHost = default; - LocalJsonValue propIp = default; - LocalJsonValue propName = default; - LocalJsonValue?> propRoles = default; - LocalJsonValue> propTasks = default; - LocalJsonValue propTransportAddress = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propHost.TryReadProperty(ref reader, options, PropHost, null)) - { - continue; - } - - if (propIp.TryReadProperty(ref reader, options, PropIp, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTasks.TryReadProperty(ref reader, options, PropTasks, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexNode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Attributes = propAttributes.Value, - Host = propHost.Value, - Ip = propIp.Value, - Name = propName.Value, - Roles = propRoles.Value, - Tasks = propTasks.Value, - TransportAddress = propTransportAddress.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexNode value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropHost, value.Host, null, null); - writer.WriteProperty(options, PropIp, value.Ip, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTasks, value.Tasks, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexNodeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.Json.ReindexNodeConverter))] public sealed partial class ReindexNode { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexStatus.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexStatus.Converters.g.cs new file mode 100644 index 00000000000..08d29bdb7b9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexStatus.Converters.g.cs @@ -0,0 +1,171 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.Json; + +public sealed partial class ReindexStatusConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBatches = System.Text.Json.JsonEncodedText.Encode("batches"); + private static readonly System.Text.Json.JsonEncodedText PropCreated = System.Text.Json.JsonEncodedText.Encode("created"); + private static readonly System.Text.Json.JsonEncodedText PropDeleted = System.Text.Json.JsonEncodedText.Encode("deleted"); + private static readonly System.Text.Json.JsonEncodedText PropNoops = System.Text.Json.JsonEncodedText.Encode("noops"); + private static readonly System.Text.Json.JsonEncodedText PropRequestsPerSecond = System.Text.Json.JsonEncodedText.Encode("requests_per_second"); + private static readonly System.Text.Json.JsonEncodedText PropRetries = System.Text.Json.JsonEncodedText.Encode("retries"); + private static readonly System.Text.Json.JsonEncodedText PropThrottled = System.Text.Json.JsonEncodedText.Encode("throttled"); + private static readonly System.Text.Json.JsonEncodedText PropThrottledMillis = System.Text.Json.JsonEncodedText.Encode("throttled_millis"); + private static readonly System.Text.Json.JsonEncodedText PropThrottledUntil = System.Text.Json.JsonEncodedText.Encode("throttled_until"); + private static readonly System.Text.Json.JsonEncodedText PropThrottledUntilMillis = System.Text.Json.JsonEncodedText.Encode("throttled_until_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + private static readonly System.Text.Json.JsonEncodedText PropUpdated = System.Text.Json.JsonEncodedText.Encode("updated"); + private static readonly System.Text.Json.JsonEncodedText PropVersionConflicts = System.Text.Json.JsonEncodedText.Encode("version_conflicts"); + + public override Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBatches = default; + LocalJsonValue propCreated = default; + LocalJsonValue propDeleted = default; + LocalJsonValue propNoops = default; + LocalJsonValue propRequestsPerSecond = default; + LocalJsonValue propRetries = default; + LocalJsonValue propThrottled = default; + LocalJsonValue propThrottledMillis = default; + LocalJsonValue propThrottledUntil = default; + LocalJsonValue propThrottledUntilMillis = default; + LocalJsonValue propTotal = default; + LocalJsonValue propUpdated = default; + LocalJsonValue propVersionConflicts = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBatches.TryReadProperty(ref reader, options, PropBatches, null)) + { + continue; + } + + if (propCreated.TryReadProperty(ref reader, options, PropCreated, null)) + { + continue; + } + + if (propDeleted.TryReadProperty(ref reader, options, PropDeleted, null)) + { + continue; + } + + if (propNoops.TryReadProperty(ref reader, options, PropNoops, null)) + { + continue; + } + + if (propRequestsPerSecond.TryReadProperty(ref reader, options, PropRequestsPerSecond, null)) + { + continue; + } + + if (propRetries.TryReadProperty(ref reader, options, PropRetries, null)) + { + continue; + } + + if (propThrottled.TryReadProperty(ref reader, options, PropThrottled, null)) + { + continue; + } + + if (propThrottledMillis.TryReadProperty(ref reader, options, PropThrottledMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propThrottledUntil.TryReadProperty(ref reader, options, PropThrottledUntil, null)) + { + continue; + } + + if (propThrottledUntilMillis.TryReadProperty(ref reader, options, PropThrottledUntilMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (propUpdated.TryReadProperty(ref reader, options, PropUpdated, null)) + { + continue; + } + + if (propVersionConflicts.TryReadProperty(ref reader, options, PropVersionConflicts, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Batches = propBatches.Value, + Created = propCreated.Value, + Deleted = propDeleted.Value, + Noops = propNoops.Value, + RequestsPerSecond = propRequestsPerSecond.Value, + Retries = propRetries.Value, + Throttled = propThrottled.Value, + ThrottledMillis = propThrottledMillis.Value, + ThrottledUntil = propThrottledUntil.Value, + ThrottledUntilMillis = propThrottledUntilMillis.Value, + Total = propTotal.Value, + Updated = propUpdated.Value, + VersionConflicts = propVersionConflicts.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexStatus value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBatches, value.Batches, null, null); + writer.WriteProperty(options, PropCreated, value.Created, null, null); + writer.WriteProperty(options, PropDeleted, value.Deleted, null, null); + writer.WriteProperty(options, PropNoops, value.Noops, null, null); + writer.WriteProperty(options, PropRequestsPerSecond, value.RequestsPerSecond, null, null); + writer.WriteProperty(options, PropRetries, value.Retries, null, null); + writer.WriteProperty(options, PropThrottled, value.Throttled, null, null); + writer.WriteProperty(options, PropThrottledMillis, value.ThrottledMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropThrottledUntil, value.ThrottledUntil, null, null); + writer.WriteProperty(options, PropThrottledUntilMillis, value.ThrottledUntilMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteProperty(options, PropUpdated, value.Updated, null, null); + writer.WriteProperty(options, PropVersionConflicts, value.VersionConflicts, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexStatus.g.cs index 12da67be7ab..e2b25799b71 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexStatus.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexStatus.g.cs @@ -23,154 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.ReindexRethrottle; -internal sealed partial class ReindexStatusConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBatches = System.Text.Json.JsonEncodedText.Encode("batches"); - private static readonly System.Text.Json.JsonEncodedText PropCreated = System.Text.Json.JsonEncodedText.Encode("created"); - private static readonly System.Text.Json.JsonEncodedText PropDeleted = System.Text.Json.JsonEncodedText.Encode("deleted"); - private static readonly System.Text.Json.JsonEncodedText PropNoops = System.Text.Json.JsonEncodedText.Encode("noops"); - private static readonly System.Text.Json.JsonEncodedText PropRequestsPerSecond = System.Text.Json.JsonEncodedText.Encode("requests_per_second"); - private static readonly System.Text.Json.JsonEncodedText PropRetries = System.Text.Json.JsonEncodedText.Encode("retries"); - private static readonly System.Text.Json.JsonEncodedText PropThrottled = System.Text.Json.JsonEncodedText.Encode("throttled"); - private static readonly System.Text.Json.JsonEncodedText PropThrottledMillis = System.Text.Json.JsonEncodedText.Encode("throttled_millis"); - private static readonly System.Text.Json.JsonEncodedText PropThrottledUntil = System.Text.Json.JsonEncodedText.Encode("throttled_until"); - private static readonly System.Text.Json.JsonEncodedText PropThrottledUntilMillis = System.Text.Json.JsonEncodedText.Encode("throttled_until_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - private static readonly System.Text.Json.JsonEncodedText PropUpdated = System.Text.Json.JsonEncodedText.Encode("updated"); - private static readonly System.Text.Json.JsonEncodedText PropVersionConflicts = System.Text.Json.JsonEncodedText.Encode("version_conflicts"); - - public override Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBatches = default; - LocalJsonValue propCreated = default; - LocalJsonValue propDeleted = default; - LocalJsonValue propNoops = default; - LocalJsonValue propRequestsPerSecond = default; - LocalJsonValue propRetries = default; - LocalJsonValue propThrottled = default; - LocalJsonValue propThrottledMillis = default; - LocalJsonValue propThrottledUntil = default; - LocalJsonValue propThrottledUntilMillis = default; - LocalJsonValue propTotal = default; - LocalJsonValue propUpdated = default; - LocalJsonValue propVersionConflicts = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBatches.TryReadProperty(ref reader, options, PropBatches, null)) - { - continue; - } - - if (propCreated.TryReadProperty(ref reader, options, PropCreated, null)) - { - continue; - } - - if (propDeleted.TryReadProperty(ref reader, options, PropDeleted, null)) - { - continue; - } - - if (propNoops.TryReadProperty(ref reader, options, PropNoops, null)) - { - continue; - } - - if (propRequestsPerSecond.TryReadProperty(ref reader, options, PropRequestsPerSecond, null)) - { - continue; - } - - if (propRetries.TryReadProperty(ref reader, options, PropRetries, null)) - { - continue; - } - - if (propThrottled.TryReadProperty(ref reader, options, PropThrottled, null)) - { - continue; - } - - if (propThrottledMillis.TryReadProperty(ref reader, options, PropThrottledMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propThrottledUntil.TryReadProperty(ref reader, options, PropThrottledUntil, null)) - { - continue; - } - - if (propThrottledUntilMillis.TryReadProperty(ref reader, options, PropThrottledUntilMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (propUpdated.TryReadProperty(ref reader, options, PropUpdated, null)) - { - continue; - } - - if (propVersionConflicts.TryReadProperty(ref reader, options, PropVersionConflicts, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Batches = propBatches.Value, - Created = propCreated.Value, - Deleted = propDeleted.Value, - Noops = propNoops.Value, - RequestsPerSecond = propRequestsPerSecond.Value, - Retries = propRetries.Value, - Throttled = propThrottled.Value, - ThrottledMillis = propThrottledMillis.Value, - ThrottledUntil = propThrottledUntil.Value, - ThrottledUntilMillis = propThrottledUntilMillis.Value, - Total = propTotal.Value, - Updated = propUpdated.Value, - VersionConflicts = propVersionConflicts.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexStatus value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBatches, value.Batches, null, null); - writer.WriteProperty(options, PropCreated, value.Created, null, null); - writer.WriteProperty(options, PropDeleted, value.Deleted, null, null); - writer.WriteProperty(options, PropNoops, value.Noops, null, null); - writer.WriteProperty(options, PropRequestsPerSecond, value.RequestsPerSecond, null, null); - writer.WriteProperty(options, PropRetries, value.Retries, null, null); - writer.WriteProperty(options, PropThrottled, value.Throttled, null, null); - writer.WriteProperty(options, PropThrottledMillis, value.ThrottledMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropThrottledUntil, value.ThrottledUntil, null, null); - writer.WriteProperty(options, PropThrottledUntilMillis, value.ThrottledUntilMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteProperty(options, PropUpdated, value.Updated, null, null); - writer.WriteProperty(options, PropVersionConflicts, value.VersionConflicts, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexStatusConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.Json.ReindexStatusConverter))] public sealed partial class ReindexStatus { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexTask.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexTask.Converters.g.cs new file mode 100644 index 00000000000..4c3a716872d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexTask.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.Json; + +public sealed partial class ReindexTaskConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAction = System.Text.Json.JsonEncodedText.Encode("action"); + private static readonly System.Text.Json.JsonEncodedText PropCancellable = System.Text.Json.JsonEncodedText.Encode("cancellable"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropHeaders = System.Text.Json.JsonEncodedText.Encode("headers"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); + private static readonly System.Text.Json.JsonEncodedText PropRunningTimeInNanos = System.Text.Json.JsonEncodedText.Encode("running_time_in_nanos"); + private static readonly System.Text.Json.JsonEncodedText PropStartTimeInMillis = System.Text.Json.JsonEncodedText.Encode("start_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexTask Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAction = default; + LocalJsonValue propCancellable = default; + LocalJsonValue propDescription = default; + LocalJsonValue>> propHeaders = default; + LocalJsonValue propId = default; + LocalJsonValue propNode = default; + LocalJsonValue propRunningTimeInNanos = default; + LocalJsonValue propStartTimeInMillis = default; + LocalJsonValue propStatus = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAction.TryReadProperty(ref reader, options, PropAction, null)) + { + continue; + } + + if (propCancellable.TryReadProperty(ref reader, options, PropCancellable, null)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propHeaders.TryReadProperty(ref reader, options, PropHeaders, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)!)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propNode.TryReadProperty(ref reader, options, PropNode, null)) + { + continue; + } + + if (propRunningTimeInNanos.TryReadProperty(ref reader, options, PropRunningTimeInNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) + { + continue; + } + + if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexTask(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Action = propAction.Value, + Cancellable = propCancellable.Value, + Description = propDescription.Value, + Headers = propHeaders.Value, + Id = propId.Value, + Node = propNode.Value, + RunningTimeInNanos = propRunningTimeInNanos.Value, + StartTimeInMillis = propStartTimeInMillis.Value, + Status = propStatus.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexTask value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAction, value.Action, null, null); + writer.WriteProperty(options, PropCancellable, value.Cancellable, null, null); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropHeaders, value.Headers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropNode, value.Node, null, null); + writer.WriteProperty(options, PropRunningTimeInNanos, value.RunningTimeInNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); + writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexTask.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexTask.g.cs index a315985d922..cc283d331e1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexTask.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ReindexRethrottle/ReindexTask.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.ReindexRethrottle; -internal sealed partial class ReindexTaskConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAction = System.Text.Json.JsonEncodedText.Encode("action"); - private static readonly System.Text.Json.JsonEncodedText PropCancellable = System.Text.Json.JsonEncodedText.Encode("cancellable"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropHeaders = System.Text.Json.JsonEncodedText.Encode("headers"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); - private static readonly System.Text.Json.JsonEncodedText PropRunningTimeInNanos = System.Text.Json.JsonEncodedText.Encode("running_time_in_nanos"); - private static readonly System.Text.Json.JsonEncodedText PropStartTimeInMillis = System.Text.Json.JsonEncodedText.Encode("start_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexTask Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAction = default; - LocalJsonValue propCancellable = default; - LocalJsonValue propDescription = default; - LocalJsonValue>> propHeaders = default; - LocalJsonValue propId = default; - LocalJsonValue propNode = default; - LocalJsonValue propRunningTimeInNanos = default; - LocalJsonValue propStartTimeInMillis = default; - LocalJsonValue propStatus = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAction.TryReadProperty(ref reader, options, PropAction, null)) - { - continue; - } - - if (propCancellable.TryReadProperty(ref reader, options, PropCancellable, null)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propHeaders.TryReadProperty(ref reader, options, PropHeaders, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)!)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propNode.TryReadProperty(ref reader, options, PropNode, null)) - { - continue; - } - - if (propRunningTimeInNanos.TryReadProperty(ref reader, options, PropRunningTimeInNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) - { - continue; - } - - if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexTask(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Action = propAction.Value, - Cancellable = propCancellable.Value, - Description = propDescription.Value, - Headers = propHeaders.Value, - Id = propId.Value, - Node = propNode.Value, - RunningTimeInNanos = propRunningTimeInNanos.Value, - StartTimeInMillis = propStartTimeInMillis.Value, - Status = propStatus.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexTask value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAction, value.Action, null, null); - writer.WriteProperty(options, PropCancellable, value.Cancellable, null, null); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropHeaders, value.Headers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropNode, value.Node, null, null); - writer.WriteProperty(options, PropRunningTimeInNanos, value.RunningTimeInNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); - writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.ReindexTaskConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.ReindexRethrottle.Json.ReindexTaskConverter))] public sealed partial class ReindexTask { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.ScriptsPainlessExecute.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ScriptsPainlessExecute/PainlessContext.Converters.g.cs similarity index 76% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.ScriptsPainlessExecute.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ScriptsPainlessExecute/PainlessContext.Converters.g.cs index 537aae5da01..5dbf789e310 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.ScriptsPainlessExecute.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ScriptsPainlessExecute/PainlessContext.Converters.g.cs @@ -21,9 +21,9 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute; +namespace Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.Json; -internal sealed partial class PainlessContextConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class PainlessContextConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText MemberBooleanField = System.Text.Json.JsonEncodedText.Encode("boolean_field"); private static readonly System.Text.Json.JsonEncodedText MemberCompositeField = System.Text.Json.JsonEncodedText.Encode("composite_field"); @@ -204,86 +204,4 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, { Write(writer, value, options); } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.PainlessContextConverter))] -public enum PainlessContext -{ - /// - /// - /// The context for boolean fields. The script returns a true or false response. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "boolean_field")] - BooleanField, - /// - /// - /// The context for composite runtime fields. The script returns a map of values. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "composite_field")] - CompositeField, - /// - /// - /// The context for date fields. emit takes a long value and the script returns a sorted list of dates. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "date_field")] - DateField, - /// - /// - /// The context for double numeric fields. The script returns a sorted list of double values. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "double_field")] - DoubleField, - /// - /// - /// Treats scripts as if they were run inside a script query. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "filter")] - Filter, - /// - /// - /// The context for geo-point fields. emit takes two double parameters, the latitude and longitude values, and the script returns an object in GeoJSON format containing the coordinates for the geo point. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "geo_point_field")] - GeoPointField, - /// - /// - /// The context for ip fields. The script returns a sorted list of IP addresses. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "ip_field")] - IpField, - /// - /// - /// The context for keyword fields. The script returns a sorted list of string values. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "keyword_field")] - KeywordField, - /// - /// - /// The context for long numeric fields. The script returns a sorted list of long values. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "long_field")] - LongField, - /// - /// - /// The default context if no other context is specified. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "painless_test")] - PainlessTest, - /// - /// - /// Treats scripts as if they were run inside a script_score function in a function_score query. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "score")] - Score } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ScriptsPainlessExecute/PainlessContext.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ScriptsPainlessExecute/PainlessContext.g.cs new file mode 100644 index 00000000000..919aab2af35 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ScriptsPainlessExecute/PainlessContext.g.cs @@ -0,0 +1,106 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.Json.PainlessContextConverter))] +public enum PainlessContext +{ + /// + /// + /// The context for boolean fields. The script returns a true or false response. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "boolean_field")] + BooleanField, + /// + /// + /// The context for composite runtime fields. The script returns a map of values. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "composite_field")] + CompositeField, + /// + /// + /// The context for date fields. emit takes a long value and the script returns a sorted list of dates. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "date_field")] + DateField, + /// + /// + /// The context for double numeric fields. The script returns a sorted list of double values. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "double_field")] + DoubleField, + /// + /// + /// Treats scripts as if they were run inside a script query. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "filter")] + Filter, + /// + /// + /// The context for geo-point fields. emit takes two double parameters, the latitude and longitude values, and the script returns an object in GeoJSON format containing the coordinates for the geo point. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "geo_point_field")] + GeoPointField, + /// + /// + /// The context for ip fields. The script returns a sorted list of IP addresses. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "ip_field")] + IpField, + /// + /// + /// The context for keyword fields. The script returns a sorted list of string values. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "keyword_field")] + KeywordField, + /// + /// + /// The context for long numeric fields. The script returns a sorted list of long values. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "long_field")] + LongField, + /// + /// + /// The default context if no other context is specified. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "painless_test")] + PainlessTest, + /// + /// + /// Treats scripts as if they were run inside a script_score function in a function_score query. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "score")] + Score +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ScriptsPainlessExecute/PainlessContextSetup.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ScriptsPainlessExecute/PainlessContextSetup.Converters.g.cs new file mode 100644 index 00000000000..625a4d3f4eb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ScriptsPainlessExecute/PainlessContextSetup.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.Json; + +public sealed partial class PainlessContextSetupConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocument = System.Text.Json.JsonEncodedText.Encode("document"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + + public override Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.PainlessContextSetup Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDocument = default; + LocalJsonValue propIndex = default; + LocalJsonValue propQuery = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocument.TryReadProperty(ref reader, options, PropDocument, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.PainlessContextSetup(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Document = propDocument.Value, + Index = propIndex.Value, + Query = propQuery.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.PainlessContextSetup value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocument, value.Document, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ScriptsPainlessExecute/PainlessContextSetup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ScriptsPainlessExecute/PainlessContextSetup.g.cs index 94982c99673..fa6cf786642 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ScriptsPainlessExecute/PainlessContextSetup.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/ScriptsPainlessExecute/PainlessContextSetup.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute; -internal sealed partial class PainlessContextSetupConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocument = System.Text.Json.JsonEncodedText.Encode("document"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - - public override Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.PainlessContextSetup Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDocument = default; - LocalJsonValue propIndex = default; - LocalJsonValue propQuery = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocument.TryReadProperty(ref reader, options, PropDocument, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.PainlessContextSetup(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Document = propDocument.Value, - Index = propIndex.Value, - Query = propQuery.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.PainlessContextSetup value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocument, value.Document, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.PainlessContextSetupConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.ScriptsPainlessExecute.Json.PainlessContextSetupConverter))] public sealed partial class PainlessContextSetup { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationBreakdown.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationBreakdown.Converters.g.cs new file mode 100644 index 00000000000..09bf068ea33 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationBreakdown.Converters.g.cs @@ -0,0 +1,162 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class AggregationBreakdownConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuildAggregation = System.Text.Json.JsonEncodedText.Encode("build_aggregation"); + private static readonly System.Text.Json.JsonEncodedText PropBuildAggregationCount = System.Text.Json.JsonEncodedText.Encode("build_aggregation_count"); + private static readonly System.Text.Json.JsonEncodedText PropBuildLeafCollector = System.Text.Json.JsonEncodedText.Encode("build_leaf_collector"); + private static readonly System.Text.Json.JsonEncodedText PropBuildLeafCollectorCount = System.Text.Json.JsonEncodedText.Encode("build_leaf_collector_count"); + private static readonly System.Text.Json.JsonEncodedText PropCollect = System.Text.Json.JsonEncodedText.Encode("collect"); + private static readonly System.Text.Json.JsonEncodedText PropCollectCount = System.Text.Json.JsonEncodedText.Encode("collect_count"); + private static readonly System.Text.Json.JsonEncodedText PropInitialize = System.Text.Json.JsonEncodedText.Encode("initialize"); + private static readonly System.Text.Json.JsonEncodedText PropInitializeCount = System.Text.Json.JsonEncodedText.Encode("initialize_count"); + private static readonly System.Text.Json.JsonEncodedText PropPostCollection = System.Text.Json.JsonEncodedText.Encode("post_collection"); + private static readonly System.Text.Json.JsonEncodedText PropPostCollectionCount = System.Text.Json.JsonEncodedText.Encode("post_collection_count"); + private static readonly System.Text.Json.JsonEncodedText PropReduce = System.Text.Json.JsonEncodedText.Encode("reduce"); + private static readonly System.Text.Json.JsonEncodedText PropReduceCount = System.Text.Json.JsonEncodedText.Encode("reduce_count"); + + public override Elastic.Clients.Elasticsearch.Core.Search.AggregationBreakdown Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBuildAggregation = default; + LocalJsonValue propBuildAggregationCount = default; + LocalJsonValue propBuildLeafCollector = default; + LocalJsonValue propBuildLeafCollectorCount = default; + LocalJsonValue propCollect = default; + LocalJsonValue propCollectCount = default; + LocalJsonValue propInitialize = default; + LocalJsonValue propInitializeCount = default; + LocalJsonValue propPostCollection = default; + LocalJsonValue propPostCollectionCount = default; + LocalJsonValue propReduce = default; + LocalJsonValue propReduceCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuildAggregation.TryReadProperty(ref reader, options, PropBuildAggregation, null)) + { + continue; + } + + if (propBuildAggregationCount.TryReadProperty(ref reader, options, PropBuildAggregationCount, null)) + { + continue; + } + + if (propBuildLeafCollector.TryReadProperty(ref reader, options, PropBuildLeafCollector, null)) + { + continue; + } + + if (propBuildLeafCollectorCount.TryReadProperty(ref reader, options, PropBuildLeafCollectorCount, null)) + { + continue; + } + + if (propCollect.TryReadProperty(ref reader, options, PropCollect, null)) + { + continue; + } + + if (propCollectCount.TryReadProperty(ref reader, options, PropCollectCount, null)) + { + continue; + } + + if (propInitialize.TryReadProperty(ref reader, options, PropInitialize, null)) + { + continue; + } + + if (propInitializeCount.TryReadProperty(ref reader, options, PropInitializeCount, null)) + { + continue; + } + + if (propPostCollection.TryReadProperty(ref reader, options, PropPostCollection, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPostCollectionCount.TryReadProperty(ref reader, options, PropPostCollectionCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propReduce.TryReadProperty(ref reader, options, PropReduce, null)) + { + continue; + } + + if (propReduceCount.TryReadProperty(ref reader, options, PropReduceCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.AggregationBreakdown(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BuildAggregation = propBuildAggregation.Value, + BuildAggregationCount = propBuildAggregationCount.Value, + BuildLeafCollector = propBuildLeafCollector.Value, + BuildLeafCollectorCount = propBuildLeafCollectorCount.Value, + Collect = propCollect.Value, + CollectCount = propCollectCount.Value, + Initialize = propInitialize.Value, + InitializeCount = propInitializeCount.Value, + PostCollection = propPostCollection.Value, + PostCollectionCount = propPostCollectionCount.Value, + Reduce = propReduce.Value, + ReduceCount = propReduceCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.AggregationBreakdown value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuildAggregation, value.BuildAggregation, null, null); + writer.WriteProperty(options, PropBuildAggregationCount, value.BuildAggregationCount, null, null); + writer.WriteProperty(options, PropBuildLeafCollector, value.BuildLeafCollector, null, null); + writer.WriteProperty(options, PropBuildLeafCollectorCount, value.BuildLeafCollectorCount, null, null); + writer.WriteProperty(options, PropCollect, value.Collect, null, null); + writer.WriteProperty(options, PropCollectCount, value.CollectCount, null, null); + writer.WriteProperty(options, PropInitialize, value.Initialize, null, null); + writer.WriteProperty(options, PropInitializeCount, value.InitializeCount, null, null); + writer.WriteProperty(options, PropPostCollection, value.PostCollection, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPostCollectionCount, value.PostCollectionCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropReduce, value.Reduce, null, null); + writer.WriteProperty(options, PropReduceCount, value.ReduceCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationBreakdown.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationBreakdown.g.cs index 68eb485f23b..e51de94e49f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationBreakdown.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationBreakdown.g.cs @@ -23,145 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class AggregationBreakdownConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuildAggregation = System.Text.Json.JsonEncodedText.Encode("build_aggregation"); - private static readonly System.Text.Json.JsonEncodedText PropBuildAggregationCount = System.Text.Json.JsonEncodedText.Encode("build_aggregation_count"); - private static readonly System.Text.Json.JsonEncodedText PropBuildLeafCollector = System.Text.Json.JsonEncodedText.Encode("build_leaf_collector"); - private static readonly System.Text.Json.JsonEncodedText PropBuildLeafCollectorCount = System.Text.Json.JsonEncodedText.Encode("build_leaf_collector_count"); - private static readonly System.Text.Json.JsonEncodedText PropCollect = System.Text.Json.JsonEncodedText.Encode("collect"); - private static readonly System.Text.Json.JsonEncodedText PropCollectCount = System.Text.Json.JsonEncodedText.Encode("collect_count"); - private static readonly System.Text.Json.JsonEncodedText PropInitialize = System.Text.Json.JsonEncodedText.Encode("initialize"); - private static readonly System.Text.Json.JsonEncodedText PropInitializeCount = System.Text.Json.JsonEncodedText.Encode("initialize_count"); - private static readonly System.Text.Json.JsonEncodedText PropPostCollection = System.Text.Json.JsonEncodedText.Encode("post_collection"); - private static readonly System.Text.Json.JsonEncodedText PropPostCollectionCount = System.Text.Json.JsonEncodedText.Encode("post_collection_count"); - private static readonly System.Text.Json.JsonEncodedText PropReduce = System.Text.Json.JsonEncodedText.Encode("reduce"); - private static readonly System.Text.Json.JsonEncodedText PropReduceCount = System.Text.Json.JsonEncodedText.Encode("reduce_count"); - - public override Elastic.Clients.Elasticsearch.Core.Search.AggregationBreakdown Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBuildAggregation = default; - LocalJsonValue propBuildAggregationCount = default; - LocalJsonValue propBuildLeafCollector = default; - LocalJsonValue propBuildLeafCollectorCount = default; - LocalJsonValue propCollect = default; - LocalJsonValue propCollectCount = default; - LocalJsonValue propInitialize = default; - LocalJsonValue propInitializeCount = default; - LocalJsonValue propPostCollection = default; - LocalJsonValue propPostCollectionCount = default; - LocalJsonValue propReduce = default; - LocalJsonValue propReduceCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuildAggregation.TryReadProperty(ref reader, options, PropBuildAggregation, null)) - { - continue; - } - - if (propBuildAggregationCount.TryReadProperty(ref reader, options, PropBuildAggregationCount, null)) - { - continue; - } - - if (propBuildLeafCollector.TryReadProperty(ref reader, options, PropBuildLeafCollector, null)) - { - continue; - } - - if (propBuildLeafCollectorCount.TryReadProperty(ref reader, options, PropBuildLeafCollectorCount, null)) - { - continue; - } - - if (propCollect.TryReadProperty(ref reader, options, PropCollect, null)) - { - continue; - } - - if (propCollectCount.TryReadProperty(ref reader, options, PropCollectCount, null)) - { - continue; - } - - if (propInitialize.TryReadProperty(ref reader, options, PropInitialize, null)) - { - continue; - } - - if (propInitializeCount.TryReadProperty(ref reader, options, PropInitializeCount, null)) - { - continue; - } - - if (propPostCollection.TryReadProperty(ref reader, options, PropPostCollection, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPostCollectionCount.TryReadProperty(ref reader, options, PropPostCollectionCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propReduce.TryReadProperty(ref reader, options, PropReduce, null)) - { - continue; - } - - if (propReduceCount.TryReadProperty(ref reader, options, PropReduceCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.AggregationBreakdown(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BuildAggregation = propBuildAggregation.Value, - BuildAggregationCount = propBuildAggregationCount.Value, - BuildLeafCollector = propBuildLeafCollector.Value, - BuildLeafCollectorCount = propBuildLeafCollectorCount.Value, - Collect = propCollect.Value, - CollectCount = propCollectCount.Value, - Initialize = propInitialize.Value, - InitializeCount = propInitializeCount.Value, - PostCollection = propPostCollection.Value, - PostCollectionCount = propPostCollectionCount.Value, - Reduce = propReduce.Value, - ReduceCount = propReduceCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.AggregationBreakdown value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuildAggregation, value.BuildAggregation, null, null); - writer.WriteProperty(options, PropBuildAggregationCount, value.BuildAggregationCount, null, null); - writer.WriteProperty(options, PropBuildLeafCollector, value.BuildLeafCollector, null, null); - writer.WriteProperty(options, PropBuildLeafCollectorCount, value.BuildLeafCollectorCount, null, null); - writer.WriteProperty(options, PropCollect, value.Collect, null, null); - writer.WriteProperty(options, PropCollectCount, value.CollectCount, null, null); - writer.WriteProperty(options, PropInitialize, value.Initialize, null, null); - writer.WriteProperty(options, PropInitializeCount, value.InitializeCount, null, null); - writer.WriteProperty(options, PropPostCollection, value.PostCollection, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPostCollectionCount, value.PostCollectionCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropReduce, value.Reduce, null, null); - writer.WriteProperty(options, PropReduceCount, value.ReduceCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.AggregationBreakdownConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.AggregationBreakdownConverter))] public sealed partial class AggregationBreakdown { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationProfile.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationProfile.Converters.g.cs new file mode 100644 index 00000000000..abe9b4e136c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationProfile.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class AggregationProfileConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBreakdown = System.Text.Json.JsonEncodedText.Encode("breakdown"); + private static readonly System.Text.Json.JsonEncodedText PropChildren = System.Text.Json.JsonEncodedText.Encode("children"); + private static readonly System.Text.Json.JsonEncodedText PropDebug = System.Text.Json.JsonEncodedText.Encode("debug"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropTimeInNanos = System.Text.Json.JsonEncodedText.Encode("time_in_nanos"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Core.Search.AggregationProfile Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBreakdown = default; + LocalJsonValue?> propChildren = default; + LocalJsonValue propDebug = default; + LocalJsonValue propDescription = default; + LocalJsonValue propTimeInNanos = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBreakdown.TryReadProperty(ref reader, options, PropBreakdown, null)) + { + continue; + } + + if (propChildren.TryReadProperty(ref reader, options, PropChildren, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propDebug.TryReadProperty(ref reader, options, PropDebug, null)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propTimeInNanos.TryReadProperty(ref reader, options, PropTimeInNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.AggregationProfile(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Breakdown = propBreakdown.Value, + Children = propChildren.Value, + Debug = propDebug.Value, + Description = propDescription.Value, + TimeInNanos = propTimeInNanos.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.AggregationProfile value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBreakdown, value.Breakdown, null, null); + writer.WriteProperty(options, PropChildren, value.Children, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDebug, value.Debug, null, null); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropTimeInNanos, value.TimeInNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationProfile.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationProfile.g.cs index 6c6d2066019..3a89139ba92 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationProfile.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationProfile.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class AggregationProfileConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBreakdown = System.Text.Json.JsonEncodedText.Encode("breakdown"); - private static readonly System.Text.Json.JsonEncodedText PropChildren = System.Text.Json.JsonEncodedText.Encode("children"); - private static readonly System.Text.Json.JsonEncodedText PropDebug = System.Text.Json.JsonEncodedText.Encode("debug"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropTimeInNanos = System.Text.Json.JsonEncodedText.Encode("time_in_nanos"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Core.Search.AggregationProfile Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBreakdown = default; - LocalJsonValue?> propChildren = default; - LocalJsonValue propDebug = default; - LocalJsonValue propDescription = default; - LocalJsonValue propTimeInNanos = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBreakdown.TryReadProperty(ref reader, options, PropBreakdown, null)) - { - continue; - } - - if (propChildren.TryReadProperty(ref reader, options, PropChildren, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propDebug.TryReadProperty(ref reader, options, PropDebug, null)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propTimeInNanos.TryReadProperty(ref reader, options, PropTimeInNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.AggregationProfile(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Breakdown = propBreakdown.Value, - Children = propChildren.Value, - Debug = propDebug.Value, - Description = propDescription.Value, - TimeInNanos = propTimeInNanos.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.AggregationProfile value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBreakdown, value.Breakdown, null, null); - writer.WriteProperty(options, PropChildren, value.Children, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDebug, value.Debug, null, null); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropTimeInNanos, value.TimeInNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.AggregationProfileConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.AggregationProfileConverter))] public sealed partial class AggregationProfile { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationProfileDebug.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationProfileDebug.Converters.g.cs new file mode 100644 index 00000000000..4f5e64bd46c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationProfileDebug.Converters.g.cs @@ -0,0 +1,342 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class AggregationProfileDebugConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBruteForceUsed = System.Text.Json.JsonEncodedText.Encode("brute_force_used"); + private static readonly System.Text.Json.JsonEncodedText PropBuiltBuckets = System.Text.Json.JsonEncodedText.Encode("built_buckets"); + private static readonly System.Text.Json.JsonEncodedText PropCharsFetched = System.Text.Json.JsonEncodedText.Encode("chars_fetched"); + private static readonly System.Text.Json.JsonEncodedText PropCollectAnalyzedCount = System.Text.Json.JsonEncodedText.Encode("collect_analyzed_count"); + private static readonly System.Text.Json.JsonEncodedText PropCollectAnalyzedNs = System.Text.Json.JsonEncodedText.Encode("collect_analyzed_ns"); + private static readonly System.Text.Json.JsonEncodedText PropCollectionStrategy = System.Text.Json.JsonEncodedText.Encode("collection_strategy"); + private static readonly System.Text.Json.JsonEncodedText PropDeferredAggregators = System.Text.Json.JsonEncodedText.Encode("deferred_aggregators"); + private static readonly System.Text.Json.JsonEncodedText PropDelegate = System.Text.Json.JsonEncodedText.Encode("delegate"); + private static readonly System.Text.Json.JsonEncodedText PropDelegateDebug = System.Text.Json.JsonEncodedText.Encode("delegate_debug"); + private static readonly System.Text.Json.JsonEncodedText PropDynamicPruningAttempted = System.Text.Json.JsonEncodedText.Encode("dynamic_pruning_attempted"); + private static readonly System.Text.Json.JsonEncodedText PropDynamicPruningUsed = System.Text.Json.JsonEncodedText.Encode("dynamic_pruning_used"); + private static readonly System.Text.Json.JsonEncodedText PropEmptyCollectorsUsed = System.Text.Json.JsonEncodedText.Encode("empty_collectors_used"); + private static readonly System.Text.Json.JsonEncodedText PropExtractCount = System.Text.Json.JsonEncodedText.Encode("extract_count"); + private static readonly System.Text.Json.JsonEncodedText PropExtractNs = System.Text.Json.JsonEncodedText.Encode("extract_ns"); + private static readonly System.Text.Json.JsonEncodedText PropFilters = System.Text.Json.JsonEncodedText.Encode("filters"); + private static readonly System.Text.Json.JsonEncodedText PropHasFilter = System.Text.Json.JsonEncodedText.Encode("has_filter"); + private static readonly System.Text.Json.JsonEncodedText PropMapReducer = System.Text.Json.JsonEncodedText.Encode("map_reducer"); + private static readonly System.Text.Json.JsonEncodedText PropNumericCollectorsUsed = System.Text.Json.JsonEncodedText.Encode("numeric_collectors_used"); + private static readonly System.Text.Json.JsonEncodedText PropOrdinalsCollectorsOverheadTooHigh = System.Text.Json.JsonEncodedText.Encode("ordinals_collectors_overhead_too_high"); + private static readonly System.Text.Json.JsonEncodedText PropOrdinalsCollectorsUsed = System.Text.Json.JsonEncodedText.Encode("ordinals_collectors_used"); + private static readonly System.Text.Json.JsonEncodedText PropResultStrategy = System.Text.Json.JsonEncodedText.Encode("result_strategy"); + private static readonly System.Text.Json.JsonEncodedText PropSegmentsCollected = System.Text.Json.JsonEncodedText.Encode("segments_collected"); + private static readonly System.Text.Json.JsonEncodedText PropSegmentsCounted = System.Text.Json.JsonEncodedText.Encode("segments_counted"); + private static readonly System.Text.Json.JsonEncodedText PropSegmentsWithDeletedDocs = System.Text.Json.JsonEncodedText.Encode("segments_with_deleted_docs"); + private static readonly System.Text.Json.JsonEncodedText PropSegmentsWithDocCountField = System.Text.Json.JsonEncodedText.Encode("segments_with_doc_count_field"); + private static readonly System.Text.Json.JsonEncodedText PropSegmentsWithMultiValuedOrds = System.Text.Json.JsonEncodedText.Encode("segments_with_multi_valued_ords"); + private static readonly System.Text.Json.JsonEncodedText PropSegmentsWithSingleValuedOrds = System.Text.Json.JsonEncodedText.Encode("segments_with_single_valued_ords"); + private static readonly System.Text.Json.JsonEncodedText PropSkippedDueToNoData = System.Text.Json.JsonEncodedText.Encode("skipped_due_to_no_data"); + private static readonly System.Text.Json.JsonEncodedText PropStringHashingCollectorsUsed = System.Text.Json.JsonEncodedText.Encode("string_hashing_collectors_used"); + private static readonly System.Text.Json.JsonEncodedText PropSurvivingBuckets = System.Text.Json.JsonEncodedText.Encode("surviving_buckets"); + private static readonly System.Text.Json.JsonEncodedText PropTotalBuckets = System.Text.Json.JsonEncodedText.Encode("total_buckets"); + private static readonly System.Text.Json.JsonEncodedText PropValuesFetched = System.Text.Json.JsonEncodedText.Encode("values_fetched"); + + public override Elastic.Clients.Elasticsearch.Core.Search.AggregationProfileDebug Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBruteForceUsed = default; + LocalJsonValue propBuiltBuckets = default; + LocalJsonValue propCharsFetched = default; + LocalJsonValue propCollectAnalyzedCount = default; + LocalJsonValue propCollectAnalyzedNs = default; + LocalJsonValue propCollectionStrategy = default; + LocalJsonValue?> propDeferredAggregators = default; + LocalJsonValue propDelegate = default; + LocalJsonValue propDelegateDebug = default; + LocalJsonValue propDynamicPruningAttempted = default; + LocalJsonValue propDynamicPruningUsed = default; + LocalJsonValue propEmptyCollectorsUsed = default; + LocalJsonValue propExtractCount = default; + LocalJsonValue propExtractNs = default; + LocalJsonValue?> propFilters = default; + LocalJsonValue propHasFilter = default; + LocalJsonValue propMapReducer = default; + LocalJsonValue propNumericCollectorsUsed = default; + LocalJsonValue propOrdinalsCollectorsOverheadTooHigh = default; + LocalJsonValue propOrdinalsCollectorsUsed = default; + LocalJsonValue propResultStrategy = default; + LocalJsonValue propSegmentsCollected = default; + LocalJsonValue propSegmentsCounted = default; + LocalJsonValue propSegmentsWithDeletedDocs = default; + LocalJsonValue propSegmentsWithDocCountField = default; + LocalJsonValue propSegmentsWithMultiValuedOrds = default; + LocalJsonValue propSegmentsWithSingleValuedOrds = default; + LocalJsonValue propSkippedDueToNoData = default; + LocalJsonValue propStringHashingCollectorsUsed = default; + LocalJsonValue propSurvivingBuckets = default; + LocalJsonValue propTotalBuckets = default; + LocalJsonValue propValuesFetched = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBruteForceUsed.TryReadProperty(ref reader, options, PropBruteForceUsed, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propBuiltBuckets.TryReadProperty(ref reader, options, PropBuiltBuckets, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCharsFetched.TryReadProperty(ref reader, options, PropCharsFetched, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCollectAnalyzedCount.TryReadProperty(ref reader, options, PropCollectAnalyzedCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCollectAnalyzedNs.TryReadProperty(ref reader, options, PropCollectAnalyzedNs, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCollectionStrategy.TryReadProperty(ref reader, options, PropCollectionStrategy, null)) + { + continue; + } + + if (propDeferredAggregators.TryReadProperty(ref reader, options, PropDeferredAggregators, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propDelegate.TryReadProperty(ref reader, options, PropDelegate, null)) + { + continue; + } + + if (propDelegateDebug.TryReadProperty(ref reader, options, PropDelegateDebug, null)) + { + continue; + } + + if (propDynamicPruningAttempted.TryReadProperty(ref reader, options, PropDynamicPruningAttempted, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamicPruningUsed.TryReadProperty(ref reader, options, PropDynamicPruningUsed, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEmptyCollectorsUsed.TryReadProperty(ref reader, options, PropEmptyCollectorsUsed, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propExtractCount.TryReadProperty(ref reader, options, PropExtractCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propExtractNs.TryReadProperty(ref reader, options, PropExtractNs, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFilters.TryReadProperty(ref reader, options, PropFilters, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propHasFilter.TryReadProperty(ref reader, options, PropHasFilter, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMapReducer.TryReadProperty(ref reader, options, PropMapReducer, null)) + { + continue; + } + + if (propNumericCollectorsUsed.TryReadProperty(ref reader, options, PropNumericCollectorsUsed, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOrdinalsCollectorsOverheadTooHigh.TryReadProperty(ref reader, options, PropOrdinalsCollectorsOverheadTooHigh, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOrdinalsCollectorsUsed.TryReadProperty(ref reader, options, PropOrdinalsCollectorsUsed, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propResultStrategy.TryReadProperty(ref reader, options, PropResultStrategy, null)) + { + continue; + } + + if (propSegmentsCollected.TryReadProperty(ref reader, options, PropSegmentsCollected, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSegmentsCounted.TryReadProperty(ref reader, options, PropSegmentsCounted, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSegmentsWithDeletedDocs.TryReadProperty(ref reader, options, PropSegmentsWithDeletedDocs, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSegmentsWithDocCountField.TryReadProperty(ref reader, options, PropSegmentsWithDocCountField, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSegmentsWithMultiValuedOrds.TryReadProperty(ref reader, options, PropSegmentsWithMultiValuedOrds, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSegmentsWithSingleValuedOrds.TryReadProperty(ref reader, options, PropSegmentsWithSingleValuedOrds, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSkippedDueToNoData.TryReadProperty(ref reader, options, PropSkippedDueToNoData, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propStringHashingCollectorsUsed.TryReadProperty(ref reader, options, PropStringHashingCollectorsUsed, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSurvivingBuckets.TryReadProperty(ref reader, options, PropSurvivingBuckets, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotalBuckets.TryReadProperty(ref reader, options, PropTotalBuckets, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propValuesFetched.TryReadProperty(ref reader, options, PropValuesFetched, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.AggregationProfileDebug(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BruteForceUsed = propBruteForceUsed.Value, + BuiltBuckets = propBuiltBuckets.Value, + CharsFetched = propCharsFetched.Value, + CollectAnalyzedCount = propCollectAnalyzedCount.Value, + CollectAnalyzedNs = propCollectAnalyzedNs.Value, + CollectionStrategy = propCollectionStrategy.Value, + DeferredAggregators = propDeferredAggregators.Value, + Delegate = propDelegate.Value, + DelegateDebug = propDelegateDebug.Value, + DynamicPruningAttempted = propDynamicPruningAttempted.Value, + DynamicPruningUsed = propDynamicPruningUsed.Value, + EmptyCollectorsUsed = propEmptyCollectorsUsed.Value, + ExtractCount = propExtractCount.Value, + ExtractNs = propExtractNs.Value, + Filters = propFilters.Value, + HasFilter = propHasFilter.Value, + MapReducer = propMapReducer.Value, + NumericCollectorsUsed = propNumericCollectorsUsed.Value, + OrdinalsCollectorsOverheadTooHigh = propOrdinalsCollectorsOverheadTooHigh.Value, + OrdinalsCollectorsUsed = propOrdinalsCollectorsUsed.Value, + ResultStrategy = propResultStrategy.Value, + SegmentsCollected = propSegmentsCollected.Value, + SegmentsCounted = propSegmentsCounted.Value, + SegmentsWithDeletedDocs = propSegmentsWithDeletedDocs.Value, + SegmentsWithDocCountField = propSegmentsWithDocCountField.Value, + SegmentsWithMultiValuedOrds = propSegmentsWithMultiValuedOrds.Value, + SegmentsWithSingleValuedOrds = propSegmentsWithSingleValuedOrds.Value, + SkippedDueToNoData = propSkippedDueToNoData.Value, + StringHashingCollectorsUsed = propStringHashingCollectorsUsed.Value, + SurvivingBuckets = propSurvivingBuckets.Value, + TotalBuckets = propTotalBuckets.Value, + ValuesFetched = propValuesFetched.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.AggregationProfileDebug value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBruteForceUsed, value.BruteForceUsed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropBuiltBuckets, value.BuiltBuckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCharsFetched, value.CharsFetched, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCollectAnalyzedCount, value.CollectAnalyzedCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCollectAnalyzedNs, value.CollectAnalyzedNs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCollectionStrategy, value.CollectionStrategy, null, null); + writer.WriteProperty(options, PropDeferredAggregators, value.DeferredAggregators, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDelegate, value.Delegate, null, null); + writer.WriteProperty(options, PropDelegateDebug, value.DelegateDebug, null, null); + writer.WriteProperty(options, PropDynamicPruningAttempted, value.DynamicPruningAttempted, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamicPruningUsed, value.DynamicPruningUsed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEmptyCollectorsUsed, value.EmptyCollectorsUsed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropExtractCount, value.ExtractCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropExtractNs, value.ExtractNs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFilters, value.Filters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropHasFilter, value.HasFilter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMapReducer, value.MapReducer, null, null); + writer.WriteProperty(options, PropNumericCollectorsUsed, value.NumericCollectorsUsed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOrdinalsCollectorsOverheadTooHigh, value.OrdinalsCollectorsOverheadTooHigh, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOrdinalsCollectorsUsed, value.OrdinalsCollectorsUsed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropResultStrategy, value.ResultStrategy, null, null); + writer.WriteProperty(options, PropSegmentsCollected, value.SegmentsCollected, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSegmentsCounted, value.SegmentsCounted, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSegmentsWithDeletedDocs, value.SegmentsWithDeletedDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSegmentsWithDocCountField, value.SegmentsWithDocCountField, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSegmentsWithMultiValuedOrds, value.SegmentsWithMultiValuedOrds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSegmentsWithSingleValuedOrds, value.SegmentsWithSingleValuedOrds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSkippedDueToNoData, value.SkippedDueToNoData, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropStringHashingCollectorsUsed, value.StringHashingCollectorsUsed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSurvivingBuckets, value.SurvivingBuckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotalBuckets, value.TotalBuckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropValuesFetched, value.ValuesFetched, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationProfileDebug.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationProfileDebug.g.cs index ceacda699e1..721e3afabf0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationProfileDebug.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationProfileDebug.g.cs @@ -23,325 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class AggregationProfileDebugConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBruteForceUsed = System.Text.Json.JsonEncodedText.Encode("brute_force_used"); - private static readonly System.Text.Json.JsonEncodedText PropBuiltBuckets = System.Text.Json.JsonEncodedText.Encode("built_buckets"); - private static readonly System.Text.Json.JsonEncodedText PropCharsFetched = System.Text.Json.JsonEncodedText.Encode("chars_fetched"); - private static readonly System.Text.Json.JsonEncodedText PropCollectAnalyzedCount = System.Text.Json.JsonEncodedText.Encode("collect_analyzed_count"); - private static readonly System.Text.Json.JsonEncodedText PropCollectAnalyzedNs = System.Text.Json.JsonEncodedText.Encode("collect_analyzed_ns"); - private static readonly System.Text.Json.JsonEncodedText PropCollectionStrategy = System.Text.Json.JsonEncodedText.Encode("collection_strategy"); - private static readonly System.Text.Json.JsonEncodedText PropDeferredAggregators = System.Text.Json.JsonEncodedText.Encode("deferred_aggregators"); - private static readonly System.Text.Json.JsonEncodedText PropDelegate = System.Text.Json.JsonEncodedText.Encode("delegate"); - private static readonly System.Text.Json.JsonEncodedText PropDelegateDebug = System.Text.Json.JsonEncodedText.Encode("delegate_debug"); - private static readonly System.Text.Json.JsonEncodedText PropDynamicPruningAttempted = System.Text.Json.JsonEncodedText.Encode("dynamic_pruning_attempted"); - private static readonly System.Text.Json.JsonEncodedText PropDynamicPruningUsed = System.Text.Json.JsonEncodedText.Encode("dynamic_pruning_used"); - private static readonly System.Text.Json.JsonEncodedText PropEmptyCollectorsUsed = System.Text.Json.JsonEncodedText.Encode("empty_collectors_used"); - private static readonly System.Text.Json.JsonEncodedText PropExtractCount = System.Text.Json.JsonEncodedText.Encode("extract_count"); - private static readonly System.Text.Json.JsonEncodedText PropExtractNs = System.Text.Json.JsonEncodedText.Encode("extract_ns"); - private static readonly System.Text.Json.JsonEncodedText PropFilters = System.Text.Json.JsonEncodedText.Encode("filters"); - private static readonly System.Text.Json.JsonEncodedText PropHasFilter = System.Text.Json.JsonEncodedText.Encode("has_filter"); - private static readonly System.Text.Json.JsonEncodedText PropMapReducer = System.Text.Json.JsonEncodedText.Encode("map_reducer"); - private static readonly System.Text.Json.JsonEncodedText PropNumericCollectorsUsed = System.Text.Json.JsonEncodedText.Encode("numeric_collectors_used"); - private static readonly System.Text.Json.JsonEncodedText PropOrdinalsCollectorsOverheadTooHigh = System.Text.Json.JsonEncodedText.Encode("ordinals_collectors_overhead_too_high"); - private static readonly System.Text.Json.JsonEncodedText PropOrdinalsCollectorsUsed = System.Text.Json.JsonEncodedText.Encode("ordinals_collectors_used"); - private static readonly System.Text.Json.JsonEncodedText PropResultStrategy = System.Text.Json.JsonEncodedText.Encode("result_strategy"); - private static readonly System.Text.Json.JsonEncodedText PropSegmentsCollected = System.Text.Json.JsonEncodedText.Encode("segments_collected"); - private static readonly System.Text.Json.JsonEncodedText PropSegmentsCounted = System.Text.Json.JsonEncodedText.Encode("segments_counted"); - private static readonly System.Text.Json.JsonEncodedText PropSegmentsWithDeletedDocs = System.Text.Json.JsonEncodedText.Encode("segments_with_deleted_docs"); - private static readonly System.Text.Json.JsonEncodedText PropSegmentsWithDocCountField = System.Text.Json.JsonEncodedText.Encode("segments_with_doc_count_field"); - private static readonly System.Text.Json.JsonEncodedText PropSegmentsWithMultiValuedOrds = System.Text.Json.JsonEncodedText.Encode("segments_with_multi_valued_ords"); - private static readonly System.Text.Json.JsonEncodedText PropSegmentsWithSingleValuedOrds = System.Text.Json.JsonEncodedText.Encode("segments_with_single_valued_ords"); - private static readonly System.Text.Json.JsonEncodedText PropSkippedDueToNoData = System.Text.Json.JsonEncodedText.Encode("skipped_due_to_no_data"); - private static readonly System.Text.Json.JsonEncodedText PropStringHashingCollectorsUsed = System.Text.Json.JsonEncodedText.Encode("string_hashing_collectors_used"); - private static readonly System.Text.Json.JsonEncodedText PropSurvivingBuckets = System.Text.Json.JsonEncodedText.Encode("surviving_buckets"); - private static readonly System.Text.Json.JsonEncodedText PropTotalBuckets = System.Text.Json.JsonEncodedText.Encode("total_buckets"); - private static readonly System.Text.Json.JsonEncodedText PropValuesFetched = System.Text.Json.JsonEncodedText.Encode("values_fetched"); - - public override Elastic.Clients.Elasticsearch.Core.Search.AggregationProfileDebug Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBruteForceUsed = default; - LocalJsonValue propBuiltBuckets = default; - LocalJsonValue propCharsFetched = default; - LocalJsonValue propCollectAnalyzedCount = default; - LocalJsonValue propCollectAnalyzedNs = default; - LocalJsonValue propCollectionStrategy = default; - LocalJsonValue?> propDeferredAggregators = default; - LocalJsonValue propDelegate = default; - LocalJsonValue propDelegateDebug = default; - LocalJsonValue propDynamicPruningAttempted = default; - LocalJsonValue propDynamicPruningUsed = default; - LocalJsonValue propEmptyCollectorsUsed = default; - LocalJsonValue propExtractCount = default; - LocalJsonValue propExtractNs = default; - LocalJsonValue?> propFilters = default; - LocalJsonValue propHasFilter = default; - LocalJsonValue propMapReducer = default; - LocalJsonValue propNumericCollectorsUsed = default; - LocalJsonValue propOrdinalsCollectorsOverheadTooHigh = default; - LocalJsonValue propOrdinalsCollectorsUsed = default; - LocalJsonValue propResultStrategy = default; - LocalJsonValue propSegmentsCollected = default; - LocalJsonValue propSegmentsCounted = default; - LocalJsonValue propSegmentsWithDeletedDocs = default; - LocalJsonValue propSegmentsWithDocCountField = default; - LocalJsonValue propSegmentsWithMultiValuedOrds = default; - LocalJsonValue propSegmentsWithSingleValuedOrds = default; - LocalJsonValue propSkippedDueToNoData = default; - LocalJsonValue propStringHashingCollectorsUsed = default; - LocalJsonValue propSurvivingBuckets = default; - LocalJsonValue propTotalBuckets = default; - LocalJsonValue propValuesFetched = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBruteForceUsed.TryReadProperty(ref reader, options, PropBruteForceUsed, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propBuiltBuckets.TryReadProperty(ref reader, options, PropBuiltBuckets, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCharsFetched.TryReadProperty(ref reader, options, PropCharsFetched, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCollectAnalyzedCount.TryReadProperty(ref reader, options, PropCollectAnalyzedCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCollectAnalyzedNs.TryReadProperty(ref reader, options, PropCollectAnalyzedNs, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCollectionStrategy.TryReadProperty(ref reader, options, PropCollectionStrategy, null)) - { - continue; - } - - if (propDeferredAggregators.TryReadProperty(ref reader, options, PropDeferredAggregators, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propDelegate.TryReadProperty(ref reader, options, PropDelegate, null)) - { - continue; - } - - if (propDelegateDebug.TryReadProperty(ref reader, options, PropDelegateDebug, null)) - { - continue; - } - - if (propDynamicPruningAttempted.TryReadProperty(ref reader, options, PropDynamicPruningAttempted, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamicPruningUsed.TryReadProperty(ref reader, options, PropDynamicPruningUsed, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEmptyCollectorsUsed.TryReadProperty(ref reader, options, PropEmptyCollectorsUsed, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propExtractCount.TryReadProperty(ref reader, options, PropExtractCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propExtractNs.TryReadProperty(ref reader, options, PropExtractNs, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFilters.TryReadProperty(ref reader, options, PropFilters, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propHasFilter.TryReadProperty(ref reader, options, PropHasFilter, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMapReducer.TryReadProperty(ref reader, options, PropMapReducer, null)) - { - continue; - } - - if (propNumericCollectorsUsed.TryReadProperty(ref reader, options, PropNumericCollectorsUsed, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOrdinalsCollectorsOverheadTooHigh.TryReadProperty(ref reader, options, PropOrdinalsCollectorsOverheadTooHigh, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOrdinalsCollectorsUsed.TryReadProperty(ref reader, options, PropOrdinalsCollectorsUsed, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propResultStrategy.TryReadProperty(ref reader, options, PropResultStrategy, null)) - { - continue; - } - - if (propSegmentsCollected.TryReadProperty(ref reader, options, PropSegmentsCollected, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSegmentsCounted.TryReadProperty(ref reader, options, PropSegmentsCounted, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSegmentsWithDeletedDocs.TryReadProperty(ref reader, options, PropSegmentsWithDeletedDocs, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSegmentsWithDocCountField.TryReadProperty(ref reader, options, PropSegmentsWithDocCountField, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSegmentsWithMultiValuedOrds.TryReadProperty(ref reader, options, PropSegmentsWithMultiValuedOrds, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSegmentsWithSingleValuedOrds.TryReadProperty(ref reader, options, PropSegmentsWithSingleValuedOrds, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSkippedDueToNoData.TryReadProperty(ref reader, options, PropSkippedDueToNoData, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propStringHashingCollectorsUsed.TryReadProperty(ref reader, options, PropStringHashingCollectorsUsed, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSurvivingBuckets.TryReadProperty(ref reader, options, PropSurvivingBuckets, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotalBuckets.TryReadProperty(ref reader, options, PropTotalBuckets, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propValuesFetched.TryReadProperty(ref reader, options, PropValuesFetched, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.AggregationProfileDebug(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BruteForceUsed = propBruteForceUsed.Value, - BuiltBuckets = propBuiltBuckets.Value, - CharsFetched = propCharsFetched.Value, - CollectAnalyzedCount = propCollectAnalyzedCount.Value, - CollectAnalyzedNs = propCollectAnalyzedNs.Value, - CollectionStrategy = propCollectionStrategy.Value, - DeferredAggregators = propDeferredAggregators.Value, - Delegate = propDelegate.Value, - DelegateDebug = propDelegateDebug.Value, - DynamicPruningAttempted = propDynamicPruningAttempted.Value, - DynamicPruningUsed = propDynamicPruningUsed.Value, - EmptyCollectorsUsed = propEmptyCollectorsUsed.Value, - ExtractCount = propExtractCount.Value, - ExtractNs = propExtractNs.Value, - Filters = propFilters.Value, - HasFilter = propHasFilter.Value, - MapReducer = propMapReducer.Value, - NumericCollectorsUsed = propNumericCollectorsUsed.Value, - OrdinalsCollectorsOverheadTooHigh = propOrdinalsCollectorsOverheadTooHigh.Value, - OrdinalsCollectorsUsed = propOrdinalsCollectorsUsed.Value, - ResultStrategy = propResultStrategy.Value, - SegmentsCollected = propSegmentsCollected.Value, - SegmentsCounted = propSegmentsCounted.Value, - SegmentsWithDeletedDocs = propSegmentsWithDeletedDocs.Value, - SegmentsWithDocCountField = propSegmentsWithDocCountField.Value, - SegmentsWithMultiValuedOrds = propSegmentsWithMultiValuedOrds.Value, - SegmentsWithSingleValuedOrds = propSegmentsWithSingleValuedOrds.Value, - SkippedDueToNoData = propSkippedDueToNoData.Value, - StringHashingCollectorsUsed = propStringHashingCollectorsUsed.Value, - SurvivingBuckets = propSurvivingBuckets.Value, - TotalBuckets = propTotalBuckets.Value, - ValuesFetched = propValuesFetched.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.AggregationProfileDebug value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBruteForceUsed, value.BruteForceUsed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropBuiltBuckets, value.BuiltBuckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCharsFetched, value.CharsFetched, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCollectAnalyzedCount, value.CollectAnalyzedCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCollectAnalyzedNs, value.CollectAnalyzedNs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCollectionStrategy, value.CollectionStrategy, null, null); - writer.WriteProperty(options, PropDeferredAggregators, value.DeferredAggregators, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDelegate, value.Delegate, null, null); - writer.WriteProperty(options, PropDelegateDebug, value.DelegateDebug, null, null); - writer.WriteProperty(options, PropDynamicPruningAttempted, value.DynamicPruningAttempted, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamicPruningUsed, value.DynamicPruningUsed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEmptyCollectorsUsed, value.EmptyCollectorsUsed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropExtractCount, value.ExtractCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropExtractNs, value.ExtractNs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFilters, value.Filters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropHasFilter, value.HasFilter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMapReducer, value.MapReducer, null, null); - writer.WriteProperty(options, PropNumericCollectorsUsed, value.NumericCollectorsUsed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOrdinalsCollectorsOverheadTooHigh, value.OrdinalsCollectorsOverheadTooHigh, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOrdinalsCollectorsUsed, value.OrdinalsCollectorsUsed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropResultStrategy, value.ResultStrategy, null, null); - writer.WriteProperty(options, PropSegmentsCollected, value.SegmentsCollected, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSegmentsCounted, value.SegmentsCounted, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSegmentsWithDeletedDocs, value.SegmentsWithDeletedDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSegmentsWithDocCountField, value.SegmentsWithDocCountField, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSegmentsWithMultiValuedOrds, value.SegmentsWithMultiValuedOrds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSegmentsWithSingleValuedOrds, value.SegmentsWithSingleValuedOrds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSkippedDueToNoData, value.SkippedDueToNoData, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropStringHashingCollectorsUsed, value.StringHashingCollectorsUsed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSurvivingBuckets, value.SurvivingBuckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotalBuckets, value.TotalBuckets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropValuesFetched, value.ValuesFetched, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.AggregationProfileDebugConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.AggregationProfileDebugConverter))] public sealed partial class AggregationProfileDebug { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationProfileDelegateDebugFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationProfileDelegateDebugFilter.Converters.g.cs new file mode 100644 index 00000000000..76e7a96775a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationProfileDelegateDebugFilter.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class AggregationProfileDelegateDebugFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropResultsFromMetadata = System.Text.Json.JsonEncodedText.Encode("results_from_metadata"); + private static readonly System.Text.Json.JsonEncodedText PropSegmentsCountedInConstantTime = System.Text.Json.JsonEncodedText.Encode("segments_counted_in_constant_time"); + private static readonly System.Text.Json.JsonEncodedText PropSpecializedFor = System.Text.Json.JsonEncodedText.Encode("specialized_for"); + + public override Elastic.Clients.Elasticsearch.Core.Search.AggregationProfileDelegateDebugFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propQuery = default; + LocalJsonValue propResultsFromMetadata = default; + LocalJsonValue propSegmentsCountedInConstantTime = default; + LocalJsonValue propSpecializedFor = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propResultsFromMetadata.TryReadProperty(ref reader, options, PropResultsFromMetadata, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSegmentsCountedInConstantTime.TryReadProperty(ref reader, options, PropSegmentsCountedInConstantTime, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSpecializedFor.TryReadProperty(ref reader, options, PropSpecializedFor, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.AggregationProfileDelegateDebugFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Query = propQuery.Value, + ResultsFromMetadata = propResultsFromMetadata.Value, + SegmentsCountedInConstantTime = propSegmentsCountedInConstantTime.Value, + SpecializedFor = propSpecializedFor.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.AggregationProfileDelegateDebugFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropResultsFromMetadata, value.ResultsFromMetadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSegmentsCountedInConstantTime, value.SegmentsCountedInConstantTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSpecializedFor, value.SpecializedFor, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationProfileDelegateDebugFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationProfileDelegateDebugFilter.g.cs index eca4a328f46..a9ef581635c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationProfileDelegateDebugFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/AggregationProfileDelegateDebugFilter.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class AggregationProfileDelegateDebugFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropResultsFromMetadata = System.Text.Json.JsonEncodedText.Encode("results_from_metadata"); - private static readonly System.Text.Json.JsonEncodedText PropSegmentsCountedInConstantTime = System.Text.Json.JsonEncodedText.Encode("segments_counted_in_constant_time"); - private static readonly System.Text.Json.JsonEncodedText PropSpecializedFor = System.Text.Json.JsonEncodedText.Encode("specialized_for"); - - public override Elastic.Clients.Elasticsearch.Core.Search.AggregationProfileDelegateDebugFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propQuery = default; - LocalJsonValue propResultsFromMetadata = default; - LocalJsonValue propSegmentsCountedInConstantTime = default; - LocalJsonValue propSpecializedFor = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propResultsFromMetadata.TryReadProperty(ref reader, options, PropResultsFromMetadata, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSegmentsCountedInConstantTime.TryReadProperty(ref reader, options, PropSegmentsCountedInConstantTime, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSpecializedFor.TryReadProperty(ref reader, options, PropSpecializedFor, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.AggregationProfileDelegateDebugFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Query = propQuery.Value, - ResultsFromMetadata = propResultsFromMetadata.Value, - SegmentsCountedInConstantTime = propSegmentsCountedInConstantTime.Value, - SpecializedFor = propSpecializedFor.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.AggregationProfileDelegateDebugFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropResultsFromMetadata, value.ResultsFromMetadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSegmentsCountedInConstantTime, value.SegmentsCountedInConstantTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSpecializedFor, value.SpecializedFor, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.AggregationProfileDelegateDebugFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.AggregationProfileDelegateDebugFilterConverter))] public sealed partial class AggregationProfileDelegateDebugFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/BoundaryScanner.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/BoundaryScanner.Converters.g.cs new file mode 100644 index 00000000000..b1da7ed64cc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/BoundaryScanner.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class BoundaryScannerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberChars = System.Text.Json.JsonEncodedText.Encode("chars"); + private static readonly System.Text.Json.JsonEncodedText MemberSentence = System.Text.Json.JsonEncodedText.Encode("sentence"); + private static readonly System.Text.Json.JsonEncodedText MemberWord = System.Text.Json.JsonEncodedText.Encode("word"); + + public override Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberChars)) + { + return Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner.Chars; + } + + if (reader.ValueTextEquals(MemberSentence)) + { + return Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner.Sentence; + } + + if (reader.ValueTextEquals(MemberWord)) + { + return Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner.Word; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberChars.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner.Chars; + } + + if (string.Equals(value, MemberSentence.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner.Sentence; + } + + if (string.Equals(value, MemberWord.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner.Word; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner.Chars: + writer.WriteStringValue(MemberChars); + break; + case Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner.Sentence: + writer.WriteStringValue(MemberSentence); + break; + case Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner.Word: + writer.WriteStringValue(MemberWord); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/BoundaryScanner.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/BoundaryScanner.g.cs new file mode 100644 index 00000000000..7b72a87ac4d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/BoundaryScanner.g.cs @@ -0,0 +1,56 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.BoundaryScannerConverter))] +public enum BoundaryScanner +{ + /// + /// + /// Use the characters specified by boundary_chars as highlighting boundaries. + /// The boundary_max_scan setting controls how far to scan for boundary characters. + /// Only valid for the fvh highlighter. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "chars")] + Chars, + /// + /// + /// Break highlighted fragments at the next sentence boundary, as determined by Java’s BreakIterator. + /// You can specify the locale to use with boundary_scanner_locale. + /// When used with the unified highlighter, the sentence scanner splits sentences bigger than fragment_size at the first word boundary next to fragment_size. + /// You can set fragment_size to 0 to never split any sentence. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "sentence")] + Sentence, + /// + /// + /// Break highlighted fragments at the next word boundary, as determined by Java’s BreakIterator. + /// You can specify the locale to use with boundary_scanner_locale. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "word")] + Word +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Collector.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Collector.Converters.g.cs new file mode 100644 index 00000000000..a0b1a97fdbb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Collector.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class CollectorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChildren = System.Text.Json.JsonEncodedText.Encode("children"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); + private static readonly System.Text.Json.JsonEncodedText PropTimeInNanos = System.Text.Json.JsonEncodedText.Encode("time_in_nanos"); + + public override Elastic.Clients.Elasticsearch.Core.Search.Collector Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propChildren = default; + LocalJsonValue propName = default; + LocalJsonValue propReason = default; + LocalJsonValue propTimeInNanos = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChildren.TryReadProperty(ref reader, options, PropChildren, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propReason.TryReadProperty(ref reader, options, PropReason, null)) + { + continue; + } + + if (propTimeInNanos.TryReadProperty(ref reader, options, PropTimeInNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.Collector(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Children = propChildren.Value, + Name = propName.Value, + Reason = propReason.Value, + TimeInNanos = propTimeInNanos.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.Collector value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChildren, value.Children, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropReason, value.Reason, null, null); + writer.WriteProperty(options, PropTimeInNanos, value.TimeInNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Collector.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Collector.g.cs index 294a43e1c43..810bd5a01b0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Collector.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Collector.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class CollectorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChildren = System.Text.Json.JsonEncodedText.Encode("children"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); - private static readonly System.Text.Json.JsonEncodedText PropTimeInNanos = System.Text.Json.JsonEncodedText.Encode("time_in_nanos"); - - public override Elastic.Clients.Elasticsearch.Core.Search.Collector Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propChildren = default; - LocalJsonValue propName = default; - LocalJsonValue propReason = default; - LocalJsonValue propTimeInNanos = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChildren.TryReadProperty(ref reader, options, PropChildren, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propReason.TryReadProperty(ref reader, options, PropReason, null)) - { - continue; - } - - if (propTimeInNanos.TryReadProperty(ref reader, options, PropTimeInNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.Collector(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Children = propChildren.Value, - Name = propName.Value, - Reason = propReason.Value, - TimeInNanos = propTimeInNanos.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.Collector value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChildren, value.Children, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropReason, value.Reason, null, null); - writer.WriteProperty(options, PropTimeInNanos, value.TimeInNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.CollectorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.CollectorConverter))] public sealed partial class Collector { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionContext.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionContext.Converters.g.cs new file mode 100644 index 00000000000..0e1d931b584 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionContext.Converters.g.cs @@ -0,0 +1,106 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class CompletionContextConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropContext = System.Text.Json.JsonEncodedText.Encode("context"); + private static readonly System.Text.Json.JsonEncodedText PropNeighbours = System.Text.Json.JsonEncodedText.Encode("neighbours"); + private static readonly System.Text.Json.JsonEncodedText PropPrecision = System.Text.Json.JsonEncodedText.Encode("precision"); + private static readonly System.Text.Json.JsonEncodedText PropPrefix = System.Text.Json.JsonEncodedText.Encode("prefix"); + + public override Elastic.Clients.Elasticsearch.Core.Search.CompletionContext Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var readerSnapshot = reader; + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propContext = default; + LocalJsonValue?> propNeighbours = default; + LocalJsonValue propPrecision = default; + LocalJsonValue propPrefix = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propContext.TryReadProperty(ref reader, options, PropContext, null)) + { + continue; + } + + if (propNeighbours.TryReadProperty(ref reader, options, PropNeighbours, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propPrecision.TryReadProperty(ref reader, options, PropPrecision, null)) + { + continue; + } + + if (propPrefix.TryReadProperty(ref reader, options, PropPrefix, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + try + { + reader = readerSnapshot; + var result = reader.ReadValue(options, null); + return new Elastic.Clients.Elasticsearch.Core.Search.CompletionContext(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Context = result + }; + } + catch (System.Text.Json.JsonException) + { + throw; + } + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.CompletionContext(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Context = propContext.Value, + Neighbours = propNeighbours.Value, + Precision = propPrecision.Value, + Prefix = propPrefix.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.CompletionContext value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropContext, value.Context, null, null); + writer.WriteProperty(options, PropNeighbours, value.Neighbours, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPrecision, value.Precision, null, null); + writer.WriteProperty(options, PropPrefix, value.Prefix, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionContext.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionContext.g.cs index 87660df4b1a..0a8dead806e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionContext.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionContext.g.cs @@ -23,89 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class CompletionContextConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropContext = System.Text.Json.JsonEncodedText.Encode("context"); - private static readonly System.Text.Json.JsonEncodedText PropNeighbours = System.Text.Json.JsonEncodedText.Encode("neighbours"); - private static readonly System.Text.Json.JsonEncodedText PropPrecision = System.Text.Json.JsonEncodedText.Encode("precision"); - private static readonly System.Text.Json.JsonEncodedText PropPrefix = System.Text.Json.JsonEncodedText.Encode("prefix"); - - public override Elastic.Clients.Elasticsearch.Core.Search.CompletionContext Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var readerSnapshot = reader; - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propContext = default; - LocalJsonValue?> propNeighbours = default; - LocalJsonValue propPrecision = default; - LocalJsonValue propPrefix = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propContext.TryReadProperty(ref reader, options, PropContext, null)) - { - continue; - } - - if (propNeighbours.TryReadProperty(ref reader, options, PropNeighbours, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propPrecision.TryReadProperty(ref reader, options, PropPrecision, null)) - { - continue; - } - - if (propPrefix.TryReadProperty(ref reader, options, PropPrefix, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - try - { - reader = readerSnapshot; - var result = reader.ReadValue(options, null); - return new Elastic.Clients.Elasticsearch.Core.Search.CompletionContext(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Context = result - }; - } - catch (System.Text.Json.JsonException) - { - throw; - } - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.CompletionContext(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Context = propContext.Value, - Neighbours = propNeighbours.Value, - Precision = propPrecision.Value, - Prefix = propPrefix.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.CompletionContext value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropContext, value.Context, null, null); - writer.WriteProperty(options, PropNeighbours, value.Neighbours, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPrecision, value.Precision, null, null); - writer.WriteProperty(options, PropPrefix, value.Prefix, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.CompletionContextConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.CompletionContextConverter))] public sealed partial class CompletionContext { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggest.Converters.g.cs new file mode 100644 index 00000000000..0f3852e98d7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggest.Converters.g.cs @@ -0,0 +1,106 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class CompletionSuggestConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropLength = System.Text.Json.JsonEncodedText.Encode("length"); + private static readonly System.Text.Json.JsonEncodedText PropOffset = System.Text.Json.JsonEncodedText.Encode("offset"); + private static readonly System.Text.Json.JsonEncodedText PropOptions = System.Text.Json.JsonEncodedText.Encode("options"); + private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); + + public override Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLength = default; + LocalJsonValue propOffset = default; + LocalJsonValue>> propOptions = default; + LocalJsonValue propText = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLength.TryReadProperty(ref reader, options, PropLength, null)) + { + continue; + } + + if (propOffset.TryReadProperty(ref reader, options, PropOffset, null)) + { + continue; + } + + if (propOptions.TryReadProperty(ref reader, options, PropOptions, static System.Collections.Generic.ICollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue>(o, null)!)) + { + continue; + } + + if (propText.TryReadProperty(ref reader, options, PropText, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Length = propLength.Value, + Offset = propOffset.Value, + Options = propOptions.Value, + Text = propText.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLength, value.Length, null, null); + writer.WriteProperty(options, PropOffset, value.Offset, null, null); + writer.WriteProperty(options, PropOptions, value.Options, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection> v) => w.WriteSingleOrManyCollectionValue>(o, v, null)); + writer.WriteProperty(options, PropText, value.Text, null, null); + writer.WriteEndObject(); + } +} + +public sealed partial class CompletionSuggestConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(CompletionSuggest<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(CompletionSuggestConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggest.g.cs index b573da7a8e4..433c3cabf6d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggest.g.cs @@ -23,89 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class CompletionSuggestConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropLength = System.Text.Json.JsonEncodedText.Encode("length"); - private static readonly System.Text.Json.JsonEncodedText PropOffset = System.Text.Json.JsonEncodedText.Encode("offset"); - private static readonly System.Text.Json.JsonEncodedText PropOptions = System.Text.Json.JsonEncodedText.Encode("options"); - private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); - - public override Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLength = default; - LocalJsonValue propOffset = default; - LocalJsonValue>> propOptions = default; - LocalJsonValue propText = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLength.TryReadProperty(ref reader, options, PropLength, null)) - { - continue; - } - - if (propOffset.TryReadProperty(ref reader, options, PropOffset, null)) - { - continue; - } - - if (propOptions.TryReadProperty(ref reader, options, PropOptions, static System.Collections.Generic.ICollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue>(o, null)!)) - { - continue; - } - - if (propText.TryReadProperty(ref reader, options, PropText, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Length = propLength.Value, - Offset = propOffset.Value, - Options = propOptions.Value, - Text = propText.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLength, value.Length, null, null); - writer.WriteProperty(options, PropOffset, value.Offset, null, null); - writer.WriteProperty(options, PropOptions, value.Options, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection> v) => w.WriteSingleOrManyCollectionValue>(o, v, null)); - writer.WriteProperty(options, PropText, value.Text, null, null); - writer.WriteEndObject(); - } -} - -internal sealed partial class CompletionSuggestConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(CompletionSuggest<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(CompletionSuggestConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggestConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.CompletionSuggestConverterFactory))] public sealed partial class CompletionSuggest : Elastic.Clients.Elasticsearch.Core.Search.ISuggest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggestOption.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggestOption.Converters.g.cs new file mode 100644 index 00000000000..02b5b970974 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggestOption.Converters.g.cs @@ -0,0 +1,160 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class CompletionSuggestOptionConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropCollateMatch = System.Text.Json.JsonEncodedText.Encode("collate_match"); + private static readonly System.Text.Json.JsonEncodedText PropContexts = System.Text.Json.JsonEncodedText.Encode("contexts"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("_routing"); + private static readonly System.Text.Json.JsonEncodedText PropScore = System.Text.Json.JsonEncodedText.Encode("score"); + private static readonly System.Text.Json.JsonEncodedText PropScore0 = System.Text.Json.JsonEncodedText.Encode("_score"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); + private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); + + public override Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggestOption Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCollateMatch = default; + LocalJsonValue>?> propContexts = default; + LocalJsonValue?> propFields = default; + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + LocalJsonValue propRouting = default; + LocalJsonValue propScore = default; + LocalJsonValue propScore0 = default; + LocalJsonValue propSource = default; + LocalJsonValue propText = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCollateMatch.TryReadProperty(ref reader, options, PropCollateMatch, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propContexts.TryReadProperty(ref reader, options, PropContexts, static System.Collections.Generic.IReadOnlyDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (propScore.TryReadProperty(ref reader, options, PropScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propScore0.TryReadProperty(ref reader, options, PropScore0, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, static TDocument? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propText.TryReadProperty(ref reader, options, PropText, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggestOption(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CollateMatch = propCollateMatch.Value, + Contexts = propContexts.Value, + Fields = propFields.Value, + Id = propId.Value, + Index = propIndex.Value, + Routing = propRouting.Value, + Score = propScore.Value, + Score0 = propScore0.Value, + Source = propSource.Value, + Text = propText.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggestOption value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCollateMatch, value.CollateMatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropContexts, value.Contexts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteProperty(options, PropScore, value.Score, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropScore0, value.Score0, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSource, value.Source, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TDocument? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropText, value.Text, null, null); + writer.WriteEndObject(); + } +} + +public sealed partial class CompletionSuggestOptionConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(CompletionSuggestOption<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(CompletionSuggestOptionConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggestOption.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggestOption.g.cs index c799e332702..37b81c42bef 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggestOption.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggestOption.g.cs @@ -23,143 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class CompletionSuggestOptionConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropCollateMatch = System.Text.Json.JsonEncodedText.Encode("collate_match"); - private static readonly System.Text.Json.JsonEncodedText PropContexts = System.Text.Json.JsonEncodedText.Encode("contexts"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("_routing"); - private static readonly System.Text.Json.JsonEncodedText PropScore = System.Text.Json.JsonEncodedText.Encode("score"); - private static readonly System.Text.Json.JsonEncodedText PropScore0 = System.Text.Json.JsonEncodedText.Encode("_score"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); - private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); - - public override Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggestOption Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCollateMatch = default; - LocalJsonValue>?> propContexts = default; - LocalJsonValue?> propFields = default; - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - LocalJsonValue propRouting = default; - LocalJsonValue propScore = default; - LocalJsonValue propScore0 = default; - LocalJsonValue propSource = default; - LocalJsonValue propText = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCollateMatch.TryReadProperty(ref reader, options, PropCollateMatch, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propContexts.TryReadProperty(ref reader, options, PropContexts, static System.Collections.Generic.IReadOnlyDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (propScore.TryReadProperty(ref reader, options, PropScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propScore0.TryReadProperty(ref reader, options, PropScore0, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, static TDocument? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propText.TryReadProperty(ref reader, options, PropText, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggestOption(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CollateMatch = propCollateMatch.Value, - Contexts = propContexts.Value, - Fields = propFields.Value, - Id = propId.Value, - Index = propIndex.Value, - Routing = propRouting.Value, - Score = propScore.Value, - Score0 = propScore0.Value, - Source = propSource.Value, - Text = propText.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggestOption value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCollateMatch, value.CollateMatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropContexts, value.Contexts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteProperty(options, PropScore, value.Score, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropScore0, value.Score0, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSource, value.Source, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TDocument? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropText, value.Text, null, null); - writer.WriteEndObject(); - } -} - -internal sealed partial class CompletionSuggestOptionConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(CompletionSuggestOption<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(CompletionSuggestOptionConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggestOptionConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.CompletionSuggestOptionConverterFactory))] public sealed partial class CompletionSuggestOption { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggester.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggester.Converters.g.cs new file mode 100644 index 00000000000..53853b0be61 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggester.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class CompletionSuggesterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropContexts = System.Text.Json.JsonEncodedText.Encode("contexts"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFuzzy = System.Text.Json.JsonEncodedText.Encode("fuzzy"); + private static readonly System.Text.Json.JsonEncodedText PropRegex = System.Text.Json.JsonEncodedText.Encode("regex"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropSkipDuplicates = System.Text.Json.JsonEncodedText.Encode("skip_duplicates"); + + public override Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggester Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzer = default; + LocalJsonValue>?> propContexts = default; + LocalJsonValue propField = default; + LocalJsonValue propFuzzy = default; + LocalJsonValue propRegex = default; + LocalJsonValue propSize = default; + LocalJsonValue propSkipDuplicates = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) + { + continue; + } + + if (propContexts.TryReadProperty(ref reader, options, PropContexts, static System.Collections.Generic.IDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFuzzy.TryReadProperty(ref reader, options, PropFuzzy, null)) + { + continue; + } + + if (propRegex.TryReadProperty(ref reader, options, PropRegex, null)) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSkipDuplicates.TryReadProperty(ref reader, options, PropSkipDuplicates, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggester(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analyzer = propAnalyzer.Value, + Contexts = propContexts.Value, + Field = propField.Value, + Fuzzy = propFuzzy.Value, + Regex = propRegex.Value, + Size = propSize.Value, + SkipDuplicates = propSkipDuplicates.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggester value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); + writer.WriteProperty(options, PropContexts, value.Contexts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFuzzy, value.Fuzzy, null, null); + writer.WriteProperty(options, PropRegex, value.Regex, null, null); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSkipDuplicates, value.SkipDuplicates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggester.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggester.g.cs index 21a96c90c5d..e740fa55ff6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggester.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/CompletionSuggester.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class CompletionSuggesterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropContexts = System.Text.Json.JsonEncodedText.Encode("contexts"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFuzzy = System.Text.Json.JsonEncodedText.Encode("fuzzy"); - private static readonly System.Text.Json.JsonEncodedText PropRegex = System.Text.Json.JsonEncodedText.Encode("regex"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropSkipDuplicates = System.Text.Json.JsonEncodedText.Encode("skip_duplicates"); - - public override Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggester Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyzer = default; - LocalJsonValue>?> propContexts = default; - LocalJsonValue propField = default; - LocalJsonValue propFuzzy = default; - LocalJsonValue propRegex = default; - LocalJsonValue propSize = default; - LocalJsonValue propSkipDuplicates = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) - { - continue; - } - - if (propContexts.TryReadProperty(ref reader, options, PropContexts, static System.Collections.Generic.IDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFuzzy.TryReadProperty(ref reader, options, PropFuzzy, null)) - { - continue; - } - - if (propRegex.TryReadProperty(ref reader, options, PropRegex, null)) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSkipDuplicates.TryReadProperty(ref reader, options, PropSkipDuplicates, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggester(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analyzer = propAnalyzer.Value, - Contexts = propContexts.Value, - Field = propField.Value, - Fuzzy = propFuzzy.Value, - Regex = propRegex.Value, - Size = propSize.Value, - SkipDuplicates = propSkipDuplicates.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggester value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); - writer.WriteProperty(options, PropContexts, value.Contexts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFuzzy, value.Fuzzy, null, null); - writer.WriteProperty(options, PropRegex, value.Regex, null, null); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSkipDuplicates, value.SkipDuplicates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggesterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.CompletionSuggesterConverter))] public sealed partial class CompletionSuggester { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsKnnProfile.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsKnnProfile.Converters.g.cs new file mode 100644 index 00000000000..e3e78b03832 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsKnnProfile.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class DfsKnnProfileConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCollector = System.Text.Json.JsonEncodedText.Encode("collector"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropRewriteTime = System.Text.Json.JsonEncodedText.Encode("rewrite_time"); + private static readonly System.Text.Json.JsonEncodedText PropVectorOperationsCount = System.Text.Json.JsonEncodedText.Encode("vector_operations_count"); + + public override Elastic.Clients.Elasticsearch.Core.Search.DfsKnnProfile Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propCollector = default; + LocalJsonValue> propQuery = default; + LocalJsonValue propRewriteTime = default; + LocalJsonValue propVectorOperationsCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCollector.TryReadProperty(ref reader, options, PropCollector, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propRewriteTime.TryReadProperty(ref reader, options, PropRewriteTime, null)) + { + continue; + } + + if (propVectorOperationsCount.TryReadProperty(ref reader, options, PropVectorOperationsCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.DfsKnnProfile(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Collector = propCollector.Value, + Query = propQuery.Value, + RewriteTime = propRewriteTime.Value, + VectorOperationsCount = propVectorOperationsCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.DfsKnnProfile value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCollector, value.Collector, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropQuery, value.Query, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRewriteTime, value.RewriteTime, null, null); + writer.WriteProperty(options, PropVectorOperationsCount, value.VectorOperationsCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsKnnProfile.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsKnnProfile.g.cs index 644ae198695..4e36d34342a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsKnnProfile.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsKnnProfile.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class DfsKnnProfileConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCollector = System.Text.Json.JsonEncodedText.Encode("collector"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropRewriteTime = System.Text.Json.JsonEncodedText.Encode("rewrite_time"); - private static readonly System.Text.Json.JsonEncodedText PropVectorOperationsCount = System.Text.Json.JsonEncodedText.Encode("vector_operations_count"); - - public override Elastic.Clients.Elasticsearch.Core.Search.DfsKnnProfile Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propCollector = default; - LocalJsonValue> propQuery = default; - LocalJsonValue propRewriteTime = default; - LocalJsonValue propVectorOperationsCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCollector.TryReadProperty(ref reader, options, PropCollector, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propRewriteTime.TryReadProperty(ref reader, options, PropRewriteTime, null)) - { - continue; - } - - if (propVectorOperationsCount.TryReadProperty(ref reader, options, PropVectorOperationsCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.DfsKnnProfile(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Collector = propCollector.Value, - Query = propQuery.Value, - RewriteTime = propRewriteTime.Value, - VectorOperationsCount = propVectorOperationsCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.DfsKnnProfile value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCollector, value.Collector, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropQuery, value.Query, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRewriteTime, value.RewriteTime, null, null); - writer.WriteProperty(options, PropVectorOperationsCount, value.VectorOperationsCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.DfsKnnProfileConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.DfsKnnProfileConverter))] public sealed partial class DfsKnnProfile { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsProfile.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsProfile.Converters.g.cs new file mode 100644 index 00000000000..3df75ea0ce2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsProfile.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class DfsProfileConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropKnn = System.Text.Json.JsonEncodedText.Encode("knn"); + private static readonly System.Text.Json.JsonEncodedText PropStatistics = System.Text.Json.JsonEncodedText.Encode("statistics"); + + public override Elastic.Clients.Elasticsearch.Core.Search.DfsProfile Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propKnn = default; + LocalJsonValue propStatistics = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propKnn.TryReadProperty(ref reader, options, PropKnn, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStatistics.TryReadProperty(ref reader, options, PropStatistics, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.DfsProfile(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Knn = propKnn.Value, + Statistics = propStatistics.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.DfsProfile value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropKnn, value.Knn, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStatistics, value.Statistics, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsProfile.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsProfile.g.cs index 116885551ef..cca5df608bf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsProfile.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsProfile.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class DfsProfileConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropKnn = System.Text.Json.JsonEncodedText.Encode("knn"); - private static readonly System.Text.Json.JsonEncodedText PropStatistics = System.Text.Json.JsonEncodedText.Encode("statistics"); - - public override Elastic.Clients.Elasticsearch.Core.Search.DfsProfile Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propKnn = default; - LocalJsonValue propStatistics = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propKnn.TryReadProperty(ref reader, options, PropKnn, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStatistics.TryReadProperty(ref reader, options, PropStatistics, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.DfsProfile(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Knn = propKnn.Value, - Statistics = propStatistics.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.DfsProfile value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropKnn, value.Knn, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStatistics, value.Statistics, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.DfsProfileConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.DfsProfileConverter))] public sealed partial class DfsProfile { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsStatisticsBreakdown.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsStatisticsBreakdown.Converters.g.cs new file mode 100644 index 00000000000..a8386a5a1a9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsStatisticsBreakdown.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class DfsStatisticsBreakdownConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCollectionStatistics = System.Text.Json.JsonEncodedText.Encode("collection_statistics"); + private static readonly System.Text.Json.JsonEncodedText PropCollectionStatisticsCount = System.Text.Json.JsonEncodedText.Encode("collection_statistics_count"); + private static readonly System.Text.Json.JsonEncodedText PropCreateWeight = System.Text.Json.JsonEncodedText.Encode("create_weight"); + private static readonly System.Text.Json.JsonEncodedText PropCreateWeightCount = System.Text.Json.JsonEncodedText.Encode("create_weight_count"); + private static readonly System.Text.Json.JsonEncodedText PropRewrite = System.Text.Json.JsonEncodedText.Encode("rewrite"); + private static readonly System.Text.Json.JsonEncodedText PropRewriteCount = System.Text.Json.JsonEncodedText.Encode("rewrite_count"); + private static readonly System.Text.Json.JsonEncodedText PropTermStatistics = System.Text.Json.JsonEncodedText.Encode("term_statistics"); + private static readonly System.Text.Json.JsonEncodedText PropTermStatisticsCount = System.Text.Json.JsonEncodedText.Encode("term_statistics_count"); + + public override Elastic.Clients.Elasticsearch.Core.Search.DfsStatisticsBreakdown Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCollectionStatistics = default; + LocalJsonValue propCollectionStatisticsCount = default; + LocalJsonValue propCreateWeight = default; + LocalJsonValue propCreateWeightCount = default; + LocalJsonValue propRewrite = default; + LocalJsonValue propRewriteCount = default; + LocalJsonValue propTermStatistics = default; + LocalJsonValue propTermStatisticsCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCollectionStatistics.TryReadProperty(ref reader, options, PropCollectionStatistics, null)) + { + continue; + } + + if (propCollectionStatisticsCount.TryReadProperty(ref reader, options, PropCollectionStatisticsCount, null)) + { + continue; + } + + if (propCreateWeight.TryReadProperty(ref reader, options, PropCreateWeight, null)) + { + continue; + } + + if (propCreateWeightCount.TryReadProperty(ref reader, options, PropCreateWeightCount, null)) + { + continue; + } + + if (propRewrite.TryReadProperty(ref reader, options, PropRewrite, null)) + { + continue; + } + + if (propRewriteCount.TryReadProperty(ref reader, options, PropRewriteCount, null)) + { + continue; + } + + if (propTermStatistics.TryReadProperty(ref reader, options, PropTermStatistics, null)) + { + continue; + } + + if (propTermStatisticsCount.TryReadProperty(ref reader, options, PropTermStatisticsCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.DfsStatisticsBreakdown(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CollectionStatistics = propCollectionStatistics.Value, + CollectionStatisticsCount = propCollectionStatisticsCount.Value, + CreateWeight = propCreateWeight.Value, + CreateWeightCount = propCreateWeightCount.Value, + Rewrite = propRewrite.Value, + RewriteCount = propRewriteCount.Value, + TermStatistics = propTermStatistics.Value, + TermStatisticsCount = propTermStatisticsCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.DfsStatisticsBreakdown value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCollectionStatistics, value.CollectionStatistics, null, null); + writer.WriteProperty(options, PropCollectionStatisticsCount, value.CollectionStatisticsCount, null, null); + writer.WriteProperty(options, PropCreateWeight, value.CreateWeight, null, null); + writer.WriteProperty(options, PropCreateWeightCount, value.CreateWeightCount, null, null); + writer.WriteProperty(options, PropRewrite, value.Rewrite, null, null); + writer.WriteProperty(options, PropRewriteCount, value.RewriteCount, null, null); + writer.WriteProperty(options, PropTermStatistics, value.TermStatistics, null, null); + writer.WriteProperty(options, PropTermStatisticsCount, value.TermStatisticsCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsStatisticsBreakdown.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsStatisticsBreakdown.g.cs index 80243ab2cff..67bfac8e3f8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsStatisticsBreakdown.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsStatisticsBreakdown.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class DfsStatisticsBreakdownConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCollectionStatistics = System.Text.Json.JsonEncodedText.Encode("collection_statistics"); - private static readonly System.Text.Json.JsonEncodedText PropCollectionStatisticsCount = System.Text.Json.JsonEncodedText.Encode("collection_statistics_count"); - private static readonly System.Text.Json.JsonEncodedText PropCreateWeight = System.Text.Json.JsonEncodedText.Encode("create_weight"); - private static readonly System.Text.Json.JsonEncodedText PropCreateWeightCount = System.Text.Json.JsonEncodedText.Encode("create_weight_count"); - private static readonly System.Text.Json.JsonEncodedText PropRewrite = System.Text.Json.JsonEncodedText.Encode("rewrite"); - private static readonly System.Text.Json.JsonEncodedText PropRewriteCount = System.Text.Json.JsonEncodedText.Encode("rewrite_count"); - private static readonly System.Text.Json.JsonEncodedText PropTermStatistics = System.Text.Json.JsonEncodedText.Encode("term_statistics"); - private static readonly System.Text.Json.JsonEncodedText PropTermStatisticsCount = System.Text.Json.JsonEncodedText.Encode("term_statistics_count"); - - public override Elastic.Clients.Elasticsearch.Core.Search.DfsStatisticsBreakdown Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCollectionStatistics = default; - LocalJsonValue propCollectionStatisticsCount = default; - LocalJsonValue propCreateWeight = default; - LocalJsonValue propCreateWeightCount = default; - LocalJsonValue propRewrite = default; - LocalJsonValue propRewriteCount = default; - LocalJsonValue propTermStatistics = default; - LocalJsonValue propTermStatisticsCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCollectionStatistics.TryReadProperty(ref reader, options, PropCollectionStatistics, null)) - { - continue; - } - - if (propCollectionStatisticsCount.TryReadProperty(ref reader, options, PropCollectionStatisticsCount, null)) - { - continue; - } - - if (propCreateWeight.TryReadProperty(ref reader, options, PropCreateWeight, null)) - { - continue; - } - - if (propCreateWeightCount.TryReadProperty(ref reader, options, PropCreateWeightCount, null)) - { - continue; - } - - if (propRewrite.TryReadProperty(ref reader, options, PropRewrite, null)) - { - continue; - } - - if (propRewriteCount.TryReadProperty(ref reader, options, PropRewriteCount, null)) - { - continue; - } - - if (propTermStatistics.TryReadProperty(ref reader, options, PropTermStatistics, null)) - { - continue; - } - - if (propTermStatisticsCount.TryReadProperty(ref reader, options, PropTermStatisticsCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.DfsStatisticsBreakdown(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CollectionStatistics = propCollectionStatistics.Value, - CollectionStatisticsCount = propCollectionStatisticsCount.Value, - CreateWeight = propCreateWeight.Value, - CreateWeightCount = propCreateWeightCount.Value, - Rewrite = propRewrite.Value, - RewriteCount = propRewriteCount.Value, - TermStatistics = propTermStatistics.Value, - TermStatisticsCount = propTermStatisticsCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.DfsStatisticsBreakdown value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCollectionStatistics, value.CollectionStatistics, null, null); - writer.WriteProperty(options, PropCollectionStatisticsCount, value.CollectionStatisticsCount, null, null); - writer.WriteProperty(options, PropCreateWeight, value.CreateWeight, null, null); - writer.WriteProperty(options, PropCreateWeightCount, value.CreateWeightCount, null, null); - writer.WriteProperty(options, PropRewrite, value.Rewrite, null, null); - writer.WriteProperty(options, PropRewriteCount, value.RewriteCount, null, null); - writer.WriteProperty(options, PropTermStatistics, value.TermStatistics, null, null); - writer.WriteProperty(options, PropTermStatisticsCount, value.TermStatisticsCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.DfsStatisticsBreakdownConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.DfsStatisticsBreakdownConverter))] public sealed partial class DfsStatisticsBreakdown { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsStatisticsProfile.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsStatisticsProfile.Converters.g.cs new file mode 100644 index 00000000000..3e8953f2e62 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsStatisticsProfile.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class DfsStatisticsProfileConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBreakdown = System.Text.Json.JsonEncodedText.Encode("breakdown"); + private static readonly System.Text.Json.JsonEncodedText PropChildren = System.Text.Json.JsonEncodedText.Encode("children"); + private static readonly System.Text.Json.JsonEncodedText PropDebug = System.Text.Json.JsonEncodedText.Encode("debug"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropTime = System.Text.Json.JsonEncodedText.Encode("time"); + private static readonly System.Text.Json.JsonEncodedText PropTimeInNanos = System.Text.Json.JsonEncodedText.Encode("time_in_nanos"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Core.Search.DfsStatisticsProfile Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBreakdown = default; + LocalJsonValue?> propChildren = default; + LocalJsonValue?> propDebug = default; + LocalJsonValue propDescription = default; + LocalJsonValue propTime = default; + LocalJsonValue propTimeInNanos = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBreakdown.TryReadProperty(ref reader, options, PropBreakdown, null)) + { + continue; + } + + if (propChildren.TryReadProperty(ref reader, options, PropChildren, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propDebug.TryReadProperty(ref reader, options, PropDebug, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propTime.TryReadProperty(ref reader, options, PropTime, null)) + { + continue; + } + + if (propTimeInNanos.TryReadProperty(ref reader, options, PropTimeInNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.DfsStatisticsProfile(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Breakdown = propBreakdown.Value, + Children = propChildren.Value, + Debug = propDebug.Value, + Description = propDescription.Value, + Time = propTime.Value, + TimeInNanos = propTimeInNanos.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.DfsStatisticsProfile value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBreakdown, value.Breakdown, null, null); + writer.WriteProperty(options, PropChildren, value.Children, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDebug, value.Debug, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropTime, value.Time, null, null); + writer.WriteProperty(options, PropTimeInNanos, value.TimeInNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsStatisticsProfile.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsStatisticsProfile.g.cs index 098c8863c90..70a353f3cf3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsStatisticsProfile.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DfsStatisticsProfile.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class DfsStatisticsProfileConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBreakdown = System.Text.Json.JsonEncodedText.Encode("breakdown"); - private static readonly System.Text.Json.JsonEncodedText PropChildren = System.Text.Json.JsonEncodedText.Encode("children"); - private static readonly System.Text.Json.JsonEncodedText PropDebug = System.Text.Json.JsonEncodedText.Encode("debug"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropTime = System.Text.Json.JsonEncodedText.Encode("time"); - private static readonly System.Text.Json.JsonEncodedText PropTimeInNanos = System.Text.Json.JsonEncodedText.Encode("time_in_nanos"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Core.Search.DfsStatisticsProfile Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBreakdown = default; - LocalJsonValue?> propChildren = default; - LocalJsonValue?> propDebug = default; - LocalJsonValue propDescription = default; - LocalJsonValue propTime = default; - LocalJsonValue propTimeInNanos = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBreakdown.TryReadProperty(ref reader, options, PropBreakdown, null)) - { - continue; - } - - if (propChildren.TryReadProperty(ref reader, options, PropChildren, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propDebug.TryReadProperty(ref reader, options, PropDebug, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propTime.TryReadProperty(ref reader, options, PropTime, null)) - { - continue; - } - - if (propTimeInNanos.TryReadProperty(ref reader, options, PropTimeInNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.DfsStatisticsProfile(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Breakdown = propBreakdown.Value, - Children = propChildren.Value, - Debug = propDebug.Value, - Description = propDescription.Value, - Time = propTime.Value, - TimeInNanos = propTimeInNanos.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.DfsStatisticsProfile value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBreakdown, value.Breakdown, null, null); - writer.WriteProperty(options, PropChildren, value.Children, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDebug, value.Debug, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropTime, value.Time, null, null); - writer.WriteProperty(options, PropTimeInNanos, value.TimeInNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.DfsStatisticsProfileConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.DfsStatisticsProfileConverter))] public sealed partial class DfsStatisticsProfile { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DirectGenerator.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DirectGenerator.Converters.g.cs new file mode 100644 index 00000000000..1019809a893 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DirectGenerator.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class DirectGeneratorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropMaxEdits = System.Text.Json.JsonEncodedText.Encode("max_edits"); + private static readonly System.Text.Json.JsonEncodedText PropMaxInspections = System.Text.Json.JsonEncodedText.Encode("max_inspections"); + private static readonly System.Text.Json.JsonEncodedText PropMaxTermFreq = System.Text.Json.JsonEncodedText.Encode("max_term_freq"); + private static readonly System.Text.Json.JsonEncodedText PropMinDocFreq = System.Text.Json.JsonEncodedText.Encode("min_doc_freq"); + private static readonly System.Text.Json.JsonEncodedText PropMinWordLength = System.Text.Json.JsonEncodedText.Encode("min_word_length"); + private static readonly System.Text.Json.JsonEncodedText PropPostFilter = System.Text.Json.JsonEncodedText.Encode("post_filter"); + private static readonly System.Text.Json.JsonEncodedText PropPreFilter = System.Text.Json.JsonEncodedText.Encode("pre_filter"); + private static readonly System.Text.Json.JsonEncodedText PropPrefixLength = System.Text.Json.JsonEncodedText.Encode("prefix_length"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropSuggestMode = System.Text.Json.JsonEncodedText.Encode("suggest_mode"); + + public override Elastic.Clients.Elasticsearch.Core.Search.DirectGenerator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propMaxEdits = default; + LocalJsonValue propMaxInspections = default; + LocalJsonValue propMaxTermFreq = default; + LocalJsonValue propMinDocFreq = default; + LocalJsonValue propMinWordLength = default; + LocalJsonValue propPostFilter = default; + LocalJsonValue propPreFilter = default; + LocalJsonValue propPrefixLength = default; + LocalJsonValue propSize = default; + LocalJsonValue propSuggestMode = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propMaxEdits.TryReadProperty(ref reader, options, PropMaxEdits, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxInspections.TryReadProperty(ref reader, options, PropMaxInspections, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxTermFreq.TryReadProperty(ref reader, options, PropMaxTermFreq, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinDocFreq.TryReadProperty(ref reader, options, PropMinDocFreq, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinWordLength.TryReadProperty(ref reader, options, PropMinWordLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPostFilter.TryReadProperty(ref reader, options, PropPostFilter, null)) + { + continue; + } + + if (propPreFilter.TryReadProperty(ref reader, options, PropPreFilter, null)) + { + continue; + } + + if (propPrefixLength.TryReadProperty(ref reader, options, PropPrefixLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSuggestMode.TryReadProperty(ref reader, options, PropSuggestMode, static Elastic.Clients.Elasticsearch.SuggestMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.DirectGenerator(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + MaxEdits = propMaxEdits.Value, + MaxInspections = propMaxInspections.Value, + MaxTermFreq = propMaxTermFreq.Value, + MinDocFreq = propMinDocFreq.Value, + MinWordLength = propMinWordLength.Value, + PostFilter = propPostFilter.Value, + PreFilter = propPreFilter.Value, + PrefixLength = propPrefixLength.Value, + Size = propSize.Value, + SuggestMode = propSuggestMode.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.DirectGenerator value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropMaxEdits, value.MaxEdits, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxInspections, value.MaxInspections, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxTermFreq, value.MaxTermFreq, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinDocFreq, value.MinDocFreq, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinWordLength, value.MinWordLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPostFilter, value.PostFilter, null, null); + writer.WriteProperty(options, PropPreFilter, value.PreFilter, null, null); + writer.WriteProperty(options, PropPrefixLength, value.PrefixLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSuggestMode, value.SuggestMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SuggestMode? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DirectGenerator.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DirectGenerator.g.cs index 3802eb2e584..57709cf9442 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DirectGenerator.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/DirectGenerator.g.cs @@ -23,136 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class DirectGeneratorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropMaxEdits = System.Text.Json.JsonEncodedText.Encode("max_edits"); - private static readonly System.Text.Json.JsonEncodedText PropMaxInspections = System.Text.Json.JsonEncodedText.Encode("max_inspections"); - private static readonly System.Text.Json.JsonEncodedText PropMaxTermFreq = System.Text.Json.JsonEncodedText.Encode("max_term_freq"); - private static readonly System.Text.Json.JsonEncodedText PropMinDocFreq = System.Text.Json.JsonEncodedText.Encode("min_doc_freq"); - private static readonly System.Text.Json.JsonEncodedText PropMinWordLength = System.Text.Json.JsonEncodedText.Encode("min_word_length"); - private static readonly System.Text.Json.JsonEncodedText PropPostFilter = System.Text.Json.JsonEncodedText.Encode("post_filter"); - private static readonly System.Text.Json.JsonEncodedText PropPreFilter = System.Text.Json.JsonEncodedText.Encode("pre_filter"); - private static readonly System.Text.Json.JsonEncodedText PropPrefixLength = System.Text.Json.JsonEncodedText.Encode("prefix_length"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropSuggestMode = System.Text.Json.JsonEncodedText.Encode("suggest_mode"); - - public override Elastic.Clients.Elasticsearch.Core.Search.DirectGenerator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propMaxEdits = default; - LocalJsonValue propMaxInspections = default; - LocalJsonValue propMaxTermFreq = default; - LocalJsonValue propMinDocFreq = default; - LocalJsonValue propMinWordLength = default; - LocalJsonValue propPostFilter = default; - LocalJsonValue propPreFilter = default; - LocalJsonValue propPrefixLength = default; - LocalJsonValue propSize = default; - LocalJsonValue propSuggestMode = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propMaxEdits.TryReadProperty(ref reader, options, PropMaxEdits, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxInspections.TryReadProperty(ref reader, options, PropMaxInspections, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxTermFreq.TryReadProperty(ref reader, options, PropMaxTermFreq, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinDocFreq.TryReadProperty(ref reader, options, PropMinDocFreq, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinWordLength.TryReadProperty(ref reader, options, PropMinWordLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPostFilter.TryReadProperty(ref reader, options, PropPostFilter, null)) - { - continue; - } - - if (propPreFilter.TryReadProperty(ref reader, options, PropPreFilter, null)) - { - continue; - } - - if (propPrefixLength.TryReadProperty(ref reader, options, PropPrefixLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSuggestMode.TryReadProperty(ref reader, options, PropSuggestMode, static Elastic.Clients.Elasticsearch.SuggestMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.DirectGenerator(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - MaxEdits = propMaxEdits.Value, - MaxInspections = propMaxInspections.Value, - MaxTermFreq = propMaxTermFreq.Value, - MinDocFreq = propMinDocFreq.Value, - MinWordLength = propMinWordLength.Value, - PostFilter = propPostFilter.Value, - PreFilter = propPreFilter.Value, - PrefixLength = propPrefixLength.Value, - Size = propSize.Value, - SuggestMode = propSuggestMode.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.DirectGenerator value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropMaxEdits, value.MaxEdits, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxInspections, value.MaxInspections, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxTermFreq, value.MaxTermFreq, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinDocFreq, value.MinDocFreq, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinWordLength, value.MinWordLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPostFilter, value.PostFilter, null, null); - writer.WriteProperty(options, PropPreFilter, value.PreFilter, null, null); - writer.WriteProperty(options, PropPrefixLength, value.PrefixLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSuggestMode, value.SuggestMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SuggestMode? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.DirectGeneratorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.DirectGeneratorConverter))] public sealed partial class DirectGenerator { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FetchProfile.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FetchProfile.Converters.g.cs new file mode 100644 index 00000000000..602f0ec746e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FetchProfile.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class FetchProfileConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBreakdown = System.Text.Json.JsonEncodedText.Encode("breakdown"); + private static readonly System.Text.Json.JsonEncodedText PropChildren = System.Text.Json.JsonEncodedText.Encode("children"); + private static readonly System.Text.Json.JsonEncodedText PropDebug = System.Text.Json.JsonEncodedText.Encode("debug"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropTimeInNanos = System.Text.Json.JsonEncodedText.Encode("time_in_nanos"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Core.Search.FetchProfile Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBreakdown = default; + LocalJsonValue?> propChildren = default; + LocalJsonValue propDebug = default; + LocalJsonValue propDescription = default; + LocalJsonValue propTimeInNanos = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBreakdown.TryReadProperty(ref reader, options, PropBreakdown, null)) + { + continue; + } + + if (propChildren.TryReadProperty(ref reader, options, PropChildren, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propDebug.TryReadProperty(ref reader, options, PropDebug, null)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propTimeInNanos.TryReadProperty(ref reader, options, PropTimeInNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.FetchProfile(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Breakdown = propBreakdown.Value, + Children = propChildren.Value, + Debug = propDebug.Value, + Description = propDescription.Value, + TimeInNanos = propTimeInNanos.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.FetchProfile value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBreakdown, value.Breakdown, null, null); + writer.WriteProperty(options, PropChildren, value.Children, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDebug, value.Debug, null, null); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropTimeInNanos, value.TimeInNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FetchProfile.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FetchProfile.g.cs index 6d304ec7d7f..d33a9b795e1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FetchProfile.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FetchProfile.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class FetchProfileConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBreakdown = System.Text.Json.JsonEncodedText.Encode("breakdown"); - private static readonly System.Text.Json.JsonEncodedText PropChildren = System.Text.Json.JsonEncodedText.Encode("children"); - private static readonly System.Text.Json.JsonEncodedText PropDebug = System.Text.Json.JsonEncodedText.Encode("debug"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropTimeInNanos = System.Text.Json.JsonEncodedText.Encode("time_in_nanos"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Core.Search.FetchProfile Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBreakdown = default; - LocalJsonValue?> propChildren = default; - LocalJsonValue propDebug = default; - LocalJsonValue propDescription = default; - LocalJsonValue propTimeInNanos = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBreakdown.TryReadProperty(ref reader, options, PropBreakdown, null)) - { - continue; - } - - if (propChildren.TryReadProperty(ref reader, options, PropChildren, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propDebug.TryReadProperty(ref reader, options, PropDebug, null)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propTimeInNanos.TryReadProperty(ref reader, options, PropTimeInNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.FetchProfile(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Breakdown = propBreakdown.Value, - Children = propChildren.Value, - Debug = propDebug.Value, - Description = propDescription.Value, - TimeInNanos = propTimeInNanos.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.FetchProfile value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBreakdown, value.Breakdown, null, null); - writer.WriteProperty(options, PropChildren, value.Children, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDebug, value.Debug, null, null); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropTimeInNanos, value.TimeInNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.FetchProfileConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.FetchProfileConverter))] public sealed partial class FetchProfile { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FetchProfileBreakdown.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FetchProfileBreakdown.Converters.g.cs new file mode 100644 index 00000000000..f6f3f5f2509 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FetchProfileBreakdown.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class FetchProfileBreakdownConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLoadSource = System.Text.Json.JsonEncodedText.Encode("load_source"); + private static readonly System.Text.Json.JsonEncodedText PropLoadSourceCount = System.Text.Json.JsonEncodedText.Encode("load_source_count"); + private static readonly System.Text.Json.JsonEncodedText PropLoadStoredFields = System.Text.Json.JsonEncodedText.Encode("load_stored_fields"); + private static readonly System.Text.Json.JsonEncodedText PropLoadStoredFieldsCount = System.Text.Json.JsonEncodedText.Encode("load_stored_fields_count"); + private static readonly System.Text.Json.JsonEncodedText PropNextReader = System.Text.Json.JsonEncodedText.Encode("next_reader"); + private static readonly System.Text.Json.JsonEncodedText PropNextReaderCount = System.Text.Json.JsonEncodedText.Encode("next_reader_count"); + private static readonly System.Text.Json.JsonEncodedText PropProcess = System.Text.Json.JsonEncodedText.Encode("process"); + private static readonly System.Text.Json.JsonEncodedText PropProcessCount = System.Text.Json.JsonEncodedText.Encode("process_count"); + + public override Elastic.Clients.Elasticsearch.Core.Search.FetchProfileBreakdown Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLoadSource = default; + LocalJsonValue propLoadSourceCount = default; + LocalJsonValue propLoadStoredFields = default; + LocalJsonValue propLoadStoredFieldsCount = default; + LocalJsonValue propNextReader = default; + LocalJsonValue propNextReaderCount = default; + LocalJsonValue propProcess = default; + LocalJsonValue propProcessCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLoadSource.TryReadProperty(ref reader, options, PropLoadSource, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLoadSourceCount.TryReadProperty(ref reader, options, PropLoadSourceCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLoadStoredFields.TryReadProperty(ref reader, options, PropLoadStoredFields, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLoadStoredFieldsCount.TryReadProperty(ref reader, options, PropLoadStoredFieldsCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNextReader.TryReadProperty(ref reader, options, PropNextReader, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNextReaderCount.TryReadProperty(ref reader, options, PropNextReaderCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProcess.TryReadProperty(ref reader, options, PropProcess, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProcessCount.TryReadProperty(ref reader, options, PropProcessCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.FetchProfileBreakdown(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + LoadSource = propLoadSource.Value, + LoadSourceCount = propLoadSourceCount.Value, + LoadStoredFields = propLoadStoredFields.Value, + LoadStoredFieldsCount = propLoadStoredFieldsCount.Value, + NextReader = propNextReader.Value, + NextReaderCount = propNextReaderCount.Value, + Process = propProcess.Value, + ProcessCount = propProcessCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.FetchProfileBreakdown value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLoadSource, value.LoadSource, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLoadSourceCount, value.LoadSourceCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLoadStoredFields, value.LoadStoredFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLoadStoredFieldsCount, value.LoadStoredFieldsCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNextReader, value.NextReader, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNextReaderCount, value.NextReaderCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProcess, value.Process, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProcessCount, value.ProcessCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FetchProfileBreakdown.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FetchProfileBreakdown.g.cs index 1261078e7d7..6c882fd5f82 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FetchProfileBreakdown.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FetchProfileBreakdown.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class FetchProfileBreakdownConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLoadSource = System.Text.Json.JsonEncodedText.Encode("load_source"); - private static readonly System.Text.Json.JsonEncodedText PropLoadSourceCount = System.Text.Json.JsonEncodedText.Encode("load_source_count"); - private static readonly System.Text.Json.JsonEncodedText PropLoadStoredFields = System.Text.Json.JsonEncodedText.Encode("load_stored_fields"); - private static readonly System.Text.Json.JsonEncodedText PropLoadStoredFieldsCount = System.Text.Json.JsonEncodedText.Encode("load_stored_fields_count"); - private static readonly System.Text.Json.JsonEncodedText PropNextReader = System.Text.Json.JsonEncodedText.Encode("next_reader"); - private static readonly System.Text.Json.JsonEncodedText PropNextReaderCount = System.Text.Json.JsonEncodedText.Encode("next_reader_count"); - private static readonly System.Text.Json.JsonEncodedText PropProcess = System.Text.Json.JsonEncodedText.Encode("process"); - private static readonly System.Text.Json.JsonEncodedText PropProcessCount = System.Text.Json.JsonEncodedText.Encode("process_count"); - - public override Elastic.Clients.Elasticsearch.Core.Search.FetchProfileBreakdown Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLoadSource = default; - LocalJsonValue propLoadSourceCount = default; - LocalJsonValue propLoadStoredFields = default; - LocalJsonValue propLoadStoredFieldsCount = default; - LocalJsonValue propNextReader = default; - LocalJsonValue propNextReaderCount = default; - LocalJsonValue propProcess = default; - LocalJsonValue propProcessCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLoadSource.TryReadProperty(ref reader, options, PropLoadSource, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLoadSourceCount.TryReadProperty(ref reader, options, PropLoadSourceCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLoadStoredFields.TryReadProperty(ref reader, options, PropLoadStoredFields, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLoadStoredFieldsCount.TryReadProperty(ref reader, options, PropLoadStoredFieldsCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNextReader.TryReadProperty(ref reader, options, PropNextReader, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNextReaderCount.TryReadProperty(ref reader, options, PropNextReaderCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProcess.TryReadProperty(ref reader, options, PropProcess, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProcessCount.TryReadProperty(ref reader, options, PropProcessCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.FetchProfileBreakdown(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - LoadSource = propLoadSource.Value, - LoadSourceCount = propLoadSourceCount.Value, - LoadStoredFields = propLoadStoredFields.Value, - LoadStoredFieldsCount = propLoadStoredFieldsCount.Value, - NextReader = propNextReader.Value, - NextReaderCount = propNextReaderCount.Value, - Process = propProcess.Value, - ProcessCount = propProcessCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.FetchProfileBreakdown value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLoadSource, value.LoadSource, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLoadSourceCount, value.LoadSourceCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLoadStoredFields, value.LoadStoredFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLoadStoredFieldsCount, value.LoadStoredFieldsCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNextReader, value.NextReader, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNextReaderCount, value.NextReaderCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProcess, value.Process, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProcessCount, value.ProcessCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.FetchProfileBreakdownConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.FetchProfileBreakdownConverter))] public sealed partial class FetchProfileBreakdown { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FetchProfileDebug.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FetchProfileDebug.Converters.g.cs new file mode 100644 index 00000000000..58856ec7b97 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FetchProfileDebug.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class FetchProfileDebugConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFastPath = System.Text.Json.JsonEncodedText.Encode("fast_path"); + private static readonly System.Text.Json.JsonEncodedText PropStoredFields = System.Text.Json.JsonEncodedText.Encode("stored_fields"); + + public override Elastic.Clients.Elasticsearch.Core.Search.FetchProfileDebug Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFastPath = default; + LocalJsonValue?> propStoredFields = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFastPath.TryReadProperty(ref reader, options, PropFastPath, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propStoredFields.TryReadProperty(ref reader, options, PropStoredFields, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.FetchProfileDebug(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FastPath = propFastPath.Value, + StoredFields = propStoredFields.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.FetchProfileDebug value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFastPath, value.FastPath, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropStoredFields, value.StoredFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FetchProfileDebug.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FetchProfileDebug.g.cs index 77976d0cb75..bcc401a0c14 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FetchProfileDebug.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FetchProfileDebug.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class FetchProfileDebugConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFastPath = System.Text.Json.JsonEncodedText.Encode("fast_path"); - private static readonly System.Text.Json.JsonEncodedText PropStoredFields = System.Text.Json.JsonEncodedText.Encode("stored_fields"); - - public override Elastic.Clients.Elasticsearch.Core.Search.FetchProfileDebug Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFastPath = default; - LocalJsonValue?> propStoredFields = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFastPath.TryReadProperty(ref reader, options, PropFastPath, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propStoredFields.TryReadProperty(ref reader, options, PropStoredFields, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.FetchProfileDebug(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FastPath = propFastPath.Value, - StoredFields = propStoredFields.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.FetchProfileDebug value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFastPath, value.FastPath, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropStoredFields, value.StoredFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.FetchProfileDebugConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.FetchProfileDebugConverter))] public sealed partial class FetchProfileDebug { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FieldCollapse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FieldCollapse.Converters.g.cs new file mode 100644 index 00000000000..e938d8887fb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FieldCollapse.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class FieldCollapseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCollapse = System.Text.Json.JsonEncodedText.Encode("collapse"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropInnerHits = System.Text.Json.JsonEncodedText.Encode("inner_hits"); + private static readonly System.Text.Json.JsonEncodedText PropMaxConcurrentGroupSearches = System.Text.Json.JsonEncodedText.Encode("max_concurrent_group_searches"); + + public override Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCollapse = default; + LocalJsonValue propField = default; + LocalJsonValue?> propInnerHits = default; + LocalJsonValue propMaxConcurrentGroupSearches = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCollapse.TryReadProperty(ref reader, options, PropCollapse, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propInnerHits.TryReadProperty(ref reader, options, PropInnerHits, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propMaxConcurrentGroupSearches.TryReadProperty(ref reader, options, PropMaxConcurrentGroupSearches, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Collapse = propCollapse.Value, + Field = propField.Value, + InnerHits = propInnerHits.Value, + MaxConcurrentGroupSearches = propMaxConcurrentGroupSearches.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCollapse, value.Collapse, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropInnerHits, value.InnerHits, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMaxConcurrentGroupSearches, value.MaxConcurrentGroupSearches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FieldCollapse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FieldCollapse.g.cs index d77769fa142..1d9960915d3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FieldCollapse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FieldCollapse.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class FieldCollapseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCollapse = System.Text.Json.JsonEncodedText.Encode("collapse"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropInnerHits = System.Text.Json.JsonEncodedText.Encode("inner_hits"); - private static readonly System.Text.Json.JsonEncodedText PropMaxConcurrentGroupSearches = System.Text.Json.JsonEncodedText.Encode("max_concurrent_group_searches"); - - public override Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCollapse = default; - LocalJsonValue propField = default; - LocalJsonValue?> propInnerHits = default; - LocalJsonValue propMaxConcurrentGroupSearches = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCollapse.TryReadProperty(ref reader, options, PropCollapse, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propInnerHits.TryReadProperty(ref reader, options, PropInnerHits, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propMaxConcurrentGroupSearches.TryReadProperty(ref reader, options, PropMaxConcurrentGroupSearches, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Collapse = propCollapse.Value, - Field = propField.Value, - InnerHits = propInnerHits.Value, - MaxConcurrentGroupSearches = propMaxConcurrentGroupSearches.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCollapse, value.Collapse, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropInnerHits, value.InnerHits, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMaxConcurrentGroupSearches, value.MaxConcurrentGroupSearches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.FieldCollapseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.FieldCollapseConverter))] public sealed partial class FieldCollapse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FieldSuggester.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FieldSuggester.Converters.g.cs new file mode 100644 index 00000000000..7f5e7496163 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FieldSuggester.Converters.g.cs @@ -0,0 +1,129 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class FieldSuggesterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPrefix = System.Text.Json.JsonEncodedText.Encode("prefix"); + private static readonly System.Text.Json.JsonEncodedText PropRegex = System.Text.Json.JsonEncodedText.Encode("regex"); + private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); + private static readonly System.Text.Json.JsonEncodedText VariantCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText VariantPhrase = System.Text.Json.JsonEncodedText.Encode("phrase"); + private static readonly System.Text.Json.JsonEncodedText VariantTerm = System.Text.Json.JsonEncodedText.Encode("term"); + + public override Elastic.Clients.Elasticsearch.Core.Search.FieldSuggester Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPrefix = default; + LocalJsonValue propRegex = default; + LocalJsonValue propText = default; + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPrefix.TryReadProperty(ref reader, options, PropPrefix, null)) + { + continue; + } + + if (propRegex.TryReadProperty(ref reader, options, PropRegex, null)) + { + continue; + } + + if (propText.TryReadProperty(ref reader, options, PropText, null)) + { + continue; + } + + if (reader.ValueTextEquals(VariantCompletion)) + { + variantType = VariantCompletion.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantPhrase)) + { + variantType = VariantPhrase.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTerm)) + { + variantType = VariantTerm.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.FieldSuggester(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant, + Prefix = propPrefix.Value, + Regex = propRegex.Value, + Text = propText.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.FieldSuggester value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "completion": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggester)value.Variant, null, null); + break; + case "phrase": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggester)value.Variant, null, null); + break; + case "term": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Core.Search.TermSuggester)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Core.Search.FieldSuggester)}'."); + } + + writer.WriteProperty(options, PropPrefix, value.Prefix, null, null); + writer.WriteProperty(options, PropRegex, value.Regex, null, null); + writer.WriteProperty(options, PropText, value.Text, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FieldSuggester.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FieldSuggester.g.cs index 3ef3fec562b..4e69b734ca5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FieldSuggester.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/FieldSuggester.g.cs @@ -23,112 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class FieldSuggesterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPrefix = System.Text.Json.JsonEncodedText.Encode("prefix"); - private static readonly System.Text.Json.JsonEncodedText PropRegex = System.Text.Json.JsonEncodedText.Encode("regex"); - private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); - private static readonly System.Text.Json.JsonEncodedText VariantCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText VariantPhrase = System.Text.Json.JsonEncodedText.Encode("phrase"); - private static readonly System.Text.Json.JsonEncodedText VariantTerm = System.Text.Json.JsonEncodedText.Encode("term"); - - public override Elastic.Clients.Elasticsearch.Core.Search.FieldSuggester Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPrefix = default; - LocalJsonValue propRegex = default; - LocalJsonValue propText = default; - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPrefix.TryReadProperty(ref reader, options, PropPrefix, null)) - { - continue; - } - - if (propRegex.TryReadProperty(ref reader, options, PropRegex, null)) - { - continue; - } - - if (propText.TryReadProperty(ref reader, options, PropText, null)) - { - continue; - } - - if (reader.ValueTextEquals(VariantCompletion)) - { - variantType = VariantCompletion.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantPhrase)) - { - variantType = VariantPhrase.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTerm)) - { - variantType = VariantTerm.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.FieldSuggester(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant, - Prefix = propPrefix.Value, - Regex = propRegex.Value, - Text = propText.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.FieldSuggester value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "completion": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Core.Search.CompletionSuggester)value.Variant, null, null); - break; - case "phrase": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggester)value.Variant, null, null); - break; - case "term": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Core.Search.TermSuggester)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Core.Search.FieldSuggester)}'."); - } - - writer.WriteProperty(options, PropPrefix, value.Prefix, null, null); - writer.WriteProperty(options, PropRegex, value.Regex, null, null); - writer.WriteProperty(options, PropText, value.Text, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.FieldSuggesterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.FieldSuggesterConverter))] public sealed partial class FieldSuggester { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Highlight.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Highlight.Converters.g.cs new file mode 100644 index 00000000000..1cda3c25c6d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Highlight.Converters.g.cs @@ -0,0 +1,261 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class HighlightConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoundaryChars = System.Text.Json.JsonEncodedText.Encode("boundary_chars"); + private static readonly System.Text.Json.JsonEncodedText PropBoundaryMaxScan = System.Text.Json.JsonEncodedText.Encode("boundary_max_scan"); + private static readonly System.Text.Json.JsonEncodedText PropBoundaryScanner = System.Text.Json.JsonEncodedText.Encode("boundary_scanner"); + private static readonly System.Text.Json.JsonEncodedText PropBoundaryScannerLocale = System.Text.Json.JsonEncodedText.Encode("boundary_scanner_locale"); + private static readonly System.Text.Json.JsonEncodedText PropEncoder = System.Text.Json.JsonEncodedText.Encode("encoder"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropForceSource = System.Text.Json.JsonEncodedText.Encode("force_source"); + private static readonly System.Text.Json.JsonEncodedText PropFragmenter = System.Text.Json.JsonEncodedText.Encode("fragmenter"); + private static readonly System.Text.Json.JsonEncodedText PropFragmentSize = System.Text.Json.JsonEncodedText.Encode("fragment_size"); + private static readonly System.Text.Json.JsonEncodedText PropHighlightFilter = System.Text.Json.JsonEncodedText.Encode("highlight_filter"); + private static readonly System.Text.Json.JsonEncodedText PropHighlightQuery = System.Text.Json.JsonEncodedText.Encode("highlight_query"); + private static readonly System.Text.Json.JsonEncodedText PropMaxAnalyzedOffset = System.Text.Json.JsonEncodedText.Encode("max_analyzed_offset"); + private static readonly System.Text.Json.JsonEncodedText PropMaxFragmentLength = System.Text.Json.JsonEncodedText.Encode("max_fragment_length"); + private static readonly System.Text.Json.JsonEncodedText PropNoMatchSize = System.Text.Json.JsonEncodedText.Encode("no_match_size"); + private static readonly System.Text.Json.JsonEncodedText PropNumberOfFragments = System.Text.Json.JsonEncodedText.Encode("number_of_fragments"); + private static readonly System.Text.Json.JsonEncodedText PropOptions = System.Text.Json.JsonEncodedText.Encode("options"); + private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); + private static readonly System.Text.Json.JsonEncodedText PropPhraseLimit = System.Text.Json.JsonEncodedText.Encode("phrase_limit"); + private static readonly System.Text.Json.JsonEncodedText PropPostTags = System.Text.Json.JsonEncodedText.Encode("post_tags"); + private static readonly System.Text.Json.JsonEncodedText PropPreTags = System.Text.Json.JsonEncodedText.Encode("pre_tags"); + private static readonly System.Text.Json.JsonEncodedText PropRequireFieldMatch = System.Text.Json.JsonEncodedText.Encode("require_field_match"); + private static readonly System.Text.Json.JsonEncodedText PropTagsSchema = System.Text.Json.JsonEncodedText.Encode("tags_schema"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Core.Search.Highlight Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoundaryChars = default; + LocalJsonValue propBoundaryMaxScan = default; + LocalJsonValue propBoundaryScanner = default; + LocalJsonValue propBoundaryScannerLocale = default; + LocalJsonValue propEncoder = default; + LocalJsonValue>> propFields = default; + LocalJsonValue propForceSource = default; + LocalJsonValue propFragmenter = default; + LocalJsonValue propFragmentSize = default; + LocalJsonValue propHighlightFilter = default; + LocalJsonValue propHighlightQuery = default; + LocalJsonValue propMaxAnalyzedOffset = default; + LocalJsonValue propMaxFragmentLength = default; + LocalJsonValue propNoMatchSize = default; + LocalJsonValue propNumberOfFragments = default; + LocalJsonValue?> propOptions = default; + LocalJsonValue propOrder = default; + LocalJsonValue propPhraseLimit = default; + LocalJsonValue?> propPostTags = default; + LocalJsonValue?> propPreTags = default; + LocalJsonValue propRequireFieldMatch = default; + LocalJsonValue propTagsSchema = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoundaryChars.TryReadProperty(ref reader, options, PropBoundaryChars, null)) + { + continue; + } + + if (propBoundaryMaxScan.TryReadProperty(ref reader, options, PropBoundaryMaxScan, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propBoundaryScanner.TryReadProperty(ref reader, options, PropBoundaryScanner, static Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propBoundaryScannerLocale.TryReadProperty(ref reader, options, PropBoundaryScannerLocale, null)) + { + continue; + } + + if (propEncoder.TryReadProperty(ref reader, options, PropEncoder, static Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.ICollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue>(o, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null))!)) + { + continue; + } + + if (propForceSource.TryReadProperty(ref reader, options, PropForceSource, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFragmenter.TryReadProperty(ref reader, options, PropFragmenter, static Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFragmentSize.TryReadProperty(ref reader, options, PropFragmentSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propHighlightFilter.TryReadProperty(ref reader, options, PropHighlightFilter, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propHighlightQuery.TryReadProperty(ref reader, options, PropHighlightQuery, null)) + { + continue; + } + + if (propMaxAnalyzedOffset.TryReadProperty(ref reader, options, PropMaxAnalyzedOffset, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxFragmentLength.TryReadProperty(ref reader, options, PropMaxFragmentLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNoMatchSize.TryReadProperty(ref reader, options, PropNoMatchSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNumberOfFragments.TryReadProperty(ref reader, options, PropNumberOfFragments, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOptions.TryReadProperty(ref reader, options, PropOptions, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propOrder.TryReadProperty(ref reader, options, PropOrder, static Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPhraseLimit.TryReadProperty(ref reader, options, PropPhraseLimit, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPostTags.TryReadProperty(ref reader, options, PropPostTags, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propPreTags.TryReadProperty(ref reader, options, PropPreTags, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propRequireFieldMatch.TryReadProperty(ref reader, options, PropRequireFieldMatch, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTagsSchema.TryReadProperty(ref reader, options, PropTagsSchema, static Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, static Elastic.Clients.Elasticsearch.Core.Search.HighlighterType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.Highlight(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BoundaryChars = propBoundaryChars.Value, + BoundaryMaxScan = propBoundaryMaxScan.Value, + BoundaryScanner = propBoundaryScanner.Value, + BoundaryScannerLocale = propBoundaryScannerLocale.Value, + Encoder = propEncoder.Value, + Fields = propFields.Value, + ForceSource = propForceSource.Value, + Fragmenter = propFragmenter.Value, + FragmentSize = propFragmentSize.Value, + HighlightFilter = propHighlightFilter.Value, + HighlightQuery = propHighlightQuery.Value, + MaxAnalyzedOffset = propMaxAnalyzedOffset.Value, + MaxFragmentLength = propMaxFragmentLength.Value, + NoMatchSize = propNoMatchSize.Value, + NumberOfFragments = propNumberOfFragments.Value, + Options = propOptions.Value, + Order = propOrder.Value, + PhraseLimit = propPhraseLimit.Value, + PostTags = propPostTags.Value, + PreTags = propPreTags.Value, + RequireFieldMatch = propRequireFieldMatch.Value, + TagsSchema = propTagsSchema.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.Highlight value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoundaryChars, value.BoundaryChars, null, null); + writer.WriteProperty(options, PropBoundaryMaxScan, value.BoundaryMaxScan, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropBoundaryScanner, value.BoundaryScanner, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropBoundaryScannerLocale, value.BoundaryScannerLocale, null, null); + writer.WriteProperty(options, PropEncoder, value.Encoder, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection> v) => w.WriteSingleOrManyCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null))); + writer.WriteProperty(options, PropForceSource, value.ForceSource, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFragmenter, value.Fragmenter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFragmentSize, value.FragmentSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropHighlightFilter, value.HighlightFilter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropHighlightQuery, value.HighlightQuery, null, null); + writer.WriteProperty(options, PropMaxAnalyzedOffset, value.MaxAnalyzedOffset, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxFragmentLength, value.MaxFragmentLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNoMatchSize, value.NoMatchSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNumberOfFragments, value.NumberOfFragments, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOptions, value.Options, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPhraseLimit, value.PhraseLimit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPostTags, value.PostTags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPreTags, value.PreTags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRequireFieldMatch, value.RequireFieldMatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTagsSchema, value.TagsSchema, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.HighlighterType? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Highlight.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Highlight.g.cs index eda3637589f..6a063ef3102 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Highlight.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Highlight.g.cs @@ -23,244 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class HighlightConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoundaryChars = System.Text.Json.JsonEncodedText.Encode("boundary_chars"); - private static readonly System.Text.Json.JsonEncodedText PropBoundaryMaxScan = System.Text.Json.JsonEncodedText.Encode("boundary_max_scan"); - private static readonly System.Text.Json.JsonEncodedText PropBoundaryScanner = System.Text.Json.JsonEncodedText.Encode("boundary_scanner"); - private static readonly System.Text.Json.JsonEncodedText PropBoundaryScannerLocale = System.Text.Json.JsonEncodedText.Encode("boundary_scanner_locale"); - private static readonly System.Text.Json.JsonEncodedText PropEncoder = System.Text.Json.JsonEncodedText.Encode("encoder"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropForceSource = System.Text.Json.JsonEncodedText.Encode("force_source"); - private static readonly System.Text.Json.JsonEncodedText PropFragmenter = System.Text.Json.JsonEncodedText.Encode("fragmenter"); - private static readonly System.Text.Json.JsonEncodedText PropFragmentSize = System.Text.Json.JsonEncodedText.Encode("fragment_size"); - private static readonly System.Text.Json.JsonEncodedText PropHighlightFilter = System.Text.Json.JsonEncodedText.Encode("highlight_filter"); - private static readonly System.Text.Json.JsonEncodedText PropHighlightQuery = System.Text.Json.JsonEncodedText.Encode("highlight_query"); - private static readonly System.Text.Json.JsonEncodedText PropMaxAnalyzedOffset = System.Text.Json.JsonEncodedText.Encode("max_analyzed_offset"); - private static readonly System.Text.Json.JsonEncodedText PropMaxFragmentLength = System.Text.Json.JsonEncodedText.Encode("max_fragment_length"); - private static readonly System.Text.Json.JsonEncodedText PropNoMatchSize = System.Text.Json.JsonEncodedText.Encode("no_match_size"); - private static readonly System.Text.Json.JsonEncodedText PropNumberOfFragments = System.Text.Json.JsonEncodedText.Encode("number_of_fragments"); - private static readonly System.Text.Json.JsonEncodedText PropOptions = System.Text.Json.JsonEncodedText.Encode("options"); - private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); - private static readonly System.Text.Json.JsonEncodedText PropPhraseLimit = System.Text.Json.JsonEncodedText.Encode("phrase_limit"); - private static readonly System.Text.Json.JsonEncodedText PropPostTags = System.Text.Json.JsonEncodedText.Encode("post_tags"); - private static readonly System.Text.Json.JsonEncodedText PropPreTags = System.Text.Json.JsonEncodedText.Encode("pre_tags"); - private static readonly System.Text.Json.JsonEncodedText PropRequireFieldMatch = System.Text.Json.JsonEncodedText.Encode("require_field_match"); - private static readonly System.Text.Json.JsonEncodedText PropTagsSchema = System.Text.Json.JsonEncodedText.Encode("tags_schema"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Core.Search.Highlight Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoundaryChars = default; - LocalJsonValue propBoundaryMaxScan = default; - LocalJsonValue propBoundaryScanner = default; - LocalJsonValue propBoundaryScannerLocale = default; - LocalJsonValue propEncoder = default; - LocalJsonValue>> propFields = default; - LocalJsonValue propForceSource = default; - LocalJsonValue propFragmenter = default; - LocalJsonValue propFragmentSize = default; - LocalJsonValue propHighlightFilter = default; - LocalJsonValue propHighlightQuery = default; - LocalJsonValue propMaxAnalyzedOffset = default; - LocalJsonValue propMaxFragmentLength = default; - LocalJsonValue propNoMatchSize = default; - LocalJsonValue propNumberOfFragments = default; - LocalJsonValue?> propOptions = default; - LocalJsonValue propOrder = default; - LocalJsonValue propPhraseLimit = default; - LocalJsonValue?> propPostTags = default; - LocalJsonValue?> propPreTags = default; - LocalJsonValue propRequireFieldMatch = default; - LocalJsonValue propTagsSchema = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoundaryChars.TryReadProperty(ref reader, options, PropBoundaryChars, null)) - { - continue; - } - - if (propBoundaryMaxScan.TryReadProperty(ref reader, options, PropBoundaryMaxScan, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propBoundaryScanner.TryReadProperty(ref reader, options, PropBoundaryScanner, static Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propBoundaryScannerLocale.TryReadProperty(ref reader, options, PropBoundaryScannerLocale, null)) - { - continue; - } - - if (propEncoder.TryReadProperty(ref reader, options, PropEncoder, static Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.ICollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue>(o, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null))!)) - { - continue; - } - - if (propForceSource.TryReadProperty(ref reader, options, PropForceSource, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFragmenter.TryReadProperty(ref reader, options, PropFragmenter, static Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFragmentSize.TryReadProperty(ref reader, options, PropFragmentSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propHighlightFilter.TryReadProperty(ref reader, options, PropHighlightFilter, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propHighlightQuery.TryReadProperty(ref reader, options, PropHighlightQuery, null)) - { - continue; - } - - if (propMaxAnalyzedOffset.TryReadProperty(ref reader, options, PropMaxAnalyzedOffset, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxFragmentLength.TryReadProperty(ref reader, options, PropMaxFragmentLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNoMatchSize.TryReadProperty(ref reader, options, PropNoMatchSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNumberOfFragments.TryReadProperty(ref reader, options, PropNumberOfFragments, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOptions.TryReadProperty(ref reader, options, PropOptions, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propOrder.TryReadProperty(ref reader, options, PropOrder, static Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPhraseLimit.TryReadProperty(ref reader, options, PropPhraseLimit, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPostTags.TryReadProperty(ref reader, options, PropPostTags, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propPreTags.TryReadProperty(ref reader, options, PropPreTags, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propRequireFieldMatch.TryReadProperty(ref reader, options, PropRequireFieldMatch, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTagsSchema.TryReadProperty(ref reader, options, PropTagsSchema, static Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, static Elastic.Clients.Elasticsearch.Core.Search.HighlighterType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.Highlight(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BoundaryChars = propBoundaryChars.Value, - BoundaryMaxScan = propBoundaryMaxScan.Value, - BoundaryScanner = propBoundaryScanner.Value, - BoundaryScannerLocale = propBoundaryScannerLocale.Value, - Encoder = propEncoder.Value, - Fields = propFields.Value, - ForceSource = propForceSource.Value, - Fragmenter = propFragmenter.Value, - FragmentSize = propFragmentSize.Value, - HighlightFilter = propHighlightFilter.Value, - HighlightQuery = propHighlightQuery.Value, - MaxAnalyzedOffset = propMaxAnalyzedOffset.Value, - MaxFragmentLength = propMaxFragmentLength.Value, - NoMatchSize = propNoMatchSize.Value, - NumberOfFragments = propNumberOfFragments.Value, - Options = propOptions.Value, - Order = propOrder.Value, - PhraseLimit = propPhraseLimit.Value, - PostTags = propPostTags.Value, - PreTags = propPreTags.Value, - RequireFieldMatch = propRequireFieldMatch.Value, - TagsSchema = propTagsSchema.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.Highlight value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoundaryChars, value.BoundaryChars, null, null); - writer.WriteProperty(options, PropBoundaryMaxScan, value.BoundaryMaxScan, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropBoundaryScanner, value.BoundaryScanner, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropBoundaryScannerLocale, value.BoundaryScannerLocale, null, null); - writer.WriteProperty(options, PropEncoder, value.Encoder, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection> v) => w.WriteSingleOrManyCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null))); - writer.WriteProperty(options, PropForceSource, value.ForceSource, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFragmenter, value.Fragmenter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFragmentSize, value.FragmentSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropHighlightFilter, value.HighlightFilter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropHighlightQuery, value.HighlightQuery, null, null); - writer.WriteProperty(options, PropMaxAnalyzedOffset, value.MaxAnalyzedOffset, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxFragmentLength, value.MaxFragmentLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNoMatchSize, value.NoMatchSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNumberOfFragments, value.NumberOfFragments, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOptions, value.Options, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPhraseLimit, value.PhraseLimit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPostTags, value.PostTags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPreTags, value.PreTags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRequireFieldMatch, value.RequireFieldMatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTagsSchema, value.TagsSchema, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.HighlighterType? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.HighlightConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.HighlightConverter))] public sealed partial class Highlight { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlightField.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlightField.Converters.g.cs new file mode 100644 index 00000000000..7176a997bbd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlightField.Converters.g.cs @@ -0,0 +1,261 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class HighlightFieldConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoundaryChars = System.Text.Json.JsonEncodedText.Encode("boundary_chars"); + private static readonly System.Text.Json.JsonEncodedText PropBoundaryMaxScan = System.Text.Json.JsonEncodedText.Encode("boundary_max_scan"); + private static readonly System.Text.Json.JsonEncodedText PropBoundaryScanner = System.Text.Json.JsonEncodedText.Encode("boundary_scanner"); + private static readonly System.Text.Json.JsonEncodedText PropBoundaryScannerLocale = System.Text.Json.JsonEncodedText.Encode("boundary_scanner_locale"); + private static readonly System.Text.Json.JsonEncodedText PropForceSource = System.Text.Json.JsonEncodedText.Encode("force_source"); + private static readonly System.Text.Json.JsonEncodedText PropFragmenter = System.Text.Json.JsonEncodedText.Encode("fragmenter"); + private static readonly System.Text.Json.JsonEncodedText PropFragmentOffset = System.Text.Json.JsonEncodedText.Encode("fragment_offset"); + private static readonly System.Text.Json.JsonEncodedText PropFragmentSize = System.Text.Json.JsonEncodedText.Encode("fragment_size"); + private static readonly System.Text.Json.JsonEncodedText PropHighlightFilter = System.Text.Json.JsonEncodedText.Encode("highlight_filter"); + private static readonly System.Text.Json.JsonEncodedText PropHighlightQuery = System.Text.Json.JsonEncodedText.Encode("highlight_query"); + private static readonly System.Text.Json.JsonEncodedText PropMatchedFields = System.Text.Json.JsonEncodedText.Encode("matched_fields"); + private static readonly System.Text.Json.JsonEncodedText PropMaxAnalyzedOffset = System.Text.Json.JsonEncodedText.Encode("max_analyzed_offset"); + private static readonly System.Text.Json.JsonEncodedText PropMaxFragmentLength = System.Text.Json.JsonEncodedText.Encode("max_fragment_length"); + private static readonly System.Text.Json.JsonEncodedText PropNoMatchSize = System.Text.Json.JsonEncodedText.Encode("no_match_size"); + private static readonly System.Text.Json.JsonEncodedText PropNumberOfFragments = System.Text.Json.JsonEncodedText.Encode("number_of_fragments"); + private static readonly System.Text.Json.JsonEncodedText PropOptions = System.Text.Json.JsonEncodedText.Encode("options"); + private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); + private static readonly System.Text.Json.JsonEncodedText PropPhraseLimit = System.Text.Json.JsonEncodedText.Encode("phrase_limit"); + private static readonly System.Text.Json.JsonEncodedText PropPostTags = System.Text.Json.JsonEncodedText.Encode("post_tags"); + private static readonly System.Text.Json.JsonEncodedText PropPreTags = System.Text.Json.JsonEncodedText.Encode("pre_tags"); + private static readonly System.Text.Json.JsonEncodedText PropRequireFieldMatch = System.Text.Json.JsonEncodedText.Encode("require_field_match"); + private static readonly System.Text.Json.JsonEncodedText PropTagsSchema = System.Text.Json.JsonEncodedText.Encode("tags_schema"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Core.Search.HighlightField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoundaryChars = default; + LocalJsonValue propBoundaryMaxScan = default; + LocalJsonValue propBoundaryScanner = default; + LocalJsonValue propBoundaryScannerLocale = default; + LocalJsonValue propForceSource = default; + LocalJsonValue propFragmenter = default; + LocalJsonValue propFragmentOffset = default; + LocalJsonValue propFragmentSize = default; + LocalJsonValue propHighlightFilter = default; + LocalJsonValue propHighlightQuery = default; + LocalJsonValue propMatchedFields = default; + LocalJsonValue propMaxAnalyzedOffset = default; + LocalJsonValue propMaxFragmentLength = default; + LocalJsonValue propNoMatchSize = default; + LocalJsonValue propNumberOfFragments = default; + LocalJsonValue?> propOptions = default; + LocalJsonValue propOrder = default; + LocalJsonValue propPhraseLimit = default; + LocalJsonValue?> propPostTags = default; + LocalJsonValue?> propPreTags = default; + LocalJsonValue propRequireFieldMatch = default; + LocalJsonValue propTagsSchema = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoundaryChars.TryReadProperty(ref reader, options, PropBoundaryChars, null)) + { + continue; + } + + if (propBoundaryMaxScan.TryReadProperty(ref reader, options, PropBoundaryMaxScan, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propBoundaryScanner.TryReadProperty(ref reader, options, PropBoundaryScanner, static Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propBoundaryScannerLocale.TryReadProperty(ref reader, options, PropBoundaryScannerLocale, null)) + { + continue; + } + + if (propForceSource.TryReadProperty(ref reader, options, PropForceSource, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFragmenter.TryReadProperty(ref reader, options, PropFragmenter, static Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFragmentOffset.TryReadProperty(ref reader, options, PropFragmentOffset, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFragmentSize.TryReadProperty(ref reader, options, PropFragmentSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propHighlightFilter.TryReadProperty(ref reader, options, PropHighlightFilter, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propHighlightQuery.TryReadProperty(ref reader, options, PropHighlightQuery, null)) + { + continue; + } + + if (propMatchedFields.TryReadProperty(ref reader, options, PropMatchedFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propMaxAnalyzedOffset.TryReadProperty(ref reader, options, PropMaxAnalyzedOffset, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxFragmentLength.TryReadProperty(ref reader, options, PropMaxFragmentLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNoMatchSize.TryReadProperty(ref reader, options, PropNoMatchSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNumberOfFragments.TryReadProperty(ref reader, options, PropNumberOfFragments, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOptions.TryReadProperty(ref reader, options, PropOptions, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propOrder.TryReadProperty(ref reader, options, PropOrder, static Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPhraseLimit.TryReadProperty(ref reader, options, PropPhraseLimit, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPostTags.TryReadProperty(ref reader, options, PropPostTags, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propPreTags.TryReadProperty(ref reader, options, PropPreTags, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propRequireFieldMatch.TryReadProperty(ref reader, options, PropRequireFieldMatch, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTagsSchema.TryReadProperty(ref reader, options, PropTagsSchema, static Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, static Elastic.Clients.Elasticsearch.Core.Search.HighlighterType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.HighlightField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BoundaryChars = propBoundaryChars.Value, + BoundaryMaxScan = propBoundaryMaxScan.Value, + BoundaryScanner = propBoundaryScanner.Value, + BoundaryScannerLocale = propBoundaryScannerLocale.Value, + ForceSource = propForceSource.Value, + Fragmenter = propFragmenter.Value, + FragmentOffset = propFragmentOffset.Value, + FragmentSize = propFragmentSize.Value, + HighlightFilter = propHighlightFilter.Value, + HighlightQuery = propHighlightQuery.Value, + MatchedFields = propMatchedFields.Value, + MaxAnalyzedOffset = propMaxAnalyzedOffset.Value, + MaxFragmentLength = propMaxFragmentLength.Value, + NoMatchSize = propNoMatchSize.Value, + NumberOfFragments = propNumberOfFragments.Value, + Options = propOptions.Value, + Order = propOrder.Value, + PhraseLimit = propPhraseLimit.Value, + PostTags = propPostTags.Value, + PreTags = propPreTags.Value, + RequireFieldMatch = propRequireFieldMatch.Value, + TagsSchema = propTagsSchema.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.HighlightField value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoundaryChars, value.BoundaryChars, null, null); + writer.WriteProperty(options, PropBoundaryMaxScan, value.BoundaryMaxScan, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropBoundaryScanner, value.BoundaryScanner, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropBoundaryScannerLocale, value.BoundaryScannerLocale, null, null); + writer.WriteProperty(options, PropForceSource, value.ForceSource, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFragmenter, value.Fragmenter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFragmentOffset, value.FragmentOffset, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFragmentSize, value.FragmentSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropHighlightFilter, value.HighlightFilter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropHighlightQuery, value.HighlightQuery, null, null); + writer.WriteProperty(options, PropMatchedFields, value.MatchedFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropMaxAnalyzedOffset, value.MaxAnalyzedOffset, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxFragmentLength, value.MaxFragmentLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNoMatchSize, value.NoMatchSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNumberOfFragments, value.NumberOfFragments, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOptions, value.Options, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPhraseLimit, value.PhraseLimit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPostTags, value.PostTags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPreTags, value.PreTags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRequireFieldMatch, value.RequireFieldMatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTagsSchema, value.TagsSchema, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.HighlighterType? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlightField.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlightField.g.cs index 387fdc1d8fa..080c88c31d6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlightField.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlightField.g.cs @@ -23,244 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class HighlightFieldConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoundaryChars = System.Text.Json.JsonEncodedText.Encode("boundary_chars"); - private static readonly System.Text.Json.JsonEncodedText PropBoundaryMaxScan = System.Text.Json.JsonEncodedText.Encode("boundary_max_scan"); - private static readonly System.Text.Json.JsonEncodedText PropBoundaryScanner = System.Text.Json.JsonEncodedText.Encode("boundary_scanner"); - private static readonly System.Text.Json.JsonEncodedText PropBoundaryScannerLocale = System.Text.Json.JsonEncodedText.Encode("boundary_scanner_locale"); - private static readonly System.Text.Json.JsonEncodedText PropForceSource = System.Text.Json.JsonEncodedText.Encode("force_source"); - private static readonly System.Text.Json.JsonEncodedText PropFragmenter = System.Text.Json.JsonEncodedText.Encode("fragmenter"); - private static readonly System.Text.Json.JsonEncodedText PropFragmentOffset = System.Text.Json.JsonEncodedText.Encode("fragment_offset"); - private static readonly System.Text.Json.JsonEncodedText PropFragmentSize = System.Text.Json.JsonEncodedText.Encode("fragment_size"); - private static readonly System.Text.Json.JsonEncodedText PropHighlightFilter = System.Text.Json.JsonEncodedText.Encode("highlight_filter"); - private static readonly System.Text.Json.JsonEncodedText PropHighlightQuery = System.Text.Json.JsonEncodedText.Encode("highlight_query"); - private static readonly System.Text.Json.JsonEncodedText PropMatchedFields = System.Text.Json.JsonEncodedText.Encode("matched_fields"); - private static readonly System.Text.Json.JsonEncodedText PropMaxAnalyzedOffset = System.Text.Json.JsonEncodedText.Encode("max_analyzed_offset"); - private static readonly System.Text.Json.JsonEncodedText PropMaxFragmentLength = System.Text.Json.JsonEncodedText.Encode("max_fragment_length"); - private static readonly System.Text.Json.JsonEncodedText PropNoMatchSize = System.Text.Json.JsonEncodedText.Encode("no_match_size"); - private static readonly System.Text.Json.JsonEncodedText PropNumberOfFragments = System.Text.Json.JsonEncodedText.Encode("number_of_fragments"); - private static readonly System.Text.Json.JsonEncodedText PropOptions = System.Text.Json.JsonEncodedText.Encode("options"); - private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); - private static readonly System.Text.Json.JsonEncodedText PropPhraseLimit = System.Text.Json.JsonEncodedText.Encode("phrase_limit"); - private static readonly System.Text.Json.JsonEncodedText PropPostTags = System.Text.Json.JsonEncodedText.Encode("post_tags"); - private static readonly System.Text.Json.JsonEncodedText PropPreTags = System.Text.Json.JsonEncodedText.Encode("pre_tags"); - private static readonly System.Text.Json.JsonEncodedText PropRequireFieldMatch = System.Text.Json.JsonEncodedText.Encode("require_field_match"); - private static readonly System.Text.Json.JsonEncodedText PropTagsSchema = System.Text.Json.JsonEncodedText.Encode("tags_schema"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Core.Search.HighlightField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoundaryChars = default; - LocalJsonValue propBoundaryMaxScan = default; - LocalJsonValue propBoundaryScanner = default; - LocalJsonValue propBoundaryScannerLocale = default; - LocalJsonValue propForceSource = default; - LocalJsonValue propFragmenter = default; - LocalJsonValue propFragmentOffset = default; - LocalJsonValue propFragmentSize = default; - LocalJsonValue propHighlightFilter = default; - LocalJsonValue propHighlightQuery = default; - LocalJsonValue propMatchedFields = default; - LocalJsonValue propMaxAnalyzedOffset = default; - LocalJsonValue propMaxFragmentLength = default; - LocalJsonValue propNoMatchSize = default; - LocalJsonValue propNumberOfFragments = default; - LocalJsonValue?> propOptions = default; - LocalJsonValue propOrder = default; - LocalJsonValue propPhraseLimit = default; - LocalJsonValue?> propPostTags = default; - LocalJsonValue?> propPreTags = default; - LocalJsonValue propRequireFieldMatch = default; - LocalJsonValue propTagsSchema = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoundaryChars.TryReadProperty(ref reader, options, PropBoundaryChars, null)) - { - continue; - } - - if (propBoundaryMaxScan.TryReadProperty(ref reader, options, PropBoundaryMaxScan, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propBoundaryScanner.TryReadProperty(ref reader, options, PropBoundaryScanner, static Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propBoundaryScannerLocale.TryReadProperty(ref reader, options, PropBoundaryScannerLocale, null)) - { - continue; - } - - if (propForceSource.TryReadProperty(ref reader, options, PropForceSource, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFragmenter.TryReadProperty(ref reader, options, PropFragmenter, static Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFragmentOffset.TryReadProperty(ref reader, options, PropFragmentOffset, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFragmentSize.TryReadProperty(ref reader, options, PropFragmentSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propHighlightFilter.TryReadProperty(ref reader, options, PropHighlightFilter, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propHighlightQuery.TryReadProperty(ref reader, options, PropHighlightQuery, null)) - { - continue; - } - - if (propMatchedFields.TryReadProperty(ref reader, options, PropMatchedFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propMaxAnalyzedOffset.TryReadProperty(ref reader, options, PropMaxAnalyzedOffset, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxFragmentLength.TryReadProperty(ref reader, options, PropMaxFragmentLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNoMatchSize.TryReadProperty(ref reader, options, PropNoMatchSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNumberOfFragments.TryReadProperty(ref reader, options, PropNumberOfFragments, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOptions.TryReadProperty(ref reader, options, PropOptions, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propOrder.TryReadProperty(ref reader, options, PropOrder, static Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPhraseLimit.TryReadProperty(ref reader, options, PropPhraseLimit, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPostTags.TryReadProperty(ref reader, options, PropPostTags, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propPreTags.TryReadProperty(ref reader, options, PropPreTags, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propRequireFieldMatch.TryReadProperty(ref reader, options, PropRequireFieldMatch, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTagsSchema.TryReadProperty(ref reader, options, PropTagsSchema, static Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, static Elastic.Clients.Elasticsearch.Core.Search.HighlighterType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.HighlightField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BoundaryChars = propBoundaryChars.Value, - BoundaryMaxScan = propBoundaryMaxScan.Value, - BoundaryScanner = propBoundaryScanner.Value, - BoundaryScannerLocale = propBoundaryScannerLocale.Value, - ForceSource = propForceSource.Value, - Fragmenter = propFragmenter.Value, - FragmentOffset = propFragmentOffset.Value, - FragmentSize = propFragmentSize.Value, - HighlightFilter = propHighlightFilter.Value, - HighlightQuery = propHighlightQuery.Value, - MatchedFields = propMatchedFields.Value, - MaxAnalyzedOffset = propMaxAnalyzedOffset.Value, - MaxFragmentLength = propMaxFragmentLength.Value, - NoMatchSize = propNoMatchSize.Value, - NumberOfFragments = propNumberOfFragments.Value, - Options = propOptions.Value, - Order = propOrder.Value, - PhraseLimit = propPhraseLimit.Value, - PostTags = propPostTags.Value, - PreTags = propPreTags.Value, - RequireFieldMatch = propRequireFieldMatch.Value, - TagsSchema = propTagsSchema.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.HighlightField value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoundaryChars, value.BoundaryChars, null, null); - writer.WriteProperty(options, PropBoundaryMaxScan, value.BoundaryMaxScan, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropBoundaryScanner, value.BoundaryScanner, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropBoundaryScannerLocale, value.BoundaryScannerLocale, null, null); - writer.WriteProperty(options, PropForceSource, value.ForceSource, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFragmenter, value.Fragmenter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFragmentOffset, value.FragmentOffset, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFragmentSize, value.FragmentSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropHighlightFilter, value.HighlightFilter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropHighlightQuery, value.HighlightQuery, null, null); - writer.WriteProperty(options, PropMatchedFields, value.MatchedFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropMaxAnalyzedOffset, value.MaxAnalyzedOffset, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxFragmentLength, value.MaxFragmentLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNoMatchSize, value.NoMatchSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNumberOfFragments, value.NumberOfFragments, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOptions, value.Options, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPhraseLimit, value.PhraseLimit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPostTags, value.PostTags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPreTags, value.PreTags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRequireFieldMatch, value.RequireFieldMatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTagsSchema, value.TagsSchema, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.HighlighterType? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.HighlightFieldConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.HighlightFieldConverter))] public sealed partial class HighlightField { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterEncoder.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterEncoder.Converters.g.cs new file mode 100644 index 00000000000..6cb03088b29 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterEncoder.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class HighlighterEncoderConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberDefault = System.Text.Json.JsonEncodedText.Encode("default"); + private static readonly System.Text.Json.JsonEncodedText MemberHtml = System.Text.Json.JsonEncodedText.Encode("html"); + + public override Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberDefault)) + { + return Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder.Default; + } + + if (reader.ValueTextEquals(MemberHtml)) + { + return Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder.Html; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberDefault.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder.Default; + } + + if (string.Equals(value, MemberHtml.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder.Html; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder.Default: + writer.WriteStringValue(MemberDefault); + break; + case Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder.Html: + writer.WriteStringValue(MemberHtml); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterEncoder.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterEncoder.g.cs new file mode 100644 index 00000000000..a5232c672bc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterEncoder.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.HighlighterEncoderConverter))] +public enum HighlighterEncoder +{ + [System.Runtime.Serialization.EnumMember(Value = "default")] + Default, + [System.Runtime.Serialization.EnumMember(Value = "html")] + Html +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterFragmenter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterFragmenter.Converters.g.cs new file mode 100644 index 00000000000..223d0dd71dc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterFragmenter.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class HighlighterFragmenterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberSimple = System.Text.Json.JsonEncodedText.Encode("simple"); + private static readonly System.Text.Json.JsonEncodedText MemberSpan = System.Text.Json.JsonEncodedText.Encode("span"); + + public override Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberSimple)) + { + return Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter.Simple; + } + + if (reader.ValueTextEquals(MemberSpan)) + { + return Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter.Span; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberSimple.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter.Simple; + } + + if (string.Equals(value, MemberSpan.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter.Span; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter.Simple: + writer.WriteStringValue(MemberSimple); + break; + case Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter.Span: + writer.WriteStringValue(MemberSpan); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterFragmenter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterFragmenter.g.cs new file mode 100644 index 00000000000..98806e1804c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterFragmenter.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.HighlighterFragmenterConverter))] +public enum HighlighterFragmenter +{ + [System.Runtime.Serialization.EnumMember(Value = "simple")] + Simple, + [System.Runtime.Serialization.EnumMember(Value = "span")] + Span +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterOrder.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterOrder.Converters.g.cs new file mode 100644 index 00000000000..26efd05ec79 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterOrder.Converters.g.cs @@ -0,0 +1,67 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class HighlighterOrderConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberScore = System.Text.Json.JsonEncodedText.Encode("score"); + + public override Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberScore)) + { + return Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder.Score; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberScore.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder.Score; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder.Score: + writer.WriteStringValue(MemberScore); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterOrder.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterOrder.g.cs new file mode 100644 index 00000000000..404456f39ae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterOrder.g.cs @@ -0,0 +1,31 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.HighlighterOrderConverter))] +public enum HighlighterOrder +{ + [System.Runtime.Serialization.EnumMember(Value = "score")] + Score +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterTagsSchema.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterTagsSchema.Converters.g.cs new file mode 100644 index 00000000000..c1c2c534b0f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterTagsSchema.Converters.g.cs @@ -0,0 +1,67 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class HighlighterTagsSchemaConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberStyled = System.Text.Json.JsonEncodedText.Encode("styled"); + + public override Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberStyled)) + { + return Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema.Styled; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberStyled.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema.Styled; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema.Styled: + writer.WriteStringValue(MemberStyled); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterTagsSchema.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterTagsSchema.g.cs new file mode 100644 index 00000000000..3658a987b58 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterTagsSchema.g.cs @@ -0,0 +1,31 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.HighlighterTagsSchemaConverter))] +public enum HighlighterTagsSchema +{ + [System.Runtime.Serialization.EnumMember(Value = "styled")] + Styled +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterType.Converters.g.cs new file mode 100644 index 00000000000..933fc2eea56 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterType.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class HighlighterTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Core.Search.HighlighterType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Core.Search.HighlighterType(reader.ReadValue(options, null)); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.HighlighterType value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Value, null); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterType.g.cs new file mode 100644 index 00000000000..eaf1d8627ed --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HighlighterType.g.cs @@ -0,0 +1,69 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.HighlighterTypeConverter))] +public readonly partial struct HighlighterType : Elastic.Clients.Elasticsearch.Serialization.IEnumStruct +{ + public HighlighterType(string value) => Value = value; +#if NET7_0_OR_GREATER + static HighlighterType IEnumStruct.Create(string value) => value; +#else + HighlighterType IEnumStruct.Create(string value) => value; +#endif + public readonly string Value { get; } + + /// + /// + /// The fvh highlighter uses the Lucene Fast Vector highlighter. + /// + /// + public static HighlighterType FastVector { get; } = new HighlighterType("fvh"); + + /// + /// + /// The plain highlighter uses the standard Lucene highlighter + /// + /// + public static HighlighterType Plain { get; } = new HighlighterType("plain"); + + /// + /// + /// The unified highlighter uses the Lucene Unified Highlighter. + /// + /// + public static HighlighterType Unified { get; } = new HighlighterType("unified"); + + public override string ToString() => Value ?? string.Empty; + + public static implicit operator string(HighlighterType @enum) => @enum.Value; + public static implicit operator HighlighterType(string value) => new(value); + + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals(object obj) => obj is HighlighterType other && this.Equals(other); + public bool Equals(HighlighterType other) => Value == other.Value; + + public static bool operator ==(HighlighterType a, HighlighterType b) => a.Equals(b); + public static bool operator !=(HighlighterType a, HighlighterType b) => !(a == b); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Hit.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Hit.Converters.g.cs new file mode 100644 index 00000000000..ef116adf70f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Hit.Converters.g.cs @@ -0,0 +1,250 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class HitConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropExplanation = System.Text.Json.JsonEncodedText.Encode("_explanation"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropHighlight = System.Text.Json.JsonEncodedText.Encode("highlight"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); + private static readonly System.Text.Json.JsonEncodedText PropIgnored = System.Text.Json.JsonEncodedText.Encode("_ignored"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoredFieldValues = System.Text.Json.JsonEncodedText.Encode("ignored_field_values"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); + private static readonly System.Text.Json.JsonEncodedText PropInnerHits = System.Text.Json.JsonEncodedText.Encode("inner_hits"); + private static readonly System.Text.Json.JsonEncodedText PropMatchedQueries = System.Text.Json.JsonEncodedText.Encode("matched_queries"); + private static readonly System.Text.Json.JsonEncodedText PropNested = System.Text.Json.JsonEncodedText.Encode("_nested"); + private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("_node"); + private static readonly System.Text.Json.JsonEncodedText PropPrimaryTerm = System.Text.Json.JsonEncodedText.Encode("_primary_term"); + private static readonly System.Text.Json.JsonEncodedText PropRank = System.Text.Json.JsonEncodedText.Encode("_rank"); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("_routing"); + private static readonly System.Text.Json.JsonEncodedText PropScore = System.Text.Json.JsonEncodedText.Encode("_score"); + private static readonly System.Text.Json.JsonEncodedText PropSeqNo = System.Text.Json.JsonEncodedText.Encode("_seq_no"); + private static readonly System.Text.Json.JsonEncodedText PropShard = System.Text.Json.JsonEncodedText.Encode("_shard"); + 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 PropVersion = System.Text.Json.JsonEncodedText.Encode("_version"); + + public override Elastic.Clients.Elasticsearch.Core.Search.Hit Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExplanation = default; + LocalJsonValue?> propFields = default; + LocalJsonValue>?> propHighlight = default; + LocalJsonValue propId = default; + LocalJsonValue?> propIgnored = default; + LocalJsonValue>?> propIgnoredFieldValues = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propInnerHits = default; + LocalJsonValue, System.Collections.Generic.IReadOnlyDictionary>?> propMatchedQueries = default; + LocalJsonValue propNested = default; + LocalJsonValue propNode = default; + LocalJsonValue propPrimaryTerm = default; + LocalJsonValue propRank = default; + LocalJsonValue propRouting = default; + LocalJsonValue propScore = default; + LocalJsonValue propSeqNo = default; + LocalJsonValue propShard = default; + LocalJsonValue?> propSort = default; + LocalJsonValue propSource = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExplanation.TryReadProperty(ref reader, options, PropExplanation, null)) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propHighlight.TryReadProperty(ref reader, options, PropHighlight, static System.Collections.Generic.IReadOnlyDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIgnored.TryReadProperty(ref reader, options, PropIgnored, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propIgnoredFieldValues.TryReadProperty(ref reader, options, PropIgnoredFieldValues, static System.Collections.Generic.IReadOnlyDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propInnerHits.TryReadProperty(ref reader, options, PropInnerHits, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propMatchedQueries.TryReadProperty(ref reader, options, PropMatchedQueries, static Elastic.Clients.Elasticsearch.Union, System.Collections.Generic.IReadOnlyDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue, System.Collections.Generic.IReadOnlyDictionary>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject), static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!))) + { + continue; + } + + if (propNested.TryReadProperty(ref reader, options, PropNested, null)) + { + continue; + } + + if (propNode.TryReadProperty(ref reader, options, PropNode, null)) + { + continue; + } + + if (propPrimaryTerm.TryReadProperty(ref reader, options, PropPrimaryTerm, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRank.TryReadProperty(ref reader, options, PropRank, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (propScore.TryReadProperty(ref reader, options, PropScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSeqNo.TryReadProperty(ref reader, options, PropSeqNo, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propShard.TryReadProperty(ref reader, options, PropShard, null)) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, static TDocument? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.Hit(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Explanation = propExplanation.Value, + Fields = propFields.Value, + Highlight = propHighlight.Value, + Id = propId.Value, + Ignored = propIgnored.Value, + IgnoredFieldValues = propIgnoredFieldValues.Value, + Index = propIndex.Value, + InnerHits = propInnerHits.Value, + MatchedQueries = propMatchedQueries.Value, + Nested = propNested.Value, + Node = propNode.Value, + PrimaryTerm = propPrimaryTerm.Value, + Rank = propRank.Value, + Routing = propRouting.Value, + Score = propScore.Value, + SeqNo = propSeqNo.Value, + Shard = propShard.Value, + Sort = propSort.Value, + Source = propSource.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.Hit value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExplanation, value.Explanation, null, null); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropHighlight, value.Highlight, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIgnored, value.Ignored, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIgnoredFieldValues, value.IgnoredFieldValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))))); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropInnerHits, value.InnerHits, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropMatchedQueries, value.MatchedQueries, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union, System.Collections.Generic.IReadOnlyDictionary>? v) => w.WriteUnionValue, System.Collections.Generic.IReadOnlyDictionary>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null))); + writer.WriteProperty(options, PropNested, value.Nested, null, null); + writer.WriteProperty(options, PropNode, value.Node, null, null); + writer.WriteProperty(options, PropPrimaryTerm, value.PrimaryTerm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRank, value.Rank, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteProperty(options, PropScore, value.Score, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSeqNo, value.SeqNo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropShard, value.Shard, null, null); + writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSource, value.Source, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TDocument? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} + +public sealed partial class HitConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(Hit<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(HitConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Hit.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Hit.g.cs index e42e2cdf22a..10a4384e069 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Hit.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Hit.g.cs @@ -23,233 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class HitConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropExplanation = System.Text.Json.JsonEncodedText.Encode("_explanation"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropHighlight = System.Text.Json.JsonEncodedText.Encode("highlight"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - private static readonly System.Text.Json.JsonEncodedText PropIgnored = System.Text.Json.JsonEncodedText.Encode("_ignored"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoredFieldValues = System.Text.Json.JsonEncodedText.Encode("ignored_field_values"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); - private static readonly System.Text.Json.JsonEncodedText PropInnerHits = System.Text.Json.JsonEncodedText.Encode("inner_hits"); - private static readonly System.Text.Json.JsonEncodedText PropMatchedQueries = System.Text.Json.JsonEncodedText.Encode("matched_queries"); - private static readonly System.Text.Json.JsonEncodedText PropNested = System.Text.Json.JsonEncodedText.Encode("_nested"); - private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("_node"); - private static readonly System.Text.Json.JsonEncodedText PropPrimaryTerm = System.Text.Json.JsonEncodedText.Encode("_primary_term"); - private static readonly System.Text.Json.JsonEncodedText PropRank = System.Text.Json.JsonEncodedText.Encode("_rank"); - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("_routing"); - private static readonly System.Text.Json.JsonEncodedText PropScore = System.Text.Json.JsonEncodedText.Encode("_score"); - private static readonly System.Text.Json.JsonEncodedText PropSeqNo = System.Text.Json.JsonEncodedText.Encode("_seq_no"); - private static readonly System.Text.Json.JsonEncodedText PropShard = System.Text.Json.JsonEncodedText.Encode("_shard"); - 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 PropVersion = System.Text.Json.JsonEncodedText.Encode("_version"); - - public override Elastic.Clients.Elasticsearch.Core.Search.Hit Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propExplanation = default; - LocalJsonValue?> propFields = default; - LocalJsonValue>?> propHighlight = default; - LocalJsonValue propId = default; - LocalJsonValue?> propIgnored = default; - LocalJsonValue>?> propIgnoredFieldValues = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propInnerHits = default; - LocalJsonValue, System.Collections.Generic.IReadOnlyDictionary>?> propMatchedQueries = default; - LocalJsonValue propNested = default; - LocalJsonValue propNode = default; - LocalJsonValue propPrimaryTerm = default; - LocalJsonValue propRank = default; - LocalJsonValue propRouting = default; - LocalJsonValue propScore = default; - LocalJsonValue propSeqNo = default; - LocalJsonValue propShard = default; - LocalJsonValue?> propSort = default; - LocalJsonValue propSource = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExplanation.TryReadProperty(ref reader, options, PropExplanation, null)) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propHighlight.TryReadProperty(ref reader, options, PropHighlight, static System.Collections.Generic.IReadOnlyDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIgnored.TryReadProperty(ref reader, options, PropIgnored, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propIgnoredFieldValues.TryReadProperty(ref reader, options, PropIgnoredFieldValues, static System.Collections.Generic.IReadOnlyDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propInnerHits.TryReadProperty(ref reader, options, PropInnerHits, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propMatchedQueries.TryReadProperty(ref reader, options, PropMatchedQueries, static Elastic.Clients.Elasticsearch.Union, System.Collections.Generic.IReadOnlyDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue, System.Collections.Generic.IReadOnlyDictionary>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject), static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!))) - { - continue; - } - - if (propNested.TryReadProperty(ref reader, options, PropNested, null)) - { - continue; - } - - if (propNode.TryReadProperty(ref reader, options, PropNode, null)) - { - continue; - } - - if (propPrimaryTerm.TryReadProperty(ref reader, options, PropPrimaryTerm, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRank.TryReadProperty(ref reader, options, PropRank, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (propScore.TryReadProperty(ref reader, options, PropScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSeqNo.TryReadProperty(ref reader, options, PropSeqNo, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propShard.TryReadProperty(ref reader, options, PropShard, null)) - { - continue; - } - - if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, static TDocument? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.Hit(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Explanation = propExplanation.Value, - Fields = propFields.Value, - Highlight = propHighlight.Value, - Id = propId.Value, - Ignored = propIgnored.Value, - IgnoredFieldValues = propIgnoredFieldValues.Value, - Index = propIndex.Value, - InnerHits = propInnerHits.Value, - MatchedQueries = propMatchedQueries.Value, - Nested = propNested.Value, - Node = propNode.Value, - PrimaryTerm = propPrimaryTerm.Value, - Rank = propRank.Value, - Routing = propRouting.Value, - Score = propScore.Value, - SeqNo = propSeqNo.Value, - Shard = propShard.Value, - Sort = propSort.Value, - Source = propSource.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.Hit value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExplanation, value.Explanation, null, null); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropHighlight, value.Highlight, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIgnored, value.Ignored, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIgnoredFieldValues, value.IgnoredFieldValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))))); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropInnerHits, value.InnerHits, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropMatchedQueries, value.MatchedQueries, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union, System.Collections.Generic.IReadOnlyDictionary>? v) => w.WriteUnionValue, System.Collections.Generic.IReadOnlyDictionary>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null))); - writer.WriteProperty(options, PropNested, value.Nested, null, null); - writer.WriteProperty(options, PropNode, value.Node, null, null); - writer.WriteProperty(options, PropPrimaryTerm, value.PrimaryTerm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRank, value.Rank, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteProperty(options, PropScore, value.Score, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSeqNo, value.SeqNo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropShard, value.Shard, null, null); - writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSource, value.Source, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TDocument? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -internal sealed partial class HitConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(Hit<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(HitConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.HitConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.HitConverterFactory))] public sealed partial class Hit { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HitsMetadata.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HitsMetadata.Converters.g.cs new file mode 100644 index 00000000000..10ea490e2ca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HitsMetadata.Converters.g.cs @@ -0,0 +1,97 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class HitsMetadataConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropHits = System.Text.Json.JsonEncodedText.Encode("hits"); + private static readonly System.Text.Json.JsonEncodedText PropMaxScore = System.Text.Json.JsonEncodedText.Encode("max_score"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Core.Search.HitsMetadata Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>> propHits = default; + LocalJsonValue propMaxScore = default; + LocalJsonValue?> propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propHits.TryReadProperty(ref reader, options, PropHits, static System.Collections.Generic.IReadOnlyCollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, null)!)) + { + continue; + } + + if (propMaxScore.TryReadProperty(ref reader, options, PropMaxScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number), null, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.HitsMetadata(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Hits = propHits.Value, + MaxScore = propMaxScore.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.HitsMetadata value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropHits, value.Hits, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection> v) => w.WriteCollectionValue>(o, v, null)); + writer.WriteProperty(options, PropMaxScore, value.MaxScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotal, value.Total, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); + writer.WriteEndObject(); + } +} + +public sealed partial class HitsMetadataConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(HitsMetadata<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(HitsMetadataConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HitsMetadata.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HitsMetadata.g.cs index 0e5cc449f48..ae601f75ff1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HitsMetadata.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/HitsMetadata.g.cs @@ -23,80 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class HitsMetadataConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropHits = System.Text.Json.JsonEncodedText.Encode("hits"); - private static readonly System.Text.Json.JsonEncodedText PropMaxScore = System.Text.Json.JsonEncodedText.Encode("max_score"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Core.Search.HitsMetadata Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>> propHits = default; - LocalJsonValue propMaxScore = default; - LocalJsonValue?> propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propHits.TryReadProperty(ref reader, options, PropHits, static System.Collections.Generic.IReadOnlyCollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, null)!)) - { - continue; - } - - if (propMaxScore.TryReadProperty(ref reader, options, PropMaxScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number), null, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.HitsMetadata(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Hits = propHits.Value, - MaxScore = propMaxScore.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.HitsMetadata value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropHits, value.Hits, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection> v) => w.WriteCollectionValue>(o, v, null)); - writer.WriteProperty(options, PropMaxScore, value.MaxScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotal, value.Total, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -internal sealed partial class HitsMetadataConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(HitsMetadata<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(HitsMetadataConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.HitsMetadataConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.HitsMetadataConverterFactory))] public sealed partial class HitsMetadata { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/InnerHits.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/InnerHits.Converters.g.cs new file mode 100644 index 00000000000..fd91c6432e7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/InnerHits.Converters.g.cs @@ -0,0 +1,198 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class InnerHitsConverter : System.Text.Json.Serialization.JsonConverter +{ + 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 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 PropIgnoreUnmapped = System.Text.Json.JsonEncodedText.Encode("ignore_unmapped"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropScriptFields = System.Text.Json.JsonEncodedText.Encode("script_fields"); + 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 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 PropStoredFields = System.Text.Json.JsonEncodedText.Encode("stored_fields"); + private static readonly System.Text.Json.JsonEncodedText PropTrackScores = System.Text.Json.JsonEncodedText.Encode("track_scores"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Core.Search.InnerHits Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCollapse = default; + LocalJsonValue?> propDocvalueFields = default; + LocalJsonValue propExplain = default; + LocalJsonValue propFields = default; + LocalJsonValue propFrom = default; + LocalJsonValue propHighlight = default; + LocalJsonValue propIgnoreUnmapped = default; + LocalJsonValue propName = default; + LocalJsonValue?> propScriptFields = default; + LocalJsonValue propSeqNoPrimaryTerm = default; + LocalJsonValue propSize = default; + LocalJsonValue?> propSort = default; + LocalJsonValue propSource = default; + LocalJsonValue propStoredFields = default; + LocalJsonValue propTrackScores = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCollapse.TryReadProperty(ref reader, options, PropCollapse, null)) + { + continue; + } + + if (propDocvalueFields.TryReadProperty(ref reader, options, PropDocvalueFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propExplain.TryReadProperty(ref reader, options, PropExplain, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propFrom.TryReadProperty(ref reader, options, PropFrom, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propHighlight.TryReadProperty(ref reader, options, PropHighlight, null)) + { + continue; + } + + if (propIgnoreUnmapped.TryReadProperty(ref reader, options, PropIgnoreUnmapped, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propScriptFields.TryReadProperty(ref reader, options, PropScriptFields, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propSeqNoPrimaryTerm.TryReadProperty(ref reader, options, PropSeqNoPrimaryTerm, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (propStoredFields.TryReadProperty(ref reader, options, PropStoredFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propTrackScores.TryReadProperty(ref reader, options, PropTrackScores, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.InnerHits(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Collapse = propCollapse.Value, + DocvalueFields = propDocvalueFields.Value, + Explain = propExplain.Value, + Fields = propFields.Value, + From = propFrom.Value, + Highlight = propHighlight.Value, + IgnoreUnmapped = propIgnoreUnmapped.Value, + Name = propName.Value, + ScriptFields = propScriptFields.Value, + SeqNoPrimaryTerm = propSeqNoPrimaryTerm.Value, + Size = propSize.Value, + Sort = propSort.Value, + Source = propSource.Value, + StoredFields = propStoredFields.Value, + TrackScores = propTrackScores.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.InnerHits value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCollapse, value.Collapse, null, null); + writer.WriteProperty(options, PropDocvalueFields, value.DocvalueFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropExplain, value.Explain, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropFrom, value.From, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropHighlight, value.Highlight, null, null); + writer.WriteProperty(options, PropIgnoreUnmapped, value.IgnoreUnmapped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropScriptFields, value.ScriptFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropSeqNoPrimaryTerm, value.SeqNoPrimaryTerm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteProperty(options, PropStoredFields, value.StoredFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropTrackScores, value.TrackScores, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/InnerHits.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/InnerHits.g.cs index c56272996a2..203a04b3c5b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/InnerHits.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/InnerHits.g.cs @@ -23,181 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class InnerHitsConverter : System.Text.Json.Serialization.JsonConverter -{ - 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 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 PropIgnoreUnmapped = System.Text.Json.JsonEncodedText.Encode("ignore_unmapped"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropScriptFields = System.Text.Json.JsonEncodedText.Encode("script_fields"); - 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 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 PropStoredFields = System.Text.Json.JsonEncodedText.Encode("stored_fields"); - private static readonly System.Text.Json.JsonEncodedText PropTrackScores = System.Text.Json.JsonEncodedText.Encode("track_scores"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Core.Search.InnerHits Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCollapse = default; - LocalJsonValue?> propDocvalueFields = default; - LocalJsonValue propExplain = default; - LocalJsonValue propFields = default; - LocalJsonValue propFrom = default; - LocalJsonValue propHighlight = default; - LocalJsonValue propIgnoreUnmapped = default; - LocalJsonValue propName = default; - LocalJsonValue?> propScriptFields = default; - LocalJsonValue propSeqNoPrimaryTerm = default; - LocalJsonValue propSize = default; - LocalJsonValue?> propSort = default; - LocalJsonValue propSource = default; - LocalJsonValue propStoredFields = default; - LocalJsonValue propTrackScores = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCollapse.TryReadProperty(ref reader, options, PropCollapse, null)) - { - continue; - } - - if (propDocvalueFields.TryReadProperty(ref reader, options, PropDocvalueFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propExplain.TryReadProperty(ref reader, options, PropExplain, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propFrom.TryReadProperty(ref reader, options, PropFrom, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propHighlight.TryReadProperty(ref reader, options, PropHighlight, null)) - { - continue; - } - - if (propIgnoreUnmapped.TryReadProperty(ref reader, options, PropIgnoreUnmapped, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propScriptFields.TryReadProperty(ref reader, options, PropScriptFields, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propSeqNoPrimaryTerm.TryReadProperty(ref reader, options, PropSeqNoPrimaryTerm, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (propStoredFields.TryReadProperty(ref reader, options, PropStoredFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propTrackScores.TryReadProperty(ref reader, options, PropTrackScores, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.InnerHits(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Collapse = propCollapse.Value, - DocvalueFields = propDocvalueFields.Value, - Explain = propExplain.Value, - Fields = propFields.Value, - From = propFrom.Value, - Highlight = propHighlight.Value, - IgnoreUnmapped = propIgnoreUnmapped.Value, - Name = propName.Value, - ScriptFields = propScriptFields.Value, - SeqNoPrimaryTerm = propSeqNoPrimaryTerm.Value, - Size = propSize.Value, - Sort = propSort.Value, - Source = propSource.Value, - StoredFields = propStoredFields.Value, - TrackScores = propTrackScores.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.InnerHits value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCollapse, value.Collapse, null, null); - writer.WriteProperty(options, PropDocvalueFields, value.DocvalueFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropExplain, value.Explain, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropFrom, value.From, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropHighlight, value.Highlight, null, null); - writer.WriteProperty(options, PropIgnoreUnmapped, value.IgnoreUnmapped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropScriptFields, value.ScriptFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropSeqNoPrimaryTerm, value.SeqNoPrimaryTerm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteProperty(options, PropStoredFields, value.StoredFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropTrackScores, value.TrackScores, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.InnerHitsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.InnerHitsConverter))] public sealed partial class InnerHits { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/InnerHitsResult.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/InnerHitsResult.Converters.g.cs new file mode 100644 index 00000000000..bb3bda66eed --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/InnerHitsResult.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class InnerHitsResultConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropHits = System.Text.Json.JsonEncodedText.Encode("hits"); + + public override Elastic.Clients.Elasticsearch.Core.Search.InnerHitsResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propHits = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propHits.TryReadProperty(ref reader, options, PropHits, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.InnerHitsResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Hits = propHits.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.InnerHitsResult value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropHits, value.Hits, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/InnerHitsResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/InnerHitsResult.g.cs index 8db466cc5bd..837e252ca71 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/InnerHitsResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/InnerHitsResult.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class InnerHitsResultConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropHits = System.Text.Json.JsonEncodedText.Encode("hits"); - - public override Elastic.Clients.Elasticsearch.Core.Search.InnerHitsResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propHits = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propHits.TryReadProperty(ref reader, options, PropHits, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.InnerHitsResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Hits = propHits.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.InnerHitsResult value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropHits, value.Hits, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.InnerHitsResultConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.InnerHitsResultConverter))] public sealed partial class InnerHitsResult { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/KnnCollectorResult.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/KnnCollectorResult.Converters.g.cs new file mode 100644 index 00000000000..c658e36999c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/KnnCollectorResult.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class KnnCollectorResultConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChildren = System.Text.Json.JsonEncodedText.Encode("children"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); + private static readonly System.Text.Json.JsonEncodedText PropTime = System.Text.Json.JsonEncodedText.Encode("time"); + private static readonly System.Text.Json.JsonEncodedText PropTimeInNanos = System.Text.Json.JsonEncodedText.Encode("time_in_nanos"); + + public override Elastic.Clients.Elasticsearch.Core.Search.KnnCollectorResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propChildren = default; + LocalJsonValue propName = default; + LocalJsonValue propReason = default; + LocalJsonValue propTime = default; + LocalJsonValue propTimeInNanos = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChildren.TryReadProperty(ref reader, options, PropChildren, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propReason.TryReadProperty(ref reader, options, PropReason, null)) + { + continue; + } + + if (propTime.TryReadProperty(ref reader, options, PropTime, null)) + { + continue; + } + + if (propTimeInNanos.TryReadProperty(ref reader, options, PropTimeInNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.KnnCollectorResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Children = propChildren.Value, + Name = propName.Value, + Reason = propReason.Value, + Time = propTime.Value, + TimeInNanos = propTimeInNanos.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.KnnCollectorResult value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChildren, value.Children, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropReason, value.Reason, null, null); + writer.WriteProperty(options, PropTime, value.Time, null, null); + writer.WriteProperty(options, PropTimeInNanos, value.TimeInNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/KnnCollectorResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/KnnCollectorResult.g.cs index 4c67a6b9a3a..978da5a9c5d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/KnnCollectorResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/KnnCollectorResult.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class KnnCollectorResultConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChildren = System.Text.Json.JsonEncodedText.Encode("children"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); - private static readonly System.Text.Json.JsonEncodedText PropTime = System.Text.Json.JsonEncodedText.Encode("time"); - private static readonly System.Text.Json.JsonEncodedText PropTimeInNanos = System.Text.Json.JsonEncodedText.Encode("time_in_nanos"); - - public override Elastic.Clients.Elasticsearch.Core.Search.KnnCollectorResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propChildren = default; - LocalJsonValue propName = default; - LocalJsonValue propReason = default; - LocalJsonValue propTime = default; - LocalJsonValue propTimeInNanos = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChildren.TryReadProperty(ref reader, options, PropChildren, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propReason.TryReadProperty(ref reader, options, PropReason, null)) - { - continue; - } - - if (propTime.TryReadProperty(ref reader, options, PropTime, null)) - { - continue; - } - - if (propTimeInNanos.TryReadProperty(ref reader, options, PropTimeInNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.KnnCollectorResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Children = propChildren.Value, - Name = propName.Value, - Reason = propReason.Value, - Time = propTime.Value, - TimeInNanos = propTimeInNanos.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.KnnCollectorResult value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChildren, value.Children, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropReason, value.Reason, null, null); - writer.WriteProperty(options, PropTime, value.Time, null, null); - writer.WriteProperty(options, PropTimeInNanos, value.TimeInNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.KnnCollectorResultConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.KnnCollectorResultConverter))] public sealed partial class KnnCollectorResult { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/KnnQueryProfileBreakdown.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/KnnQueryProfileBreakdown.Converters.g.cs new file mode 100644 index 00000000000..2313c44f217 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/KnnQueryProfileBreakdown.Converters.g.cs @@ -0,0 +1,234 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class KnnQueryProfileBreakdownConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAdvance = System.Text.Json.JsonEncodedText.Encode("advance"); + private static readonly System.Text.Json.JsonEncodedText PropAdvanceCount = System.Text.Json.JsonEncodedText.Encode("advance_count"); + private static readonly System.Text.Json.JsonEncodedText PropBuildScorer = System.Text.Json.JsonEncodedText.Encode("build_scorer"); + private static readonly System.Text.Json.JsonEncodedText PropBuildScorerCount = System.Text.Json.JsonEncodedText.Encode("build_scorer_count"); + private static readonly System.Text.Json.JsonEncodedText PropComputeMaxScore = System.Text.Json.JsonEncodedText.Encode("compute_max_score"); + private static readonly System.Text.Json.JsonEncodedText PropComputeMaxScoreCount = System.Text.Json.JsonEncodedText.Encode("compute_max_score_count"); + private static readonly System.Text.Json.JsonEncodedText PropCountWeight = System.Text.Json.JsonEncodedText.Encode("count_weight"); + private static readonly System.Text.Json.JsonEncodedText PropCountWeightCount = System.Text.Json.JsonEncodedText.Encode("count_weight_count"); + private static readonly System.Text.Json.JsonEncodedText PropCreateWeight = System.Text.Json.JsonEncodedText.Encode("create_weight"); + private static readonly System.Text.Json.JsonEncodedText PropCreateWeightCount = System.Text.Json.JsonEncodedText.Encode("create_weight_count"); + private static readonly System.Text.Json.JsonEncodedText PropMatch = System.Text.Json.JsonEncodedText.Encode("match"); + private static readonly System.Text.Json.JsonEncodedText PropMatchCount = System.Text.Json.JsonEncodedText.Encode("match_count"); + private static readonly System.Text.Json.JsonEncodedText PropNextDoc = System.Text.Json.JsonEncodedText.Encode("next_doc"); + private static readonly System.Text.Json.JsonEncodedText PropNextDocCount = System.Text.Json.JsonEncodedText.Encode("next_doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropScore = System.Text.Json.JsonEncodedText.Encode("score"); + private static readonly System.Text.Json.JsonEncodedText PropScoreCount = System.Text.Json.JsonEncodedText.Encode("score_count"); + private static readonly System.Text.Json.JsonEncodedText PropSetMinCompetitiveScore = System.Text.Json.JsonEncodedText.Encode("set_min_competitive_score"); + private static readonly System.Text.Json.JsonEncodedText PropSetMinCompetitiveScoreCount = System.Text.Json.JsonEncodedText.Encode("set_min_competitive_score_count"); + private static readonly System.Text.Json.JsonEncodedText PropShallowAdvance = System.Text.Json.JsonEncodedText.Encode("shallow_advance"); + private static readonly System.Text.Json.JsonEncodedText PropShallowAdvanceCount = System.Text.Json.JsonEncodedText.Encode("shallow_advance_count"); + + public override Elastic.Clients.Elasticsearch.Core.Search.KnnQueryProfileBreakdown Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAdvance = default; + LocalJsonValue propAdvanceCount = default; + LocalJsonValue propBuildScorer = default; + LocalJsonValue propBuildScorerCount = default; + LocalJsonValue propComputeMaxScore = default; + LocalJsonValue propComputeMaxScoreCount = default; + LocalJsonValue propCountWeight = default; + LocalJsonValue propCountWeightCount = default; + LocalJsonValue propCreateWeight = default; + LocalJsonValue propCreateWeightCount = default; + LocalJsonValue propMatch = default; + LocalJsonValue propMatchCount = default; + LocalJsonValue propNextDoc = default; + LocalJsonValue propNextDocCount = default; + LocalJsonValue propScore = default; + LocalJsonValue propScoreCount = default; + LocalJsonValue propSetMinCompetitiveScore = default; + LocalJsonValue propSetMinCompetitiveScoreCount = default; + LocalJsonValue propShallowAdvance = default; + LocalJsonValue propShallowAdvanceCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAdvance.TryReadProperty(ref reader, options, PropAdvance, null)) + { + continue; + } + + if (propAdvanceCount.TryReadProperty(ref reader, options, PropAdvanceCount, null)) + { + continue; + } + + if (propBuildScorer.TryReadProperty(ref reader, options, PropBuildScorer, null)) + { + continue; + } + + if (propBuildScorerCount.TryReadProperty(ref reader, options, PropBuildScorerCount, null)) + { + continue; + } + + if (propComputeMaxScore.TryReadProperty(ref reader, options, PropComputeMaxScore, null)) + { + continue; + } + + if (propComputeMaxScoreCount.TryReadProperty(ref reader, options, PropComputeMaxScoreCount, null)) + { + continue; + } + + if (propCountWeight.TryReadProperty(ref reader, options, PropCountWeight, null)) + { + continue; + } + + if (propCountWeightCount.TryReadProperty(ref reader, options, PropCountWeightCount, null)) + { + continue; + } + + if (propCreateWeight.TryReadProperty(ref reader, options, PropCreateWeight, null)) + { + continue; + } + + if (propCreateWeightCount.TryReadProperty(ref reader, options, PropCreateWeightCount, null)) + { + continue; + } + + if (propMatch.TryReadProperty(ref reader, options, PropMatch, null)) + { + continue; + } + + if (propMatchCount.TryReadProperty(ref reader, options, PropMatchCount, null)) + { + continue; + } + + if (propNextDoc.TryReadProperty(ref reader, options, PropNextDoc, null)) + { + continue; + } + + if (propNextDocCount.TryReadProperty(ref reader, options, PropNextDocCount, null)) + { + continue; + } + + if (propScore.TryReadProperty(ref reader, options, PropScore, null)) + { + continue; + } + + if (propScoreCount.TryReadProperty(ref reader, options, PropScoreCount, null)) + { + continue; + } + + if (propSetMinCompetitiveScore.TryReadProperty(ref reader, options, PropSetMinCompetitiveScore, null)) + { + continue; + } + + if (propSetMinCompetitiveScoreCount.TryReadProperty(ref reader, options, PropSetMinCompetitiveScoreCount, null)) + { + continue; + } + + if (propShallowAdvance.TryReadProperty(ref reader, options, PropShallowAdvance, null)) + { + continue; + } + + if (propShallowAdvanceCount.TryReadProperty(ref reader, options, PropShallowAdvanceCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.KnnQueryProfileBreakdown(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Advance = propAdvance.Value, + AdvanceCount = propAdvanceCount.Value, + BuildScorer = propBuildScorer.Value, + BuildScorerCount = propBuildScorerCount.Value, + ComputeMaxScore = propComputeMaxScore.Value, + ComputeMaxScoreCount = propComputeMaxScoreCount.Value, + CountWeight = propCountWeight.Value, + CountWeightCount = propCountWeightCount.Value, + CreateWeight = propCreateWeight.Value, + CreateWeightCount = propCreateWeightCount.Value, + Match = propMatch.Value, + MatchCount = propMatchCount.Value, + NextDoc = propNextDoc.Value, + NextDocCount = propNextDocCount.Value, + Score = propScore.Value, + ScoreCount = propScoreCount.Value, + SetMinCompetitiveScore = propSetMinCompetitiveScore.Value, + SetMinCompetitiveScoreCount = propSetMinCompetitiveScoreCount.Value, + ShallowAdvance = propShallowAdvance.Value, + ShallowAdvanceCount = propShallowAdvanceCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.KnnQueryProfileBreakdown value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAdvance, value.Advance, null, null); + writer.WriteProperty(options, PropAdvanceCount, value.AdvanceCount, null, null); + writer.WriteProperty(options, PropBuildScorer, value.BuildScorer, null, null); + writer.WriteProperty(options, PropBuildScorerCount, value.BuildScorerCount, null, null); + writer.WriteProperty(options, PropComputeMaxScore, value.ComputeMaxScore, null, null); + writer.WriteProperty(options, PropComputeMaxScoreCount, value.ComputeMaxScoreCount, null, null); + writer.WriteProperty(options, PropCountWeight, value.CountWeight, null, null); + writer.WriteProperty(options, PropCountWeightCount, value.CountWeightCount, null, null); + writer.WriteProperty(options, PropCreateWeight, value.CreateWeight, null, null); + writer.WriteProperty(options, PropCreateWeightCount, value.CreateWeightCount, null, null); + writer.WriteProperty(options, PropMatch, value.Match, null, null); + writer.WriteProperty(options, PropMatchCount, value.MatchCount, null, null); + writer.WriteProperty(options, PropNextDoc, value.NextDoc, null, null); + writer.WriteProperty(options, PropNextDocCount, value.NextDocCount, null, null); + writer.WriteProperty(options, PropScore, value.Score, null, null); + writer.WriteProperty(options, PropScoreCount, value.ScoreCount, null, null); + writer.WriteProperty(options, PropSetMinCompetitiveScore, value.SetMinCompetitiveScore, null, null); + writer.WriteProperty(options, PropSetMinCompetitiveScoreCount, value.SetMinCompetitiveScoreCount, null, null); + writer.WriteProperty(options, PropShallowAdvance, value.ShallowAdvance, null, null); + writer.WriteProperty(options, PropShallowAdvanceCount, value.ShallowAdvanceCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/KnnQueryProfileBreakdown.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/KnnQueryProfileBreakdown.g.cs index c2a39c3d3e4..5f4ca6da9cb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/KnnQueryProfileBreakdown.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/KnnQueryProfileBreakdown.g.cs @@ -23,217 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class KnnQueryProfileBreakdownConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAdvance = System.Text.Json.JsonEncodedText.Encode("advance"); - private static readonly System.Text.Json.JsonEncodedText PropAdvanceCount = System.Text.Json.JsonEncodedText.Encode("advance_count"); - private static readonly System.Text.Json.JsonEncodedText PropBuildScorer = System.Text.Json.JsonEncodedText.Encode("build_scorer"); - private static readonly System.Text.Json.JsonEncodedText PropBuildScorerCount = System.Text.Json.JsonEncodedText.Encode("build_scorer_count"); - private static readonly System.Text.Json.JsonEncodedText PropComputeMaxScore = System.Text.Json.JsonEncodedText.Encode("compute_max_score"); - private static readonly System.Text.Json.JsonEncodedText PropComputeMaxScoreCount = System.Text.Json.JsonEncodedText.Encode("compute_max_score_count"); - private static readonly System.Text.Json.JsonEncodedText PropCountWeight = System.Text.Json.JsonEncodedText.Encode("count_weight"); - private static readonly System.Text.Json.JsonEncodedText PropCountWeightCount = System.Text.Json.JsonEncodedText.Encode("count_weight_count"); - private static readonly System.Text.Json.JsonEncodedText PropCreateWeight = System.Text.Json.JsonEncodedText.Encode("create_weight"); - private static readonly System.Text.Json.JsonEncodedText PropCreateWeightCount = System.Text.Json.JsonEncodedText.Encode("create_weight_count"); - private static readonly System.Text.Json.JsonEncodedText PropMatch = System.Text.Json.JsonEncodedText.Encode("match"); - private static readonly System.Text.Json.JsonEncodedText PropMatchCount = System.Text.Json.JsonEncodedText.Encode("match_count"); - private static readonly System.Text.Json.JsonEncodedText PropNextDoc = System.Text.Json.JsonEncodedText.Encode("next_doc"); - private static readonly System.Text.Json.JsonEncodedText PropNextDocCount = System.Text.Json.JsonEncodedText.Encode("next_doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropScore = System.Text.Json.JsonEncodedText.Encode("score"); - private static readonly System.Text.Json.JsonEncodedText PropScoreCount = System.Text.Json.JsonEncodedText.Encode("score_count"); - private static readonly System.Text.Json.JsonEncodedText PropSetMinCompetitiveScore = System.Text.Json.JsonEncodedText.Encode("set_min_competitive_score"); - private static readonly System.Text.Json.JsonEncodedText PropSetMinCompetitiveScoreCount = System.Text.Json.JsonEncodedText.Encode("set_min_competitive_score_count"); - private static readonly System.Text.Json.JsonEncodedText PropShallowAdvance = System.Text.Json.JsonEncodedText.Encode("shallow_advance"); - private static readonly System.Text.Json.JsonEncodedText PropShallowAdvanceCount = System.Text.Json.JsonEncodedText.Encode("shallow_advance_count"); - - public override Elastic.Clients.Elasticsearch.Core.Search.KnnQueryProfileBreakdown Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAdvance = default; - LocalJsonValue propAdvanceCount = default; - LocalJsonValue propBuildScorer = default; - LocalJsonValue propBuildScorerCount = default; - LocalJsonValue propComputeMaxScore = default; - LocalJsonValue propComputeMaxScoreCount = default; - LocalJsonValue propCountWeight = default; - LocalJsonValue propCountWeightCount = default; - LocalJsonValue propCreateWeight = default; - LocalJsonValue propCreateWeightCount = default; - LocalJsonValue propMatch = default; - LocalJsonValue propMatchCount = default; - LocalJsonValue propNextDoc = default; - LocalJsonValue propNextDocCount = default; - LocalJsonValue propScore = default; - LocalJsonValue propScoreCount = default; - LocalJsonValue propSetMinCompetitiveScore = default; - LocalJsonValue propSetMinCompetitiveScoreCount = default; - LocalJsonValue propShallowAdvance = default; - LocalJsonValue propShallowAdvanceCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAdvance.TryReadProperty(ref reader, options, PropAdvance, null)) - { - continue; - } - - if (propAdvanceCount.TryReadProperty(ref reader, options, PropAdvanceCount, null)) - { - continue; - } - - if (propBuildScorer.TryReadProperty(ref reader, options, PropBuildScorer, null)) - { - continue; - } - - if (propBuildScorerCount.TryReadProperty(ref reader, options, PropBuildScorerCount, null)) - { - continue; - } - - if (propComputeMaxScore.TryReadProperty(ref reader, options, PropComputeMaxScore, null)) - { - continue; - } - - if (propComputeMaxScoreCount.TryReadProperty(ref reader, options, PropComputeMaxScoreCount, null)) - { - continue; - } - - if (propCountWeight.TryReadProperty(ref reader, options, PropCountWeight, null)) - { - continue; - } - - if (propCountWeightCount.TryReadProperty(ref reader, options, PropCountWeightCount, null)) - { - continue; - } - - if (propCreateWeight.TryReadProperty(ref reader, options, PropCreateWeight, null)) - { - continue; - } - - if (propCreateWeightCount.TryReadProperty(ref reader, options, PropCreateWeightCount, null)) - { - continue; - } - - if (propMatch.TryReadProperty(ref reader, options, PropMatch, null)) - { - continue; - } - - if (propMatchCount.TryReadProperty(ref reader, options, PropMatchCount, null)) - { - continue; - } - - if (propNextDoc.TryReadProperty(ref reader, options, PropNextDoc, null)) - { - continue; - } - - if (propNextDocCount.TryReadProperty(ref reader, options, PropNextDocCount, null)) - { - continue; - } - - if (propScore.TryReadProperty(ref reader, options, PropScore, null)) - { - continue; - } - - if (propScoreCount.TryReadProperty(ref reader, options, PropScoreCount, null)) - { - continue; - } - - if (propSetMinCompetitiveScore.TryReadProperty(ref reader, options, PropSetMinCompetitiveScore, null)) - { - continue; - } - - if (propSetMinCompetitiveScoreCount.TryReadProperty(ref reader, options, PropSetMinCompetitiveScoreCount, null)) - { - continue; - } - - if (propShallowAdvance.TryReadProperty(ref reader, options, PropShallowAdvance, null)) - { - continue; - } - - if (propShallowAdvanceCount.TryReadProperty(ref reader, options, PropShallowAdvanceCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.KnnQueryProfileBreakdown(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Advance = propAdvance.Value, - AdvanceCount = propAdvanceCount.Value, - BuildScorer = propBuildScorer.Value, - BuildScorerCount = propBuildScorerCount.Value, - ComputeMaxScore = propComputeMaxScore.Value, - ComputeMaxScoreCount = propComputeMaxScoreCount.Value, - CountWeight = propCountWeight.Value, - CountWeightCount = propCountWeightCount.Value, - CreateWeight = propCreateWeight.Value, - CreateWeightCount = propCreateWeightCount.Value, - Match = propMatch.Value, - MatchCount = propMatchCount.Value, - NextDoc = propNextDoc.Value, - NextDocCount = propNextDocCount.Value, - Score = propScore.Value, - ScoreCount = propScoreCount.Value, - SetMinCompetitiveScore = propSetMinCompetitiveScore.Value, - SetMinCompetitiveScoreCount = propSetMinCompetitiveScoreCount.Value, - ShallowAdvance = propShallowAdvance.Value, - ShallowAdvanceCount = propShallowAdvanceCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.KnnQueryProfileBreakdown value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAdvance, value.Advance, null, null); - writer.WriteProperty(options, PropAdvanceCount, value.AdvanceCount, null, null); - writer.WriteProperty(options, PropBuildScorer, value.BuildScorer, null, null); - writer.WriteProperty(options, PropBuildScorerCount, value.BuildScorerCount, null, null); - writer.WriteProperty(options, PropComputeMaxScore, value.ComputeMaxScore, null, null); - writer.WriteProperty(options, PropComputeMaxScoreCount, value.ComputeMaxScoreCount, null, null); - writer.WriteProperty(options, PropCountWeight, value.CountWeight, null, null); - writer.WriteProperty(options, PropCountWeightCount, value.CountWeightCount, null, null); - writer.WriteProperty(options, PropCreateWeight, value.CreateWeight, null, null); - writer.WriteProperty(options, PropCreateWeightCount, value.CreateWeightCount, null, null); - writer.WriteProperty(options, PropMatch, value.Match, null, null); - writer.WriteProperty(options, PropMatchCount, value.MatchCount, null, null); - writer.WriteProperty(options, PropNextDoc, value.NextDoc, null, null); - writer.WriteProperty(options, PropNextDocCount, value.NextDocCount, null, null); - writer.WriteProperty(options, PropScore, value.Score, null, null); - writer.WriteProperty(options, PropScoreCount, value.ScoreCount, null, null); - writer.WriteProperty(options, PropSetMinCompetitiveScore, value.SetMinCompetitiveScore, null, null); - writer.WriteProperty(options, PropSetMinCompetitiveScoreCount, value.SetMinCompetitiveScoreCount, null, null); - writer.WriteProperty(options, PropShallowAdvance, value.ShallowAdvance, null, null); - writer.WriteProperty(options, PropShallowAdvanceCount, value.ShallowAdvanceCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.KnnQueryProfileBreakdownConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.KnnQueryProfileBreakdownConverter))] public sealed partial class KnnQueryProfileBreakdown { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/KnnQueryProfileResult.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/KnnQueryProfileResult.Converters.g.cs new file mode 100644 index 00000000000..9f1e3150844 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/KnnQueryProfileResult.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class KnnQueryProfileResultConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBreakdown = System.Text.Json.JsonEncodedText.Encode("breakdown"); + private static readonly System.Text.Json.JsonEncodedText PropChildren = System.Text.Json.JsonEncodedText.Encode("children"); + private static readonly System.Text.Json.JsonEncodedText PropDebug = System.Text.Json.JsonEncodedText.Encode("debug"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropTime = System.Text.Json.JsonEncodedText.Encode("time"); + private static readonly System.Text.Json.JsonEncodedText PropTimeInNanos = System.Text.Json.JsonEncodedText.Encode("time_in_nanos"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Core.Search.KnnQueryProfileResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBreakdown = default; + LocalJsonValue?> propChildren = default; + LocalJsonValue?> propDebug = default; + LocalJsonValue propDescription = default; + LocalJsonValue propTime = default; + LocalJsonValue propTimeInNanos = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBreakdown.TryReadProperty(ref reader, options, PropBreakdown, null)) + { + continue; + } + + if (propChildren.TryReadProperty(ref reader, options, PropChildren, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propDebug.TryReadProperty(ref reader, options, PropDebug, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propTime.TryReadProperty(ref reader, options, PropTime, null)) + { + continue; + } + + if (propTimeInNanos.TryReadProperty(ref reader, options, PropTimeInNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.KnnQueryProfileResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Breakdown = propBreakdown.Value, + Children = propChildren.Value, + Debug = propDebug.Value, + Description = propDescription.Value, + Time = propTime.Value, + TimeInNanos = propTimeInNanos.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.KnnQueryProfileResult value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBreakdown, value.Breakdown, null, null); + writer.WriteProperty(options, PropChildren, value.Children, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDebug, value.Debug, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropTime, value.Time, null, null); + writer.WriteProperty(options, PropTimeInNanos, value.TimeInNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/KnnQueryProfileResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/KnnQueryProfileResult.g.cs index d7f5a002300..ad6a8a9f92a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/KnnQueryProfileResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/KnnQueryProfileResult.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class KnnQueryProfileResultConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBreakdown = System.Text.Json.JsonEncodedText.Encode("breakdown"); - private static readonly System.Text.Json.JsonEncodedText PropChildren = System.Text.Json.JsonEncodedText.Encode("children"); - private static readonly System.Text.Json.JsonEncodedText PropDebug = System.Text.Json.JsonEncodedText.Encode("debug"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropTime = System.Text.Json.JsonEncodedText.Encode("time"); - private static readonly System.Text.Json.JsonEncodedText PropTimeInNanos = System.Text.Json.JsonEncodedText.Encode("time_in_nanos"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Core.Search.KnnQueryProfileResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBreakdown = default; - LocalJsonValue?> propChildren = default; - LocalJsonValue?> propDebug = default; - LocalJsonValue propDescription = default; - LocalJsonValue propTime = default; - LocalJsonValue propTimeInNanos = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBreakdown.TryReadProperty(ref reader, options, PropBreakdown, null)) - { - continue; - } - - if (propChildren.TryReadProperty(ref reader, options, PropChildren, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propDebug.TryReadProperty(ref reader, options, PropDebug, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propTime.TryReadProperty(ref reader, options, PropTime, null)) - { - continue; - } - - if (propTimeInNanos.TryReadProperty(ref reader, options, PropTimeInNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.KnnQueryProfileResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Breakdown = propBreakdown.Value, - Children = propChildren.Value, - Debug = propDebug.Value, - Description = propDescription.Value, - Time = propTime.Value, - TimeInNanos = propTimeInNanos.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.KnnQueryProfileResult value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBreakdown, value.Breakdown, null, null); - writer.WriteProperty(options, PropChildren, value.Children, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDebug, value.Debug, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropTime, value.Time, null, null); - writer.WriteProperty(options, PropTimeInNanos, value.TimeInNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.KnnQueryProfileResultConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.KnnQueryProfileResultConverter))] public sealed partial class KnnQueryProfileResult { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LaplaceSmoothingModel.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LaplaceSmoothingModel.Converters.g.cs new file mode 100644 index 00000000000..bf2d5cbbf24 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LaplaceSmoothingModel.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class LaplaceSmoothingModelConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAlpha = System.Text.Json.JsonEncodedText.Encode("alpha"); + + public override Elastic.Clients.Elasticsearch.Core.Search.LaplaceSmoothingModel Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAlpha = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAlpha.TryReadProperty(ref reader, options, PropAlpha, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.LaplaceSmoothingModel(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Alpha = propAlpha.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.LaplaceSmoothingModel value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAlpha, value.Alpha, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LaplaceSmoothingModel.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LaplaceSmoothingModel.g.cs index 3d900ab014c..7b1bcd959b6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LaplaceSmoothingModel.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LaplaceSmoothingModel.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class LaplaceSmoothingModelConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAlpha = System.Text.Json.JsonEncodedText.Encode("alpha"); - - public override Elastic.Clients.Elasticsearch.Core.Search.LaplaceSmoothingModel Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAlpha = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAlpha.TryReadProperty(ref reader, options, PropAlpha, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.LaplaceSmoothingModel(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Alpha = propAlpha.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.LaplaceSmoothingModel value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAlpha, value.Alpha, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.LaplaceSmoothingModelConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.LaplaceSmoothingModelConverter))] public sealed partial class LaplaceSmoothingModel { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LearningToRank.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LearningToRank.Converters.g.cs new file mode 100644 index 00000000000..79e0045860d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LearningToRank.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class LearningToRankConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); + private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); + + public override Elastic.Clients.Elasticsearch.Core.Search.LearningToRank Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propModelId = default; + LocalJsonValue?> propParams = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) + { + continue; + } + + if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.LearningToRank(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ModelId = propModelId.Value, + Params = propParams.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.LearningToRank value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropModelId, value.ModelId, null, null); + writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LearningToRank.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LearningToRank.g.cs index 137f0b0d06b..8d6123dd5d2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LearningToRank.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LearningToRank.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class LearningToRankConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); - private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); - - public override Elastic.Clients.Elasticsearch.Core.Search.LearningToRank Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propModelId = default; - LocalJsonValue?> propParams = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) - { - continue; - } - - if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.LearningToRank(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ModelId = propModelId.Value, - Params = propParams.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.LearningToRank value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropModelId, value.ModelId, null, null); - writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.LearningToRankConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.LearningToRankConverter))] public sealed partial class LearningToRank { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LinearInterpolationSmoothingModel.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LinearInterpolationSmoothingModel.Converters.g.cs new file mode 100644 index 00000000000..233c5f24048 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LinearInterpolationSmoothingModel.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class LinearInterpolationSmoothingModelConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBigramLambda = System.Text.Json.JsonEncodedText.Encode("bigram_lambda"); + private static readonly System.Text.Json.JsonEncodedText PropTrigramLambda = System.Text.Json.JsonEncodedText.Encode("trigram_lambda"); + private static readonly System.Text.Json.JsonEncodedText PropUnigramLambda = System.Text.Json.JsonEncodedText.Encode("unigram_lambda"); + + public override Elastic.Clients.Elasticsearch.Core.Search.LinearInterpolationSmoothingModel Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBigramLambda = default; + LocalJsonValue propTrigramLambda = default; + LocalJsonValue propUnigramLambda = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBigramLambda.TryReadProperty(ref reader, options, PropBigramLambda, null)) + { + continue; + } + + if (propTrigramLambda.TryReadProperty(ref reader, options, PropTrigramLambda, null)) + { + continue; + } + + if (propUnigramLambda.TryReadProperty(ref reader, options, PropUnigramLambda, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.LinearInterpolationSmoothingModel(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BigramLambda = propBigramLambda.Value, + TrigramLambda = propTrigramLambda.Value, + UnigramLambda = propUnigramLambda.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.LinearInterpolationSmoothingModel value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBigramLambda, value.BigramLambda, null, null); + writer.WriteProperty(options, PropTrigramLambda, value.TrigramLambda, null, null); + writer.WriteProperty(options, PropUnigramLambda, value.UnigramLambda, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LinearInterpolationSmoothingModel.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LinearInterpolationSmoothingModel.g.cs index 957cbb5d146..d57e904a9e4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LinearInterpolationSmoothingModel.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/LinearInterpolationSmoothingModel.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class LinearInterpolationSmoothingModelConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBigramLambda = System.Text.Json.JsonEncodedText.Encode("bigram_lambda"); - private static readonly System.Text.Json.JsonEncodedText PropTrigramLambda = System.Text.Json.JsonEncodedText.Encode("trigram_lambda"); - private static readonly System.Text.Json.JsonEncodedText PropUnigramLambda = System.Text.Json.JsonEncodedText.Encode("unigram_lambda"); - - public override Elastic.Clients.Elasticsearch.Core.Search.LinearInterpolationSmoothingModel Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBigramLambda = default; - LocalJsonValue propTrigramLambda = default; - LocalJsonValue propUnigramLambda = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBigramLambda.TryReadProperty(ref reader, options, PropBigramLambda, null)) - { - continue; - } - - if (propTrigramLambda.TryReadProperty(ref reader, options, PropTrigramLambda, null)) - { - continue; - } - - if (propUnigramLambda.TryReadProperty(ref reader, options, PropUnigramLambda, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.LinearInterpolationSmoothingModel(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BigramLambda = propBigramLambda.Value, - TrigramLambda = propTrigramLambda.Value, - UnigramLambda = propUnigramLambda.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.LinearInterpolationSmoothingModel value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBigramLambda, value.BigramLambda, null, null); - writer.WriteProperty(options, PropTrigramLambda, value.TrigramLambda, null, null); - writer.WriteProperty(options, PropUnigramLambda, value.UnigramLambda, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.LinearInterpolationSmoothingModelConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.LinearInterpolationSmoothingModelConverter))] public sealed partial class LinearInterpolationSmoothingModel { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/NestedIdentity.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/NestedIdentity.Converters.g.cs new file mode 100644 index 00000000000..3cf266069f9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/NestedIdentity.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class NestedIdentityConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropNested = System.Text.Json.JsonEncodedText.Encode("_nested"); + private static readonly System.Text.Json.JsonEncodedText PropOffset = System.Text.Json.JsonEncodedText.Encode("offset"); + + public override Elastic.Clients.Elasticsearch.Core.Search.NestedIdentity Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propNested = default; + LocalJsonValue propOffset = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propNested.TryReadProperty(ref reader, options, PropNested, null)) + { + continue; + } + + if (propOffset.TryReadProperty(ref reader, options, PropOffset, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.NestedIdentity(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Nested = propNested.Value, + Offset = propOffset.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.NestedIdentity value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropNested, value.Nested, null, null); + writer.WriteProperty(options, PropOffset, value.Offset, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/NestedIdentity.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/NestedIdentity.g.cs index bcdfcfdebab..c933cab47d9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/NestedIdentity.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/NestedIdentity.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class NestedIdentityConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropNested = System.Text.Json.JsonEncodedText.Encode("_nested"); - private static readonly System.Text.Json.JsonEncodedText PropOffset = System.Text.Json.JsonEncodedText.Encode("offset"); - - public override Elastic.Clients.Elasticsearch.Core.Search.NestedIdentity Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propNested = default; - LocalJsonValue propOffset = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propNested.TryReadProperty(ref reader, options, PropNested, null)) - { - continue; - } - - if (propOffset.TryReadProperty(ref reader, options, PropOffset, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.NestedIdentity(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Nested = propNested.Value, - Offset = propOffset.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.NestedIdentity value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropNested, value.Nested, null, null); - writer.WriteProperty(options, PropOffset, value.Offset, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.NestedIdentityConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.NestedIdentityConverter))] public sealed partial class NestedIdentity { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggest.Converters.g.cs new file mode 100644 index 00000000000..f8a4ab366f9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggest.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class PhraseSuggestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLength = System.Text.Json.JsonEncodedText.Encode("length"); + private static readonly System.Text.Json.JsonEncodedText PropOffset = System.Text.Json.JsonEncodedText.Encode("offset"); + private static readonly System.Text.Json.JsonEncodedText PropOptions = System.Text.Json.JsonEncodedText.Encode("options"); + private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); + + public override Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLength = default; + LocalJsonValue propOffset = default; + LocalJsonValue> propOptions = default; + LocalJsonValue propText = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLength.TryReadProperty(ref reader, options, PropLength, null)) + { + continue; + } + + if (propOffset.TryReadProperty(ref reader, options, PropOffset, null)) + { + continue; + } + + if (propOptions.TryReadProperty(ref reader, options, PropOptions, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propText.TryReadProperty(ref reader, options, PropText, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Length = propLength.Value, + Offset = propOffset.Value, + Options = propOptions.Value, + Text = propText.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLength, value.Length, null, null); + writer.WriteProperty(options, PropOffset, value.Offset, null, null); + writer.WriteProperty(options, PropOptions, value.Options, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropText, value.Text, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggest.g.cs index 9da6536ab92..629561767a9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggest.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class PhraseSuggestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLength = System.Text.Json.JsonEncodedText.Encode("length"); - private static readonly System.Text.Json.JsonEncodedText PropOffset = System.Text.Json.JsonEncodedText.Encode("offset"); - private static readonly System.Text.Json.JsonEncodedText PropOptions = System.Text.Json.JsonEncodedText.Encode("options"); - private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); - - public override Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLength = default; - LocalJsonValue propOffset = default; - LocalJsonValue> propOptions = default; - LocalJsonValue propText = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLength.TryReadProperty(ref reader, options, PropLength, null)) - { - continue; - } - - if (propOffset.TryReadProperty(ref reader, options, PropOffset, null)) - { - continue; - } - - if (propOptions.TryReadProperty(ref reader, options, PropOptions, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (propText.TryReadProperty(ref reader, options, PropText, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Length = propLength.Value, - Offset = propOffset.Value, - Options = propOptions.Value, - Text = propText.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLength, value.Length, null, null); - writer.WriteProperty(options, PropOffset, value.Offset, null, null); - writer.WriteProperty(options, PropOptions, value.Options, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropText, value.Text, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.PhraseSuggestConverter))] public sealed partial class PhraseSuggest : Elastic.Clients.Elasticsearch.Core.Search.ISuggest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestCollate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestCollate.Converters.g.cs new file mode 100644 index 00000000000..498557282ac --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestCollate.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class PhraseSuggestCollateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); + private static readonly System.Text.Json.JsonEncodedText PropPrune = System.Text.Json.JsonEncodedText.Encode("prune"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + + public override Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestCollate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propParams = default; + LocalJsonValue propPrune = default; + LocalJsonValue propQuery = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propPrune.TryReadProperty(ref reader, options, PropPrune, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestCollate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Params = propParams.Value, + Prune = propPrune.Value, + Query = propQuery.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestCollate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropPrune, value.Prune, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestCollate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestCollate.g.cs index d5cad637798..6e452e1ec52 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestCollate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestCollate.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class PhraseSuggestCollateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); - private static readonly System.Text.Json.JsonEncodedText PropPrune = System.Text.Json.JsonEncodedText.Encode("prune"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - - public override Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestCollate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propParams = default; - LocalJsonValue propPrune = default; - LocalJsonValue propQuery = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propPrune.TryReadProperty(ref reader, options, PropPrune, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestCollate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Params = propParams.Value, - Prune = propPrune.Value, - Query = propQuery.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestCollate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropPrune, value.Prune, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestCollateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.PhraseSuggestCollateConverter))] public sealed partial class PhraseSuggestCollate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestCollateQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestCollateQuery.Converters.g.cs new file mode 100644 index 00000000000..c5df7a62a0f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestCollateQuery.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class PhraseSuggestCollateQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + + public override Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestCollateQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propSource = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestCollateQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + Source = propSource.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestCollateQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestCollateQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestCollateQuery.g.cs index 10fd5579631..e9d602978cc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestCollateQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestCollateQuery.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class PhraseSuggestCollateQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - - public override Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestCollateQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue propSource = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestCollateQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - Source = propSource.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestCollateQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestCollateQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.PhraseSuggestCollateQueryConverter))] public sealed partial class PhraseSuggestCollateQuery { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestHighlight.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestHighlight.Converters.g.cs new file mode 100644 index 00000000000..a5c87bd66e7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestHighlight.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class PhraseSuggestHighlightConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPostTag = System.Text.Json.JsonEncodedText.Encode("post_tag"); + private static readonly System.Text.Json.JsonEncodedText PropPreTag = System.Text.Json.JsonEncodedText.Encode("pre_tag"); + + public override Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestHighlight Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPostTag = default; + LocalJsonValue propPreTag = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPostTag.TryReadProperty(ref reader, options, PropPostTag, null)) + { + continue; + } + + if (propPreTag.TryReadProperty(ref reader, options, PropPreTag, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestHighlight(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + PostTag = propPostTag.Value, + PreTag = propPreTag.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestHighlight value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPostTag, value.PostTag, null, null); + writer.WriteProperty(options, PropPreTag, value.PreTag, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestHighlight.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestHighlight.g.cs index 2ea4aa36a25..b8c6ba424ad 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestHighlight.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestHighlight.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class PhraseSuggestHighlightConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPostTag = System.Text.Json.JsonEncodedText.Encode("post_tag"); - private static readonly System.Text.Json.JsonEncodedText PropPreTag = System.Text.Json.JsonEncodedText.Encode("pre_tag"); - - public override Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestHighlight Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPostTag = default; - LocalJsonValue propPreTag = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPostTag.TryReadProperty(ref reader, options, PropPostTag, null)) - { - continue; - } - - if (propPreTag.TryReadProperty(ref reader, options, PropPreTag, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestHighlight(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - PostTag = propPostTag.Value, - PreTag = propPreTag.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestHighlight value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPostTag, value.PostTag, null, null); - writer.WriteProperty(options, PropPreTag, value.PreTag, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestHighlightConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.PhraseSuggestHighlightConverter))] public sealed partial class PhraseSuggestHighlight { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestOption.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestOption.Converters.g.cs new file mode 100644 index 00000000000..2c2bc05df3f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestOption.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class PhraseSuggestOptionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCollateMatch = System.Text.Json.JsonEncodedText.Encode("collate_match"); + private static readonly System.Text.Json.JsonEncodedText PropHighlighted = System.Text.Json.JsonEncodedText.Encode("highlighted"); + private static readonly System.Text.Json.JsonEncodedText PropScore = System.Text.Json.JsonEncodedText.Encode("score"); + private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); + + public override Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestOption Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCollateMatch = default; + LocalJsonValue propHighlighted = default; + LocalJsonValue propScore = default; + LocalJsonValue propText = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCollateMatch.TryReadProperty(ref reader, options, PropCollateMatch, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propHighlighted.TryReadProperty(ref reader, options, PropHighlighted, null)) + { + continue; + } + + if (propScore.TryReadProperty(ref reader, options, PropScore, null)) + { + continue; + } + + if (propText.TryReadProperty(ref reader, options, PropText, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestOption(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CollateMatch = propCollateMatch.Value, + Highlighted = propHighlighted.Value, + Score = propScore.Value, + Text = propText.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestOption value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCollateMatch, value.CollateMatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropHighlighted, value.Highlighted, null, null); + writer.WriteProperty(options, PropScore, value.Score, null, null); + writer.WriteProperty(options, PropText, value.Text, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestOption.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestOption.g.cs index dec291b86e1..1f675fd79c8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestOption.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggestOption.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class PhraseSuggestOptionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCollateMatch = System.Text.Json.JsonEncodedText.Encode("collate_match"); - private static readonly System.Text.Json.JsonEncodedText PropHighlighted = System.Text.Json.JsonEncodedText.Encode("highlighted"); - private static readonly System.Text.Json.JsonEncodedText PropScore = System.Text.Json.JsonEncodedText.Encode("score"); - private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); - - public override Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestOption Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCollateMatch = default; - LocalJsonValue propHighlighted = default; - LocalJsonValue propScore = default; - LocalJsonValue propText = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCollateMatch.TryReadProperty(ref reader, options, PropCollateMatch, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propHighlighted.TryReadProperty(ref reader, options, PropHighlighted, null)) - { - continue; - } - - if (propScore.TryReadProperty(ref reader, options, PropScore, null)) - { - continue; - } - - if (propText.TryReadProperty(ref reader, options, PropText, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestOption(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CollateMatch = propCollateMatch.Value, - Highlighted = propHighlighted.Value, - Score = propScore.Value, - Text = propText.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestOption value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCollateMatch, value.CollateMatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropHighlighted, value.Highlighted, null, null); - writer.WriteProperty(options, PropScore, value.Score, null, null); - writer.WriteProperty(options, PropText, value.Text, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggestOptionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.PhraseSuggestOptionConverter))] public sealed partial class PhraseSuggestOption { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggester.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggester.Converters.g.cs new file mode 100644 index 00000000000..ba423ef83e5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggester.Converters.g.cs @@ -0,0 +1,198 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class PhraseSuggesterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropCollate = System.Text.Json.JsonEncodedText.Encode("collate"); + private static readonly System.Text.Json.JsonEncodedText PropConfidence = System.Text.Json.JsonEncodedText.Encode("confidence"); + private static readonly System.Text.Json.JsonEncodedText PropDirectGenerator = System.Text.Json.JsonEncodedText.Encode("direct_generator"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropForceUnigrams = System.Text.Json.JsonEncodedText.Encode("force_unigrams"); + private static readonly System.Text.Json.JsonEncodedText PropGramSize = System.Text.Json.JsonEncodedText.Encode("gram_size"); + private static readonly System.Text.Json.JsonEncodedText PropHighlight = System.Text.Json.JsonEncodedText.Encode("highlight"); + private static readonly System.Text.Json.JsonEncodedText PropMaxErrors = System.Text.Json.JsonEncodedText.Encode("max_errors"); + private static readonly System.Text.Json.JsonEncodedText PropRealWordErrorLikelihood = System.Text.Json.JsonEncodedText.Encode("real_word_error_likelihood"); + private static readonly System.Text.Json.JsonEncodedText PropSeparator = System.Text.Json.JsonEncodedText.Encode("separator"); + private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropSmoothing = System.Text.Json.JsonEncodedText.Encode("smoothing"); + private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); + private static readonly System.Text.Json.JsonEncodedText PropTokenLimit = System.Text.Json.JsonEncodedText.Encode("token_limit"); + + public override Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggester Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzer = default; + LocalJsonValue propCollate = default; + LocalJsonValue propConfidence = default; + LocalJsonValue?> propDirectGenerator = default; + LocalJsonValue propField = default; + LocalJsonValue propForceUnigrams = default; + LocalJsonValue propGramSize = default; + LocalJsonValue propHighlight = default; + LocalJsonValue propMaxErrors = default; + LocalJsonValue propRealWordErrorLikelihood = default; + LocalJsonValue propSeparator = default; + LocalJsonValue propShardSize = default; + LocalJsonValue propSize = default; + LocalJsonValue propSmoothing = default; + LocalJsonValue propText = default; + LocalJsonValue propTokenLimit = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) + { + continue; + } + + if (propCollate.TryReadProperty(ref reader, options, PropCollate, null)) + { + continue; + } + + if (propConfidence.TryReadProperty(ref reader, options, PropConfidence, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDirectGenerator.TryReadProperty(ref reader, options, PropDirectGenerator, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propForceUnigrams.TryReadProperty(ref reader, options, PropForceUnigrams, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propGramSize.TryReadProperty(ref reader, options, PropGramSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propHighlight.TryReadProperty(ref reader, options, PropHighlight, null)) + { + continue; + } + + if (propMaxErrors.TryReadProperty(ref reader, options, PropMaxErrors, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRealWordErrorLikelihood.TryReadProperty(ref reader, options, PropRealWordErrorLikelihood, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSeparator.TryReadProperty(ref reader, options, PropSeparator, null)) + { + continue; + } + + if (propShardSize.TryReadProperty(ref reader, options, PropShardSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSmoothing.TryReadProperty(ref reader, options, PropSmoothing, null)) + { + continue; + } + + if (propText.TryReadProperty(ref reader, options, PropText, null)) + { + continue; + } + + if (propTokenLimit.TryReadProperty(ref reader, options, PropTokenLimit, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggester(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analyzer = propAnalyzer.Value, + Collate = propCollate.Value, + Confidence = propConfidence.Value, + DirectGenerator = propDirectGenerator.Value, + Field = propField.Value, + ForceUnigrams = propForceUnigrams.Value, + GramSize = propGramSize.Value, + Highlight = propHighlight.Value, + MaxErrors = propMaxErrors.Value, + RealWordErrorLikelihood = propRealWordErrorLikelihood.Value, + Separator = propSeparator.Value, + ShardSize = propShardSize.Value, + Size = propSize.Value, + Smoothing = propSmoothing.Value, + Text = propText.Value, + TokenLimit = propTokenLimit.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggester value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); + writer.WriteProperty(options, PropCollate, value.Collate, null, null); + writer.WriteProperty(options, PropConfidence, value.Confidence, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDirectGenerator, value.DirectGenerator, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropForceUnigrams, value.ForceUnigrams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropGramSize, value.GramSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropHighlight, value.Highlight, null, null); + writer.WriteProperty(options, PropMaxErrors, value.MaxErrors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRealWordErrorLikelihood, value.RealWordErrorLikelihood, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSeparator, value.Separator, null, null); + writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSmoothing, value.Smoothing, null, null); + writer.WriteProperty(options, PropText, value.Text, null, null); + writer.WriteProperty(options, PropTokenLimit, value.TokenLimit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggester.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggester.g.cs index 622ac34e5b7..64fcab2544a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggester.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggester.g.cs @@ -23,181 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class PhraseSuggesterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropCollate = System.Text.Json.JsonEncodedText.Encode("collate"); - private static readonly System.Text.Json.JsonEncodedText PropConfidence = System.Text.Json.JsonEncodedText.Encode("confidence"); - private static readonly System.Text.Json.JsonEncodedText PropDirectGenerator = System.Text.Json.JsonEncodedText.Encode("direct_generator"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropForceUnigrams = System.Text.Json.JsonEncodedText.Encode("force_unigrams"); - private static readonly System.Text.Json.JsonEncodedText PropGramSize = System.Text.Json.JsonEncodedText.Encode("gram_size"); - private static readonly System.Text.Json.JsonEncodedText PropHighlight = System.Text.Json.JsonEncodedText.Encode("highlight"); - private static readonly System.Text.Json.JsonEncodedText PropMaxErrors = System.Text.Json.JsonEncodedText.Encode("max_errors"); - private static readonly System.Text.Json.JsonEncodedText PropRealWordErrorLikelihood = System.Text.Json.JsonEncodedText.Encode("real_word_error_likelihood"); - private static readonly System.Text.Json.JsonEncodedText PropSeparator = System.Text.Json.JsonEncodedText.Encode("separator"); - private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropSmoothing = System.Text.Json.JsonEncodedText.Encode("smoothing"); - private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); - private static readonly System.Text.Json.JsonEncodedText PropTokenLimit = System.Text.Json.JsonEncodedText.Encode("token_limit"); - - public override Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggester Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyzer = default; - LocalJsonValue propCollate = default; - LocalJsonValue propConfidence = default; - LocalJsonValue?> propDirectGenerator = default; - LocalJsonValue propField = default; - LocalJsonValue propForceUnigrams = default; - LocalJsonValue propGramSize = default; - LocalJsonValue propHighlight = default; - LocalJsonValue propMaxErrors = default; - LocalJsonValue propRealWordErrorLikelihood = default; - LocalJsonValue propSeparator = default; - LocalJsonValue propShardSize = default; - LocalJsonValue propSize = default; - LocalJsonValue propSmoothing = default; - LocalJsonValue propText = default; - LocalJsonValue propTokenLimit = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) - { - continue; - } - - if (propCollate.TryReadProperty(ref reader, options, PropCollate, null)) - { - continue; - } - - if (propConfidence.TryReadProperty(ref reader, options, PropConfidence, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDirectGenerator.TryReadProperty(ref reader, options, PropDirectGenerator, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propForceUnigrams.TryReadProperty(ref reader, options, PropForceUnigrams, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propGramSize.TryReadProperty(ref reader, options, PropGramSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propHighlight.TryReadProperty(ref reader, options, PropHighlight, null)) - { - continue; - } - - if (propMaxErrors.TryReadProperty(ref reader, options, PropMaxErrors, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRealWordErrorLikelihood.TryReadProperty(ref reader, options, PropRealWordErrorLikelihood, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSeparator.TryReadProperty(ref reader, options, PropSeparator, null)) - { - continue; - } - - if (propShardSize.TryReadProperty(ref reader, options, PropShardSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSmoothing.TryReadProperty(ref reader, options, PropSmoothing, null)) - { - continue; - } - - if (propText.TryReadProperty(ref reader, options, PropText, null)) - { - continue; - } - - if (propTokenLimit.TryReadProperty(ref reader, options, PropTokenLimit, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggester(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analyzer = propAnalyzer.Value, - Collate = propCollate.Value, - Confidence = propConfidence.Value, - DirectGenerator = propDirectGenerator.Value, - Field = propField.Value, - ForceUnigrams = propForceUnigrams.Value, - GramSize = propGramSize.Value, - Highlight = propHighlight.Value, - MaxErrors = propMaxErrors.Value, - RealWordErrorLikelihood = propRealWordErrorLikelihood.Value, - Separator = propSeparator.Value, - ShardSize = propShardSize.Value, - Size = propSize.Value, - Smoothing = propSmoothing.Value, - Text = propText.Value, - TokenLimit = propTokenLimit.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggester value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); - writer.WriteProperty(options, PropCollate, value.Collate, null, null); - writer.WriteProperty(options, PropConfidence, value.Confidence, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDirectGenerator, value.DirectGenerator, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropForceUnigrams, value.ForceUnigrams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropGramSize, value.GramSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropHighlight, value.Highlight, null, null); - writer.WriteProperty(options, PropMaxErrors, value.MaxErrors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRealWordErrorLikelihood, value.RealWordErrorLikelihood, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSeparator, value.Separator, null, null); - writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSmoothing, value.Smoothing, null, null); - writer.WriteProperty(options, PropText, value.Text, null, null); - writer.WriteProperty(options, PropTokenLimit, value.TokenLimit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggesterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.PhraseSuggesterConverter))] public sealed partial class PhraseSuggester { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PointInTimeReference.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PointInTimeReference.Converters.g.cs new file mode 100644 index 00000000000..30e14298eb2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PointInTimeReference.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class PointInTimeReferenceConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropKeepAlive = System.Text.Json.JsonEncodedText.Encode("keep_alive"); + + public override Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReference Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propKeepAlive = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propKeepAlive.TryReadProperty(ref reader, options, PropKeepAlive, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReference(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + KeepAlive = propKeepAlive.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReference value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropKeepAlive, value.KeepAlive, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PointInTimeReference.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PointInTimeReference.g.cs index 4e01b3e9a97..efc7bab3b95 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PointInTimeReference.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PointInTimeReference.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class PointInTimeReferenceConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropKeepAlive = System.Text.Json.JsonEncodedText.Encode("keep_alive"); - - public override Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReference Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue propKeepAlive = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propKeepAlive.TryReadProperty(ref reader, options, PropKeepAlive, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReference(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - KeepAlive = propKeepAlive.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReference value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropKeepAlive, value.KeepAlive, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReferenceConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.PointInTimeReferenceConverter))] public sealed partial class PointInTimeReference { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Profile.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Profile.Converters.g.cs new file mode 100644 index 00000000000..fb9af80dbfe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Profile.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class ProfileConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); + + public override Elastic.Clients.Elasticsearch.Core.Search.Profile Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propShards = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propShards.TryReadProperty(ref reader, options, PropShards, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.Profile(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Shards = propShards.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.Profile value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropShards, value.Shards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Profile.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Profile.g.cs index 5c0d306311d..50f5257d028 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Profile.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Profile.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class ProfileConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); - - public override Elastic.Clients.Elasticsearch.Core.Search.Profile Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propShards = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propShards.TryReadProperty(ref reader, options, PropShards, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.Profile(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Shards = propShards.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.Profile value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropShards, value.Shards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.ProfileConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.ProfileConverter))] public sealed partial class Profile { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/QueryBreakdown.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/QueryBreakdown.Converters.g.cs new file mode 100644 index 00000000000..e990fc16d17 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/QueryBreakdown.Converters.g.cs @@ -0,0 +1,234 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class QueryBreakdownConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAdvance = System.Text.Json.JsonEncodedText.Encode("advance"); + private static readonly System.Text.Json.JsonEncodedText PropAdvanceCount = System.Text.Json.JsonEncodedText.Encode("advance_count"); + private static readonly System.Text.Json.JsonEncodedText PropBuildScorer = System.Text.Json.JsonEncodedText.Encode("build_scorer"); + private static readonly System.Text.Json.JsonEncodedText PropBuildScorerCount = System.Text.Json.JsonEncodedText.Encode("build_scorer_count"); + private static readonly System.Text.Json.JsonEncodedText PropComputeMaxScore = System.Text.Json.JsonEncodedText.Encode("compute_max_score"); + private static readonly System.Text.Json.JsonEncodedText PropComputeMaxScoreCount = System.Text.Json.JsonEncodedText.Encode("compute_max_score_count"); + private static readonly System.Text.Json.JsonEncodedText PropCountWeight = System.Text.Json.JsonEncodedText.Encode("count_weight"); + private static readonly System.Text.Json.JsonEncodedText PropCountWeightCount = System.Text.Json.JsonEncodedText.Encode("count_weight_count"); + private static readonly System.Text.Json.JsonEncodedText PropCreateWeight = System.Text.Json.JsonEncodedText.Encode("create_weight"); + private static readonly System.Text.Json.JsonEncodedText PropCreateWeightCount = System.Text.Json.JsonEncodedText.Encode("create_weight_count"); + private static readonly System.Text.Json.JsonEncodedText PropMatch = System.Text.Json.JsonEncodedText.Encode("match"); + private static readonly System.Text.Json.JsonEncodedText PropMatchCount = System.Text.Json.JsonEncodedText.Encode("match_count"); + private static readonly System.Text.Json.JsonEncodedText PropNextDoc = System.Text.Json.JsonEncodedText.Encode("next_doc"); + private static readonly System.Text.Json.JsonEncodedText PropNextDocCount = System.Text.Json.JsonEncodedText.Encode("next_doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropScore = System.Text.Json.JsonEncodedText.Encode("score"); + private static readonly System.Text.Json.JsonEncodedText PropScoreCount = System.Text.Json.JsonEncodedText.Encode("score_count"); + private static readonly System.Text.Json.JsonEncodedText PropSetMinCompetitiveScore = System.Text.Json.JsonEncodedText.Encode("set_min_competitive_score"); + private static readonly System.Text.Json.JsonEncodedText PropSetMinCompetitiveScoreCount = System.Text.Json.JsonEncodedText.Encode("set_min_competitive_score_count"); + private static readonly System.Text.Json.JsonEncodedText PropShallowAdvance = System.Text.Json.JsonEncodedText.Encode("shallow_advance"); + private static readonly System.Text.Json.JsonEncodedText PropShallowAdvanceCount = System.Text.Json.JsonEncodedText.Encode("shallow_advance_count"); + + public override Elastic.Clients.Elasticsearch.Core.Search.QueryBreakdown Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAdvance = default; + LocalJsonValue propAdvanceCount = default; + LocalJsonValue propBuildScorer = default; + LocalJsonValue propBuildScorerCount = default; + LocalJsonValue propComputeMaxScore = default; + LocalJsonValue propComputeMaxScoreCount = default; + LocalJsonValue propCountWeight = default; + LocalJsonValue propCountWeightCount = default; + LocalJsonValue propCreateWeight = default; + LocalJsonValue propCreateWeightCount = default; + LocalJsonValue propMatch = default; + LocalJsonValue propMatchCount = default; + LocalJsonValue propNextDoc = default; + LocalJsonValue propNextDocCount = default; + LocalJsonValue propScore = default; + LocalJsonValue propScoreCount = default; + LocalJsonValue propSetMinCompetitiveScore = default; + LocalJsonValue propSetMinCompetitiveScoreCount = default; + LocalJsonValue propShallowAdvance = default; + LocalJsonValue propShallowAdvanceCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAdvance.TryReadProperty(ref reader, options, PropAdvance, null)) + { + continue; + } + + if (propAdvanceCount.TryReadProperty(ref reader, options, PropAdvanceCount, null)) + { + continue; + } + + if (propBuildScorer.TryReadProperty(ref reader, options, PropBuildScorer, null)) + { + continue; + } + + if (propBuildScorerCount.TryReadProperty(ref reader, options, PropBuildScorerCount, null)) + { + continue; + } + + if (propComputeMaxScore.TryReadProperty(ref reader, options, PropComputeMaxScore, null)) + { + continue; + } + + if (propComputeMaxScoreCount.TryReadProperty(ref reader, options, PropComputeMaxScoreCount, null)) + { + continue; + } + + if (propCountWeight.TryReadProperty(ref reader, options, PropCountWeight, null)) + { + continue; + } + + if (propCountWeightCount.TryReadProperty(ref reader, options, PropCountWeightCount, null)) + { + continue; + } + + if (propCreateWeight.TryReadProperty(ref reader, options, PropCreateWeight, null)) + { + continue; + } + + if (propCreateWeightCount.TryReadProperty(ref reader, options, PropCreateWeightCount, null)) + { + continue; + } + + if (propMatch.TryReadProperty(ref reader, options, PropMatch, null)) + { + continue; + } + + if (propMatchCount.TryReadProperty(ref reader, options, PropMatchCount, null)) + { + continue; + } + + if (propNextDoc.TryReadProperty(ref reader, options, PropNextDoc, null)) + { + continue; + } + + if (propNextDocCount.TryReadProperty(ref reader, options, PropNextDocCount, null)) + { + continue; + } + + if (propScore.TryReadProperty(ref reader, options, PropScore, null)) + { + continue; + } + + if (propScoreCount.TryReadProperty(ref reader, options, PropScoreCount, null)) + { + continue; + } + + if (propSetMinCompetitiveScore.TryReadProperty(ref reader, options, PropSetMinCompetitiveScore, null)) + { + continue; + } + + if (propSetMinCompetitiveScoreCount.TryReadProperty(ref reader, options, PropSetMinCompetitiveScoreCount, null)) + { + continue; + } + + if (propShallowAdvance.TryReadProperty(ref reader, options, PropShallowAdvance, null)) + { + continue; + } + + if (propShallowAdvanceCount.TryReadProperty(ref reader, options, PropShallowAdvanceCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.QueryBreakdown(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Advance = propAdvance.Value, + AdvanceCount = propAdvanceCount.Value, + BuildScorer = propBuildScorer.Value, + BuildScorerCount = propBuildScorerCount.Value, + ComputeMaxScore = propComputeMaxScore.Value, + ComputeMaxScoreCount = propComputeMaxScoreCount.Value, + CountWeight = propCountWeight.Value, + CountWeightCount = propCountWeightCount.Value, + CreateWeight = propCreateWeight.Value, + CreateWeightCount = propCreateWeightCount.Value, + Match = propMatch.Value, + MatchCount = propMatchCount.Value, + NextDoc = propNextDoc.Value, + NextDocCount = propNextDocCount.Value, + Score = propScore.Value, + ScoreCount = propScoreCount.Value, + SetMinCompetitiveScore = propSetMinCompetitiveScore.Value, + SetMinCompetitiveScoreCount = propSetMinCompetitiveScoreCount.Value, + ShallowAdvance = propShallowAdvance.Value, + ShallowAdvanceCount = propShallowAdvanceCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.QueryBreakdown value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAdvance, value.Advance, null, null); + writer.WriteProperty(options, PropAdvanceCount, value.AdvanceCount, null, null); + writer.WriteProperty(options, PropBuildScorer, value.BuildScorer, null, null); + writer.WriteProperty(options, PropBuildScorerCount, value.BuildScorerCount, null, null); + writer.WriteProperty(options, PropComputeMaxScore, value.ComputeMaxScore, null, null); + writer.WriteProperty(options, PropComputeMaxScoreCount, value.ComputeMaxScoreCount, null, null); + writer.WriteProperty(options, PropCountWeight, value.CountWeight, null, null); + writer.WriteProperty(options, PropCountWeightCount, value.CountWeightCount, null, null); + writer.WriteProperty(options, PropCreateWeight, value.CreateWeight, null, null); + writer.WriteProperty(options, PropCreateWeightCount, value.CreateWeightCount, null, null); + writer.WriteProperty(options, PropMatch, value.Match, null, null); + writer.WriteProperty(options, PropMatchCount, value.MatchCount, null, null); + writer.WriteProperty(options, PropNextDoc, value.NextDoc, null, null); + writer.WriteProperty(options, PropNextDocCount, value.NextDocCount, null, null); + writer.WriteProperty(options, PropScore, value.Score, null, null); + writer.WriteProperty(options, PropScoreCount, value.ScoreCount, null, null); + writer.WriteProperty(options, PropSetMinCompetitiveScore, value.SetMinCompetitiveScore, null, null); + writer.WriteProperty(options, PropSetMinCompetitiveScoreCount, value.SetMinCompetitiveScoreCount, null, null); + writer.WriteProperty(options, PropShallowAdvance, value.ShallowAdvance, null, null); + writer.WriteProperty(options, PropShallowAdvanceCount, value.ShallowAdvanceCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/QueryBreakdown.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/QueryBreakdown.g.cs index 378e3abf99e..77ce8e77ef6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/QueryBreakdown.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/QueryBreakdown.g.cs @@ -23,217 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class QueryBreakdownConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAdvance = System.Text.Json.JsonEncodedText.Encode("advance"); - private static readonly System.Text.Json.JsonEncodedText PropAdvanceCount = System.Text.Json.JsonEncodedText.Encode("advance_count"); - private static readonly System.Text.Json.JsonEncodedText PropBuildScorer = System.Text.Json.JsonEncodedText.Encode("build_scorer"); - private static readonly System.Text.Json.JsonEncodedText PropBuildScorerCount = System.Text.Json.JsonEncodedText.Encode("build_scorer_count"); - private static readonly System.Text.Json.JsonEncodedText PropComputeMaxScore = System.Text.Json.JsonEncodedText.Encode("compute_max_score"); - private static readonly System.Text.Json.JsonEncodedText PropComputeMaxScoreCount = System.Text.Json.JsonEncodedText.Encode("compute_max_score_count"); - private static readonly System.Text.Json.JsonEncodedText PropCountWeight = System.Text.Json.JsonEncodedText.Encode("count_weight"); - private static readonly System.Text.Json.JsonEncodedText PropCountWeightCount = System.Text.Json.JsonEncodedText.Encode("count_weight_count"); - private static readonly System.Text.Json.JsonEncodedText PropCreateWeight = System.Text.Json.JsonEncodedText.Encode("create_weight"); - private static readonly System.Text.Json.JsonEncodedText PropCreateWeightCount = System.Text.Json.JsonEncodedText.Encode("create_weight_count"); - private static readonly System.Text.Json.JsonEncodedText PropMatch = System.Text.Json.JsonEncodedText.Encode("match"); - private static readonly System.Text.Json.JsonEncodedText PropMatchCount = System.Text.Json.JsonEncodedText.Encode("match_count"); - private static readonly System.Text.Json.JsonEncodedText PropNextDoc = System.Text.Json.JsonEncodedText.Encode("next_doc"); - private static readonly System.Text.Json.JsonEncodedText PropNextDocCount = System.Text.Json.JsonEncodedText.Encode("next_doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropScore = System.Text.Json.JsonEncodedText.Encode("score"); - private static readonly System.Text.Json.JsonEncodedText PropScoreCount = System.Text.Json.JsonEncodedText.Encode("score_count"); - private static readonly System.Text.Json.JsonEncodedText PropSetMinCompetitiveScore = System.Text.Json.JsonEncodedText.Encode("set_min_competitive_score"); - private static readonly System.Text.Json.JsonEncodedText PropSetMinCompetitiveScoreCount = System.Text.Json.JsonEncodedText.Encode("set_min_competitive_score_count"); - private static readonly System.Text.Json.JsonEncodedText PropShallowAdvance = System.Text.Json.JsonEncodedText.Encode("shallow_advance"); - private static readonly System.Text.Json.JsonEncodedText PropShallowAdvanceCount = System.Text.Json.JsonEncodedText.Encode("shallow_advance_count"); - - public override Elastic.Clients.Elasticsearch.Core.Search.QueryBreakdown Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAdvance = default; - LocalJsonValue propAdvanceCount = default; - LocalJsonValue propBuildScorer = default; - LocalJsonValue propBuildScorerCount = default; - LocalJsonValue propComputeMaxScore = default; - LocalJsonValue propComputeMaxScoreCount = default; - LocalJsonValue propCountWeight = default; - LocalJsonValue propCountWeightCount = default; - LocalJsonValue propCreateWeight = default; - LocalJsonValue propCreateWeightCount = default; - LocalJsonValue propMatch = default; - LocalJsonValue propMatchCount = default; - LocalJsonValue propNextDoc = default; - LocalJsonValue propNextDocCount = default; - LocalJsonValue propScore = default; - LocalJsonValue propScoreCount = default; - LocalJsonValue propSetMinCompetitiveScore = default; - LocalJsonValue propSetMinCompetitiveScoreCount = default; - LocalJsonValue propShallowAdvance = default; - LocalJsonValue propShallowAdvanceCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAdvance.TryReadProperty(ref reader, options, PropAdvance, null)) - { - continue; - } - - if (propAdvanceCount.TryReadProperty(ref reader, options, PropAdvanceCount, null)) - { - continue; - } - - if (propBuildScorer.TryReadProperty(ref reader, options, PropBuildScorer, null)) - { - continue; - } - - if (propBuildScorerCount.TryReadProperty(ref reader, options, PropBuildScorerCount, null)) - { - continue; - } - - if (propComputeMaxScore.TryReadProperty(ref reader, options, PropComputeMaxScore, null)) - { - continue; - } - - if (propComputeMaxScoreCount.TryReadProperty(ref reader, options, PropComputeMaxScoreCount, null)) - { - continue; - } - - if (propCountWeight.TryReadProperty(ref reader, options, PropCountWeight, null)) - { - continue; - } - - if (propCountWeightCount.TryReadProperty(ref reader, options, PropCountWeightCount, null)) - { - continue; - } - - if (propCreateWeight.TryReadProperty(ref reader, options, PropCreateWeight, null)) - { - continue; - } - - if (propCreateWeightCount.TryReadProperty(ref reader, options, PropCreateWeightCount, null)) - { - continue; - } - - if (propMatch.TryReadProperty(ref reader, options, PropMatch, null)) - { - continue; - } - - if (propMatchCount.TryReadProperty(ref reader, options, PropMatchCount, null)) - { - continue; - } - - if (propNextDoc.TryReadProperty(ref reader, options, PropNextDoc, null)) - { - continue; - } - - if (propNextDocCount.TryReadProperty(ref reader, options, PropNextDocCount, null)) - { - continue; - } - - if (propScore.TryReadProperty(ref reader, options, PropScore, null)) - { - continue; - } - - if (propScoreCount.TryReadProperty(ref reader, options, PropScoreCount, null)) - { - continue; - } - - if (propSetMinCompetitiveScore.TryReadProperty(ref reader, options, PropSetMinCompetitiveScore, null)) - { - continue; - } - - if (propSetMinCompetitiveScoreCount.TryReadProperty(ref reader, options, PropSetMinCompetitiveScoreCount, null)) - { - continue; - } - - if (propShallowAdvance.TryReadProperty(ref reader, options, PropShallowAdvance, null)) - { - continue; - } - - if (propShallowAdvanceCount.TryReadProperty(ref reader, options, PropShallowAdvanceCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.QueryBreakdown(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Advance = propAdvance.Value, - AdvanceCount = propAdvanceCount.Value, - BuildScorer = propBuildScorer.Value, - BuildScorerCount = propBuildScorerCount.Value, - ComputeMaxScore = propComputeMaxScore.Value, - ComputeMaxScoreCount = propComputeMaxScoreCount.Value, - CountWeight = propCountWeight.Value, - CountWeightCount = propCountWeightCount.Value, - CreateWeight = propCreateWeight.Value, - CreateWeightCount = propCreateWeightCount.Value, - Match = propMatch.Value, - MatchCount = propMatchCount.Value, - NextDoc = propNextDoc.Value, - NextDocCount = propNextDocCount.Value, - Score = propScore.Value, - ScoreCount = propScoreCount.Value, - SetMinCompetitiveScore = propSetMinCompetitiveScore.Value, - SetMinCompetitiveScoreCount = propSetMinCompetitiveScoreCount.Value, - ShallowAdvance = propShallowAdvance.Value, - ShallowAdvanceCount = propShallowAdvanceCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.QueryBreakdown value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAdvance, value.Advance, null, null); - writer.WriteProperty(options, PropAdvanceCount, value.AdvanceCount, null, null); - writer.WriteProperty(options, PropBuildScorer, value.BuildScorer, null, null); - writer.WriteProperty(options, PropBuildScorerCount, value.BuildScorerCount, null, null); - writer.WriteProperty(options, PropComputeMaxScore, value.ComputeMaxScore, null, null); - writer.WriteProperty(options, PropComputeMaxScoreCount, value.ComputeMaxScoreCount, null, null); - writer.WriteProperty(options, PropCountWeight, value.CountWeight, null, null); - writer.WriteProperty(options, PropCountWeightCount, value.CountWeightCount, null, null); - writer.WriteProperty(options, PropCreateWeight, value.CreateWeight, null, null); - writer.WriteProperty(options, PropCreateWeightCount, value.CreateWeightCount, null, null); - writer.WriteProperty(options, PropMatch, value.Match, null, null); - writer.WriteProperty(options, PropMatchCount, value.MatchCount, null, null); - writer.WriteProperty(options, PropNextDoc, value.NextDoc, null, null); - writer.WriteProperty(options, PropNextDocCount, value.NextDocCount, null, null); - writer.WriteProperty(options, PropScore, value.Score, null, null); - writer.WriteProperty(options, PropScoreCount, value.ScoreCount, null, null); - writer.WriteProperty(options, PropSetMinCompetitiveScore, value.SetMinCompetitiveScore, null, null); - writer.WriteProperty(options, PropSetMinCompetitiveScoreCount, value.SetMinCompetitiveScoreCount, null, null); - writer.WriteProperty(options, PropShallowAdvance, value.ShallowAdvance, null, null); - writer.WriteProperty(options, PropShallowAdvanceCount, value.ShallowAdvanceCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.QueryBreakdownConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.QueryBreakdownConverter))] public sealed partial class QueryBreakdown { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/QueryProfile.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/QueryProfile.Converters.g.cs new file mode 100644 index 00000000000..1e2bfe44f9c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/QueryProfile.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class QueryProfileConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBreakdown = System.Text.Json.JsonEncodedText.Encode("breakdown"); + private static readonly System.Text.Json.JsonEncodedText PropChildren = System.Text.Json.JsonEncodedText.Encode("children"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropTimeInNanos = System.Text.Json.JsonEncodedText.Encode("time_in_nanos"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Core.Search.QueryProfile Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBreakdown = default; + LocalJsonValue?> propChildren = default; + LocalJsonValue propDescription = default; + LocalJsonValue propTimeInNanos = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBreakdown.TryReadProperty(ref reader, options, PropBreakdown, null)) + { + continue; + } + + if (propChildren.TryReadProperty(ref reader, options, PropChildren, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propTimeInNanos.TryReadProperty(ref reader, options, PropTimeInNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.QueryProfile(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Breakdown = propBreakdown.Value, + Children = propChildren.Value, + Description = propDescription.Value, + TimeInNanos = propTimeInNanos.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.QueryProfile value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBreakdown, value.Breakdown, null, null); + writer.WriteProperty(options, PropChildren, value.Children, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropTimeInNanos, value.TimeInNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/QueryProfile.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/QueryProfile.g.cs index bac97c9cae5..0328aea6b9a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/QueryProfile.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/QueryProfile.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class QueryProfileConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBreakdown = System.Text.Json.JsonEncodedText.Encode("breakdown"); - private static readonly System.Text.Json.JsonEncodedText PropChildren = System.Text.Json.JsonEncodedText.Encode("children"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropTimeInNanos = System.Text.Json.JsonEncodedText.Encode("time_in_nanos"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Core.Search.QueryProfile Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBreakdown = default; - LocalJsonValue?> propChildren = default; - LocalJsonValue propDescription = default; - LocalJsonValue propTimeInNanos = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBreakdown.TryReadProperty(ref reader, options, PropBreakdown, null)) - { - continue; - } - - if (propChildren.TryReadProperty(ref reader, options, PropChildren, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propTimeInNanos.TryReadProperty(ref reader, options, PropTimeInNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.QueryProfile(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Breakdown = propBreakdown.Value, - Children = propChildren.Value, - Description = propDescription.Value, - TimeInNanos = propTimeInNanos.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.QueryProfile value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBreakdown, value.Breakdown, null, null); - writer.WriteProperty(options, PropChildren, value.Children, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropTimeInNanos, value.TimeInNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.QueryProfileConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.QueryProfileConverter))] public sealed partial class QueryProfile { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/RegexOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/RegexOptions.Converters.g.cs new file mode 100644 index 00000000000..d3cc52453d3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/RegexOptions.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class RegexOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFlags = System.Text.Json.JsonEncodedText.Encode("flags"); + private static readonly System.Text.Json.JsonEncodedText PropMaxDeterminizedStates = System.Text.Json.JsonEncodedText.Encode("max_determinized_states"); + + public override Elastic.Clients.Elasticsearch.Core.Search.RegexOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propFlags = default; + LocalJsonValue propMaxDeterminizedStates = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFlags.TryReadProperty(ref reader, options, PropFlags, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) + { + continue; + } + + if (propMaxDeterminizedStates.TryReadProperty(ref reader, options, PropMaxDeterminizedStates, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.RegexOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Flags = propFlags.Value, + MaxDeterminizedStates = propMaxDeterminizedStates.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.RegexOptions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFlags, value.Flags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); + writer.WriteProperty(options, PropMaxDeterminizedStates, value.MaxDeterminizedStates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/RegexOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/RegexOptions.g.cs index c292e65c5c6..d441c43551f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/RegexOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/RegexOptions.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class RegexOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFlags = System.Text.Json.JsonEncodedText.Encode("flags"); - private static readonly System.Text.Json.JsonEncodedText PropMaxDeterminizedStates = System.Text.Json.JsonEncodedText.Encode("max_determinized_states"); - - public override Elastic.Clients.Elasticsearch.Core.Search.RegexOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propFlags = default; - LocalJsonValue propMaxDeterminizedStates = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFlags.TryReadProperty(ref reader, options, PropFlags, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) - { - continue; - } - - if (propMaxDeterminizedStates.TryReadProperty(ref reader, options, PropMaxDeterminizedStates, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.RegexOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Flags = propFlags.Value, - MaxDeterminizedStates = propMaxDeterminizedStates.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.RegexOptions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFlags, value.Flags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); - writer.WriteProperty(options, PropMaxDeterminizedStates, value.MaxDeterminizedStates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.RegexOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.RegexOptionsConverter))] public sealed partial class RegexOptions { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Rescore.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Rescore.Converters.g.cs new file mode 100644 index 00000000000..1fe26531cbb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Rescore.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class RescoreConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropWindowSize = System.Text.Json.JsonEncodedText.Encode("window_size"); + private static readonly System.Text.Json.JsonEncodedText VariantLearningToRank = System.Text.Json.JsonEncodedText.Encode("learning_to_rank"); + private static readonly System.Text.Json.JsonEncodedText VariantQuery = System.Text.Json.JsonEncodedText.Encode("query"); + + public override Elastic.Clients.Elasticsearch.Core.Search.Rescore Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propWindowSize = default; + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propWindowSize.TryReadProperty(ref reader, options, PropWindowSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(VariantLearningToRank)) + { + variantType = VariantLearningToRank.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantQuery)) + { + variantType = VariantQuery.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.Rescore(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant, + WindowSize = propWindowSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.Rescore value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "learning_to_rank": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Core.Search.LearningToRank)value.Variant, null, null); + break; + case "query": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Core.Search.RescoreQuery)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Core.Search.Rescore)}'."); + } + + writer.WriteProperty(options, PropWindowSize, value.WindowSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Rescore.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Rescore.g.cs index 3ab7af2a240..bb2e813303c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Rescore.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Rescore.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class RescoreConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropWindowSize = System.Text.Json.JsonEncodedText.Encode("window_size"); - private static readonly System.Text.Json.JsonEncodedText VariantLearningToRank = System.Text.Json.JsonEncodedText.Encode("learning_to_rank"); - private static readonly System.Text.Json.JsonEncodedText VariantQuery = System.Text.Json.JsonEncodedText.Encode("query"); - - public override Elastic.Clients.Elasticsearch.Core.Search.Rescore Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propWindowSize = default; - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propWindowSize.TryReadProperty(ref reader, options, PropWindowSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(VariantLearningToRank)) - { - variantType = VariantLearningToRank.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantQuery)) - { - variantType = VariantQuery.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.Rescore(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant, - WindowSize = propWindowSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.Rescore value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "learning_to_rank": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Core.Search.LearningToRank)value.Variant, null, null); - break; - case "query": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Core.Search.RescoreQuery)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Core.Search.Rescore)}'."); - } - - writer.WriteProperty(options, PropWindowSize, value.WindowSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.RescoreConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.RescoreConverter))] public sealed partial class Rescore { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/RescoreQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/RescoreQuery.Converters.g.cs new file mode 100644 index 00000000000..24676c06b17 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/RescoreQuery.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class RescoreQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("rescore_query"); + private static readonly System.Text.Json.JsonEncodedText PropQueryWeight = System.Text.Json.JsonEncodedText.Encode("query_weight"); + private static readonly System.Text.Json.JsonEncodedText PropRescoreQueryWeight = System.Text.Json.JsonEncodedText.Encode("rescore_query_weight"); + private static readonly System.Text.Json.JsonEncodedText PropScoreMode = System.Text.Json.JsonEncodedText.Encode("score_mode"); + + public override Elastic.Clients.Elasticsearch.Core.Search.RescoreQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propQuery = default; + LocalJsonValue propQueryWeight = default; + LocalJsonValue propRescoreQueryWeight = default; + LocalJsonValue propScoreMode = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propQueryWeight.TryReadProperty(ref reader, options, PropQueryWeight, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRescoreQueryWeight.TryReadProperty(ref reader, options, PropRescoreQueryWeight, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propScoreMode.TryReadProperty(ref reader, options, PropScoreMode, static Elastic.Clients.Elasticsearch.Core.Search.ScoreMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.RescoreQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Query = propQuery.Value, + QueryWeight = propQueryWeight.Value, + RescoreQueryWeight = propRescoreQueryWeight.Value, + ScoreMode = propScoreMode.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.RescoreQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropQueryWeight, value.QueryWeight, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRescoreQueryWeight, value.RescoreQueryWeight, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropScoreMode, value.ScoreMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.ScoreMode? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/RescoreQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/RescoreQuery.g.cs index 85f238a1a17..abd45311829 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/RescoreQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/RescoreQuery.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class RescoreQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("rescore_query"); - private static readonly System.Text.Json.JsonEncodedText PropQueryWeight = System.Text.Json.JsonEncodedText.Encode("query_weight"); - private static readonly System.Text.Json.JsonEncodedText PropRescoreQueryWeight = System.Text.Json.JsonEncodedText.Encode("rescore_query_weight"); - private static readonly System.Text.Json.JsonEncodedText PropScoreMode = System.Text.Json.JsonEncodedText.Encode("score_mode"); - - public override Elastic.Clients.Elasticsearch.Core.Search.RescoreQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propQuery = default; - LocalJsonValue propQueryWeight = default; - LocalJsonValue propRescoreQueryWeight = default; - LocalJsonValue propScoreMode = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propQueryWeight.TryReadProperty(ref reader, options, PropQueryWeight, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRescoreQueryWeight.TryReadProperty(ref reader, options, PropRescoreQueryWeight, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propScoreMode.TryReadProperty(ref reader, options, PropScoreMode, static Elastic.Clients.Elasticsearch.Core.Search.ScoreMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.RescoreQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Query = propQuery.Value, - QueryWeight = propQueryWeight.Value, - RescoreQueryWeight = propRescoreQueryWeight.Value, - ScoreMode = propScoreMode.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.RescoreQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropQueryWeight, value.QueryWeight, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRescoreQueryWeight, value.RescoreQueryWeight, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropScoreMode, value.ScoreMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.ScoreMode? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.RescoreQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.RescoreQueryConverter))] public sealed partial class RescoreQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/ScoreMode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/ScoreMode.Converters.g.cs new file mode 100644 index 00000000000..f13fdfe370f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/ScoreMode.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class ScoreModeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAvg = System.Text.Json.JsonEncodedText.Encode("avg"); + private static readonly System.Text.Json.JsonEncodedText MemberMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText MemberMin = System.Text.Json.JsonEncodedText.Encode("min"); + private static readonly System.Text.Json.JsonEncodedText MemberMultiply = System.Text.Json.JsonEncodedText.Encode("multiply"); + private static readonly System.Text.Json.JsonEncodedText MemberTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Core.Search.ScoreMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAvg)) + { + return Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Avg; + } + + if (reader.ValueTextEquals(MemberMax)) + { + return Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Max; + } + + if (reader.ValueTextEquals(MemberMin)) + { + return Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Min; + } + + if (reader.ValueTextEquals(MemberMultiply)) + { + return Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Multiply; + } + + if (reader.ValueTextEquals(MemberTotal)) + { + return Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Total; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAvg.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Avg; + } + + if (string.Equals(value, MemberMax.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Max; + } + + if (string.Equals(value, MemberMin.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Min; + } + + if (string.Equals(value, MemberMultiply.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Multiply; + } + + if (string.Equals(value, MemberTotal.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Total; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.ScoreMode)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.ScoreMode value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Avg: + writer.WriteStringValue(MemberAvg); + break; + case Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Max: + writer.WriteStringValue(MemberMax); + break; + case Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Min: + writer.WriteStringValue(MemberMin); + break; + case Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Multiply: + writer.WriteStringValue(MemberMultiply); + break; + case Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Total: + writer.WriteStringValue(MemberTotal); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.ScoreMode)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Core.Search.ScoreMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.ScoreMode value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/ScoreMode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/ScoreMode.g.cs new file mode 100644 index 00000000000..33d2f26bfb9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/ScoreMode.g.cs @@ -0,0 +1,65 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.ScoreModeConverter))] +public enum ScoreMode +{ + /// + /// + /// Average the original score and the rescore query score. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "avg")] + Avg, + /// + /// + /// Take the max of original score and the rescore query score. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "max")] + Max, + /// + /// + /// Take the min of the original score and the rescore query score. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "min")] + Min, + /// + /// + /// Multiply the original score by the rescore query score. + /// Useful for function query rescores. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "multiply")] + Multiply, + /// + /// + /// Add the original score and the rescore query score. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "total")] + Total +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SearchProfile.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SearchProfile.Converters.g.cs new file mode 100644 index 00000000000..86b00540323 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SearchProfile.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class SearchProfileConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCollector = System.Text.Json.JsonEncodedText.Encode("collector"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropRewriteTime = System.Text.Json.JsonEncodedText.Encode("rewrite_time"); + + public override Elastic.Clients.Elasticsearch.Core.Search.SearchProfile Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propCollector = default; + LocalJsonValue> propQuery = default; + LocalJsonValue propRewriteTime = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCollector.TryReadProperty(ref reader, options, PropCollector, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propRewriteTime.TryReadProperty(ref reader, options, PropRewriteTime, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.SearchProfile(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Collector = propCollector.Value, + Query = propQuery.Value, + RewriteTime = propRewriteTime.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.SearchProfile value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCollector, value.Collector, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropQuery, value.Query, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRewriteTime, value.RewriteTime, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SearchProfile.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SearchProfile.g.cs index 66401a1fabd..6a95c1f252d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SearchProfile.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SearchProfile.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class SearchProfileConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCollector = System.Text.Json.JsonEncodedText.Encode("collector"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropRewriteTime = System.Text.Json.JsonEncodedText.Encode("rewrite_time"); - - public override Elastic.Clients.Elasticsearch.Core.Search.SearchProfile Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propCollector = default; - LocalJsonValue> propQuery = default; - LocalJsonValue propRewriteTime = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCollector.TryReadProperty(ref reader, options, PropCollector, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propRewriteTime.TryReadProperty(ref reader, options, PropRewriteTime, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.SearchProfile(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Collector = propCollector.Value, - Query = propQuery.Value, - RewriteTime = propRewriteTime.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.SearchProfile value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCollector, value.Collector, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropQuery, value.Query, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRewriteTime, value.RewriteTime, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.SearchProfileConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.SearchProfileConverter))] public sealed partial class SearchProfile { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/ShardProfile.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/ShardProfile.Converters.g.cs new file mode 100644 index 00000000000..c998c177077 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/ShardProfile.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class ShardProfileConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); + private static readonly System.Text.Json.JsonEncodedText PropCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); + private static readonly System.Text.Json.JsonEncodedText PropDfs = System.Text.Json.JsonEncodedText.Encode("dfs"); + private static readonly System.Text.Json.JsonEncodedText PropFetch = System.Text.Json.JsonEncodedText.Encode("fetch"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropNodeId = System.Text.Json.JsonEncodedText.Encode("node_id"); + private static readonly System.Text.Json.JsonEncodedText PropSearches = System.Text.Json.JsonEncodedText.Encode("searches"); + private static readonly System.Text.Json.JsonEncodedText PropShardId = System.Text.Json.JsonEncodedText.Encode("shard_id"); + + public override Elastic.Clients.Elasticsearch.Core.Search.ShardProfile Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propAggregations = default; + LocalJsonValue propCluster = default; + LocalJsonValue propDfs = default; + LocalJsonValue propFetch = default; + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + LocalJsonValue propNodeId = default; + LocalJsonValue> propSearches = default; + LocalJsonValue propShardId = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propCluster.TryReadProperty(ref reader, options, PropCluster, null)) + { + continue; + } + + if (propDfs.TryReadProperty(ref reader, options, PropDfs, null)) + { + continue; + } + + if (propFetch.TryReadProperty(ref reader, options, PropFetch, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propNodeId.TryReadProperty(ref reader, options, PropNodeId, null)) + { + continue; + } + + if (propSearches.TryReadProperty(ref reader, options, PropSearches, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propShardId.TryReadProperty(ref reader, options, PropShardId, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.ShardProfile(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = propAggregations.Value, + Cluster = propCluster.Value, + Dfs = propDfs.Value, + Fetch = propFetch.Value, + Id = propId.Value, + Index = propIndex.Value, + NodeId = propNodeId.Value, + Searches = propSearches.Value, + ShardId = propShardId.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.ShardProfile value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCluster, value.Cluster, null, null); + writer.WriteProperty(options, PropDfs, value.Dfs, null, null); + writer.WriteProperty(options, PropFetch, value.Fetch, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropNodeId, value.NodeId, null, null); + writer.WriteProperty(options, PropSearches, value.Searches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropShardId, value.ShardId, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/ShardProfile.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/ShardProfile.g.cs index 1d6a34f2ad0..99b18da604d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/ShardProfile.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/ShardProfile.g.cs @@ -23,118 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class ShardProfileConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); - private static readonly System.Text.Json.JsonEncodedText PropCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); - private static readonly System.Text.Json.JsonEncodedText PropDfs = System.Text.Json.JsonEncodedText.Encode("dfs"); - private static readonly System.Text.Json.JsonEncodedText PropFetch = System.Text.Json.JsonEncodedText.Encode("fetch"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropNodeId = System.Text.Json.JsonEncodedText.Encode("node_id"); - private static readonly System.Text.Json.JsonEncodedText PropSearches = System.Text.Json.JsonEncodedText.Encode("searches"); - private static readonly System.Text.Json.JsonEncodedText PropShardId = System.Text.Json.JsonEncodedText.Encode("shard_id"); - - public override Elastic.Clients.Elasticsearch.Core.Search.ShardProfile Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propAggregations = default; - LocalJsonValue propCluster = default; - LocalJsonValue propDfs = default; - LocalJsonValue propFetch = default; - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - LocalJsonValue propNodeId = default; - LocalJsonValue> propSearches = default; - LocalJsonValue propShardId = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propCluster.TryReadProperty(ref reader, options, PropCluster, null)) - { - continue; - } - - if (propDfs.TryReadProperty(ref reader, options, PropDfs, null)) - { - continue; - } - - if (propFetch.TryReadProperty(ref reader, options, PropFetch, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propNodeId.TryReadProperty(ref reader, options, PropNodeId, null)) - { - continue; - } - - if (propSearches.TryReadProperty(ref reader, options, PropSearches, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propShardId.TryReadProperty(ref reader, options, PropShardId, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.ShardProfile(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = propAggregations.Value, - Cluster = propCluster.Value, - Dfs = propDfs.Value, - Fetch = propFetch.Value, - Id = propId.Value, - Index = propIndex.Value, - NodeId = propNodeId.Value, - Searches = propSearches.Value, - ShardId = propShardId.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.ShardProfile value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCluster, value.Cluster, null, null); - writer.WriteProperty(options, PropDfs, value.Dfs, null, null); - writer.WriteProperty(options, PropFetch, value.Fetch, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropNodeId, value.NodeId, null, null); - writer.WriteProperty(options, PropSearches, value.Searches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropShardId, value.ShardId, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.ShardProfileConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.ShardProfileConverter))] public sealed partial class ShardProfile { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SmoothingModel.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SmoothingModel.Converters.g.cs new file mode 100644 index 00000000000..9bdd6428257 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SmoothingModel.Converters.g.cs @@ -0,0 +1,102 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class SmoothingModelConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantLaplace = System.Text.Json.JsonEncodedText.Encode("laplace"); + private static readonly System.Text.Json.JsonEncodedText VariantLinearInterpolation = System.Text.Json.JsonEncodedText.Encode("linear_interpolation"); + private static readonly System.Text.Json.JsonEncodedText VariantStupidBackoff = System.Text.Json.JsonEncodedText.Encode("stupid_backoff"); + + public override Elastic.Clients.Elasticsearch.Core.Search.SmoothingModel Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantLaplace)) + { + variantType = VariantLaplace.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantLinearInterpolation)) + { + variantType = VariantLinearInterpolation.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantStupidBackoff)) + { + variantType = VariantStupidBackoff.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.SmoothingModel(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.SmoothingModel value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "laplace": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Core.Search.LaplaceSmoothingModel)value.Variant, null, null); + break; + case "linear_interpolation": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Core.Search.LinearInterpolationSmoothingModel)value.Variant, null, null); + break; + case "stupid_backoff": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Core.Search.StupidBackoffSmoothingModel)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Core.Search.SmoothingModel)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SmoothingModel.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SmoothingModel.g.cs index 553ce3b7019..1f793fc1049 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SmoothingModel.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SmoothingModel.g.cs @@ -23,85 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class SmoothingModelConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantLaplace = System.Text.Json.JsonEncodedText.Encode("laplace"); - private static readonly System.Text.Json.JsonEncodedText VariantLinearInterpolation = System.Text.Json.JsonEncodedText.Encode("linear_interpolation"); - private static readonly System.Text.Json.JsonEncodedText VariantStupidBackoff = System.Text.Json.JsonEncodedText.Encode("stupid_backoff"); - - public override Elastic.Clients.Elasticsearch.Core.Search.SmoothingModel Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantLaplace)) - { - variantType = VariantLaplace.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantLinearInterpolation)) - { - variantType = VariantLinearInterpolation.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantStupidBackoff)) - { - variantType = VariantStupidBackoff.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.SmoothingModel(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.SmoothingModel value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "laplace": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Core.Search.LaplaceSmoothingModel)value.Variant, null, null); - break; - case "linear_interpolation": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Core.Search.LinearInterpolationSmoothingModel)value.Variant, null, null); - break; - case "stupid_backoff": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Core.Search.StupidBackoffSmoothingModel)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Core.Search.SmoothingModel)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.SmoothingModelConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.SmoothingModelConverter))] public sealed partial class SmoothingModel { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SourceFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SourceFilter.Converters.g.cs new file mode 100644 index 00000000000..7d7f07e45f8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SourceFilter.Converters.g.cs @@ -0,0 +1,92 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class SourceFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExcludes = System.Text.Json.JsonEncodedText.Encode("excludes"); + private static readonly System.Text.Json.JsonEncodedText PropExcludes1 = System.Text.Json.JsonEncodedText.Encode("exclude"); + private static readonly System.Text.Json.JsonEncodedText PropExcludeVectors = System.Text.Json.JsonEncodedText.Encode("exclude_vectors"); + private static readonly System.Text.Json.JsonEncodedText PropIncludes = System.Text.Json.JsonEncodedText.Encode("includes"); + private static readonly System.Text.Json.JsonEncodedText PropIncludes1 = System.Text.Json.JsonEncodedText.Encode("include"); + + public override Elastic.Clients.Elasticsearch.Core.Search.SourceFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) + { + var value = reader.ReadValue(options, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + return new Elastic.Clients.Elasticsearch.Core.Search.SourceFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Includes = value + }; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExcludes = default; + LocalJsonValue propExcludeVectors = default; + LocalJsonValue propIncludes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExcludes.TryReadProperty(ref reader, options, PropExcludes, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))) || propExcludes.TryReadProperty(ref reader, options, PropExcludes1, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propExcludeVectors.TryReadProperty(ref reader, options, PropExcludeVectors, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIncludes.TryReadProperty(ref reader, options, PropIncludes, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))) || propIncludes.TryReadProperty(ref reader, options, PropIncludes1, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.SourceFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Excludes = propExcludes.Value, + ExcludeVectors = propExcludeVectors.Value, + Includes = propIncludes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.SourceFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExcludes, value.Excludes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropExcludeVectors, value.ExcludeVectors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIncludes, value.Includes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SourceFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SourceFilter.g.cs index c613c9e4a12..a9d982a9b14 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SourceFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SourceFilter.g.cs @@ -23,75 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class SourceFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExcludes = System.Text.Json.JsonEncodedText.Encode("excludes"); - private static readonly System.Text.Json.JsonEncodedText PropExcludes1 = System.Text.Json.JsonEncodedText.Encode("exclude"); - private static readonly System.Text.Json.JsonEncodedText PropExcludeVectors = System.Text.Json.JsonEncodedText.Encode("exclude_vectors"); - private static readonly System.Text.Json.JsonEncodedText PropIncludes = System.Text.Json.JsonEncodedText.Encode("includes"); - private static readonly System.Text.Json.JsonEncodedText PropIncludes1 = System.Text.Json.JsonEncodedText.Encode("include"); - - public override Elastic.Clients.Elasticsearch.Core.Search.SourceFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) - { - var value = reader.ReadValue(options, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - return new Elastic.Clients.Elasticsearch.Core.Search.SourceFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Includes = value - }; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propExcludes = default; - LocalJsonValue propExcludeVectors = default; - LocalJsonValue propIncludes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExcludes.TryReadProperty(ref reader, options, PropExcludes, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))) || propExcludes.TryReadProperty(ref reader, options, PropExcludes1, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propExcludeVectors.TryReadProperty(ref reader, options, PropExcludeVectors, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIncludes.TryReadProperty(ref reader, options, PropIncludes, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))) || propIncludes.TryReadProperty(ref reader, options, PropIncludes1, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.SourceFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Excludes = propExcludes.Value, - ExcludeVectors = propExcludeVectors.Value, - Includes = propIncludes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.SourceFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExcludes, value.Excludes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropExcludeVectors, value.ExcludeVectors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIncludes, value.Includes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.SourceFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.SourceFilterConverter))] public sealed partial class SourceFilter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/StringDistance.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/StringDistance.Converters.g.cs new file mode 100644 index 00000000000..1cb58ae1cfd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/StringDistance.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class StringDistanceConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberDamerauLevenshtein = System.Text.Json.JsonEncodedText.Encode("damerau_levenshtein"); + private static readonly System.Text.Json.JsonEncodedText MemberInternal = System.Text.Json.JsonEncodedText.Encode("internal"); + private static readonly System.Text.Json.JsonEncodedText MemberJaroWinkler = System.Text.Json.JsonEncodedText.Encode("jaro_winkler"); + private static readonly System.Text.Json.JsonEncodedText MemberLevenshtein = System.Text.Json.JsonEncodedText.Encode("levenshtein"); + private static readonly System.Text.Json.JsonEncodedText MemberNgram = System.Text.Json.JsonEncodedText.Encode("ngram"); + + public override Elastic.Clients.Elasticsearch.Core.Search.StringDistance Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberDamerauLevenshtein)) + { + return Elastic.Clients.Elasticsearch.Core.Search.StringDistance.DamerauLevenshtein; + } + + if (reader.ValueTextEquals(MemberInternal)) + { + return Elastic.Clients.Elasticsearch.Core.Search.StringDistance.Internal; + } + + if (reader.ValueTextEquals(MemberJaroWinkler)) + { + return Elastic.Clients.Elasticsearch.Core.Search.StringDistance.JaroWinkler; + } + + if (reader.ValueTextEquals(MemberLevenshtein)) + { + return Elastic.Clients.Elasticsearch.Core.Search.StringDistance.Levenshtein; + } + + if (reader.ValueTextEquals(MemberNgram)) + { + return Elastic.Clients.Elasticsearch.Core.Search.StringDistance.Ngram; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberDamerauLevenshtein.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Search.StringDistance.DamerauLevenshtein; + } + + if (string.Equals(value, MemberInternal.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Search.StringDistance.Internal; + } + + if (string.Equals(value, MemberJaroWinkler.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Search.StringDistance.JaroWinkler; + } + + if (string.Equals(value, MemberLevenshtein.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Search.StringDistance.Levenshtein; + } + + if (string.Equals(value, MemberNgram.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Search.StringDistance.Ngram; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.StringDistance)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.StringDistance value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Core.Search.StringDistance.DamerauLevenshtein: + writer.WriteStringValue(MemberDamerauLevenshtein); + break; + case Elastic.Clients.Elasticsearch.Core.Search.StringDistance.Internal: + writer.WriteStringValue(MemberInternal); + break; + case Elastic.Clients.Elasticsearch.Core.Search.StringDistance.JaroWinkler: + writer.WriteStringValue(MemberJaroWinkler); + break; + case Elastic.Clients.Elasticsearch.Core.Search.StringDistance.Levenshtein: + writer.WriteStringValue(MemberLevenshtein); + break; + case Elastic.Clients.Elasticsearch.Core.Search.StringDistance.Ngram: + writer.WriteStringValue(MemberNgram); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.StringDistance)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Core.Search.StringDistance ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.StringDistance value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/StringDistance.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/StringDistance.g.cs new file mode 100644 index 00000000000..ca8fdc8c949 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/StringDistance.g.cs @@ -0,0 +1,64 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.StringDistanceConverter))] +public enum StringDistance +{ + /// + /// + /// String distance algorithm based on Damerau-Levenshtein algorithm. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "damerau_levenshtein")] + DamerauLevenshtein, + /// + /// + /// Based on the Damerau-Levenshtein algorithm, but highly optimized for comparing string distance for terms inside the index. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "internal")] + Internal, + /// + /// + /// String distance algorithm based on Jaro-Winkler algorithm. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "jaro_winkler")] + JaroWinkler, + /// + /// + /// String distance algorithm based on the Levenshtein edit distance algorithm. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "levenshtein")] + Levenshtein, + /// + /// + /// String distance algorithm based on character n-grams. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "ngram")] + Ngram +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/StupidBackoffSmoothingModel.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/StupidBackoffSmoothingModel.Converters.g.cs new file mode 100644 index 00000000000..915c9aff610 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/StupidBackoffSmoothingModel.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class StupidBackoffSmoothingModelConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDiscount = System.Text.Json.JsonEncodedText.Encode("discount"); + + public override Elastic.Clients.Elasticsearch.Core.Search.StupidBackoffSmoothingModel Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDiscount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDiscount.TryReadProperty(ref reader, options, PropDiscount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.StupidBackoffSmoothingModel(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Discount = propDiscount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.StupidBackoffSmoothingModel value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDiscount, value.Discount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/StupidBackoffSmoothingModel.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/StupidBackoffSmoothingModel.g.cs index c81a09c9827..4398e37a9e3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/StupidBackoffSmoothingModel.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/StupidBackoffSmoothingModel.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class StupidBackoffSmoothingModelConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDiscount = System.Text.Json.JsonEncodedText.Encode("discount"); - - public override Elastic.Clients.Elasticsearch.Core.Search.StupidBackoffSmoothingModel Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDiscount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDiscount.TryReadProperty(ref reader, options, PropDiscount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.StupidBackoffSmoothingModel(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Discount = propDiscount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.StupidBackoffSmoothingModel value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDiscount, value.Discount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.StupidBackoffSmoothingModelConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.StupidBackoffSmoothingModelConverter))] public sealed partial class StupidBackoffSmoothingModel { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SuggestDictionary.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SuggestDictionary.Converters.g.cs new file mode 100644 index 00000000000..f6c7e8f5849 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SuggestDictionary.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class SuggestDictionaryConverter : System.Text.Json.Serialization.JsonConverter> +{ + public override Elastic.Clients.Elasticsearch.Core.Search.SuggestDictionary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + var dictionary = new System.Collections.Generic.Dictionary>(); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + ReadItem(ref reader, options, out string name, out System.Collections.Generic.IReadOnlyCollection value); + dictionary[name] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.SuggestDictionary(dictionary); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.SuggestDictionary value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + foreach (var pair in value) + { + WriteItem(writer, options, pair.Key, pair.Value); + } + + writer.WriteEndObject(); + } + + internal static void ReadItem(ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options, out string name, out System.Collections.Generic.IReadOnlyCollection value) + { + var key = reader.ReadPropertyName(options, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!); + reader.Read(); + var parts = key.Split('#'); + if (parts.Length != 2) + { + throw new System.Text.Json.JsonException($"Unable to parse typed-key '{key}' for variant '{nameof(System.Collections.Generic.IReadOnlyCollection)}'."); + } + + var discriminator = parts[0]; + name = parts[1]; + value = discriminator switch + { + "completion" => reader.ReadValue>>(options, static System.Collections.Generic.IReadOnlyCollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, null)!), + "phrase" => reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!), + "term" => reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!), + _ => throw new System.Text.Json.JsonException($"Variant '{discriminator}' is not supported for type '{nameof(System.Collections.Generic.IReadOnlyCollection)}'.") + }; + } + + internal static void WriteItem(System.Text.Json.Utf8JsonWriter writer, System.Text.Json.JsonSerializerOptions options, string name, System.Collections.Generic.IReadOnlyCollection value) + { + var key = System.Linq.Enumerable.First(value).Type + '#' + name; + switch (value) + { + case System.Collections.Generic.IReadOnlyCollection> v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection> v) => w.WritePropertyName>>(o, v)); + break; + case System.Collections.Generic.IReadOnlyCollection v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WritePropertyName>(o, v)); + break; + case System.Collections.Generic.IReadOnlyCollection v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WritePropertyName>(o, v)); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{0}' is not supported for type '{nameof(System.Collections.Generic.IReadOnlyCollection)}'."); + } + } +} + +public sealed partial class SuggestDictionaryConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(SuggestDictionary<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(SuggestDictionaryConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SuggestDictionary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SuggestDictionary.g.cs index bb8a8bf3685..fa1465ffccd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SuggestDictionary.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SuggestDictionary.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class SuggestDictionaryConverter : System.Text.Json.Serialization.JsonConverter> -{ - public override Elastic.Clients.Elasticsearch.Core.Search.SuggestDictionary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - var dictionary = new System.Collections.Generic.Dictionary>(); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - ReadItem(ref reader, options, out string name, out System.Collections.Generic.IReadOnlyCollection value); - dictionary[name] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.SuggestDictionary(dictionary); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.SuggestDictionary value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - foreach (var pair in value) - { - WriteItem(writer, options, pair.Key, pair.Value); - } - - writer.WriteEndObject(); - } - - internal static void ReadItem(ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options, out string name, out System.Collections.Generic.IReadOnlyCollection value) - { - var key = reader.ReadPropertyName(options, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!); - reader.Read(); - var parts = key.Split('#'); - if (parts.Length != 2) - { - throw new System.Text.Json.JsonException($"Unable to parse typed-key '{key}' for variant '{nameof(System.Collections.Generic.IReadOnlyCollection)}'."); - } - - var discriminator = parts[0]; - name = parts[1]; - value = discriminator switch - { - "completion" => reader.ReadValue>>(options, static System.Collections.Generic.IReadOnlyCollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, null)!), - "phrase" => reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!), - "term" => reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!), - _ => throw new System.Text.Json.JsonException($"Variant '{discriminator}' is not supported for type '{nameof(System.Collections.Generic.IReadOnlyCollection)}'.") - }; - } - - internal static void WriteItem(System.Text.Json.Utf8JsonWriter writer, System.Text.Json.JsonSerializerOptions options, string name, System.Collections.Generic.IReadOnlyCollection value) - { - var key = System.Linq.Enumerable.First(value).Type + '#' + name; - switch (value) - { - case System.Collections.Generic.IReadOnlyCollection> v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection> v) => w.WritePropertyName>>(o, v)); - break; - case System.Collections.Generic.IReadOnlyCollection v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WritePropertyName>(o, v)); - break; - case System.Collections.Generic.IReadOnlyCollection v: - writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WritePropertyName>(o, v)); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{0}' is not supported for type '{nameof(System.Collections.Generic.IReadOnlyCollection)}'."); - } - } -} - -internal sealed partial class SuggestDictionaryConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(SuggestDictionary<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(SuggestDictionaryConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.SuggestDictionaryConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.SuggestDictionaryConverterFactory))] public sealed partial class SuggestDictionary : Elastic.Clients.Elasticsearch.IsAReadOnlyDictionary> { public SuggestDictionary(System.Collections.Generic.IReadOnlyDictionary> backingDictionary) : base(backingDictionary) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SuggestFuzziness.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SuggestFuzziness.Converters.g.cs new file mode 100644 index 00000000000..ecd4d78553e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SuggestFuzziness.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class SuggestFuzzinessConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFuzziness = System.Text.Json.JsonEncodedText.Encode("fuzziness"); + private static readonly System.Text.Json.JsonEncodedText PropMinLength = System.Text.Json.JsonEncodedText.Encode("min_length"); + private static readonly System.Text.Json.JsonEncodedText PropPrefixLength = System.Text.Json.JsonEncodedText.Encode("prefix_length"); + private static readonly System.Text.Json.JsonEncodedText PropTranspositions = System.Text.Json.JsonEncodedText.Encode("transpositions"); + private static readonly System.Text.Json.JsonEncodedText PropUnicodeAware = System.Text.Json.JsonEncodedText.Encode("unicode_aware"); + + public override Elastic.Clients.Elasticsearch.Core.Search.SuggestFuzziness Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFuzziness = default; + LocalJsonValue propMinLength = default; + LocalJsonValue propPrefixLength = default; + LocalJsonValue propTranspositions = default; + LocalJsonValue propUnicodeAware = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFuzziness.TryReadProperty(ref reader, options, PropFuzziness, null)) + { + continue; + } + + if (propMinLength.TryReadProperty(ref reader, options, PropMinLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPrefixLength.TryReadProperty(ref reader, options, PropPrefixLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTranspositions.TryReadProperty(ref reader, options, PropTranspositions, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propUnicodeAware.TryReadProperty(ref reader, options, PropUnicodeAware, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.SuggestFuzziness(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Fuzziness = propFuzziness.Value, + MinLength = propMinLength.Value, + PrefixLength = propPrefixLength.Value, + Transpositions = propTranspositions.Value, + UnicodeAware = propUnicodeAware.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.SuggestFuzziness value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFuzziness, value.Fuzziness, null, null); + writer.WriteProperty(options, PropMinLength, value.MinLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPrefixLength, value.PrefixLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTranspositions, value.Transpositions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropUnicodeAware, value.UnicodeAware, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SuggestFuzziness.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SuggestFuzziness.g.cs index fab2e1d0a40..f2f3d290bb3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SuggestFuzziness.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SuggestFuzziness.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class SuggestFuzzinessConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFuzziness = System.Text.Json.JsonEncodedText.Encode("fuzziness"); - private static readonly System.Text.Json.JsonEncodedText PropMinLength = System.Text.Json.JsonEncodedText.Encode("min_length"); - private static readonly System.Text.Json.JsonEncodedText PropPrefixLength = System.Text.Json.JsonEncodedText.Encode("prefix_length"); - private static readonly System.Text.Json.JsonEncodedText PropTranspositions = System.Text.Json.JsonEncodedText.Encode("transpositions"); - private static readonly System.Text.Json.JsonEncodedText PropUnicodeAware = System.Text.Json.JsonEncodedText.Encode("unicode_aware"); - - public override Elastic.Clients.Elasticsearch.Core.Search.SuggestFuzziness Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFuzziness = default; - LocalJsonValue propMinLength = default; - LocalJsonValue propPrefixLength = default; - LocalJsonValue propTranspositions = default; - LocalJsonValue propUnicodeAware = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFuzziness.TryReadProperty(ref reader, options, PropFuzziness, null)) - { - continue; - } - - if (propMinLength.TryReadProperty(ref reader, options, PropMinLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPrefixLength.TryReadProperty(ref reader, options, PropPrefixLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTranspositions.TryReadProperty(ref reader, options, PropTranspositions, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propUnicodeAware.TryReadProperty(ref reader, options, PropUnicodeAware, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.SuggestFuzziness(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Fuzziness = propFuzziness.Value, - MinLength = propMinLength.Value, - PrefixLength = propPrefixLength.Value, - Transpositions = propTranspositions.Value, - UnicodeAware = propUnicodeAware.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.SuggestFuzziness value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFuzziness, value.Fuzziness, null, null); - writer.WriteProperty(options, PropMinLength, value.MinLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPrefixLength, value.PrefixLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTranspositions, value.Transpositions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropUnicodeAware, value.UnicodeAware, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.SuggestFuzzinessConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.SuggestFuzzinessConverter))] public sealed partial class SuggestFuzziness { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SuggestSort.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SuggestSort.Converters.g.cs new file mode 100644 index 00000000000..60c986d1645 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SuggestSort.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class SuggestSortConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberFrequency = System.Text.Json.JsonEncodedText.Encode("frequency"); + private static readonly System.Text.Json.JsonEncodedText MemberScore = System.Text.Json.JsonEncodedText.Encode("score"); + + public override Elastic.Clients.Elasticsearch.Core.Search.SuggestSort Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberFrequency)) + { + return Elastic.Clients.Elasticsearch.Core.Search.SuggestSort.Frequency; + } + + if (reader.ValueTextEquals(MemberScore)) + { + return Elastic.Clients.Elasticsearch.Core.Search.SuggestSort.Score; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberFrequency.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Search.SuggestSort.Frequency; + } + + if (string.Equals(value, MemberScore.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Search.SuggestSort.Score; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.SuggestSort)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.SuggestSort value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Core.Search.SuggestSort.Frequency: + writer.WriteStringValue(MemberFrequency); + break; + case Elastic.Clients.Elasticsearch.Core.Search.SuggestSort.Score: + writer.WriteStringValue(MemberScore); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.SuggestSort)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Core.Search.SuggestSort ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.SuggestSort value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SuggestSort.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SuggestSort.g.cs new file mode 100644 index 00000000000..2b1aa799ea9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/SuggestSort.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.SuggestSortConverter))] +public enum SuggestSort +{ + /// + /// + /// Sort by document frequency first, then similarity score and then the term itself. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "frequency")] + Frequency, + /// + /// + /// Sort by score first, then document frequency and then the term itself. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "score")] + Score +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Suggester.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Suggester.Converters.g.cs new file mode 100644 index 00000000000..0d241ae0475 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Suggester.Converters.g.cs @@ -0,0 +1,69 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class SuggesterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); + + public override Elastic.Clients.Elasticsearch.Core.Search.Suggester Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propSuggesters = default; + LocalJsonValue propText = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propText.TryReadProperty(ref reader, options, PropText, null)) + { + continue; + } + + propSuggesters ??= new System.Collections.Generic.Dictionary(); + reader.ReadProperty(options, out string key, out Elastic.Clients.Elasticsearch.Core.Search.FieldSuggester value, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!, null); + propSuggesters[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.Suggester(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Suggesters = propSuggesters, + Text = propText.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.Suggester value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropText, value.Text, null, null); + if (value.Suggesters is not null) + { + foreach (var item in value.Suggesters) + { + writer.WriteProperty(options, item.Key, item.Value, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), null); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Suggester.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Suggester.g.cs index 9b1e0947aca..e07c70c8e78 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Suggester.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/Suggester.g.cs @@ -23,52 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class SuggesterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); - - public override Elastic.Clients.Elasticsearch.Core.Search.Suggester Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propSuggesters = default; - LocalJsonValue propText = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propText.TryReadProperty(ref reader, options, PropText, null)) - { - continue; - } - - propSuggesters ??= new System.Collections.Generic.Dictionary(); - reader.ReadProperty(options, out string key, out Elastic.Clients.Elasticsearch.Core.Search.FieldSuggester value, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!, null); - propSuggesters[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.Suggester(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Suggesters = propSuggesters, - Text = propText.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.Suggester value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropText, value.Text, null, null); - if (value.Suggesters is not null) - { - foreach (var item in value.Suggesters) - { - writer.WriteProperty(options, item.Key, item.Value, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), null); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.SuggesterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.SuggesterConverter))] public sealed partial class Suggester { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggest.Converters.g.cs new file mode 100644 index 00000000000..ec21fad6019 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggest.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class TermSuggestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLength = System.Text.Json.JsonEncodedText.Encode("length"); + private static readonly System.Text.Json.JsonEncodedText PropOffset = System.Text.Json.JsonEncodedText.Encode("offset"); + private static readonly System.Text.Json.JsonEncodedText PropOptions = System.Text.Json.JsonEncodedText.Encode("options"); + private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); + + public override Elastic.Clients.Elasticsearch.Core.Search.TermSuggest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLength = default; + LocalJsonValue propOffset = default; + LocalJsonValue> propOptions = default; + LocalJsonValue propText = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLength.TryReadProperty(ref reader, options, PropLength, null)) + { + continue; + } + + if (propOffset.TryReadProperty(ref reader, options, PropOffset, null)) + { + continue; + } + + if (propOptions.TryReadProperty(ref reader, options, PropOptions, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propText.TryReadProperty(ref reader, options, PropText, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.TermSuggest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Length = propLength.Value, + Offset = propOffset.Value, + Options = propOptions.Value, + Text = propText.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.TermSuggest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLength, value.Length, null, null); + writer.WriteProperty(options, PropOffset, value.Offset, null, null); + writer.WriteProperty(options, PropOptions, value.Options, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropText, value.Text, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggest.g.cs index d530dc416dc..edd0f74169c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggest.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class TermSuggestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLength = System.Text.Json.JsonEncodedText.Encode("length"); - private static readonly System.Text.Json.JsonEncodedText PropOffset = System.Text.Json.JsonEncodedText.Encode("offset"); - private static readonly System.Text.Json.JsonEncodedText PropOptions = System.Text.Json.JsonEncodedText.Encode("options"); - private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); - - public override Elastic.Clients.Elasticsearch.Core.Search.TermSuggest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLength = default; - LocalJsonValue propOffset = default; - LocalJsonValue> propOptions = default; - LocalJsonValue propText = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLength.TryReadProperty(ref reader, options, PropLength, null)) - { - continue; - } - - if (propOffset.TryReadProperty(ref reader, options, PropOffset, null)) - { - continue; - } - - if (propOptions.TryReadProperty(ref reader, options, PropOptions, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (propText.TryReadProperty(ref reader, options, PropText, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.TermSuggest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Length = propLength.Value, - Offset = propOffset.Value, - Options = propOptions.Value, - Text = propText.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.TermSuggest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLength, value.Length, null, null); - writer.WriteProperty(options, PropOffset, value.Offset, null, null); - writer.WriteProperty(options, PropOptions, value.Options, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropText, value.Text, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.TermSuggestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.TermSuggestConverter))] public sealed partial class TermSuggest : Elastic.Clients.Elasticsearch.Core.Search.ISuggest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggestOption.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggestOption.Converters.g.cs new file mode 100644 index 00000000000..fb9b542709b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggestOption.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class TermSuggestOptionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCollateMatch = System.Text.Json.JsonEncodedText.Encode("collate_match"); + private static readonly System.Text.Json.JsonEncodedText PropFreq = System.Text.Json.JsonEncodedText.Encode("freq"); + private static readonly System.Text.Json.JsonEncodedText PropHighlighted = System.Text.Json.JsonEncodedText.Encode("highlighted"); + private static readonly System.Text.Json.JsonEncodedText PropScore = System.Text.Json.JsonEncodedText.Encode("score"); + private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); + + public override Elastic.Clients.Elasticsearch.Core.Search.TermSuggestOption Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCollateMatch = default; + LocalJsonValue propFreq = default; + LocalJsonValue propHighlighted = default; + LocalJsonValue propScore = default; + LocalJsonValue propText = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCollateMatch.TryReadProperty(ref reader, options, PropCollateMatch, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFreq.TryReadProperty(ref reader, options, PropFreq, null)) + { + continue; + } + + if (propHighlighted.TryReadProperty(ref reader, options, PropHighlighted, null)) + { + continue; + } + + if (propScore.TryReadProperty(ref reader, options, PropScore, null)) + { + continue; + } + + if (propText.TryReadProperty(ref reader, options, PropText, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.TermSuggestOption(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CollateMatch = propCollateMatch.Value, + Freq = propFreq.Value, + Highlighted = propHighlighted.Value, + Score = propScore.Value, + Text = propText.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.TermSuggestOption value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCollateMatch, value.CollateMatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFreq, value.Freq, null, null); + writer.WriteProperty(options, PropHighlighted, value.Highlighted, null, null); + writer.WriteProperty(options, PropScore, value.Score, null, null); + writer.WriteProperty(options, PropText, value.Text, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggestOption.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggestOption.g.cs index 50d5bf7c1e5..570c2593f8a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggestOption.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggestOption.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class TermSuggestOptionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCollateMatch = System.Text.Json.JsonEncodedText.Encode("collate_match"); - private static readonly System.Text.Json.JsonEncodedText PropFreq = System.Text.Json.JsonEncodedText.Encode("freq"); - private static readonly System.Text.Json.JsonEncodedText PropHighlighted = System.Text.Json.JsonEncodedText.Encode("highlighted"); - private static readonly System.Text.Json.JsonEncodedText PropScore = System.Text.Json.JsonEncodedText.Encode("score"); - private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); - - public override Elastic.Clients.Elasticsearch.Core.Search.TermSuggestOption Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCollateMatch = default; - LocalJsonValue propFreq = default; - LocalJsonValue propHighlighted = default; - LocalJsonValue propScore = default; - LocalJsonValue propText = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCollateMatch.TryReadProperty(ref reader, options, PropCollateMatch, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFreq.TryReadProperty(ref reader, options, PropFreq, null)) - { - continue; - } - - if (propHighlighted.TryReadProperty(ref reader, options, PropHighlighted, null)) - { - continue; - } - - if (propScore.TryReadProperty(ref reader, options, PropScore, null)) - { - continue; - } - - if (propText.TryReadProperty(ref reader, options, PropText, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.TermSuggestOption(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CollateMatch = propCollateMatch.Value, - Freq = propFreq.Value, - Highlighted = propHighlighted.Value, - Score = propScore.Value, - Text = propText.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.TermSuggestOption value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCollateMatch, value.CollateMatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFreq, value.Freq, null, null); - writer.WriteProperty(options, PropHighlighted, value.Highlighted, null, null); - writer.WriteProperty(options, PropScore, value.Score, null, null); - writer.WriteProperty(options, PropText, value.Text, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.TermSuggestOptionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.TermSuggestOptionConverter))] public sealed partial class TermSuggestOption { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggester.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggester.Converters.g.cs new file mode 100644 index 00000000000..857c505b798 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggester.Converters.g.cs @@ -0,0 +1,189 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class TermSuggesterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropLowercaseTerms = System.Text.Json.JsonEncodedText.Encode("lowercase_terms"); + private static readonly System.Text.Json.JsonEncodedText PropMaxEdits = System.Text.Json.JsonEncodedText.Encode("max_edits"); + private static readonly System.Text.Json.JsonEncodedText PropMaxInspections = System.Text.Json.JsonEncodedText.Encode("max_inspections"); + private static readonly System.Text.Json.JsonEncodedText PropMaxTermFreq = System.Text.Json.JsonEncodedText.Encode("max_term_freq"); + private static readonly System.Text.Json.JsonEncodedText PropMinDocFreq = System.Text.Json.JsonEncodedText.Encode("min_doc_freq"); + private static readonly System.Text.Json.JsonEncodedText PropMinWordLength = System.Text.Json.JsonEncodedText.Encode("min_word_length"); + private static readonly System.Text.Json.JsonEncodedText PropPrefixLength = System.Text.Json.JsonEncodedText.Encode("prefix_length"); + private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); + private static readonly System.Text.Json.JsonEncodedText PropStringDistance = System.Text.Json.JsonEncodedText.Encode("string_distance"); + private static readonly System.Text.Json.JsonEncodedText PropSuggestMode = System.Text.Json.JsonEncodedText.Encode("suggest_mode"); + private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); + + public override Elastic.Clients.Elasticsearch.Core.Search.TermSuggester Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzer = default; + LocalJsonValue propField = default; + LocalJsonValue propLowercaseTerms = default; + LocalJsonValue propMaxEdits = default; + LocalJsonValue propMaxInspections = default; + LocalJsonValue propMaxTermFreq = default; + LocalJsonValue propMinDocFreq = default; + LocalJsonValue propMinWordLength = default; + LocalJsonValue propPrefixLength = default; + LocalJsonValue propShardSize = default; + LocalJsonValue propSize = default; + LocalJsonValue propSort = default; + LocalJsonValue propStringDistance = default; + LocalJsonValue propSuggestMode = default; + LocalJsonValue propText = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propLowercaseTerms.TryReadProperty(ref reader, options, PropLowercaseTerms, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxEdits.TryReadProperty(ref reader, options, PropMaxEdits, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxInspections.TryReadProperty(ref reader, options, PropMaxInspections, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxTermFreq.TryReadProperty(ref reader, options, PropMaxTermFreq, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinDocFreq.TryReadProperty(ref reader, options, PropMinDocFreq, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinWordLength.TryReadProperty(ref reader, options, PropMinWordLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPrefixLength.TryReadProperty(ref reader, options, PropPrefixLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propShardSize.TryReadProperty(ref reader, options, PropShardSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, static Elastic.Clients.Elasticsearch.Core.Search.SuggestSort? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propStringDistance.TryReadProperty(ref reader, options, PropStringDistance, static Elastic.Clients.Elasticsearch.Core.Search.StringDistance? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSuggestMode.TryReadProperty(ref reader, options, PropSuggestMode, static Elastic.Clients.Elasticsearch.SuggestMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propText.TryReadProperty(ref reader, options, PropText, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.TermSuggester(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analyzer = propAnalyzer.Value, + Field = propField.Value, + LowercaseTerms = propLowercaseTerms.Value, + MaxEdits = propMaxEdits.Value, + MaxInspections = propMaxInspections.Value, + MaxTermFreq = propMaxTermFreq.Value, + MinDocFreq = propMinDocFreq.Value, + MinWordLength = propMinWordLength.Value, + PrefixLength = propPrefixLength.Value, + ShardSize = propShardSize.Value, + Size = propSize.Value, + Sort = propSort.Value, + StringDistance = propStringDistance.Value, + SuggestMode = propSuggestMode.Value, + Text = propText.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.TermSuggester value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropLowercaseTerms, value.LowercaseTerms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxEdits, value.MaxEdits, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxInspections, value.MaxInspections, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxTermFreq, value.MaxTermFreq, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinDocFreq, value.MinDocFreq, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinWordLength, value.MinWordLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPrefixLength, value.PrefixLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.SuggestSort? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropStringDistance, value.StringDistance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.StringDistance? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSuggestMode, value.SuggestMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SuggestMode? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropText, value.Text, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggester.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggester.g.cs index 28a9ea1e572..2e173807c45 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggester.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggester.g.cs @@ -23,172 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class TermSuggesterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropLowercaseTerms = System.Text.Json.JsonEncodedText.Encode("lowercase_terms"); - private static readonly System.Text.Json.JsonEncodedText PropMaxEdits = System.Text.Json.JsonEncodedText.Encode("max_edits"); - private static readonly System.Text.Json.JsonEncodedText PropMaxInspections = System.Text.Json.JsonEncodedText.Encode("max_inspections"); - private static readonly System.Text.Json.JsonEncodedText PropMaxTermFreq = System.Text.Json.JsonEncodedText.Encode("max_term_freq"); - private static readonly System.Text.Json.JsonEncodedText PropMinDocFreq = System.Text.Json.JsonEncodedText.Encode("min_doc_freq"); - private static readonly System.Text.Json.JsonEncodedText PropMinWordLength = System.Text.Json.JsonEncodedText.Encode("min_word_length"); - private static readonly System.Text.Json.JsonEncodedText PropPrefixLength = System.Text.Json.JsonEncodedText.Encode("prefix_length"); - private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); - private static readonly System.Text.Json.JsonEncodedText PropStringDistance = System.Text.Json.JsonEncodedText.Encode("string_distance"); - private static readonly System.Text.Json.JsonEncodedText PropSuggestMode = System.Text.Json.JsonEncodedText.Encode("suggest_mode"); - private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); - - public override Elastic.Clients.Elasticsearch.Core.Search.TermSuggester Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyzer = default; - LocalJsonValue propField = default; - LocalJsonValue propLowercaseTerms = default; - LocalJsonValue propMaxEdits = default; - LocalJsonValue propMaxInspections = default; - LocalJsonValue propMaxTermFreq = default; - LocalJsonValue propMinDocFreq = default; - LocalJsonValue propMinWordLength = default; - LocalJsonValue propPrefixLength = default; - LocalJsonValue propShardSize = default; - LocalJsonValue propSize = default; - LocalJsonValue propSort = default; - LocalJsonValue propStringDistance = default; - LocalJsonValue propSuggestMode = default; - LocalJsonValue propText = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propLowercaseTerms.TryReadProperty(ref reader, options, PropLowercaseTerms, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxEdits.TryReadProperty(ref reader, options, PropMaxEdits, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxInspections.TryReadProperty(ref reader, options, PropMaxInspections, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxTermFreq.TryReadProperty(ref reader, options, PropMaxTermFreq, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinDocFreq.TryReadProperty(ref reader, options, PropMinDocFreq, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinWordLength.TryReadProperty(ref reader, options, PropMinWordLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPrefixLength.TryReadProperty(ref reader, options, PropPrefixLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propShardSize.TryReadProperty(ref reader, options, PropShardSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSort.TryReadProperty(ref reader, options, PropSort, static Elastic.Clients.Elasticsearch.Core.Search.SuggestSort? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propStringDistance.TryReadProperty(ref reader, options, PropStringDistance, static Elastic.Clients.Elasticsearch.Core.Search.StringDistance? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSuggestMode.TryReadProperty(ref reader, options, PropSuggestMode, static Elastic.Clients.Elasticsearch.SuggestMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propText.TryReadProperty(ref reader, options, PropText, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.TermSuggester(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analyzer = propAnalyzer.Value, - Field = propField.Value, - LowercaseTerms = propLowercaseTerms.Value, - MaxEdits = propMaxEdits.Value, - MaxInspections = propMaxInspections.Value, - MaxTermFreq = propMaxTermFreq.Value, - MinDocFreq = propMinDocFreq.Value, - MinWordLength = propMinWordLength.Value, - PrefixLength = propPrefixLength.Value, - ShardSize = propShardSize.Value, - Size = propSize.Value, - Sort = propSort.Value, - StringDistance = propStringDistance.Value, - SuggestMode = propSuggestMode.Value, - Text = propText.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.TermSuggester value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropLowercaseTerms, value.LowercaseTerms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxEdits, value.MaxEdits, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxInspections, value.MaxInspections, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxTermFreq, value.MaxTermFreq, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinDocFreq, value.MinDocFreq, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinWordLength, value.MinWordLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPrefixLength, value.PrefixLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.SuggestSort? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropStringDistance, value.StringDistance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.StringDistance? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSuggestMode, value.SuggestMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SuggestMode? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropText, value.Text, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.TermSuggesterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.TermSuggesterConverter))] public sealed partial class TermSuggester { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TotalHits.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TotalHits.Converters.g.cs new file mode 100644 index 00000000000..e2ba90f6fa1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TotalHits.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class TotalHitsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRelation = System.Text.Json.JsonEncodedText.Encode("relation"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + + public override Elastic.Clients.Elasticsearch.Core.Search.TotalHits Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propRelation = default; + LocalJsonValue propValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRelation.TryReadProperty(ref reader, options, PropRelation, null)) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.Search.TotalHits(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Relation = propRelation.Value, + Value = propValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.TotalHits value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRelation, value.Relation, null, null); + writer.WriteProperty(options, PropValue, value.Value, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TotalHits.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TotalHits.g.cs index 557ed577e81..4c53d35dea1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TotalHits.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TotalHits.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class TotalHitsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRelation = System.Text.Json.JsonEncodedText.Encode("relation"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - - public override Elastic.Clients.Elasticsearch.Core.Search.TotalHits Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propRelation = default; - LocalJsonValue propValue = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRelation.TryReadProperty(ref reader, options, PropRelation, null)) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.Search.TotalHits(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Relation = propRelation.Value, - Value = propValue.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.TotalHits value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRelation, value.Relation, null, null); - writer.WriteProperty(options, PropValue, value.Value, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.TotalHitsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.TotalHitsConverter))] public sealed partial class TotalHits { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TotalHitsRelation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TotalHitsRelation.Converters.g.cs new file mode 100644 index 00000000000..62143844c4d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TotalHitsRelation.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class TotalHitsRelationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberEq = System.Text.Json.JsonEncodedText.Encode("eq"); + private static readonly System.Text.Json.JsonEncodedText MemberGte = System.Text.Json.JsonEncodedText.Encode("gte"); + + public override Elastic.Clients.Elasticsearch.Core.Search.TotalHitsRelation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberEq)) + { + return Elastic.Clients.Elasticsearch.Core.Search.TotalHitsRelation.Eq; + } + + if (reader.ValueTextEquals(MemberGte)) + { + return Elastic.Clients.Elasticsearch.Core.Search.TotalHitsRelation.Gte; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberEq.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Search.TotalHitsRelation.Eq; + } + + if (string.Equals(value, MemberGte.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.Search.TotalHitsRelation.Gte; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.TotalHitsRelation)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.TotalHitsRelation value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Core.Search.TotalHitsRelation.Eq: + writer.WriteStringValue(MemberEq); + break; + case Elastic.Clients.Elasticsearch.Core.Search.TotalHitsRelation.Gte: + writer.WriteStringValue(MemberGte); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.TotalHitsRelation)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Core.Search.TotalHitsRelation ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.TotalHitsRelation value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TotalHitsRelation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TotalHitsRelation.g.cs new file mode 100644 index 00000000000..ae0505d57a2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TotalHitsRelation.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.TotalHitsRelationConverter))] +public enum TotalHitsRelation +{ + /// + /// + /// Accurate + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "eq")] + Eq, + /// + /// + /// Lower bound, including returned events or sequences + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "gte")] + Gte +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchMvt/GridAggregationType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchMvt/GridAggregationType.Converters.g.cs new file mode 100644 index 00000000000..f995237d328 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchMvt/GridAggregationType.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.SearchMvt.Json; + +public sealed partial class GridAggregationTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberGeohex = System.Text.Json.JsonEncodedText.Encode("geohex"); + private static readonly System.Text.Json.JsonEncodedText MemberGeotile = System.Text.Json.JsonEncodedText.Encode("geotile"); + + public override Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberGeohex)) + { + return Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType.Geohex; + } + + if (reader.ValueTextEquals(MemberGeotile)) + { + return Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType.Geotile; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberGeohex.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType.Geohex; + } + + if (string.Equals(value, MemberGeotile.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType.Geotile; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType.Geohex: + writer.WriteStringValue(MemberGeohex); + break; + case Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType.Geotile: + writer.WriteStringValue(MemberGeotile); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchMvt/GridAggregationType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchMvt/GridAggregationType.g.cs new file mode 100644 index 00000000000..f7e8629eb98 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchMvt/GridAggregationType.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.SearchMvt; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.SearchMvt.Json.GridAggregationTypeConverter))] +public enum GridAggregationType +{ + [System.Runtime.Serialization.EnumMember(Value = "geohex")] + Geohex, + [System.Runtime.Serialization.EnumMember(Value = "geotile")] + Geotile +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.SearchMvt.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchMvt/GridType.Converters.g.cs similarity index 54% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.SearchMvt.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchMvt/GridType.Converters.g.cs index 472aba20fec..cf85bf6f2c6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.SearchMvt.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchMvt/GridType.Converters.g.cs @@ -21,66 +21,9 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.Core.SearchMvt; +namespace Elastic.Clients.Elasticsearch.Core.SearchMvt.Json; -internal sealed partial class GridAggregationTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberGeohex = System.Text.Json.JsonEncodedText.Encode("geohex"); - private static readonly System.Text.Json.JsonEncodedText MemberGeotile = System.Text.Json.JsonEncodedText.Encode("geotile"); - - public override Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberGeohex)) - { - return Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType.Geohex; - } - - if (reader.ValueTextEquals(MemberGeotile)) - { - return Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType.Geotile; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberGeohex.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType.Geohex; - } - - if (string.Equals(value, MemberGeotile.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType.Geotile; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType.Geohex: - writer.WriteStringValue(MemberGeohex); - break; - case Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType.Geotile: - writer.WriteStringValue(MemberGeotile); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class GridTypeConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class GridTypeConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText MemberCentroid = System.Text.Json.JsonEncodedText.Encode("centroid"); private static readonly System.Text.Json.JsonEncodedText MemberGrid = System.Text.Json.JsonEncodedText.Encode("grid"); @@ -149,24 +92,4 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, { Write(writer, value, options); } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.SearchMvt.GridAggregationTypeConverter))] -public enum GridAggregationType -{ - [System.Runtime.Serialization.EnumMember(Value = "geohex")] - Geohex, - [System.Runtime.Serialization.EnumMember(Value = "geotile")] - Geotile -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.SearchMvt.GridTypeConverter))] -public enum GridType -{ - [System.Runtime.Serialization.EnumMember(Value = "centroid")] - Centroid, - [System.Runtime.Serialization.EnumMember(Value = "grid")] - Grid, - [System.Runtime.Serialization.EnumMember(Value = "point")] - Point } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchMvt/GridType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchMvt/GridType.g.cs new file mode 100644 index 00000000000..16fc20879bc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchMvt/GridType.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.SearchMvt; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.SearchMvt.Json.GridTypeConverter))] +public enum GridType +{ + [System.Runtime.Serialization.EnumMember(Value = "centroid")] + Centroid, + [System.Runtime.Serialization.EnumMember(Value = "grid")] + Grid, + [System.Runtime.Serialization.EnumMember(Value = "point")] + Point +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchShards/SearchShardsNodeAttributes.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchShards/SearchShardsNodeAttributes.Converters.g.cs new file mode 100644 index 00000000000..040bc982f68 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchShards/SearchShardsNodeAttributes.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.SearchShards.Json; + +public sealed partial class SearchShardsNodeAttributesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); + private static readonly System.Text.Json.JsonEncodedText PropEphemeralId = System.Text.Json.JsonEncodedText.Encode("ephemeral_id"); + private static readonly System.Text.Json.JsonEncodedText PropExternalId = System.Text.Json.JsonEncodedText.Encode("external_id"); + private static readonly System.Text.Json.JsonEncodedText PropMaxIndexVersion = System.Text.Json.JsonEncodedText.Encode("max_index_version"); + private static readonly System.Text.Json.JsonEncodedText PropMinIndexVersion = System.Text.Json.JsonEncodedText.Encode("min_index_version"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Core.SearchShards.SearchShardsNodeAttributes Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propAttributes = default; + LocalJsonValue propEphemeralId = default; + LocalJsonValue propExternalId = default; + LocalJsonValue propMaxIndexVersion = default; + LocalJsonValue propMinIndexVersion = default; + LocalJsonValue propName = default; + LocalJsonValue> propRoles = default; + LocalJsonValue propTransportAddress = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propEphemeralId.TryReadProperty(ref reader, options, PropEphemeralId, null)) + { + continue; + } + + if (propExternalId.TryReadProperty(ref reader, options, PropExternalId, null)) + { + continue; + } + + if (propMaxIndexVersion.TryReadProperty(ref reader, options, PropMaxIndexVersion, null)) + { + continue; + } + + if (propMinIndexVersion.TryReadProperty(ref reader, options, PropMinIndexVersion, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.SearchShards.SearchShardsNodeAttributes(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Attributes = propAttributes.Value, + EphemeralId = propEphemeralId.Value, + ExternalId = propExternalId.Value, + MaxIndexVersion = propMaxIndexVersion.Value, + MinIndexVersion = propMinIndexVersion.Value, + Name = propName.Value, + Roles = propRoles.Value, + TransportAddress = propTransportAddress.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.SearchShards.SearchShardsNodeAttributes value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropEphemeralId, value.EphemeralId, null, null); + writer.WriteProperty(options, PropExternalId, value.ExternalId, null, null); + writer.WriteProperty(options, PropMaxIndexVersion, value.MaxIndexVersion, null, null); + writer.WriteProperty(options, PropMinIndexVersion, value.MinIndexVersion, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchShards/SearchShardsNodeAttributes.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchShards/SearchShardsNodeAttributes.g.cs index b40593ff04b..5376ada340d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchShards/SearchShardsNodeAttributes.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchShards/SearchShardsNodeAttributes.g.cs @@ -23,118 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.SearchShards; -internal sealed partial class SearchShardsNodeAttributesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); - private static readonly System.Text.Json.JsonEncodedText PropEphemeralId = System.Text.Json.JsonEncodedText.Encode("ephemeral_id"); - private static readonly System.Text.Json.JsonEncodedText PropExternalId = System.Text.Json.JsonEncodedText.Encode("external_id"); - private static readonly System.Text.Json.JsonEncodedText PropMaxIndexVersion = System.Text.Json.JsonEncodedText.Encode("max_index_version"); - private static readonly System.Text.Json.JsonEncodedText PropMinIndexVersion = System.Text.Json.JsonEncodedText.Encode("min_index_version"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); - private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Core.SearchShards.SearchShardsNodeAttributes Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propAttributes = default; - LocalJsonValue propEphemeralId = default; - LocalJsonValue propExternalId = default; - LocalJsonValue propMaxIndexVersion = default; - LocalJsonValue propMinIndexVersion = default; - LocalJsonValue propName = default; - LocalJsonValue> propRoles = default; - LocalJsonValue propTransportAddress = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propEphemeralId.TryReadProperty(ref reader, options, PropEphemeralId, null)) - { - continue; - } - - if (propExternalId.TryReadProperty(ref reader, options, PropExternalId, null)) - { - continue; - } - - if (propMaxIndexVersion.TryReadProperty(ref reader, options, PropMaxIndexVersion, null)) - { - continue; - } - - if (propMinIndexVersion.TryReadProperty(ref reader, options, PropMinIndexVersion, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.SearchShards.SearchShardsNodeAttributes(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Attributes = propAttributes.Value, - EphemeralId = propEphemeralId.Value, - ExternalId = propExternalId.Value, - MaxIndexVersion = propMaxIndexVersion.Value, - MinIndexVersion = propMinIndexVersion.Value, - Name = propName.Value, - Roles = propRoles.Value, - TransportAddress = propTransportAddress.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.SearchShards.SearchShardsNodeAttributes value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropEphemeralId, value.EphemeralId, null, null); - writer.WriteProperty(options, PropExternalId, value.ExternalId, null, null); - writer.WriteProperty(options, PropMaxIndexVersion, value.MaxIndexVersion, null, null); - writer.WriteProperty(options, PropMinIndexVersion, value.MinIndexVersion, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.SearchShards.SearchShardsNodeAttributesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.SearchShards.Json.SearchShardsNodeAttributesConverter))] public sealed partial class SearchShardsNodeAttributes { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchShards/ShardStoreIndex.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchShards/ShardStoreIndex.Converters.g.cs new file mode 100644 index 00000000000..3ffa7b7abb8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchShards/ShardStoreIndex.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.SearchShards.Json; + +public sealed partial class ShardStoreIndexConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + + public override Elastic.Clients.Elasticsearch.Core.SearchShards.ShardStoreIndex Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAliases = default; + LocalJsonValue propFilter = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.SearchShards.ShardStoreIndex(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aliases = propAliases.Value, + Filter = propFilter.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.SearchShards.ShardStoreIndex value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFilter, value.Filter, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchShards/ShardStoreIndex.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchShards/ShardStoreIndex.g.cs index 45d743f96d4..ecd652ec3e1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchShards/ShardStoreIndex.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SearchShards/ShardStoreIndex.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.SearchShards; -internal sealed partial class ShardStoreIndexConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - - public override Elastic.Clients.Elasticsearch.Core.SearchShards.ShardStoreIndex Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAliases = default; - LocalJsonValue propFilter = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.SearchShards.ShardStoreIndex(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aliases = propAliases.Value, - Filter = propFilter.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.SearchShards.ShardStoreIndex value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFilter, value.Filter, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.SearchShards.ShardStoreIndexConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.SearchShards.Json.ShardStoreIndexConverter))] public sealed partial class ShardStoreIndex { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfig.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfig.Converters.g.cs new file mode 100644 index 00000000000..9cdc6070884 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfig.Converters.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class SourceConfigConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Core.Search.SourceConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray); + return selector(ref reader, options) switch + { + Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Core.Search.SourceConfig(reader.ReadValue(options, null)), + Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Core.Search.SourceConfig(reader.ReadValue(options, null)), + _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Core.Search.SourceConfig)}") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.SourceConfig value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Tag) + { + case Elastic.Clients.Elasticsearch.UnionTag.T1: + { + writer.WriteValue(options, value.Value1, null); + break; + } + + case Elastic.Clients.Elasticsearch.UnionTag.T2: + { + writer.WriteValue(options, value.Value2, null); + break; + } + + default: + throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfig.g.cs index 9a7e553965f..1d4f1eed9fc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfig.g.cs @@ -23,47 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class SourceConfigConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Core.Search.SourceConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray); - return selector(ref reader, options) switch - { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Core.Search.SourceConfig(reader.ReadValue(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Core.Search.SourceConfig(reader.ReadValue(options, null)), - _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Core.Search.SourceConfig)}") - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.SourceConfig value, System.Text.Json.JsonSerializerOptions options) - { - switch (value.Tag) - { - case Elastic.Clients.Elasticsearch.UnionTag.T1: - { - writer.WriteValue(options, value.Value1, null); - break; - } - - case Elastic.Clients.Elasticsearch.UnionTag.T2: - { - writer.WriteValue(options, value.Value2, null); - break; - } - - default: - throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); - } - } -} - /// /// /// Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.SourceConfigConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.SourceConfigConverter))] public sealed partial class SourceConfig : Elastic.Clients.Elasticsearch.Union { public SourceConfig(bool value) : base(value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfigParam.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfigParam.Converters.g.cs new file mode 100644 index 00000000000..1f1cfe82217 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfigParam.Converters.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class SourceConfigParamConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Core.Search.SourceConfigParam Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray); + return selector(ref reader, options) switch + { + Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Core.Search.SourceConfigParam(reader.ReadValue(options, null)), + Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Core.Search.SourceConfigParam(reader.ReadValue(options, static Elastic.Clients.Elasticsearch.Fields (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))), + _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Core.Search.SourceConfigParam)}") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.SourceConfigParam value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Tag) + { + case Elastic.Clients.Elasticsearch.UnionTag.T1: + { + writer.WriteValue(options, value.Value1, null); + break; + } + + case Elastic.Clients.Elasticsearch.UnionTag.T2: + { + writer.WriteValue(options, value.Value2, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + break; + } + + default: + throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfigParam.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfigParam.g.cs index 161221e9091..cccbe1d4d27 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfigParam.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/SourceConfigParam.g.cs @@ -23,48 +23,13 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class SourceConfigParamConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Core.Search.SourceConfigParam Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray); - return selector(ref reader, options) switch - { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Core.Search.SourceConfigParam(reader.ReadValue(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Core.Search.SourceConfigParam(reader.ReadValue(options, static Elastic.Clients.Elasticsearch.Fields (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))), - _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Core.Search.SourceConfigParam)}") - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.SourceConfigParam value, System.Text.Json.JsonSerializerOptions options) - { - switch (value.Tag) - { - case Elastic.Clients.Elasticsearch.UnionTag.T1: - { - writer.WriteValue(options, value.Value1, null); - break; - } - - case Elastic.Clients.Elasticsearch.UnionTag.T2: - { - writer.WriteValue(options, value.Value2, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - break; - } - - default: - throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); - } - } -} - /// /// /// Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered. /// Used as a query parameter along with the _source_includes and _source_excludes parameters. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.SourceConfigParamConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.SourceConfigParamConverter))] public sealed partial class SourceConfigParam : Elastic.Clients.Elasticsearch.Union { public SourceConfigParam(bool value) : base(value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/FieldStatistics.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/FieldStatistics.Converters.g.cs new file mode 100644 index 00000000000..fa16567e435 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/FieldStatistics.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.TermVectors.Json; + +public sealed partial class FieldStatisticsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropSumDocFreq = System.Text.Json.JsonEncodedText.Encode("sum_doc_freq"); + private static readonly System.Text.Json.JsonEncodedText PropSumTtf = System.Text.Json.JsonEncodedText.Encode("sum_ttf"); + + public override Elastic.Clients.Elasticsearch.Core.TermVectors.FieldStatistics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDocCount = default; + LocalJsonValue propSumDocFreq = default; + LocalJsonValue propSumTtf = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propSumDocFreq.TryReadProperty(ref reader, options, PropSumDocFreq, null)) + { + continue; + } + + if (propSumTtf.TryReadProperty(ref reader, options, PropSumTtf, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.TermVectors.FieldStatistics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DocCount = propDocCount.Value, + SumDocFreq = propSumDocFreq.Value, + SumTtf = propSumTtf.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.TermVectors.FieldStatistics value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropSumDocFreq, value.SumDocFreq, null, null); + writer.WriteProperty(options, PropSumTtf, value.SumTtf, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/FieldStatistics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/FieldStatistics.g.cs index d9a90aca9f4..8be24c0247f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/FieldStatistics.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/FieldStatistics.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.TermVectors; -internal sealed partial class FieldStatisticsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropSumDocFreq = System.Text.Json.JsonEncodedText.Encode("sum_doc_freq"); - private static readonly System.Text.Json.JsonEncodedText PropSumTtf = System.Text.Json.JsonEncodedText.Encode("sum_ttf"); - - public override Elastic.Clients.Elasticsearch.Core.TermVectors.FieldStatistics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDocCount = default; - LocalJsonValue propSumDocFreq = default; - LocalJsonValue propSumTtf = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propSumDocFreq.TryReadProperty(ref reader, options, PropSumDocFreq, null)) - { - continue; - } - - if (propSumTtf.TryReadProperty(ref reader, options, PropSumTtf, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.TermVectors.FieldStatistics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DocCount = propDocCount.Value, - SumDocFreq = propSumDocFreq.Value, - SumTtf = propSumTtf.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.TermVectors.FieldStatistics value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropSumDocFreq, value.SumDocFreq, null, null); - writer.WriteProperty(options, PropSumTtf, value.SumTtf, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.TermVectors.FieldStatisticsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.TermVectors.Json.FieldStatisticsConverter))] public sealed partial class FieldStatistics { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/Filter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/Filter.Converters.g.cs new file mode 100644 index 00000000000..a02ea8ccc9a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/Filter.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.TermVectors.Json; + +public sealed partial class FilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxDocFreq = System.Text.Json.JsonEncodedText.Encode("max_doc_freq"); + private static readonly System.Text.Json.JsonEncodedText PropMaxNumTerms = System.Text.Json.JsonEncodedText.Encode("max_num_terms"); + private static readonly System.Text.Json.JsonEncodedText PropMaxTermFreq = System.Text.Json.JsonEncodedText.Encode("max_term_freq"); + private static readonly System.Text.Json.JsonEncodedText PropMaxWordLength = System.Text.Json.JsonEncodedText.Encode("max_word_length"); + private static readonly System.Text.Json.JsonEncodedText PropMinDocFreq = System.Text.Json.JsonEncodedText.Encode("min_doc_freq"); + private static readonly System.Text.Json.JsonEncodedText PropMinTermFreq = System.Text.Json.JsonEncodedText.Encode("min_term_freq"); + private static readonly System.Text.Json.JsonEncodedText PropMinWordLength = System.Text.Json.JsonEncodedText.Encode("min_word_length"); + + public override Elastic.Clients.Elasticsearch.Core.TermVectors.Filter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxDocFreq = default; + LocalJsonValue propMaxNumTerms = default; + LocalJsonValue propMaxTermFreq = default; + LocalJsonValue propMaxWordLength = default; + LocalJsonValue propMinDocFreq = default; + LocalJsonValue propMinTermFreq = default; + LocalJsonValue propMinWordLength = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxDocFreq.TryReadProperty(ref reader, options, PropMaxDocFreq, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxNumTerms.TryReadProperty(ref reader, options, PropMaxNumTerms, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxTermFreq.TryReadProperty(ref reader, options, PropMaxTermFreq, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxWordLength.TryReadProperty(ref reader, options, PropMaxWordLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinDocFreq.TryReadProperty(ref reader, options, PropMinDocFreq, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinTermFreq.TryReadProperty(ref reader, options, PropMinTermFreq, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinWordLength.TryReadProperty(ref reader, options, PropMinWordLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.TermVectors.Filter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxDocFreq = propMaxDocFreq.Value, + MaxNumTerms = propMaxNumTerms.Value, + MaxTermFreq = propMaxTermFreq.Value, + MaxWordLength = propMaxWordLength.Value, + MinDocFreq = propMinDocFreq.Value, + MinTermFreq = propMinTermFreq.Value, + MinWordLength = propMinWordLength.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.TermVectors.Filter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxDocFreq, value.MaxDocFreq, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxNumTerms, value.MaxNumTerms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxTermFreq, value.MaxTermFreq, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxWordLength, value.MaxWordLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinDocFreq, value.MinDocFreq, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinTermFreq, value.MinTermFreq, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinWordLength, value.MinWordLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/Filter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/Filter.g.cs index 21209034a96..e431573e7b6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/Filter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/Filter.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.TermVectors; -internal sealed partial class FilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxDocFreq = System.Text.Json.JsonEncodedText.Encode("max_doc_freq"); - private static readonly System.Text.Json.JsonEncodedText PropMaxNumTerms = System.Text.Json.JsonEncodedText.Encode("max_num_terms"); - private static readonly System.Text.Json.JsonEncodedText PropMaxTermFreq = System.Text.Json.JsonEncodedText.Encode("max_term_freq"); - private static readonly System.Text.Json.JsonEncodedText PropMaxWordLength = System.Text.Json.JsonEncodedText.Encode("max_word_length"); - private static readonly System.Text.Json.JsonEncodedText PropMinDocFreq = System.Text.Json.JsonEncodedText.Encode("min_doc_freq"); - private static readonly System.Text.Json.JsonEncodedText PropMinTermFreq = System.Text.Json.JsonEncodedText.Encode("min_term_freq"); - private static readonly System.Text.Json.JsonEncodedText PropMinWordLength = System.Text.Json.JsonEncodedText.Encode("min_word_length"); - - public override Elastic.Clients.Elasticsearch.Core.TermVectors.Filter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxDocFreq = default; - LocalJsonValue propMaxNumTerms = default; - LocalJsonValue propMaxTermFreq = default; - LocalJsonValue propMaxWordLength = default; - LocalJsonValue propMinDocFreq = default; - LocalJsonValue propMinTermFreq = default; - LocalJsonValue propMinWordLength = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxDocFreq.TryReadProperty(ref reader, options, PropMaxDocFreq, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxNumTerms.TryReadProperty(ref reader, options, PropMaxNumTerms, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxTermFreq.TryReadProperty(ref reader, options, PropMaxTermFreq, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxWordLength.TryReadProperty(ref reader, options, PropMaxWordLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinDocFreq.TryReadProperty(ref reader, options, PropMinDocFreq, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinTermFreq.TryReadProperty(ref reader, options, PropMinTermFreq, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinWordLength.TryReadProperty(ref reader, options, PropMinWordLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.TermVectors.Filter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxDocFreq = propMaxDocFreq.Value, - MaxNumTerms = propMaxNumTerms.Value, - MaxTermFreq = propMaxTermFreq.Value, - MaxWordLength = propMaxWordLength.Value, - MinDocFreq = propMinDocFreq.Value, - MinTermFreq = propMinTermFreq.Value, - MinWordLength = propMinWordLength.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.TermVectors.Filter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxDocFreq, value.MaxDocFreq, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxNumTerms, value.MaxNumTerms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxTermFreq, value.MaxTermFreq, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxWordLength, value.MaxWordLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinDocFreq, value.MinDocFreq, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinTermFreq, value.MinTermFreq, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinWordLength, value.MinWordLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.TermVectors.FilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.TermVectors.Json.FilterConverter))] public sealed partial class Filter { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/Term.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/Term.Converters.g.cs new file mode 100644 index 00000000000..75f3401a6f4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/Term.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.TermVectors.Json; + +public sealed partial class TermConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocFreq = System.Text.Json.JsonEncodedText.Encode("doc_freq"); + private static readonly System.Text.Json.JsonEncodedText PropScore = System.Text.Json.JsonEncodedText.Encode("score"); + private static readonly System.Text.Json.JsonEncodedText PropTermFreq = System.Text.Json.JsonEncodedText.Encode("term_freq"); + private static readonly System.Text.Json.JsonEncodedText PropTokens = System.Text.Json.JsonEncodedText.Encode("tokens"); + private static readonly System.Text.Json.JsonEncodedText PropTtf = System.Text.Json.JsonEncodedText.Encode("ttf"); + + public override Elastic.Clients.Elasticsearch.Core.TermVectors.Term Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDocFreq = default; + LocalJsonValue propScore = default; + LocalJsonValue propTermFreq = default; + LocalJsonValue?> propTokens = default; + LocalJsonValue propTtf = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocFreq.TryReadProperty(ref reader, options, PropDocFreq, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propScore.TryReadProperty(ref reader, options, PropScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTermFreq.TryReadProperty(ref reader, options, PropTermFreq, null)) + { + continue; + } + + if (propTokens.TryReadProperty(ref reader, options, PropTokens, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTtf.TryReadProperty(ref reader, options, PropTtf, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.TermVectors.Term(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DocFreq = propDocFreq.Value, + Score = propScore.Value, + TermFreq = propTermFreq.Value, + Tokens = propTokens.Value, + Ttf = propTtf.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.TermVectors.Term value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocFreq, value.DocFreq, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropScore, value.Score, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTermFreq, value.TermFreq, null, null); + writer.WriteProperty(options, PropTokens, value.Tokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTtf, value.Ttf, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/Term.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/Term.g.cs index 46de34dbc32..1c4cd1f5d21 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/Term.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/Term.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.TermVectors; -internal sealed partial class TermConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocFreq = System.Text.Json.JsonEncodedText.Encode("doc_freq"); - private static readonly System.Text.Json.JsonEncodedText PropScore = System.Text.Json.JsonEncodedText.Encode("score"); - private static readonly System.Text.Json.JsonEncodedText PropTermFreq = System.Text.Json.JsonEncodedText.Encode("term_freq"); - private static readonly System.Text.Json.JsonEncodedText PropTokens = System.Text.Json.JsonEncodedText.Encode("tokens"); - private static readonly System.Text.Json.JsonEncodedText PropTtf = System.Text.Json.JsonEncodedText.Encode("ttf"); - - public override Elastic.Clients.Elasticsearch.Core.TermVectors.Term Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDocFreq = default; - LocalJsonValue propScore = default; - LocalJsonValue propTermFreq = default; - LocalJsonValue?> propTokens = default; - LocalJsonValue propTtf = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocFreq.TryReadProperty(ref reader, options, PropDocFreq, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propScore.TryReadProperty(ref reader, options, PropScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTermFreq.TryReadProperty(ref reader, options, PropTermFreq, null)) - { - continue; - } - - if (propTokens.TryReadProperty(ref reader, options, PropTokens, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTtf.TryReadProperty(ref reader, options, PropTtf, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.TermVectors.Term(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DocFreq = propDocFreq.Value, - Score = propScore.Value, - TermFreq = propTermFreq.Value, - Tokens = propTokens.Value, - Ttf = propTtf.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.TermVectors.Term value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocFreq, value.DocFreq, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropScore, value.Score, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTermFreq, value.TermFreq, null, null); - writer.WriteProperty(options, PropTokens, value.Tokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTtf, value.Ttf, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.TermVectors.TermConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.TermVectors.Json.TermConverter))] public sealed partial class Term { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/TermVector.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/TermVector.Converters.g.cs new file mode 100644 index 00000000000..3fca083ce75 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/TermVector.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.TermVectors.Json; + +public sealed partial class TermVectorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFieldStatistics = System.Text.Json.JsonEncodedText.Encode("field_statistics"); + private static readonly System.Text.Json.JsonEncodedText PropTerms = System.Text.Json.JsonEncodedText.Encode("terms"); + + public override Elastic.Clients.Elasticsearch.Core.TermVectors.TermVector Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFieldStatistics = default; + LocalJsonValue> propTerms = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFieldStatistics.TryReadProperty(ref reader, options, PropFieldStatistics, null)) + { + continue; + } + + if (propTerms.TryReadProperty(ref reader, options, PropTerms, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.TermVectors.TermVector(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FieldStatistics = propFieldStatistics.Value, + Terms = propTerms.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.TermVectors.TermVector value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFieldStatistics, value.FieldStatistics, null, null); + writer.WriteProperty(options, PropTerms, value.Terms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/TermVector.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/TermVector.g.cs index b6df866e38f..ee8f69ccd00 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/TermVector.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/TermVector.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.TermVectors; -internal sealed partial class TermVectorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFieldStatistics = System.Text.Json.JsonEncodedText.Encode("field_statistics"); - private static readonly System.Text.Json.JsonEncodedText PropTerms = System.Text.Json.JsonEncodedText.Encode("terms"); - - public override Elastic.Clients.Elasticsearch.Core.TermVectors.TermVector Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFieldStatistics = default; - LocalJsonValue> propTerms = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFieldStatistics.TryReadProperty(ref reader, options, PropFieldStatistics, null)) - { - continue; - } - - if (propTerms.TryReadProperty(ref reader, options, PropTerms, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.TermVectors.TermVector(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FieldStatistics = propFieldStatistics.Value, - Terms = propTerms.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.TermVectors.TermVector value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFieldStatistics, value.FieldStatistics, null, null); - writer.WriteProperty(options, PropTerms, value.Terms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.TermVectors.TermVectorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.TermVectors.Json.TermVectorConverter))] public sealed partial class TermVector { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/Token.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/Token.Converters.g.cs new file mode 100644 index 00000000000..96d68792696 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/Token.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.TermVectors.Json; + +public sealed partial class TokenConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEndOffset = System.Text.Json.JsonEncodedText.Encode("end_offset"); + private static readonly System.Text.Json.JsonEncodedText PropPayload = System.Text.Json.JsonEncodedText.Encode("payload"); + private static readonly System.Text.Json.JsonEncodedText PropPosition = System.Text.Json.JsonEncodedText.Encode("position"); + private static readonly System.Text.Json.JsonEncodedText PropStartOffset = System.Text.Json.JsonEncodedText.Encode("start_offset"); + + public override Elastic.Clients.Elasticsearch.Core.TermVectors.Token Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEndOffset = default; + LocalJsonValue propPayload = default; + LocalJsonValue propPosition = default; + LocalJsonValue propStartOffset = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEndOffset.TryReadProperty(ref reader, options, PropEndOffset, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPayload.TryReadProperty(ref reader, options, PropPayload, null)) + { + continue; + } + + if (propPosition.TryReadProperty(ref reader, options, PropPosition, null)) + { + continue; + } + + if (propStartOffset.TryReadProperty(ref reader, options, PropStartOffset, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.TermVectors.Token(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + EndOffset = propEndOffset.Value, + Payload = propPayload.Value, + Position = propPosition.Value, + StartOffset = propStartOffset.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.TermVectors.Token value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEndOffset, value.EndOffset, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPayload, value.Payload, null, null); + writer.WriteProperty(options, PropPosition, value.Position, null, null); + writer.WriteProperty(options, PropStartOffset, value.StartOffset, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/Token.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/Token.g.cs index a66f833eb4a..92de9c46a41 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/Token.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TermVectors/Token.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.TermVectors; -internal sealed partial class TokenConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEndOffset = System.Text.Json.JsonEncodedText.Encode("end_offset"); - private static readonly System.Text.Json.JsonEncodedText PropPayload = System.Text.Json.JsonEncodedText.Encode("payload"); - private static readonly System.Text.Json.JsonEncodedText PropPosition = System.Text.Json.JsonEncodedText.Encode("position"); - private static readonly System.Text.Json.JsonEncodedText PropStartOffset = System.Text.Json.JsonEncodedText.Encode("start_offset"); - - public override Elastic.Clients.Elasticsearch.Core.TermVectors.Token Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEndOffset = default; - LocalJsonValue propPayload = default; - LocalJsonValue propPosition = default; - LocalJsonValue propStartOffset = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEndOffset.TryReadProperty(ref reader, options, PropEndOffset, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPayload.TryReadProperty(ref reader, options, PropPayload, null)) - { - continue; - } - - if (propPosition.TryReadProperty(ref reader, options, PropPosition, null)) - { - continue; - } - - if (propStartOffset.TryReadProperty(ref reader, options, PropStartOffset, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.TermVectors.Token(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - EndOffset = propEndOffset.Value, - Payload = propPayload.Value, - Position = propPosition.Value, - StartOffset = propStartOffset.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.TermVectors.Token value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEndOffset, value.EndOffset, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPayload, value.Payload, null, null); - writer.WriteProperty(options, PropPosition, value.Position, null, null); - writer.WriteProperty(options, PropStartOffset, value.StartOffset, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.TermVectors.TokenConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.TermVectors.Json.TokenConverter))] public sealed partial class Token { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TrackHits.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TrackHits.Converters.g.cs new file mode 100644 index 00000000000..b8b52b961a7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TrackHits.Converters.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.Search.Json; + +public sealed partial class TrackHitsConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Core.Search.TrackHits Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number); + return selector(ref reader, options) switch + { + Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Core.Search.TrackHits(reader.ReadValue(options, null)), + Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Core.Search.TrackHits(reader.ReadValue(options, null)), + _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Core.Search.TrackHits)}") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.TrackHits value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Tag) + { + case Elastic.Clients.Elasticsearch.UnionTag.T1: + { + writer.WriteValue(options, value.Value1, null); + break; + } + + case Elastic.Clients.Elasticsearch.UnionTag.T2: + { + writer.WriteValue(options, value.Value2, null); + break; + } + + default: + throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TrackHits.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TrackHits.g.cs index cb07edeac11..48e28725628 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TrackHits.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/TrackHits.g.cs @@ -23,41 +23,6 @@ namespace Elastic.Clients.Elasticsearch.Core.Search; -internal sealed partial class TrackHitsConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Core.Search.TrackHits Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number); - return selector(ref reader, options) switch - { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Core.Search.TrackHits(reader.ReadValue(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Core.Search.TrackHits(reader.ReadValue(options, null)), - _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Core.Search.TrackHits)}") - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.TrackHits value, System.Text.Json.JsonSerializerOptions options) - { - switch (value.Tag) - { - case Elastic.Clients.Elasticsearch.UnionTag.T1: - { - writer.WriteValue(options, value.Value1, null); - break; - } - - case Elastic.Clients.Elasticsearch.UnionTag.T2: - { - writer.WriteValue(options, value.Value2, null); - break; - } - - default: - throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); - } - } -} - /// /// /// Number of hits matching the query to count accurately. If true, the exact @@ -66,7 +31,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Defaults to 10,000 hits. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.TrackHitsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Json.TrackHitsConverter))] public sealed partial class TrackHits : Elastic.Clients.Elasticsearch.Union { public TrackHits(bool value) : base(value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/UpdateByQueryRethrottle/UpdateByQueryRethrottleNode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/UpdateByQueryRethrottle/UpdateByQueryRethrottleNode.Converters.g.cs new file mode 100644 index 00000000000..1801b0d4b5c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/UpdateByQueryRethrottle/UpdateByQueryRethrottleNode.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Core.UpdateByQueryRethrottle.Json; + +public sealed partial class UpdateByQueryRethrottleNodeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); + private static readonly System.Text.Json.JsonEncodedText PropHost = System.Text.Json.JsonEncodedText.Encode("host"); + private static readonly System.Text.Json.JsonEncodedText PropIp = System.Text.Json.JsonEncodedText.Encode("ip"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + private static readonly System.Text.Json.JsonEncodedText PropTasks = System.Text.Json.JsonEncodedText.Encode("tasks"); + private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); + + public override Elastic.Clients.Elasticsearch.Core.UpdateByQueryRethrottle.UpdateByQueryRethrottleNode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propAttributes = default; + LocalJsonValue propHost = default; + LocalJsonValue propIp = default; + LocalJsonValue propName = default; + LocalJsonValue?> propRoles = default; + LocalJsonValue> propTasks = default; + LocalJsonValue propTransportAddress = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propHost.TryReadProperty(ref reader, options, PropHost, null)) + { + continue; + } + + if (propIp.TryReadProperty(ref reader, options, PropIp, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTasks.TryReadProperty(ref reader, options, PropTasks, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Core.UpdateByQueryRethrottle.UpdateByQueryRethrottleNode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Attributes = propAttributes.Value, + Host = propHost.Value, + Ip = propIp.Value, + Name = propName.Value, + Roles = propRoles.Value, + Tasks = propTasks.Value, + TransportAddress = propTransportAddress.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.UpdateByQueryRethrottle.UpdateByQueryRethrottleNode value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropHost, value.Host, null, null); + writer.WriteProperty(options, PropIp, value.Ip, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTasks, value.Tasks, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/UpdateByQueryRethrottle/UpdateByQueryRethrottleNode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/UpdateByQueryRethrottle/UpdateByQueryRethrottleNode.g.cs index e76c8b82fb0..8b6630f5ab4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/UpdateByQueryRethrottle/UpdateByQueryRethrottleNode.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/UpdateByQueryRethrottle/UpdateByQueryRethrottleNode.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Core.UpdateByQueryRethrottle; -internal sealed partial class UpdateByQueryRethrottleNodeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); - private static readonly System.Text.Json.JsonEncodedText PropHost = System.Text.Json.JsonEncodedText.Encode("host"); - private static readonly System.Text.Json.JsonEncodedText PropIp = System.Text.Json.JsonEncodedText.Encode("ip"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); - private static readonly System.Text.Json.JsonEncodedText PropTasks = System.Text.Json.JsonEncodedText.Encode("tasks"); - private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); - - public override Elastic.Clients.Elasticsearch.Core.UpdateByQueryRethrottle.UpdateByQueryRethrottleNode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propAttributes = default; - LocalJsonValue propHost = default; - LocalJsonValue propIp = default; - LocalJsonValue propName = default; - LocalJsonValue?> propRoles = default; - LocalJsonValue> propTasks = default; - LocalJsonValue propTransportAddress = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propHost.TryReadProperty(ref reader, options, PropHost, null)) - { - continue; - } - - if (propIp.TryReadProperty(ref reader, options, PropIp, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTasks.TryReadProperty(ref reader, options, PropTasks, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Core.UpdateByQueryRethrottle.UpdateByQueryRethrottleNode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Attributes = propAttributes.Value, - Host = propHost.Value, - Ip = propIp.Value, - Name = propName.Value, - Roles = propRoles.Value, - Tasks = propTasks.Value, - TransportAddress = propTransportAddress.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.UpdateByQueryRethrottle.UpdateByQueryRethrottleNode value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropHost, value.Host, null, null); - writer.WriteProperty(options, PropIp, value.Ip, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTasks, value.Tasks, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.UpdateByQueryRethrottle.UpdateByQueryRethrottleNodeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.UpdateByQueryRethrottle.Json.UpdateByQueryRethrottleNodeConverter))] public sealed partial class UpdateByQueryRethrottleNode { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowPattern.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowPattern.Converters.g.cs new file mode 100644 index 00000000000..69f2b7edbcb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowPattern.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class AutoFollowPatternConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropPattern = System.Text.Json.JsonEncodedText.Encode("pattern"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowPattern Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + LocalJsonValue propPattern = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propPattern.TryReadProperty(ref reader, options, PropPattern, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowPattern(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value, + Pattern = propPattern.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowPattern value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropPattern, value.Pattern, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowPattern.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowPattern.g.cs index e5fb017b4d9..2d0249a7fb0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowPattern.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowPattern.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; -internal sealed partial class AutoFollowPatternConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropPattern = System.Text.Json.JsonEncodedText.Encode("pattern"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowPattern Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - LocalJsonValue propPattern = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propPattern.TryReadProperty(ref reader, options, PropPattern, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowPattern(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value, - Pattern = propPattern.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowPattern value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropPattern, value.Pattern, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowPatternConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.AutoFollowPatternConverter))] public sealed partial class AutoFollowPattern { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowPatternSummary.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowPatternSummary.Converters.g.cs new file mode 100644 index 00000000000..b5a257a9326 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowPatternSummary.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class AutoFollowPatternSummaryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropActive = System.Text.Json.JsonEncodedText.Encode("active"); + private static readonly System.Text.Json.JsonEncodedText PropFollowIndexPattern = System.Text.Json.JsonEncodedText.Encode("follow_index_pattern"); + private static readonly System.Text.Json.JsonEncodedText PropLeaderIndexExclusionPatterns = System.Text.Json.JsonEncodedText.Encode("leader_index_exclusion_patterns"); + private static readonly System.Text.Json.JsonEncodedText PropLeaderIndexPatterns = System.Text.Json.JsonEncodedText.Encode("leader_index_patterns"); + private static readonly System.Text.Json.JsonEncodedText PropMaxOutstandingReadRequests = System.Text.Json.JsonEncodedText.Encode("max_outstanding_read_requests"); + private static readonly System.Text.Json.JsonEncodedText PropRemoteCluster = System.Text.Json.JsonEncodedText.Encode("remote_cluster"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowPatternSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propActive = default; + LocalJsonValue propFollowIndexPattern = default; + LocalJsonValue> propLeaderIndexExclusionPatterns = default; + LocalJsonValue> propLeaderIndexPatterns = default; + LocalJsonValue propMaxOutstandingReadRequests = default; + LocalJsonValue propRemoteCluster = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propActive.TryReadProperty(ref reader, options, PropActive, null)) + { + continue; + } + + if (propFollowIndexPattern.TryReadProperty(ref reader, options, PropFollowIndexPattern, null)) + { + continue; + } + + if (propLeaderIndexExclusionPatterns.TryReadProperty(ref reader, options, PropLeaderIndexExclusionPatterns, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propLeaderIndexPatterns.TryReadProperty(ref reader, options, PropLeaderIndexPatterns, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMaxOutstandingReadRequests.TryReadProperty(ref reader, options, PropMaxOutstandingReadRequests, null)) + { + continue; + } + + if (propRemoteCluster.TryReadProperty(ref reader, options, PropRemoteCluster, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowPatternSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Active = propActive.Value, + FollowIndexPattern = propFollowIndexPattern.Value, + LeaderIndexExclusionPatterns = propLeaderIndexExclusionPatterns.Value, + LeaderIndexPatterns = propLeaderIndexPatterns.Value, + MaxOutstandingReadRequests = propMaxOutstandingReadRequests.Value, + RemoteCluster = propRemoteCluster.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowPatternSummary value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropActive, value.Active, null, null); + writer.WriteProperty(options, PropFollowIndexPattern, value.FollowIndexPattern, null, null); + writer.WriteProperty(options, PropLeaderIndexExclusionPatterns, value.LeaderIndexExclusionPatterns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropLeaderIndexPatterns, value.LeaderIndexPatterns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMaxOutstandingReadRequests, value.MaxOutstandingReadRequests, null, null); + writer.WriteProperty(options, PropRemoteCluster, value.RemoteCluster, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowPatternSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowPatternSummary.g.cs index bd6294bd329..ae0fc1e4824 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowPatternSummary.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowPatternSummary.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; -internal sealed partial class AutoFollowPatternSummaryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropActive = System.Text.Json.JsonEncodedText.Encode("active"); - private static readonly System.Text.Json.JsonEncodedText PropFollowIndexPattern = System.Text.Json.JsonEncodedText.Encode("follow_index_pattern"); - private static readonly System.Text.Json.JsonEncodedText PropLeaderIndexExclusionPatterns = System.Text.Json.JsonEncodedText.Encode("leader_index_exclusion_patterns"); - private static readonly System.Text.Json.JsonEncodedText PropLeaderIndexPatterns = System.Text.Json.JsonEncodedText.Encode("leader_index_patterns"); - private static readonly System.Text.Json.JsonEncodedText PropMaxOutstandingReadRequests = System.Text.Json.JsonEncodedText.Encode("max_outstanding_read_requests"); - private static readonly System.Text.Json.JsonEncodedText PropRemoteCluster = System.Text.Json.JsonEncodedText.Encode("remote_cluster"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowPatternSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propActive = default; - LocalJsonValue propFollowIndexPattern = default; - LocalJsonValue> propLeaderIndexExclusionPatterns = default; - LocalJsonValue> propLeaderIndexPatterns = default; - LocalJsonValue propMaxOutstandingReadRequests = default; - LocalJsonValue propRemoteCluster = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propActive.TryReadProperty(ref reader, options, PropActive, null)) - { - continue; - } - - if (propFollowIndexPattern.TryReadProperty(ref reader, options, PropFollowIndexPattern, null)) - { - continue; - } - - if (propLeaderIndexExclusionPatterns.TryReadProperty(ref reader, options, PropLeaderIndexExclusionPatterns, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propLeaderIndexPatterns.TryReadProperty(ref reader, options, PropLeaderIndexPatterns, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMaxOutstandingReadRequests.TryReadProperty(ref reader, options, PropMaxOutstandingReadRequests, null)) - { - continue; - } - - if (propRemoteCluster.TryReadProperty(ref reader, options, PropRemoteCluster, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowPatternSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Active = propActive.Value, - FollowIndexPattern = propFollowIndexPattern.Value, - LeaderIndexExclusionPatterns = propLeaderIndexExclusionPatterns.Value, - LeaderIndexPatterns = propLeaderIndexPatterns.Value, - MaxOutstandingReadRequests = propMaxOutstandingReadRequests.Value, - RemoteCluster = propRemoteCluster.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowPatternSummary value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropActive, value.Active, null, null); - writer.WriteProperty(options, PropFollowIndexPattern, value.FollowIndexPattern, null, null); - writer.WriteProperty(options, PropLeaderIndexExclusionPatterns, value.LeaderIndexExclusionPatterns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropLeaderIndexPatterns, value.LeaderIndexPatterns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMaxOutstandingReadRequests, value.MaxOutstandingReadRequests, null, null); - writer.WriteProperty(options, PropRemoteCluster, value.RemoteCluster, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowPatternSummaryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.AutoFollowPatternSummaryConverter))] public sealed partial class AutoFollowPatternSummary { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowStats.Converters.g.cs new file mode 100644 index 00000000000..5227e01620a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowStats.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class AutoFollowStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAutoFollowedClusters = System.Text.Json.JsonEncodedText.Encode("auto_followed_clusters"); + private static readonly System.Text.Json.JsonEncodedText PropNumberOfFailedFollowIndices = System.Text.Json.JsonEncodedText.Encode("number_of_failed_follow_indices"); + private static readonly System.Text.Json.JsonEncodedText PropNumberOfFailedRemoteClusterStateRequests = System.Text.Json.JsonEncodedText.Encode("number_of_failed_remote_cluster_state_requests"); + private static readonly System.Text.Json.JsonEncodedText PropNumberOfSuccessfulFollowIndices = System.Text.Json.JsonEncodedText.Encode("number_of_successful_follow_indices"); + private static readonly System.Text.Json.JsonEncodedText PropRecentAutoFollowErrors = System.Text.Json.JsonEncodedText.Encode("recent_auto_follow_errors"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propAutoFollowedClusters = default; + LocalJsonValue propNumberOfFailedFollowIndices = default; + LocalJsonValue propNumberOfFailedRemoteClusterStateRequests = default; + LocalJsonValue propNumberOfSuccessfulFollowIndices = default; + LocalJsonValue> propRecentAutoFollowErrors = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAutoFollowedClusters.TryReadProperty(ref reader, options, PropAutoFollowedClusters, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propNumberOfFailedFollowIndices.TryReadProperty(ref reader, options, PropNumberOfFailedFollowIndices, null)) + { + continue; + } + + if (propNumberOfFailedRemoteClusterStateRequests.TryReadProperty(ref reader, options, PropNumberOfFailedRemoteClusterStateRequests, null)) + { + continue; + } + + if (propNumberOfSuccessfulFollowIndices.TryReadProperty(ref reader, options, PropNumberOfSuccessfulFollowIndices, null)) + { + continue; + } + + if (propRecentAutoFollowErrors.TryReadProperty(ref reader, options, PropRecentAutoFollowErrors, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AutoFollowedClusters = propAutoFollowedClusters.Value, + NumberOfFailedFollowIndices = propNumberOfFailedFollowIndices.Value, + NumberOfFailedRemoteClusterStateRequests = propNumberOfFailedRemoteClusterStateRequests.Value, + NumberOfSuccessfulFollowIndices = propNumberOfSuccessfulFollowIndices.Value, + RecentAutoFollowErrors = propRecentAutoFollowErrors.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAutoFollowedClusters, value.AutoFollowedClusters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropNumberOfFailedFollowIndices, value.NumberOfFailedFollowIndices, null, null); + writer.WriteProperty(options, PropNumberOfFailedRemoteClusterStateRequests, value.NumberOfFailedRemoteClusterStateRequests, null, null); + writer.WriteProperty(options, PropNumberOfSuccessfulFollowIndices, value.NumberOfSuccessfulFollowIndices, null, null); + writer.WriteProperty(options, PropRecentAutoFollowErrors, value.RecentAutoFollowErrors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowStats.g.cs index 068909d9cc0..8335a909a9b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowStats.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; -internal sealed partial class AutoFollowStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAutoFollowedClusters = System.Text.Json.JsonEncodedText.Encode("auto_followed_clusters"); - private static readonly System.Text.Json.JsonEncodedText PropNumberOfFailedFollowIndices = System.Text.Json.JsonEncodedText.Encode("number_of_failed_follow_indices"); - private static readonly System.Text.Json.JsonEncodedText PropNumberOfFailedRemoteClusterStateRequests = System.Text.Json.JsonEncodedText.Encode("number_of_failed_remote_cluster_state_requests"); - private static readonly System.Text.Json.JsonEncodedText PropNumberOfSuccessfulFollowIndices = System.Text.Json.JsonEncodedText.Encode("number_of_successful_follow_indices"); - private static readonly System.Text.Json.JsonEncodedText PropRecentAutoFollowErrors = System.Text.Json.JsonEncodedText.Encode("recent_auto_follow_errors"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propAutoFollowedClusters = default; - LocalJsonValue propNumberOfFailedFollowIndices = default; - LocalJsonValue propNumberOfFailedRemoteClusterStateRequests = default; - LocalJsonValue propNumberOfSuccessfulFollowIndices = default; - LocalJsonValue> propRecentAutoFollowErrors = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAutoFollowedClusters.TryReadProperty(ref reader, options, PropAutoFollowedClusters, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propNumberOfFailedFollowIndices.TryReadProperty(ref reader, options, PropNumberOfFailedFollowIndices, null)) - { - continue; - } - - if (propNumberOfFailedRemoteClusterStateRequests.TryReadProperty(ref reader, options, PropNumberOfFailedRemoteClusterStateRequests, null)) - { - continue; - } - - if (propNumberOfSuccessfulFollowIndices.TryReadProperty(ref reader, options, PropNumberOfSuccessfulFollowIndices, null)) - { - continue; - } - - if (propRecentAutoFollowErrors.TryReadProperty(ref reader, options, PropRecentAutoFollowErrors, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AutoFollowedClusters = propAutoFollowedClusters.Value, - NumberOfFailedFollowIndices = propNumberOfFailedFollowIndices.Value, - NumberOfFailedRemoteClusterStateRequests = propNumberOfFailedRemoteClusterStateRequests.Value, - NumberOfSuccessfulFollowIndices = propNumberOfSuccessfulFollowIndices.Value, - RecentAutoFollowErrors = propRecentAutoFollowErrors.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAutoFollowedClusters, value.AutoFollowedClusters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropNumberOfFailedFollowIndices, value.NumberOfFailedFollowIndices, null, null); - writer.WriteProperty(options, PropNumberOfFailedRemoteClusterStateRequests, value.NumberOfFailedRemoteClusterStateRequests, null, null); - writer.WriteProperty(options, PropNumberOfSuccessfulFollowIndices, value.NumberOfSuccessfulFollowIndices, null, null); - writer.WriteProperty(options, PropRecentAutoFollowErrors, value.RecentAutoFollowErrors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.AutoFollowStatsConverter))] public sealed partial class AutoFollowStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowedCluster.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowedCluster.Converters.g.cs new file mode 100644 index 00000000000..28d8803e25f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowedCluster.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class AutoFollowedClusterConverter : 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 PropLastSeenMetadataVersion = System.Text.Json.JsonEncodedText.Encode("last_seen_metadata_version"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSinceLastCheckMillis = System.Text.Json.JsonEncodedText.Encode("time_since_last_check_millis"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowedCluster Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClusterName = default; + LocalJsonValue propLastSeenMetadataVersion = default; + LocalJsonValue propTimeSinceLastCheckMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) + { + continue; + } + + if (propLastSeenMetadataVersion.TryReadProperty(ref reader, options, PropLastSeenMetadataVersion, null)) + { + continue; + } + + if (propTimeSinceLastCheckMillis.TryReadProperty(ref reader, options, PropTimeSinceLastCheckMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowedCluster(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClusterName = propClusterName.Value, + LastSeenMetadataVersion = propLastSeenMetadataVersion.Value, + TimeSinceLastCheckMillis = propTimeSinceLastCheckMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowedCluster value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); + writer.WriteProperty(options, PropLastSeenMetadataVersion, value.LastSeenMetadataVersion, null, null); + writer.WriteProperty(options, PropTimeSinceLastCheckMillis, value.TimeSinceLastCheckMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowedCluster.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowedCluster.g.cs index 5f3d35e4661..3c5809187fb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowedCluster.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/AutoFollowedCluster.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; -internal sealed partial class AutoFollowedClusterConverter : 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 PropLastSeenMetadataVersion = System.Text.Json.JsonEncodedText.Encode("last_seen_metadata_version"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSinceLastCheckMillis = System.Text.Json.JsonEncodedText.Encode("time_since_last_check_millis"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowedCluster Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClusterName = default; - LocalJsonValue propLastSeenMetadataVersion = default; - LocalJsonValue propTimeSinceLastCheckMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) - { - continue; - } - - if (propLastSeenMetadataVersion.TryReadProperty(ref reader, options, PropLastSeenMetadataVersion, null)) - { - continue; - } - - if (propTimeSinceLastCheckMillis.TryReadProperty(ref reader, options, PropTimeSinceLastCheckMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowedCluster(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClusterName = propClusterName.Value, - LastSeenMetadataVersion = propLastSeenMetadataVersion.Value, - TimeSinceLastCheckMillis = propTimeSinceLastCheckMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowedCluster value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); - writer.WriteProperty(options, PropLastSeenMetadataVersion, value.LastSeenMetadataVersion, null, null); - writer.WriteProperty(options, PropTimeSinceLastCheckMillis, value.TimeSinceLastCheckMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.AutoFollowedClusterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.AutoFollowedClusterConverter))] public sealed partial class AutoFollowedCluster { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowIndexStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowIndexStats.Converters.g.cs new file mode 100644 index 00000000000..ed206220811 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowIndexStats.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class FollowIndexStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowIndexStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndex = default; + LocalJsonValue> propShards = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowIndexStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Index = propIndex.Value, + Shards = propShards.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowIndexStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropShards, value.Shards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowIndexStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowIndexStats.g.cs index 7cbd3bbca78..2846af09e3d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowIndexStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowIndexStats.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; -internal sealed partial class FollowIndexStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowIndexStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndex = default; - LocalJsonValue> propShards = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowIndexStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Index = propIndex.Value, - Shards = propShards.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowIndexStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropShards, value.Shards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowIndexStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.FollowIndexStatsConverter))] public sealed partial class FollowIndexStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowStats.Converters.g.cs new file mode 100644 index 00000000000..6c88f8e6ed8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowStats.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class FollowStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propIndices = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Indices = propIndices.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowStats.g.cs index ef28d324c8c..6e396c5c844 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowStats.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; -internal sealed partial class FollowStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propIndices = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Indices = propIndices.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.FollowStatsConverter))] public sealed partial class FollowStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndex.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndex.Converters.g.cs new file mode 100644 index 00000000000..fe892f185e8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndex.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class FollowerIndexConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFollowerIndexValue = System.Text.Json.JsonEncodedText.Encode("follower_index"); + private static readonly System.Text.Json.JsonEncodedText PropLeaderIndex = System.Text.Json.JsonEncodedText.Encode("leader_index"); + private static readonly System.Text.Json.JsonEncodedText PropParameters = System.Text.Json.JsonEncodedText.Encode("parameters"); + private static readonly System.Text.Json.JsonEncodedText PropRemoteCluster = System.Text.Json.JsonEncodedText.Encode("remote_cluster"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowerIndex Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFollowerIndexValue = default; + LocalJsonValue propLeaderIndex = default; + LocalJsonValue propParameters = default; + LocalJsonValue propRemoteCluster = default; + LocalJsonValue propStatus = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFollowerIndexValue.TryReadProperty(ref reader, options, PropFollowerIndexValue, null)) + { + continue; + } + + if (propLeaderIndex.TryReadProperty(ref reader, options, PropLeaderIndex, null)) + { + continue; + } + + if (propParameters.TryReadProperty(ref reader, options, PropParameters, null)) + { + continue; + } + + if (propRemoteCluster.TryReadProperty(ref reader, options, PropRemoteCluster, null)) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowerIndex(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FollowerIndexValue = propFollowerIndexValue.Value, + LeaderIndex = propLeaderIndex.Value, + Parameters = propParameters.Value, + RemoteCluster = propRemoteCluster.Value, + Status = propStatus.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowerIndex value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFollowerIndexValue, value.FollowerIndexValue, null, null); + writer.WriteProperty(options, PropLeaderIndex, value.LeaderIndex, null, null); + writer.WriteProperty(options, PropParameters, value.Parameters, null, null); + writer.WriteProperty(options, PropRemoteCluster, value.RemoteCluster, null, null); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndex.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndex.g.cs index 2c39362d371..fb28ff44160 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndex.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndex.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; -internal sealed partial class FollowerIndexConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFollowerIndexValue = System.Text.Json.JsonEncodedText.Encode("follower_index"); - private static readonly System.Text.Json.JsonEncodedText PropLeaderIndex = System.Text.Json.JsonEncodedText.Encode("leader_index"); - private static readonly System.Text.Json.JsonEncodedText PropParameters = System.Text.Json.JsonEncodedText.Encode("parameters"); - private static readonly System.Text.Json.JsonEncodedText PropRemoteCluster = System.Text.Json.JsonEncodedText.Encode("remote_cluster"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowerIndex Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFollowerIndexValue = default; - LocalJsonValue propLeaderIndex = default; - LocalJsonValue propParameters = default; - LocalJsonValue propRemoteCluster = default; - LocalJsonValue propStatus = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFollowerIndexValue.TryReadProperty(ref reader, options, PropFollowerIndexValue, null)) - { - continue; - } - - if (propLeaderIndex.TryReadProperty(ref reader, options, PropLeaderIndex, null)) - { - continue; - } - - if (propParameters.TryReadProperty(ref reader, options, PropParameters, null)) - { - continue; - } - - if (propRemoteCluster.TryReadProperty(ref reader, options, PropRemoteCluster, null)) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowerIndex(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FollowerIndexValue = propFollowerIndexValue.Value, - LeaderIndex = propLeaderIndex.Value, - Parameters = propParameters.Value, - RemoteCluster = propRemoteCluster.Value, - Status = propStatus.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowerIndex value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFollowerIndexValue, value.FollowerIndexValue, null, null); - writer.WriteProperty(options, PropLeaderIndex, value.LeaderIndex, null, null); - writer.WriteProperty(options, PropParameters, value.Parameters, null, null); - writer.WriteProperty(options, PropRemoteCluster, value.RemoteCluster, null, null); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowerIndexConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.FollowerIndexConverter))] public sealed partial class FollowerIndex { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndexParameters.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndexParameters.Converters.g.cs new file mode 100644 index 00000000000..957d87ea334 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndexParameters.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class FollowerIndexParametersConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxOutstandingReadRequests = System.Text.Json.JsonEncodedText.Encode("max_outstanding_read_requests"); + private static readonly System.Text.Json.JsonEncodedText PropMaxOutstandingWriteRequests = System.Text.Json.JsonEncodedText.Encode("max_outstanding_write_requests"); + private static readonly System.Text.Json.JsonEncodedText PropMaxReadRequestOperationCount = System.Text.Json.JsonEncodedText.Encode("max_read_request_operation_count"); + private static readonly System.Text.Json.JsonEncodedText PropMaxReadRequestSize = System.Text.Json.JsonEncodedText.Encode("max_read_request_size"); + private static readonly System.Text.Json.JsonEncodedText PropMaxRetryDelay = System.Text.Json.JsonEncodedText.Encode("max_retry_delay"); + private static readonly System.Text.Json.JsonEncodedText PropMaxWriteBufferCount = System.Text.Json.JsonEncodedText.Encode("max_write_buffer_count"); + private static readonly System.Text.Json.JsonEncodedText PropMaxWriteBufferSize = System.Text.Json.JsonEncodedText.Encode("max_write_buffer_size"); + private static readonly System.Text.Json.JsonEncodedText PropMaxWriteRequestOperationCount = System.Text.Json.JsonEncodedText.Encode("max_write_request_operation_count"); + private static readonly System.Text.Json.JsonEncodedText PropMaxWriteRequestSize = System.Text.Json.JsonEncodedText.Encode("max_write_request_size"); + private static readonly System.Text.Json.JsonEncodedText PropReadPollTimeout = System.Text.Json.JsonEncodedText.Encode("read_poll_timeout"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowerIndexParameters Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxOutstandingReadRequests = default; + LocalJsonValue propMaxOutstandingWriteRequests = default; + LocalJsonValue propMaxReadRequestOperationCount = default; + LocalJsonValue propMaxReadRequestSize = default; + LocalJsonValue propMaxRetryDelay = default; + LocalJsonValue propMaxWriteBufferCount = default; + LocalJsonValue propMaxWriteBufferSize = default; + LocalJsonValue propMaxWriteRequestOperationCount = default; + LocalJsonValue propMaxWriteRequestSize = default; + LocalJsonValue propReadPollTimeout = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxOutstandingReadRequests.TryReadProperty(ref reader, options, PropMaxOutstandingReadRequests, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxOutstandingWriteRequests.TryReadProperty(ref reader, options, PropMaxOutstandingWriteRequests, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxReadRequestOperationCount.TryReadProperty(ref reader, options, PropMaxReadRequestOperationCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxReadRequestSize.TryReadProperty(ref reader, options, PropMaxReadRequestSize, null)) + { + continue; + } + + if (propMaxRetryDelay.TryReadProperty(ref reader, options, PropMaxRetryDelay, null)) + { + continue; + } + + if (propMaxWriteBufferCount.TryReadProperty(ref reader, options, PropMaxWriteBufferCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxWriteBufferSize.TryReadProperty(ref reader, options, PropMaxWriteBufferSize, null)) + { + continue; + } + + if (propMaxWriteRequestOperationCount.TryReadProperty(ref reader, options, PropMaxWriteRequestOperationCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxWriteRequestSize.TryReadProperty(ref reader, options, PropMaxWriteRequestSize, null)) + { + continue; + } + + if (propReadPollTimeout.TryReadProperty(ref reader, options, PropReadPollTimeout, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowerIndexParameters(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxOutstandingReadRequests = propMaxOutstandingReadRequests.Value, + MaxOutstandingWriteRequests = propMaxOutstandingWriteRequests.Value, + MaxReadRequestOperationCount = propMaxReadRequestOperationCount.Value, + MaxReadRequestSize = propMaxReadRequestSize.Value, + MaxRetryDelay = propMaxRetryDelay.Value, + MaxWriteBufferCount = propMaxWriteBufferCount.Value, + MaxWriteBufferSize = propMaxWriteBufferSize.Value, + MaxWriteRequestOperationCount = propMaxWriteRequestOperationCount.Value, + MaxWriteRequestSize = propMaxWriteRequestSize.Value, + ReadPollTimeout = propReadPollTimeout.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowerIndexParameters value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxOutstandingReadRequests, value.MaxOutstandingReadRequests, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxOutstandingWriteRequests, value.MaxOutstandingWriteRequests, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxReadRequestOperationCount, value.MaxReadRequestOperationCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxReadRequestSize, value.MaxReadRequestSize, null, null); + writer.WriteProperty(options, PropMaxRetryDelay, value.MaxRetryDelay, null, null); + writer.WriteProperty(options, PropMaxWriteBufferCount, value.MaxWriteBufferCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxWriteBufferSize, value.MaxWriteBufferSize, null, null); + writer.WriteProperty(options, PropMaxWriteRequestOperationCount, value.MaxWriteRequestOperationCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxWriteRequestSize, value.MaxWriteRequestSize, null, null); + writer.WriteProperty(options, PropReadPollTimeout, value.ReadPollTimeout, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndexParameters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndexParameters.g.cs index 2f5900256cd..501068a875f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndexParameters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndexParameters.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; -internal sealed partial class FollowerIndexParametersConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxOutstandingReadRequests = System.Text.Json.JsonEncodedText.Encode("max_outstanding_read_requests"); - private static readonly System.Text.Json.JsonEncodedText PropMaxOutstandingWriteRequests = System.Text.Json.JsonEncodedText.Encode("max_outstanding_write_requests"); - private static readonly System.Text.Json.JsonEncodedText PropMaxReadRequestOperationCount = System.Text.Json.JsonEncodedText.Encode("max_read_request_operation_count"); - private static readonly System.Text.Json.JsonEncodedText PropMaxReadRequestSize = System.Text.Json.JsonEncodedText.Encode("max_read_request_size"); - private static readonly System.Text.Json.JsonEncodedText PropMaxRetryDelay = System.Text.Json.JsonEncodedText.Encode("max_retry_delay"); - private static readonly System.Text.Json.JsonEncodedText PropMaxWriteBufferCount = System.Text.Json.JsonEncodedText.Encode("max_write_buffer_count"); - private static readonly System.Text.Json.JsonEncodedText PropMaxWriteBufferSize = System.Text.Json.JsonEncodedText.Encode("max_write_buffer_size"); - private static readonly System.Text.Json.JsonEncodedText PropMaxWriteRequestOperationCount = System.Text.Json.JsonEncodedText.Encode("max_write_request_operation_count"); - private static readonly System.Text.Json.JsonEncodedText PropMaxWriteRequestSize = System.Text.Json.JsonEncodedText.Encode("max_write_request_size"); - private static readonly System.Text.Json.JsonEncodedText PropReadPollTimeout = System.Text.Json.JsonEncodedText.Encode("read_poll_timeout"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowerIndexParameters Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxOutstandingReadRequests = default; - LocalJsonValue propMaxOutstandingWriteRequests = default; - LocalJsonValue propMaxReadRequestOperationCount = default; - LocalJsonValue propMaxReadRequestSize = default; - LocalJsonValue propMaxRetryDelay = default; - LocalJsonValue propMaxWriteBufferCount = default; - LocalJsonValue propMaxWriteBufferSize = default; - LocalJsonValue propMaxWriteRequestOperationCount = default; - LocalJsonValue propMaxWriteRequestSize = default; - LocalJsonValue propReadPollTimeout = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxOutstandingReadRequests.TryReadProperty(ref reader, options, PropMaxOutstandingReadRequests, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxOutstandingWriteRequests.TryReadProperty(ref reader, options, PropMaxOutstandingWriteRequests, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxReadRequestOperationCount.TryReadProperty(ref reader, options, PropMaxReadRequestOperationCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxReadRequestSize.TryReadProperty(ref reader, options, PropMaxReadRequestSize, null)) - { - continue; - } - - if (propMaxRetryDelay.TryReadProperty(ref reader, options, PropMaxRetryDelay, null)) - { - continue; - } - - if (propMaxWriteBufferCount.TryReadProperty(ref reader, options, PropMaxWriteBufferCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxWriteBufferSize.TryReadProperty(ref reader, options, PropMaxWriteBufferSize, null)) - { - continue; - } - - if (propMaxWriteRequestOperationCount.TryReadProperty(ref reader, options, PropMaxWriteRequestOperationCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxWriteRequestSize.TryReadProperty(ref reader, options, PropMaxWriteRequestSize, null)) - { - continue; - } - - if (propReadPollTimeout.TryReadProperty(ref reader, options, PropReadPollTimeout, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowerIndexParameters(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxOutstandingReadRequests = propMaxOutstandingReadRequests.Value, - MaxOutstandingWriteRequests = propMaxOutstandingWriteRequests.Value, - MaxReadRequestOperationCount = propMaxReadRequestOperationCount.Value, - MaxReadRequestSize = propMaxReadRequestSize.Value, - MaxRetryDelay = propMaxRetryDelay.Value, - MaxWriteBufferCount = propMaxWriteBufferCount.Value, - MaxWriteBufferSize = propMaxWriteBufferSize.Value, - MaxWriteRequestOperationCount = propMaxWriteRequestOperationCount.Value, - MaxWriteRequestSize = propMaxWriteRequestSize.Value, - ReadPollTimeout = propReadPollTimeout.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowerIndexParameters value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxOutstandingReadRequests, value.MaxOutstandingReadRequests, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxOutstandingWriteRequests, value.MaxOutstandingWriteRequests, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxReadRequestOperationCount, value.MaxReadRequestOperationCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxReadRequestSize, value.MaxReadRequestSize, null, null); - writer.WriteProperty(options, PropMaxRetryDelay, value.MaxRetryDelay, null, null); - writer.WriteProperty(options, PropMaxWriteBufferCount, value.MaxWriteBufferCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxWriteBufferSize, value.MaxWriteBufferSize, null, null); - writer.WriteProperty(options, PropMaxWriteRequestOperationCount, value.MaxWriteRequestOperationCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxWriteRequestSize, value.MaxWriteRequestSize, null, null); - writer.WriteProperty(options, PropReadPollTimeout, value.ReadPollTimeout, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowerIndexParametersConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.FollowerIndexParametersConverter))] public sealed partial class FollowerIndexParameters { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.CrossClusterReplication.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndexStatus.Converters.g.cs similarity index 87% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.CrossClusterReplication.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndexStatus.Converters.g.cs index c04b392dc0d..d40bc79178e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.CrossClusterReplication.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndexStatus.Converters.g.cs @@ -21,9 +21,9 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; -internal sealed partial class FollowerIndexStatusConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class FollowerIndexStatusConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText MemberActive = System.Text.Json.JsonEncodedText.Encode("active"); private static readonly System.Text.Json.JsonEncodedText MemberPaused = System.Text.Json.JsonEncodedText.Encode("paused"); @@ -78,13 +78,4 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, { Write(writer, value, options); } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.FollowerIndexStatusConverter))] -public enum FollowerIndexStatus -{ - [System.Runtime.Serialization.EnumMember(Value = "active")] - Active, - [System.Runtime.Serialization.EnumMember(Value = "paused")] - Paused } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndexStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndexStatus.g.cs new file mode 100644 index 00000000000..04f0f4d328a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/FollowerIndexStatus.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.FollowerIndexStatusConverter))] +public enum FollowerIndexStatus +{ + [System.Runtime.Serialization.EnumMember(Value = "active")] + Active, + [System.Runtime.Serialization.EnumMember(Value = "paused")] + Paused +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/ReadException.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/ReadException.Converters.g.cs new file mode 100644 index 00000000000..8fd53771dab --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/ReadException.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class ReadExceptionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropException = System.Text.Json.JsonEncodedText.Encode("exception"); + private static readonly System.Text.Json.JsonEncodedText PropFromSeqNo = System.Text.Json.JsonEncodedText.Encode("from_seq_no"); + private static readonly System.Text.Json.JsonEncodedText PropRetries = System.Text.Json.JsonEncodedText.Encode("retries"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.ReadException Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propException = default; + LocalJsonValue propFromSeqNo = default; + LocalJsonValue propRetries = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propException.TryReadProperty(ref reader, options, PropException, null)) + { + continue; + } + + if (propFromSeqNo.TryReadProperty(ref reader, options, PropFromSeqNo, null)) + { + continue; + } + + if (propRetries.TryReadProperty(ref reader, options, PropRetries, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.ReadException(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Exception = propException.Value, + FromSeqNo = propFromSeqNo.Value, + Retries = propRetries.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.ReadException value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropException, value.Exception, null, null); + writer.WriteProperty(options, PropFromSeqNo, value.FromSeqNo, null, null); + writer.WriteProperty(options, PropRetries, value.Retries, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/ReadException.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/ReadException.g.cs index f2b3fd6e110..8c0120313c5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/ReadException.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/ReadException.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; -internal sealed partial class ReadExceptionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropException = System.Text.Json.JsonEncodedText.Encode("exception"); - private static readonly System.Text.Json.JsonEncodedText PropFromSeqNo = System.Text.Json.JsonEncodedText.Encode("from_seq_no"); - private static readonly System.Text.Json.JsonEncodedText PropRetries = System.Text.Json.JsonEncodedText.Encode("retries"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.ReadException Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propException = default; - LocalJsonValue propFromSeqNo = default; - LocalJsonValue propRetries = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propException.TryReadProperty(ref reader, options, PropException, null)) - { - continue; - } - - if (propFromSeqNo.TryReadProperty(ref reader, options, PropFromSeqNo, null)) - { - continue; - } - - if (propRetries.TryReadProperty(ref reader, options, PropRetries, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.ReadException(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Exception = propException.Value, - FromSeqNo = propFromSeqNo.Value, - Retries = propRetries.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.ReadException value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropException, value.Exception, null, null); - writer.WriteProperty(options, PropFromSeqNo, value.FromSeqNo, null, null); - writer.WriteProperty(options, PropRetries, value.Retries, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.ReadExceptionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.ReadExceptionConverter))] public sealed partial class ReadException { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/ShardStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/ShardStats.Converters.g.cs new file mode 100644 index 00000000000..06016aeeaa8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/ShardStats.Converters.g.cs @@ -0,0 +1,351 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.CrossClusterReplication.Json; + +public sealed partial class ShardStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBytesRead = System.Text.Json.JsonEncodedText.Encode("bytes_read"); + private static readonly System.Text.Json.JsonEncodedText PropFailedReadRequests = System.Text.Json.JsonEncodedText.Encode("failed_read_requests"); + private static readonly System.Text.Json.JsonEncodedText PropFailedWriteRequests = System.Text.Json.JsonEncodedText.Encode("failed_write_requests"); + private static readonly System.Text.Json.JsonEncodedText PropFatalException = System.Text.Json.JsonEncodedText.Encode("fatal_exception"); + private static readonly System.Text.Json.JsonEncodedText PropFollowerAliasesVersion = System.Text.Json.JsonEncodedText.Encode("follower_aliases_version"); + private static readonly System.Text.Json.JsonEncodedText PropFollowerGlobalCheckpoint = System.Text.Json.JsonEncodedText.Encode("follower_global_checkpoint"); + private static readonly System.Text.Json.JsonEncodedText PropFollowerIndex = System.Text.Json.JsonEncodedText.Encode("follower_index"); + private static readonly System.Text.Json.JsonEncodedText PropFollowerMappingVersion = System.Text.Json.JsonEncodedText.Encode("follower_mapping_version"); + private static readonly System.Text.Json.JsonEncodedText PropFollowerMaxSeqNo = System.Text.Json.JsonEncodedText.Encode("follower_max_seq_no"); + private static readonly System.Text.Json.JsonEncodedText PropFollowerSettingsVersion = System.Text.Json.JsonEncodedText.Encode("follower_settings_version"); + private static readonly System.Text.Json.JsonEncodedText PropLastRequestedSeqNo = System.Text.Json.JsonEncodedText.Encode("last_requested_seq_no"); + private static readonly System.Text.Json.JsonEncodedText PropLeaderGlobalCheckpoint = System.Text.Json.JsonEncodedText.Encode("leader_global_checkpoint"); + private static readonly System.Text.Json.JsonEncodedText PropLeaderIndex = System.Text.Json.JsonEncodedText.Encode("leader_index"); + private static readonly System.Text.Json.JsonEncodedText PropLeaderMaxSeqNo = System.Text.Json.JsonEncodedText.Encode("leader_max_seq_no"); + private static readonly System.Text.Json.JsonEncodedText PropOperationsRead = System.Text.Json.JsonEncodedText.Encode("operations_read"); + private static readonly System.Text.Json.JsonEncodedText PropOperationsWritten = System.Text.Json.JsonEncodedText.Encode("operations_written"); + private static readonly System.Text.Json.JsonEncodedText PropOutstandingReadRequests = System.Text.Json.JsonEncodedText.Encode("outstanding_read_requests"); + private static readonly System.Text.Json.JsonEncodedText PropOutstandingWriteRequests = System.Text.Json.JsonEncodedText.Encode("outstanding_write_requests"); + private static readonly System.Text.Json.JsonEncodedText PropReadExceptions = System.Text.Json.JsonEncodedText.Encode("read_exceptions"); + private static readonly System.Text.Json.JsonEncodedText PropRemoteCluster = System.Text.Json.JsonEncodedText.Encode("remote_cluster"); + private static readonly System.Text.Json.JsonEncodedText PropShardId = System.Text.Json.JsonEncodedText.Encode("shard_id"); + private static readonly System.Text.Json.JsonEncodedText PropSuccessfulReadRequests = System.Text.Json.JsonEncodedText.Encode("successful_read_requests"); + private static readonly System.Text.Json.JsonEncodedText PropSuccessfulWriteRequests = System.Text.Json.JsonEncodedText.Encode("successful_write_requests"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSinceLastRead = System.Text.Json.JsonEncodedText.Encode("time_since_last_read"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSinceLastReadMillis = System.Text.Json.JsonEncodedText.Encode("time_since_last_read_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTotalReadRemoteExecTime = System.Text.Json.JsonEncodedText.Encode("total_read_remote_exec_time"); + private static readonly System.Text.Json.JsonEncodedText PropTotalReadRemoteExecTimeMillis = System.Text.Json.JsonEncodedText.Encode("total_read_remote_exec_time_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTotalReadTime = System.Text.Json.JsonEncodedText.Encode("total_read_time"); + private static readonly System.Text.Json.JsonEncodedText PropTotalReadTimeMillis = System.Text.Json.JsonEncodedText.Encode("total_read_time_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTotalWriteTime = System.Text.Json.JsonEncodedText.Encode("total_write_time"); + private static readonly System.Text.Json.JsonEncodedText PropTotalWriteTimeMillis = System.Text.Json.JsonEncodedText.Encode("total_write_time_millis"); + private static readonly System.Text.Json.JsonEncodedText PropWriteBufferOperationCount = System.Text.Json.JsonEncodedText.Encode("write_buffer_operation_count"); + private static readonly System.Text.Json.JsonEncodedText PropWriteBufferSizeInBytes = System.Text.Json.JsonEncodedText.Encode("write_buffer_size_in_bytes"); + + public override Elastic.Clients.Elasticsearch.CrossClusterReplication.ShardStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBytesRead = default; + LocalJsonValue propFailedReadRequests = default; + LocalJsonValue propFailedWriteRequests = default; + LocalJsonValue propFatalException = default; + LocalJsonValue propFollowerAliasesVersion = default; + LocalJsonValue propFollowerGlobalCheckpoint = default; + LocalJsonValue propFollowerIndex = default; + LocalJsonValue propFollowerMappingVersion = default; + LocalJsonValue propFollowerMaxSeqNo = default; + LocalJsonValue propFollowerSettingsVersion = default; + LocalJsonValue propLastRequestedSeqNo = default; + LocalJsonValue propLeaderGlobalCheckpoint = default; + LocalJsonValue propLeaderIndex = default; + LocalJsonValue propLeaderMaxSeqNo = default; + LocalJsonValue propOperationsRead = default; + LocalJsonValue propOperationsWritten = default; + LocalJsonValue propOutstandingReadRequests = default; + LocalJsonValue propOutstandingWriteRequests = default; + LocalJsonValue> propReadExceptions = default; + LocalJsonValue propRemoteCluster = default; + LocalJsonValue propShardId = default; + LocalJsonValue propSuccessfulReadRequests = default; + LocalJsonValue propSuccessfulWriteRequests = default; + LocalJsonValue propTimeSinceLastRead = default; + LocalJsonValue propTimeSinceLastReadMillis = default; + LocalJsonValue propTotalReadRemoteExecTime = default; + LocalJsonValue propTotalReadRemoteExecTimeMillis = default; + LocalJsonValue propTotalReadTime = default; + LocalJsonValue propTotalReadTimeMillis = default; + LocalJsonValue propTotalWriteTime = default; + LocalJsonValue propTotalWriteTimeMillis = default; + LocalJsonValue propWriteBufferOperationCount = default; + LocalJsonValue propWriteBufferSizeInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBytesRead.TryReadProperty(ref reader, options, PropBytesRead, null)) + { + continue; + } + + if (propFailedReadRequests.TryReadProperty(ref reader, options, PropFailedReadRequests, null)) + { + continue; + } + + if (propFailedWriteRequests.TryReadProperty(ref reader, options, PropFailedWriteRequests, null)) + { + continue; + } + + if (propFatalException.TryReadProperty(ref reader, options, PropFatalException, null)) + { + continue; + } + + if (propFollowerAliasesVersion.TryReadProperty(ref reader, options, PropFollowerAliasesVersion, null)) + { + continue; + } + + if (propFollowerGlobalCheckpoint.TryReadProperty(ref reader, options, PropFollowerGlobalCheckpoint, null)) + { + continue; + } + + if (propFollowerIndex.TryReadProperty(ref reader, options, PropFollowerIndex, null)) + { + continue; + } + + if (propFollowerMappingVersion.TryReadProperty(ref reader, options, PropFollowerMappingVersion, null)) + { + continue; + } + + if (propFollowerMaxSeqNo.TryReadProperty(ref reader, options, PropFollowerMaxSeqNo, null)) + { + continue; + } + + if (propFollowerSettingsVersion.TryReadProperty(ref reader, options, PropFollowerSettingsVersion, null)) + { + continue; + } + + if (propLastRequestedSeqNo.TryReadProperty(ref reader, options, PropLastRequestedSeqNo, null)) + { + continue; + } + + if (propLeaderGlobalCheckpoint.TryReadProperty(ref reader, options, PropLeaderGlobalCheckpoint, null)) + { + continue; + } + + if (propLeaderIndex.TryReadProperty(ref reader, options, PropLeaderIndex, null)) + { + continue; + } + + if (propLeaderMaxSeqNo.TryReadProperty(ref reader, options, PropLeaderMaxSeqNo, null)) + { + continue; + } + + if (propOperationsRead.TryReadProperty(ref reader, options, PropOperationsRead, null)) + { + continue; + } + + if (propOperationsWritten.TryReadProperty(ref reader, options, PropOperationsWritten, null)) + { + continue; + } + + if (propOutstandingReadRequests.TryReadProperty(ref reader, options, PropOutstandingReadRequests, null)) + { + continue; + } + + if (propOutstandingWriteRequests.TryReadProperty(ref reader, options, PropOutstandingWriteRequests, null)) + { + continue; + } + + if (propReadExceptions.TryReadProperty(ref reader, options, PropReadExceptions, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propRemoteCluster.TryReadProperty(ref reader, options, PropRemoteCluster, null)) + { + continue; + } + + if (propShardId.TryReadProperty(ref reader, options, PropShardId, null)) + { + continue; + } + + if (propSuccessfulReadRequests.TryReadProperty(ref reader, options, PropSuccessfulReadRequests, null)) + { + continue; + } + + if (propSuccessfulWriteRequests.TryReadProperty(ref reader, options, PropSuccessfulWriteRequests, null)) + { + continue; + } + + if (propTimeSinceLastRead.TryReadProperty(ref reader, options, PropTimeSinceLastRead, null)) + { + continue; + } + + if (propTimeSinceLastReadMillis.TryReadProperty(ref reader, options, PropTimeSinceLastReadMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTotalReadRemoteExecTime.TryReadProperty(ref reader, options, PropTotalReadRemoteExecTime, null)) + { + continue; + } + + if (propTotalReadRemoteExecTimeMillis.TryReadProperty(ref reader, options, PropTotalReadRemoteExecTimeMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTotalReadTime.TryReadProperty(ref reader, options, PropTotalReadTime, null)) + { + continue; + } + + if (propTotalReadTimeMillis.TryReadProperty(ref reader, options, PropTotalReadTimeMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTotalWriteTime.TryReadProperty(ref reader, options, PropTotalWriteTime, null)) + { + continue; + } + + if (propTotalWriteTimeMillis.TryReadProperty(ref reader, options, PropTotalWriteTimeMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propWriteBufferOperationCount.TryReadProperty(ref reader, options, PropWriteBufferOperationCount, null)) + { + continue; + } + + if (propWriteBufferSizeInBytes.TryReadProperty(ref reader, options, PropWriteBufferSizeInBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.CrossClusterReplication.ShardStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BytesRead = propBytesRead.Value, + FailedReadRequests = propFailedReadRequests.Value, + FailedWriteRequests = propFailedWriteRequests.Value, + FatalException = propFatalException.Value, + FollowerAliasesVersion = propFollowerAliasesVersion.Value, + FollowerGlobalCheckpoint = propFollowerGlobalCheckpoint.Value, + FollowerIndex = propFollowerIndex.Value, + FollowerMappingVersion = propFollowerMappingVersion.Value, + FollowerMaxSeqNo = propFollowerMaxSeqNo.Value, + FollowerSettingsVersion = propFollowerSettingsVersion.Value, + LastRequestedSeqNo = propLastRequestedSeqNo.Value, + LeaderGlobalCheckpoint = propLeaderGlobalCheckpoint.Value, + LeaderIndex = propLeaderIndex.Value, + LeaderMaxSeqNo = propLeaderMaxSeqNo.Value, + OperationsRead = propOperationsRead.Value, + OperationsWritten = propOperationsWritten.Value, + OutstandingReadRequests = propOutstandingReadRequests.Value, + OutstandingWriteRequests = propOutstandingWriteRequests.Value, + ReadExceptions = propReadExceptions.Value, + RemoteCluster = propRemoteCluster.Value, + ShardId = propShardId.Value, + SuccessfulReadRequests = propSuccessfulReadRequests.Value, + SuccessfulWriteRequests = propSuccessfulWriteRequests.Value, + TimeSinceLastRead = propTimeSinceLastRead.Value, + TimeSinceLastReadMillis = propTimeSinceLastReadMillis.Value, + TotalReadRemoteExecTime = propTotalReadRemoteExecTime.Value, + TotalReadRemoteExecTimeMillis = propTotalReadRemoteExecTimeMillis.Value, + TotalReadTime = propTotalReadTime.Value, + TotalReadTimeMillis = propTotalReadTimeMillis.Value, + TotalWriteTime = propTotalWriteTime.Value, + TotalWriteTimeMillis = propTotalWriteTimeMillis.Value, + WriteBufferOperationCount = propWriteBufferOperationCount.Value, + WriteBufferSizeInBytes = propWriteBufferSizeInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.ShardStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBytesRead, value.BytesRead, null, null); + writer.WriteProperty(options, PropFailedReadRequests, value.FailedReadRequests, null, null); + writer.WriteProperty(options, PropFailedWriteRequests, value.FailedWriteRequests, null, null); + writer.WriteProperty(options, PropFatalException, value.FatalException, null, null); + writer.WriteProperty(options, PropFollowerAliasesVersion, value.FollowerAliasesVersion, null, null); + writer.WriteProperty(options, PropFollowerGlobalCheckpoint, value.FollowerGlobalCheckpoint, null, null); + writer.WriteProperty(options, PropFollowerIndex, value.FollowerIndex, null, null); + writer.WriteProperty(options, PropFollowerMappingVersion, value.FollowerMappingVersion, null, null); + writer.WriteProperty(options, PropFollowerMaxSeqNo, value.FollowerMaxSeqNo, null, null); + writer.WriteProperty(options, PropFollowerSettingsVersion, value.FollowerSettingsVersion, null, null); + writer.WriteProperty(options, PropLastRequestedSeqNo, value.LastRequestedSeqNo, null, null); + writer.WriteProperty(options, PropLeaderGlobalCheckpoint, value.LeaderGlobalCheckpoint, null, null); + writer.WriteProperty(options, PropLeaderIndex, value.LeaderIndex, null, null); + writer.WriteProperty(options, PropLeaderMaxSeqNo, value.LeaderMaxSeqNo, null, null); + writer.WriteProperty(options, PropOperationsRead, value.OperationsRead, null, null); + writer.WriteProperty(options, PropOperationsWritten, value.OperationsWritten, null, null); + writer.WriteProperty(options, PropOutstandingReadRequests, value.OutstandingReadRequests, null, null); + writer.WriteProperty(options, PropOutstandingWriteRequests, value.OutstandingWriteRequests, null, null); + writer.WriteProperty(options, PropReadExceptions, value.ReadExceptions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRemoteCluster, value.RemoteCluster, null, null); + writer.WriteProperty(options, PropShardId, value.ShardId, null, null); + writer.WriteProperty(options, PropSuccessfulReadRequests, value.SuccessfulReadRequests, null, null); + writer.WriteProperty(options, PropSuccessfulWriteRequests, value.SuccessfulWriteRequests, null, null); + writer.WriteProperty(options, PropTimeSinceLastRead, value.TimeSinceLastRead, null, null); + writer.WriteProperty(options, PropTimeSinceLastReadMillis, value.TimeSinceLastReadMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTotalReadRemoteExecTime, value.TotalReadRemoteExecTime, null, null); + writer.WriteProperty(options, PropTotalReadRemoteExecTimeMillis, value.TotalReadRemoteExecTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTotalReadTime, value.TotalReadTime, null, null); + writer.WriteProperty(options, PropTotalReadTimeMillis, value.TotalReadTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTotalWriteTime, value.TotalWriteTime, null, null); + writer.WriteProperty(options, PropTotalWriteTimeMillis, value.TotalWriteTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropWriteBufferOperationCount, value.WriteBufferOperationCount, null, null); + writer.WriteProperty(options, PropWriteBufferSizeInBytes, value.WriteBufferSizeInBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/ShardStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/ShardStats.g.cs index cf5cce8fa26..45fd73f1932 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/ShardStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CrossClusterReplication/ShardStats.g.cs @@ -23,334 +23,7 @@ namespace Elastic.Clients.Elasticsearch.CrossClusterReplication; -internal sealed partial class ShardStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBytesRead = System.Text.Json.JsonEncodedText.Encode("bytes_read"); - private static readonly System.Text.Json.JsonEncodedText PropFailedReadRequests = System.Text.Json.JsonEncodedText.Encode("failed_read_requests"); - private static readonly System.Text.Json.JsonEncodedText PropFailedWriteRequests = System.Text.Json.JsonEncodedText.Encode("failed_write_requests"); - private static readonly System.Text.Json.JsonEncodedText PropFatalException = System.Text.Json.JsonEncodedText.Encode("fatal_exception"); - private static readonly System.Text.Json.JsonEncodedText PropFollowerAliasesVersion = System.Text.Json.JsonEncodedText.Encode("follower_aliases_version"); - private static readonly System.Text.Json.JsonEncodedText PropFollowerGlobalCheckpoint = System.Text.Json.JsonEncodedText.Encode("follower_global_checkpoint"); - private static readonly System.Text.Json.JsonEncodedText PropFollowerIndex = System.Text.Json.JsonEncodedText.Encode("follower_index"); - private static readonly System.Text.Json.JsonEncodedText PropFollowerMappingVersion = System.Text.Json.JsonEncodedText.Encode("follower_mapping_version"); - private static readonly System.Text.Json.JsonEncodedText PropFollowerMaxSeqNo = System.Text.Json.JsonEncodedText.Encode("follower_max_seq_no"); - private static readonly System.Text.Json.JsonEncodedText PropFollowerSettingsVersion = System.Text.Json.JsonEncodedText.Encode("follower_settings_version"); - private static readonly System.Text.Json.JsonEncodedText PropLastRequestedSeqNo = System.Text.Json.JsonEncodedText.Encode("last_requested_seq_no"); - private static readonly System.Text.Json.JsonEncodedText PropLeaderGlobalCheckpoint = System.Text.Json.JsonEncodedText.Encode("leader_global_checkpoint"); - private static readonly System.Text.Json.JsonEncodedText PropLeaderIndex = System.Text.Json.JsonEncodedText.Encode("leader_index"); - private static readonly System.Text.Json.JsonEncodedText PropLeaderMaxSeqNo = System.Text.Json.JsonEncodedText.Encode("leader_max_seq_no"); - private static readonly System.Text.Json.JsonEncodedText PropOperationsRead = System.Text.Json.JsonEncodedText.Encode("operations_read"); - private static readonly System.Text.Json.JsonEncodedText PropOperationsWritten = System.Text.Json.JsonEncodedText.Encode("operations_written"); - private static readonly System.Text.Json.JsonEncodedText PropOutstandingReadRequests = System.Text.Json.JsonEncodedText.Encode("outstanding_read_requests"); - private static readonly System.Text.Json.JsonEncodedText PropOutstandingWriteRequests = System.Text.Json.JsonEncodedText.Encode("outstanding_write_requests"); - private static readonly System.Text.Json.JsonEncodedText PropReadExceptions = System.Text.Json.JsonEncodedText.Encode("read_exceptions"); - private static readonly System.Text.Json.JsonEncodedText PropRemoteCluster = System.Text.Json.JsonEncodedText.Encode("remote_cluster"); - private static readonly System.Text.Json.JsonEncodedText PropShardId = System.Text.Json.JsonEncodedText.Encode("shard_id"); - private static readonly System.Text.Json.JsonEncodedText PropSuccessfulReadRequests = System.Text.Json.JsonEncodedText.Encode("successful_read_requests"); - private static readonly System.Text.Json.JsonEncodedText PropSuccessfulWriteRequests = System.Text.Json.JsonEncodedText.Encode("successful_write_requests"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSinceLastRead = System.Text.Json.JsonEncodedText.Encode("time_since_last_read"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSinceLastReadMillis = System.Text.Json.JsonEncodedText.Encode("time_since_last_read_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTotalReadRemoteExecTime = System.Text.Json.JsonEncodedText.Encode("total_read_remote_exec_time"); - private static readonly System.Text.Json.JsonEncodedText PropTotalReadRemoteExecTimeMillis = System.Text.Json.JsonEncodedText.Encode("total_read_remote_exec_time_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTotalReadTime = System.Text.Json.JsonEncodedText.Encode("total_read_time"); - private static readonly System.Text.Json.JsonEncodedText PropTotalReadTimeMillis = System.Text.Json.JsonEncodedText.Encode("total_read_time_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTotalWriteTime = System.Text.Json.JsonEncodedText.Encode("total_write_time"); - private static readonly System.Text.Json.JsonEncodedText PropTotalWriteTimeMillis = System.Text.Json.JsonEncodedText.Encode("total_write_time_millis"); - private static readonly System.Text.Json.JsonEncodedText PropWriteBufferOperationCount = System.Text.Json.JsonEncodedText.Encode("write_buffer_operation_count"); - private static readonly System.Text.Json.JsonEncodedText PropWriteBufferSizeInBytes = System.Text.Json.JsonEncodedText.Encode("write_buffer_size_in_bytes"); - - public override Elastic.Clients.Elasticsearch.CrossClusterReplication.ShardStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBytesRead = default; - LocalJsonValue propFailedReadRequests = default; - LocalJsonValue propFailedWriteRequests = default; - LocalJsonValue propFatalException = default; - LocalJsonValue propFollowerAliasesVersion = default; - LocalJsonValue propFollowerGlobalCheckpoint = default; - LocalJsonValue propFollowerIndex = default; - LocalJsonValue propFollowerMappingVersion = default; - LocalJsonValue propFollowerMaxSeqNo = default; - LocalJsonValue propFollowerSettingsVersion = default; - LocalJsonValue propLastRequestedSeqNo = default; - LocalJsonValue propLeaderGlobalCheckpoint = default; - LocalJsonValue propLeaderIndex = default; - LocalJsonValue propLeaderMaxSeqNo = default; - LocalJsonValue propOperationsRead = default; - LocalJsonValue propOperationsWritten = default; - LocalJsonValue propOutstandingReadRequests = default; - LocalJsonValue propOutstandingWriteRequests = default; - LocalJsonValue> propReadExceptions = default; - LocalJsonValue propRemoteCluster = default; - LocalJsonValue propShardId = default; - LocalJsonValue propSuccessfulReadRequests = default; - LocalJsonValue propSuccessfulWriteRequests = default; - LocalJsonValue propTimeSinceLastRead = default; - LocalJsonValue propTimeSinceLastReadMillis = default; - LocalJsonValue propTotalReadRemoteExecTime = default; - LocalJsonValue propTotalReadRemoteExecTimeMillis = default; - LocalJsonValue propTotalReadTime = default; - LocalJsonValue propTotalReadTimeMillis = default; - LocalJsonValue propTotalWriteTime = default; - LocalJsonValue propTotalWriteTimeMillis = default; - LocalJsonValue propWriteBufferOperationCount = default; - LocalJsonValue propWriteBufferSizeInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBytesRead.TryReadProperty(ref reader, options, PropBytesRead, null)) - { - continue; - } - - if (propFailedReadRequests.TryReadProperty(ref reader, options, PropFailedReadRequests, null)) - { - continue; - } - - if (propFailedWriteRequests.TryReadProperty(ref reader, options, PropFailedWriteRequests, null)) - { - continue; - } - - if (propFatalException.TryReadProperty(ref reader, options, PropFatalException, null)) - { - continue; - } - - if (propFollowerAliasesVersion.TryReadProperty(ref reader, options, PropFollowerAliasesVersion, null)) - { - continue; - } - - if (propFollowerGlobalCheckpoint.TryReadProperty(ref reader, options, PropFollowerGlobalCheckpoint, null)) - { - continue; - } - - if (propFollowerIndex.TryReadProperty(ref reader, options, PropFollowerIndex, null)) - { - continue; - } - - if (propFollowerMappingVersion.TryReadProperty(ref reader, options, PropFollowerMappingVersion, null)) - { - continue; - } - - if (propFollowerMaxSeqNo.TryReadProperty(ref reader, options, PropFollowerMaxSeqNo, null)) - { - continue; - } - - if (propFollowerSettingsVersion.TryReadProperty(ref reader, options, PropFollowerSettingsVersion, null)) - { - continue; - } - - if (propLastRequestedSeqNo.TryReadProperty(ref reader, options, PropLastRequestedSeqNo, null)) - { - continue; - } - - if (propLeaderGlobalCheckpoint.TryReadProperty(ref reader, options, PropLeaderGlobalCheckpoint, null)) - { - continue; - } - - if (propLeaderIndex.TryReadProperty(ref reader, options, PropLeaderIndex, null)) - { - continue; - } - - if (propLeaderMaxSeqNo.TryReadProperty(ref reader, options, PropLeaderMaxSeqNo, null)) - { - continue; - } - - if (propOperationsRead.TryReadProperty(ref reader, options, PropOperationsRead, null)) - { - continue; - } - - if (propOperationsWritten.TryReadProperty(ref reader, options, PropOperationsWritten, null)) - { - continue; - } - - if (propOutstandingReadRequests.TryReadProperty(ref reader, options, PropOutstandingReadRequests, null)) - { - continue; - } - - if (propOutstandingWriteRequests.TryReadProperty(ref reader, options, PropOutstandingWriteRequests, null)) - { - continue; - } - - if (propReadExceptions.TryReadProperty(ref reader, options, PropReadExceptions, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propRemoteCluster.TryReadProperty(ref reader, options, PropRemoteCluster, null)) - { - continue; - } - - if (propShardId.TryReadProperty(ref reader, options, PropShardId, null)) - { - continue; - } - - if (propSuccessfulReadRequests.TryReadProperty(ref reader, options, PropSuccessfulReadRequests, null)) - { - continue; - } - - if (propSuccessfulWriteRequests.TryReadProperty(ref reader, options, PropSuccessfulWriteRequests, null)) - { - continue; - } - - if (propTimeSinceLastRead.TryReadProperty(ref reader, options, PropTimeSinceLastRead, null)) - { - continue; - } - - if (propTimeSinceLastReadMillis.TryReadProperty(ref reader, options, PropTimeSinceLastReadMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTotalReadRemoteExecTime.TryReadProperty(ref reader, options, PropTotalReadRemoteExecTime, null)) - { - continue; - } - - if (propTotalReadRemoteExecTimeMillis.TryReadProperty(ref reader, options, PropTotalReadRemoteExecTimeMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTotalReadTime.TryReadProperty(ref reader, options, PropTotalReadTime, null)) - { - continue; - } - - if (propTotalReadTimeMillis.TryReadProperty(ref reader, options, PropTotalReadTimeMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTotalWriteTime.TryReadProperty(ref reader, options, PropTotalWriteTime, null)) - { - continue; - } - - if (propTotalWriteTimeMillis.TryReadProperty(ref reader, options, PropTotalWriteTimeMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propWriteBufferOperationCount.TryReadProperty(ref reader, options, PropWriteBufferOperationCount, null)) - { - continue; - } - - if (propWriteBufferSizeInBytes.TryReadProperty(ref reader, options, PropWriteBufferSizeInBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.CrossClusterReplication.ShardStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BytesRead = propBytesRead.Value, - FailedReadRequests = propFailedReadRequests.Value, - FailedWriteRequests = propFailedWriteRequests.Value, - FatalException = propFatalException.Value, - FollowerAliasesVersion = propFollowerAliasesVersion.Value, - FollowerGlobalCheckpoint = propFollowerGlobalCheckpoint.Value, - FollowerIndex = propFollowerIndex.Value, - FollowerMappingVersion = propFollowerMappingVersion.Value, - FollowerMaxSeqNo = propFollowerMaxSeqNo.Value, - FollowerSettingsVersion = propFollowerSettingsVersion.Value, - LastRequestedSeqNo = propLastRequestedSeqNo.Value, - LeaderGlobalCheckpoint = propLeaderGlobalCheckpoint.Value, - LeaderIndex = propLeaderIndex.Value, - LeaderMaxSeqNo = propLeaderMaxSeqNo.Value, - OperationsRead = propOperationsRead.Value, - OperationsWritten = propOperationsWritten.Value, - OutstandingReadRequests = propOutstandingReadRequests.Value, - OutstandingWriteRequests = propOutstandingWriteRequests.Value, - ReadExceptions = propReadExceptions.Value, - RemoteCluster = propRemoteCluster.Value, - ShardId = propShardId.Value, - SuccessfulReadRequests = propSuccessfulReadRequests.Value, - SuccessfulWriteRequests = propSuccessfulWriteRequests.Value, - TimeSinceLastRead = propTimeSinceLastRead.Value, - TimeSinceLastReadMillis = propTimeSinceLastReadMillis.Value, - TotalReadRemoteExecTime = propTotalReadRemoteExecTime.Value, - TotalReadRemoteExecTimeMillis = propTotalReadRemoteExecTimeMillis.Value, - TotalReadTime = propTotalReadTime.Value, - TotalReadTimeMillis = propTotalReadTimeMillis.Value, - TotalWriteTime = propTotalWriteTime.Value, - TotalWriteTimeMillis = propTotalWriteTimeMillis.Value, - WriteBufferOperationCount = propWriteBufferOperationCount.Value, - WriteBufferSizeInBytes = propWriteBufferSizeInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CrossClusterReplication.ShardStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBytesRead, value.BytesRead, null, null); - writer.WriteProperty(options, PropFailedReadRequests, value.FailedReadRequests, null, null); - writer.WriteProperty(options, PropFailedWriteRequests, value.FailedWriteRequests, null, null); - writer.WriteProperty(options, PropFatalException, value.FatalException, null, null); - writer.WriteProperty(options, PropFollowerAliasesVersion, value.FollowerAliasesVersion, null, null); - writer.WriteProperty(options, PropFollowerGlobalCheckpoint, value.FollowerGlobalCheckpoint, null, null); - writer.WriteProperty(options, PropFollowerIndex, value.FollowerIndex, null, null); - writer.WriteProperty(options, PropFollowerMappingVersion, value.FollowerMappingVersion, null, null); - writer.WriteProperty(options, PropFollowerMaxSeqNo, value.FollowerMaxSeqNo, null, null); - writer.WriteProperty(options, PropFollowerSettingsVersion, value.FollowerSettingsVersion, null, null); - writer.WriteProperty(options, PropLastRequestedSeqNo, value.LastRequestedSeqNo, null, null); - writer.WriteProperty(options, PropLeaderGlobalCheckpoint, value.LeaderGlobalCheckpoint, null, null); - writer.WriteProperty(options, PropLeaderIndex, value.LeaderIndex, null, null); - writer.WriteProperty(options, PropLeaderMaxSeqNo, value.LeaderMaxSeqNo, null, null); - writer.WriteProperty(options, PropOperationsRead, value.OperationsRead, null, null); - writer.WriteProperty(options, PropOperationsWritten, value.OperationsWritten, null, null); - writer.WriteProperty(options, PropOutstandingReadRequests, value.OutstandingReadRequests, null, null); - writer.WriteProperty(options, PropOutstandingWriteRequests, value.OutstandingWriteRequests, null, null); - writer.WriteProperty(options, PropReadExceptions, value.ReadExceptions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRemoteCluster, value.RemoteCluster, null, null); - writer.WriteProperty(options, PropShardId, value.ShardId, null, null); - writer.WriteProperty(options, PropSuccessfulReadRequests, value.SuccessfulReadRequests, null, null); - writer.WriteProperty(options, PropSuccessfulWriteRequests, value.SuccessfulWriteRequests, null, null); - writer.WriteProperty(options, PropTimeSinceLastRead, value.TimeSinceLastRead, null, null); - writer.WriteProperty(options, PropTimeSinceLastReadMillis, value.TimeSinceLastReadMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTotalReadRemoteExecTime, value.TotalReadRemoteExecTime, null, null); - writer.WriteProperty(options, PropTotalReadRemoteExecTimeMillis, value.TotalReadRemoteExecTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTotalReadTime, value.TotalReadTime, null, null); - writer.WriteProperty(options, PropTotalReadTimeMillis, value.TotalReadTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTotalWriteTime, value.TotalWriteTime, null, null); - writer.WriteProperty(options, PropTotalWriteTimeMillis, value.TotalWriteTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropWriteBufferOperationCount, value.WriteBufferOperationCount, null, null); - writer.WriteProperty(options, PropWriteBufferSizeInBytes, value.WriteBufferSizeInBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.ShardStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.CrossClusterReplication.Json.ShardStatsConverter))] public sealed partial class ShardStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/DFIIndependenceMeasure.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/DFIIndependenceMeasure.Converters.g.cs new file mode 100644 index 00000000000..d11b343c1ca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/DFIIndependenceMeasure.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class DFIIndependenceMeasureConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberChisquared = System.Text.Json.JsonEncodedText.Encode("chisquared"); + private static readonly System.Text.Json.JsonEncodedText MemberSaturated = System.Text.Json.JsonEncodedText.Encode("saturated"); + private static readonly System.Text.Json.JsonEncodedText MemberStandardized = System.Text.Json.JsonEncodedText.Encode("standardized"); + + public override Elastic.Clients.Elasticsearch.DFIIndependenceMeasure Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberChisquared)) + { + return Elastic.Clients.Elasticsearch.DFIIndependenceMeasure.Chisquared; + } + + if (reader.ValueTextEquals(MemberSaturated)) + { + return Elastic.Clients.Elasticsearch.DFIIndependenceMeasure.Saturated; + } + + if (reader.ValueTextEquals(MemberStandardized)) + { + return Elastic.Clients.Elasticsearch.DFIIndependenceMeasure.Standardized; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberChisquared.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.DFIIndependenceMeasure.Chisquared; + } + + if (string.Equals(value, MemberSaturated.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.DFIIndependenceMeasure.Saturated; + } + + if (string.Equals(value, MemberStandardized.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.DFIIndependenceMeasure.Standardized; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.DFIIndependenceMeasure)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DFIIndependenceMeasure value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.DFIIndependenceMeasure.Chisquared: + writer.WriteStringValue(MemberChisquared); + break; + case Elastic.Clients.Elasticsearch.DFIIndependenceMeasure.Saturated: + writer.WriteStringValue(MemberSaturated); + break; + case Elastic.Clients.Elasticsearch.DFIIndependenceMeasure.Standardized: + writer.WriteStringValue(MemberStandardized); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.DFIIndependenceMeasure)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.DFIIndependenceMeasure ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DFIIndependenceMeasure value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/DFIIndependenceMeasure.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/DFIIndependenceMeasure.g.cs new file mode 100644 index 00000000000..05001552c19 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/DFIIndependenceMeasure.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.DFIIndependenceMeasureConverter))] +public enum DFIIndependenceMeasure +{ + [System.Runtime.Serialization.EnumMember(Value = "chisquared")] + Chisquared, + [System.Runtime.Serialization.EnumMember(Value = "saturated")] + Saturated, + [System.Runtime.Serialization.EnumMember(Value = "standardized")] + Standardized +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/DFRAfterEffect.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/DFRAfterEffect.Converters.g.cs new file mode 100644 index 00000000000..d30cfdf396e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/DFRAfterEffect.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class DFRAfterEffectConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberB = System.Text.Json.JsonEncodedText.Encode("b"); + private static readonly System.Text.Json.JsonEncodedText MemberL = System.Text.Json.JsonEncodedText.Encode("l"); + private static readonly System.Text.Json.JsonEncodedText MemberNo = System.Text.Json.JsonEncodedText.Encode("no"); + + public override Elastic.Clients.Elasticsearch.DFRAfterEffect Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberB)) + { + return Elastic.Clients.Elasticsearch.DFRAfterEffect.B; + } + + if (reader.ValueTextEquals(MemberL)) + { + return Elastic.Clients.Elasticsearch.DFRAfterEffect.L; + } + + if (reader.ValueTextEquals(MemberNo)) + { + return Elastic.Clients.Elasticsearch.DFRAfterEffect.No; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberB.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.DFRAfterEffect.B; + } + + if (string.Equals(value, MemberL.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.DFRAfterEffect.L; + } + + if (string.Equals(value, MemberNo.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.DFRAfterEffect.No; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.DFRAfterEffect)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DFRAfterEffect value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.DFRAfterEffect.B: + writer.WriteStringValue(MemberB); + break; + case Elastic.Clients.Elasticsearch.DFRAfterEffect.L: + writer.WriteStringValue(MemberL); + break; + case Elastic.Clients.Elasticsearch.DFRAfterEffect.No: + writer.WriteStringValue(MemberNo); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.DFRAfterEffect)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.DFRAfterEffect ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DFRAfterEffect value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/DFRAfterEffect.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/DFRAfterEffect.g.cs new file mode 100644 index 00000000000..59861bc846b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/DFRAfterEffect.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.DFRAfterEffectConverter))] +public enum DFRAfterEffect +{ + [System.Runtime.Serialization.EnumMember(Value = "b")] + B, + [System.Runtime.Serialization.EnumMember(Value = "l")] + L, + [System.Runtime.Serialization.EnumMember(Value = "no")] + No +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/DFRBasicModel.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/DFRBasicModel.Converters.g.cs new file mode 100644 index 00000000000..3a972897922 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/DFRBasicModel.Converters.g.cs @@ -0,0 +1,151 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class DFRBasicModelConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberBe = System.Text.Json.JsonEncodedText.Encode("be"); + private static readonly System.Text.Json.JsonEncodedText MemberD = System.Text.Json.JsonEncodedText.Encode("d"); + private static readonly System.Text.Json.JsonEncodedText MemberG = System.Text.Json.JsonEncodedText.Encode("g"); + private static readonly System.Text.Json.JsonEncodedText MemberIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText MemberIn = System.Text.Json.JsonEncodedText.Encode("in"); + private static readonly System.Text.Json.JsonEncodedText MemberIne = System.Text.Json.JsonEncodedText.Encode("ine"); + private static readonly System.Text.Json.JsonEncodedText MemberP = System.Text.Json.JsonEncodedText.Encode("p"); + + public override Elastic.Clients.Elasticsearch.DFRBasicModel Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberBe)) + { + return Elastic.Clients.Elasticsearch.DFRBasicModel.Be; + } + + if (reader.ValueTextEquals(MemberD)) + { + return Elastic.Clients.Elasticsearch.DFRBasicModel.D; + } + + if (reader.ValueTextEquals(MemberG)) + { + return Elastic.Clients.Elasticsearch.DFRBasicModel.G; + } + + if (reader.ValueTextEquals(MemberIf)) + { + return Elastic.Clients.Elasticsearch.DFRBasicModel.If; + } + + if (reader.ValueTextEquals(MemberIn)) + { + return Elastic.Clients.Elasticsearch.DFRBasicModel.In; + } + + if (reader.ValueTextEquals(MemberIne)) + { + return Elastic.Clients.Elasticsearch.DFRBasicModel.Ine; + } + + if (reader.ValueTextEquals(MemberP)) + { + return Elastic.Clients.Elasticsearch.DFRBasicModel.P; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberBe.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.DFRBasicModel.Be; + } + + if (string.Equals(value, MemberD.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.DFRBasicModel.D; + } + + if (string.Equals(value, MemberG.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.DFRBasicModel.G; + } + + if (string.Equals(value, MemberIf.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.DFRBasicModel.If; + } + + if (string.Equals(value, MemberIn.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.DFRBasicModel.In; + } + + if (string.Equals(value, MemberIne.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.DFRBasicModel.Ine; + } + + if (string.Equals(value, MemberP.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.DFRBasicModel.P; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.DFRBasicModel)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DFRBasicModel value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.DFRBasicModel.Be: + writer.WriteStringValue(MemberBe); + break; + case Elastic.Clients.Elasticsearch.DFRBasicModel.D: + writer.WriteStringValue(MemberD); + break; + case Elastic.Clients.Elasticsearch.DFRBasicModel.G: + writer.WriteStringValue(MemberG); + break; + case Elastic.Clients.Elasticsearch.DFRBasicModel.If: + writer.WriteStringValue(MemberIf); + break; + case Elastic.Clients.Elasticsearch.DFRBasicModel.In: + writer.WriteStringValue(MemberIn); + break; + case Elastic.Clients.Elasticsearch.DFRBasicModel.Ine: + writer.WriteStringValue(MemberIne); + break; + case Elastic.Clients.Elasticsearch.DFRBasicModel.P: + writer.WriteStringValue(MemberP); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.DFRBasicModel)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.DFRBasicModel ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DFRBasicModel value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/DFRBasicModel.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/DFRBasicModel.g.cs new file mode 100644 index 00000000000..589a66c70c1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/DFRBasicModel.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.DFRBasicModelConverter))] +public enum DFRBasicModel +{ + [System.Runtime.Serialization.EnumMember(Value = "be")] + Be, + [System.Runtime.Serialization.EnumMember(Value = "d")] + D, + [System.Runtime.Serialization.EnumMember(Value = "g")] + G, + [System.Runtime.Serialization.EnumMember(Value = "if")] + If, + [System.Runtime.Serialization.EnumMember(Value = "in")] + In, + [System.Runtime.Serialization.EnumMember(Value = "ine")] + Ine, + [System.Runtime.Serialization.EnumMember(Value = "p")] + P +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/DanglingIndices/DanglingIndex.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/DanglingIndices/DanglingIndex.Converters.g.cs new file mode 100644 index 00000000000..50b675466da --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/DanglingIndices/DanglingIndex.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.DanglingIndices.Json; + +public sealed partial class DanglingIndexConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCreationDateMillis = System.Text.Json.JsonEncodedText.Encode("creation_date_millis"); + private static readonly System.Text.Json.JsonEncodedText PropIndexName = System.Text.Json.JsonEncodedText.Encode("index_name"); + private static readonly System.Text.Json.JsonEncodedText PropIndexUuid = System.Text.Json.JsonEncodedText.Encode("index_uuid"); + private static readonly System.Text.Json.JsonEncodedText PropNodeIds = System.Text.Json.JsonEncodedText.Encode("node_ids"); + + public override Elastic.Clients.Elasticsearch.DanglingIndices.DanglingIndex Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCreationDateMillis = default; + LocalJsonValue propIndexName = default; + LocalJsonValue propIndexUuid = default; + LocalJsonValue> propNodeIds = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCreationDateMillis.TryReadProperty(ref reader, options, PropCreationDateMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propIndexName.TryReadProperty(ref reader, options, PropIndexName, null)) + { + continue; + } + + if (propIndexUuid.TryReadProperty(ref reader, options, PropIndexUuid, null)) + { + continue; + } + + if (propNodeIds.TryReadProperty(ref reader, options, PropNodeIds, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.DanglingIndices.DanglingIndex(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CreationDateMillis = propCreationDateMillis.Value, + IndexName = propIndexName.Value, + IndexUuid = propIndexUuid.Value, + NodeIds = propNodeIds.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DanglingIndices.DanglingIndex value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCreationDateMillis, value.CreationDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropIndexName, value.IndexName, null, null); + writer.WriteProperty(options, PropIndexUuid, value.IndexUuid, null, null); + writer.WriteProperty(options, PropNodeIds, value.NodeIds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/DanglingIndices/DanglingIndex.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/DanglingIndices/DanglingIndex.g.cs index 3ed6a6523b0..2ec33a5dde2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/DanglingIndices/DanglingIndex.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/DanglingIndices/DanglingIndex.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.DanglingIndices; -internal sealed partial class DanglingIndexConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCreationDateMillis = System.Text.Json.JsonEncodedText.Encode("creation_date_millis"); - private static readonly System.Text.Json.JsonEncodedText PropIndexName = System.Text.Json.JsonEncodedText.Encode("index_name"); - private static readonly System.Text.Json.JsonEncodedText PropIndexUuid = System.Text.Json.JsonEncodedText.Encode("index_uuid"); - private static readonly System.Text.Json.JsonEncodedText PropNodeIds = System.Text.Json.JsonEncodedText.Encode("node_ids"); - - public override Elastic.Clients.Elasticsearch.DanglingIndices.DanglingIndex Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCreationDateMillis = default; - LocalJsonValue propIndexName = default; - LocalJsonValue propIndexUuid = default; - LocalJsonValue> propNodeIds = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCreationDateMillis.TryReadProperty(ref reader, options, PropCreationDateMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propIndexName.TryReadProperty(ref reader, options, PropIndexName, null)) - { - continue; - } - - if (propIndexUuid.TryReadProperty(ref reader, options, PropIndexUuid, null)) - { - continue; - } - - if (propNodeIds.TryReadProperty(ref reader, options, PropNodeIds, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.DanglingIndices.DanglingIndex(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CreationDateMillis = propCreationDateMillis.Value, - IndexName = propIndexName.Value, - IndexUuid = propIndexUuid.Value, - NodeIds = propNodeIds.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DanglingIndices.DanglingIndex value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCreationDateMillis, value.CreationDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropIndexName, value.IndexName, null, null); - writer.WriteProperty(options, PropIndexUuid, value.IndexUuid, null, null); - writer.WriteProperty(options, PropNodeIds, value.NodeIds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.DanglingIndices.DanglingIndexConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.DanglingIndices.Json.DanglingIndexConverter))] public sealed partial class DanglingIndex { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/DistanceUnit.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/DistanceUnit.Converters.g.cs new file mode 100644 index 00000000000..7a55d2ed720 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/DistanceUnit.Converters.g.cs @@ -0,0 +1,179 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class DistanceUnitConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCentimeters = System.Text.Json.JsonEncodedText.Encode("cm"); + private static readonly System.Text.Json.JsonEncodedText MemberFeet = System.Text.Json.JsonEncodedText.Encode("ft"); + private static readonly System.Text.Json.JsonEncodedText MemberInches = System.Text.Json.JsonEncodedText.Encode("in"); + private static readonly System.Text.Json.JsonEncodedText MemberKilometers = System.Text.Json.JsonEncodedText.Encode("km"); + private static readonly System.Text.Json.JsonEncodedText MemberMeters = System.Text.Json.JsonEncodedText.Encode("m"); + private static readonly System.Text.Json.JsonEncodedText MemberMiles = System.Text.Json.JsonEncodedText.Encode("mi"); + private static readonly System.Text.Json.JsonEncodedText MemberMillimeters = System.Text.Json.JsonEncodedText.Encode("mm"); + private static readonly System.Text.Json.JsonEncodedText MemberNauticMiles = System.Text.Json.JsonEncodedText.Encode("nmi"); + private static readonly System.Text.Json.JsonEncodedText MemberYards = System.Text.Json.JsonEncodedText.Encode("yd"); + + public override Elastic.Clients.Elasticsearch.DistanceUnit Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCentimeters)) + { + return Elastic.Clients.Elasticsearch.DistanceUnit.Centimeters; + } + + if (reader.ValueTextEquals(MemberFeet)) + { + return Elastic.Clients.Elasticsearch.DistanceUnit.Feet; + } + + if (reader.ValueTextEquals(MemberInches)) + { + return Elastic.Clients.Elasticsearch.DistanceUnit.Inches; + } + + if (reader.ValueTextEquals(MemberKilometers)) + { + return Elastic.Clients.Elasticsearch.DistanceUnit.Kilometers; + } + + if (reader.ValueTextEquals(MemberMeters)) + { + return Elastic.Clients.Elasticsearch.DistanceUnit.Meters; + } + + if (reader.ValueTextEquals(MemberMiles)) + { + return Elastic.Clients.Elasticsearch.DistanceUnit.Miles; + } + + if (reader.ValueTextEquals(MemberMillimeters)) + { + return Elastic.Clients.Elasticsearch.DistanceUnit.Millimeters; + } + + if (reader.ValueTextEquals(MemberNauticMiles)) + { + return Elastic.Clients.Elasticsearch.DistanceUnit.NauticMiles; + } + + if (reader.ValueTextEquals(MemberYards)) + { + return Elastic.Clients.Elasticsearch.DistanceUnit.Yards; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCentimeters.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.DistanceUnit.Centimeters; + } + + if (string.Equals(value, MemberFeet.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.DistanceUnit.Feet; + } + + if (string.Equals(value, MemberInches.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.DistanceUnit.Inches; + } + + if (string.Equals(value, MemberKilometers.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.DistanceUnit.Kilometers; + } + + if (string.Equals(value, MemberMeters.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.DistanceUnit.Meters; + } + + if (string.Equals(value, MemberMiles.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.DistanceUnit.Miles; + } + + if (string.Equals(value, MemberMillimeters.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.DistanceUnit.Millimeters; + } + + if (string.Equals(value, MemberNauticMiles.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.DistanceUnit.NauticMiles; + } + + if (string.Equals(value, MemberYards.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.DistanceUnit.Yards; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.DistanceUnit)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DistanceUnit value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.DistanceUnit.Centimeters: + writer.WriteStringValue(MemberCentimeters); + break; + case Elastic.Clients.Elasticsearch.DistanceUnit.Feet: + writer.WriteStringValue(MemberFeet); + break; + case Elastic.Clients.Elasticsearch.DistanceUnit.Inches: + writer.WriteStringValue(MemberInches); + break; + case Elastic.Clients.Elasticsearch.DistanceUnit.Kilometers: + writer.WriteStringValue(MemberKilometers); + break; + case Elastic.Clients.Elasticsearch.DistanceUnit.Meters: + writer.WriteStringValue(MemberMeters); + break; + case Elastic.Clients.Elasticsearch.DistanceUnit.Miles: + writer.WriteStringValue(MemberMiles); + break; + case Elastic.Clients.Elasticsearch.DistanceUnit.Millimeters: + writer.WriteStringValue(MemberMillimeters); + break; + case Elastic.Clients.Elasticsearch.DistanceUnit.NauticMiles: + writer.WriteStringValue(MemberNauticMiles); + break; + case Elastic.Clients.Elasticsearch.DistanceUnit.Yards: + writer.WriteStringValue(MemberYards); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.DistanceUnit)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.DistanceUnit ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DistanceUnit value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/DistanceUnit.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/DistanceUnit.g.cs new file mode 100644 index 00000000000..cb4a9c1da81 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/DistanceUnit.g.cs @@ -0,0 +1,47 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.DistanceUnitConverter))] +public enum DistanceUnit +{ + [System.Runtime.Serialization.EnumMember(Value = "cm")] + Centimeters, + [System.Runtime.Serialization.EnumMember(Value = "ft")] + Feet, + [System.Runtime.Serialization.EnumMember(Value = "in")] + Inches, + [System.Runtime.Serialization.EnumMember(Value = "km")] + Kilometers, + [System.Runtime.Serialization.EnumMember(Value = "m")] + Meters, + [System.Runtime.Serialization.EnumMember(Value = "mi")] + Miles, + [System.Runtime.Serialization.EnumMember(Value = "mm")] + Millimeters, + [System.Runtime.Serialization.EnumMember(Value = "nmi")] + NauticMiles, + [System.Runtime.Serialization.EnumMember(Value = "yd")] + Yards +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/DocStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/DocStats.Converters.g.cs new file mode 100644 index 00000000000..7dad0261f9f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/DocStats.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class DocStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropDeleted = System.Text.Json.JsonEncodedText.Encode("deleted"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSize = System.Text.Json.JsonEncodedText.Encode("total_size"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSizeInBytes = System.Text.Json.JsonEncodedText.Encode("total_size_in_bytes"); + + public override Elastic.Clients.Elasticsearch.DocStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propDeleted = default; + LocalJsonValue propTotalSize = default; + LocalJsonValue propTotalSizeInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propDeleted.TryReadProperty(ref reader, options, PropDeleted, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotalSize.TryReadProperty(ref reader, options, PropTotalSize, null)) + { + continue; + } + + if (propTotalSizeInBytes.TryReadProperty(ref reader, options, PropTotalSizeInBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.DocStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Deleted = propDeleted.Value, + TotalSize = propTotalSize.Value, + TotalSizeInBytes = propTotalSizeInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DocStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropDeleted, value.Deleted, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotalSize, value.TotalSize, null, null); + writer.WriteProperty(options, PropTotalSizeInBytes, value.TotalSizeInBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/DocStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/DocStats.g.cs index 62ba1ccd009..68fe8a1a3dc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/DocStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/DocStats.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class DocStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropDeleted = System.Text.Json.JsonEncodedText.Encode("deleted"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSize = System.Text.Json.JsonEncodedText.Encode("total_size"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSizeInBytes = System.Text.Json.JsonEncodedText.Encode("total_size_in_bytes"); - - public override Elastic.Clients.Elasticsearch.DocStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propDeleted = default; - LocalJsonValue propTotalSize = default; - LocalJsonValue propTotalSizeInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propDeleted.TryReadProperty(ref reader, options, PropDeleted, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotalSize.TryReadProperty(ref reader, options, PropTotalSize, null)) - { - continue; - } - - if (propTotalSizeInBytes.TryReadProperty(ref reader, options, PropTotalSizeInBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.DocStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Deleted = propDeleted.Value, - TotalSize = propTotalSize.Value, - TotalSizeInBytes = propTotalSizeInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DocStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropDeleted, value.Deleted, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotalSize, value.TotalSize, null, null); - writer.WriteProperty(options, PropTotalSizeInBytes, value.TotalSizeInBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.DocStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.DocStatsConverter))] public sealed partial class DocStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ElasticsearchVersionInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ElasticsearchVersionInfo.Converters.g.cs new file mode 100644 index 00000000000..6ebe4dd705e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ElasticsearchVersionInfo.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ElasticsearchVersionInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuildDate = System.Text.Json.JsonEncodedText.Encode("build_date"); + private static readonly System.Text.Json.JsonEncodedText PropBuildFlavor = System.Text.Json.JsonEncodedText.Encode("build_flavor"); + private static readonly System.Text.Json.JsonEncodedText PropBuildHash = System.Text.Json.JsonEncodedText.Encode("build_hash"); + private static readonly System.Text.Json.JsonEncodedText PropBuildSnapshot = System.Text.Json.JsonEncodedText.Encode("build_snapshot"); + private static readonly System.Text.Json.JsonEncodedText PropBuildType = System.Text.Json.JsonEncodedText.Encode("build_type"); + private static readonly System.Text.Json.JsonEncodedText PropLuceneVersion = System.Text.Json.JsonEncodedText.Encode("lucene_version"); + private static readonly System.Text.Json.JsonEncodedText PropMinimumIndexCompatibilityVersion = System.Text.Json.JsonEncodedText.Encode("minimum_index_compatibility_version"); + private static readonly System.Text.Json.JsonEncodedText PropMinimumWireCompatibilityVersion = System.Text.Json.JsonEncodedText.Encode("minimum_wire_compatibility_version"); + private static readonly System.Text.Json.JsonEncodedText PropNumber = System.Text.Json.JsonEncodedText.Encode("number"); + + public override Elastic.Clients.Elasticsearch.ElasticsearchVersionInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBuildDate = default; + LocalJsonValue propBuildFlavor = default; + LocalJsonValue propBuildHash = default; + LocalJsonValue propBuildSnapshot = default; + LocalJsonValue propBuildType = default; + LocalJsonValue propLuceneVersion = default; + LocalJsonValue propMinimumIndexCompatibilityVersion = default; + LocalJsonValue propMinimumWireCompatibilityVersion = default; + LocalJsonValue propNumber = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuildDate.TryReadProperty(ref reader, options, PropBuildDate, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propBuildFlavor.TryReadProperty(ref reader, options, PropBuildFlavor, null)) + { + continue; + } + + if (propBuildHash.TryReadProperty(ref reader, options, PropBuildHash, null)) + { + continue; + } + + if (propBuildSnapshot.TryReadProperty(ref reader, options, PropBuildSnapshot, null)) + { + continue; + } + + if (propBuildType.TryReadProperty(ref reader, options, PropBuildType, null)) + { + continue; + } + + if (propLuceneVersion.TryReadProperty(ref reader, options, PropLuceneVersion, null)) + { + continue; + } + + if (propMinimumIndexCompatibilityVersion.TryReadProperty(ref reader, options, PropMinimumIndexCompatibilityVersion, null)) + { + continue; + } + + if (propMinimumWireCompatibilityVersion.TryReadProperty(ref reader, options, PropMinimumWireCompatibilityVersion, null)) + { + continue; + } + + if (propNumber.TryReadProperty(ref reader, options, PropNumber, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ElasticsearchVersionInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BuildDate = propBuildDate.Value, + BuildFlavor = propBuildFlavor.Value, + BuildHash = propBuildHash.Value, + BuildSnapshot = propBuildSnapshot.Value, + BuildType = propBuildType.Value, + LuceneVersion = propLuceneVersion.Value, + MinimumIndexCompatibilityVersion = propMinimumIndexCompatibilityVersion.Value, + MinimumWireCompatibilityVersion = propMinimumWireCompatibilityVersion.Value, + Number = propNumber.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ElasticsearchVersionInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuildDate, value.BuildDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropBuildFlavor, value.BuildFlavor, null, null); + writer.WriteProperty(options, PropBuildHash, value.BuildHash, null, null); + writer.WriteProperty(options, PropBuildSnapshot, value.BuildSnapshot, null, null); + writer.WriteProperty(options, PropBuildType, value.BuildType, null, null); + writer.WriteProperty(options, PropLuceneVersion, value.LuceneVersion, null, null); + writer.WriteProperty(options, PropMinimumIndexCompatibilityVersion, value.MinimumIndexCompatibilityVersion, null, null); + writer.WriteProperty(options, PropMinimumWireCompatibilityVersion, value.MinimumWireCompatibilityVersion, null, null); + writer.WriteProperty(options, PropNumber, value.Number, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ElasticsearchVersionInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ElasticsearchVersionInfo.g.cs index 8cf6d5da5fa..21a69b928f4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ElasticsearchVersionInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ElasticsearchVersionInfo.g.cs @@ -23,118 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class ElasticsearchVersionInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuildDate = System.Text.Json.JsonEncodedText.Encode("build_date"); - private static readonly System.Text.Json.JsonEncodedText PropBuildFlavor = System.Text.Json.JsonEncodedText.Encode("build_flavor"); - private static readonly System.Text.Json.JsonEncodedText PropBuildHash = System.Text.Json.JsonEncodedText.Encode("build_hash"); - private static readonly System.Text.Json.JsonEncodedText PropBuildSnapshot = System.Text.Json.JsonEncodedText.Encode("build_snapshot"); - private static readonly System.Text.Json.JsonEncodedText PropBuildType = System.Text.Json.JsonEncodedText.Encode("build_type"); - private static readonly System.Text.Json.JsonEncodedText PropLuceneVersion = System.Text.Json.JsonEncodedText.Encode("lucene_version"); - private static readonly System.Text.Json.JsonEncodedText PropMinimumIndexCompatibilityVersion = System.Text.Json.JsonEncodedText.Encode("minimum_index_compatibility_version"); - private static readonly System.Text.Json.JsonEncodedText PropMinimumWireCompatibilityVersion = System.Text.Json.JsonEncodedText.Encode("minimum_wire_compatibility_version"); - private static readonly System.Text.Json.JsonEncodedText PropNumber = System.Text.Json.JsonEncodedText.Encode("number"); - - public override Elastic.Clients.Elasticsearch.ElasticsearchVersionInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBuildDate = default; - LocalJsonValue propBuildFlavor = default; - LocalJsonValue propBuildHash = default; - LocalJsonValue propBuildSnapshot = default; - LocalJsonValue propBuildType = default; - LocalJsonValue propLuceneVersion = default; - LocalJsonValue propMinimumIndexCompatibilityVersion = default; - LocalJsonValue propMinimumWireCompatibilityVersion = default; - LocalJsonValue propNumber = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuildDate.TryReadProperty(ref reader, options, PropBuildDate, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propBuildFlavor.TryReadProperty(ref reader, options, PropBuildFlavor, null)) - { - continue; - } - - if (propBuildHash.TryReadProperty(ref reader, options, PropBuildHash, null)) - { - continue; - } - - if (propBuildSnapshot.TryReadProperty(ref reader, options, PropBuildSnapshot, null)) - { - continue; - } - - if (propBuildType.TryReadProperty(ref reader, options, PropBuildType, null)) - { - continue; - } - - if (propLuceneVersion.TryReadProperty(ref reader, options, PropLuceneVersion, null)) - { - continue; - } - - if (propMinimumIndexCompatibilityVersion.TryReadProperty(ref reader, options, PropMinimumIndexCompatibilityVersion, null)) - { - continue; - } - - if (propMinimumWireCompatibilityVersion.TryReadProperty(ref reader, options, PropMinimumWireCompatibilityVersion, null)) - { - continue; - } - - if (propNumber.TryReadProperty(ref reader, options, PropNumber, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ElasticsearchVersionInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BuildDate = propBuildDate.Value, - BuildFlavor = propBuildFlavor.Value, - BuildHash = propBuildHash.Value, - BuildSnapshot = propBuildSnapshot.Value, - BuildType = propBuildType.Value, - LuceneVersion = propLuceneVersion.Value, - MinimumIndexCompatibilityVersion = propMinimumIndexCompatibilityVersion.Value, - MinimumWireCompatibilityVersion = propMinimumWireCompatibilityVersion.Value, - Number = propNumber.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ElasticsearchVersionInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuildDate, value.BuildDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropBuildFlavor, value.BuildFlavor, null, null); - writer.WriteProperty(options, PropBuildHash, value.BuildHash, null, null); - writer.WriteProperty(options, PropBuildSnapshot, value.BuildSnapshot, null, null); - writer.WriteProperty(options, PropBuildType, value.BuildType, null, null); - writer.WriteProperty(options, PropLuceneVersion, value.LuceneVersion, null, null); - writer.WriteProperty(options, PropMinimumIndexCompatibilityVersion, value.MinimumIndexCompatibilityVersion, null, null); - writer.WriteProperty(options, PropMinimumWireCompatibilityVersion, value.MinimumWireCompatibilityVersion, null, null); - writer.WriteProperty(options, PropNumber, value.Number, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ElasticsearchVersionInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ElasticsearchVersionInfoConverter))] public sealed partial class ElasticsearchVersionInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ElasticsearchVersionMinInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ElasticsearchVersionMinInfo.Converters.g.cs new file mode 100644 index 00000000000..c63698d8b76 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ElasticsearchVersionMinInfo.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ElasticsearchVersionMinInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuildFlavor = System.Text.Json.JsonEncodedText.Encode("build_flavor"); + private static readonly System.Text.Json.JsonEncodedText PropMinimumIndexCompatibilityVersion = System.Text.Json.JsonEncodedText.Encode("minimum_index_compatibility_version"); + private static readonly System.Text.Json.JsonEncodedText PropMinimumWireCompatibilityVersion = System.Text.Json.JsonEncodedText.Encode("minimum_wire_compatibility_version"); + private static readonly System.Text.Json.JsonEncodedText PropNumber = System.Text.Json.JsonEncodedText.Encode("number"); + + public override Elastic.Clients.Elasticsearch.ElasticsearchVersionMinInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBuildFlavor = default; + LocalJsonValue propMinimumIndexCompatibilityVersion = default; + LocalJsonValue propMinimumWireCompatibilityVersion = default; + LocalJsonValue propNumber = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuildFlavor.TryReadProperty(ref reader, options, PropBuildFlavor, null)) + { + continue; + } + + if (propMinimumIndexCompatibilityVersion.TryReadProperty(ref reader, options, PropMinimumIndexCompatibilityVersion, null)) + { + continue; + } + + if (propMinimumWireCompatibilityVersion.TryReadProperty(ref reader, options, PropMinimumWireCompatibilityVersion, null)) + { + continue; + } + + if (propNumber.TryReadProperty(ref reader, options, PropNumber, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ElasticsearchVersionMinInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BuildFlavor = propBuildFlavor.Value, + MinimumIndexCompatibilityVersion = propMinimumIndexCompatibilityVersion.Value, + MinimumWireCompatibilityVersion = propMinimumWireCompatibilityVersion.Value, + Number = propNumber.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ElasticsearchVersionMinInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuildFlavor, value.BuildFlavor, null, null); + writer.WriteProperty(options, PropMinimumIndexCompatibilityVersion, value.MinimumIndexCompatibilityVersion, null, null); + writer.WriteProperty(options, PropMinimumWireCompatibilityVersion, value.MinimumWireCompatibilityVersion, null, null); + writer.WriteProperty(options, PropNumber, value.Number, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ElasticsearchVersionMinInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ElasticsearchVersionMinInfo.g.cs index d820a3ab25c..df05295a901 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ElasticsearchVersionMinInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ElasticsearchVersionMinInfo.g.cs @@ -23,78 +23,12 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class ElasticsearchVersionMinInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuildFlavor = System.Text.Json.JsonEncodedText.Encode("build_flavor"); - private static readonly System.Text.Json.JsonEncodedText PropMinimumIndexCompatibilityVersion = System.Text.Json.JsonEncodedText.Encode("minimum_index_compatibility_version"); - private static readonly System.Text.Json.JsonEncodedText PropMinimumWireCompatibilityVersion = System.Text.Json.JsonEncodedText.Encode("minimum_wire_compatibility_version"); - private static readonly System.Text.Json.JsonEncodedText PropNumber = System.Text.Json.JsonEncodedText.Encode("number"); - - public override Elastic.Clients.Elasticsearch.ElasticsearchVersionMinInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBuildFlavor = default; - LocalJsonValue propMinimumIndexCompatibilityVersion = default; - LocalJsonValue propMinimumWireCompatibilityVersion = default; - LocalJsonValue propNumber = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuildFlavor.TryReadProperty(ref reader, options, PropBuildFlavor, null)) - { - continue; - } - - if (propMinimumIndexCompatibilityVersion.TryReadProperty(ref reader, options, PropMinimumIndexCompatibilityVersion, null)) - { - continue; - } - - if (propMinimumWireCompatibilityVersion.TryReadProperty(ref reader, options, PropMinimumWireCompatibilityVersion, null)) - { - continue; - } - - if (propNumber.TryReadProperty(ref reader, options, PropNumber, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ElasticsearchVersionMinInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BuildFlavor = propBuildFlavor.Value, - MinimumIndexCompatibilityVersion = propMinimumIndexCompatibilityVersion.Value, - MinimumWireCompatibilityVersion = propMinimumWireCompatibilityVersion.Value, - Number = propNumber.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ElasticsearchVersionMinInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuildFlavor, value.BuildFlavor, null, null); - writer.WriteProperty(options, PropMinimumIndexCompatibilityVersion, value.MinimumIndexCompatibilityVersion, null, null); - writer.WriteProperty(options, PropMinimumWireCompatibilityVersion, value.MinimumWireCompatibilityVersion, null, null); - writer.WriteProperty(options, PropNumber, value.Number, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Reduced (minimal) info ElasticsearchVersion /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ElasticsearchVersionMinInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ElasticsearchVersionMinInfoConverter))] public sealed partial class ElasticsearchVersionMinInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/EmptyObject.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/EmptyObject.Converters.g.cs new file mode 100644 index 00000000000..e3aced61f32 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/EmptyObject.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class EmptyObjectConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.EmptyObject Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.EmptyObject(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.EmptyObject value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/EmptyObject.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/EmptyObject.g.cs index 6ad06f31a55..905ead0e933 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/EmptyObject.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/EmptyObject.g.cs @@ -23,41 +23,12 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class EmptyObjectConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.EmptyObject Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.EmptyObject(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.EmptyObject value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - /// /// /// For empty Class assignments /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.EmptyObjectConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.EmptyObjectConverter))] public sealed partial class EmptyObject { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/CacheStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/CacheStats.Converters.g.cs new file mode 100644 index 00000000000..023da869b22 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/CacheStats.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Enrich.Json; + +public sealed partial class CacheStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropEvictions = System.Text.Json.JsonEncodedText.Encode("evictions"); + private static readonly System.Text.Json.JsonEncodedText PropHits = System.Text.Json.JsonEncodedText.Encode("hits"); + private static readonly System.Text.Json.JsonEncodedText PropHitsTimeInMillis = System.Text.Json.JsonEncodedText.Encode("hits_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropMisses = System.Text.Json.JsonEncodedText.Encode("misses"); + private static readonly System.Text.Json.JsonEncodedText PropMissesTimeInMillis = System.Text.Json.JsonEncodedText.Encode("misses_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropNodeId = System.Text.Json.JsonEncodedText.Encode("node_id"); + private static readonly System.Text.Json.JsonEncodedText PropSizeInBytes = System.Text.Json.JsonEncodedText.Encode("size_in_bytes"); + + public override Elastic.Clients.Elasticsearch.Enrich.CacheStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propEvictions = default; + LocalJsonValue propHits = default; + LocalJsonValue propHitsTimeInMillis = default; + LocalJsonValue propMisses = default; + LocalJsonValue propMissesTimeInMillis = default; + LocalJsonValue propNodeId = default; + LocalJsonValue propSizeInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propEvictions.TryReadProperty(ref reader, options, PropEvictions, null)) + { + continue; + } + + if (propHits.TryReadProperty(ref reader, options, PropHits, null)) + { + continue; + } + + if (propHitsTimeInMillis.TryReadProperty(ref reader, options, PropHitsTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propMisses.TryReadProperty(ref reader, options, PropMisses, null)) + { + continue; + } + + if (propMissesTimeInMillis.TryReadProperty(ref reader, options, PropMissesTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propNodeId.TryReadProperty(ref reader, options, PropNodeId, null)) + { + continue; + } + + if (propSizeInBytes.TryReadProperty(ref reader, options, PropSizeInBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Enrich.CacheStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Evictions = propEvictions.Value, + Hits = propHits.Value, + HitsTimeInMillis = propHitsTimeInMillis.Value, + Misses = propMisses.Value, + MissesTimeInMillis = propMissesTimeInMillis.Value, + NodeId = propNodeId.Value, + SizeInBytes = propSizeInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.CacheStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropEvictions, value.Evictions, null, null); + writer.WriteProperty(options, PropHits, value.Hits, null, null); + writer.WriteProperty(options, PropHitsTimeInMillis, value.HitsTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropMisses, value.Misses, null, null); + writer.WriteProperty(options, PropMissesTimeInMillis, value.MissesTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropNodeId, value.NodeId, null, null); + writer.WriteProperty(options, PropSizeInBytes, value.SizeInBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/CacheStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/CacheStats.g.cs index 18a9eb2a3c3..6df90faaf1d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/CacheStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/CacheStats.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Enrich; -internal sealed partial class CacheStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropEvictions = System.Text.Json.JsonEncodedText.Encode("evictions"); - private static readonly System.Text.Json.JsonEncodedText PropHits = System.Text.Json.JsonEncodedText.Encode("hits"); - private static readonly System.Text.Json.JsonEncodedText PropHitsTimeInMillis = System.Text.Json.JsonEncodedText.Encode("hits_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropMisses = System.Text.Json.JsonEncodedText.Encode("misses"); - private static readonly System.Text.Json.JsonEncodedText PropMissesTimeInMillis = System.Text.Json.JsonEncodedText.Encode("misses_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropNodeId = System.Text.Json.JsonEncodedText.Encode("node_id"); - private static readonly System.Text.Json.JsonEncodedText PropSizeInBytes = System.Text.Json.JsonEncodedText.Encode("size_in_bytes"); - - public override Elastic.Clients.Elasticsearch.Enrich.CacheStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propEvictions = default; - LocalJsonValue propHits = default; - LocalJsonValue propHitsTimeInMillis = default; - LocalJsonValue propMisses = default; - LocalJsonValue propMissesTimeInMillis = default; - LocalJsonValue propNodeId = default; - LocalJsonValue propSizeInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propEvictions.TryReadProperty(ref reader, options, PropEvictions, null)) - { - continue; - } - - if (propHits.TryReadProperty(ref reader, options, PropHits, null)) - { - continue; - } - - if (propHitsTimeInMillis.TryReadProperty(ref reader, options, PropHitsTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propMisses.TryReadProperty(ref reader, options, PropMisses, null)) - { - continue; - } - - if (propMissesTimeInMillis.TryReadProperty(ref reader, options, PropMissesTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propNodeId.TryReadProperty(ref reader, options, PropNodeId, null)) - { - continue; - } - - if (propSizeInBytes.TryReadProperty(ref reader, options, PropSizeInBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Enrich.CacheStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Evictions = propEvictions.Value, - Hits = propHits.Value, - HitsTimeInMillis = propHitsTimeInMillis.Value, - Misses = propMisses.Value, - MissesTimeInMillis = propMissesTimeInMillis.Value, - NodeId = propNodeId.Value, - SizeInBytes = propSizeInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.CacheStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropEvictions, value.Evictions, null, null); - writer.WriteProperty(options, PropHits, value.Hits, null, null); - writer.WriteProperty(options, PropHitsTimeInMillis, value.HitsTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropMisses, value.Misses, null, null); - writer.WriteProperty(options, PropMissesTimeInMillis, value.MissesTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropNodeId, value.NodeId, null, null); - writer.WriteProperty(options, PropSizeInBytes, value.SizeInBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.CacheStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.Json.CacheStatsConverter))] public sealed partial class CacheStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/CoordinatorStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/CoordinatorStats.Converters.g.cs new file mode 100644 index 00000000000..c03607c7c45 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/CoordinatorStats.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Enrich.Json; + +public sealed partial class CoordinatorStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExecutedSearchesTotal = System.Text.Json.JsonEncodedText.Encode("executed_searches_total"); + private static readonly System.Text.Json.JsonEncodedText PropNodeId = System.Text.Json.JsonEncodedText.Encode("node_id"); + private static readonly System.Text.Json.JsonEncodedText PropQueueSize = System.Text.Json.JsonEncodedText.Encode("queue_size"); + private static readonly System.Text.Json.JsonEncodedText PropRemoteRequestsCurrent = System.Text.Json.JsonEncodedText.Encode("remote_requests_current"); + private static readonly System.Text.Json.JsonEncodedText PropRemoteRequestsTotal = System.Text.Json.JsonEncodedText.Encode("remote_requests_total"); + + public override Elastic.Clients.Elasticsearch.Enrich.CoordinatorStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExecutedSearchesTotal = default; + LocalJsonValue propNodeId = default; + LocalJsonValue propQueueSize = default; + LocalJsonValue propRemoteRequestsCurrent = default; + LocalJsonValue propRemoteRequestsTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExecutedSearchesTotal.TryReadProperty(ref reader, options, PropExecutedSearchesTotal, null)) + { + continue; + } + + if (propNodeId.TryReadProperty(ref reader, options, PropNodeId, null)) + { + continue; + } + + if (propQueueSize.TryReadProperty(ref reader, options, PropQueueSize, null)) + { + continue; + } + + if (propRemoteRequestsCurrent.TryReadProperty(ref reader, options, PropRemoteRequestsCurrent, null)) + { + continue; + } + + if (propRemoteRequestsTotal.TryReadProperty(ref reader, options, PropRemoteRequestsTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Enrich.CoordinatorStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ExecutedSearchesTotal = propExecutedSearchesTotal.Value, + NodeId = propNodeId.Value, + QueueSize = propQueueSize.Value, + RemoteRequestsCurrent = propRemoteRequestsCurrent.Value, + RemoteRequestsTotal = propRemoteRequestsTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.CoordinatorStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExecutedSearchesTotal, value.ExecutedSearchesTotal, null, null); + writer.WriteProperty(options, PropNodeId, value.NodeId, null, null); + writer.WriteProperty(options, PropQueueSize, value.QueueSize, null, null); + writer.WriteProperty(options, PropRemoteRequestsCurrent, value.RemoteRequestsCurrent, null, null); + writer.WriteProperty(options, PropRemoteRequestsTotal, value.RemoteRequestsTotal, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/CoordinatorStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/CoordinatorStats.g.cs index b7c29c0aaaa..535fee59f80 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/CoordinatorStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/CoordinatorStats.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Enrich; -internal sealed partial class CoordinatorStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExecutedSearchesTotal = System.Text.Json.JsonEncodedText.Encode("executed_searches_total"); - private static readonly System.Text.Json.JsonEncodedText PropNodeId = System.Text.Json.JsonEncodedText.Encode("node_id"); - private static readonly System.Text.Json.JsonEncodedText PropQueueSize = System.Text.Json.JsonEncodedText.Encode("queue_size"); - private static readonly System.Text.Json.JsonEncodedText PropRemoteRequestsCurrent = System.Text.Json.JsonEncodedText.Encode("remote_requests_current"); - private static readonly System.Text.Json.JsonEncodedText PropRemoteRequestsTotal = System.Text.Json.JsonEncodedText.Encode("remote_requests_total"); - - public override Elastic.Clients.Elasticsearch.Enrich.CoordinatorStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propExecutedSearchesTotal = default; - LocalJsonValue propNodeId = default; - LocalJsonValue propQueueSize = default; - LocalJsonValue propRemoteRequestsCurrent = default; - LocalJsonValue propRemoteRequestsTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExecutedSearchesTotal.TryReadProperty(ref reader, options, PropExecutedSearchesTotal, null)) - { - continue; - } - - if (propNodeId.TryReadProperty(ref reader, options, PropNodeId, null)) - { - continue; - } - - if (propQueueSize.TryReadProperty(ref reader, options, PropQueueSize, null)) - { - continue; - } - - if (propRemoteRequestsCurrent.TryReadProperty(ref reader, options, PropRemoteRequestsCurrent, null)) - { - continue; - } - - if (propRemoteRequestsTotal.TryReadProperty(ref reader, options, PropRemoteRequestsTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Enrich.CoordinatorStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ExecutedSearchesTotal = propExecutedSearchesTotal.Value, - NodeId = propNodeId.Value, - QueueSize = propQueueSize.Value, - RemoteRequestsCurrent = propRemoteRequestsCurrent.Value, - RemoteRequestsTotal = propRemoteRequestsTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.CoordinatorStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExecutedSearchesTotal, value.ExecutedSearchesTotal, null, null); - writer.WriteProperty(options, PropNodeId, value.NodeId, null, null); - writer.WriteProperty(options, PropQueueSize, value.QueueSize, null, null); - writer.WriteProperty(options, PropRemoteRequestsCurrent, value.RemoteRequestsCurrent, null, null); - writer.WriteProperty(options, PropRemoteRequestsTotal, value.RemoteRequestsTotal, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.CoordinatorStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.Json.CoordinatorStatsConverter))] public sealed partial class CoordinatorStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichPolicy.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichPolicy.Converters.g.cs new file mode 100644 index 00000000000..a569076e08b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichPolicy.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Enrich.Json; + +public sealed partial class EnrichPolicyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropElasticsearchVersion = System.Text.Json.JsonEncodedText.Encode("elasticsearch_version"); + private static readonly System.Text.Json.JsonEncodedText PropEnrichFields = System.Text.Json.JsonEncodedText.Encode("enrich_fields"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropMatchField = System.Text.Json.JsonEncodedText.Encode("match_field"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + + public override Elastic.Clients.Elasticsearch.Enrich.EnrichPolicy Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propElasticsearchVersion = default; + LocalJsonValue propEnrichFields = default; + LocalJsonValue propIndices = default; + LocalJsonValue propMatchField = default; + LocalJsonValue propName = default; + LocalJsonValue propQuery = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propElasticsearchVersion.TryReadProperty(ref reader, options, PropElasticsearchVersion, null)) + { + continue; + } + + if (propEnrichFields.TryReadProperty(ref reader, options, PropEnrichFields, static Elastic.Clients.Elasticsearch.Fields (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) + { + continue; + } + + if (propMatchField.TryReadProperty(ref reader, options, PropMatchField, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Enrich.EnrichPolicy(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ElasticsearchVersion = propElasticsearchVersion.Value, + EnrichFields = propEnrichFields.Value, + Indices = propIndices.Value, + MatchField = propMatchField.Value, + Name = propName.Value, + Query = propQuery.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.EnrichPolicy value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropElasticsearchVersion, value.ElasticsearchVersion, null, null); + writer.WriteProperty(options, PropEnrichFields, value.EnrichFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropIndices, value.Indices, null, null); + writer.WriteProperty(options, PropMatchField, value.MatchField, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichPolicy.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichPolicy.g.cs index ad51d8e4fe3..df46164c9df 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichPolicy.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichPolicy.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Enrich; -internal sealed partial class EnrichPolicyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropElasticsearchVersion = System.Text.Json.JsonEncodedText.Encode("elasticsearch_version"); - private static readonly System.Text.Json.JsonEncodedText PropEnrichFields = System.Text.Json.JsonEncodedText.Encode("enrich_fields"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropMatchField = System.Text.Json.JsonEncodedText.Encode("match_field"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - - public override Elastic.Clients.Elasticsearch.Enrich.EnrichPolicy Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propElasticsearchVersion = default; - LocalJsonValue propEnrichFields = default; - LocalJsonValue propIndices = default; - LocalJsonValue propMatchField = default; - LocalJsonValue propName = default; - LocalJsonValue propQuery = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propElasticsearchVersion.TryReadProperty(ref reader, options, PropElasticsearchVersion, null)) - { - continue; - } - - if (propEnrichFields.TryReadProperty(ref reader, options, PropEnrichFields, static Elastic.Clients.Elasticsearch.Fields (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) - { - continue; - } - - if (propMatchField.TryReadProperty(ref reader, options, PropMatchField, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Enrich.EnrichPolicy(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ElasticsearchVersion = propElasticsearchVersion.Value, - EnrichFields = propEnrichFields.Value, - Indices = propIndices.Value, - MatchField = propMatchField.Value, - Name = propName.Value, - Query = propQuery.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.EnrichPolicy value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropElasticsearchVersion, value.ElasticsearchVersion, null, null); - writer.WriteProperty(options, PropEnrichFields, value.EnrichFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropIndices, value.Indices, null, null); - writer.WriteProperty(options, PropMatchField, value.MatchField, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.EnrichPolicyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.Json.EnrichPolicyConverter))] public sealed partial class EnrichPolicy { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Enrich.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichPolicyPhase.Converters.g.cs similarity index 56% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Enrich.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichPolicyPhase.Converters.g.cs index 7d0a0639f7a..8a9fba5508d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Enrich.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichPolicyPhase.Converters.g.cs @@ -21,9 +21,9 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.Enrich; +namespace Elastic.Clients.Elasticsearch.Enrich.Json; -internal sealed partial class EnrichPolicyPhaseConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class EnrichPolicyPhaseConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText MemberCancelled = System.Text.Json.JsonEncodedText.Encode("CANCELLED"); private static readonly System.Text.Json.JsonEncodedText MemberComplete = System.Text.Json.JsonEncodedText.Encode("COMPLETE"); @@ -120,101 +120,4 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, { Write(writer, value, options); } -} - -internal sealed partial class PolicyTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberGeoMatch = System.Text.Json.JsonEncodedText.Encode("geo_match"); - private static readonly System.Text.Json.JsonEncodedText MemberMatch = System.Text.Json.JsonEncodedText.Encode("match"); - private static readonly System.Text.Json.JsonEncodedText MemberRange = System.Text.Json.JsonEncodedText.Encode("range"); - - public override Elastic.Clients.Elasticsearch.Enrich.PolicyType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberGeoMatch)) - { - return Elastic.Clients.Elasticsearch.Enrich.PolicyType.GeoMatch; - } - - if (reader.ValueTextEquals(MemberMatch)) - { - return Elastic.Clients.Elasticsearch.Enrich.PolicyType.Match; - } - - if (reader.ValueTextEquals(MemberRange)) - { - return Elastic.Clients.Elasticsearch.Enrich.PolicyType.Range; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberGeoMatch.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Enrich.PolicyType.GeoMatch; - } - - if (string.Equals(value, MemberMatch.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Enrich.PolicyType.Match; - } - - if (string.Equals(value, MemberRange.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Enrich.PolicyType.Range; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Enrich.PolicyType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.PolicyType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Enrich.PolicyType.GeoMatch: - writer.WriteStringValue(MemberGeoMatch); - break; - case Elastic.Clients.Elasticsearch.Enrich.PolicyType.Match: - writer.WriteStringValue(MemberMatch); - break; - case Elastic.Clients.Elasticsearch.Enrich.PolicyType.Range: - writer.WriteStringValue(MemberRange); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Enrich.PolicyType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Enrich.PolicyType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.PolicyType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.EnrichPolicyPhaseConverter))] -public enum EnrichPolicyPhase -{ - [System.Runtime.Serialization.EnumMember(Value = "CANCELLED")] - Cancelled, - [System.Runtime.Serialization.EnumMember(Value = "COMPLETE")] - Complete, - [System.Runtime.Serialization.EnumMember(Value = "FAILED")] - Failed, - [System.Runtime.Serialization.EnumMember(Value = "RUNNING")] - Running, - [System.Runtime.Serialization.EnumMember(Value = "SCHEDULED")] - Scheduled -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.PolicyTypeConverter))] -public enum PolicyType -{ - [System.Runtime.Serialization.EnumMember(Value = "geo_match")] - GeoMatch, - [System.Runtime.Serialization.EnumMember(Value = "match")] - Match, - [System.Runtime.Serialization.EnumMember(Value = "range")] - Range } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichPolicyPhase.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichPolicyPhase.g.cs new file mode 100644 index 00000000000..694b7ae8b5b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichPolicyPhase.g.cs @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Enrich; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.Json.EnrichPolicyPhaseConverter))] +public enum EnrichPolicyPhase +{ + [System.Runtime.Serialization.EnumMember(Value = "CANCELLED")] + Cancelled, + [System.Runtime.Serialization.EnumMember(Value = "COMPLETE")] + Complete, + [System.Runtime.Serialization.EnumMember(Value = "FAILED")] + Failed, + [System.Runtime.Serialization.EnumMember(Value = "RUNNING")] + Running, + [System.Runtime.Serialization.EnumMember(Value = "SCHEDULED")] + Scheduled +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichSummary.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichSummary.Converters.g.cs new file mode 100644 index 00000000000..61054c8a8de --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichSummary.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Enrich.Json; + +public sealed partial class EnrichSummaryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropConfig = System.Text.Json.JsonEncodedText.Encode("config"); + + public override Elastic.Clients.Elasticsearch.Enrich.EnrichSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propConfig = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propConfig.TryReadProperty(ref reader, options, PropConfig, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Enrich.EnrichSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Config = propConfig.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.EnrichSummary value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropConfig, value.Config, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichSummary.g.cs index f7526b75bb6..c9c464846d7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichSummary.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/EnrichSummary.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Enrich; -internal sealed partial class EnrichSummaryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropConfig = System.Text.Json.JsonEncodedText.Encode("config"); - - public override Elastic.Clients.Elasticsearch.Enrich.EnrichSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propConfig = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propConfig.TryReadProperty(ref reader, options, PropConfig, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Enrich.EnrichSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Config = propConfig.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.EnrichSummary value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropConfig, value.Config, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.EnrichSummaryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.Json.EnrichSummaryConverter))] public sealed partial class EnrichSummary { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/ExecuteEnrichPolicyStatus.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/ExecuteEnrichPolicyStatus.Converters.g.cs new file mode 100644 index 00000000000..c529e006d00 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/ExecuteEnrichPolicyStatus.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Enrich.Json; + +public sealed partial class ExecuteEnrichPolicyStatusConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPhase = System.Text.Json.JsonEncodedText.Encode("phase"); + private static readonly System.Text.Json.JsonEncodedText PropStep = System.Text.Json.JsonEncodedText.Encode("step"); + + public override Elastic.Clients.Elasticsearch.Enrich.ExecuteEnrichPolicyStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPhase = default; + LocalJsonValue propStep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPhase.TryReadProperty(ref reader, options, PropPhase, null)) + { + continue; + } + + if (propStep.TryReadProperty(ref reader, options, PropStep, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Enrich.ExecuteEnrichPolicyStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Phase = propPhase.Value, + Step = propStep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.ExecuteEnrichPolicyStatus value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPhase, value.Phase, null, null); + writer.WriteProperty(options, PropStep, value.Step, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/ExecuteEnrichPolicyStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/ExecuteEnrichPolicyStatus.g.cs index 427fbc157ab..0d0b74c0541 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/ExecuteEnrichPolicyStatus.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/ExecuteEnrichPolicyStatus.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Enrich; -internal sealed partial class ExecuteEnrichPolicyStatusConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPhase = System.Text.Json.JsonEncodedText.Encode("phase"); - private static readonly System.Text.Json.JsonEncodedText PropStep = System.Text.Json.JsonEncodedText.Encode("step"); - - public override Elastic.Clients.Elasticsearch.Enrich.ExecuteEnrichPolicyStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPhase = default; - LocalJsonValue propStep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPhase.TryReadProperty(ref reader, options, PropPhase, null)) - { - continue; - } - - if (propStep.TryReadProperty(ref reader, options, PropStep, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Enrich.ExecuteEnrichPolicyStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Phase = propPhase.Value, - Step = propStep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.ExecuteEnrichPolicyStatus value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPhase, value.Phase, null, null); - writer.WriteProperty(options, PropStep, value.Step, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.ExecuteEnrichPolicyStatusConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.Json.ExecuteEnrichPolicyStatusConverter))] public sealed partial class ExecuteEnrichPolicyStatus { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/ExecutingPolicy.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/ExecutingPolicy.Converters.g.cs new file mode 100644 index 00000000000..7f8bbf2799e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/ExecutingPolicy.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Enrich.Json; + +public sealed partial class ExecutingPolicyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropTask = System.Text.Json.JsonEncodedText.Encode("task"); + + public override Elastic.Clients.Elasticsearch.Enrich.ExecutingPolicy Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + LocalJsonValue propTask = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propTask.TryReadProperty(ref reader, options, PropTask, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Enrich.ExecutingPolicy(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value, + Task = propTask.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.ExecutingPolicy value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropTask, value.Task, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/ExecutingPolicy.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/ExecutingPolicy.g.cs index 1bbf4777cd2..0a58ef5a74a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/ExecutingPolicy.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/ExecutingPolicy.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Enrich; -internal sealed partial class ExecutingPolicyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropTask = System.Text.Json.JsonEncodedText.Encode("task"); - - public override Elastic.Clients.Elasticsearch.Enrich.ExecutingPolicy Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - LocalJsonValue propTask = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propTask.TryReadProperty(ref reader, options, PropTask, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Enrich.ExecutingPolicy(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value, - Task = propTask.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.ExecutingPolicy value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropTask, value.Task, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.ExecutingPolicyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.Json.ExecutingPolicyConverter))] public sealed partial class ExecutingPolicy { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/PolicyType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/PolicyType.Converters.g.cs new file mode 100644 index 00000000000..b3f36c20cf5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/PolicyType.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Enrich.Json; + +public sealed partial class PolicyTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberGeoMatch = System.Text.Json.JsonEncodedText.Encode("geo_match"); + private static readonly System.Text.Json.JsonEncodedText MemberMatch = System.Text.Json.JsonEncodedText.Encode("match"); + private static readonly System.Text.Json.JsonEncodedText MemberRange = System.Text.Json.JsonEncodedText.Encode("range"); + + public override Elastic.Clients.Elasticsearch.Enrich.PolicyType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberGeoMatch)) + { + return Elastic.Clients.Elasticsearch.Enrich.PolicyType.GeoMatch; + } + + if (reader.ValueTextEquals(MemberMatch)) + { + return Elastic.Clients.Elasticsearch.Enrich.PolicyType.Match; + } + + if (reader.ValueTextEquals(MemberRange)) + { + return Elastic.Clients.Elasticsearch.Enrich.PolicyType.Range; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberGeoMatch.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Enrich.PolicyType.GeoMatch; + } + + if (string.Equals(value, MemberMatch.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Enrich.PolicyType.Match; + } + + if (string.Equals(value, MemberRange.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Enrich.PolicyType.Range; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Enrich.PolicyType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.PolicyType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Enrich.PolicyType.GeoMatch: + writer.WriteStringValue(MemberGeoMatch); + break; + case Elastic.Clients.Elasticsearch.Enrich.PolicyType.Match: + writer.WriteStringValue(MemberMatch); + break; + case Elastic.Clients.Elasticsearch.Enrich.PolicyType.Range: + writer.WriteStringValue(MemberRange); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Enrich.PolicyType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Enrich.PolicyType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Enrich.PolicyType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/PolicyType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/PolicyType.g.cs new file mode 100644 index 00000000000..bf618e2e01d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enrich/PolicyType.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Enrich; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Enrich.Json.PolicyTypeConverter))] +public enum PolicyType +{ + [System.Runtime.Serialization.EnumMember(Value = "geo_match")] + GeoMatch, + [System.Runtime.Serialization.EnumMember(Value = "match")] + Match, + [System.Runtime.Serialization.EnumMember(Value = "range")] + Range +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Aggregations.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Aggregations.g.cs deleted file mode 100644 index 3922dcaef4e..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Aggregations.g.cs +++ /dev/null @@ -1,1508 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using System; -using System.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.Aggregations; - -internal sealed partial class CardinalityExecutionModeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberDirect = System.Text.Json.JsonEncodedText.Encode("direct"); - private static readonly System.Text.Json.JsonEncodedText MemberGlobalOrdinals = System.Text.Json.JsonEncodedText.Encode("global_ordinals"); - private static readonly System.Text.Json.JsonEncodedText MemberSaveMemoryHeuristic = System.Text.Json.JsonEncodedText.Encode("save_memory_heuristic"); - private static readonly System.Text.Json.JsonEncodedText MemberSaveTimeHeuristic = System.Text.Json.JsonEncodedText.Encode("save_time_heuristic"); - private static readonly System.Text.Json.JsonEncodedText MemberSegmentOrdinals = System.Text.Json.JsonEncodedText.Encode("segment_ordinals"); - - public override Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberDirect)) - { - return Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.Direct; - } - - if (reader.ValueTextEquals(MemberGlobalOrdinals)) - { - return Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.GlobalOrdinals; - } - - if (reader.ValueTextEquals(MemberSaveMemoryHeuristic)) - { - return Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.SaveMemoryHeuristic; - } - - if (reader.ValueTextEquals(MemberSaveTimeHeuristic)) - { - return Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.SaveTimeHeuristic; - } - - if (reader.ValueTextEquals(MemberSegmentOrdinals)) - { - return Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.SegmentOrdinals; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberDirect.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.Direct; - } - - if (string.Equals(value, MemberGlobalOrdinals.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.GlobalOrdinals; - } - - if (string.Equals(value, MemberSaveMemoryHeuristic.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.SaveMemoryHeuristic; - } - - if (string.Equals(value, MemberSaveTimeHeuristic.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.SaveTimeHeuristic; - } - - if (string.Equals(value, MemberSegmentOrdinals.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.SegmentOrdinals; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.Direct: - writer.WriteStringValue(MemberDirect); - break; - case Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.GlobalOrdinals: - writer.WriteStringValue(MemberGlobalOrdinals); - break; - case Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.SaveMemoryHeuristic: - writer.WriteStringValue(MemberSaveMemoryHeuristic); - break; - case Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.SaveTimeHeuristic: - writer.WriteStringValue(MemberSaveTimeHeuristic); - break; - case Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode.SegmentOrdinals: - writer.WriteStringValue(MemberSegmentOrdinals); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionMode value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TermsAggregationCollectModeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberBreadthFirst = System.Text.Json.JsonEncodedText.Encode("breadth_first"); - private static readonly System.Text.Json.JsonEncodedText MemberDepthFirst = System.Text.Json.JsonEncodedText.Encode("depth_first"); - - public override Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberBreadthFirst)) - { - return Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode.BreadthFirst; - } - - if (reader.ValueTextEquals(MemberDepthFirst)) - { - return Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode.DepthFirst; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberBreadthFirst.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode.BreadthFirst; - } - - if (string.Equals(value, MemberDepthFirst.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode.DepthFirst; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode.BreadthFirst: - writer.WriteStringValue(MemberBreadthFirst); - break; - case Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode.DepthFirst: - writer.WriteStringValue(MemberDepthFirst); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TermsAggregationExecutionHintConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberGlobalOrdinals = System.Text.Json.JsonEncodedText.Encode("global_ordinals"); - private static readonly System.Text.Json.JsonEncodedText MemberGlobalOrdinalsHash = System.Text.Json.JsonEncodedText.Encode("global_ordinals_hash"); - private static readonly System.Text.Json.JsonEncodedText MemberGlobalOrdinalsLowCardinality = System.Text.Json.JsonEncodedText.Encode("global_ordinals_low_cardinality"); - private static readonly System.Text.Json.JsonEncodedText MemberMap = System.Text.Json.JsonEncodedText.Encode("map"); - - public override Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberGlobalOrdinals)) - { - return Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint.GlobalOrdinals; - } - - if (reader.ValueTextEquals(MemberGlobalOrdinalsHash)) - { - return Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint.GlobalOrdinalsHash; - } - - if (reader.ValueTextEquals(MemberGlobalOrdinalsLowCardinality)) - { - return Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint.GlobalOrdinalsLowCardinality; - } - - if (reader.ValueTextEquals(MemberMap)) - { - return Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint.Map; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberGlobalOrdinals.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint.GlobalOrdinals; - } - - if (string.Equals(value, MemberGlobalOrdinalsHash.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint.GlobalOrdinalsHash; - } - - if (string.Equals(value, MemberGlobalOrdinalsLowCardinality.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint.GlobalOrdinalsLowCardinality; - } - - if (string.Equals(value, MemberMap.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint.Map; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint.GlobalOrdinals: - writer.WriteStringValue(MemberGlobalOrdinals); - break; - case Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint.GlobalOrdinalsHash: - writer.WriteStringValue(MemberGlobalOrdinalsHash); - break; - case Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint.GlobalOrdinalsLowCardinality: - writer.WriteStringValue(MemberGlobalOrdinalsLowCardinality); - break; - case Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint.Map: - writer.WriteStringValue(MemberMap); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class MissingOrderConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberDefault = System.Text.Json.JsonEncodedText.Encode("default"); - private static readonly System.Text.Json.JsonEncodedText MemberFirst = System.Text.Json.JsonEncodedText.Encode("first"); - private static readonly System.Text.Json.JsonEncodedText MemberLast = System.Text.Json.JsonEncodedText.Encode("last"); - - public override Elastic.Clients.Elasticsearch.Aggregations.MissingOrder Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberDefault)) - { - return Elastic.Clients.Elasticsearch.Aggregations.MissingOrder.Default; - } - - if (reader.ValueTextEquals(MemberFirst)) - { - return Elastic.Clients.Elasticsearch.Aggregations.MissingOrder.First; - } - - if (reader.ValueTextEquals(MemberLast)) - { - return Elastic.Clients.Elasticsearch.Aggregations.MissingOrder.Last; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberDefault.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.MissingOrder.Default; - } - - if (string.Equals(value, MemberFirst.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.MissingOrder.First; - } - - if (string.Equals(value, MemberLast.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.MissingOrder.Last; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.MissingOrder)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MissingOrder value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Aggregations.MissingOrder.Default: - writer.WriteStringValue(MemberDefault); - break; - case Elastic.Clients.Elasticsearch.Aggregations.MissingOrder.First: - writer.WriteStringValue(MemberFirst); - break; - case Elastic.Clients.Elasticsearch.Aggregations.MissingOrder.Last: - writer.WriteStringValue(MemberLast); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.MissingOrder)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Aggregations.MissingOrder ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MissingOrder value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class MinimumIntervalConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberDay = System.Text.Json.JsonEncodedText.Encode("day"); - private static readonly System.Text.Json.JsonEncodedText MemberHour = System.Text.Json.JsonEncodedText.Encode("hour"); - private static readonly System.Text.Json.JsonEncodedText MemberMinute = System.Text.Json.JsonEncodedText.Encode("minute"); - private static readonly System.Text.Json.JsonEncodedText MemberMonth = System.Text.Json.JsonEncodedText.Encode("month"); - private static readonly System.Text.Json.JsonEncodedText MemberSecond = System.Text.Json.JsonEncodedText.Encode("second"); - private static readonly System.Text.Json.JsonEncodedText MemberYear = System.Text.Json.JsonEncodedText.Encode("year"); - - public override Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberDay)) - { - return Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Day; - } - - if (reader.ValueTextEquals(MemberHour)) - { - return Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Hour; - } - - if (reader.ValueTextEquals(MemberMinute)) - { - return Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Minute; - } - - if (reader.ValueTextEquals(MemberMonth)) - { - return Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Month; - } - - if (reader.ValueTextEquals(MemberSecond)) - { - return Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Second; - } - - if (reader.ValueTextEquals(MemberYear)) - { - return Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Year; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberDay.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Day; - } - - if (string.Equals(value, MemberHour.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Hour; - } - - if (string.Equals(value, MemberMinute.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Minute; - } - - if (string.Equals(value, MemberMonth.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Month; - } - - if (string.Equals(value, MemberSecond.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Second; - } - - if (string.Equals(value, MemberYear.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Year; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Day: - writer.WriteStringValue(MemberDay); - break; - case Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Hour: - writer.WriteStringValue(MemberHour); - break; - case Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Minute: - writer.WriteStringValue(MemberMinute); - break; - case Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Month: - writer.WriteStringValue(MemberMonth); - break; - case Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Second: - writer.WriteStringValue(MemberSecond); - break; - case Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval.Year: - writer.WriteStringValue(MemberYear); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.MinimumInterval value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class GapPolicyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberInsertZeros = System.Text.Json.JsonEncodedText.Encode("insert_zeros"); - private static readonly System.Text.Json.JsonEncodedText MemberKeepValues = System.Text.Json.JsonEncodedText.Encode("keep_values"); - private static readonly System.Text.Json.JsonEncodedText MemberSkip = System.Text.Json.JsonEncodedText.Encode("skip"); - - public override Elastic.Clients.Elasticsearch.Aggregations.GapPolicy Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberInsertZeros)) - { - return Elastic.Clients.Elasticsearch.Aggregations.GapPolicy.InsertZeros; - } - - if (reader.ValueTextEquals(MemberKeepValues)) - { - return Elastic.Clients.Elasticsearch.Aggregations.GapPolicy.KeepValues; - } - - if (reader.ValueTextEquals(MemberSkip)) - { - return Elastic.Clients.Elasticsearch.Aggregations.GapPolicy.Skip; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberInsertZeros.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.GapPolicy.InsertZeros; - } - - if (string.Equals(value, MemberKeepValues.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.GapPolicy.KeepValues; - } - - if (string.Equals(value, MemberSkip.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.GapPolicy.Skip; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.GapPolicy)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Aggregations.GapPolicy.InsertZeros: - writer.WriteStringValue(MemberInsertZeros); - break; - case Elastic.Clients.Elasticsearch.Aggregations.GapPolicy.KeepValues: - writer.WriteStringValue(MemberKeepValues); - break; - case Elastic.Clients.Elasticsearch.Aggregations.GapPolicy.Skip: - writer.WriteStringValue(MemberSkip); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.GapPolicy)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Aggregations.GapPolicy ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TDigestExecutionHintConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberDefault = System.Text.Json.JsonEncodedText.Encode("default"); - private static readonly System.Text.Json.JsonEncodedText MemberHighAccuracy = System.Text.Json.JsonEncodedText.Encode("high_accuracy"); - - public override Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberDefault)) - { - return Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint.Default; - } - - if (reader.ValueTextEquals(MemberHighAccuracy)) - { - return Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint.HighAccuracy; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberDefault.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint.Default; - } - - if (string.Equals(value, MemberHighAccuracy.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint.HighAccuracy; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint.Default: - writer.WriteStringValue(MemberDefault); - break; - case Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint.HighAccuracy: - writer.WriteStringValue(MemberHighAccuracy); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHint value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class CalendarIntervalConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberDay = System.Text.Json.JsonEncodedText.Encode("day"); - private static readonly System.Text.Json.JsonEncodedText MemberDay1 = System.Text.Json.JsonEncodedText.Encode("1d"); - private static readonly System.Text.Json.JsonEncodedText MemberHour = System.Text.Json.JsonEncodedText.Encode("hour"); - private static readonly System.Text.Json.JsonEncodedText MemberHour1 = System.Text.Json.JsonEncodedText.Encode("1h"); - private static readonly System.Text.Json.JsonEncodedText MemberMinute = System.Text.Json.JsonEncodedText.Encode("minute"); - private static readonly System.Text.Json.JsonEncodedText MemberMinute1 = System.Text.Json.JsonEncodedText.Encode("1m"); - private static readonly System.Text.Json.JsonEncodedText MemberMonth = System.Text.Json.JsonEncodedText.Encode("month"); - private static readonly System.Text.Json.JsonEncodedText MemberMonth1 = System.Text.Json.JsonEncodedText.Encode("1M"); - private static readonly System.Text.Json.JsonEncodedText MemberQuarter = System.Text.Json.JsonEncodedText.Encode("quarter"); - private static readonly System.Text.Json.JsonEncodedText MemberQuarter1 = System.Text.Json.JsonEncodedText.Encode("1q"); - private static readonly System.Text.Json.JsonEncodedText MemberSecond = System.Text.Json.JsonEncodedText.Encode("second"); - private static readonly System.Text.Json.JsonEncodedText MemberSecond1 = System.Text.Json.JsonEncodedText.Encode("1s"); - private static readonly System.Text.Json.JsonEncodedText MemberWeek = System.Text.Json.JsonEncodedText.Encode("week"); - private static readonly System.Text.Json.JsonEncodedText MemberWeek1 = System.Text.Json.JsonEncodedText.Encode("1w"); - private static readonly System.Text.Json.JsonEncodedText MemberYear = System.Text.Json.JsonEncodedText.Encode("year"); - private static readonly System.Text.Json.JsonEncodedText MemberYear1 = System.Text.Json.JsonEncodedText.Encode("1y"); - - public override Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberDay) || reader.ValueTextEquals(MemberDay1)) - { - return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Day; - } - - if (reader.ValueTextEquals(MemberHour) || reader.ValueTextEquals(MemberHour1)) - { - return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Hour; - } - - if (reader.ValueTextEquals(MemberMinute) || reader.ValueTextEquals(MemberMinute1)) - { - return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Minute; - } - - if (reader.ValueTextEquals(MemberMonth) || reader.ValueTextEquals(MemberMonth1)) - { - return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Month; - } - - if (reader.ValueTextEquals(MemberQuarter) || reader.ValueTextEquals(MemberQuarter1)) - { - return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Quarter; - } - - if (reader.ValueTextEquals(MemberSecond) || reader.ValueTextEquals(MemberSecond1)) - { - return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Second; - } - - if (reader.ValueTextEquals(MemberWeek) || reader.ValueTextEquals(MemberWeek1)) - { - return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Week; - } - - if (reader.ValueTextEquals(MemberYear) || reader.ValueTextEquals(MemberYear1)) - { - return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Year; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberDay.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberDay1.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Day; - } - - if (string.Equals(value, MemberHour.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberHour1.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Hour; - } - - if (string.Equals(value, MemberMinute.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberMinute1.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Minute; - } - - if (string.Equals(value, MemberMonth.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberMonth1.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Month; - } - - if (string.Equals(value, MemberQuarter.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberQuarter1.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Quarter; - } - - if (string.Equals(value, MemberSecond.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberSecond1.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Second; - } - - if (string.Equals(value, MemberWeek.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberWeek1.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Week; - } - - if (string.Equals(value, MemberYear.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberYear1.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Year; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Day: - writer.WriteStringValue(MemberDay); - break; - case Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Hour: - writer.WriteStringValue(MemberHour); - break; - case Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Minute: - writer.WriteStringValue(MemberMinute); - break; - case Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Month: - writer.WriteStringValue(MemberMonth); - break; - case Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Quarter: - writer.WriteStringValue(MemberQuarter); - break; - case Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Second: - writer.WriteStringValue(MemberSecond); - break; - case Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Week: - writer.WriteStringValue(MemberWeek); - break; - case Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval.Year: - writer.WriteStringValue(MemberYear); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CalendarInterval value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class SamplerAggregationExecutionHintConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberBytesHash = System.Text.Json.JsonEncodedText.Encode("bytes_hash"); - private static readonly System.Text.Json.JsonEncodedText MemberGlobalOrdinals = System.Text.Json.JsonEncodedText.Encode("global_ordinals"); - private static readonly System.Text.Json.JsonEncodedText MemberMap = System.Text.Json.JsonEncodedText.Encode("map"); - - public override Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberBytesHash)) - { - return Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint.BytesHash; - } - - if (reader.ValueTextEquals(MemberGlobalOrdinals)) - { - return Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint.GlobalOrdinals; - } - - if (reader.ValueTextEquals(MemberMap)) - { - return Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint.Map; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberBytesHash.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint.BytesHash; - } - - if (string.Equals(value, MemberGlobalOrdinals.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint.GlobalOrdinals; - } - - if (string.Equals(value, MemberMap.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint.Map; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint.BytesHash: - writer.WriteStringValue(MemberBytesHash); - break; - case Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint.GlobalOrdinals: - writer.WriteStringValue(MemberGlobalOrdinals); - break; - case Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint.Map: - writer.WriteStringValue(MemberMap); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHint value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class NormalizeMethodConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberMean = System.Text.Json.JsonEncodedText.Encode("mean"); - private static readonly System.Text.Json.JsonEncodedText MemberPercentOfSum = System.Text.Json.JsonEncodedText.Encode("percent_of_sum"); - private static readonly System.Text.Json.JsonEncodedText MemberRescale01 = System.Text.Json.JsonEncodedText.Encode("rescale_0_1"); - private static readonly System.Text.Json.JsonEncodedText MemberRescale0100 = System.Text.Json.JsonEncodedText.Encode("rescale_0_100"); - private static readonly System.Text.Json.JsonEncodedText MemberSoftmax = System.Text.Json.JsonEncodedText.Encode("softmax"); - private static readonly System.Text.Json.JsonEncodedText MemberZScore = System.Text.Json.JsonEncodedText.Encode("z-score"); - - public override Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberMean)) - { - return Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.Mean; - } - - if (reader.ValueTextEquals(MemberPercentOfSum)) - { - return Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.PercentOfSum; - } - - if (reader.ValueTextEquals(MemberRescale01)) - { - return Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.Rescale01; - } - - if (reader.ValueTextEquals(MemberRescale0100)) - { - return Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.Rescale0100; - } - - if (reader.ValueTextEquals(MemberSoftmax)) - { - return Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.Softmax; - } - - if (reader.ValueTextEquals(MemberZScore)) - { - return Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.ZScore; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberMean.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.Mean; - } - - if (string.Equals(value, MemberPercentOfSum.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.PercentOfSum; - } - - if (string.Equals(value, MemberRescale01.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.Rescale01; - } - - if (string.Equals(value, MemberRescale0100.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.Rescale0100; - } - - if (string.Equals(value, MemberSoftmax.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.Softmax; - } - - if (string.Equals(value, MemberZScore.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.ZScore; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.Mean: - writer.WriteStringValue(MemberMean); - break; - case Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.PercentOfSum: - writer.WriteStringValue(MemberPercentOfSum); - break; - case Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.Rescale01: - writer.WriteStringValue(MemberRescale01); - break; - case Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.Rescale0100: - writer.WriteStringValue(MemberRescale0100); - break; - case Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.Softmax: - writer.WriteStringValue(MemberSoftmax); - break; - case Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod.ZScore: - writer.WriteStringValue(MemberZScore); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethod value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class RateModeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberSum = System.Text.Json.JsonEncodedText.Encode("sum"); - private static readonly System.Text.Json.JsonEncodedText MemberValueCount = System.Text.Json.JsonEncodedText.Encode("value_count"); - - public override Elastic.Clients.Elasticsearch.Aggregations.RateMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberSum)) - { - return Elastic.Clients.Elasticsearch.Aggregations.RateMode.Sum; - } - - if (reader.ValueTextEquals(MemberValueCount)) - { - return Elastic.Clients.Elasticsearch.Aggregations.RateMode.ValueCount; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberSum.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.RateMode.Sum; - } - - if (string.Equals(value, MemberValueCount.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.RateMode.ValueCount; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.RateMode)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.RateMode value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Aggregations.RateMode.Sum: - writer.WriteStringValue(MemberSum); - break; - case Elastic.Clients.Elasticsearch.Aggregations.RateMode.ValueCount: - writer.WriteStringValue(MemberValueCount); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.RateMode)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Aggregations.RateMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.RateMode value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TTestTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberHeteroscedastic = System.Text.Json.JsonEncodedText.Encode("heteroscedastic"); - private static readonly System.Text.Json.JsonEncodedText MemberHomoscedastic = System.Text.Json.JsonEncodedText.Encode("homoscedastic"); - private static readonly System.Text.Json.JsonEncodedText MemberPaired = System.Text.Json.JsonEncodedText.Encode("paired"); - - public override Elastic.Clients.Elasticsearch.Aggregations.TTestType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberHeteroscedastic)) - { - return Elastic.Clients.Elasticsearch.Aggregations.TTestType.Heteroscedastic; - } - - if (reader.ValueTextEquals(MemberHomoscedastic)) - { - return Elastic.Clients.Elasticsearch.Aggregations.TTestType.Homoscedastic; - } - - if (reader.ValueTextEquals(MemberPaired)) - { - return Elastic.Clients.Elasticsearch.Aggregations.TTestType.Paired; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberHeteroscedastic.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.TTestType.Heteroscedastic; - } - - if (string.Equals(value, MemberHomoscedastic.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.TTestType.Homoscedastic; - } - - if (string.Equals(value, MemberPaired.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.TTestType.Paired; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.TTestType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TTestType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Aggregations.TTestType.Heteroscedastic: - writer.WriteStringValue(MemberHeteroscedastic); - break; - case Elastic.Clients.Elasticsearch.Aggregations.TTestType.Homoscedastic: - writer.WriteStringValue(MemberHomoscedastic); - break; - case Elastic.Clients.Elasticsearch.Aggregations.TTestType.Paired: - writer.WriteStringValue(MemberPaired); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.TTestType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Aggregations.TTestType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TTestType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ValueTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberBoolean = System.Text.Json.JsonEncodedText.Encode("boolean"); - private static readonly System.Text.Json.JsonEncodedText MemberDate = System.Text.Json.JsonEncodedText.Encode("date"); - private static readonly System.Text.Json.JsonEncodedText MemberDateNanos = System.Text.Json.JsonEncodedText.Encode("date_nanos"); - private static readonly System.Text.Json.JsonEncodedText MemberDouble = System.Text.Json.JsonEncodedText.Encode("double"); - private static readonly System.Text.Json.JsonEncodedText MemberGeoPoint = System.Text.Json.JsonEncodedText.Encode("geo_point"); - private static readonly System.Text.Json.JsonEncodedText MemberIp = System.Text.Json.JsonEncodedText.Encode("ip"); - private static readonly System.Text.Json.JsonEncodedText MemberLong = System.Text.Json.JsonEncodedText.Encode("long"); - private static readonly System.Text.Json.JsonEncodedText MemberNumber = System.Text.Json.JsonEncodedText.Encode("number"); - private static readonly System.Text.Json.JsonEncodedText MemberNumeric = System.Text.Json.JsonEncodedText.Encode("numeric"); - private static readonly System.Text.Json.JsonEncodedText MemberString = System.Text.Json.JsonEncodedText.Encode("string"); - - public override Elastic.Clients.Elasticsearch.Aggregations.ValueType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberBoolean)) - { - return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Boolean; - } - - if (reader.ValueTextEquals(MemberDate)) - { - return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Date; - } - - if (reader.ValueTextEquals(MemberDateNanos)) - { - return Elastic.Clients.Elasticsearch.Aggregations.ValueType.DateNanos; - } - - if (reader.ValueTextEquals(MemberDouble)) - { - return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Double; - } - - if (reader.ValueTextEquals(MemberGeoPoint)) - { - return Elastic.Clients.Elasticsearch.Aggregations.ValueType.GeoPoint; - } - - if (reader.ValueTextEquals(MemberIp)) - { - return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Ip; - } - - if (reader.ValueTextEquals(MemberLong)) - { - return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Long; - } - - if (reader.ValueTextEquals(MemberNumber)) - { - return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Number; - } - - if (reader.ValueTextEquals(MemberNumeric)) - { - return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Numeric; - } - - if (reader.ValueTextEquals(MemberString)) - { - return Elastic.Clients.Elasticsearch.Aggregations.ValueType.String; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberBoolean.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Boolean; - } - - if (string.Equals(value, MemberDate.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Date; - } - - if (string.Equals(value, MemberDateNanos.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.ValueType.DateNanos; - } - - if (string.Equals(value, MemberDouble.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Double; - } - - if (string.Equals(value, MemberGeoPoint.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.ValueType.GeoPoint; - } - - if (string.Equals(value, MemberIp.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Ip; - } - - if (string.Equals(value, MemberLong.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Long; - } - - if (string.Equals(value, MemberNumber.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Number; - } - - if (string.Equals(value, MemberNumeric.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.ValueType.Numeric; - } - - if (string.Equals(value, MemberString.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Aggregations.ValueType.String; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.ValueType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ValueType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Aggregations.ValueType.Boolean: - writer.WriteStringValue(MemberBoolean); - break; - case Elastic.Clients.Elasticsearch.Aggregations.ValueType.Date: - writer.WriteStringValue(MemberDate); - break; - case Elastic.Clients.Elasticsearch.Aggregations.ValueType.DateNanos: - writer.WriteStringValue(MemberDateNanos); - break; - case Elastic.Clients.Elasticsearch.Aggregations.ValueType.Double: - writer.WriteStringValue(MemberDouble); - break; - case Elastic.Clients.Elasticsearch.Aggregations.ValueType.GeoPoint: - writer.WriteStringValue(MemberGeoPoint); - break; - case Elastic.Clients.Elasticsearch.Aggregations.ValueType.Ip: - writer.WriteStringValue(MemberIp); - break; - case Elastic.Clients.Elasticsearch.Aggregations.ValueType.Long: - writer.WriteStringValue(MemberLong); - break; - case Elastic.Clients.Elasticsearch.Aggregations.ValueType.Number: - writer.WriteStringValue(MemberNumber); - break; - case Elastic.Clients.Elasticsearch.Aggregations.ValueType.Numeric: - writer.WriteStringValue(MemberNumeric); - break; - case Elastic.Clients.Elasticsearch.Aggregations.ValueType.String: - writer.WriteStringValue(MemberString); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Aggregations.ValueType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Aggregations.ValueType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ValueType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.CardinalityExecutionModeConverter))] -public enum CardinalityExecutionMode -{ - /// - /// - /// Run the aggregation by using field values directly. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "direct")] - Direct, - /// - /// - /// Run the aggregation by using global ordinals of the field and resolving those values after finishing a shard. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "global_ordinals")] - GlobalOrdinals, - /// - /// - /// Heuristic-based mode, default in Elasticsearch 8.3 and earlier. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "save_memory_heuristic")] - SaveMemoryHeuristic, - /// - /// - /// Heuristic-based mode, default in Elasticsearch 8.4 and later. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "save_time_heuristic")] - SaveTimeHeuristic, - /// - /// - /// Run the aggregation by using segment ordinal values and resolving those values after each segment. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "segment_ordinals")] - SegmentOrdinals -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectModeConverter))] -public enum TermsAggregationCollectMode -{ - /// - /// - /// Caches the set of documents that fall into the uppermost buckets for subsequent replay. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "breadth_first")] - BreadthFirst, - /// - /// - /// Expands all branches of the aggregation tree in one depth-first pass, before any pruning occurs. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "depth_first")] - DepthFirst -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHintConverter))] -public enum TermsAggregationExecutionHint -{ - [System.Runtime.Serialization.EnumMember(Value = "global_ordinals")] - GlobalOrdinals, - [System.Runtime.Serialization.EnumMember(Value = "global_ordinals_hash")] - GlobalOrdinalsHash, - [System.Runtime.Serialization.EnumMember(Value = "global_ordinals_low_cardinality")] - GlobalOrdinalsLowCardinality, - [System.Runtime.Serialization.EnumMember(Value = "map")] - Map -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.MissingOrderConverter))] -public enum MissingOrder -{ - [System.Runtime.Serialization.EnumMember(Value = "default")] - Default, - [System.Runtime.Serialization.EnumMember(Value = "first")] - First, - [System.Runtime.Serialization.EnumMember(Value = "last")] - Last -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.MinimumIntervalConverter))] -public enum MinimumInterval -{ - [System.Runtime.Serialization.EnumMember(Value = "day")] - Day, - [System.Runtime.Serialization.EnumMember(Value = "hour")] - Hour, - [System.Runtime.Serialization.EnumMember(Value = "minute")] - Minute, - [System.Runtime.Serialization.EnumMember(Value = "month")] - Month, - [System.Runtime.Serialization.EnumMember(Value = "second")] - Second, - [System.Runtime.Serialization.EnumMember(Value = "year")] - Year -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.GapPolicyConverter))] -public enum GapPolicy -{ - /// - /// - /// Replace missing values with a zero (0) and pipeline aggregation computation will proceed as normal. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "insert_zeros")] - InsertZeros, - /// - /// - /// Similar to skip, except if the metric provides a non-null, non-NaN value this value is used, - /// otherwise the empty bucket is skipped. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "keep_values")] - KeepValues, - /// - /// - /// Treats missing data as if the bucket does not exist. It will skip the bucket and - /// continue calculating using the next available value. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "skip")] - Skip -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.TDigestExecutionHintConverter))] -public enum TDigestExecutionHint -{ - [System.Runtime.Serialization.EnumMember(Value = "default")] - Default, - [System.Runtime.Serialization.EnumMember(Value = "high_accuracy")] - HighAccuracy -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.CalendarIntervalConverter))] -public enum CalendarInterval -{ - [System.Runtime.Serialization.EnumMember(Value = "day")] - Day, - [System.Runtime.Serialization.EnumMember(Value = "hour")] - Hour, - [System.Runtime.Serialization.EnumMember(Value = "minute")] - Minute, - [System.Runtime.Serialization.EnumMember(Value = "month")] - Month, - [System.Runtime.Serialization.EnumMember(Value = "quarter")] - Quarter, - [System.Runtime.Serialization.EnumMember(Value = "second")] - Second, - [System.Runtime.Serialization.EnumMember(Value = "week")] - Week, - [System.Runtime.Serialization.EnumMember(Value = "year")] - Year -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.SamplerAggregationExecutionHintConverter))] -public enum SamplerAggregationExecutionHint -{ - /// - /// - /// Hold hashes of the field values - with potential for hash collisions. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "bytes_hash")] - BytesHash, - /// - /// - /// Hold ordinals of the field as determined by the Lucene index. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "global_ordinals")] - GlobalOrdinals, - /// - /// - /// Hold field values directly. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "map")] - Map -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.NormalizeMethodConverter))] -public enum NormalizeMethod -{ - /// - /// - /// This method normalizes such that each value is normalized by how much it differs from the average. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "mean")] - Mean, - /// - /// - /// This method normalizes each value so that it represents a percentage of the total sum it attributes to. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "percent_of_sum")] - PercentOfSum, - /// - /// - /// This method rescales the data such that the minimum number is 0, and the maximum number is 1, with the rest normalized linearly in-between. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "rescale_0_1")] - Rescale01, - /// - /// - /// This method rescales the data such that the minimum number is 0, and the maximum number is 100, with the rest normalized linearly in-between. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "rescale_0_100")] - Rescale0100, - /// - /// - /// This method normalizes such that each value is exponentiated and relative to the sum of the exponents of the original values. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "softmax")] - Softmax, - /// - /// - /// This method normalizes such that each value represents how far it is from the mean relative to the standard deviation. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "z-score")] - ZScore -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.RateModeConverter))] -public enum RateMode -{ - /// - /// - /// Calculates the sum of all values of the field. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "sum")] - Sum, - /// - /// - /// Uses the number of values of the field. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "value_count")] - ValueCount -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.TTestTypeConverter))] -public enum TTestType -{ - /// - /// - /// Performs two-sample unequal variance test. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "heteroscedastic")] - Heteroscedastic, - /// - /// - /// Performs two-sample equal variance test. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "homoscedastic")] - Homoscedastic, - /// - /// - /// Performs paired t-test. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "paired")] - Paired -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.ValueTypeConverter))] -public enum ValueType -{ - [System.Runtime.Serialization.EnumMember(Value = "boolean")] - Boolean, - [System.Runtime.Serialization.EnumMember(Value = "date")] - Date, - [System.Runtime.Serialization.EnumMember(Value = "date_nanos")] - DateNanos, - [System.Runtime.Serialization.EnumMember(Value = "double")] - Double, - [System.Runtime.Serialization.EnumMember(Value = "geo_point")] - GeoPoint, - [System.Runtime.Serialization.EnumMember(Value = "ip")] - Ip, - [System.Runtime.Serialization.EnumMember(Value = "long")] - Long, - [System.Runtime.Serialization.EnumMember(Value = "number")] - Number, - [System.Runtime.Serialization.EnumMember(Value = "numeric")] - Numeric, - [System.Runtime.Serialization.EnumMember(Value = "string")] - String -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Analysis.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Analysis.g.cs deleted file mode 100644 index 17cdca04f59..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Analysis.g.cs +++ /dev/null @@ -1,2996 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using System; -using System.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.Analysis; - -internal sealed partial class KuromojiTokenizationModeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberExtended = System.Text.Json.JsonEncodedText.Encode("extended"); - private static readonly System.Text.Json.JsonEncodedText MemberNormal = System.Text.Json.JsonEncodedText.Encode("normal"); - private static readonly System.Text.Json.JsonEncodedText MemberSearch = System.Text.Json.JsonEncodedText.Encode("search"); - - public override Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberExtended)) - { - return Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode.Extended; - } - - if (reader.ValueTextEquals(MemberNormal)) - { - return Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode.Normal; - } - - if (reader.ValueTextEquals(MemberSearch)) - { - return Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode.Search; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberExtended.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode.Extended; - } - - if (string.Equals(value, MemberNormal.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode.Normal; - } - - if (string.Equals(value, MemberSearch.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode.Search; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode.Extended: - writer.WriteStringValue(MemberExtended); - break; - case Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode.Normal: - writer.WriteStringValue(MemberNormal); - break; - case Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode.Search: - writer.WriteStringValue(MemberSearch); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class NoriDecompoundModeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberDiscard = System.Text.Json.JsonEncodedText.Encode("discard"); - private static readonly System.Text.Json.JsonEncodedText MemberMixed = System.Text.Json.JsonEncodedText.Encode("mixed"); - private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); - - public override Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberDiscard)) - { - return Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode.Discard; - } - - if (reader.ValueTextEquals(MemberMixed)) - { - return Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode.Mixed; - } - - if (reader.ValueTextEquals(MemberNone)) - { - return Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode.None; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberDiscard.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode.Discard; - } - - if (string.Equals(value, MemberMixed.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode.Mixed; - } - - if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode.None; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode.Discard: - writer.WriteStringValue(MemberDiscard); - break; - case Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode.Mixed: - writer.WriteStringValue(MemberMixed); - break; - case Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode.None: - writer.WriteStringValue(MemberNone); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundMode value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class IcuNormalizationModeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCompose = System.Text.Json.JsonEncodedText.Encode("compose"); - private static readonly System.Text.Json.JsonEncodedText MemberDecompose = System.Text.Json.JsonEncodedText.Encode("decompose"); - - public override Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCompose)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode.Compose; - } - - if (reader.ValueTextEquals(MemberDecompose)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode.Decompose; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCompose.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode.Compose; - } - - if (string.Equals(value, MemberDecompose.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode.Decompose; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode.Compose: - writer.WriteStringValue(MemberCompose); - break; - case Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode.Decompose: - writer.WriteStringValue(MemberDecompose); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationMode value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class IcuNormalizationTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberNfc = System.Text.Json.JsonEncodedText.Encode("nfc"); - private static readonly System.Text.Json.JsonEncodedText MemberNfkc = System.Text.Json.JsonEncodedText.Encode("nfkc"); - private static readonly System.Text.Json.JsonEncodedText MemberNfkcCf = System.Text.Json.JsonEncodedText.Encode("nfkc_cf"); - - public override Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberNfc)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType.Nfc; - } - - if (reader.ValueTextEquals(MemberNfkc)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType.Nfkc; - } - - if (reader.ValueTextEquals(MemberNfkcCf)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType.NfkcCf; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberNfc.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType.Nfc; - } - - if (string.Equals(value, MemberNfkc.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType.Nfkc; - } - - if (string.Equals(value, MemberNfkcCf.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType.NfkcCf; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType.Nfc: - writer.WriteStringValue(MemberNfc); - break; - case Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType.Nfkc: - writer.WriteStringValue(MemberNfkc); - break; - case Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType.NfkcCf: - writer.WriteStringValue(MemberNfkcCf); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class DelimitedPayloadEncodingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberFloat = System.Text.Json.JsonEncodedText.Encode("float"); - private static readonly System.Text.Json.JsonEncodedText MemberIdentity = System.Text.Json.JsonEncodedText.Encode("identity"); - private static readonly System.Text.Json.JsonEncodedText MemberInteger = System.Text.Json.JsonEncodedText.Encode("int"); - - public override Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberFloat)) - { - return Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding.Float; - } - - if (reader.ValueTextEquals(MemberIdentity)) - { - return Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding.Identity; - } - - if (reader.ValueTextEquals(MemberInteger)) - { - return Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding.Integer; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberFloat.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding.Float; - } - - if (string.Equals(value, MemberIdentity.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding.Identity; - } - - if (string.Equals(value, MemberInteger.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding.Integer; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding.Float: - writer.WriteStringValue(MemberFloat); - break; - case Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding.Identity: - writer.WriteStringValue(MemberIdentity); - break; - case Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding.Integer: - writer.WriteStringValue(MemberInteger); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class EdgeNGramSideConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberBack = System.Text.Json.JsonEncodedText.Encode("back"); - private static readonly System.Text.Json.JsonEncodedText MemberFront = System.Text.Json.JsonEncodedText.Encode("front"); - - public override Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberBack)) - { - return Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide.Back; - } - - if (reader.ValueTextEquals(MemberFront)) - { - return Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide.Front; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberBack.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide.Back; - } - - if (string.Equals(value, MemberFront.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide.Front; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide.Back: - writer.WriteStringValue(MemberBack); - break; - case Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide.Front: - writer.WriteStringValue(MemberFront); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class KeepTypesModeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberExclude = System.Text.Json.JsonEncodedText.Encode("exclude"); - private static readonly System.Text.Json.JsonEncodedText MemberInclude = System.Text.Json.JsonEncodedText.Encode("include"); - - public override Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberExclude)) - { - return Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode.Exclude; - } - - if (reader.ValueTextEquals(MemberInclude)) - { - return Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode.Include; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberExclude.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode.Exclude; - } - - if (string.Equals(value, MemberInclude.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode.Include; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode.Exclude: - writer.WriteStringValue(MemberExclude); - break; - case Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode.Include: - writer.WriteStringValue(MemberInclude); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class LowercaseTokenFilterLanguagesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberGreek = System.Text.Json.JsonEncodedText.Encode("greek"); - private static readonly System.Text.Json.JsonEncodedText MemberIrish = System.Text.Json.JsonEncodedText.Encode("irish"); - private static readonly System.Text.Json.JsonEncodedText MemberTurkish = System.Text.Json.JsonEncodedText.Encode("turkish"); - - public override Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberGreek)) - { - return Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Greek; - } - - if (reader.ValueTextEquals(MemberIrish)) - { - return Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Irish; - } - - if (reader.ValueTextEquals(MemberTurkish)) - { - return Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Turkish; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberGreek.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Greek; - } - - if (string.Equals(value, MemberIrish.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Irish; - } - - if (string.Equals(value, MemberTurkish.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Turkish; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Greek: - writer.WriteStringValue(MemberGreek); - break; - case Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Irish: - writer.WriteStringValue(MemberIrish); - break; - case Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Turkish: - writer.WriteStringValue(MemberTurkish); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class SnowballLanguageConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberArabic = System.Text.Json.JsonEncodedText.Encode("Arabic"); - private static readonly System.Text.Json.JsonEncodedText MemberArmenian = System.Text.Json.JsonEncodedText.Encode("Armenian"); - private static readonly System.Text.Json.JsonEncodedText MemberBasque = System.Text.Json.JsonEncodedText.Encode("Basque"); - private static readonly System.Text.Json.JsonEncodedText MemberCatalan = System.Text.Json.JsonEncodedText.Encode("Catalan"); - private static readonly System.Text.Json.JsonEncodedText MemberDanish = System.Text.Json.JsonEncodedText.Encode("Danish"); - private static readonly System.Text.Json.JsonEncodedText MemberDutch = System.Text.Json.JsonEncodedText.Encode("Dutch"); - private static readonly System.Text.Json.JsonEncodedText MemberEnglish = System.Text.Json.JsonEncodedText.Encode("English"); - private static readonly System.Text.Json.JsonEncodedText MemberEstonian = System.Text.Json.JsonEncodedText.Encode("Estonian"); - private static readonly System.Text.Json.JsonEncodedText MemberFinnish = System.Text.Json.JsonEncodedText.Encode("Finnish"); - private static readonly System.Text.Json.JsonEncodedText MemberFrench = System.Text.Json.JsonEncodedText.Encode("French"); - private static readonly System.Text.Json.JsonEncodedText MemberGerman = System.Text.Json.JsonEncodedText.Encode("German"); - private static readonly System.Text.Json.JsonEncodedText MemberGerman2 = System.Text.Json.JsonEncodedText.Encode("German2"); - private static readonly System.Text.Json.JsonEncodedText MemberHungarian = System.Text.Json.JsonEncodedText.Encode("Hungarian"); - private static readonly System.Text.Json.JsonEncodedText MemberIrish = System.Text.Json.JsonEncodedText.Encode("Irish"); - private static readonly System.Text.Json.JsonEncodedText MemberItalian = System.Text.Json.JsonEncodedText.Encode("Italian"); - private static readonly System.Text.Json.JsonEncodedText MemberKp = System.Text.Json.JsonEncodedText.Encode("Kp"); - private static readonly System.Text.Json.JsonEncodedText MemberLithuanian = System.Text.Json.JsonEncodedText.Encode("Lithuanian"); - private static readonly System.Text.Json.JsonEncodedText MemberLovins = System.Text.Json.JsonEncodedText.Encode("Lovins"); - private static readonly System.Text.Json.JsonEncodedText MemberNorwegian = System.Text.Json.JsonEncodedText.Encode("Norwegian"); - private static readonly System.Text.Json.JsonEncodedText MemberPorter = System.Text.Json.JsonEncodedText.Encode("Porter"); - private static readonly System.Text.Json.JsonEncodedText MemberPortuguese = System.Text.Json.JsonEncodedText.Encode("Portuguese"); - private static readonly System.Text.Json.JsonEncodedText MemberRomanian = System.Text.Json.JsonEncodedText.Encode("Romanian"); - private static readonly System.Text.Json.JsonEncodedText MemberRussian = System.Text.Json.JsonEncodedText.Encode("Russian"); - private static readonly System.Text.Json.JsonEncodedText MemberSerbian = System.Text.Json.JsonEncodedText.Encode("Serbian"); - private static readonly System.Text.Json.JsonEncodedText MemberSpanish = System.Text.Json.JsonEncodedText.Encode("Spanish"); - private static readonly System.Text.Json.JsonEncodedText MemberSwedish = System.Text.Json.JsonEncodedText.Encode("Swedish"); - private static readonly System.Text.Json.JsonEncodedText MemberTurkish = System.Text.Json.JsonEncodedText.Encode("Turkish"); - - public override Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberArabic)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Arabic; - } - - if (reader.ValueTextEquals(MemberArmenian)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Armenian; - } - - if (reader.ValueTextEquals(MemberBasque)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Basque; - } - - if (reader.ValueTextEquals(MemberCatalan)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Catalan; - } - - if (reader.ValueTextEquals(MemberDanish)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Danish; - } - - if (reader.ValueTextEquals(MemberDutch)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Dutch; - } - - if (reader.ValueTextEquals(MemberEnglish)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.English; - } - - if (reader.ValueTextEquals(MemberEstonian)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Estonian; - } - - if (reader.ValueTextEquals(MemberFinnish)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Finnish; - } - - if (reader.ValueTextEquals(MemberFrench)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.French; - } - - if (reader.ValueTextEquals(MemberGerman)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.German; - } - - if (reader.ValueTextEquals(MemberGerman2)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.German2; - } - - if (reader.ValueTextEquals(MemberHungarian)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Hungarian; - } - - if (reader.ValueTextEquals(MemberIrish)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Irish; - } - - if (reader.ValueTextEquals(MemberItalian)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Italian; - } - - if (reader.ValueTextEquals(MemberKp)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Kp; - } - - if (reader.ValueTextEquals(MemberLithuanian)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Lithuanian; - } - - if (reader.ValueTextEquals(MemberLovins)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Lovins; - } - - if (reader.ValueTextEquals(MemberNorwegian)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Norwegian; - } - - if (reader.ValueTextEquals(MemberPorter)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Porter; - } - - if (reader.ValueTextEquals(MemberPortuguese)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Portuguese; - } - - if (reader.ValueTextEquals(MemberRomanian)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Romanian; - } - - if (reader.ValueTextEquals(MemberRussian)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Russian; - } - - if (reader.ValueTextEquals(MemberSerbian)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Serbian; - } - - if (reader.ValueTextEquals(MemberSpanish)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Spanish; - } - - if (reader.ValueTextEquals(MemberSwedish)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Swedish; - } - - if (reader.ValueTextEquals(MemberTurkish)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Turkish; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberArabic.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Arabic; - } - - if (string.Equals(value, MemberArmenian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Armenian; - } - - if (string.Equals(value, MemberBasque.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Basque; - } - - if (string.Equals(value, MemberCatalan.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Catalan; - } - - if (string.Equals(value, MemberDanish.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Danish; - } - - if (string.Equals(value, MemberDutch.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Dutch; - } - - if (string.Equals(value, MemberEnglish.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.English; - } - - if (string.Equals(value, MemberEstonian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Estonian; - } - - if (string.Equals(value, MemberFinnish.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Finnish; - } - - if (string.Equals(value, MemberFrench.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.French; - } - - if (string.Equals(value, MemberGerman.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.German; - } - - if (string.Equals(value, MemberGerman2.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.German2; - } - - if (string.Equals(value, MemberHungarian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Hungarian; - } - - if (string.Equals(value, MemberIrish.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Irish; - } - - if (string.Equals(value, MemberItalian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Italian; - } - - if (string.Equals(value, MemberKp.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Kp; - } - - if (string.Equals(value, MemberLithuanian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Lithuanian; - } - - if (string.Equals(value, MemberLovins.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Lovins; - } - - if (string.Equals(value, MemberNorwegian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Norwegian; - } - - if (string.Equals(value, MemberPorter.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Porter; - } - - if (string.Equals(value, MemberPortuguese.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Portuguese; - } - - if (string.Equals(value, MemberRomanian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Romanian; - } - - if (string.Equals(value, MemberRussian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Russian; - } - - if (string.Equals(value, MemberSerbian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Serbian; - } - - if (string.Equals(value, MemberSpanish.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Spanish; - } - - if (string.Equals(value, MemberSwedish.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Swedish; - } - - if (string.Equals(value, MemberTurkish.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Turkish; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Arabic: - writer.WriteStringValue(MemberArabic); - break; - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Armenian: - writer.WriteStringValue(MemberArmenian); - break; - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Basque: - writer.WriteStringValue(MemberBasque); - break; - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Catalan: - writer.WriteStringValue(MemberCatalan); - break; - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Danish: - writer.WriteStringValue(MemberDanish); - break; - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Dutch: - writer.WriteStringValue(MemberDutch); - break; - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.English: - writer.WriteStringValue(MemberEnglish); - break; - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Estonian: - writer.WriteStringValue(MemberEstonian); - break; - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Finnish: - writer.WriteStringValue(MemberFinnish); - break; - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.French: - writer.WriteStringValue(MemberFrench); - break; - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.German: - writer.WriteStringValue(MemberGerman); - break; - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.German2: - writer.WriteStringValue(MemberGerman2); - break; - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Hungarian: - writer.WriteStringValue(MemberHungarian); - break; - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Irish: - writer.WriteStringValue(MemberIrish); - break; - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Italian: - writer.WriteStringValue(MemberItalian); - break; - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Kp: - writer.WriteStringValue(MemberKp); - break; - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Lithuanian: - writer.WriteStringValue(MemberLithuanian); - break; - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Lovins: - writer.WriteStringValue(MemberLovins); - break; - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Norwegian: - writer.WriteStringValue(MemberNorwegian); - break; - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Porter: - writer.WriteStringValue(MemberPorter); - break; - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Portuguese: - writer.WriteStringValue(MemberPortuguese); - break; - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Romanian: - writer.WriteStringValue(MemberRomanian); - break; - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Russian: - writer.WriteStringValue(MemberRussian); - break; - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Serbian: - writer.WriteStringValue(MemberSerbian); - break; - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Spanish: - writer.WriteStringValue(MemberSpanish); - break; - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Swedish: - writer.WriteStringValue(MemberSwedish); - break; - case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Turkish: - writer.WriteStringValue(MemberTurkish); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class SynonymFormatConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberSolr = System.Text.Json.JsonEncodedText.Encode("solr"); - private static readonly System.Text.Json.JsonEncodedText MemberWordnet = System.Text.Json.JsonEncodedText.Encode("wordnet"); - - public override Elastic.Clients.Elasticsearch.Analysis.SynonymFormat Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberSolr)) - { - return Elastic.Clients.Elasticsearch.Analysis.SynonymFormat.Solr; - } - - if (reader.ValueTextEquals(MemberWordnet)) - { - return Elastic.Clients.Elasticsearch.Analysis.SynonymFormat.Wordnet; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberSolr.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SynonymFormat.Solr; - } - - if (string.Equals(value, MemberWordnet.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.SynonymFormat.Wordnet; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.SynonymFormat)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SynonymFormat value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Analysis.SynonymFormat.Solr: - writer.WriteStringValue(MemberSolr); - break; - case Elastic.Clients.Elasticsearch.Analysis.SynonymFormat.Wordnet: - writer.WriteStringValue(MemberWordnet); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.SynonymFormat)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Analysis.SynonymFormat ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SynonymFormat value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class IcuCollationAlternateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberNonIgnorable = System.Text.Json.JsonEncodedText.Encode("non-ignorable"); - private static readonly System.Text.Json.JsonEncodedText MemberShifted = System.Text.Json.JsonEncodedText.Encode("shifted"); - - public override Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberNonIgnorable)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate.NonIgnorable; - } - - if (reader.ValueTextEquals(MemberShifted)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate.Shifted; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberNonIgnorable.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate.NonIgnorable; - } - - if (string.Equals(value, MemberShifted.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate.Shifted; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate.NonIgnorable: - writer.WriteStringValue(MemberNonIgnorable); - break; - case Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate.Shifted: - writer.WriteStringValue(MemberShifted); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class IcuCollationCaseFirstConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberLower = System.Text.Json.JsonEncodedText.Encode("lower"); - private static readonly System.Text.Json.JsonEncodedText MemberUpper = System.Text.Json.JsonEncodedText.Encode("upper"); - - public override Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberLower)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst.Lower; - } - - if (reader.ValueTextEquals(MemberUpper)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst.Upper; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberLower.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst.Lower; - } - - if (string.Equals(value, MemberUpper.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst.Upper; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst.Lower: - writer.WriteStringValue(MemberLower); - break; - case Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst.Upper: - writer.WriteStringValue(MemberUpper); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class IcuCollationDecompositionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberIdentical = System.Text.Json.JsonEncodedText.Encode("identical"); - private static readonly System.Text.Json.JsonEncodedText MemberNo = System.Text.Json.JsonEncodedText.Encode("no"); - - public override Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberIdentical)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition.Identical; - } - - if (reader.ValueTextEquals(MemberNo)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition.No; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberIdentical.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition.Identical; - } - - if (string.Equals(value, MemberNo.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition.No; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition.Identical: - writer.WriteStringValue(MemberIdentical); - break; - case Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition.No: - writer.WriteStringValue(MemberNo); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class IcuCollationStrengthConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberIdentical = System.Text.Json.JsonEncodedText.Encode("identical"); - private static readonly System.Text.Json.JsonEncodedText MemberPrimary = System.Text.Json.JsonEncodedText.Encode("primary"); - private static readonly System.Text.Json.JsonEncodedText MemberQuaternary = System.Text.Json.JsonEncodedText.Encode("quaternary"); - private static readonly System.Text.Json.JsonEncodedText MemberSecondary = System.Text.Json.JsonEncodedText.Encode("secondary"); - private static readonly System.Text.Json.JsonEncodedText MemberTertiary = System.Text.Json.JsonEncodedText.Encode("tertiary"); - - public override Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberIdentical)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Identical; - } - - if (reader.ValueTextEquals(MemberPrimary)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Primary; - } - - if (reader.ValueTextEquals(MemberQuaternary)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Quaternary; - } - - if (reader.ValueTextEquals(MemberSecondary)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Secondary; - } - - if (reader.ValueTextEquals(MemberTertiary)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Tertiary; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberIdentical.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Identical; - } - - if (string.Equals(value, MemberPrimary.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Primary; - } - - if (string.Equals(value, MemberQuaternary.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Quaternary; - } - - if (string.Equals(value, MemberSecondary.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Secondary; - } - - if (string.Equals(value, MemberTertiary.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Tertiary; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Identical: - writer.WriteStringValue(MemberIdentical); - break; - case Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Primary: - writer.WriteStringValue(MemberPrimary); - break; - case Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Quaternary: - writer.WriteStringValue(MemberQuaternary); - break; - case Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Secondary: - writer.WriteStringValue(MemberSecondary); - break; - case Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength.Tertiary: - writer.WriteStringValue(MemberTertiary); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class IcuTransformDirectionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberForward = System.Text.Json.JsonEncodedText.Encode("forward"); - private static readonly System.Text.Json.JsonEncodedText MemberReverse = System.Text.Json.JsonEncodedText.Encode("reverse"); - - public override Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberForward)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection.Forward; - } - - if (reader.ValueTextEquals(MemberReverse)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection.Reverse; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberForward.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection.Forward; - } - - if (string.Equals(value, MemberReverse.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection.Reverse; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection.Forward: - writer.WriteStringValue(MemberForward); - break; - case Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection.Reverse: - writer.WriteStringValue(MemberReverse); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirection value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class PhoneticEncoderConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberBeiderMorse = System.Text.Json.JsonEncodedText.Encode("beider_morse"); - private static readonly System.Text.Json.JsonEncodedText MemberCaverphone1 = System.Text.Json.JsonEncodedText.Encode("caverphone1"); - private static readonly System.Text.Json.JsonEncodedText MemberCaverphone2 = System.Text.Json.JsonEncodedText.Encode("caverphone2"); - private static readonly System.Text.Json.JsonEncodedText MemberCologne = System.Text.Json.JsonEncodedText.Encode("cologne"); - private static readonly System.Text.Json.JsonEncodedText MemberDaitchMokotoff = System.Text.Json.JsonEncodedText.Encode("daitch_mokotoff"); - private static readonly System.Text.Json.JsonEncodedText MemberDoubleMetaphone = System.Text.Json.JsonEncodedText.Encode("double_metaphone"); - private static readonly System.Text.Json.JsonEncodedText MemberHaasephonetik = System.Text.Json.JsonEncodedText.Encode("haasephonetik"); - private static readonly System.Text.Json.JsonEncodedText MemberKoelnerphonetik = System.Text.Json.JsonEncodedText.Encode("koelnerphonetik"); - private static readonly System.Text.Json.JsonEncodedText MemberMetaphone = System.Text.Json.JsonEncodedText.Encode("metaphone"); - private static readonly System.Text.Json.JsonEncodedText MemberNysiis = System.Text.Json.JsonEncodedText.Encode("nysiis"); - private static readonly System.Text.Json.JsonEncodedText MemberRefinedSoundex = System.Text.Json.JsonEncodedText.Encode("refined_soundex"); - private static readonly System.Text.Json.JsonEncodedText MemberSoundex = System.Text.Json.JsonEncodedText.Encode("soundex"); - - public override Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberBeiderMorse)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.BeiderMorse; - } - - if (reader.ValueTextEquals(MemberCaverphone1)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Caverphone1; - } - - if (reader.ValueTextEquals(MemberCaverphone2)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Caverphone2; - } - - if (reader.ValueTextEquals(MemberCologne)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Cologne; - } - - if (reader.ValueTextEquals(MemberDaitchMokotoff)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.DaitchMokotoff; - } - - if (reader.ValueTextEquals(MemberDoubleMetaphone)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.DoubleMetaphone; - } - - if (reader.ValueTextEquals(MemberHaasephonetik)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Haasephonetik; - } - - if (reader.ValueTextEquals(MemberKoelnerphonetik)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Koelnerphonetik; - } - - if (reader.ValueTextEquals(MemberMetaphone)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Metaphone; - } - - if (reader.ValueTextEquals(MemberNysiis)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Nysiis; - } - - if (reader.ValueTextEquals(MemberRefinedSoundex)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.RefinedSoundex; - } - - if (reader.ValueTextEquals(MemberSoundex)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Soundex; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberBeiderMorse.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.BeiderMorse; - } - - if (string.Equals(value, MemberCaverphone1.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Caverphone1; - } - - if (string.Equals(value, MemberCaverphone2.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Caverphone2; - } - - if (string.Equals(value, MemberCologne.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Cologne; - } - - if (string.Equals(value, MemberDaitchMokotoff.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.DaitchMokotoff; - } - - if (string.Equals(value, MemberDoubleMetaphone.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.DoubleMetaphone; - } - - if (string.Equals(value, MemberHaasephonetik.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Haasephonetik; - } - - if (string.Equals(value, MemberKoelnerphonetik.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Koelnerphonetik; - } - - if (string.Equals(value, MemberMetaphone.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Metaphone; - } - - if (string.Equals(value, MemberNysiis.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Nysiis; - } - - if (string.Equals(value, MemberRefinedSoundex.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.RefinedSoundex; - } - - if (string.Equals(value, MemberSoundex.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Soundex; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.BeiderMorse: - writer.WriteStringValue(MemberBeiderMorse); - break; - case Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Caverphone1: - writer.WriteStringValue(MemberCaverphone1); - break; - case Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Caverphone2: - writer.WriteStringValue(MemberCaverphone2); - break; - case Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Cologne: - writer.WriteStringValue(MemberCologne); - break; - case Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.DaitchMokotoff: - writer.WriteStringValue(MemberDaitchMokotoff); - break; - case Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.DoubleMetaphone: - writer.WriteStringValue(MemberDoubleMetaphone); - break; - case Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Haasephonetik: - writer.WriteStringValue(MemberHaasephonetik); - break; - case Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Koelnerphonetik: - writer.WriteStringValue(MemberKoelnerphonetik); - break; - case Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Metaphone: - writer.WriteStringValue(MemberMetaphone); - break; - case Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Nysiis: - writer.WriteStringValue(MemberNysiis); - break; - case Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.RefinedSoundex: - writer.WriteStringValue(MemberRefinedSoundex); - break; - case Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder.Soundex: - writer.WriteStringValue(MemberSoundex); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoder value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class PhoneticNameTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAshkenazi = System.Text.Json.JsonEncodedText.Encode("ashkenazi"); - private static readonly System.Text.Json.JsonEncodedText MemberGeneric = System.Text.Json.JsonEncodedText.Encode("generic"); - private static readonly System.Text.Json.JsonEncodedText MemberSephardic = System.Text.Json.JsonEncodedText.Encode("sephardic"); - - public override Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAshkenazi)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType.Ashkenazi; - } - - if (reader.ValueTextEquals(MemberGeneric)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType.Generic; - } - - if (reader.ValueTextEquals(MemberSephardic)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType.Sephardic; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAshkenazi.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType.Ashkenazi; - } - - if (string.Equals(value, MemberGeneric.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType.Generic; - } - - if (string.Equals(value, MemberSephardic.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType.Sephardic; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType.Ashkenazi: - writer.WriteStringValue(MemberAshkenazi); - break; - case Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType.Generic: - writer.WriteStringValue(MemberGeneric); - break; - case Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType.Sephardic: - writer.WriteStringValue(MemberSephardic); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PhoneticNameType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class PhoneticRuleTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberApprox = System.Text.Json.JsonEncodedText.Encode("approx"); - private static readonly System.Text.Json.JsonEncodedText MemberExact = System.Text.Json.JsonEncodedText.Encode("exact"); - - public override Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberApprox)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType.Approx; - } - - if (reader.ValueTextEquals(MemberExact)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType.Exact; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberApprox.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType.Approx; - } - - if (string.Equals(value, MemberExact.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType.Exact; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType.Approx: - writer.WriteStringValue(MemberApprox); - break; - case Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType.Exact: - writer.WriteStringValue(MemberExact); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TokenCharConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCustom = System.Text.Json.JsonEncodedText.Encode("custom"); - private static readonly System.Text.Json.JsonEncodedText MemberDigit = System.Text.Json.JsonEncodedText.Encode("digit"); - private static readonly System.Text.Json.JsonEncodedText MemberLetter = System.Text.Json.JsonEncodedText.Encode("letter"); - private static readonly System.Text.Json.JsonEncodedText MemberPunctuation = System.Text.Json.JsonEncodedText.Encode("punctuation"); - private static readonly System.Text.Json.JsonEncodedText MemberSymbol = System.Text.Json.JsonEncodedText.Encode("symbol"); - private static readonly System.Text.Json.JsonEncodedText MemberWhitespace = System.Text.Json.JsonEncodedText.Encode("whitespace"); - - public override Elastic.Clients.Elasticsearch.Analysis.TokenChar Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCustom)) - { - return Elastic.Clients.Elasticsearch.Analysis.TokenChar.Custom; - } - - if (reader.ValueTextEquals(MemberDigit)) - { - return Elastic.Clients.Elasticsearch.Analysis.TokenChar.Digit; - } - - if (reader.ValueTextEquals(MemberLetter)) - { - return Elastic.Clients.Elasticsearch.Analysis.TokenChar.Letter; - } - - if (reader.ValueTextEquals(MemberPunctuation)) - { - return Elastic.Clients.Elasticsearch.Analysis.TokenChar.Punctuation; - } - - if (reader.ValueTextEquals(MemberSymbol)) - { - return Elastic.Clients.Elasticsearch.Analysis.TokenChar.Symbol; - } - - if (reader.ValueTextEquals(MemberWhitespace)) - { - return Elastic.Clients.Elasticsearch.Analysis.TokenChar.Whitespace; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCustom.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.TokenChar.Custom; - } - - if (string.Equals(value, MemberDigit.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.TokenChar.Digit; - } - - if (string.Equals(value, MemberLetter.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.TokenChar.Letter; - } - - if (string.Equals(value, MemberPunctuation.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.TokenChar.Punctuation; - } - - if (string.Equals(value, MemberSymbol.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.TokenChar.Symbol; - } - - if (string.Equals(value, MemberWhitespace.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.TokenChar.Whitespace; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.TokenChar)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.TokenChar value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Analysis.TokenChar.Custom: - writer.WriteStringValue(MemberCustom); - break; - case Elastic.Clients.Elasticsearch.Analysis.TokenChar.Digit: - writer.WriteStringValue(MemberDigit); - break; - case Elastic.Clients.Elasticsearch.Analysis.TokenChar.Letter: - writer.WriteStringValue(MemberLetter); - break; - case Elastic.Clients.Elasticsearch.Analysis.TokenChar.Punctuation: - writer.WriteStringValue(MemberPunctuation); - break; - case Elastic.Clients.Elasticsearch.Analysis.TokenChar.Symbol: - writer.WriteStringValue(MemberSymbol); - break; - case Elastic.Clients.Elasticsearch.Analysis.TokenChar.Whitespace: - writer.WriteStringValue(MemberWhitespace); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.TokenChar)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Analysis.TokenChar ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.TokenChar value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class CjkBigramIgnoredScriptConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberHan = System.Text.Json.JsonEncodedText.Encode("han"); - private static readonly System.Text.Json.JsonEncodedText MemberHangul = System.Text.Json.JsonEncodedText.Encode("hangul"); - private static readonly System.Text.Json.JsonEncodedText MemberHiragana = System.Text.Json.JsonEncodedText.Encode("hiragana"); - private static readonly System.Text.Json.JsonEncodedText MemberKatakana = System.Text.Json.JsonEncodedText.Encode("katakana"); - - public override Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberHan)) - { - return Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Han; - } - - if (reader.ValueTextEquals(MemberHangul)) - { - return Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Hangul; - } - - if (reader.ValueTextEquals(MemberHiragana)) - { - return Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Hiragana; - } - - if (reader.ValueTextEquals(MemberKatakana)) - { - return Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Katakana; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberHan.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Han; - } - - if (string.Equals(value, MemberHangul.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Hangul; - } - - if (string.Equals(value, MemberHiragana.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Hiragana; - } - - if (string.Equals(value, MemberKatakana.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Katakana; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Han: - writer.WriteStringValue(MemberHan); - break; - case Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Hangul: - writer.WriteStringValue(MemberHangul); - break; - case Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Hiragana: - writer.WriteStringValue(MemberHiragana); - break; - case Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Katakana: - writer.WriteStringValue(MemberKatakana); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class PhoneticLanguageConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAny = System.Text.Json.JsonEncodedText.Encode("any"); - private static readonly System.Text.Json.JsonEncodedText MemberCommon = System.Text.Json.JsonEncodedText.Encode("common"); - private static readonly System.Text.Json.JsonEncodedText MemberCyrillic = System.Text.Json.JsonEncodedText.Encode("cyrillic"); - private static readonly System.Text.Json.JsonEncodedText MemberEnglish = System.Text.Json.JsonEncodedText.Encode("english"); - private static readonly System.Text.Json.JsonEncodedText MemberFrench = System.Text.Json.JsonEncodedText.Encode("french"); - private static readonly System.Text.Json.JsonEncodedText MemberGerman = System.Text.Json.JsonEncodedText.Encode("german"); - private static readonly System.Text.Json.JsonEncodedText MemberHebrew = System.Text.Json.JsonEncodedText.Encode("hebrew"); - private static readonly System.Text.Json.JsonEncodedText MemberHungarian = System.Text.Json.JsonEncodedText.Encode("hungarian"); - private static readonly System.Text.Json.JsonEncodedText MemberPolish = System.Text.Json.JsonEncodedText.Encode("polish"); - private static readonly System.Text.Json.JsonEncodedText MemberRomanian = System.Text.Json.JsonEncodedText.Encode("romanian"); - private static readonly System.Text.Json.JsonEncodedText MemberRussian = System.Text.Json.JsonEncodedText.Encode("russian"); - private static readonly System.Text.Json.JsonEncodedText MemberSpanish = System.Text.Json.JsonEncodedText.Encode("spanish"); - - public override Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAny)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Any; - } - - if (reader.ValueTextEquals(MemberCommon)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Common; - } - - if (reader.ValueTextEquals(MemberCyrillic)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Cyrillic; - } - - if (reader.ValueTextEquals(MemberEnglish)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.English; - } - - if (reader.ValueTextEquals(MemberFrench)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.French; - } - - if (reader.ValueTextEquals(MemberGerman)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.German; - } - - if (reader.ValueTextEquals(MemberHebrew)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Hebrew; - } - - if (reader.ValueTextEquals(MemberHungarian)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Hungarian; - } - - if (reader.ValueTextEquals(MemberPolish)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Polish; - } - - if (reader.ValueTextEquals(MemberRomanian)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Romanian; - } - - if (reader.ValueTextEquals(MemberRussian)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Russian; - } - - if (reader.ValueTextEquals(MemberSpanish)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Spanish; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAny.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Any; - } - - if (string.Equals(value, MemberCommon.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Common; - } - - if (string.Equals(value, MemberCyrillic.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Cyrillic; - } - - if (string.Equals(value, MemberEnglish.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.English; - } - - if (string.Equals(value, MemberFrench.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.French; - } - - if (string.Equals(value, MemberGerman.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.German; - } - - if (string.Equals(value, MemberHebrew.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Hebrew; - } - - if (string.Equals(value, MemberHungarian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Hungarian; - } - - if (string.Equals(value, MemberPolish.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Polish; - } - - if (string.Equals(value, MemberRomanian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Romanian; - } - - if (string.Equals(value, MemberRussian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Russian; - } - - if (string.Equals(value, MemberSpanish.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Spanish; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Any: - writer.WriteStringValue(MemberAny); - break; - case Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Common: - writer.WriteStringValue(MemberCommon); - break; - case Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Cyrillic: - writer.WriteStringValue(MemberCyrillic); - break; - case Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.English: - writer.WriteStringValue(MemberEnglish); - break; - case Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.French: - writer.WriteStringValue(MemberFrench); - break; - case Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.German: - writer.WriteStringValue(MemberGerman); - break; - case Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Hebrew: - writer.WriteStringValue(MemberHebrew); - break; - case Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Hungarian: - writer.WriteStringValue(MemberHungarian); - break; - case Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Polish: - writer.WriteStringValue(MemberPolish); - break; - case Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Romanian: - writer.WriteStringValue(MemberRomanian); - break; - case Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Russian: - writer.WriteStringValue(MemberRussian); - break; - case Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage.Spanish: - writer.WriteStringValue(MemberSpanish); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguage value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class StopWordLanguageConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberArabic = System.Text.Json.JsonEncodedText.Encode("_arabic_"); - private static readonly System.Text.Json.JsonEncodedText MemberArmenian = System.Text.Json.JsonEncodedText.Encode("_armenian_"); - private static readonly System.Text.Json.JsonEncodedText MemberBasque = System.Text.Json.JsonEncodedText.Encode("_basque_"); - private static readonly System.Text.Json.JsonEncodedText MemberBengali = System.Text.Json.JsonEncodedText.Encode("_bengali_"); - private static readonly System.Text.Json.JsonEncodedText MemberBrazilian = System.Text.Json.JsonEncodedText.Encode("_brazilian_"); - private static readonly System.Text.Json.JsonEncodedText MemberBulgarian = System.Text.Json.JsonEncodedText.Encode("_bulgarian_"); - private static readonly System.Text.Json.JsonEncodedText MemberCatalan = System.Text.Json.JsonEncodedText.Encode("_catalan_"); - private static readonly System.Text.Json.JsonEncodedText MemberCjk = System.Text.Json.JsonEncodedText.Encode("_cjk_"); - private static readonly System.Text.Json.JsonEncodedText MemberCzech = System.Text.Json.JsonEncodedText.Encode("_czech_"); - private static readonly System.Text.Json.JsonEncodedText MemberDanish = System.Text.Json.JsonEncodedText.Encode("_danish_"); - private static readonly System.Text.Json.JsonEncodedText MemberDutch = System.Text.Json.JsonEncodedText.Encode("_dutch_"); - private static readonly System.Text.Json.JsonEncodedText MemberEnglish = System.Text.Json.JsonEncodedText.Encode("_english_"); - private static readonly System.Text.Json.JsonEncodedText MemberEstonian = System.Text.Json.JsonEncodedText.Encode("_estonian_"); - private static readonly System.Text.Json.JsonEncodedText MemberFinnish = System.Text.Json.JsonEncodedText.Encode("_finnish_"); - private static readonly System.Text.Json.JsonEncodedText MemberFrench = System.Text.Json.JsonEncodedText.Encode("_french_"); - private static readonly System.Text.Json.JsonEncodedText MemberGalician = System.Text.Json.JsonEncodedText.Encode("_galician_"); - private static readonly System.Text.Json.JsonEncodedText MemberGerman = System.Text.Json.JsonEncodedText.Encode("_german_"); - private static readonly System.Text.Json.JsonEncodedText MemberGreek = System.Text.Json.JsonEncodedText.Encode("_greek_"); - private static readonly System.Text.Json.JsonEncodedText MemberHindi = System.Text.Json.JsonEncodedText.Encode("_hindi_"); - private static readonly System.Text.Json.JsonEncodedText MemberHungarian = System.Text.Json.JsonEncodedText.Encode("_hungarian_"); - private static readonly System.Text.Json.JsonEncodedText MemberIndonesian = System.Text.Json.JsonEncodedText.Encode("_indonesian_"); - private static readonly System.Text.Json.JsonEncodedText MemberIrish = System.Text.Json.JsonEncodedText.Encode("_irish_"); - private static readonly System.Text.Json.JsonEncodedText MemberItalian = System.Text.Json.JsonEncodedText.Encode("_italian_"); - private static readonly System.Text.Json.JsonEncodedText MemberLatvian = System.Text.Json.JsonEncodedText.Encode("_latvian_"); - private static readonly System.Text.Json.JsonEncodedText MemberLithuanian = System.Text.Json.JsonEncodedText.Encode("_lithuanian_"); - private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("_none_"); - private static readonly System.Text.Json.JsonEncodedText MemberNorwegian = System.Text.Json.JsonEncodedText.Encode("_norwegian_"); - private static readonly System.Text.Json.JsonEncodedText MemberPersian = System.Text.Json.JsonEncodedText.Encode("_persian_"); - private static readonly System.Text.Json.JsonEncodedText MemberPortuguese = System.Text.Json.JsonEncodedText.Encode("_portuguese_"); - private static readonly System.Text.Json.JsonEncodedText MemberRomanian = System.Text.Json.JsonEncodedText.Encode("_romanian_"); - private static readonly System.Text.Json.JsonEncodedText MemberRussian = System.Text.Json.JsonEncodedText.Encode("_russian_"); - private static readonly System.Text.Json.JsonEncodedText MemberSerbian = System.Text.Json.JsonEncodedText.Encode("_serbian_"); - private static readonly System.Text.Json.JsonEncodedText MemberSorani = System.Text.Json.JsonEncodedText.Encode("_sorani_"); - private static readonly System.Text.Json.JsonEncodedText MemberSpanish = System.Text.Json.JsonEncodedText.Encode("_spanish_"); - private static readonly System.Text.Json.JsonEncodedText MemberSwedish = System.Text.Json.JsonEncodedText.Encode("_swedish_"); - private static readonly System.Text.Json.JsonEncodedText MemberThai = System.Text.Json.JsonEncodedText.Encode("_thai_"); - private static readonly System.Text.Json.JsonEncodedText MemberTurkish = System.Text.Json.JsonEncodedText.Encode("_turkish_"); - - public override Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberArabic)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Arabic; - } - - if (reader.ValueTextEquals(MemberArmenian)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Armenian; - } - - if (reader.ValueTextEquals(MemberBasque)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Basque; - } - - if (reader.ValueTextEquals(MemberBengali)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Bengali; - } - - if (reader.ValueTextEquals(MemberBrazilian)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Brazilian; - } - - if (reader.ValueTextEquals(MemberBulgarian)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Bulgarian; - } - - if (reader.ValueTextEquals(MemberCatalan)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Catalan; - } - - if (reader.ValueTextEquals(MemberCjk)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Cjk; - } - - if (reader.ValueTextEquals(MemberCzech)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Czech; - } - - if (reader.ValueTextEquals(MemberDanish)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Danish; - } - - if (reader.ValueTextEquals(MemberDutch)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Dutch; - } - - if (reader.ValueTextEquals(MemberEnglish)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.English; - } - - if (reader.ValueTextEquals(MemberEstonian)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Estonian; - } - - if (reader.ValueTextEquals(MemberFinnish)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Finnish; - } - - if (reader.ValueTextEquals(MemberFrench)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.French; - } - - if (reader.ValueTextEquals(MemberGalician)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Galician; - } - - if (reader.ValueTextEquals(MemberGerman)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.German; - } - - if (reader.ValueTextEquals(MemberGreek)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Greek; - } - - if (reader.ValueTextEquals(MemberHindi)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Hindi; - } - - if (reader.ValueTextEquals(MemberHungarian)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Hungarian; - } - - if (reader.ValueTextEquals(MemberIndonesian)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Indonesian; - } - - if (reader.ValueTextEquals(MemberIrish)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Irish; - } - - if (reader.ValueTextEquals(MemberItalian)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Italian; - } - - if (reader.ValueTextEquals(MemberLatvian)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Latvian; - } - - if (reader.ValueTextEquals(MemberLithuanian)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Lithuanian; - } - - if (reader.ValueTextEquals(MemberNone)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.None; - } - - if (reader.ValueTextEquals(MemberNorwegian)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Norwegian; - } - - if (reader.ValueTextEquals(MemberPersian)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Persian; - } - - if (reader.ValueTextEquals(MemberPortuguese)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Portuguese; - } - - if (reader.ValueTextEquals(MemberRomanian)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Romanian; - } - - if (reader.ValueTextEquals(MemberRussian)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Russian; - } - - if (reader.ValueTextEquals(MemberSerbian)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Serbian; - } - - if (reader.ValueTextEquals(MemberSorani)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Sorani; - } - - if (reader.ValueTextEquals(MemberSpanish)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Spanish; - } - - if (reader.ValueTextEquals(MemberSwedish)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Swedish; - } - - if (reader.ValueTextEquals(MemberThai)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Thai; - } - - if (reader.ValueTextEquals(MemberTurkish)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Turkish; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberArabic.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Arabic; - } - - if (string.Equals(value, MemberArmenian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Armenian; - } - - if (string.Equals(value, MemberBasque.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Basque; - } - - if (string.Equals(value, MemberBengali.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Bengali; - } - - if (string.Equals(value, MemberBrazilian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Brazilian; - } - - if (string.Equals(value, MemberBulgarian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Bulgarian; - } - - if (string.Equals(value, MemberCatalan.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Catalan; - } - - if (string.Equals(value, MemberCjk.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Cjk; - } - - if (string.Equals(value, MemberCzech.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Czech; - } - - if (string.Equals(value, MemberDanish.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Danish; - } - - if (string.Equals(value, MemberDutch.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Dutch; - } - - if (string.Equals(value, MemberEnglish.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.English; - } - - if (string.Equals(value, MemberEstonian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Estonian; - } - - if (string.Equals(value, MemberFinnish.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Finnish; - } - - if (string.Equals(value, MemberFrench.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.French; - } - - if (string.Equals(value, MemberGalician.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Galician; - } - - if (string.Equals(value, MemberGerman.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.German; - } - - if (string.Equals(value, MemberGreek.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Greek; - } - - if (string.Equals(value, MemberHindi.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Hindi; - } - - if (string.Equals(value, MemberHungarian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Hungarian; - } - - if (string.Equals(value, MemberIndonesian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Indonesian; - } - - if (string.Equals(value, MemberIrish.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Irish; - } - - if (string.Equals(value, MemberItalian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Italian; - } - - if (string.Equals(value, MemberLatvian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Latvian; - } - - if (string.Equals(value, MemberLithuanian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Lithuanian; - } - - if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.None; - } - - if (string.Equals(value, MemberNorwegian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Norwegian; - } - - if (string.Equals(value, MemberPersian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Persian; - } - - if (string.Equals(value, MemberPortuguese.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Portuguese; - } - - if (string.Equals(value, MemberRomanian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Romanian; - } - - if (string.Equals(value, MemberRussian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Russian; - } - - if (string.Equals(value, MemberSerbian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Serbian; - } - - if (string.Equals(value, MemberSorani.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Sorani; - } - - if (string.Equals(value, MemberSpanish.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Spanish; - } - - if (string.Equals(value, MemberSwedish.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Swedish; - } - - if (string.Equals(value, MemberThai.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Thai; - } - - if (string.Equals(value, MemberTurkish.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Turkish; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Arabic: - writer.WriteStringValue(MemberArabic); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Armenian: - writer.WriteStringValue(MemberArmenian); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Basque: - writer.WriteStringValue(MemberBasque); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Bengali: - writer.WriteStringValue(MemberBengali); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Brazilian: - writer.WriteStringValue(MemberBrazilian); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Bulgarian: - writer.WriteStringValue(MemberBulgarian); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Catalan: - writer.WriteStringValue(MemberCatalan); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Cjk: - writer.WriteStringValue(MemberCjk); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Czech: - writer.WriteStringValue(MemberCzech); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Danish: - writer.WriteStringValue(MemberDanish); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Dutch: - writer.WriteStringValue(MemberDutch); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.English: - writer.WriteStringValue(MemberEnglish); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Estonian: - writer.WriteStringValue(MemberEstonian); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Finnish: - writer.WriteStringValue(MemberFinnish); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.French: - writer.WriteStringValue(MemberFrench); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Galician: - writer.WriteStringValue(MemberGalician); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.German: - writer.WriteStringValue(MemberGerman); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Greek: - writer.WriteStringValue(MemberGreek); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Hindi: - writer.WriteStringValue(MemberHindi); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Hungarian: - writer.WriteStringValue(MemberHungarian); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Indonesian: - writer.WriteStringValue(MemberIndonesian); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Irish: - writer.WriteStringValue(MemberIrish); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Italian: - writer.WriteStringValue(MemberItalian); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Latvian: - writer.WriteStringValue(MemberLatvian); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Lithuanian: - writer.WriteStringValue(MemberLithuanian); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.None: - writer.WriteStringValue(MemberNone); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Norwegian: - writer.WriteStringValue(MemberNorwegian); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Persian: - writer.WriteStringValue(MemberPersian); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Portuguese: - writer.WriteStringValue(MemberPortuguese); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Romanian: - writer.WriteStringValue(MemberRomanian); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Russian: - writer.WriteStringValue(MemberRussian); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Serbian: - writer.WriteStringValue(MemberSerbian); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Sorani: - writer.WriteStringValue(MemberSorani); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Spanish: - writer.WriteStringValue(MemberSpanish); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Swedish: - writer.WriteStringValue(MemberSwedish); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Thai: - writer.WriteStringValue(MemberThai); - break; - case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Turkish: - writer.WriteStringValue(MemberTurkish); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationModeConverter))] -public enum KuromojiTokenizationMode -{ - [System.Runtime.Serialization.EnumMember(Value = "extended")] - Extended, - [System.Runtime.Serialization.EnumMember(Value = "normal")] - Normal, - [System.Runtime.Serialization.EnumMember(Value = "search")] - Search -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.NoriDecompoundModeConverter))] -public enum NoriDecompoundMode -{ - [System.Runtime.Serialization.EnumMember(Value = "discard")] - Discard, - [System.Runtime.Serialization.EnumMember(Value = "mixed")] - Mixed, - [System.Runtime.Serialization.EnumMember(Value = "none")] - None -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationModeConverter))] -public enum IcuNormalizationMode -{ - [System.Runtime.Serialization.EnumMember(Value = "compose")] - Compose, - [System.Runtime.Serialization.EnumMember(Value = "decompose")] - Decompose -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationTypeConverter))] -public enum IcuNormalizationType -{ - [System.Runtime.Serialization.EnumMember(Value = "nfc")] - Nfc, - [System.Runtime.Serialization.EnumMember(Value = "nfkc")] - Nfkc, - [System.Runtime.Serialization.EnumMember(Value = "nfkc_cf")] - NfkcCf -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncodingConverter))] -public enum DelimitedPayloadEncoding -{ - [System.Runtime.Serialization.EnumMember(Value = "float")] - Float, - [System.Runtime.Serialization.EnumMember(Value = "identity")] - Identity, - [System.Runtime.Serialization.EnumMember(Value = "int")] - Integer -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSideConverter))] -public enum EdgeNGramSide -{ - [System.Runtime.Serialization.EnumMember(Value = "back")] - Back, - [System.Runtime.Serialization.EnumMember(Value = "front")] - Front -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.KeepTypesModeConverter))] -public enum KeepTypesMode -{ - [System.Runtime.Serialization.EnumMember(Value = "exclude")] - Exclude, - [System.Runtime.Serialization.EnumMember(Value = "include")] - Include -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguagesConverter))] -public enum LowercaseTokenFilterLanguages -{ - [System.Runtime.Serialization.EnumMember(Value = "greek")] - Greek, - [System.Runtime.Serialization.EnumMember(Value = "irish")] - Irish, - [System.Runtime.Serialization.EnumMember(Value = "turkish")] - Turkish -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.SnowballLanguageConverter))] -public enum SnowballLanguage -{ - [System.Runtime.Serialization.EnumMember(Value = "Arabic")] - Arabic, - [System.Runtime.Serialization.EnumMember(Value = "Armenian")] - Armenian, - [System.Runtime.Serialization.EnumMember(Value = "Basque")] - Basque, - [System.Runtime.Serialization.EnumMember(Value = "Catalan")] - Catalan, - [System.Runtime.Serialization.EnumMember(Value = "Danish")] - Danish, - [System.Runtime.Serialization.EnumMember(Value = "Dutch")] - Dutch, - [System.Runtime.Serialization.EnumMember(Value = "English")] - English, - [System.Runtime.Serialization.EnumMember(Value = "Estonian")] - Estonian, - [System.Runtime.Serialization.EnumMember(Value = "Finnish")] - Finnish, - [System.Runtime.Serialization.EnumMember(Value = "French")] - French, - [System.Runtime.Serialization.EnumMember(Value = "German")] - German, - [System.Runtime.Serialization.EnumMember(Value = "German2")] - German2, - [System.Runtime.Serialization.EnumMember(Value = "Hungarian")] - Hungarian, - [System.Runtime.Serialization.EnumMember(Value = "Irish")] - Irish, - [System.Runtime.Serialization.EnumMember(Value = "Italian")] - Italian, - [System.Runtime.Serialization.EnumMember(Value = "Kp")] - Kp, - [System.Runtime.Serialization.EnumMember(Value = "Lithuanian")] - Lithuanian, - [System.Runtime.Serialization.EnumMember(Value = "Lovins")] - Lovins, - [System.Runtime.Serialization.EnumMember(Value = "Norwegian")] - Norwegian, - [System.Runtime.Serialization.EnumMember(Value = "Porter")] - Porter, - [System.Runtime.Serialization.EnumMember(Value = "Portuguese")] - Portuguese, - [System.Runtime.Serialization.EnumMember(Value = "Romanian")] - Romanian, - [System.Runtime.Serialization.EnumMember(Value = "Russian")] - Russian, - [System.Runtime.Serialization.EnumMember(Value = "Serbian")] - Serbian, - [System.Runtime.Serialization.EnumMember(Value = "Spanish")] - Spanish, - [System.Runtime.Serialization.EnumMember(Value = "Swedish")] - Swedish, - [System.Runtime.Serialization.EnumMember(Value = "Turkish")] - Turkish -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.SynonymFormatConverter))] -public enum SynonymFormat -{ - [System.Runtime.Serialization.EnumMember(Value = "solr")] - Solr, - [System.Runtime.Serialization.EnumMember(Value = "wordnet")] - Wordnet -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternateConverter))] -public enum IcuCollationAlternate -{ - [System.Runtime.Serialization.EnumMember(Value = "non-ignorable")] - NonIgnorable, - [System.Runtime.Serialization.EnumMember(Value = "shifted")] - Shifted -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirstConverter))] -public enum IcuCollationCaseFirst -{ - [System.Runtime.Serialization.EnumMember(Value = "lower")] - Lower, - [System.Runtime.Serialization.EnumMember(Value = "upper")] - Upper -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecompositionConverter))] -public enum IcuCollationDecomposition -{ - [System.Runtime.Serialization.EnumMember(Value = "identical")] - Identical, - [System.Runtime.Serialization.EnumMember(Value = "no")] - No -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrengthConverter))] -public enum IcuCollationStrength -{ - [System.Runtime.Serialization.EnumMember(Value = "identical")] - Identical, - [System.Runtime.Serialization.EnumMember(Value = "primary")] - Primary, - [System.Runtime.Serialization.EnumMember(Value = "quaternary")] - Quaternary, - [System.Runtime.Serialization.EnumMember(Value = "secondary")] - Secondary, - [System.Runtime.Serialization.EnumMember(Value = "tertiary")] - Tertiary -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.IcuTransformDirectionConverter))] -public enum IcuTransformDirection -{ - [System.Runtime.Serialization.EnumMember(Value = "forward")] - Forward, - [System.Runtime.Serialization.EnumMember(Value = "reverse")] - Reverse -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.PhoneticEncoderConverter))] -public enum PhoneticEncoder -{ - [System.Runtime.Serialization.EnumMember(Value = "beider_morse")] - BeiderMorse, - [System.Runtime.Serialization.EnumMember(Value = "caverphone1")] - Caverphone1, - [System.Runtime.Serialization.EnumMember(Value = "caverphone2")] - Caverphone2, - [System.Runtime.Serialization.EnumMember(Value = "cologne")] - Cologne, - [System.Runtime.Serialization.EnumMember(Value = "daitch_mokotoff")] - DaitchMokotoff, - [System.Runtime.Serialization.EnumMember(Value = "double_metaphone")] - DoubleMetaphone, - [System.Runtime.Serialization.EnumMember(Value = "haasephonetik")] - Haasephonetik, - [System.Runtime.Serialization.EnumMember(Value = "koelnerphonetik")] - Koelnerphonetik, - [System.Runtime.Serialization.EnumMember(Value = "metaphone")] - Metaphone, - [System.Runtime.Serialization.EnumMember(Value = "nysiis")] - Nysiis, - [System.Runtime.Serialization.EnumMember(Value = "refined_soundex")] - RefinedSoundex, - [System.Runtime.Serialization.EnumMember(Value = "soundex")] - Soundex -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.PhoneticNameTypeConverter))] -public enum PhoneticNameType -{ - [System.Runtime.Serialization.EnumMember(Value = "ashkenazi")] - Ashkenazi, - [System.Runtime.Serialization.EnumMember(Value = "generic")] - Generic, - [System.Runtime.Serialization.EnumMember(Value = "sephardic")] - Sephardic -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.PhoneticRuleTypeConverter))] -public enum PhoneticRuleType -{ - [System.Runtime.Serialization.EnumMember(Value = "approx")] - Approx, - [System.Runtime.Serialization.EnumMember(Value = "exact")] - Exact -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.TokenCharConverter))] -public enum TokenChar -{ - [System.Runtime.Serialization.EnumMember(Value = "custom")] - Custom, - [System.Runtime.Serialization.EnumMember(Value = "digit")] - Digit, - [System.Runtime.Serialization.EnumMember(Value = "letter")] - Letter, - [System.Runtime.Serialization.EnumMember(Value = "punctuation")] - Punctuation, - [System.Runtime.Serialization.EnumMember(Value = "symbol")] - Symbol, - [System.Runtime.Serialization.EnumMember(Value = "whitespace")] - Whitespace -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScriptConverter))] -public enum CjkBigramIgnoredScript -{ - [System.Runtime.Serialization.EnumMember(Value = "han")] - Han, - [System.Runtime.Serialization.EnumMember(Value = "hangul")] - Hangul, - [System.Runtime.Serialization.EnumMember(Value = "hiragana")] - Hiragana, - [System.Runtime.Serialization.EnumMember(Value = "katakana")] - Katakana -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguageConverter))] -public enum PhoneticLanguage -{ - [System.Runtime.Serialization.EnumMember(Value = "any")] - Any, - [System.Runtime.Serialization.EnumMember(Value = "common")] - Common, - [System.Runtime.Serialization.EnumMember(Value = "cyrillic")] - Cyrillic, - [System.Runtime.Serialization.EnumMember(Value = "english")] - English, - [System.Runtime.Serialization.EnumMember(Value = "french")] - French, - [System.Runtime.Serialization.EnumMember(Value = "german")] - German, - [System.Runtime.Serialization.EnumMember(Value = "hebrew")] - Hebrew, - [System.Runtime.Serialization.EnumMember(Value = "hungarian")] - Hungarian, - [System.Runtime.Serialization.EnumMember(Value = "polish")] - Polish, - [System.Runtime.Serialization.EnumMember(Value = "romanian")] - Romanian, - [System.Runtime.Serialization.EnumMember(Value = "russian")] - Russian, - [System.Runtime.Serialization.EnumMember(Value = "spanish")] - Spanish -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.StopWordLanguageConverter))] -public enum StopWordLanguage -{ - [System.Runtime.Serialization.EnumMember(Value = "_arabic_")] - Arabic, - [System.Runtime.Serialization.EnumMember(Value = "_armenian_")] - Armenian, - [System.Runtime.Serialization.EnumMember(Value = "_basque_")] - Basque, - [System.Runtime.Serialization.EnumMember(Value = "_bengali_")] - Bengali, - [System.Runtime.Serialization.EnumMember(Value = "_brazilian_")] - Brazilian, - [System.Runtime.Serialization.EnumMember(Value = "_bulgarian_")] - Bulgarian, - [System.Runtime.Serialization.EnumMember(Value = "_catalan_")] - Catalan, - [System.Runtime.Serialization.EnumMember(Value = "_cjk_")] - Cjk, - [System.Runtime.Serialization.EnumMember(Value = "_czech_")] - Czech, - [System.Runtime.Serialization.EnumMember(Value = "_danish_")] - Danish, - [System.Runtime.Serialization.EnumMember(Value = "_dutch_")] - Dutch, - [System.Runtime.Serialization.EnumMember(Value = "_english_")] - English, - [System.Runtime.Serialization.EnumMember(Value = "_estonian_")] - Estonian, - [System.Runtime.Serialization.EnumMember(Value = "_finnish_")] - Finnish, - [System.Runtime.Serialization.EnumMember(Value = "_french_")] - French, - [System.Runtime.Serialization.EnumMember(Value = "_galician_")] - Galician, - [System.Runtime.Serialization.EnumMember(Value = "_german_")] - German, - [System.Runtime.Serialization.EnumMember(Value = "_greek_")] - Greek, - [System.Runtime.Serialization.EnumMember(Value = "_hindi_")] - Hindi, - [System.Runtime.Serialization.EnumMember(Value = "_hungarian_")] - Hungarian, - [System.Runtime.Serialization.EnumMember(Value = "_indonesian_")] - Indonesian, - [System.Runtime.Serialization.EnumMember(Value = "_irish_")] - Irish, - [System.Runtime.Serialization.EnumMember(Value = "_italian_")] - Italian, - [System.Runtime.Serialization.EnumMember(Value = "_latvian_")] - Latvian, - [System.Runtime.Serialization.EnumMember(Value = "_lithuanian_")] - Lithuanian, - [System.Runtime.Serialization.EnumMember(Value = "_none_")] - None, - [System.Runtime.Serialization.EnumMember(Value = "_norwegian_")] - Norwegian, - [System.Runtime.Serialization.EnumMember(Value = "_persian_")] - Persian, - [System.Runtime.Serialization.EnumMember(Value = "_portuguese_")] - Portuguese, - [System.Runtime.Serialization.EnumMember(Value = "_romanian_")] - Romanian, - [System.Runtime.Serialization.EnumMember(Value = "_russian_")] - Russian, - [System.Runtime.Serialization.EnumMember(Value = "_serbian_")] - Serbian, - [System.Runtime.Serialization.EnumMember(Value = "_sorani_")] - Sorani, - [System.Runtime.Serialization.EnumMember(Value = "_spanish_")] - Spanish, - [System.Runtime.Serialization.EnumMember(Value = "_swedish_")] - Swedish, - [System.Runtime.Serialization.EnumMember(Value = "_thai_")] - Thai, - [System.Runtime.Serialization.EnumMember(Value = "_turkish_")] - Turkish -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Cluster.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Cluster.g.cs deleted file mode 100644 index 5add7364e77..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Cluster.g.cs +++ /dev/null @@ -1,720 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using System; -using System.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.Cluster; - -internal sealed partial class AllocationExplainDecisionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAlways = System.Text.Json.JsonEncodedText.Encode("ALWAYS"); - private static readonly System.Text.Json.JsonEncodedText MemberNo = System.Text.Json.JsonEncodedText.Encode("NO"); - private static readonly System.Text.Json.JsonEncodedText MemberThrottle = System.Text.Json.JsonEncodedText.Encode("THROTTLE"); - private static readonly System.Text.Json.JsonEncodedText MemberYes = System.Text.Json.JsonEncodedText.Encode("YES"); - - public override Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAlways)) - { - return Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision.Always; - } - - if (reader.ValueTextEquals(MemberNo)) - { - return Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision.No; - } - - if (reader.ValueTextEquals(MemberThrottle)) - { - return Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision.Throttle; - } - - if (reader.ValueTextEquals(MemberYes)) - { - return Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision.Yes; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAlways.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision.Always; - } - - if (string.Equals(value, MemberNo.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision.No; - } - - if (string.Equals(value, MemberThrottle.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision.Throttle; - } - - if (string.Equals(value, MemberYes.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision.Yes; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision.Always: - writer.WriteStringValue(MemberAlways); - break; - case Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision.No: - writer.WriteStringValue(MemberNo); - break; - case Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision.Throttle: - writer.WriteStringValue(MemberThrottle); - break; - case Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision.Yes: - writer.WriteStringValue(MemberYes); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecision value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class DecisionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAllocationDelayed = System.Text.Json.JsonEncodedText.Encode("allocation_delayed"); - private static readonly System.Text.Json.JsonEncodedText MemberAwaitingInfo = System.Text.Json.JsonEncodedText.Encode("awaiting_info"); - private static readonly System.Text.Json.JsonEncodedText MemberNo = System.Text.Json.JsonEncodedText.Encode("no"); - private static readonly System.Text.Json.JsonEncodedText MemberNoAttempt = System.Text.Json.JsonEncodedText.Encode("no_attempt"); - private static readonly System.Text.Json.JsonEncodedText MemberNoValidShardCopy = System.Text.Json.JsonEncodedText.Encode("no_valid_shard_copy"); - private static readonly System.Text.Json.JsonEncodedText MemberThrottled = System.Text.Json.JsonEncodedText.Encode("throttled"); - private static readonly System.Text.Json.JsonEncodedText MemberWorseBalance = System.Text.Json.JsonEncodedText.Encode("worse_balance"); - private static readonly System.Text.Json.JsonEncodedText MemberYes = System.Text.Json.JsonEncodedText.Encode("yes"); - - public override Elastic.Clients.Elasticsearch.Cluster.Decision Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAllocationDelayed)) - { - return Elastic.Clients.Elasticsearch.Cluster.Decision.AllocationDelayed; - } - - if (reader.ValueTextEquals(MemberAwaitingInfo)) - { - return Elastic.Clients.Elasticsearch.Cluster.Decision.AwaitingInfo; - } - - if (reader.ValueTextEquals(MemberNo)) - { - return Elastic.Clients.Elasticsearch.Cluster.Decision.No; - } - - if (reader.ValueTextEquals(MemberNoAttempt)) - { - return Elastic.Clients.Elasticsearch.Cluster.Decision.NoAttempt; - } - - if (reader.ValueTextEquals(MemberNoValidShardCopy)) - { - return Elastic.Clients.Elasticsearch.Cluster.Decision.NoValidShardCopy; - } - - if (reader.ValueTextEquals(MemberThrottled)) - { - return Elastic.Clients.Elasticsearch.Cluster.Decision.Throttled; - } - - if (reader.ValueTextEquals(MemberWorseBalance)) - { - return Elastic.Clients.Elasticsearch.Cluster.Decision.WorseBalance; - } - - if (reader.ValueTextEquals(MemberYes)) - { - return Elastic.Clients.Elasticsearch.Cluster.Decision.Yes; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAllocationDelayed.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.Decision.AllocationDelayed; - } - - if (string.Equals(value, MemberAwaitingInfo.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.Decision.AwaitingInfo; - } - - if (string.Equals(value, MemberNo.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.Decision.No; - } - - if (string.Equals(value, MemberNoAttempt.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.Decision.NoAttempt; - } - - if (string.Equals(value, MemberNoValidShardCopy.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.Decision.NoValidShardCopy; - } - - if (string.Equals(value, MemberThrottled.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.Decision.Throttled; - } - - if (string.Equals(value, MemberWorseBalance.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.Decision.WorseBalance; - } - - if (string.Equals(value, MemberYes.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.Decision.Yes; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Cluster.Decision)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.Decision value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Cluster.Decision.AllocationDelayed: - writer.WriteStringValue(MemberAllocationDelayed); - break; - case Elastic.Clients.Elasticsearch.Cluster.Decision.AwaitingInfo: - writer.WriteStringValue(MemberAwaitingInfo); - break; - case Elastic.Clients.Elasticsearch.Cluster.Decision.No: - writer.WriteStringValue(MemberNo); - break; - case Elastic.Clients.Elasticsearch.Cluster.Decision.NoAttempt: - writer.WriteStringValue(MemberNoAttempt); - break; - case Elastic.Clients.Elasticsearch.Cluster.Decision.NoValidShardCopy: - writer.WriteStringValue(MemberNoValidShardCopy); - break; - case Elastic.Clients.Elasticsearch.Cluster.Decision.Throttled: - writer.WriteStringValue(MemberThrottled); - break; - case Elastic.Clients.Elasticsearch.Cluster.Decision.WorseBalance: - writer.WriteStringValue(MemberWorseBalance); - break; - case Elastic.Clients.Elasticsearch.Cluster.Decision.Yes: - writer.WriteStringValue(MemberYes); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Cluster.Decision)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Cluster.Decision ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.Decision value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class UnassignedInformationReasonConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAllocationFailed = System.Text.Json.JsonEncodedText.Encode("ALLOCATION_FAILED"); - private static readonly System.Text.Json.JsonEncodedText MemberClusterRecovered = System.Text.Json.JsonEncodedText.Encode("CLUSTER_RECOVERED"); - private static readonly System.Text.Json.JsonEncodedText MemberDanglingIndexImported = System.Text.Json.JsonEncodedText.Encode("DANGLING_INDEX_IMPORTED"); - private static readonly System.Text.Json.JsonEncodedText MemberExistingIndexRestored = System.Text.Json.JsonEncodedText.Encode("EXISTING_INDEX_RESTORED"); - private static readonly System.Text.Json.JsonEncodedText MemberForcedEmptyPrimary = System.Text.Json.JsonEncodedText.Encode("FORCED_EMPTY_PRIMARY"); - private static readonly System.Text.Json.JsonEncodedText MemberIndexCreated = System.Text.Json.JsonEncodedText.Encode("INDEX_CREATED"); - private static readonly System.Text.Json.JsonEncodedText MemberIndexReopened = System.Text.Json.JsonEncodedText.Encode("INDEX_REOPENED"); - private static readonly System.Text.Json.JsonEncodedText MemberManualAllocation = System.Text.Json.JsonEncodedText.Encode("MANUAL_ALLOCATION"); - private static readonly System.Text.Json.JsonEncodedText MemberNewIndexRestored = System.Text.Json.JsonEncodedText.Encode("NEW_INDEX_RESTORED"); - private static readonly System.Text.Json.JsonEncodedText MemberNodeLeft = System.Text.Json.JsonEncodedText.Encode("NODE_LEFT"); - private static readonly System.Text.Json.JsonEncodedText MemberPrimaryFailed = System.Text.Json.JsonEncodedText.Encode("PRIMARY_FAILED"); - private static readonly System.Text.Json.JsonEncodedText MemberReallocatedReplica = System.Text.Json.JsonEncodedText.Encode("REALLOCATED_REPLICA"); - private static readonly System.Text.Json.JsonEncodedText MemberReinitialized = System.Text.Json.JsonEncodedText.Encode("REINITIALIZED"); - private static readonly System.Text.Json.JsonEncodedText MemberReplicaAdded = System.Text.Json.JsonEncodedText.Encode("REPLICA_ADDED"); - private static readonly System.Text.Json.JsonEncodedText MemberRerouteCancelled = System.Text.Json.JsonEncodedText.Encode("REROUTE_CANCELLED"); - - public override Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAllocationFailed)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.AllocationFailed; - } - - if (reader.ValueTextEquals(MemberClusterRecovered)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ClusterRecovered; - } - - if (reader.ValueTextEquals(MemberDanglingIndexImported)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.DanglingIndexImported; - } - - if (reader.ValueTextEquals(MemberExistingIndexRestored)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ExistingIndexRestored; - } - - if (reader.ValueTextEquals(MemberForcedEmptyPrimary)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ForcedEmptyPrimary; - } - - if (reader.ValueTextEquals(MemberIndexCreated)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.IndexCreated; - } - - if (reader.ValueTextEquals(MemberIndexReopened)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.IndexReopened; - } - - if (reader.ValueTextEquals(MemberManualAllocation)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ManualAllocation; - } - - if (reader.ValueTextEquals(MemberNewIndexRestored)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.NewIndexRestored; - } - - if (reader.ValueTextEquals(MemberNodeLeft)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.NodeLeft; - } - - if (reader.ValueTextEquals(MemberPrimaryFailed)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.PrimaryFailed; - } - - if (reader.ValueTextEquals(MemberReallocatedReplica)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ReallocatedReplica; - } - - if (reader.ValueTextEquals(MemberReinitialized)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.Reinitialized; - } - - if (reader.ValueTextEquals(MemberReplicaAdded)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ReplicaAdded; - } - - if (reader.ValueTextEquals(MemberRerouteCancelled)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.RerouteCancelled; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAllocationFailed.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.AllocationFailed; - } - - if (string.Equals(value, MemberClusterRecovered.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ClusterRecovered; - } - - if (string.Equals(value, MemberDanglingIndexImported.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.DanglingIndexImported; - } - - if (string.Equals(value, MemberExistingIndexRestored.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ExistingIndexRestored; - } - - if (string.Equals(value, MemberForcedEmptyPrimary.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ForcedEmptyPrimary; - } - - if (string.Equals(value, MemberIndexCreated.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.IndexCreated; - } - - if (string.Equals(value, MemberIndexReopened.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.IndexReopened; - } - - if (string.Equals(value, MemberManualAllocation.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ManualAllocation; - } - - if (string.Equals(value, MemberNewIndexRestored.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.NewIndexRestored; - } - - if (string.Equals(value, MemberNodeLeft.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.NodeLeft; - } - - if (string.Equals(value, MemberPrimaryFailed.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.PrimaryFailed; - } - - if (string.Equals(value, MemberReallocatedReplica.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ReallocatedReplica; - } - - if (string.Equals(value, MemberReinitialized.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.Reinitialized; - } - - if (string.Equals(value, MemberReplicaAdded.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ReplicaAdded; - } - - if (string.Equals(value, MemberRerouteCancelled.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.RerouteCancelled; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.AllocationFailed: - writer.WriteStringValue(MemberAllocationFailed); - break; - case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ClusterRecovered: - writer.WriteStringValue(MemberClusterRecovered); - break; - case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.DanglingIndexImported: - writer.WriteStringValue(MemberDanglingIndexImported); - break; - case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ExistingIndexRestored: - writer.WriteStringValue(MemberExistingIndexRestored); - break; - case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ForcedEmptyPrimary: - writer.WriteStringValue(MemberForcedEmptyPrimary); - break; - case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.IndexCreated: - writer.WriteStringValue(MemberIndexCreated); - break; - case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.IndexReopened: - writer.WriteStringValue(MemberIndexReopened); - break; - case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ManualAllocation: - writer.WriteStringValue(MemberManualAllocation); - break; - case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.NewIndexRestored: - writer.WriteStringValue(MemberNewIndexRestored); - break; - case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.NodeLeft: - writer.WriteStringValue(MemberNodeLeft); - break; - case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.PrimaryFailed: - writer.WriteStringValue(MemberPrimaryFailed); - break; - case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ReallocatedReplica: - writer.WriteStringValue(MemberReallocatedReplica); - break; - case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.Reinitialized: - writer.WriteStringValue(MemberReinitialized); - break; - case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.ReplicaAdded: - writer.WriteStringValue(MemberReplicaAdded); - break; - case Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason.RerouteCancelled: - writer.WriteStringValue(MemberRerouteCancelled); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReason value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ShardStateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAborted = System.Text.Json.JsonEncodedText.Encode("ABORTED"); - private static readonly System.Text.Json.JsonEncodedText MemberFailed = System.Text.Json.JsonEncodedText.Encode("FAILED"); - private static readonly System.Text.Json.JsonEncodedText MemberInit = System.Text.Json.JsonEncodedText.Encode("INIT"); - private static readonly System.Text.Json.JsonEncodedText MemberMissing = System.Text.Json.JsonEncodedText.Encode("MISSING"); - private static readonly System.Text.Json.JsonEncodedText MemberPausedForNodeRemoval = System.Text.Json.JsonEncodedText.Encode("PAUSED_FOR_NODE_REMOVAL"); - private static readonly System.Text.Json.JsonEncodedText MemberQueued = System.Text.Json.JsonEncodedText.Encode("QUEUED"); - private static readonly System.Text.Json.JsonEncodedText MemberSuccess = System.Text.Json.JsonEncodedText.Encode("SUCCESS"); - private static readonly System.Text.Json.JsonEncodedText MemberWaiting = System.Text.Json.JsonEncodedText.Encode("WAITING"); - - public override Elastic.Clients.Elasticsearch.Cluster.ShardState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAborted)) - { - return Elastic.Clients.Elasticsearch.Cluster.ShardState.Aborted; - } - - if (reader.ValueTextEquals(MemberFailed)) - { - return Elastic.Clients.Elasticsearch.Cluster.ShardState.Failed; - } - - if (reader.ValueTextEquals(MemberInit)) - { - return Elastic.Clients.Elasticsearch.Cluster.ShardState.Init; - } - - if (reader.ValueTextEquals(MemberMissing)) - { - return Elastic.Clients.Elasticsearch.Cluster.ShardState.Missing; - } - - if (reader.ValueTextEquals(MemberPausedForNodeRemoval)) - { - return Elastic.Clients.Elasticsearch.Cluster.ShardState.PausedForNodeRemoval; - } - - if (reader.ValueTextEquals(MemberQueued)) - { - return Elastic.Clients.Elasticsearch.Cluster.ShardState.Queued; - } - - if (reader.ValueTextEquals(MemberSuccess)) - { - return Elastic.Clients.Elasticsearch.Cluster.ShardState.Success; - } - - if (reader.ValueTextEquals(MemberWaiting)) - { - return Elastic.Clients.Elasticsearch.Cluster.ShardState.Waiting; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAborted.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.ShardState.Aborted; - } - - if (string.Equals(value, MemberFailed.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.ShardState.Failed; - } - - if (string.Equals(value, MemberInit.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.ShardState.Init; - } - - if (string.Equals(value, MemberMissing.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.ShardState.Missing; - } - - if (string.Equals(value, MemberPausedForNodeRemoval.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.ShardState.PausedForNodeRemoval; - } - - if (string.Equals(value, MemberQueued.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.ShardState.Queued; - } - - if (string.Equals(value, MemberSuccess.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.ShardState.Success; - } - - if (string.Equals(value, MemberWaiting.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Cluster.ShardState.Waiting; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Cluster.ShardState)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ShardState value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Cluster.ShardState.Aborted: - writer.WriteStringValue(MemberAborted); - break; - case Elastic.Clients.Elasticsearch.Cluster.ShardState.Failed: - writer.WriteStringValue(MemberFailed); - break; - case Elastic.Clients.Elasticsearch.Cluster.ShardState.Init: - writer.WriteStringValue(MemberInit); - break; - case Elastic.Clients.Elasticsearch.Cluster.ShardState.Missing: - writer.WriteStringValue(MemberMissing); - break; - case Elastic.Clients.Elasticsearch.Cluster.ShardState.PausedForNodeRemoval: - writer.WriteStringValue(MemberPausedForNodeRemoval); - break; - case Elastic.Clients.Elasticsearch.Cluster.ShardState.Queued: - writer.WriteStringValue(MemberQueued); - break; - case Elastic.Clients.Elasticsearch.Cluster.ShardState.Success: - writer.WriteStringValue(MemberSuccess); - break; - case Elastic.Clients.Elasticsearch.Cluster.ShardState.Waiting: - writer.WriteStringValue(MemberWaiting); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Cluster.ShardState)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Cluster.ShardState ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ShardState value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.AllocationExplainDecisionConverter))] -public enum AllocationExplainDecision -{ - [System.Runtime.Serialization.EnumMember(Value = "ALWAYS")] - Always, - [System.Runtime.Serialization.EnumMember(Value = "NO")] - No, - [System.Runtime.Serialization.EnumMember(Value = "THROTTLE")] - Throttle, - [System.Runtime.Serialization.EnumMember(Value = "YES")] - Yes -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.DecisionConverter))] -public enum Decision -{ - [System.Runtime.Serialization.EnumMember(Value = "allocation_delayed")] - AllocationDelayed, - [System.Runtime.Serialization.EnumMember(Value = "awaiting_info")] - AwaitingInfo, - [System.Runtime.Serialization.EnumMember(Value = "no")] - No, - [System.Runtime.Serialization.EnumMember(Value = "no_attempt")] - NoAttempt, - [System.Runtime.Serialization.EnumMember(Value = "no_valid_shard_copy")] - NoValidShardCopy, - [System.Runtime.Serialization.EnumMember(Value = "throttled")] - Throttled, - [System.Runtime.Serialization.EnumMember(Value = "worse_balance")] - WorseBalance, - [System.Runtime.Serialization.EnumMember(Value = "yes")] - Yes -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.UnassignedInformationReasonConverter))] -public enum UnassignedInformationReason -{ - [System.Runtime.Serialization.EnumMember(Value = "ALLOCATION_FAILED")] - AllocationFailed, - [System.Runtime.Serialization.EnumMember(Value = "CLUSTER_RECOVERED")] - ClusterRecovered, - [System.Runtime.Serialization.EnumMember(Value = "DANGLING_INDEX_IMPORTED")] - DanglingIndexImported, - [System.Runtime.Serialization.EnumMember(Value = "EXISTING_INDEX_RESTORED")] - ExistingIndexRestored, - [System.Runtime.Serialization.EnumMember(Value = "FORCED_EMPTY_PRIMARY")] - ForcedEmptyPrimary, - [System.Runtime.Serialization.EnumMember(Value = "INDEX_CREATED")] - IndexCreated, - [System.Runtime.Serialization.EnumMember(Value = "INDEX_REOPENED")] - IndexReopened, - [System.Runtime.Serialization.EnumMember(Value = "MANUAL_ALLOCATION")] - ManualAllocation, - [System.Runtime.Serialization.EnumMember(Value = "NEW_INDEX_RESTORED")] - NewIndexRestored, - [System.Runtime.Serialization.EnumMember(Value = "NODE_LEFT")] - NodeLeft, - [System.Runtime.Serialization.EnumMember(Value = "PRIMARY_FAILED")] - PrimaryFailed, - [System.Runtime.Serialization.EnumMember(Value = "REALLOCATED_REPLICA")] - ReallocatedReplica, - [System.Runtime.Serialization.EnumMember(Value = "REINITIALIZED")] - Reinitialized, - [System.Runtime.Serialization.EnumMember(Value = "REPLICA_ADDED")] - ReplicaAdded, - [System.Runtime.Serialization.EnumMember(Value = "REROUTE_CANCELLED")] - RerouteCancelled -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.ShardStateConverter))] -public enum ShardState -{ - [System.Runtime.Serialization.EnumMember(Value = "ABORTED")] - Aborted, - [System.Runtime.Serialization.EnumMember(Value = "FAILED")] - Failed, - [System.Runtime.Serialization.EnumMember(Value = "INIT")] - Init, - [System.Runtime.Serialization.EnumMember(Value = "MISSING")] - Missing, - [System.Runtime.Serialization.EnumMember(Value = "PAUSED_FOR_NODE_REMOVAL")] - PausedForNodeRemoval, - [System.Runtime.Serialization.EnumMember(Value = "QUEUED")] - Queued, - [System.Runtime.Serialization.EnumMember(Value = "SUCCESS")] - Success, - [System.Runtime.Serialization.EnumMember(Value = "WAITING")] - Waiting -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.Search.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.Search.g.cs deleted file mode 100644 index fcfb1b69248..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Core.Search.g.cs +++ /dev/null @@ -1,848 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using System; -using System.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.Core.Search; - -internal sealed partial class HighlighterTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Core.Search.HighlighterType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Core.Search.HighlighterType(reader.ReadValue(options, null)); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.HighlighterType value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Value, null); - } -} - -internal sealed partial class BoundaryScannerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberChars = System.Text.Json.JsonEncodedText.Encode("chars"); - private static readonly System.Text.Json.JsonEncodedText MemberSentence = System.Text.Json.JsonEncodedText.Encode("sentence"); - private static readonly System.Text.Json.JsonEncodedText MemberWord = System.Text.Json.JsonEncodedText.Encode("word"); - - public override Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberChars)) - { - return Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner.Chars; - } - - if (reader.ValueTextEquals(MemberSentence)) - { - return Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner.Sentence; - } - - if (reader.ValueTextEquals(MemberWord)) - { - return Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner.Word; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberChars.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner.Chars; - } - - if (string.Equals(value, MemberSentence.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner.Sentence; - } - - if (string.Equals(value, MemberWord.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner.Word; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner.Chars: - writer.WriteStringValue(MemberChars); - break; - case Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner.Sentence: - writer.WriteStringValue(MemberSentence); - break; - case Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner.Word: - writer.WriteStringValue(MemberWord); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.BoundaryScanner value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class HighlighterFragmenterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberSimple = System.Text.Json.JsonEncodedText.Encode("simple"); - private static readonly System.Text.Json.JsonEncodedText MemberSpan = System.Text.Json.JsonEncodedText.Encode("span"); - - public override Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberSimple)) - { - return Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter.Simple; - } - - if (reader.ValueTextEquals(MemberSpan)) - { - return Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter.Span; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberSimple.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter.Simple; - } - - if (string.Equals(value, MemberSpan.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter.Span; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter.Simple: - writer.WriteStringValue(MemberSimple); - break; - case Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter.Span: - writer.WriteStringValue(MemberSpan); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenter value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class HighlighterOrderConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberScore = System.Text.Json.JsonEncodedText.Encode("score"); - - public override Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberScore)) - { - return Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder.Score; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberScore.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder.Score; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder.Score: - writer.WriteStringValue(MemberScore); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrder value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class HighlighterTagsSchemaConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberStyled = System.Text.Json.JsonEncodedText.Encode("styled"); - - public override Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberStyled)) - { - return Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema.Styled; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberStyled.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema.Styled; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema.Styled: - writer.WriteStringValue(MemberStyled); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchema value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class HighlighterEncoderConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberDefault = System.Text.Json.JsonEncodedText.Encode("default"); - private static readonly System.Text.Json.JsonEncodedText MemberHtml = System.Text.Json.JsonEncodedText.Encode("html"); - - public override Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberDefault)) - { - return Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder.Default; - } - - if (reader.ValueTextEquals(MemberHtml)) - { - return Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder.Html; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberDefault.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder.Default; - } - - if (string.Equals(value, MemberHtml.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder.Html; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder.Default: - writer.WriteStringValue(MemberDefault); - break; - case Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder.Html: - writer.WriteStringValue(MemberHtml); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoder value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TotalHitsRelationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberEq = System.Text.Json.JsonEncodedText.Encode("eq"); - private static readonly System.Text.Json.JsonEncodedText MemberGte = System.Text.Json.JsonEncodedText.Encode("gte"); - - public override Elastic.Clients.Elasticsearch.Core.Search.TotalHitsRelation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberEq)) - { - return Elastic.Clients.Elasticsearch.Core.Search.TotalHitsRelation.Eq; - } - - if (reader.ValueTextEquals(MemberGte)) - { - return Elastic.Clients.Elasticsearch.Core.Search.TotalHitsRelation.Gte; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberEq.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Search.TotalHitsRelation.Eq; - } - - if (string.Equals(value, MemberGte.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Search.TotalHitsRelation.Gte; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.TotalHitsRelation)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.TotalHitsRelation value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Core.Search.TotalHitsRelation.Eq: - writer.WriteStringValue(MemberEq); - break; - case Elastic.Clients.Elasticsearch.Core.Search.TotalHitsRelation.Gte: - writer.WriteStringValue(MemberGte); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.TotalHitsRelation)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Core.Search.TotalHitsRelation ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.TotalHitsRelation value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ScoreModeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAvg = System.Text.Json.JsonEncodedText.Encode("avg"); - private static readonly System.Text.Json.JsonEncodedText MemberMax = System.Text.Json.JsonEncodedText.Encode("max"); - private static readonly System.Text.Json.JsonEncodedText MemberMin = System.Text.Json.JsonEncodedText.Encode("min"); - private static readonly System.Text.Json.JsonEncodedText MemberMultiply = System.Text.Json.JsonEncodedText.Encode("multiply"); - private static readonly System.Text.Json.JsonEncodedText MemberTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Core.Search.ScoreMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAvg)) - { - return Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Avg; - } - - if (reader.ValueTextEquals(MemberMax)) - { - return Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Max; - } - - if (reader.ValueTextEquals(MemberMin)) - { - return Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Min; - } - - if (reader.ValueTextEquals(MemberMultiply)) - { - return Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Multiply; - } - - if (reader.ValueTextEquals(MemberTotal)) - { - return Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Total; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAvg.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Avg; - } - - if (string.Equals(value, MemberMax.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Max; - } - - if (string.Equals(value, MemberMin.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Min; - } - - if (string.Equals(value, MemberMultiply.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Multiply; - } - - if (string.Equals(value, MemberTotal.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Total; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.ScoreMode)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.ScoreMode value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Avg: - writer.WriteStringValue(MemberAvg); - break; - case Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Max: - writer.WriteStringValue(MemberMax); - break; - case Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Min: - writer.WriteStringValue(MemberMin); - break; - case Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Multiply: - writer.WriteStringValue(MemberMultiply); - break; - case Elastic.Clients.Elasticsearch.Core.Search.ScoreMode.Total: - writer.WriteStringValue(MemberTotal); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.ScoreMode)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Core.Search.ScoreMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.ScoreMode value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class SuggestSortConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberFrequency = System.Text.Json.JsonEncodedText.Encode("frequency"); - private static readonly System.Text.Json.JsonEncodedText MemberScore = System.Text.Json.JsonEncodedText.Encode("score"); - - public override Elastic.Clients.Elasticsearch.Core.Search.SuggestSort Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberFrequency)) - { - return Elastic.Clients.Elasticsearch.Core.Search.SuggestSort.Frequency; - } - - if (reader.ValueTextEquals(MemberScore)) - { - return Elastic.Clients.Elasticsearch.Core.Search.SuggestSort.Score; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberFrequency.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Search.SuggestSort.Frequency; - } - - if (string.Equals(value, MemberScore.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Search.SuggestSort.Score; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.SuggestSort)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.SuggestSort value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Core.Search.SuggestSort.Frequency: - writer.WriteStringValue(MemberFrequency); - break; - case Elastic.Clients.Elasticsearch.Core.Search.SuggestSort.Score: - writer.WriteStringValue(MemberScore); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.SuggestSort)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Core.Search.SuggestSort ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.SuggestSort value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class StringDistanceConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberDamerauLevenshtein = System.Text.Json.JsonEncodedText.Encode("damerau_levenshtein"); - private static readonly System.Text.Json.JsonEncodedText MemberInternal = System.Text.Json.JsonEncodedText.Encode("internal"); - private static readonly System.Text.Json.JsonEncodedText MemberJaroWinkler = System.Text.Json.JsonEncodedText.Encode("jaro_winkler"); - private static readonly System.Text.Json.JsonEncodedText MemberLevenshtein = System.Text.Json.JsonEncodedText.Encode("levenshtein"); - private static readonly System.Text.Json.JsonEncodedText MemberNgram = System.Text.Json.JsonEncodedText.Encode("ngram"); - - public override Elastic.Clients.Elasticsearch.Core.Search.StringDistance Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberDamerauLevenshtein)) - { - return Elastic.Clients.Elasticsearch.Core.Search.StringDistance.DamerauLevenshtein; - } - - if (reader.ValueTextEquals(MemberInternal)) - { - return Elastic.Clients.Elasticsearch.Core.Search.StringDistance.Internal; - } - - if (reader.ValueTextEquals(MemberJaroWinkler)) - { - return Elastic.Clients.Elasticsearch.Core.Search.StringDistance.JaroWinkler; - } - - if (reader.ValueTextEquals(MemberLevenshtein)) - { - return Elastic.Clients.Elasticsearch.Core.Search.StringDistance.Levenshtein; - } - - if (reader.ValueTextEquals(MemberNgram)) - { - return Elastic.Clients.Elasticsearch.Core.Search.StringDistance.Ngram; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberDamerauLevenshtein.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Search.StringDistance.DamerauLevenshtein; - } - - if (string.Equals(value, MemberInternal.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Search.StringDistance.Internal; - } - - if (string.Equals(value, MemberJaroWinkler.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Search.StringDistance.JaroWinkler; - } - - if (string.Equals(value, MemberLevenshtein.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Search.StringDistance.Levenshtein; - } - - if (string.Equals(value, MemberNgram.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Core.Search.StringDistance.Ngram; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.StringDistance)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.StringDistance value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Core.Search.StringDistance.DamerauLevenshtein: - writer.WriteStringValue(MemberDamerauLevenshtein); - break; - case Elastic.Clients.Elasticsearch.Core.Search.StringDistance.Internal: - writer.WriteStringValue(MemberInternal); - break; - case Elastic.Clients.Elasticsearch.Core.Search.StringDistance.JaroWinkler: - writer.WriteStringValue(MemberJaroWinkler); - break; - case Elastic.Clients.Elasticsearch.Core.Search.StringDistance.Levenshtein: - writer.WriteStringValue(MemberLevenshtein); - break; - case Elastic.Clients.Elasticsearch.Core.Search.StringDistance.Ngram: - writer.WriteStringValue(MemberNgram); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Core.Search.StringDistance)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Core.Search.StringDistance ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Search.StringDistance value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.HighlighterTypeConverter))] -public readonly partial struct HighlighterType : Elastic.Clients.Elasticsearch.Serialization.IEnumStruct -{ - public HighlighterType(string value) => Value = value; -#if NET7_0_OR_GREATER - static HighlighterType IEnumStruct.Create(string value) => value; -#else - HighlighterType IEnumStruct.Create(string value) => value; -#endif - public readonly string Value { get; } - - /// - /// - /// The fvh highlighter uses the Lucene Fast Vector highlighter. - /// - /// - public static HighlighterType FastVector { get; } = new HighlighterType("fvh"); - - /// - /// - /// The plain highlighter uses the standard Lucene highlighter - /// - /// - public static HighlighterType Plain { get; } = new HighlighterType("plain"); - - /// - /// - /// The unified highlighter uses the Lucene Unified Highlighter. - /// - /// - public static HighlighterType Unified { get; } = new HighlighterType("unified"); - - public override string ToString() => Value ?? string.Empty; - - public static implicit operator string(HighlighterType @enum) => @enum.Value; - public static implicit operator HighlighterType(string value) => new(value); - - public override int GetHashCode() => Value.GetHashCode(); - public override bool Equals(object obj) => obj is HighlighterType other && this.Equals(other); - public bool Equals(HighlighterType other) => Value == other.Value; - - public static bool operator ==(HighlighterType a, HighlighterType b) => a.Equals(b); - public static bool operator !=(HighlighterType a, HighlighterType b) => !(a == b); -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.BoundaryScannerConverter))] -public enum BoundaryScanner -{ - /// - /// - /// Use the characters specified by boundary_chars as highlighting boundaries. - /// The boundary_max_scan setting controls how far to scan for boundary characters. - /// Only valid for the fvh highlighter. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "chars")] - Chars, - /// - /// - /// Break highlighted fragments at the next sentence boundary, as determined by Java’s BreakIterator. - /// You can specify the locale to use with boundary_scanner_locale. - /// When used with the unified highlighter, the sentence scanner splits sentences bigger than fragment_size at the first word boundary next to fragment_size. - /// You can set fragment_size to 0 to never split any sentence. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "sentence")] - Sentence, - /// - /// - /// Break highlighted fragments at the next word boundary, as determined by Java’s BreakIterator. - /// You can specify the locale to use with boundary_scanner_locale. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "word")] - Word -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.HighlighterFragmenterConverter))] -public enum HighlighterFragmenter -{ - [System.Runtime.Serialization.EnumMember(Value = "simple")] - Simple, - [System.Runtime.Serialization.EnumMember(Value = "span")] - Span -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.HighlighterOrderConverter))] -public enum HighlighterOrder -{ - [System.Runtime.Serialization.EnumMember(Value = "score")] - Score -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.HighlighterTagsSchemaConverter))] -public enum HighlighterTagsSchema -{ - [System.Runtime.Serialization.EnumMember(Value = "styled")] - Styled -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.HighlighterEncoderConverter))] -public enum HighlighterEncoder -{ - [System.Runtime.Serialization.EnumMember(Value = "default")] - Default, - [System.Runtime.Serialization.EnumMember(Value = "html")] - Html -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.TotalHitsRelationConverter))] -public enum TotalHitsRelation -{ - /// - /// - /// Accurate - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "eq")] - Eq, - /// - /// - /// Lower bound, including returned events or sequences - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "gte")] - Gte -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.ScoreModeConverter))] -public enum ScoreMode -{ - /// - /// - /// Average the original score and the rescore query score. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "avg")] - Avg, - /// - /// - /// Take the max of original score and the rescore query score. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "max")] - Max, - /// - /// - /// Take the min of the original score and the rescore query score. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "min")] - Min, - /// - /// - /// Multiply the original score by the rescore query score. - /// Useful for function query rescores. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "multiply")] - Multiply, - /// - /// - /// Add the original score and the rescore query score. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "total")] - Total -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.SuggestSortConverter))] -public enum SuggestSort -{ - /// - /// - /// Sort by document frequency first, then similarity score and then the term itself. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "frequency")] - Frequency, - /// - /// - /// Sort by score first, then document frequency and then the term itself. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "score")] - Score -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.StringDistanceConverter))] -public enum StringDistance -{ - /// - /// - /// String distance algorithm based on Damerau-Levenshtein algorithm. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "damerau_levenshtein")] - DamerauLevenshtein, - /// - /// - /// Based on the Damerau-Levenshtein algorithm, but highly optimized for comparing string distance for terms inside the index. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "internal")] - Internal, - /// - /// - /// String distance algorithm based on Jaro-Winkler algorithm. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "jaro_winkler")] - JaroWinkler, - /// - /// - /// String distance algorithm based on the Levenshtein edit distance algorithm. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "levenshtein")] - Levenshtein, - /// - /// - /// String distance algorithm based on character n-grams. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "ngram")] - Ngram -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.IndexManagement.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.IndexManagement.g.cs deleted file mode 100644 index a0dfdb6757d..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.IndexManagement.g.cs +++ /dev/null @@ -1,1604 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using System; -using System.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.IndexManagement; - -internal sealed partial class FeatureConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); - private static readonly System.Text.Json.JsonEncodedText MemberMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); - private static readonly System.Text.Json.JsonEncodedText MemberSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.Feature Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAliases)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.Feature.Aliases; - } - - if (reader.ValueTextEquals(MemberMappings)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.Feature.Mappings; - } - - if (reader.ValueTextEquals(MemberSettings)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.Feature.Settings; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAliases.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.Feature.Aliases; - } - - if (string.Equals(value, MemberMappings.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.Feature.Mappings; - } - - if (string.Equals(value, MemberSettings.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.Feature.Settings; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.Feature)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.Feature value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.IndexManagement.Feature.Aliases: - writer.WriteStringValue(MemberAliases); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.Feature.Mappings: - writer.WriteStringValue(MemberMappings); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.Feature.Settings: - writer.WriteStringValue(MemberSettings); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.Feature)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.IndexManagement.Feature ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.Feature value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ModeEnumConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberUpgrade = System.Text.Json.JsonEncodedText.Encode("upgrade"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ModeEnum Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberUpgrade)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ModeEnum.Upgrade; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberUpgrade.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ModeEnum.Upgrade; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.ModeEnum)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ModeEnum value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.IndexManagement.ModeEnum.Upgrade: - writer.WriteStringValue(MemberUpgrade); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.ModeEnum)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.IndexManagement.ModeEnum ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ModeEnum value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ShardStoreAllocationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberPrimary = System.Text.Json.JsonEncodedText.Encode("primary"); - private static readonly System.Text.Json.JsonEncodedText MemberReplica = System.Text.Json.JsonEncodedText.Encode("replica"); - private static readonly System.Text.Json.JsonEncodedText MemberUnused = System.Text.Json.JsonEncodedText.Encode("unused"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberPrimary)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation.Primary; - } - - if (reader.ValueTextEquals(MemberReplica)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation.Replica; - } - - if (reader.ValueTextEquals(MemberUnused)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation.Unused; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberPrimary.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation.Primary; - } - - if (string.Equals(value, MemberReplica.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation.Replica; - } - - if (string.Equals(value, MemberUnused.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation.Unused; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation.Primary: - writer.WriteStringValue(MemberPrimary); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation.Replica: - writer.WriteStringValue(MemberReplica); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation.Unused: - writer.WriteStringValue(MemberUnused); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ShardStoreStatusConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAll = System.Text.Json.JsonEncodedText.Encode("all"); - private static readonly System.Text.Json.JsonEncodedText MemberGreen = System.Text.Json.JsonEncodedText.Encode("green"); - private static readonly System.Text.Json.JsonEncodedText MemberRed = System.Text.Json.JsonEncodedText.Encode("red"); - private static readonly System.Text.Json.JsonEncodedText MemberYellow = System.Text.Json.JsonEncodedText.Encode("yellow"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAll)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus.All; - } - - if (reader.ValueTextEquals(MemberGreen)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus.Green; - } - - if (reader.ValueTextEquals(MemberRed)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus.Red; - } - - if (reader.ValueTextEquals(MemberYellow)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus.Yellow; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAll.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus.All; - } - - if (string.Equals(value, MemberGreen.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus.Green; - } - - if (string.Equals(value, MemberRed.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus.Red; - } - - if (string.Equals(value, MemberYellow.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus.Yellow; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus.All: - writer.WriteStringValue(MemberAll); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus.Green: - writer.WriteStringValue(MemberGreen); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus.Red: - writer.WriteStringValue(MemberRed); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus.Yellow: - writer.WriteStringValue(MemberYellow); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class IndexMetadataStateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberClose = System.Text.Json.JsonEncodedText.Encode("close"); - private static readonly System.Text.Json.JsonEncodedText MemberOpen = System.Text.Json.JsonEncodedText.Encode("open"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberClose)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState.Close; - } - - if (reader.ValueTextEquals(MemberOpen)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState.Open; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberClose.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState.Close; - } - - if (string.Equals(value, MemberOpen.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState.Open; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState.Close: - writer.WriteStringValue(MemberClose); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState.Open: - writer.WriteStringValue(MemberOpen); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ShardRoutingStateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberInitializing = System.Text.Json.JsonEncodedText.Encode("INITIALIZING"); - private static readonly System.Text.Json.JsonEncodedText MemberRelocating = System.Text.Json.JsonEncodedText.Encode("RELOCATING"); - private static readonly System.Text.Json.JsonEncodedText MemberStarted = System.Text.Json.JsonEncodedText.Encode("STARTED"); - private static readonly System.Text.Json.JsonEncodedText MemberUnassigned = System.Text.Json.JsonEncodedText.Encode("UNASSIGNED"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberInitializing)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState.Initializing; - } - - if (reader.ValueTextEquals(MemberRelocating)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState.Relocating; - } - - if (reader.ValueTextEquals(MemberStarted)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState.Started; - } - - if (reader.ValueTextEquals(MemberUnassigned)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState.Unassigned; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberInitializing.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState.Initializing; - } - - if (string.Equals(value, MemberRelocating.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState.Relocating; - } - - if (string.Equals(value, MemberStarted.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState.Started; - } - - if (string.Equals(value, MemberUnassigned.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState.Unassigned; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState.Initializing: - writer.WriteStringValue(MemberInitializing); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState.Relocating: - writer.WriteStringValue(MemberRelocating); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState.Started: - writer.WriteStringValue(MemberStarted); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState.Unassigned: - writer.WriteStringValue(MemberUnassigned); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class IndicesBlockOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText MemberRead = System.Text.Json.JsonEncodedText.Encode("read"); - private static readonly System.Text.Json.JsonEncodedText MemberReadOnly = System.Text.Json.JsonEncodedText.Encode("read_only"); - private static readonly System.Text.Json.JsonEncodedText MemberWrite = System.Text.Json.JsonEncodedText.Encode("write"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberMetadata)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions.Metadata; - } - - if (reader.ValueTextEquals(MemberRead)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions.Read; - } - - if (reader.ValueTextEquals(MemberReadOnly)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions.ReadOnly; - } - - if (reader.ValueTextEquals(MemberWrite)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions.Write; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberMetadata.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions.Metadata; - } - - if (string.Equals(value, MemberRead.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions.Read; - } - - if (string.Equals(value, MemberReadOnly.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions.ReadOnly; - } - - if (string.Equals(value, MemberWrite.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions.Write; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions.Metadata: - writer.WriteStringValue(MemberMetadata); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions.Read: - writer.WriteStringValue(MemberRead); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions.ReadOnly: - writer.WriteStringValue(MemberReadOnly); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions.Write: - writer.WriteStringValue(MemberWrite); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class IndexCheckOnStartupConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberChecksum = System.Text.Json.JsonEncodedText.Encode("checksum"); - private static readonly System.Text.Json.JsonEncodedText MemberFalse = System.Text.Json.JsonEncodedText.Encode("false"); - private static readonly System.Text.Json.JsonEncodedText MemberTrue = System.Text.Json.JsonEncodedText.Encode("true"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberChecksum)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup.Checksum; - } - - if (reader.ValueTextEquals(MemberFalse)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup.False; - } - - if (reader.ValueTextEquals(MemberTrue)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup.True; - } - - if (reader.TokenType is not System.Text.Json.JsonTokenType.String) - { - throw new System.Text.Json.JsonException($"Unknown member of type '{reader.TokenType}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup)}'."); - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberChecksum.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup.Checksum; - } - - if (string.Equals(value, MemberFalse.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup.False; - } - - if (string.Equals(value, MemberTrue.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup.True; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup.Checksum: - writer.WriteStringValue(MemberChecksum); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup.False: - writer.WriteRawValue(MemberFalse.EncodedUtf8Bytes); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup.True: - writer.WriteRawValue(MemberTrue.EncodedUtf8Bytes); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ManagedByConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberDatastream = System.Text.Json.JsonEncodedText.Encode("Data stream lifecycle"); - private static readonly System.Text.Json.JsonEncodedText MemberIlm = System.Text.Json.JsonEncodedText.Encode("Index Lifecycle Management"); - private static readonly System.Text.Json.JsonEncodedText MemberUnmanaged = System.Text.Json.JsonEncodedText.Encode("Unmanaged"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberDatastream)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy.Datastream; - } - - if (reader.ValueTextEquals(MemberIlm)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy.Ilm; - } - - if (reader.ValueTextEquals(MemberUnmanaged)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy.Unmanaged; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberDatastream.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy.Datastream; - } - - if (string.Equals(value, MemberIlm.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy.Ilm; - } - - if (string.Equals(value, MemberUnmanaged.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy.Unmanaged; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy.Datastream: - writer.WriteStringValue(MemberDatastream); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy.Ilm: - writer.WriteStringValue(MemberIlm); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy.Unmanaged: - writer.WriteStringValue(MemberUnmanaged); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class IndexModeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberLogsdb = System.Text.Json.JsonEncodedText.Encode("logsdb"); - private static readonly System.Text.Json.JsonEncodedText MemberLookup = System.Text.Json.JsonEncodedText.Encode("lookup"); - private static readonly System.Text.Json.JsonEncodedText MemberStandard = System.Text.Json.JsonEncodedText.Encode("standard"); - private static readonly System.Text.Json.JsonEncodedText MemberTimeSeries = System.Text.Json.JsonEncodedText.Encode("time_series"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberLogsdb)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexMode.Logsdb; - } - - if (reader.ValueTextEquals(MemberLookup)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexMode.Lookup; - } - - if (reader.ValueTextEquals(MemberStandard)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexMode.Standard; - } - - if (reader.ValueTextEquals(MemberTimeSeries)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexMode.TimeSeries; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberLogsdb.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexMode.Logsdb; - } - - if (string.Equals(value, MemberLookup.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexMode.Lookup; - } - - if (string.Equals(value, MemberStandard.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexMode.Standard; - } - - if (string.Equals(value, MemberTimeSeries.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexMode.TimeSeries; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndexMode)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexMode value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.IndexManagement.IndexMode.Logsdb: - writer.WriteStringValue(MemberLogsdb); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.IndexMode.Lookup: - writer.WriteStringValue(MemberLookup); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.IndexMode.Standard: - writer.WriteStringValue(MemberStandard); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.IndexMode.TimeSeries: - writer.WriteStringValue(MemberTimeSeries); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndexMode)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexMode value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TranslogDurabilityConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAsync = System.Text.Json.JsonEncodedText.Encode("async"); - private static readonly System.Text.Json.JsonEncodedText MemberAsync1 = System.Text.Json.JsonEncodedText.Encode("ASYNC"); - private static readonly System.Text.Json.JsonEncodedText MemberRequest = System.Text.Json.JsonEncodedText.Encode("request"); - private static readonly System.Text.Json.JsonEncodedText MemberRequest1 = System.Text.Json.JsonEncodedText.Encode("REQUEST"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAsync) || reader.ValueTextEquals(MemberAsync1)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability.Async; - } - - if (reader.ValueTextEquals(MemberRequest) || reader.ValueTextEquals(MemberRequest1)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability.Request; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAsync.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberAsync1.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability.Async; - } - - if (string.Equals(value, MemberRequest.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberRequest1.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability.Request; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability.Async: - writer.WriteStringValue(MemberAsync); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability.Request: - writer.WriteStringValue(MemberRequest); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class StorageTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.StorageType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.IndexManagement.StorageType(reader.ReadValue(options, null)); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.StorageType value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Value, null); - } -} - -internal sealed partial class IndexRoutingAllocationOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAll = System.Text.Json.JsonEncodedText.Encode("all"); - private static readonly System.Text.Json.JsonEncodedText MemberNewPrimaries = System.Text.Json.JsonEncodedText.Encode("new_primaries"); - private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); - private static readonly System.Text.Json.JsonEncodedText MemberPrimaries = System.Text.Json.JsonEncodedText.Encode("primaries"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAll)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions.All; - } - - if (reader.ValueTextEquals(MemberNewPrimaries)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions.NewPrimaries; - } - - if (reader.ValueTextEquals(MemberNone)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions.None; - } - - if (reader.ValueTextEquals(MemberPrimaries)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions.Primaries; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAll.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions.All; - } - - if (string.Equals(value, MemberNewPrimaries.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions.NewPrimaries; - } - - if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions.None; - } - - if (string.Equals(value, MemberPrimaries.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions.Primaries; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions.All: - writer.WriteStringValue(MemberAll); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions.NewPrimaries: - writer.WriteStringValue(MemberNewPrimaries); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions.None: - writer.WriteStringValue(MemberNone); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions.Primaries: - writer.WriteStringValue(MemberPrimaries); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class IndexRoutingRebalanceOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAll = System.Text.Json.JsonEncodedText.Encode("all"); - private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); - private static readonly System.Text.Json.JsonEncodedText MemberPrimaries = System.Text.Json.JsonEncodedText.Encode("primaries"); - private static readonly System.Text.Json.JsonEncodedText MemberReplicas = System.Text.Json.JsonEncodedText.Encode("replicas"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAll)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions.All; - } - - if (reader.ValueTextEquals(MemberNone)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions.None; - } - - if (reader.ValueTextEquals(MemberPrimaries)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions.Primaries; - } - - if (reader.ValueTextEquals(MemberReplicas)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions.Replicas; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAll.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions.All; - } - - if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions.None; - } - - if (string.Equals(value, MemberPrimaries.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions.Primaries; - } - - if (string.Equals(value, MemberReplicas.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions.Replicas; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions.All: - writer.WriteStringValue(MemberAll); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions.None: - writer.WriteStringValue(MemberNone); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions.Primaries: - writer.WriteStringValue(MemberPrimaries); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions.Replicas: - writer.WriteStringValue(MemberReplicas); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class SegmentSortOrderConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAsc = System.Text.Json.JsonEncodedText.Encode("asc"); - private static readonly System.Text.Json.JsonEncodedText MemberAsc1 = System.Text.Json.JsonEncodedText.Encode("ASC"); - private static readonly System.Text.Json.JsonEncodedText MemberDesc = System.Text.Json.JsonEncodedText.Encode("desc"); - private static readonly System.Text.Json.JsonEncodedText MemberDesc1 = System.Text.Json.JsonEncodedText.Encode("DESC"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortOrder Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAsc) || reader.ValueTextEquals(MemberAsc1)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortOrder.Asc; - } - - if (reader.ValueTextEquals(MemberDesc) || reader.ValueTextEquals(MemberDesc1)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortOrder.Desc; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAsc.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberAsc1.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortOrder.Asc; - } - - if (string.Equals(value, MemberDesc.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberDesc1.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortOrder.Desc; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortOrder)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortOrder value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortOrder.Asc: - writer.WriteStringValue(MemberAsc); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortOrder.Desc: - writer.WriteStringValue(MemberDesc); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortOrder)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortOrder ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortOrder value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class SegmentSortModeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberMax = System.Text.Json.JsonEncodedText.Encode("max"); - private static readonly System.Text.Json.JsonEncodedText MemberMax1 = System.Text.Json.JsonEncodedText.Encode("MAX"); - private static readonly System.Text.Json.JsonEncodedText MemberMin = System.Text.Json.JsonEncodedText.Encode("min"); - private static readonly System.Text.Json.JsonEncodedText MemberMin1 = System.Text.Json.JsonEncodedText.Encode("MIN"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberMax) || reader.ValueTextEquals(MemberMax1)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMode.Max; - } - - if (reader.ValueTextEquals(MemberMin) || reader.ValueTextEquals(MemberMin1)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMode.Min; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberMax.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberMax1.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMode.Max; - } - - if (string.Equals(value, MemberMin.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberMin1.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMode.Min; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMode)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMode value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMode.Max: - writer.WriteStringValue(MemberMax); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMode.Min: - writer.WriteStringValue(MemberMin); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMode)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMode value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class SegmentSortMissingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberFirst = System.Text.Json.JsonEncodedText.Encode("_first"); - private static readonly System.Text.Json.JsonEncodedText MemberLast = System.Text.Json.JsonEncodedText.Encode("_last"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMissing Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberFirst)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMissing.First; - } - - if (reader.ValueTextEquals(MemberLast)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMissing.Last; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberFirst.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMissing.First; - } - - if (string.Equals(value, MemberLast.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMissing.Last; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMissing)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMissing value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMissing.First: - writer.WriteStringValue(MemberFirst); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMissing.Last: - writer.WriteStringValue(MemberLast); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMissing)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMissing ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMissing value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class SourceModeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberDisabled = System.Text.Json.JsonEncodedText.Encode("disabled"); - private static readonly System.Text.Json.JsonEncodedText MemberStored = System.Text.Json.JsonEncodedText.Encode("stored"); - private static readonly System.Text.Json.JsonEncodedText MemberSynthetic = System.Text.Json.JsonEncodedText.Encode("synthetic"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SourceMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberDisabled)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.SourceMode.Disabled; - } - - if (reader.ValueTextEquals(MemberStored)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.SourceMode.Stored; - } - - if (reader.ValueTextEquals(MemberSynthetic)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.SourceMode.Synthetic; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberDisabled.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.SourceMode.Disabled; - } - - if (string.Equals(value, MemberStored.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.SourceMode.Stored; - } - - if (string.Equals(value, MemberSynthetic.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.SourceMode.Synthetic; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.SourceMode)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SourceMode value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.IndexManagement.SourceMode.Disabled: - writer.WriteStringValue(MemberDisabled); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.SourceMode.Stored: - writer.WriteStringValue(MemberStored); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.SourceMode.Synthetic: - writer.WriteStringValue(MemberSynthetic); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.SourceMode)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.IndexManagement.SourceMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SourceMode value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class NumericFielddataFormatConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberArray = System.Text.Json.JsonEncodedText.Encode("array"); - private static readonly System.Text.Json.JsonEncodedText MemberDisabled = System.Text.Json.JsonEncodedText.Encode("disabled"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataFormat Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberArray)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataFormat.Array; - } - - if (reader.ValueTextEquals(MemberDisabled)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataFormat.Disabled; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberArray.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataFormat.Array; - } - - if (string.Equals(value, MemberDisabled.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataFormat.Disabled; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataFormat)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataFormat value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataFormat.Array: - writer.WriteStringValue(MemberArray); - break; - case Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataFormat.Disabled: - writer.WriteStringValue(MemberDisabled); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataFormat)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataFormat ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataFormat value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.FeatureConverter))] -public enum Feature -{ - [System.Runtime.Serialization.EnumMember(Value = "aliases")] - Aliases, - [System.Runtime.Serialization.EnumMember(Value = "mappings")] - Mappings, - [System.Runtime.Serialization.EnumMember(Value = "settings")] - Settings -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ModeEnumConverter))] -public enum ModeEnum -{ - [System.Runtime.Serialization.EnumMember(Value = "upgrade")] - Upgrade -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocationConverter))] -public enum ShardStoreAllocation -{ - [System.Runtime.Serialization.EnumMember(Value = "primary")] - Primary, - [System.Runtime.Serialization.EnumMember(Value = "replica")] - Replica, - [System.Runtime.Serialization.EnumMember(Value = "unused")] - Unused -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatusConverter))] -public enum ShardStoreStatus -{ - /// - /// - /// Return all shards, regardless of health status. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "all")] - All, - /// - /// - /// The primary shard and all replica shards are assigned. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "green")] - Green, - /// - /// - /// The primary shard is unassigned. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "red")] - Red, - /// - /// - /// One or more replica shards are unassigned. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "yellow")] - Yellow -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataStateConverter))] -public enum IndexMetadataState -{ - [System.Runtime.Serialization.EnumMember(Value = "close")] - Close, - [System.Runtime.Serialization.EnumMember(Value = "open")] - Open -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingStateConverter))] -public enum ShardRoutingState -{ - [System.Runtime.Serialization.EnumMember(Value = "INITIALIZING")] - Initializing, - [System.Runtime.Serialization.EnumMember(Value = "RELOCATING")] - Relocating, - [System.Runtime.Serialization.EnumMember(Value = "STARTED")] - Started, - [System.Runtime.Serialization.EnumMember(Value = "UNASSIGNED")] - Unassigned -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptionsConverter))] -public enum IndicesBlockOptions -{ - /// - /// - /// Disable metadata changes, such as closing the index. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "metadata")] - Metadata, - /// - /// - /// Disable read operations. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "read")] - Read, - /// - /// - /// Disable write operations and metadata changes. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "read_only")] - ReadOnly, - /// - /// - /// Disable write operations. However, metadata changes are still allowed. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "write")] - Write -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartupConverter))] -public enum IndexCheckOnStartup -{ - [System.Runtime.Serialization.EnumMember(Value = "checksum")] - Checksum, - [System.Runtime.Serialization.EnumMember(Value = "false")] - False, - [System.Runtime.Serialization.EnumMember(Value = "true")] - True -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ManagedByConverter))] -public enum ManagedBy -{ - [System.Runtime.Serialization.EnumMember(Value = "Data stream lifecycle")] - Datastream, - [System.Runtime.Serialization.EnumMember(Value = "Index Lifecycle Management")] - Ilm, - [System.Runtime.Serialization.EnumMember(Value = "Unmanaged")] - Unmanaged -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexModeConverter))] -public enum IndexMode -{ - [System.Runtime.Serialization.EnumMember(Value = "logsdb")] - Logsdb, - [System.Runtime.Serialization.EnumMember(Value = "lookup")] - Lookup, - [System.Runtime.Serialization.EnumMember(Value = "standard")] - Standard, - [System.Runtime.Serialization.EnumMember(Value = "time_series")] - TimeSeries -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurabilityConverter))] -public enum TranslogDurability -{ - /// - /// - /// fsync and commit in the background every sync_interval. In the event of a failure, all acknowledged writes - /// since the last automatic commit will be discarded. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "async")] - Async, - /// - /// - /// (default) fsync and commit after every request. In the event of hardware failure, all acknowledged writes - /// will already have been committed to disk. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "request")] - Request -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.StorageTypeConverter))] -public readonly partial struct StorageType : Elastic.Clients.Elasticsearch.Serialization.IEnumStruct -{ - public StorageType(string value) => Value = value; -#if NET7_0_OR_GREATER - static StorageType IEnumStruct.Create(string value) => value; -#else - StorageType IEnumStruct.Create(string value) => value; -#endif - public readonly string Value { get; } - - /// - /// - /// Default file system implementation. This will pick the best implementation depending on the operating environment, which - /// is currently hybridfs on all supported systems but is subject to change. - /// - /// - public static StorageType Fs { get; } = new StorageType("fs"); - - /// - /// - /// The hybridfs type is a hybrid of niofs and mmapfs, which chooses the best file system type for each type of file - /// based on the read access pattern. Currently only the Lucene term dictionary, norms and doc values files are memory - /// mapped. All other files are opened using Lucene NIOFSDirectory. Similarly to mmapfs be sure you have allowed - /// plenty of virtual address space. - /// - /// - public static StorageType Hybridfs { get; } = new StorageType("hybridfs"); - - /// - /// - /// The MMap FS type stores the shard index on the file system (maps to Lucene MMapDirectory) by mapping a file into - /// memory (mmap). Memory mapping uses up a portion of the virtual memory address space in your process equal to the size - /// of the file being mapped. Before using this class, be sure you have allowed plenty of virtual address space. - /// - /// - public static StorageType Mmapfs { get; } = new StorageType("mmapfs"); - - /// - /// - /// The NIO FS type stores the shard index on the file system (maps to Lucene NIOFSDirectory) using NIO. It allows multiple - /// threads to read from the same file concurrently. It is not recommended on Windows because of a bug in the SUN Java - /// implementation and disables some optimizations for heap memory usage. - /// - /// - public static StorageType Niofs { get; } = new StorageType("niofs"); - - public override string ToString() => Value ?? string.Empty; - - public static implicit operator string(StorageType @enum) => @enum.Value; - public static implicit operator StorageType(string value) => new(value); - - public override int GetHashCode() => Value.GetHashCode(); - public override bool Equals(object obj) => obj is StorageType other && this.Equals(other); - public bool Equals(StorageType other) => Value == other.Value; - - public static bool operator ==(StorageType a, StorageType b) => a.Equals(b); - public static bool operator !=(StorageType a, StorageType b) => !(a == b); -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptionsConverter))] -public enum IndexRoutingAllocationOptions -{ - [System.Runtime.Serialization.EnumMember(Value = "all")] - All, - [System.Runtime.Serialization.EnumMember(Value = "new_primaries")] - NewPrimaries, - [System.Runtime.Serialization.EnumMember(Value = "none")] - None, - [System.Runtime.Serialization.EnumMember(Value = "primaries")] - Primaries -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptionsConverter))] -public enum IndexRoutingRebalanceOptions -{ - [System.Runtime.Serialization.EnumMember(Value = "all")] - All, - [System.Runtime.Serialization.EnumMember(Value = "none")] - None, - [System.Runtime.Serialization.EnumMember(Value = "primaries")] - Primaries, - [System.Runtime.Serialization.EnumMember(Value = "replicas")] - Replicas -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortOrderConverter))] -public enum SegmentSortOrder -{ - [System.Runtime.Serialization.EnumMember(Value = "asc")] - Asc, - [System.Runtime.Serialization.EnumMember(Value = "desc")] - Desc -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortModeConverter))] -public enum SegmentSortMode -{ - [System.Runtime.Serialization.EnumMember(Value = "max")] - Max, - [System.Runtime.Serialization.EnumMember(Value = "min")] - Min -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMissingConverter))] -public enum SegmentSortMissing -{ - [System.Runtime.Serialization.EnumMember(Value = "_first")] - First, - [System.Runtime.Serialization.EnumMember(Value = "_last")] - Last -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SourceModeConverter))] -public enum SourceMode -{ - [System.Runtime.Serialization.EnumMember(Value = "disabled")] - Disabled, - [System.Runtime.Serialization.EnumMember(Value = "stored")] - Stored, - [System.Runtime.Serialization.EnumMember(Value = "synthetic")] - Synthetic -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataFormatConverter))] -public enum NumericFielddataFormat -{ - [System.Runtime.Serialization.EnumMember(Value = "array")] - Array, - [System.Runtime.Serialization.EnumMember(Value = "disabled")] - Disabled -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Inference.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Inference.g.cs deleted file mode 100644 index 51aa882c314..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Inference.g.cs +++ /dev/null @@ -1,3914 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using System; -using System.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.Inference; - -internal sealed partial class TaskTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); - private static readonly System.Text.Json.JsonEncodedText MemberSparseEmbedding = System.Text.Json.JsonEncodedText.Encode("sparse_embedding"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.TaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberChatCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskType.ChatCompletion; - } - - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskType.Completion; - } - - if (reader.ValueTextEquals(MemberRerank)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskType.Rerank; - } - - if (reader.ValueTextEquals(MemberSparseEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskType.SparseEmbedding; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskType.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskType.ChatCompletion; - } - - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskType.Completion; - } - - if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskType.Rerank; - } - - if (string.Equals(value, MemberSparseEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskType.SparseEmbedding; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskType.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.TaskType.ChatCompletion: - writer.WriteStringValue(MemberChatCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskType.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskType.Rerank: - writer.WriteStringValue(MemberRerank); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskType.SparseEmbedding: - writer.WriteStringValue(MemberSparseEmbedding); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskType.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.TaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class Ai21TaskTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - - public override Elastic.Clients.Elasticsearch.Inference.Ai21TaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberChatCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.Ai21TaskType.ChatCompletion; - } - - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.Ai21TaskType.Completion; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.Ai21TaskType.ChatCompletion; - } - - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.Ai21TaskType.Completion; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.Ai21TaskType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.Ai21TaskType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.Ai21TaskType.ChatCompletion: - writer.WriteStringValue(MemberChatCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.Ai21TaskType.Completion: - writer.WriteStringValue(MemberCompletion); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.Ai21TaskType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.Ai21TaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.Ai21TaskType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class AlibabaCloudTaskTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); - private static readonly System.Text.Json.JsonEncodedText MemberSpaceEmbedding = System.Text.Json.JsonEncodedText.Encode("space_embedding"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType.Completion; - } - - if (reader.ValueTextEquals(MemberRerank)) - { - return Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType.Rerank; - } - - if (reader.ValueTextEquals(MemberSpaceEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType.SpaceEmbedding; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType.Completion; - } - - if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType.Rerank; - } - - if (string.Equals(value, MemberSpaceEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType.SpaceEmbedding; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType.Rerank: - writer.WriteStringValue(MemberRerank); - break; - case Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType.SpaceEmbedding: - writer.WriteStringValue(MemberSpaceEmbedding); - break; - case Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class AmazonBedrockTaskTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType.Completion; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType.Completion; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TaskTypeAmazonSageMakerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); - private static readonly System.Text.Json.JsonEncodedText MemberSparseEmbedding = System.Text.Json.JsonEncodedText.Encode("sparse_embedding"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberChatCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.ChatCompletion; - } - - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.Completion; - } - - if (reader.ValueTextEquals(MemberRerank)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.Rerank; - } - - if (reader.ValueTextEquals(MemberSparseEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.SparseEmbedding; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.ChatCompletion; - } - - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.Completion; - } - - if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.Rerank; - } - - if (string.Equals(value, MemberSparseEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.SparseEmbedding; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.ChatCompletion: - writer.WriteStringValue(MemberChatCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.Rerank: - writer.WriteStringValue(MemberRerank); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.SparseEmbedding: - writer.WriteStringValue(MemberSparseEmbedding); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class AnthropicTaskTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - - public override Elastic.Clients.Elasticsearch.Inference.AnthropicTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.AnthropicTaskType.Completion; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.AnthropicTaskType.Completion; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.AnthropicTaskType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AnthropicTaskType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.AnthropicTaskType.Completion: - writer.WriteStringValue(MemberCompletion); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.AnthropicTaskType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.AnthropicTaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AnthropicTaskType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class AzureAiStudioTaskTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType.Completion; - } - - if (reader.ValueTextEquals(MemberRerank)) - { - return Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType.Rerank; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType.Completion; - } - - if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType.Rerank; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType.Rerank: - writer.WriteStringValue(MemberRerank); - break; - case Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class AzureOpenAITaskTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskType.Completion; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskType.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskType.Completion; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskType.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskType.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskType.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class CohereTaskTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.CohereTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereTaskType.Completion; - } - - if (reader.ValueTextEquals(MemberRerank)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereTaskType.Rerank; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereTaskType.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereTaskType.Completion; - } - - if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereTaskType.Rerank; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereTaskType.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.CohereTaskType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CohereTaskType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.CohereTaskType.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.CohereTaskType.Rerank: - writer.WriteStringValue(MemberRerank); - break; - case Elastic.Clients.Elasticsearch.Inference.CohereTaskType.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.CohereTaskType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.CohereTaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CohereTaskType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class CustomTaskTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); - private static readonly System.Text.Json.JsonEncodedText MemberSparseEmbedding = System.Text.Json.JsonEncodedText.Encode("sparse_embedding"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.CustomTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.CustomTaskType.Completion; - } - - if (reader.ValueTextEquals(MemberRerank)) - { - return Elastic.Clients.Elasticsearch.Inference.CustomTaskType.Rerank; - } - - if (reader.ValueTextEquals(MemberSparseEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.CustomTaskType.SparseEmbedding; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.CustomTaskType.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.CustomTaskType.Completion; - } - - if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.CustomTaskType.Rerank; - } - - if (string.Equals(value, MemberSparseEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.CustomTaskType.SparseEmbedding; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.CustomTaskType.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.CustomTaskType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CustomTaskType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.CustomTaskType.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.CustomTaskType.Rerank: - writer.WriteStringValue(MemberRerank); - break; - case Elastic.Clients.Elasticsearch.Inference.CustomTaskType.SparseEmbedding: - writer.WriteStringValue(MemberSparseEmbedding); - break; - case Elastic.Clients.Elasticsearch.Inference.CustomTaskType.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.CustomTaskType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.CustomTaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CustomTaskType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TaskTypeDeepSeekConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeDeepSeek Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberChatCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeDeepSeek.ChatCompletion; - } - - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeDeepSeek.Completion; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeDeepSeek.ChatCompletion; - } - - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeDeepSeek.Completion; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeDeepSeek)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeDeepSeek value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.TaskTypeDeepSeek.ChatCompletion: - writer.WriteStringValue(MemberChatCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeDeepSeek.Completion: - writer.WriteStringValue(MemberCompletion); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeDeepSeek)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeDeepSeek ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeDeepSeek value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ElasticsearchTaskTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); - private static readonly System.Text.Json.JsonEncodedText MemberSparseEmbedding = System.Text.Json.JsonEncodedText.Encode("sparse_embedding"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberRerank)) - { - return Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType.Rerank; - } - - if (reader.ValueTextEquals(MemberSparseEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType.SparseEmbedding; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType.Rerank; - } - - if (string.Equals(value, MemberSparseEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType.SparseEmbedding; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType.Rerank: - writer.WriteStringValue(MemberRerank); - break; - case Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType.SparseEmbedding: - writer.WriteStringValue(MemberSparseEmbedding); - break; - case Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ElserTaskTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberSparseEmbedding = System.Text.Json.JsonEncodedText.Encode("sparse_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.ElserTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberSparseEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.ElserTaskType.SparseEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberSparseEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.ElserTaskType.SparseEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.ElserTaskType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ElserTaskType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.ElserTaskType.SparseEmbedding: - writer.WriteStringValue(MemberSparseEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.ElserTaskType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.ElserTaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ElserTaskType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class GoogleAiStudioTaskTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioTaskType.Completion; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioTaskType.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioTaskType.Completion; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioTaskType.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioTaskType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioTaskType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioTaskType.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioTaskType.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioTaskType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioTaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioTaskType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class GoogleVertexAITaskTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberChatCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType.ChatCompletion; - } - - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType.Completion; - } - - if (reader.ValueTextEquals(MemberRerank)) - { - return Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType.Rerank; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType.ChatCompletion; - } - - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType.Completion; - } - - if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType.Rerank; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType.ChatCompletion: - writer.WriteStringValue(MemberChatCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType.Rerank: - writer.WriteStringValue(MemberRerank); - break; - case Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class HuggingFaceTaskTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberChatCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType.ChatCompletion; - } - - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType.Completion; - } - - if (reader.ValueTextEquals(MemberRerank)) - { - return Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType.Rerank; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType.ChatCompletion; - } - - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType.Completion; - } - - if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType.Rerank; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType.ChatCompletion: - writer.WriteStringValue(MemberChatCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType.Rerank: - writer.WriteStringValue(MemberRerank); - break; - case Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class JinaAITaskTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.JinaAITaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberRerank)) - { - return Elastic.Clients.Elasticsearch.Inference.JinaAITaskType.Rerank; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.JinaAITaskType.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.JinaAITaskType.Rerank; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.JinaAITaskType.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.JinaAITaskType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.JinaAITaskType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.JinaAITaskType.Rerank: - writer.WriteStringValue(MemberRerank); - break; - case Elastic.Clients.Elasticsearch.Inference.JinaAITaskType.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.JinaAITaskType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.JinaAITaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.JinaAITaskType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class LlamaTaskTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.LlamaTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberChatCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.LlamaTaskType.ChatCompletion; - } - - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.LlamaTaskType.Completion; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.LlamaTaskType.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.LlamaTaskType.ChatCompletion; - } - - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.LlamaTaskType.Completion; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.LlamaTaskType.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.LlamaTaskType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.LlamaTaskType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.LlamaTaskType.ChatCompletion: - writer.WriteStringValue(MemberChatCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.LlamaTaskType.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.LlamaTaskType.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.LlamaTaskType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.LlamaTaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.LlamaTaskType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class MistralTaskTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.MistralTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberChatCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.MistralTaskType.ChatCompletion; - } - - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.MistralTaskType.Completion; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.MistralTaskType.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.MistralTaskType.ChatCompletion; - } - - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.MistralTaskType.Completion; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.MistralTaskType.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.MistralTaskType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.MistralTaskType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.MistralTaskType.ChatCompletion: - writer.WriteStringValue(MemberChatCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.MistralTaskType.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.MistralTaskType.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.MistralTaskType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.MistralTaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.MistralTaskType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class OpenAITaskTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.OpenAITaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberChatCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.OpenAITaskType.ChatCompletion; - } - - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.OpenAITaskType.Completion; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.OpenAITaskType.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.OpenAITaskType.ChatCompletion; - } - - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.OpenAITaskType.Completion; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.OpenAITaskType.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.OpenAITaskType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.OpenAITaskType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.OpenAITaskType.ChatCompletion: - writer.WriteStringValue(MemberChatCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.OpenAITaskType.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.OpenAITaskType.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.OpenAITaskType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.OpenAITaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.OpenAITaskType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class VoyageAITaskTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.VoyageAITaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberRerank)) - { - return Elastic.Clients.Elasticsearch.Inference.VoyageAITaskType.Rerank; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.VoyageAITaskType.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.VoyageAITaskType.Rerank; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.VoyageAITaskType.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.VoyageAITaskType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.VoyageAITaskType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.VoyageAITaskType.Rerank: - writer.WriteStringValue(MemberRerank); - break; - case Elastic.Clients.Elasticsearch.Inference.VoyageAITaskType.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.VoyageAITaskType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.VoyageAITaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.VoyageAITaskType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class WatsonxTaskTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberChatCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.ChatCompletion; - } - - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.Completion; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.ChatCompletion; - } - - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.Completion; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.ChatCompletion: - writer.WriteStringValue(MemberChatCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TaskTypeAi21Converter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAi21 Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberChatCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAi21.ChatCompletion; - } - - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAi21.Completion; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAi21.ChatCompletion; - } - - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAi21.Completion; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAi21)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAi21 value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.TaskTypeAi21.ChatCompletion: - writer.WriteStringValue(MemberChatCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeAi21.Completion: - writer.WriteStringValue(MemberCompletion); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAi21)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAi21 ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAi21 value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TaskTypeAlibabaCloudAIConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); - private static readonly System.Text.Json.JsonEncodedText MemberSparseEmbedding = System.Text.Json.JsonEncodedText.Encode("sparse_embedding"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.Completion; - } - - if (reader.ValueTextEquals(MemberRerank)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.Rerank; - } - - if (reader.ValueTextEquals(MemberSparseEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.SparseEmbedding; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.Completion; - } - - if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.Rerank; - } - - if (string.Equals(value, MemberSparseEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.SparseEmbedding; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.Rerank: - writer.WriteStringValue(MemberRerank); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.SparseEmbedding: - writer.WriteStringValue(MemberSparseEmbedding); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TaskTypeAmazonBedrockConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock.Completion; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock.Completion; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TaskTypeAnthropicConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAnthropic Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAnthropic.Completion; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAnthropic.Completion; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAnthropic)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAnthropic value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.TaskTypeAnthropic.Completion: - writer.WriteStringValue(MemberCompletion); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAnthropic)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAnthropic ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAnthropic value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TaskTypeAzureAIStudioConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio.Completion; - } - - if (reader.ValueTextEquals(MemberRerank)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio.Rerank; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio.Completion; - } - - if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio.Rerank; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio.Rerank: - writer.WriteStringValue(MemberRerank); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TaskTypeAzureOpenAIConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureOpenAI Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureOpenAI.Completion; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureOpenAI.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureOpenAI.Completion; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureOpenAI.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureOpenAI)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureOpenAI value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureOpenAI.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureOpenAI.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureOpenAI)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureOpenAI ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureOpenAI value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TaskTypeCohereConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere.Completion; - } - - if (reader.ValueTextEquals(MemberRerank)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere.Rerank; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere.Completion; - } - - if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere.Rerank; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere.Rerank: - writer.WriteStringValue(MemberRerank); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TaskTypeCustomConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); - private static readonly System.Text.Json.JsonEncodedText MemberSparseEmbedding = System.Text.Json.JsonEncodedText.Encode("sparse_embedding"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom.Completion; - } - - if (reader.ValueTextEquals(MemberRerank)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom.Rerank; - } - - if (reader.ValueTextEquals(MemberSparseEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom.SparseEmbedding; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom.Completion; - } - - if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom.Rerank; - } - - if (string.Equals(value, MemberSparseEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom.SparseEmbedding; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom.Rerank: - writer.WriteStringValue(MemberRerank); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom.SparseEmbedding: - writer.WriteStringValue(MemberSparseEmbedding); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TaskTypeElasticsearchConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); - private static readonly System.Text.Json.JsonEncodedText MemberSparseEmbedding = System.Text.Json.JsonEncodedText.Encode("sparse_embedding"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberRerank)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch.Rerank; - } - - if (reader.ValueTextEquals(MemberSparseEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch.SparseEmbedding; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch.Rerank; - } - - if (string.Equals(value, MemberSparseEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch.SparseEmbedding; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch.Rerank: - writer.WriteStringValue(MemberRerank); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch.SparseEmbedding: - writer.WriteStringValue(MemberSparseEmbedding); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TaskTypeELSERConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberSparseEmbedding = System.Text.Json.JsonEncodedText.Encode("sparse_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeELSER Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberSparseEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeELSER.SparseEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberSparseEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeELSER.SparseEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeELSER)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeELSER value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.TaskTypeELSER.SparseEmbedding: - writer.WriteStringValue(MemberSparseEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeELSER)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeELSER ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeELSER value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TaskTypeGoogleAIStudioConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleAIStudio Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleAIStudio.Completion; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleAIStudio.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleAIStudio.Completion; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleAIStudio.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleAIStudio)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleAIStudio value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleAIStudio.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleAIStudio.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleAIStudio)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleAIStudio ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleAIStudio value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TaskTypeGoogleVertexAIConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberRerank)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI.Rerank; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI.Rerank; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI.Rerank: - writer.WriteStringValue(MemberRerank); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TaskTypeHuggingFaceConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberChatCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace.ChatCompletion; - } - - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace.Completion; - } - - if (reader.ValueTextEquals(MemberRerank)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace.Rerank; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace.ChatCompletion; - } - - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace.Completion; - } - - if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace.Rerank; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace.ChatCompletion: - writer.WriteStringValue(MemberChatCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace.Rerank: - writer.WriteStringValue(MemberRerank); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TaskTypeJinaAiConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberRerank)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi.Rerank; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi.Rerank; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi.Rerank: - writer.WriteStringValue(MemberRerank); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TaskTypeLlamaConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberChatCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama.ChatCompletion; - } - - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama.Completion; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama.ChatCompletion; - } - - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama.Completion; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama.ChatCompletion: - writer.WriteStringValue(MemberChatCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TaskTypeMistralConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberChatCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral.ChatCompletion; - } - - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral.Completion; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral.ChatCompletion; - } - - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral.Completion; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral.ChatCompletion: - writer.WriteStringValue(MemberChatCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TaskTypeOpenAIConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberChatCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI.ChatCompletion; - } - - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI.Completion; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI.ChatCompletion; - } - - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI.Completion; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI.ChatCompletion: - writer.WriteStringValue(MemberChatCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TaskTypeVoyageAIConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeVoyageAI Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberRerank)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeVoyageAI.Rerank; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeVoyageAI.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeVoyageAI.Rerank; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeVoyageAI.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeVoyageAI)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeVoyageAI value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.TaskTypeVoyageAI.Rerank: - writer.WriteStringValue(MemberRerank); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeVoyageAI.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeVoyageAI)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeVoyageAI ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeVoyageAI value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TaskTypeWatsonxConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberChatCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx.ChatCompletion; - } - - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx.Completion; - } - - if (reader.ValueTextEquals(MemberTextEmbedding)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx.TextEmbedding; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx.ChatCompletion; - } - - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx.Completion; - } - - if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx.TextEmbedding; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx.ChatCompletion: - writer.WriteStringValue(MemberChatCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx.TextEmbedding: - writer.WriteStringValue(MemberTextEmbedding); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class AmazonSageMakerApiConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberElastic = System.Text.Json.JsonEncodedText.Encode("elastic"); - private static readonly System.Text.Json.JsonEncodedText MemberOpenai = System.Text.Json.JsonEncodedText.Encode("openai"); - - public override Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerApi Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberElastic)) - { - return Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerApi.Elastic; - } - - if (reader.ValueTextEquals(MemberOpenai)) - { - return Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerApi.Openai; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberElastic.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerApi.Elastic; - } - - if (string.Equals(value, MemberOpenai.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerApi.Openai; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerApi)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerApi value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerApi.Elastic: - writer.WriteStringValue(MemberElastic); - break; - case Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerApi.Openai: - writer.WriteStringValue(MemberOpenai); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerApi)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerApi ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerApi value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class CohereEmbeddingTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberBinary = System.Text.Json.JsonEncodedText.Encode("binary"); - private static readonly System.Text.Json.JsonEncodedText MemberBit = System.Text.Json.JsonEncodedText.Encode("bit"); - private static readonly System.Text.Json.JsonEncodedText MemberByte = System.Text.Json.JsonEncodedText.Encode("byte"); - private static readonly System.Text.Json.JsonEncodedText MemberFloat = System.Text.Json.JsonEncodedText.Encode("float"); - private static readonly System.Text.Json.JsonEncodedText MemberInt8 = System.Text.Json.JsonEncodedText.Encode("int8"); - - public override Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberBinary)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Binary; - } - - if (reader.ValueTextEquals(MemberBit)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Bit; - } - - if (reader.ValueTextEquals(MemberByte)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Byte; - } - - if (reader.ValueTextEquals(MemberFloat)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Float; - } - - if (reader.ValueTextEquals(MemberInt8)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Int8; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberBinary.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Binary; - } - - if (string.Equals(value, MemberBit.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Bit; - } - - if (string.Equals(value, MemberByte.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Byte; - } - - if (string.Equals(value, MemberFloat.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Float; - } - - if (string.Equals(value, MemberInt8.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Int8; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Binary: - writer.WriteStringValue(MemberBinary); - break; - case Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Bit: - writer.WriteStringValue(MemberBit); - break; - case Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Byte: - writer.WriteStringValue(MemberByte); - break; - case Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Float: - writer.WriteStringValue(MemberFloat); - break; - case Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Int8: - writer.WriteStringValue(MemberInt8); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class CohereSimilarityTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCosine = System.Text.Json.JsonEncodedText.Encode("cosine"); - private static readonly System.Text.Json.JsonEncodedText MemberDotProduct = System.Text.Json.JsonEncodedText.Encode("dot_product"); - private static readonly System.Text.Json.JsonEncodedText MemberL2Norm = System.Text.Json.JsonEncodedText.Encode("l2_norm"); - - public override Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCosine)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType.Cosine; - } - - if (reader.ValueTextEquals(MemberDotProduct)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType.DotProduct; - } - - if (reader.ValueTextEquals(MemberL2Norm)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType.L2Norm; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCosine.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType.Cosine; - } - - if (string.Equals(value, MemberDotProduct.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType.DotProduct; - } - - if (string.Equals(value, MemberL2Norm.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType.L2Norm; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType.Cosine: - writer.WriteStringValue(MemberCosine); - break; - case Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType.DotProduct: - writer.WriteStringValue(MemberDotProduct); - break; - case Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType.L2Norm: - writer.WriteStringValue(MemberL2Norm); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class CohereInputTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberClassification = System.Text.Json.JsonEncodedText.Encode("classification"); - private static readonly System.Text.Json.JsonEncodedText MemberClustering = System.Text.Json.JsonEncodedText.Encode("clustering"); - private static readonly System.Text.Json.JsonEncodedText MemberIngest = System.Text.Json.JsonEncodedText.Encode("ingest"); - private static readonly System.Text.Json.JsonEncodedText MemberSearch = System.Text.Json.JsonEncodedText.Encode("search"); - - public override Elastic.Clients.Elasticsearch.Inference.CohereInputType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberClassification)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereInputType.Classification; - } - - if (reader.ValueTextEquals(MemberClustering)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereInputType.Clustering; - } - - if (reader.ValueTextEquals(MemberIngest)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereInputType.Ingest; - } - - if (reader.ValueTextEquals(MemberSearch)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereInputType.Search; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberClassification.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereInputType.Classification; - } - - if (string.Equals(value, MemberClustering.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereInputType.Clustering; - } - - if (string.Equals(value, MemberIngest.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereInputType.Ingest; - } - - if (string.Equals(value, MemberSearch.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereInputType.Search; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.CohereInputType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CohereInputType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.CohereInputType.Classification: - writer.WriteStringValue(MemberClassification); - break; - case Elastic.Clients.Elasticsearch.Inference.CohereInputType.Clustering: - writer.WriteStringValue(MemberClustering); - break; - case Elastic.Clients.Elasticsearch.Inference.CohereInputType.Ingest: - writer.WriteStringValue(MemberIngest); - break; - case Elastic.Clients.Elasticsearch.Inference.CohereInputType.Search: - writer.WriteStringValue(MemberSearch); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.CohereInputType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.CohereInputType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CohereInputType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class CohereTruncateTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberEnd = System.Text.Json.JsonEncodedText.Encode("END"); - private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("NONE"); - private static readonly System.Text.Json.JsonEncodedText MemberStart = System.Text.Json.JsonEncodedText.Encode("START"); - - public override Elastic.Clients.Elasticsearch.Inference.CohereTruncateType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberEnd)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereTruncateType.End; - } - - if (reader.ValueTextEquals(MemberNone)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereTruncateType.None; - } - - if (reader.ValueTextEquals(MemberStart)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereTruncateType.Start; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberEnd.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereTruncateType.End; - } - - if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereTruncateType.None; - } - - if (string.Equals(value, MemberStart.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.CohereTruncateType.Start; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.CohereTruncateType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CohereTruncateType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.CohereTruncateType.End: - writer.WriteStringValue(MemberEnd); - break; - case Elastic.Clients.Elasticsearch.Inference.CohereTruncateType.None: - writer.WriteStringValue(MemberNone); - break; - case Elastic.Clients.Elasticsearch.Inference.CohereTruncateType.Start: - writer.WriteStringValue(MemberStart); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.CohereTruncateType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.CohereTruncateType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CohereTruncateType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class JinaAISimilarityTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCosine = System.Text.Json.JsonEncodedText.Encode("cosine"); - private static readonly System.Text.Json.JsonEncodedText MemberDotProduct = System.Text.Json.JsonEncodedText.Encode("dot_product"); - private static readonly System.Text.Json.JsonEncodedText MemberL2Norm = System.Text.Json.JsonEncodedText.Encode("l2_norm"); - - public override Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCosine)) - { - return Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType.Cosine; - } - - if (reader.ValueTextEquals(MemberDotProduct)) - { - return Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType.DotProduct; - } - - if (reader.ValueTextEquals(MemberL2Norm)) - { - return Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType.L2Norm; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCosine.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType.Cosine; - } - - if (string.Equals(value, MemberDotProduct.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType.DotProduct; - } - - if (string.Equals(value, MemberL2Norm.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType.L2Norm; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType.Cosine: - writer.WriteStringValue(MemberCosine); - break; - case Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType.DotProduct: - writer.WriteStringValue(MemberDotProduct); - break; - case Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType.L2Norm: - writer.WriteStringValue(MemberL2Norm); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class JinaAITextEmbeddingTaskConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberClassification = System.Text.Json.JsonEncodedText.Encode("classification"); - private static readonly System.Text.Json.JsonEncodedText MemberClustering = System.Text.Json.JsonEncodedText.Encode("clustering"); - private static readonly System.Text.Json.JsonEncodedText MemberIngest = System.Text.Json.JsonEncodedText.Encode("ingest"); - private static readonly System.Text.Json.JsonEncodedText MemberSearch = System.Text.Json.JsonEncodedText.Encode("search"); - - public override Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberClassification)) - { - return Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask.Classification; - } - - if (reader.ValueTextEquals(MemberClustering)) - { - return Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask.Clustering; - } - - if (reader.ValueTextEquals(MemberIngest)) - { - return Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask.Ingest; - } - - if (reader.ValueTextEquals(MemberSearch)) - { - return Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask.Search; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberClassification.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask.Classification; - } - - if (string.Equals(value, MemberClustering.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask.Clustering; - } - - if (string.Equals(value, MemberIngest.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask.Ingest; - } - - if (string.Equals(value, MemberSearch.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask.Search; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask.Classification: - writer.WriteStringValue(MemberClassification); - break; - case Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask.Clustering: - writer.WriteStringValue(MemberClustering); - break; - case Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask.Ingest: - writer.WriteStringValue(MemberIngest); - break; - case Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask.Search: - writer.WriteStringValue(MemberSearch); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class LlamaSimilarityTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCosine = System.Text.Json.JsonEncodedText.Encode("cosine"); - private static readonly System.Text.Json.JsonEncodedText MemberDotProduct = System.Text.Json.JsonEncodedText.Encode("dot_product"); - private static readonly System.Text.Json.JsonEncodedText MemberL2Norm = System.Text.Json.JsonEncodedText.Encode("l2_norm"); - - public override Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCosine)) - { - return Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType.Cosine; - } - - if (reader.ValueTextEquals(MemberDotProduct)) - { - return Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType.DotProduct; - } - - if (reader.ValueTextEquals(MemberL2Norm)) - { - return Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType.L2Norm; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCosine.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType.Cosine; - } - - if (string.Equals(value, MemberDotProduct.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType.DotProduct; - } - - if (string.Equals(value, MemberL2Norm.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType.L2Norm; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType.Cosine: - writer.WriteStringValue(MemberCosine); - break; - case Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType.DotProduct: - writer.WriteStringValue(MemberDotProduct); - break; - case Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType.L2Norm: - writer.WriteStringValue(MemberL2Norm); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TaskTypeConverter))] -public enum TaskType -{ - [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] - ChatCompletion, - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "rerank")] - Rerank, - [System.Runtime.Serialization.EnumMember(Value = "sparse_embedding")] - SparseEmbedding, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Ai21TaskTypeConverter))] -public enum Ai21TaskType -{ - [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] - ChatCompletion, - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskTypeConverter))] -public enum AlibabaCloudTaskType -{ - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "rerank")] - Rerank, - [System.Runtime.Serialization.EnumMember(Value = "space_embedding")] - SpaceEmbedding, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskTypeConverter))] -public enum AmazonBedrockTaskType -{ - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMakerConverter))] -public enum TaskTypeAmazonSageMaker -{ - [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] - ChatCompletion, - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "rerank")] - Rerank, - [System.Runtime.Serialization.EnumMember(Value = "sparse_embedding")] - SparseEmbedding, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.AnthropicTaskTypeConverter))] -public enum AnthropicTaskType -{ - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskTypeConverter))] -public enum AzureAiStudioTaskType -{ - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "rerank")] - Rerank, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskTypeConverter))] -public enum AzureOpenAITaskType -{ - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.CohereTaskTypeConverter))] -public enum CohereTaskType -{ - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "rerank")] - Rerank, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.CustomTaskTypeConverter))] -public enum CustomTaskType -{ - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "rerank")] - Rerank, - [System.Runtime.Serialization.EnumMember(Value = "sparse_embedding")] - SparseEmbedding, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TaskTypeDeepSeekConverter))] -public enum TaskTypeDeepSeek -{ - [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] - ChatCompletion, - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskTypeConverter))] -public enum ElasticsearchTaskType -{ - [System.Runtime.Serialization.EnumMember(Value = "rerank")] - Rerank, - [System.Runtime.Serialization.EnumMember(Value = "sparse_embedding")] - SparseEmbedding, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.ElserTaskTypeConverter))] -public enum ElserTaskType -{ - [System.Runtime.Serialization.EnumMember(Value = "sparse_embedding")] - SparseEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioTaskTypeConverter))] -public enum GoogleAiStudioTaskType -{ - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskTypeConverter))] -public enum GoogleVertexAITaskType -{ - [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] - ChatCompletion, - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "rerank")] - Rerank, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskTypeConverter))] -public enum HuggingFaceTaskType -{ - [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] - ChatCompletion, - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "rerank")] - Rerank, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.JinaAITaskTypeConverter))] -public enum JinaAITaskType -{ - [System.Runtime.Serialization.EnumMember(Value = "rerank")] - Rerank, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.LlamaTaskTypeConverter))] -public enum LlamaTaskType -{ - [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] - ChatCompletion, - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.MistralTaskTypeConverter))] -public enum MistralTaskType -{ - [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] - ChatCompletion, - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.OpenAITaskTypeConverter))] -public enum OpenAITaskType -{ - [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] - ChatCompletion, - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.VoyageAITaskTypeConverter))] -public enum VoyageAITaskType -{ - [System.Runtime.Serialization.EnumMember(Value = "rerank")] - Rerank, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.WatsonxTaskTypeConverter))] -public enum WatsonxTaskType -{ - [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] - ChatCompletion, - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAi21Converter))] -public enum TaskTypeAi21 -{ - [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] - ChatCompletion, - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAIConverter))] -public enum TaskTypeAlibabaCloudAI -{ - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "rerank")] - Rerank, - [System.Runtime.Serialization.EnumMember(Value = "sparse_embedding")] - SparseEmbedding, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrockConverter))] -public enum TaskTypeAmazonBedrock -{ - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAnthropicConverter))] -public enum TaskTypeAnthropic -{ - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudioConverter))] -public enum TaskTypeAzureAIStudio -{ - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "rerank")] - Rerank, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureOpenAIConverter))] -public enum TaskTypeAzureOpenAI -{ - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TaskTypeCohereConverter))] -public enum TaskTypeCohere -{ - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "rerank")] - Rerank, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TaskTypeCustomConverter))] -public enum TaskTypeCustom -{ - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "rerank")] - Rerank, - [System.Runtime.Serialization.EnumMember(Value = "sparse_embedding")] - SparseEmbedding, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearchConverter))] -public enum TaskTypeElasticsearch -{ - [System.Runtime.Serialization.EnumMember(Value = "rerank")] - Rerank, - [System.Runtime.Serialization.EnumMember(Value = "sparse_embedding")] - SparseEmbedding, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TaskTypeELSERConverter))] -public enum TaskTypeELSER -{ - [System.Runtime.Serialization.EnumMember(Value = "sparse_embedding")] - SparseEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleAIStudioConverter))] -public enum TaskTypeGoogleAIStudio -{ - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAIConverter))] -public enum TaskTypeGoogleVertexAI -{ - [System.Runtime.Serialization.EnumMember(Value = "rerank")] - Rerank, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFaceConverter))] -public enum TaskTypeHuggingFace -{ - [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] - ChatCompletion, - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "rerank")] - Rerank, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAiConverter))] -public enum TaskTypeJinaAi -{ - [System.Runtime.Serialization.EnumMember(Value = "rerank")] - Rerank, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TaskTypeLlamaConverter))] -public enum TaskTypeLlama -{ - [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] - ChatCompletion, - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TaskTypeMistralConverter))] -public enum TaskTypeMistral -{ - [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] - ChatCompletion, - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAIConverter))] -public enum TaskTypeOpenAI -{ - [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] - ChatCompletion, - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TaskTypeVoyageAIConverter))] -public enum TaskTypeVoyageAI -{ - [System.Runtime.Serialization.EnumMember(Value = "rerank")] - Rerank, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonxConverter))] -public enum TaskTypeWatsonx -{ - [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] - ChatCompletion, - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] - TextEmbedding -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerApiConverter))] -public enum AmazonSageMakerApi -{ - [System.Runtime.Serialization.EnumMember(Value = "elastic")] - Elastic, - [System.Runtime.Serialization.EnumMember(Value = "openai")] - Openai -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingTypeConverter))] -public enum CohereEmbeddingType -{ - [System.Runtime.Serialization.EnumMember(Value = "binary")] - Binary, - [System.Runtime.Serialization.EnumMember(Value = "bit")] - Bit, - [System.Runtime.Serialization.EnumMember(Value = "byte")] - Byte, - [System.Runtime.Serialization.EnumMember(Value = "float")] - Float, - [System.Runtime.Serialization.EnumMember(Value = "int8")] - Int8 -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.CohereSimilarityTypeConverter))] -public enum CohereSimilarityType -{ - [System.Runtime.Serialization.EnumMember(Value = "cosine")] - Cosine, - [System.Runtime.Serialization.EnumMember(Value = "dot_product")] - DotProduct, - [System.Runtime.Serialization.EnumMember(Value = "l2_norm")] - L2Norm -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.CohereInputTypeConverter))] -public enum CohereInputType -{ - [System.Runtime.Serialization.EnumMember(Value = "classification")] - Classification, - [System.Runtime.Serialization.EnumMember(Value = "clustering")] - Clustering, - [System.Runtime.Serialization.EnumMember(Value = "ingest")] - Ingest, - [System.Runtime.Serialization.EnumMember(Value = "search")] - Search -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.CohereTruncateTypeConverter))] -public enum CohereTruncateType -{ - [System.Runtime.Serialization.EnumMember(Value = "END")] - End, - [System.Runtime.Serialization.EnumMember(Value = "NONE")] - None, - [System.Runtime.Serialization.EnumMember(Value = "START")] - Start -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityTypeConverter))] -public enum JinaAISimilarityType -{ - [System.Runtime.Serialization.EnumMember(Value = "cosine")] - Cosine, - [System.Runtime.Serialization.EnumMember(Value = "dot_product")] - DotProduct, - [System.Runtime.Serialization.EnumMember(Value = "l2_norm")] - L2Norm -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTaskConverter))] -public enum JinaAITextEmbeddingTask -{ - [System.Runtime.Serialization.EnumMember(Value = "classification")] - Classification, - [System.Runtime.Serialization.EnumMember(Value = "clustering")] - Clustering, - [System.Runtime.Serialization.EnumMember(Value = "ingest")] - Ingest, - [System.Runtime.Serialization.EnumMember(Value = "search")] - Search -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityTypeConverter))] -public enum LlamaSimilarityType -{ - [System.Runtime.Serialization.EnumMember(Value = "cosine")] - Cosine, - [System.Runtime.Serialization.EnumMember(Value = "dot_product")] - DotProduct, - [System.Runtime.Serialization.EnumMember(Value = "l2_norm")] - L2Norm -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Ingest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Ingest.g.cs deleted file mode 100644 index fdd2917d267..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Ingest.g.cs +++ /dev/null @@ -1,818 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using System; -using System.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.Ingest; - -internal sealed partial class ShapeTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberGeoShape = System.Text.Json.JsonEncodedText.Encode("geo_shape"); - private static readonly System.Text.Json.JsonEncodedText MemberShape = System.Text.Json.JsonEncodedText.Encode("shape"); - - public override Elastic.Clients.Elasticsearch.Ingest.ShapeType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberGeoShape)) - { - return Elastic.Clients.Elasticsearch.Ingest.ShapeType.GeoShape; - } - - if (reader.ValueTextEquals(MemberShape)) - { - return Elastic.Clients.Elasticsearch.Ingest.ShapeType.Shape; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberGeoShape.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.ShapeType.GeoShape; - } - - if (string.Equals(value, MemberShape.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.ShapeType.Shape; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.ShapeType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.ShapeType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Ingest.ShapeType.GeoShape: - writer.WriteStringValue(MemberGeoShape); - break; - case Elastic.Clients.Elasticsearch.Ingest.ShapeType.Shape: - writer.WriteStringValue(MemberShape); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.ShapeType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Ingest.ShapeType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.ShapeType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ConvertTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAuto = System.Text.Json.JsonEncodedText.Encode("auto"); - private static readonly System.Text.Json.JsonEncodedText MemberBoolean = System.Text.Json.JsonEncodedText.Encode("boolean"); - private static readonly System.Text.Json.JsonEncodedText MemberDouble = System.Text.Json.JsonEncodedText.Encode("double"); - private static readonly System.Text.Json.JsonEncodedText MemberFloat = System.Text.Json.JsonEncodedText.Encode("float"); - private static readonly System.Text.Json.JsonEncodedText MemberInteger = System.Text.Json.JsonEncodedText.Encode("integer"); - private static readonly System.Text.Json.JsonEncodedText MemberIp = System.Text.Json.JsonEncodedText.Encode("ip"); - private static readonly System.Text.Json.JsonEncodedText MemberLong = System.Text.Json.JsonEncodedText.Encode("long"); - private static readonly System.Text.Json.JsonEncodedText MemberString = System.Text.Json.JsonEncodedText.Encode("string"); - - public override Elastic.Clients.Elasticsearch.Ingest.ConvertType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAuto)) - { - return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Auto; - } - - if (reader.ValueTextEquals(MemberBoolean)) - { - return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Boolean; - } - - if (reader.ValueTextEquals(MemberDouble)) - { - return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Double; - } - - if (reader.ValueTextEquals(MemberFloat)) - { - return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Float; - } - - if (reader.ValueTextEquals(MemberInteger)) - { - return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Integer; - } - - if (reader.ValueTextEquals(MemberIp)) - { - return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Ip; - } - - if (reader.ValueTextEquals(MemberLong)) - { - return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Long; - } - - if (reader.ValueTextEquals(MemberString)) - { - return Elastic.Clients.Elasticsearch.Ingest.ConvertType.String; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAuto.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Auto; - } - - if (string.Equals(value, MemberBoolean.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Boolean; - } - - if (string.Equals(value, MemberDouble.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Double; - } - - if (string.Equals(value, MemberFloat.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Float; - } - - if (string.Equals(value, MemberInteger.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Integer; - } - - if (string.Equals(value, MemberIp.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Ip; - } - - if (string.Equals(value, MemberLong.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Long; - } - - if (string.Equals(value, MemberString.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.ConvertType.String; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.ConvertType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.ConvertType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Ingest.ConvertType.Auto: - writer.WriteStringValue(MemberAuto); - break; - case Elastic.Clients.Elasticsearch.Ingest.ConvertType.Boolean: - writer.WriteStringValue(MemberBoolean); - break; - case Elastic.Clients.Elasticsearch.Ingest.ConvertType.Double: - writer.WriteStringValue(MemberDouble); - break; - case Elastic.Clients.Elasticsearch.Ingest.ConvertType.Float: - writer.WriteStringValue(MemberFloat); - break; - case Elastic.Clients.Elasticsearch.Ingest.ConvertType.Integer: - writer.WriteStringValue(MemberInteger); - break; - case Elastic.Clients.Elasticsearch.Ingest.ConvertType.Ip: - writer.WriteStringValue(MemberIp); - break; - case Elastic.Clients.Elasticsearch.Ingest.ConvertType.Long: - writer.WriteStringValue(MemberLong); - break; - case Elastic.Clients.Elasticsearch.Ingest.ConvertType.String: - writer.WriteStringValue(MemberString); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.ConvertType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Ingest.ConvertType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.ConvertType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class FingerprintDigestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberMd5 = System.Text.Json.JsonEncodedText.Encode("MD5"); - private static readonly System.Text.Json.JsonEncodedText MemberMurmurHash3 = System.Text.Json.JsonEncodedText.Encode("MurmurHash3"); - private static readonly System.Text.Json.JsonEncodedText MemberSha1 = System.Text.Json.JsonEncodedText.Encode("SHA-1"); - private static readonly System.Text.Json.JsonEncodedText MemberSha256 = System.Text.Json.JsonEncodedText.Encode("SHA-256"); - private static readonly System.Text.Json.JsonEncodedText MemberSha512 = System.Text.Json.JsonEncodedText.Encode("SHA-512"); - - public override Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberMd5)) - { - return Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.Md5; - } - - if (reader.ValueTextEquals(MemberMurmurHash3)) - { - return Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.MurmurHash3; - } - - if (reader.ValueTextEquals(MemberSha1)) - { - return Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.Sha1; - } - - if (reader.ValueTextEquals(MemberSha256)) - { - return Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.Sha256; - } - - if (reader.ValueTextEquals(MemberSha512)) - { - return Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.Sha512; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberMd5.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.Md5; - } - - if (string.Equals(value, MemberMurmurHash3.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.MurmurHash3; - } - - if (string.Equals(value, MemberSha1.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.Sha1; - } - - if (string.Equals(value, MemberSha256.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.Sha256; - } - - if (string.Equals(value, MemberSha512.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.Sha512; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.Md5: - writer.WriteStringValue(MemberMd5); - break; - case Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.MurmurHash3: - writer.WriteStringValue(MemberMurmurHash3); - break; - case Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.Sha1: - writer.WriteStringValue(MemberSha1); - break; - case Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.Sha256: - writer.WriteStringValue(MemberSha256); - break; - case Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.Sha512: - writer.WriteStringValue(MemberSha512); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class GeoGridTileTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberGeohash = System.Text.Json.JsonEncodedText.Encode("geohash"); - private static readonly System.Text.Json.JsonEncodedText MemberGeohex = System.Text.Json.JsonEncodedText.Encode("geohex"); - private static readonly System.Text.Json.JsonEncodedText MemberGeotile = System.Text.Json.JsonEncodedText.Encode("geotile"); - - public override Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberGeohash)) - { - return Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType.Geohash; - } - - if (reader.ValueTextEquals(MemberGeohex)) - { - return Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType.Geohex; - } - - if (reader.ValueTextEquals(MemberGeotile)) - { - return Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType.Geotile; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberGeohash.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType.Geohash; - } - - if (string.Equals(value, MemberGeohex.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType.Geohex; - } - - if (string.Equals(value, MemberGeotile.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType.Geotile; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType.Geohash: - writer.WriteStringValue(MemberGeohash); - break; - case Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType.Geohex: - writer.WriteStringValue(MemberGeohex); - break; - case Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType.Geotile: - writer.WriteStringValue(MemberGeotile); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class GeoGridTargetFormatConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberGeojson = System.Text.Json.JsonEncodedText.Encode("geojson"); - private static readonly System.Text.Json.JsonEncodedText MemberWkt = System.Text.Json.JsonEncodedText.Encode("wkt"); - - public override Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberGeojson)) - { - return Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat.Geojson; - } - - if (reader.ValueTextEquals(MemberWkt)) - { - return Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat.Wkt; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberGeojson.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat.Geojson; - } - - if (string.Equals(value, MemberWkt.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat.Wkt; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat.Geojson: - writer.WriteStringValue(MemberGeojson); - break; - case Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat.Wkt: - writer.WriteStringValue(MemberWkt); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class JsonProcessorConflictStrategyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberMerge = System.Text.Json.JsonEncodedText.Encode("merge"); - private static readonly System.Text.Json.JsonEncodedText MemberReplace = System.Text.Json.JsonEncodedText.Encode("replace"); - - public override Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberMerge)) - { - return Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy.Merge; - } - - if (reader.ValueTextEquals(MemberReplace)) - { - return Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy.Replace; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberMerge.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy.Merge; - } - - if (string.Equals(value, MemberReplace.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy.Replace; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy.Merge: - writer.WriteStringValue(MemberMerge); - break; - case Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy.Replace: - writer.WriteStringValue(MemberReplace); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class UserAgentPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberDevice = System.Text.Json.JsonEncodedText.Encode("device"); - private static readonly System.Text.Json.JsonEncodedText MemberName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText MemberOriginal = System.Text.Json.JsonEncodedText.Encode("original"); - private static readonly System.Text.Json.JsonEncodedText MemberOs = System.Text.Json.JsonEncodedText.Encode("os"); - private static readonly System.Text.Json.JsonEncodedText MemberVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberDevice)) - { - return Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Device; - } - - if (reader.ValueTextEquals(MemberName)) - { - return Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Name; - } - - if (reader.ValueTextEquals(MemberOriginal)) - { - return Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Original; - } - - if (reader.ValueTextEquals(MemberOs)) - { - return Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Os; - } - - if (reader.ValueTextEquals(MemberVersion)) - { - return Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Version; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberDevice.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Device; - } - - if (string.Equals(value, MemberName.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Name; - } - - if (string.Equals(value, MemberOriginal.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Original; - } - - if (string.Equals(value, MemberOs.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Os; - } - - if (string.Equals(value, MemberVersion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Version; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Device: - writer.WriteStringValue(MemberDevice); - break; - case Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Name: - writer.WriteStringValue(MemberName); - break; - case Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Original: - writer.WriteStringValue(MemberOriginal); - break; - case Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Os: - writer.WriteStringValue(MemberOs); - break; - case Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Version: - writer.WriteStringValue(MemberVersion); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class PipelineSimulationStatusOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberDropped = System.Text.Json.JsonEncodedText.Encode("dropped"); - private static readonly System.Text.Json.JsonEncodedText MemberError = System.Text.Json.JsonEncodedText.Encode("error"); - private static readonly System.Text.Json.JsonEncodedText MemberErrorIgnored = System.Text.Json.JsonEncodedText.Encode("error_ignored"); - private static readonly System.Text.Json.JsonEncodedText MemberSkipped = System.Text.Json.JsonEncodedText.Encode("skipped"); - private static readonly System.Text.Json.JsonEncodedText MemberSuccess = System.Text.Json.JsonEncodedText.Encode("success"); - - public override Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberDropped)) - { - return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Dropped; - } - - if (reader.ValueTextEquals(MemberError)) - { - return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Error; - } - - if (reader.ValueTextEquals(MemberErrorIgnored)) - { - return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.ErrorIgnored; - } - - if (reader.ValueTextEquals(MemberSkipped)) - { - return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Skipped; - } - - if (reader.ValueTextEquals(MemberSuccess)) - { - return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Success; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberDropped.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Dropped; - } - - if (string.Equals(value, MemberError.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Error; - } - - if (string.Equals(value, MemberErrorIgnored.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.ErrorIgnored; - } - - if (string.Equals(value, MemberSkipped.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Skipped; - } - - if (string.Equals(value, MemberSuccess.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Success; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Dropped: - writer.WriteStringValue(MemberDropped); - break; - case Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Error: - writer.WriteStringValue(MemberError); - break; - case Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.ErrorIgnored: - writer.WriteStringValue(MemberErrorIgnored); - break; - case Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Skipped: - writer.WriteStringValue(MemberSkipped); - break; - case Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Success: - writer.WriteStringValue(MemberSuccess); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.ShapeTypeConverter))] -public enum ShapeType -{ - [System.Runtime.Serialization.EnumMember(Value = "geo_shape")] - GeoShape, - [System.Runtime.Serialization.EnumMember(Value = "shape")] - Shape -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.ConvertTypeConverter))] -public enum ConvertType -{ - [System.Runtime.Serialization.EnumMember(Value = "auto")] - Auto, - [System.Runtime.Serialization.EnumMember(Value = "boolean")] - Boolean, - [System.Runtime.Serialization.EnumMember(Value = "double")] - Double, - [System.Runtime.Serialization.EnumMember(Value = "float")] - Float, - [System.Runtime.Serialization.EnumMember(Value = "integer")] - Integer, - [System.Runtime.Serialization.EnumMember(Value = "ip")] - Ip, - [System.Runtime.Serialization.EnumMember(Value = "long")] - Long, - [System.Runtime.Serialization.EnumMember(Value = "string")] - String -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.FingerprintDigestConverter))] -public enum FingerprintDigest -{ - [System.Runtime.Serialization.EnumMember(Value = "MD5")] - Md5, - [System.Runtime.Serialization.EnumMember(Value = "MurmurHash3")] - MurmurHash3, - [System.Runtime.Serialization.EnumMember(Value = "SHA-1")] - Sha1, - [System.Runtime.Serialization.EnumMember(Value = "SHA-256")] - Sha256, - [System.Runtime.Serialization.EnumMember(Value = "SHA-512")] - Sha512 -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.GeoGridTileTypeConverter))] -public enum GeoGridTileType -{ - [System.Runtime.Serialization.EnumMember(Value = "geohash")] - Geohash, - [System.Runtime.Serialization.EnumMember(Value = "geohex")] - Geohex, - [System.Runtime.Serialization.EnumMember(Value = "geotile")] - Geotile -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormatConverter))] -public enum GeoGridTargetFormat -{ - [System.Runtime.Serialization.EnumMember(Value = "geojson")] - Geojson, - [System.Runtime.Serialization.EnumMember(Value = "wkt")] - Wkt -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategyConverter))] -public enum JsonProcessorConflictStrategy -{ - /// - /// - /// Conflicting fields will be merged. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "merge")] - Merge, - /// - /// - /// Root fields that conflict with fields from the parsed JSON will be overridden. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "replace")] - Replace -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.UserAgentPropertyConverter))] -public enum UserAgentProperty -{ - [System.Runtime.Serialization.EnumMember(Value = "device")] - Device, - [System.Runtime.Serialization.EnumMember(Value = "name")] - Name, - [System.Runtime.Serialization.EnumMember(Value = "original")] - Original, - [System.Runtime.Serialization.EnumMember(Value = "os")] - Os, - [System.Runtime.Serialization.EnumMember(Value = "version")] - Version -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptionsConverter))] -public enum PipelineSimulationStatusOptions -{ - [System.Runtime.Serialization.EnumMember(Value = "dropped")] - Dropped, - [System.Runtime.Serialization.EnumMember(Value = "error")] - Error, - [System.Runtime.Serialization.EnumMember(Value = "error_ignored")] - ErrorIgnored, - [System.Runtime.Serialization.EnumMember(Value = "skipped")] - Skipped, - [System.Runtime.Serialization.EnumMember(Value = "success")] - Success -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.MachineLearning.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.MachineLearning.g.cs deleted file mode 100644 index 38f160e324f..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.MachineLearning.g.cs +++ /dev/null @@ -1,1968 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using System; -using System.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.MachineLearning; - -internal sealed partial class IncludeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberDefinition = System.Text.Json.JsonEncodedText.Encode("definition"); - private static readonly System.Text.Json.JsonEncodedText MemberDefinitionStatus = System.Text.Json.JsonEncodedText.Encode("definition_status"); - private static readonly System.Text.Json.JsonEncodedText MemberFeatureImportanceBaseline = System.Text.Json.JsonEncodedText.Encode("feature_importance_baseline"); - private static readonly System.Text.Json.JsonEncodedText MemberHyperparameters = System.Text.Json.JsonEncodedText.Encode("hyperparameters"); - private static readonly System.Text.Json.JsonEncodedText MemberTotalFeatureImportance = System.Text.Json.JsonEncodedText.Encode("total_feature_importance"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.Include Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberDefinition)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.Include.Definition; - } - - if (reader.ValueTextEquals(MemberDefinitionStatus)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.Include.DefinitionStatus; - } - - if (reader.ValueTextEquals(MemberFeatureImportanceBaseline)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.Include.FeatureImportanceBaseline; - } - - if (reader.ValueTextEquals(MemberHyperparameters)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.Include.Hyperparameters; - } - - if (reader.ValueTextEquals(MemberTotalFeatureImportance)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.Include.TotalFeatureImportance; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberDefinition.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.Include.Definition; - } - - if (string.Equals(value, MemberDefinitionStatus.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.Include.DefinitionStatus; - } - - if (string.Equals(value, MemberFeatureImportanceBaseline.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.Include.FeatureImportanceBaseline; - } - - if (string.Equals(value, MemberHyperparameters.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.Include.Hyperparameters; - } - - if (string.Equals(value, MemberTotalFeatureImportance.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.Include.TotalFeatureImportance; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.Include)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Include value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.MachineLearning.Include.Definition: - writer.WriteStringValue(MemberDefinition); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.Include.DefinitionStatus: - writer.WriteStringValue(MemberDefinitionStatus); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.Include.FeatureImportanceBaseline: - writer.WriteStringValue(MemberFeatureImportanceBaseline); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.Include.Hyperparameters: - writer.WriteStringValue(MemberHyperparameters); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.Include.TotalFeatureImportance: - writer.WriteStringValue(MemberTotalFeatureImportance); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.Include)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.MachineLearning.Include ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Include value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TrainingPriorityConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberLow = System.Text.Json.JsonEncodedText.Encode("low"); - private static readonly System.Text.Json.JsonEncodedText MemberNormal = System.Text.Json.JsonEncodedText.Encode("normal"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberLow)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority.Low; - } - - if (reader.ValueTextEquals(MemberNormal)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority.Normal; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberLow.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority.Low; - } - - if (string.Equals(value, MemberNormal.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority.Normal; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority.Low: - writer.WriteStringValue(MemberLow); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority.Normal: - writer.WriteStringValue(MemberNormal); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class DeploymentAllocationStateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberFullyAllocated = System.Text.Json.JsonEncodedText.Encode("fully_allocated"); - private static readonly System.Text.Json.JsonEncodedText MemberStarted = System.Text.Json.JsonEncodedText.Encode("started"); - private static readonly System.Text.Json.JsonEncodedText MemberStarting = System.Text.Json.JsonEncodedText.Encode("starting"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberFullyAllocated)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState.FullyAllocated; - } - - if (reader.ValueTextEquals(MemberStarted)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState.Started; - } - - if (reader.ValueTextEquals(MemberStarting)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState.Starting; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberFullyAllocated.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState.FullyAllocated; - } - - if (string.Equals(value, MemberStarted.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState.Started; - } - - if (string.Equals(value, MemberStarting.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState.Starting; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState.FullyAllocated: - writer.WriteStringValue(MemberFullyAllocated); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState.Started: - writer.WriteStringValue(MemberStarted); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState.Starting: - writer.WriteStringValue(MemberStarting); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TrainedModelTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberLangIdent = System.Text.Json.JsonEncodedText.Encode("lang_ident"); - private static readonly System.Text.Json.JsonEncodedText MemberPytorch = System.Text.Json.JsonEncodedText.Encode("pytorch"); - private static readonly System.Text.Json.JsonEncodedText MemberTreeEnsemble = System.Text.Json.JsonEncodedText.Encode("tree_ensemble"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberLangIdent)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType.LangIdent; - } - - if (reader.ValueTextEquals(MemberPytorch)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType.Pytorch; - } - - if (reader.ValueTextEquals(MemberTreeEnsemble)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType.TreeEnsemble; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberLangIdent.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType.LangIdent; - } - - if (string.Equals(value, MemberPytorch.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType.Pytorch; - } - - if (string.Equals(value, MemberTreeEnsemble.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType.TreeEnsemble; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType.LangIdent: - writer.WriteStringValue(MemberLangIdent); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType.Pytorch: - writer.WriteStringValue(MemberPytorch); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType.TreeEnsemble: - writer.WriteStringValue(MemberTreeEnsemble); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ExcludeFrequentConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAll = System.Text.Json.JsonEncodedText.Encode("all"); - private static readonly System.Text.Json.JsonEncodedText MemberBy = System.Text.Json.JsonEncodedText.Encode("by"); - private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); - private static readonly System.Text.Json.JsonEncodedText MemberOver = System.Text.Json.JsonEncodedText.Encode("over"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAll)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent.All; - } - - if (reader.ValueTextEquals(MemberBy)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent.By; - } - - if (reader.ValueTextEquals(MemberNone)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent.None; - } - - if (reader.ValueTextEquals(MemberOver)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent.Over; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAll.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent.All; - } - - if (string.Equals(value, MemberBy.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent.By; - } - - if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent.None; - } - - if (string.Equals(value, MemberOver.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent.Over; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent.All: - writer.WriteStringValue(MemberAll); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent.By: - writer.WriteStringValue(MemberBy); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent.None: - writer.WriteStringValue(MemberNone); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent.Over: - writer.WriteStringValue(MemberOver); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ChunkingModeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAuto = System.Text.Json.JsonEncodedText.Encode("auto"); - private static readonly System.Text.Json.JsonEncodedText MemberManual = System.Text.Json.JsonEncodedText.Encode("manual"); - private static readonly System.Text.Json.JsonEncodedText MemberOff = System.Text.Json.JsonEncodedText.Encode("off"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAuto)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode.Auto; - } - - if (reader.ValueTextEquals(MemberManual)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode.Manual; - } - - if (reader.ValueTextEquals(MemberOff)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode.Off; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAuto.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode.Auto; - } - - if (string.Equals(value, MemberManual.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode.Manual; - } - - if (string.Equals(value, MemberOff.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode.Off; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode.Auto: - writer.WriteStringValue(MemberAuto); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode.Manual: - writer.WriteStringValue(MemberManual); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode.Off: - writer.WriteStringValue(MemberOff); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class DeploymentAssignmentStateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberFailed = System.Text.Json.JsonEncodedText.Encode("failed"); - private static readonly System.Text.Json.JsonEncodedText MemberStarted = System.Text.Json.JsonEncodedText.Encode("started"); - private static readonly System.Text.Json.JsonEncodedText MemberStarting = System.Text.Json.JsonEncodedText.Encode("starting"); - private static readonly System.Text.Json.JsonEncodedText MemberStopping = System.Text.Json.JsonEncodedText.Encode("stopping"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberFailed)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState.Failed; - } - - if (reader.ValueTextEquals(MemberStarted)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState.Started; - } - - if (reader.ValueTextEquals(MemberStarting)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState.Starting; - } - - if (reader.ValueTextEquals(MemberStopping)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState.Stopping; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberFailed.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState.Failed; - } - - if (string.Equals(value, MemberStarted.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState.Started; - } - - if (string.Equals(value, MemberStarting.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState.Starting; - } - - if (string.Equals(value, MemberStopping.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState.Stopping; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState.Failed: - writer.WriteStringValue(MemberFailed); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState.Started: - writer.WriteStringValue(MemberStarted); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState.Starting: - writer.WriteStringValue(MemberStarting); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState.Stopping: - writer.WriteStringValue(MemberStopping); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class DataframeStateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberFailed = System.Text.Json.JsonEncodedText.Encode("failed"); - private static readonly System.Text.Json.JsonEncodedText MemberStarted = System.Text.Json.JsonEncodedText.Encode("started"); - private static readonly System.Text.Json.JsonEncodedText MemberStarting = System.Text.Json.JsonEncodedText.Encode("starting"); - private static readonly System.Text.Json.JsonEncodedText MemberStopped = System.Text.Json.JsonEncodedText.Encode("stopped"); - private static readonly System.Text.Json.JsonEncodedText MemberStopping = System.Text.Json.JsonEncodedText.Encode("stopping"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberFailed)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Failed; - } - - if (reader.ValueTextEquals(MemberStarted)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Started; - } - - if (reader.ValueTextEquals(MemberStarting)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Starting; - } - - if (reader.ValueTextEquals(MemberStopped)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Stopped; - } - - if (reader.ValueTextEquals(MemberStopping)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Stopping; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberFailed.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Failed; - } - - if (string.Equals(value, MemberStarted.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Started; - } - - if (string.Equals(value, MemberStarting.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Starting; - } - - if (string.Equals(value, MemberStopped.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Stopped; - } - - if (string.Equals(value, MemberStopping.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Stopping; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeState)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeState value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Failed: - writer.WriteStringValue(MemberFailed); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Started: - writer.WriteStringValue(MemberStarted); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Starting: - writer.WriteStringValue(MemberStarting); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Stopped: - writer.WriteStringValue(MemberStopped); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Stopping: - writer.WriteStringValue(MemberStopping); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeState)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeState ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeState value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class DatafeedStateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberStarted = System.Text.Json.JsonEncodedText.Encode("started"); - private static readonly System.Text.Json.JsonEncodedText MemberStarting = System.Text.Json.JsonEncodedText.Encode("starting"); - private static readonly System.Text.Json.JsonEncodedText MemberStopped = System.Text.Json.JsonEncodedText.Encode("stopped"); - private static readonly System.Text.Json.JsonEncodedText MemberStopping = System.Text.Json.JsonEncodedText.Encode("stopping"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberStarted)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState.Started; - } - - if (reader.ValueTextEquals(MemberStarting)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState.Starting; - } - - if (reader.ValueTextEquals(MemberStopped)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState.Stopped; - } - - if (reader.ValueTextEquals(MemberStopping)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState.Stopping; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberStarted.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState.Started; - } - - if (string.Equals(value, MemberStarting.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState.Starting; - } - - if (string.Equals(value, MemberStopped.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState.Stopped; - } - - if (string.Equals(value, MemberStopping.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState.Stopping; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState.Started: - writer.WriteStringValue(MemberStarted); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState.Starting: - writer.WriteStringValue(MemberStarting); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState.Stopped: - writer.WriteStringValue(MemberStopped); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState.Stopping: - writer.WriteStringValue(MemberStopping); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class JobStateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberClosed = System.Text.Json.JsonEncodedText.Encode("closed"); - private static readonly System.Text.Json.JsonEncodedText MemberClosing = System.Text.Json.JsonEncodedText.Encode("closing"); - private static readonly System.Text.Json.JsonEncodedText MemberFailed = System.Text.Json.JsonEncodedText.Encode("failed"); - private static readonly System.Text.Json.JsonEncodedText MemberOpened = System.Text.Json.JsonEncodedText.Encode("opened"); - private static readonly System.Text.Json.JsonEncodedText MemberOpening = System.Text.Json.JsonEncodedText.Encode("opening"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.JobState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberClosed)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.JobState.Closed; - } - - if (reader.ValueTextEquals(MemberClosing)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.JobState.Closing; - } - - if (reader.ValueTextEquals(MemberFailed)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.JobState.Failed; - } - - if (reader.ValueTextEquals(MemberOpened)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.JobState.Opened; - } - - if (reader.ValueTextEquals(MemberOpening)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.JobState.Opening; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberClosed.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.JobState.Closed; - } - - if (string.Equals(value, MemberClosing.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.JobState.Closing; - } - - if (string.Equals(value, MemberFailed.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.JobState.Failed; - } - - if (string.Equals(value, MemberOpened.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.JobState.Opened; - } - - if (string.Equals(value, MemberOpening.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.JobState.Opening; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.JobState)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.JobState value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.MachineLearning.JobState.Closed: - writer.WriteStringValue(MemberClosed); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.JobState.Closing: - writer.WriteStringValue(MemberClosing); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.JobState.Failed: - writer.WriteStringValue(MemberFailed); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.JobState.Opened: - writer.WriteStringValue(MemberOpened); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.JobState.Opening: - writer.WriteStringValue(MemberOpening); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.JobState)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.MachineLearning.JobState ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.JobState value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class SnapshotUpgradeStateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberFailed = System.Text.Json.JsonEncodedText.Encode("failed"); - private static readonly System.Text.Json.JsonEncodedText MemberLoadingOldState = System.Text.Json.JsonEncodedText.Encode("loading_old_state"); - private static readonly System.Text.Json.JsonEncodedText MemberSavingNewState = System.Text.Json.JsonEncodedText.Encode("saving_new_state"); - private static readonly System.Text.Json.JsonEncodedText MemberStopped = System.Text.Json.JsonEncodedText.Encode("stopped"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberFailed)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState.Failed; - } - - if (reader.ValueTextEquals(MemberLoadingOldState)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState.LoadingOldState; - } - - if (reader.ValueTextEquals(MemberSavingNewState)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState.SavingNewState; - } - - if (reader.ValueTextEquals(MemberStopped)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState.Stopped; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberFailed.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState.Failed; - } - - if (string.Equals(value, MemberLoadingOldState.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState.LoadingOldState; - } - - if (string.Equals(value, MemberSavingNewState.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState.SavingNewState; - } - - if (string.Equals(value, MemberStopped.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState.Stopped; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState.Failed: - writer.WriteStringValue(MemberFailed); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState.LoadingOldState: - writer.WriteStringValue(MemberLoadingOldState); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState.SavingNewState: - writer.WriteStringValue(MemberSavingNewState); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState.Stopped: - writer.WriteStringValue(MemberStopped); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class MemoryStatusConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberHardLimit = System.Text.Json.JsonEncodedText.Encode("hard_limit"); - private static readonly System.Text.Json.JsonEncodedText MemberOk = System.Text.Json.JsonEncodedText.Encode("ok"); - private static readonly System.Text.Json.JsonEncodedText MemberSoftLimit = System.Text.Json.JsonEncodedText.Encode("soft_limit"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberHardLimit)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus.HardLimit; - } - - if (reader.ValueTextEquals(MemberOk)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus.Ok; - } - - if (reader.ValueTextEquals(MemberSoftLimit)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus.SoftLimit; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberHardLimit.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus.HardLimit; - } - - if (string.Equals(value, MemberOk.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus.Ok; - } - - if (string.Equals(value, MemberSoftLimit.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus.SoftLimit; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus.HardLimit: - writer.WriteStringValue(MemberHardLimit); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus.Ok: - writer.WriteStringValue(MemberOk); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus.SoftLimit: - writer.WriteStringValue(MemberSoftLimit); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class CategorizationStatusConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberOk = System.Text.Json.JsonEncodedText.Encode("ok"); - private static readonly System.Text.Json.JsonEncodedText MemberWarn = System.Text.Json.JsonEncodedText.Encode("warn"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.CategorizationStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberOk)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.CategorizationStatus.Ok; - } - - if (reader.ValueTextEquals(MemberWarn)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.CategorizationStatus.Warn; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberOk.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.CategorizationStatus.Ok; - } - - if (string.Equals(value, MemberWarn.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.CategorizationStatus.Warn; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.CategorizationStatus)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.CategorizationStatus value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.MachineLearning.CategorizationStatus.Ok: - writer.WriteStringValue(MemberOk); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.CategorizationStatus.Warn: - writer.WriteStringValue(MemberWarn); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.CategorizationStatus)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.MachineLearning.CategorizationStatus ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.CategorizationStatus value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class JobBlockedReasonConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberDelete = System.Text.Json.JsonEncodedText.Encode("delete"); - private static readonly System.Text.Json.JsonEncodedText MemberReset = System.Text.Json.JsonEncodedText.Encode("reset"); - private static readonly System.Text.Json.JsonEncodedText MemberRevert = System.Text.Json.JsonEncodedText.Encode("revert"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberDelete)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason.Delete; - } - - if (reader.ValueTextEquals(MemberReset)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason.Reset; - } - - if (reader.ValueTextEquals(MemberRevert)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason.Revert; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberDelete.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason.Delete; - } - - if (string.Equals(value, MemberReset.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason.Reset; - } - - if (string.Equals(value, MemberRevert.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason.Revert; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason.Delete: - writer.WriteStringValue(MemberDelete); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason.Reset: - writer.WriteStringValue(MemberReset); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason.Revert: - writer.WriteStringValue(MemberRevert); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class RoutingStateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberFailed = System.Text.Json.JsonEncodedText.Encode("failed"); - private static readonly System.Text.Json.JsonEncodedText MemberStarted = System.Text.Json.JsonEncodedText.Encode("started"); - private static readonly System.Text.Json.JsonEncodedText MemberStarting = System.Text.Json.JsonEncodedText.Encode("starting"); - private static readonly System.Text.Json.JsonEncodedText MemberStopped = System.Text.Json.JsonEncodedText.Encode("stopped"); - private static readonly System.Text.Json.JsonEncodedText MemberStopping = System.Text.Json.JsonEncodedText.Encode("stopping"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.RoutingState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberFailed)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Failed; - } - - if (reader.ValueTextEquals(MemberStarted)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Started; - } - - if (reader.ValueTextEquals(MemberStarting)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Starting; - } - - if (reader.ValueTextEquals(MemberStopped)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Stopped; - } - - if (reader.ValueTextEquals(MemberStopping)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Stopping; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberFailed.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Failed; - } - - if (string.Equals(value, MemberStarted.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Started; - } - - if (string.Equals(value, MemberStarting.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Starting; - } - - if (string.Equals(value, MemberStopped.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Stopped; - } - - if (string.Equals(value, MemberStopping.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Stopping; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.RoutingState)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.RoutingState value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Failed: - writer.WriteStringValue(MemberFailed); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Started: - writer.WriteStringValue(MemberStarted); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Starting: - writer.WriteStringValue(MemberStarting); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Stopped: - writer.WriteStringValue(MemberStopped); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Stopping: - writer.WriteStringValue(MemberStopping); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.RoutingState)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.MachineLearning.RoutingState ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.RoutingState value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class RuleActionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberSkipModelUpdate = System.Text.Json.JsonEncodedText.Encode("skip_model_update"); - private static readonly System.Text.Json.JsonEncodedText MemberSkipResult = System.Text.Json.JsonEncodedText.Encode("skip_result"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.RuleAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberSkipModelUpdate)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.RuleAction.SkipModelUpdate; - } - - if (reader.ValueTextEquals(MemberSkipResult)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.RuleAction.SkipResult; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberSkipModelUpdate.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.RuleAction.SkipModelUpdate; - } - - if (string.Equals(value, MemberSkipResult.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.RuleAction.SkipResult; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.RuleAction)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.RuleAction value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.MachineLearning.RuleAction.SkipModelUpdate: - writer.WriteStringValue(MemberSkipModelUpdate); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.RuleAction.SkipResult: - writer.WriteStringValue(MemberSkipResult); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.RuleAction)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.MachineLearning.RuleAction ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.RuleAction value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TokenizationTruncateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberFirst = System.Text.Json.JsonEncodedText.Encode("first"); - private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); - private static readonly System.Text.Json.JsonEncodedText MemberSecond = System.Text.Json.JsonEncodedText.Encode("second"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberFirst)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate.First; - } - - if (reader.ValueTextEquals(MemberNone)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate.None; - } - - if (reader.ValueTextEquals(MemberSecond)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate.Second; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberFirst.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate.First; - } - - if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate.None; - } - - if (string.Equals(value, MemberSecond.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate.Second; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate.First: - writer.WriteStringValue(MemberFirst); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate.None: - writer.WriteStringValue(MemberNone); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate.Second: - writer.WriteStringValue(MemberSecond); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class AppliesToConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberActual = System.Text.Json.JsonEncodedText.Encode("actual"); - private static readonly System.Text.Json.JsonEncodedText MemberDiffFromTypical = System.Text.Json.JsonEncodedText.Encode("diff_from_typical"); - private static readonly System.Text.Json.JsonEncodedText MemberTime = System.Text.Json.JsonEncodedText.Encode("time"); - private static readonly System.Text.Json.JsonEncodedText MemberTypical = System.Text.Json.JsonEncodedText.Encode("typical"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberActual)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo.Actual; - } - - if (reader.ValueTextEquals(MemberDiffFromTypical)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo.DiffFromTypical; - } - - if (reader.ValueTextEquals(MemberTime)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo.Time; - } - - if (reader.ValueTextEquals(MemberTypical)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo.Typical; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberActual.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo.Actual; - } - - if (string.Equals(value, MemberDiffFromTypical.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo.DiffFromTypical; - } - - if (string.Equals(value, MemberTime.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo.Time; - } - - if (string.Equals(value, MemberTypical.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo.Typical; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo.Actual: - writer.WriteStringValue(MemberActual); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo.DiffFromTypical: - writer.WriteStringValue(MemberDiffFromTypical); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo.Time: - writer.WriteStringValue(MemberTime); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo.Typical: - writer.WriteStringValue(MemberTypical); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ConditionOperatorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberGt = System.Text.Json.JsonEncodedText.Encode("gt"); - private static readonly System.Text.Json.JsonEncodedText MemberGte = System.Text.Json.JsonEncodedText.Encode("gte"); - private static readonly System.Text.Json.JsonEncodedText MemberLt = System.Text.Json.JsonEncodedText.Encode("lt"); - private static readonly System.Text.Json.JsonEncodedText MemberLte = System.Text.Json.JsonEncodedText.Encode("lte"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberGt)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator.Gt; - } - - if (reader.ValueTextEquals(MemberGte)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator.Gte; - } - - if (reader.ValueTextEquals(MemberLt)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator.Lt; - } - - if (reader.ValueTextEquals(MemberLte)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator.Lte; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberGt.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator.Gt; - } - - if (string.Equals(value, MemberGte.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator.Gte; - } - - if (string.Equals(value, MemberLt.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator.Lt; - } - - if (string.Equals(value, MemberLte.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator.Lte; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator.Gt: - writer.WriteStringValue(MemberGt); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator.Gte: - writer.WriteStringValue(MemberGte); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator.Lt: - writer.WriteStringValue(MemberLt); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator.Lte: - writer.WriteStringValue(MemberLte); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class FilterTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberExclude = System.Text.Json.JsonEncodedText.Encode("exclude"); - private static readonly System.Text.Json.JsonEncodedText MemberInclude = System.Text.Json.JsonEncodedText.Encode("include"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.FilterType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberExclude)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.FilterType.Exclude; - } - - if (reader.ValueTextEquals(MemberInclude)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.FilterType.Include; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberExclude.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.FilterType.Exclude; - } - - if (string.Equals(value, MemberInclude.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.MachineLearning.FilterType.Include; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.FilterType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.FilterType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.MachineLearning.FilterType.Exclude: - writer.WriteStringValue(MemberExclude); - break; - case Elastic.Clients.Elasticsearch.MachineLearning.FilterType.Include: - writer.WriteStringValue(MemberInclude); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.FilterType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.MachineLearning.FilterType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.FilterType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.IncludeConverter))] -public enum Include -{ - /// - /// - /// Includes the model definition. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "definition")] - Definition, - /// - /// - /// Includes the model definition status. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "definition_status")] - DefinitionStatus, - /// - /// - /// Includes the baseline for feature importance values. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "feature_importance_baseline")] - FeatureImportanceBaseline, - /// - /// - /// Includes the information about hyperparameters used to train the model. - /// This information consists of the value, the absolute and relative - /// importance of the hyperparameter as well as an indicator of whether it was - /// specified by the user or tuned during hyperparameter optimization. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "hyperparameters")] - Hyperparameters, - /// - /// - /// Includes the total feature importance for the training data set. The - /// baseline and total feature importance values are returned in the metadata - /// field in the response body. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "total_feature_importance")] - TotalFeatureImportance -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriorityConverter))] -public enum TrainingPriority -{ - [System.Runtime.Serialization.EnumMember(Value = "low")] - Low, - [System.Runtime.Serialization.EnumMember(Value = "normal")] - Normal -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationStateConverter))] -public enum DeploymentAllocationState -{ - /// - /// - /// Trained model deployment has started on all valid nodes. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "fully_allocated")] - FullyAllocated, - /// - /// - /// The trained model is started on at least one node. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "started")] - Started, - /// - /// - /// Trained model deployment is starting but it is not yet deployed on any nodes. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "starting")] - Starting -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTypeConverter))] -public enum TrainedModelType -{ - /// - /// - /// A special type reserved for language identification models. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "lang_ident")] - LangIdent, - /// - /// - /// The stored definition is a PyTorch (specifically a TorchScript) model. - /// Currently only NLP models are supported. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "pytorch")] - Pytorch, - /// - /// - /// The model definition is an ensemble model of decision trees. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "tree_ensemble")] - TreeEnsemble -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequentConverter))] -public enum ExcludeFrequent -{ - [System.Runtime.Serialization.EnumMember(Value = "all")] - All, - [System.Runtime.Serialization.EnumMember(Value = "by")] - By, - [System.Runtime.Serialization.EnumMember(Value = "none")] - None, - [System.Runtime.Serialization.EnumMember(Value = "over")] - Over -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ChunkingModeConverter))] -public enum ChunkingMode -{ - [System.Runtime.Serialization.EnumMember(Value = "auto")] - Auto, - [System.Runtime.Serialization.EnumMember(Value = "manual")] - Manual, - [System.Runtime.Serialization.EnumMember(Value = "off")] - Off -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentStateConverter))] -public enum DeploymentAssignmentState -{ - /// - /// - /// The deployment is on a failed state and must be re-deployed. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "failed")] - Failed, - /// - /// - /// The deployment is usable; at least one node has the model allocated. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "started")] - Started, - /// - /// - /// The deployment has recently started but is not yet usable; the model is not allocated on any nodes. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "starting")] - Starting, - /// - /// - /// The deployment is preparing to stop and deallocate the model from the relevant nodes. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "stopping")] - Stopping -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeStateConverter))] -public enum DataframeState -{ - [System.Runtime.Serialization.EnumMember(Value = "failed")] - Failed, - [System.Runtime.Serialization.EnumMember(Value = "started")] - Started, - [System.Runtime.Serialization.EnumMember(Value = "starting")] - Starting, - [System.Runtime.Serialization.EnumMember(Value = "stopped")] - Stopped, - [System.Runtime.Serialization.EnumMember(Value = "stopping")] - Stopping -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DatafeedStateConverter))] -public enum DatafeedState -{ - [System.Runtime.Serialization.EnumMember(Value = "started")] - Started, - [System.Runtime.Serialization.EnumMember(Value = "starting")] - Starting, - [System.Runtime.Serialization.EnumMember(Value = "stopped")] - Stopped, - [System.Runtime.Serialization.EnumMember(Value = "stopping")] - Stopping -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.JobStateConverter))] -public enum JobState -{ - /// - /// - /// The job finished successfully with its model state persisted. The job must be opened before it can accept further data. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "closed")] - Closed, - /// - /// - /// The job close action is in progress and has not yet completed. A closing job cannot accept further data. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "closing")] - Closing, - /// - /// - /// The job did not finish successfully due to an error. - /// This situation can occur due to invalid input data, a fatal error occurring during the analysis, or an external interaction such as the process being killed by the Linux out of memory (OOM) killer. - /// If the job had irrevocably failed, it must be force closed and then deleted. - /// If the datafeed can be corrected, the job can be closed and then re-opened. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "failed")] - Failed, - /// - /// - /// The job is available to receive and process data. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "opened")] - Opened, - /// - /// - /// The job open action is in progress and has not yet completed. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "opening")] - Opening -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeStateConverter))] -public enum SnapshotUpgradeState -{ - [System.Runtime.Serialization.EnumMember(Value = "failed")] - Failed, - [System.Runtime.Serialization.EnumMember(Value = "loading_old_state")] - LoadingOldState, - [System.Runtime.Serialization.EnumMember(Value = "saving_new_state")] - SavingNewState, - [System.Runtime.Serialization.EnumMember(Value = "stopped")] - Stopped -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatusConverter))] -public enum MemoryStatus -{ - [System.Runtime.Serialization.EnumMember(Value = "hard_limit")] - HardLimit, - [System.Runtime.Serialization.EnumMember(Value = "ok")] - Ok, - [System.Runtime.Serialization.EnumMember(Value = "soft_limit")] - SoftLimit -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.CategorizationStatusConverter))] -public enum CategorizationStatus -{ - [System.Runtime.Serialization.EnumMember(Value = "ok")] - Ok, - [System.Runtime.Serialization.EnumMember(Value = "warn")] - Warn -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReasonConverter))] -public enum JobBlockedReason -{ - [System.Runtime.Serialization.EnumMember(Value = "delete")] - Delete, - [System.Runtime.Serialization.EnumMember(Value = "reset")] - Reset, - [System.Runtime.Serialization.EnumMember(Value = "revert")] - Revert -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.RoutingStateConverter))] -public enum RoutingState -{ - /// - /// - /// The allocation attempt failed. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "failed")] - Failed, - /// - /// - /// The trained model is allocated and ready to accept inference requests. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "started")] - Started, - /// - /// - /// The trained model is attempting to allocate on this node; inference requests are not yet accepted. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "starting")] - Starting, - /// - /// - /// The trained model is fully deallocated from this node. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "stopped")] - Stopped, - /// - /// - /// The trained model is being deallocated from this node. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "stopping")] - Stopping -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.RuleActionConverter))] -public enum RuleAction -{ - /// - /// - /// The value for that series will not be used to update the model. Unless you also specify skip_result, the results will be created as usual. This action is suitable when certain values are expected to be consistently anomalous and they affect the model in a way that negatively impacts the rest of the results. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "skip_model_update")] - SkipModelUpdate, - /// - /// - /// The result will not be created. Unless you also specify skip_model_update, the model will be updated as usual with the corresponding series value. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "skip_result")] - SkipResult -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncateConverter))] -public enum TokenizationTruncate -{ - [System.Runtime.Serialization.EnumMember(Value = "first")] - First, - [System.Runtime.Serialization.EnumMember(Value = "none")] - None, - [System.Runtime.Serialization.EnumMember(Value = "second")] - Second -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.AppliesToConverter))] -public enum AppliesTo -{ - [System.Runtime.Serialization.EnumMember(Value = "actual")] - Actual, - [System.Runtime.Serialization.EnumMember(Value = "diff_from_typical")] - DiffFromTypical, - [System.Runtime.Serialization.EnumMember(Value = "time")] - Time, - [System.Runtime.Serialization.EnumMember(Value = "typical")] - Typical -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperatorConverter))] -public enum ConditionOperator -{ - [System.Runtime.Serialization.EnumMember(Value = "gt")] - Gt, - [System.Runtime.Serialization.EnumMember(Value = "gte")] - Gte, - [System.Runtime.Serialization.EnumMember(Value = "lt")] - Lt, - [System.Runtime.Serialization.EnumMember(Value = "lte")] - Lte -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.FilterTypeConverter))] -public enum FilterType -{ - [System.Runtime.Serialization.EnumMember(Value = "exclude")] - Exclude, - [System.Runtime.Serialization.EnumMember(Value = "include")] - Include -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Mapping.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Mapping.g.cs deleted file mode 100644 index 1322e4a6bc5..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Mapping.g.cs +++ /dev/null @@ -1,2666 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using System; -using System.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.Mapping; - -internal sealed partial class DynamicMappingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberFalse = System.Text.Json.JsonEncodedText.Encode("false"); - private static readonly System.Text.Json.JsonEncodedText MemberRuntime = System.Text.Json.JsonEncodedText.Encode("runtime"); - private static readonly System.Text.Json.JsonEncodedText MemberStrict = System.Text.Json.JsonEncodedText.Encode("strict"); - private static readonly System.Text.Json.JsonEncodedText MemberTrue = System.Text.Json.JsonEncodedText.Encode("true"); - - public override Elastic.Clients.Elasticsearch.Mapping.DynamicMapping Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberFalse)) - { - return Elastic.Clients.Elasticsearch.Mapping.DynamicMapping.False; - } - - if (reader.ValueTextEquals(MemberRuntime)) - { - return Elastic.Clients.Elasticsearch.Mapping.DynamicMapping.Runtime; - } - - if (reader.ValueTextEquals(MemberStrict)) - { - return Elastic.Clients.Elasticsearch.Mapping.DynamicMapping.Strict; - } - - if (reader.ValueTextEquals(MemberTrue)) - { - return Elastic.Clients.Elasticsearch.Mapping.DynamicMapping.True; - } - - if (reader.TokenType is not System.Text.Json.JsonTokenType.String) - { - throw new System.Text.Json.JsonException($"Unknown member of type '{reader.TokenType}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.DynamicMapping)}'."); - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberFalse.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.DynamicMapping.False; - } - - if (string.Equals(value, MemberRuntime.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.DynamicMapping.Runtime; - } - - if (string.Equals(value, MemberStrict.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.DynamicMapping.Strict; - } - - if (string.Equals(value, MemberTrue.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.DynamicMapping.True; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.DynamicMapping)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Mapping.DynamicMapping.False: - writer.WriteRawValue(MemberFalse.EncodedUtf8Bytes); - break; - case Elastic.Clients.Elasticsearch.Mapping.DynamicMapping.Runtime: - writer.WriteStringValue(MemberRuntime); - break; - case Elastic.Clients.Elasticsearch.Mapping.DynamicMapping.Strict: - writer.WriteStringValue(MemberStrict); - break; - case Elastic.Clients.Elasticsearch.Mapping.DynamicMapping.True: - writer.WriteRawValue(MemberTrue.EncodedUtf8Bytes); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.DynamicMapping)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Mapping.DynamicMapping ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class SubobjectsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAuto = System.Text.Json.JsonEncodedText.Encode("auto"); - private static readonly System.Text.Json.JsonEncodedText MemberFalse = System.Text.Json.JsonEncodedText.Encode("false"); - private static readonly System.Text.Json.JsonEncodedText MemberTrue = System.Text.Json.JsonEncodedText.Encode("true"); - - public override Elastic.Clients.Elasticsearch.Mapping.Subobjects Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAuto)) - { - return Elastic.Clients.Elasticsearch.Mapping.Subobjects.Auto; - } - - if (reader.ValueTextEquals(MemberFalse)) - { - return Elastic.Clients.Elasticsearch.Mapping.Subobjects.False; - } - - if (reader.ValueTextEquals(MemberTrue)) - { - return Elastic.Clients.Elasticsearch.Mapping.Subobjects.True; - } - - if (reader.TokenType is not System.Text.Json.JsonTokenType.String) - { - throw new System.Text.Json.JsonException($"Unknown member of type '{reader.TokenType}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.Subobjects)}'."); - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAuto.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.Subobjects.Auto; - } - - if (string.Equals(value, MemberFalse.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.Subobjects.False; - } - - if (string.Equals(value, MemberTrue.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.Subobjects.True; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.Subobjects)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.Subobjects value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Mapping.Subobjects.Auto: - writer.WriteStringValue(MemberAuto); - break; - case Elastic.Clients.Elasticsearch.Mapping.Subobjects.False: - writer.WriteRawValue(MemberFalse.EncodedUtf8Bytes); - break; - case Elastic.Clients.Elasticsearch.Mapping.Subobjects.True: - writer.WriteRawValue(MemberTrue.EncodedUtf8Bytes); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.Subobjects)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Mapping.Subobjects ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.Subobjects value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class SourceFieldModeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberDisabled = System.Text.Json.JsonEncodedText.Encode("disabled"); - private static readonly System.Text.Json.JsonEncodedText MemberStored = System.Text.Json.JsonEncodedText.Encode("stored"); - private static readonly System.Text.Json.JsonEncodedText MemberSynthetic = System.Text.Json.JsonEncodedText.Encode("synthetic"); - - public override Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberDisabled)) - { - return Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode.Disabled; - } - - if (reader.ValueTextEquals(MemberStored)) - { - return Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode.Stored; - } - - if (reader.ValueTextEquals(MemberSynthetic)) - { - return Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode.Synthetic; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberDisabled.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode.Disabled; - } - - if (string.Equals(value, MemberStored.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode.Stored; - } - - if (string.Equals(value, MemberSynthetic.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode.Synthetic; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode.Disabled: - writer.WriteStringValue(MemberDisabled); - break; - case Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode.Stored: - writer.WriteStringValue(MemberStored); - break; - case Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode.Synthetic: - writer.WriteStringValue(MemberSynthetic); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TimeSeriesMetricTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCounter = System.Text.Json.JsonEncodedText.Encode("counter"); - private static readonly System.Text.Json.JsonEncodedText MemberGauge = System.Text.Json.JsonEncodedText.Encode("gauge"); - private static readonly System.Text.Json.JsonEncodedText MemberHistogram = System.Text.Json.JsonEncodedText.Encode("histogram"); - private static readonly System.Text.Json.JsonEncodedText MemberPosition = System.Text.Json.JsonEncodedText.Encode("position"); - private static readonly System.Text.Json.JsonEncodedText MemberSummary = System.Text.Json.JsonEncodedText.Encode("summary"); - - public override Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCounter)) - { - return Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Counter; - } - - if (reader.ValueTextEquals(MemberGauge)) - { - return Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Gauge; - } - - if (reader.ValueTextEquals(MemberHistogram)) - { - return Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Histogram; - } - - if (reader.ValueTextEquals(MemberPosition)) - { - return Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Position; - } - - if (reader.ValueTextEquals(MemberSummary)) - { - return Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Summary; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCounter.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Counter; - } - - if (string.Equals(value, MemberGauge.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Gauge; - } - - if (string.Equals(value, MemberHistogram.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Histogram; - } - - if (string.Equals(value, MemberPosition.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Position; - } - - if (string.Equals(value, MemberSummary.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Summary; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Counter: - writer.WriteStringValue(MemberCounter); - break; - case Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Gauge: - writer.WriteStringValue(MemberGauge); - break; - case Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Histogram: - writer.WriteStringValue(MemberHistogram); - break; - case Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Position: - writer.WriteStringValue(MemberPosition); - break; - case Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Summary: - writer.WriteStringValue(MemberSummary); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class MatchTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberRegex = System.Text.Json.JsonEncodedText.Encode("regex"); - private static readonly System.Text.Json.JsonEncodedText MemberSimple = System.Text.Json.JsonEncodedText.Encode("simple"); - - public override Elastic.Clients.Elasticsearch.Mapping.MatchType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberRegex)) - { - return Elastic.Clients.Elasticsearch.Mapping.MatchType.Regex; - } - - if (reader.ValueTextEquals(MemberSimple)) - { - return Elastic.Clients.Elasticsearch.Mapping.MatchType.Simple; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberRegex.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.MatchType.Regex; - } - - if (string.Equals(value, MemberSimple.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.MatchType.Simple; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.MatchType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.MatchType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Mapping.MatchType.Regex: - writer.WriteStringValue(MemberRegex); - break; - case Elastic.Clients.Elasticsearch.Mapping.MatchType.Simple: - writer.WriteStringValue(MemberSimple); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.MatchType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Mapping.MatchType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.MatchType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class RuntimeFieldTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberBoolean = System.Text.Json.JsonEncodedText.Encode("boolean"); - private static readonly System.Text.Json.JsonEncodedText MemberComposite = System.Text.Json.JsonEncodedText.Encode("composite"); - private static readonly System.Text.Json.JsonEncodedText MemberDate = System.Text.Json.JsonEncodedText.Encode("date"); - private static readonly System.Text.Json.JsonEncodedText MemberDouble = System.Text.Json.JsonEncodedText.Encode("double"); - private static readonly System.Text.Json.JsonEncodedText MemberGeoPoint = System.Text.Json.JsonEncodedText.Encode("geo_point"); - private static readonly System.Text.Json.JsonEncodedText MemberGeoShape = System.Text.Json.JsonEncodedText.Encode("geo_shape"); - private static readonly System.Text.Json.JsonEncodedText MemberIp = System.Text.Json.JsonEncodedText.Encode("ip"); - private static readonly System.Text.Json.JsonEncodedText MemberKeyword = System.Text.Json.JsonEncodedText.Encode("keyword"); - private static readonly System.Text.Json.JsonEncodedText MemberLong = System.Text.Json.JsonEncodedText.Encode("long"); - private static readonly System.Text.Json.JsonEncodedText MemberLookup = System.Text.Json.JsonEncodedText.Encode("lookup"); - - public override Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberBoolean)) - { - return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Boolean; - } - - if (reader.ValueTextEquals(MemberComposite)) - { - return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Composite; - } - - if (reader.ValueTextEquals(MemberDate)) - { - return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Date; - } - - if (reader.ValueTextEquals(MemberDouble)) - { - return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Double; - } - - if (reader.ValueTextEquals(MemberGeoPoint)) - { - return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.GeoPoint; - } - - if (reader.ValueTextEquals(MemberGeoShape)) - { - return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.GeoShape; - } - - if (reader.ValueTextEquals(MemberIp)) - { - return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Ip; - } - - if (reader.ValueTextEquals(MemberKeyword)) - { - return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Keyword; - } - - if (reader.ValueTextEquals(MemberLong)) - { - return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Long; - } - - if (reader.ValueTextEquals(MemberLookup)) - { - return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Lookup; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberBoolean.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Boolean; - } - - if (string.Equals(value, MemberComposite.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Composite; - } - - if (string.Equals(value, MemberDate.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Date; - } - - if (string.Equals(value, MemberDouble.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Double; - } - - if (string.Equals(value, MemberGeoPoint.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.GeoPoint; - } - - if (string.Equals(value, MemberGeoShape.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.GeoShape; - } - - if (string.Equals(value, MemberIp.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Ip; - } - - if (string.Equals(value, MemberKeyword.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Keyword; - } - - if (string.Equals(value, MemberLong.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Long; - } - - if (string.Equals(value, MemberLookup.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Lookup; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Boolean: - writer.WriteStringValue(MemberBoolean); - break; - case Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Composite: - writer.WriteStringValue(MemberComposite); - break; - case Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Date: - writer.WriteStringValue(MemberDate); - break; - case Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Double: - writer.WriteStringValue(MemberDouble); - break; - case Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.GeoPoint: - writer.WriteStringValue(MemberGeoPoint); - break; - case Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.GeoShape: - writer.WriteStringValue(MemberGeoShape); - break; - case Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Ip: - writer.WriteStringValue(MemberIp); - break; - case Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Keyword: - writer.WriteStringValue(MemberKeyword); - break; - case Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Long: - writer.WriteStringValue(MemberLong); - break; - case Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Lookup: - writer.WriteStringValue(MemberLookup); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class SyntheticSourceKeepEnumConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAll = System.Text.Json.JsonEncodedText.Encode("all"); - private static readonly System.Text.Json.JsonEncodedText MemberArrays = System.Text.Json.JsonEncodedText.Encode("arrays"); - private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); - - public override Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAll)) - { - return Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum.All; - } - - if (reader.ValueTextEquals(MemberArrays)) - { - return Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum.Arrays; - } - - if (reader.ValueTextEquals(MemberNone)) - { - return Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum.None; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAll.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum.All; - } - - if (string.Equals(value, MemberArrays.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum.Arrays; - } - - if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum.None; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum.All: - writer.WriteStringValue(MemberAll); - break; - case Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum.Arrays: - writer.WriteStringValue(MemberArrays); - break; - case Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum.None: - writer.WriteStringValue(MemberNone); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class OnScriptErrorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberContinue = System.Text.Json.JsonEncodedText.Encode("continue"); - private static readonly System.Text.Json.JsonEncodedText MemberFail = System.Text.Json.JsonEncodedText.Encode("fail"); - - public override Elastic.Clients.Elasticsearch.Mapping.OnScriptError Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberContinue)) - { - return Elastic.Clients.Elasticsearch.Mapping.OnScriptError.Continue; - } - - if (reader.ValueTextEquals(MemberFail)) - { - return Elastic.Clients.Elasticsearch.Mapping.OnScriptError.Fail; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberContinue.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.OnScriptError.Continue; - } - - if (string.Equals(value, MemberFail.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.OnScriptError.Fail; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.OnScriptError)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.OnScriptError value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Mapping.OnScriptError.Continue: - writer.WriteStringValue(MemberContinue); - break; - case Elastic.Clients.Elasticsearch.Mapping.OnScriptError.Fail: - writer.WriteStringValue(MemberFail); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.OnScriptError)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Mapping.OnScriptError ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.OnScriptError value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class IndexOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberDocs = System.Text.Json.JsonEncodedText.Encode("docs"); - private static readonly System.Text.Json.JsonEncodedText MemberFreqs = System.Text.Json.JsonEncodedText.Encode("freqs"); - private static readonly System.Text.Json.JsonEncodedText MemberOffsets = System.Text.Json.JsonEncodedText.Encode("offsets"); - private static readonly System.Text.Json.JsonEncodedText MemberPositions = System.Text.Json.JsonEncodedText.Encode("positions"); - - public override Elastic.Clients.Elasticsearch.Mapping.IndexOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberDocs)) - { - return Elastic.Clients.Elasticsearch.Mapping.IndexOptions.Docs; - } - - if (reader.ValueTextEquals(MemberFreqs)) - { - return Elastic.Clients.Elasticsearch.Mapping.IndexOptions.Freqs; - } - - if (reader.ValueTextEquals(MemberOffsets)) - { - return Elastic.Clients.Elasticsearch.Mapping.IndexOptions.Offsets; - } - - if (reader.ValueTextEquals(MemberPositions)) - { - return Elastic.Clients.Elasticsearch.Mapping.IndexOptions.Positions; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberDocs.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.IndexOptions.Docs; - } - - if (string.Equals(value, MemberFreqs.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.IndexOptions.Freqs; - } - - if (string.Equals(value, MemberOffsets.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.IndexOptions.Offsets; - } - - if (string.Equals(value, MemberPositions.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.IndexOptions.Positions; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.IndexOptions)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.IndexOptions value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Mapping.IndexOptions.Docs: - writer.WriteStringValue(MemberDocs); - break; - case Elastic.Clients.Elasticsearch.Mapping.IndexOptions.Freqs: - writer.WriteStringValue(MemberFreqs); - break; - case Elastic.Clients.Elasticsearch.Mapping.IndexOptions.Offsets: - writer.WriteStringValue(MemberOffsets); - break; - case Elastic.Clients.Elasticsearch.Mapping.IndexOptions.Positions: - writer.WriteStringValue(MemberPositions); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.IndexOptions)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Mapping.IndexOptions ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.IndexOptions value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TermVectorOptionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberNo = System.Text.Json.JsonEncodedText.Encode("no"); - private static readonly System.Text.Json.JsonEncodedText MemberWithOffsets = System.Text.Json.JsonEncodedText.Encode("with_offsets"); - private static readonly System.Text.Json.JsonEncodedText MemberWithPositions = System.Text.Json.JsonEncodedText.Encode("with_positions"); - private static readonly System.Text.Json.JsonEncodedText MemberWithPositionsOffsets = System.Text.Json.JsonEncodedText.Encode("with_positions_offsets"); - private static readonly System.Text.Json.JsonEncodedText MemberWithPositionsOffsetsPayloads = System.Text.Json.JsonEncodedText.Encode("with_positions_offsets_payloads"); - private static readonly System.Text.Json.JsonEncodedText MemberWithPositionsPayloads = System.Text.Json.JsonEncodedText.Encode("with_positions_payloads"); - private static readonly System.Text.Json.JsonEncodedText MemberYes = System.Text.Json.JsonEncodedText.Encode("yes"); - - public override Elastic.Clients.Elasticsearch.Mapping.TermVectorOption Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberNo)) - { - return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.No; - } - - if (reader.ValueTextEquals(MemberWithOffsets)) - { - return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithOffsets; - } - - if (reader.ValueTextEquals(MemberWithPositions)) - { - return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithPositions; - } - - if (reader.ValueTextEquals(MemberWithPositionsOffsets)) - { - return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithPositionsOffsets; - } - - if (reader.ValueTextEquals(MemberWithPositionsOffsetsPayloads)) - { - return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithPositionsOffsetsPayloads; - } - - if (reader.ValueTextEquals(MemberWithPositionsPayloads)) - { - return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithPositionsPayloads; - } - - if (reader.ValueTextEquals(MemberYes)) - { - return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.Yes; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberNo.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.No; - } - - if (string.Equals(value, MemberWithOffsets.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithOffsets; - } - - if (string.Equals(value, MemberWithPositions.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithPositions; - } - - if (string.Equals(value, MemberWithPositionsOffsets.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithPositionsOffsets; - } - - if (string.Equals(value, MemberWithPositionsOffsetsPayloads.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithPositionsOffsetsPayloads; - } - - if (string.Equals(value, MemberWithPositionsPayloads.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithPositionsPayloads; - } - - if (string.Equals(value, MemberYes.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.Yes; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.TermVectorOption)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.TermVectorOption value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.No: - writer.WriteStringValue(MemberNo); - break; - case Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithOffsets: - writer.WriteStringValue(MemberWithOffsets); - break; - case Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithPositions: - writer.WriteStringValue(MemberWithPositions); - break; - case Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithPositionsOffsets: - writer.WriteStringValue(MemberWithPositionsOffsets); - break; - case Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithPositionsOffsetsPayloads: - writer.WriteStringValue(MemberWithPositionsOffsetsPayloads); - break; - case Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithPositionsPayloads: - writer.WriteStringValue(MemberWithPositionsPayloads); - break; - case Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.Yes: - writer.WriteStringValue(MemberYes); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.TermVectorOption)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Mapping.TermVectorOption ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.TermVectorOption value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class DenseVectorElementTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberBit = System.Text.Json.JsonEncodedText.Encode("bit"); - private static readonly System.Text.Json.JsonEncodedText MemberByte = System.Text.Json.JsonEncodedText.Encode("byte"); - private static readonly System.Text.Json.JsonEncodedText MemberFloat = System.Text.Json.JsonEncodedText.Encode("float"); - - public override Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberBit)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType.Bit; - } - - if (reader.ValueTextEquals(MemberByte)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType.Byte; - } - - if (reader.ValueTextEquals(MemberFloat)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType.Float; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberBit.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType.Bit; - } - - if (string.Equals(value, MemberByte.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType.Byte; - } - - if (string.Equals(value, MemberFloat.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType.Float; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType.Bit: - writer.WriteStringValue(MemberBit); - break; - case Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType.Byte: - writer.WriteStringValue(MemberByte); - break; - case Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType.Float: - writer.WriteStringValue(MemberFloat); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class DenseVectorSimilarityConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCosine = System.Text.Json.JsonEncodedText.Encode("cosine"); - private static readonly System.Text.Json.JsonEncodedText MemberDotProduct = System.Text.Json.JsonEncodedText.Encode("dot_product"); - private static readonly System.Text.Json.JsonEncodedText MemberL2Norm = System.Text.Json.JsonEncodedText.Encode("l2_norm"); - private static readonly System.Text.Json.JsonEncodedText MemberMaxInnerProduct = System.Text.Json.JsonEncodedText.Encode("max_inner_product"); - - public override Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCosine)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity.Cosine; - } - - if (reader.ValueTextEquals(MemberDotProduct)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity.DotProduct; - } - - if (reader.ValueTextEquals(MemberL2Norm)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity.L2Norm; - } - - if (reader.ValueTextEquals(MemberMaxInnerProduct)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity.MaxInnerProduct; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCosine.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity.Cosine; - } - - if (string.Equals(value, MemberDotProduct.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity.DotProduct; - } - - if (string.Equals(value, MemberL2Norm.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity.L2Norm; - } - - if (string.Equals(value, MemberMaxInnerProduct.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity.MaxInnerProduct; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity.Cosine: - writer.WriteStringValue(MemberCosine); - break; - case Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity.DotProduct: - writer.WriteStringValue(MemberDotProduct); - break; - case Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity.L2Norm: - writer.WriteStringValue(MemberL2Norm); - break; - case Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity.MaxInnerProduct: - writer.WriteStringValue(MemberMaxInnerProduct); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class RankVectorElementTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberBit = System.Text.Json.JsonEncodedText.Encode("bit"); - private static readonly System.Text.Json.JsonEncodedText MemberByte = System.Text.Json.JsonEncodedText.Encode("byte"); - private static readonly System.Text.Json.JsonEncodedText MemberFloat = System.Text.Json.JsonEncodedText.Encode("float"); - - public override Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberBit)) - { - return Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType.Bit; - } - - if (reader.ValueTextEquals(MemberByte)) - { - return Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType.Byte; - } - - if (reader.ValueTextEquals(MemberFloat)) - { - return Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType.Float; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberBit.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType.Bit; - } - - if (string.Equals(value, MemberByte.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType.Byte; - } - - if (string.Equals(value, MemberFloat.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType.Float; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType.Bit: - writer.WriteStringValue(MemberBit); - break; - case Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType.Byte: - writer.WriteStringValue(MemberByte); - break; - case Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType.Float: - writer.WriteStringValue(MemberFloat); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class GeoPointMetricTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCounter = System.Text.Json.JsonEncodedText.Encode("counter"); - private static readonly System.Text.Json.JsonEncodedText MemberGauge = System.Text.Json.JsonEncodedText.Encode("gauge"); - private static readonly System.Text.Json.JsonEncodedText MemberPosition = System.Text.Json.JsonEncodedText.Encode("position"); - - public override Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCounter)) - { - return Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType.Counter; - } - - if (reader.ValueTextEquals(MemberGauge)) - { - return Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType.Gauge; - } - - if (reader.ValueTextEquals(MemberPosition)) - { - return Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType.Position; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCounter.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType.Counter; - } - - if (string.Equals(value, MemberGauge.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType.Gauge; - } - - if (string.Equals(value, MemberPosition.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType.Position; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType.Counter: - writer.WriteStringValue(MemberCounter); - break; - case Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType.Gauge: - writer.WriteStringValue(MemberGauge); - break; - case Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType.Position: - writer.WriteStringValue(MemberPosition); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class GeoOrientationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberLeft = System.Text.Json.JsonEncodedText.Encode("left"); - private static readonly System.Text.Json.JsonEncodedText MemberLeft1 = System.Text.Json.JsonEncodedText.Encode("LEFT"); - private static readonly System.Text.Json.JsonEncodedText MemberLeft2 = System.Text.Json.JsonEncodedText.Encode("clockwise"); - private static readonly System.Text.Json.JsonEncodedText MemberLeft3 = System.Text.Json.JsonEncodedText.Encode("cw"); - private static readonly System.Text.Json.JsonEncodedText MemberRight = System.Text.Json.JsonEncodedText.Encode("right"); - private static readonly System.Text.Json.JsonEncodedText MemberRight1 = System.Text.Json.JsonEncodedText.Encode("RIGHT"); - private static readonly System.Text.Json.JsonEncodedText MemberRight2 = System.Text.Json.JsonEncodedText.Encode("counterclockwise"); - private static readonly System.Text.Json.JsonEncodedText MemberRight3 = System.Text.Json.JsonEncodedText.Encode("ccw"); - - public override Elastic.Clients.Elasticsearch.Mapping.GeoOrientation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberLeft) || reader.ValueTextEquals(MemberLeft1) || reader.ValueTextEquals(MemberLeft2) || reader.ValueTextEquals(MemberLeft3)) - { - return Elastic.Clients.Elasticsearch.Mapping.GeoOrientation.Left; - } - - if (reader.ValueTextEquals(MemberRight) || reader.ValueTextEquals(MemberRight1) || reader.ValueTextEquals(MemberRight2) || reader.ValueTextEquals(MemberRight3)) - { - return Elastic.Clients.Elasticsearch.Mapping.GeoOrientation.Right; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberLeft.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberLeft1.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberLeft2.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberLeft3.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.GeoOrientation.Left; - } - - if (string.Equals(value, MemberRight.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberRight1.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberRight2.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberRight3.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.GeoOrientation.Right; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.GeoOrientation)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.GeoOrientation value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Mapping.GeoOrientation.Left: - writer.WriteStringValue(MemberLeft); - break; - case Elastic.Clients.Elasticsearch.Mapping.GeoOrientation.Right: - writer.WriteStringValue(MemberRight); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.GeoOrientation)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Mapping.GeoOrientation ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.GeoOrientation value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class GeoStrategyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberRecursive = System.Text.Json.JsonEncodedText.Encode("recursive"); - private static readonly System.Text.Json.JsonEncodedText MemberTerm = System.Text.Json.JsonEncodedText.Encode("term"); - - public override Elastic.Clients.Elasticsearch.Mapping.GeoStrategy Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberRecursive)) - { - return Elastic.Clients.Elasticsearch.Mapping.GeoStrategy.Recursive; - } - - if (reader.ValueTextEquals(MemberTerm)) - { - return Elastic.Clients.Elasticsearch.Mapping.GeoStrategy.Term; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberRecursive.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.GeoStrategy.Recursive; - } - - if (string.Equals(value, MemberTerm.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.GeoStrategy.Term; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.GeoStrategy)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.GeoStrategy value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Mapping.GeoStrategy.Recursive: - writer.WriteStringValue(MemberRecursive); - break; - case Elastic.Clients.Elasticsearch.Mapping.GeoStrategy.Term: - writer.WriteStringValue(MemberTerm); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.GeoStrategy)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Mapping.GeoStrategy ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.GeoStrategy value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class FieldTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAggregateMetricDouble = System.Text.Json.JsonEncodedText.Encode("aggregate_metric_double"); - private static readonly System.Text.Json.JsonEncodedText MemberAlias = System.Text.Json.JsonEncodedText.Encode("alias"); - private static readonly System.Text.Json.JsonEncodedText MemberBinary = System.Text.Json.JsonEncodedText.Encode("binary"); - private static readonly System.Text.Json.JsonEncodedText MemberBoolean = System.Text.Json.JsonEncodedText.Encode("boolean"); - private static readonly System.Text.Json.JsonEncodedText MemberByte = System.Text.Json.JsonEncodedText.Encode("byte"); - private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText MemberConstantKeyword = System.Text.Json.JsonEncodedText.Encode("constant_keyword"); - private static readonly System.Text.Json.JsonEncodedText MemberCountedKeyword = System.Text.Json.JsonEncodedText.Encode("counted_keyword"); - private static readonly System.Text.Json.JsonEncodedText MemberDate = System.Text.Json.JsonEncodedText.Encode("date"); - private static readonly System.Text.Json.JsonEncodedText MemberDateNanos = System.Text.Json.JsonEncodedText.Encode("date_nanos"); - private static readonly System.Text.Json.JsonEncodedText MemberDateRange = System.Text.Json.JsonEncodedText.Encode("date_range"); - private static readonly System.Text.Json.JsonEncodedText MemberDenseVector = System.Text.Json.JsonEncodedText.Encode("dense_vector"); - private static readonly System.Text.Json.JsonEncodedText MemberDouble = System.Text.Json.JsonEncodedText.Encode("double"); - private static readonly System.Text.Json.JsonEncodedText MemberDoubleRange = System.Text.Json.JsonEncodedText.Encode("double_range"); - private static readonly System.Text.Json.JsonEncodedText MemberFlattened = System.Text.Json.JsonEncodedText.Encode("flattened"); - private static readonly System.Text.Json.JsonEncodedText MemberFloat = System.Text.Json.JsonEncodedText.Encode("float"); - private static readonly System.Text.Json.JsonEncodedText MemberFloatRange = System.Text.Json.JsonEncodedText.Encode("float_range"); - private static readonly System.Text.Json.JsonEncodedText MemberGeoPoint = System.Text.Json.JsonEncodedText.Encode("geo_point"); - private static readonly System.Text.Json.JsonEncodedText MemberGeoShape = System.Text.Json.JsonEncodedText.Encode("geo_shape"); - private static readonly System.Text.Json.JsonEncodedText MemberHalfFloat = System.Text.Json.JsonEncodedText.Encode("half_float"); - private static readonly System.Text.Json.JsonEncodedText MemberHistogram = System.Text.Json.JsonEncodedText.Encode("histogram"); - private static readonly System.Text.Json.JsonEncodedText MemberIcuCollationKeyword = System.Text.Json.JsonEncodedText.Encode("icu_collation_keyword"); - private static readonly System.Text.Json.JsonEncodedText MemberInteger = System.Text.Json.JsonEncodedText.Encode("integer"); - private static readonly System.Text.Json.JsonEncodedText MemberIntegerRange = System.Text.Json.JsonEncodedText.Encode("integer_range"); - private static readonly System.Text.Json.JsonEncodedText MemberIp = System.Text.Json.JsonEncodedText.Encode("ip"); - private static readonly System.Text.Json.JsonEncodedText MemberIpRange = System.Text.Json.JsonEncodedText.Encode("ip_range"); - private static readonly System.Text.Json.JsonEncodedText MemberJoin = System.Text.Json.JsonEncodedText.Encode("join"); - private static readonly System.Text.Json.JsonEncodedText MemberKeyword = System.Text.Json.JsonEncodedText.Encode("keyword"); - private static readonly System.Text.Json.JsonEncodedText MemberLong = System.Text.Json.JsonEncodedText.Encode("long"); - private static readonly System.Text.Json.JsonEncodedText MemberLongRange = System.Text.Json.JsonEncodedText.Encode("long_range"); - private static readonly System.Text.Json.JsonEncodedText MemberMatchOnlyText = System.Text.Json.JsonEncodedText.Encode("match_only_text"); - private static readonly System.Text.Json.JsonEncodedText MemberMurmur3 = System.Text.Json.JsonEncodedText.Encode("murmur3"); - private static readonly System.Text.Json.JsonEncodedText MemberNested = System.Text.Json.JsonEncodedText.Encode("nested"); - private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); - private static readonly System.Text.Json.JsonEncodedText MemberObject = System.Text.Json.JsonEncodedText.Encode("object"); - private static readonly System.Text.Json.JsonEncodedText MemberPassthrough = System.Text.Json.JsonEncodedText.Encode("passthrough"); - private static readonly System.Text.Json.JsonEncodedText MemberPercolator = System.Text.Json.JsonEncodedText.Encode("percolator"); - private static readonly System.Text.Json.JsonEncodedText MemberRankFeature = System.Text.Json.JsonEncodedText.Encode("rank_feature"); - private static readonly System.Text.Json.JsonEncodedText MemberRankFeatures = System.Text.Json.JsonEncodedText.Encode("rank_features"); - private static readonly System.Text.Json.JsonEncodedText MemberScaledFloat = System.Text.Json.JsonEncodedText.Encode("scaled_float"); - private static readonly System.Text.Json.JsonEncodedText MemberSearchAsYouType = System.Text.Json.JsonEncodedText.Encode("search_as_you_type"); - private static readonly System.Text.Json.JsonEncodedText MemberSemanticText = System.Text.Json.JsonEncodedText.Encode("semantic_text"); - private static readonly System.Text.Json.JsonEncodedText MemberShape = System.Text.Json.JsonEncodedText.Encode("shape"); - private static readonly System.Text.Json.JsonEncodedText MemberShort = System.Text.Json.JsonEncodedText.Encode("short"); - private static readonly System.Text.Json.JsonEncodedText MemberSparseVector = System.Text.Json.JsonEncodedText.Encode("sparse_vector"); - private static readonly System.Text.Json.JsonEncodedText MemberText = System.Text.Json.JsonEncodedText.Encode("text"); - private static readonly System.Text.Json.JsonEncodedText MemberTokenCount = System.Text.Json.JsonEncodedText.Encode("token_count"); - private static readonly System.Text.Json.JsonEncodedText MemberVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Mapping.FieldType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAggregateMetricDouble)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.AggregateMetricDouble; - } - - if (reader.ValueTextEquals(MemberAlias)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Alias; - } - - if (reader.ValueTextEquals(MemberBinary)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Binary; - } - - if (reader.ValueTextEquals(MemberBoolean)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Boolean; - } - - if (reader.ValueTextEquals(MemberByte)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Byte; - } - - if (reader.ValueTextEquals(MemberCompletion)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Completion; - } - - if (reader.ValueTextEquals(MemberConstantKeyword)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.ConstantKeyword; - } - - if (reader.ValueTextEquals(MemberCountedKeyword)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.CountedKeyword; - } - - if (reader.ValueTextEquals(MemberDate)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Date; - } - - if (reader.ValueTextEquals(MemberDateNanos)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.DateNanos; - } - - if (reader.ValueTextEquals(MemberDateRange)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.DateRange; - } - - if (reader.ValueTextEquals(MemberDenseVector)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.DenseVector; - } - - if (reader.ValueTextEquals(MemberDouble)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Double; - } - - if (reader.ValueTextEquals(MemberDoubleRange)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.DoubleRange; - } - - if (reader.ValueTextEquals(MemberFlattened)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Flattened; - } - - if (reader.ValueTextEquals(MemberFloat)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Float; - } - - if (reader.ValueTextEquals(MemberFloatRange)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.FloatRange; - } - - if (reader.ValueTextEquals(MemberGeoPoint)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.GeoPoint; - } - - if (reader.ValueTextEquals(MemberGeoShape)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.GeoShape; - } - - if (reader.ValueTextEquals(MemberHalfFloat)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.HalfFloat; - } - - if (reader.ValueTextEquals(MemberHistogram)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Histogram; - } - - if (reader.ValueTextEquals(MemberIcuCollationKeyword)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.IcuCollationKeyword; - } - - if (reader.ValueTextEquals(MemberInteger)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Integer; - } - - if (reader.ValueTextEquals(MemberIntegerRange)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.IntegerRange; - } - - if (reader.ValueTextEquals(MemberIp)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Ip; - } - - if (reader.ValueTextEquals(MemberIpRange)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.IpRange; - } - - if (reader.ValueTextEquals(MemberJoin)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Join; - } - - if (reader.ValueTextEquals(MemberKeyword)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Keyword; - } - - if (reader.ValueTextEquals(MemberLong)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Long; - } - - if (reader.ValueTextEquals(MemberLongRange)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.LongRange; - } - - if (reader.ValueTextEquals(MemberMatchOnlyText)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.MatchOnlyText; - } - - if (reader.ValueTextEquals(MemberMurmur3)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Murmur3; - } - - if (reader.ValueTextEquals(MemberNested)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Nested; - } - - if (reader.ValueTextEquals(MemberNone)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.None; - } - - if (reader.ValueTextEquals(MemberObject)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Object; - } - - if (reader.ValueTextEquals(MemberPassthrough)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Passthrough; - } - - if (reader.ValueTextEquals(MemberPercolator)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Percolator; - } - - if (reader.ValueTextEquals(MemberRankFeature)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.RankFeature; - } - - if (reader.ValueTextEquals(MemberRankFeatures)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.RankFeatures; - } - - if (reader.ValueTextEquals(MemberScaledFloat)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.ScaledFloat; - } - - if (reader.ValueTextEquals(MemberSearchAsYouType)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.SearchAsYouType; - } - - if (reader.ValueTextEquals(MemberSemanticText)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.SemanticText; - } - - if (reader.ValueTextEquals(MemberShape)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Shape; - } - - if (reader.ValueTextEquals(MemberShort)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Short; - } - - if (reader.ValueTextEquals(MemberSparseVector)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.SparseVector; - } - - if (reader.ValueTextEquals(MemberText)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Text; - } - - if (reader.ValueTextEquals(MemberTokenCount)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.TokenCount; - } - - if (reader.ValueTextEquals(MemberVersion)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Version; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAggregateMetricDouble.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.AggregateMetricDouble; - } - - if (string.Equals(value, MemberAlias.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Alias; - } - - if (string.Equals(value, MemberBinary.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Binary; - } - - if (string.Equals(value, MemberBoolean.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Boolean; - } - - if (string.Equals(value, MemberByte.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Byte; - } - - if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Completion; - } - - if (string.Equals(value, MemberConstantKeyword.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.ConstantKeyword; - } - - if (string.Equals(value, MemberCountedKeyword.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.CountedKeyword; - } - - if (string.Equals(value, MemberDate.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Date; - } - - if (string.Equals(value, MemberDateNanos.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.DateNanos; - } - - if (string.Equals(value, MemberDateRange.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.DateRange; - } - - if (string.Equals(value, MemberDenseVector.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.DenseVector; - } - - if (string.Equals(value, MemberDouble.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Double; - } - - if (string.Equals(value, MemberDoubleRange.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.DoubleRange; - } - - if (string.Equals(value, MemberFlattened.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Flattened; - } - - if (string.Equals(value, MemberFloat.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Float; - } - - if (string.Equals(value, MemberFloatRange.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.FloatRange; - } - - if (string.Equals(value, MemberGeoPoint.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.GeoPoint; - } - - if (string.Equals(value, MemberGeoShape.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.GeoShape; - } - - if (string.Equals(value, MemberHalfFloat.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.HalfFloat; - } - - if (string.Equals(value, MemberHistogram.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Histogram; - } - - if (string.Equals(value, MemberIcuCollationKeyword.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.IcuCollationKeyword; - } - - if (string.Equals(value, MemberInteger.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Integer; - } - - if (string.Equals(value, MemberIntegerRange.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.IntegerRange; - } - - if (string.Equals(value, MemberIp.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Ip; - } - - if (string.Equals(value, MemberIpRange.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.IpRange; - } - - if (string.Equals(value, MemberJoin.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Join; - } - - if (string.Equals(value, MemberKeyword.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Keyword; - } - - if (string.Equals(value, MemberLong.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Long; - } - - if (string.Equals(value, MemberLongRange.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.LongRange; - } - - if (string.Equals(value, MemberMatchOnlyText.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.MatchOnlyText; - } - - if (string.Equals(value, MemberMurmur3.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Murmur3; - } - - if (string.Equals(value, MemberNested.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Nested; - } - - if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.None; - } - - if (string.Equals(value, MemberObject.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Object; - } - - if (string.Equals(value, MemberPassthrough.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Passthrough; - } - - if (string.Equals(value, MemberPercolator.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Percolator; - } - - if (string.Equals(value, MemberRankFeature.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.RankFeature; - } - - if (string.Equals(value, MemberRankFeatures.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.RankFeatures; - } - - if (string.Equals(value, MemberScaledFloat.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.ScaledFloat; - } - - if (string.Equals(value, MemberSearchAsYouType.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.SearchAsYouType; - } - - if (string.Equals(value, MemberSemanticText.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.SemanticText; - } - - if (string.Equals(value, MemberShape.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Shape; - } - - if (string.Equals(value, MemberShort.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Short; - } - - if (string.Equals(value, MemberSparseVector.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.SparseVector; - } - - if (string.Equals(value, MemberText.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Text; - } - - if (string.Equals(value, MemberTokenCount.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.TokenCount; - } - - if (string.Equals(value, MemberVersion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.FieldType.Version; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.FieldType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.FieldType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Mapping.FieldType.AggregateMetricDouble: - writer.WriteStringValue(MemberAggregateMetricDouble); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.Alias: - writer.WriteStringValue(MemberAlias); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.Binary: - writer.WriteStringValue(MemberBinary); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.Boolean: - writer.WriteStringValue(MemberBoolean); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.Byte: - writer.WriteStringValue(MemberByte); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.Completion: - writer.WriteStringValue(MemberCompletion); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.ConstantKeyword: - writer.WriteStringValue(MemberConstantKeyword); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.CountedKeyword: - writer.WriteStringValue(MemberCountedKeyword); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.Date: - writer.WriteStringValue(MemberDate); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.DateNanos: - writer.WriteStringValue(MemberDateNanos); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.DateRange: - writer.WriteStringValue(MemberDateRange); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.DenseVector: - writer.WriteStringValue(MemberDenseVector); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.Double: - writer.WriteStringValue(MemberDouble); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.DoubleRange: - writer.WriteStringValue(MemberDoubleRange); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.Flattened: - writer.WriteStringValue(MemberFlattened); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.Float: - writer.WriteStringValue(MemberFloat); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.FloatRange: - writer.WriteStringValue(MemberFloatRange); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.GeoPoint: - writer.WriteStringValue(MemberGeoPoint); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.GeoShape: - writer.WriteStringValue(MemberGeoShape); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.HalfFloat: - writer.WriteStringValue(MemberHalfFloat); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.Histogram: - writer.WriteStringValue(MemberHistogram); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.IcuCollationKeyword: - writer.WriteStringValue(MemberIcuCollationKeyword); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.Integer: - writer.WriteStringValue(MemberInteger); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.IntegerRange: - writer.WriteStringValue(MemberIntegerRange); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.Ip: - writer.WriteStringValue(MemberIp); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.IpRange: - writer.WriteStringValue(MemberIpRange); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.Join: - writer.WriteStringValue(MemberJoin); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.Keyword: - writer.WriteStringValue(MemberKeyword); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.Long: - writer.WriteStringValue(MemberLong); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.LongRange: - writer.WriteStringValue(MemberLongRange); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.MatchOnlyText: - writer.WriteStringValue(MemberMatchOnlyText); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.Murmur3: - writer.WriteStringValue(MemberMurmur3); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.Nested: - writer.WriteStringValue(MemberNested); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.None: - writer.WriteStringValue(MemberNone); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.Object: - writer.WriteStringValue(MemberObject); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.Passthrough: - writer.WriteStringValue(MemberPassthrough); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.Percolator: - writer.WriteStringValue(MemberPercolator); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.RankFeature: - writer.WriteStringValue(MemberRankFeature); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.RankFeatures: - writer.WriteStringValue(MemberRankFeatures); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.ScaledFloat: - writer.WriteStringValue(MemberScaledFloat); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.SearchAsYouType: - writer.WriteStringValue(MemberSearchAsYouType); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.SemanticText: - writer.WriteStringValue(MemberSemanticText); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.Shape: - writer.WriteStringValue(MemberShape); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.Short: - writer.WriteStringValue(MemberShort); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.SparseVector: - writer.WriteStringValue(MemberSparseVector); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.Text: - writer.WriteStringValue(MemberText); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.TokenCount: - writer.WriteStringValue(MemberTokenCount); - break; - case Elastic.Clients.Elasticsearch.Mapping.FieldType.Version: - writer.WriteStringValue(MemberVersion); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.FieldType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Mapping.FieldType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.FieldType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class DenseVectorIndexOptionsTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberBbqFlat = System.Text.Json.JsonEncodedText.Encode("bbq_flat"); - private static readonly System.Text.Json.JsonEncodedText MemberBbqHnsw = System.Text.Json.JsonEncodedText.Encode("bbq_hnsw"); - private static readonly System.Text.Json.JsonEncodedText MemberFlat = System.Text.Json.JsonEncodedText.Encode("flat"); - private static readonly System.Text.Json.JsonEncodedText MemberHnsw = System.Text.Json.JsonEncodedText.Encode("hnsw"); - private static readonly System.Text.Json.JsonEncodedText MemberInt4Flat = System.Text.Json.JsonEncodedText.Encode("int4_flat"); - private static readonly System.Text.Json.JsonEncodedText MemberInt4Hnsw = System.Text.Json.JsonEncodedText.Encode("int4_hnsw"); - private static readonly System.Text.Json.JsonEncodedText MemberInt8Flat = System.Text.Json.JsonEncodedText.Encode("int8_flat"); - private static readonly System.Text.Json.JsonEncodedText MemberInt8Hnsw = System.Text.Json.JsonEncodedText.Encode("int8_hnsw"); - - public override Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberBbqFlat)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.BbqFlat; - } - - if (reader.ValueTextEquals(MemberBbqHnsw)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.BbqHnsw; - } - - if (reader.ValueTextEquals(MemberFlat)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Flat; - } - - if (reader.ValueTextEquals(MemberHnsw)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Hnsw; - } - - if (reader.ValueTextEquals(MemberInt4Flat)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Int4Flat; - } - - if (reader.ValueTextEquals(MemberInt4Hnsw)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Int4Hnsw; - } - - if (reader.ValueTextEquals(MemberInt8Flat)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Int8Flat; - } - - if (reader.ValueTextEquals(MemberInt8Hnsw)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Int8Hnsw; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberBbqFlat.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.BbqFlat; - } - - if (string.Equals(value, MemberBbqHnsw.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.BbqHnsw; - } - - if (string.Equals(value, MemberFlat.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Flat; - } - - if (string.Equals(value, MemberHnsw.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Hnsw; - } - - if (string.Equals(value, MemberInt4Flat.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Int4Flat; - } - - if (string.Equals(value, MemberInt4Hnsw.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Int4Hnsw; - } - - if (string.Equals(value, MemberInt8Flat.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Int8Flat; - } - - if (string.Equals(value, MemberInt8Hnsw.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Int8Hnsw; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.BbqFlat: - writer.WriteStringValue(MemberBbqFlat); - break; - case Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.BbqHnsw: - writer.WriteStringValue(MemberBbqHnsw); - break; - case Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Flat: - writer.WriteStringValue(MemberFlat); - break; - case Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Hnsw: - writer.WriteStringValue(MemberHnsw); - break; - case Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Int4Flat: - writer.WriteStringValue(MemberInt4Flat); - break; - case Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Int4Hnsw: - writer.WriteStringValue(MemberInt4Hnsw); - break; - case Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Int8Flat: - writer.WriteStringValue(MemberInt8Flat); - break; - case Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Int8Hnsw: - writer.WriteStringValue(MemberInt8Hnsw); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.DynamicMappingConverter))] -public enum DynamicMapping -{ - [System.Runtime.Serialization.EnumMember(Value = "false")] - False, - [System.Runtime.Serialization.EnumMember(Value = "runtime")] - Runtime, - [System.Runtime.Serialization.EnumMember(Value = "strict")] - Strict, - [System.Runtime.Serialization.EnumMember(Value = "true")] - True -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.SubobjectsConverter))] -public enum Subobjects -{ - [System.Runtime.Serialization.EnumMember(Value = "auto")] - Auto, - [System.Runtime.Serialization.EnumMember(Value = "false")] - False, - [System.Runtime.Serialization.EnumMember(Value = "true")] - True -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.SourceFieldModeConverter))] -public enum SourceFieldMode -{ - [System.Runtime.Serialization.EnumMember(Value = "disabled")] - Disabled, - [System.Runtime.Serialization.EnumMember(Value = "stored")] - Stored, - /// - /// - /// Instead of storing source documents on disk exactly as you send them, - /// Elasticsearch can reconstruct source content on the fly upon retrieval. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "synthetic")] - Synthetic -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricTypeConverter))] -public enum TimeSeriesMetricType -{ - [System.Runtime.Serialization.EnumMember(Value = "counter")] - Counter, - [System.Runtime.Serialization.EnumMember(Value = "gauge")] - Gauge, - [System.Runtime.Serialization.EnumMember(Value = "histogram")] - Histogram, - [System.Runtime.Serialization.EnumMember(Value = "position")] - Position, - [System.Runtime.Serialization.EnumMember(Value = "summary")] - Summary -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.MatchTypeConverter))] -public enum MatchType -{ - [System.Runtime.Serialization.EnumMember(Value = "regex")] - Regex, - [System.Runtime.Serialization.EnumMember(Value = "simple")] - Simple -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldTypeConverter))] -public enum RuntimeFieldType -{ - [System.Runtime.Serialization.EnumMember(Value = "boolean")] - Boolean, - [System.Runtime.Serialization.EnumMember(Value = "composite")] - Composite, - [System.Runtime.Serialization.EnumMember(Value = "date")] - Date, - [System.Runtime.Serialization.EnumMember(Value = "double")] - Double, - [System.Runtime.Serialization.EnumMember(Value = "geo_point")] - GeoPoint, - [System.Runtime.Serialization.EnumMember(Value = "geo_shape")] - GeoShape, - [System.Runtime.Serialization.EnumMember(Value = "ip")] - Ip, - [System.Runtime.Serialization.EnumMember(Value = "keyword")] - Keyword, - [System.Runtime.Serialization.EnumMember(Value = "long")] - Long, - [System.Runtime.Serialization.EnumMember(Value = "lookup")] - Lookup -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnumConverter))] -public enum SyntheticSourceKeepEnum -{ - /// - /// - /// The source for both singleton instances and arrays of the corresponding field or object gets recorded. - /// When applied to objects, the source of all sub-objects and sub-fields gets captured. - /// Furthermore, the original source of arrays gets captured and appears in synthetic source with no modifications. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "all")] - All, - /// - /// - /// Arrays of the corresponding field or object preserve the original element ordering and duplicate elements. - /// The synthetic source fragment for such arrays is not guaranteed to match the original source exactly, - /// e.g. array [1, 2, [5], [[4, [3]]], 5] may appear as-is or in an equivalent format like [1, 2, 5, 4, 3, 5]. - /// The exact format may change in the future, in an effort to reduce the storage overhead of this option. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "arrays")] - Arrays, - /// - /// - /// Synthetic source diverges from the original source (default) - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "none")] - None -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.OnScriptErrorConverter))] -public enum OnScriptError -{ - [System.Runtime.Serialization.EnumMember(Value = "continue")] - Continue, - [System.Runtime.Serialization.EnumMember(Value = "fail")] - Fail -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.IndexOptionsConverter))] -public enum IndexOptions -{ - [System.Runtime.Serialization.EnumMember(Value = "docs")] - Docs, - [System.Runtime.Serialization.EnumMember(Value = "freqs")] - Freqs, - [System.Runtime.Serialization.EnumMember(Value = "offsets")] - Offsets, - [System.Runtime.Serialization.EnumMember(Value = "positions")] - Positions -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.TermVectorOptionConverter))] -public enum TermVectorOption -{ - [System.Runtime.Serialization.EnumMember(Value = "no")] - No, - [System.Runtime.Serialization.EnumMember(Value = "with_offsets")] - WithOffsets, - [System.Runtime.Serialization.EnumMember(Value = "with_positions")] - WithPositions, - [System.Runtime.Serialization.EnumMember(Value = "with_positions_offsets")] - WithPositionsOffsets, - [System.Runtime.Serialization.EnumMember(Value = "with_positions_offsets_payloads")] - WithPositionsOffsetsPayloads, - [System.Runtime.Serialization.EnumMember(Value = "with_positions_payloads")] - WithPositionsPayloads, - [System.Runtime.Serialization.EnumMember(Value = "yes")] - Yes -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementTypeConverter))] -public enum DenseVectorElementType -{ - /// - /// - /// Indexes a single bit per dimension. Useful for very high-dimensional vectors or models that specifically support - /// bit vectors. - /// - /// - /// NOTE: when using bit, the number of dimensions must be a multiple of 8 and must represent the number of bits. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "bit")] - Bit, - /// - /// - /// Indexes a 1-byte integer value per dimension. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "byte")] - Byte, - /// - /// - /// Indexes a 4-byte floating-point value per dimension. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "float")] - Float -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarityConverter))] -public enum DenseVectorSimilarity -{ - /// - /// - /// Computes the cosine similarity. During indexing Elasticsearch automatically normalizes vectors with cosine - /// similarity to unit length. This allows to internally use dot_product for computing similarity, which is more - /// efficient. Original un-normalized vectors can be still accessed through scripts. - /// - /// - /// The document _score is computed as (1 + cosine(query, vector)) / 2. - /// - /// - /// The cosine similarity does not allow vectors with zero magnitude, since cosine is not defined in this case. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "cosine")] - Cosine, - /// - /// - /// Computes the dot product of two unit vectors. This option provides an optimized way to perform cosine similarity. - /// The constraints and computed score are defined by element_type. - /// - /// - /// When element_type is float, all vectors must be unit length, including both document and query vectors. - /// - /// - /// The document _score is computed as (1 + dot_product(query, vector)) / 2. - /// - /// - /// When element_type is byte, all vectors must have the same length including both document and query vectors or - /// results will be inaccurate. - /// - /// - /// The document _score is computed as 0.5 + (dot_product(query, vector) / (32768 * dims)) where dims is the - /// number of dimensions per vector. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "dot_product")] - DotProduct, - /// - /// - /// Computes similarity based on the L2 distance (also known as Euclidean distance) between the vectors. - /// - /// - /// The document _score is computed as 1 / (1 + l2_norm(query, vector)^2). - /// - /// - /// For bit vectors, instead of using l2_norm, the hamming distance between the vectors is used. - /// - /// - /// The _score transformation is (numBits - hamming(a, b)) / numBits. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "l2_norm")] - L2Norm, - /// - /// - /// Computes the maximum inner product of two vectors. This is similar to dot_product, but doesn't require vectors - /// to be normalized. This means that each vector’s magnitude can significantly effect the score. - /// - /// - /// The document _score is adjusted to prevent negative values. For max_inner_product values < 0, the _score - /// is 1 / (1 + -1 * max_inner_product(query, vector)). For non-negative max_inner_product results the _score - /// is calculated max_inner_product(query, vector) + 1. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "max_inner_product")] - MaxInnerProduct -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.RankVectorElementTypeConverter))] -public enum RankVectorElementType -{ - [System.Runtime.Serialization.EnumMember(Value = "bit")] - Bit, - [System.Runtime.Serialization.EnumMember(Value = "byte")] - Byte, - [System.Runtime.Serialization.EnumMember(Value = "float")] - Float -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricTypeConverter))] -public enum GeoPointMetricType -{ - [System.Runtime.Serialization.EnumMember(Value = "counter")] - Counter, - [System.Runtime.Serialization.EnumMember(Value = "gauge")] - Gauge, - [System.Runtime.Serialization.EnumMember(Value = "position")] - Position -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.GeoOrientationConverter))] -public enum GeoOrientation -{ - [System.Runtime.Serialization.EnumMember(Value = "left")] - Left, - [System.Runtime.Serialization.EnumMember(Value = "right")] - Right -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.GeoStrategyConverter))] -public enum GeoStrategy -{ - [System.Runtime.Serialization.EnumMember(Value = "recursive")] - Recursive, - [System.Runtime.Serialization.EnumMember(Value = "term")] - Term -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.FieldTypeConverter))] -public enum FieldType -{ - [System.Runtime.Serialization.EnumMember(Value = "aggregate_metric_double")] - AggregateMetricDouble, - [System.Runtime.Serialization.EnumMember(Value = "alias")] - Alias, - [System.Runtime.Serialization.EnumMember(Value = "binary")] - Binary, - [System.Runtime.Serialization.EnumMember(Value = "boolean")] - Boolean, - [System.Runtime.Serialization.EnumMember(Value = "byte")] - Byte, - [System.Runtime.Serialization.EnumMember(Value = "completion")] - Completion, - [System.Runtime.Serialization.EnumMember(Value = "constant_keyword")] - ConstantKeyword, - [System.Runtime.Serialization.EnumMember(Value = "counted_keyword")] - CountedKeyword, - [System.Runtime.Serialization.EnumMember(Value = "date")] - Date, - [System.Runtime.Serialization.EnumMember(Value = "date_nanos")] - DateNanos, - [System.Runtime.Serialization.EnumMember(Value = "date_range")] - DateRange, - [System.Runtime.Serialization.EnumMember(Value = "dense_vector")] - DenseVector, - [System.Runtime.Serialization.EnumMember(Value = "double")] - Double, - [System.Runtime.Serialization.EnumMember(Value = "double_range")] - DoubleRange, - [System.Runtime.Serialization.EnumMember(Value = "flattened")] - Flattened, - [System.Runtime.Serialization.EnumMember(Value = "float")] - Float, - [System.Runtime.Serialization.EnumMember(Value = "float_range")] - FloatRange, - [System.Runtime.Serialization.EnumMember(Value = "geo_point")] - GeoPoint, - [System.Runtime.Serialization.EnumMember(Value = "geo_shape")] - GeoShape, - [System.Runtime.Serialization.EnumMember(Value = "half_float")] - HalfFloat, - [System.Runtime.Serialization.EnumMember(Value = "histogram")] - Histogram, - [System.Runtime.Serialization.EnumMember(Value = "icu_collation_keyword")] - IcuCollationKeyword, - [System.Runtime.Serialization.EnumMember(Value = "integer")] - Integer, - [System.Runtime.Serialization.EnumMember(Value = "integer_range")] - IntegerRange, - [System.Runtime.Serialization.EnumMember(Value = "ip")] - Ip, - [System.Runtime.Serialization.EnumMember(Value = "ip_range")] - IpRange, - [System.Runtime.Serialization.EnumMember(Value = "join")] - Join, - [System.Runtime.Serialization.EnumMember(Value = "keyword")] - Keyword, - [System.Runtime.Serialization.EnumMember(Value = "long")] - Long, - [System.Runtime.Serialization.EnumMember(Value = "long_range")] - LongRange, - [System.Runtime.Serialization.EnumMember(Value = "match_only_text")] - MatchOnlyText, - [System.Runtime.Serialization.EnumMember(Value = "murmur3")] - Murmur3, - [System.Runtime.Serialization.EnumMember(Value = "nested")] - Nested, - [System.Runtime.Serialization.EnumMember(Value = "none")] - None, - [System.Runtime.Serialization.EnumMember(Value = "object")] - Object, - [System.Runtime.Serialization.EnumMember(Value = "passthrough")] - Passthrough, - [System.Runtime.Serialization.EnumMember(Value = "percolator")] - Percolator, - [System.Runtime.Serialization.EnumMember(Value = "rank_feature")] - RankFeature, - [System.Runtime.Serialization.EnumMember(Value = "rank_features")] - RankFeatures, - [System.Runtime.Serialization.EnumMember(Value = "scaled_float")] - ScaledFloat, - [System.Runtime.Serialization.EnumMember(Value = "search_as_you_type")] - SearchAsYouType, - [System.Runtime.Serialization.EnumMember(Value = "semantic_text")] - SemanticText, - [System.Runtime.Serialization.EnumMember(Value = "shape")] - Shape, - [System.Runtime.Serialization.EnumMember(Value = "short")] - Short, - [System.Runtime.Serialization.EnumMember(Value = "sparse_vector")] - SparseVector, - [System.Runtime.Serialization.EnumMember(Value = "text")] - Text, - [System.Runtime.Serialization.EnumMember(Value = "token_count")] - TokenCount, - [System.Runtime.Serialization.EnumMember(Value = "version")] - Version -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsTypeConverter))] -public enum DenseVectorIndexOptionsType -{ - /// - /// - /// This utilizes a brute-force search algorithm in addition to automatically quantizing to binary vectors. - /// Only supports element_type of float. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "bbq_flat")] - BbqFlat, - /// - /// - /// This utilizes the HNSW algorithm in addition to automatic binary quantization for scalable approximate kNN - /// search with element_type of float. - /// - /// - /// This can reduce the memory footprint by nearly 32x at the cost of some accuracy. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "bbq_hnsw")] - BbqHnsw, - /// - /// - /// This utilizes a brute-force search algorithm for exact kNN search. This supports all element_type values. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "flat")] - Flat, - /// - /// - /// This utilizes the HNSW algorithm for scalable approximate kNN search. This supports all element_type values. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "hnsw")] - Hnsw, - /// - /// - /// This utilizes a brute-force search algorithm in addition to automatically half-byte scalar quantization. - /// Only supports element_type of float. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "int4_flat")] - Int4Flat, - /// - /// - /// This utilizes the HNSW algorithm in addition to automatically scalar quantization for scalable approximate kNN - /// search with element_type of float. - /// - /// - /// This can reduce the memory footprint by 8x at the cost of some accuracy. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "int4_hnsw")] - Int4Hnsw, - /// - /// - /// This utilizes a brute-force search algorithm in addition to automatically scalar quantization. Only supports - /// element_type of float. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "int8_flat")] - Int8Flat, - /// - /// - /// The default index type for float vectors. This utilizes the HNSW algorithm in addition to automatically scalar - /// quantization for scalable approximate kNN search with element_type of float. - /// - /// - /// This can reduce the memory footprint by 4x at the cost of some accuracy. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "int8_hnsw")] - Int8Hnsw -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.NoNamespace.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.NoNamespace.g.cs deleted file mode 100644 index b5ab1e9f4e6..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.NoNamespace.g.cs +++ /dev/null @@ -1,3548 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using System; -using System.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch; - -internal sealed partial class TimeUnitConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberDays = System.Text.Json.JsonEncodedText.Encode("d"); - private static readonly System.Text.Json.JsonEncodedText MemberHours = System.Text.Json.JsonEncodedText.Encode("h"); - private static readonly System.Text.Json.JsonEncodedText MemberMinutes = System.Text.Json.JsonEncodedText.Encode("m"); - private static readonly System.Text.Json.JsonEncodedText MemberMicroseconds = System.Text.Json.JsonEncodedText.Encode("micros"); - private static readonly System.Text.Json.JsonEncodedText MemberMilliseconds = System.Text.Json.JsonEncodedText.Encode("ms"); - private static readonly System.Text.Json.JsonEncodedText MemberNanoseconds = System.Text.Json.JsonEncodedText.Encode("nanos"); - private static readonly System.Text.Json.JsonEncodedText MemberSeconds = System.Text.Json.JsonEncodedText.Encode("s"); - - public override Elastic.Clients.Elasticsearch.TimeUnit Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberDays)) - { - return Elastic.Clients.Elasticsearch.TimeUnit.Days; - } - - if (reader.ValueTextEquals(MemberHours)) - { - return Elastic.Clients.Elasticsearch.TimeUnit.Hours; - } - - if (reader.ValueTextEquals(MemberMinutes)) - { - return Elastic.Clients.Elasticsearch.TimeUnit.Minutes; - } - - if (reader.ValueTextEquals(MemberMicroseconds)) - { - return Elastic.Clients.Elasticsearch.TimeUnit.Microseconds; - } - - if (reader.ValueTextEquals(MemberMilliseconds)) - { - return Elastic.Clients.Elasticsearch.TimeUnit.Milliseconds; - } - - if (reader.ValueTextEquals(MemberNanoseconds)) - { - return Elastic.Clients.Elasticsearch.TimeUnit.Nanoseconds; - } - - if (reader.ValueTextEquals(MemberSeconds)) - { - return Elastic.Clients.Elasticsearch.TimeUnit.Seconds; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberDays.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.TimeUnit.Days; - } - - if (string.Equals(value, MemberHours.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.TimeUnit.Hours; - } - - if (string.Equals(value, MemberMinutes.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.TimeUnit.Minutes; - } - - if (string.Equals(value, MemberMicroseconds.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.TimeUnit.Microseconds; - } - - if (string.Equals(value, MemberMilliseconds.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.TimeUnit.Milliseconds; - } - - if (string.Equals(value, MemberNanoseconds.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.TimeUnit.Nanoseconds; - } - - if (string.Equals(value, MemberSeconds.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.TimeUnit.Seconds; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.TimeUnit)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TimeUnit value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.TimeUnit.Days: - writer.WriteStringValue(MemberDays); - break; - case Elastic.Clients.Elasticsearch.TimeUnit.Hours: - writer.WriteStringValue(MemberHours); - break; - case Elastic.Clients.Elasticsearch.TimeUnit.Minutes: - writer.WriteStringValue(MemberMinutes); - break; - case Elastic.Clients.Elasticsearch.TimeUnit.Microseconds: - writer.WriteStringValue(MemberMicroseconds); - break; - case Elastic.Clients.Elasticsearch.TimeUnit.Milliseconds: - writer.WriteStringValue(MemberMilliseconds); - break; - case Elastic.Clients.Elasticsearch.TimeUnit.Nanoseconds: - writer.WriteStringValue(MemberNanoseconds); - break; - case Elastic.Clients.Elasticsearch.TimeUnit.Seconds: - writer.WriteStringValue(MemberSeconds); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.TimeUnit)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.TimeUnit ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TimeUnit value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class SearchTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberDfsQueryThenFetch = System.Text.Json.JsonEncodedText.Encode("dfs_query_then_fetch"); - private static readonly System.Text.Json.JsonEncodedText MemberQueryThenFetch = System.Text.Json.JsonEncodedText.Encode("query_then_fetch"); - - public override Elastic.Clients.Elasticsearch.SearchType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberDfsQueryThenFetch)) - { - return Elastic.Clients.Elasticsearch.SearchType.DfsQueryThenFetch; - } - - if (reader.ValueTextEquals(MemberQueryThenFetch)) - { - return Elastic.Clients.Elasticsearch.SearchType.QueryThenFetch; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberDfsQueryThenFetch.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.SearchType.DfsQueryThenFetch; - } - - if (string.Equals(value, MemberQueryThenFetch.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.SearchType.QueryThenFetch; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.SearchType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.SearchType.DfsQueryThenFetch: - writer.WriteStringValue(MemberDfsQueryThenFetch); - break; - case Elastic.Clients.Elasticsearch.SearchType.QueryThenFetch: - writer.WriteStringValue(MemberQueryThenFetch); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.SearchType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.SearchType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class SuggestModeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAlways = System.Text.Json.JsonEncodedText.Encode("always"); - private static readonly System.Text.Json.JsonEncodedText MemberMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText MemberPopular = System.Text.Json.JsonEncodedText.Encode("popular"); - - public override Elastic.Clients.Elasticsearch.SuggestMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAlways)) - { - return Elastic.Clients.Elasticsearch.SuggestMode.Always; - } - - if (reader.ValueTextEquals(MemberMissing)) - { - return Elastic.Clients.Elasticsearch.SuggestMode.Missing; - } - - if (reader.ValueTextEquals(MemberPopular)) - { - return Elastic.Clients.Elasticsearch.SuggestMode.Popular; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAlways.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.SuggestMode.Always; - } - - if (string.Equals(value, MemberMissing.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.SuggestMode.Missing; - } - - if (string.Equals(value, MemberPopular.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.SuggestMode.Popular; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.SuggestMode)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SuggestMode value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.SuggestMode.Always: - writer.WriteStringValue(MemberAlways); - break; - case Elastic.Clients.Elasticsearch.SuggestMode.Missing: - writer.WriteStringValue(MemberMissing); - break; - case Elastic.Clients.Elasticsearch.SuggestMode.Popular: - writer.WriteStringValue(MemberPopular); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.SuggestMode)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.SuggestMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SuggestMode value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class RefreshConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberFalse = System.Text.Json.JsonEncodedText.Encode("false"); - private static readonly System.Text.Json.JsonEncodedText MemberTrue = System.Text.Json.JsonEncodedText.Encode("true"); - private static readonly System.Text.Json.JsonEncodedText MemberWaitFor = System.Text.Json.JsonEncodedText.Encode("wait_for"); - - public override Elastic.Clients.Elasticsearch.Refresh Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberFalse)) - { - return Elastic.Clients.Elasticsearch.Refresh.False; - } - - if (reader.ValueTextEquals(MemberTrue)) - { - return Elastic.Clients.Elasticsearch.Refresh.True; - } - - if (reader.ValueTextEquals(MemberWaitFor)) - { - return Elastic.Clients.Elasticsearch.Refresh.WaitFor; - } - - if (reader.TokenType is not System.Text.Json.JsonTokenType.String) - { - throw new System.Text.Json.JsonException($"Unknown member of type '{reader.TokenType}' for enum '{nameof(Elastic.Clients.Elasticsearch.Refresh)}'."); - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberFalse.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Refresh.False; - } - - if (string.Equals(value, MemberTrue.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Refresh.True; - } - - if (string.Equals(value, MemberWaitFor.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Refresh.WaitFor; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Refresh)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Refresh value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Refresh.False: - writer.WriteRawValue(MemberFalse.EncodedUtf8Bytes); - break; - case Elastic.Clients.Elasticsearch.Refresh.True: - writer.WriteRawValue(MemberTrue.EncodedUtf8Bytes); - break; - case Elastic.Clients.Elasticsearch.Refresh.WaitFor: - writer.WriteStringValue(MemberWaitFor); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Refresh)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Refresh ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Refresh value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class HealthStatusConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberGreen = System.Text.Json.JsonEncodedText.Encode("green"); - private static readonly System.Text.Json.JsonEncodedText MemberGreen1 = System.Text.Json.JsonEncodedText.Encode("GREEN"); - private static readonly System.Text.Json.JsonEncodedText MemberRed = System.Text.Json.JsonEncodedText.Encode("red"); - private static readonly System.Text.Json.JsonEncodedText MemberRed1 = System.Text.Json.JsonEncodedText.Encode("RED"); - private static readonly System.Text.Json.JsonEncodedText MemberUnavailable = System.Text.Json.JsonEncodedText.Encode("unavailable"); - private static readonly System.Text.Json.JsonEncodedText MemberUnknown = System.Text.Json.JsonEncodedText.Encode("unknown"); - private static readonly System.Text.Json.JsonEncodedText MemberYellow = System.Text.Json.JsonEncodedText.Encode("yellow"); - private static readonly System.Text.Json.JsonEncodedText MemberYellow1 = System.Text.Json.JsonEncodedText.Encode("YELLOW"); - - public override Elastic.Clients.Elasticsearch.HealthStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberGreen) || reader.ValueTextEquals(MemberGreen1)) - { - return Elastic.Clients.Elasticsearch.HealthStatus.Green; - } - - if (reader.ValueTextEquals(MemberRed) || reader.ValueTextEquals(MemberRed1)) - { - return Elastic.Clients.Elasticsearch.HealthStatus.Red; - } - - if (reader.ValueTextEquals(MemberUnavailable)) - { - return Elastic.Clients.Elasticsearch.HealthStatus.Unavailable; - } - - if (reader.ValueTextEquals(MemberUnknown)) - { - return Elastic.Clients.Elasticsearch.HealthStatus.Unknown; - } - - if (reader.ValueTextEquals(MemberYellow) || reader.ValueTextEquals(MemberYellow1)) - { - return Elastic.Clients.Elasticsearch.HealthStatus.Yellow; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberGreen.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberGreen1.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.HealthStatus.Green; - } - - if (string.Equals(value, MemberRed.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberRed1.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.HealthStatus.Red; - } - - if (string.Equals(value, MemberUnavailable.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.HealthStatus.Unavailable; - } - - if (string.Equals(value, MemberUnknown.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.HealthStatus.Unknown; - } - - if (string.Equals(value, MemberYellow.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberYellow1.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.HealthStatus.Yellow; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.HealthStatus)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.HealthStatus value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.HealthStatus.Green: - writer.WriteStringValue(MemberGreen); - break; - case Elastic.Clients.Elasticsearch.HealthStatus.Red: - writer.WriteStringValue(MemberRed); - break; - case Elastic.Clients.Elasticsearch.HealthStatus.Unavailable: - writer.WriteStringValue(MemberUnavailable); - break; - case Elastic.Clients.Elasticsearch.HealthStatus.Unknown: - writer.WriteStringValue(MemberUnknown); - break; - case Elastic.Clients.Elasticsearch.HealthStatus.Yellow: - writer.WriteStringValue(MemberYellow); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.HealthStatus)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.HealthStatus ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.HealthStatus value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class LevelConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); - private static readonly System.Text.Json.JsonEncodedText MemberIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText MemberShards = System.Text.Json.JsonEncodedText.Encode("shards"); - - public override Elastic.Clients.Elasticsearch.Level Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCluster)) - { - return Elastic.Clients.Elasticsearch.Level.Cluster; - } - - if (reader.ValueTextEquals(MemberIndices)) - { - return Elastic.Clients.Elasticsearch.Level.Indices; - } - - if (reader.ValueTextEquals(MemberShards)) - { - return Elastic.Clients.Elasticsearch.Level.Shards; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCluster.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Level.Cluster; - } - - if (string.Equals(value, MemberIndices.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Level.Indices; - } - - if (string.Equals(value, MemberShards.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Level.Shards; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Level)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Level value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Level.Cluster: - writer.WriteStringValue(MemberCluster); - break; - case Elastic.Clients.Elasticsearch.Level.Indices: - writer.WriteStringValue(MemberIndices); - break; - case Elastic.Clients.Elasticsearch.Level.Shards: - writer.WriteStringValue(MemberShards); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Level)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Level ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Level value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class WaitForEventsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberHigh = System.Text.Json.JsonEncodedText.Encode("high"); - private static readonly System.Text.Json.JsonEncodedText MemberImmediate = System.Text.Json.JsonEncodedText.Encode("immediate"); - private static readonly System.Text.Json.JsonEncodedText MemberLanguid = System.Text.Json.JsonEncodedText.Encode("languid"); - private static readonly System.Text.Json.JsonEncodedText MemberLow = System.Text.Json.JsonEncodedText.Encode("low"); - private static readonly System.Text.Json.JsonEncodedText MemberNormal = System.Text.Json.JsonEncodedText.Encode("normal"); - private static readonly System.Text.Json.JsonEncodedText MemberUrgent = System.Text.Json.JsonEncodedText.Encode("urgent"); - - public override Elastic.Clients.Elasticsearch.WaitForEvents Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberHigh)) - { - return Elastic.Clients.Elasticsearch.WaitForEvents.High; - } - - if (reader.ValueTextEquals(MemberImmediate)) - { - return Elastic.Clients.Elasticsearch.WaitForEvents.Immediate; - } - - if (reader.ValueTextEquals(MemberLanguid)) - { - return Elastic.Clients.Elasticsearch.WaitForEvents.Languid; - } - - if (reader.ValueTextEquals(MemberLow)) - { - return Elastic.Clients.Elasticsearch.WaitForEvents.Low; - } - - if (reader.ValueTextEquals(MemberNormal)) - { - return Elastic.Clients.Elasticsearch.WaitForEvents.Normal; - } - - if (reader.ValueTextEquals(MemberUrgent)) - { - return Elastic.Clients.Elasticsearch.WaitForEvents.Urgent; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberHigh.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.WaitForEvents.High; - } - - if (string.Equals(value, MemberImmediate.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.WaitForEvents.Immediate; - } - - if (string.Equals(value, MemberLanguid.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.WaitForEvents.Languid; - } - - if (string.Equals(value, MemberLow.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.WaitForEvents.Low; - } - - if (string.Equals(value, MemberNormal.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.WaitForEvents.Normal; - } - - if (string.Equals(value, MemberUrgent.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.WaitForEvents.Urgent; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.WaitForEvents)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.WaitForEvents value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.WaitForEvents.High: - writer.WriteStringValue(MemberHigh); - break; - case Elastic.Clients.Elasticsearch.WaitForEvents.Immediate: - writer.WriteStringValue(MemberImmediate); - break; - case Elastic.Clients.Elasticsearch.WaitForEvents.Languid: - writer.WriteStringValue(MemberLanguid); - break; - case Elastic.Clients.Elasticsearch.WaitForEvents.Low: - writer.WriteStringValue(MemberLow); - break; - case Elastic.Clients.Elasticsearch.WaitForEvents.Normal: - writer.WriteStringValue(MemberNormal); - break; - case Elastic.Clients.Elasticsearch.WaitForEvents.Urgent: - writer.WriteStringValue(MemberUrgent); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.WaitForEvents)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.WaitForEvents ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.WaitForEvents value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class VersionTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberExternal = System.Text.Json.JsonEncodedText.Encode("external"); - private static readonly System.Text.Json.JsonEncodedText MemberExternalGte = System.Text.Json.JsonEncodedText.Encode("external_gte"); - private static readonly System.Text.Json.JsonEncodedText MemberForce = System.Text.Json.JsonEncodedText.Encode("force"); - private static readonly System.Text.Json.JsonEncodedText MemberInternal = System.Text.Json.JsonEncodedText.Encode("internal"); - - public override Elastic.Clients.Elasticsearch.VersionType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberExternal)) - { - return Elastic.Clients.Elasticsearch.VersionType.External; - } - - if (reader.ValueTextEquals(MemberExternalGte)) - { - return Elastic.Clients.Elasticsearch.VersionType.ExternalGte; - } - - if (reader.ValueTextEquals(MemberForce)) - { - return Elastic.Clients.Elasticsearch.VersionType.Force; - } - - if (reader.ValueTextEquals(MemberInternal)) - { - return Elastic.Clients.Elasticsearch.VersionType.Internal; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberExternal.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.VersionType.External; - } - - if (string.Equals(value, MemberExternalGte.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.VersionType.ExternalGte; - } - - if (string.Equals(value, MemberForce.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.VersionType.Force; - } - - if (string.Equals(value, MemberInternal.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.VersionType.Internal; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.VersionType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.VersionType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.VersionType.External: - writer.WriteStringValue(MemberExternal); - break; - case Elastic.Clients.Elasticsearch.VersionType.ExternalGte: - writer.WriteStringValue(MemberExternalGte); - break; - case Elastic.Clients.Elasticsearch.VersionType.Force: - writer.WriteStringValue(MemberForce); - break; - case Elastic.Clients.Elasticsearch.VersionType.Internal: - writer.WriteStringValue(MemberInternal); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.VersionType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.VersionType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.VersionType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ConflictsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAbort = System.Text.Json.JsonEncodedText.Encode("abort"); - private static readonly System.Text.Json.JsonEncodedText MemberProceed = System.Text.Json.JsonEncodedText.Encode("proceed"); - - public override Elastic.Clients.Elasticsearch.Conflicts Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAbort)) - { - return Elastic.Clients.Elasticsearch.Conflicts.Abort; - } - - if (reader.ValueTextEquals(MemberProceed)) - { - return Elastic.Clients.Elasticsearch.Conflicts.Proceed; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAbort.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Conflicts.Abort; - } - - if (string.Equals(value, MemberProceed.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Conflicts.Proceed; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Conflicts)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Conflicts value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Conflicts.Abort: - writer.WriteStringValue(MemberAbort); - break; - case Elastic.Clients.Elasticsearch.Conflicts.Proceed: - writer.WriteStringValue(MemberProceed); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Conflicts)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Conflicts ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Conflicts value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class OpTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCreate = System.Text.Json.JsonEncodedText.Encode("create"); - private static readonly System.Text.Json.JsonEncodedText MemberIndex = System.Text.Json.JsonEncodedText.Encode("index"); - - public override Elastic.Clients.Elasticsearch.OpType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCreate)) - { - return Elastic.Clients.Elasticsearch.OpType.Create; - } - - if (reader.ValueTextEquals(MemberIndex)) - { - return Elastic.Clients.Elasticsearch.OpType.Index; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCreate.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.OpType.Create; - } - - if (string.Equals(value, MemberIndex.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.OpType.Index; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.OpType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.OpType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.OpType.Create: - writer.WriteStringValue(MemberCreate); - break; - case Elastic.Clients.Elasticsearch.OpType.Index: - writer.WriteStringValue(MemberIndex); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.OpType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.OpType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.OpType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ThreadTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberBlock = System.Text.Json.JsonEncodedText.Encode("block"); - private static readonly System.Text.Json.JsonEncodedText MemberCpu = System.Text.Json.JsonEncodedText.Encode("cpu"); - private static readonly System.Text.Json.JsonEncodedText MemberGpu = System.Text.Json.JsonEncodedText.Encode("gpu"); - private static readonly System.Text.Json.JsonEncodedText MemberMem = System.Text.Json.JsonEncodedText.Encode("mem"); - private static readonly System.Text.Json.JsonEncodedText MemberWait = System.Text.Json.JsonEncodedText.Encode("wait"); - - public override Elastic.Clients.Elasticsearch.ThreadType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberBlock)) - { - return Elastic.Clients.Elasticsearch.ThreadType.Block; - } - - if (reader.ValueTextEquals(MemberCpu)) - { - return Elastic.Clients.Elasticsearch.ThreadType.Cpu; - } - - if (reader.ValueTextEquals(MemberGpu)) - { - return Elastic.Clients.Elasticsearch.ThreadType.Gpu; - } - - if (reader.ValueTextEquals(MemberMem)) - { - return Elastic.Clients.Elasticsearch.ThreadType.Mem; - } - - if (reader.ValueTextEquals(MemberWait)) - { - return Elastic.Clients.Elasticsearch.ThreadType.Wait; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberBlock.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.ThreadType.Block; - } - - if (string.Equals(value, MemberCpu.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.ThreadType.Cpu; - } - - if (string.Equals(value, MemberGpu.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.ThreadType.Gpu; - } - - if (string.Equals(value, MemberMem.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.ThreadType.Mem; - } - - if (string.Equals(value, MemberWait.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.ThreadType.Wait; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.ThreadType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ThreadType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.ThreadType.Block: - writer.WriteStringValue(MemberBlock); - break; - case Elastic.Clients.Elasticsearch.ThreadType.Cpu: - writer.WriteStringValue(MemberCpu); - break; - case Elastic.Clients.Elasticsearch.ThreadType.Gpu: - writer.WriteStringValue(MemberGpu); - break; - case Elastic.Clients.Elasticsearch.ThreadType.Mem: - writer.WriteStringValue(MemberMem); - break; - case Elastic.Clients.Elasticsearch.ThreadType.Wait: - writer.WriteStringValue(MemberWait); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.ThreadType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.ThreadType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ThreadType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class SortOrderConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAsc = System.Text.Json.JsonEncodedText.Encode("asc"); - private static readonly System.Text.Json.JsonEncodedText MemberDesc = System.Text.Json.JsonEncodedText.Encode("desc"); - - public override Elastic.Clients.Elasticsearch.SortOrder Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAsc)) - { - return Elastic.Clients.Elasticsearch.SortOrder.Asc; - } - - if (reader.ValueTextEquals(MemberDesc)) - { - return Elastic.Clients.Elasticsearch.SortOrder.Desc; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAsc.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.SortOrder.Asc; - } - - if (string.Equals(value, MemberDesc.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.SortOrder.Desc; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.SortOrder)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SortOrder value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.SortOrder.Asc: - writer.WriteStringValue(MemberAsc); - break; - case Elastic.Clients.Elasticsearch.SortOrder.Desc: - writer.WriteStringValue(MemberDesc); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.SortOrder)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.SortOrder ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SortOrder value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ResultConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCreated = System.Text.Json.JsonEncodedText.Encode("created"); - private static readonly System.Text.Json.JsonEncodedText MemberDeleted = System.Text.Json.JsonEncodedText.Encode("deleted"); - private static readonly System.Text.Json.JsonEncodedText MemberNoOp = System.Text.Json.JsonEncodedText.Encode("noop"); - private static readonly System.Text.Json.JsonEncodedText MemberNotFound = System.Text.Json.JsonEncodedText.Encode("not_found"); - private static readonly System.Text.Json.JsonEncodedText MemberUpdated = System.Text.Json.JsonEncodedText.Encode("updated"); - - public override Elastic.Clients.Elasticsearch.Result Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCreated)) - { - return Elastic.Clients.Elasticsearch.Result.Created; - } - - if (reader.ValueTextEquals(MemberDeleted)) - { - return Elastic.Clients.Elasticsearch.Result.Deleted; - } - - if (reader.ValueTextEquals(MemberNoOp)) - { - return Elastic.Clients.Elasticsearch.Result.NoOp; - } - - if (reader.ValueTextEquals(MemberNotFound)) - { - return Elastic.Clients.Elasticsearch.Result.NotFound; - } - - if (reader.ValueTextEquals(MemberUpdated)) - { - return Elastic.Clients.Elasticsearch.Result.Updated; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCreated.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Result.Created; - } - - if (string.Equals(value, MemberDeleted.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Result.Deleted; - } - - if (string.Equals(value, MemberNoOp.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Result.NoOp; - } - - if (string.Equals(value, MemberNotFound.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Result.NotFound; - } - - if (string.Equals(value, MemberUpdated.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Result.Updated; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Result)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Result value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Result.Created: - writer.WriteStringValue(MemberCreated); - break; - case Elastic.Clients.Elasticsearch.Result.Deleted: - writer.WriteStringValue(MemberDeleted); - break; - case Elastic.Clients.Elasticsearch.Result.NoOp: - writer.WriteStringValue(MemberNoOp); - break; - case Elastic.Clients.Elasticsearch.Result.NotFound: - writer.WriteStringValue(MemberNotFound); - break; - case Elastic.Clients.Elasticsearch.Result.Updated: - writer.WriteStringValue(MemberUpdated); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Result)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Result ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Result value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class LifecycleOperationModeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberRunning = System.Text.Json.JsonEncodedText.Encode("RUNNING"); - private static readonly System.Text.Json.JsonEncodedText MemberStopped = System.Text.Json.JsonEncodedText.Encode("STOPPED"); - private static readonly System.Text.Json.JsonEncodedText MemberStopping = System.Text.Json.JsonEncodedText.Encode("STOPPING"); - - public override Elastic.Clients.Elasticsearch.LifecycleOperationMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberRunning)) - { - return Elastic.Clients.Elasticsearch.LifecycleOperationMode.Running; - } - - if (reader.ValueTextEquals(MemberStopped)) - { - return Elastic.Clients.Elasticsearch.LifecycleOperationMode.Stopped; - } - - if (reader.ValueTextEquals(MemberStopping)) - { - return Elastic.Clients.Elasticsearch.LifecycleOperationMode.Stopping; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberRunning.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.LifecycleOperationMode.Running; - } - - if (string.Equals(value, MemberStopped.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.LifecycleOperationMode.Stopped; - } - - if (string.Equals(value, MemberStopping.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.LifecycleOperationMode.Stopping; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.LifecycleOperationMode)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LifecycleOperationMode value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.LifecycleOperationMode.Running: - writer.WriteStringValue(MemberRunning); - break; - case Elastic.Clients.Elasticsearch.LifecycleOperationMode.Stopped: - writer.WriteStringValue(MemberStopped); - break; - case Elastic.Clients.Elasticsearch.LifecycleOperationMode.Stopping: - writer.WriteStringValue(MemberStopping); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.LifecycleOperationMode)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.LifecycleOperationMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LifecycleOperationMode value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ExpandWildcardConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAll = System.Text.Json.JsonEncodedText.Encode("all"); - private static readonly System.Text.Json.JsonEncodedText MemberClosed = System.Text.Json.JsonEncodedText.Encode("closed"); - private static readonly System.Text.Json.JsonEncodedText MemberHidden = System.Text.Json.JsonEncodedText.Encode("hidden"); - private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); - private static readonly System.Text.Json.JsonEncodedText MemberOpen = System.Text.Json.JsonEncodedText.Encode("open"); - - public override Elastic.Clients.Elasticsearch.ExpandWildcard Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAll)) - { - return Elastic.Clients.Elasticsearch.ExpandWildcard.All; - } - - if (reader.ValueTextEquals(MemberClosed)) - { - return Elastic.Clients.Elasticsearch.ExpandWildcard.Closed; - } - - if (reader.ValueTextEquals(MemberHidden)) - { - return Elastic.Clients.Elasticsearch.ExpandWildcard.Hidden; - } - - if (reader.ValueTextEquals(MemberNone)) - { - return Elastic.Clients.Elasticsearch.ExpandWildcard.None; - } - - if (reader.ValueTextEquals(MemberOpen)) - { - return Elastic.Clients.Elasticsearch.ExpandWildcard.Open; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAll.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.ExpandWildcard.All; - } - - if (string.Equals(value, MemberClosed.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.ExpandWildcard.Closed; - } - - if (string.Equals(value, MemberHidden.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.ExpandWildcard.Hidden; - } - - if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.ExpandWildcard.None; - } - - if (string.Equals(value, MemberOpen.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.ExpandWildcard.Open; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.ExpandWildcard)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ExpandWildcard value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.ExpandWildcard.All: - writer.WriteStringValue(MemberAll); - break; - case Elastic.Clients.Elasticsearch.ExpandWildcard.Closed: - writer.WriteStringValue(MemberClosed); - break; - case Elastic.Clients.Elasticsearch.ExpandWildcard.Hidden: - writer.WriteStringValue(MemberHidden); - break; - case Elastic.Clients.Elasticsearch.ExpandWildcard.None: - writer.WriteStringValue(MemberNone); - break; - case Elastic.Clients.Elasticsearch.ExpandWildcard.Open: - writer.WriteStringValue(MemberOpen); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.ExpandWildcard)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.ExpandWildcard ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ExpandWildcard value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class WaitForActiveShardOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAll = System.Text.Json.JsonEncodedText.Encode("all"); - private static readonly System.Text.Json.JsonEncodedText MemberIndexSetting = System.Text.Json.JsonEncodedText.Encode("index-setting"); - - public override Elastic.Clients.Elasticsearch.WaitForActiveShardOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAll)) - { - return Elastic.Clients.Elasticsearch.WaitForActiveShardOptions.All; - } - - if (reader.ValueTextEquals(MemberIndexSetting)) - { - return Elastic.Clients.Elasticsearch.WaitForActiveShardOptions.IndexSetting; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAll.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.WaitForActiveShardOptions.All; - } - - if (string.Equals(value, MemberIndexSetting.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.WaitForActiveShardOptions.IndexSetting; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.WaitForActiveShardOptions)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.WaitForActiveShardOptions value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.WaitForActiveShardOptions.All: - writer.WriteStringValue(MemberAll); - break; - case Elastic.Clients.Elasticsearch.WaitForActiveShardOptions.IndexSetting: - writer.WriteStringValue(MemberIndexSetting); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.WaitForActiveShardOptions)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.WaitForActiveShardOptions ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.WaitForActiveShardOptions value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class NodeRoleConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberClient = System.Text.Json.JsonEncodedText.Encode("client"); - private static readonly System.Text.Json.JsonEncodedText MemberCoordinatingOnly = System.Text.Json.JsonEncodedText.Encode("coordinating_only"); - private static readonly System.Text.Json.JsonEncodedText MemberData = System.Text.Json.JsonEncodedText.Encode("data"); - private static readonly System.Text.Json.JsonEncodedText MemberDataCold = System.Text.Json.JsonEncodedText.Encode("data_cold"); - private static readonly System.Text.Json.JsonEncodedText MemberDataContent = System.Text.Json.JsonEncodedText.Encode("data_content"); - private static readonly System.Text.Json.JsonEncodedText MemberDataFrozen = System.Text.Json.JsonEncodedText.Encode("data_frozen"); - private static readonly System.Text.Json.JsonEncodedText MemberDataHot = System.Text.Json.JsonEncodedText.Encode("data_hot"); - private static readonly System.Text.Json.JsonEncodedText MemberDataWarm = System.Text.Json.JsonEncodedText.Encode("data_warm"); - private static readonly System.Text.Json.JsonEncodedText MemberIngest = System.Text.Json.JsonEncodedText.Encode("ingest"); - private static readonly System.Text.Json.JsonEncodedText MemberMaster = System.Text.Json.JsonEncodedText.Encode("master"); - private static readonly System.Text.Json.JsonEncodedText MemberMl = System.Text.Json.JsonEncodedText.Encode("ml"); - private static readonly System.Text.Json.JsonEncodedText MemberRemoteClusterClient = System.Text.Json.JsonEncodedText.Encode("remote_cluster_client"); - private static readonly System.Text.Json.JsonEncodedText MemberTransform = System.Text.Json.JsonEncodedText.Encode("transform"); - private static readonly System.Text.Json.JsonEncodedText MemberVotingOnly = System.Text.Json.JsonEncodedText.Encode("voting_only"); - - public override Elastic.Clients.Elasticsearch.NodeRole Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberClient)) - { - return Elastic.Clients.Elasticsearch.NodeRole.Client; - } - - if (reader.ValueTextEquals(MemberCoordinatingOnly)) - { - return Elastic.Clients.Elasticsearch.NodeRole.CoordinatingOnly; - } - - if (reader.ValueTextEquals(MemberData)) - { - return Elastic.Clients.Elasticsearch.NodeRole.Data; - } - - if (reader.ValueTextEquals(MemberDataCold)) - { - return Elastic.Clients.Elasticsearch.NodeRole.DataCold; - } - - if (reader.ValueTextEquals(MemberDataContent)) - { - return Elastic.Clients.Elasticsearch.NodeRole.DataContent; - } - - if (reader.ValueTextEquals(MemberDataFrozen)) - { - return Elastic.Clients.Elasticsearch.NodeRole.DataFrozen; - } - - if (reader.ValueTextEquals(MemberDataHot)) - { - return Elastic.Clients.Elasticsearch.NodeRole.DataHot; - } - - if (reader.ValueTextEquals(MemberDataWarm)) - { - return Elastic.Clients.Elasticsearch.NodeRole.DataWarm; - } - - if (reader.ValueTextEquals(MemberIngest)) - { - return Elastic.Clients.Elasticsearch.NodeRole.Ingest; - } - - if (reader.ValueTextEquals(MemberMaster)) - { - return Elastic.Clients.Elasticsearch.NodeRole.Master; - } - - if (reader.ValueTextEquals(MemberMl)) - { - return Elastic.Clients.Elasticsearch.NodeRole.Ml; - } - - if (reader.ValueTextEquals(MemberRemoteClusterClient)) - { - return Elastic.Clients.Elasticsearch.NodeRole.RemoteClusterClient; - } - - if (reader.ValueTextEquals(MemberTransform)) - { - return Elastic.Clients.Elasticsearch.NodeRole.Transform; - } - - if (reader.ValueTextEquals(MemberVotingOnly)) - { - return Elastic.Clients.Elasticsearch.NodeRole.VotingOnly; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberClient.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.NodeRole.Client; - } - - if (string.Equals(value, MemberCoordinatingOnly.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.NodeRole.CoordinatingOnly; - } - - if (string.Equals(value, MemberData.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.NodeRole.Data; - } - - if (string.Equals(value, MemberDataCold.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.NodeRole.DataCold; - } - - if (string.Equals(value, MemberDataContent.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.NodeRole.DataContent; - } - - if (string.Equals(value, MemberDataFrozen.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.NodeRole.DataFrozen; - } - - if (string.Equals(value, MemberDataHot.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.NodeRole.DataHot; - } - - if (string.Equals(value, MemberDataWarm.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.NodeRole.DataWarm; - } - - if (string.Equals(value, MemberIngest.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.NodeRole.Ingest; - } - - if (string.Equals(value, MemberMaster.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.NodeRole.Master; - } - - if (string.Equals(value, MemberMl.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.NodeRole.Ml; - } - - if (string.Equals(value, MemberRemoteClusterClient.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.NodeRole.RemoteClusterClient; - } - - if (string.Equals(value, MemberTransform.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.NodeRole.Transform; - } - - if (string.Equals(value, MemberVotingOnly.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.NodeRole.VotingOnly; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.NodeRole)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.NodeRole value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.NodeRole.Client: - writer.WriteStringValue(MemberClient); - break; - case Elastic.Clients.Elasticsearch.NodeRole.CoordinatingOnly: - writer.WriteStringValue(MemberCoordinatingOnly); - break; - case Elastic.Clients.Elasticsearch.NodeRole.Data: - writer.WriteStringValue(MemberData); - break; - case Elastic.Clients.Elasticsearch.NodeRole.DataCold: - writer.WriteStringValue(MemberDataCold); - break; - case Elastic.Clients.Elasticsearch.NodeRole.DataContent: - writer.WriteStringValue(MemberDataContent); - break; - case Elastic.Clients.Elasticsearch.NodeRole.DataFrozen: - writer.WriteStringValue(MemberDataFrozen); - break; - case Elastic.Clients.Elasticsearch.NodeRole.DataHot: - writer.WriteStringValue(MemberDataHot); - break; - case Elastic.Clients.Elasticsearch.NodeRole.DataWarm: - writer.WriteStringValue(MemberDataWarm); - break; - case Elastic.Clients.Elasticsearch.NodeRole.Ingest: - writer.WriteStringValue(MemberIngest); - break; - case Elastic.Clients.Elasticsearch.NodeRole.Master: - writer.WriteStringValue(MemberMaster); - break; - case Elastic.Clients.Elasticsearch.NodeRole.Ml: - writer.WriteStringValue(MemberMl); - break; - case Elastic.Clients.Elasticsearch.NodeRole.RemoteClusterClient: - writer.WriteStringValue(MemberRemoteClusterClient); - break; - case Elastic.Clients.Elasticsearch.NodeRole.Transform: - writer.WriteStringValue(MemberTransform); - break; - case Elastic.Clients.Elasticsearch.NodeRole.VotingOnly: - writer.WriteStringValue(MemberVotingOnly); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.NodeRole)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.NodeRole ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.NodeRole value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ClusterInfoTargetConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAll = System.Text.Json.JsonEncodedText.Encode("_all"); - private static readonly System.Text.Json.JsonEncodedText MemberHttp = System.Text.Json.JsonEncodedText.Encode("http"); - private static readonly System.Text.Json.JsonEncodedText MemberIngest = System.Text.Json.JsonEncodedText.Encode("ingest"); - private static readonly System.Text.Json.JsonEncodedText MemberScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText MemberThreadPool = System.Text.Json.JsonEncodedText.Encode("thread_pool"); - - public override Elastic.Clients.Elasticsearch.ClusterInfoTarget Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAll)) - { - return Elastic.Clients.Elasticsearch.ClusterInfoTarget.All; - } - - if (reader.ValueTextEquals(MemberHttp)) - { - return Elastic.Clients.Elasticsearch.ClusterInfoTarget.Http; - } - - if (reader.ValueTextEquals(MemberIngest)) - { - return Elastic.Clients.Elasticsearch.ClusterInfoTarget.Ingest; - } - - if (reader.ValueTextEquals(MemberScript)) - { - return Elastic.Clients.Elasticsearch.ClusterInfoTarget.Script; - } - - if (reader.ValueTextEquals(MemberThreadPool)) - { - return Elastic.Clients.Elasticsearch.ClusterInfoTarget.ThreadPool; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAll.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.ClusterInfoTarget.All; - } - - if (string.Equals(value, MemberHttp.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.ClusterInfoTarget.Http; - } - - if (string.Equals(value, MemberIngest.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.ClusterInfoTarget.Ingest; - } - - if (string.Equals(value, MemberScript.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.ClusterInfoTarget.Script; - } - - if (string.Equals(value, MemberThreadPool.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.ClusterInfoTarget.ThreadPool; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.ClusterInfoTarget)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ClusterInfoTarget value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.ClusterInfoTarget.All: - writer.WriteStringValue(MemberAll); - break; - case Elastic.Clients.Elasticsearch.ClusterInfoTarget.Http: - writer.WriteStringValue(MemberHttp); - break; - case Elastic.Clients.Elasticsearch.ClusterInfoTarget.Ingest: - writer.WriteStringValue(MemberIngest); - break; - case Elastic.Clients.Elasticsearch.ClusterInfoTarget.Script: - writer.WriteStringValue(MemberScript); - break; - case Elastic.Clients.Elasticsearch.ClusterInfoTarget.ThreadPool: - writer.WriteStringValue(MemberThreadPool); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.ClusterInfoTarget)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.ClusterInfoTarget ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ClusterInfoTarget value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class SlicesCalculationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAuto = System.Text.Json.JsonEncodedText.Encode("auto"); - - public override Elastic.Clients.Elasticsearch.SlicesCalculation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAuto)) - { - return Elastic.Clients.Elasticsearch.SlicesCalculation.Auto; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAuto.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.SlicesCalculation.Auto; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.SlicesCalculation)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SlicesCalculation value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.SlicesCalculation.Auto: - writer.WriteStringValue(MemberAuto); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.SlicesCalculation)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.SlicesCalculation ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SlicesCalculation value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ScriptLanguageConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.ScriptLanguage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.ScriptLanguage(reader.ReadValue(options, null)); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ScriptLanguage value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Value, null); - } -} - -internal sealed partial class GeoDistanceTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberArc = System.Text.Json.JsonEncodedText.Encode("arc"); - private static readonly System.Text.Json.JsonEncodedText MemberPlane = System.Text.Json.JsonEncodedText.Encode("plane"); - - public override Elastic.Clients.Elasticsearch.GeoDistanceType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberArc)) - { - return Elastic.Clients.Elasticsearch.GeoDistanceType.Arc; - } - - if (reader.ValueTextEquals(MemberPlane)) - { - return Elastic.Clients.Elasticsearch.GeoDistanceType.Plane; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberArc.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.GeoDistanceType.Arc; - } - - if (string.Equals(value, MemberPlane.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.GeoDistanceType.Plane; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.GeoDistanceType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GeoDistanceType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.GeoDistanceType.Arc: - writer.WriteStringValue(MemberArc); - break; - case Elastic.Clients.Elasticsearch.GeoDistanceType.Plane: - writer.WriteStringValue(MemberPlane); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.GeoDistanceType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.GeoDistanceType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GeoDistanceType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ScoreNormalizerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberL2Norm = System.Text.Json.JsonEncodedText.Encode("l2_norm"); - private static readonly System.Text.Json.JsonEncodedText MemberMinmax = System.Text.Json.JsonEncodedText.Encode("minmax"); - private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); - - public override Elastic.Clients.Elasticsearch.ScoreNormalizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberL2Norm)) - { - return Elastic.Clients.Elasticsearch.ScoreNormalizer.L2Norm; - } - - if (reader.ValueTextEquals(MemberMinmax)) - { - return Elastic.Clients.Elasticsearch.ScoreNormalizer.Minmax; - } - - if (reader.ValueTextEquals(MemberNone)) - { - return Elastic.Clients.Elasticsearch.ScoreNormalizer.None; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberL2Norm.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.ScoreNormalizer.L2Norm; - } - - if (string.Equals(value, MemberMinmax.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.ScoreNormalizer.Minmax; - } - - if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.ScoreNormalizer.None; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.ScoreNormalizer)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ScoreNormalizer value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.ScoreNormalizer.L2Norm: - writer.WriteStringValue(MemberL2Norm); - break; - case Elastic.Clients.Elasticsearch.ScoreNormalizer.Minmax: - writer.WriteStringValue(MemberMinmax); - break; - case Elastic.Clients.Elasticsearch.ScoreNormalizer.None: - writer.WriteStringValue(MemberNone); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.ScoreNormalizer)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.ScoreNormalizer ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ScoreNormalizer value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ClusterSearchStatusConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberFailed = System.Text.Json.JsonEncodedText.Encode("failed"); - private static readonly System.Text.Json.JsonEncodedText MemberPartial = System.Text.Json.JsonEncodedText.Encode("partial"); - private static readonly System.Text.Json.JsonEncodedText MemberRunning = System.Text.Json.JsonEncodedText.Encode("running"); - private static readonly System.Text.Json.JsonEncodedText MemberSkipped = System.Text.Json.JsonEncodedText.Encode("skipped"); - private static readonly System.Text.Json.JsonEncodedText MemberSuccessful = System.Text.Json.JsonEncodedText.Encode("successful"); - - public override Elastic.Clients.Elasticsearch.ClusterSearchStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberFailed)) - { - return Elastic.Clients.Elasticsearch.ClusterSearchStatus.Failed; - } - - if (reader.ValueTextEquals(MemberPartial)) - { - return Elastic.Clients.Elasticsearch.ClusterSearchStatus.Partial; - } - - if (reader.ValueTextEquals(MemberRunning)) - { - return Elastic.Clients.Elasticsearch.ClusterSearchStatus.Running; - } - - if (reader.ValueTextEquals(MemberSkipped)) - { - return Elastic.Clients.Elasticsearch.ClusterSearchStatus.Skipped; - } - - if (reader.ValueTextEquals(MemberSuccessful)) - { - return Elastic.Clients.Elasticsearch.ClusterSearchStatus.Successful; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberFailed.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.ClusterSearchStatus.Failed; - } - - if (string.Equals(value, MemberPartial.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.ClusterSearchStatus.Partial; - } - - if (string.Equals(value, MemberRunning.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.ClusterSearchStatus.Running; - } - - if (string.Equals(value, MemberSkipped.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.ClusterSearchStatus.Skipped; - } - - if (string.Equals(value, MemberSuccessful.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.ClusterSearchStatus.Successful; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.ClusterSearchStatus)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ClusterSearchStatus value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.ClusterSearchStatus.Failed: - writer.WriteStringValue(MemberFailed); - break; - case Elastic.Clients.Elasticsearch.ClusterSearchStatus.Partial: - writer.WriteStringValue(MemberPartial); - break; - case Elastic.Clients.Elasticsearch.ClusterSearchStatus.Running: - writer.WriteStringValue(MemberRunning); - break; - case Elastic.Clients.Elasticsearch.ClusterSearchStatus.Skipped: - writer.WriteStringValue(MemberSkipped); - break; - case Elastic.Clients.Elasticsearch.ClusterSearchStatus.Successful: - writer.WriteStringValue(MemberSuccessful); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.ClusterSearchStatus)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.ClusterSearchStatus ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ClusterSearchStatus value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class DistanceUnitConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCentimeters = System.Text.Json.JsonEncodedText.Encode("cm"); - private static readonly System.Text.Json.JsonEncodedText MemberFeet = System.Text.Json.JsonEncodedText.Encode("ft"); - private static readonly System.Text.Json.JsonEncodedText MemberInches = System.Text.Json.JsonEncodedText.Encode("in"); - private static readonly System.Text.Json.JsonEncodedText MemberKilometers = System.Text.Json.JsonEncodedText.Encode("km"); - private static readonly System.Text.Json.JsonEncodedText MemberMeters = System.Text.Json.JsonEncodedText.Encode("m"); - private static readonly System.Text.Json.JsonEncodedText MemberMiles = System.Text.Json.JsonEncodedText.Encode("mi"); - private static readonly System.Text.Json.JsonEncodedText MemberMillimeters = System.Text.Json.JsonEncodedText.Encode("mm"); - private static readonly System.Text.Json.JsonEncodedText MemberNauticMiles = System.Text.Json.JsonEncodedText.Encode("nmi"); - private static readonly System.Text.Json.JsonEncodedText MemberYards = System.Text.Json.JsonEncodedText.Encode("yd"); - - public override Elastic.Clients.Elasticsearch.DistanceUnit Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCentimeters)) - { - return Elastic.Clients.Elasticsearch.DistanceUnit.Centimeters; - } - - if (reader.ValueTextEquals(MemberFeet)) - { - return Elastic.Clients.Elasticsearch.DistanceUnit.Feet; - } - - if (reader.ValueTextEquals(MemberInches)) - { - return Elastic.Clients.Elasticsearch.DistanceUnit.Inches; - } - - if (reader.ValueTextEquals(MemberKilometers)) - { - return Elastic.Clients.Elasticsearch.DistanceUnit.Kilometers; - } - - if (reader.ValueTextEquals(MemberMeters)) - { - return Elastic.Clients.Elasticsearch.DistanceUnit.Meters; - } - - if (reader.ValueTextEquals(MemberMiles)) - { - return Elastic.Clients.Elasticsearch.DistanceUnit.Miles; - } - - if (reader.ValueTextEquals(MemberMillimeters)) - { - return Elastic.Clients.Elasticsearch.DistanceUnit.Millimeters; - } - - if (reader.ValueTextEquals(MemberNauticMiles)) - { - return Elastic.Clients.Elasticsearch.DistanceUnit.NauticMiles; - } - - if (reader.ValueTextEquals(MemberYards)) - { - return Elastic.Clients.Elasticsearch.DistanceUnit.Yards; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCentimeters.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.DistanceUnit.Centimeters; - } - - if (string.Equals(value, MemberFeet.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.DistanceUnit.Feet; - } - - if (string.Equals(value, MemberInches.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.DistanceUnit.Inches; - } - - if (string.Equals(value, MemberKilometers.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.DistanceUnit.Kilometers; - } - - if (string.Equals(value, MemberMeters.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.DistanceUnit.Meters; - } - - if (string.Equals(value, MemberMiles.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.DistanceUnit.Miles; - } - - if (string.Equals(value, MemberMillimeters.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.DistanceUnit.Millimeters; - } - - if (string.Equals(value, MemberNauticMiles.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.DistanceUnit.NauticMiles; - } - - if (string.Equals(value, MemberYards.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.DistanceUnit.Yards; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.DistanceUnit)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DistanceUnit value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.DistanceUnit.Centimeters: - writer.WriteStringValue(MemberCentimeters); - break; - case Elastic.Clients.Elasticsearch.DistanceUnit.Feet: - writer.WriteStringValue(MemberFeet); - break; - case Elastic.Clients.Elasticsearch.DistanceUnit.Inches: - writer.WriteStringValue(MemberInches); - break; - case Elastic.Clients.Elasticsearch.DistanceUnit.Kilometers: - writer.WriteStringValue(MemberKilometers); - break; - case Elastic.Clients.Elasticsearch.DistanceUnit.Meters: - writer.WriteStringValue(MemberMeters); - break; - case Elastic.Clients.Elasticsearch.DistanceUnit.Miles: - writer.WriteStringValue(MemberMiles); - break; - case Elastic.Clients.Elasticsearch.DistanceUnit.Millimeters: - writer.WriteStringValue(MemberMillimeters); - break; - case Elastic.Clients.Elasticsearch.DistanceUnit.NauticMiles: - writer.WriteStringValue(MemberNauticMiles); - break; - case Elastic.Clients.Elasticsearch.DistanceUnit.Yards: - writer.WriteStringValue(MemberYards); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.DistanceUnit)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.DistanceUnit ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DistanceUnit value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class SortModeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAvg = System.Text.Json.JsonEncodedText.Encode("avg"); - private static readonly System.Text.Json.JsonEncodedText MemberMax = System.Text.Json.JsonEncodedText.Encode("max"); - private static readonly System.Text.Json.JsonEncodedText MemberMedian = System.Text.Json.JsonEncodedText.Encode("median"); - private static readonly System.Text.Json.JsonEncodedText MemberMin = System.Text.Json.JsonEncodedText.Encode("min"); - private static readonly System.Text.Json.JsonEncodedText MemberSum = System.Text.Json.JsonEncodedText.Encode("sum"); - - public override Elastic.Clients.Elasticsearch.SortMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAvg)) - { - return Elastic.Clients.Elasticsearch.SortMode.Avg; - } - - if (reader.ValueTextEquals(MemberMax)) - { - return Elastic.Clients.Elasticsearch.SortMode.Max; - } - - if (reader.ValueTextEquals(MemberMedian)) - { - return Elastic.Clients.Elasticsearch.SortMode.Median; - } - - if (reader.ValueTextEquals(MemberMin)) - { - return Elastic.Clients.Elasticsearch.SortMode.Min; - } - - if (reader.ValueTextEquals(MemberSum)) - { - return Elastic.Clients.Elasticsearch.SortMode.Sum; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAvg.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.SortMode.Avg; - } - - if (string.Equals(value, MemberMax.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.SortMode.Max; - } - - if (string.Equals(value, MemberMedian.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.SortMode.Median; - } - - if (string.Equals(value, MemberMin.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.SortMode.Min; - } - - if (string.Equals(value, MemberSum.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.SortMode.Sum; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.SortMode)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SortMode value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.SortMode.Avg: - writer.WriteStringValue(MemberAvg); - break; - case Elastic.Clients.Elasticsearch.SortMode.Max: - writer.WriteStringValue(MemberMax); - break; - case Elastic.Clients.Elasticsearch.SortMode.Median: - writer.WriteStringValue(MemberMedian); - break; - case Elastic.Clients.Elasticsearch.SortMode.Min: - writer.WriteStringValue(MemberMin); - break; - case Elastic.Clients.Elasticsearch.SortMode.Sum: - writer.WriteStringValue(MemberSum); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.SortMode)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.SortMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SortMode value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class GeoShapeRelationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberContains = System.Text.Json.JsonEncodedText.Encode("contains"); - private static readonly System.Text.Json.JsonEncodedText MemberDisjoint = System.Text.Json.JsonEncodedText.Encode("disjoint"); - private static readonly System.Text.Json.JsonEncodedText MemberIntersects = System.Text.Json.JsonEncodedText.Encode("intersects"); - private static readonly System.Text.Json.JsonEncodedText MemberWithin = System.Text.Json.JsonEncodedText.Encode("within"); - - public override Elastic.Clients.Elasticsearch.GeoShapeRelation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberContains)) - { - return Elastic.Clients.Elasticsearch.GeoShapeRelation.Contains; - } - - if (reader.ValueTextEquals(MemberDisjoint)) - { - return Elastic.Clients.Elasticsearch.GeoShapeRelation.Disjoint; - } - - if (reader.ValueTextEquals(MemberIntersects)) - { - return Elastic.Clients.Elasticsearch.GeoShapeRelation.Intersects; - } - - if (reader.ValueTextEquals(MemberWithin)) - { - return Elastic.Clients.Elasticsearch.GeoShapeRelation.Within; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberContains.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.GeoShapeRelation.Contains; - } - - if (string.Equals(value, MemberDisjoint.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.GeoShapeRelation.Disjoint; - } - - if (string.Equals(value, MemberIntersects.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.GeoShapeRelation.Intersects; - } - - if (string.Equals(value, MemberWithin.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.GeoShapeRelation.Within; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.GeoShapeRelation)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GeoShapeRelation value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.GeoShapeRelation.Contains: - writer.WriteStringValue(MemberContains); - break; - case Elastic.Clients.Elasticsearch.GeoShapeRelation.Disjoint: - writer.WriteStringValue(MemberDisjoint); - break; - case Elastic.Clients.Elasticsearch.GeoShapeRelation.Intersects: - writer.WriteStringValue(MemberIntersects); - break; - case Elastic.Clients.Elasticsearch.GeoShapeRelation.Within: - writer.WriteStringValue(MemberWithin); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.GeoShapeRelation)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.GeoShapeRelation ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GeoShapeRelation value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ScriptSortTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberNumber = System.Text.Json.JsonEncodedText.Encode("number"); - private static readonly System.Text.Json.JsonEncodedText MemberString = System.Text.Json.JsonEncodedText.Encode("string"); - private static readonly System.Text.Json.JsonEncodedText MemberVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.ScriptSortType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberNumber)) - { - return Elastic.Clients.Elasticsearch.ScriptSortType.Number; - } - - if (reader.ValueTextEquals(MemberString)) - { - return Elastic.Clients.Elasticsearch.ScriptSortType.String; - } - - if (reader.ValueTextEquals(MemberVersion)) - { - return Elastic.Clients.Elasticsearch.ScriptSortType.Version; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberNumber.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.ScriptSortType.Number; - } - - if (string.Equals(value, MemberString.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.ScriptSortType.String; - } - - if (string.Equals(value, MemberVersion.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.ScriptSortType.Version; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.ScriptSortType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ScriptSortType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.ScriptSortType.Number: - writer.WriteStringValue(MemberNumber); - break; - case Elastic.Clients.Elasticsearch.ScriptSortType.String: - writer.WriteStringValue(MemberString); - break; - case Elastic.Clients.Elasticsearch.ScriptSortType.Version: - writer.WriteStringValue(MemberVersion); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.ScriptSortType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.ScriptSortType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ScriptSortType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class DFIIndependenceMeasureConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberChisquared = System.Text.Json.JsonEncodedText.Encode("chisquared"); - private static readonly System.Text.Json.JsonEncodedText MemberSaturated = System.Text.Json.JsonEncodedText.Encode("saturated"); - private static readonly System.Text.Json.JsonEncodedText MemberStandardized = System.Text.Json.JsonEncodedText.Encode("standardized"); - - public override Elastic.Clients.Elasticsearch.DFIIndependenceMeasure Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberChisquared)) - { - return Elastic.Clients.Elasticsearch.DFIIndependenceMeasure.Chisquared; - } - - if (reader.ValueTextEquals(MemberSaturated)) - { - return Elastic.Clients.Elasticsearch.DFIIndependenceMeasure.Saturated; - } - - if (reader.ValueTextEquals(MemberStandardized)) - { - return Elastic.Clients.Elasticsearch.DFIIndependenceMeasure.Standardized; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberChisquared.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.DFIIndependenceMeasure.Chisquared; - } - - if (string.Equals(value, MemberSaturated.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.DFIIndependenceMeasure.Saturated; - } - - if (string.Equals(value, MemberStandardized.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.DFIIndependenceMeasure.Standardized; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.DFIIndependenceMeasure)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DFIIndependenceMeasure value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.DFIIndependenceMeasure.Chisquared: - writer.WriteStringValue(MemberChisquared); - break; - case Elastic.Clients.Elasticsearch.DFIIndependenceMeasure.Saturated: - writer.WriteStringValue(MemberSaturated); - break; - case Elastic.Clients.Elasticsearch.DFIIndependenceMeasure.Standardized: - writer.WriteStringValue(MemberStandardized); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.DFIIndependenceMeasure)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.DFIIndependenceMeasure ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DFIIndependenceMeasure value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class DFRAfterEffectConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberB = System.Text.Json.JsonEncodedText.Encode("b"); - private static readonly System.Text.Json.JsonEncodedText MemberL = System.Text.Json.JsonEncodedText.Encode("l"); - private static readonly System.Text.Json.JsonEncodedText MemberNo = System.Text.Json.JsonEncodedText.Encode("no"); - - public override Elastic.Clients.Elasticsearch.DFRAfterEffect Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberB)) - { - return Elastic.Clients.Elasticsearch.DFRAfterEffect.B; - } - - if (reader.ValueTextEquals(MemberL)) - { - return Elastic.Clients.Elasticsearch.DFRAfterEffect.L; - } - - if (reader.ValueTextEquals(MemberNo)) - { - return Elastic.Clients.Elasticsearch.DFRAfterEffect.No; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberB.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.DFRAfterEffect.B; - } - - if (string.Equals(value, MemberL.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.DFRAfterEffect.L; - } - - if (string.Equals(value, MemberNo.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.DFRAfterEffect.No; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.DFRAfterEffect)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DFRAfterEffect value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.DFRAfterEffect.B: - writer.WriteStringValue(MemberB); - break; - case Elastic.Clients.Elasticsearch.DFRAfterEffect.L: - writer.WriteStringValue(MemberL); - break; - case Elastic.Clients.Elasticsearch.DFRAfterEffect.No: - writer.WriteStringValue(MemberNo); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.DFRAfterEffect)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.DFRAfterEffect ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DFRAfterEffect value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class DFRBasicModelConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberBe = System.Text.Json.JsonEncodedText.Encode("be"); - private static readonly System.Text.Json.JsonEncodedText MemberD = System.Text.Json.JsonEncodedText.Encode("d"); - private static readonly System.Text.Json.JsonEncodedText MemberG = System.Text.Json.JsonEncodedText.Encode("g"); - private static readonly System.Text.Json.JsonEncodedText MemberIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText MemberIn = System.Text.Json.JsonEncodedText.Encode("in"); - private static readonly System.Text.Json.JsonEncodedText MemberIne = System.Text.Json.JsonEncodedText.Encode("ine"); - private static readonly System.Text.Json.JsonEncodedText MemberP = System.Text.Json.JsonEncodedText.Encode("p"); - - public override Elastic.Clients.Elasticsearch.DFRBasicModel Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberBe)) - { - return Elastic.Clients.Elasticsearch.DFRBasicModel.Be; - } - - if (reader.ValueTextEquals(MemberD)) - { - return Elastic.Clients.Elasticsearch.DFRBasicModel.D; - } - - if (reader.ValueTextEquals(MemberG)) - { - return Elastic.Clients.Elasticsearch.DFRBasicModel.G; - } - - if (reader.ValueTextEquals(MemberIf)) - { - return Elastic.Clients.Elasticsearch.DFRBasicModel.If; - } - - if (reader.ValueTextEquals(MemberIn)) - { - return Elastic.Clients.Elasticsearch.DFRBasicModel.In; - } - - if (reader.ValueTextEquals(MemberIne)) - { - return Elastic.Clients.Elasticsearch.DFRBasicModel.Ine; - } - - if (reader.ValueTextEquals(MemberP)) - { - return Elastic.Clients.Elasticsearch.DFRBasicModel.P; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberBe.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.DFRBasicModel.Be; - } - - if (string.Equals(value, MemberD.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.DFRBasicModel.D; - } - - if (string.Equals(value, MemberG.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.DFRBasicModel.G; - } - - if (string.Equals(value, MemberIf.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.DFRBasicModel.If; - } - - if (string.Equals(value, MemberIn.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.DFRBasicModel.In; - } - - if (string.Equals(value, MemberIne.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.DFRBasicModel.Ine; - } - - if (string.Equals(value, MemberP.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.DFRBasicModel.P; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.DFRBasicModel)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DFRBasicModel value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.DFRBasicModel.Be: - writer.WriteStringValue(MemberBe); - break; - case Elastic.Clients.Elasticsearch.DFRBasicModel.D: - writer.WriteStringValue(MemberD); - break; - case Elastic.Clients.Elasticsearch.DFRBasicModel.G: - writer.WriteStringValue(MemberG); - break; - case Elastic.Clients.Elasticsearch.DFRBasicModel.If: - writer.WriteStringValue(MemberIf); - break; - case Elastic.Clients.Elasticsearch.DFRBasicModel.In: - writer.WriteStringValue(MemberIn); - break; - case Elastic.Clients.Elasticsearch.DFRBasicModel.Ine: - writer.WriteStringValue(MemberIne); - break; - case Elastic.Clients.Elasticsearch.DFRBasicModel.P: - writer.WriteStringValue(MemberP); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.DFRBasicModel)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.DFRBasicModel ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.DFRBasicModel value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class NormalizationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberH1 = System.Text.Json.JsonEncodedText.Encode("h1"); - private static readonly System.Text.Json.JsonEncodedText MemberH2 = System.Text.Json.JsonEncodedText.Encode("h2"); - private static readonly System.Text.Json.JsonEncodedText MemberH3 = System.Text.Json.JsonEncodedText.Encode("h3"); - private static readonly System.Text.Json.JsonEncodedText MemberNo = System.Text.Json.JsonEncodedText.Encode("no"); - private static readonly System.Text.Json.JsonEncodedText MemberZ = System.Text.Json.JsonEncodedText.Encode("z"); - - public override Elastic.Clients.Elasticsearch.Normalization Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberH1)) - { - return Elastic.Clients.Elasticsearch.Normalization.H1; - } - - if (reader.ValueTextEquals(MemberH2)) - { - return Elastic.Clients.Elasticsearch.Normalization.H2; - } - - if (reader.ValueTextEquals(MemberH3)) - { - return Elastic.Clients.Elasticsearch.Normalization.H3; - } - - if (reader.ValueTextEquals(MemberNo)) - { - return Elastic.Clients.Elasticsearch.Normalization.No; - } - - if (reader.ValueTextEquals(MemberZ)) - { - return Elastic.Clients.Elasticsearch.Normalization.Z; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberH1.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Normalization.H1; - } - - if (string.Equals(value, MemberH2.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Normalization.H2; - } - - if (string.Equals(value, MemberH3.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Normalization.H3; - } - - if (string.Equals(value, MemberNo.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Normalization.No; - } - - if (string.Equals(value, MemberZ.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Normalization.Z; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Normalization)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Normalization value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Normalization.H1: - writer.WriteStringValue(MemberH1); - break; - case Elastic.Clients.Elasticsearch.Normalization.H2: - writer.WriteStringValue(MemberH2); - break; - case Elastic.Clients.Elasticsearch.Normalization.H3: - writer.WriteStringValue(MemberH3); - break; - case Elastic.Clients.Elasticsearch.Normalization.No: - writer.WriteStringValue(MemberNo); - break; - case Elastic.Clients.Elasticsearch.Normalization.Z: - writer.WriteStringValue(MemberZ); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Normalization)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Normalization ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Normalization value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class IBDistributionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberLl = System.Text.Json.JsonEncodedText.Encode("ll"); - private static readonly System.Text.Json.JsonEncodedText MemberSpl = System.Text.Json.JsonEncodedText.Encode("spl"); - - public override Elastic.Clients.Elasticsearch.IBDistribution Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberLl)) - { - return Elastic.Clients.Elasticsearch.IBDistribution.Ll; - } - - if (reader.ValueTextEquals(MemberSpl)) - { - return Elastic.Clients.Elasticsearch.IBDistribution.Spl; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberLl.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IBDistribution.Ll; - } - - if (string.Equals(value, MemberSpl.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IBDistribution.Spl; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IBDistribution)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IBDistribution value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.IBDistribution.Ll: - writer.WriteStringValue(MemberLl); - break; - case Elastic.Clients.Elasticsearch.IBDistribution.Spl: - writer.WriteStringValue(MemberSpl); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IBDistribution)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.IBDistribution ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IBDistribution value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class IBLambdaConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberDf = System.Text.Json.JsonEncodedText.Encode("df"); - private static readonly System.Text.Json.JsonEncodedText MemberTtf = System.Text.Json.JsonEncodedText.Encode("ttf"); - - public override Elastic.Clients.Elasticsearch.IBLambda Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberDf)) - { - return Elastic.Clients.Elasticsearch.IBLambda.Df; - } - - if (reader.ValueTextEquals(MemberTtf)) - { - return Elastic.Clients.Elasticsearch.IBLambda.Ttf; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberDf.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IBLambda.Df; - } - - if (string.Equals(value, MemberTtf.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.IBLambda.Ttf; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IBLambda)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IBLambda value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.IBLambda.Df: - writer.WriteStringValue(MemberDf); - break; - case Elastic.Clients.Elasticsearch.IBLambda.Ttf: - writer.WriteStringValue(MemberTtf); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IBLambda)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.IBLambda ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IBLambda value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class FieldSortNumericTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberDate = System.Text.Json.JsonEncodedText.Encode("date"); - private static readonly System.Text.Json.JsonEncodedText MemberDateNanos = System.Text.Json.JsonEncodedText.Encode("date_nanos"); - private static readonly System.Text.Json.JsonEncodedText MemberDouble = System.Text.Json.JsonEncodedText.Encode("double"); - private static readonly System.Text.Json.JsonEncodedText MemberLong = System.Text.Json.JsonEncodedText.Encode("long"); - - public override Elastic.Clients.Elasticsearch.FieldSortNumericType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberDate)) - { - return Elastic.Clients.Elasticsearch.FieldSortNumericType.Date; - } - - if (reader.ValueTextEquals(MemberDateNanos)) - { - return Elastic.Clients.Elasticsearch.FieldSortNumericType.DateNanos; - } - - if (reader.ValueTextEquals(MemberDouble)) - { - return Elastic.Clients.Elasticsearch.FieldSortNumericType.Double; - } - - if (reader.ValueTextEquals(MemberLong)) - { - return Elastic.Clients.Elasticsearch.FieldSortNumericType.Long; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberDate.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.FieldSortNumericType.Date; - } - - if (string.Equals(value, MemberDateNanos.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.FieldSortNumericType.DateNanos; - } - - if (string.Equals(value, MemberDouble.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.FieldSortNumericType.Double; - } - - if (string.Equals(value, MemberLong.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.FieldSortNumericType.Long; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.FieldSortNumericType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.FieldSortNumericType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.FieldSortNumericType.Date: - writer.WriteStringValue(MemberDate); - break; - case Elastic.Clients.Elasticsearch.FieldSortNumericType.DateNanos: - writer.WriteStringValue(MemberDateNanos); - break; - case Elastic.Clients.Elasticsearch.FieldSortNumericType.Double: - writer.WriteStringValue(MemberDouble); - break; - case Elastic.Clients.Elasticsearch.FieldSortNumericType.Long: - writer.WriteStringValue(MemberLong); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.FieldSortNumericType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.FieldSortNumericType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.FieldSortNumericType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TimeUnitConverter))] -public enum TimeUnit -{ - [System.Runtime.Serialization.EnumMember(Value = "d")] - Days, - [System.Runtime.Serialization.EnumMember(Value = "h")] - Hours, - [System.Runtime.Serialization.EnumMember(Value = "m")] - Minutes, - [System.Runtime.Serialization.EnumMember(Value = "micros")] - Microseconds, - [System.Runtime.Serialization.EnumMember(Value = "ms")] - Milliseconds, - [System.Runtime.Serialization.EnumMember(Value = "nanos")] - Nanoseconds, - [System.Runtime.Serialization.EnumMember(Value = "s")] - Seconds -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchTypeConverter))] -public enum SearchType -{ - /// - /// - /// Documents are scored using global term and document frequencies across all shards. This is usually slower but more accurate. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "dfs_query_then_fetch")] - DfsQueryThenFetch, - /// - /// - /// Documents are scored using local term and document frequencies for the shard. This is usually faster but less accurate. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "query_then_fetch")] - QueryThenFetch -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SuggestModeConverter))] -public enum SuggestMode -{ - /// - /// - /// Suggest any matching suggestions based on terms in the suggest text. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "always")] - Always, - /// - /// - /// Only generate suggestions for terms that are not in the shard. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "missing")] - Missing, - /// - /// - /// Only suggest terms that occur in more docs on the shard than the original term. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "popular")] - Popular -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.RefreshConverter))] -public enum Refresh -{ - [System.Runtime.Serialization.EnumMember(Value = "false")] - False, - [System.Runtime.Serialization.EnumMember(Value = "true")] - True, - [System.Runtime.Serialization.EnumMember(Value = "wait_for")] - WaitFor -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.HealthStatusConverter))] -public enum HealthStatus -{ - /// - /// - /// All shards are assigned. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "green")] - Green, - /// - /// - /// One or more primary shards are unassigned, so some data is unavailable. This can occur briefly during cluster startup as primary shards are assigned. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "red")] - Red, - [System.Runtime.Serialization.EnumMember(Value = "unavailable")] - Unavailable, - [System.Runtime.Serialization.EnumMember(Value = "unknown")] - Unknown, - /// - /// - /// All primary shards are assigned, but one or more replica shards are unassigned. If a node in the cluster fails, some data could be unavailable until that node is repaired. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "yellow")] - Yellow -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LevelConverter))] -public enum Level -{ - [System.Runtime.Serialization.EnumMember(Value = "cluster")] - Cluster, - [System.Runtime.Serialization.EnumMember(Value = "indices")] - Indices, - [System.Runtime.Serialization.EnumMember(Value = "shards")] - Shards -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.WaitForEventsConverter))] -public enum WaitForEvents -{ - [System.Runtime.Serialization.EnumMember(Value = "high")] - High, - [System.Runtime.Serialization.EnumMember(Value = "immediate")] - Immediate, - [System.Runtime.Serialization.EnumMember(Value = "languid")] - Languid, - [System.Runtime.Serialization.EnumMember(Value = "low")] - Low, - [System.Runtime.Serialization.EnumMember(Value = "normal")] - Normal, - [System.Runtime.Serialization.EnumMember(Value = "urgent")] - Urgent -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.VersionTypeConverter))] -public enum VersionType -{ - /// - /// - /// Only index the document if the specified version is strictly higher than the version of the stored document or if there is no existing document. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "external")] - External, - /// - /// - /// Only index the document if the specified version is equal or higher than the version of the stored document or if there is no existing document. - /// NOTE: The external_gte version type is meant for special use cases and should be used with care. - /// If used incorrectly, it can result in loss of data. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "external_gte")] - ExternalGte, - /// - /// - /// This option is deprecated because it can cause primary and replica shards to diverge. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "force")] - Force, - /// - /// - /// Use internal versioning that starts at 1 and increments with each update or delete. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "internal")] - Internal -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ConflictsConverter))] -public enum Conflicts -{ - /// - /// - /// Stop reindexing if there are conflicts. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "abort")] - Abort, - /// - /// - /// Continue reindexing even if there are conflicts. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "proceed")] - Proceed -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.OpTypeConverter))] -public enum OpType -{ - /// - /// - /// Only index documents that do not already exist. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "create")] - Create, - /// - /// - /// Overwrite any documents that already exist. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "index")] - Index -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ThreadTypeConverter))] -public enum ThreadType -{ - [System.Runtime.Serialization.EnumMember(Value = "block")] - Block, - [System.Runtime.Serialization.EnumMember(Value = "cpu")] - Cpu, - [System.Runtime.Serialization.EnumMember(Value = "gpu")] - Gpu, - [System.Runtime.Serialization.EnumMember(Value = "mem")] - Mem, - [System.Runtime.Serialization.EnumMember(Value = "wait")] - Wait -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SortOrderConverter))] -public enum SortOrder -{ - /// - /// - /// Ascending (smallest to largest) - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "asc")] - Asc, - /// - /// - /// Descending (largest to smallest) - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "desc")] - Desc -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ResultConverter))] -public enum Result -{ - [System.Runtime.Serialization.EnumMember(Value = "created")] - Created, - [System.Runtime.Serialization.EnumMember(Value = "deleted")] - Deleted, - [System.Runtime.Serialization.EnumMember(Value = "noop")] - NoOp, - [System.Runtime.Serialization.EnumMember(Value = "not_found")] - NotFound, - [System.Runtime.Serialization.EnumMember(Value = "updated")] - Updated -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LifecycleOperationModeConverter))] -public enum LifecycleOperationMode -{ - [System.Runtime.Serialization.EnumMember(Value = "RUNNING")] - Running, - [System.Runtime.Serialization.EnumMember(Value = "STOPPED")] - Stopped, - [System.Runtime.Serialization.EnumMember(Value = "STOPPING")] - Stopping -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ExpandWildcardConverter))] -public enum ExpandWildcard -{ - /// - /// - /// Match any data stream or index, including hidden ones. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "all")] - All, - /// - /// - /// Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "closed")] - Closed, - /// - /// - /// Match hidden data streams and hidden indices. Must be combined with open, closed, or both. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "hidden")] - Hidden, - /// - /// - /// Wildcard expressions are not accepted. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "none")] - None, - /// - /// - /// Match open, non-hidden indices. Also matches any non-hidden data stream. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "open")] - Open -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.WaitForActiveShardOptionsConverter))] -public enum WaitForActiveShardOptions -{ - [System.Runtime.Serialization.EnumMember(Value = "all")] - All, - [System.Runtime.Serialization.EnumMember(Value = "index-setting")] - IndexSetting -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.NodeRoleConverter))] -public enum NodeRole -{ - [System.Runtime.Serialization.EnumMember(Value = "client")] - Client, - [System.Runtime.Serialization.EnumMember(Value = "coordinating_only")] - CoordinatingOnly, - [System.Runtime.Serialization.EnumMember(Value = "data")] - Data, - [System.Runtime.Serialization.EnumMember(Value = "data_cold")] - DataCold, - [System.Runtime.Serialization.EnumMember(Value = "data_content")] - DataContent, - [System.Runtime.Serialization.EnumMember(Value = "data_frozen")] - DataFrozen, - [System.Runtime.Serialization.EnumMember(Value = "data_hot")] - DataHot, - [System.Runtime.Serialization.EnumMember(Value = "data_warm")] - DataWarm, - [System.Runtime.Serialization.EnumMember(Value = "ingest")] - Ingest, - [System.Runtime.Serialization.EnumMember(Value = "master")] - Master, - [System.Runtime.Serialization.EnumMember(Value = "ml")] - Ml, - [System.Runtime.Serialization.EnumMember(Value = "remote_cluster_client")] - RemoteClusterClient, - [System.Runtime.Serialization.EnumMember(Value = "transform")] - Transform, - [System.Runtime.Serialization.EnumMember(Value = "voting_only")] - VotingOnly -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ClusterInfoTargetConverter))] -public enum ClusterInfoTarget -{ - [System.Runtime.Serialization.EnumMember(Value = "_all")] - All, - [System.Runtime.Serialization.EnumMember(Value = "http")] - Http, - [System.Runtime.Serialization.EnumMember(Value = "ingest")] - Ingest, - [System.Runtime.Serialization.EnumMember(Value = "script")] - Script, - [System.Runtime.Serialization.EnumMember(Value = "thread_pool")] - ThreadPool -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SlicesCalculationConverter))] -public enum SlicesCalculation -{ - /// - /// - /// Let Elasticsearch choose a reasonable number for most data streams and indices. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "auto")] - Auto -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ScriptLanguageConverter))] -public readonly partial struct ScriptLanguage : Elastic.Clients.Elasticsearch.Serialization.IEnumStruct -{ - public ScriptLanguage(string value) => Value = value; -#if NET7_0_OR_GREATER - static ScriptLanguage IEnumStruct.Create(string value) => value; -#else - ScriptLanguage IEnumStruct.Create(string value) => value; -#endif - public readonly string Value { get; } - - /// - /// - /// Lucene’s expressions language, compiles a JavaScript expression to bytecode. - /// - /// - public static ScriptLanguage Expression { get; } = new ScriptLanguage("expression"); - - /// - /// - /// Expert Java API - /// - /// - public static ScriptLanguage Java { get; } = new ScriptLanguage("java"); - - /// - /// - /// Mustache templated, used for templates. - /// - /// - public static ScriptLanguage Mustache { get; } = new ScriptLanguage("mustache"); - - /// - /// - /// Painless scripting language, purpose-built for Elasticsearch. - /// - /// - public static ScriptLanguage Painless { get; } = new ScriptLanguage("painless"); - - public override string ToString() => Value ?? string.Empty; - - public static implicit operator string(ScriptLanguage @enum) => @enum.Value; - public static implicit operator ScriptLanguage(string value) => new(value); - - public override int GetHashCode() => Value.GetHashCode(); - public override bool Equals(object obj) => obj is ScriptLanguage other && this.Equals(other); - public bool Equals(ScriptLanguage other) => Value == other.Value; - - public static bool operator ==(ScriptLanguage a, ScriptLanguage b) => a.Equals(b); - public static bool operator !=(ScriptLanguage a, ScriptLanguage b) => !(a == b); -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.GeoDistanceTypeConverter))] -public enum GeoDistanceType -{ - /// - /// - /// The arc calculation is the most accurate. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "arc")] - Arc, - /// - /// - /// The plane calculation is faster but less accurate. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "plane")] - Plane -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ScoreNormalizerConverter))] -public enum ScoreNormalizer -{ - [System.Runtime.Serialization.EnumMember(Value = "l2_norm")] - L2Norm, - [System.Runtime.Serialization.EnumMember(Value = "minmax")] - Minmax, - [System.Runtime.Serialization.EnumMember(Value = "none")] - None -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ClusterSearchStatusConverter))] -public enum ClusterSearchStatus -{ - [System.Runtime.Serialization.EnumMember(Value = "failed")] - Failed, - [System.Runtime.Serialization.EnumMember(Value = "partial")] - Partial, - [System.Runtime.Serialization.EnumMember(Value = "running")] - Running, - [System.Runtime.Serialization.EnumMember(Value = "skipped")] - Skipped, - [System.Runtime.Serialization.EnumMember(Value = "successful")] - Successful -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.DistanceUnitConverter))] -public enum DistanceUnit -{ - [System.Runtime.Serialization.EnumMember(Value = "cm")] - Centimeters, - [System.Runtime.Serialization.EnumMember(Value = "ft")] - Feet, - [System.Runtime.Serialization.EnumMember(Value = "in")] - Inches, - [System.Runtime.Serialization.EnumMember(Value = "km")] - Kilometers, - [System.Runtime.Serialization.EnumMember(Value = "m")] - Meters, - [System.Runtime.Serialization.EnumMember(Value = "mi")] - Miles, - [System.Runtime.Serialization.EnumMember(Value = "mm")] - Millimeters, - [System.Runtime.Serialization.EnumMember(Value = "nmi")] - NauticMiles, - [System.Runtime.Serialization.EnumMember(Value = "yd")] - Yards -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SortModeConverter))] -public enum SortMode -{ - [System.Runtime.Serialization.EnumMember(Value = "avg")] - Avg, - [System.Runtime.Serialization.EnumMember(Value = "max")] - Max, - [System.Runtime.Serialization.EnumMember(Value = "median")] - Median, - [System.Runtime.Serialization.EnumMember(Value = "min")] - Min, - [System.Runtime.Serialization.EnumMember(Value = "sum")] - Sum -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.GeoShapeRelationConverter))] -public enum GeoShapeRelation -{ - /// - /// - /// Return all documents whose geo_shape or geo_point field contains the query geometry. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "contains")] - Contains, - /// - /// - /// Return all documents whose geo_shape or geo_point field has nothing in common with the query geometry. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "disjoint")] - Disjoint, - /// - /// - /// Return all documents whose geo_shape or geo_point field intersects the query geometry. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "intersects")] - Intersects, - /// - /// - /// Return all documents whose geo_shape or geo_point field is within the query geometry. - /// Line geometries are not supported. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "within")] - Within -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ScriptSortTypeConverter))] -public enum ScriptSortType -{ - [System.Runtime.Serialization.EnumMember(Value = "number")] - Number, - [System.Runtime.Serialization.EnumMember(Value = "string")] - String, - [System.Runtime.Serialization.EnumMember(Value = "version")] - Version -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.DFIIndependenceMeasureConverter))] -public enum DFIIndependenceMeasure -{ - [System.Runtime.Serialization.EnumMember(Value = "chisquared")] - Chisquared, - [System.Runtime.Serialization.EnumMember(Value = "saturated")] - Saturated, - [System.Runtime.Serialization.EnumMember(Value = "standardized")] - Standardized -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.DFRAfterEffectConverter))] -public enum DFRAfterEffect -{ - [System.Runtime.Serialization.EnumMember(Value = "b")] - B, - [System.Runtime.Serialization.EnumMember(Value = "l")] - L, - [System.Runtime.Serialization.EnumMember(Value = "no")] - No -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.DFRBasicModelConverter))] -public enum DFRBasicModel -{ - [System.Runtime.Serialization.EnumMember(Value = "be")] - Be, - [System.Runtime.Serialization.EnumMember(Value = "d")] - D, - [System.Runtime.Serialization.EnumMember(Value = "g")] - G, - [System.Runtime.Serialization.EnumMember(Value = "if")] - If, - [System.Runtime.Serialization.EnumMember(Value = "in")] - In, - [System.Runtime.Serialization.EnumMember(Value = "ine")] - Ine, - [System.Runtime.Serialization.EnumMember(Value = "p")] - P -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.NormalizationConverter))] -public enum Normalization -{ - [System.Runtime.Serialization.EnumMember(Value = "h1")] - H1, - [System.Runtime.Serialization.EnumMember(Value = "h2")] - H2, - [System.Runtime.Serialization.EnumMember(Value = "h3")] - H3, - [System.Runtime.Serialization.EnumMember(Value = "no")] - No, - [System.Runtime.Serialization.EnumMember(Value = "z")] - Z -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IBDistributionConverter))] -public enum IBDistribution -{ - [System.Runtime.Serialization.EnumMember(Value = "ll")] - Ll, - [System.Runtime.Serialization.EnumMember(Value = "spl")] - Spl -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IBLambdaConverter))] -public enum IBLambda -{ - [System.Runtime.Serialization.EnumMember(Value = "df")] - Df, - [System.Runtime.Serialization.EnumMember(Value = "ttf")] - Ttf -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.FieldSortNumericTypeConverter))] -public enum FieldSortNumericType -{ - [System.Runtime.Serialization.EnumMember(Value = "date")] - Date, - [System.Runtime.Serialization.EnumMember(Value = "date_nanos")] - DateNanos, - [System.Runtime.Serialization.EnumMember(Value = "double")] - Double, - [System.Runtime.Serialization.EnumMember(Value = "long")] - Long -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryDsl.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryDsl.g.cs deleted file mode 100644 index f2bdfde94d0..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryDsl.g.cs +++ /dev/null @@ -1,1710 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using System; -using System.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.QueryDsl; - -internal sealed partial class OperatorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAnd = System.Text.Json.JsonEncodedText.Encode("and"); - private static readonly System.Text.Json.JsonEncodedText MemberAnd1 = System.Text.Json.JsonEncodedText.Encode("AND"); - private static readonly System.Text.Json.JsonEncodedText MemberOr = System.Text.Json.JsonEncodedText.Encode("or"); - private static readonly System.Text.Json.JsonEncodedText MemberOr1 = System.Text.Json.JsonEncodedText.Encode("OR"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.Operator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAnd) || reader.ValueTextEquals(MemberAnd1)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.Operator.And; - } - - if (reader.ValueTextEquals(MemberOr) || reader.ValueTextEquals(MemberOr1)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.Operator.Or; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAnd.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberAnd1.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.Operator.And; - } - - if (string.Equals(value, MemberOr.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberOr1.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.Operator.Or; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.Operator)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.Operator value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.QueryDsl.Operator.And: - writer.WriteStringValue(MemberAnd); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.Operator.Or: - writer.WriteStringValue(MemberOr); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.Operator)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.QueryDsl.Operator ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.Operator value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ZeroTermsQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAll = System.Text.Json.JsonEncodedText.Encode("all"); - private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAll)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery.All; - } - - if (reader.ValueTextEquals(MemberNone)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery.None; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAll.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery.All; - } - - if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery.None; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery.All: - writer.WriteStringValue(MemberAll); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery.None: - writer.WriteStringValue(MemberNone); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class CombinedFieldsOperatorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAnd = System.Text.Json.JsonEncodedText.Encode("and"); - private static readonly System.Text.Json.JsonEncodedText MemberOr = System.Text.Json.JsonEncodedText.Encode("or"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAnd)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator.And; - } - - if (reader.ValueTextEquals(MemberOr)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator.Or; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAnd.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator.And; - } - - if (string.Equals(value, MemberOr.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator.Or; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator.And: - writer.WriteStringValue(MemberAnd); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator.Or: - writer.WriteStringValue(MemberOr); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class CombinedFieldsZeroTermsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAll = System.Text.Json.JsonEncodedText.Encode("all"); - private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAll)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms.All; - } - - if (reader.ValueTextEquals(MemberNone)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms.None; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAll.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms.All; - } - - if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms.None; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms.All: - writer.WriteStringValue(MemberAll); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms.None: - writer.WriteStringValue(MemberNone); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class FunctionBoostModeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAvg = System.Text.Json.JsonEncodedText.Encode("avg"); - private static readonly System.Text.Json.JsonEncodedText MemberMax = System.Text.Json.JsonEncodedText.Encode("max"); - private static readonly System.Text.Json.JsonEncodedText MemberMin = System.Text.Json.JsonEncodedText.Encode("min"); - private static readonly System.Text.Json.JsonEncodedText MemberMultiply = System.Text.Json.JsonEncodedText.Encode("multiply"); - private static readonly System.Text.Json.JsonEncodedText MemberReplace = System.Text.Json.JsonEncodedText.Encode("replace"); - private static readonly System.Text.Json.JsonEncodedText MemberSum = System.Text.Json.JsonEncodedText.Encode("sum"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAvg)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Avg; - } - - if (reader.ValueTextEquals(MemberMax)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Max; - } - - if (reader.ValueTextEquals(MemberMin)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Min; - } - - if (reader.ValueTextEquals(MemberMultiply)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Multiply; - } - - if (reader.ValueTextEquals(MemberReplace)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Replace; - } - - if (reader.ValueTextEquals(MemberSum)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Sum; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAvg.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Avg; - } - - if (string.Equals(value, MemberMax.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Max; - } - - if (string.Equals(value, MemberMin.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Min; - } - - if (string.Equals(value, MemberMultiply.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Multiply; - } - - if (string.Equals(value, MemberReplace.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Replace; - } - - if (string.Equals(value, MemberSum.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Sum; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Avg: - writer.WriteStringValue(MemberAvg); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Max: - writer.WriteStringValue(MemberMax); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Min: - writer.WriteStringValue(MemberMin); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Multiply: - writer.WriteStringValue(MemberMultiply); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Replace: - writer.WriteStringValue(MemberReplace); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Sum: - writer.WriteStringValue(MemberSum); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class FunctionScoreModeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAvg = System.Text.Json.JsonEncodedText.Encode("avg"); - private static readonly System.Text.Json.JsonEncodedText MemberFirst = System.Text.Json.JsonEncodedText.Encode("first"); - private static readonly System.Text.Json.JsonEncodedText MemberMax = System.Text.Json.JsonEncodedText.Encode("max"); - private static readonly System.Text.Json.JsonEncodedText MemberMin = System.Text.Json.JsonEncodedText.Encode("min"); - private static readonly System.Text.Json.JsonEncodedText MemberMultiply = System.Text.Json.JsonEncodedText.Encode("multiply"); - private static readonly System.Text.Json.JsonEncodedText MemberSum = System.Text.Json.JsonEncodedText.Encode("sum"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAvg)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Avg; - } - - if (reader.ValueTextEquals(MemberFirst)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.First; - } - - if (reader.ValueTextEquals(MemberMax)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Max; - } - - if (reader.ValueTextEquals(MemberMin)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Min; - } - - if (reader.ValueTextEquals(MemberMultiply)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Multiply; - } - - if (reader.ValueTextEquals(MemberSum)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Sum; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAvg.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Avg; - } - - if (string.Equals(value, MemberFirst.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.First; - } - - if (string.Equals(value, MemberMax.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Max; - } - - if (string.Equals(value, MemberMin.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Min; - } - - if (string.Equals(value, MemberMultiply.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Multiply; - } - - if (string.Equals(value, MemberSum.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Sum; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Avg: - writer.WriteStringValue(MemberAvg); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.First: - writer.WriteStringValue(MemberFirst); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Max: - writer.WriteStringValue(MemberMax); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Min: - writer.WriteStringValue(MemberMin); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Multiply: - writer.WriteStringValue(MemberMultiply); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Sum: - writer.WriteStringValue(MemberSum); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class GeoExecutionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberIndexed = System.Text.Json.JsonEncodedText.Encode("indexed"); - private static readonly System.Text.Json.JsonEncodedText MemberMemory = System.Text.Json.JsonEncodedText.Encode("memory"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberIndexed)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution.Indexed; - } - - if (reader.ValueTextEquals(MemberMemory)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution.Memory; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberIndexed.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution.Indexed; - } - - if (string.Equals(value, MemberMemory.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution.Memory; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution.Indexed: - writer.WriteStringValue(MemberIndexed); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution.Memory: - writer.WriteStringValue(MemberMemory); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class GeoValidationMethodConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); - private static readonly System.Text.Json.JsonEncodedText MemberIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); - private static readonly System.Text.Json.JsonEncodedText MemberStrict = System.Text.Json.JsonEncodedText.Encode("strict"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCoerce)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod.Coerce; - } - - if (reader.ValueTextEquals(MemberIgnoreMalformed)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod.IgnoreMalformed; - } - - if (reader.ValueTextEquals(MemberStrict)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod.Strict; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCoerce.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod.Coerce; - } - - if (string.Equals(value, MemberIgnoreMalformed.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod.IgnoreMalformed; - } - - if (string.Equals(value, MemberStrict.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod.Strict; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod.Coerce: - writer.WriteStringValue(MemberCoerce); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod.IgnoreMalformed: - writer.WriteStringValue(MemberIgnoreMalformed); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod.Strict: - writer.WriteStringValue(MemberStrict); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ChildScoreModeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAvg = System.Text.Json.JsonEncodedText.Encode("avg"); - private static readonly System.Text.Json.JsonEncodedText MemberMax = System.Text.Json.JsonEncodedText.Encode("max"); - private static readonly System.Text.Json.JsonEncodedText MemberMin = System.Text.Json.JsonEncodedText.Encode("min"); - private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); - private static readonly System.Text.Json.JsonEncodedText MemberSum = System.Text.Json.JsonEncodedText.Encode("sum"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAvg)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.Avg; - } - - if (reader.ValueTextEquals(MemberMax)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.Max; - } - - if (reader.ValueTextEquals(MemberMin)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.Min; - } - - if (reader.ValueTextEquals(MemberNone)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.None; - } - - if (reader.ValueTextEquals(MemberSum)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.Sum; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAvg.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.Avg; - } - - if (string.Equals(value, MemberMax.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.Max; - } - - if (string.Equals(value, MemberMin.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.Min; - } - - if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.None; - } - - if (string.Equals(value, MemberSum.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.Sum; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.Avg: - writer.WriteStringValue(MemberAvg); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.Max: - writer.WriteStringValue(MemberMax); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.Min: - writer.WriteStringValue(MemberMin); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.None: - writer.WriteStringValue(MemberNone); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.Sum: - writer.WriteStringValue(MemberSum); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TextQueryTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberBestFields = System.Text.Json.JsonEncodedText.Encode("best_fields"); - private static readonly System.Text.Json.JsonEncodedText MemberBoolPrefix = System.Text.Json.JsonEncodedText.Encode("bool_prefix"); - private static readonly System.Text.Json.JsonEncodedText MemberCrossFields = System.Text.Json.JsonEncodedText.Encode("cross_fields"); - private static readonly System.Text.Json.JsonEncodedText MemberMostFields = System.Text.Json.JsonEncodedText.Encode("most_fields"); - private static readonly System.Text.Json.JsonEncodedText MemberPhrase = System.Text.Json.JsonEncodedText.Encode("phrase"); - private static readonly System.Text.Json.JsonEncodedText MemberPhrasePrefix = System.Text.Json.JsonEncodedText.Encode("phrase_prefix"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberBestFields)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.BestFields; - } - - if (reader.ValueTextEquals(MemberBoolPrefix)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.BoolPrefix; - } - - if (reader.ValueTextEquals(MemberCrossFields)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.CrossFields; - } - - if (reader.ValueTextEquals(MemberMostFields)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.MostFields; - } - - if (reader.ValueTextEquals(MemberPhrase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.Phrase; - } - - if (reader.ValueTextEquals(MemberPhrasePrefix)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.PhrasePrefix; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberBestFields.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.BestFields; - } - - if (string.Equals(value, MemberBoolPrefix.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.BoolPrefix; - } - - if (string.Equals(value, MemberCrossFields.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.CrossFields; - } - - if (string.Equals(value, MemberMostFields.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.MostFields; - } - - if (string.Equals(value, MemberPhrase.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.Phrase; - } - - if (string.Equals(value, MemberPhrasePrefix.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.PhrasePrefix; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.BestFields: - writer.WriteStringValue(MemberBestFields); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.BoolPrefix: - writer.WriteStringValue(MemberBoolPrefix); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.CrossFields: - writer.WriteStringValue(MemberCrossFields); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.MostFields: - writer.WriteStringValue(MemberMostFields); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.Phrase: - writer.WriteStringValue(MemberPhrase); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.PhrasePrefix: - writer.WriteStringValue(MemberPhrasePrefix); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class SimpleQueryStringFlagsConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - { - var s = reader.GetString(); - if (string.IsNullOrEmpty(s)) - { - return default; - } - - var flags = s.Split('|'); - var result = default(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags); - foreach (var flag in flags) - { - result |= flag switch - { - "ALL" => Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.All, - "AND" => Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.And, - "ESCAPE" => Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Escape, - "FUZZY" => Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Fuzzy, - "NEAR" => Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Near, - "NONE" => Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.None, - "NOT" => Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Not, - "OR" => Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Or, - "PHRASE" => Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Phrase, - "PRECEDENCE" => Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Precedence, - "PREFIX" => Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Prefix, - "SLOP" => Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Slop, - "WHITESPACE" => Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Whitespace, - _ => throw new System.Text.Json.JsonException($"Invalid flag value '{flag}' for type '{typeToConvert.Name}'.") - }; - } - - return result; - } - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags value, System.Text.Json.JsonSerializerOptions options) - { - { - if (value == default) - { - writer.WriteStringValue(string.Empty); - return; - } - - var sb = new System.Text.StringBuilder(); - if (value.HasFlag(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.All)) - sb.Append("ALL|"); - if (value.HasFlag(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.And)) - sb.Append("AND|"); - if (value.HasFlag(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Escape)) - sb.Append("ESCAPE|"); - if (value.HasFlag(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Fuzzy)) - sb.Append("FUZZY|"); - if (value.HasFlag(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Near)) - sb.Append("NEAR|"); - if (value.HasFlag(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.None)) - sb.Append("NONE|"); - if (value.HasFlag(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Not)) - sb.Append("NOT|"); - if (value.HasFlag(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Or)) - sb.Append("OR|"); - if (value.HasFlag(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Phrase)) - sb.Append("PHRASE|"); - if (value.HasFlag(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Precedence)) - sb.Append("PRECEDENCE|"); - if (value.HasFlag(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Prefix)) - sb.Append("PREFIX|"); - if (value.HasFlag(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Slop)) - sb.Append("SLOP|"); - if (value.HasFlag(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Whitespace)) - sb.Append("WHITESPACE|"); - if (sb.Length == 0) - { - writer.WriteStringValue(string.Empty); - return; - } - - sb.Remove(sb.Length - 1, 1); - writer.WriteStringValue(sb.ToString()); - } - } -} - -internal sealed partial class RangeRelationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberContains = System.Text.Json.JsonEncodedText.Encode("contains"); - private static readonly System.Text.Json.JsonEncodedText MemberIntersects = System.Text.Json.JsonEncodedText.Encode("intersects"); - private static readonly System.Text.Json.JsonEncodedText MemberWithin = System.Text.Json.JsonEncodedText.Encode("within"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberContains)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation.Contains; - } - - if (reader.ValueTextEquals(MemberIntersects)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation.Intersects; - } - - if (reader.ValueTextEquals(MemberWithin)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation.Within; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberContains.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation.Contains; - } - - if (string.Equals(value, MemberIntersects.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation.Intersects; - } - - if (string.Equals(value, MemberWithin.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation.Within; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation.Contains: - writer.WriteStringValue(MemberContains); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation.Intersects: - writer.WriteStringValue(MemberIntersects); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation.Within: - writer.WriteStringValue(MemberWithin); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class FieldValueFactorModifierConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberLn = System.Text.Json.JsonEncodedText.Encode("ln"); - private static readonly System.Text.Json.JsonEncodedText MemberLn1p = System.Text.Json.JsonEncodedText.Encode("ln1p"); - private static readonly System.Text.Json.JsonEncodedText MemberLn2p = System.Text.Json.JsonEncodedText.Encode("ln2p"); - private static readonly System.Text.Json.JsonEncodedText MemberLog = System.Text.Json.JsonEncodedText.Encode("log"); - private static readonly System.Text.Json.JsonEncodedText MemberLog1p = System.Text.Json.JsonEncodedText.Encode("log1p"); - private static readonly System.Text.Json.JsonEncodedText MemberLog2p = System.Text.Json.JsonEncodedText.Encode("log2p"); - private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); - private static readonly System.Text.Json.JsonEncodedText MemberReciprocal = System.Text.Json.JsonEncodedText.Encode("reciprocal"); - private static readonly System.Text.Json.JsonEncodedText MemberSqrt = System.Text.Json.JsonEncodedText.Encode("sqrt"); - private static readonly System.Text.Json.JsonEncodedText MemberSquare = System.Text.Json.JsonEncodedText.Encode("square"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberLn)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Ln; - } - - if (reader.ValueTextEquals(MemberLn1p)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Ln1p; - } - - if (reader.ValueTextEquals(MemberLn2p)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Ln2p; - } - - if (reader.ValueTextEquals(MemberLog)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Log; - } - - if (reader.ValueTextEquals(MemberLog1p)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Log1p; - } - - if (reader.ValueTextEquals(MemberLog2p)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Log2p; - } - - if (reader.ValueTextEquals(MemberNone)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.None; - } - - if (reader.ValueTextEquals(MemberReciprocal)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Reciprocal; - } - - if (reader.ValueTextEquals(MemberSqrt)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Sqrt; - } - - if (reader.ValueTextEquals(MemberSquare)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Square; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberLn.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Ln; - } - - if (string.Equals(value, MemberLn1p.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Ln1p; - } - - if (string.Equals(value, MemberLn2p.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Ln2p; - } - - if (string.Equals(value, MemberLog.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Log; - } - - if (string.Equals(value, MemberLog1p.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Log1p; - } - - if (string.Equals(value, MemberLog2p.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Log2p; - } - - if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.None; - } - - if (string.Equals(value, MemberReciprocal.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Reciprocal; - } - - if (string.Equals(value, MemberSqrt.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Sqrt; - } - - if (string.Equals(value, MemberSquare.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Square; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Ln: - writer.WriteStringValue(MemberLn); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Ln1p: - writer.WriteStringValue(MemberLn1p); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Ln2p: - writer.WriteStringValue(MemberLn2p); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Log: - writer.WriteStringValue(MemberLog); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Log1p: - writer.WriteStringValue(MemberLog1p); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Log2p: - writer.WriteStringValue(MemberLog2p); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.None: - writer.WriteStringValue(MemberNone); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Reciprocal: - writer.WriteStringValue(MemberReciprocal); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Sqrt: - writer.WriteStringValue(MemberSqrt); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Square: - writer.WriteStringValue(MemberSquare); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class MultiValueModeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAvg = System.Text.Json.JsonEncodedText.Encode("avg"); - private static readonly System.Text.Json.JsonEncodedText MemberMax = System.Text.Json.JsonEncodedText.Encode("max"); - private static readonly System.Text.Json.JsonEncodedText MemberMin = System.Text.Json.JsonEncodedText.Encode("min"); - private static readonly System.Text.Json.JsonEncodedText MemberSum = System.Text.Json.JsonEncodedText.Encode("sum"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAvg)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode.Avg; - } - - if (reader.ValueTextEquals(MemberMax)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode.Max; - } - - if (reader.ValueTextEquals(MemberMin)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode.Min; - } - - if (reader.ValueTextEquals(MemberSum)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode.Sum; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAvg.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode.Avg; - } - - if (string.Equals(value, MemberMax.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode.Max; - } - - if (string.Equals(value, MemberMin.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode.Min; - } - - if (string.Equals(value, MemberSum.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode.Sum; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode.Avg: - writer.WriteStringValue(MemberAvg); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode.Max: - writer.WriteStringValue(MemberMax); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode.Min: - writer.WriteStringValue(MemberMin); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode.Sum: - writer.WriteStringValue(MemberSum); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.OperatorConverter))] -public enum Operator -{ - [System.Runtime.Serialization.EnumMember(Value = "and")] - And, - [System.Runtime.Serialization.EnumMember(Value = "or")] - Or -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQueryConverter))] -public enum ZeroTermsQuery -{ - /// - /// - /// Returns all documents, similar to a match_all query. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "all")] - All, - /// - /// - /// No documents are returned if the analyzer removes all tokens. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "none")] - None -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperatorConverter))] -public enum CombinedFieldsOperator -{ - [System.Runtime.Serialization.EnumMember(Value = "and")] - And, - [System.Runtime.Serialization.EnumMember(Value = "or")] - Or -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTermsConverter))] -public enum CombinedFieldsZeroTerms -{ - /// - /// - /// Returns all documents, similar to a match_all query. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "all")] - All, - /// - /// - /// No documents are returned if the analyzer removes all tokens. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "none")] - None -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostModeConverter))] -public enum FunctionBoostMode -{ - /// - /// - /// Query score and function score are averaged - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "avg")] - Avg, - /// - /// - /// Max of query score and function score - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "max")] - Max, - /// - /// - /// Min of query score and function score - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "min")] - Min, - /// - /// - /// Query score and function score are multiplied - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "multiply")] - Multiply, - /// - /// - /// Only the function score is used. - /// The query score is ignored. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "replace")] - Replace, - /// - /// - /// Query score and function score are added - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "sum")] - Sum -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreModeConverter))] -public enum FunctionScoreMode -{ - /// - /// - /// Scores are averaged. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "avg")] - Avg, - /// - /// - /// The first function that has a matching filter is applied. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "first")] - First, - /// - /// - /// Maximum score is used. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "max")] - Max, - /// - /// - /// Minimum score is used. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "min")] - Min, - /// - /// - /// Scores are multiplied. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "multiply")] - Multiply, - /// - /// - /// Scores are summed. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "sum")] - Sum -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.GeoExecutionConverter))] -public enum GeoExecution -{ - [System.Runtime.Serialization.EnumMember(Value = "indexed")] - Indexed, - [System.Runtime.Serialization.EnumMember(Value = "memory")] - Memory -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethodConverter))] -public enum GeoValidationMethod -{ - /// - /// - /// Accept geo points with invalid latitude or longitude and additionally try and infer correct coordinates. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "coerce")] - Coerce, - /// - /// - /// Accept geo points with invalid latitude or longitude. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "ignore_malformed")] - IgnoreMalformed, - [System.Runtime.Serialization.EnumMember(Value = "strict")] - Strict -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreModeConverter))] -public enum ChildScoreMode -{ - [System.Runtime.Serialization.EnumMember(Value = "avg")] - Avg, - [System.Runtime.Serialization.EnumMember(Value = "max")] - Max, - [System.Runtime.Serialization.EnumMember(Value = "min")] - Min, - [System.Runtime.Serialization.EnumMember(Value = "none")] - None, - [System.Runtime.Serialization.EnumMember(Value = "sum")] - Sum -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.TextQueryTypeConverter))] -public enum TextQueryType -{ - /// - /// - /// Finds documents that match any field, but uses the _score from the best field. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "best_fields")] - BestFields, - /// - /// - /// Creates a match_bool_prefix query on each field and combines the _score from each field. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "bool_prefix")] - BoolPrefix, - /// - /// - /// Treats fields with the same analyzer as though they were one big field. - /// Looks for each word in any field. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "cross_fields")] - CrossFields, - /// - /// - /// Finds documents that match any field and combines the _score from each field. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "most_fields")] - MostFields, - /// - /// - /// Runs a match_phrase query on each field and uses the _score from the best field. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "phrase")] - Phrase, - /// - /// - /// Runs a match_phrase_prefix query on each field and uses the _score from the best field. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "phrase_prefix")] - PhrasePrefix -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlagsConverter))] -[System.Flags] -public enum SimpleQueryStringFlags -{ - /// - /// - /// Enables all optional operators. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "ALL")] - All = 1 << 0, - /// - /// - /// Enables the + AND operator. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "AND")] - And = 1 << 1, - /// - /// - /// Enables \ as an escape character. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "ESCAPE")] - Escape = 1 << 2, - /// - /// - /// Enables the ~N operator after a word, where N is an integer denoting the allowed edit distance for matching. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "FUZZY")] - Fuzzy = 1 << 3, - /// - /// - /// Enables the ~N operator, after a phrase where N is the maximum number of positions allowed between matching tokens. - /// Synonymous to SLOP. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "NEAR")] - Near = 1 << 4, - /// - /// - /// Disables all operators. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "NONE")] - None = 1 << 5, - /// - /// - /// Enables the - NOT operator. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "NOT")] - Not = 1 << 6, - /// - /// - /// Enables the \| OR operator. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "OR")] - Or = 1 << 7, - /// - /// - /// Enables the " quotes operator used to search for phrases. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "PHRASE")] - Phrase = 1 << 8, - /// - /// - /// Enables the ( and ) operators to control operator precedence. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "PRECEDENCE")] - Precedence = 1 << 9, - /// - /// - /// Enables the * prefix operator. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "PREFIX")] - Prefix = 1 << 10, - /// - /// - /// Enables the ~N operator, after a phrase where N is maximum number of positions allowed between matching tokens. - /// Synonymous to NEAR. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "SLOP")] - Slop = 1 << 11, - /// - /// - /// Enables whitespace as split characters. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "WHITESPACE")] - Whitespace = 1 << 12 -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.RangeRelationConverter))] -public enum RangeRelation -{ - /// - /// - /// Matches documents with a range field value that entirely contains the query’s range. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "contains")] - Contains, - /// - /// - /// Matches documents with a range field value that intersects the query’s range. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "intersects")] - Intersects, - /// - /// - /// Matches documents with a range field value entirely within the query’s range. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "within")] - Within -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifierConverter))] -public enum FieldValueFactorModifier -{ - /// - /// - /// Take the natural logarithm of the field value. - /// Because this function will return a negative value and cause an error if used on values between 0 and 1, it is recommended to use ln1p instead. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "ln")] - Ln, - /// - /// - /// Add 1 to the field value and take the natural logarithm. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "ln1p")] - Ln1p, - /// - /// - /// Add 2 to the field value and take the natural logarithm. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "ln2p")] - Ln2p, - /// - /// - /// Take the common logarithm of the field value. - /// Because this function will return a negative value and cause an error if used on values between 0 and 1, it is recommended to use log1p instead. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "log")] - Log, - /// - /// - /// Add 1 to the field value and take the common logarithm. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "log1p")] - Log1p, - /// - /// - /// Add 2 to the field value and take the common logarithm. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "log2p")] - Log2p, - /// - /// - /// Do not apply any multiplier to the field value. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "none")] - None, - /// - /// - /// Reciprocate the field value, same as 1/x where x is the field’s value. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "reciprocal")] - Reciprocal, - /// - /// - /// Take the square root of the field value. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "sqrt")] - Sqrt, - /// - /// - /// Square the field value (multiply it by itself). - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "square")] - Square -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.MultiValueModeConverter))] -public enum MultiValueMode -{ - /// - /// - /// Distance is the average distance. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "avg")] - Avg, - /// - /// - /// Distance is the maximum distance. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "max")] - Max, - /// - /// - /// Distance is the minimum distance. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "min")] - Min, - /// - /// - /// Distance is the sum of all distances. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "sum")] - Sum -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Security.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Security.g.cs deleted file mode 100644 index 690330fffce..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Security.g.cs +++ /dev/null @@ -1,686 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using System; -using System.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.Security; - -internal sealed partial class AccessTokenGrantTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberKerberos = System.Text.Json.JsonEncodedText.Encode("_kerberos"); - private static readonly System.Text.Json.JsonEncodedText MemberClientCredentials = System.Text.Json.JsonEncodedText.Encode("client_credentials"); - private static readonly System.Text.Json.JsonEncodedText MemberPassword = System.Text.Json.JsonEncodedText.Encode("password"); - private static readonly System.Text.Json.JsonEncodedText MemberRefreshToken = System.Text.Json.JsonEncodedText.Encode("refresh_token"); - - public override Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberKerberos)) - { - return Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType.Kerberos; - } - - if (reader.ValueTextEquals(MemberClientCredentials)) - { - return Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType.ClientCredentials; - } - - if (reader.ValueTextEquals(MemberPassword)) - { - return Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType.Password; - } - - if (reader.ValueTextEquals(MemberRefreshToken)) - { - return Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType.RefreshToken; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberKerberos.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType.Kerberos; - } - - if (string.Equals(value, MemberClientCredentials.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType.ClientCredentials; - } - - if (string.Equals(value, MemberPassword.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType.Password; - } - - if (string.Equals(value, MemberRefreshToken.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType.RefreshToken; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType.Kerberos: - writer.WriteStringValue(MemberKerberos); - break; - case Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType.ClientCredentials: - writer.WriteStringValue(MemberClientCredentials); - break; - case Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType.Password: - writer.WriteStringValue(MemberPassword); - break; - case Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType.RefreshToken: - writer.WriteStringValue(MemberRefreshToken); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ApiKeyGrantTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAccessToken = System.Text.Json.JsonEncodedText.Encode("access_token"); - private static readonly System.Text.Json.JsonEncodedText MemberPassword = System.Text.Json.JsonEncodedText.Encode("password"); - - public override Elastic.Clients.Elasticsearch.Security.ApiKeyGrantType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAccessToken)) - { - return Elastic.Clients.Elasticsearch.Security.ApiKeyGrantType.AccessToken; - } - - if (reader.ValueTextEquals(MemberPassword)) - { - return Elastic.Clients.Elasticsearch.Security.ApiKeyGrantType.Password; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAccessToken.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Security.ApiKeyGrantType.AccessToken; - } - - if (string.Equals(value, MemberPassword.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Security.ApiKeyGrantType.Password; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Security.ApiKeyGrantType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ApiKeyGrantType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Security.ApiKeyGrantType.AccessToken: - writer.WriteStringValue(MemberAccessToken); - break; - case Elastic.Clients.Elasticsearch.Security.ApiKeyGrantType.Password: - writer.WriteStringValue(MemberPassword); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Security.ApiKeyGrantType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Security.ApiKeyGrantType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ApiKeyGrantType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class GrantTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAccessToken = System.Text.Json.JsonEncodedText.Encode("access_token"); - private static readonly System.Text.Json.JsonEncodedText MemberPassword = System.Text.Json.JsonEncodedText.Encode("password"); - - public override Elastic.Clients.Elasticsearch.Security.GrantType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAccessToken)) - { - return Elastic.Clients.Elasticsearch.Security.GrantType.AccessToken; - } - - if (reader.ValueTextEquals(MemberPassword)) - { - return Elastic.Clients.Elasticsearch.Security.GrantType.Password; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAccessToken.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Security.GrantType.AccessToken; - } - - if (string.Equals(value, MemberPassword.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Security.GrantType.Password; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Security.GrantType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GrantType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Security.GrantType.AccessToken: - writer.WriteStringValue(MemberAccessToken); - break; - case Elastic.Clients.Elasticsearch.Security.GrantType.Password: - writer.WriteStringValue(MemberPassword); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Security.GrantType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Security.GrantType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GrantType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ClusterPrivilegeConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.ClusterPrivilege Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Security.ClusterPrivilege(reader.ReadValue(options, null)); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ClusterPrivilege value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Value, null); - } -} - -internal sealed partial class IndexPrivilegeConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.IndexPrivilege Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Security.IndexPrivilege(reader.ReadValue(options, null)); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.IndexPrivilege value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Value, null); - } -} - -internal sealed partial class RemoteClusterPrivilegeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberMonitorEnrich = System.Text.Json.JsonEncodedText.Encode("monitor_enrich"); - private static readonly System.Text.Json.JsonEncodedText MemberMonitorStats = System.Text.Json.JsonEncodedText.Encode("monitor_stats"); - - public override Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivilege Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberMonitorEnrich)) - { - return Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivilege.MonitorEnrich; - } - - if (reader.ValueTextEquals(MemberMonitorStats)) - { - return Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivilege.MonitorStats; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberMonitorEnrich.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivilege.MonitorEnrich; - } - - if (string.Equals(value, MemberMonitorStats.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivilege.MonitorStats; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivilege)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivilege value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivilege.MonitorEnrich: - writer.WriteStringValue(MemberMonitorEnrich); - break; - case Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivilege.MonitorStats: - writer.WriteStringValue(MemberMonitorStats); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivilege)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivilege ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivilege value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class TemplateFormatConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberJson = System.Text.Json.JsonEncodedText.Encode("json"); - private static readonly System.Text.Json.JsonEncodedText MemberString = System.Text.Json.JsonEncodedText.Encode("string"); - - public override Elastic.Clients.Elasticsearch.Security.TemplateFormat Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberJson)) - { - return Elastic.Clients.Elasticsearch.Security.TemplateFormat.Json; - } - - if (reader.ValueTextEquals(MemberString)) - { - return Elastic.Clients.Elasticsearch.Security.TemplateFormat.String; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberJson.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Security.TemplateFormat.Json; - } - - if (string.Equals(value, MemberString.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Security.TemplateFormat.String; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Security.TemplateFormat)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.TemplateFormat value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Security.TemplateFormat.Json: - writer.WriteStringValue(MemberJson); - break; - case Elastic.Clients.Elasticsearch.Security.TemplateFormat.String: - writer.WriteStringValue(MemberString); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Security.TemplateFormat)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Security.TemplateFormat ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.TemplateFormat value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class RestrictionWorkflowConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Security.RestrictionWorkflow Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Security.RestrictionWorkflow(reader.ReadValue(options, null)); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RestrictionWorkflow value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.Value, null); - } -} - -internal sealed partial class ApiKeyTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberCrossCluster = System.Text.Json.JsonEncodedText.Encode("cross_cluster"); - private static readonly System.Text.Json.JsonEncodedText MemberRest = System.Text.Json.JsonEncodedText.Encode("rest"); - - public override Elastic.Clients.Elasticsearch.Security.ApiKeyType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberCrossCluster)) - { - return Elastic.Clients.Elasticsearch.Security.ApiKeyType.CrossCluster; - } - - if (reader.ValueTextEquals(MemberRest)) - { - return Elastic.Clients.Elasticsearch.Security.ApiKeyType.Rest; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberCrossCluster.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Security.ApiKeyType.CrossCluster; - } - - if (string.Equals(value, MemberRest.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Security.ApiKeyType.Rest; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Security.ApiKeyType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ApiKeyType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Security.ApiKeyType.CrossCluster: - writer.WriteStringValue(MemberCrossCluster); - break; - case Elastic.Clients.Elasticsearch.Security.ApiKeyType.Rest: - writer.WriteStringValue(MemberRest); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Security.ApiKeyType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Security.ApiKeyType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ApiKeyType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.AccessTokenGrantTypeConverter))] -public enum AccessTokenGrantType -{ - /// - /// - /// This grant type is supported internally and implements SPNEGO based Kerberos support. - /// The _kerberos grant type may change from version to version. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "_kerberos")] - Kerberos, - /// - /// - /// This grant type implements the Client Credentials Grant of OAuth2. - /// It is geared for machine to machine communication and is not suitable or designed for the self-service user creation of tokens. - /// It generates only access tokens that cannot be refreshed. - /// The premise is that the entity that uses client_credentials has constant access to a set of (client, not end-user) credentials and can authenticate itself at will. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "client_credentials")] - ClientCredentials, - /// - /// - /// This grant type implements the Resource Owner Password Credentials Grant of OAuth2. - /// In this grant, a trusted client exchanges the end user's credentials for an access token and (possibly) a refresh token. - /// The request needs to be made by an authenticated user but happens on behalf of another authenticated user (the one whose credentials are passed as request parameters). - /// This grant type is not suitable or designed for the self-service user creation of tokens. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "password")] - Password, - /// - /// - /// This grant type implements the Refresh Token Grant of OAuth2. - /// In this grant a user exchanges a previously issued refresh token for a new access token and a new refresh token. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "refresh_token")] - RefreshToken -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ApiKeyGrantTypeConverter))] -public enum ApiKeyGrantType -{ - [System.Runtime.Serialization.EnumMember(Value = "access_token")] - AccessToken, - [System.Runtime.Serialization.EnumMember(Value = "password")] - Password -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GrantTypeConverter))] -public enum GrantType -{ - /// - /// - /// In this type of grant, you must supply an access token that was created by the Elasticsearch token service. - /// If you are activating a user profile, you can alternatively supply a JWT (either a JWT access_token or a JWT id_token). - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "access_token")] - AccessToken, - /// - /// - /// In this type of grant, you must supply the user ID and password for which you want to create the API key. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "password")] - Password -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ClusterPrivilegeConverter))] -public readonly partial struct ClusterPrivilege : Elastic.Clients.Elasticsearch.Serialization.IEnumStruct -{ - public ClusterPrivilege(string value) => Value = value; -#if NET7_0_OR_GREATER - static ClusterPrivilege IEnumStruct.Create(string value) => value; -#else - ClusterPrivilege IEnumStruct.Create(string value) => value; -#endif - public readonly string Value { get; } - public static ClusterPrivilege All { get; } = new ClusterPrivilege("all"); - public static ClusterPrivilege CancelTask { get; } = new ClusterPrivilege("cancel_task"); - public static ClusterPrivilege CreateSnapshot { get; } = new ClusterPrivilege("create_snapshot"); - public static ClusterPrivilege CrossClusterReplication { get; } = new ClusterPrivilege("cross_cluster_replication"); - public static ClusterPrivilege CrossClusterSearch { get; } = new ClusterPrivilege("cross_cluster_search"); - public static ClusterPrivilege DelegatePki { get; } = new ClusterPrivilege("delegate_pki"); - public static ClusterPrivilege GrantApiKey { get; } = new ClusterPrivilege("grant_api_key"); - public static ClusterPrivilege Manage { get; } = new ClusterPrivilege("manage"); - public static ClusterPrivilege ManageApiKey { get; } = new ClusterPrivilege("manage_api_key"); - public static ClusterPrivilege ManageAutoscaling { get; } = new ClusterPrivilege("manage_autoscaling"); - public static ClusterPrivilege ManageBehavioralAnalytics { get; } = new ClusterPrivilege("manage_behavioral_analytics"); - public static ClusterPrivilege ManageCcr { get; } = new ClusterPrivilege("manage_ccr"); - public static ClusterPrivilege ManageDataFrameTransforms { get; } = new ClusterPrivilege("manage_data_frame_transforms"); - public static ClusterPrivilege ManageDataStreamGlobalRetention { get; } = new ClusterPrivilege("manage_data_stream_global_retention"); - public static ClusterPrivilege ManageEnrich { get; } = new ClusterPrivilege("manage_enrich"); - public static ClusterPrivilege ManageEsql { get; } = new ClusterPrivilege("manage_esql"); - public static ClusterPrivilege ManageIlm { get; } = new ClusterPrivilege("manage_ilm"); - public static ClusterPrivilege ManageIndexTemplates { get; } = new ClusterPrivilege("manage_index_templates"); - public static ClusterPrivilege ManageInference { get; } = new ClusterPrivilege("manage_inference"); - public static ClusterPrivilege ManageIngestPipelines { get; } = new ClusterPrivilege("manage_ingest_pipelines"); - public static ClusterPrivilege ManageLogstashPipelines { get; } = new ClusterPrivilege("manage_logstash_pipelines"); - public static ClusterPrivilege ManageMl { get; } = new ClusterPrivilege("manage_ml"); - public static ClusterPrivilege ManageOidc { get; } = new ClusterPrivilege("manage_oidc"); - public static ClusterPrivilege ManageOwnApiKey { get; } = new ClusterPrivilege("manage_own_api_key"); - public static ClusterPrivilege ManagePipeline { get; } = new ClusterPrivilege("manage_pipeline"); - public static ClusterPrivilege ManageRollup { get; } = new ClusterPrivilege("manage_rollup"); - public static ClusterPrivilege ManageSaml { get; } = new ClusterPrivilege("manage_saml"); - public static ClusterPrivilege ManageSearchApplication { get; } = new ClusterPrivilege("manage_search_application"); - public static ClusterPrivilege ManageSearchQueryRules { get; } = new ClusterPrivilege("manage_search_query_rules"); - public static ClusterPrivilege ManageSearchSynonyms { get; } = new ClusterPrivilege("manage_search_synonyms"); - public static ClusterPrivilege ManageSecurity { get; } = new ClusterPrivilege("manage_security"); - public static ClusterPrivilege ManageServiceAccount { get; } = new ClusterPrivilege("manage_service_account"); - public static ClusterPrivilege ManageSlm { get; } = new ClusterPrivilege("manage_slm"); - public static ClusterPrivilege ManageToken { get; } = new ClusterPrivilege("manage_token"); - public static ClusterPrivilege ManageTransform { get; } = new ClusterPrivilege("manage_transform"); - public static ClusterPrivilege ManageUserProfile { get; } = new ClusterPrivilege("manage_user_profile"); - public static ClusterPrivilege ManageWatcher { get; } = new ClusterPrivilege("manage_watcher"); - public static ClusterPrivilege Monitor { get; } = new ClusterPrivilege("monitor"); - public static ClusterPrivilege MonitorDataFrameTransforms { get; } = new ClusterPrivilege("monitor_data_frame_transforms"); - public static ClusterPrivilege MonitorDataStreamGlobalRetention { get; } = new ClusterPrivilege("monitor_data_stream_global_retention"); - public static ClusterPrivilege MonitorEnrich { get; } = new ClusterPrivilege("monitor_enrich"); - public static ClusterPrivilege MonitorEsql { get; } = new ClusterPrivilege("monitor_esql"); - public static ClusterPrivilege MonitorInference { get; } = new ClusterPrivilege("monitor_inference"); - public static ClusterPrivilege MonitorMl { get; } = new ClusterPrivilege("monitor_ml"); - public static ClusterPrivilege MonitorRollup { get; } = new ClusterPrivilege("monitor_rollup"); - public static ClusterPrivilege MonitorSnapshot { get; } = new ClusterPrivilege("monitor_snapshot"); - public static ClusterPrivilege MonitorStats { get; } = new ClusterPrivilege("monitor_stats"); - public static ClusterPrivilege MonitorTextStructure { get; } = new ClusterPrivilege("monitor_text_structure"); - public static ClusterPrivilege MonitorTransform { get; } = new ClusterPrivilege("monitor_transform"); - public static ClusterPrivilege MonitorWatcher { get; } = new ClusterPrivilege("monitor_watcher"); - public static ClusterPrivilege None { get; } = new ClusterPrivilege("none"); - public static ClusterPrivilege PostBehavioralAnalyticsEvent { get; } = new ClusterPrivilege("post_behavioral_analytics_event"); - public static ClusterPrivilege ReadCcr { get; } = new ClusterPrivilege("read_ccr"); - public static ClusterPrivilege ReadFleetSecrets { get; } = new ClusterPrivilege("read_fleet_secrets"); - public static ClusterPrivilege ReadIlm { get; } = new ClusterPrivilege("read_ilm"); - public static ClusterPrivilege ReadPipeline { get; } = new ClusterPrivilege("read_pipeline"); - public static ClusterPrivilege ReadSecurity { get; } = new ClusterPrivilege("read_security"); - public static ClusterPrivilege ReadSlm { get; } = new ClusterPrivilege("read_slm"); - public static ClusterPrivilege TransportClient { get; } = new ClusterPrivilege("transport_client"); - public static ClusterPrivilege WriteConnectorSecrets { get; } = new ClusterPrivilege("write_connector_secrets"); - public static ClusterPrivilege WriteFleetSecrets { get; } = new ClusterPrivilege("write_fleet_secrets"); - - public override string ToString() => Value ?? string.Empty; - - public static implicit operator string(ClusterPrivilege @enum) => @enum.Value; - public static implicit operator ClusterPrivilege(string value) => new(value); - - public override int GetHashCode() => Value.GetHashCode(); - public override bool Equals(object obj) => obj is ClusterPrivilege other && this.Equals(other); - public bool Equals(ClusterPrivilege other) => Value == other.Value; - - public static bool operator ==(ClusterPrivilege a, ClusterPrivilege b) => a.Equals(b); - public static bool operator !=(ClusterPrivilege a, ClusterPrivilege b) => !(a == b); -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.IndexPrivilegeConverter))] -public readonly partial struct IndexPrivilege : Elastic.Clients.Elasticsearch.Serialization.IEnumStruct -{ - public IndexPrivilege(string value) => Value = value; -#if NET7_0_OR_GREATER - static IndexPrivilege IEnumStruct.Create(string value) => value; -#else - IndexPrivilege IEnumStruct.Create(string value) => value; -#endif - public readonly string Value { get; } - public static IndexPrivilege All { get; } = new IndexPrivilege("all"); - public static IndexPrivilege AutoConfigure { get; } = new IndexPrivilege("auto_configure"); - public static IndexPrivilege Create { get; } = new IndexPrivilege("create"); - public static IndexPrivilege CreateDoc { get; } = new IndexPrivilege("create_doc"); - public static IndexPrivilege CreateIndex { get; } = new IndexPrivilege("create_index"); - public static IndexPrivilege CrossClusterReplication { get; } = new IndexPrivilege("cross_cluster_replication"); - public static IndexPrivilege CrossClusterReplicationInternal { get; } = new IndexPrivilege("cross_cluster_replication_internal"); - public static IndexPrivilege Delete { get; } = new IndexPrivilege("delete"); - public static IndexPrivilege DeleteIndex { get; } = new IndexPrivilege("delete_index"); - public static IndexPrivilege Index { get; } = new IndexPrivilege("index"); - public static IndexPrivilege Maintenance { get; } = new IndexPrivilege("maintenance"); - public static IndexPrivilege Manage { get; } = new IndexPrivilege("manage"); - public static IndexPrivilege ManageDataStreamLifecycle { get; } = new IndexPrivilege("manage_data_stream_lifecycle"); - public static IndexPrivilege ManageFollowIndex { get; } = new IndexPrivilege("manage_follow_index"); - public static IndexPrivilege ManageIlm { get; } = new IndexPrivilege("manage_ilm"); - public static IndexPrivilege ManageLeaderIndex { get; } = new IndexPrivilege("manage_leader_index"); - public static IndexPrivilege Monitor { get; } = new IndexPrivilege("monitor"); - public static IndexPrivilege None { get; } = new IndexPrivilege("none"); - public static IndexPrivilege Read { get; } = new IndexPrivilege("read"); - public static IndexPrivilege ReadCrossCluster { get; } = new IndexPrivilege("read_cross_cluster"); - public static IndexPrivilege ViewIndexMetadata { get; } = new IndexPrivilege("view_index_metadata"); - public static IndexPrivilege Write { get; } = new IndexPrivilege("write"); - - public override string ToString() => Value ?? string.Empty; - - public static implicit operator string(IndexPrivilege @enum) => @enum.Value; - public static implicit operator IndexPrivilege(string value) => new(value); - - public override int GetHashCode() => Value.GetHashCode(); - public override bool Equals(object obj) => obj is IndexPrivilege other && this.Equals(other); - public bool Equals(IndexPrivilege other) => Value == other.Value; - - public static bool operator ==(IndexPrivilege a, IndexPrivilege b) => a.Equals(b); - public static bool operator !=(IndexPrivilege a, IndexPrivilege b) => !(a == b); -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivilegeConverter))] -public enum RemoteClusterPrivilege -{ - [System.Runtime.Serialization.EnumMember(Value = "monitor_enrich")] - MonitorEnrich, - [System.Runtime.Serialization.EnumMember(Value = "monitor_stats")] - MonitorStats -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.TemplateFormatConverter))] -public enum TemplateFormat -{ - [System.Runtime.Serialization.EnumMember(Value = "json")] - Json, - [System.Runtime.Serialization.EnumMember(Value = "string")] - String -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.RestrictionWorkflowConverter))] -public readonly partial struct RestrictionWorkflow : Elastic.Clients.Elasticsearch.Serialization.IEnumStruct -{ - public RestrictionWorkflow(string value) => Value = value; -#if NET7_0_OR_GREATER - static RestrictionWorkflow IEnumStruct.Create(string value) => value; -#else - RestrictionWorkflow IEnumStruct.Create(string value) => value; -#endif - public readonly string Value { get; } - public static RestrictionWorkflow SearchApplicationQuery { get; } = new RestrictionWorkflow("search_application_query"); - - public override string ToString() => Value ?? string.Empty; - - public static implicit operator string(RestrictionWorkflow @enum) => @enum.Value; - public static implicit operator RestrictionWorkflow(string value) => new(value); - - public override int GetHashCode() => Value.GetHashCode(); - public override bool Equals(object obj) => obj is RestrictionWorkflow other && this.Equals(other); - public bool Equals(RestrictionWorkflow other) => Value == other.Value; - - public static bool operator ==(RestrictionWorkflow a, RestrictionWorkflow b) => a.Equals(b); - public static bool operator !=(RestrictionWorkflow a, RestrictionWorkflow b) => !(a == b); -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ApiKeyTypeConverter))] -public enum ApiKeyType -{ - [System.Runtime.Serialization.EnumMember(Value = "cross_cluster")] - CrossCluster, - [System.Runtime.Serialization.EnumMember(Value = "rest")] - Rest -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Snapshot.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Snapshot.g.cs deleted file mode 100644 index e463e87bfd0..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Snapshot.g.cs +++ /dev/null @@ -1,448 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using System; -using System.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.Snapshot; - -internal sealed partial class SnapshotSortConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberDuration = System.Text.Json.JsonEncodedText.Encode("duration"); - private static readonly System.Text.Json.JsonEncodedText MemberFailedShardCount = System.Text.Json.JsonEncodedText.Encode("failed_shard_count"); - private static readonly System.Text.Json.JsonEncodedText MemberIndexCount = System.Text.Json.JsonEncodedText.Encode("index_count"); - private static readonly System.Text.Json.JsonEncodedText MemberName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText MemberRepository = System.Text.Json.JsonEncodedText.Encode("repository"); - private static readonly System.Text.Json.JsonEncodedText MemberShardCount = System.Text.Json.JsonEncodedText.Encode("shard_count"); - private static readonly System.Text.Json.JsonEncodedText MemberStartTime = System.Text.Json.JsonEncodedText.Encode("start_time"); - - public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberDuration)) - { - return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.Duration; - } - - if (reader.ValueTextEquals(MemberFailedShardCount)) - { - return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.FailedShardCount; - } - - if (reader.ValueTextEquals(MemberIndexCount)) - { - return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.IndexCount; - } - - if (reader.ValueTextEquals(MemberName)) - { - return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.Name; - } - - if (reader.ValueTextEquals(MemberRepository)) - { - return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.Repository; - } - - if (reader.ValueTextEquals(MemberShardCount)) - { - return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.ShardCount; - } - - if (reader.ValueTextEquals(MemberStartTime)) - { - return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.StartTime; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberDuration.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.Duration; - } - - if (string.Equals(value, MemberFailedShardCount.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.FailedShardCount; - } - - if (string.Equals(value, MemberIndexCount.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.IndexCount; - } - - if (string.Equals(value, MemberName.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.Name; - } - - if (string.Equals(value, MemberRepository.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.Repository; - } - - if (string.Equals(value, MemberShardCount.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.ShardCount; - } - - if (string.Equals(value, MemberStartTime.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.StartTime; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.Duration: - writer.WriteStringValue(MemberDuration); - break; - case Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.FailedShardCount: - writer.WriteStringValue(MemberFailedShardCount); - break; - case Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.IndexCount: - writer.WriteStringValue(MemberIndexCount); - break; - case Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.Name: - writer.WriteStringValue(MemberName); - break; - case Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.Repository: - writer.WriteStringValue(MemberRepository); - break; - case Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.ShardCount: - writer.WriteStringValue(MemberShardCount); - break; - case Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.StartTime: - writer.WriteStringValue(MemberStartTime); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class SnapshotStateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberFailed = System.Text.Json.JsonEncodedText.Encode("FAILED"); - private static readonly System.Text.Json.JsonEncodedText MemberInProgress = System.Text.Json.JsonEncodedText.Encode("IN_PROGRESS"); - private static readonly System.Text.Json.JsonEncodedText MemberIncompatible = System.Text.Json.JsonEncodedText.Encode("INCOMPATIBLE"); - private static readonly System.Text.Json.JsonEncodedText MemberPartial = System.Text.Json.JsonEncodedText.Encode("PARTIAL"); - private static readonly System.Text.Json.JsonEncodedText MemberSuccess = System.Text.Json.JsonEncodedText.Encode("SUCCESS"); - - public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberFailed)) - { - return Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.Failed; - } - - if (reader.ValueTextEquals(MemberInProgress)) - { - return Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.InProgress; - } - - if (reader.ValueTextEquals(MemberIncompatible)) - { - return Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.Incompatible; - } - - if (reader.ValueTextEquals(MemberPartial)) - { - return Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.Partial; - } - - if (reader.ValueTextEquals(MemberSuccess)) - { - return Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.Success; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberFailed.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.Failed; - } - - if (string.Equals(value, MemberInProgress.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.InProgress; - } - - if (string.Equals(value, MemberIncompatible.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.Incompatible; - } - - if (string.Equals(value, MemberPartial.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.Partial; - } - - if (string.Equals(value, MemberSuccess.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.Success; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Snapshot.SnapshotState)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotState value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.Failed: - writer.WriteStringValue(MemberFailed); - break; - case Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.InProgress: - writer.WriteStringValue(MemberInProgress); - break; - case Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.Incompatible: - writer.WriteStringValue(MemberIncompatible); - break; - case Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.Partial: - writer.WriteStringValue(MemberPartial); - break; - case Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.Success: - writer.WriteStringValue(MemberSuccess); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Snapshot.SnapshotState)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotState ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotState value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class ShardsStatsStageConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberDone = System.Text.Json.JsonEncodedText.Encode("DONE"); - private static readonly System.Text.Json.JsonEncodedText MemberFailure = System.Text.Json.JsonEncodedText.Encode("FAILURE"); - private static readonly System.Text.Json.JsonEncodedText MemberFinalize = System.Text.Json.JsonEncodedText.Encode("FINALIZE"); - private static readonly System.Text.Json.JsonEncodedText MemberInit = System.Text.Json.JsonEncodedText.Encode("INIT"); - private static readonly System.Text.Json.JsonEncodedText MemberStarted = System.Text.Json.JsonEncodedText.Encode("STARTED"); - - public override Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberDone)) - { - return Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Done; - } - - if (reader.ValueTextEquals(MemberFailure)) - { - return Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Failure; - } - - if (reader.ValueTextEquals(MemberFinalize)) - { - return Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Finalize; - } - - if (reader.ValueTextEquals(MemberInit)) - { - return Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Init; - } - - if (reader.ValueTextEquals(MemberStarted)) - { - return Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Started; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberDone.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Done; - } - - if (string.Equals(value, MemberFailure.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Failure; - } - - if (string.Equals(value, MemberFinalize.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Finalize; - } - - if (string.Equals(value, MemberInit.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Init; - } - - if (string.Equals(value, MemberStarted.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Started; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Done: - writer.WriteStringValue(MemberDone); - break; - case Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Failure: - writer.WriteStringValue(MemberFailure); - break; - case Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Finalize: - writer.WriteStringValue(MemberFinalize); - break; - case Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Init: - writer.WriteStringValue(MemberInit); - break; - case Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Started: - writer.WriteStringValue(MemberStarted); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.SnapshotSortConverter))] -public enum SnapshotSort -{ - [System.Runtime.Serialization.EnumMember(Value = "duration")] - Duration, - [System.Runtime.Serialization.EnumMember(Value = "failed_shard_count")] - FailedShardCount, - [System.Runtime.Serialization.EnumMember(Value = "index_count")] - IndexCount, - [System.Runtime.Serialization.EnumMember(Value = "name")] - Name, - [System.Runtime.Serialization.EnumMember(Value = "repository")] - Repository, - [System.Runtime.Serialization.EnumMember(Value = "shard_count")] - ShardCount, - [System.Runtime.Serialization.EnumMember(Value = "start_time")] - StartTime -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.SnapshotStateConverter))] -public enum SnapshotState -{ - /// - /// - /// The snapshot failed. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "FAILED")] - Failed, - /// - /// - /// The snapshot process has started. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "IN_PROGRESS")] - InProgress, - /// - /// - /// The snapshot is incompatible with the current version of the cluster. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "INCOMPATIBLE")] - Incompatible, - /// - /// - /// The snapshot was partially successful. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "PARTIAL")] - Partial, - /// - /// - /// The snapshot process completed successfully. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "SUCCESS")] - Success -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStageConverter))] -public enum ShardsStatsStage -{ - /// - /// - /// The number of shards in the snapshot that were successfully stored in the repository. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "DONE")] - Done, - /// - /// - /// The number of shards in the snapshot that were not successfully stored in the repository. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "FAILURE")] - Failure, - /// - /// - /// The number of shards in the snapshot that are in the finalizing stage of being stored in the repository. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "FINALIZE")] - Finalize, - /// - /// - /// The number of shards in the snapshot that are in the initializing stage of being stored in the repository. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "INIT")] - Init, - /// - /// - /// The number of shards in the snapshot that are in the started stage of being stored in the repository. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "STARTED")] - Started -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/EqlHits.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/EqlHits.Converters.g.cs new file mode 100644 index 00000000000..c3d4bc86291 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/EqlHits.Converters.g.cs @@ -0,0 +1,97 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Eql.Json; + +public sealed partial class EqlHitsConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropEvents = System.Text.Json.JsonEncodedText.Encode("events"); + private static readonly System.Text.Json.JsonEncodedText PropSequences = System.Text.Json.JsonEncodedText.Encode("sequences"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Eql.EqlHits Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>?> propEvents = default; + LocalJsonValue>?> propSequences = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEvents.TryReadProperty(ref reader, options, PropEvents, static System.Collections.Generic.IReadOnlyCollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, null))) + { + continue; + } + + if (propSequences.TryReadProperty(ref reader, options, PropSequences, static System.Collections.Generic.IReadOnlyCollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, null))) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Eql.EqlHits(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Events = propEvents.Value, + Sequences = propSequences.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Eql.EqlHits value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEvents, value.Events, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection>? v) => w.WriteCollectionValue>(o, v, null)); + writer.WriteProperty(options, PropSequences, value.Sequences, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection>? v) => w.WriteCollectionValue>(o, v, null)); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} + +public sealed partial class EqlHitsConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(EqlHits<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(EqlHitsConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/EqlHits.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/EqlHits.g.cs index 1344133b90d..3213e29905b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/EqlHits.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/EqlHits.g.cs @@ -23,80 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Eql; -internal sealed partial class EqlHitsConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropEvents = System.Text.Json.JsonEncodedText.Encode("events"); - private static readonly System.Text.Json.JsonEncodedText PropSequences = System.Text.Json.JsonEncodedText.Encode("sequences"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Eql.EqlHits Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>?> propEvents = default; - LocalJsonValue>?> propSequences = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEvents.TryReadProperty(ref reader, options, PropEvents, static System.Collections.Generic.IReadOnlyCollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, null))) - { - continue; - } - - if (propSequences.TryReadProperty(ref reader, options, PropSequences, static System.Collections.Generic.IReadOnlyCollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, null))) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Eql.EqlHits(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Events = propEvents.Value, - Sequences = propSequences.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Eql.EqlHits value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEvents, value.Events, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection>? v) => w.WriteCollectionValue>(o, v, null)); - writer.WriteProperty(options, PropSequences, value.Sequences, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection>? v) => w.WriteCollectionValue>(o, v, null)); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -internal sealed partial class EqlHitsConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(EqlHits<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(EqlHitsConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Eql.EqlHitsConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Eql.Json.EqlHitsConverterFactory))] public sealed partial class EqlHits { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/HitsEvent.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/HitsEvent.Converters.g.cs new file mode 100644 index 00000000000..0a4d31d276c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/HitsEvent.Converters.g.cs @@ -0,0 +1,115 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Eql.Json; + +public sealed partial class HitsEventConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); + + public override Elastic.Clients.Elasticsearch.Eql.HitsEvent Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>?> propFields = default; + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + LocalJsonValue propMissing = default; + LocalJsonValue propSource = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!))) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, static TEvent (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Eql.HitsEvent(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Fields = propFields.Value, + Id = propId.Value, + Index = propIndex.Value, + Missing = propMissing.Value, + Source = propSource.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Eql.HitsEvent value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))))); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropMissing, value.Missing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSource, value.Source, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TEvent v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} + +public sealed partial class HitsEventConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(HitsEvent<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(HitsEventConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/HitsEvent.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/HitsEvent.g.cs index e2d8b014725..6867b56aa0c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/HitsEvent.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/HitsEvent.g.cs @@ -23,98 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Eql; -internal sealed partial class HitsEventConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); - - public override Elastic.Clients.Elasticsearch.Eql.HitsEvent Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>?> propFields = default; - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - LocalJsonValue propMissing = default; - LocalJsonValue propSource = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!))) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, static TEvent (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Eql.HitsEvent(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Fields = propFields.Value, - Id = propId.Value, - Index = propIndex.Value, - Missing = propMissing.Value, - Source = propSource.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Eql.HitsEvent value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))))); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropMissing, value.Missing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSource, value.Source, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, TEvent v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteEndObject(); - } -} - -internal sealed partial class HitsEventConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(HitsEvent<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(HitsEventConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Eql.HitsEventConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Eql.Json.HitsEventConverterFactory))] public sealed partial class HitsEvent { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/HitsSequence.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/HitsSequence.Converters.g.cs new file mode 100644 index 00000000000..207bfe06498 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/HitsSequence.Converters.g.cs @@ -0,0 +1,88 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Eql.Json; + +public sealed partial class HitsSequenceConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropEvents = System.Text.Json.JsonEncodedText.Encode("events"); + private static readonly System.Text.Json.JsonEncodedText PropJoinKeys = System.Text.Json.JsonEncodedText.Encode("join_keys"); + + public override Elastic.Clients.Elasticsearch.Eql.HitsSequence Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>> propEvents = default; + LocalJsonValue?> propJoinKeys = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEvents.TryReadProperty(ref reader, options, PropEvents, static System.Collections.Generic.IReadOnlyCollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, null)!)) + { + continue; + } + + if (propJoinKeys.TryReadProperty(ref reader, options, PropJoinKeys, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Eql.HitsSequence(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Events = propEvents.Value, + JoinKeys = propJoinKeys.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Eql.HitsSequence value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEvents, value.Events, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection> v) => w.WriteCollectionValue>(o, v, null)); + writer.WriteProperty(options, PropJoinKeys, value.JoinKeys, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} + +public sealed partial class HitsSequenceConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(HitsSequence<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(HitsSequenceConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/HitsSequence.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/HitsSequence.g.cs index 392eba64b0a..ae501a0392f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/HitsSequence.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/HitsSequence.g.cs @@ -23,71 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Eql; -internal sealed partial class HitsSequenceConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropEvents = System.Text.Json.JsonEncodedText.Encode("events"); - private static readonly System.Text.Json.JsonEncodedText PropJoinKeys = System.Text.Json.JsonEncodedText.Encode("join_keys"); - - public override Elastic.Clients.Elasticsearch.Eql.HitsSequence Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>> propEvents = default; - LocalJsonValue?> propJoinKeys = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEvents.TryReadProperty(ref reader, options, PropEvents, static System.Collections.Generic.IReadOnlyCollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, null)!)) - { - continue; - } - - if (propJoinKeys.TryReadProperty(ref reader, options, PropJoinKeys, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Eql.HitsSequence(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Events = propEvents.Value, - JoinKeys = propJoinKeys.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Eql.HitsSequence value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEvents, value.Events, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection> v) => w.WriteCollectionValue>(o, v, null)); - writer.WriteProperty(options, PropJoinKeys, value.JoinKeys, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -internal sealed partial class HitsSequenceConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(HitsSequence<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(HitsSequenceConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Eql.HitsSequenceConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Eql.Json.HitsSequenceConverterFactory))] public sealed partial class HitsSequence { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Eql.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/ResultPosition.Converters.g.cs similarity index 82% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Eql.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/ResultPosition.Converters.g.cs index f3eae7798b7..85842dde1cc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Eql.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/ResultPosition.Converters.g.cs @@ -21,9 +21,9 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.Eql; +namespace Elastic.Clients.Elasticsearch.Eql.Json; -internal sealed partial class ResultPositionConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class ResultPositionConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText MemberHead = System.Text.Json.JsonEncodedText.Encode("head"); private static readonly System.Text.Json.JsonEncodedText MemberTail = System.Text.Json.JsonEncodedText.Encode("tail"); @@ -78,23 +78,4 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, { Write(writer, value, options); } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Eql.ResultPositionConverter))] -public enum ResultPosition -{ - /// - /// - /// Return the earliest matches, similar to the Unix head command. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "head")] - Head, - /// - /// - /// Return the most recent matches, similar to the Unix tail command. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "tail")] - Tail } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/ResultPosition.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/ResultPosition.g.cs new file mode 100644 index 00000000000..e99ec78a561 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Eql/ResultPosition.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Eql; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Eql.Json.ResultPositionConverter))] +public enum ResultPosition +{ + /// + /// + /// Return the earliest matches, similar to the Unix head command. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "head")] + Head, + /// + /// + /// Return the most recent matches, similar to the Unix tail command. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "tail")] + Tail +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ErrorCause.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ErrorCause.Converters.g.cs new file mode 100644 index 00000000000..434f57cffd2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ErrorCause.Converters.g.cs @@ -0,0 +1,114 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ErrorCauseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCausedBy = System.Text.Json.JsonEncodedText.Encode("caused_by"); + private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); + private static readonly System.Text.Json.JsonEncodedText PropRootCause = System.Text.Json.JsonEncodedText.Encode("root_cause"); + private static readonly System.Text.Json.JsonEncodedText PropStackTrace = System.Text.Json.JsonEncodedText.Encode("stack_trace"); + private static readonly System.Text.Json.JsonEncodedText PropSuppressed = System.Text.Json.JsonEncodedText.Encode("suppressed"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.ErrorCause Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCausedBy = default; + System.Collections.Generic.Dictionary? propMetadata = default; + LocalJsonValue propReason = default; + LocalJsonValue?> propRootCause = default; + LocalJsonValue propStackTrace = default; + LocalJsonValue?> propSuppressed = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCausedBy.TryReadProperty(ref reader, options, PropCausedBy, null)) + { + continue; + } + + if (propReason.TryReadProperty(ref reader, options, PropReason, null)) + { + continue; + } + + if (propRootCause.TryReadProperty(ref reader, options, PropRootCause, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStackTrace.TryReadProperty(ref reader, options, PropStackTrace, null)) + { + continue; + } + + if (propSuppressed.TryReadProperty(ref reader, options, PropSuppressed, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + propMetadata ??= new System.Collections.Generic.Dictionary(); + reader.ReadProperty(options, out string key, out object value, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!); + propMetadata[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ErrorCause(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CausedBy = propCausedBy.Value, + Metadata = propMetadata, + Reason = propReason.Value, + RootCause = propRootCause.Value, + StackTrace = propStackTrace.Value, + Suppressed = propSuppressed.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ErrorCause value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCausedBy, value.CausedBy, null, null); + writer.WriteProperty(options, PropReason, value.Reason, null, null); + writer.WriteProperty(options, PropRootCause, value.RootCause, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStackTrace, value.StackTrace, null, null); + writer.WriteProperty(options, PropSuppressed, value.Suppressed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropType, value.Type, null, null); + if (value.Metadata is not null) + { + foreach (var item in value.Metadata) + { + writer.WriteProperty(options, item.Key, item.Value, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ErrorCause.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ErrorCause.g.cs index 4f7c35ea617..98f50d18c4d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ErrorCause.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ErrorCause.g.cs @@ -23,103 +23,13 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class ErrorCauseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCausedBy = System.Text.Json.JsonEncodedText.Encode("caused_by"); - private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); - private static readonly System.Text.Json.JsonEncodedText PropRootCause = System.Text.Json.JsonEncodedText.Encode("root_cause"); - private static readonly System.Text.Json.JsonEncodedText PropStackTrace = System.Text.Json.JsonEncodedText.Encode("stack_trace"); - private static readonly System.Text.Json.JsonEncodedText PropSuppressed = System.Text.Json.JsonEncodedText.Encode("suppressed"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.ErrorCause Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCausedBy = default; - System.Collections.Generic.Dictionary? propMetadata = default; - LocalJsonValue propReason = default; - LocalJsonValue?> propRootCause = default; - LocalJsonValue propStackTrace = default; - LocalJsonValue?> propSuppressed = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCausedBy.TryReadProperty(ref reader, options, PropCausedBy, null)) - { - continue; - } - - if (propReason.TryReadProperty(ref reader, options, PropReason, null)) - { - continue; - } - - if (propRootCause.TryReadProperty(ref reader, options, PropRootCause, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStackTrace.TryReadProperty(ref reader, options, PropStackTrace, null)) - { - continue; - } - - if (propSuppressed.TryReadProperty(ref reader, options, PropSuppressed, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - propMetadata ??= new System.Collections.Generic.Dictionary(); - reader.ReadProperty(options, out string key, out object value, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!); - propMetadata[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ErrorCause(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CausedBy = propCausedBy.Value, - Metadata = propMetadata, - Reason = propReason.Value, - RootCause = propRootCause.Value, - StackTrace = propStackTrace.Value, - Suppressed = propSuppressed.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ErrorCause value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCausedBy, value.CausedBy, null, null); - writer.WriteProperty(options, PropReason, value.Reason, null, null); - writer.WriteProperty(options, PropRootCause, value.RootCause, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStackTrace, value.StackTrace, null, null); - writer.WriteProperty(options, PropSuppressed, value.Suppressed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropType, value.Type, null, null); - if (value.Metadata is not null) - { - foreach (var item in value.Metadata) - { - writer.WriteProperty(options, item.Key, item.Value, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - } - } - - writer.WriteEndObject(); - } -} - /// /// /// Cause and details about a request failure. This class defines the properties common to all error types. /// Additional details are also provided, that depend on the error type. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ErrorCauseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ErrorCauseConverter))] public sealed partial class ErrorCause { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ErrorResponseBase.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ErrorResponseBase.Converters.g.cs new file mode 100644 index 00000000000..8c0efa275cc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ErrorResponseBase.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ErrorResponseBaseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + + public override Elastic.Clients.Elasticsearch.ErrorResponseBase Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propError = default; + LocalJsonValue propStatus = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propError.TryReadProperty(ref reader, options, PropError, null)) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ErrorResponseBase(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Error = propError.Value, + Status = propStatus.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ErrorResponseBase value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropError, value.Error, null, null); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ErrorResponseBase.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ErrorResponseBase.g.cs index 788c793a658..e32b886bf96 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ErrorResponseBase.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ErrorResponseBase.g.cs @@ -23,60 +23,12 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class ErrorResponseBaseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - - public override Elastic.Clients.Elasticsearch.ErrorResponseBase Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propError = default; - LocalJsonValue propStatus = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propError.TryReadProperty(ref reader, options, PropError, null)) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ErrorResponseBase(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Error = propError.Value, - Status = propStatus.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ErrorResponseBase value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropError, value.Error, null, null); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteEndObject(); - } -} - /// /// /// The response returned by Elasticsearch when request execution did not succeed. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ErrorResponseBaseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ErrorResponseBaseConverter))] public sealed partial class ErrorResponseBase { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Esql.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Esql/EsqlFormat.Converters.g.cs similarity index 88% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Esql.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Esql/EsqlFormat.Converters.g.cs index cd426889710..90bce921bda 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Esql.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Esql/EsqlFormat.Converters.g.cs @@ -21,9 +21,9 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.Esql; +namespace Elastic.Clients.Elasticsearch.Esql.Json; -internal sealed partial class EsqlFormatConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class EsqlFormatConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText MemberArrow = System.Text.Json.JsonEncodedText.Encode("arrow"); private static readonly System.Text.Json.JsonEncodedText MemberCbor = System.Text.Json.JsonEncodedText.Encode("cbor"); @@ -162,25 +162,4 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, { Write(writer, value, options); } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.EsqlFormatConverter))] -public enum EsqlFormat -{ - [System.Runtime.Serialization.EnumMember(Value = "arrow")] - Arrow, - [System.Runtime.Serialization.EnumMember(Value = "cbor")] - Cbor, - [System.Runtime.Serialization.EnumMember(Value = "csv")] - Csv, - [System.Runtime.Serialization.EnumMember(Value = "json")] - Json, - [System.Runtime.Serialization.EnumMember(Value = "smile")] - Smile, - [System.Runtime.Serialization.EnumMember(Value = "tsv")] - Tsv, - [System.Runtime.Serialization.EnumMember(Value = "txt")] - Txt, - [System.Runtime.Serialization.EnumMember(Value = "yaml")] - Yaml } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Esql/EsqlFormat.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Esql/EsqlFormat.g.cs new file mode 100644 index 00000000000..7758f8171e1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Esql/EsqlFormat.g.cs @@ -0,0 +1,45 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Esql; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.Json.EsqlFormatConverter))] +public enum EsqlFormat +{ + [System.Runtime.Serialization.EnumMember(Value = "arrow")] + Arrow, + [System.Runtime.Serialization.EnumMember(Value = "cbor")] + Cbor, + [System.Runtime.Serialization.EnumMember(Value = "csv")] + Csv, + [System.Runtime.Serialization.EnumMember(Value = "json")] + Json, + [System.Runtime.Serialization.EnumMember(Value = "smile")] + Smile, + [System.Runtime.Serialization.EnumMember(Value = "tsv")] + Tsv, + [System.Runtime.Serialization.EnumMember(Value = "txt")] + Txt, + [System.Runtime.Serialization.EnumMember(Value = "yaml")] + Yaml +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Esql/EsqlQueryInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Esql/EsqlQueryInfo.Converters.g.cs new file mode 100644 index 00000000000..e615983a174 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Esql/EsqlQueryInfo.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Esql.Json; + +public sealed partial class EsqlQueryInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropRunningTimeNanos = System.Text.Json.JsonEncodedText.Encode("running_time_nanos"); + private static readonly System.Text.Json.JsonEncodedText PropStartTimeMillis = System.Text.Json.JsonEncodedText.Encode("start_time_millis"); + + public override Elastic.Clients.Elasticsearch.Esql.EsqlQueryInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propNode = default; + LocalJsonValue propQuery = default; + LocalJsonValue propRunningTimeNanos = default; + LocalJsonValue propStartTimeMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propNode.TryReadProperty(ref reader, options, PropNode, null)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propRunningTimeNanos.TryReadProperty(ref reader, options, PropRunningTimeNanos, null)) + { + continue; + } + + if (propStartTimeMillis.TryReadProperty(ref reader, options, PropStartTimeMillis, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Esql.EsqlQueryInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + Node = propNode.Value, + Query = propQuery.Value, + RunningTimeNanos = propRunningTimeNanos.Value, + StartTimeMillis = propStartTimeMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.EsqlQueryInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropNode, value.Node, null, null); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropRunningTimeNanos, value.RunningTimeNanos, null, null); + writer.WriteProperty(options, PropStartTimeMillis, value.StartTimeMillis, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Esql/EsqlQueryInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Esql/EsqlQueryInfo.g.cs index 405b30ea8e3..d5a20db5c54 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Esql/EsqlQueryInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Esql/EsqlQueryInfo.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Esql; -internal sealed partial class EsqlQueryInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropRunningTimeNanos = System.Text.Json.JsonEncodedText.Encode("running_time_nanos"); - private static readonly System.Text.Json.JsonEncodedText PropStartTimeMillis = System.Text.Json.JsonEncodedText.Encode("start_time_millis"); - - public override Elastic.Clients.Elasticsearch.Esql.EsqlQueryInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue propNode = default; - LocalJsonValue propQuery = default; - LocalJsonValue propRunningTimeNanos = default; - LocalJsonValue propStartTimeMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propNode.TryReadProperty(ref reader, options, PropNode, null)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propRunningTimeNanos.TryReadProperty(ref reader, options, PropRunningTimeNanos, null)) - { - continue; - } - - if (propStartTimeMillis.TryReadProperty(ref reader, options, PropStartTimeMillis, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Esql.EsqlQueryInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - Node = propNode.Value, - Query = propQuery.Value, - RunningTimeNanos = propRunningTimeNanos.Value, - StartTimeMillis = propStartTimeMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Esql.EsqlQueryInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropNode, value.Node, null, null); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropRunningTimeNanos, value.RunningTimeNanos, null, null); - writer.WriteProperty(options, PropStartTimeMillis, value.StartTimeMillis, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.EsqlQueryInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Esql.Json.EsqlQueryInfoConverter))] public sealed partial class EsqlQueryInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ExpandWildcard.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ExpandWildcard.Converters.g.cs new file mode 100644 index 00000000000..729933128b5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ExpandWildcard.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ExpandWildcardConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAll = System.Text.Json.JsonEncodedText.Encode("all"); + private static readonly System.Text.Json.JsonEncodedText MemberClosed = System.Text.Json.JsonEncodedText.Encode("closed"); + private static readonly System.Text.Json.JsonEncodedText MemberHidden = System.Text.Json.JsonEncodedText.Encode("hidden"); + private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); + private static readonly System.Text.Json.JsonEncodedText MemberOpen = System.Text.Json.JsonEncodedText.Encode("open"); + + public override Elastic.Clients.Elasticsearch.ExpandWildcard Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAll)) + { + return Elastic.Clients.Elasticsearch.ExpandWildcard.All; + } + + if (reader.ValueTextEquals(MemberClosed)) + { + return Elastic.Clients.Elasticsearch.ExpandWildcard.Closed; + } + + if (reader.ValueTextEquals(MemberHidden)) + { + return Elastic.Clients.Elasticsearch.ExpandWildcard.Hidden; + } + + if (reader.ValueTextEquals(MemberNone)) + { + return Elastic.Clients.Elasticsearch.ExpandWildcard.None; + } + + if (reader.ValueTextEquals(MemberOpen)) + { + return Elastic.Clients.Elasticsearch.ExpandWildcard.Open; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAll.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.ExpandWildcard.All; + } + + if (string.Equals(value, MemberClosed.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.ExpandWildcard.Closed; + } + + if (string.Equals(value, MemberHidden.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.ExpandWildcard.Hidden; + } + + if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.ExpandWildcard.None; + } + + if (string.Equals(value, MemberOpen.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.ExpandWildcard.Open; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.ExpandWildcard)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ExpandWildcard value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.ExpandWildcard.All: + writer.WriteStringValue(MemberAll); + break; + case Elastic.Clients.Elasticsearch.ExpandWildcard.Closed: + writer.WriteStringValue(MemberClosed); + break; + case Elastic.Clients.Elasticsearch.ExpandWildcard.Hidden: + writer.WriteStringValue(MemberHidden); + break; + case Elastic.Clients.Elasticsearch.ExpandWildcard.None: + writer.WriteStringValue(MemberNone); + break; + case Elastic.Clients.Elasticsearch.ExpandWildcard.Open: + writer.WriteStringValue(MemberOpen); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.ExpandWildcard)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.ExpandWildcard ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ExpandWildcard value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ExpandWildcard.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ExpandWildcard.g.cs new file mode 100644 index 00000000000..b5584ce6e1a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ExpandWildcard.g.cs @@ -0,0 +1,64 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ExpandWildcardConverter))] +public enum ExpandWildcard +{ + /// + /// + /// Match any data stream or index, including hidden ones. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "all")] + All, + /// + /// + /// Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "closed")] + Closed, + /// + /// + /// Match hidden data streams and hidden indices. Must be combined with open, closed, or both. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "hidden")] + Hidden, + /// + /// + /// Wildcard expressions are not accepted. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "none")] + None, + /// + /// + /// Match open, non-hidden indices. Also matches any non-hidden data stream. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "open")] + Open +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Features/Feature.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Features/Feature.Converters.g.cs new file mode 100644 index 00000000000..5e4bdf5e549 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Features/Feature.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Features.Json; + +public sealed partial class FeatureConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.Features.Feature Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Features.Feature(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Features.Feature value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Features/Feature.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Features/Feature.g.cs index 60d02ebd95b..0d43d06d497 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Features/Feature.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Features/Feature.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Features; -internal sealed partial class FeatureConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.Features.Feature Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Features.Feature(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Features.Feature value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Features.FeatureConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Features.Json.FeatureConverter))] public sealed partial class Feature { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldMemoryUsage.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldMemoryUsage.Converters.g.cs new file mode 100644 index 00000000000..c70e18dc477 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldMemoryUsage.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class FieldMemoryUsageConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMemorySize = System.Text.Json.JsonEncodedText.Encode("memory_size"); + private static readonly System.Text.Json.JsonEncodedText PropMemorySizeInBytes = System.Text.Json.JsonEncodedText.Encode("memory_size_in_bytes"); + + public override Elastic.Clients.Elasticsearch.FieldMemoryUsage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMemorySize = default; + LocalJsonValue propMemorySizeInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMemorySize.TryReadProperty(ref reader, options, PropMemorySize, null)) + { + continue; + } + + if (propMemorySizeInBytes.TryReadProperty(ref reader, options, PropMemorySizeInBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.FieldMemoryUsage(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MemorySize = propMemorySize.Value, + MemorySizeInBytes = propMemorySizeInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.FieldMemoryUsage value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMemorySize, value.MemorySize, null, null); + writer.WriteProperty(options, PropMemorySizeInBytes, value.MemorySizeInBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldMemoryUsage.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldMemoryUsage.g.cs index b44e4beda90..69f57fc0fb9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldMemoryUsage.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldMemoryUsage.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class FieldMemoryUsageConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMemorySize = System.Text.Json.JsonEncodedText.Encode("memory_size"); - private static readonly System.Text.Json.JsonEncodedText PropMemorySizeInBytes = System.Text.Json.JsonEncodedText.Encode("memory_size_in_bytes"); - - public override Elastic.Clients.Elasticsearch.FieldMemoryUsage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMemorySize = default; - LocalJsonValue propMemorySizeInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMemorySize.TryReadProperty(ref reader, options, PropMemorySize, null)) - { - continue; - } - - if (propMemorySizeInBytes.TryReadProperty(ref reader, options, PropMemorySizeInBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.FieldMemoryUsage(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MemorySize = propMemorySize.Value, - MemorySizeInBytes = propMemorySizeInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.FieldMemoryUsage value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMemorySize, value.MemorySize, null, null); - writer.WriteProperty(options, PropMemorySizeInBytes, value.MemorySizeInBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.FieldMemoryUsageConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.FieldMemoryUsageConverter))] public sealed partial class FieldMemoryUsage { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSizeUsage.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSizeUsage.Converters.g.cs new file mode 100644 index 00000000000..d12af7a5b68 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSizeUsage.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class FieldSizeUsageConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropSizeInBytes = System.Text.Json.JsonEncodedText.Encode("size_in_bytes"); + + public override Elastic.Clients.Elasticsearch.FieldSizeUsage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propSize = default; + LocalJsonValue propSizeInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSize.TryReadProperty(ref reader, options, PropSize, null)) + { + continue; + } + + if (propSizeInBytes.TryReadProperty(ref reader, options, PropSizeInBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.FieldSizeUsage(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Size = propSize.Value, + SizeInBytes = propSizeInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.FieldSizeUsage value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSize, value.Size, null, null); + writer.WriteProperty(options, PropSizeInBytes, value.SizeInBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSizeUsage.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSizeUsage.g.cs index 303233ca99f..c9fb7e8fb83 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSizeUsage.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSizeUsage.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class FieldSizeUsageConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropSizeInBytes = System.Text.Json.JsonEncodedText.Encode("size_in_bytes"); - - public override Elastic.Clients.Elasticsearch.FieldSizeUsage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propSize = default; - LocalJsonValue propSizeInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSize.TryReadProperty(ref reader, options, PropSize, null)) - { - continue; - } - - if (propSizeInBytes.TryReadProperty(ref reader, options, PropSizeInBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.FieldSizeUsage(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Size = propSize.Value, - SizeInBytes = propSizeInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.FieldSizeUsage value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSize, value.Size, null, null); - writer.WriteProperty(options, PropSizeInBytes, value.SizeInBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.FieldSizeUsageConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.FieldSizeUsageConverter))] public sealed partial class FieldSizeUsage { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSort.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSort.Converters.g.cs new file mode 100644 index 00000000000..e2e44eab97c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSort.Converters.g.cs @@ -0,0 +1,139 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class FieldSortConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); + private static readonly System.Text.Json.JsonEncodedText PropNested = System.Text.Json.JsonEncodedText.Encode("nested"); + private static readonly System.Text.Json.JsonEncodedText PropNumericType = System.Text.Json.JsonEncodedText.Encode("numeric_type"); + private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); + private static readonly System.Text.Json.JsonEncodedText PropUnmappedType = System.Text.Json.JsonEncodedText.Encode("unmapped_type"); + + public override Elastic.Clients.Elasticsearch.FieldSort Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + reader.Read(); + propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); + reader.Read(); + if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) + { + var value = reader.ReadValue(options, static Elastic.Clients.Elasticsearch.SortOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o)); + reader.Read(); + return new Elastic.Clients.Elasticsearch.FieldSort(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Order = value + }; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFormat = default; + LocalJsonValue propMissing = default; + LocalJsonValue propMode = default; + LocalJsonValue propNested = default; + LocalJsonValue propNumericType = default; + LocalJsonValue propOrder = default; + LocalJsonValue propUnmappedType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (propMode.TryReadProperty(ref reader, options, PropMode, static Elastic.Clients.Elasticsearch.SortMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNested.TryReadProperty(ref reader, options, PropNested, null)) + { + continue; + } + + if (propNumericType.TryReadProperty(ref reader, options, PropNumericType, static Elastic.Clients.Elasticsearch.FieldSortNumericType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOrder.TryReadProperty(ref reader, options, PropOrder, static Elastic.Clients.Elasticsearch.SortOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propUnmappedType.TryReadProperty(ref reader, options, PropUnmappedType, static Elastic.Clients.Elasticsearch.Mapping.FieldType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.FieldSort(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Format = propFormat.Value, + Missing = propMissing.Value, + Mode = propMode.Value, + Nested = propNested.Value, + NumericType = propNumericType.Value, + Order = propOrder.Value, + UnmappedType = propUnmappedType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.FieldSort value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); + writer.WriteStartObject(); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteProperty(options, PropMode, value.Mode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortMode? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNested, value.Nested, null, null); + writer.WriteProperty(options, PropNumericType, value.NumericType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.FieldSortNumericType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortOrder? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropUnmappedType, value.UnmappedType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.FieldType? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSort.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSort.g.cs index 11457b1f03e..35472c6b409 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSort.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSort.g.cs @@ -23,122 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class FieldSortConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); - private static readonly System.Text.Json.JsonEncodedText PropNested = System.Text.Json.JsonEncodedText.Encode("nested"); - private static readonly System.Text.Json.JsonEncodedText PropNumericType = System.Text.Json.JsonEncodedText.Encode("numeric_type"); - private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); - private static readonly System.Text.Json.JsonEncodedText PropUnmappedType = System.Text.Json.JsonEncodedText.Encode("unmapped_type"); - - public override Elastic.Clients.Elasticsearch.FieldSort Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - reader.Read(); - propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); - reader.Read(); - if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) - { - var value = reader.ReadValue(options, static Elastic.Clients.Elasticsearch.SortOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o)); - reader.Read(); - return new Elastic.Clients.Elasticsearch.FieldSort(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Order = value - }; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFormat = default; - LocalJsonValue propMissing = default; - LocalJsonValue propMode = default; - LocalJsonValue propNested = default; - LocalJsonValue propNumericType = default; - LocalJsonValue propOrder = default; - LocalJsonValue propUnmappedType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) - { - continue; - } - - if (propMode.TryReadProperty(ref reader, options, PropMode, static Elastic.Clients.Elasticsearch.SortMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNested.TryReadProperty(ref reader, options, PropNested, null)) - { - continue; - } - - if (propNumericType.TryReadProperty(ref reader, options, PropNumericType, static Elastic.Clients.Elasticsearch.FieldSortNumericType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOrder.TryReadProperty(ref reader, options, PropOrder, static Elastic.Clients.Elasticsearch.SortOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propUnmappedType.TryReadProperty(ref reader, options, PropUnmappedType, static Elastic.Clients.Elasticsearch.Mapping.FieldType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.FieldSort(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Format = propFormat.Value, - Missing = propMissing.Value, - Mode = propMode.Value, - Nested = propNested.Value, - NumericType = propNumericType.Value, - Order = propOrder.Value, - UnmappedType = propUnmappedType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.FieldSort value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); - writer.WriteStartObject(); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropMissing, value.Missing, null, null); - writer.WriteProperty(options, PropMode, value.Mode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortMode? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNested, value.Nested, null, null); - writer.WriteProperty(options, PropNumericType, value.NumericType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.FieldSortNumericType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortOrder? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropUnmappedType, value.UnmappedType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.FieldType? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.FieldSortConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.FieldSortConverter))] public sealed partial class FieldSort { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSortNumericType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSortNumericType.Converters.g.cs new file mode 100644 index 00000000000..aae01725f3d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSortNumericType.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class FieldSortNumericTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberDate = System.Text.Json.JsonEncodedText.Encode("date"); + private static readonly System.Text.Json.JsonEncodedText MemberDateNanos = System.Text.Json.JsonEncodedText.Encode("date_nanos"); + private static readonly System.Text.Json.JsonEncodedText MemberDouble = System.Text.Json.JsonEncodedText.Encode("double"); + private static readonly System.Text.Json.JsonEncodedText MemberLong = System.Text.Json.JsonEncodedText.Encode("long"); + + public override Elastic.Clients.Elasticsearch.FieldSortNumericType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberDate)) + { + return Elastic.Clients.Elasticsearch.FieldSortNumericType.Date; + } + + if (reader.ValueTextEquals(MemberDateNanos)) + { + return Elastic.Clients.Elasticsearch.FieldSortNumericType.DateNanos; + } + + if (reader.ValueTextEquals(MemberDouble)) + { + return Elastic.Clients.Elasticsearch.FieldSortNumericType.Double; + } + + if (reader.ValueTextEquals(MemberLong)) + { + return Elastic.Clients.Elasticsearch.FieldSortNumericType.Long; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberDate.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.FieldSortNumericType.Date; + } + + if (string.Equals(value, MemberDateNanos.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.FieldSortNumericType.DateNanos; + } + + if (string.Equals(value, MemberDouble.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.FieldSortNumericType.Double; + } + + if (string.Equals(value, MemberLong.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.FieldSortNumericType.Long; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.FieldSortNumericType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.FieldSortNumericType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.FieldSortNumericType.Date: + writer.WriteStringValue(MemberDate); + break; + case Elastic.Clients.Elasticsearch.FieldSortNumericType.DateNanos: + writer.WriteStringValue(MemberDateNanos); + break; + case Elastic.Clients.Elasticsearch.FieldSortNumericType.Double: + writer.WriteStringValue(MemberDouble); + break; + case Elastic.Clients.Elasticsearch.FieldSortNumericType.Long: + writer.WriteStringValue(MemberLong); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.FieldSortNumericType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.FieldSortNumericType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.FieldSortNumericType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSortNumericType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSortNumericType.g.cs new file mode 100644 index 00000000000..44544df823e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSortNumericType.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.FieldSortNumericTypeConverter))] +public enum FieldSortNumericType +{ + [System.Runtime.Serialization.EnumMember(Value = "date")] + Date, + [System.Runtime.Serialization.EnumMember(Value = "date_nanos")] + DateNanos, + [System.Runtime.Serialization.EnumMember(Value = "double")] + Double, + [System.Runtime.Serialization.EnumMember(Value = "long")] + Long +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FielddataStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FielddataStats.Converters.g.cs new file mode 100644 index 00000000000..f5e7c9b18bf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FielddataStats.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class FielddataStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEvictions = System.Text.Json.JsonEncodedText.Encode("evictions"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropGlobalOrdinals = System.Text.Json.JsonEncodedText.Encode("global_ordinals"); + private static readonly System.Text.Json.JsonEncodedText PropMemorySize = System.Text.Json.JsonEncodedText.Encode("memory_size"); + private static readonly System.Text.Json.JsonEncodedText PropMemorySizeInBytes = System.Text.Json.JsonEncodedText.Encode("memory_size_in_bytes"); + + public override Elastic.Clients.Elasticsearch.FielddataStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEvictions = default; + LocalJsonValue?> propFields = default; + LocalJsonValue propGlobalOrdinals = default; + LocalJsonValue propMemorySize = default; + LocalJsonValue propMemorySizeInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEvictions.TryReadProperty(ref reader, options, PropEvictions, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propGlobalOrdinals.TryReadProperty(ref reader, options, PropGlobalOrdinals, null)) + { + continue; + } + + if (propMemorySize.TryReadProperty(ref reader, options, PropMemorySize, null)) + { + continue; + } + + if (propMemorySizeInBytes.TryReadProperty(ref reader, options, PropMemorySizeInBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.FielddataStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Evictions = propEvictions.Value, + Fields = propFields.Value, + GlobalOrdinals = propGlobalOrdinals.Value, + MemorySize = propMemorySize.Value, + MemorySizeInBytes = propMemorySizeInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.FielddataStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEvictions, value.Evictions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropGlobalOrdinals, value.GlobalOrdinals, null, null); + writer.WriteProperty(options, PropMemorySize, value.MemorySize, null, null); + writer.WriteProperty(options, PropMemorySizeInBytes, value.MemorySizeInBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FielddataStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FielddataStats.g.cs index 5401d0a38d9..708676744d7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FielddataStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FielddataStats.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class FielddataStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEvictions = System.Text.Json.JsonEncodedText.Encode("evictions"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropGlobalOrdinals = System.Text.Json.JsonEncodedText.Encode("global_ordinals"); - private static readonly System.Text.Json.JsonEncodedText PropMemorySize = System.Text.Json.JsonEncodedText.Encode("memory_size"); - private static readonly System.Text.Json.JsonEncodedText PropMemorySizeInBytes = System.Text.Json.JsonEncodedText.Encode("memory_size_in_bytes"); - - public override Elastic.Clients.Elasticsearch.FielddataStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEvictions = default; - LocalJsonValue?> propFields = default; - LocalJsonValue propGlobalOrdinals = default; - LocalJsonValue propMemorySize = default; - LocalJsonValue propMemorySizeInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEvictions.TryReadProperty(ref reader, options, PropEvictions, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propGlobalOrdinals.TryReadProperty(ref reader, options, PropGlobalOrdinals, null)) - { - continue; - } - - if (propMemorySize.TryReadProperty(ref reader, options, PropMemorySize, null)) - { - continue; - } - - if (propMemorySizeInBytes.TryReadProperty(ref reader, options, PropMemorySizeInBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.FielddataStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Evictions = propEvictions.Value, - Fields = propFields.Value, - GlobalOrdinals = propGlobalOrdinals.Value, - MemorySize = propMemorySize.Value, - MemorySizeInBytes = propMemorySizeInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.FielddataStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEvictions, value.Evictions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropGlobalOrdinals, value.GlobalOrdinals, null, null); - writer.WriteProperty(options, PropMemorySize, value.MemorySize, null, null); - writer.WriteProperty(options, PropMemorySizeInBytes, value.MemorySizeInBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.FielddataStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.FielddataStatsConverter))] public sealed partial class FielddataStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FlushStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FlushStats.Converters.g.cs new file mode 100644 index 00000000000..9ea6b66f8ba --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FlushStats.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class FlushStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPeriodic = System.Text.Json.JsonEncodedText.Encode("periodic"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + private static readonly System.Text.Json.JsonEncodedText PropTotalTime = System.Text.Json.JsonEncodedText.Encode("total_time"); + private static readonly System.Text.Json.JsonEncodedText PropTotalTimeInMillis = System.Text.Json.JsonEncodedText.Encode("total_time_in_millis"); + + public override Elastic.Clients.Elasticsearch.FlushStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPeriodic = default; + LocalJsonValue propTotal = default; + LocalJsonValue propTotalTime = default; + LocalJsonValue propTotalTimeInMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPeriodic.TryReadProperty(ref reader, options, PropPeriodic, null)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (propTotalTime.TryReadProperty(ref reader, options, PropTotalTime, null)) + { + continue; + } + + if (propTotalTimeInMillis.TryReadProperty(ref reader, options, PropTotalTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.FlushStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Periodic = propPeriodic.Value, + Total = propTotal.Value, + TotalTime = propTotalTime.Value, + TotalTimeInMillis = propTotalTimeInMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.FlushStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPeriodic, value.Periodic, null, null); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteProperty(options, PropTotalTime, value.TotalTime, null, null); + writer.WriteProperty(options, PropTotalTimeInMillis, value.TotalTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FlushStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FlushStats.g.cs index a24779dc9f8..8a68f7ac06f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FlushStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FlushStats.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class FlushStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPeriodic = System.Text.Json.JsonEncodedText.Encode("periodic"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - private static readonly System.Text.Json.JsonEncodedText PropTotalTime = System.Text.Json.JsonEncodedText.Encode("total_time"); - private static readonly System.Text.Json.JsonEncodedText PropTotalTimeInMillis = System.Text.Json.JsonEncodedText.Encode("total_time_in_millis"); - - public override Elastic.Clients.Elasticsearch.FlushStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPeriodic = default; - LocalJsonValue propTotal = default; - LocalJsonValue propTotalTime = default; - LocalJsonValue propTotalTimeInMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPeriodic.TryReadProperty(ref reader, options, PropPeriodic, null)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (propTotalTime.TryReadProperty(ref reader, options, PropTotalTime, null)) - { - continue; - } - - if (propTotalTimeInMillis.TryReadProperty(ref reader, options, PropTotalTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.FlushStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Periodic = propPeriodic.Value, - Total = propTotal.Value, - TotalTime = propTotalTime.Value, - TotalTimeInMillis = propTotalTimeInMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.FlushStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPeriodic, value.Periodic, null, null); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteProperty(options, PropTotalTime, value.TotalTime, null, null); - writer.WriteProperty(options, PropTotalTimeInMillis, value.TotalTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.FlushStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.FlushStatsConverter))] public sealed partial class FlushStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Fuzziness.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Fuzziness.Converters.g.cs new file mode 100644 index 00000000000..85ff8171d96 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Fuzziness.Converters.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class FuzzinessConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Fuzziness Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number); + return selector(ref reader, options) switch + { + Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Fuzziness(reader.ReadValue(options, null)), + Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Fuzziness(reader.ReadValue(options, null)), + _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Fuzziness)}") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Fuzziness value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Tag) + { + case Elastic.Clients.Elasticsearch.UnionTag.T1: + { + writer.WriteValue(options, value.Value1, null); + break; + } + + case Elastic.Clients.Elasticsearch.UnionTag.T2: + { + writer.WriteValue(options, value.Value2, null); + break; + } + + default: + throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Fuzziness.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Fuzziness.g.cs index 63fd3c97ca3..119cd1aa83a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Fuzziness.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Fuzziness.g.cs @@ -23,45 +23,10 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class FuzzinessConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Fuzziness Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number); - return selector(ref reader, options) switch - { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Fuzziness(reader.ReadValue(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Fuzziness(reader.ReadValue(options, null)), - _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Fuzziness)}") - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Fuzziness value, System.Text.Json.JsonSerializerOptions options) - { - switch (value.Tag) - { - case Elastic.Clients.Elasticsearch.UnionTag.T1: - { - writer.WriteValue(options, value.Value1, null); - break; - } - - case Elastic.Clients.Elasticsearch.UnionTag.T2: - { - writer.WriteValue(options, value.Value2, null); - break; - } - - default: - throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); - } - } -} - /// /// Learn more about this API in the Elasticsearch documentation. /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.FuzzinessConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.FuzzinessConverter))] public sealed partial class Fuzziness : Elastic.Clients.Elasticsearch.Union { public Fuzziness(string value) : base(value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoDistanceSort.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoDistanceSort.Converters.g.cs new file mode 100644 index 00000000000..68a94527524 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoDistanceSort.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class GeoDistanceSortConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDistanceType = System.Text.Json.JsonEncodedText.Encode("distance_type"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnmapped = System.Text.Json.JsonEncodedText.Encode("ignore_unmapped"); + private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); + private static readonly System.Text.Json.JsonEncodedText PropNested = System.Text.Json.JsonEncodedText.Encode("nested"); + private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); + private static readonly System.Text.Json.JsonEncodedText PropUnit = System.Text.Json.JsonEncodedText.Encode("unit"); + + public override Elastic.Clients.Elasticsearch.GeoDistanceSort Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDistanceType = default; + LocalJsonValue propField = default; + LocalJsonValue propIgnoreUnmapped = default; + LocalJsonValue> propLocation = default; + LocalJsonValue propMode = default; + LocalJsonValue propNested = default; + LocalJsonValue propOrder = default; + LocalJsonValue propUnit = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDistanceType.TryReadProperty(ref reader, options, PropDistanceType, static Elastic.Clients.Elasticsearch.GeoDistanceType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreUnmapped.TryReadProperty(ref reader, options, PropIgnoreUnmapped, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMode.TryReadProperty(ref reader, options, PropMode, static Elastic.Clients.Elasticsearch.SortMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNested.TryReadProperty(ref reader, options, PropNested, null)) + { + continue; + } + + if (propOrder.TryReadProperty(ref reader, options, PropOrder, static Elastic.Clients.Elasticsearch.SortOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propUnit.TryReadProperty(ref reader, options, PropUnit, static Elastic.Clients.Elasticsearch.DistanceUnit? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + propField.Initialized = propLocation.Initialized = true; + reader.ReadProperty(options, out propField.Value, out propLocation.Value, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o), static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.GeoDistanceSort(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DistanceType = propDistanceType.Value, + Field = propField.Value, + IgnoreUnmapped = propIgnoreUnmapped.Value, + Location = propLocation.Value, + Mode = propMode.Value, + Nested = propNested.Value, + Order = propOrder.Value, + Unit = propUnit.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GeoDistanceSort value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDistanceType, value.DistanceType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.GeoDistanceType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreUnmapped, value.IgnoreUnmapped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMode, value.Mode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortMode? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNested, value.Nested, null, null); + writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortOrder? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropUnit, value.Unit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.DistanceUnit? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, value.Field, value.Location, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoDistanceSort.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoDistanceSort.g.cs index 33d94d79178..7142acf3d28 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoDistanceSort.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoDistanceSort.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class GeoDistanceSortConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDistanceType = System.Text.Json.JsonEncodedText.Encode("distance_type"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnmapped = System.Text.Json.JsonEncodedText.Encode("ignore_unmapped"); - private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); - private static readonly System.Text.Json.JsonEncodedText PropNested = System.Text.Json.JsonEncodedText.Encode("nested"); - private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); - private static readonly System.Text.Json.JsonEncodedText PropUnit = System.Text.Json.JsonEncodedText.Encode("unit"); - - public override Elastic.Clients.Elasticsearch.GeoDistanceSort Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDistanceType = default; - LocalJsonValue propField = default; - LocalJsonValue propIgnoreUnmapped = default; - LocalJsonValue> propLocation = default; - LocalJsonValue propMode = default; - LocalJsonValue propNested = default; - LocalJsonValue propOrder = default; - LocalJsonValue propUnit = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDistanceType.TryReadProperty(ref reader, options, PropDistanceType, static Elastic.Clients.Elasticsearch.GeoDistanceType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreUnmapped.TryReadProperty(ref reader, options, PropIgnoreUnmapped, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMode.TryReadProperty(ref reader, options, PropMode, static Elastic.Clients.Elasticsearch.SortMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNested.TryReadProperty(ref reader, options, PropNested, null)) - { - continue; - } - - if (propOrder.TryReadProperty(ref reader, options, PropOrder, static Elastic.Clients.Elasticsearch.SortOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propUnit.TryReadProperty(ref reader, options, PropUnit, static Elastic.Clients.Elasticsearch.DistanceUnit? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - propField.Initialized = propLocation.Initialized = true; - reader.ReadProperty(options, out propField.Value, out propLocation.Value, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o), static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.GeoDistanceSort(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DistanceType = propDistanceType.Value, - Field = propField.Value, - IgnoreUnmapped = propIgnoreUnmapped.Value, - Location = propLocation.Value, - Mode = propMode.Value, - Nested = propNested.Value, - Order = propOrder.Value, - Unit = propUnit.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GeoDistanceSort value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDistanceType, value.DistanceType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.GeoDistanceType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreUnmapped, value.IgnoreUnmapped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMode, value.Mode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortMode? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNested, value.Nested, null, null); - writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortOrder? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropUnit, value.Unit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.DistanceUnit? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, value.Field, value.Location, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.GeoDistanceSortConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.GeoDistanceSortConverter))] public sealed partial class GeoDistanceSort { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoDistanceType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoDistanceType.Converters.g.cs new file mode 100644 index 00000000000..d930c1e4451 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoDistanceType.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class GeoDistanceTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberArc = System.Text.Json.JsonEncodedText.Encode("arc"); + private static readonly System.Text.Json.JsonEncodedText MemberPlane = System.Text.Json.JsonEncodedText.Encode("plane"); + + public override Elastic.Clients.Elasticsearch.GeoDistanceType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberArc)) + { + return Elastic.Clients.Elasticsearch.GeoDistanceType.Arc; + } + + if (reader.ValueTextEquals(MemberPlane)) + { + return Elastic.Clients.Elasticsearch.GeoDistanceType.Plane; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberArc.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.GeoDistanceType.Arc; + } + + if (string.Equals(value, MemberPlane.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.GeoDistanceType.Plane; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.GeoDistanceType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GeoDistanceType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.GeoDistanceType.Arc: + writer.WriteStringValue(MemberArc); + break; + case Elastic.Clients.Elasticsearch.GeoDistanceType.Plane: + writer.WriteStringValue(MemberPlane); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.GeoDistanceType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.GeoDistanceType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GeoDistanceType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoDistanceType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoDistanceType.g.cs new file mode 100644 index 00000000000..c07dc1e4328 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoDistanceType.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.GeoDistanceTypeConverter))] +public enum GeoDistanceType +{ + /// + /// + /// The arc calculation is the most accurate. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "arc")] + Arc, + /// + /// + /// The plane calculation is faster but less accurate. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "plane")] + Plane +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoHashLocation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoHashLocation.Converters.g.cs new file mode 100644 index 00000000000..5782d8d5a70 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoHashLocation.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class GeoHashLocationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropGeohash = System.Text.Json.JsonEncodedText.Encode("geohash"); + + public override Elastic.Clients.Elasticsearch.GeoHashLocation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propGeohash = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propGeohash.TryReadProperty(ref reader, options, PropGeohash, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.GeoHashLocation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Geohash = propGeohash.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GeoHashLocation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropGeohash, value.Geohash, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoHashLocation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoHashLocation.g.cs index fadd6a51537..c108bc33b6a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoHashLocation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoHashLocation.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class GeoHashLocationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropGeohash = System.Text.Json.JsonEncodedText.Encode("geohash"); - - public override Elastic.Clients.Elasticsearch.GeoHashLocation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propGeohash = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propGeohash.TryReadProperty(ref reader, options, PropGeohash, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.GeoHashLocation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Geohash = propGeohash.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GeoHashLocation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropGeohash, value.Geohash, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.GeoHashLocationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.GeoHashLocationConverter))] public sealed partial class GeoHashLocation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoLine.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoLine.Converters.g.cs new file mode 100644 index 00000000000..0873d3fd988 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoLine.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class GeoLineConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCoordinates = System.Text.Json.JsonEncodedText.Encode("coordinates"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.GeoLine Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>> propCoordinates = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCoordinates.TryReadProperty(ref reader, options, PropCoordinates, static System.Collections.Generic.IReadOnlyCollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)!)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.GeoLine(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Coordinates = propCoordinates.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GeoLine value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCoordinates, value.Coordinates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection> v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoLine.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoLine.g.cs index 65804e83edd..05970126f10 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoLine.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoLine.g.cs @@ -23,60 +23,12 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class GeoLineConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCoordinates = System.Text.Json.JsonEncodedText.Encode("coordinates"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.GeoLine Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>> propCoordinates = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCoordinates.TryReadProperty(ref reader, options, PropCoordinates, static System.Collections.Generic.IReadOnlyCollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)!)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.GeoLine(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Coordinates = propCoordinates.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GeoLine value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCoordinates, value.Coordinates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection> v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - /// /// /// A GeoJson GeoLine. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.GeoLineConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.GeoLineConverter))] public sealed partial class GeoLine { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoLocation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoLocation.g.cs index 27f0c22a406..703273ef066 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoLocation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoLocation.g.cs @@ -50,7 +50,7 @@ namespace Elastic.Clients.Elasticsearch; /// /// /// -public sealed partial class GeoLocation : Elastic.Clients.Elasticsearch.Core.IComplexUnion +public partial class GeoLocation : Elastic.Clients.Elasticsearch.Core.IComplexUnion { public enum Kind { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoShapeRelation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoShapeRelation.Converters.g.cs new file mode 100644 index 00000000000..c78870f585c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoShapeRelation.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class GeoShapeRelationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberContains = System.Text.Json.JsonEncodedText.Encode("contains"); + private static readonly System.Text.Json.JsonEncodedText MemberDisjoint = System.Text.Json.JsonEncodedText.Encode("disjoint"); + private static readonly System.Text.Json.JsonEncodedText MemberIntersects = System.Text.Json.JsonEncodedText.Encode("intersects"); + private static readonly System.Text.Json.JsonEncodedText MemberWithin = System.Text.Json.JsonEncodedText.Encode("within"); + + public override Elastic.Clients.Elasticsearch.GeoShapeRelation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberContains)) + { + return Elastic.Clients.Elasticsearch.GeoShapeRelation.Contains; + } + + if (reader.ValueTextEquals(MemberDisjoint)) + { + return Elastic.Clients.Elasticsearch.GeoShapeRelation.Disjoint; + } + + if (reader.ValueTextEquals(MemberIntersects)) + { + return Elastic.Clients.Elasticsearch.GeoShapeRelation.Intersects; + } + + if (reader.ValueTextEquals(MemberWithin)) + { + return Elastic.Clients.Elasticsearch.GeoShapeRelation.Within; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberContains.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.GeoShapeRelation.Contains; + } + + if (string.Equals(value, MemberDisjoint.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.GeoShapeRelation.Disjoint; + } + + if (string.Equals(value, MemberIntersects.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.GeoShapeRelation.Intersects; + } + + if (string.Equals(value, MemberWithin.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.GeoShapeRelation.Within; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.GeoShapeRelation)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GeoShapeRelation value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.GeoShapeRelation.Contains: + writer.WriteStringValue(MemberContains); + break; + case Elastic.Clients.Elasticsearch.GeoShapeRelation.Disjoint: + writer.WriteStringValue(MemberDisjoint); + break; + case Elastic.Clients.Elasticsearch.GeoShapeRelation.Intersects: + writer.WriteStringValue(MemberIntersects); + break; + case Elastic.Clients.Elasticsearch.GeoShapeRelation.Within: + writer.WriteStringValue(MemberWithin); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.GeoShapeRelation)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.GeoShapeRelation ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GeoShapeRelation value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoShapeRelation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoShapeRelation.g.cs new file mode 100644 index 00000000000..cbeca05b9d4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoShapeRelation.g.cs @@ -0,0 +1,58 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.GeoShapeRelationConverter))] +public enum GeoShapeRelation +{ + /// + /// + /// Return all documents whose geo_shape or geo_point field contains the query geometry. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "contains")] + Contains, + /// + /// + /// Return all documents whose geo_shape or geo_point field has nothing in common with the query geometry. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "disjoint")] + Disjoint, + /// + /// + /// Return all documents whose geo_shape or geo_point field intersects the query geometry. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "intersects")] + Intersects, + /// + /// + /// Return all documents whose geo_shape or geo_point field is within the query geometry. + /// Line geometries are not supported. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "within")] + Within +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeohashPrecision.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeohashPrecision.Converters.g.cs new file mode 100644 index 00000000000..78feb6304ea --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeohashPrecision.Converters.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class GeohashPrecisionConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.GeohashPrecision Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String); + return selector(ref reader, options) switch + { + Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.GeohashPrecision(reader.ReadValue(options, null)), + Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.GeohashPrecision(reader.ReadValue(options, null)), + _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.GeohashPrecision)}") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GeohashPrecision value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Tag) + { + case Elastic.Clients.Elasticsearch.UnionTag.T1: + { + writer.WriteValue(options, value.Value1, null); + break; + } + + case Elastic.Clients.Elasticsearch.UnionTag.T2: + { + writer.WriteValue(options, value.Value2, null); + break; + } + + default: + throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeohashPrecision.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeohashPrecision.g.cs index 7b746a0a774..ee54b9edfb8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeohashPrecision.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeohashPrecision.g.cs @@ -23,47 +23,12 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class GeohashPrecisionConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.GeohashPrecision Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String); - return selector(ref reader, options) switch - { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.GeohashPrecision(reader.ReadValue(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.GeohashPrecision(reader.ReadValue(options, null)), - _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.GeohashPrecision)}") - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GeohashPrecision value, System.Text.Json.JsonSerializerOptions options) - { - switch (value.Tag) - { - case Elastic.Clients.Elasticsearch.UnionTag.T1: - { - writer.WriteValue(options, value.Value1, null); - break; - } - - case Elastic.Clients.Elasticsearch.UnionTag.T2: - { - writer.WriteValue(options, value.Value2, null); - break; - } - - default: - throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); - } - } -} - /// /// /// A precision that can be expressed as a geohash length between 1 and 12, or a distance measure like "1km", "10m". /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.GeohashPrecisionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.GeohashPrecisionConverter))] public sealed partial class GeohashPrecision : Elastic.Clients.Elasticsearch.Union { public GeohashPrecision(long value) : base(value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GetStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GetStats.Converters.g.cs new file mode 100644 index 00000000000..ca331e14d24 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GetStats.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class GetStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCurrent = System.Text.Json.JsonEncodedText.Encode("current"); + private static readonly System.Text.Json.JsonEncodedText PropExistsTime = System.Text.Json.JsonEncodedText.Encode("exists_time"); + private static readonly System.Text.Json.JsonEncodedText PropExistsTimeInMillis = System.Text.Json.JsonEncodedText.Encode("exists_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropExistsTotal = System.Text.Json.JsonEncodedText.Encode("exists_total"); + private static readonly System.Text.Json.JsonEncodedText PropMissingTime = System.Text.Json.JsonEncodedText.Encode("missing_time"); + private static readonly System.Text.Json.JsonEncodedText PropMissingTimeInMillis = System.Text.Json.JsonEncodedText.Encode("missing_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropMissingTotal = System.Text.Json.JsonEncodedText.Encode("missing_total"); + private static readonly System.Text.Json.JsonEncodedText PropTime = System.Text.Json.JsonEncodedText.Encode("time"); + private static readonly System.Text.Json.JsonEncodedText PropTimeInMillis = System.Text.Json.JsonEncodedText.Encode("time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.GetStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCurrent = default; + LocalJsonValue propExistsTime = default; + LocalJsonValue propExistsTimeInMillis = default; + LocalJsonValue propExistsTotal = default; + LocalJsonValue propMissingTime = default; + LocalJsonValue propMissingTimeInMillis = default; + LocalJsonValue propMissingTotal = default; + LocalJsonValue propTime = default; + LocalJsonValue propTimeInMillis = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCurrent.TryReadProperty(ref reader, options, PropCurrent, null)) + { + continue; + } + + if (propExistsTime.TryReadProperty(ref reader, options, PropExistsTime, null)) + { + continue; + } + + if (propExistsTimeInMillis.TryReadProperty(ref reader, options, PropExistsTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propExistsTotal.TryReadProperty(ref reader, options, PropExistsTotal, null)) + { + continue; + } + + if (propMissingTime.TryReadProperty(ref reader, options, PropMissingTime, null)) + { + continue; + } + + if (propMissingTimeInMillis.TryReadProperty(ref reader, options, PropMissingTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propMissingTotal.TryReadProperty(ref reader, options, PropMissingTotal, null)) + { + continue; + } + + if (propTime.TryReadProperty(ref reader, options, PropTime, null)) + { + continue; + } + + if (propTimeInMillis.TryReadProperty(ref reader, options, PropTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.GetStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Current = propCurrent.Value, + ExistsTime = propExistsTime.Value, + ExistsTimeInMillis = propExistsTimeInMillis.Value, + ExistsTotal = propExistsTotal.Value, + MissingTime = propMissingTime.Value, + MissingTimeInMillis = propMissingTimeInMillis.Value, + MissingTotal = propMissingTotal.Value, + Time = propTime.Value, + TimeInMillis = propTimeInMillis.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GetStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCurrent, value.Current, null, null); + writer.WriteProperty(options, PropExistsTime, value.ExistsTime, null, null); + writer.WriteProperty(options, PropExistsTimeInMillis, value.ExistsTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropExistsTotal, value.ExistsTotal, null, null); + writer.WriteProperty(options, PropMissingTime, value.MissingTime, null, null); + writer.WriteProperty(options, PropMissingTimeInMillis, value.MissingTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropMissingTotal, value.MissingTotal, null, null); + writer.WriteProperty(options, PropTime, value.Time, null, null); + writer.WriteProperty(options, PropTimeInMillis, value.TimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GetStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GetStats.g.cs index 904bc434eba..83a17cf84e3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GetStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GetStats.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class GetStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCurrent = System.Text.Json.JsonEncodedText.Encode("current"); - private static readonly System.Text.Json.JsonEncodedText PropExistsTime = System.Text.Json.JsonEncodedText.Encode("exists_time"); - private static readonly System.Text.Json.JsonEncodedText PropExistsTimeInMillis = System.Text.Json.JsonEncodedText.Encode("exists_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropExistsTotal = System.Text.Json.JsonEncodedText.Encode("exists_total"); - private static readonly System.Text.Json.JsonEncodedText PropMissingTime = System.Text.Json.JsonEncodedText.Encode("missing_time"); - private static readonly System.Text.Json.JsonEncodedText PropMissingTimeInMillis = System.Text.Json.JsonEncodedText.Encode("missing_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropMissingTotal = System.Text.Json.JsonEncodedText.Encode("missing_total"); - private static readonly System.Text.Json.JsonEncodedText PropTime = System.Text.Json.JsonEncodedText.Encode("time"); - private static readonly System.Text.Json.JsonEncodedText PropTimeInMillis = System.Text.Json.JsonEncodedText.Encode("time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.GetStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCurrent = default; - LocalJsonValue propExistsTime = default; - LocalJsonValue propExistsTimeInMillis = default; - LocalJsonValue propExistsTotal = default; - LocalJsonValue propMissingTime = default; - LocalJsonValue propMissingTimeInMillis = default; - LocalJsonValue propMissingTotal = default; - LocalJsonValue propTime = default; - LocalJsonValue propTimeInMillis = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCurrent.TryReadProperty(ref reader, options, PropCurrent, null)) - { - continue; - } - - if (propExistsTime.TryReadProperty(ref reader, options, PropExistsTime, null)) - { - continue; - } - - if (propExistsTimeInMillis.TryReadProperty(ref reader, options, PropExistsTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propExistsTotal.TryReadProperty(ref reader, options, PropExistsTotal, null)) - { - continue; - } - - if (propMissingTime.TryReadProperty(ref reader, options, PropMissingTime, null)) - { - continue; - } - - if (propMissingTimeInMillis.TryReadProperty(ref reader, options, PropMissingTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propMissingTotal.TryReadProperty(ref reader, options, PropMissingTotal, null)) - { - continue; - } - - if (propTime.TryReadProperty(ref reader, options, PropTime, null)) - { - continue; - } - - if (propTimeInMillis.TryReadProperty(ref reader, options, PropTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.GetStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Current = propCurrent.Value, - ExistsTime = propExistsTime.Value, - ExistsTimeInMillis = propExistsTimeInMillis.Value, - ExistsTotal = propExistsTotal.Value, - MissingTime = propMissingTime.Value, - MissingTimeInMillis = propMissingTimeInMillis.Value, - MissingTotal = propMissingTotal.Value, - Time = propTime.Value, - TimeInMillis = propTimeInMillis.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GetStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCurrent, value.Current, null, null); - writer.WriteProperty(options, PropExistsTime, value.ExistsTime, null, null); - writer.WriteProperty(options, PropExistsTimeInMillis, value.ExistsTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropExistsTotal, value.ExistsTotal, null, null); - writer.WriteProperty(options, PropMissingTime, value.MissingTime, null, null); - writer.WriteProperty(options, PropMissingTimeInMillis, value.MissingTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropMissingTotal, value.MissingTotal, null, null); - writer.WriteProperty(options, PropTime, value.Time, null, null); - writer.WriteProperty(options, PropTimeInMillis, value.TimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.GetStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.GetStatsConverter))] public sealed partial class GetStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GlobalOrdinalFieldStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GlobalOrdinalFieldStats.Converters.g.cs new file mode 100644 index 00000000000..aba78e0af3f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GlobalOrdinalFieldStats.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class GlobalOrdinalFieldStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuildTime = System.Text.Json.JsonEncodedText.Encode("build_time"); + private static readonly System.Text.Json.JsonEncodedText PropBuildTimeInMillis = System.Text.Json.JsonEncodedText.Encode("build_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropShardMaxValueCount = System.Text.Json.JsonEncodedText.Encode("shard_max_value_count"); + + public override Elastic.Clients.Elasticsearch.GlobalOrdinalFieldStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBuildTime = default; + LocalJsonValue propBuildTimeInMillis = default; + LocalJsonValue propShardMaxValueCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuildTime.TryReadProperty(ref reader, options, PropBuildTime, null)) + { + continue; + } + + if (propBuildTimeInMillis.TryReadProperty(ref reader, options, PropBuildTimeInMillis, null)) + { + continue; + } + + if (propShardMaxValueCount.TryReadProperty(ref reader, options, PropShardMaxValueCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.GlobalOrdinalFieldStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BuildTime = propBuildTime.Value, + BuildTimeInMillis = propBuildTimeInMillis.Value, + ShardMaxValueCount = propShardMaxValueCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GlobalOrdinalFieldStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuildTime, value.BuildTime, null, null); + writer.WriteProperty(options, PropBuildTimeInMillis, value.BuildTimeInMillis, null, null); + writer.WriteProperty(options, PropShardMaxValueCount, value.ShardMaxValueCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GlobalOrdinalFieldStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GlobalOrdinalFieldStats.g.cs index 433ea30209f..9247d628bd6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GlobalOrdinalFieldStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GlobalOrdinalFieldStats.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class GlobalOrdinalFieldStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuildTime = System.Text.Json.JsonEncodedText.Encode("build_time"); - private static readonly System.Text.Json.JsonEncodedText PropBuildTimeInMillis = System.Text.Json.JsonEncodedText.Encode("build_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropShardMaxValueCount = System.Text.Json.JsonEncodedText.Encode("shard_max_value_count"); - - public override Elastic.Clients.Elasticsearch.GlobalOrdinalFieldStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBuildTime = default; - LocalJsonValue propBuildTimeInMillis = default; - LocalJsonValue propShardMaxValueCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuildTime.TryReadProperty(ref reader, options, PropBuildTime, null)) - { - continue; - } - - if (propBuildTimeInMillis.TryReadProperty(ref reader, options, PropBuildTimeInMillis, null)) - { - continue; - } - - if (propShardMaxValueCount.TryReadProperty(ref reader, options, PropShardMaxValueCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.GlobalOrdinalFieldStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BuildTime = propBuildTime.Value, - BuildTimeInMillis = propBuildTimeInMillis.Value, - ShardMaxValueCount = propShardMaxValueCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GlobalOrdinalFieldStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuildTime, value.BuildTime, null, null); - writer.WriteProperty(options, PropBuildTimeInMillis, value.BuildTimeInMillis, null, null); - writer.WriteProperty(options, PropShardMaxValueCount, value.ShardMaxValueCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.GlobalOrdinalFieldStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.GlobalOrdinalFieldStatsConverter))] public sealed partial class GlobalOrdinalFieldStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GlobalOrdinalsStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GlobalOrdinalsStats.Converters.g.cs new file mode 100644 index 00000000000..dca273f8f87 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GlobalOrdinalsStats.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class GlobalOrdinalsStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuildTime = System.Text.Json.JsonEncodedText.Encode("build_time"); + private static readonly System.Text.Json.JsonEncodedText PropBuildTimeInMillis = System.Text.Json.JsonEncodedText.Encode("build_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + + public override Elastic.Clients.Elasticsearch.GlobalOrdinalsStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBuildTime = default; + LocalJsonValue propBuildTimeInMillis = default; + LocalJsonValue?> propFields = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuildTime.TryReadProperty(ref reader, options, PropBuildTime, null)) + { + continue; + } + + if (propBuildTimeInMillis.TryReadProperty(ref reader, options, PropBuildTimeInMillis, null)) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.GlobalOrdinalsStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BuildTime = propBuildTime.Value, + BuildTimeInMillis = propBuildTimeInMillis.Value, + Fields = propFields.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GlobalOrdinalsStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuildTime, value.BuildTime, null, null); + writer.WriteProperty(options, PropBuildTimeInMillis, value.BuildTimeInMillis, null, null); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GlobalOrdinalsStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GlobalOrdinalsStats.g.cs index 8c90ed483b9..ccf111e8cfe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GlobalOrdinalsStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GlobalOrdinalsStats.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class GlobalOrdinalsStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuildTime = System.Text.Json.JsonEncodedText.Encode("build_time"); - private static readonly System.Text.Json.JsonEncodedText PropBuildTimeInMillis = System.Text.Json.JsonEncodedText.Encode("build_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - - public override Elastic.Clients.Elasticsearch.GlobalOrdinalsStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBuildTime = default; - LocalJsonValue propBuildTimeInMillis = default; - LocalJsonValue?> propFields = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuildTime.TryReadProperty(ref reader, options, PropBuildTime, null)) - { - continue; - } - - if (propBuildTimeInMillis.TryReadProperty(ref reader, options, PropBuildTimeInMillis, null)) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.GlobalOrdinalsStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BuildTime = propBuildTime.Value, - BuildTimeInMillis = propBuildTimeInMillis.Value, - Fields = propFields.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.GlobalOrdinalsStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuildTime, value.BuildTime, null, null); - writer.WriteProperty(options, PropBuildTimeInMillis, value.BuildTimeInMillis, null, null); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.GlobalOrdinalsStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.GlobalOrdinalsStatsConverter))] public sealed partial class GlobalOrdinalsStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Connection.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Connection.Converters.g.cs new file mode 100644 index 00000000000..efdcae6c205 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Connection.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Graph.Json; + +public sealed partial class ConnectionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + private static readonly System.Text.Json.JsonEncodedText PropTarget = System.Text.Json.JsonEncodedText.Encode("target"); + private static readonly System.Text.Json.JsonEncodedText PropWeight = System.Text.Json.JsonEncodedText.Encode("weight"); + + public override Elastic.Clients.Elasticsearch.Graph.Connection Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDocCount = default; + LocalJsonValue propSource = default; + LocalJsonValue propTarget = default; + LocalJsonValue propWeight = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (propTarget.TryReadProperty(ref reader, options, PropTarget, null)) + { + continue; + } + + if (propWeight.TryReadProperty(ref reader, options, PropWeight, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Graph.Connection(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DocCount = propDocCount.Value, + Source = propSource.Value, + Target = propTarget.Value, + Weight = propWeight.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Graph.Connection value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteProperty(options, PropTarget, value.Target, null, null); + writer.WriteProperty(options, PropWeight, value.Weight, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Connection.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Connection.g.cs index b1fc8d21624..b1e5ff06dc0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Connection.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Connection.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Graph; -internal sealed partial class ConnectionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - private static readonly System.Text.Json.JsonEncodedText PropTarget = System.Text.Json.JsonEncodedText.Encode("target"); - private static readonly System.Text.Json.JsonEncodedText PropWeight = System.Text.Json.JsonEncodedText.Encode("weight"); - - public override Elastic.Clients.Elasticsearch.Graph.Connection Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDocCount = default; - LocalJsonValue propSource = default; - LocalJsonValue propTarget = default; - LocalJsonValue propWeight = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (propTarget.TryReadProperty(ref reader, options, PropTarget, null)) - { - continue; - } - - if (propWeight.TryReadProperty(ref reader, options, PropWeight, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Graph.Connection(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DocCount = propDocCount.Value, - Source = propSource.Value, - Target = propTarget.Value, - Weight = propWeight.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Graph.Connection value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteProperty(options, PropTarget, value.Target, null, null); - writer.WriteProperty(options, PropWeight, value.Weight, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Graph.ConnectionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Graph.Json.ConnectionConverter))] public sealed partial class Connection { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/ExploreControls.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/ExploreControls.Converters.g.cs new file mode 100644 index 00000000000..8a0c8712ee0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/ExploreControls.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Graph.Json; + +public sealed partial class ExploreControlsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSampleDiversity = System.Text.Json.JsonEncodedText.Encode("sample_diversity"); + private static readonly System.Text.Json.JsonEncodedText PropSampleSize = System.Text.Json.JsonEncodedText.Encode("sample_size"); + private static readonly System.Text.Json.JsonEncodedText PropTimeout = System.Text.Json.JsonEncodedText.Encode("timeout"); + private static readonly System.Text.Json.JsonEncodedText PropUseSignificance = System.Text.Json.JsonEncodedText.Encode("use_significance"); + + public override Elastic.Clients.Elasticsearch.Graph.ExploreControls Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propSampleDiversity = default; + LocalJsonValue propSampleSize = default; + LocalJsonValue propTimeout = default; + LocalJsonValue propUseSignificance = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSampleDiversity.TryReadProperty(ref reader, options, PropSampleDiversity, null)) + { + continue; + } + + if (propSampleSize.TryReadProperty(ref reader, options, PropSampleSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeout.TryReadProperty(ref reader, options, PropTimeout, null)) + { + continue; + } + + if (propUseSignificance.TryReadProperty(ref reader, options, PropUseSignificance, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Graph.ExploreControls(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + SampleDiversity = propSampleDiversity.Value, + SampleSize = propSampleSize.Value, + Timeout = propTimeout.Value, + UseSignificance = propUseSignificance.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Graph.ExploreControls value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSampleDiversity, value.SampleDiversity, null, null); + writer.WriteProperty(options, PropSampleSize, value.SampleSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeout, value.Timeout, null, null); + writer.WriteProperty(options, PropUseSignificance, value.UseSignificance, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/ExploreControls.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/ExploreControls.g.cs index a448ca08899..0e13d758e5d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/ExploreControls.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/ExploreControls.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Graph; -internal sealed partial class ExploreControlsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSampleDiversity = System.Text.Json.JsonEncodedText.Encode("sample_diversity"); - private static readonly System.Text.Json.JsonEncodedText PropSampleSize = System.Text.Json.JsonEncodedText.Encode("sample_size"); - private static readonly System.Text.Json.JsonEncodedText PropTimeout = System.Text.Json.JsonEncodedText.Encode("timeout"); - private static readonly System.Text.Json.JsonEncodedText PropUseSignificance = System.Text.Json.JsonEncodedText.Encode("use_significance"); - - public override Elastic.Clients.Elasticsearch.Graph.ExploreControls Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propSampleDiversity = default; - LocalJsonValue propSampleSize = default; - LocalJsonValue propTimeout = default; - LocalJsonValue propUseSignificance = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSampleDiversity.TryReadProperty(ref reader, options, PropSampleDiversity, null)) - { - continue; - } - - if (propSampleSize.TryReadProperty(ref reader, options, PropSampleSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeout.TryReadProperty(ref reader, options, PropTimeout, null)) - { - continue; - } - - if (propUseSignificance.TryReadProperty(ref reader, options, PropUseSignificance, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Graph.ExploreControls(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - SampleDiversity = propSampleDiversity.Value, - SampleSize = propSampleSize.Value, - Timeout = propTimeout.Value, - UseSignificance = propUseSignificance.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Graph.ExploreControls value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSampleDiversity, value.SampleDiversity, null, null); - writer.WriteProperty(options, PropSampleSize, value.SampleSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeout, value.Timeout, null, null); - writer.WriteProperty(options, PropUseSignificance, value.UseSignificance, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Graph.ExploreControlsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Graph.Json.ExploreControlsConverter))] public sealed partial class ExploreControls { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Hop.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Hop.Converters.g.cs new file mode 100644 index 00000000000..7afeb301f42 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Hop.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Graph.Json; + +public sealed partial class HopConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropConnections = System.Text.Json.JsonEncodedText.Encode("connections"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropVertices = System.Text.Json.JsonEncodedText.Encode("vertices"); + + public override Elastic.Clients.Elasticsearch.Graph.Hop Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propConnections = default; + LocalJsonValue propQuery = default; + LocalJsonValue> propVertices = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propConnections.TryReadProperty(ref reader, options, PropConnections, null)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propVertices.TryReadProperty(ref reader, options, PropVertices, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Graph.Hop(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Connections = propConnections.Value, + Query = propQuery.Value, + Vertices = propVertices.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Graph.Hop value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropConnections, value.Connections, null, null); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropVertices, value.Vertices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Hop.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Hop.g.cs index e29e7074a25..dcde0554dec 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Hop.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Hop.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Graph; -internal sealed partial class HopConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropConnections = System.Text.Json.JsonEncodedText.Encode("connections"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropVertices = System.Text.Json.JsonEncodedText.Encode("vertices"); - - public override Elastic.Clients.Elasticsearch.Graph.Hop Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propConnections = default; - LocalJsonValue propQuery = default; - LocalJsonValue> propVertices = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propConnections.TryReadProperty(ref reader, options, PropConnections, null)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propVertices.TryReadProperty(ref reader, options, PropVertices, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Graph.Hop(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Connections = propConnections.Value, - Query = propQuery.Value, - Vertices = propVertices.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Graph.Hop value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropConnections, value.Connections, null, null); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropVertices, value.Vertices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Graph.HopConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Graph.Json.HopConverter))] public sealed partial class Hop { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/SampleDiversity.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/SampleDiversity.Converters.g.cs new file mode 100644 index 00000000000..0a3bb78fd1d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/SampleDiversity.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Graph.Json; + +public sealed partial class SampleDiversityConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropMaxDocsPerValue = System.Text.Json.JsonEncodedText.Encode("max_docs_per_value"); + + public override Elastic.Clients.Elasticsearch.Graph.SampleDiversity Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propMaxDocsPerValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propMaxDocsPerValue.TryReadProperty(ref reader, options, PropMaxDocsPerValue, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Graph.SampleDiversity(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + MaxDocsPerValue = propMaxDocsPerValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Graph.SampleDiversity value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropMaxDocsPerValue, value.MaxDocsPerValue, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/SampleDiversity.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/SampleDiversity.g.cs index 379459a31c1..a5f4fc942db 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/SampleDiversity.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/SampleDiversity.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Graph; -internal sealed partial class SampleDiversityConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropMaxDocsPerValue = System.Text.Json.JsonEncodedText.Encode("max_docs_per_value"); - - public override Elastic.Clients.Elasticsearch.Graph.SampleDiversity Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propMaxDocsPerValue = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propMaxDocsPerValue.TryReadProperty(ref reader, options, PropMaxDocsPerValue, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Graph.SampleDiversity(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - MaxDocsPerValue = propMaxDocsPerValue.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Graph.SampleDiversity value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropMaxDocsPerValue, value.MaxDocsPerValue, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Graph.SampleDiversityConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Graph.Json.SampleDiversityConverter))] public sealed partial class SampleDiversity { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Vertex.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Vertex.Converters.g.cs new file mode 100644 index 00000000000..711376ff0d7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Vertex.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Graph.Json; + +public sealed partial class VertexConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDepth = System.Text.Json.JsonEncodedText.Encode("depth"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropTerm = System.Text.Json.JsonEncodedText.Encode("term"); + private static readonly System.Text.Json.JsonEncodedText PropWeight = System.Text.Json.JsonEncodedText.Encode("weight"); + + public override Elastic.Clients.Elasticsearch.Graph.Vertex Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDepth = default; + LocalJsonValue propField = default; + LocalJsonValue propTerm = default; + LocalJsonValue propWeight = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDepth.TryReadProperty(ref reader, options, PropDepth, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propTerm.TryReadProperty(ref reader, options, PropTerm, null)) + { + continue; + } + + if (propWeight.TryReadProperty(ref reader, options, PropWeight, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Graph.Vertex(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Depth = propDepth.Value, + Field = propField.Value, + Term = propTerm.Value, + Weight = propWeight.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Graph.Vertex value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDepth, value.Depth, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropTerm, value.Term, null, null); + writer.WriteProperty(options, PropWeight, value.Weight, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Vertex.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Vertex.g.cs index b6efaad191f..ea4aebece39 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Vertex.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/Vertex.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Graph; -internal sealed partial class VertexConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDepth = System.Text.Json.JsonEncodedText.Encode("depth"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropTerm = System.Text.Json.JsonEncodedText.Encode("term"); - private static readonly System.Text.Json.JsonEncodedText PropWeight = System.Text.Json.JsonEncodedText.Encode("weight"); - - public override Elastic.Clients.Elasticsearch.Graph.Vertex Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDepth = default; - LocalJsonValue propField = default; - LocalJsonValue propTerm = default; - LocalJsonValue propWeight = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDepth.TryReadProperty(ref reader, options, PropDepth, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propTerm.TryReadProperty(ref reader, options, PropTerm, null)) - { - continue; - } - - if (propWeight.TryReadProperty(ref reader, options, PropWeight, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Graph.Vertex(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Depth = propDepth.Value, - Field = propField.Value, - Term = propTerm.Value, - Weight = propWeight.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Graph.Vertex value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDepth, value.Depth, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropTerm, value.Term, null, null); - writer.WriteProperty(options, PropWeight, value.Weight, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Graph.VertexConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Graph.Json.VertexConverter))] public sealed partial class Vertex { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/VertexDefinition.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/VertexDefinition.Converters.g.cs new file mode 100644 index 00000000000..f91d1296339 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/VertexDefinition.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Graph.Json; + +public sealed partial class VertexDefinitionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExclude = System.Text.Json.JsonEncodedText.Encode("exclude"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropInclude = System.Text.Json.JsonEncodedText.Encode("include"); + private static readonly System.Text.Json.JsonEncodedText PropMinDocCount = System.Text.Json.JsonEncodedText.Encode("min_doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropShardMinDocCount = System.Text.Json.JsonEncodedText.Encode("shard_min_doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + + public override Elastic.Clients.Elasticsearch.Graph.VertexDefinition Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propExclude = default; + LocalJsonValue propField = default; + LocalJsonValue?> propInclude = default; + LocalJsonValue propMinDocCount = default; + LocalJsonValue propShardMinDocCount = default; + LocalJsonValue propSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExclude.TryReadProperty(ref reader, options, PropExclude, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propInclude.TryReadProperty(ref reader, options, PropInclude, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propMinDocCount.TryReadProperty(ref reader, options, PropMinDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propShardMinDocCount.TryReadProperty(ref reader, options, PropShardMinDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Graph.VertexDefinition(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Exclude = propExclude.Value, + Field = propField.Value, + Include = propInclude.Value, + MinDocCount = propMinDocCount.Value, + ShardMinDocCount = propShardMinDocCount.Value, + Size = propSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Graph.VertexDefinition value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExclude, value.Exclude, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropInclude, value.Include, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMinDocCount, value.MinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropShardMinDocCount, value.ShardMinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/VertexDefinition.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/VertexDefinition.g.cs index 428fe74552a..fa5beaf0066 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/VertexDefinition.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/VertexDefinition.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Graph; -internal sealed partial class VertexDefinitionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExclude = System.Text.Json.JsonEncodedText.Encode("exclude"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropInclude = System.Text.Json.JsonEncodedText.Encode("include"); - private static readonly System.Text.Json.JsonEncodedText PropMinDocCount = System.Text.Json.JsonEncodedText.Encode("min_doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropShardMinDocCount = System.Text.Json.JsonEncodedText.Encode("shard_min_doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - - public override Elastic.Clients.Elasticsearch.Graph.VertexDefinition Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propExclude = default; - LocalJsonValue propField = default; - LocalJsonValue?> propInclude = default; - LocalJsonValue propMinDocCount = default; - LocalJsonValue propShardMinDocCount = default; - LocalJsonValue propSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExclude.TryReadProperty(ref reader, options, PropExclude, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propInclude.TryReadProperty(ref reader, options, PropInclude, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propMinDocCount.TryReadProperty(ref reader, options, PropMinDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propShardMinDocCount.TryReadProperty(ref reader, options, PropShardMinDocCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Graph.VertexDefinition(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Exclude = propExclude.Value, - Field = propField.Value, - Include = propInclude.Value, - MinDocCount = propMinDocCount.Value, - ShardMinDocCount = propShardMinDocCount.Value, - Size = propSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Graph.VertexDefinition value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExclude, value.Exclude, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropInclude, value.Include, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMinDocCount, value.MinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropShardMinDocCount, value.ShardMinDocCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Graph.VertexDefinitionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Graph.Json.VertexDefinitionConverter))] public sealed partial class VertexDefinition { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/VertexInclude.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/VertexInclude.Converters.g.cs new file mode 100644 index 00000000000..487ce5093f8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/VertexInclude.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Graph.Json; + +public sealed partial class VertexIncludeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropTerm = System.Text.Json.JsonEncodedText.Encode("term"); + + public override Elastic.Clients.Elasticsearch.Graph.VertexInclude Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) + { + var value = reader.ReadValue(options, null); + return new Elastic.Clients.Elasticsearch.Graph.VertexInclude(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Term = value + }; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propTerm = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTerm.TryReadProperty(ref reader, options, PropTerm, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Graph.VertexInclude(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Term = propTerm.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Graph.VertexInclude value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTerm, value.Term, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/VertexInclude.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/VertexInclude.g.cs index cb07853bf5c..aca434f5ed4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/VertexInclude.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Graph/VertexInclude.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Graph; -internal sealed partial class VertexIncludeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropTerm = System.Text.Json.JsonEncodedText.Encode("term"); - - public override Elastic.Clients.Elasticsearch.Graph.VertexInclude Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) - { - var value = reader.ReadValue(options, null); - return new Elastic.Clients.Elasticsearch.Graph.VertexInclude(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Term = value - }; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propTerm = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTerm.TryReadProperty(ref reader, options, PropTerm, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Graph.VertexInclude(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Term = propTerm.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Graph.VertexInclude value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTerm, value.Term, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Graph.VertexIncludeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Graph.Json.VertexIncludeConverter))] public sealed partial class VertexInclude { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/HealthStatus.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/HealthStatus.Converters.g.cs new file mode 100644 index 00000000000..972a15aa28d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/HealthStatus.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class HealthStatusConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberGreen = System.Text.Json.JsonEncodedText.Encode("green"); + private static readonly System.Text.Json.JsonEncodedText MemberGreen1 = System.Text.Json.JsonEncodedText.Encode("GREEN"); + private static readonly System.Text.Json.JsonEncodedText MemberRed = System.Text.Json.JsonEncodedText.Encode("red"); + private static readonly System.Text.Json.JsonEncodedText MemberRed1 = System.Text.Json.JsonEncodedText.Encode("RED"); + private static readonly System.Text.Json.JsonEncodedText MemberUnavailable = System.Text.Json.JsonEncodedText.Encode("unavailable"); + private static readonly System.Text.Json.JsonEncodedText MemberUnknown = System.Text.Json.JsonEncodedText.Encode("unknown"); + private static readonly System.Text.Json.JsonEncodedText MemberYellow = System.Text.Json.JsonEncodedText.Encode("yellow"); + private static readonly System.Text.Json.JsonEncodedText MemberYellow1 = System.Text.Json.JsonEncodedText.Encode("YELLOW"); + + public override Elastic.Clients.Elasticsearch.HealthStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberGreen) || reader.ValueTextEquals(MemberGreen1)) + { + return Elastic.Clients.Elasticsearch.HealthStatus.Green; + } + + if (reader.ValueTextEquals(MemberRed) || reader.ValueTextEquals(MemberRed1)) + { + return Elastic.Clients.Elasticsearch.HealthStatus.Red; + } + + if (reader.ValueTextEquals(MemberUnavailable)) + { + return Elastic.Clients.Elasticsearch.HealthStatus.Unavailable; + } + + if (reader.ValueTextEquals(MemberUnknown)) + { + return Elastic.Clients.Elasticsearch.HealthStatus.Unknown; + } + + if (reader.ValueTextEquals(MemberYellow) || reader.ValueTextEquals(MemberYellow1)) + { + return Elastic.Clients.Elasticsearch.HealthStatus.Yellow; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberGreen.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberGreen1.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.HealthStatus.Green; + } + + if (string.Equals(value, MemberRed.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberRed1.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.HealthStatus.Red; + } + + if (string.Equals(value, MemberUnavailable.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.HealthStatus.Unavailable; + } + + if (string.Equals(value, MemberUnknown.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.HealthStatus.Unknown; + } + + if (string.Equals(value, MemberYellow.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberYellow1.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.HealthStatus.Yellow; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.HealthStatus)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.HealthStatus value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.HealthStatus.Green: + writer.WriteStringValue(MemberGreen); + break; + case Elastic.Clients.Elasticsearch.HealthStatus.Red: + writer.WriteStringValue(MemberRed); + break; + case Elastic.Clients.Elasticsearch.HealthStatus.Unavailable: + writer.WriteStringValue(MemberUnavailable); + break; + case Elastic.Clients.Elasticsearch.HealthStatus.Unknown: + writer.WriteStringValue(MemberUnknown); + break; + case Elastic.Clients.Elasticsearch.HealthStatus.Yellow: + writer.WriteStringValue(MemberYellow); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.HealthStatus)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.HealthStatus ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.HealthStatus value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/HealthStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/HealthStatus.g.cs new file mode 100644 index 00000000000..9d75f7764f2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/HealthStatus.g.cs @@ -0,0 +1,54 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.HealthStatusConverter))] +public enum HealthStatus +{ + /// + /// + /// All shards are assigned. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "green")] + Green, + /// + /// + /// One or more primary shards are unassigned, so some data is unavailable. This can occur briefly during cluster startup as primary shards are assigned. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "red")] + Red, + [System.Runtime.Serialization.EnumMember(Value = "unavailable")] + Unavailable, + [System.Runtime.Serialization.EnumMember(Value = "unknown")] + Unknown, + /// + /// + /// All primary shards are assigned, but one or more replica shards are unassigned. If a node in the cluster fails, some data could be unavailable until that node is repaired. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "yellow")] + Yellow +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IBDistribution.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IBDistribution.Converters.g.cs new file mode 100644 index 00000000000..46bcb99183a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IBDistribution.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class IBDistributionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberLl = System.Text.Json.JsonEncodedText.Encode("ll"); + private static readonly System.Text.Json.JsonEncodedText MemberSpl = System.Text.Json.JsonEncodedText.Encode("spl"); + + public override Elastic.Clients.Elasticsearch.IBDistribution Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberLl)) + { + return Elastic.Clients.Elasticsearch.IBDistribution.Ll; + } + + if (reader.ValueTextEquals(MemberSpl)) + { + return Elastic.Clients.Elasticsearch.IBDistribution.Spl; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberLl.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IBDistribution.Ll; + } + + if (string.Equals(value, MemberSpl.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IBDistribution.Spl; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IBDistribution)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IBDistribution value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.IBDistribution.Ll: + writer.WriteStringValue(MemberLl); + break; + case Elastic.Clients.Elasticsearch.IBDistribution.Spl: + writer.WriteStringValue(MemberSpl); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IBDistribution)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.IBDistribution ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IBDistribution value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IBDistribution.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IBDistribution.g.cs new file mode 100644 index 00000000000..8a1b2e6529c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IBDistribution.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.IBDistributionConverter))] +public enum IBDistribution +{ + [System.Runtime.Serialization.EnumMember(Value = "ll")] + Ll, + [System.Runtime.Serialization.EnumMember(Value = "spl")] + Spl +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IBLambda.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IBLambda.Converters.g.cs new file mode 100644 index 00000000000..756e532f7c2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IBLambda.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class IBLambdaConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberDf = System.Text.Json.JsonEncodedText.Encode("df"); + private static readonly System.Text.Json.JsonEncodedText MemberTtf = System.Text.Json.JsonEncodedText.Encode("ttf"); + + public override Elastic.Clients.Elasticsearch.IBLambda Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberDf)) + { + return Elastic.Clients.Elasticsearch.IBLambda.Df; + } + + if (reader.ValueTextEquals(MemberTtf)) + { + return Elastic.Clients.Elasticsearch.IBLambda.Ttf; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberDf.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IBLambda.Df; + } + + if (string.Equals(value, MemberTtf.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IBLambda.Ttf; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IBLambda)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IBLambda value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.IBLambda.Df: + writer.WriteStringValue(MemberDf); + break; + case Elastic.Clients.Elasticsearch.IBLambda.Ttf: + writer.WriteStringValue(MemberTtf); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IBLambda)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.IBLambda ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IBLambda value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IBLambda.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IBLambda.g.cs new file mode 100644 index 00000000000..474c60a52d9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IBLambda.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.IBLambdaConverter))] +public enum IBLambda +{ + [System.Runtime.Serialization.EnumMember(Value = "df")] + Df, + [System.Runtime.Serialization.EnumMember(Value = "ttf")] + Ttf +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Actions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Actions.Converters.g.cs new file mode 100644 index 00000000000..345c6290210 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Actions.Converters.g.cs @@ -0,0 +1,177 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class ActionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllocate = System.Text.Json.JsonEncodedText.Encode("allocate"); + private static readonly System.Text.Json.JsonEncodedText PropDelete = System.Text.Json.JsonEncodedText.Encode("delete"); + private static readonly System.Text.Json.JsonEncodedText PropDownsample = System.Text.Json.JsonEncodedText.Encode("downsample"); + private static readonly System.Text.Json.JsonEncodedText PropForcemerge = System.Text.Json.JsonEncodedText.Encode("forcemerge"); + private static readonly System.Text.Json.JsonEncodedText PropFreeze = System.Text.Json.JsonEncodedText.Encode("freeze"); + private static readonly System.Text.Json.JsonEncodedText PropMigrate = System.Text.Json.JsonEncodedText.Encode("migrate"); + private static readonly System.Text.Json.JsonEncodedText PropReadonly = System.Text.Json.JsonEncodedText.Encode("readonly"); + private static readonly System.Text.Json.JsonEncodedText PropRollover = System.Text.Json.JsonEncodedText.Encode("rollover"); + private static readonly System.Text.Json.JsonEncodedText PropSearchableSnapshot = System.Text.Json.JsonEncodedText.Encode("searchable_snapshot"); + private static readonly System.Text.Json.JsonEncodedText PropSetPriority = System.Text.Json.JsonEncodedText.Encode("set_priority"); + private static readonly System.Text.Json.JsonEncodedText PropShrink = System.Text.Json.JsonEncodedText.Encode("shrink"); + private static readonly System.Text.Json.JsonEncodedText PropUnfollow = System.Text.Json.JsonEncodedText.Encode("unfollow"); + private static readonly System.Text.Json.JsonEncodedText PropWaitForSnapshot = System.Text.Json.JsonEncodedText.Encode("wait_for_snapshot"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Actions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllocate = default; + LocalJsonValue propDelete = default; + LocalJsonValue propDownsample = default; + LocalJsonValue propForcemerge = default; + LocalJsonValue propFreeze = default; + LocalJsonValue propMigrate = default; + LocalJsonValue propReadonly = default; + LocalJsonValue propRollover = default; + LocalJsonValue propSearchableSnapshot = default; + LocalJsonValue propSetPriority = default; + LocalJsonValue propShrink = default; + LocalJsonValue propUnfollow = default; + LocalJsonValue propWaitForSnapshot = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllocate.TryReadProperty(ref reader, options, PropAllocate, null)) + { + continue; + } + + if (propDelete.TryReadProperty(ref reader, options, PropDelete, null)) + { + continue; + } + + if (propDownsample.TryReadProperty(ref reader, options, PropDownsample, null)) + { + continue; + } + + if (propForcemerge.TryReadProperty(ref reader, options, PropForcemerge, null)) + { + continue; + } + + if (propFreeze.TryReadProperty(ref reader, options, PropFreeze, null)) + { + continue; + } + + if (propMigrate.TryReadProperty(ref reader, options, PropMigrate, null)) + { + continue; + } + + if (propReadonly.TryReadProperty(ref reader, options, PropReadonly, null)) + { + continue; + } + + if (propRollover.TryReadProperty(ref reader, options, PropRollover, null)) + { + continue; + } + + if (propSearchableSnapshot.TryReadProperty(ref reader, options, PropSearchableSnapshot, null)) + { + continue; + } + + if (propSetPriority.TryReadProperty(ref reader, options, PropSetPriority, null)) + { + continue; + } + + if (propShrink.TryReadProperty(ref reader, options, PropShrink, null)) + { + continue; + } + + if (propUnfollow.TryReadProperty(ref reader, options, PropUnfollow, null)) + { + continue; + } + + if (propWaitForSnapshot.TryReadProperty(ref reader, options, PropWaitForSnapshot, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Actions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Allocate = propAllocate.Value, + Delete = propDelete.Value, + Downsample = propDownsample.Value, + Forcemerge = propForcemerge.Value, +#pragma warning disable CS0618 + Freeze = propFreeze.Value +#pragma warning restore CS0618 +, + Migrate = propMigrate.Value, + Readonly = propReadonly.Value, + Rollover = propRollover.Value, + SearchableSnapshot = propSearchableSnapshot.Value, + SetPriority = propSetPriority.Value, + Shrink = propShrink.Value, + Unfollow = propUnfollow.Value, + WaitForSnapshot = propWaitForSnapshot.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Actions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllocate, value.Allocate, null, null); + writer.WriteProperty(options, PropDelete, value.Delete, null, null); + writer.WriteProperty(options, PropDownsample, value.Downsample, null, null); + writer.WriteProperty(options, PropForcemerge, value.Forcemerge, null, null); +#pragma warning disable CS0618 + writer.WriteProperty(options, PropFreeze, value.Freeze, null, null) +#pragma warning restore CS0618 + ; + writer.WriteProperty(options, PropMigrate, value.Migrate, null, null); + writer.WriteProperty(options, PropReadonly, value.Readonly, null, null); + writer.WriteProperty(options, PropRollover, value.Rollover, null, null); + writer.WriteProperty(options, PropSearchableSnapshot, value.SearchableSnapshot, null, null); + writer.WriteProperty(options, PropSetPriority, value.SetPriority, null, null); + writer.WriteProperty(options, PropShrink, value.Shrink, null, null); + writer.WriteProperty(options, PropUnfollow, value.Unfollow, null, null); + writer.WriteProperty(options, PropWaitForSnapshot, value.WaitForSnapshot, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Actions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Actions.g.cs index 7a9a1e04a1a..e1a1030c132 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Actions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Actions.g.cs @@ -23,160 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; -internal sealed partial class ActionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllocate = System.Text.Json.JsonEncodedText.Encode("allocate"); - private static readonly System.Text.Json.JsonEncodedText PropDelete = System.Text.Json.JsonEncodedText.Encode("delete"); - private static readonly System.Text.Json.JsonEncodedText PropDownsample = System.Text.Json.JsonEncodedText.Encode("downsample"); - private static readonly System.Text.Json.JsonEncodedText PropForcemerge = System.Text.Json.JsonEncodedText.Encode("forcemerge"); - private static readonly System.Text.Json.JsonEncodedText PropFreeze = System.Text.Json.JsonEncodedText.Encode("freeze"); - private static readonly System.Text.Json.JsonEncodedText PropMigrate = System.Text.Json.JsonEncodedText.Encode("migrate"); - private static readonly System.Text.Json.JsonEncodedText PropReadonly = System.Text.Json.JsonEncodedText.Encode("readonly"); - private static readonly System.Text.Json.JsonEncodedText PropRollover = System.Text.Json.JsonEncodedText.Encode("rollover"); - private static readonly System.Text.Json.JsonEncodedText PropSearchableSnapshot = System.Text.Json.JsonEncodedText.Encode("searchable_snapshot"); - private static readonly System.Text.Json.JsonEncodedText PropSetPriority = System.Text.Json.JsonEncodedText.Encode("set_priority"); - private static readonly System.Text.Json.JsonEncodedText PropShrink = System.Text.Json.JsonEncodedText.Encode("shrink"); - private static readonly System.Text.Json.JsonEncodedText PropUnfollow = System.Text.Json.JsonEncodedText.Encode("unfollow"); - private static readonly System.Text.Json.JsonEncodedText PropWaitForSnapshot = System.Text.Json.JsonEncodedText.Encode("wait_for_snapshot"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Actions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllocate = default; - LocalJsonValue propDelete = default; - LocalJsonValue propDownsample = default; - LocalJsonValue propForcemerge = default; - LocalJsonValue propFreeze = default; - LocalJsonValue propMigrate = default; - LocalJsonValue propReadonly = default; - LocalJsonValue propRollover = default; - LocalJsonValue propSearchableSnapshot = default; - LocalJsonValue propSetPriority = default; - LocalJsonValue propShrink = default; - LocalJsonValue propUnfollow = default; - LocalJsonValue propWaitForSnapshot = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllocate.TryReadProperty(ref reader, options, PropAllocate, null)) - { - continue; - } - - if (propDelete.TryReadProperty(ref reader, options, PropDelete, null)) - { - continue; - } - - if (propDownsample.TryReadProperty(ref reader, options, PropDownsample, null)) - { - continue; - } - - if (propForcemerge.TryReadProperty(ref reader, options, PropForcemerge, null)) - { - continue; - } - - if (propFreeze.TryReadProperty(ref reader, options, PropFreeze, null)) - { - continue; - } - - if (propMigrate.TryReadProperty(ref reader, options, PropMigrate, null)) - { - continue; - } - - if (propReadonly.TryReadProperty(ref reader, options, PropReadonly, null)) - { - continue; - } - - if (propRollover.TryReadProperty(ref reader, options, PropRollover, null)) - { - continue; - } - - if (propSearchableSnapshot.TryReadProperty(ref reader, options, PropSearchableSnapshot, null)) - { - continue; - } - - if (propSetPriority.TryReadProperty(ref reader, options, PropSetPriority, null)) - { - continue; - } - - if (propShrink.TryReadProperty(ref reader, options, PropShrink, null)) - { - continue; - } - - if (propUnfollow.TryReadProperty(ref reader, options, PropUnfollow, null)) - { - continue; - } - - if (propWaitForSnapshot.TryReadProperty(ref reader, options, PropWaitForSnapshot, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Actions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Allocate = propAllocate.Value, - Delete = propDelete.Value, - Downsample = propDownsample.Value, - Forcemerge = propForcemerge.Value, -#pragma warning disable CS0618 - Freeze = propFreeze.Value -#pragma warning restore CS0618 -, - Migrate = propMigrate.Value, - Readonly = propReadonly.Value, - Rollover = propRollover.Value, - SearchableSnapshot = propSearchableSnapshot.Value, - SetPriority = propSetPriority.Value, - Shrink = propShrink.Value, - Unfollow = propUnfollow.Value, - WaitForSnapshot = propWaitForSnapshot.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Actions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllocate, value.Allocate, null, null); - writer.WriteProperty(options, PropDelete, value.Delete, null, null); - writer.WriteProperty(options, PropDownsample, value.Downsample, null, null); - writer.WriteProperty(options, PropForcemerge, value.Forcemerge, null, null); -#pragma warning disable CS0618 - writer.WriteProperty(options, PropFreeze, value.Freeze, null, null) -#pragma warning restore CS0618 - ; - writer.WriteProperty(options, PropMigrate, value.Migrate, null, null); - writer.WriteProperty(options, PropReadonly, value.Readonly, null, null); - writer.WriteProperty(options, PropRollover, value.Rollover, null, null); - writer.WriteProperty(options, PropSearchableSnapshot, value.SearchableSnapshot, null, null); - writer.WriteProperty(options, PropSetPriority, value.SetPriority, null, null); - writer.WriteProperty(options, PropShrink, value.Shrink, null, null); - writer.WriteProperty(options, PropUnfollow, value.Unfollow, null, null); - writer.WriteProperty(options, PropWaitForSnapshot, value.WaitForSnapshot, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ActionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.ActionsConverter))] public sealed partial class Actions { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/AllocateAction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/AllocateAction.Converters.g.cs new file mode 100644 index 00000000000..7d8db70b65f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/AllocateAction.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class AllocateActionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExclude = System.Text.Json.JsonEncodedText.Encode("exclude"); + private static readonly System.Text.Json.JsonEncodedText PropInclude = System.Text.Json.JsonEncodedText.Encode("include"); + private static readonly System.Text.Json.JsonEncodedText PropNumberOfReplicas = System.Text.Json.JsonEncodedText.Encode("number_of_replicas"); + private static readonly System.Text.Json.JsonEncodedText PropRequire = System.Text.Json.JsonEncodedText.Encode("require"); + private static readonly System.Text.Json.JsonEncodedText PropTotalShardsPerNode = System.Text.Json.JsonEncodedText.Encode("total_shards_per_node"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.AllocateAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propExclude = default; + LocalJsonValue?> propInclude = default; + LocalJsonValue propNumberOfReplicas = default; + LocalJsonValue?> propRequire = default; + LocalJsonValue propTotalShardsPerNode = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExclude.TryReadProperty(ref reader, options, PropExclude, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propInclude.TryReadProperty(ref reader, options, PropInclude, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propNumberOfReplicas.TryReadProperty(ref reader, options, PropNumberOfReplicas, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRequire.TryReadProperty(ref reader, options, PropRequire, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propTotalShardsPerNode.TryReadProperty(ref reader, options, PropTotalShardsPerNode, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.AllocateAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Exclude = propExclude.Value, + Include = propInclude.Value, + NumberOfReplicas = propNumberOfReplicas.Value, + Require = propRequire.Value, + TotalShardsPerNode = propTotalShardsPerNode.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.AllocateAction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExclude, value.Exclude, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropInclude, value.Include, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNumberOfReplicas, value.NumberOfReplicas, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRequire, value.Require, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropTotalShardsPerNode, value.TotalShardsPerNode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/AllocateAction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/AllocateAction.g.cs index b7960569a41..06b645c8031 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/AllocateAction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/AllocateAction.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; -internal sealed partial class AllocateActionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExclude = System.Text.Json.JsonEncodedText.Encode("exclude"); - private static readonly System.Text.Json.JsonEncodedText PropInclude = System.Text.Json.JsonEncodedText.Encode("include"); - private static readonly System.Text.Json.JsonEncodedText PropNumberOfReplicas = System.Text.Json.JsonEncodedText.Encode("number_of_replicas"); - private static readonly System.Text.Json.JsonEncodedText PropRequire = System.Text.Json.JsonEncodedText.Encode("require"); - private static readonly System.Text.Json.JsonEncodedText PropTotalShardsPerNode = System.Text.Json.JsonEncodedText.Encode("total_shards_per_node"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.AllocateAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propExclude = default; - LocalJsonValue?> propInclude = default; - LocalJsonValue propNumberOfReplicas = default; - LocalJsonValue?> propRequire = default; - LocalJsonValue propTotalShardsPerNode = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExclude.TryReadProperty(ref reader, options, PropExclude, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propInclude.TryReadProperty(ref reader, options, PropInclude, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propNumberOfReplicas.TryReadProperty(ref reader, options, PropNumberOfReplicas, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRequire.TryReadProperty(ref reader, options, PropRequire, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propTotalShardsPerNode.TryReadProperty(ref reader, options, PropTotalShardsPerNode, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.AllocateAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Exclude = propExclude.Value, - Include = propInclude.Value, - NumberOfReplicas = propNumberOfReplicas.Value, - Require = propRequire.Value, - TotalShardsPerNode = propTotalShardsPerNode.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.AllocateAction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExclude, value.Exclude, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropInclude, value.Include, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNumberOfReplicas, value.NumberOfReplicas, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRequire, value.Require, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropTotalShardsPerNode, value.TotalShardsPerNode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.AllocateActionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.AllocateActionConverter))] public sealed partial class AllocateAction { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/DeleteAction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/DeleteAction.Converters.g.cs new file mode 100644 index 00000000000..fc651616711 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/DeleteAction.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class DeleteActionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDeleteSearchableSnapshot = System.Text.Json.JsonEncodedText.Encode("delete_searchable_snapshot"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDeleteSearchableSnapshot = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDeleteSearchableSnapshot.TryReadProperty(ref reader, options, PropDeleteSearchableSnapshot, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DeleteSearchableSnapshot = propDeleteSearchableSnapshot.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteAction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDeleteSearchableSnapshot, value.DeleteSearchableSnapshot, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/DeleteAction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/DeleteAction.g.cs index e86feb0ec45..d0d017a1ed8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/DeleteAction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/DeleteAction.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; -internal sealed partial class DeleteActionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDeleteSearchableSnapshot = System.Text.Json.JsonEncodedText.Encode("delete_searchable_snapshot"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDeleteSearchableSnapshot = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDeleteSearchableSnapshot.TryReadProperty(ref reader, options, PropDeleteSearchableSnapshot, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DeleteSearchableSnapshot = propDeleteSearchableSnapshot.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteAction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDeleteSearchableSnapshot, value.DeleteSearchableSnapshot, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DeleteActionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.DeleteActionConverter))] public sealed partial class DeleteAction { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/DownsampleAction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/DownsampleAction.Converters.g.cs new file mode 100644 index 00000000000..9abd971eec6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/DownsampleAction.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class DownsampleActionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFixedInterval = System.Text.Json.JsonEncodedText.Encode("fixed_interval"); + private static readonly System.Text.Json.JsonEncodedText PropWaitTimeout = System.Text.Json.JsonEncodedText.Encode("wait_timeout"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DownsampleAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFixedInterval = default; + LocalJsonValue propWaitTimeout = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFixedInterval.TryReadProperty(ref reader, options, PropFixedInterval, null)) + { + continue; + } + + if (propWaitTimeout.TryReadProperty(ref reader, options, PropWaitTimeout, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DownsampleAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FixedInterval = propFixedInterval.Value, + WaitTimeout = propWaitTimeout.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DownsampleAction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFixedInterval, value.FixedInterval, null, null); + writer.WriteProperty(options, PropWaitTimeout, value.WaitTimeout, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/DownsampleAction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/DownsampleAction.g.cs index a929ce72c72..86b084cd1e6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/DownsampleAction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/DownsampleAction.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; -internal sealed partial class DownsampleActionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFixedInterval = System.Text.Json.JsonEncodedText.Encode("fixed_interval"); - private static readonly System.Text.Json.JsonEncodedText PropWaitTimeout = System.Text.Json.JsonEncodedText.Encode("wait_timeout"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DownsampleAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFixedInterval = default; - LocalJsonValue propWaitTimeout = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFixedInterval.TryReadProperty(ref reader, options, PropFixedInterval, null)) - { - continue; - } - - if (propWaitTimeout.TryReadProperty(ref reader, options, PropWaitTimeout, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DownsampleAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FixedInterval = propFixedInterval.Value, - WaitTimeout = propWaitTimeout.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DownsampleAction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFixedInterval, value.FixedInterval, null, null); - writer.WriteProperty(options, PropWaitTimeout, value.WaitTimeout, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.DownsampleActionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.DownsampleActionConverter))] public sealed partial class DownsampleAction { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/ForceMergeAction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/ForceMergeAction.Converters.g.cs new file mode 100644 index 00000000000..1d0e6959c0f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/ForceMergeAction.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class ForceMergeActionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndexCodec = System.Text.Json.JsonEncodedText.Encode("index_codec"); + private static readonly System.Text.Json.JsonEncodedText PropMaxNumSegments = System.Text.Json.JsonEncodedText.Encode("max_num_segments"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ForceMergeAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndexCodec = default; + LocalJsonValue propMaxNumSegments = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndexCodec.TryReadProperty(ref reader, options, PropIndexCodec, null)) + { + continue; + } + + if (propMaxNumSegments.TryReadProperty(ref reader, options, PropMaxNumSegments, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ForceMergeAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + IndexCodec = propIndexCodec.Value, + MaxNumSegments = propMaxNumSegments.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ForceMergeAction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndexCodec, value.IndexCodec, null, null); + writer.WriteProperty(options, PropMaxNumSegments, value.MaxNumSegments, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/ForceMergeAction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/ForceMergeAction.g.cs index 7c8a7dff455..a00f40744e3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/ForceMergeAction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/ForceMergeAction.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; -internal sealed partial class ForceMergeActionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndexCodec = System.Text.Json.JsonEncodedText.Encode("index_codec"); - private static readonly System.Text.Json.JsonEncodedText PropMaxNumSegments = System.Text.Json.JsonEncodedText.Encode("max_num_segments"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ForceMergeAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndexCodec = default; - LocalJsonValue propMaxNumSegments = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndexCodec.TryReadProperty(ref reader, options, PropIndexCodec, null)) - { - continue; - } - - if (propMaxNumSegments.TryReadProperty(ref reader, options, PropMaxNumSegments, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ForceMergeAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - IndexCodec = propIndexCodec.Value, - MaxNumSegments = propMaxNumSegments.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ForceMergeAction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndexCodec, value.IndexCodec, null, null); - writer.WriteProperty(options, PropMaxNumSegments, value.MaxNumSegments, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ForceMergeActionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.ForceMergeActionConverter))] public sealed partial class ForceMergeAction { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/IlmPolicy.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/IlmPolicy.Converters.g.cs new file mode 100644 index 00000000000..13e7bb543fb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/IlmPolicy.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class IlmPolicyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); + private static readonly System.Text.Json.JsonEncodedText PropPhases = System.Text.Json.JsonEncodedText.Encode("phases"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.IlmPolicy Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propMeta = default; + LocalJsonValue propPhases = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propPhases.TryReadProperty(ref reader, options, PropPhases, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.IlmPolicy(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Meta = propMeta.Value, + Phases = propPhases.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.IlmPolicy value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropPhases, value.Phases, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/IlmPolicy.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/IlmPolicy.g.cs index 8351b32d22b..0653e77e7b9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/IlmPolicy.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/IlmPolicy.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; -internal sealed partial class IlmPolicyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); - private static readonly System.Text.Json.JsonEncodedText PropPhases = System.Text.Json.JsonEncodedText.Encode("phases"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.IlmPolicy Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propMeta = default; - LocalJsonValue propPhases = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propPhases.TryReadProperty(ref reader, options, PropPhases, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.IlmPolicy(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Meta = propMeta.Value, - Phases = propPhases.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.IlmPolicy value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropPhases, value.Phases, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.IlmPolicyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.IlmPolicyConverter))] public sealed partial class IlmPolicy { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Lifecycle.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Lifecycle.Converters.g.cs new file mode 100644 index 00000000000..e34e8e4fc35 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Lifecycle.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class LifecycleConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropModifiedDate = System.Text.Json.JsonEncodedText.Encode("modified_date"); + private static readonly System.Text.Json.JsonEncodedText PropPolicy = System.Text.Json.JsonEncodedText.Encode("policy"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Lifecycle Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propModifiedDate = default; + LocalJsonValue propPolicy = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propModifiedDate.TryReadProperty(ref reader, options, PropModifiedDate, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propPolicy.TryReadProperty(ref reader, options, PropPolicy, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Lifecycle(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ModifiedDate = propModifiedDate.Value, + Policy = propPolicy.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Lifecycle value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropModifiedDate, value.ModifiedDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropPolicy, value.Policy, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Lifecycle.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Lifecycle.g.cs index 9081d115bd9..98568f42c3c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Lifecycle.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Lifecycle.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; -internal sealed partial class LifecycleConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropModifiedDate = System.Text.Json.JsonEncodedText.Encode("modified_date"); - private static readonly System.Text.Json.JsonEncodedText PropPolicy = System.Text.Json.JsonEncodedText.Encode("policy"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Lifecycle Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propModifiedDate = default; - LocalJsonValue propPolicy = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propModifiedDate.TryReadProperty(ref reader, options, PropModifiedDate, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propPolicy.TryReadProperty(ref reader, options, PropPolicy, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Lifecycle(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ModifiedDate = propModifiedDate.Value, - Policy = propPolicy.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Lifecycle value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropModifiedDate, value.ModifiedDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropPolicy, value.Policy, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.LifecycleConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.LifecycleConverter))] public sealed partial class Lifecycle { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/MigrateAction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/MigrateAction.Converters.g.cs new file mode 100644 index 00000000000..e16f7f927b9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/MigrateAction.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class MigrateActionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEnabled = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Enabled = propEnabled.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateAction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/MigrateAction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/MigrateAction.g.cs index e38351f42ef..8389d952fdc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/MigrateAction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/MigrateAction.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; -internal sealed partial class MigrateActionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEnabled = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Enabled = propEnabled.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateAction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.MigrateActionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.MigrateActionConverter))] public sealed partial class MigrateAction { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Phase.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Phase.Converters.g.cs new file mode 100644 index 00000000000..d658c44335c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Phase.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class PhaseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropActions = System.Text.Json.JsonEncodedText.Encode("actions"); + private static readonly System.Text.Json.JsonEncodedText PropMinAge = System.Text.Json.JsonEncodedText.Encode("min_age"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phase Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propActions = default; + LocalJsonValue propMinAge = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propActions.TryReadProperty(ref reader, options, PropActions, null)) + { + continue; + } + + if (propMinAge.TryReadProperty(ref reader, options, PropMinAge, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phase(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Actions = propActions.Value, + MinAge = propMinAge.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phase value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropActions, value.Actions, null, null); + writer.WriteProperty(options, PropMinAge, value.MinAge, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Phase.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Phase.g.cs index 04686144cb9..cc8513a21f9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Phase.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Phase.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; -internal sealed partial class PhaseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropActions = System.Text.Json.JsonEncodedText.Encode("actions"); - private static readonly System.Text.Json.JsonEncodedText PropMinAge = System.Text.Json.JsonEncodedText.Encode("min_age"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phase Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propActions = default; - LocalJsonValue propMinAge = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propActions.TryReadProperty(ref reader, options, PropActions, null)) - { - continue; - } - - if (propMinAge.TryReadProperty(ref reader, options, PropMinAge, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phase(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Actions = propActions.Value, - MinAge = propMinAge.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phase value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropActions, value.Actions, null, null); - writer.WriteProperty(options, PropMinAge, value.MinAge, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PhaseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.PhaseConverter))] public sealed partial class Phase { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Phases.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Phases.Converters.g.cs new file mode 100644 index 00000000000..4ec502dbffd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Phases.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class PhasesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCold = System.Text.Json.JsonEncodedText.Encode("cold"); + private static readonly System.Text.Json.JsonEncodedText PropDelete = System.Text.Json.JsonEncodedText.Encode("delete"); + private static readonly System.Text.Json.JsonEncodedText PropFrozen = System.Text.Json.JsonEncodedText.Encode("frozen"); + private static readonly System.Text.Json.JsonEncodedText PropHot = System.Text.Json.JsonEncodedText.Encode("hot"); + private static readonly System.Text.Json.JsonEncodedText PropWarm = System.Text.Json.JsonEncodedText.Encode("warm"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phases Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCold = default; + LocalJsonValue propDelete = default; + LocalJsonValue propFrozen = default; + LocalJsonValue propHot = default; + LocalJsonValue propWarm = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCold.TryReadProperty(ref reader, options, PropCold, null)) + { + continue; + } + + if (propDelete.TryReadProperty(ref reader, options, PropDelete, null)) + { + continue; + } + + if (propFrozen.TryReadProperty(ref reader, options, PropFrozen, null)) + { + continue; + } + + if (propHot.TryReadProperty(ref reader, options, PropHot, null)) + { + continue; + } + + if (propWarm.TryReadProperty(ref reader, options, PropWarm, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phases(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Cold = propCold.Value, + Delete = propDelete.Value, + Frozen = propFrozen.Value, + Hot = propHot.Value, + Warm = propWarm.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phases value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCold, value.Cold, null, null); + writer.WriteProperty(options, PropDelete, value.Delete, null, null); + writer.WriteProperty(options, PropFrozen, value.Frozen, null, null); + writer.WriteProperty(options, PropHot, value.Hot, null, null); + writer.WriteProperty(options, PropWarm, value.Warm, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Phases.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Phases.g.cs index 68746409ae5..a3a67beca55 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Phases.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/Phases.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; -internal sealed partial class PhasesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCold = System.Text.Json.JsonEncodedText.Encode("cold"); - private static readonly System.Text.Json.JsonEncodedText PropDelete = System.Text.Json.JsonEncodedText.Encode("delete"); - private static readonly System.Text.Json.JsonEncodedText PropFrozen = System.Text.Json.JsonEncodedText.Encode("frozen"); - private static readonly System.Text.Json.JsonEncodedText PropHot = System.Text.Json.JsonEncodedText.Encode("hot"); - private static readonly System.Text.Json.JsonEncodedText PropWarm = System.Text.Json.JsonEncodedText.Encode("warm"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phases Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCold = default; - LocalJsonValue propDelete = default; - LocalJsonValue propFrozen = default; - LocalJsonValue propHot = default; - LocalJsonValue propWarm = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCold.TryReadProperty(ref reader, options, PropCold, null)) - { - continue; - } - - if (propDelete.TryReadProperty(ref reader, options, PropDelete, null)) - { - continue; - } - - if (propFrozen.TryReadProperty(ref reader, options, PropFrozen, null)) - { - continue; - } - - if (propHot.TryReadProperty(ref reader, options, PropHot, null)) - { - continue; - } - - if (propWarm.TryReadProperty(ref reader, options, PropWarm, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phases(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Cold = propCold.Value, - Delete = propDelete.Value, - Frozen = propFrozen.Value, - Hot = propHot.Value, - Warm = propWarm.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Phases value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCold, value.Cold, null, null); - writer.WriteProperty(options, PropDelete, value.Delete, null, null); - writer.WriteProperty(options, PropFrozen, value.Frozen, null, null); - writer.WriteProperty(options, PropHot, value.Hot, null, null); - writer.WriteProperty(options, PropWarm, value.Warm, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.PhasesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.PhasesConverter))] public sealed partial class Phases { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/RolloverAction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/RolloverAction.Converters.g.cs new file mode 100644 index 00000000000..11abe9da2eb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/RolloverAction.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class RolloverActionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxAge = System.Text.Json.JsonEncodedText.Encode("max_age"); + private static readonly System.Text.Json.JsonEncodedText PropMaxDocs = System.Text.Json.JsonEncodedText.Encode("max_docs"); + private static readonly System.Text.Json.JsonEncodedText PropMaxPrimaryShardDocs = System.Text.Json.JsonEncodedText.Encode("max_primary_shard_docs"); + private static readonly System.Text.Json.JsonEncodedText PropMaxPrimaryShardSize = System.Text.Json.JsonEncodedText.Encode("max_primary_shard_size"); + private static readonly System.Text.Json.JsonEncodedText PropMaxSize = System.Text.Json.JsonEncodedText.Encode("max_size"); + private static readonly System.Text.Json.JsonEncodedText PropMinAge = System.Text.Json.JsonEncodedText.Encode("min_age"); + private static readonly System.Text.Json.JsonEncodedText PropMinDocs = System.Text.Json.JsonEncodedText.Encode("min_docs"); + private static readonly System.Text.Json.JsonEncodedText PropMinPrimaryShardDocs = System.Text.Json.JsonEncodedText.Encode("min_primary_shard_docs"); + private static readonly System.Text.Json.JsonEncodedText PropMinPrimaryShardSize = System.Text.Json.JsonEncodedText.Encode("min_primary_shard_size"); + private static readonly System.Text.Json.JsonEncodedText PropMinSize = System.Text.Json.JsonEncodedText.Encode("min_size"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RolloverAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxAge = default; + LocalJsonValue propMaxDocs = default; + LocalJsonValue propMaxPrimaryShardDocs = default; + LocalJsonValue propMaxPrimaryShardSize = default; + LocalJsonValue propMaxSize = default; + LocalJsonValue propMinAge = default; + LocalJsonValue propMinDocs = default; + LocalJsonValue propMinPrimaryShardDocs = default; + LocalJsonValue propMinPrimaryShardSize = default; + LocalJsonValue propMinSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxAge.TryReadProperty(ref reader, options, PropMaxAge, null)) + { + continue; + } + + if (propMaxDocs.TryReadProperty(ref reader, options, PropMaxDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxPrimaryShardDocs.TryReadProperty(ref reader, options, PropMaxPrimaryShardDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxPrimaryShardSize.TryReadProperty(ref reader, options, PropMaxPrimaryShardSize, null)) + { + continue; + } + + if (propMaxSize.TryReadProperty(ref reader, options, PropMaxSize, null)) + { + continue; + } + + if (propMinAge.TryReadProperty(ref reader, options, PropMinAge, null)) + { + continue; + } + + if (propMinDocs.TryReadProperty(ref reader, options, PropMinDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinPrimaryShardDocs.TryReadProperty(ref reader, options, PropMinPrimaryShardDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinPrimaryShardSize.TryReadProperty(ref reader, options, PropMinPrimaryShardSize, null)) + { + continue; + } + + if (propMinSize.TryReadProperty(ref reader, options, PropMinSize, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RolloverAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxAge = propMaxAge.Value, + MaxDocs = propMaxDocs.Value, + MaxPrimaryShardDocs = propMaxPrimaryShardDocs.Value, + MaxPrimaryShardSize = propMaxPrimaryShardSize.Value, + MaxSize = propMaxSize.Value, + MinAge = propMinAge.Value, + MinDocs = propMinDocs.Value, + MinPrimaryShardDocs = propMinPrimaryShardDocs.Value, + MinPrimaryShardSize = propMinPrimaryShardSize.Value, + MinSize = propMinSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RolloverAction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxAge, value.MaxAge, null, null); + writer.WriteProperty(options, PropMaxDocs, value.MaxDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxPrimaryShardDocs, value.MaxPrimaryShardDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxPrimaryShardSize, value.MaxPrimaryShardSize, null, null); + writer.WriteProperty(options, PropMaxSize, value.MaxSize, null, null); + writer.WriteProperty(options, PropMinAge, value.MinAge, null, null); + writer.WriteProperty(options, PropMinDocs, value.MinDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinPrimaryShardDocs, value.MinPrimaryShardDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinPrimaryShardSize, value.MinPrimaryShardSize, null, null); + writer.WriteProperty(options, PropMinSize, value.MinSize, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/RolloverAction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/RolloverAction.g.cs index c60d2268b13..cccbd91a65e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/RolloverAction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/RolloverAction.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; -internal sealed partial class RolloverActionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxAge = System.Text.Json.JsonEncodedText.Encode("max_age"); - private static readonly System.Text.Json.JsonEncodedText PropMaxDocs = System.Text.Json.JsonEncodedText.Encode("max_docs"); - private static readonly System.Text.Json.JsonEncodedText PropMaxPrimaryShardDocs = System.Text.Json.JsonEncodedText.Encode("max_primary_shard_docs"); - private static readonly System.Text.Json.JsonEncodedText PropMaxPrimaryShardSize = System.Text.Json.JsonEncodedText.Encode("max_primary_shard_size"); - private static readonly System.Text.Json.JsonEncodedText PropMaxSize = System.Text.Json.JsonEncodedText.Encode("max_size"); - private static readonly System.Text.Json.JsonEncodedText PropMinAge = System.Text.Json.JsonEncodedText.Encode("min_age"); - private static readonly System.Text.Json.JsonEncodedText PropMinDocs = System.Text.Json.JsonEncodedText.Encode("min_docs"); - private static readonly System.Text.Json.JsonEncodedText PropMinPrimaryShardDocs = System.Text.Json.JsonEncodedText.Encode("min_primary_shard_docs"); - private static readonly System.Text.Json.JsonEncodedText PropMinPrimaryShardSize = System.Text.Json.JsonEncodedText.Encode("min_primary_shard_size"); - private static readonly System.Text.Json.JsonEncodedText PropMinSize = System.Text.Json.JsonEncodedText.Encode("min_size"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RolloverAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxAge = default; - LocalJsonValue propMaxDocs = default; - LocalJsonValue propMaxPrimaryShardDocs = default; - LocalJsonValue propMaxPrimaryShardSize = default; - LocalJsonValue propMaxSize = default; - LocalJsonValue propMinAge = default; - LocalJsonValue propMinDocs = default; - LocalJsonValue propMinPrimaryShardDocs = default; - LocalJsonValue propMinPrimaryShardSize = default; - LocalJsonValue propMinSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxAge.TryReadProperty(ref reader, options, PropMaxAge, null)) - { - continue; - } - - if (propMaxDocs.TryReadProperty(ref reader, options, PropMaxDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxPrimaryShardDocs.TryReadProperty(ref reader, options, PropMaxPrimaryShardDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxPrimaryShardSize.TryReadProperty(ref reader, options, PropMaxPrimaryShardSize, null)) - { - continue; - } - - if (propMaxSize.TryReadProperty(ref reader, options, PropMaxSize, null)) - { - continue; - } - - if (propMinAge.TryReadProperty(ref reader, options, PropMinAge, null)) - { - continue; - } - - if (propMinDocs.TryReadProperty(ref reader, options, PropMinDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinPrimaryShardDocs.TryReadProperty(ref reader, options, PropMinPrimaryShardDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinPrimaryShardSize.TryReadProperty(ref reader, options, PropMinPrimaryShardSize, null)) - { - continue; - } - - if (propMinSize.TryReadProperty(ref reader, options, PropMinSize, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RolloverAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxAge = propMaxAge.Value, - MaxDocs = propMaxDocs.Value, - MaxPrimaryShardDocs = propMaxPrimaryShardDocs.Value, - MaxPrimaryShardSize = propMaxPrimaryShardSize.Value, - MaxSize = propMaxSize.Value, - MinAge = propMinAge.Value, - MinDocs = propMinDocs.Value, - MinPrimaryShardDocs = propMinPrimaryShardDocs.Value, - MinPrimaryShardSize = propMinPrimaryShardSize.Value, - MinSize = propMinSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RolloverAction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxAge, value.MaxAge, null, null); - writer.WriteProperty(options, PropMaxDocs, value.MaxDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxPrimaryShardDocs, value.MaxPrimaryShardDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxPrimaryShardSize, value.MaxPrimaryShardSize, null, null); - writer.WriteProperty(options, PropMaxSize, value.MaxSize, null, null); - writer.WriteProperty(options, PropMinAge, value.MinAge, null, null); - writer.WriteProperty(options, PropMinDocs, value.MinDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinPrimaryShardDocs, value.MinPrimaryShardDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinPrimaryShardSize, value.MinPrimaryShardSize, null, null); - writer.WriteProperty(options, PropMinSize, value.MinSize, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RolloverActionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.RolloverActionConverter))] public sealed partial class RolloverAction { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/SearchableSnapshotAction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/SearchableSnapshotAction.Converters.g.cs new file mode 100644 index 00000000000..579a7436402 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/SearchableSnapshotAction.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class SearchableSnapshotActionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropForceMergeIndex = System.Text.Json.JsonEncodedText.Encode("force_merge_index"); + private static readonly System.Text.Json.JsonEncodedText PropSnapshotRepository = System.Text.Json.JsonEncodedText.Encode("snapshot_repository"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SearchableSnapshotAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propForceMergeIndex = default; + LocalJsonValue propSnapshotRepository = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propForceMergeIndex.TryReadProperty(ref reader, options, PropForceMergeIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSnapshotRepository.TryReadProperty(ref reader, options, PropSnapshotRepository, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SearchableSnapshotAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ForceMergeIndex = propForceMergeIndex.Value, + SnapshotRepository = propSnapshotRepository.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SearchableSnapshotAction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropForceMergeIndex, value.ForceMergeIndex, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSnapshotRepository, value.SnapshotRepository, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/SearchableSnapshotAction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/SearchableSnapshotAction.g.cs index f09b6164f1e..17350e158b1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/SearchableSnapshotAction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/SearchableSnapshotAction.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; -internal sealed partial class SearchableSnapshotActionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropForceMergeIndex = System.Text.Json.JsonEncodedText.Encode("force_merge_index"); - private static readonly System.Text.Json.JsonEncodedText PropSnapshotRepository = System.Text.Json.JsonEncodedText.Encode("snapshot_repository"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SearchableSnapshotAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propForceMergeIndex = default; - LocalJsonValue propSnapshotRepository = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propForceMergeIndex.TryReadProperty(ref reader, options, PropForceMergeIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSnapshotRepository.TryReadProperty(ref reader, options, PropSnapshotRepository, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SearchableSnapshotAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ForceMergeIndex = propForceMergeIndex.Value, - SnapshotRepository = propSnapshotRepository.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SearchableSnapshotAction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropForceMergeIndex, value.ForceMergeIndex, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSnapshotRepository, value.SnapshotRepository, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SearchableSnapshotActionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.SearchableSnapshotActionConverter))] public sealed partial class SearchableSnapshotAction { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/SetPriorityAction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/SetPriorityAction.Converters.g.cs new file mode 100644 index 00000000000..95ed8f220d7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/SetPriorityAction.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class SetPriorityActionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPriority = System.Text.Json.JsonEncodedText.Encode("priority"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SetPriorityAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPriority = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPriority.TryReadProperty(ref reader, options, PropPriority, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SetPriorityAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Priority = propPriority.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SetPriorityAction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPriority, value.Priority, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/SetPriorityAction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/SetPriorityAction.g.cs index a964118d5a2..dfb986da5a8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/SetPriorityAction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/SetPriorityAction.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; -internal sealed partial class SetPriorityActionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPriority = System.Text.Json.JsonEncodedText.Encode("priority"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SetPriorityAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPriority = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPriority.TryReadProperty(ref reader, options, PropPriority, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SetPriorityAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Priority = propPriority.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SetPriorityAction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPriority, value.Priority, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.SetPriorityActionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.SetPriorityActionConverter))] public sealed partial class SetPriorityAction { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/ShrinkAction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/ShrinkAction.Converters.g.cs new file mode 100644 index 00000000000..d40c75d37a4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/ShrinkAction.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class ShrinkActionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowWriteAfterShrink = System.Text.Json.JsonEncodedText.Encode("allow_write_after_shrink"); + private static readonly System.Text.Json.JsonEncodedText PropMaxPrimaryShardSize = System.Text.Json.JsonEncodedText.Encode("max_primary_shard_size"); + private static readonly System.Text.Json.JsonEncodedText PropNumberOfShards = System.Text.Json.JsonEncodedText.Encode("number_of_shards"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ShrinkAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowWriteAfterShrink = default; + LocalJsonValue propMaxPrimaryShardSize = default; + LocalJsonValue propNumberOfShards = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowWriteAfterShrink.TryReadProperty(ref reader, options, PropAllowWriteAfterShrink, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxPrimaryShardSize.TryReadProperty(ref reader, options, PropMaxPrimaryShardSize, null)) + { + continue; + } + + if (propNumberOfShards.TryReadProperty(ref reader, options, PropNumberOfShards, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ShrinkAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowWriteAfterShrink = propAllowWriteAfterShrink.Value, + MaxPrimaryShardSize = propMaxPrimaryShardSize.Value, + NumberOfShards = propNumberOfShards.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ShrinkAction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowWriteAfterShrink, value.AllowWriteAfterShrink, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxPrimaryShardSize, value.MaxPrimaryShardSize, null, null); + writer.WriteProperty(options, PropNumberOfShards, value.NumberOfShards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/ShrinkAction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/ShrinkAction.g.cs index 3e791668cf3..01c9ce90541 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/ShrinkAction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/ShrinkAction.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; -internal sealed partial class ShrinkActionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowWriteAfterShrink = System.Text.Json.JsonEncodedText.Encode("allow_write_after_shrink"); - private static readonly System.Text.Json.JsonEncodedText PropMaxPrimaryShardSize = System.Text.Json.JsonEncodedText.Encode("max_primary_shard_size"); - private static readonly System.Text.Json.JsonEncodedText PropNumberOfShards = System.Text.Json.JsonEncodedText.Encode("number_of_shards"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ShrinkAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowWriteAfterShrink = default; - LocalJsonValue propMaxPrimaryShardSize = default; - LocalJsonValue propNumberOfShards = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowWriteAfterShrink.TryReadProperty(ref reader, options, PropAllowWriteAfterShrink, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxPrimaryShardSize.TryReadProperty(ref reader, options, PropMaxPrimaryShardSize, null)) - { - continue; - } - - if (propNumberOfShards.TryReadProperty(ref reader, options, PropNumberOfShards, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ShrinkAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowWriteAfterShrink = propAllowWriteAfterShrink.Value, - MaxPrimaryShardSize = propMaxPrimaryShardSize.Value, - NumberOfShards = propNumberOfShards.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ShrinkAction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowWriteAfterShrink, value.AllowWriteAfterShrink, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxPrimaryShardSize, value.MaxPrimaryShardSize, null, null); - writer.WriteProperty(options, PropNumberOfShards, value.NumberOfShards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.ShrinkActionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.ShrinkActionConverter))] public sealed partial class ShrinkAction { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/StepKey.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/StepKey.Converters.g.cs new file mode 100644 index 00000000000..0046f490097 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/StepKey.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class StepKeyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAction = System.Text.Json.JsonEncodedText.Encode("action"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropPhase = System.Text.Json.JsonEncodedText.Encode("phase"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAction = default; + LocalJsonValue propName = default; + LocalJsonValue propPhase = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAction.TryReadProperty(ref reader, options, PropAction, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propPhase.TryReadProperty(ref reader, options, PropPhase, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Action = propAction.Value, + Name = propName.Value, + Phase = propPhase.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAction, value.Action, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropPhase, value.Phase, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/StepKey.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/StepKey.g.cs index 83321403b20..f309bb9a9e3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/StepKey.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/StepKey.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; -internal sealed partial class StepKeyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAction = System.Text.Json.JsonEncodedText.Encode("action"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropPhase = System.Text.Json.JsonEncodedText.Encode("phase"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAction = default; - LocalJsonValue propName = default; - LocalJsonValue propPhase = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAction.TryReadProperty(ref reader, options, PropAction, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propPhase.TryReadProperty(ref reader, options, PropPhase, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Action = propAction.Value, - Name = propName.Value, - Phase = propPhase.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKey value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAction, value.Action, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropPhase, value.Phase, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.StepKeyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.StepKeyConverter))] public sealed partial class StepKey { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/WaitForSnapshotAction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/WaitForSnapshotAction.Converters.g.cs new file mode 100644 index 00000000000..760c3380b79 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/WaitForSnapshotAction.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json; + +public sealed partial class WaitForSnapshotActionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPolicy = System.Text.Json.JsonEncodedText.Encode("policy"); + + public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.WaitForSnapshotAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPolicy = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPolicy.TryReadProperty(ref reader, options, PropPolicy, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.WaitForSnapshotAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Policy = propPolicy.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.WaitForSnapshotAction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPolicy, value.Policy, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/WaitForSnapshotAction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/WaitForSnapshotAction.g.cs index 55daad85e6d..feefc2ce471 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/WaitForSnapshotAction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/WaitForSnapshotAction.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexLifecycleManagement; -internal sealed partial class WaitForSnapshotActionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPolicy = System.Text.Json.JsonEncodedText.Encode("policy"); - - public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.WaitForSnapshotAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPolicy = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPolicy.TryReadProperty(ref reader, options, PropPolicy, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexLifecycleManagement.WaitForSnapshotAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Policy = propPolicy.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexLifecycleManagement.WaitForSnapshotAction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPolicy, value.Policy, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.WaitForSnapshotActionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexLifecycleManagement.Json.WaitForSnapshotActionConverter))] public sealed partial class WaitForSnapshotAction { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AddAction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AddAction.Converters.g.cs new file mode 100644 index 00000000000..0e950422138 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AddAction.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class AddActionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAlias = System.Text.Json.JsonEncodedText.Encode("alias"); + private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropIndexRouting = System.Text.Json.JsonEncodedText.Encode("index_routing"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropIsHidden = System.Text.Json.JsonEncodedText.Encode("is_hidden"); + private static readonly System.Text.Json.JsonEncodedText PropIsWriteIndex = System.Text.Json.JsonEncodedText.Encode("is_write_index"); + private static readonly System.Text.Json.JsonEncodedText PropMustExist = System.Text.Json.JsonEncodedText.Encode("must_exist"); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); + private static readonly System.Text.Json.JsonEncodedText PropSearchRouting = System.Text.Json.JsonEncodedText.Encode("search_routing"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.AddAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAlias = default; + LocalJsonValue?> propAliases = default; + LocalJsonValue propFilter = default; + LocalJsonValue propIndex = default; + LocalJsonValue propIndexRouting = default; + LocalJsonValue propIndices = default; + LocalJsonValue propIsHidden = default; + LocalJsonValue propIsWriteIndex = default; + LocalJsonValue propMustExist = default; + LocalJsonValue propRouting = default; + LocalJsonValue propSearchRouting = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAlias.TryReadProperty(ref reader, options, PropAlias, null)) + { + continue; + } + + if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propIndexRouting.TryReadProperty(ref reader, options, PropIndexRouting, null)) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) + { + continue; + } + + if (propIsHidden.TryReadProperty(ref reader, options, PropIsHidden, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIsWriteIndex.TryReadProperty(ref reader, options, PropIsWriteIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMustExist.TryReadProperty(ref reader, options, PropMustExist, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (propSearchRouting.TryReadProperty(ref reader, options, PropSearchRouting, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.AddAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Alias = propAlias.Value, + Aliases = propAliases.Value, + Filter = propFilter.Value, + Index = propIndex.Value, + IndexRouting = propIndexRouting.Value, + Indices = propIndices.Value, + IsHidden = propIsHidden.Value, + IsWriteIndex = propIsWriteIndex.Value, + MustExist = propMustExist.Value, + Routing = propRouting.Value, + SearchRouting = propSearchRouting.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.AddAction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAlias, value.Alias, null, null); + writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFilter, value.Filter, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropIndexRouting, value.IndexRouting, null, null); + writer.WriteProperty(options, PropIndices, value.Indices, null, null); + writer.WriteProperty(options, PropIsHidden, value.IsHidden, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIsWriteIndex, value.IsWriteIndex, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMustExist, value.MustExist, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteProperty(options, PropSearchRouting, value.SearchRouting, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AddAction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AddAction.g.cs index 3aac333479e..07702857ac2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AddAction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AddAction.g.cs @@ -23,136 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class AddActionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAlias = System.Text.Json.JsonEncodedText.Encode("alias"); - private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropIndexRouting = System.Text.Json.JsonEncodedText.Encode("index_routing"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropIsHidden = System.Text.Json.JsonEncodedText.Encode("is_hidden"); - private static readonly System.Text.Json.JsonEncodedText PropIsWriteIndex = System.Text.Json.JsonEncodedText.Encode("is_write_index"); - private static readonly System.Text.Json.JsonEncodedText PropMustExist = System.Text.Json.JsonEncodedText.Encode("must_exist"); - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); - private static readonly System.Text.Json.JsonEncodedText PropSearchRouting = System.Text.Json.JsonEncodedText.Encode("search_routing"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.AddAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAlias = default; - LocalJsonValue?> propAliases = default; - LocalJsonValue propFilter = default; - LocalJsonValue propIndex = default; - LocalJsonValue propIndexRouting = default; - LocalJsonValue propIndices = default; - LocalJsonValue propIsHidden = default; - LocalJsonValue propIsWriteIndex = default; - LocalJsonValue propMustExist = default; - LocalJsonValue propRouting = default; - LocalJsonValue propSearchRouting = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAlias.TryReadProperty(ref reader, options, PropAlias, null)) - { - continue; - } - - if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propIndexRouting.TryReadProperty(ref reader, options, PropIndexRouting, null)) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) - { - continue; - } - - if (propIsHidden.TryReadProperty(ref reader, options, PropIsHidden, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIsWriteIndex.TryReadProperty(ref reader, options, PropIsWriteIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMustExist.TryReadProperty(ref reader, options, PropMustExist, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (propSearchRouting.TryReadProperty(ref reader, options, PropSearchRouting, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.AddAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Alias = propAlias.Value, - Aliases = propAliases.Value, - Filter = propFilter.Value, - Index = propIndex.Value, - IndexRouting = propIndexRouting.Value, - Indices = propIndices.Value, - IsHidden = propIsHidden.Value, - IsWriteIndex = propIsWriteIndex.Value, - MustExist = propMustExist.Value, - Routing = propRouting.Value, - SearchRouting = propSearchRouting.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.AddAction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAlias, value.Alias, null, null); - writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFilter, value.Filter, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropIndexRouting, value.IndexRouting, null, null); - writer.WriteProperty(options, PropIndices, value.Indices, null, null); - writer.WriteProperty(options, PropIsHidden, value.IsHidden, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIsWriteIndex, value.IsWriteIndex, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMustExist, value.MustExist, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteProperty(options, PropSearchRouting, value.SearchRouting, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.AddActionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.AddActionConverter))] public sealed partial class AddAction { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Alias.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Alias.Converters.g.cs new file mode 100644 index 00000000000..3c077841136 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Alias.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class AliasConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropIndexRouting = System.Text.Json.JsonEncodedText.Encode("index_routing"); + private static readonly System.Text.Json.JsonEncodedText PropIsHidden = System.Text.Json.JsonEncodedText.Encode("is_hidden"); + private static readonly System.Text.Json.JsonEncodedText PropIsWriteIndex = System.Text.Json.JsonEncodedText.Encode("is_write_index"); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); + private static readonly System.Text.Json.JsonEncodedText PropSearchRouting = System.Text.Json.JsonEncodedText.Encode("search_routing"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.Alias Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFilter = default; + LocalJsonValue propIndexRouting = default; + LocalJsonValue propIsHidden = default; + LocalJsonValue propIsWriteIndex = default; + LocalJsonValue propRouting = default; + LocalJsonValue propSearchRouting = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) + { + continue; + } + + if (propIndexRouting.TryReadProperty(ref reader, options, PropIndexRouting, null)) + { + continue; + } + + if (propIsHidden.TryReadProperty(ref reader, options, PropIsHidden, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIsWriteIndex.TryReadProperty(ref reader, options, PropIsWriteIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (propSearchRouting.TryReadProperty(ref reader, options, PropSearchRouting, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.Alias(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Filter = propFilter.Value, + IndexRouting = propIndexRouting.Value, + IsHidden = propIsHidden.Value, + IsWriteIndex = propIsWriteIndex.Value, + Routing = propRouting.Value, + SearchRouting = propSearchRouting.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.Alias value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFilter, value.Filter, null, null); + writer.WriteProperty(options, PropIndexRouting, value.IndexRouting, null, null); + writer.WriteProperty(options, PropIsHidden, value.IsHidden, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIsWriteIndex, value.IsWriteIndex, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteProperty(options, PropSearchRouting, value.SearchRouting, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Alias.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Alias.g.cs index d34e858cbf3..2d4a74873e2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Alias.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Alias.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class AliasConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropIndexRouting = System.Text.Json.JsonEncodedText.Encode("index_routing"); - private static readonly System.Text.Json.JsonEncodedText PropIsHidden = System.Text.Json.JsonEncodedText.Encode("is_hidden"); - private static readonly System.Text.Json.JsonEncodedText PropIsWriteIndex = System.Text.Json.JsonEncodedText.Encode("is_write_index"); - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); - private static readonly System.Text.Json.JsonEncodedText PropSearchRouting = System.Text.Json.JsonEncodedText.Encode("search_routing"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.Alias Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFilter = default; - LocalJsonValue propIndexRouting = default; - LocalJsonValue propIsHidden = default; - LocalJsonValue propIsWriteIndex = default; - LocalJsonValue propRouting = default; - LocalJsonValue propSearchRouting = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) - { - continue; - } - - if (propIndexRouting.TryReadProperty(ref reader, options, PropIndexRouting, null)) - { - continue; - } - - if (propIsHidden.TryReadProperty(ref reader, options, PropIsHidden, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIsWriteIndex.TryReadProperty(ref reader, options, PropIsWriteIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (propSearchRouting.TryReadProperty(ref reader, options, PropSearchRouting, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.Alias(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Filter = propFilter.Value, - IndexRouting = propIndexRouting.Value, - IsHidden = propIsHidden.Value, - IsWriteIndex = propIsWriteIndex.Value, - Routing = propRouting.Value, - SearchRouting = propSearchRouting.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.Alias value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFilter, value.Filter, null, null); - writer.WriteProperty(options, PropIndexRouting, value.IndexRouting, null, null); - writer.WriteProperty(options, PropIsHidden, value.IsHidden, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIsWriteIndex, value.IsWriteIndex, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteProperty(options, PropSearchRouting, value.SearchRouting, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.AliasConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.AliasConverter))] public sealed partial class Alias { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AliasDefinition.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AliasDefinition.Converters.g.cs new file mode 100644 index 00000000000..5906f282c4a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AliasDefinition.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class AliasDefinitionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropIndexRouting = System.Text.Json.JsonEncodedText.Encode("index_routing"); + private static readonly System.Text.Json.JsonEncodedText PropIsHidden = System.Text.Json.JsonEncodedText.Encode("is_hidden"); + private static readonly System.Text.Json.JsonEncodedText PropIsWriteIndex = System.Text.Json.JsonEncodedText.Encode("is_write_index"); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); + private static readonly System.Text.Json.JsonEncodedText PropSearchRouting = System.Text.Json.JsonEncodedText.Encode("search_routing"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.AliasDefinition Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFilter = default; + LocalJsonValue propIndexRouting = default; + LocalJsonValue propIsHidden = default; + LocalJsonValue propIsWriteIndex = default; + LocalJsonValue propRouting = default; + LocalJsonValue propSearchRouting = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) + { + continue; + } + + if (propIndexRouting.TryReadProperty(ref reader, options, PropIndexRouting, null)) + { + continue; + } + + if (propIsHidden.TryReadProperty(ref reader, options, PropIsHidden, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIsWriteIndex.TryReadProperty(ref reader, options, PropIsWriteIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (propSearchRouting.TryReadProperty(ref reader, options, PropSearchRouting, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.AliasDefinition(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Filter = propFilter.Value, + IndexRouting = propIndexRouting.Value, + IsHidden = propIsHidden.Value, + IsWriteIndex = propIsWriteIndex.Value, + Routing = propRouting.Value, + SearchRouting = propSearchRouting.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.AliasDefinition value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFilter, value.Filter, null, null); + writer.WriteProperty(options, PropIndexRouting, value.IndexRouting, null, null); + writer.WriteProperty(options, PropIsHidden, value.IsHidden, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIsWriteIndex, value.IsWriteIndex, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteProperty(options, PropSearchRouting, value.SearchRouting, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AliasDefinition.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AliasDefinition.g.cs index 3903ef8fe2f..8938ee7fcff 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AliasDefinition.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AliasDefinition.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class AliasDefinitionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropIndexRouting = System.Text.Json.JsonEncodedText.Encode("index_routing"); - private static readonly System.Text.Json.JsonEncodedText PropIsHidden = System.Text.Json.JsonEncodedText.Encode("is_hidden"); - private static readonly System.Text.Json.JsonEncodedText PropIsWriteIndex = System.Text.Json.JsonEncodedText.Encode("is_write_index"); - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); - private static readonly System.Text.Json.JsonEncodedText PropSearchRouting = System.Text.Json.JsonEncodedText.Encode("search_routing"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.AliasDefinition Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFilter = default; - LocalJsonValue propIndexRouting = default; - LocalJsonValue propIsHidden = default; - LocalJsonValue propIsWriteIndex = default; - LocalJsonValue propRouting = default; - LocalJsonValue propSearchRouting = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) - { - continue; - } - - if (propIndexRouting.TryReadProperty(ref reader, options, PropIndexRouting, null)) - { - continue; - } - - if (propIsHidden.TryReadProperty(ref reader, options, PropIsHidden, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIsWriteIndex.TryReadProperty(ref reader, options, PropIsWriteIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (propSearchRouting.TryReadProperty(ref reader, options, PropSearchRouting, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.AliasDefinition(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Filter = propFilter.Value, - IndexRouting = propIndexRouting.Value, - IsHidden = propIsHidden.Value, - IsWriteIndex = propIsWriteIndex.Value, - Routing = propRouting.Value, - SearchRouting = propSearchRouting.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.AliasDefinition value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFilter, value.Filter, null, null); - writer.WriteProperty(options, PropIndexRouting, value.IndexRouting, null, null); - writer.WriteProperty(options, PropIsHidden, value.IsHidden, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIsWriteIndex, value.IsWriteIndex, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteProperty(options, PropSearchRouting, value.SearchRouting, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.AliasDefinitionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.AliasDefinitionConverter))] public sealed partial class AliasDefinition { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzeDetail.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzeDetail.Converters.g.cs new file mode 100644 index 00000000000..be5b1ef3fa2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzeDetail.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class AnalyzeDetailConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropCharfilters = System.Text.Json.JsonEncodedText.Encode("charfilters"); + private static readonly System.Text.Json.JsonEncodedText PropCustomAnalyzer = System.Text.Json.JsonEncodedText.Encode("custom_analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropTokenfilters = System.Text.Json.JsonEncodedText.Encode("tokenfilters"); + private static readonly System.Text.Json.JsonEncodedText PropTokenizer = System.Text.Json.JsonEncodedText.Encode("tokenizer"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeDetail Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzer = default; + LocalJsonValue?> propCharfilters = default; + LocalJsonValue propCustomAnalyzer = default; + LocalJsonValue?> propTokenfilters = default; + LocalJsonValue propTokenizer = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) + { + continue; + } + + if (propCharfilters.TryReadProperty(ref reader, options, PropCharfilters, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propCustomAnalyzer.TryReadProperty(ref reader, options, PropCustomAnalyzer, null)) + { + continue; + } + + if (propTokenfilters.TryReadProperty(ref reader, options, PropTokenfilters, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTokenizer.TryReadProperty(ref reader, options, PropTokenizer, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analyzer = propAnalyzer.Value, + Charfilters = propCharfilters.Value, + CustomAnalyzer = propCustomAnalyzer.Value, + Tokenfilters = propTokenfilters.Value, + Tokenizer = propTokenizer.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeDetail value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); + writer.WriteProperty(options, PropCharfilters, value.Charfilters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCustomAnalyzer, value.CustomAnalyzer, null, null); + writer.WriteProperty(options, PropTokenfilters, value.Tokenfilters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTokenizer, value.Tokenizer, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzeDetail.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzeDetail.g.cs index 7049d509da3..0855b7c8a83 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzeDetail.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzeDetail.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class AnalyzeDetailConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropCharfilters = System.Text.Json.JsonEncodedText.Encode("charfilters"); - private static readonly System.Text.Json.JsonEncodedText PropCustomAnalyzer = System.Text.Json.JsonEncodedText.Encode("custom_analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropTokenfilters = System.Text.Json.JsonEncodedText.Encode("tokenfilters"); - private static readonly System.Text.Json.JsonEncodedText PropTokenizer = System.Text.Json.JsonEncodedText.Encode("tokenizer"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeDetail Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyzer = default; - LocalJsonValue?> propCharfilters = default; - LocalJsonValue propCustomAnalyzer = default; - LocalJsonValue?> propTokenfilters = default; - LocalJsonValue propTokenizer = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) - { - continue; - } - - if (propCharfilters.TryReadProperty(ref reader, options, PropCharfilters, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propCustomAnalyzer.TryReadProperty(ref reader, options, PropCustomAnalyzer, null)) - { - continue; - } - - if (propTokenfilters.TryReadProperty(ref reader, options, PropTokenfilters, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTokenizer.TryReadProperty(ref reader, options, PropTokenizer, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analyzer = propAnalyzer.Value, - Charfilters = propCharfilters.Value, - CustomAnalyzer = propCustomAnalyzer.Value, - Tokenfilters = propTokenfilters.Value, - Tokenizer = propTokenizer.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeDetail value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); - writer.WriteProperty(options, PropCharfilters, value.Charfilters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCustomAnalyzer, value.CustomAnalyzer, null, null); - writer.WriteProperty(options, PropTokenfilters, value.Tokenfilters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTokenizer, value.Tokenizer, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeDetailConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.AnalyzeDetailConverter))] public sealed partial class AnalyzeDetail { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzeToken.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzeToken.Converters.g.cs new file mode 100644 index 00000000000..53d91e4a941 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzeToken.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class AnalyzeTokenConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEndOffset = System.Text.Json.JsonEncodedText.Encode("end_offset"); + private static readonly System.Text.Json.JsonEncodedText PropPosition = System.Text.Json.JsonEncodedText.Encode("position"); + private static readonly System.Text.Json.JsonEncodedText PropPositionLength = System.Text.Json.JsonEncodedText.Encode("positionLength"); + private static readonly System.Text.Json.JsonEncodedText PropStartOffset = System.Text.Json.JsonEncodedText.Encode("start_offset"); + private static readonly System.Text.Json.JsonEncodedText PropToken = System.Text.Json.JsonEncodedText.Encode("token"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeToken Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEndOffset = default; + LocalJsonValue propPosition = default; + LocalJsonValue propPositionLength = default; + LocalJsonValue propStartOffset = default; + LocalJsonValue propToken = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEndOffset.TryReadProperty(ref reader, options, PropEndOffset, null)) + { + continue; + } + + if (propPosition.TryReadProperty(ref reader, options, PropPosition, null)) + { + continue; + } + + if (propPositionLength.TryReadProperty(ref reader, options, PropPositionLength, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propStartOffset.TryReadProperty(ref reader, options, PropStartOffset, null)) + { + continue; + } + + if (propToken.TryReadProperty(ref reader, options, PropToken, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeToken(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + EndOffset = propEndOffset.Value, + Position = propPosition.Value, + PositionLength = propPositionLength.Value, + StartOffset = propStartOffset.Value, + Token = propToken.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeToken value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEndOffset, value.EndOffset, null, null); + writer.WriteProperty(options, PropPosition, value.Position, null, null); + writer.WriteProperty(options, PropPositionLength, value.PositionLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropStartOffset, value.StartOffset, null, null); + writer.WriteProperty(options, PropToken, value.Token, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzeToken.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzeToken.g.cs index e36d4fb34c6..7a07be1f289 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzeToken.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzeToken.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class AnalyzeTokenConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEndOffset = System.Text.Json.JsonEncodedText.Encode("end_offset"); - private static readonly System.Text.Json.JsonEncodedText PropPosition = System.Text.Json.JsonEncodedText.Encode("position"); - private static readonly System.Text.Json.JsonEncodedText PropPositionLength = System.Text.Json.JsonEncodedText.Encode("positionLength"); - private static readonly System.Text.Json.JsonEncodedText PropStartOffset = System.Text.Json.JsonEncodedText.Encode("start_offset"); - private static readonly System.Text.Json.JsonEncodedText PropToken = System.Text.Json.JsonEncodedText.Encode("token"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeToken Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEndOffset = default; - LocalJsonValue propPosition = default; - LocalJsonValue propPositionLength = default; - LocalJsonValue propStartOffset = default; - LocalJsonValue propToken = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEndOffset.TryReadProperty(ref reader, options, PropEndOffset, null)) - { - continue; - } - - if (propPosition.TryReadProperty(ref reader, options, PropPosition, null)) - { - continue; - } - - if (propPositionLength.TryReadProperty(ref reader, options, PropPositionLength, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propStartOffset.TryReadProperty(ref reader, options, PropStartOffset, null)) - { - continue; - } - - if (propToken.TryReadProperty(ref reader, options, PropToken, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeToken(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - EndOffset = propEndOffset.Value, - Position = propPosition.Value, - PositionLength = propPositionLength.Value, - StartOffset = propStartOffset.Value, - Token = propToken.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeToken value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEndOffset, value.EndOffset, null, null); - writer.WriteProperty(options, PropPosition, value.Position, null, null); - writer.WriteProperty(options, PropPositionLength, value.PositionLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropStartOffset, value.StartOffset, null, null); - writer.WriteProperty(options, PropToken, value.Token, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.AnalyzeTokenConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.AnalyzeTokenConverter))] public sealed partial class AnalyzeToken { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzerDetail.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzerDetail.Converters.g.cs new file mode 100644 index 00000000000..5a00f1b0deb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzerDetail.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class AnalyzerDetailConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropTokens = System.Text.Json.JsonEncodedText.Encode("tokens"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.AnalyzerDetail Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + LocalJsonValue> propTokens = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propTokens.TryReadProperty(ref reader, options, PropTokens, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.AnalyzerDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value, + Tokens = propTokens.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.AnalyzerDetail value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropTokens, value.Tokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzerDetail.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzerDetail.g.cs index e393b5808b1..9437f98239b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzerDetail.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/AnalyzerDetail.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class AnalyzerDetailConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropTokens = System.Text.Json.JsonEncodedText.Encode("tokens"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.AnalyzerDetail Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - LocalJsonValue> propTokens = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propTokens.TryReadProperty(ref reader, options, PropTokens, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.AnalyzerDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value, - Tokens = propTokens.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.AnalyzerDetail value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropTokens, value.Tokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.AnalyzerDetailConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.AnalyzerDetailConverter))] public sealed partial class AnalyzerDetail { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CacheQueries.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CacheQueries.Converters.g.cs new file mode 100644 index 00000000000..9820fe1fa11 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CacheQueries.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class CacheQueriesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.CacheQueries Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEnabled = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.CacheQueries(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Enabled = propEnabled.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CacheQueries value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CacheQueries.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CacheQueries.g.cs index 3a2a4a7b65e..21e6d463cbd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CacheQueries.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CacheQueries.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class CacheQueriesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.CacheQueries Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEnabled = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.CacheQueries(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Enabled = propEnabled.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CacheQueries value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.CacheQueriesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.CacheQueriesConverter))] public sealed partial class CacheQueries { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CharFilterDetail.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CharFilterDetail.Converters.g.cs new file mode 100644 index 00000000000..6fbca318d58 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CharFilterDetail.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class CharFilterDetailConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFilteredText = System.Text.Json.JsonEncodedText.Encode("filtered_text"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.CharFilterDetail Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propFilteredText = default; + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFilteredText.TryReadProperty(ref reader, options, PropFilteredText, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.CharFilterDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FilteredText = propFilteredText.Value, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CharFilterDetail value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFilteredText, value.FilteredText, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CharFilterDetail.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CharFilterDetail.g.cs index 0b34c8ad51c..6f198d9f234 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CharFilterDetail.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CharFilterDetail.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class CharFilterDetailConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFilteredText = System.Text.Json.JsonEncodedText.Encode("filtered_text"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.CharFilterDetail Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propFilteredText = default; - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFilteredText.TryReadProperty(ref reader, options, PropFilteredText, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.CharFilterDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FilteredText = propFilteredText.Value, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CharFilterDetail value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFilteredText, value.FilteredText, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.CharFilterDetailConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.CharFilterDetailConverter))] public sealed partial class CharFilterDetail { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CloseIndexResult.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CloseIndexResult.Converters.g.cs new file mode 100644 index 00000000000..3f841acb492 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CloseIndexResult.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class CloseIndexResultConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClosed = System.Text.Json.JsonEncodedText.Encode("closed"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.CloseIndexResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClosed = default; + LocalJsonValue?> propShards = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClosed.TryReadProperty(ref reader, options, PropClosed, null)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.CloseIndexResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Closed = propClosed.Value, + Shards = propShards.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CloseIndexResult value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClosed, value.Closed, null, null); + writer.WriteProperty(options, PropShards, value.Shards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CloseIndexResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CloseIndexResult.g.cs index 8a1a81b18fb..398d0ae36c2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CloseIndexResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CloseIndexResult.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class CloseIndexResultConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClosed = System.Text.Json.JsonEncodedText.Encode("closed"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.CloseIndexResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClosed = default; - LocalJsonValue?> propShards = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClosed.TryReadProperty(ref reader, options, PropClosed, null)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.CloseIndexResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Closed = propClosed.Value, - Shards = propShards.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CloseIndexResult value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClosed, value.Closed, null, null); - writer.WriteProperty(options, PropShards, value.Shards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.CloseIndexResultConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.CloseIndexResultConverter))] public sealed partial class CloseIndexResult { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CloseShardResult.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CloseShardResult.Converters.g.cs new file mode 100644 index 00000000000..aa3d8df1021 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CloseShardResult.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class CloseShardResultConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFailures = System.Text.Json.JsonEncodedText.Encode("failures"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.CloseShardResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propFailures = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFailures.TryReadProperty(ref reader, options, PropFailures, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.CloseShardResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Failures = propFailures.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CloseShardResult value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFailures, value.Failures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CloseShardResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CloseShardResult.g.cs index 513639f9494..4f9267ce872 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CloseShardResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CloseShardResult.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class CloseShardResultConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFailures = System.Text.Json.JsonEncodedText.Encode("failures"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.CloseShardResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propFailures = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFailures.TryReadProperty(ref reader, options, PropFailures, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.CloseShardResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Failures = propFailures.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CloseShardResult value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFailures, value.Failures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.CloseShardResultConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.CloseShardResultConverter))] public sealed partial class CloseShardResult { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CreateFrom.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CreateFrom.Converters.g.cs new file mode 100644 index 00000000000..d6d1d41b609 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CreateFrom.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class CreateFromConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMappingsOverride = System.Text.Json.JsonEncodedText.Encode("mappings_override"); + private static readonly System.Text.Json.JsonEncodedText PropRemoveIndexBlocks = System.Text.Json.JsonEncodedText.Encode("remove_index_blocks"); + private static readonly System.Text.Json.JsonEncodedText PropSettingsOverride = System.Text.Json.JsonEncodedText.Encode("settings_override"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.CreateFrom Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMappingsOverride = default; + LocalJsonValue propRemoveIndexBlocks = default; + LocalJsonValue propSettingsOverride = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMappingsOverride.TryReadProperty(ref reader, options, PropMappingsOverride, null)) + { + continue; + } + + if (propRemoveIndexBlocks.TryReadProperty(ref reader, options, PropRemoveIndexBlocks, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSettingsOverride.TryReadProperty(ref reader, options, PropSettingsOverride, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.CreateFrom(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MappingsOverride = propMappingsOverride.Value, + RemoveIndexBlocks = propRemoveIndexBlocks.Value, + SettingsOverride = propSettingsOverride.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CreateFrom value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMappingsOverride, value.MappingsOverride, null, null); + writer.WriteProperty(options, PropRemoveIndexBlocks, value.RemoveIndexBlocks, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSettingsOverride, value.SettingsOverride, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CreateFrom.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CreateFrom.g.cs index 4fb53e93d1a..f2735d62852 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CreateFrom.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/CreateFrom.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class CreateFromConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMappingsOverride = System.Text.Json.JsonEncodedText.Encode("mappings_override"); - private static readonly System.Text.Json.JsonEncodedText PropRemoveIndexBlocks = System.Text.Json.JsonEncodedText.Encode("remove_index_blocks"); - private static readonly System.Text.Json.JsonEncodedText PropSettingsOverride = System.Text.Json.JsonEncodedText.Encode("settings_override"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.CreateFrom Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMappingsOverride = default; - LocalJsonValue propRemoveIndexBlocks = default; - LocalJsonValue propSettingsOverride = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMappingsOverride.TryReadProperty(ref reader, options, PropMappingsOverride, null)) - { - continue; - } - - if (propRemoveIndexBlocks.TryReadProperty(ref reader, options, PropRemoveIndexBlocks, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSettingsOverride.TryReadProperty(ref reader, options, PropSettingsOverride, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.CreateFrom(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MappingsOverride = propMappingsOverride.Value, - RemoveIndexBlocks = propRemoveIndexBlocks.Value, - SettingsOverride = propSettingsOverride.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.CreateFrom value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMappingsOverride, value.MappingsOverride, null, null); - writer.WriteProperty(options, PropRemoveIndexBlocks, value.RemoveIndexBlocks, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSettingsOverride, value.SettingsOverride, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.CreateFromConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.CreateFromConverter))] public sealed partial class CreateFrom { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStream.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStream.Converters.g.cs new file mode 100644 index 00000000000..67ce1f55e13 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStream.Converters.g.cs @@ -0,0 +1,234 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DataStreamConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowCustomRouting = System.Text.Json.JsonEncodedText.Encode("allow_custom_routing"); + private static readonly System.Text.Json.JsonEncodedText PropFailureStore = System.Text.Json.JsonEncodedText.Encode("failure_store"); + private static readonly System.Text.Json.JsonEncodedText PropGeneration = System.Text.Json.JsonEncodedText.Encode("generation"); + private static readonly System.Text.Json.JsonEncodedText PropHidden = System.Text.Json.JsonEncodedText.Encode("hidden"); + private static readonly System.Text.Json.JsonEncodedText PropIlmPolicy = System.Text.Json.JsonEncodedText.Encode("ilm_policy"); + private static readonly System.Text.Json.JsonEncodedText PropIndexMode = System.Text.Json.JsonEncodedText.Encode("index_mode"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropLifecycle = System.Text.Json.JsonEncodedText.Encode("lifecycle"); + private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropNextGenerationManagedBy = System.Text.Json.JsonEncodedText.Encode("next_generation_managed_by"); + private static readonly System.Text.Json.JsonEncodedText PropPreferIlm = System.Text.Json.JsonEncodedText.Encode("prefer_ilm"); + private static readonly System.Text.Json.JsonEncodedText PropReplicated = System.Text.Json.JsonEncodedText.Encode("replicated"); + private static readonly System.Text.Json.JsonEncodedText PropRolloverOnWrite = System.Text.Json.JsonEncodedText.Encode("rollover_on_write"); + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + private static readonly System.Text.Json.JsonEncodedText PropSystem = System.Text.Json.JsonEncodedText.Encode("system"); + private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"); + private static readonly System.Text.Json.JsonEncodedText PropTimestampField = System.Text.Json.JsonEncodedText.Encode("timestamp_field"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DataStream Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowCustomRouting = default; + LocalJsonValue propFailureStore = default; + LocalJsonValue propGeneration = default; + LocalJsonValue propHidden = default; + LocalJsonValue propIlmPolicy = default; + LocalJsonValue propIndexMode = default; + LocalJsonValue> propIndices = default; + LocalJsonValue propLifecycle = default; + LocalJsonValue propMappings = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propName = default; + LocalJsonValue propNextGenerationManagedBy = default; + LocalJsonValue propPreferIlm = default; + LocalJsonValue propReplicated = default; + LocalJsonValue propRolloverOnWrite = default; + LocalJsonValue propSettings = default; + LocalJsonValue propStatus = default; + LocalJsonValue propSystem = default; + LocalJsonValue propTemplate = default; + LocalJsonValue propTimestampField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowCustomRouting.TryReadProperty(ref reader, options, PropAllowCustomRouting, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFailureStore.TryReadProperty(ref reader, options, PropFailureStore, null)) + { + continue; + } + + if (propGeneration.TryReadProperty(ref reader, options, PropGeneration, null)) + { + continue; + } + + if (propHidden.TryReadProperty(ref reader, options, PropHidden, null)) + { + continue; + } + + if (propIlmPolicy.TryReadProperty(ref reader, options, PropIlmPolicy, null)) + { + continue; + } + + if (propIndexMode.TryReadProperty(ref reader, options, PropIndexMode, static Elastic.Clients.Elasticsearch.IndexManagement.IndexMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propLifecycle.TryReadProperty(ref reader, options, PropLifecycle, null)) + { + continue; + } + + if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propNextGenerationManagedBy.TryReadProperty(ref reader, options, PropNextGenerationManagedBy, null)) + { + continue; + } + + if (propPreferIlm.TryReadProperty(ref reader, options, PropPreferIlm, null)) + { + continue; + } + + if (propReplicated.TryReadProperty(ref reader, options, PropReplicated, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRolloverOnWrite.TryReadProperty(ref reader, options, PropRolloverOnWrite, null)) + { + continue; + } + + if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (propSystem.TryReadProperty(ref reader, options, PropSystem, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, null)) + { + continue; + } + + if (propTimestampField.TryReadProperty(ref reader, options, PropTimestampField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DataStream(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowCustomRouting = propAllowCustomRouting.Value, + FailureStore = propFailureStore.Value, + Generation = propGeneration.Value, + Hidden = propHidden.Value, + IlmPolicy = propIlmPolicy.Value, + IndexMode = propIndexMode.Value, + Indices = propIndices.Value, + Lifecycle = propLifecycle.Value, + Mappings = propMappings.Value, + Meta = propMeta.Value, + Name = propName.Value, + NextGenerationManagedBy = propNextGenerationManagedBy.Value, + PreferIlm = propPreferIlm.Value, + Replicated = propReplicated.Value, + RolloverOnWrite = propRolloverOnWrite.Value, + Settings = propSettings.Value, + Status = propStatus.Value, + System = propSystem.Value, + Template = propTemplate.Value, + TimestampField = propTimestampField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStream value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowCustomRouting, value.AllowCustomRouting, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFailureStore, value.FailureStore, null, null); + writer.WriteProperty(options, PropGeneration, value.Generation, null, null); + writer.WriteProperty(options, PropHidden, value.Hidden, null, null); + writer.WriteProperty(options, PropIlmPolicy, value.IlmPolicy, null, null); + writer.WriteProperty(options, PropIndexMode, value.IndexMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.IndexManagement.IndexMode? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropLifecycle, value.Lifecycle, null, null); + writer.WriteProperty(options, PropMappings, value.Mappings, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropNextGenerationManagedBy, value.NextGenerationManagedBy, null, null); + writer.WriteProperty(options, PropPreferIlm, value.PreferIlm, null, null); + writer.WriteProperty(options, PropReplicated, value.Replicated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRolloverOnWrite, value.RolloverOnWrite, null, null); + writer.WriteProperty(options, PropSettings, value.Settings, null, null); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteProperty(options, PropSystem, value.System, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTemplate, value.Template, null, null); + writer.WriteProperty(options, PropTimestampField, value.TimestampField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStream.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStream.g.cs index 347c0618cba..b2a6882879e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStream.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStream.g.cs @@ -23,217 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DataStreamConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowCustomRouting = System.Text.Json.JsonEncodedText.Encode("allow_custom_routing"); - private static readonly System.Text.Json.JsonEncodedText PropFailureStore = System.Text.Json.JsonEncodedText.Encode("failure_store"); - private static readonly System.Text.Json.JsonEncodedText PropGeneration = System.Text.Json.JsonEncodedText.Encode("generation"); - private static readonly System.Text.Json.JsonEncodedText PropHidden = System.Text.Json.JsonEncodedText.Encode("hidden"); - private static readonly System.Text.Json.JsonEncodedText PropIlmPolicy = System.Text.Json.JsonEncodedText.Encode("ilm_policy"); - private static readonly System.Text.Json.JsonEncodedText PropIndexMode = System.Text.Json.JsonEncodedText.Encode("index_mode"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropLifecycle = System.Text.Json.JsonEncodedText.Encode("lifecycle"); - private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropNextGenerationManagedBy = System.Text.Json.JsonEncodedText.Encode("next_generation_managed_by"); - private static readonly System.Text.Json.JsonEncodedText PropPreferIlm = System.Text.Json.JsonEncodedText.Encode("prefer_ilm"); - private static readonly System.Text.Json.JsonEncodedText PropReplicated = System.Text.Json.JsonEncodedText.Encode("replicated"); - private static readonly System.Text.Json.JsonEncodedText PropRolloverOnWrite = System.Text.Json.JsonEncodedText.Encode("rollover_on_write"); - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - private static readonly System.Text.Json.JsonEncodedText PropSystem = System.Text.Json.JsonEncodedText.Encode("system"); - private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"); - private static readonly System.Text.Json.JsonEncodedText PropTimestampField = System.Text.Json.JsonEncodedText.Encode("timestamp_field"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DataStream Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowCustomRouting = default; - LocalJsonValue propFailureStore = default; - LocalJsonValue propGeneration = default; - LocalJsonValue propHidden = default; - LocalJsonValue propIlmPolicy = default; - LocalJsonValue propIndexMode = default; - LocalJsonValue> propIndices = default; - LocalJsonValue propLifecycle = default; - LocalJsonValue propMappings = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propName = default; - LocalJsonValue propNextGenerationManagedBy = default; - LocalJsonValue propPreferIlm = default; - LocalJsonValue propReplicated = default; - LocalJsonValue propRolloverOnWrite = default; - LocalJsonValue propSettings = default; - LocalJsonValue propStatus = default; - LocalJsonValue propSystem = default; - LocalJsonValue propTemplate = default; - LocalJsonValue propTimestampField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowCustomRouting.TryReadProperty(ref reader, options, PropAllowCustomRouting, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFailureStore.TryReadProperty(ref reader, options, PropFailureStore, null)) - { - continue; - } - - if (propGeneration.TryReadProperty(ref reader, options, PropGeneration, null)) - { - continue; - } - - if (propHidden.TryReadProperty(ref reader, options, PropHidden, null)) - { - continue; - } - - if (propIlmPolicy.TryReadProperty(ref reader, options, PropIlmPolicy, null)) - { - continue; - } - - if (propIndexMode.TryReadProperty(ref reader, options, PropIndexMode, static Elastic.Clients.Elasticsearch.IndexManagement.IndexMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propLifecycle.TryReadProperty(ref reader, options, PropLifecycle, null)) - { - continue; - } - - if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propNextGenerationManagedBy.TryReadProperty(ref reader, options, PropNextGenerationManagedBy, null)) - { - continue; - } - - if (propPreferIlm.TryReadProperty(ref reader, options, PropPreferIlm, null)) - { - continue; - } - - if (propReplicated.TryReadProperty(ref reader, options, PropReplicated, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRolloverOnWrite.TryReadProperty(ref reader, options, PropRolloverOnWrite, null)) - { - continue; - } - - if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (propSystem.TryReadProperty(ref reader, options, PropSystem, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, null)) - { - continue; - } - - if (propTimestampField.TryReadProperty(ref reader, options, PropTimestampField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DataStream(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowCustomRouting = propAllowCustomRouting.Value, - FailureStore = propFailureStore.Value, - Generation = propGeneration.Value, - Hidden = propHidden.Value, - IlmPolicy = propIlmPolicy.Value, - IndexMode = propIndexMode.Value, - Indices = propIndices.Value, - Lifecycle = propLifecycle.Value, - Mappings = propMappings.Value, - Meta = propMeta.Value, - Name = propName.Value, - NextGenerationManagedBy = propNextGenerationManagedBy.Value, - PreferIlm = propPreferIlm.Value, - Replicated = propReplicated.Value, - RolloverOnWrite = propRolloverOnWrite.Value, - Settings = propSettings.Value, - Status = propStatus.Value, - System = propSystem.Value, - Template = propTemplate.Value, - TimestampField = propTimestampField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStream value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowCustomRouting, value.AllowCustomRouting, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFailureStore, value.FailureStore, null, null); - writer.WriteProperty(options, PropGeneration, value.Generation, null, null); - writer.WriteProperty(options, PropHidden, value.Hidden, null, null); - writer.WriteProperty(options, PropIlmPolicy, value.IlmPolicy, null, null); - writer.WriteProperty(options, PropIndexMode, value.IndexMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.IndexManagement.IndexMode? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropLifecycle, value.Lifecycle, null, null); - writer.WriteProperty(options, PropMappings, value.Mappings, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropNextGenerationManagedBy, value.NextGenerationManagedBy, null, null); - writer.WriteProperty(options, PropPreferIlm, value.PreferIlm, null, null); - writer.WriteProperty(options, PropReplicated, value.Replicated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRolloverOnWrite, value.RolloverOnWrite, null, null); - writer.WriteProperty(options, PropSettings, value.Settings, null, null); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteProperty(options, PropSystem, value.System, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTemplate, value.Template, null, null); - writer.WriteProperty(options, PropTimestampField, value.TimestampField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DataStreamConverter))] public sealed partial class DataStream { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamFailureStore.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamFailureStore.Converters.g.cs new file mode 100644 index 00000000000..0aee5e10551 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamFailureStore.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DataStreamFailureStoreConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropLifecycle = System.Text.Json.JsonEncodedText.Encode("lifecycle"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamFailureStore Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEnabled = default; + LocalJsonValue propLifecycle = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLifecycle.TryReadProperty(ref reader, options, PropLifecycle, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamFailureStore(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Enabled = propEnabled.Value, + Lifecycle = propLifecycle.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamFailureStore value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLifecycle, value.Lifecycle, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamFailureStore.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamFailureStore.g.cs index 25c55e91f21..a8275bfad13 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamFailureStore.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamFailureStore.g.cs @@ -23,60 +23,12 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DataStreamFailureStoreConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropLifecycle = System.Text.Json.JsonEncodedText.Encode("lifecycle"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamFailureStore Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEnabled = default; - LocalJsonValue propLifecycle = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLifecycle.TryReadProperty(ref reader, options, PropLifecycle, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamFailureStore(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Enabled = propEnabled.Value, - Lifecycle = propLifecycle.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamFailureStore value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLifecycle, value.Lifecycle, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Data stream failure store contains the configuration of the failure store for a given data stream. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamFailureStoreConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DataStreamFailureStoreConverter))] public sealed partial class DataStreamFailureStore { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamFailureStoreTemplate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamFailureStoreTemplate.Converters.g.cs new file mode 100644 index 00000000000..4ae2d43713e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamFailureStoreTemplate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DataStreamFailureStoreTemplateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropLifecycle = System.Text.Json.JsonEncodedText.Encode("lifecycle"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamFailureStoreTemplate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEnabled = default; + LocalJsonValue propLifecycle = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLifecycle.TryReadProperty(ref reader, options, PropLifecycle, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamFailureStoreTemplate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Enabled = propEnabled.Value, + Lifecycle = propLifecycle.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamFailureStoreTemplate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLifecycle, value.Lifecycle, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamFailureStoreTemplate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamFailureStoreTemplate.g.cs index 6ed811f4e7f..933cd89b8b2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamFailureStoreTemplate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamFailureStoreTemplate.g.cs @@ -23,60 +23,12 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DataStreamFailureStoreTemplateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropLifecycle = System.Text.Json.JsonEncodedText.Encode("lifecycle"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamFailureStoreTemplate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEnabled = default; - LocalJsonValue propLifecycle = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLifecycle.TryReadProperty(ref reader, options, PropLifecycle, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamFailureStoreTemplate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Enabled = propEnabled.Value, - Lifecycle = propLifecycle.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamFailureStoreTemplate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLifecycle, value.Lifecycle, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Template equivalent of DataStreamFailureStore that allows nullable values. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamFailureStoreTemplateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DataStreamFailureStoreTemplateConverter))] public sealed partial class DataStreamFailureStoreTemplate { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamIndex.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamIndex.Converters.g.cs new file mode 100644 index 00000000000..4fce7a362f2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamIndex.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DataStreamIndexConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIlmPolicy = System.Text.Json.JsonEncodedText.Encode("ilm_policy"); + private static readonly System.Text.Json.JsonEncodedText PropIndexMode = System.Text.Json.JsonEncodedText.Encode("index_mode"); + private static readonly System.Text.Json.JsonEncodedText PropIndexName = System.Text.Json.JsonEncodedText.Encode("index_name"); + private static readonly System.Text.Json.JsonEncodedText PropIndexUuid = System.Text.Json.JsonEncodedText.Encode("index_uuid"); + private static readonly System.Text.Json.JsonEncodedText PropManagedBy = System.Text.Json.JsonEncodedText.Encode("managed_by"); + private static readonly System.Text.Json.JsonEncodedText PropPreferIlm = System.Text.Json.JsonEncodedText.Encode("prefer_ilm"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamIndex Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIlmPolicy = default; + LocalJsonValue propIndexMode = default; + LocalJsonValue propIndexName = default; + LocalJsonValue propIndexUuid = default; + LocalJsonValue propManagedBy = default; + LocalJsonValue propPreferIlm = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIlmPolicy.TryReadProperty(ref reader, options, PropIlmPolicy, null)) + { + continue; + } + + if (propIndexMode.TryReadProperty(ref reader, options, PropIndexMode, static Elastic.Clients.Elasticsearch.IndexManagement.IndexMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndexName.TryReadProperty(ref reader, options, PropIndexName, null)) + { + continue; + } + + if (propIndexUuid.TryReadProperty(ref reader, options, PropIndexUuid, null)) + { + continue; + } + + if (propManagedBy.TryReadProperty(ref reader, options, PropManagedBy, static Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPreferIlm.TryReadProperty(ref reader, options, PropPreferIlm, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamIndex(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + IlmPolicy = propIlmPolicy.Value, + IndexMode = propIndexMode.Value, + IndexName = propIndexName.Value, + IndexUuid = propIndexUuid.Value, + ManagedBy = propManagedBy.Value, + PreferIlm = propPreferIlm.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamIndex value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIlmPolicy, value.IlmPolicy, null, null); + writer.WriteProperty(options, PropIndexMode, value.IndexMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.IndexManagement.IndexMode? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndexName, value.IndexName, null, null); + writer.WriteProperty(options, PropIndexUuid, value.IndexUuid, null, null); + writer.WriteProperty(options, PropManagedBy, value.ManagedBy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPreferIlm, value.PreferIlm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamIndex.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamIndex.g.cs index 635934ee023..73d81df3428 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamIndex.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamIndex.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DataStreamIndexConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIlmPolicy = System.Text.Json.JsonEncodedText.Encode("ilm_policy"); - private static readonly System.Text.Json.JsonEncodedText PropIndexMode = System.Text.Json.JsonEncodedText.Encode("index_mode"); - private static readonly System.Text.Json.JsonEncodedText PropIndexName = System.Text.Json.JsonEncodedText.Encode("index_name"); - private static readonly System.Text.Json.JsonEncodedText PropIndexUuid = System.Text.Json.JsonEncodedText.Encode("index_uuid"); - private static readonly System.Text.Json.JsonEncodedText PropManagedBy = System.Text.Json.JsonEncodedText.Encode("managed_by"); - private static readonly System.Text.Json.JsonEncodedText PropPreferIlm = System.Text.Json.JsonEncodedText.Encode("prefer_ilm"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamIndex Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIlmPolicy = default; - LocalJsonValue propIndexMode = default; - LocalJsonValue propIndexName = default; - LocalJsonValue propIndexUuid = default; - LocalJsonValue propManagedBy = default; - LocalJsonValue propPreferIlm = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIlmPolicy.TryReadProperty(ref reader, options, PropIlmPolicy, null)) - { - continue; - } - - if (propIndexMode.TryReadProperty(ref reader, options, PropIndexMode, static Elastic.Clients.Elasticsearch.IndexManagement.IndexMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndexName.TryReadProperty(ref reader, options, PropIndexName, null)) - { - continue; - } - - if (propIndexUuid.TryReadProperty(ref reader, options, PropIndexUuid, null)) - { - continue; - } - - if (propManagedBy.TryReadProperty(ref reader, options, PropManagedBy, static Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPreferIlm.TryReadProperty(ref reader, options, PropPreferIlm, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamIndex(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - IlmPolicy = propIlmPolicy.Value, - IndexMode = propIndexMode.Value, - IndexName = propIndexName.Value, - IndexUuid = propIndexUuid.Value, - ManagedBy = propManagedBy.Value, - PreferIlm = propPreferIlm.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamIndex value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIlmPolicy, value.IlmPolicy, null, null); - writer.WriteProperty(options, PropIndexMode, value.IndexMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.IndexManagement.IndexMode? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndexName, value.IndexName, null, null); - writer.WriteProperty(options, PropIndexUuid, value.IndexUuid, null, null); - writer.WriteProperty(options, PropManagedBy, value.ManagedBy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPreferIlm, value.PreferIlm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamIndexConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DataStreamIndexConverter))] public sealed partial class DataStreamIndex { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.Converters.g.cs new file mode 100644 index 00000000000..35a827108e2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DataStreamLifecycleConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDataRetention = System.Text.Json.JsonEncodedText.Encode("data_retention"); + private static readonly System.Text.Json.JsonEncodedText PropDownsampling = System.Text.Json.JsonEncodedText.Encode("downsampling"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycle Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDataRetention = default; + LocalJsonValue propDownsampling = default; + LocalJsonValue propEnabled = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDataRetention.TryReadProperty(ref reader, options, PropDataRetention, null)) + { + continue; + } + + if (propDownsampling.TryReadProperty(ref reader, options, PropDownsampling, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycle(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DataRetention = propDataRetention.Value, + Downsampling = propDownsampling.Value, + Enabled = propEnabled.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycle value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDataRetention, value.DataRetention, null, null); + writer.WriteProperty(options, PropDownsampling, value.Downsampling, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.g.cs index cec385460dc..b57d7848049 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.g.cs @@ -23,69 +23,12 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DataStreamLifecycleConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDataRetention = System.Text.Json.JsonEncodedText.Encode("data_retention"); - private static readonly System.Text.Json.JsonEncodedText PropDownsampling = System.Text.Json.JsonEncodedText.Encode("downsampling"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycle Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDataRetention = default; - LocalJsonValue propDownsampling = default; - LocalJsonValue propEnabled = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDataRetention.TryReadProperty(ref reader, options, PropDataRetention, null)) - { - continue; - } - - if (propDownsampling.TryReadProperty(ref reader, options, PropDownsampling, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycle(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DataRetention = propDataRetention.Value, - Downsampling = propDownsampling.Value, - Enabled = propEnabled.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycle value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDataRetention, value.DataRetention, null, null); - writer.WriteProperty(options, PropDownsampling, value.Downsampling, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Data stream lifecycle denotes that a data stream is managed by the data stream lifecycle and contains the configuration. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DataStreamLifecycleConverter))] public sealed partial class DataStreamLifecycle { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleDownsampling.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleDownsampling.Converters.g.cs new file mode 100644 index 00000000000..eafb64186fb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleDownsampling.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DataStreamLifecycleDownsamplingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRounds = System.Text.Json.JsonEncodedText.Encode("rounds"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsampling Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propRounds = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRounds.TryReadProperty(ref reader, options, PropRounds, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsampling(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Rounds = propRounds.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsampling value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRounds, value.Rounds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleDownsampling.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleDownsampling.g.cs index 7691490eab3..4b86442b785 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleDownsampling.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleDownsampling.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DataStreamLifecycleDownsamplingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRounds = System.Text.Json.JsonEncodedText.Encode("rounds"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsampling Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propRounds = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRounds.TryReadProperty(ref reader, options, PropRounds, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsampling(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Rounds = propRounds.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsampling value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRounds, value.Rounds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDownsamplingConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DataStreamLifecycleDownsamplingConverter))] public sealed partial class DataStreamLifecycleDownsampling { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleExplain.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleExplain.Converters.g.cs new file mode 100644 index 00000000000..1cd13d1904a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleExplain.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DataStreamLifecycleExplainConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); + private static readonly System.Text.Json.JsonEncodedText PropGenerationTime = System.Text.Json.JsonEncodedText.Encode("generation_time"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropIndexCreationDateMillis = System.Text.Json.JsonEncodedText.Encode("index_creation_date_millis"); + private static readonly System.Text.Json.JsonEncodedText PropLifecycle = System.Text.Json.JsonEncodedText.Encode("lifecycle"); + private static readonly System.Text.Json.JsonEncodedText PropManagedByLifecycle = System.Text.Json.JsonEncodedText.Encode("managed_by_lifecycle"); + private static readonly System.Text.Json.JsonEncodedText PropRolloverDateMillis = System.Text.Json.JsonEncodedText.Encode("rollover_date_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSinceIndexCreation = System.Text.Json.JsonEncodedText.Encode("time_since_index_creation"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSinceRollover = System.Text.Json.JsonEncodedText.Encode("time_since_rollover"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleExplain Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propError = default; + LocalJsonValue propGenerationTime = default; + LocalJsonValue propIndex = default; + LocalJsonValue propIndexCreationDateMillis = default; + LocalJsonValue propLifecycle = default; + LocalJsonValue propManagedByLifecycle = default; + LocalJsonValue propRolloverDateMillis = default; + LocalJsonValue propTimeSinceIndexCreation = default; + LocalJsonValue propTimeSinceRollover = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propError.TryReadProperty(ref reader, options, PropError, null)) + { + continue; + } + + if (propGenerationTime.TryReadProperty(ref reader, options, PropGenerationTime, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propIndexCreationDateMillis.TryReadProperty(ref reader, options, PropIndexCreationDateMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propLifecycle.TryReadProperty(ref reader, options, PropLifecycle, null)) + { + continue; + } + + if (propManagedByLifecycle.TryReadProperty(ref reader, options, PropManagedByLifecycle, null)) + { + continue; + } + + if (propRolloverDateMillis.TryReadProperty(ref reader, options, PropRolloverDateMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propTimeSinceIndexCreation.TryReadProperty(ref reader, options, PropTimeSinceIndexCreation, null)) + { + continue; + } + + if (propTimeSinceRollover.TryReadProperty(ref reader, options, PropTimeSinceRollover, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleExplain(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Error = propError.Value, + GenerationTime = propGenerationTime.Value, + Index = propIndex.Value, + IndexCreationDateMillis = propIndexCreationDateMillis.Value, + Lifecycle = propLifecycle.Value, + ManagedByLifecycle = propManagedByLifecycle.Value, + RolloverDateMillis = propRolloverDateMillis.Value, + TimeSinceIndexCreation = propTimeSinceIndexCreation.Value, + TimeSinceRollover = propTimeSinceRollover.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleExplain value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropError, value.Error, null, null); + writer.WriteProperty(options, PropGenerationTime, value.GenerationTime, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropIndexCreationDateMillis, value.IndexCreationDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropLifecycle, value.Lifecycle, null, null); + writer.WriteProperty(options, PropManagedByLifecycle, value.ManagedByLifecycle, null, null); + writer.WriteProperty(options, PropRolloverDateMillis, value.RolloverDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropTimeSinceIndexCreation, value.TimeSinceIndexCreation, null, null); + writer.WriteProperty(options, PropTimeSinceRollover, value.TimeSinceRollover, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleExplain.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleExplain.g.cs index 897cfab7d08..a0e40c1d5f4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleExplain.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleExplain.g.cs @@ -23,118 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DataStreamLifecycleExplainConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); - private static readonly System.Text.Json.JsonEncodedText PropGenerationTime = System.Text.Json.JsonEncodedText.Encode("generation_time"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropIndexCreationDateMillis = System.Text.Json.JsonEncodedText.Encode("index_creation_date_millis"); - private static readonly System.Text.Json.JsonEncodedText PropLifecycle = System.Text.Json.JsonEncodedText.Encode("lifecycle"); - private static readonly System.Text.Json.JsonEncodedText PropManagedByLifecycle = System.Text.Json.JsonEncodedText.Encode("managed_by_lifecycle"); - private static readonly System.Text.Json.JsonEncodedText PropRolloverDateMillis = System.Text.Json.JsonEncodedText.Encode("rollover_date_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSinceIndexCreation = System.Text.Json.JsonEncodedText.Encode("time_since_index_creation"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSinceRollover = System.Text.Json.JsonEncodedText.Encode("time_since_rollover"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleExplain Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propError = default; - LocalJsonValue propGenerationTime = default; - LocalJsonValue propIndex = default; - LocalJsonValue propIndexCreationDateMillis = default; - LocalJsonValue propLifecycle = default; - LocalJsonValue propManagedByLifecycle = default; - LocalJsonValue propRolloverDateMillis = default; - LocalJsonValue propTimeSinceIndexCreation = default; - LocalJsonValue propTimeSinceRollover = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propError.TryReadProperty(ref reader, options, PropError, null)) - { - continue; - } - - if (propGenerationTime.TryReadProperty(ref reader, options, PropGenerationTime, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propIndexCreationDateMillis.TryReadProperty(ref reader, options, PropIndexCreationDateMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propLifecycle.TryReadProperty(ref reader, options, PropLifecycle, null)) - { - continue; - } - - if (propManagedByLifecycle.TryReadProperty(ref reader, options, PropManagedByLifecycle, null)) - { - continue; - } - - if (propRolloverDateMillis.TryReadProperty(ref reader, options, PropRolloverDateMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propTimeSinceIndexCreation.TryReadProperty(ref reader, options, PropTimeSinceIndexCreation, null)) - { - continue; - } - - if (propTimeSinceRollover.TryReadProperty(ref reader, options, PropTimeSinceRollover, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleExplain(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Error = propError.Value, - GenerationTime = propGenerationTime.Value, - Index = propIndex.Value, - IndexCreationDateMillis = propIndexCreationDateMillis.Value, - Lifecycle = propLifecycle.Value, - ManagedByLifecycle = propManagedByLifecycle.Value, - RolloverDateMillis = propRolloverDateMillis.Value, - TimeSinceIndexCreation = propTimeSinceIndexCreation.Value, - TimeSinceRollover = propTimeSinceRollover.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleExplain value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropError, value.Error, null, null); - writer.WriteProperty(options, PropGenerationTime, value.GenerationTime, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropIndexCreationDateMillis, value.IndexCreationDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropLifecycle, value.Lifecycle, null, null); - writer.WriteProperty(options, PropManagedByLifecycle, value.ManagedByLifecycle, null, null); - writer.WriteProperty(options, PropRolloverDateMillis, value.RolloverDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropTimeSinceIndexCreation, value.TimeSinceIndexCreation, null, null); - writer.WriteProperty(options, PropTimeSinceRollover, value.TimeSinceRollover, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleExplainConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DataStreamLifecycleExplainConverter))] public sealed partial class DataStreamLifecycleExplain { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleRolloverConditions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleRolloverConditions.Converters.g.cs new file mode 100644 index 00000000000..f487f868feb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleRolloverConditions.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DataStreamLifecycleRolloverConditionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxAge = System.Text.Json.JsonEncodedText.Encode("max_age"); + private static readonly System.Text.Json.JsonEncodedText PropMaxDocs = System.Text.Json.JsonEncodedText.Encode("max_docs"); + private static readonly System.Text.Json.JsonEncodedText PropMaxPrimaryShardDocs = System.Text.Json.JsonEncodedText.Encode("max_primary_shard_docs"); + private static readonly System.Text.Json.JsonEncodedText PropMaxPrimaryShardSize = System.Text.Json.JsonEncodedText.Encode("max_primary_shard_size"); + private static readonly System.Text.Json.JsonEncodedText PropMaxSize = System.Text.Json.JsonEncodedText.Encode("max_size"); + private static readonly System.Text.Json.JsonEncodedText PropMinAge = System.Text.Json.JsonEncodedText.Encode("min_age"); + private static readonly System.Text.Json.JsonEncodedText PropMinDocs = System.Text.Json.JsonEncodedText.Encode("min_docs"); + private static readonly System.Text.Json.JsonEncodedText PropMinPrimaryShardDocs = System.Text.Json.JsonEncodedText.Encode("min_primary_shard_docs"); + private static readonly System.Text.Json.JsonEncodedText PropMinPrimaryShardSize = System.Text.Json.JsonEncodedText.Encode("min_primary_shard_size"); + private static readonly System.Text.Json.JsonEncodedText PropMinSize = System.Text.Json.JsonEncodedText.Encode("min_size"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxAge = default; + LocalJsonValue propMaxDocs = default; + LocalJsonValue propMaxPrimaryShardDocs = default; + LocalJsonValue propMaxPrimaryShardSize = default; + LocalJsonValue propMaxSize = default; + LocalJsonValue propMinAge = default; + LocalJsonValue propMinDocs = default; + LocalJsonValue propMinPrimaryShardDocs = default; + LocalJsonValue propMinPrimaryShardSize = default; + LocalJsonValue propMinSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxAge.TryReadProperty(ref reader, options, PropMaxAge, null)) + { + continue; + } + + if (propMaxDocs.TryReadProperty(ref reader, options, PropMaxDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxPrimaryShardDocs.TryReadProperty(ref reader, options, PropMaxPrimaryShardDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxPrimaryShardSize.TryReadProperty(ref reader, options, PropMaxPrimaryShardSize, null)) + { + continue; + } + + if (propMaxSize.TryReadProperty(ref reader, options, PropMaxSize, null)) + { + continue; + } + + if (propMinAge.TryReadProperty(ref reader, options, PropMinAge, null)) + { + continue; + } + + if (propMinDocs.TryReadProperty(ref reader, options, PropMinDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinPrimaryShardDocs.TryReadProperty(ref reader, options, PropMinPrimaryShardDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinPrimaryShardSize.TryReadProperty(ref reader, options, PropMinPrimaryShardSize, null)) + { + continue; + } + + if (propMinSize.TryReadProperty(ref reader, options, PropMinSize, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxAge = propMaxAge.Value, + MaxDocs = propMaxDocs.Value, + MaxPrimaryShardDocs = propMaxPrimaryShardDocs.Value, + MaxPrimaryShardSize = propMaxPrimaryShardSize.Value, + MaxSize = propMaxSize.Value, + MinAge = propMinAge.Value, + MinDocs = propMinDocs.Value, + MinPrimaryShardDocs = propMinPrimaryShardDocs.Value, + MinPrimaryShardSize = propMinPrimaryShardSize.Value, + MinSize = propMinSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxAge, value.MaxAge, null, null); + writer.WriteProperty(options, PropMaxDocs, value.MaxDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxPrimaryShardDocs, value.MaxPrimaryShardDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxPrimaryShardSize, value.MaxPrimaryShardSize, null, null); + writer.WriteProperty(options, PropMaxSize, value.MaxSize, null, null); + writer.WriteProperty(options, PropMinAge, value.MinAge, null, null); + writer.WriteProperty(options, PropMinDocs, value.MinDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinPrimaryShardDocs, value.MinPrimaryShardDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinPrimaryShardSize, value.MinPrimaryShardSize, null, null); + writer.WriteProperty(options, PropMinSize, value.MinSize, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleRolloverConditions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleRolloverConditions.g.cs index 1f11b62010b..fafd4b69cbc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleRolloverConditions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleRolloverConditions.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DataStreamLifecycleRolloverConditionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxAge = System.Text.Json.JsonEncodedText.Encode("max_age"); - private static readonly System.Text.Json.JsonEncodedText PropMaxDocs = System.Text.Json.JsonEncodedText.Encode("max_docs"); - private static readonly System.Text.Json.JsonEncodedText PropMaxPrimaryShardDocs = System.Text.Json.JsonEncodedText.Encode("max_primary_shard_docs"); - private static readonly System.Text.Json.JsonEncodedText PropMaxPrimaryShardSize = System.Text.Json.JsonEncodedText.Encode("max_primary_shard_size"); - private static readonly System.Text.Json.JsonEncodedText PropMaxSize = System.Text.Json.JsonEncodedText.Encode("max_size"); - private static readonly System.Text.Json.JsonEncodedText PropMinAge = System.Text.Json.JsonEncodedText.Encode("min_age"); - private static readonly System.Text.Json.JsonEncodedText PropMinDocs = System.Text.Json.JsonEncodedText.Encode("min_docs"); - private static readonly System.Text.Json.JsonEncodedText PropMinPrimaryShardDocs = System.Text.Json.JsonEncodedText.Encode("min_primary_shard_docs"); - private static readonly System.Text.Json.JsonEncodedText PropMinPrimaryShardSize = System.Text.Json.JsonEncodedText.Encode("min_primary_shard_size"); - private static readonly System.Text.Json.JsonEncodedText PropMinSize = System.Text.Json.JsonEncodedText.Encode("min_size"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxAge = default; - LocalJsonValue propMaxDocs = default; - LocalJsonValue propMaxPrimaryShardDocs = default; - LocalJsonValue propMaxPrimaryShardSize = default; - LocalJsonValue propMaxSize = default; - LocalJsonValue propMinAge = default; - LocalJsonValue propMinDocs = default; - LocalJsonValue propMinPrimaryShardDocs = default; - LocalJsonValue propMinPrimaryShardSize = default; - LocalJsonValue propMinSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxAge.TryReadProperty(ref reader, options, PropMaxAge, null)) - { - continue; - } - - if (propMaxDocs.TryReadProperty(ref reader, options, PropMaxDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxPrimaryShardDocs.TryReadProperty(ref reader, options, PropMaxPrimaryShardDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxPrimaryShardSize.TryReadProperty(ref reader, options, PropMaxPrimaryShardSize, null)) - { - continue; - } - - if (propMaxSize.TryReadProperty(ref reader, options, PropMaxSize, null)) - { - continue; - } - - if (propMinAge.TryReadProperty(ref reader, options, PropMinAge, null)) - { - continue; - } - - if (propMinDocs.TryReadProperty(ref reader, options, PropMinDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinPrimaryShardDocs.TryReadProperty(ref reader, options, PropMinPrimaryShardDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinPrimaryShardSize.TryReadProperty(ref reader, options, PropMinPrimaryShardSize, null)) - { - continue; - } - - if (propMinSize.TryReadProperty(ref reader, options, PropMinSize, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxAge = propMaxAge.Value, - MaxDocs = propMaxDocs.Value, - MaxPrimaryShardDocs = propMaxPrimaryShardDocs.Value, - MaxPrimaryShardSize = propMaxPrimaryShardSize.Value, - MaxSize = propMaxSize.Value, - MinAge = propMinAge.Value, - MinDocs = propMinDocs.Value, - MinPrimaryShardDocs = propMinPrimaryShardDocs.Value, - MinPrimaryShardSize = propMinPrimaryShardSize.Value, - MinSize = propMinSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxAge, value.MaxAge, null, null); - writer.WriteProperty(options, PropMaxDocs, value.MaxDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxPrimaryShardDocs, value.MaxPrimaryShardDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxPrimaryShardSize, value.MaxPrimaryShardSize, null, null); - writer.WriteProperty(options, PropMaxSize, value.MaxSize, null, null); - writer.WriteProperty(options, PropMinAge, value.MinAge, null, null); - writer.WriteProperty(options, PropMinDocs, value.MinDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinPrimaryShardDocs, value.MinPrimaryShardDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinPrimaryShardSize, value.MinPrimaryShardSize, null, null); - writer.WriteProperty(options, PropMinSize, value.MinSize, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DataStreamLifecycleRolloverConditionsConverter))] public sealed partial class DataStreamLifecycleRolloverConditions { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.Converters.g.cs new file mode 100644 index 00000000000..6727213c461 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DataStreamLifecycleWithRolloverConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDataRetention = System.Text.Json.JsonEncodedText.Encode("data_retention"); + private static readonly System.Text.Json.JsonEncodedText PropDownsampling = System.Text.Json.JsonEncodedText.Encode("downsampling"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropRollover = System.Text.Json.JsonEncodedText.Encode("rollover"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDataRetention = default; + LocalJsonValue propDownsampling = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propRollover = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDataRetention.TryReadProperty(ref reader, options, PropDataRetention, null)) + { + continue; + } + + if (propDownsampling.TryReadProperty(ref reader, options, PropDownsampling, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRollover.TryReadProperty(ref reader, options, PropRollover, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DataRetention = propDataRetention.Value, + Downsampling = propDownsampling.Value, + Enabled = propEnabled.Value, + Rollover = propRollover.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDataRetention, value.DataRetention, null, null); + writer.WriteProperty(options, PropDownsampling, value.Downsampling, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRollover, value.Rollover, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.g.cs index 2500777e4a2..5b0f50b495d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.g.cs @@ -23,79 +23,13 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DataStreamLifecycleWithRolloverConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDataRetention = System.Text.Json.JsonEncodedText.Encode("data_retention"); - private static readonly System.Text.Json.JsonEncodedText PropDownsampling = System.Text.Json.JsonEncodedText.Encode("downsampling"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropRollover = System.Text.Json.JsonEncodedText.Encode("rollover"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDataRetention = default; - LocalJsonValue propDownsampling = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propRollover = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDataRetention.TryReadProperty(ref reader, options, PropDataRetention, null)) - { - continue; - } - - if (propDownsampling.TryReadProperty(ref reader, options, PropDownsampling, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRollover.TryReadProperty(ref reader, options, PropRollover, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DataRetention = propDataRetention.Value, - Downsampling = propDownsampling.Value, - Enabled = propEnabled.Value, - Rollover = propRollover.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDataRetention, value.DataRetention, null, null); - writer.WriteProperty(options, PropDownsampling, value.Downsampling, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRollover, value.Rollover, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Data stream lifecycle with rollover can be used to display the configuration including the default rollover conditions, /// if asked. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DataStreamLifecycleWithRolloverConverter))] public sealed partial class DataStreamLifecycleWithRollover { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamMappings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamMappings.Converters.g.cs new file mode 100644 index 00000000000..e8e78a88fa8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamMappings.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DataStreamMappingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEffectiveMappings = System.Text.Json.JsonEncodedText.Encode("effective_mappings"); + private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamMappings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEffectiveMappings = default; + LocalJsonValue propMappings = default; + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEffectiveMappings.TryReadProperty(ref reader, options, PropEffectiveMappings, null)) + { + continue; + } + + if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamMappings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + EffectiveMappings = propEffectiveMappings.Value, + Mappings = propMappings.Value, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamMappings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEffectiveMappings, value.EffectiveMappings, null, null); + writer.WriteProperty(options, PropMappings, value.Mappings, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamMappings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamMappings.g.cs index 99da0da48fd..ee0ab3de2c4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamMappings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamMappings.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DataStreamMappingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEffectiveMappings = System.Text.Json.JsonEncodedText.Encode("effective_mappings"); - private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamMappings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEffectiveMappings = default; - LocalJsonValue propMappings = default; - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEffectiveMappings.TryReadProperty(ref reader, options, PropEffectiveMappings, null)) - { - continue; - } - - if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamMappings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - EffectiveMappings = propEffectiveMappings.Value, - Mappings = propMappings.Value, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamMappings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEffectiveMappings, value.EffectiveMappings, null, null); - writer.WriteProperty(options, PropMappings, value.Mappings, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamMappingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DataStreamMappingsConverter))] public sealed partial class DataStreamMappings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamOptions.Converters.g.cs new file mode 100644 index 00000000000..80824d1c556 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamOptions.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DataStreamOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFailureStore = System.Text.Json.JsonEncodedText.Encode("failure_store"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFailureStore = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFailureStore.TryReadProperty(ref reader, options, PropFailureStore, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FailureStore = propFailureStore.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamOptions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFailureStore, value.FailureStore, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamOptions.g.cs index f66053be3bf..0df915325bd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamOptions.g.cs @@ -23,52 +23,13 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DataStreamOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFailureStore = System.Text.Json.JsonEncodedText.Encode("failure_store"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFailureStore = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFailureStore.TryReadProperty(ref reader, options, PropFailureStore, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FailureStore = propFailureStore.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamOptions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFailureStore, value.FailureStore, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Data stream options contain the configuration of data stream level features for a given data stream, for example, /// the failure store configuration. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DataStreamOptionsConverter))] public sealed partial class DataStreamOptions { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamOptionsTemplate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamOptionsTemplate.Converters.g.cs new file mode 100644 index 00000000000..48e0818ea65 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamOptionsTemplate.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DataStreamOptionsTemplateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFailureStore = System.Text.Json.JsonEncodedText.Encode("failure_store"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamOptionsTemplate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFailureStore = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFailureStore.TryReadProperty(ref reader, options, PropFailureStore, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamOptionsTemplate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FailureStore = propFailureStore.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamOptionsTemplate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFailureStore, value.FailureStore, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamOptionsTemplate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamOptionsTemplate.g.cs index bfd76cb5115..14541d3f775 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamOptionsTemplate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamOptionsTemplate.g.cs @@ -23,51 +23,12 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DataStreamOptionsTemplateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFailureStore = System.Text.Json.JsonEncodedText.Encode("failure_store"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamOptionsTemplate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFailureStore = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFailureStore.TryReadProperty(ref reader, options, PropFailureStore, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamOptionsTemplate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FailureStore = propFailureStore.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamOptionsTemplate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFailureStore, value.FailureStore, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Data stream options template contains the same information as DataStreamOptions but allows them to be set explicitly to null. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamOptionsTemplateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DataStreamOptionsTemplateConverter))] public sealed partial class DataStreamOptionsTemplate { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamSettings.Converters.g.cs new file mode 100644 index 00000000000..bfe11470621 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamSettings.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DataStreamSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEffectiveSettings = System.Text.Json.JsonEncodedText.Encode("effective_settings"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEffectiveSettings = default; + LocalJsonValue propName = default; + LocalJsonValue propSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEffectiveSettings.TryReadProperty(ref reader, options, PropEffectiveSettings, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + EffectiveSettings = propEffectiveSettings.Value, + Name = propName.Value, + Settings = propSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEffectiveSettings, value.EffectiveSettings, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropSettings, value.Settings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamSettings.g.cs index e2fbc57e9f6..0fd271b5b22 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamSettings.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DataStreamSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEffectiveSettings = System.Text.Json.JsonEncodedText.Encode("effective_settings"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEffectiveSettings = default; - LocalJsonValue propName = default; - LocalJsonValue propSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEffectiveSettings.TryReadProperty(ref reader, options, PropEffectiveSettings, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - EffectiveSettings = propEffectiveSettings.Value, - Name = propName.Value, - Settings = propSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEffectiveSettings, value.EffectiveSettings, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropSettings, value.Settings, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DataStreamSettingsConverter))] public sealed partial class DataStreamSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamSettingsError.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamSettingsError.Converters.g.cs new file mode 100644 index 00000000000..aca63093047 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamSettingsError.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DataStreamSettingsErrorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamSettingsError Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propError = default; + LocalJsonValue propIndex = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propError.TryReadProperty(ref reader, options, PropError, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamSettingsError(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Error = propError.Value, + Index = propIndex.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamSettingsError value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropError, value.Error, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamSettingsError.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamSettingsError.g.cs index caa683d6dff..d67865c93ad 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamSettingsError.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamSettingsError.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DataStreamSettingsErrorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamSettingsError Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propError = default; - LocalJsonValue propIndex = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propError.TryReadProperty(ref reader, options, PropError, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamSettingsError(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Error = propError.Value, - Index = propIndex.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamSettingsError value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropError, value.Error, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamSettingsErrorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DataStreamSettingsErrorConverter))] public sealed partial class DataStreamSettingsError { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamStats.Converters.g.cs new file mode 100644 index 00000000000..b8789c74f58 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamStats.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DataStreamStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBackingIndicesInError = System.Text.Json.JsonEncodedText.Encode("backing_indices_in_error"); + private static readonly System.Text.Json.JsonEncodedText PropBackingIndicesInTotal = System.Text.Json.JsonEncodedText.Encode("backing_indices_in_total"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBackingIndicesInError = default; + LocalJsonValue propBackingIndicesInTotal = default; + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBackingIndicesInError.TryReadProperty(ref reader, options, PropBackingIndicesInError, null)) + { + continue; + } + + if (propBackingIndicesInTotal.TryReadProperty(ref reader, options, PropBackingIndicesInTotal, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BackingIndicesInError = propBackingIndicesInError.Value, + BackingIndicesInTotal = propBackingIndicesInTotal.Value, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBackingIndicesInError, value.BackingIndicesInError, null, null); + writer.WriteProperty(options, PropBackingIndicesInTotal, value.BackingIndicesInTotal, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamStats.g.cs index 5042ab99fee..64260e3e5c3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamStats.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DataStreamStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBackingIndicesInError = System.Text.Json.JsonEncodedText.Encode("backing_indices_in_error"); - private static readonly System.Text.Json.JsonEncodedText PropBackingIndicesInTotal = System.Text.Json.JsonEncodedText.Encode("backing_indices_in_total"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBackingIndicesInError = default; - LocalJsonValue propBackingIndicesInTotal = default; - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBackingIndicesInError.TryReadProperty(ref reader, options, PropBackingIndicesInError, null)) - { - continue; - } - - if (propBackingIndicesInTotal.TryReadProperty(ref reader, options, PropBackingIndicesInTotal, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BackingIndicesInError = propBackingIndicesInError.Value, - BackingIndicesInTotal = propBackingIndicesInTotal.Value, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBackingIndicesInError, value.BackingIndicesInError, null, null); - writer.WriteProperty(options, PropBackingIndicesInTotal, value.BackingIndicesInTotal, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DataStreamStatsConverter))] public sealed partial class DataStreamStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamTimestampField.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamTimestampField.Converters.g.cs new file mode 100644 index 00000000000..e8069b47892 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamTimestampField.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DataStreamTimestampFieldConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamTimestampField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamTimestampField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamTimestampField value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamTimestampField.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamTimestampField.g.cs index 1537e6596de..b7a02d3b955 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamTimestampField.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamTimestampField.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DataStreamTimestampFieldConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamTimestampField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamTimestampField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamTimestampField value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamTimestampFieldConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DataStreamTimestampFieldConverter))] public sealed partial class DataStreamTimestampField { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamVisibility.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamVisibility.Converters.g.cs new file mode 100644 index 00000000000..506a9e2e696 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamVisibility.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DataStreamVisibilityConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowCustomRouting = System.Text.Json.JsonEncodedText.Encode("allow_custom_routing"); + private static readonly System.Text.Json.JsonEncodedText PropHidden = System.Text.Json.JsonEncodedText.Encode("hidden"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibility Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowCustomRouting = default; + LocalJsonValue propHidden = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowCustomRouting.TryReadProperty(ref reader, options, PropAllowCustomRouting, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propHidden.TryReadProperty(ref reader, options, PropHidden, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibility(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowCustomRouting = propAllowCustomRouting.Value, + Hidden = propHidden.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibility value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowCustomRouting, value.AllowCustomRouting, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropHidden, value.Hidden, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamVisibility.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamVisibility.g.cs index 146c954e483..997b3819d9b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamVisibility.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamVisibility.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DataStreamVisibilityConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowCustomRouting = System.Text.Json.JsonEncodedText.Encode("allow_custom_routing"); - private static readonly System.Text.Json.JsonEncodedText PropHidden = System.Text.Json.JsonEncodedText.Encode("hidden"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibility Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowCustomRouting = default; - LocalJsonValue propHidden = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowCustomRouting.TryReadProperty(ref reader, options, PropAllowCustomRouting, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propHidden.TryReadProperty(ref reader, options, PropHidden, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibility(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowCustomRouting = propAllowCustomRouting.Value, - Hidden = propHidden.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibility value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowCustomRouting, value.AllowCustomRouting, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropHidden, value.Hidden, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibilityConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DataStreamVisibilityConverter))] public sealed partial class DataStreamVisibility { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamWithLifecycle.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamWithLifecycle.Converters.g.cs new file mode 100644 index 00000000000..c57995a5025 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamWithLifecycle.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DataStreamWithLifecycleConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLifecycle = System.Text.Json.JsonEncodedText.Encode("lifecycle"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamWithLifecycle Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLifecycle = default; + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLifecycle.TryReadProperty(ref reader, options, PropLifecycle, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamWithLifecycle(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Lifecycle = propLifecycle.Value, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamWithLifecycle value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLifecycle, value.Lifecycle, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamWithLifecycle.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamWithLifecycle.g.cs index 4a83c6d7efd..a684daed17c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamWithLifecycle.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamWithLifecycle.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DataStreamWithLifecycleConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLifecycle = System.Text.Json.JsonEncodedText.Encode("lifecycle"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamWithLifecycle Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLifecycle = default; - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLifecycle.TryReadProperty(ref reader, options, PropLifecycle, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamWithLifecycle(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Lifecycle = propLifecycle.Value, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamWithLifecycle value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLifecycle, value.Lifecycle, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamWithLifecycleConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DataStreamWithLifecycleConverter))] public sealed partial class DataStreamWithLifecycle { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamWithOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamWithOptions.Converters.g.cs new file mode 100644 index 00000000000..07ac1078485 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamWithOptions.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DataStreamWithOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropOptions = System.Text.Json.JsonEncodedText.Encode("options"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamWithOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + LocalJsonValue propOptions = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propOptions.TryReadProperty(ref reader, options, PropOptions, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamWithOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value, + Options = propOptions.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamWithOptions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropOptions, value.Options, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamWithOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamWithOptions.g.cs index af8f36d3498..4081caf75ea 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamWithOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamWithOptions.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DataStreamWithOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropOptions = System.Text.Json.JsonEncodedText.Encode("options"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamWithOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - LocalJsonValue propOptions = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propOptions.TryReadProperty(ref reader, options, PropOptions, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamWithOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value, - Options = propOptions.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamWithOptions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropOptions, value.Options, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamWithOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DataStreamWithOptionsConverter))] public sealed partial class DataStreamWithOptions { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamsStatsItem.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamsStatsItem.Converters.g.cs new file mode 100644 index 00000000000..ff0d5783ded --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamsStatsItem.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DataStreamsStatsItemConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBackingIndices = System.Text.Json.JsonEncodedText.Encode("backing_indices"); + private static readonly System.Text.Json.JsonEncodedText PropDataStream = System.Text.Json.JsonEncodedText.Encode("data_stream"); + private static readonly System.Text.Json.JsonEncodedText PropMaximumTimestamp = System.Text.Json.JsonEncodedText.Encode("maximum_timestamp"); + private static readonly System.Text.Json.JsonEncodedText PropStoreSize = System.Text.Json.JsonEncodedText.Encode("store_size"); + private static readonly System.Text.Json.JsonEncodedText PropStoreSizeBytes = System.Text.Json.JsonEncodedText.Encode("store_size_bytes"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamsStatsItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBackingIndices = default; + LocalJsonValue propDataStream = default; + LocalJsonValue propMaximumTimestamp = default; + LocalJsonValue propStoreSize = default; + LocalJsonValue propStoreSizeBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBackingIndices.TryReadProperty(ref reader, options, PropBackingIndices, null)) + { + continue; + } + + if (propDataStream.TryReadProperty(ref reader, options, PropDataStream, null)) + { + continue; + } + + if (propMaximumTimestamp.TryReadProperty(ref reader, options, PropMaximumTimestamp, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propStoreSize.TryReadProperty(ref reader, options, PropStoreSize, null)) + { + continue; + } + + if (propStoreSizeBytes.TryReadProperty(ref reader, options, PropStoreSizeBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamsStatsItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BackingIndices = propBackingIndices.Value, + DataStream = propDataStream.Value, + MaximumTimestamp = propMaximumTimestamp.Value, + StoreSize = propStoreSize.Value, + StoreSizeBytes = propStoreSizeBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamsStatsItem value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBackingIndices, value.BackingIndices, null, null); + writer.WriteProperty(options, PropDataStream, value.DataStream, null, null); + writer.WriteProperty(options, PropMaximumTimestamp, value.MaximumTimestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropStoreSize, value.StoreSize, null, null); + writer.WriteProperty(options, PropStoreSizeBytes, value.StoreSizeBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamsStatsItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamsStatsItem.g.cs index 15b7ccf154e..28d51735e7d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamsStatsItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamsStatsItem.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DataStreamsStatsItemConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBackingIndices = System.Text.Json.JsonEncodedText.Encode("backing_indices"); - private static readonly System.Text.Json.JsonEncodedText PropDataStream = System.Text.Json.JsonEncodedText.Encode("data_stream"); - private static readonly System.Text.Json.JsonEncodedText PropMaximumTimestamp = System.Text.Json.JsonEncodedText.Encode("maximum_timestamp"); - private static readonly System.Text.Json.JsonEncodedText PropStoreSize = System.Text.Json.JsonEncodedText.Encode("store_size"); - private static readonly System.Text.Json.JsonEncodedText PropStoreSizeBytes = System.Text.Json.JsonEncodedText.Encode("store_size_bytes"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamsStatsItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBackingIndices = default; - LocalJsonValue propDataStream = default; - LocalJsonValue propMaximumTimestamp = default; - LocalJsonValue propStoreSize = default; - LocalJsonValue propStoreSizeBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBackingIndices.TryReadProperty(ref reader, options, PropBackingIndices, null)) - { - continue; - } - - if (propDataStream.TryReadProperty(ref reader, options, PropDataStream, null)) - { - continue; - } - - if (propMaximumTimestamp.TryReadProperty(ref reader, options, PropMaximumTimestamp, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propStoreSize.TryReadProperty(ref reader, options, PropStoreSize, null)) - { - continue; - } - - if (propStoreSizeBytes.TryReadProperty(ref reader, options, PropStoreSizeBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamsStatsItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BackingIndices = propBackingIndices.Value, - DataStream = propDataStream.Value, - MaximumTimestamp = propMaximumTimestamp.Value, - StoreSize = propStoreSize.Value, - StoreSizeBytes = propStoreSizeBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DataStreamsStatsItem value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBackingIndices, value.BackingIndices, null, null); - writer.WriteProperty(options, PropDataStream, value.DataStream, null, null); - writer.WriteProperty(options, PropMaximumTimestamp, value.MaximumTimestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropStoreSize, value.StoreSize, null, null); - writer.WriteProperty(options, PropStoreSizeBytes, value.StoreSizeBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamsStatsItemConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DataStreamsStatsItemConverter))] public sealed partial class DataStreamsStatsItem { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DownsampleConfig.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DownsampleConfig.Converters.g.cs new file mode 100644 index 00000000000..8e65bb67e40 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DownsampleConfig.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DownsampleConfigConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFixedInterval = System.Text.Json.JsonEncodedText.Encode("fixed_interval"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DownsampleConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFixedInterval = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFixedInterval.TryReadProperty(ref reader, options, PropFixedInterval, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DownsampleConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FixedInterval = propFixedInterval.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DownsampleConfig value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFixedInterval, value.FixedInterval, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DownsampleConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DownsampleConfig.g.cs index d1cb76c94c4..80d06bc913d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DownsampleConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DownsampleConfig.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DownsampleConfigConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFixedInterval = System.Text.Json.JsonEncodedText.Encode("fixed_interval"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DownsampleConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFixedInterval = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFixedInterval.TryReadProperty(ref reader, options, PropFixedInterval, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DownsampleConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FixedInterval = propFixedInterval.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DownsampleConfig value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFixedInterval, value.FixedInterval, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DownsampleConfigConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DownsampleConfigConverter))] public sealed partial class DownsampleConfig { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DownsamplingRound.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DownsamplingRound.Converters.g.cs new file mode 100644 index 00000000000..c9425024317 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DownsamplingRound.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class DownsamplingRoundConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAfter = System.Text.Json.JsonEncodedText.Encode("after"); + private static readonly System.Text.Json.JsonEncodedText PropConfig = System.Text.Json.JsonEncodedText.Encode("config"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.DownsamplingRound Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAfter = default; + LocalJsonValue propConfig = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAfter.TryReadProperty(ref reader, options, PropAfter, null)) + { + continue; + } + + if (propConfig.TryReadProperty(ref reader, options, PropConfig, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.DownsamplingRound(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + After = propAfter.Value, + Config = propConfig.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DownsamplingRound value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAfter, value.After, null, null); + writer.WriteProperty(options, PropConfig, value.Config, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DownsamplingRound.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DownsamplingRound.g.cs index 117addd8135..a56f7d5638e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DownsamplingRound.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DownsamplingRound.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class DownsamplingRoundConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAfter = System.Text.Json.JsonEncodedText.Encode("after"); - private static readonly System.Text.Json.JsonEncodedText PropConfig = System.Text.Json.JsonEncodedText.Encode("config"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.DownsamplingRound Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAfter = default; - LocalJsonValue propConfig = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAfter.TryReadProperty(ref reader, options, PropAfter, null)) - { - continue; - } - - if (propConfig.TryReadProperty(ref reader, options, PropConfig, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.DownsamplingRound(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - After = propAfter.Value, - Config = propConfig.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.DownsamplingRound value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAfter, value.After, null, null); - writer.WriteProperty(options, PropConfig, value.Config, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.DownsamplingRoundConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.DownsamplingRoundConverter))] public sealed partial class DownsamplingRound { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ExplainAnalyzeToken.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ExplainAnalyzeToken.Converters.g.cs new file mode 100644 index 00000000000..f5c21bc578d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ExplainAnalyzeToken.Converters.g.cs @@ -0,0 +1,141 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ExplainAnalyzeTokenConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBytes = System.Text.Json.JsonEncodedText.Encode("bytes"); + private static readonly System.Text.Json.JsonEncodedText PropEndOffset = System.Text.Json.JsonEncodedText.Encode("end_offset"); + private static readonly System.Text.Json.JsonEncodedText PropKeyword = System.Text.Json.JsonEncodedText.Encode("keyword"); + private static readonly System.Text.Json.JsonEncodedText PropPosition = System.Text.Json.JsonEncodedText.Encode("position"); + private static readonly System.Text.Json.JsonEncodedText PropPositionLength = System.Text.Json.JsonEncodedText.Encode("positionLength"); + private static readonly System.Text.Json.JsonEncodedText PropStartOffset = System.Text.Json.JsonEncodedText.Encode("start_offset"); + private static readonly System.Text.Json.JsonEncodedText PropTermFrequency = System.Text.Json.JsonEncodedText.Encode("termFrequency"); + private static readonly System.Text.Json.JsonEncodedText PropToken = System.Text.Json.JsonEncodedText.Encode("token"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ExplainAnalyzeToken Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAttributes = default; + LocalJsonValue propBytes = default; + LocalJsonValue propEndOffset = default; + LocalJsonValue propKeyword = default; + LocalJsonValue propPosition = default; + LocalJsonValue propPositionLength = default; + LocalJsonValue propStartOffset = default; + LocalJsonValue propTermFrequency = default; + LocalJsonValue propToken = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBytes.TryReadProperty(ref reader, options, PropBytes, null)) + { + continue; + } + + if (propEndOffset.TryReadProperty(ref reader, options, PropEndOffset, null)) + { + continue; + } + + if (propKeyword.TryReadProperty(ref reader, options, PropKeyword, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPosition.TryReadProperty(ref reader, options, PropPosition, null)) + { + continue; + } + + if (propPositionLength.TryReadProperty(ref reader, options, PropPositionLength, null)) + { + continue; + } + + if (propStartOffset.TryReadProperty(ref reader, options, PropStartOffset, null)) + { + continue; + } + + if (propTermFrequency.TryReadProperty(ref reader, options, PropTermFrequency, null)) + { + continue; + } + + if (propToken.TryReadProperty(ref reader, options, PropToken, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + propAttributes ??= new System.Collections.Generic.Dictionary(); + reader.ReadProperty(options, out string key, out object value, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!); + propAttributes[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ExplainAnalyzeToken(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Attributes = propAttributes, + Bytes = propBytes.Value, + EndOffset = propEndOffset.Value, + Keyword = propKeyword.Value, + Position = propPosition.Value, + PositionLength = propPositionLength.Value, + StartOffset = propStartOffset.Value, + TermFrequency = propTermFrequency.Value, + Token = propToken.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ExplainAnalyzeToken value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBytes, value.Bytes, null, null); + writer.WriteProperty(options, PropEndOffset, value.EndOffset, null, null); + writer.WriteProperty(options, PropKeyword, value.Keyword, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPosition, value.Position, null, null); + writer.WriteProperty(options, PropPositionLength, value.PositionLength, null, null); + writer.WriteProperty(options, PropStartOffset, value.StartOffset, null, null); + writer.WriteProperty(options, PropTermFrequency, value.TermFrequency, null, null); + writer.WriteProperty(options, PropToken, value.Token, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + if (value.Attributes is not null) + { + foreach (var item in value.Attributes) + { + writer.WriteProperty(options, item.Key, item.Value, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ExplainAnalyzeToken.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ExplainAnalyzeToken.g.cs index d10472c87cc..4eb1cefcf86 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ExplainAnalyzeToken.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ExplainAnalyzeToken.g.cs @@ -23,124 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ExplainAnalyzeTokenConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBytes = System.Text.Json.JsonEncodedText.Encode("bytes"); - private static readonly System.Text.Json.JsonEncodedText PropEndOffset = System.Text.Json.JsonEncodedText.Encode("end_offset"); - private static readonly System.Text.Json.JsonEncodedText PropKeyword = System.Text.Json.JsonEncodedText.Encode("keyword"); - private static readonly System.Text.Json.JsonEncodedText PropPosition = System.Text.Json.JsonEncodedText.Encode("position"); - private static readonly System.Text.Json.JsonEncodedText PropPositionLength = System.Text.Json.JsonEncodedText.Encode("positionLength"); - private static readonly System.Text.Json.JsonEncodedText PropStartOffset = System.Text.Json.JsonEncodedText.Encode("start_offset"); - private static readonly System.Text.Json.JsonEncodedText PropTermFrequency = System.Text.Json.JsonEncodedText.Encode("termFrequency"); - private static readonly System.Text.Json.JsonEncodedText PropToken = System.Text.Json.JsonEncodedText.Encode("token"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ExplainAnalyzeToken Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - System.Collections.Generic.Dictionary? propAttributes = default; - LocalJsonValue propBytes = default; - LocalJsonValue propEndOffset = default; - LocalJsonValue propKeyword = default; - LocalJsonValue propPosition = default; - LocalJsonValue propPositionLength = default; - LocalJsonValue propStartOffset = default; - LocalJsonValue propTermFrequency = default; - LocalJsonValue propToken = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBytes.TryReadProperty(ref reader, options, PropBytes, null)) - { - continue; - } - - if (propEndOffset.TryReadProperty(ref reader, options, PropEndOffset, null)) - { - continue; - } - - if (propKeyword.TryReadProperty(ref reader, options, PropKeyword, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPosition.TryReadProperty(ref reader, options, PropPosition, null)) - { - continue; - } - - if (propPositionLength.TryReadProperty(ref reader, options, PropPositionLength, null)) - { - continue; - } - - if (propStartOffset.TryReadProperty(ref reader, options, PropStartOffset, null)) - { - continue; - } - - if (propTermFrequency.TryReadProperty(ref reader, options, PropTermFrequency, null)) - { - continue; - } - - if (propToken.TryReadProperty(ref reader, options, PropToken, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - propAttributes ??= new System.Collections.Generic.Dictionary(); - reader.ReadProperty(options, out string key, out object value, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!); - propAttributes[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ExplainAnalyzeToken(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Attributes = propAttributes, - Bytes = propBytes.Value, - EndOffset = propEndOffset.Value, - Keyword = propKeyword.Value, - Position = propPosition.Value, - PositionLength = propPositionLength.Value, - StartOffset = propStartOffset.Value, - TermFrequency = propTermFrequency.Value, - Token = propToken.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ExplainAnalyzeToken value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBytes, value.Bytes, null, null); - writer.WriteProperty(options, PropEndOffset, value.EndOffset, null, null); - writer.WriteProperty(options, PropKeyword, value.Keyword, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPosition, value.Position, null, null); - writer.WriteProperty(options, PropPositionLength, value.PositionLength, null, null); - writer.WriteProperty(options, PropStartOffset, value.StartOffset, null, null); - writer.WriteProperty(options, PropTermFrequency, value.TermFrequency, null, null); - writer.WriteProperty(options, PropToken, value.Token, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - if (value.Attributes is not null) - { - foreach (var item in value.Attributes) - { - writer.WriteProperty(options, item.Key, item.Value, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ExplainAnalyzeTokenConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ExplainAnalyzeTokenConverter))] public sealed partial class ExplainAnalyzeToken { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FailureStore.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FailureStore.Converters.g.cs new file mode 100644 index 00000000000..c5150759d44 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FailureStore.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class FailureStoreConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropRolloverOnWrite = System.Text.Json.JsonEncodedText.Encode("rollover_on_write"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.FailureStore Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEnabled = default; + LocalJsonValue> propIndices = default; + LocalJsonValue propRolloverOnWrite = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propRolloverOnWrite.TryReadProperty(ref reader, options, PropRolloverOnWrite, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.FailureStore(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Enabled = propEnabled.Value, + Indices = propIndices.Value, + RolloverOnWrite = propRolloverOnWrite.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.FailureStore value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRolloverOnWrite, value.RolloverOnWrite, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FailureStore.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FailureStore.g.cs index bb471d91cf3..f01c95fd274 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FailureStore.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FailureStore.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class FailureStoreConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropRolloverOnWrite = System.Text.Json.JsonEncodedText.Encode("rollover_on_write"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.FailureStore Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEnabled = default; - LocalJsonValue> propIndices = default; - LocalJsonValue propRolloverOnWrite = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propRolloverOnWrite.TryReadProperty(ref reader, options, PropRolloverOnWrite, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.FailureStore(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Enabled = propEnabled.Value, - Indices = propIndices.Value, - RolloverOnWrite = propRolloverOnWrite.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.FailureStore value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRolloverOnWrite, value.RolloverOnWrite, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.FailureStoreConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.FailureStoreConverter))] public sealed partial class FailureStore { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FailureStoreLifecycle.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FailureStoreLifecycle.Converters.g.cs new file mode 100644 index 00000000000..0c30a6abb29 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FailureStoreLifecycle.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class FailureStoreLifecycleConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDataRetention = System.Text.Json.JsonEncodedText.Encode("data_retention"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.FailureStoreLifecycle Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDataRetention = default; + LocalJsonValue propEnabled = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDataRetention.TryReadProperty(ref reader, options, PropDataRetention, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.FailureStoreLifecycle(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DataRetention = propDataRetention.Value, + Enabled = propEnabled.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.FailureStoreLifecycle value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDataRetention, value.DataRetention, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FailureStoreLifecycle.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FailureStoreLifecycle.g.cs index a322a22a254..af417739089 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FailureStoreLifecycle.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FailureStoreLifecycle.g.cs @@ -23,60 +23,12 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class FailureStoreLifecycleConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDataRetention = System.Text.Json.JsonEncodedText.Encode("data_retention"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.FailureStoreLifecycle Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDataRetention = default; - LocalJsonValue propEnabled = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDataRetention.TryReadProperty(ref reader, options, PropDataRetention, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.FailureStoreLifecycle(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DataRetention = propDataRetention.Value, - Enabled = propEnabled.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.FailureStoreLifecycle value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDataRetention, value.DataRetention, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// The failure store lifecycle configures the data stream lifecycle configuration for failure indices. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.FailureStoreLifecycleConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.FailureStoreLifecycleConverter))] public sealed partial class FailureStoreLifecycle { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FailureStoreLifecycleTemplate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FailureStoreLifecycleTemplate.Converters.g.cs new file mode 100644 index 00000000000..fdc3c1b14dc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FailureStoreLifecycleTemplate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class FailureStoreLifecycleTemplateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDataRetention = System.Text.Json.JsonEncodedText.Encode("data_retention"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.FailureStoreLifecycleTemplate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDataRetention = default; + LocalJsonValue propEnabled = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDataRetention.TryReadProperty(ref reader, options, PropDataRetention, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.FailureStoreLifecycleTemplate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DataRetention = propDataRetention.Value, + Enabled = propEnabled.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.FailureStoreLifecycleTemplate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDataRetention, value.DataRetention, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FailureStoreLifecycleTemplate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FailureStoreLifecycleTemplate.g.cs index f7a225c68fe..95d34babab5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FailureStoreLifecycleTemplate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FailureStoreLifecycleTemplate.g.cs @@ -23,60 +23,12 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class FailureStoreLifecycleTemplateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDataRetention = System.Text.Json.JsonEncodedText.Encode("data_retention"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.FailureStoreLifecycleTemplate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDataRetention = default; - LocalJsonValue propEnabled = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDataRetention.TryReadProperty(ref reader, options, PropDataRetention, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.FailureStoreLifecycleTemplate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DataRetention = propDataRetention.Value, - Enabled = propEnabled.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.FailureStoreLifecycleTemplate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDataRetention, value.DataRetention, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Template equivalent of FailureStoreLifecycle that allows nullable values. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.FailureStoreLifecycleTemplateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.FailureStoreLifecycleTemplateConverter))] public sealed partial class FailureStoreLifecycleTemplate { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Feature.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Feature.Converters.g.cs new file mode 100644 index 00000000000..7a914c1f499 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Feature.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class FeatureConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); + private static readonly System.Text.Json.JsonEncodedText MemberMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); + private static readonly System.Text.Json.JsonEncodedText MemberSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.Feature Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAliases)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.Feature.Aliases; + } + + if (reader.ValueTextEquals(MemberMappings)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.Feature.Mappings; + } + + if (reader.ValueTextEquals(MemberSettings)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.Feature.Settings; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAliases.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.Feature.Aliases; + } + + if (string.Equals(value, MemberMappings.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.Feature.Mappings; + } + + if (string.Equals(value, MemberSettings.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.Feature.Settings; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.Feature)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.Feature value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.IndexManagement.Feature.Aliases: + writer.WriteStringValue(MemberAliases); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.Feature.Mappings: + writer.WriteStringValue(MemberMappings); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.Feature.Settings: + writer.WriteStringValue(MemberSettings); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.Feature)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.IndexManagement.Feature ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.Feature value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Feature.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Feature.g.cs new file mode 100644 index 00000000000..fe982888e56 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Feature.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.FeatureConverter))] +public enum Feature +{ + [System.Runtime.Serialization.EnumMember(Value = "aliases")] + Aliases, + [System.Runtime.Serialization.EnumMember(Value = "mappings")] + Mappings, + [System.Runtime.Serialization.EnumMember(Value = "settings")] + Settings +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FieldSummary.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FieldSummary.Converters.g.cs new file mode 100644 index 00000000000..118dfe54789 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FieldSummary.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class FieldSummaryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAny = System.Text.Json.JsonEncodedText.Encode("any"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropInvertedIndex = System.Text.Json.JsonEncodedText.Encode("inverted_index"); + private static readonly System.Text.Json.JsonEncodedText PropKnnVectors = System.Text.Json.JsonEncodedText.Encode("knn_vectors"); + private static readonly System.Text.Json.JsonEncodedText PropNorms = System.Text.Json.JsonEncodedText.Encode("norms"); + private static readonly System.Text.Json.JsonEncodedText PropPoints = System.Text.Json.JsonEncodedText.Encode("points"); + private static readonly System.Text.Json.JsonEncodedText PropStoredFields = System.Text.Json.JsonEncodedText.Encode("stored_fields"); + private static readonly System.Text.Json.JsonEncodedText PropTermVectors = System.Text.Json.JsonEncodedText.Encode("term_vectors"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.FieldSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAny = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propInvertedIndex = default; + LocalJsonValue propKnnVectors = default; + LocalJsonValue propNorms = default; + LocalJsonValue propPoints = default; + LocalJsonValue propStoredFields = default; + LocalJsonValue propTermVectors = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAny.TryReadProperty(ref reader, options, PropAny, null)) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, null)) + { + continue; + } + + if (propInvertedIndex.TryReadProperty(ref reader, options, PropInvertedIndex, null)) + { + continue; + } + + if (propKnnVectors.TryReadProperty(ref reader, options, PropKnnVectors, null)) + { + continue; + } + + if (propNorms.TryReadProperty(ref reader, options, PropNorms, null)) + { + continue; + } + + if (propPoints.TryReadProperty(ref reader, options, PropPoints, null)) + { + continue; + } + + if (propStoredFields.TryReadProperty(ref reader, options, PropStoredFields, null)) + { + continue; + } + + if (propTermVectors.TryReadProperty(ref reader, options, PropTermVectors, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.FieldSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Any = propAny.Value, + DocValues = propDocValues.Value, + InvertedIndex = propInvertedIndex.Value, + KnnVectors = propKnnVectors.Value, + Norms = propNorms.Value, + Points = propPoints.Value, + StoredFields = propStoredFields.Value, + TermVectors = propTermVectors.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.FieldSummary value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAny, value.Any, null, null); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, null); + writer.WriteProperty(options, PropInvertedIndex, value.InvertedIndex, null, null); + writer.WriteProperty(options, PropKnnVectors, value.KnnVectors, null, null); + writer.WriteProperty(options, PropNorms, value.Norms, null, null); + writer.WriteProperty(options, PropPoints, value.Points, null, null); + writer.WriteProperty(options, PropStoredFields, value.StoredFields, null, null); + writer.WriteProperty(options, PropTermVectors, value.TermVectors, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FieldSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FieldSummary.g.cs index fc7217dd4e2..0f28d5ed40e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FieldSummary.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FieldSummary.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class FieldSummaryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAny = System.Text.Json.JsonEncodedText.Encode("any"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropInvertedIndex = System.Text.Json.JsonEncodedText.Encode("inverted_index"); - private static readonly System.Text.Json.JsonEncodedText PropKnnVectors = System.Text.Json.JsonEncodedText.Encode("knn_vectors"); - private static readonly System.Text.Json.JsonEncodedText PropNorms = System.Text.Json.JsonEncodedText.Encode("norms"); - private static readonly System.Text.Json.JsonEncodedText PropPoints = System.Text.Json.JsonEncodedText.Encode("points"); - private static readonly System.Text.Json.JsonEncodedText PropStoredFields = System.Text.Json.JsonEncodedText.Encode("stored_fields"); - private static readonly System.Text.Json.JsonEncodedText PropTermVectors = System.Text.Json.JsonEncodedText.Encode("term_vectors"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.FieldSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAny = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propInvertedIndex = default; - LocalJsonValue propKnnVectors = default; - LocalJsonValue propNorms = default; - LocalJsonValue propPoints = default; - LocalJsonValue propStoredFields = default; - LocalJsonValue propTermVectors = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAny.TryReadProperty(ref reader, options, PropAny, null)) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, null)) - { - continue; - } - - if (propInvertedIndex.TryReadProperty(ref reader, options, PropInvertedIndex, null)) - { - continue; - } - - if (propKnnVectors.TryReadProperty(ref reader, options, PropKnnVectors, null)) - { - continue; - } - - if (propNorms.TryReadProperty(ref reader, options, PropNorms, null)) - { - continue; - } - - if (propPoints.TryReadProperty(ref reader, options, PropPoints, null)) - { - continue; - } - - if (propStoredFields.TryReadProperty(ref reader, options, PropStoredFields, null)) - { - continue; - } - - if (propTermVectors.TryReadProperty(ref reader, options, PropTermVectors, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.FieldSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Any = propAny.Value, - DocValues = propDocValues.Value, - InvertedIndex = propInvertedIndex.Value, - KnnVectors = propKnnVectors.Value, - Norms = propNorms.Value, - Points = propPoints.Value, - StoredFields = propStoredFields.Value, - TermVectors = propTermVectors.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.FieldSummary value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAny, value.Any, null, null); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, null); - writer.WriteProperty(options, PropInvertedIndex, value.InvertedIndex, null, null); - writer.WriteProperty(options, PropKnnVectors, value.KnnVectors, null, null); - writer.WriteProperty(options, PropNorms, value.Norms, null, null); - writer.WriteProperty(options, PropPoints, value.Points, null, null); - writer.WriteProperty(options, PropStoredFields, value.StoredFields, null, null); - writer.WriteProperty(options, PropTermVectors, value.TermVectors, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.FieldSummaryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.FieldSummaryConverter))] public sealed partial class FieldSummary { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FielddataFrequencyFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FielddataFrequencyFilter.Converters.g.cs new file mode 100644 index 00000000000..2488960b06d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FielddataFrequencyFilter.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class FielddataFrequencyFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); + private static readonly System.Text.Json.JsonEncodedText PropMinSegmentSize = System.Text.Json.JsonEncodedText.Encode("min_segment_size"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.FielddataFrequencyFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMax = default; + LocalJsonValue propMin = default; + LocalJsonValue propMinSegmentSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMax.TryReadProperty(ref reader, options, PropMax, null)) + { + continue; + } + + if (propMin.TryReadProperty(ref reader, options, PropMin, null)) + { + continue; + } + + if (propMinSegmentSize.TryReadProperty(ref reader, options, PropMinSegmentSize, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.FielddataFrequencyFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Max = propMax.Value, + Min = propMin.Value, + MinSegmentSize = propMinSegmentSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.FielddataFrequencyFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMax, value.Max, null, null); + writer.WriteProperty(options, PropMin, value.Min, null, null); + writer.WriteProperty(options, PropMinSegmentSize, value.MinSegmentSize, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FielddataFrequencyFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FielddataFrequencyFilter.g.cs index 65a0f62982c..71b29171bb8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FielddataFrequencyFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FielddataFrequencyFilter.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class FielddataFrequencyFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); - private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); - private static readonly System.Text.Json.JsonEncodedText PropMinSegmentSize = System.Text.Json.JsonEncodedText.Encode("min_segment_size"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.FielddataFrequencyFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMax = default; - LocalJsonValue propMin = default; - LocalJsonValue propMinSegmentSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMax.TryReadProperty(ref reader, options, PropMax, null)) - { - continue; - } - - if (propMin.TryReadProperty(ref reader, options, PropMin, null)) - { - continue; - } - - if (propMinSegmentSize.TryReadProperty(ref reader, options, PropMinSegmentSize, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.FielddataFrequencyFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Max = propMax.Value, - Min = propMin.Value, - MinSegmentSize = propMinSegmentSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.FielddataFrequencyFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMax, value.Max, null, null); - writer.WriteProperty(options, PropMin, value.Min, null, null); - writer.WriteProperty(options, PropMinSegmentSize, value.MinSegmentSize, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.FielddataFrequencyFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.FielddataFrequencyFilterConverter))] public sealed partial class FielddataFrequencyFilter { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FileDetails.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FileDetails.Converters.g.cs new file mode 100644 index 00000000000..5d019706126 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FileDetails.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class FileDetailsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLength = System.Text.Json.JsonEncodedText.Encode("length"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropRecovered = System.Text.Json.JsonEncodedText.Encode("recovered"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.FileDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLength = default; + LocalJsonValue propName = default; + LocalJsonValue propRecovered = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLength.TryReadProperty(ref reader, options, PropLength, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propRecovered.TryReadProperty(ref reader, options, PropRecovered, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.FileDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Length = propLength.Value, + Name = propName.Value, + Recovered = propRecovered.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.FileDetails value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLength, value.Length, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropRecovered, value.Recovered, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FileDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FileDetails.g.cs index a306e76b733..a32079fe83d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FileDetails.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/FileDetails.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class FileDetailsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLength = System.Text.Json.JsonEncodedText.Encode("length"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropRecovered = System.Text.Json.JsonEncodedText.Encode("recovered"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.FileDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLength = default; - LocalJsonValue propName = default; - LocalJsonValue propRecovered = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLength.TryReadProperty(ref reader, options, PropLength, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propRecovered.TryReadProperty(ref reader, options, PropRecovered, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.FileDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Length = propLength.Value, - Name = propName.Value, - Recovered = propRecovered.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.FileDetails value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLength, value.Length, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropRecovered, value.Recovered, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.FileDetailsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.FileDetailsConverter))] public sealed partial class FileDetails { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexAliases.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexAliases.Converters.g.cs new file mode 100644 index 00000000000..a51dad7f57e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexAliases.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexAliasesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexAliases Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propAliases = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexAliases(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aliases = propAliases.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexAliases value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexAliases.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexAliases.g.cs index 732db268457..8a884cc49b2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexAliases.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexAliases.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexAliasesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexAliases Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propAliases = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexAliases(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aliases = propAliases.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexAliases value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexAliasesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexAliasesConverter))] public sealed partial class IndexAliases { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexAndDataStreamAction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexAndDataStreamAction.Converters.g.cs new file mode 100644 index 00000000000..897f7e64c05 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexAndDataStreamAction.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexAndDataStreamActionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDataStream = System.Text.Json.JsonEncodedText.Encode("data_stream"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexAndDataStreamAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDataStream = default; + LocalJsonValue propIndex = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDataStream.TryReadProperty(ref reader, options, PropDataStream, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexAndDataStreamAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DataStream = propDataStream.Value, + Index = propIndex.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexAndDataStreamAction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDataStream, value.DataStream, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexAndDataStreamAction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexAndDataStreamAction.g.cs index 155ae574585..3de8cb9ac20 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexAndDataStreamAction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexAndDataStreamAction.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexAndDataStreamActionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDataStream = System.Text.Json.JsonEncodedText.Encode("data_stream"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexAndDataStreamAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDataStream = default; - LocalJsonValue propIndex = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDataStream.TryReadProperty(ref reader, options, PropDataStream, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexAndDataStreamAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DataStream = propDataStream.Value, - Index = propIndex.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexAndDataStreamAction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDataStream, value.DataStream, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexAndDataStreamActionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexAndDataStreamActionConverter))] public sealed partial class IndexAndDataStreamAction { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexCheckOnStartup.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexCheckOnStartup.Converters.g.cs new file mode 100644 index 00000000000..c2761c589c2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexCheckOnStartup.Converters.g.cs @@ -0,0 +1,100 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexCheckOnStartupConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberChecksum = System.Text.Json.JsonEncodedText.Encode("checksum"); + private static readonly System.Text.Json.JsonEncodedText MemberFalse = System.Text.Json.JsonEncodedText.Encode("false"); + private static readonly System.Text.Json.JsonEncodedText MemberTrue = System.Text.Json.JsonEncodedText.Encode("true"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberChecksum)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup.Checksum; + } + + if (reader.ValueTextEquals(MemberFalse)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup.False; + } + + if (reader.ValueTextEquals(MemberTrue)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup.True; + } + + if (reader.TokenType is not System.Text.Json.JsonTokenType.String) + { + throw new System.Text.Json.JsonException($"Unknown member of type '{reader.TokenType}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup)}'."); + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberChecksum.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup.Checksum; + } + + if (string.Equals(value, MemberFalse.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup.False; + } + + if (string.Equals(value, MemberTrue.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup.True; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup.Checksum: + writer.WriteStringValue(MemberChecksum); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup.False: + writer.WriteRawValue(MemberFalse.EncodedUtf8Bytes); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup.True: + writer.WriteRawValue(MemberTrue.EncodedUtf8Bytes); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexCheckOnStartup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexCheckOnStartup.g.cs new file mode 100644 index 00000000000..ab02ad13945 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexCheckOnStartup.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexCheckOnStartupConverter))] +public enum IndexCheckOnStartup +{ + [System.Runtime.Serialization.EnumMember(Value = "checksum")] + Checksum, + [System.Runtime.Serialization.EnumMember(Value = "false")] + False, + [System.Runtime.Serialization.EnumMember(Value = "true")] + True +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexMappingRecord.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexMappingRecord.Converters.g.cs new file mode 100644 index 00000000000..9054d7183a6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexMappingRecord.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexMappingRecordConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropItem = System.Text.Json.JsonEncodedText.Encode("item"); + private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexMappingRecord Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propItem = default; + LocalJsonValue propMappings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propItem.TryReadProperty(ref reader, options, PropItem, null)) + { + continue; + } + + if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexMappingRecord(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Item = propItem.Value, + Mappings = propMappings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexMappingRecord value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropItem, value.Item, null, null); + writer.WriteProperty(options, PropMappings, value.Mappings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexMappingRecord.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexMappingRecord.g.cs index 3229862de58..add36a126cf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexMappingRecord.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexMappingRecord.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexMappingRecordConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropItem = System.Text.Json.JsonEncodedText.Encode("item"); - private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexMappingRecord Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propItem = default; - LocalJsonValue propMappings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propItem.TryReadProperty(ref reader, options, PropItem, null)) - { - continue; - } - - if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexMappingRecord(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Item = propItem.Value, - Mappings = propMappings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexMappingRecord value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropItem, value.Item, null, null); - writer.WriteProperty(options, PropMappings, value.Mappings, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexMappingRecordConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexMappingRecordConverter))] public sealed partial class IndexMappingRecord { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexMetadataState.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexMetadataState.Converters.g.cs new file mode 100644 index 00000000000..28c0799a0a2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexMetadataState.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexMetadataStateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberClose = System.Text.Json.JsonEncodedText.Encode("close"); + private static readonly System.Text.Json.JsonEncodedText MemberOpen = System.Text.Json.JsonEncodedText.Encode("open"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberClose)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState.Close; + } + + if (reader.ValueTextEquals(MemberOpen)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState.Open; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberClose.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState.Close; + } + + if (string.Equals(value, MemberOpen.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState.Open; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState.Close: + writer.WriteStringValue(MemberClose); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState.Open: + writer.WriteStringValue(MemberOpen); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexMetadataState.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexMetadataState.g.cs new file mode 100644 index 00000000000..5ecdc0d1e40 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexMetadataState.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexMetadataStateConverter))] +public enum IndexMetadataState +{ + [System.Runtime.Serialization.EnumMember(Value = "close")] + Close, + [System.Runtime.Serialization.EnumMember(Value = "open")] + Open +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexMode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexMode.Converters.g.cs new file mode 100644 index 00000000000..357071aa14e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexMode.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexModeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberLogsdb = System.Text.Json.JsonEncodedText.Encode("logsdb"); + private static readonly System.Text.Json.JsonEncodedText MemberLookup = System.Text.Json.JsonEncodedText.Encode("lookup"); + private static readonly System.Text.Json.JsonEncodedText MemberStandard = System.Text.Json.JsonEncodedText.Encode("standard"); + private static readonly System.Text.Json.JsonEncodedText MemberTimeSeries = System.Text.Json.JsonEncodedText.Encode("time_series"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberLogsdb)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexMode.Logsdb; + } + + if (reader.ValueTextEquals(MemberLookup)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexMode.Lookup; + } + + if (reader.ValueTextEquals(MemberStandard)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexMode.Standard; + } + + if (reader.ValueTextEquals(MemberTimeSeries)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexMode.TimeSeries; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberLogsdb.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexMode.Logsdb; + } + + if (string.Equals(value, MemberLookup.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexMode.Lookup; + } + + if (string.Equals(value, MemberStandard.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexMode.Standard; + } + + if (string.Equals(value, MemberTimeSeries.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexMode.TimeSeries; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndexMode)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexMode value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.IndexManagement.IndexMode.Logsdb: + writer.WriteStringValue(MemberLogsdb); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.IndexMode.Lookup: + writer.WriteStringValue(MemberLookup); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.IndexMode.Standard: + writer.WriteStringValue(MemberStandard); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.IndexMode.TimeSeries: + writer.WriteStringValue(MemberTimeSeries); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndexMode)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexMode value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexMode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexMode.g.cs new file mode 100644 index 00000000000..47dc25848b2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexMode.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexModeConverter))] +public enum IndexMode +{ + [System.Runtime.Serialization.EnumMember(Value = "logsdb")] + Logsdb, + [System.Runtime.Serialization.EnumMember(Value = "lookup")] + Lookup, + [System.Runtime.Serialization.EnumMember(Value = "standard")] + Standard, + [System.Runtime.Serialization.EnumMember(Value = "time_series")] + TimeSeries +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexModifyDataStreamAction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexModifyDataStreamAction.Converters.g.cs new file mode 100644 index 00000000000..c7da430ace7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexModifyDataStreamAction.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexModifyDataStreamActionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantAddBackingIndex = System.Text.Json.JsonEncodedText.Encode("add_backing_index"); + private static readonly System.Text.Json.JsonEncodedText VariantRemoveBackingIndex = System.Text.Json.JsonEncodedText.Encode("remove_backing_index"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexModifyDataStreamAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantAddBackingIndex)) + { + variantType = VariantAddBackingIndex.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRemoveBackingIndex)) + { + variantType = VariantRemoveBackingIndex.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexModifyDataStreamAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexModifyDataStreamAction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "add_backing_index": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.IndexManagement.IndexAndDataStreamAction)value.Variant, null, null); + break; + case "remove_backing_index": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.IndexManagement.IndexAndDataStreamAction)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndexModifyDataStreamAction)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexModifyDataStreamAction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexModifyDataStreamAction.g.cs index 58fd616f4f4..ab321be983b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexModifyDataStreamAction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexModifyDataStreamAction.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexModifyDataStreamActionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantAddBackingIndex = System.Text.Json.JsonEncodedText.Encode("add_backing_index"); - private static readonly System.Text.Json.JsonEncodedText VariantRemoveBackingIndex = System.Text.Json.JsonEncodedText.Encode("remove_backing_index"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexModifyDataStreamAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantAddBackingIndex)) - { - variantType = VariantAddBackingIndex.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRemoveBackingIndex)) - { - variantType = VariantRemoveBackingIndex.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexModifyDataStreamAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexModifyDataStreamAction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "add_backing_index": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.IndexManagement.IndexAndDataStreamAction)value.Variant, null, null); - break; - case "remove_backing_index": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.IndexManagement.IndexAndDataStreamAction)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndexModifyDataStreamAction)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexModifyDataStreamActionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexModifyDataStreamActionConverter))] public sealed partial class IndexModifyDataStreamAction { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRouting.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRouting.Converters.g.cs new file mode 100644 index 00000000000..3239e3fb048 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRouting.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexRoutingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllocation = System.Text.Json.JsonEncodedText.Encode("allocation"); + private static readonly System.Text.Json.JsonEncodedText PropRebalance = System.Text.Json.JsonEncodedText.Encode("rebalance"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexRouting Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllocation = default; + LocalJsonValue propRebalance = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllocation.TryReadProperty(ref reader, options, PropAllocation, null)) + { + continue; + } + + if (propRebalance.TryReadProperty(ref reader, options, PropRebalance, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexRouting(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Allocation = propAllocation.Value, + Rebalance = propRebalance.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexRouting value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllocation, value.Allocation, null, null); + writer.WriteProperty(options, PropRebalance, value.Rebalance, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRouting.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRouting.g.cs index db718ccec4a..e9c5035d969 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRouting.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRouting.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexRoutingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllocation = System.Text.Json.JsonEncodedText.Encode("allocation"); - private static readonly System.Text.Json.JsonEncodedText PropRebalance = System.Text.Json.JsonEncodedText.Encode("rebalance"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexRouting Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllocation = default; - LocalJsonValue propRebalance = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllocation.TryReadProperty(ref reader, options, PropAllocation, null)) - { - continue; - } - - if (propRebalance.TryReadProperty(ref reader, options, PropRebalance, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexRouting(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Allocation = propAllocation.Value, - Rebalance = propRebalance.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexRouting value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllocation, value.Allocation, null, null); - writer.WriteProperty(options, PropRebalance, value.Rebalance, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexRoutingConverter))] public sealed partial class IndexRouting { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocation.Converters.g.cs new file mode 100644 index 00000000000..fbcc8b13b24 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocation.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexRoutingAllocationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDisk = System.Text.Json.JsonEncodedText.Encode("disk"); + private static readonly System.Text.Json.JsonEncodedText PropEnable = System.Text.Json.JsonEncodedText.Encode("enable"); + private static readonly System.Text.Json.JsonEncodedText PropInclude = System.Text.Json.JsonEncodedText.Encode("include"); + private static readonly System.Text.Json.JsonEncodedText PropInitialRecovery = System.Text.Json.JsonEncodedText.Encode("initial_recovery"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDisk = default; + LocalJsonValue propEnable = default; + LocalJsonValue propInclude = default; + LocalJsonValue propInitialRecovery = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDisk.TryReadProperty(ref reader, options, PropDisk, null)) + { + continue; + } + + if (propEnable.TryReadProperty(ref reader, options, PropEnable, static Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propInclude.TryReadProperty(ref reader, options, PropInclude, null)) + { + continue; + } + + if (propInitialRecovery.TryReadProperty(ref reader, options, PropInitialRecovery, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Disk = propDisk.Value, + Enable = propEnable.Value, + Include = propInclude.Value, + InitialRecovery = propInitialRecovery.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDisk, value.Disk, null, null); + writer.WriteProperty(options, PropEnable, value.Enable, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropInclude, value.Include, null, null); + writer.WriteProperty(options, PropInitialRecovery, value.InitialRecovery, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocation.g.cs index 14c18671842..410908bf4f3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocation.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexRoutingAllocationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDisk = System.Text.Json.JsonEncodedText.Encode("disk"); - private static readonly System.Text.Json.JsonEncodedText PropEnable = System.Text.Json.JsonEncodedText.Encode("enable"); - private static readonly System.Text.Json.JsonEncodedText PropInclude = System.Text.Json.JsonEncodedText.Encode("include"); - private static readonly System.Text.Json.JsonEncodedText PropInitialRecovery = System.Text.Json.JsonEncodedText.Encode("initial_recovery"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDisk = default; - LocalJsonValue propEnable = default; - LocalJsonValue propInclude = default; - LocalJsonValue propInitialRecovery = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDisk.TryReadProperty(ref reader, options, PropDisk, null)) - { - continue; - } - - if (propEnable.TryReadProperty(ref reader, options, PropEnable, static Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propInclude.TryReadProperty(ref reader, options, PropInclude, null)) - { - continue; - } - - if (propInitialRecovery.TryReadProperty(ref reader, options, PropInitialRecovery, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Disk = propDisk.Value, - Enable = propEnable.Value, - Include = propInclude.Value, - InitialRecovery = propInitialRecovery.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDisk, value.Disk, null, null); - writer.WriteProperty(options, PropEnable, value.Enable, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropInclude, value.Include, null, null); - writer.WriteProperty(options, PropInitialRecovery, value.InitialRecovery, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexRoutingAllocationConverter))] public sealed partial class IndexRoutingAllocation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationDisk.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationDisk.Converters.g.cs new file mode 100644 index 00000000000..447512aa80a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationDisk.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexRoutingAllocationDiskConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropThresholdEnabled = System.Text.Json.JsonEncodedText.Encode("threshold_enabled"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationDisk Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propThresholdEnabled = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propThresholdEnabled.TryReadProperty(ref reader, options, PropThresholdEnabled, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationDisk(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ThresholdEnabled = propThresholdEnabled.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationDisk value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropThresholdEnabled, value.ThresholdEnabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationDisk.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationDisk.g.cs index 8fe3da9e279..5d9d802d0f0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationDisk.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationDisk.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexRoutingAllocationDiskConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropThresholdEnabled = System.Text.Json.JsonEncodedText.Encode("threshold_enabled"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationDisk Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propThresholdEnabled = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propThresholdEnabled.TryReadProperty(ref reader, options, PropThresholdEnabled, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationDisk(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ThresholdEnabled = propThresholdEnabled.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationDisk value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropThresholdEnabled, value.ThresholdEnabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationDiskConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexRoutingAllocationDiskConverter))] public sealed partial class IndexRoutingAllocationDisk { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationInclude.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationInclude.Converters.g.cs new file mode 100644 index 00000000000..50efd442ab9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationInclude.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexRoutingAllocationIncludeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); + private static readonly System.Text.Json.JsonEncodedText PropTierPreference = System.Text.Json.JsonEncodedText.Encode("_tier_preference"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationInclude Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propTierPreference = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propTierPreference.TryReadProperty(ref reader, options, PropTierPreference, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationInclude(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + TierPreference = propTierPreference.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationInclude value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropTierPreference, value.TierPreference, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationInclude.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationInclude.g.cs index ebd34aa3077..50bcfa0f3ed 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationInclude.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationInclude.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexRoutingAllocationIncludeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - private static readonly System.Text.Json.JsonEncodedText PropTierPreference = System.Text.Json.JsonEncodedText.Encode("_tier_preference"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationInclude Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue propTierPreference = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propTierPreference.TryReadProperty(ref reader, options, PropTierPreference, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationInclude(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - TierPreference = propTierPreference.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationInclude value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropTierPreference, value.TierPreference, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationIncludeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexRoutingAllocationIncludeConverter))] public sealed partial class IndexRoutingAllocationInclude { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationInitialRecovery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationInitialRecovery.Converters.g.cs new file mode 100644 index 00000000000..3317772a459 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationInitialRecovery.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexRoutingAllocationInitialRecoveryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationInitialRecovery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationInitialRecovery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationInitialRecovery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationInitialRecovery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationInitialRecovery.g.cs index 90e953f4371..fa271cdb11a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationInitialRecovery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationInitialRecovery.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexRoutingAllocationInitialRecoveryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationInitialRecovery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationInitialRecovery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationInitialRecovery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationInitialRecoveryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexRoutingAllocationInitialRecoveryConverter))] public sealed partial class IndexRoutingAllocationInitialRecovery { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationOptions.Converters.g.cs new file mode 100644 index 00000000000..56126a7e3a9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationOptions.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexRoutingAllocationOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAll = System.Text.Json.JsonEncodedText.Encode("all"); + private static readonly System.Text.Json.JsonEncodedText MemberNewPrimaries = System.Text.Json.JsonEncodedText.Encode("new_primaries"); + private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); + private static readonly System.Text.Json.JsonEncodedText MemberPrimaries = System.Text.Json.JsonEncodedText.Encode("primaries"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAll)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions.All; + } + + if (reader.ValueTextEquals(MemberNewPrimaries)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions.NewPrimaries; + } + + if (reader.ValueTextEquals(MemberNone)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions.None; + } + + if (reader.ValueTextEquals(MemberPrimaries)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions.Primaries; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAll.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions.All; + } + + if (string.Equals(value, MemberNewPrimaries.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions.NewPrimaries; + } + + if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions.None; + } + + if (string.Equals(value, MemberPrimaries.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions.Primaries; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions.All: + writer.WriteStringValue(MemberAll); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions.NewPrimaries: + writer.WriteStringValue(MemberNewPrimaries); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions.None: + writer.WriteStringValue(MemberNone); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions.Primaries: + writer.WriteStringValue(MemberPrimaries); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingAllocationOptions value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationOptions.g.cs new file mode 100644 index 00000000000..140d9cc1f9e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingAllocationOptions.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexRoutingAllocationOptionsConverter))] +public enum IndexRoutingAllocationOptions +{ + [System.Runtime.Serialization.EnumMember(Value = "all")] + All, + [System.Runtime.Serialization.EnumMember(Value = "new_primaries")] + NewPrimaries, + [System.Runtime.Serialization.EnumMember(Value = "none")] + None, + [System.Runtime.Serialization.EnumMember(Value = "primaries")] + Primaries +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingRebalance.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingRebalance.Converters.g.cs new file mode 100644 index 00000000000..869f6044e74 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingRebalance.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexRoutingRebalanceConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnable = System.Text.Json.JsonEncodedText.Encode("enable"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalance Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEnable = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnable.TryReadProperty(ref reader, options, PropEnable, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalance(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Enable = propEnable.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalance value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnable, value.Enable, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingRebalance.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingRebalance.g.cs index 0a4c7f47a7e..5e32b7b0e0e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingRebalance.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingRebalance.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexRoutingRebalanceConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEnable = System.Text.Json.JsonEncodedText.Encode("enable"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalance Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEnable = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEnable.TryReadProperty(ref reader, options, PropEnable, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalance(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Enable = propEnable.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalance value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEnable, value.Enable, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexRoutingRebalanceConverter))] public sealed partial class IndexRoutingRebalance { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingRebalanceOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingRebalanceOptions.Converters.g.cs new file mode 100644 index 00000000000..89828acdd27 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingRebalanceOptions.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexRoutingRebalanceOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAll = System.Text.Json.JsonEncodedText.Encode("all"); + private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); + private static readonly System.Text.Json.JsonEncodedText MemberPrimaries = System.Text.Json.JsonEncodedText.Encode("primaries"); + private static readonly System.Text.Json.JsonEncodedText MemberReplicas = System.Text.Json.JsonEncodedText.Encode("replicas"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAll)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions.All; + } + + if (reader.ValueTextEquals(MemberNone)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions.None; + } + + if (reader.ValueTextEquals(MemberPrimaries)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions.Primaries; + } + + if (reader.ValueTextEquals(MemberReplicas)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions.Replicas; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAll.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions.All; + } + + if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions.None; + } + + if (string.Equals(value, MemberPrimaries.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions.Primaries; + } + + if (string.Equals(value, MemberReplicas.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions.Replicas; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions.All: + writer.WriteStringValue(MemberAll); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions.None: + writer.WriteStringValue(MemberNone); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions.Primaries: + writer.WriteStringValue(MemberPrimaries); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions.Replicas: + writer.WriteStringValue(MemberReplicas); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexRoutingRebalanceOptions value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingRebalanceOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingRebalanceOptions.g.cs new file mode 100644 index 00000000000..d3b7a521967 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexRoutingRebalanceOptions.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexRoutingRebalanceOptionsConverter))] +public enum IndexRoutingRebalanceOptions +{ + [System.Runtime.Serialization.EnumMember(Value = "all")] + All, + [System.Runtime.Serialization.EnumMember(Value = "none")] + None, + [System.Runtime.Serialization.EnumMember(Value = "primaries")] + Primaries, + [System.Runtime.Serialization.EnumMember(Value = "replicas")] + Replicas +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSegment.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSegment.Converters.g.cs new file mode 100644 index 00000000000..fe53fdf2cc2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSegment.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexSegmentConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexSegment Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>> propShards = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propShards.TryReadProperty(ref reader, options, PropShards, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexSegment(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Shards = propShards.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexSegment value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropShards, value.Shards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSegment.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSegment.g.cs index c251cecfd48..db3f807b890 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSegment.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSegment.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexSegmentConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexSegment Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>> propShards = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propShards.TryReadProperty(ref reader, options, PropShards, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexSegment(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Shards = propShards.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexSegment value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropShards, value.Shards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexSegmentConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexSegmentConverter))] public sealed partial class IndexSegment { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSegmentSort.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSegmentSort.Converters.g.cs new file mode 100644 index 00000000000..06bee522538 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSegmentSort.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexSegmentSortConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); + private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexSegmentSort Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue?> propMissing = default; + LocalJsonValue?> propMode = default; + LocalJsonValue?> propOrder = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propMode.TryReadProperty(ref reader, options, PropMode, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propOrder.TryReadProperty(ref reader, options, PropOrder, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexSegmentSort(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Missing = propMissing.Value, + Mode = propMode.Value, + Order = propOrder.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexSegmentSort value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropMissing, value.Missing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMode, value.Mode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSegmentSort.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSegmentSort.g.cs index 5f7d2c711bc..81270e92683 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSegmentSort.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSegmentSort.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexSegmentSortConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); - private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexSegmentSort Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue?> propMissing = default; - LocalJsonValue?> propMode = default; - LocalJsonValue?> propOrder = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propMode.TryReadProperty(ref reader, options, PropMode, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propOrder.TryReadProperty(ref reader, options, PropOrder, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexSegmentSort(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Missing = propMissing.Value, - Mode = propMode.Value, - Order = propOrder.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexSegmentSort value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropMissing, value.Missing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMode, value.Mode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexSegmentSortConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexSegmentSortConverter))] public sealed partial class IndexSegmentSort { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingBlocks.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingBlocks.Converters.g.cs new file mode 100644 index 00000000000..4acbdc67405 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingBlocks.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexSettingBlocksConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropRead = System.Text.Json.JsonEncodedText.Encode("read"); + private static readonly System.Text.Json.JsonEncodedText PropReadOnly = System.Text.Json.JsonEncodedText.Encode("read_only"); + private static readonly System.Text.Json.JsonEncodedText PropReadOnlyAllowDelete = System.Text.Json.JsonEncodedText.Encode("read_only_allow_delete"); + private static readonly System.Text.Json.JsonEncodedText PropWrite = System.Text.Json.JsonEncodedText.Encode("write"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingBlocks Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMetadata = default; + LocalJsonValue propRead = default; + LocalJsonValue propReadOnly = default; + LocalJsonValue propReadOnlyAllowDelete = default; + LocalJsonValue propWrite = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRead.TryReadProperty(ref reader, options, PropRead, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propReadOnly.TryReadProperty(ref reader, options, PropReadOnly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propReadOnlyAllowDelete.TryReadProperty(ref reader, options, PropReadOnlyAllowDelete, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propWrite.TryReadProperty(ref reader, options, PropWrite, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingBlocks(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Metadata = propMetadata.Value, + Read = propRead.Value, + ReadOnly = propReadOnly.Value, + ReadOnlyAllowDelete = propReadOnlyAllowDelete.Value, + Write = propWrite.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingBlocks value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRead, value.Read, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropReadOnly, value.ReadOnly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropReadOnlyAllowDelete, value.ReadOnlyAllowDelete, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropWrite, value.Write, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingBlocks.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingBlocks.g.cs index 389acc08d4c..a700eb8da05 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingBlocks.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingBlocks.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexSettingBlocksConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropRead = System.Text.Json.JsonEncodedText.Encode("read"); - private static readonly System.Text.Json.JsonEncodedText PropReadOnly = System.Text.Json.JsonEncodedText.Encode("read_only"); - private static readonly System.Text.Json.JsonEncodedText PropReadOnlyAllowDelete = System.Text.Json.JsonEncodedText.Encode("read_only_allow_delete"); - private static readonly System.Text.Json.JsonEncodedText PropWrite = System.Text.Json.JsonEncodedText.Encode("write"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingBlocks Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMetadata = default; - LocalJsonValue propRead = default; - LocalJsonValue propReadOnly = default; - LocalJsonValue propReadOnlyAllowDelete = default; - LocalJsonValue propWrite = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRead.TryReadProperty(ref reader, options, PropRead, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propReadOnly.TryReadProperty(ref reader, options, PropReadOnly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propReadOnlyAllowDelete.TryReadProperty(ref reader, options, PropReadOnlyAllowDelete, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propWrite.TryReadProperty(ref reader, options, PropWrite, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingBlocks(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Metadata = propMetadata.Value, - Read = propRead.Value, - ReadOnly = propReadOnly.Value, - ReadOnlyAllowDelete = propReadOnlyAllowDelete.Value, - Write = propWrite.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingBlocks value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRead, value.Read, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropReadOnly, value.ReadOnly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropReadOnlyAllowDelete, value.ReadOnlyAllowDelete, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropWrite, value.Write, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingBlocksConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexSettingBlocksConverter))] public sealed partial class IndexSettingBlocks { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingResults.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingResults.Converters.g.cs new file mode 100644 index 00000000000..012ae534876 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingResults.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexSettingResultsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAppliedToDataStreamAndBackingIndices = System.Text.Json.JsonEncodedText.Encode("applied_to_data_stream_and_backing_indices"); + private static readonly System.Text.Json.JsonEncodedText PropAppliedToDataStreamOnly = System.Text.Json.JsonEncodedText.Encode("applied_to_data_stream_only"); + private static readonly System.Text.Json.JsonEncodedText PropErrors = System.Text.Json.JsonEncodedText.Encode("errors"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingResults Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propAppliedToDataStreamAndBackingIndices = default; + LocalJsonValue> propAppliedToDataStreamOnly = default; + LocalJsonValue?> propErrors = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAppliedToDataStreamAndBackingIndices.TryReadProperty(ref reader, options, PropAppliedToDataStreamAndBackingIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propAppliedToDataStreamOnly.TryReadProperty(ref reader, options, PropAppliedToDataStreamOnly, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propErrors.TryReadProperty(ref reader, options, PropErrors, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingResults(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AppliedToDataStreamAndBackingIndices = propAppliedToDataStreamAndBackingIndices.Value, + AppliedToDataStreamOnly = propAppliedToDataStreamOnly.Value, + Errors = propErrors.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingResults value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAppliedToDataStreamAndBackingIndices, value.AppliedToDataStreamAndBackingIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropAppliedToDataStreamOnly, value.AppliedToDataStreamOnly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropErrors, value.Errors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingResults.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingResults.g.cs index 56996b647d3..dcb5deaa079 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingResults.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingResults.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexSettingResultsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAppliedToDataStreamAndBackingIndices = System.Text.Json.JsonEncodedText.Encode("applied_to_data_stream_and_backing_indices"); - private static readonly System.Text.Json.JsonEncodedText PropAppliedToDataStreamOnly = System.Text.Json.JsonEncodedText.Encode("applied_to_data_stream_only"); - private static readonly System.Text.Json.JsonEncodedText PropErrors = System.Text.Json.JsonEncodedText.Encode("errors"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingResults Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propAppliedToDataStreamAndBackingIndices = default; - LocalJsonValue> propAppliedToDataStreamOnly = default; - LocalJsonValue?> propErrors = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAppliedToDataStreamAndBackingIndices.TryReadProperty(ref reader, options, PropAppliedToDataStreamAndBackingIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propAppliedToDataStreamOnly.TryReadProperty(ref reader, options, PropAppliedToDataStreamOnly, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propErrors.TryReadProperty(ref reader, options, PropErrors, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingResults(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AppliedToDataStreamAndBackingIndices = propAppliedToDataStreamAndBackingIndices.Value, - AppliedToDataStreamOnly = propAppliedToDataStreamOnly.Value, - Errors = propErrors.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingResults value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAppliedToDataStreamAndBackingIndices, value.AppliedToDataStreamAndBackingIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropAppliedToDataStreamOnly, value.AppliedToDataStreamOnly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropErrors, value.Errors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingResultsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexSettingResultsConverter))] public sealed partial class IndexSettingResults { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettings.Converters.g.cs new file mode 100644 index 00000000000..a8e3305c6c3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettings.Converters.g.cs @@ -0,0 +1,564 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalysis = System.Text.Json.JsonEncodedText.Encode("analysis"); + private static readonly System.Text.Json.JsonEncodedText PropAnalyze = System.Text.Json.JsonEncodedText.Encode("analyze"); + private static readonly System.Text.Json.JsonEncodedText PropAutoExpandReplicas = System.Text.Json.JsonEncodedText.Encode("auto_expand_replicas"); + private static readonly System.Text.Json.JsonEncodedText PropBlocks = System.Text.Json.JsonEncodedText.Encode("blocks"); + private static readonly System.Text.Json.JsonEncodedText PropCheckOnStartup = System.Text.Json.JsonEncodedText.Encode("check_on_startup"); + private static readonly System.Text.Json.JsonEncodedText PropCodec = System.Text.Json.JsonEncodedText.Encode("codec"); + private static readonly System.Text.Json.JsonEncodedText PropCreationDate = System.Text.Json.JsonEncodedText.Encode("creation_date"); + private static readonly System.Text.Json.JsonEncodedText PropCreationDateString = System.Text.Json.JsonEncodedText.Encode("creation_date_string"); + private static readonly System.Text.Json.JsonEncodedText PropDefaultPipeline = System.Text.Json.JsonEncodedText.Encode("default_pipeline"); + private static readonly System.Text.Json.JsonEncodedText PropFinalPipeline = System.Text.Json.JsonEncodedText.Encode("final_pipeline"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropGcDeletes = System.Text.Json.JsonEncodedText.Encode("gc_deletes"); + private static readonly System.Text.Json.JsonEncodedText PropHidden = System.Text.Json.JsonEncodedText.Encode("hidden"); + private static readonly System.Text.Json.JsonEncodedText PropHighlight = System.Text.Json.JsonEncodedText.Encode("highlight"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropIndexingPressure = System.Text.Json.JsonEncodedText.Encode("indexing_pressure"); + private static readonly System.Text.Json.JsonEncodedText PropIndexingSlowlog = System.Text.Json.JsonEncodedText.Encode("indexing.slowlog"); + private static readonly System.Text.Json.JsonEncodedText PropLifecycle = System.Text.Json.JsonEncodedText.Encode("lifecycle"); + private static readonly System.Text.Json.JsonEncodedText PropLoadFixedBitsetFiltersEagerly = System.Text.Json.JsonEncodedText.Encode("load_fixed_bitset_filters_eagerly"); + private static readonly System.Text.Json.JsonEncodedText PropMapping = System.Text.Json.JsonEncodedText.Encode("mapping"); + private static readonly System.Text.Json.JsonEncodedText PropMaxDocvalueFieldsSearch = System.Text.Json.JsonEncodedText.Encode("max_docvalue_fields_search"); + private static readonly System.Text.Json.JsonEncodedText PropMaxInnerResultWindow = System.Text.Json.JsonEncodedText.Encode("max_inner_result_window"); + private static readonly System.Text.Json.JsonEncodedText PropMaxNgramDiff = System.Text.Json.JsonEncodedText.Encode("max_ngram_diff"); + private static readonly System.Text.Json.JsonEncodedText PropMaxRefreshListeners = System.Text.Json.JsonEncodedText.Encode("max_refresh_listeners"); + private static readonly System.Text.Json.JsonEncodedText PropMaxRegexLength = System.Text.Json.JsonEncodedText.Encode("max_regex_length"); + private static readonly System.Text.Json.JsonEncodedText PropMaxRescoreWindow = System.Text.Json.JsonEncodedText.Encode("max_rescore_window"); + private static readonly System.Text.Json.JsonEncodedText PropMaxResultWindow = System.Text.Json.JsonEncodedText.Encode("max_result_window"); + private static readonly System.Text.Json.JsonEncodedText PropMaxScriptFields = System.Text.Json.JsonEncodedText.Encode("max_script_fields"); + private static readonly System.Text.Json.JsonEncodedText PropMaxShingleDiff = System.Text.Json.JsonEncodedText.Encode("max_shingle_diff"); + private static readonly System.Text.Json.JsonEncodedText PropMaxSlicesPerScroll = System.Text.Json.JsonEncodedText.Encode("max_slices_per_scroll"); + private static readonly System.Text.Json.JsonEncodedText PropMaxTermsCount = System.Text.Json.JsonEncodedText.Encode("max_terms_count"); + private static readonly System.Text.Json.JsonEncodedText PropMerge = System.Text.Json.JsonEncodedText.Encode("merge"); + private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); + private static readonly System.Text.Json.JsonEncodedText PropNumberOfReplicas = System.Text.Json.JsonEncodedText.Encode("number_of_replicas"); + private static readonly System.Text.Json.JsonEncodedText PropNumberOfRoutingShards = System.Text.Json.JsonEncodedText.Encode("number_of_routing_shards"); + private static readonly System.Text.Json.JsonEncodedText PropNumberOfShards = System.Text.Json.JsonEncodedText.Encode("number_of_shards"); + private static readonly System.Text.Json.JsonEncodedText PropPriority = System.Text.Json.JsonEncodedText.Encode("priority"); + private static readonly System.Text.Json.JsonEncodedText PropProvidedName = System.Text.Json.JsonEncodedText.Encode("provided_name"); + private static readonly System.Text.Json.JsonEncodedText PropQueries = System.Text.Json.JsonEncodedText.Encode("queries"); + private static readonly System.Text.Json.JsonEncodedText PropQueryString = System.Text.Json.JsonEncodedText.Encode("query_string"); + private static readonly System.Text.Json.JsonEncodedText PropRefreshInterval = System.Text.Json.JsonEncodedText.Encode("refresh_interval"); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); + private static readonly System.Text.Json.JsonEncodedText PropRoutingPartitionSize = System.Text.Json.JsonEncodedText.Encode("routing_partition_size"); + private static readonly System.Text.Json.JsonEncodedText PropRoutingPath = System.Text.Json.JsonEncodedText.Encode("routing_path"); + private static readonly System.Text.Json.JsonEncodedText PropSearch = System.Text.Json.JsonEncodedText.Encode("search"); + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); + private static readonly System.Text.Json.JsonEncodedText PropSoftDeletes = System.Text.Json.JsonEncodedText.Encode("soft_deletes"); + private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeries = System.Text.Json.JsonEncodedText.Encode("time_series"); + private static readonly System.Text.Json.JsonEncodedText PropTopMetricsMaxSize = System.Text.Json.JsonEncodedText.Encode("top_metrics_max_size"); + private static readonly System.Text.Json.JsonEncodedText PropTranslog = System.Text.Json.JsonEncodedText.Encode("translog"); + private static readonly System.Text.Json.JsonEncodedText PropUuid = System.Text.Json.JsonEncodedText.Encode("uuid"); + private static readonly System.Text.Json.JsonEncodedText PropVerifiedBeforeClose = System.Text.Json.JsonEncodedText.Encode("verified_before_close"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalysis = default; + LocalJsonValue propAnalyze = default; + LocalJsonValue propAutoExpandReplicas = default; + LocalJsonValue propBlocks = default; + LocalJsonValue propCheckOnStartup = default; + LocalJsonValue propCodec = default; + LocalJsonValue propCreationDate = default; + LocalJsonValue propCreationDateString = default; + LocalJsonValue propDefaultPipeline = default; + LocalJsonValue propFinalPipeline = default; + LocalJsonValue?> propFormat = default; + LocalJsonValue propGcDeletes = default; + LocalJsonValue?> propHidden = default; + LocalJsonValue propHighlight = default; + LocalJsonValue propIndex = default; + LocalJsonValue propIndexingPressure = default; + LocalJsonValue propIndexingSlowlog = default; + LocalJsonValue propLifecycle = default; + LocalJsonValue propLoadFixedBitsetFiltersEagerly = default; + LocalJsonValue propMapping = default; + LocalJsonValue propMaxDocvalueFieldsSearch = default; + LocalJsonValue propMaxInnerResultWindow = default; + LocalJsonValue propMaxNgramDiff = default; + LocalJsonValue propMaxRefreshListeners = default; + LocalJsonValue propMaxRegexLength = default; + LocalJsonValue propMaxRescoreWindow = default; + LocalJsonValue propMaxResultWindow = default; + LocalJsonValue propMaxScriptFields = default; + LocalJsonValue propMaxShingleDiff = default; + LocalJsonValue propMaxSlicesPerScroll = default; + LocalJsonValue propMaxTermsCount = default; + LocalJsonValue propMerge = default; + LocalJsonValue propMode = default; + LocalJsonValue?> propNumberOfReplicas = default; + LocalJsonValue propNumberOfRoutingShards = default; + LocalJsonValue?> propNumberOfShards = default; + System.Collections.Generic.Dictionary? propOtherSettings = default; + LocalJsonValue?> propPriority = default; + LocalJsonValue propProvidedName = default; + LocalJsonValue propQueries = default; + LocalJsonValue propQueryString = default; + LocalJsonValue propRefreshInterval = default; + LocalJsonValue propRouting = default; + LocalJsonValue propRoutingPartitionSize = default; + LocalJsonValue?> propRoutingPath = default; + LocalJsonValue propSearch = default; + LocalJsonValue propSettings = default; + LocalJsonValue propSimilarity = default; + LocalJsonValue propSoftDeletes = default; + LocalJsonValue propSort = default; + LocalJsonValue propStore = default; + LocalJsonValue propTimeSeries = default; + LocalJsonValue propTopMetricsMaxSize = default; + LocalJsonValue propTranslog = default; + LocalJsonValue propUuid = default; + LocalJsonValue?> propVerifiedBeforeClose = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalysis.TryReadProperty(ref reader, options, PropAnalysis, null)) + { + continue; + } + + if (propAnalyze.TryReadProperty(ref reader, options, PropAnalyze, null)) + { + continue; + } + + if (propAutoExpandReplicas.TryReadProperty(ref reader, options, PropAutoExpandReplicas, null)) + { + continue; + } + + if (propBlocks.TryReadProperty(ref reader, options, PropBlocks, null)) + { + continue; + } + + if (propCheckOnStartup.TryReadProperty(ref reader, options, PropCheckOnStartup, static Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCodec.TryReadProperty(ref reader, options, PropCodec, null)) + { + continue; + } + + if (propCreationDate.TryReadProperty(ref reader, options, PropCreationDate, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propCreationDateString.TryReadProperty(ref reader, options, PropCreationDateString, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propDefaultPipeline.TryReadProperty(ref reader, options, PropDefaultPipeline, null)) + { + continue; + } + + if (propFinalPipeline.TryReadProperty(ref reader, options, PropFinalPipeline, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number), null, null))) + { + continue; + } + + if (propGcDeletes.TryReadProperty(ref reader, options, PropGcDeletes, null)) + { + continue; + } + + if (propHidden.TryReadProperty(ref reader, options, PropHidden, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) + { + continue; + } + + if (propHighlight.TryReadProperty(ref reader, options, PropHighlight, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propIndexingPressure.TryReadProperty(ref reader, options, PropIndexingPressure, null)) + { + continue; + } + + if (propIndexingSlowlog.TryReadProperty(ref reader, options, PropIndexingSlowlog, null)) + { + continue; + } + + if (propLifecycle.TryReadProperty(ref reader, options, PropLifecycle, null)) + { + continue; + } + + if (propLoadFixedBitsetFiltersEagerly.TryReadProperty(ref reader, options, PropLoadFixedBitsetFiltersEagerly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMapping.TryReadProperty(ref reader, options, PropMapping, null)) + { + continue; + } + + if (propMaxDocvalueFieldsSearch.TryReadProperty(ref reader, options, PropMaxDocvalueFieldsSearch, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxInnerResultWindow.TryReadProperty(ref reader, options, PropMaxInnerResultWindow, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxNgramDiff.TryReadProperty(ref reader, options, PropMaxNgramDiff, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxRefreshListeners.TryReadProperty(ref reader, options, PropMaxRefreshListeners, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxRegexLength.TryReadProperty(ref reader, options, PropMaxRegexLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxRescoreWindow.TryReadProperty(ref reader, options, PropMaxRescoreWindow, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxResultWindow.TryReadProperty(ref reader, options, PropMaxResultWindow, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxScriptFields.TryReadProperty(ref reader, options, PropMaxScriptFields, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxShingleDiff.TryReadProperty(ref reader, options, PropMaxShingleDiff, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxSlicesPerScroll.TryReadProperty(ref reader, options, PropMaxSlicesPerScroll, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxTermsCount.TryReadProperty(ref reader, options, PropMaxTermsCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMerge.TryReadProperty(ref reader, options, PropMerge, null)) + { + continue; + } + + if (propMode.TryReadProperty(ref reader, options, PropMode, null)) + { + continue; + } + + if (propNumberOfReplicas.TryReadProperty(ref reader, options, PropNumberOfReplicas, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) + { + continue; + } + + if (propNumberOfRoutingShards.TryReadProperty(ref reader, options, PropNumberOfRoutingShards, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNumberOfShards.TryReadProperty(ref reader, options, PropNumberOfShards, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) + { + continue; + } + + if (propPriority.TryReadProperty(ref reader, options, PropPriority, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) + { + continue; + } + + if (propProvidedName.TryReadProperty(ref reader, options, PropProvidedName, null)) + { + continue; + } + + if (propQueries.TryReadProperty(ref reader, options, PropQueries, null)) + { + continue; + } + + if (propQueryString.TryReadProperty(ref reader, options, PropQueryString, null)) + { + continue; + } + + if (propRefreshInterval.TryReadProperty(ref reader, options, PropRefreshInterval, null)) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (propRoutingPartitionSize.TryReadProperty(ref reader, options, PropRoutingPartitionSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRoutingPath.TryReadProperty(ref reader, options, PropRoutingPath, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propSearch.TryReadProperty(ref reader, options, PropSearch, null)) + { + continue; + } + + if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) + { + continue; + } + + if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, null)) + { + continue; + } + + if (propSoftDeletes.TryReadProperty(ref reader, options, PropSoftDeletes, null)) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, null)) + { + continue; + } + + if (propTimeSeries.TryReadProperty(ref reader, options, PropTimeSeries, null)) + { + continue; + } + + if (propTopMetricsMaxSize.TryReadProperty(ref reader, options, PropTopMetricsMaxSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTranslog.TryReadProperty(ref reader, options, PropTranslog, null)) + { + continue; + } + + if (propUuid.TryReadProperty(ref reader, options, PropUuid, null)) + { + continue; + } + + if (propVerifiedBeforeClose.TryReadProperty(ref reader, options, PropVerifiedBeforeClose, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + propOtherSettings ??= new System.Collections.Generic.Dictionary(); + reader.ReadProperty(options, out string key, out object value, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!); + propOtherSettings[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analysis = propAnalysis.Value, + Analyze = propAnalyze.Value, + AutoExpandReplicas = propAutoExpandReplicas.Value, + Blocks = propBlocks.Value, + CheckOnStartup = propCheckOnStartup.Value, + Codec = propCodec.Value, + CreationDate = propCreationDate.Value, + CreationDateString = propCreationDateString.Value, + DefaultPipeline = propDefaultPipeline.Value, + FinalPipeline = propFinalPipeline.Value, + Format = propFormat.Value, + GcDeletes = propGcDeletes.Value, + Hidden = propHidden.Value, + Highlight = propHighlight.Value, + Index = propIndex.Value, + IndexingPressure = propIndexingPressure.Value, + IndexingSlowlog = propIndexingSlowlog.Value, + Lifecycle = propLifecycle.Value, + LoadFixedBitsetFiltersEagerly = propLoadFixedBitsetFiltersEagerly.Value, + Mapping = propMapping.Value, + MaxDocvalueFieldsSearch = propMaxDocvalueFieldsSearch.Value, + MaxInnerResultWindow = propMaxInnerResultWindow.Value, + MaxNgramDiff = propMaxNgramDiff.Value, + MaxRefreshListeners = propMaxRefreshListeners.Value, + MaxRegexLength = propMaxRegexLength.Value, + MaxRescoreWindow = propMaxRescoreWindow.Value, + MaxResultWindow = propMaxResultWindow.Value, + MaxScriptFields = propMaxScriptFields.Value, + MaxShingleDiff = propMaxShingleDiff.Value, + MaxSlicesPerScroll = propMaxSlicesPerScroll.Value, + MaxTermsCount = propMaxTermsCount.Value, + Merge = propMerge.Value, + Mode = propMode.Value, + NumberOfReplicas = propNumberOfReplicas.Value, + NumberOfRoutingShards = propNumberOfRoutingShards.Value, + NumberOfShards = propNumberOfShards.Value, + OtherSettings = propOtherSettings, + Priority = propPriority.Value, + ProvidedName = propProvidedName.Value, + Queries = propQueries.Value, + QueryString = propQueryString.Value, + RefreshInterval = propRefreshInterval.Value, + Routing = propRouting.Value, + RoutingPartitionSize = propRoutingPartitionSize.Value, + RoutingPath = propRoutingPath.Value, + Search = propSearch.Value, + Settings = propSettings.Value, + Similarity = propSimilarity.Value, + SoftDeletes = propSoftDeletes.Value, + Sort = propSort.Value, + Store = propStore.Value, + TimeSeries = propTimeSeries.Value, + TopMetricsMaxSize = propTopMetricsMaxSize.Value, + Translog = propTranslog.Value, + Uuid = propUuid.Value, + VerifiedBeforeClose = propVerifiedBeforeClose.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalysis, value.Analysis, null, null); + writer.WriteProperty(options, PropAnalyze, value.Analyze, null, null); + writer.WriteProperty(options, PropAutoExpandReplicas, value.AutoExpandReplicas, null, null); + writer.WriteProperty(options, PropBlocks, value.Blocks, null, null); + writer.WriteProperty(options, PropCheckOnStartup, value.CheckOnStartup, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCodec, value.Codec, null, null); + writer.WriteProperty(options, PropCreationDate, value.CreationDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropCreationDateString, value.CreationDateString, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropDefaultPipeline, value.DefaultPipeline, null, null); + writer.WriteProperty(options, PropFinalPipeline, value.FinalPipeline, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); + writer.WriteProperty(options, PropGcDeletes, value.GcDeletes, null, null); + writer.WriteProperty(options, PropHidden, value.Hidden, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); + writer.WriteProperty(options, PropHighlight, value.Highlight, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropIndexingPressure, value.IndexingPressure, null, null); + writer.WriteProperty(options, PropIndexingSlowlog, value.IndexingSlowlog, null, null); + writer.WriteProperty(options, PropLifecycle, value.Lifecycle, null, null); + writer.WriteProperty(options, PropLoadFixedBitsetFiltersEagerly, value.LoadFixedBitsetFiltersEagerly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMapping, value.Mapping, null, null); + writer.WriteProperty(options, PropMaxDocvalueFieldsSearch, value.MaxDocvalueFieldsSearch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxInnerResultWindow, value.MaxInnerResultWindow, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxNgramDiff, value.MaxNgramDiff, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxRefreshListeners, value.MaxRefreshListeners, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxRegexLength, value.MaxRegexLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxRescoreWindow, value.MaxRescoreWindow, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxResultWindow, value.MaxResultWindow, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxScriptFields, value.MaxScriptFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxShingleDiff, value.MaxShingleDiff, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxSlicesPerScroll, value.MaxSlicesPerScroll, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxTermsCount, value.MaxTermsCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMerge, value.Merge, null, null); + writer.WriteProperty(options, PropMode, value.Mode, null, null); + writer.WriteProperty(options, PropNumberOfReplicas, value.NumberOfReplicas, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); + writer.WriteProperty(options, PropNumberOfRoutingShards, value.NumberOfRoutingShards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNumberOfShards, value.NumberOfShards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); + writer.WriteProperty(options, PropPriority, value.Priority, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); + writer.WriteProperty(options, PropProvidedName, value.ProvidedName, null, null); + writer.WriteProperty(options, PropQueries, value.Queries, null, null); + writer.WriteProperty(options, PropQueryString, value.QueryString, null, null); + writer.WriteProperty(options, PropRefreshInterval, value.RefreshInterval, null, null); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteProperty(options, PropRoutingPartitionSize, value.RoutingPartitionSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRoutingPath, value.RoutingPath, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSearch, value.Search, null, null); + writer.WriteProperty(options, PropSettings, value.Settings, null, null); + writer.WriteProperty(options, PropSimilarity, value.Similarity, null, null); + writer.WriteProperty(options, PropSoftDeletes, value.SoftDeletes, null, null); + writer.WriteProperty(options, PropSort, value.Sort, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, null); + writer.WriteProperty(options, PropTimeSeries, value.TimeSeries, null, null); + writer.WriteProperty(options, PropTopMetricsMaxSize, value.TopMetricsMaxSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTranslog, value.Translog, null, null); + writer.WriteProperty(options, PropUuid, value.Uuid, null, null); + writer.WriteProperty(options, PropVerifiedBeforeClose, value.VerifiedBeforeClose, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + if (value.OtherSettings is not null) + { + foreach (var item in value.OtherSettings) + { + writer.WriteProperty(options, item.Key, item.Value, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettings.g.cs index cb39b8ca54a..bd06068e7d5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettings.g.cs @@ -23,550 +23,10 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalysis = System.Text.Json.JsonEncodedText.Encode("analysis"); - private static readonly System.Text.Json.JsonEncodedText PropAnalyze = System.Text.Json.JsonEncodedText.Encode("analyze"); - private static readonly System.Text.Json.JsonEncodedText PropAutoExpandReplicas = System.Text.Json.JsonEncodedText.Encode("auto_expand_replicas"); - private static readonly System.Text.Json.JsonEncodedText PropBlocks = System.Text.Json.JsonEncodedText.Encode("blocks"); - private static readonly System.Text.Json.JsonEncodedText PropCheckOnStartup = System.Text.Json.JsonEncodedText.Encode("check_on_startup"); - private static readonly System.Text.Json.JsonEncodedText PropCodec = System.Text.Json.JsonEncodedText.Encode("codec"); - private static readonly System.Text.Json.JsonEncodedText PropCreationDate = System.Text.Json.JsonEncodedText.Encode("creation_date"); - private static readonly System.Text.Json.JsonEncodedText PropCreationDateString = System.Text.Json.JsonEncodedText.Encode("creation_date_string"); - private static readonly System.Text.Json.JsonEncodedText PropDefaultPipeline = System.Text.Json.JsonEncodedText.Encode("default_pipeline"); - private static readonly System.Text.Json.JsonEncodedText PropFinalPipeline = System.Text.Json.JsonEncodedText.Encode("final_pipeline"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropGcDeletes = System.Text.Json.JsonEncodedText.Encode("gc_deletes"); - private static readonly System.Text.Json.JsonEncodedText PropHidden = System.Text.Json.JsonEncodedText.Encode("hidden"); - private static readonly System.Text.Json.JsonEncodedText PropHighlight = System.Text.Json.JsonEncodedText.Encode("highlight"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropIndexingPressure = System.Text.Json.JsonEncodedText.Encode("indexing_pressure"); - private static readonly System.Text.Json.JsonEncodedText PropIndexingSlowlog = System.Text.Json.JsonEncodedText.Encode("indexing.slowlog"); - private static readonly System.Text.Json.JsonEncodedText PropLifecycle = System.Text.Json.JsonEncodedText.Encode("lifecycle"); - private static readonly System.Text.Json.JsonEncodedText PropLoadFixedBitsetFiltersEagerly = System.Text.Json.JsonEncodedText.Encode("load_fixed_bitset_filters_eagerly"); - private static readonly System.Text.Json.JsonEncodedText PropMapping = System.Text.Json.JsonEncodedText.Encode("mapping"); - private static readonly System.Text.Json.JsonEncodedText PropMaxDocvalueFieldsSearch = System.Text.Json.JsonEncodedText.Encode("max_docvalue_fields_search"); - private static readonly System.Text.Json.JsonEncodedText PropMaxInnerResultWindow = System.Text.Json.JsonEncodedText.Encode("max_inner_result_window"); - private static readonly System.Text.Json.JsonEncodedText PropMaxNgramDiff = System.Text.Json.JsonEncodedText.Encode("max_ngram_diff"); - private static readonly System.Text.Json.JsonEncodedText PropMaxRefreshListeners = System.Text.Json.JsonEncodedText.Encode("max_refresh_listeners"); - private static readonly System.Text.Json.JsonEncodedText PropMaxRegexLength = System.Text.Json.JsonEncodedText.Encode("max_regex_length"); - private static readonly System.Text.Json.JsonEncodedText PropMaxRescoreWindow = System.Text.Json.JsonEncodedText.Encode("max_rescore_window"); - private static readonly System.Text.Json.JsonEncodedText PropMaxResultWindow = System.Text.Json.JsonEncodedText.Encode("max_result_window"); - private static readonly System.Text.Json.JsonEncodedText PropMaxScriptFields = System.Text.Json.JsonEncodedText.Encode("max_script_fields"); - private static readonly System.Text.Json.JsonEncodedText PropMaxShingleDiff = System.Text.Json.JsonEncodedText.Encode("max_shingle_diff"); - private static readonly System.Text.Json.JsonEncodedText PropMaxSlicesPerScroll = System.Text.Json.JsonEncodedText.Encode("max_slices_per_scroll"); - private static readonly System.Text.Json.JsonEncodedText PropMaxTermsCount = System.Text.Json.JsonEncodedText.Encode("max_terms_count"); - private static readonly System.Text.Json.JsonEncodedText PropMerge = System.Text.Json.JsonEncodedText.Encode("merge"); - private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); - private static readonly System.Text.Json.JsonEncodedText PropNumberOfReplicas = System.Text.Json.JsonEncodedText.Encode("number_of_replicas"); - private static readonly System.Text.Json.JsonEncodedText PropNumberOfRoutingShards = System.Text.Json.JsonEncodedText.Encode("number_of_routing_shards"); - private static readonly System.Text.Json.JsonEncodedText PropNumberOfShards = System.Text.Json.JsonEncodedText.Encode("number_of_shards"); - private static readonly System.Text.Json.JsonEncodedText PropPriority = System.Text.Json.JsonEncodedText.Encode("priority"); - private static readonly System.Text.Json.JsonEncodedText PropProvidedName = System.Text.Json.JsonEncodedText.Encode("provided_name"); - private static readonly System.Text.Json.JsonEncodedText PropQueries = System.Text.Json.JsonEncodedText.Encode("queries"); - private static readonly System.Text.Json.JsonEncodedText PropQueryString = System.Text.Json.JsonEncodedText.Encode("query_string"); - private static readonly System.Text.Json.JsonEncodedText PropRefreshInterval = System.Text.Json.JsonEncodedText.Encode("refresh_interval"); - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); - private static readonly System.Text.Json.JsonEncodedText PropRoutingPartitionSize = System.Text.Json.JsonEncodedText.Encode("routing_partition_size"); - private static readonly System.Text.Json.JsonEncodedText PropRoutingPath = System.Text.Json.JsonEncodedText.Encode("routing_path"); - private static readonly System.Text.Json.JsonEncodedText PropSearch = System.Text.Json.JsonEncodedText.Encode("search"); - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); - private static readonly System.Text.Json.JsonEncodedText PropSoftDeletes = System.Text.Json.JsonEncodedText.Encode("soft_deletes"); - private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeries = System.Text.Json.JsonEncodedText.Encode("time_series"); - private static readonly System.Text.Json.JsonEncodedText PropTopMetricsMaxSize = System.Text.Json.JsonEncodedText.Encode("top_metrics_max_size"); - private static readonly System.Text.Json.JsonEncodedText PropTranslog = System.Text.Json.JsonEncodedText.Encode("translog"); - private static readonly System.Text.Json.JsonEncodedText PropUuid = System.Text.Json.JsonEncodedText.Encode("uuid"); - private static readonly System.Text.Json.JsonEncodedText PropVerifiedBeforeClose = System.Text.Json.JsonEncodedText.Encode("verified_before_close"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalysis = default; - LocalJsonValue propAnalyze = default; - LocalJsonValue propAutoExpandReplicas = default; - LocalJsonValue propBlocks = default; - LocalJsonValue propCheckOnStartup = default; - LocalJsonValue propCodec = default; - LocalJsonValue propCreationDate = default; - LocalJsonValue propCreationDateString = default; - LocalJsonValue propDefaultPipeline = default; - LocalJsonValue propFinalPipeline = default; - LocalJsonValue?> propFormat = default; - LocalJsonValue propGcDeletes = default; - LocalJsonValue?> propHidden = default; - LocalJsonValue propHighlight = default; - LocalJsonValue propIndex = default; - LocalJsonValue propIndexingPressure = default; - LocalJsonValue propIndexingSlowlog = default; - LocalJsonValue propLifecycle = default; - LocalJsonValue propLoadFixedBitsetFiltersEagerly = default; - LocalJsonValue propMapping = default; - LocalJsonValue propMaxDocvalueFieldsSearch = default; - LocalJsonValue propMaxInnerResultWindow = default; - LocalJsonValue propMaxNgramDiff = default; - LocalJsonValue propMaxRefreshListeners = default; - LocalJsonValue propMaxRegexLength = default; - LocalJsonValue propMaxRescoreWindow = default; - LocalJsonValue propMaxResultWindow = default; - LocalJsonValue propMaxScriptFields = default; - LocalJsonValue propMaxShingleDiff = default; - LocalJsonValue propMaxSlicesPerScroll = default; - LocalJsonValue propMaxTermsCount = default; - LocalJsonValue propMerge = default; - LocalJsonValue propMode = default; - LocalJsonValue?> propNumberOfReplicas = default; - LocalJsonValue propNumberOfRoutingShards = default; - LocalJsonValue?> propNumberOfShards = default; - System.Collections.Generic.Dictionary? propOtherSettings = default; - LocalJsonValue?> propPriority = default; - LocalJsonValue propProvidedName = default; - LocalJsonValue propQueries = default; - LocalJsonValue propQueryString = default; - LocalJsonValue propRefreshInterval = default; - LocalJsonValue propRouting = default; - LocalJsonValue propRoutingPartitionSize = default; - LocalJsonValue?> propRoutingPath = default; - LocalJsonValue propSearch = default; - LocalJsonValue propSettings = default; - LocalJsonValue propSimilarity = default; - LocalJsonValue propSoftDeletes = default; - LocalJsonValue propSort = default; - LocalJsonValue propStore = default; - LocalJsonValue propTimeSeries = default; - LocalJsonValue propTopMetricsMaxSize = default; - LocalJsonValue propTranslog = default; - LocalJsonValue propUuid = default; - LocalJsonValue?> propVerifiedBeforeClose = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalysis.TryReadProperty(ref reader, options, PropAnalysis, null)) - { - continue; - } - - if (propAnalyze.TryReadProperty(ref reader, options, PropAnalyze, null)) - { - continue; - } - - if (propAutoExpandReplicas.TryReadProperty(ref reader, options, PropAutoExpandReplicas, null)) - { - continue; - } - - if (propBlocks.TryReadProperty(ref reader, options, PropBlocks, null)) - { - continue; - } - - if (propCheckOnStartup.TryReadProperty(ref reader, options, PropCheckOnStartup, static Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCodec.TryReadProperty(ref reader, options, PropCodec, null)) - { - continue; - } - - if (propCreationDate.TryReadProperty(ref reader, options, PropCreationDate, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propCreationDateString.TryReadProperty(ref reader, options, PropCreationDateString, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propDefaultPipeline.TryReadProperty(ref reader, options, PropDefaultPipeline, null)) - { - continue; - } - - if (propFinalPipeline.TryReadProperty(ref reader, options, PropFinalPipeline, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number), null, null))) - { - continue; - } - - if (propGcDeletes.TryReadProperty(ref reader, options, PropGcDeletes, null)) - { - continue; - } - - if (propHidden.TryReadProperty(ref reader, options, PropHidden, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) - { - continue; - } - - if (propHighlight.TryReadProperty(ref reader, options, PropHighlight, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propIndexingPressure.TryReadProperty(ref reader, options, PropIndexingPressure, null)) - { - continue; - } - - if (propIndexingSlowlog.TryReadProperty(ref reader, options, PropIndexingSlowlog, null)) - { - continue; - } - - if (propLifecycle.TryReadProperty(ref reader, options, PropLifecycle, null)) - { - continue; - } - - if (propLoadFixedBitsetFiltersEagerly.TryReadProperty(ref reader, options, PropLoadFixedBitsetFiltersEagerly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMapping.TryReadProperty(ref reader, options, PropMapping, null)) - { - continue; - } - - if (propMaxDocvalueFieldsSearch.TryReadProperty(ref reader, options, PropMaxDocvalueFieldsSearch, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxInnerResultWindow.TryReadProperty(ref reader, options, PropMaxInnerResultWindow, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxNgramDiff.TryReadProperty(ref reader, options, PropMaxNgramDiff, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxRefreshListeners.TryReadProperty(ref reader, options, PropMaxRefreshListeners, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxRegexLength.TryReadProperty(ref reader, options, PropMaxRegexLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxRescoreWindow.TryReadProperty(ref reader, options, PropMaxRescoreWindow, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxResultWindow.TryReadProperty(ref reader, options, PropMaxResultWindow, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxScriptFields.TryReadProperty(ref reader, options, PropMaxScriptFields, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxShingleDiff.TryReadProperty(ref reader, options, PropMaxShingleDiff, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxSlicesPerScroll.TryReadProperty(ref reader, options, PropMaxSlicesPerScroll, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxTermsCount.TryReadProperty(ref reader, options, PropMaxTermsCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMerge.TryReadProperty(ref reader, options, PropMerge, null)) - { - continue; - } - - if (propMode.TryReadProperty(ref reader, options, PropMode, null)) - { - continue; - } - - if (propNumberOfReplicas.TryReadProperty(ref reader, options, PropNumberOfReplicas, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) - { - continue; - } - - if (propNumberOfRoutingShards.TryReadProperty(ref reader, options, PropNumberOfRoutingShards, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNumberOfShards.TryReadProperty(ref reader, options, PropNumberOfShards, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) - { - continue; - } - - if (propPriority.TryReadProperty(ref reader, options, PropPriority, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) - { - continue; - } - - if (propProvidedName.TryReadProperty(ref reader, options, PropProvidedName, null)) - { - continue; - } - - if (propQueries.TryReadProperty(ref reader, options, PropQueries, null)) - { - continue; - } - - if (propQueryString.TryReadProperty(ref reader, options, PropQueryString, null)) - { - continue; - } - - if (propRefreshInterval.TryReadProperty(ref reader, options, PropRefreshInterval, null)) - { - continue; - } - - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (propRoutingPartitionSize.TryReadProperty(ref reader, options, PropRoutingPartitionSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRoutingPath.TryReadProperty(ref reader, options, PropRoutingPath, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propSearch.TryReadProperty(ref reader, options, PropSearch, null)) - { - continue; - } - - if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) - { - continue; - } - - if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, null)) - { - continue; - } - - if (propSoftDeletes.TryReadProperty(ref reader, options, PropSoftDeletes, null)) - { - continue; - } - - if (propSort.TryReadProperty(ref reader, options, PropSort, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, null)) - { - continue; - } - - if (propTimeSeries.TryReadProperty(ref reader, options, PropTimeSeries, null)) - { - continue; - } - - if (propTopMetricsMaxSize.TryReadProperty(ref reader, options, PropTopMetricsMaxSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTranslog.TryReadProperty(ref reader, options, PropTranslog, null)) - { - continue; - } - - if (propUuid.TryReadProperty(ref reader, options, PropUuid, null)) - { - continue; - } - - if (propVerifiedBeforeClose.TryReadProperty(ref reader, options, PropVerifiedBeforeClose, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - propOtherSettings ??= new System.Collections.Generic.Dictionary(); - reader.ReadProperty(options, out string key, out object value, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!); - propOtherSettings[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analysis = propAnalysis.Value, - Analyze = propAnalyze.Value, - AutoExpandReplicas = propAutoExpandReplicas.Value, - Blocks = propBlocks.Value, - CheckOnStartup = propCheckOnStartup.Value, - Codec = propCodec.Value, - CreationDate = propCreationDate.Value, - CreationDateString = propCreationDateString.Value, - DefaultPipeline = propDefaultPipeline.Value, - FinalPipeline = propFinalPipeline.Value, - Format = propFormat.Value, - GcDeletes = propGcDeletes.Value, - Hidden = propHidden.Value, - Highlight = propHighlight.Value, - Index = propIndex.Value, - IndexingPressure = propIndexingPressure.Value, - IndexingSlowlog = propIndexingSlowlog.Value, - Lifecycle = propLifecycle.Value, - LoadFixedBitsetFiltersEagerly = propLoadFixedBitsetFiltersEagerly.Value, - Mapping = propMapping.Value, - MaxDocvalueFieldsSearch = propMaxDocvalueFieldsSearch.Value, - MaxInnerResultWindow = propMaxInnerResultWindow.Value, - MaxNgramDiff = propMaxNgramDiff.Value, - MaxRefreshListeners = propMaxRefreshListeners.Value, - MaxRegexLength = propMaxRegexLength.Value, - MaxRescoreWindow = propMaxRescoreWindow.Value, - MaxResultWindow = propMaxResultWindow.Value, - MaxScriptFields = propMaxScriptFields.Value, - MaxShingleDiff = propMaxShingleDiff.Value, - MaxSlicesPerScroll = propMaxSlicesPerScroll.Value, - MaxTermsCount = propMaxTermsCount.Value, - Merge = propMerge.Value, - Mode = propMode.Value, - NumberOfReplicas = propNumberOfReplicas.Value, - NumberOfRoutingShards = propNumberOfRoutingShards.Value, - NumberOfShards = propNumberOfShards.Value, - OtherSettings = propOtherSettings, - Priority = propPriority.Value, - ProvidedName = propProvidedName.Value, - Queries = propQueries.Value, - QueryString = propQueryString.Value, - RefreshInterval = propRefreshInterval.Value, - Routing = propRouting.Value, - RoutingPartitionSize = propRoutingPartitionSize.Value, - RoutingPath = propRoutingPath.Value, - Search = propSearch.Value, - Settings = propSettings.Value, - Similarity = propSimilarity.Value, - SoftDeletes = propSoftDeletes.Value, - Sort = propSort.Value, - Store = propStore.Value, - TimeSeries = propTimeSeries.Value, - TopMetricsMaxSize = propTopMetricsMaxSize.Value, - Translog = propTranslog.Value, - Uuid = propUuid.Value, - VerifiedBeforeClose = propVerifiedBeforeClose.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalysis, value.Analysis, null, null); - writer.WriteProperty(options, PropAnalyze, value.Analyze, null, null); - writer.WriteProperty(options, PropAutoExpandReplicas, value.AutoExpandReplicas, null, null); - writer.WriteProperty(options, PropBlocks, value.Blocks, null, null); - writer.WriteProperty(options, PropCheckOnStartup, value.CheckOnStartup, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.IndexManagement.IndexCheckOnStartup? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCodec, value.Codec, null, null); - writer.WriteProperty(options, PropCreationDate, value.CreationDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropCreationDateString, value.CreationDateString, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropDefaultPipeline, value.DefaultPipeline, null, null); - writer.WriteProperty(options, PropFinalPipeline, value.FinalPipeline, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); - writer.WriteProperty(options, PropGcDeletes, value.GcDeletes, null, null); - writer.WriteProperty(options, PropHidden, value.Hidden, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); - writer.WriteProperty(options, PropHighlight, value.Highlight, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropIndexingPressure, value.IndexingPressure, null, null); - writer.WriteProperty(options, PropIndexingSlowlog, value.IndexingSlowlog, null, null); - writer.WriteProperty(options, PropLifecycle, value.Lifecycle, null, null); - writer.WriteProperty(options, PropLoadFixedBitsetFiltersEagerly, value.LoadFixedBitsetFiltersEagerly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMapping, value.Mapping, null, null); - writer.WriteProperty(options, PropMaxDocvalueFieldsSearch, value.MaxDocvalueFieldsSearch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxInnerResultWindow, value.MaxInnerResultWindow, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxNgramDiff, value.MaxNgramDiff, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxRefreshListeners, value.MaxRefreshListeners, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxRegexLength, value.MaxRegexLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxRescoreWindow, value.MaxRescoreWindow, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxResultWindow, value.MaxResultWindow, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxScriptFields, value.MaxScriptFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxShingleDiff, value.MaxShingleDiff, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxSlicesPerScroll, value.MaxSlicesPerScroll, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxTermsCount, value.MaxTermsCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMerge, value.Merge, null, null); - writer.WriteProperty(options, PropMode, value.Mode, null, null); - writer.WriteProperty(options, PropNumberOfReplicas, value.NumberOfReplicas, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); - writer.WriteProperty(options, PropNumberOfRoutingShards, value.NumberOfRoutingShards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNumberOfShards, value.NumberOfShards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); - writer.WriteProperty(options, PropPriority, value.Priority, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); - writer.WriteProperty(options, PropProvidedName, value.ProvidedName, null, null); - writer.WriteProperty(options, PropQueries, value.Queries, null, null); - writer.WriteProperty(options, PropQueryString, value.QueryString, null, null); - writer.WriteProperty(options, PropRefreshInterval, value.RefreshInterval, null, null); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteProperty(options, PropRoutingPartitionSize, value.RoutingPartitionSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRoutingPath, value.RoutingPath, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSearch, value.Search, null, null); - writer.WriteProperty(options, PropSettings, value.Settings, null, null); - writer.WriteProperty(options, PropSimilarity, value.Similarity, null, null); - writer.WriteProperty(options, PropSoftDeletes, value.SoftDeletes, null, null); - writer.WriteProperty(options, PropSort, value.Sort, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, null); - writer.WriteProperty(options, PropTimeSeries, value.TimeSeries, null, null); - writer.WriteProperty(options, PropTopMetricsMaxSize, value.TopMetricsMaxSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTranslog, value.Translog, null, null); - writer.WriteProperty(options, PropUuid, value.Uuid, null, null); - writer.WriteProperty(options, PropVerifiedBeforeClose, value.VerifiedBeforeClose, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - if (value.OtherSettings is not null) - { - foreach (var item in value.OtherSettings) - { - writer.WriteProperty(options, item.Key, item.Value, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - } - } - - writer.WriteEndObject(); - } -} - /// /// Learn more about this API in the Elasticsearch documentation. /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexSettingsConverter))] public sealed partial class IndexSettings { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsAnalysis.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsAnalysis.Converters.g.cs new file mode 100644 index 00000000000..004244a5ebb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsAnalysis.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexSettingsAnalysisConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzers = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropCharFilters = System.Text.Json.JsonEncodedText.Encode("char_filter"); + private static readonly System.Text.Json.JsonEncodedText PropNormalizers = System.Text.Json.JsonEncodedText.Encode("normalizer"); + private static readonly System.Text.Json.JsonEncodedText PropTokenFilters = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropTokenizers = System.Text.Json.JsonEncodedText.Encode("tokenizer"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysis Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzers = default; + LocalJsonValue propCharFilters = default; + LocalJsonValue propNormalizers = default; + LocalJsonValue propTokenFilters = default; + LocalJsonValue propTokenizers = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzers.TryReadProperty(ref reader, options, PropAnalyzers, null)) + { + continue; + } + + if (propCharFilters.TryReadProperty(ref reader, options, PropCharFilters, null)) + { + continue; + } + + if (propNormalizers.TryReadProperty(ref reader, options, PropNormalizers, null)) + { + continue; + } + + if (propTokenFilters.TryReadProperty(ref reader, options, PropTokenFilters, null)) + { + continue; + } + + if (propTokenizers.TryReadProperty(ref reader, options, PropTokenizers, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysis(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analyzers = propAnalyzers.Value, + CharFilters = propCharFilters.Value, + Normalizers = propNormalizers.Value, + TokenFilters = propTokenFilters.Value, + Tokenizers = propTokenizers.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysis value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzers, value.Analyzers, null, null); + writer.WriteProperty(options, PropCharFilters, value.CharFilters, null, null); + writer.WriteProperty(options, PropNormalizers, value.Normalizers, null, null); + writer.WriteProperty(options, PropTokenFilters, value.TokenFilters, null, null); + writer.WriteProperty(options, PropTokenizers, value.Tokenizers, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsAnalysis.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsAnalysis.g.cs index a851186dff5..10c766ea7d7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsAnalysis.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsAnalysis.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexSettingsAnalysisConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzers = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropCharFilters = System.Text.Json.JsonEncodedText.Encode("char_filter"); - private static readonly System.Text.Json.JsonEncodedText PropNormalizers = System.Text.Json.JsonEncodedText.Encode("normalizer"); - private static readonly System.Text.Json.JsonEncodedText PropTokenFilters = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropTokenizers = System.Text.Json.JsonEncodedText.Encode("tokenizer"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysis Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyzers = default; - LocalJsonValue propCharFilters = default; - LocalJsonValue propNormalizers = default; - LocalJsonValue propTokenFilters = default; - LocalJsonValue propTokenizers = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzers.TryReadProperty(ref reader, options, PropAnalyzers, null)) - { - continue; - } - - if (propCharFilters.TryReadProperty(ref reader, options, PropCharFilters, null)) - { - continue; - } - - if (propNormalizers.TryReadProperty(ref reader, options, PropNormalizers, null)) - { - continue; - } - - if (propTokenFilters.TryReadProperty(ref reader, options, PropTokenFilters, null)) - { - continue; - } - - if (propTokenizers.TryReadProperty(ref reader, options, PropTokenizers, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysis(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analyzers = propAnalyzers.Value, - CharFilters = propCharFilters.Value, - Normalizers = propNormalizers.Value, - TokenFilters = propTokenFilters.Value, - Tokenizers = propTokenizers.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysis value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzers, value.Analyzers, null, null); - writer.WriteProperty(options, PropCharFilters, value.CharFilters, null, null); - writer.WriteProperty(options, PropNormalizers, value.Normalizers, null, null); - writer.WriteProperty(options, PropTokenFilters, value.TokenFilters, null, null); - writer.WriteProperty(options, PropTokenizers, value.Tokenizers, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsAnalysisConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexSettingsAnalysisConverter))] public sealed partial class IndexSettingsAnalysis { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsLifecycle.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsLifecycle.Converters.g.cs new file mode 100644 index 00000000000..d1779d7619b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsLifecycle.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexSettingsLifecycleConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndexingComplete = System.Text.Json.JsonEncodedText.Encode("indexing_complete"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropOriginationDate = System.Text.Json.JsonEncodedText.Encode("origination_date"); + private static readonly System.Text.Json.JsonEncodedText PropParseOriginationDate = System.Text.Json.JsonEncodedText.Encode("parse_origination_date"); + private static readonly System.Text.Json.JsonEncodedText PropPreferIlm = System.Text.Json.JsonEncodedText.Encode("prefer_ilm"); + private static readonly System.Text.Json.JsonEncodedText PropRolloverAlias = System.Text.Json.JsonEncodedText.Encode("rollover_alias"); + private static readonly System.Text.Json.JsonEncodedText PropStep = System.Text.Json.JsonEncodedText.Encode("step"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycle Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndexingComplete = default; + LocalJsonValue propName = default; + LocalJsonValue propOriginationDate = default; + LocalJsonValue propParseOriginationDate = default; + LocalJsonValue?> propPreferIlm = default; + LocalJsonValue propRolloverAlias = default; + LocalJsonValue propStep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndexingComplete.TryReadProperty(ref reader, options, PropIndexingComplete, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propOriginationDate.TryReadProperty(ref reader, options, PropOriginationDate, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propParseOriginationDate.TryReadProperty(ref reader, options, PropParseOriginationDate, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPreferIlm.TryReadProperty(ref reader, options, PropPreferIlm, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) + { + continue; + } + + if (propRolloverAlias.TryReadProperty(ref reader, options, PropRolloverAlias, null)) + { + continue; + } + + if (propStep.TryReadProperty(ref reader, options, PropStep, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycle(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + IndexingComplete = propIndexingComplete.Value, + Name = propName.Value, + OriginationDate = propOriginationDate.Value, + ParseOriginationDate = propParseOriginationDate.Value, + PreferIlm = propPreferIlm.Value, + RolloverAlias = propRolloverAlias.Value, + Step = propStep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycle value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndexingComplete, value.IndexingComplete, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropOriginationDate, value.OriginationDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropParseOriginationDate, value.ParseOriginationDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPreferIlm, value.PreferIlm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); + writer.WriteProperty(options, PropRolloverAlias, value.RolloverAlias, null, null); + writer.WriteProperty(options, PropStep, value.Step, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsLifecycle.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsLifecycle.g.cs index 6b3a0ee38c6..ffdaa9477a3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsLifecycle.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsLifecycle.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexSettingsLifecycleConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndexingComplete = System.Text.Json.JsonEncodedText.Encode("indexing_complete"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropOriginationDate = System.Text.Json.JsonEncodedText.Encode("origination_date"); - private static readonly System.Text.Json.JsonEncodedText PropParseOriginationDate = System.Text.Json.JsonEncodedText.Encode("parse_origination_date"); - private static readonly System.Text.Json.JsonEncodedText PropPreferIlm = System.Text.Json.JsonEncodedText.Encode("prefer_ilm"); - private static readonly System.Text.Json.JsonEncodedText PropRolloverAlias = System.Text.Json.JsonEncodedText.Encode("rollover_alias"); - private static readonly System.Text.Json.JsonEncodedText PropStep = System.Text.Json.JsonEncodedText.Encode("step"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycle Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndexingComplete = default; - LocalJsonValue propName = default; - LocalJsonValue propOriginationDate = default; - LocalJsonValue propParseOriginationDate = default; - LocalJsonValue?> propPreferIlm = default; - LocalJsonValue propRolloverAlias = default; - LocalJsonValue propStep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndexingComplete.TryReadProperty(ref reader, options, PropIndexingComplete, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propOriginationDate.TryReadProperty(ref reader, options, PropOriginationDate, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propParseOriginationDate.TryReadProperty(ref reader, options, PropParseOriginationDate, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPreferIlm.TryReadProperty(ref reader, options, PropPreferIlm, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) - { - continue; - } - - if (propRolloverAlias.TryReadProperty(ref reader, options, PropRolloverAlias, null)) - { - continue; - } - - if (propStep.TryReadProperty(ref reader, options, PropStep, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycle(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - IndexingComplete = propIndexingComplete.Value, - Name = propName.Value, - OriginationDate = propOriginationDate.Value, - ParseOriginationDate = propParseOriginationDate.Value, - PreferIlm = propPreferIlm.Value, - RolloverAlias = propRolloverAlias.Value, - Step = propStep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycle value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndexingComplete, value.IndexingComplete, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropOriginationDate, value.OriginationDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropParseOriginationDate, value.ParseOriginationDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPreferIlm, value.PreferIlm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); - writer.WriteProperty(options, PropRolloverAlias, value.RolloverAlias, null, null); - writer.WriteProperty(options, PropStep, value.Step, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycleConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexSettingsLifecycleConverter))] public sealed partial class IndexSettingsLifecycle { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsLifecycleStep.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsLifecycleStep.Converters.g.cs new file mode 100644 index 00000000000..c3e4ddc21cb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsLifecycleStep.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexSettingsLifecycleStepConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropWaitTimeThreshold = System.Text.Json.JsonEncodedText.Encode("wait_time_threshold"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycleStep Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propWaitTimeThreshold = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propWaitTimeThreshold.TryReadProperty(ref reader, options, PropWaitTimeThreshold, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycleStep(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + WaitTimeThreshold = propWaitTimeThreshold.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycleStep value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropWaitTimeThreshold, value.WaitTimeThreshold, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsLifecycleStep.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsLifecycleStep.g.cs index a8cbab2469c..1a92e5412b9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsLifecycleStep.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsLifecycleStep.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexSettingsLifecycleStepConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropWaitTimeThreshold = System.Text.Json.JsonEncodedText.Encode("wait_time_threshold"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycleStep Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propWaitTimeThreshold = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propWaitTimeThreshold.TryReadProperty(ref reader, options, PropWaitTimeThreshold, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycleStep(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - WaitTimeThreshold = propWaitTimeThreshold.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycleStep value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropWaitTimeThreshold, value.WaitTimeThreshold, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsLifecycleStepConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexSettingsLifecycleStepConverter))] public sealed partial class IndexSettingsLifecycleStep { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsTimeSeries.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsTimeSeries.Converters.g.cs new file mode 100644 index 00000000000..99cf61b960c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsTimeSeries.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexSettingsTimeSeriesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEndTime = System.Text.Json.JsonEncodedText.Encode("end_time"); + private static readonly System.Text.Json.JsonEncodedText PropStartTime = System.Text.Json.JsonEncodedText.Encode("start_time"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsTimeSeries Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEndTime = default; + LocalJsonValue propStartTime = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEndTime.TryReadProperty(ref reader, options, PropEndTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propStartTime.TryReadProperty(ref reader, options, PropStartTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsTimeSeries(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + EndTime = propEndTime.Value, + StartTime = propStartTime.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsTimeSeries value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEndTime, value.EndTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropStartTime, value.StartTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsTimeSeries.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsTimeSeries.g.cs index 6311f963cba..6f36206b966 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsTimeSeries.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSettingsTimeSeries.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexSettingsTimeSeriesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEndTime = System.Text.Json.JsonEncodedText.Encode("end_time"); - private static readonly System.Text.Json.JsonEncodedText PropStartTime = System.Text.Json.JsonEncodedText.Encode("start_time"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsTimeSeries Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEndTime = default; - LocalJsonValue propStartTime = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEndTime.TryReadProperty(ref reader, options, PropEndTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propStartTime.TryReadProperty(ref reader, options, PropStartTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsTimeSeries(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - EndTime = propEndTime.Value, - StartTime = propStartTime.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsTimeSeries value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEndTime, value.EndTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropStartTime, value.StartTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexSettingsTimeSeriesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexSettingsTimeSeriesConverter))] public sealed partial class IndexSettingsTimeSeries { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexState.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexState.Converters.g.cs new file mode 100644 index 00000000000..f4224e10240 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexState.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexStateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); + private static readonly System.Text.Json.JsonEncodedText PropDataStream = System.Text.Json.JsonEncodedText.Encode("data_stream"); + private static readonly System.Text.Json.JsonEncodedText PropDefaults = System.Text.Json.JsonEncodedText.Encode("defaults"); + private static readonly System.Text.Json.JsonEncodedText PropLifecycle = System.Text.Json.JsonEncodedText.Encode("lifecycle"); + private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAliases = default; + LocalJsonValue propDataStream = default; + LocalJsonValue propDefaults = default; + LocalJsonValue propLifecycle = default; + LocalJsonValue propMappings = default; + LocalJsonValue propSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propDataStream.TryReadProperty(ref reader, options, PropDataStream, null)) + { + continue; + } + + if (propDefaults.TryReadProperty(ref reader, options, PropDefaults, null)) + { + continue; + } + + if (propLifecycle.TryReadProperty(ref reader, options, PropLifecycle, null)) + { + continue; + } + + if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) + { + continue; + } + + if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexState(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aliases = propAliases.Value, + DataStream = propDataStream.Value, + Defaults = propDefaults.Value, + Lifecycle = propLifecycle.Value, + Mappings = propMappings.Value, + Settings = propSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexState value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropDataStream, value.DataStream, null, null); + writer.WriteProperty(options, PropDefaults, value.Defaults, null, null); + writer.WriteProperty(options, PropLifecycle, value.Lifecycle, null, null); + writer.WriteProperty(options, PropMappings, value.Mappings, null, null); + writer.WriteProperty(options, PropSettings, value.Settings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexState.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexState.g.cs index 0da1912a5bc..d923dd9cb5c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexState.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexState.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexStateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); - private static readonly System.Text.Json.JsonEncodedText PropDataStream = System.Text.Json.JsonEncodedText.Encode("data_stream"); - private static readonly System.Text.Json.JsonEncodedText PropDefaults = System.Text.Json.JsonEncodedText.Encode("defaults"); - private static readonly System.Text.Json.JsonEncodedText PropLifecycle = System.Text.Json.JsonEncodedText.Encode("lifecycle"); - private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAliases = default; - LocalJsonValue propDataStream = default; - LocalJsonValue propDefaults = default; - LocalJsonValue propLifecycle = default; - LocalJsonValue propMappings = default; - LocalJsonValue propSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propDataStream.TryReadProperty(ref reader, options, PropDataStream, null)) - { - continue; - } - - if (propDefaults.TryReadProperty(ref reader, options, PropDefaults, null)) - { - continue; - } - - if (propLifecycle.TryReadProperty(ref reader, options, PropLifecycle, null)) - { - continue; - } - - if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) - { - continue; - } - - if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexState(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aliases = propAliases.Value, - DataStream = propDataStream.Value, - Defaults = propDefaults.Value, - Lifecycle = propLifecycle.Value, - Mappings = propMappings.Value, - Settings = propSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexState value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropDataStream, value.DataStream, null, null); - writer.WriteProperty(options, PropDefaults, value.Defaults, null, null); - writer.WriteProperty(options, PropLifecycle, value.Lifecycle, null, null); - writer.WriteProperty(options, PropMappings, value.Mappings, null, null); - writer.WriteProperty(options, PropSettings, value.Settings, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexStateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexStateConverter))] public sealed partial class IndexState { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexStats.Converters.g.cs new file mode 100644 index 00000000000..75797e67961 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexStats.Converters.g.cs @@ -0,0 +1,225 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBulk = System.Text.Json.JsonEncodedText.Encode("bulk"); + private static readonly System.Text.Json.JsonEncodedText PropCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); + private static readonly System.Text.Json.JsonEncodedText PropFielddata = System.Text.Json.JsonEncodedText.Encode("fielddata"); + private static readonly System.Text.Json.JsonEncodedText PropFlush = System.Text.Json.JsonEncodedText.Encode("flush"); + private static readonly System.Text.Json.JsonEncodedText PropGet = System.Text.Json.JsonEncodedText.Encode("get"); + private static readonly System.Text.Json.JsonEncodedText PropIndexing = System.Text.Json.JsonEncodedText.Encode("indexing"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropMerges = System.Text.Json.JsonEncodedText.Encode("merges"); + private static readonly System.Text.Json.JsonEncodedText PropQueryCache = System.Text.Json.JsonEncodedText.Encode("query_cache"); + private static readonly System.Text.Json.JsonEncodedText PropRecovery = System.Text.Json.JsonEncodedText.Encode("recovery"); + private static readonly System.Text.Json.JsonEncodedText PropRefresh = System.Text.Json.JsonEncodedText.Encode("refresh"); + private static readonly System.Text.Json.JsonEncodedText PropRequestCache = System.Text.Json.JsonEncodedText.Encode("request_cache"); + private static readonly System.Text.Json.JsonEncodedText PropSearch = System.Text.Json.JsonEncodedText.Encode("search"); + private static readonly System.Text.Json.JsonEncodedText PropSegments = System.Text.Json.JsonEncodedText.Encode("segments"); + private static readonly System.Text.Json.JsonEncodedText PropShardStats = System.Text.Json.JsonEncodedText.Encode("shard_stats"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropTranslog = System.Text.Json.JsonEncodedText.Encode("translog"); + private static readonly System.Text.Json.JsonEncodedText PropWarmer = System.Text.Json.JsonEncodedText.Encode("warmer"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBulk = default; + LocalJsonValue propCompletion = default; + LocalJsonValue propDocs = default; + LocalJsonValue propFielddata = default; + LocalJsonValue propFlush = default; + LocalJsonValue propGet = default; + LocalJsonValue propIndexing = default; + LocalJsonValue propIndices = default; + LocalJsonValue propMerges = default; + LocalJsonValue propQueryCache = default; + LocalJsonValue propRecovery = default; + LocalJsonValue propRefresh = default; + LocalJsonValue propRequestCache = default; + LocalJsonValue propSearch = default; + LocalJsonValue propSegments = default; + LocalJsonValue propShardStats = default; + LocalJsonValue propStore = default; + LocalJsonValue propTranslog = default; + LocalJsonValue propWarmer = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBulk.TryReadProperty(ref reader, options, PropBulk, null)) + { + continue; + } + + if (propCompletion.TryReadProperty(ref reader, options, PropCompletion, null)) + { + continue; + } + + if (propDocs.TryReadProperty(ref reader, options, PropDocs, null)) + { + continue; + } + + if (propFielddata.TryReadProperty(ref reader, options, PropFielddata, null)) + { + continue; + } + + if (propFlush.TryReadProperty(ref reader, options, PropFlush, null)) + { + continue; + } + + if (propGet.TryReadProperty(ref reader, options, PropGet, null)) + { + continue; + } + + if (propIndexing.TryReadProperty(ref reader, options, PropIndexing, null)) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) + { + continue; + } + + if (propMerges.TryReadProperty(ref reader, options, PropMerges, null)) + { + continue; + } + + if (propQueryCache.TryReadProperty(ref reader, options, PropQueryCache, null)) + { + continue; + } + + if (propRecovery.TryReadProperty(ref reader, options, PropRecovery, null)) + { + continue; + } + + if (propRefresh.TryReadProperty(ref reader, options, PropRefresh, null)) + { + continue; + } + + if (propRequestCache.TryReadProperty(ref reader, options, PropRequestCache, null)) + { + continue; + } + + if (propSearch.TryReadProperty(ref reader, options, PropSearch, null)) + { + continue; + } + + if (propSegments.TryReadProperty(ref reader, options, PropSegments, null)) + { + continue; + } + + if (propShardStats.TryReadProperty(ref reader, options, PropShardStats, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, null)) + { + continue; + } + + if (propTranslog.TryReadProperty(ref reader, options, PropTranslog, null)) + { + continue; + } + + if (propWarmer.TryReadProperty(ref reader, options, PropWarmer, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Bulk = propBulk.Value, + Completion = propCompletion.Value, + Docs = propDocs.Value, + Fielddata = propFielddata.Value, + Flush = propFlush.Value, + Get = propGet.Value, + Indexing = propIndexing.Value, + Indices = propIndices.Value, + Merges = propMerges.Value, + QueryCache = propQueryCache.Value, + Recovery = propRecovery.Value, + Refresh = propRefresh.Value, + RequestCache = propRequestCache.Value, + Search = propSearch.Value, + Segments = propSegments.Value, + ShardStats = propShardStats.Value, + Store = propStore.Value, + Translog = propTranslog.Value, + Warmer = propWarmer.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBulk, value.Bulk, null, null); + writer.WriteProperty(options, PropCompletion, value.Completion, null, null); + writer.WriteProperty(options, PropDocs, value.Docs, null, null); + writer.WriteProperty(options, PropFielddata, value.Fielddata, null, null); + writer.WriteProperty(options, PropFlush, value.Flush, null, null); + writer.WriteProperty(options, PropGet, value.Get, null, null); + writer.WriteProperty(options, PropIndexing, value.Indexing, null, null); + writer.WriteProperty(options, PropIndices, value.Indices, null, null); + writer.WriteProperty(options, PropMerges, value.Merges, null, null); + writer.WriteProperty(options, PropQueryCache, value.QueryCache, null, null); + writer.WriteProperty(options, PropRecovery, value.Recovery, null, null); + writer.WriteProperty(options, PropRefresh, value.Refresh, null, null); + writer.WriteProperty(options, PropRequestCache, value.RequestCache, null, null); + writer.WriteProperty(options, PropSearch, value.Search, null, null); + writer.WriteProperty(options, PropSegments, value.Segments, null, null); + writer.WriteProperty(options, PropShardStats, value.ShardStats, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, null); + writer.WriteProperty(options, PropTranslog, value.Translog, null, null); + writer.WriteProperty(options, PropWarmer, value.Warmer, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexStats.g.cs index 7d0fddc2387..4fd39c3e756 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexStats.g.cs @@ -23,208 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBulk = System.Text.Json.JsonEncodedText.Encode("bulk"); - private static readonly System.Text.Json.JsonEncodedText PropCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); - private static readonly System.Text.Json.JsonEncodedText PropFielddata = System.Text.Json.JsonEncodedText.Encode("fielddata"); - private static readonly System.Text.Json.JsonEncodedText PropFlush = System.Text.Json.JsonEncodedText.Encode("flush"); - private static readonly System.Text.Json.JsonEncodedText PropGet = System.Text.Json.JsonEncodedText.Encode("get"); - private static readonly System.Text.Json.JsonEncodedText PropIndexing = System.Text.Json.JsonEncodedText.Encode("indexing"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropMerges = System.Text.Json.JsonEncodedText.Encode("merges"); - private static readonly System.Text.Json.JsonEncodedText PropQueryCache = System.Text.Json.JsonEncodedText.Encode("query_cache"); - private static readonly System.Text.Json.JsonEncodedText PropRecovery = System.Text.Json.JsonEncodedText.Encode("recovery"); - private static readonly System.Text.Json.JsonEncodedText PropRefresh = System.Text.Json.JsonEncodedText.Encode("refresh"); - private static readonly System.Text.Json.JsonEncodedText PropRequestCache = System.Text.Json.JsonEncodedText.Encode("request_cache"); - private static readonly System.Text.Json.JsonEncodedText PropSearch = System.Text.Json.JsonEncodedText.Encode("search"); - private static readonly System.Text.Json.JsonEncodedText PropSegments = System.Text.Json.JsonEncodedText.Encode("segments"); - private static readonly System.Text.Json.JsonEncodedText PropShardStats = System.Text.Json.JsonEncodedText.Encode("shard_stats"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropTranslog = System.Text.Json.JsonEncodedText.Encode("translog"); - private static readonly System.Text.Json.JsonEncodedText PropWarmer = System.Text.Json.JsonEncodedText.Encode("warmer"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBulk = default; - LocalJsonValue propCompletion = default; - LocalJsonValue propDocs = default; - LocalJsonValue propFielddata = default; - LocalJsonValue propFlush = default; - LocalJsonValue propGet = default; - LocalJsonValue propIndexing = default; - LocalJsonValue propIndices = default; - LocalJsonValue propMerges = default; - LocalJsonValue propQueryCache = default; - LocalJsonValue propRecovery = default; - LocalJsonValue propRefresh = default; - LocalJsonValue propRequestCache = default; - LocalJsonValue propSearch = default; - LocalJsonValue propSegments = default; - LocalJsonValue propShardStats = default; - LocalJsonValue propStore = default; - LocalJsonValue propTranslog = default; - LocalJsonValue propWarmer = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBulk.TryReadProperty(ref reader, options, PropBulk, null)) - { - continue; - } - - if (propCompletion.TryReadProperty(ref reader, options, PropCompletion, null)) - { - continue; - } - - if (propDocs.TryReadProperty(ref reader, options, PropDocs, null)) - { - continue; - } - - if (propFielddata.TryReadProperty(ref reader, options, PropFielddata, null)) - { - continue; - } - - if (propFlush.TryReadProperty(ref reader, options, PropFlush, null)) - { - continue; - } - - if (propGet.TryReadProperty(ref reader, options, PropGet, null)) - { - continue; - } - - if (propIndexing.TryReadProperty(ref reader, options, PropIndexing, null)) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) - { - continue; - } - - if (propMerges.TryReadProperty(ref reader, options, PropMerges, null)) - { - continue; - } - - if (propQueryCache.TryReadProperty(ref reader, options, PropQueryCache, null)) - { - continue; - } - - if (propRecovery.TryReadProperty(ref reader, options, PropRecovery, null)) - { - continue; - } - - if (propRefresh.TryReadProperty(ref reader, options, PropRefresh, null)) - { - continue; - } - - if (propRequestCache.TryReadProperty(ref reader, options, PropRequestCache, null)) - { - continue; - } - - if (propSearch.TryReadProperty(ref reader, options, PropSearch, null)) - { - continue; - } - - if (propSegments.TryReadProperty(ref reader, options, PropSegments, null)) - { - continue; - } - - if (propShardStats.TryReadProperty(ref reader, options, PropShardStats, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, null)) - { - continue; - } - - if (propTranslog.TryReadProperty(ref reader, options, PropTranslog, null)) - { - continue; - } - - if (propWarmer.TryReadProperty(ref reader, options, PropWarmer, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Bulk = propBulk.Value, - Completion = propCompletion.Value, - Docs = propDocs.Value, - Fielddata = propFielddata.Value, - Flush = propFlush.Value, - Get = propGet.Value, - Indexing = propIndexing.Value, - Indices = propIndices.Value, - Merges = propMerges.Value, - QueryCache = propQueryCache.Value, - Recovery = propRecovery.Value, - Refresh = propRefresh.Value, - RequestCache = propRequestCache.Value, - Search = propSearch.Value, - Segments = propSegments.Value, - ShardStats = propShardStats.Value, - Store = propStore.Value, - Translog = propTranslog.Value, - Warmer = propWarmer.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBulk, value.Bulk, null, null); - writer.WriteProperty(options, PropCompletion, value.Completion, null, null); - writer.WriteProperty(options, PropDocs, value.Docs, null, null); - writer.WriteProperty(options, PropFielddata, value.Fielddata, null, null); - writer.WriteProperty(options, PropFlush, value.Flush, null, null); - writer.WriteProperty(options, PropGet, value.Get, null, null); - writer.WriteProperty(options, PropIndexing, value.Indexing, null, null); - writer.WriteProperty(options, PropIndices, value.Indices, null, null); - writer.WriteProperty(options, PropMerges, value.Merges, null, null); - writer.WriteProperty(options, PropQueryCache, value.QueryCache, null, null); - writer.WriteProperty(options, PropRecovery, value.Recovery, null, null); - writer.WriteProperty(options, PropRefresh, value.Refresh, null, null); - writer.WriteProperty(options, PropRequestCache, value.RequestCache, null, null); - writer.WriteProperty(options, PropSearch, value.Search, null, null); - writer.WriteProperty(options, PropSegments, value.Segments, null, null); - writer.WriteProperty(options, PropShardStats, value.ShardStats, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, null); - writer.WriteProperty(options, PropTranslog, value.Translog, null, null); - writer.WriteProperty(options, PropWarmer, value.Warmer, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexStatsConverter))] public sealed partial class IndexStats { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplate.Converters.g.cs new file mode 100644 index 00000000000..658c27995a0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplate.Converters.g.cs @@ -0,0 +1,180 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexTemplateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowAutoCreate = System.Text.Json.JsonEncodedText.Encode("allow_auto_create"); + private static readonly System.Text.Json.JsonEncodedText PropComposedOf = System.Text.Json.JsonEncodedText.Encode("composed_of"); + private static readonly System.Text.Json.JsonEncodedText PropCreatedDate = System.Text.Json.JsonEncodedText.Encode("created_date"); + private static readonly System.Text.Json.JsonEncodedText PropCreatedDateMillis = System.Text.Json.JsonEncodedText.Encode("created_date_millis"); + private static readonly System.Text.Json.JsonEncodedText PropDataStream = System.Text.Json.JsonEncodedText.Encode("data_stream"); + private static readonly System.Text.Json.JsonEncodedText PropDeprecated = System.Text.Json.JsonEncodedText.Encode("deprecated"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissingComponentTemplates = System.Text.Json.JsonEncodedText.Encode("ignore_missing_component_templates"); + private static readonly System.Text.Json.JsonEncodedText PropIndexPatterns = System.Text.Json.JsonEncodedText.Encode("index_patterns"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); + private static readonly System.Text.Json.JsonEncodedText PropModifiedDate = System.Text.Json.JsonEncodedText.Encode("modified_date"); + private static readonly System.Text.Json.JsonEncodedText PropModifiedDateMillis = System.Text.Json.JsonEncodedText.Encode("modified_date_millis"); + private static readonly System.Text.Json.JsonEncodedText PropPriority = System.Text.Json.JsonEncodedText.Encode("priority"); + private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowAutoCreate = default; + LocalJsonValue> propComposedOf = default; + LocalJsonValue propCreatedDate = default; + LocalJsonValue propCreatedDateMillis = default; + LocalJsonValue propDataStream = default; + LocalJsonValue propDeprecated = default; + LocalJsonValue propIgnoreMissingComponentTemplates = default; + LocalJsonValue propIndexPatterns = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propModifiedDate = default; + LocalJsonValue propModifiedDateMillis = default; + LocalJsonValue propPriority = default; + LocalJsonValue propTemplate = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowAutoCreate.TryReadProperty(ref reader, options, PropAllowAutoCreate, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propComposedOf.TryReadProperty(ref reader, options, PropComposedOf, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propCreatedDate.TryReadProperty(ref reader, options, PropCreatedDate, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propCreatedDateMillis.TryReadProperty(ref reader, options, PropCreatedDateMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propDataStream.TryReadProperty(ref reader, options, PropDataStream, null)) + { + continue; + } + + if (propDeprecated.TryReadProperty(ref reader, options, PropDeprecated, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissingComponentTemplates.TryReadProperty(ref reader, options, PropIgnoreMissingComponentTemplates, null)) + { + continue; + } + + if (propIndexPatterns.TryReadProperty(ref reader, options, PropIndexPatterns, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propModifiedDate.TryReadProperty(ref reader, options, PropModifiedDate, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propModifiedDateMillis.TryReadProperty(ref reader, options, PropModifiedDateMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propPriority.TryReadProperty(ref reader, options, PropPriority, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowAutoCreate = propAllowAutoCreate.Value, + ComposedOf = propComposedOf.Value, + CreatedDate = propCreatedDate.Value, + CreatedDateMillis = propCreatedDateMillis.Value, + DataStream = propDataStream.Value, + Deprecated = propDeprecated.Value, + IgnoreMissingComponentTemplates = propIgnoreMissingComponentTemplates.Value, + IndexPatterns = propIndexPatterns.Value, + Meta = propMeta.Value, + ModifiedDate = propModifiedDate.Value, + ModifiedDateMillis = propModifiedDateMillis.Value, + Priority = propPriority.Value, + Template = propTemplate.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowAutoCreate, value.AllowAutoCreate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropComposedOf, value.ComposedOf, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCreatedDate, value.CreatedDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropCreatedDateMillis, value.CreatedDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropDataStream, value.DataStream, null, null); + writer.WriteProperty(options, PropDeprecated, value.Deprecated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissingComponentTemplates, value.IgnoreMissingComponentTemplates, null, null); + writer.WriteProperty(options, PropIndexPatterns, value.IndexPatterns, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropModifiedDate, value.ModifiedDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropModifiedDateMillis, value.ModifiedDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropPriority, value.Priority, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTemplate, value.Template, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplate.g.cs index a380ba83f51..68a12ae55bb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplate.g.cs @@ -23,163 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexTemplateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowAutoCreate = System.Text.Json.JsonEncodedText.Encode("allow_auto_create"); - private static readonly System.Text.Json.JsonEncodedText PropComposedOf = System.Text.Json.JsonEncodedText.Encode("composed_of"); - private static readonly System.Text.Json.JsonEncodedText PropCreatedDate = System.Text.Json.JsonEncodedText.Encode("created_date"); - private static readonly System.Text.Json.JsonEncodedText PropCreatedDateMillis = System.Text.Json.JsonEncodedText.Encode("created_date_millis"); - private static readonly System.Text.Json.JsonEncodedText PropDataStream = System.Text.Json.JsonEncodedText.Encode("data_stream"); - private static readonly System.Text.Json.JsonEncodedText PropDeprecated = System.Text.Json.JsonEncodedText.Encode("deprecated"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissingComponentTemplates = System.Text.Json.JsonEncodedText.Encode("ignore_missing_component_templates"); - private static readonly System.Text.Json.JsonEncodedText PropIndexPatterns = System.Text.Json.JsonEncodedText.Encode("index_patterns"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); - private static readonly System.Text.Json.JsonEncodedText PropModifiedDate = System.Text.Json.JsonEncodedText.Encode("modified_date"); - private static readonly System.Text.Json.JsonEncodedText PropModifiedDateMillis = System.Text.Json.JsonEncodedText.Encode("modified_date_millis"); - private static readonly System.Text.Json.JsonEncodedText PropPriority = System.Text.Json.JsonEncodedText.Encode("priority"); - private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowAutoCreate = default; - LocalJsonValue> propComposedOf = default; - LocalJsonValue propCreatedDate = default; - LocalJsonValue propCreatedDateMillis = default; - LocalJsonValue propDataStream = default; - LocalJsonValue propDeprecated = default; - LocalJsonValue propIgnoreMissingComponentTemplates = default; - LocalJsonValue propIndexPatterns = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propModifiedDate = default; - LocalJsonValue propModifiedDateMillis = default; - LocalJsonValue propPriority = default; - LocalJsonValue propTemplate = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowAutoCreate.TryReadProperty(ref reader, options, PropAllowAutoCreate, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propComposedOf.TryReadProperty(ref reader, options, PropComposedOf, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propCreatedDate.TryReadProperty(ref reader, options, PropCreatedDate, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propCreatedDateMillis.TryReadProperty(ref reader, options, PropCreatedDateMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propDataStream.TryReadProperty(ref reader, options, PropDataStream, null)) - { - continue; - } - - if (propDeprecated.TryReadProperty(ref reader, options, PropDeprecated, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissingComponentTemplates.TryReadProperty(ref reader, options, PropIgnoreMissingComponentTemplates, null)) - { - continue; - } - - if (propIndexPatterns.TryReadProperty(ref reader, options, PropIndexPatterns, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propModifiedDate.TryReadProperty(ref reader, options, PropModifiedDate, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propModifiedDateMillis.TryReadProperty(ref reader, options, PropModifiedDateMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propPriority.TryReadProperty(ref reader, options, PropPriority, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowAutoCreate = propAllowAutoCreate.Value, - ComposedOf = propComposedOf.Value, - CreatedDate = propCreatedDate.Value, - CreatedDateMillis = propCreatedDateMillis.Value, - DataStream = propDataStream.Value, - Deprecated = propDeprecated.Value, - IgnoreMissingComponentTemplates = propIgnoreMissingComponentTemplates.Value, - IndexPatterns = propIndexPatterns.Value, - Meta = propMeta.Value, - ModifiedDate = propModifiedDate.Value, - ModifiedDateMillis = propModifiedDateMillis.Value, - Priority = propPriority.Value, - Template = propTemplate.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowAutoCreate, value.AllowAutoCreate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropComposedOf, value.ComposedOf, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCreatedDate, value.CreatedDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropCreatedDateMillis, value.CreatedDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropDataStream, value.DataStream, null, null); - writer.WriteProperty(options, PropDeprecated, value.Deprecated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissingComponentTemplates, value.IgnoreMissingComponentTemplates, null, null); - writer.WriteProperty(options, PropIndexPatterns, value.IndexPatterns, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropModifiedDate, value.ModifiedDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropModifiedDateMillis, value.ModifiedDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropPriority, value.Priority, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTemplate, value.Template, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexTemplateConverter))] public sealed partial class IndexTemplate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateDataStreamConfiguration.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateDataStreamConfiguration.Converters.g.cs new file mode 100644 index 00000000000..d122b488a56 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateDataStreamConfiguration.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexTemplateDataStreamConfigurationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowCustomRouting = System.Text.Json.JsonEncodedText.Encode("allow_custom_routing"); + private static readonly System.Text.Json.JsonEncodedText PropHidden = System.Text.Json.JsonEncodedText.Encode("hidden"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDataStreamConfiguration Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowCustomRouting = default; + LocalJsonValue propHidden = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowCustomRouting.TryReadProperty(ref reader, options, PropAllowCustomRouting, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propHidden.TryReadProperty(ref reader, options, PropHidden, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDataStreamConfiguration(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowCustomRouting = propAllowCustomRouting.Value, + Hidden = propHidden.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDataStreamConfiguration value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowCustomRouting, value.AllowCustomRouting, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropHidden, value.Hidden, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateDataStreamConfiguration.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateDataStreamConfiguration.g.cs index bba7ada8f87..72eb1865eda 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateDataStreamConfiguration.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateDataStreamConfiguration.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexTemplateDataStreamConfigurationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowCustomRouting = System.Text.Json.JsonEncodedText.Encode("allow_custom_routing"); - private static readonly System.Text.Json.JsonEncodedText PropHidden = System.Text.Json.JsonEncodedText.Encode("hidden"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDataStreamConfiguration Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowCustomRouting = default; - LocalJsonValue propHidden = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowCustomRouting.TryReadProperty(ref reader, options, PropAllowCustomRouting, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propHidden.TryReadProperty(ref reader, options, PropHidden, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDataStreamConfiguration(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowCustomRouting = propAllowCustomRouting.Value, - Hidden = propHidden.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDataStreamConfiguration value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowCustomRouting, value.AllowCustomRouting, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropHidden, value.Hidden, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDataStreamConfigurationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexTemplateDataStreamConfigurationConverter))] public sealed partial class IndexTemplateDataStreamConfiguration { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateItem.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateItem.Converters.g.cs new file mode 100644 index 00000000000..65a7cd4de2e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateItem.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexTemplateItemConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndexTemplate = System.Text.Json.JsonEncodedText.Encode("index_template"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndexTemplate = default; + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndexTemplate.TryReadProperty(ref reader, options, PropIndexTemplate, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + IndexTemplate = propIndexTemplate.Value, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateItem value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndexTemplate, value.IndexTemplate, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateItem.g.cs index bdcfccb489b..1541e1650ef 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateItem.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexTemplateItemConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndexTemplate = System.Text.Json.JsonEncodedText.Encode("index_template"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndexTemplate = default; - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndexTemplate.TryReadProperty(ref reader, options, PropIndexTemplate, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - IndexTemplate = propIndexTemplate.Value, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateItem value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndexTemplate, value.IndexTemplate, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateItemConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexTemplateItemConverter))] public sealed partial class IndexTemplateItem { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateMapping.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateMapping.Converters.g.cs new file mode 100644 index 00000000000..3da45b0e8ff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateMapping.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexTemplateMappingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); + private static readonly System.Text.Json.JsonEncodedText PropLifecycle = System.Text.Json.JsonEncodedText.Encode("lifecycle"); + private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateMapping Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAliases = default; + LocalJsonValue propLifecycle = default; + LocalJsonValue propMappings = default; + LocalJsonValue propSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propLifecycle.TryReadProperty(ref reader, options, PropLifecycle, null)) + { + continue; + } + + if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) + { + continue; + } + + if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateMapping(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aliases = propAliases.Value, + Lifecycle = propLifecycle.Value, + Mappings = propMappings.Value, + Settings = propSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateMapping value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropLifecycle, value.Lifecycle, null, null); + writer.WriteProperty(options, PropMappings, value.Mappings, null, null); + writer.WriteProperty(options, PropSettings, value.Settings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateMapping.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateMapping.g.cs index 58e256184b5..3709a22d2f3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateMapping.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateMapping.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexTemplateMappingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); - private static readonly System.Text.Json.JsonEncodedText PropLifecycle = System.Text.Json.JsonEncodedText.Encode("lifecycle"); - private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateMapping Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAliases = default; - LocalJsonValue propLifecycle = default; - LocalJsonValue propMappings = default; - LocalJsonValue propSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propLifecycle.TryReadProperty(ref reader, options, PropLifecycle, null)) - { - continue; - } - - if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) - { - continue; - } - - if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateMapping(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aliases = propAliases.Value, - Lifecycle = propLifecycle.Value, - Mappings = propMappings.Value, - Settings = propSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateMapping value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropLifecycle, value.Lifecycle, null, null); - writer.WriteProperty(options, PropMappings, value.Mappings, null, null); - writer.WriteProperty(options, PropSettings, value.Settings, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateMappingConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexTemplateMappingConverter))] public sealed partial class IndexTemplateMapping { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateSummary.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateSummary.Converters.g.cs new file mode 100644 index 00000000000..25c3f6abf40 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateSummary.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexTemplateSummaryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); + private static readonly System.Text.Json.JsonEncodedText PropDataStreamOptions = System.Text.Json.JsonEncodedText.Encode("data_stream_options"); + private static readonly System.Text.Json.JsonEncodedText PropLifecycle = System.Text.Json.JsonEncodedText.Encode("lifecycle"); + private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAliases = default; + LocalJsonValue propDataStreamOptions = default; + LocalJsonValue propLifecycle = default; + LocalJsonValue propMappings = default; + LocalJsonValue propSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propDataStreamOptions.TryReadProperty(ref reader, options, PropDataStreamOptions, null)) + { + continue; + } + + if (propLifecycle.TryReadProperty(ref reader, options, PropLifecycle, null)) + { + continue; + } + + if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) + { + continue; + } + + if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aliases = propAliases.Value, + DataStreamOptions = propDataStreamOptions.Value, + Lifecycle = propLifecycle.Value, + Mappings = propMappings.Value, + Settings = propSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummary value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropDataStreamOptions, value.DataStreamOptions, null, null); + writer.WriteProperty(options, PropLifecycle, value.Lifecycle, null, null); + writer.WriteProperty(options, PropMappings, value.Mappings, null, null); + writer.WriteProperty(options, PropSettings, value.Settings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateSummary.g.cs index 4af6d76a1f8..d276196a36e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateSummary.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateSummary.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexTemplateSummaryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); - private static readonly System.Text.Json.JsonEncodedText PropDataStreamOptions = System.Text.Json.JsonEncodedText.Encode("data_stream_options"); - private static readonly System.Text.Json.JsonEncodedText PropLifecycle = System.Text.Json.JsonEncodedText.Encode("lifecycle"); - private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAliases = default; - LocalJsonValue propDataStreamOptions = default; - LocalJsonValue propLifecycle = default; - LocalJsonValue propMappings = default; - LocalJsonValue propSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propDataStreamOptions.TryReadProperty(ref reader, options, PropDataStreamOptions, null)) - { - continue; - } - - if (propLifecycle.TryReadProperty(ref reader, options, PropLifecycle, null)) - { - continue; - } - - if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) - { - continue; - } - - if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aliases = propAliases.Value, - DataStreamOptions = propDataStreamOptions.Value, - Lifecycle = propLifecycle.Value, - Mappings = propMappings.Value, - Settings = propSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummary value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropDataStreamOptions, value.DataStreamOptions, null, null); - writer.WriteProperty(options, PropLifecycle, value.Lifecycle, null, null); - writer.WriteProperty(options, PropMappings, value.Mappings, null, null); - writer.WriteProperty(options, PropSettings, value.Settings, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummaryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexTemplateSummaryConverter))] public sealed partial class IndexTemplateSummary { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexUpdateAliasesAction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexUpdateAliasesAction.Converters.g.cs new file mode 100644 index 00000000000..fda4a5564dd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexUpdateAliasesAction.Converters.g.cs @@ -0,0 +1,102 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexUpdateAliasesActionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantAdd = System.Text.Json.JsonEncodedText.Encode("add"); + private static readonly System.Text.Json.JsonEncodedText VariantRemove = System.Text.Json.JsonEncodedText.Encode("remove"); + private static readonly System.Text.Json.JsonEncodedText VariantRemoveIndex = System.Text.Json.JsonEncodedText.Encode("remove_index"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexUpdateAliasesAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantAdd)) + { + variantType = VariantAdd.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRemove)) + { + variantType = VariantRemove.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRemoveIndex)) + { + variantType = VariantRemoveIndex.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexUpdateAliasesAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexUpdateAliasesAction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "add": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.IndexManagement.AddAction)value.Variant, null, null); + break; + case "remove": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.IndexManagement.RemoveAction)value.Variant, null, null); + break; + case "remove_index": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.IndexManagement.RemoveIndexAction)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndexUpdateAliasesAction)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexUpdateAliasesAction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexUpdateAliasesAction.g.cs index 2a067152387..2b1866fc753 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexUpdateAliasesAction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexUpdateAliasesAction.g.cs @@ -23,85 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexUpdateAliasesActionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantAdd = System.Text.Json.JsonEncodedText.Encode("add"); - private static readonly System.Text.Json.JsonEncodedText VariantRemove = System.Text.Json.JsonEncodedText.Encode("remove"); - private static readonly System.Text.Json.JsonEncodedText VariantRemoveIndex = System.Text.Json.JsonEncodedText.Encode("remove_index"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexUpdateAliasesAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantAdd)) - { - variantType = VariantAdd.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRemove)) - { - variantType = VariantRemove.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRemoveIndex)) - { - variantType = VariantRemoveIndex.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexUpdateAliasesAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexUpdateAliasesAction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "add": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.IndexManagement.AddAction)value.Variant, null, null); - break; - case "remove": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.IndexManagement.RemoveAction)value.Variant, null, null); - break; - case "remove_index": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.IndexManagement.RemoveIndexAction)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndexUpdateAliasesAction)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexUpdateAliasesActionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexUpdateAliasesActionConverter))] public sealed partial class IndexUpdateAliasesAction { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexVersioning.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexVersioning.Converters.g.cs new file mode 100644 index 00000000000..d7677649b22 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexVersioning.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexVersioningConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCreated = System.Text.Json.JsonEncodedText.Encode("created"); + private static readonly System.Text.Json.JsonEncodedText PropCreatedString = System.Text.Json.JsonEncodedText.Encode("created_string"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexVersioning Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCreated = default; + LocalJsonValue propCreatedString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCreated.TryReadProperty(ref reader, options, PropCreated, null)) + { + continue; + } + + if (propCreatedString.TryReadProperty(ref reader, options, PropCreatedString, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexVersioning(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Created = propCreated.Value, + CreatedString = propCreatedString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexVersioning value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCreated, value.Created, null, null); + writer.WriteProperty(options, PropCreatedString, value.CreatedString, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexVersioning.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexVersioning.g.cs index 8c21fbc2ec9..a8d69c96746 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexVersioning.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexVersioning.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexVersioningConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCreated = System.Text.Json.JsonEncodedText.Encode("created"); - private static readonly System.Text.Json.JsonEncodedText PropCreatedString = System.Text.Json.JsonEncodedText.Encode("created_string"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexVersioning Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCreated = default; - LocalJsonValue propCreatedString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCreated.TryReadProperty(ref reader, options, PropCreated, null)) - { - continue; - } - - if (propCreatedString.TryReadProperty(ref reader, options, PropCreatedString, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexVersioning(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Created = propCreated.Value, - CreatedString = propCreatedString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexVersioning value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCreated, value.Created, null, null); - writer.WriteProperty(options, PropCreatedString, value.CreatedString, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexVersioningConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexVersioningConverter))] public sealed partial class IndexVersioning { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingPressure.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingPressure.Converters.g.cs new file mode 100644 index 00000000000..cbf8b452964 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingPressure.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexingPressureConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMemory = System.Text.Json.JsonEncodedText.Encode("memory"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressure Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMemory = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMemory.TryReadProperty(ref reader, options, PropMemory, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressure(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Memory = propMemory.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressure value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMemory, value.Memory, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingPressure.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingPressure.g.cs index 43c5de801fe..f33956703a7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingPressure.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingPressure.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexingPressureConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMemory = System.Text.Json.JsonEncodedText.Encode("memory"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressure Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMemory = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMemory.TryReadProperty(ref reader, options, PropMemory, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressure(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Memory = propMemory.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressure value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMemory, value.Memory, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressureConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexingPressureConverter))] public sealed partial class IndexingPressure { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingPressureMemory.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingPressureMemory.Converters.g.cs new file mode 100644 index 00000000000..826be9dd8cc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingPressureMemory.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexingPressureMemoryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLimit = System.Text.Json.JsonEncodedText.Encode("limit"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressureMemory Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLimit = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLimit.TryReadProperty(ref reader, options, PropLimit, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressureMemory(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Limit = propLimit.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressureMemory value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLimit, value.Limit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingPressureMemory.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingPressureMemory.g.cs index d8a6f0f961d..2a47eebb5fb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingPressureMemory.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingPressureMemory.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexingPressureMemoryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLimit = System.Text.Json.JsonEncodedText.Encode("limit"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressureMemory Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLimit = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLimit.TryReadProperty(ref reader, options, PropLimit, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressureMemory(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Limit = propLimit.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressureMemory value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLimit, value.Limit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexingPressureMemoryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexingPressureMemoryConverter))] public sealed partial class IndexingPressureMemory { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingSlowlogSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingSlowlogSettings.Converters.g.cs new file mode 100644 index 00000000000..5b7ea656a14 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingSlowlogSettings.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexingSlowlogSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLevel = System.Text.Json.JsonEncodedText.Encode("level"); + private static readonly System.Text.Json.JsonEncodedText PropReformat = System.Text.Json.JsonEncodedText.Encode("reformat"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + private static readonly System.Text.Json.JsonEncodedText PropThreshold = System.Text.Json.JsonEncodedText.Encode("threshold"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLevel = default; + LocalJsonValue propReformat = default; + LocalJsonValue propSource = default; + LocalJsonValue propThreshold = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLevel.TryReadProperty(ref reader, options, PropLevel, null)) + { + continue; + } + + if (propReformat.TryReadProperty(ref reader, options, PropReformat, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propThreshold.TryReadProperty(ref reader, options, PropThreshold, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Level = propLevel.Value, + Reformat = propReformat.Value, + Source = propSource.Value, + Threshold = propThreshold.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLevel, value.Level, null, null); + writer.WriteProperty(options, PropReformat, value.Reformat, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSource, value.Source, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropThreshold, value.Threshold, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingSlowlogSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingSlowlogSettings.g.cs index 0ba2dcfba2a..038a33abcac 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingSlowlogSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingSlowlogSettings.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexingSlowlogSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLevel = System.Text.Json.JsonEncodedText.Encode("level"); - private static readonly System.Text.Json.JsonEncodedText PropReformat = System.Text.Json.JsonEncodedText.Encode("reformat"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - private static readonly System.Text.Json.JsonEncodedText PropThreshold = System.Text.Json.JsonEncodedText.Encode("threshold"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLevel = default; - LocalJsonValue propReformat = default; - LocalJsonValue propSource = default; - LocalJsonValue propThreshold = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLevel.TryReadProperty(ref reader, options, PropLevel, null)) - { - continue; - } - - if (propReformat.TryReadProperty(ref reader, options, PropReformat, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propThreshold.TryReadProperty(ref reader, options, PropThreshold, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Level = propLevel.Value, - Reformat = propReformat.Value, - Source = propSource.Value, - Threshold = propThreshold.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLevel, value.Level, null, null); - writer.WriteProperty(options, PropReformat, value.Reformat, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSource, value.Source, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropThreshold, value.Threshold, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexingSlowlogSettingsConverter))] public sealed partial class IndexingSlowlogSettings { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingSlowlogTresholds.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingSlowlogTresholds.Converters.g.cs new file mode 100644 index 00000000000..4339713d6f8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingSlowlogTresholds.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndexingSlowlogTresholdsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogTresholds Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndex = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogTresholds(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Index = propIndex.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogTresholds value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingSlowlogTresholds.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingSlowlogTresholds.g.cs index 707957775a4..f625e6ee01d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingSlowlogTresholds.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexingSlowlogTresholds.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndexingSlowlogTresholdsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogTresholds Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndex = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogTresholds(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Index = propIndex.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogTresholds value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndexingSlowlogTresholdsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndexingSlowlogTresholdsConverter))] public sealed partial class IndexingSlowlogTresholds { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesBlockOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesBlockOptions.Converters.g.cs new file mode 100644 index 00000000000..557ca7efd60 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesBlockOptions.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndicesBlockOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText MemberRead = System.Text.Json.JsonEncodedText.Encode("read"); + private static readonly System.Text.Json.JsonEncodedText MemberReadOnly = System.Text.Json.JsonEncodedText.Encode("read_only"); + private static readonly System.Text.Json.JsonEncodedText MemberWrite = System.Text.Json.JsonEncodedText.Encode("write"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberMetadata)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions.Metadata; + } + + if (reader.ValueTextEquals(MemberRead)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions.Read; + } + + if (reader.ValueTextEquals(MemberReadOnly)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions.ReadOnly; + } + + if (reader.ValueTextEquals(MemberWrite)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions.Write; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberMetadata.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions.Metadata; + } + + if (string.Equals(value, MemberRead.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions.Read; + } + + if (string.Equals(value, MemberReadOnly.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions.ReadOnly; + } + + if (string.Equals(value, MemberWrite.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions.Write; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions.Metadata: + writer.WriteStringValue(MemberMetadata); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions.Read: + writer.WriteStringValue(MemberRead); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions.ReadOnly: + writer.WriteStringValue(MemberReadOnly); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions.Write: + writer.WriteStringValue(MemberWrite); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndicesBlockOptions value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesBlockOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesBlockOptions.g.cs new file mode 100644 index 00000000000..d1ab4312170 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesBlockOptions.g.cs @@ -0,0 +1,57 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndicesBlockOptionsConverter))] +public enum IndicesBlockOptions +{ + /// + /// + /// Disable metadata changes, such as closing the index. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "metadata")] + Metadata, + /// + /// + /// Disable read operations. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "read")] + Read, + /// + /// + /// Disable write operations and metadata changes. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "read_only")] + ReadOnly, + /// + /// + /// Disable write operations. However, metadata changes are still allowed. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "write")] + Write +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesShardStores.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesShardStores.Converters.g.cs new file mode 100644 index 00000000000..0e271893ab1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesShardStores.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndicesShardStoresConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndicesShardStores Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propShards = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propShards.TryReadProperty(ref reader, options, PropShards, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndicesShardStores(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Shards = propShards.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndicesShardStores value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropShards, value.Shards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesShardStores.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesShardStores.g.cs index 557732c7227..20e5152aa1f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesShardStores.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesShardStores.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndicesShardStoresConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndicesShardStores Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propShards = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propShards.TryReadProperty(ref reader, options, PropShards, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndicesShardStores(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Shards = propShards.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndicesShardStores value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropShards, value.Shards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndicesShardStoresConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndicesShardStoresConverter))] public sealed partial class IndicesShardStores { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesStats.Converters.g.cs new file mode 100644 index 00000000000..06c64e8711a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesStats.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndicesStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropHealth = System.Text.Json.JsonEncodedText.Encode("health"); + private static readonly System.Text.Json.JsonEncodedText PropPrimaries = System.Text.Json.JsonEncodedText.Encode("primaries"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + private static readonly System.Text.Json.JsonEncodedText PropUuid = System.Text.Json.JsonEncodedText.Encode("uuid"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndicesStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propHealth = default; + LocalJsonValue propPrimaries = default; + LocalJsonValue>?> propShards = default; + LocalJsonValue propStatus = default; + LocalJsonValue propTotal = default; + LocalJsonValue propUuid = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propHealth.TryReadProperty(ref reader, options, PropHealth, static Elastic.Clients.Elasticsearch.HealthStatus? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPrimaries.TryReadProperty(ref reader, options, PropPrimaries, null)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, static System.Collections.Generic.IReadOnlyDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, static Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (propUuid.TryReadProperty(ref reader, options, PropUuid, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndicesStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Health = propHealth.Value, + Primaries = propPrimaries.Value, + Shards = propShards.Value, + Status = propStatus.Value, + Total = propTotal.Value, + Uuid = propUuid.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndicesStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropHealth, value.Health, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.HealthStatus? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPrimaries, value.Primaries, null, null); + writer.WriteProperty(options, PropShards, value.Shards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropStatus, value.Status, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteProperty(options, PropUuid, value.Uuid, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesStats.g.cs index de13490f542..46226e81085 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesStats.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndicesStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropHealth = System.Text.Json.JsonEncodedText.Encode("health"); - private static readonly System.Text.Json.JsonEncodedText PropPrimaries = System.Text.Json.JsonEncodedText.Encode("primaries"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - private static readonly System.Text.Json.JsonEncodedText PropUuid = System.Text.Json.JsonEncodedText.Encode("uuid"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndicesStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propHealth = default; - LocalJsonValue propPrimaries = default; - LocalJsonValue>?> propShards = default; - LocalJsonValue propStatus = default; - LocalJsonValue propTotal = default; - LocalJsonValue propUuid = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propHealth.TryReadProperty(ref reader, options, PropHealth, static Elastic.Clients.Elasticsearch.HealthStatus? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPrimaries.TryReadProperty(ref reader, options, PropPrimaries, null)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, static System.Collections.Generic.IReadOnlyDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, static Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (propUuid.TryReadProperty(ref reader, options, PropUuid, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndicesStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Health = propHealth.Value, - Primaries = propPrimaries.Value, - Shards = propShards.Value, - Status = propStatus.Value, - Total = propTotal.Value, - Uuid = propUuid.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndicesStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropHealth, value.Health, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.HealthStatus? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPrimaries, value.Primaries, null, null); - writer.WriteProperty(options, PropShards, value.Shards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropStatus, value.Status, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.IndexManagement.IndexMetadataState? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteProperty(options, PropUuid, value.Uuid, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndicesStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndicesStatsConverter))] public sealed partial class IndicesStats { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesValidationExplanation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesValidationExplanation.Converters.g.cs new file mode 100644 index 00000000000..673f389a64e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesValidationExplanation.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class IndicesValidationExplanationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); + private static readonly System.Text.Json.JsonEncodedText PropExplanation = System.Text.Json.JsonEncodedText.Encode("explanation"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropValid = System.Text.Json.JsonEncodedText.Encode("valid"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndicesValidationExplanation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propError = default; + LocalJsonValue propExplanation = default; + LocalJsonValue propIndex = default; + LocalJsonValue propValid = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propError.TryReadProperty(ref reader, options, PropError, null)) + { + continue; + } + + if (propExplanation.TryReadProperty(ref reader, options, PropExplanation, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propValid.TryReadProperty(ref reader, options, PropValid, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.IndicesValidationExplanation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Error = propError.Value, + Explanation = propExplanation.Value, + Index = propIndex.Value, + Valid = propValid.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndicesValidationExplanation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropError, value.Error, null, null); + writer.WriteProperty(options, PropExplanation, value.Explanation, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropValid, value.Valid, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesValidationExplanation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesValidationExplanation.g.cs index e35178ca7b6..7f3f33a0f7b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesValidationExplanation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndicesValidationExplanation.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class IndicesValidationExplanationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); - private static readonly System.Text.Json.JsonEncodedText PropExplanation = System.Text.Json.JsonEncodedText.Encode("explanation"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropValid = System.Text.Json.JsonEncodedText.Encode("valid"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.IndicesValidationExplanation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propError = default; - LocalJsonValue propExplanation = default; - LocalJsonValue propIndex = default; - LocalJsonValue propValid = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propError.TryReadProperty(ref reader, options, PropError, null)) - { - continue; - } - - if (propExplanation.TryReadProperty(ref reader, options, PropExplanation, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propValid.TryReadProperty(ref reader, options, PropValid, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.IndicesValidationExplanation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Error = propError.Value, - Explanation = propExplanation.Value, - Index = propIndex.Value, - Valid = propValid.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndicesValidationExplanation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropError, value.Error, null, null); - writer.WriteProperty(options, PropExplanation, value.Explanation, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropValid, value.Valid, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.IndicesValidationExplanationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.IndicesValidationExplanationConverter))] public sealed partial class IndicesValidationExplanation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/InvertedIndex.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/InvertedIndex.Converters.g.cs new file mode 100644 index 00000000000..95164146d3a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/InvertedIndex.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class InvertedIndexConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropOffsets = System.Text.Json.JsonEncodedText.Encode("offsets"); + private static readonly System.Text.Json.JsonEncodedText PropPayloads = System.Text.Json.JsonEncodedText.Encode("payloads"); + private static readonly System.Text.Json.JsonEncodedText PropPositions = System.Text.Json.JsonEncodedText.Encode("positions"); + private static readonly System.Text.Json.JsonEncodedText PropPostings = System.Text.Json.JsonEncodedText.Encode("postings"); + private static readonly System.Text.Json.JsonEncodedText PropProximity = System.Text.Json.JsonEncodedText.Encode("proximity"); + private static readonly System.Text.Json.JsonEncodedText PropTermFrequencies = System.Text.Json.JsonEncodedText.Encode("term_frequencies"); + private static readonly System.Text.Json.JsonEncodedText PropTerms = System.Text.Json.JsonEncodedText.Encode("terms"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.InvertedIndex Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propOffsets = default; + LocalJsonValue propPayloads = default; + LocalJsonValue propPositions = default; + LocalJsonValue propPostings = default; + LocalJsonValue propProximity = default; + LocalJsonValue propTermFrequencies = default; + LocalJsonValue propTerms = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propOffsets.TryReadProperty(ref reader, options, PropOffsets, null)) + { + continue; + } + + if (propPayloads.TryReadProperty(ref reader, options, PropPayloads, null)) + { + continue; + } + + if (propPositions.TryReadProperty(ref reader, options, PropPositions, null)) + { + continue; + } + + if (propPostings.TryReadProperty(ref reader, options, PropPostings, null)) + { + continue; + } + + if (propProximity.TryReadProperty(ref reader, options, PropProximity, null)) + { + continue; + } + + if (propTermFrequencies.TryReadProperty(ref reader, options, PropTermFrequencies, null)) + { + continue; + } + + if (propTerms.TryReadProperty(ref reader, options, PropTerms, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.InvertedIndex(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Offsets = propOffsets.Value, + Payloads = propPayloads.Value, + Positions = propPositions.Value, + Postings = propPostings.Value, + Proximity = propProximity.Value, + TermFrequencies = propTermFrequencies.Value, + Terms = propTerms.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.InvertedIndex value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropOffsets, value.Offsets, null, null); + writer.WriteProperty(options, PropPayloads, value.Payloads, null, null); + writer.WriteProperty(options, PropPositions, value.Positions, null, null); + writer.WriteProperty(options, PropPostings, value.Postings, null, null); + writer.WriteProperty(options, PropProximity, value.Proximity, null, null); + writer.WriteProperty(options, PropTermFrequencies, value.TermFrequencies, null, null); + writer.WriteProperty(options, PropTerms, value.Terms, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/InvertedIndex.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/InvertedIndex.g.cs index cdbb1f97455..3ab99a9f765 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/InvertedIndex.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/InvertedIndex.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class InvertedIndexConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropOffsets = System.Text.Json.JsonEncodedText.Encode("offsets"); - private static readonly System.Text.Json.JsonEncodedText PropPayloads = System.Text.Json.JsonEncodedText.Encode("payloads"); - private static readonly System.Text.Json.JsonEncodedText PropPositions = System.Text.Json.JsonEncodedText.Encode("positions"); - private static readonly System.Text.Json.JsonEncodedText PropPostings = System.Text.Json.JsonEncodedText.Encode("postings"); - private static readonly System.Text.Json.JsonEncodedText PropProximity = System.Text.Json.JsonEncodedText.Encode("proximity"); - private static readonly System.Text.Json.JsonEncodedText PropTermFrequencies = System.Text.Json.JsonEncodedText.Encode("term_frequencies"); - private static readonly System.Text.Json.JsonEncodedText PropTerms = System.Text.Json.JsonEncodedText.Encode("terms"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.InvertedIndex Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propOffsets = default; - LocalJsonValue propPayloads = default; - LocalJsonValue propPositions = default; - LocalJsonValue propPostings = default; - LocalJsonValue propProximity = default; - LocalJsonValue propTermFrequencies = default; - LocalJsonValue propTerms = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propOffsets.TryReadProperty(ref reader, options, PropOffsets, null)) - { - continue; - } - - if (propPayloads.TryReadProperty(ref reader, options, PropPayloads, null)) - { - continue; - } - - if (propPositions.TryReadProperty(ref reader, options, PropPositions, null)) - { - continue; - } - - if (propPostings.TryReadProperty(ref reader, options, PropPostings, null)) - { - continue; - } - - if (propProximity.TryReadProperty(ref reader, options, PropProximity, null)) - { - continue; - } - - if (propTermFrequencies.TryReadProperty(ref reader, options, PropTermFrequencies, null)) - { - continue; - } - - if (propTerms.TryReadProperty(ref reader, options, PropTerms, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.InvertedIndex(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Offsets = propOffsets.Value, - Payloads = propPayloads.Value, - Positions = propPositions.Value, - Postings = propPostings.Value, - Proximity = propProximity.Value, - TermFrequencies = propTermFrequencies.Value, - Terms = propTerms.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.InvertedIndex value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropOffsets, value.Offsets, null, null); - writer.WriteProperty(options, PropPayloads, value.Payloads, null, null); - writer.WriteProperty(options, PropPositions, value.Positions, null, null); - writer.WriteProperty(options, PropPostings, value.Postings, null, null); - writer.WriteProperty(options, PropProximity, value.Proximity, null, null); - writer.WriteProperty(options, PropTermFrequencies, value.TermFrequencies, null, null); - writer.WriteProperty(options, PropTerms, value.Terms, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.InvertedIndexConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.InvertedIndexConverter))] public sealed partial class InvertedIndex { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ManagedBy.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ManagedBy.Converters.g.cs new file mode 100644 index 00000000000..824bc970917 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ManagedBy.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ManagedByConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberDatastream = System.Text.Json.JsonEncodedText.Encode("Data stream lifecycle"); + private static readonly System.Text.Json.JsonEncodedText MemberIlm = System.Text.Json.JsonEncodedText.Encode("Index Lifecycle Management"); + private static readonly System.Text.Json.JsonEncodedText MemberUnmanaged = System.Text.Json.JsonEncodedText.Encode("Unmanaged"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberDatastream)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy.Datastream; + } + + if (reader.ValueTextEquals(MemberIlm)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy.Ilm; + } + + if (reader.ValueTextEquals(MemberUnmanaged)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy.Unmanaged; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberDatastream.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy.Datastream; + } + + if (string.Equals(value, MemberIlm.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy.Ilm; + } + + if (string.Equals(value, MemberUnmanaged.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy.Unmanaged; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy.Datastream: + writer.WriteStringValue(MemberDatastream); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy.Ilm: + writer.WriteStringValue(MemberIlm); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy.Unmanaged: + writer.WriteStringValue(MemberUnmanaged); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ManagedBy value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ManagedBy.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ManagedBy.g.cs new file mode 100644 index 00000000000..8230b53a07c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ManagedBy.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ManagedByConverter))] +public enum ManagedBy +{ + [System.Runtime.Serialization.EnumMember(Value = "Data stream lifecycle")] + Datastream, + [System.Runtime.Serialization.EnumMember(Value = "Index Lifecycle Management")] + Ilm, + [System.Runtime.Serialization.EnumMember(Value = "Unmanaged")] + Unmanaged +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettings.Converters.g.cs new file mode 100644 index 00000000000..dcd9aef8768 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettings.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class MappingLimitSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); + private static readonly System.Text.Json.JsonEncodedText PropDepth = System.Text.Json.JsonEncodedText.Encode("depth"); + private static readonly System.Text.Json.JsonEncodedText PropDimensionFields = System.Text.Json.JsonEncodedText.Encode("dimension_fields"); + private static readonly System.Text.Json.JsonEncodedText PropFieldNameLength = System.Text.Json.JsonEncodedText.Encode("field_name_length"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); + private static readonly System.Text.Json.JsonEncodedText PropNestedFields = System.Text.Json.JsonEncodedText.Encode("nested_fields"); + private static readonly System.Text.Json.JsonEncodedText PropNestedObjects = System.Text.Json.JsonEncodedText.Encode("nested_objects"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + private static readonly System.Text.Json.JsonEncodedText PropTotalFields = System.Text.Json.JsonEncodedText.Encode("total_fields"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCoerce = default; + LocalJsonValue propDepth = default; + LocalJsonValue propDimensionFields = default; + LocalJsonValue propFieldNameLength = default; + LocalJsonValue?> propIgnoreMalformed = default; + LocalJsonValue propNestedFields = default; + LocalJsonValue propNestedObjects = default; + LocalJsonValue propSource = default; + LocalJsonValue propTotalFields = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDepth.TryReadProperty(ref reader, options, PropDepth, null)) + { + continue; + } + + if (propDimensionFields.TryReadProperty(ref reader, options, PropDimensionFields, null)) + { + continue; + } + + if (propFieldNameLength.TryReadProperty(ref reader, options, PropFieldNameLength, null)) + { + continue; + } + + if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) + { + continue; + } + + if (propNestedFields.TryReadProperty(ref reader, options, PropNestedFields, null)) + { + continue; + } + + if (propNestedObjects.TryReadProperty(ref reader, options, PropNestedObjects, null)) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (propTotalFields.TryReadProperty(ref reader, options, PropTotalFields, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Coerce = propCoerce.Value, + Depth = propDepth.Value, + DimensionFields = propDimensionFields.Value, + FieldNameLength = propFieldNameLength.Value, + IgnoreMalformed = propIgnoreMalformed.Value, + NestedFields = propNestedFields.Value, + NestedObjects = propNestedObjects.Value, + Source = propSource.Value, + TotalFields = propTotalFields.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDepth, value.Depth, null, null); + writer.WriteProperty(options, PropDimensionFields, value.DimensionFields, null, null); + writer.WriteProperty(options, PropFieldNameLength, value.FieldNameLength, null, null); + writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); + writer.WriteProperty(options, PropNestedFields, value.NestedFields, null, null); + writer.WriteProperty(options, PropNestedObjects, value.NestedObjects, null, null); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteProperty(options, PropTotalFields, value.TotalFields, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettings.g.cs index fc576f60ae2..339c1b54a4c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettings.g.cs @@ -23,124 +23,13 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class MappingLimitSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); - private static readonly System.Text.Json.JsonEncodedText PropDepth = System.Text.Json.JsonEncodedText.Encode("depth"); - private static readonly System.Text.Json.JsonEncodedText PropDimensionFields = System.Text.Json.JsonEncodedText.Encode("dimension_fields"); - private static readonly System.Text.Json.JsonEncodedText PropFieldNameLength = System.Text.Json.JsonEncodedText.Encode("field_name_length"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); - private static readonly System.Text.Json.JsonEncodedText PropNestedFields = System.Text.Json.JsonEncodedText.Encode("nested_fields"); - private static readonly System.Text.Json.JsonEncodedText PropNestedObjects = System.Text.Json.JsonEncodedText.Encode("nested_objects"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - private static readonly System.Text.Json.JsonEncodedText PropTotalFields = System.Text.Json.JsonEncodedText.Encode("total_fields"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCoerce = default; - LocalJsonValue propDepth = default; - LocalJsonValue propDimensionFields = default; - LocalJsonValue propFieldNameLength = default; - LocalJsonValue?> propIgnoreMalformed = default; - LocalJsonValue propNestedFields = default; - LocalJsonValue propNestedObjects = default; - LocalJsonValue propSource = default; - LocalJsonValue propTotalFields = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDepth.TryReadProperty(ref reader, options, PropDepth, null)) - { - continue; - } - - if (propDimensionFields.TryReadProperty(ref reader, options, PropDimensionFields, null)) - { - continue; - } - - if (propFieldNameLength.TryReadProperty(ref reader, options, PropFieldNameLength, null)) - { - continue; - } - - if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) - { - continue; - } - - if (propNestedFields.TryReadProperty(ref reader, options, PropNestedFields, null)) - { - continue; - } - - if (propNestedObjects.TryReadProperty(ref reader, options, PropNestedObjects, null)) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (propTotalFields.TryReadProperty(ref reader, options, PropTotalFields, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Coerce = propCoerce.Value, - Depth = propDepth.Value, - DimensionFields = propDimensionFields.Value, - FieldNameLength = propFieldNameLength.Value, - IgnoreMalformed = propIgnoreMalformed.Value, - NestedFields = propNestedFields.Value, - NestedObjects = propNestedObjects.Value, - Source = propSource.Value, - TotalFields = propTotalFields.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDepth, value.Depth, null, null); - writer.WriteProperty(options, PropDimensionFields, value.DimensionFields, null, null); - writer.WriteProperty(options, PropFieldNameLength, value.FieldNameLength, null, null); - writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); - writer.WriteProperty(options, PropNestedFields, value.NestedFields, null, null); - writer.WriteProperty(options, PropNestedObjects, value.NestedObjects, null, null); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteProperty(options, PropTotalFields, value.TotalFields, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Mapping Limit Settings /// /// Learn more about this API in the Elasticsearch documentation. /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.MappingLimitSettingsConverter))] public sealed partial class MappingLimitSettings { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsDepth.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsDepth.Converters.g.cs new file mode 100644 index 00000000000..aec76237890 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsDepth.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class MappingLimitSettingsDepthConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLimit = System.Text.Json.JsonEncodedText.Encode("limit"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDepth Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLimit = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLimit.TryReadProperty(ref reader, options, PropLimit, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDepth(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Limit = propLimit.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDepth value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLimit, value.Limit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsDepth.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsDepth.g.cs index b78d7c26343..6f5b242aa67 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsDepth.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsDepth.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class MappingLimitSettingsDepthConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLimit = System.Text.Json.JsonEncodedText.Encode("limit"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDepth Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLimit = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLimit.TryReadProperty(ref reader, options, PropLimit, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDepth(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Limit = propLimit.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDepth value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLimit, value.Limit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDepthConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.MappingLimitSettingsDepthConverter))] public sealed partial class MappingLimitSettingsDepth { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsDimensionFields.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsDimensionFields.Converters.g.cs new file mode 100644 index 00000000000..7ba0b67cb88 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsDimensionFields.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class MappingLimitSettingsDimensionFieldsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLimit = System.Text.Json.JsonEncodedText.Encode("limit"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDimensionFields Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLimit = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLimit.TryReadProperty(ref reader, options, PropLimit, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDimensionFields(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Limit = propLimit.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDimensionFields value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLimit, value.Limit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsDimensionFields.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsDimensionFields.g.cs index e3fb2376ff6..613fb995cb0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsDimensionFields.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsDimensionFields.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class MappingLimitSettingsDimensionFieldsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLimit = System.Text.Json.JsonEncodedText.Encode("limit"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDimensionFields Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLimit = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLimit.TryReadProperty(ref reader, options, PropLimit, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDimensionFields(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Limit = propLimit.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDimensionFields value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLimit, value.Limit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsDimensionFieldsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.MappingLimitSettingsDimensionFieldsConverter))] public sealed partial class MappingLimitSettingsDimensionFields { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsFieldNameLength.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsFieldNameLength.Converters.g.cs new file mode 100644 index 00000000000..311da8624d0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsFieldNameLength.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class MappingLimitSettingsFieldNameLengthConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLimit = System.Text.Json.JsonEncodedText.Encode("limit"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsFieldNameLength Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLimit = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLimit.TryReadProperty(ref reader, options, PropLimit, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsFieldNameLength(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Limit = propLimit.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsFieldNameLength value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLimit, value.Limit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsFieldNameLength.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsFieldNameLength.g.cs index 41234caabe2..0653362d2aa 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsFieldNameLength.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsFieldNameLength.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class MappingLimitSettingsFieldNameLengthConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLimit = System.Text.Json.JsonEncodedText.Encode("limit"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsFieldNameLength Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLimit = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLimit.TryReadProperty(ref reader, options, PropLimit, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsFieldNameLength(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Limit = propLimit.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsFieldNameLength value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLimit, value.Limit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsFieldNameLengthConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.MappingLimitSettingsFieldNameLengthConverter))] public sealed partial class MappingLimitSettingsFieldNameLength { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsNestedFields.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsNestedFields.Converters.g.cs new file mode 100644 index 00000000000..1c6503a1c65 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsNestedFields.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class MappingLimitSettingsNestedFieldsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLimit = System.Text.Json.JsonEncodedText.Encode("limit"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsNestedFields Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLimit = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLimit.TryReadProperty(ref reader, options, PropLimit, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsNestedFields(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Limit = propLimit.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsNestedFields value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLimit, value.Limit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsNestedFields.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsNestedFields.g.cs index ef6ca69abe1..4efec30e9b9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsNestedFields.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsNestedFields.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class MappingLimitSettingsNestedFieldsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLimit = System.Text.Json.JsonEncodedText.Encode("limit"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsNestedFields Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLimit = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLimit.TryReadProperty(ref reader, options, PropLimit, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsNestedFields(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Limit = propLimit.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsNestedFields value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLimit, value.Limit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsNestedFieldsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.MappingLimitSettingsNestedFieldsConverter))] public sealed partial class MappingLimitSettingsNestedFields { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsNestedObjects.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsNestedObjects.Converters.g.cs new file mode 100644 index 00000000000..4ac3845e841 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsNestedObjects.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class MappingLimitSettingsNestedObjectsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLimit = System.Text.Json.JsonEncodedText.Encode("limit"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsNestedObjects Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLimit = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLimit.TryReadProperty(ref reader, options, PropLimit, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsNestedObjects(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Limit = propLimit.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsNestedObjects value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLimit, value.Limit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsNestedObjects.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsNestedObjects.g.cs index 0a885109c27..09c1ab02558 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsNestedObjects.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsNestedObjects.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class MappingLimitSettingsNestedObjectsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLimit = System.Text.Json.JsonEncodedText.Encode("limit"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsNestedObjects Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLimit = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLimit.TryReadProperty(ref reader, options, PropLimit, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsNestedObjects(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Limit = propLimit.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsNestedObjects value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLimit, value.Limit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsNestedObjectsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.MappingLimitSettingsNestedObjectsConverter))] public sealed partial class MappingLimitSettingsNestedObjects { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsSourceFields.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsSourceFields.Converters.g.cs new file mode 100644 index 00000000000..bde51b2e9de --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsSourceFields.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class MappingLimitSettingsSourceFieldsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsSourceFields Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMode = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMode.TryReadProperty(ref reader, options, PropMode, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsSourceFields(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Mode = propMode.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsSourceFields value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMode, value.Mode, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsSourceFields.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsSourceFields.g.cs index 88ad0962222..1754ad81821 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsSourceFields.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsSourceFields.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class MappingLimitSettingsSourceFieldsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsSourceFields Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMode = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMode.TryReadProperty(ref reader, options, PropMode, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsSourceFields(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Mode = propMode.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsSourceFields value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMode, value.Mode, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsSourceFieldsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.MappingLimitSettingsSourceFieldsConverter))] public sealed partial class MappingLimitSettingsSourceFields { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsTotalFields.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsTotalFields.Converters.g.cs new file mode 100644 index 00000000000..b15f914979d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsTotalFields.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class MappingLimitSettingsTotalFieldsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIgnoreDynamicBeyondLimit = System.Text.Json.JsonEncodedText.Encode("ignore_dynamic_beyond_limit"); + private static readonly System.Text.Json.JsonEncodedText PropLimit = System.Text.Json.JsonEncodedText.Encode("limit"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsTotalFields Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propIgnoreDynamicBeyondLimit = default; + LocalJsonValue?> propLimit = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIgnoreDynamicBeyondLimit.TryReadProperty(ref reader, options, PropIgnoreDynamicBeyondLimit, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) + { + continue; + } + + if (propLimit.TryReadProperty(ref reader, options, PropLimit, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsTotalFields(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + IgnoreDynamicBeyondLimit = propIgnoreDynamicBeyondLimit.Value, + Limit = propLimit.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsTotalFields value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIgnoreDynamicBeyondLimit, value.IgnoreDynamicBeyondLimit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); + writer.WriteProperty(options, PropLimit, value.Limit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsTotalFields.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsTotalFields.g.cs index 4fd082c2c68..3c224b134be 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsTotalFields.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsTotalFields.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class MappingLimitSettingsTotalFieldsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIgnoreDynamicBeyondLimit = System.Text.Json.JsonEncodedText.Encode("ignore_dynamic_beyond_limit"); - private static readonly System.Text.Json.JsonEncodedText PropLimit = System.Text.Json.JsonEncodedText.Encode("limit"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsTotalFields Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propIgnoreDynamicBeyondLimit = default; - LocalJsonValue?> propLimit = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIgnoreDynamicBeyondLimit.TryReadProperty(ref reader, options, PropIgnoreDynamicBeyondLimit, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) - { - continue; - } - - if (propLimit.TryReadProperty(ref reader, options, PropLimit, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsTotalFields(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - IgnoreDynamicBeyondLimit = propIgnoreDynamicBeyondLimit.Value, - Limit = propLimit.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsTotalFields value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIgnoreDynamicBeyondLimit, value.IgnoreDynamicBeyondLimit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); - writer.WriteProperty(options, PropLimit, value.Limit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.MappingLimitSettingsTotalFieldsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.MappingLimitSettingsTotalFieldsConverter))] public sealed partial class MappingLimitSettingsTotalFields { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingStats.Converters.g.cs new file mode 100644 index 00000000000..8f324ed613f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingStats.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class MappingStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropTotalCount = System.Text.Json.JsonEncodedText.Encode("total_count"); + private static readonly System.Text.Json.JsonEncodedText PropTotalEstimatedOverhead = System.Text.Json.JsonEncodedText.Encode("total_estimated_overhead"); + private static readonly System.Text.Json.JsonEncodedText PropTotalEstimatedOverheadInBytes = System.Text.Json.JsonEncodedText.Encode("total_estimated_overhead_in_bytes"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.MappingStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propTotalCount = default; + LocalJsonValue propTotalEstimatedOverhead = default; + LocalJsonValue propTotalEstimatedOverheadInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propTotalCount.TryReadProperty(ref reader, options, PropTotalCount, null)) + { + continue; + } + + if (propTotalEstimatedOverhead.TryReadProperty(ref reader, options, PropTotalEstimatedOverhead, null)) + { + continue; + } + + if (propTotalEstimatedOverheadInBytes.TryReadProperty(ref reader, options, PropTotalEstimatedOverheadInBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.MappingStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + TotalCount = propTotalCount.Value, + TotalEstimatedOverhead = propTotalEstimatedOverhead.Value, + TotalEstimatedOverheadInBytes = propTotalEstimatedOverheadInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MappingStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropTotalCount, value.TotalCount, null, null); + writer.WriteProperty(options, PropTotalEstimatedOverhead, value.TotalEstimatedOverhead, null, null); + writer.WriteProperty(options, PropTotalEstimatedOverheadInBytes, value.TotalEstimatedOverheadInBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingStats.g.cs index 2a3ddaa9c82..947202666e4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingStats.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class MappingStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropTotalCount = System.Text.Json.JsonEncodedText.Encode("total_count"); - private static readonly System.Text.Json.JsonEncodedText PropTotalEstimatedOverhead = System.Text.Json.JsonEncodedText.Encode("total_estimated_overhead"); - private static readonly System.Text.Json.JsonEncodedText PropTotalEstimatedOverheadInBytes = System.Text.Json.JsonEncodedText.Encode("total_estimated_overhead_in_bytes"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.MappingStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propTotalCount = default; - LocalJsonValue propTotalEstimatedOverhead = default; - LocalJsonValue propTotalEstimatedOverheadInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propTotalCount.TryReadProperty(ref reader, options, PropTotalCount, null)) - { - continue; - } - - if (propTotalEstimatedOverhead.TryReadProperty(ref reader, options, PropTotalEstimatedOverhead, null)) - { - continue; - } - - if (propTotalEstimatedOverheadInBytes.TryReadProperty(ref reader, options, PropTotalEstimatedOverheadInBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.MappingStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - TotalCount = propTotalCount.Value, - TotalEstimatedOverhead = propTotalEstimatedOverhead.Value, - TotalEstimatedOverheadInBytes = propTotalEstimatedOverheadInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MappingStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropTotalCount, value.TotalCount, null, null); - writer.WriteProperty(options, PropTotalEstimatedOverhead, value.TotalEstimatedOverhead, null, null); - writer.WriteProperty(options, PropTotalEstimatedOverheadInBytes, value.TotalEstimatedOverheadInBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.MappingStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.MappingStatsConverter))] public sealed partial class MappingStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Merge.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Merge.Converters.g.cs new file mode 100644 index 00000000000..f6f256c3202 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Merge.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class MergeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropScheduler = System.Text.Json.JsonEncodedText.Encode("scheduler"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.Merge Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propScheduler = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propScheduler.TryReadProperty(ref reader, options, PropScheduler, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.Merge(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Scheduler = propScheduler.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.Merge value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropScheduler, value.Scheduler, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Merge.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Merge.g.cs index ce0018e04dc..a24060e30ad 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Merge.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Merge.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class MergeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropScheduler = System.Text.Json.JsonEncodedText.Encode("scheduler"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.Merge Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propScheduler = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propScheduler.TryReadProperty(ref reader, options, PropScheduler, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.Merge(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Scheduler = propScheduler.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.Merge value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropScheduler, value.Scheduler, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.MergeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.MergeConverter))] public sealed partial class Merge { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MergeScheduler.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MergeScheduler.Converters.g.cs new file mode 100644 index 00000000000..3080f884612 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MergeScheduler.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class MergeSchedulerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxMergeCount = System.Text.Json.JsonEncodedText.Encode("max_merge_count"); + private static readonly System.Text.Json.JsonEncodedText PropMaxThreadCount = System.Text.Json.JsonEncodedText.Encode("max_thread_count"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.MergeScheduler Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxMergeCount = default; + LocalJsonValue propMaxThreadCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxMergeCount.TryReadProperty(ref reader, options, PropMaxMergeCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxThreadCount.TryReadProperty(ref reader, options, PropMaxThreadCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.MergeScheduler(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxMergeCount = propMaxMergeCount.Value, + MaxThreadCount = propMaxThreadCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MergeScheduler value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxMergeCount, value.MaxMergeCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxThreadCount, value.MaxThreadCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MergeScheduler.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MergeScheduler.g.cs index 8ea88300943..895e9e2fb06 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MergeScheduler.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MergeScheduler.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class MergeSchedulerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxMergeCount = System.Text.Json.JsonEncodedText.Encode("max_merge_count"); - private static readonly System.Text.Json.JsonEncodedText PropMaxThreadCount = System.Text.Json.JsonEncodedText.Encode("max_thread_count"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.MergeScheduler Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxMergeCount = default; - LocalJsonValue propMaxThreadCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxMergeCount.TryReadProperty(ref reader, options, PropMaxMergeCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxThreadCount.TryReadProperty(ref reader, options, PropMaxThreadCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.MergeScheduler(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxMergeCount = propMaxMergeCount.Value, - MaxThreadCount = propMaxThreadCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MergeScheduler value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxMergeCount, value.MaxMergeCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxThreadCount, value.MaxThreadCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.MergeSchedulerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.MergeSchedulerConverter))] public sealed partial class MergeScheduler { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MigrateReindex.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MigrateReindex.Converters.g.cs new file mode 100644 index 00000000000..99ec3b7c0dd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MigrateReindex.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class MigrateReindexConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.MigrateReindex Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMode = default; + LocalJsonValue propSource = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMode.TryReadProperty(ref reader, options, PropMode, null)) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.MigrateReindex(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Mode = propMode.Value, + Source = propSource.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MigrateReindex value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMode, value.Mode, null, null); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MigrateReindex.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MigrateReindex.g.cs index 1297dd1e43a..85895f0752a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MigrateReindex.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MigrateReindex.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class MigrateReindexConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.MigrateReindex Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMode = default; - LocalJsonValue propSource = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMode.TryReadProperty(ref reader, options, PropMode, null)) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.MigrateReindex(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Mode = propMode.Value, - Source = propSource.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.MigrateReindex value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMode, value.Mode, null, null); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.MigrateReindexConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.MigrateReindexConverter))] public sealed partial class MigrateReindex { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ModeEnum.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ModeEnum.Converters.g.cs new file mode 100644 index 00000000000..456f999a52f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ModeEnum.Converters.g.cs @@ -0,0 +1,67 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ModeEnumConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberUpgrade = System.Text.Json.JsonEncodedText.Encode("upgrade"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ModeEnum Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberUpgrade)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ModeEnum.Upgrade; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberUpgrade.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ModeEnum.Upgrade; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.ModeEnum)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ModeEnum value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.IndexManagement.ModeEnum.Upgrade: + writer.WriteStringValue(MemberUpgrade); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.ModeEnum)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.IndexManagement.ModeEnum ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ModeEnum value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ModeEnum.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ModeEnum.g.cs new file mode 100644 index 00000000000..d9fcb0914a3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ModeEnum.g.cs @@ -0,0 +1,31 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ModeEnumConverter))] +public enum ModeEnum +{ + [System.Runtime.Serialization.EnumMember(Value = "upgrade")] + Upgrade +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/NumericFielddata.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/NumericFielddata.Converters.g.cs new file mode 100644 index 00000000000..c9d23b1f7ea --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/NumericFielddata.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class NumericFielddataConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddata Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFormat = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddata(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Format = propFormat.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddata value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/NumericFielddata.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/NumericFielddata.g.cs index b5ffa3cb116..c51ced34eca 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/NumericFielddata.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/NumericFielddata.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class NumericFielddataConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddata Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFormat = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddata(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Format = propFormat.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddata value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.NumericFielddataConverter))] public sealed partial class NumericFielddata { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/NumericFielddataFormat.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/NumericFielddataFormat.Converters.g.cs new file mode 100644 index 00000000000..bb0b53c094b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/NumericFielddataFormat.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class NumericFielddataFormatConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberArray = System.Text.Json.JsonEncodedText.Encode("array"); + private static readonly System.Text.Json.JsonEncodedText MemberDisabled = System.Text.Json.JsonEncodedText.Encode("disabled"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataFormat Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberArray)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataFormat.Array; + } + + if (reader.ValueTextEquals(MemberDisabled)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataFormat.Disabled; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberArray.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataFormat.Array; + } + + if (string.Equals(value, MemberDisabled.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataFormat.Disabled; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataFormat)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataFormat value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataFormat.Array: + writer.WriteStringValue(MemberArray); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataFormat.Disabled: + writer.WriteStringValue(MemberDisabled); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataFormat)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataFormat ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.NumericFielddataFormat value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/NumericFielddataFormat.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/NumericFielddataFormat.g.cs new file mode 100644 index 00000000000..d0f40052841 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/NumericFielddataFormat.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.NumericFielddataFormatConverter))] +public enum NumericFielddataFormat +{ + [System.Runtime.Serialization.EnumMember(Value = "array")] + Array, + [System.Runtime.Serialization.EnumMember(Value = "disabled")] + Disabled +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Overlapping.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Overlapping.Converters.g.cs new file mode 100644 index 00000000000..f7f2dea02cf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Overlapping.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class OverlappingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndexPatterns = System.Text.Json.JsonEncodedText.Encode("index_patterns"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.Overlapping Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propIndexPatterns = default; + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndexPatterns.TryReadProperty(ref reader, options, PropIndexPatterns, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.Overlapping(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + IndexPatterns = propIndexPatterns.Value, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.Overlapping value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndexPatterns, value.IndexPatterns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Overlapping.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Overlapping.g.cs index 5e59fb0889d..18615d07d6f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Overlapping.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Overlapping.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class OverlappingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndexPatterns = System.Text.Json.JsonEncodedText.Encode("index_patterns"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.Overlapping Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propIndexPatterns = default; - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndexPatterns.TryReadProperty(ref reader, options, PropIndexPatterns, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.Overlapping(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - IndexPatterns = propIndexPatterns.Value, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.Overlapping value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndexPatterns, value.IndexPatterns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.OverlappingConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.OverlappingConverter))] public sealed partial class Overlapping { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Queries.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Queries.Converters.g.cs new file mode 100644 index 00000000000..ec34114cb80 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Queries.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class QueriesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCache = System.Text.Json.JsonEncodedText.Encode("cache"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.Queries Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCache = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCache.TryReadProperty(ref reader, options, PropCache, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.Queries(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Cache = propCache.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.Queries value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCache, value.Cache, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Queries.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Queries.g.cs index 696ae5875b2..83e5d389b4f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Queries.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Queries.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class QueriesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCache = System.Text.Json.JsonEncodedText.Encode("cache"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.Queries Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCache = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCache.TryReadProperty(ref reader, options, PropCache, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.Queries(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Cache = propCache.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.Queries value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCache, value.Cache, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.QueriesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.QueriesConverter))] public sealed partial class Queries { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryBytes.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryBytes.Converters.g.cs new file mode 100644 index 00000000000..4d53392c525 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryBytes.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class RecoveryBytesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPercent = System.Text.Json.JsonEncodedText.Encode("percent"); + private static readonly System.Text.Json.JsonEncodedText PropRecovered = System.Text.Json.JsonEncodedText.Encode("recovered"); + private static readonly System.Text.Json.JsonEncodedText PropRecoveredFromSnapshot = System.Text.Json.JsonEncodedText.Encode("recovered_from_snapshot"); + private static readonly System.Text.Json.JsonEncodedText PropRecoveredFromSnapshotInBytes = System.Text.Json.JsonEncodedText.Encode("recovered_from_snapshot_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropRecoveredInBytes = System.Text.Json.JsonEncodedText.Encode("recovered_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropReused = System.Text.Json.JsonEncodedText.Encode("reused"); + private static readonly System.Text.Json.JsonEncodedText PropReusedInBytes = System.Text.Json.JsonEncodedText.Encode("reused_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + private static readonly System.Text.Json.JsonEncodedText PropTotalInBytes = System.Text.Json.JsonEncodedText.Encode("total_in_bytes"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.RecoveryBytes Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPercent = default; + LocalJsonValue propRecovered = default; + LocalJsonValue propRecoveredFromSnapshot = default; + LocalJsonValue propRecoveredFromSnapshotInBytes = default; + LocalJsonValue propRecoveredInBytes = default; + LocalJsonValue propReused = default; + LocalJsonValue propReusedInBytes = default; + LocalJsonValue propTotal = default; + LocalJsonValue propTotalInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPercent.TryReadProperty(ref reader, options, PropPercent, null)) + { + continue; + } + + if (propRecovered.TryReadProperty(ref reader, options, PropRecovered, null)) + { + continue; + } + + if (propRecoveredFromSnapshot.TryReadProperty(ref reader, options, PropRecoveredFromSnapshot, null)) + { + continue; + } + + if (propRecoveredFromSnapshotInBytes.TryReadProperty(ref reader, options, PropRecoveredFromSnapshotInBytes, null)) + { + continue; + } + + if (propRecoveredInBytes.TryReadProperty(ref reader, options, PropRecoveredInBytes, null)) + { + continue; + } + + if (propReused.TryReadProperty(ref reader, options, PropReused, null)) + { + continue; + } + + if (propReusedInBytes.TryReadProperty(ref reader, options, PropReusedInBytes, null)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (propTotalInBytes.TryReadProperty(ref reader, options, PropTotalInBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.RecoveryBytes(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Percent = propPercent.Value, + Recovered = propRecovered.Value, + RecoveredFromSnapshot = propRecoveredFromSnapshot.Value, + RecoveredFromSnapshotInBytes = propRecoveredFromSnapshotInBytes.Value, + RecoveredInBytes = propRecoveredInBytes.Value, + Reused = propReused.Value, + ReusedInBytes = propReusedInBytes.Value, + Total = propTotal.Value, + TotalInBytes = propTotalInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RecoveryBytes value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPercent, value.Percent, null, null); + writer.WriteProperty(options, PropRecovered, value.Recovered, null, null); + writer.WriteProperty(options, PropRecoveredFromSnapshot, value.RecoveredFromSnapshot, null, null); + writer.WriteProperty(options, PropRecoveredFromSnapshotInBytes, value.RecoveredFromSnapshotInBytes, null, null); + writer.WriteProperty(options, PropRecoveredInBytes, value.RecoveredInBytes, null, null); + writer.WriteProperty(options, PropReused, value.Reused, null, null); + writer.WriteProperty(options, PropReusedInBytes, value.ReusedInBytes, null, null); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteProperty(options, PropTotalInBytes, value.TotalInBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryBytes.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryBytes.g.cs index e5eec34b9f3..c0ab88366be 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryBytes.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryBytes.g.cs @@ -23,118 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class RecoveryBytesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPercent = System.Text.Json.JsonEncodedText.Encode("percent"); - private static readonly System.Text.Json.JsonEncodedText PropRecovered = System.Text.Json.JsonEncodedText.Encode("recovered"); - private static readonly System.Text.Json.JsonEncodedText PropRecoveredFromSnapshot = System.Text.Json.JsonEncodedText.Encode("recovered_from_snapshot"); - private static readonly System.Text.Json.JsonEncodedText PropRecoveredFromSnapshotInBytes = System.Text.Json.JsonEncodedText.Encode("recovered_from_snapshot_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropRecoveredInBytes = System.Text.Json.JsonEncodedText.Encode("recovered_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropReused = System.Text.Json.JsonEncodedText.Encode("reused"); - private static readonly System.Text.Json.JsonEncodedText PropReusedInBytes = System.Text.Json.JsonEncodedText.Encode("reused_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - private static readonly System.Text.Json.JsonEncodedText PropTotalInBytes = System.Text.Json.JsonEncodedText.Encode("total_in_bytes"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.RecoveryBytes Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPercent = default; - LocalJsonValue propRecovered = default; - LocalJsonValue propRecoveredFromSnapshot = default; - LocalJsonValue propRecoveredFromSnapshotInBytes = default; - LocalJsonValue propRecoveredInBytes = default; - LocalJsonValue propReused = default; - LocalJsonValue propReusedInBytes = default; - LocalJsonValue propTotal = default; - LocalJsonValue propTotalInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPercent.TryReadProperty(ref reader, options, PropPercent, null)) - { - continue; - } - - if (propRecovered.TryReadProperty(ref reader, options, PropRecovered, null)) - { - continue; - } - - if (propRecoveredFromSnapshot.TryReadProperty(ref reader, options, PropRecoveredFromSnapshot, null)) - { - continue; - } - - if (propRecoveredFromSnapshotInBytes.TryReadProperty(ref reader, options, PropRecoveredFromSnapshotInBytes, null)) - { - continue; - } - - if (propRecoveredInBytes.TryReadProperty(ref reader, options, PropRecoveredInBytes, null)) - { - continue; - } - - if (propReused.TryReadProperty(ref reader, options, PropReused, null)) - { - continue; - } - - if (propReusedInBytes.TryReadProperty(ref reader, options, PropReusedInBytes, null)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (propTotalInBytes.TryReadProperty(ref reader, options, PropTotalInBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.RecoveryBytes(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Percent = propPercent.Value, - Recovered = propRecovered.Value, - RecoveredFromSnapshot = propRecoveredFromSnapshot.Value, - RecoveredFromSnapshotInBytes = propRecoveredFromSnapshotInBytes.Value, - RecoveredInBytes = propRecoveredInBytes.Value, - Reused = propReused.Value, - ReusedInBytes = propReusedInBytes.Value, - Total = propTotal.Value, - TotalInBytes = propTotalInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RecoveryBytes value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPercent, value.Percent, null, null); - writer.WriteProperty(options, PropRecovered, value.Recovered, null, null); - writer.WriteProperty(options, PropRecoveredFromSnapshot, value.RecoveredFromSnapshot, null, null); - writer.WriteProperty(options, PropRecoveredFromSnapshotInBytes, value.RecoveredFromSnapshotInBytes, null, null); - writer.WriteProperty(options, PropRecoveredInBytes, value.RecoveredInBytes, null, null); - writer.WriteProperty(options, PropReused, value.Reused, null, null); - writer.WriteProperty(options, PropReusedInBytes, value.ReusedInBytes, null, null); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteProperty(options, PropTotalInBytes, value.TotalInBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.RecoveryBytesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.RecoveryBytesConverter))] public sealed partial class RecoveryBytes { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryFiles.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryFiles.Converters.g.cs new file mode 100644 index 00000000000..82e6c495e24 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryFiles.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class RecoveryFilesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); + private static readonly System.Text.Json.JsonEncodedText PropPercent = System.Text.Json.JsonEncodedText.Encode("percent"); + private static readonly System.Text.Json.JsonEncodedText PropRecovered = System.Text.Json.JsonEncodedText.Encode("recovered"); + private static readonly System.Text.Json.JsonEncodedText PropReused = System.Text.Json.JsonEncodedText.Encode("reused"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.RecoveryFiles Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propDetails = default; + LocalJsonValue propPercent = default; + LocalJsonValue propRecovered = default; + LocalJsonValue propReused = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDetails.TryReadProperty(ref reader, options, PropDetails, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propPercent.TryReadProperty(ref reader, options, PropPercent, null)) + { + continue; + } + + if (propRecovered.TryReadProperty(ref reader, options, PropRecovered, null)) + { + continue; + } + + if (propReused.TryReadProperty(ref reader, options, PropReused, null)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.RecoveryFiles(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Details = propDetails.Value, + Percent = propPercent.Value, + Recovered = propRecovered.Value, + Reused = propReused.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RecoveryFiles value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDetails, value.Details, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPercent, value.Percent, null, null); + writer.WriteProperty(options, PropRecovered, value.Recovered, null, null); + writer.WriteProperty(options, PropReused, value.Reused, null, null); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryFiles.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryFiles.g.cs index e7f8727e06a..e0450f7b1d7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryFiles.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryFiles.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class RecoveryFilesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); - private static readonly System.Text.Json.JsonEncodedText PropPercent = System.Text.Json.JsonEncodedText.Encode("percent"); - private static readonly System.Text.Json.JsonEncodedText PropRecovered = System.Text.Json.JsonEncodedText.Encode("recovered"); - private static readonly System.Text.Json.JsonEncodedText PropReused = System.Text.Json.JsonEncodedText.Encode("reused"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.RecoveryFiles Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propDetails = default; - LocalJsonValue propPercent = default; - LocalJsonValue propRecovered = default; - LocalJsonValue propReused = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDetails.TryReadProperty(ref reader, options, PropDetails, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propPercent.TryReadProperty(ref reader, options, PropPercent, null)) - { - continue; - } - - if (propRecovered.TryReadProperty(ref reader, options, PropRecovered, null)) - { - continue; - } - - if (propReused.TryReadProperty(ref reader, options, PropReused, null)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.RecoveryFiles(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Details = propDetails.Value, - Percent = propPercent.Value, - Recovered = propRecovered.Value, - Reused = propReused.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RecoveryFiles value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDetails, value.Details, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPercent, value.Percent, null, null); - writer.WriteProperty(options, PropRecovered, value.Recovered, null, null); - writer.WriteProperty(options, PropReused, value.Reused, null, null); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.RecoveryFilesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.RecoveryFilesConverter))] public sealed partial class RecoveryFiles { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryIndexStatus.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryIndexStatus.Converters.g.cs new file mode 100644 index 00000000000..8eac7ee826a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryIndexStatus.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class RecoveryIndexStatusConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBytes = System.Text.Json.JsonEncodedText.Encode("bytes"); + private static readonly System.Text.Json.JsonEncodedText PropFiles = System.Text.Json.JsonEncodedText.Encode("files"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropSourceThrottleTime = System.Text.Json.JsonEncodedText.Encode("source_throttle_time"); + private static readonly System.Text.Json.JsonEncodedText PropSourceThrottleTimeInMillis = System.Text.Json.JsonEncodedText.Encode("source_throttle_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTargetThrottleTime = System.Text.Json.JsonEncodedText.Encode("target_throttle_time"); + private static readonly System.Text.Json.JsonEncodedText PropTargetThrottleTimeInMillis = System.Text.Json.JsonEncodedText.Encode("target_throttle_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTotalTime = System.Text.Json.JsonEncodedText.Encode("total_time"); + private static readonly System.Text.Json.JsonEncodedText PropTotalTimeInMillis = System.Text.Json.JsonEncodedText.Encode("total_time_in_millis"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.RecoveryIndexStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBytes = default; + LocalJsonValue propFiles = default; + LocalJsonValue propSize = default; + LocalJsonValue propSourceThrottleTime = default; + LocalJsonValue propSourceThrottleTimeInMillis = default; + LocalJsonValue propTargetThrottleTime = default; + LocalJsonValue propTargetThrottleTimeInMillis = default; + LocalJsonValue propTotalTime = default; + LocalJsonValue propTotalTimeInMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBytes.TryReadProperty(ref reader, options, PropBytes, null)) + { + continue; + } + + if (propFiles.TryReadProperty(ref reader, options, PropFiles, null)) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, null)) + { + continue; + } + + if (propSourceThrottleTime.TryReadProperty(ref reader, options, PropSourceThrottleTime, null)) + { + continue; + } + + if (propSourceThrottleTimeInMillis.TryReadProperty(ref reader, options, PropSourceThrottleTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTargetThrottleTime.TryReadProperty(ref reader, options, PropTargetThrottleTime, null)) + { + continue; + } + + if (propTargetThrottleTimeInMillis.TryReadProperty(ref reader, options, PropTargetThrottleTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTotalTime.TryReadProperty(ref reader, options, PropTotalTime, null)) + { + continue; + } + + if (propTotalTimeInMillis.TryReadProperty(ref reader, options, PropTotalTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.RecoveryIndexStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Bytes = propBytes.Value, + Files = propFiles.Value, + Size = propSize.Value, + SourceThrottleTime = propSourceThrottleTime.Value, + SourceThrottleTimeInMillis = propSourceThrottleTimeInMillis.Value, + TargetThrottleTime = propTargetThrottleTime.Value, + TargetThrottleTimeInMillis = propTargetThrottleTimeInMillis.Value, + TotalTime = propTotalTime.Value, + TotalTimeInMillis = propTotalTimeInMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RecoveryIndexStatus value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBytes, value.Bytes, null, null); + writer.WriteProperty(options, PropFiles, value.Files, null, null); + writer.WriteProperty(options, PropSize, value.Size, null, null); + writer.WriteProperty(options, PropSourceThrottleTime, value.SourceThrottleTime, null, null); + writer.WriteProperty(options, PropSourceThrottleTimeInMillis, value.SourceThrottleTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTargetThrottleTime, value.TargetThrottleTime, null, null); + writer.WriteProperty(options, PropTargetThrottleTimeInMillis, value.TargetThrottleTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTotalTime, value.TotalTime, null, null); + writer.WriteProperty(options, PropTotalTimeInMillis, value.TotalTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryIndexStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryIndexStatus.g.cs index d370d9d29cf..ea72e700b27 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryIndexStatus.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryIndexStatus.g.cs @@ -23,118 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class RecoveryIndexStatusConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBytes = System.Text.Json.JsonEncodedText.Encode("bytes"); - private static readonly System.Text.Json.JsonEncodedText PropFiles = System.Text.Json.JsonEncodedText.Encode("files"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropSourceThrottleTime = System.Text.Json.JsonEncodedText.Encode("source_throttle_time"); - private static readonly System.Text.Json.JsonEncodedText PropSourceThrottleTimeInMillis = System.Text.Json.JsonEncodedText.Encode("source_throttle_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTargetThrottleTime = System.Text.Json.JsonEncodedText.Encode("target_throttle_time"); - private static readonly System.Text.Json.JsonEncodedText PropTargetThrottleTimeInMillis = System.Text.Json.JsonEncodedText.Encode("target_throttle_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTotalTime = System.Text.Json.JsonEncodedText.Encode("total_time"); - private static readonly System.Text.Json.JsonEncodedText PropTotalTimeInMillis = System.Text.Json.JsonEncodedText.Encode("total_time_in_millis"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.RecoveryIndexStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBytes = default; - LocalJsonValue propFiles = default; - LocalJsonValue propSize = default; - LocalJsonValue propSourceThrottleTime = default; - LocalJsonValue propSourceThrottleTimeInMillis = default; - LocalJsonValue propTargetThrottleTime = default; - LocalJsonValue propTargetThrottleTimeInMillis = default; - LocalJsonValue propTotalTime = default; - LocalJsonValue propTotalTimeInMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBytes.TryReadProperty(ref reader, options, PropBytes, null)) - { - continue; - } - - if (propFiles.TryReadProperty(ref reader, options, PropFiles, null)) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, null)) - { - continue; - } - - if (propSourceThrottleTime.TryReadProperty(ref reader, options, PropSourceThrottleTime, null)) - { - continue; - } - - if (propSourceThrottleTimeInMillis.TryReadProperty(ref reader, options, PropSourceThrottleTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTargetThrottleTime.TryReadProperty(ref reader, options, PropTargetThrottleTime, null)) - { - continue; - } - - if (propTargetThrottleTimeInMillis.TryReadProperty(ref reader, options, PropTargetThrottleTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTotalTime.TryReadProperty(ref reader, options, PropTotalTime, null)) - { - continue; - } - - if (propTotalTimeInMillis.TryReadProperty(ref reader, options, PropTotalTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.RecoveryIndexStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Bytes = propBytes.Value, - Files = propFiles.Value, - Size = propSize.Value, - SourceThrottleTime = propSourceThrottleTime.Value, - SourceThrottleTimeInMillis = propSourceThrottleTimeInMillis.Value, - TargetThrottleTime = propTargetThrottleTime.Value, - TargetThrottleTimeInMillis = propTargetThrottleTimeInMillis.Value, - TotalTime = propTotalTime.Value, - TotalTimeInMillis = propTotalTimeInMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RecoveryIndexStatus value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBytes, value.Bytes, null, null); - writer.WriteProperty(options, PropFiles, value.Files, null, null); - writer.WriteProperty(options, PropSize, value.Size, null, null); - writer.WriteProperty(options, PropSourceThrottleTime, value.SourceThrottleTime, null, null); - writer.WriteProperty(options, PropSourceThrottleTimeInMillis, value.SourceThrottleTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTargetThrottleTime, value.TargetThrottleTime, null, null); - writer.WriteProperty(options, PropTargetThrottleTimeInMillis, value.TargetThrottleTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTotalTime, value.TotalTime, null, null); - writer.WriteProperty(options, PropTotalTimeInMillis, value.TotalTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.RecoveryIndexStatusConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.RecoveryIndexStatusConverter))] public sealed partial class RecoveryIndexStatus { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryOrigin.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryOrigin.Converters.g.cs new file mode 100644 index 00000000000..f42c84d6e68 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryOrigin.Converters.g.cs @@ -0,0 +1,162 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class RecoveryOriginConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBootstrapNewHistoryUuid = System.Text.Json.JsonEncodedText.Encode("bootstrap_new_history_uuid"); + private static readonly System.Text.Json.JsonEncodedText PropHost = System.Text.Json.JsonEncodedText.Encode("host"); + private static readonly System.Text.Json.JsonEncodedText PropHostname = System.Text.Json.JsonEncodedText.Encode("hostname"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropIp = System.Text.Json.JsonEncodedText.Encode("ip"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropRepository = System.Text.Json.JsonEncodedText.Encode("repository"); + private static readonly System.Text.Json.JsonEncodedText PropRestoreUuid = System.Text.Json.JsonEncodedText.Encode("restoreUUID"); + private static readonly System.Text.Json.JsonEncodedText PropSnapshot = System.Text.Json.JsonEncodedText.Encode("snapshot"); + private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.RecoveryOrigin Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBootstrapNewHistoryUuid = default; + LocalJsonValue propHost = default; + LocalJsonValue propHostname = default; + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + LocalJsonValue propIp = default; + LocalJsonValue propName = default; + LocalJsonValue propRepository = default; + LocalJsonValue propRestoreUuid = default; + LocalJsonValue propSnapshot = default; + LocalJsonValue propTransportAddress = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBootstrapNewHistoryUuid.TryReadProperty(ref reader, options, PropBootstrapNewHistoryUuid, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propHost.TryReadProperty(ref reader, options, PropHost, null)) + { + continue; + } + + if (propHostname.TryReadProperty(ref reader, options, PropHostname, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propIp.TryReadProperty(ref reader, options, PropIp, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propRepository.TryReadProperty(ref reader, options, PropRepository, null)) + { + continue; + } + + if (propRestoreUuid.TryReadProperty(ref reader, options, PropRestoreUuid, null)) + { + continue; + } + + if (propSnapshot.TryReadProperty(ref reader, options, PropSnapshot, null)) + { + continue; + } + + if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.RecoveryOrigin(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BootstrapNewHistoryUuid = propBootstrapNewHistoryUuid.Value, + Host = propHost.Value, + Hostname = propHostname.Value, + Id = propId.Value, + Index = propIndex.Value, + Ip = propIp.Value, + Name = propName.Value, + Repository = propRepository.Value, + RestoreUuid = propRestoreUuid.Value, + Snapshot = propSnapshot.Value, + TransportAddress = propTransportAddress.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RecoveryOrigin value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBootstrapNewHistoryUuid, value.BootstrapNewHistoryUuid, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropHost, value.Host, null, null); + writer.WriteProperty(options, PropHostname, value.Hostname, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropIp, value.Ip, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropRepository, value.Repository, null, null); + writer.WriteProperty(options, PropRestoreUuid, value.RestoreUuid, null, null); + writer.WriteProperty(options, PropSnapshot, value.Snapshot, null, null); + writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryOrigin.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryOrigin.g.cs index f55c87fc077..7322ac89036 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryOrigin.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryOrigin.g.cs @@ -23,145 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class RecoveryOriginConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBootstrapNewHistoryUuid = System.Text.Json.JsonEncodedText.Encode("bootstrap_new_history_uuid"); - private static readonly System.Text.Json.JsonEncodedText PropHost = System.Text.Json.JsonEncodedText.Encode("host"); - private static readonly System.Text.Json.JsonEncodedText PropHostname = System.Text.Json.JsonEncodedText.Encode("hostname"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropIp = System.Text.Json.JsonEncodedText.Encode("ip"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropRepository = System.Text.Json.JsonEncodedText.Encode("repository"); - private static readonly System.Text.Json.JsonEncodedText PropRestoreUuid = System.Text.Json.JsonEncodedText.Encode("restoreUUID"); - private static readonly System.Text.Json.JsonEncodedText PropSnapshot = System.Text.Json.JsonEncodedText.Encode("snapshot"); - private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.RecoveryOrigin Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBootstrapNewHistoryUuid = default; - LocalJsonValue propHost = default; - LocalJsonValue propHostname = default; - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - LocalJsonValue propIp = default; - LocalJsonValue propName = default; - LocalJsonValue propRepository = default; - LocalJsonValue propRestoreUuid = default; - LocalJsonValue propSnapshot = default; - LocalJsonValue propTransportAddress = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBootstrapNewHistoryUuid.TryReadProperty(ref reader, options, PropBootstrapNewHistoryUuid, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propHost.TryReadProperty(ref reader, options, PropHost, null)) - { - continue; - } - - if (propHostname.TryReadProperty(ref reader, options, PropHostname, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propIp.TryReadProperty(ref reader, options, PropIp, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propRepository.TryReadProperty(ref reader, options, PropRepository, null)) - { - continue; - } - - if (propRestoreUuid.TryReadProperty(ref reader, options, PropRestoreUuid, null)) - { - continue; - } - - if (propSnapshot.TryReadProperty(ref reader, options, PropSnapshot, null)) - { - continue; - } - - if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.RecoveryOrigin(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BootstrapNewHistoryUuid = propBootstrapNewHistoryUuid.Value, - Host = propHost.Value, - Hostname = propHostname.Value, - Id = propId.Value, - Index = propIndex.Value, - Ip = propIp.Value, - Name = propName.Value, - Repository = propRepository.Value, - RestoreUuid = propRestoreUuid.Value, - Snapshot = propSnapshot.Value, - TransportAddress = propTransportAddress.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RecoveryOrigin value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBootstrapNewHistoryUuid, value.BootstrapNewHistoryUuid, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropHost, value.Host, null, null); - writer.WriteProperty(options, PropHostname, value.Hostname, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropIp, value.Ip, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropRepository, value.Repository, null, null); - writer.WriteProperty(options, PropRestoreUuid, value.RestoreUuid, null, null); - writer.WriteProperty(options, PropSnapshot, value.Snapshot, null, null); - writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.RecoveryOriginConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.RecoveryOriginConverter))] public sealed partial class RecoveryOrigin { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryStartStatus.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryStartStatus.Converters.g.cs new file mode 100644 index 00000000000..46ac1aa90e4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryStartStatus.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class RecoveryStartStatusConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCheckIndexTime = System.Text.Json.JsonEncodedText.Encode("check_index_time"); + private static readonly System.Text.Json.JsonEncodedText PropCheckIndexTimeInMillis = System.Text.Json.JsonEncodedText.Encode("check_index_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTotalTime = System.Text.Json.JsonEncodedText.Encode("total_time"); + private static readonly System.Text.Json.JsonEncodedText PropTotalTimeInMillis = System.Text.Json.JsonEncodedText.Encode("total_time_in_millis"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.RecoveryStartStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCheckIndexTime = default; + LocalJsonValue propCheckIndexTimeInMillis = default; + LocalJsonValue propTotalTime = default; + LocalJsonValue propTotalTimeInMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCheckIndexTime.TryReadProperty(ref reader, options, PropCheckIndexTime, null)) + { + continue; + } + + if (propCheckIndexTimeInMillis.TryReadProperty(ref reader, options, PropCheckIndexTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTotalTime.TryReadProperty(ref reader, options, PropTotalTime, null)) + { + continue; + } + + if (propTotalTimeInMillis.TryReadProperty(ref reader, options, PropTotalTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.RecoveryStartStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CheckIndexTime = propCheckIndexTime.Value, + CheckIndexTimeInMillis = propCheckIndexTimeInMillis.Value, + TotalTime = propTotalTime.Value, + TotalTimeInMillis = propTotalTimeInMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RecoveryStartStatus value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCheckIndexTime, value.CheckIndexTime, null, null); + writer.WriteProperty(options, PropCheckIndexTimeInMillis, value.CheckIndexTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTotalTime, value.TotalTime, null, null); + writer.WriteProperty(options, PropTotalTimeInMillis, value.TotalTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryStartStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryStartStatus.g.cs index 0bbb8c2aa69..7569b8edb39 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryStartStatus.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryStartStatus.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class RecoveryStartStatusConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCheckIndexTime = System.Text.Json.JsonEncodedText.Encode("check_index_time"); - private static readonly System.Text.Json.JsonEncodedText PropCheckIndexTimeInMillis = System.Text.Json.JsonEncodedText.Encode("check_index_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTotalTime = System.Text.Json.JsonEncodedText.Encode("total_time"); - private static readonly System.Text.Json.JsonEncodedText PropTotalTimeInMillis = System.Text.Json.JsonEncodedText.Encode("total_time_in_millis"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.RecoveryStartStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCheckIndexTime = default; - LocalJsonValue propCheckIndexTimeInMillis = default; - LocalJsonValue propTotalTime = default; - LocalJsonValue propTotalTimeInMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCheckIndexTime.TryReadProperty(ref reader, options, PropCheckIndexTime, null)) - { - continue; - } - - if (propCheckIndexTimeInMillis.TryReadProperty(ref reader, options, PropCheckIndexTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTotalTime.TryReadProperty(ref reader, options, PropTotalTime, null)) - { - continue; - } - - if (propTotalTimeInMillis.TryReadProperty(ref reader, options, PropTotalTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.RecoveryStartStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CheckIndexTime = propCheckIndexTime.Value, - CheckIndexTimeInMillis = propCheckIndexTimeInMillis.Value, - TotalTime = propTotalTime.Value, - TotalTimeInMillis = propTotalTimeInMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RecoveryStartStatus value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCheckIndexTime, value.CheckIndexTime, null, null); - writer.WriteProperty(options, PropCheckIndexTimeInMillis, value.CheckIndexTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTotalTime, value.TotalTime, null, null); - writer.WriteProperty(options, PropTotalTimeInMillis, value.TotalTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.RecoveryStartStatusConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.RecoveryStartStatusConverter))] public sealed partial class RecoveryStartStatus { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryStatus.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryStatus.Converters.g.cs new file mode 100644 index 00000000000..35dcf2a4776 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryStatus.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class RecoveryStatusConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.RecoveryStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propShards = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propShards.TryReadProperty(ref reader, options, PropShards, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.RecoveryStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Shards = propShards.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RecoveryStatus value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropShards, value.Shards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryStatus.g.cs index fdf1fe9938b..0558d6a9a23 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryStatus.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RecoveryStatus.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class RecoveryStatusConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.RecoveryStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propShards = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propShards.TryReadProperty(ref reader, options, PropShards, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.RecoveryStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Shards = propShards.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RecoveryStatus value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropShards, value.Shards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.RecoveryStatusConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.RecoveryStatusConverter))] public sealed partial class RecoveryStatus { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ReloadDetails.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ReloadDetails.Converters.g.cs new file mode 100644 index 00000000000..3c25638f466 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ReloadDetails.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ReloadDetailsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropReloadedAnalyzers = System.Text.Json.JsonEncodedText.Encode("reloaded_analyzers"); + private static readonly System.Text.Json.JsonEncodedText PropReloadedNodeIds = System.Text.Json.JsonEncodedText.Encode("reloaded_node_ids"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ReloadDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndex = default; + LocalJsonValue> propReloadedAnalyzers = default; + LocalJsonValue> propReloadedNodeIds = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propReloadedAnalyzers.TryReadProperty(ref reader, options, PropReloadedAnalyzers, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propReloadedNodeIds.TryReadProperty(ref reader, options, PropReloadedNodeIds, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ReloadDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Index = propIndex.Value, + ReloadedAnalyzers = propReloadedAnalyzers.Value, + ReloadedNodeIds = propReloadedNodeIds.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ReloadDetails value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropReloadedAnalyzers, value.ReloadedAnalyzers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropReloadedNodeIds, value.ReloadedNodeIds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ReloadDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ReloadDetails.g.cs index b74e42b468f..4e00ab7e85f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ReloadDetails.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ReloadDetails.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ReloadDetailsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropReloadedAnalyzers = System.Text.Json.JsonEncodedText.Encode("reloaded_analyzers"); - private static readonly System.Text.Json.JsonEncodedText PropReloadedNodeIds = System.Text.Json.JsonEncodedText.Encode("reloaded_node_ids"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ReloadDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndex = default; - LocalJsonValue> propReloadedAnalyzers = default; - LocalJsonValue> propReloadedNodeIds = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propReloadedAnalyzers.TryReadProperty(ref reader, options, PropReloadedAnalyzers, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propReloadedNodeIds.TryReadProperty(ref reader, options, PropReloadedNodeIds, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ReloadDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Index = propIndex.Value, - ReloadedAnalyzers = propReloadedAnalyzers.Value, - ReloadedNodeIds = propReloadedNodeIds.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ReloadDetails value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropReloadedAnalyzers, value.ReloadedAnalyzers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropReloadedNodeIds, value.ReloadedNodeIds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ReloadDetailsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ReloadDetailsConverter))] public sealed partial class ReloadDetails { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ReloadResult.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ReloadResult.Converters.g.cs new file mode 100644 index 00000000000..66b105719f8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ReloadResult.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ReloadResultConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropReloadDetails = System.Text.Json.JsonEncodedText.Encode("reload_details"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ReloadResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propReloadDetails = default; + LocalJsonValue propShards = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propReloadDetails.TryReadProperty(ref reader, options, PropReloadDetails, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ReloadResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ReloadDetails = propReloadDetails.Value, + Shards = propShards.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ReloadResult value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropReloadDetails, value.ReloadDetails, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ReloadResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ReloadResult.g.cs index fbf6cceb306..a3e91fc6dd8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ReloadResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ReloadResult.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ReloadResultConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropReloadDetails = System.Text.Json.JsonEncodedText.Encode("reload_details"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ReloadResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propReloadDetails = default; - LocalJsonValue propShards = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propReloadDetails.TryReadProperty(ref reader, options, PropReloadDetails, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ReloadResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ReloadDetails = propReloadDetails.Value, - Shards = propShards.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ReloadResult value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropReloadDetails, value.ReloadDetails, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ReloadResultConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ReloadResultConverter))] public sealed partial class ReloadResult { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveAction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveAction.Converters.g.cs new file mode 100644 index 00000000000..697648d4ab7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveAction.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class RemoveActionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAlias = System.Text.Json.JsonEncodedText.Encode("alias"); + private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropMustExist = System.Text.Json.JsonEncodedText.Encode("must_exist"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.RemoveAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAlias = default; + LocalJsonValue?> propAliases = default; + LocalJsonValue propIndex = default; + LocalJsonValue propIndices = default; + LocalJsonValue propMustExist = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAlias.TryReadProperty(ref reader, options, PropAlias, null)) + { + continue; + } + + if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) + { + continue; + } + + if (propMustExist.TryReadProperty(ref reader, options, PropMustExist, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.RemoveAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Alias = propAlias.Value, + Aliases = propAliases.Value, + Index = propIndex.Value, + Indices = propIndices.Value, + MustExist = propMustExist.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RemoveAction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAlias, value.Alias, null, null); + writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropIndices, value.Indices, null, null); + writer.WriteProperty(options, PropMustExist, value.MustExist, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveAction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveAction.g.cs index 4669ab7d501..b886445f3a4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveAction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveAction.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class RemoveActionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAlias = System.Text.Json.JsonEncodedText.Encode("alias"); - private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropMustExist = System.Text.Json.JsonEncodedText.Encode("must_exist"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.RemoveAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAlias = default; - LocalJsonValue?> propAliases = default; - LocalJsonValue propIndex = default; - LocalJsonValue propIndices = default; - LocalJsonValue propMustExist = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAlias.TryReadProperty(ref reader, options, PropAlias, null)) - { - continue; - } - - if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) - { - continue; - } - - if (propMustExist.TryReadProperty(ref reader, options, PropMustExist, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.RemoveAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Alias = propAlias.Value, - Aliases = propAliases.Value, - Index = propIndex.Value, - Indices = propIndices.Value, - MustExist = propMustExist.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RemoveAction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAlias, value.Alias, null, null); - writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropIndices, value.Indices, null, null); - writer.WriteProperty(options, PropMustExist, value.MustExist, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.RemoveActionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.RemoveActionConverter))] public sealed partial class RemoveAction { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveIndexAction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveIndexAction.Converters.g.cs new file mode 100644 index 00000000000..e6d37808f14 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveIndexAction.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class RemoveIndexActionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropMustExist = System.Text.Json.JsonEncodedText.Encode("must_exist"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.RemoveIndexAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndex = default; + LocalJsonValue propIndices = default; + LocalJsonValue propMustExist = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) + { + continue; + } + + if (propMustExist.TryReadProperty(ref reader, options, PropMustExist, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.RemoveIndexAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Index = propIndex.Value, + Indices = propIndices.Value, + MustExist = propMustExist.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RemoveIndexAction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropIndices, value.Indices, null, null); + writer.WriteProperty(options, PropMustExist, value.MustExist, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveIndexAction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveIndexAction.g.cs index 8258fe80293..234ab94922c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveIndexAction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveIndexAction.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class RemoveIndexActionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropMustExist = System.Text.Json.JsonEncodedText.Encode("must_exist"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.RemoveIndexAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndex = default; - LocalJsonValue propIndices = default; - LocalJsonValue propMustExist = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) - { - continue; - } - - if (propMustExist.TryReadProperty(ref reader, options, PropMustExist, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.RemoveIndexAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Index = propIndex.Value, - Indices = propIndices.Value, - MustExist = propMustExist.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RemoveIndexAction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropIndices, value.Indices, null, null); - writer.WriteProperty(options, PropMustExist, value.MustExist, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.RemoveIndexActionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.RemoveIndexActionConverter))] public sealed partial class RemoveIndexAction { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveIndicesBlockStatus.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveIndicesBlockStatus.Converters.g.cs new file mode 100644 index 00000000000..41f35743eac --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveIndicesBlockStatus.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class RemoveIndicesBlockStatusConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropException = System.Text.Json.JsonEncodedText.Encode("exception"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropUnblocked = System.Text.Json.JsonEncodedText.Encode("unblocked"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.RemoveIndicesBlockStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propException = default; + LocalJsonValue propName = default; + LocalJsonValue propUnblocked = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propException.TryReadProperty(ref reader, options, PropException, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propUnblocked.TryReadProperty(ref reader, options, PropUnblocked, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.RemoveIndicesBlockStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Exception = propException.Value, + Name = propName.Value, + Unblocked = propUnblocked.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RemoveIndicesBlockStatus value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropException, value.Exception, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropUnblocked, value.Unblocked, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveIndicesBlockStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveIndicesBlockStatus.g.cs index dc44db0593b..06db3fbc891 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveIndicesBlockStatus.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RemoveIndicesBlockStatus.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class RemoveIndicesBlockStatusConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropException = System.Text.Json.JsonEncodedText.Encode("exception"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropUnblocked = System.Text.Json.JsonEncodedText.Encode("unblocked"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.RemoveIndicesBlockStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propException = default; - LocalJsonValue propName = default; - LocalJsonValue propUnblocked = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propException.TryReadProperty(ref reader, options, PropException, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propUnblocked.TryReadProperty(ref reader, options, PropUnblocked, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.RemoveIndicesBlockStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Exception = propException.Value, - Name = propName.Value, - Unblocked = propUnblocked.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RemoveIndicesBlockStatus value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropException, value.Exception, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropUnblocked, value.Unblocked, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.RemoveIndicesBlockStatusConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.RemoveIndicesBlockStatusConverter))] public sealed partial class RemoveIndicesBlockStatus { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveClusterInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveClusterInfo.Converters.g.cs new file mode 100644 index 00000000000..1d0793b7bb2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveClusterInfo.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ResolveClusterInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropConnected = System.Text.Json.JsonEncodedText.Encode("connected"); + private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); + private static readonly System.Text.Json.JsonEncodedText PropMatchingIndices = System.Text.Json.JsonEncodedText.Encode("matching_indices"); + private static readonly System.Text.Json.JsonEncodedText PropSkipUnavailable = System.Text.Json.JsonEncodedText.Encode("skip_unavailable"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ResolveClusterInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propConnected = default; + LocalJsonValue propError = default; + LocalJsonValue propMatchingIndices = default; + LocalJsonValue propSkipUnavailable = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propConnected.TryReadProperty(ref reader, options, PropConnected, null)) + { + continue; + } + + if (propError.TryReadProperty(ref reader, options, PropError, null)) + { + continue; + } + + if (propMatchingIndices.TryReadProperty(ref reader, options, PropMatchingIndices, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSkipUnavailable.TryReadProperty(ref reader, options, PropSkipUnavailable, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ResolveClusterInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Connected = propConnected.Value, + Error = propError.Value, + MatchingIndices = propMatchingIndices.Value, + SkipUnavailable = propSkipUnavailable.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ResolveClusterInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropConnected, value.Connected, null, null); + writer.WriteProperty(options, PropError, value.Error, null, null); + writer.WriteProperty(options, PropMatchingIndices, value.MatchingIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSkipUnavailable, value.SkipUnavailable, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveClusterInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveClusterInfo.g.cs index 1b4161d6e35..4e7cb39ff46 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveClusterInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveClusterInfo.g.cs @@ -23,87 +23,12 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ResolveClusterInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropConnected = System.Text.Json.JsonEncodedText.Encode("connected"); - private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); - private static readonly System.Text.Json.JsonEncodedText PropMatchingIndices = System.Text.Json.JsonEncodedText.Encode("matching_indices"); - private static readonly System.Text.Json.JsonEncodedText PropSkipUnavailable = System.Text.Json.JsonEncodedText.Encode("skip_unavailable"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ResolveClusterInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propConnected = default; - LocalJsonValue propError = default; - LocalJsonValue propMatchingIndices = default; - LocalJsonValue propSkipUnavailable = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propConnected.TryReadProperty(ref reader, options, PropConnected, null)) - { - continue; - } - - if (propError.TryReadProperty(ref reader, options, PropError, null)) - { - continue; - } - - if (propMatchingIndices.TryReadProperty(ref reader, options, PropMatchingIndices, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSkipUnavailable.TryReadProperty(ref reader, options, PropSkipUnavailable, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ResolveClusterInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Connected = propConnected.Value, - Error = propError.Value, - MatchingIndices = propMatchingIndices.Value, - SkipUnavailable = propSkipUnavailable.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ResolveClusterInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropConnected, value.Connected, null, null); - writer.WriteProperty(options, PropError, value.Error, null, null); - writer.WriteProperty(options, PropMatchingIndices, value.MatchingIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSkipUnavailable, value.SkipUnavailable, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Provides information about each cluster request relevant to doing a cross-cluster search. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ResolveClusterInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ResolveClusterInfoConverter))] public sealed partial class ResolveClusterInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexAliasItem.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexAliasItem.Converters.g.cs new file mode 100644 index 00000000000..511b8847833 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexAliasItem.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ResolveIndexAliasItemConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexAliasItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propIndices = default; + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexAliasItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Indices = propIndices.Value, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexAliasItem value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexAliasItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexAliasItem.g.cs index c0a045533d1..d3293387e5d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexAliasItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexAliasItem.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ResolveIndexAliasItemConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexAliasItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propIndices = default; - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexAliasItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Indices = propIndices.Value, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexAliasItem value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexAliasItemConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ResolveIndexAliasItemConverter))] public sealed partial class ResolveIndexAliasItem { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexDataStreamsItem.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexDataStreamsItem.Converters.g.cs new file mode 100644 index 00000000000..ecf53b70f7e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexDataStreamsItem.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ResolveIndexDataStreamsItemConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBackingIndices = System.Text.Json.JsonEncodedText.Encode("backing_indices"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropTimestampField = System.Text.Json.JsonEncodedText.Encode("timestamp_field"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexDataStreamsItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBackingIndices = default; + LocalJsonValue propName = default; + LocalJsonValue propTimestampField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBackingIndices.TryReadProperty(ref reader, options, PropBackingIndices, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propTimestampField.TryReadProperty(ref reader, options, PropTimestampField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexDataStreamsItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BackingIndices = propBackingIndices.Value, + Name = propName.Value, + TimestampField = propTimestampField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexDataStreamsItem value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBackingIndices, value.BackingIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropTimestampField, value.TimestampField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexDataStreamsItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexDataStreamsItem.g.cs index 1445c55b3d8..34eb55d27b3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexDataStreamsItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexDataStreamsItem.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ResolveIndexDataStreamsItemConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBackingIndices = System.Text.Json.JsonEncodedText.Encode("backing_indices"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropTimestampField = System.Text.Json.JsonEncodedText.Encode("timestamp_field"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexDataStreamsItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBackingIndices = default; - LocalJsonValue propName = default; - LocalJsonValue propTimestampField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBackingIndices.TryReadProperty(ref reader, options, PropBackingIndices, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propTimestampField.TryReadProperty(ref reader, options, PropTimestampField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexDataStreamsItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BackingIndices = propBackingIndices.Value, - Name = propName.Value, - TimestampField = propTimestampField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexDataStreamsItem value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBackingIndices, value.BackingIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropTimestampField, value.TimestampField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexDataStreamsItemConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ResolveIndexDataStreamsItemConverter))] public sealed partial class ResolveIndexDataStreamsItem { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexItem.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexItem.Converters.g.cs new file mode 100644 index 00000000000..fdfd84fb054 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexItem.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ResolveIndexItemConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); + private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); + private static readonly System.Text.Json.JsonEncodedText PropDataStream = System.Text.Json.JsonEncodedText.Encode("data_stream"); + private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAliases = default; + LocalJsonValue> propAttributes = default; + LocalJsonValue propDataStream = default; + LocalJsonValue propMode = default; + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propDataStream.TryReadProperty(ref reader, options, PropDataStream, null)) + { + continue; + } + + if (propMode.TryReadProperty(ref reader, options, PropMode, static Elastic.Clients.Elasticsearch.IndexManagement.IndexMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aliases = propAliases.Value, + Attributes = propAttributes.Value, + DataStream = propDataStream.Value, + Mode = propMode.Value, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexItem value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDataStream, value.DataStream, null, null); + writer.WriteProperty(options, PropMode, value.Mode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.IndexManagement.IndexMode? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexItem.g.cs index f6ad1adfdc2..212a1af02f5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ResolveIndexItem.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ResolveIndexItemConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); - private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); - private static readonly System.Text.Json.JsonEncodedText PropDataStream = System.Text.Json.JsonEncodedText.Encode("data_stream"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAliases = default; - LocalJsonValue> propAttributes = default; - LocalJsonValue propDataStream = default; - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propDataStream.TryReadProperty(ref reader, options, PropDataStream, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aliases = propAliases.Value, - Attributes = propAttributes.Value, - DataStream = propDataStream.Value, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexItem value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDataStream, value.DataStream, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ResolveIndexItemConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ResolveIndexItemConverter))] public sealed partial class ResolveIndexItem { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -122,6 +56,7 @@ internal ResolveIndexItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstr #endif System.Collections.Generic.IReadOnlyCollection Attributes { get; set; } public string? DataStream { get; set; } + public Elastic.Clients.Elasticsearch.IndexManagement.IndexMode? Mode { get; set; } public #if NET7_0_OR_GREATER required diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RetentionLease.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RetentionLease.Converters.g.cs new file mode 100644 index 00000000000..1ba0896d51f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RetentionLease.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class RetentionLeaseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPeriod = System.Text.Json.JsonEncodedText.Encode("period"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.RetentionLease Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPeriod = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPeriod.TryReadProperty(ref reader, options, PropPeriod, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.RetentionLease(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Period = propPeriod.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RetentionLease value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPeriod, value.Period, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RetentionLease.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RetentionLease.g.cs index 4d90d1a30be..570c39632fa 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RetentionLease.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RetentionLease.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class RetentionLeaseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPeriod = System.Text.Json.JsonEncodedText.Encode("period"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.RetentionLease Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPeriod = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPeriod.TryReadProperty(ref reader, options, PropPeriod, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.RetentionLease(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Period = propPeriod.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RetentionLease value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPeriod, value.Period, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.RetentionLeaseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.RetentionLeaseConverter))] public sealed partial class RetentionLease { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RolloverConditions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RolloverConditions.Converters.g.cs new file mode 100644 index 00000000000..331cdf4e886 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RolloverConditions.Converters.g.cs @@ -0,0 +1,189 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class RolloverConditionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxAge = System.Text.Json.JsonEncodedText.Encode("max_age"); + private static readonly System.Text.Json.JsonEncodedText PropMaxAgeMillis = System.Text.Json.JsonEncodedText.Encode("max_age_millis"); + private static readonly System.Text.Json.JsonEncodedText PropMaxDocs = System.Text.Json.JsonEncodedText.Encode("max_docs"); + private static readonly System.Text.Json.JsonEncodedText PropMaxPrimaryShardDocs = System.Text.Json.JsonEncodedText.Encode("max_primary_shard_docs"); + private static readonly System.Text.Json.JsonEncodedText PropMaxPrimaryShardSize = System.Text.Json.JsonEncodedText.Encode("max_primary_shard_size"); + private static readonly System.Text.Json.JsonEncodedText PropMaxPrimaryShardSizeBytes = System.Text.Json.JsonEncodedText.Encode("max_primary_shard_size_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropMaxSize = System.Text.Json.JsonEncodedText.Encode("max_size"); + private static readonly System.Text.Json.JsonEncodedText PropMaxSizeBytes = System.Text.Json.JsonEncodedText.Encode("max_size_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropMinAge = System.Text.Json.JsonEncodedText.Encode("min_age"); + private static readonly System.Text.Json.JsonEncodedText PropMinDocs = System.Text.Json.JsonEncodedText.Encode("min_docs"); + private static readonly System.Text.Json.JsonEncodedText PropMinPrimaryShardDocs = System.Text.Json.JsonEncodedText.Encode("min_primary_shard_docs"); + private static readonly System.Text.Json.JsonEncodedText PropMinPrimaryShardSize = System.Text.Json.JsonEncodedText.Encode("min_primary_shard_size"); + private static readonly System.Text.Json.JsonEncodedText PropMinPrimaryShardSizeBytes = System.Text.Json.JsonEncodedText.Encode("min_primary_shard_size_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropMinSize = System.Text.Json.JsonEncodedText.Encode("min_size"); + private static readonly System.Text.Json.JsonEncodedText PropMinSizeBytes = System.Text.Json.JsonEncodedText.Encode("min_size_bytes"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.RolloverConditions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxAge = default; + LocalJsonValue propMaxAgeMillis = default; + LocalJsonValue propMaxDocs = default; + LocalJsonValue propMaxPrimaryShardDocs = default; + LocalJsonValue propMaxPrimaryShardSize = default; + LocalJsonValue propMaxPrimaryShardSizeBytes = default; + LocalJsonValue propMaxSize = default; + LocalJsonValue propMaxSizeBytes = default; + LocalJsonValue propMinAge = default; + LocalJsonValue propMinDocs = default; + LocalJsonValue propMinPrimaryShardDocs = default; + LocalJsonValue propMinPrimaryShardSize = default; + LocalJsonValue propMinPrimaryShardSizeBytes = default; + LocalJsonValue propMinSize = default; + LocalJsonValue propMinSizeBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxAge.TryReadProperty(ref reader, options, PropMaxAge, null)) + { + continue; + } + + if (propMaxAgeMillis.TryReadProperty(ref reader, options, PropMaxAgeMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propMaxDocs.TryReadProperty(ref reader, options, PropMaxDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxPrimaryShardDocs.TryReadProperty(ref reader, options, PropMaxPrimaryShardDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxPrimaryShardSize.TryReadProperty(ref reader, options, PropMaxPrimaryShardSize, null)) + { + continue; + } + + if (propMaxPrimaryShardSizeBytes.TryReadProperty(ref reader, options, PropMaxPrimaryShardSizeBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxSize.TryReadProperty(ref reader, options, PropMaxSize, null)) + { + continue; + } + + if (propMaxSizeBytes.TryReadProperty(ref reader, options, PropMaxSizeBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinAge.TryReadProperty(ref reader, options, PropMinAge, null)) + { + continue; + } + + if (propMinDocs.TryReadProperty(ref reader, options, PropMinDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinPrimaryShardDocs.TryReadProperty(ref reader, options, PropMinPrimaryShardDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinPrimaryShardSize.TryReadProperty(ref reader, options, PropMinPrimaryShardSize, null)) + { + continue; + } + + if (propMinPrimaryShardSizeBytes.TryReadProperty(ref reader, options, PropMinPrimaryShardSizeBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinSize.TryReadProperty(ref reader, options, PropMinSize, null)) + { + continue; + } + + if (propMinSizeBytes.TryReadProperty(ref reader, options, PropMinSizeBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.RolloverConditions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxAge = propMaxAge.Value, + MaxAgeMillis = propMaxAgeMillis.Value, + MaxDocs = propMaxDocs.Value, + MaxPrimaryShardDocs = propMaxPrimaryShardDocs.Value, + MaxPrimaryShardSize = propMaxPrimaryShardSize.Value, + MaxPrimaryShardSizeBytes = propMaxPrimaryShardSizeBytes.Value, + MaxSize = propMaxSize.Value, + MaxSizeBytes = propMaxSizeBytes.Value, + MinAge = propMinAge.Value, + MinDocs = propMinDocs.Value, + MinPrimaryShardDocs = propMinPrimaryShardDocs.Value, + MinPrimaryShardSize = propMinPrimaryShardSize.Value, + MinPrimaryShardSizeBytes = propMinPrimaryShardSizeBytes.Value, + MinSize = propMinSize.Value, + MinSizeBytes = propMinSizeBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RolloverConditions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxAge, value.MaxAge, null, null); + writer.WriteProperty(options, PropMaxAgeMillis, value.MaxAgeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropMaxDocs, value.MaxDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxPrimaryShardDocs, value.MaxPrimaryShardDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxPrimaryShardSize, value.MaxPrimaryShardSize, null, null); + writer.WriteProperty(options, PropMaxPrimaryShardSizeBytes, value.MaxPrimaryShardSizeBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxSize, value.MaxSize, null, null); + writer.WriteProperty(options, PropMaxSizeBytes, value.MaxSizeBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinAge, value.MinAge, null, null); + writer.WriteProperty(options, PropMinDocs, value.MinDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinPrimaryShardDocs, value.MinPrimaryShardDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinPrimaryShardSize, value.MinPrimaryShardSize, null, null); + writer.WriteProperty(options, PropMinPrimaryShardSizeBytes, value.MinPrimaryShardSizeBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinSize, value.MinSize, null, null); + writer.WriteProperty(options, PropMinSizeBytes, value.MinSizeBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RolloverConditions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RolloverConditions.g.cs index a6ee808e4eb..88ccb61c937 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RolloverConditions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RolloverConditions.g.cs @@ -23,172 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class RolloverConditionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxAge = System.Text.Json.JsonEncodedText.Encode("max_age"); - private static readonly System.Text.Json.JsonEncodedText PropMaxAgeMillis = System.Text.Json.JsonEncodedText.Encode("max_age_millis"); - private static readonly System.Text.Json.JsonEncodedText PropMaxDocs = System.Text.Json.JsonEncodedText.Encode("max_docs"); - private static readonly System.Text.Json.JsonEncodedText PropMaxPrimaryShardDocs = System.Text.Json.JsonEncodedText.Encode("max_primary_shard_docs"); - private static readonly System.Text.Json.JsonEncodedText PropMaxPrimaryShardSize = System.Text.Json.JsonEncodedText.Encode("max_primary_shard_size"); - private static readonly System.Text.Json.JsonEncodedText PropMaxPrimaryShardSizeBytes = System.Text.Json.JsonEncodedText.Encode("max_primary_shard_size_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropMaxSize = System.Text.Json.JsonEncodedText.Encode("max_size"); - private static readonly System.Text.Json.JsonEncodedText PropMaxSizeBytes = System.Text.Json.JsonEncodedText.Encode("max_size_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropMinAge = System.Text.Json.JsonEncodedText.Encode("min_age"); - private static readonly System.Text.Json.JsonEncodedText PropMinDocs = System.Text.Json.JsonEncodedText.Encode("min_docs"); - private static readonly System.Text.Json.JsonEncodedText PropMinPrimaryShardDocs = System.Text.Json.JsonEncodedText.Encode("min_primary_shard_docs"); - private static readonly System.Text.Json.JsonEncodedText PropMinPrimaryShardSize = System.Text.Json.JsonEncodedText.Encode("min_primary_shard_size"); - private static readonly System.Text.Json.JsonEncodedText PropMinPrimaryShardSizeBytes = System.Text.Json.JsonEncodedText.Encode("min_primary_shard_size_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropMinSize = System.Text.Json.JsonEncodedText.Encode("min_size"); - private static readonly System.Text.Json.JsonEncodedText PropMinSizeBytes = System.Text.Json.JsonEncodedText.Encode("min_size_bytes"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.RolloverConditions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxAge = default; - LocalJsonValue propMaxAgeMillis = default; - LocalJsonValue propMaxDocs = default; - LocalJsonValue propMaxPrimaryShardDocs = default; - LocalJsonValue propMaxPrimaryShardSize = default; - LocalJsonValue propMaxPrimaryShardSizeBytes = default; - LocalJsonValue propMaxSize = default; - LocalJsonValue propMaxSizeBytes = default; - LocalJsonValue propMinAge = default; - LocalJsonValue propMinDocs = default; - LocalJsonValue propMinPrimaryShardDocs = default; - LocalJsonValue propMinPrimaryShardSize = default; - LocalJsonValue propMinPrimaryShardSizeBytes = default; - LocalJsonValue propMinSize = default; - LocalJsonValue propMinSizeBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxAge.TryReadProperty(ref reader, options, PropMaxAge, null)) - { - continue; - } - - if (propMaxAgeMillis.TryReadProperty(ref reader, options, PropMaxAgeMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propMaxDocs.TryReadProperty(ref reader, options, PropMaxDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxPrimaryShardDocs.TryReadProperty(ref reader, options, PropMaxPrimaryShardDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxPrimaryShardSize.TryReadProperty(ref reader, options, PropMaxPrimaryShardSize, null)) - { - continue; - } - - if (propMaxPrimaryShardSizeBytes.TryReadProperty(ref reader, options, PropMaxPrimaryShardSizeBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxSize.TryReadProperty(ref reader, options, PropMaxSize, null)) - { - continue; - } - - if (propMaxSizeBytes.TryReadProperty(ref reader, options, PropMaxSizeBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinAge.TryReadProperty(ref reader, options, PropMinAge, null)) - { - continue; - } - - if (propMinDocs.TryReadProperty(ref reader, options, PropMinDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinPrimaryShardDocs.TryReadProperty(ref reader, options, PropMinPrimaryShardDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinPrimaryShardSize.TryReadProperty(ref reader, options, PropMinPrimaryShardSize, null)) - { - continue; - } - - if (propMinPrimaryShardSizeBytes.TryReadProperty(ref reader, options, PropMinPrimaryShardSizeBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinSize.TryReadProperty(ref reader, options, PropMinSize, null)) - { - continue; - } - - if (propMinSizeBytes.TryReadProperty(ref reader, options, PropMinSizeBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.RolloverConditions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxAge = propMaxAge.Value, - MaxAgeMillis = propMaxAgeMillis.Value, - MaxDocs = propMaxDocs.Value, - MaxPrimaryShardDocs = propMaxPrimaryShardDocs.Value, - MaxPrimaryShardSize = propMaxPrimaryShardSize.Value, - MaxPrimaryShardSizeBytes = propMaxPrimaryShardSizeBytes.Value, - MaxSize = propMaxSize.Value, - MaxSizeBytes = propMaxSizeBytes.Value, - MinAge = propMinAge.Value, - MinDocs = propMinDocs.Value, - MinPrimaryShardDocs = propMinPrimaryShardDocs.Value, - MinPrimaryShardSize = propMinPrimaryShardSize.Value, - MinPrimaryShardSizeBytes = propMinPrimaryShardSizeBytes.Value, - MinSize = propMinSize.Value, - MinSizeBytes = propMinSizeBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RolloverConditions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxAge, value.MaxAge, null, null); - writer.WriteProperty(options, PropMaxAgeMillis, value.MaxAgeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropMaxDocs, value.MaxDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxPrimaryShardDocs, value.MaxPrimaryShardDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxPrimaryShardSize, value.MaxPrimaryShardSize, null, null); - writer.WriteProperty(options, PropMaxPrimaryShardSizeBytes, value.MaxPrimaryShardSizeBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxSize, value.MaxSize, null, null); - writer.WriteProperty(options, PropMaxSizeBytes, value.MaxSizeBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinAge, value.MinAge, null, null); - writer.WriteProperty(options, PropMinDocs, value.MinDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinPrimaryShardDocs, value.MinPrimaryShardDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinPrimaryShardSize, value.MinPrimaryShardSize, null, null); - writer.WriteProperty(options, PropMinPrimaryShardSizeBytes, value.MinPrimaryShardSizeBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinSize, value.MinSize, null, null); - writer.WriteProperty(options, PropMinSizeBytes, value.MinSizeBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.RolloverConditionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.RolloverConditionsConverter))] public sealed partial class RolloverConditions { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SearchIdle.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SearchIdle.Converters.g.cs new file mode 100644 index 00000000000..10dd5c06c59 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SearchIdle.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SearchIdleConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAfter = System.Text.Json.JsonEncodedText.Encode("after"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SearchIdle Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAfter = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAfter.TryReadProperty(ref reader, options, PropAfter, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.SearchIdle(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + After = propAfter.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SearchIdle value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAfter, value.After, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SearchIdle.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SearchIdle.g.cs index 614208bee3a..87b6b3e04a2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SearchIdle.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SearchIdle.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class SearchIdleConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAfter = System.Text.Json.JsonEncodedText.Encode("after"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SearchIdle Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAfter = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAfter.TryReadProperty(ref reader, options, PropAfter, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SearchIdle(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - After = propAfter.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SearchIdle value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAfter, value.After, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SearchIdleConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SearchIdleConverter))] public sealed partial class SearchIdle { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Segment.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Segment.Converters.g.cs new file mode 100644 index 00000000000..c164462b40a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Segment.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SegmentConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); + private static readonly System.Text.Json.JsonEncodedText PropCommitted = System.Text.Json.JsonEncodedText.Encode("committed"); + private static readonly System.Text.Json.JsonEncodedText PropCompound = System.Text.Json.JsonEncodedText.Encode("compound"); + private static readonly System.Text.Json.JsonEncodedText PropDeletedDocs = System.Text.Json.JsonEncodedText.Encode("deleted_docs"); + private static readonly System.Text.Json.JsonEncodedText PropGeneration = System.Text.Json.JsonEncodedText.Encode("generation"); + private static readonly System.Text.Json.JsonEncodedText PropNumDocs = System.Text.Json.JsonEncodedText.Encode("num_docs"); + private static readonly System.Text.Json.JsonEncodedText PropSearch = System.Text.Json.JsonEncodedText.Encode("search"); + private static readonly System.Text.Json.JsonEncodedText PropSizeInBytes = System.Text.Json.JsonEncodedText.Encode("size_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.Segment Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propAttributes = default; + LocalJsonValue propCommitted = default; + LocalJsonValue propCompound = default; + LocalJsonValue propDeletedDocs = default; + LocalJsonValue propGeneration = default; + LocalJsonValue propNumDocs = default; + LocalJsonValue propSearch = default; + LocalJsonValue propSizeInBytes = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propCommitted.TryReadProperty(ref reader, options, PropCommitted, null)) + { + continue; + } + + if (propCompound.TryReadProperty(ref reader, options, PropCompound, null)) + { + continue; + } + + if (propDeletedDocs.TryReadProperty(ref reader, options, PropDeletedDocs, null)) + { + continue; + } + + if (propGeneration.TryReadProperty(ref reader, options, PropGeneration, null)) + { + continue; + } + + if (propNumDocs.TryReadProperty(ref reader, options, PropNumDocs, null)) + { + continue; + } + + if (propSearch.TryReadProperty(ref reader, options, PropSearch, null)) + { + continue; + } + + if (propSizeInBytes.TryReadProperty(ref reader, options, PropSizeInBytes, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.Segment(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Attributes = propAttributes.Value, + Committed = propCommitted.Value, + Compound = propCompound.Value, + DeletedDocs = propDeletedDocs.Value, + Generation = propGeneration.Value, + NumDocs = propNumDocs.Value, + Search = propSearch.Value, + SizeInBytes = propSizeInBytes.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.Segment value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropCommitted, value.Committed, null, null); + writer.WriteProperty(options, PropCompound, value.Compound, null, null); + writer.WriteProperty(options, PropDeletedDocs, value.DeletedDocs, null, null); + writer.WriteProperty(options, PropGeneration, value.Generation, null, null); + writer.WriteProperty(options, PropNumDocs, value.NumDocs, null, null); + writer.WriteProperty(options, PropSearch, value.Search, null, null); + writer.WriteProperty(options, PropSizeInBytes, value.SizeInBytes, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Segment.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Segment.g.cs index 667b5cea1c9..5cc12001586 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Segment.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Segment.g.cs @@ -23,118 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class SegmentConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); - private static readonly System.Text.Json.JsonEncodedText PropCommitted = System.Text.Json.JsonEncodedText.Encode("committed"); - private static readonly System.Text.Json.JsonEncodedText PropCompound = System.Text.Json.JsonEncodedText.Encode("compound"); - private static readonly System.Text.Json.JsonEncodedText PropDeletedDocs = System.Text.Json.JsonEncodedText.Encode("deleted_docs"); - private static readonly System.Text.Json.JsonEncodedText PropGeneration = System.Text.Json.JsonEncodedText.Encode("generation"); - private static readonly System.Text.Json.JsonEncodedText PropNumDocs = System.Text.Json.JsonEncodedText.Encode("num_docs"); - private static readonly System.Text.Json.JsonEncodedText PropSearch = System.Text.Json.JsonEncodedText.Encode("search"); - private static readonly System.Text.Json.JsonEncodedText PropSizeInBytes = System.Text.Json.JsonEncodedText.Encode("size_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.Segment Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propAttributes = default; - LocalJsonValue propCommitted = default; - LocalJsonValue propCompound = default; - LocalJsonValue propDeletedDocs = default; - LocalJsonValue propGeneration = default; - LocalJsonValue propNumDocs = default; - LocalJsonValue propSearch = default; - LocalJsonValue propSizeInBytes = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propCommitted.TryReadProperty(ref reader, options, PropCommitted, null)) - { - continue; - } - - if (propCompound.TryReadProperty(ref reader, options, PropCompound, null)) - { - continue; - } - - if (propDeletedDocs.TryReadProperty(ref reader, options, PropDeletedDocs, null)) - { - continue; - } - - if (propGeneration.TryReadProperty(ref reader, options, PropGeneration, null)) - { - continue; - } - - if (propNumDocs.TryReadProperty(ref reader, options, PropNumDocs, null)) - { - continue; - } - - if (propSearch.TryReadProperty(ref reader, options, PropSearch, null)) - { - continue; - } - - if (propSizeInBytes.TryReadProperty(ref reader, options, PropSizeInBytes, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.Segment(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Attributes = propAttributes.Value, - Committed = propCommitted.Value, - Compound = propCompound.Value, - DeletedDocs = propDeletedDocs.Value, - Generation = propGeneration.Value, - NumDocs = propNumDocs.Value, - Search = propSearch.Value, - SizeInBytes = propSizeInBytes.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.Segment value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropCommitted, value.Committed, null, null); - writer.WriteProperty(options, PropCompound, value.Compound, null, null); - writer.WriteProperty(options, PropDeletedDocs, value.DeletedDocs, null, null); - writer.WriteProperty(options, PropGeneration, value.Generation, null, null); - writer.WriteProperty(options, PropNumDocs, value.NumDocs, null, null); - writer.WriteProperty(options, PropSearch, value.Search, null, null); - writer.WriteProperty(options, PropSizeInBytes, value.SizeInBytes, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SegmentConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SegmentConverter))] public sealed partial class Segment { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SegmentSortMissing.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SegmentSortMissing.Converters.g.cs new file mode 100644 index 00000000000..7960986ad43 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SegmentSortMissing.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SegmentSortMissingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberFirst = System.Text.Json.JsonEncodedText.Encode("_first"); + private static readonly System.Text.Json.JsonEncodedText MemberLast = System.Text.Json.JsonEncodedText.Encode("_last"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMissing Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberFirst)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMissing.First; + } + + if (reader.ValueTextEquals(MemberLast)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMissing.Last; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberFirst.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMissing.First; + } + + if (string.Equals(value, MemberLast.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMissing.Last; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMissing)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMissing value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMissing.First: + writer.WriteStringValue(MemberFirst); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMissing.Last: + writer.WriteStringValue(MemberLast); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMissing)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMissing ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMissing value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SegmentSortMissing.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SegmentSortMissing.g.cs new file mode 100644 index 00000000000..b4ef55df178 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SegmentSortMissing.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SegmentSortMissingConverter))] +public enum SegmentSortMissing +{ + [System.Runtime.Serialization.EnumMember(Value = "_first")] + First, + [System.Runtime.Serialization.EnumMember(Value = "_last")] + Last +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SegmentSortMode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SegmentSortMode.Converters.g.cs new file mode 100644 index 00000000000..3ba56555e43 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SegmentSortMode.Converters.g.cs @@ -0,0 +1,83 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SegmentSortModeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText MemberMax1 = System.Text.Json.JsonEncodedText.Encode("MAX"); + private static readonly System.Text.Json.JsonEncodedText MemberMin = System.Text.Json.JsonEncodedText.Encode("min"); + private static readonly System.Text.Json.JsonEncodedText MemberMin1 = System.Text.Json.JsonEncodedText.Encode("MIN"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberMax) || reader.ValueTextEquals(MemberMax1)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMode.Max; + } + + if (reader.ValueTextEquals(MemberMin) || reader.ValueTextEquals(MemberMin1)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMode.Min; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberMax.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberMax1.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMode.Max; + } + + if (string.Equals(value, MemberMin.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberMin1.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMode.Min; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMode)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMode value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMode.Max: + writer.WriteStringValue(MemberMax); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMode.Min: + writer.WriteStringValue(MemberMin); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMode)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortMode value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SegmentSortMode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SegmentSortMode.g.cs new file mode 100644 index 00000000000..78bb8de490f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SegmentSortMode.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SegmentSortModeConverter))] +public enum SegmentSortMode +{ + [System.Runtime.Serialization.EnumMember(Value = "max")] + Max, + [System.Runtime.Serialization.EnumMember(Value = "min")] + Min +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SegmentSortOrder.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SegmentSortOrder.Converters.g.cs new file mode 100644 index 00000000000..e78bc43f622 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SegmentSortOrder.Converters.g.cs @@ -0,0 +1,83 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SegmentSortOrderConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAsc = System.Text.Json.JsonEncodedText.Encode("asc"); + private static readonly System.Text.Json.JsonEncodedText MemberAsc1 = System.Text.Json.JsonEncodedText.Encode("ASC"); + private static readonly System.Text.Json.JsonEncodedText MemberDesc = System.Text.Json.JsonEncodedText.Encode("desc"); + private static readonly System.Text.Json.JsonEncodedText MemberDesc1 = System.Text.Json.JsonEncodedText.Encode("DESC"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortOrder Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAsc) || reader.ValueTextEquals(MemberAsc1)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortOrder.Asc; + } + + if (reader.ValueTextEquals(MemberDesc) || reader.ValueTextEquals(MemberDesc1)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortOrder.Desc; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAsc.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberAsc1.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortOrder.Asc; + } + + if (string.Equals(value, MemberDesc.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberDesc1.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortOrder.Desc; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortOrder)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortOrder value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortOrder.Asc: + writer.WriteStringValue(MemberAsc); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortOrder.Desc: + writer.WriteStringValue(MemberDesc); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortOrder)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortOrder ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SegmentSortOrder value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SegmentSortOrder.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SegmentSortOrder.g.cs new file mode 100644 index 00000000000..7b51a5c0dce --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SegmentSortOrder.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SegmentSortOrderConverter))] +public enum SegmentSortOrder +{ + [System.Runtime.Serialization.EnumMember(Value = "asc")] + Asc, + [System.Runtime.Serialization.EnumMember(Value = "desc")] + Desc +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsAnalyze.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsAnalyze.Converters.g.cs new file mode 100644 index 00000000000..37ca48d8ba6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsAnalyze.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SettingsAnalyzeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxTokenCount = System.Text.Json.JsonEncodedText.Encode("max_token_count"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SettingsAnalyze Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxTokenCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxTokenCount.TryReadProperty(ref reader, options, PropMaxTokenCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.SettingsAnalyze(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxTokenCount = propMaxTokenCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SettingsAnalyze value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxTokenCount, value.MaxTokenCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsAnalyze.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsAnalyze.g.cs index b5329931608..9e3868c8a91 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsAnalyze.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsAnalyze.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class SettingsAnalyzeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxTokenCount = System.Text.Json.JsonEncodedText.Encode("max_token_count"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SettingsAnalyze Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxTokenCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxTokenCount.TryReadProperty(ref reader, options, PropMaxTokenCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SettingsAnalyze(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxTokenCount = propMaxTokenCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SettingsAnalyze value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxTokenCount, value.MaxTokenCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SettingsAnalyzeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SettingsAnalyzeConverter))] public sealed partial class SettingsAnalyze { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsHighlight.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsHighlight.Converters.g.cs new file mode 100644 index 00000000000..4c6d790e4bf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsHighlight.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SettingsHighlightConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxAnalyzedOffset = System.Text.Json.JsonEncodedText.Encode("max_analyzed_offset"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SettingsHighlight Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxAnalyzedOffset = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxAnalyzedOffset.TryReadProperty(ref reader, options, PropMaxAnalyzedOffset, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.SettingsHighlight(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxAnalyzedOffset = propMaxAnalyzedOffset.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SettingsHighlight value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxAnalyzedOffset, value.MaxAnalyzedOffset, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsHighlight.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsHighlight.g.cs index 26281f1695e..5a9ca1b6609 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsHighlight.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsHighlight.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class SettingsHighlightConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxAnalyzedOffset = System.Text.Json.JsonEncodedText.Encode("max_analyzed_offset"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SettingsHighlight Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxAnalyzedOffset = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxAnalyzedOffset.TryReadProperty(ref reader, options, PropMaxAnalyzedOffset, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SettingsHighlight(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxAnalyzedOffset = propMaxAnalyzedOffset.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SettingsHighlight value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxAnalyzedOffset, value.MaxAnalyzedOffset, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SettingsHighlightConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SettingsHighlightConverter))] public sealed partial class SettingsHighlight { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsQueryString.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsQueryString.Converters.g.cs new file mode 100644 index 00000000000..e1b000d63f9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsQueryString.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SettingsQueryStringConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLenient = System.Text.Json.JsonEncodedText.Encode("lenient"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SettingsQueryString Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLenient = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLenient.TryReadProperty(ref reader, options, PropLenient, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.SettingsQueryString(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Lenient = propLenient.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SettingsQueryString value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLenient, value.Lenient, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsQueryString.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsQueryString.g.cs index 11205edc402..c5f63d38954 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsQueryString.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsQueryString.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class SettingsQueryStringConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLenient = System.Text.Json.JsonEncodedText.Encode("lenient"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SettingsQueryString Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLenient = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLenient.TryReadProperty(ref reader, options, PropLenient, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SettingsQueryString(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Lenient = propLenient.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SettingsQueryString value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLenient, value.Lenient, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SettingsQueryStringConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SettingsQueryStringConverter))] public sealed partial class SettingsQueryString { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSearch.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSearch.Converters.g.cs new file mode 100644 index 00000000000..c798310e2e3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSearch.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SettingsSearchConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIdle = System.Text.Json.JsonEncodedText.Encode("idle"); + private static readonly System.Text.Json.JsonEncodedText PropSlowlog = System.Text.Json.JsonEncodedText.Encode("slowlog"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SettingsSearch Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIdle = default; + LocalJsonValue propSlowlog = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIdle.TryReadProperty(ref reader, options, PropIdle, null)) + { + continue; + } + + if (propSlowlog.TryReadProperty(ref reader, options, PropSlowlog, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.SettingsSearch(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Idle = propIdle.Value, + Slowlog = propSlowlog.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SettingsSearch value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIdle, value.Idle, null, null); + writer.WriteProperty(options, PropSlowlog, value.Slowlog, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSearch.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSearch.g.cs index 9cc8b59e250..f14a60a155c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSearch.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSearch.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class SettingsSearchConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIdle = System.Text.Json.JsonEncodedText.Encode("idle"); - private static readonly System.Text.Json.JsonEncodedText PropSlowlog = System.Text.Json.JsonEncodedText.Encode("slowlog"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SettingsSearch Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIdle = default; - LocalJsonValue propSlowlog = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIdle.TryReadProperty(ref reader, options, PropIdle, null)) - { - continue; - } - - if (propSlowlog.TryReadProperty(ref reader, options, PropSlowlog, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SettingsSearch(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Idle = propIdle.Value, - Slowlog = propSlowlog.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SettingsSearch value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIdle, value.Idle, null, null); - writer.WriteProperty(options, PropSlowlog, value.Slowlog, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SettingsSearchConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SettingsSearchConverter))] public sealed partial class SettingsSearch { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarities.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarities.Converters.g.cs new file mode 100644 index 00000000000..4462bd3637c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarities.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SettingsSimilaritiesConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarities Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarities(reader.ReadValue?>(options, static System.Collections.Generic.Dictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarities value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.BackingDictionary, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.Dictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarities.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarities.g.cs index 41ffe9d3177..30360d0b7c8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarities.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarities.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class SettingsSimilaritiesConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarities Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarities(reader.ReadValue?>(options, static System.Collections.Generic.Dictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarities value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.BackingDictionary, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.Dictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilaritiesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SettingsSimilaritiesConverter))] public sealed partial class SettingsSimilarities : Elastic.Clients.Elasticsearch.IsADictionary { public SettingsSimilarities() diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarity.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarity.Converters.g.cs new file mode 100644 index 00000000000..7596fad3aaf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarity.Converters.g.cs @@ -0,0 +1,92 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ISettingsSimilarityConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDiscriminator = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ISettingsSimilarity Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + var readerSnapshot = reader; + string? discriminator = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.TryReadProperty(options, PropDiscriminator, ref discriminator, null)) + { + break; + } + + reader.Skip(); + } + + reader = readerSnapshot; + return discriminator switch + { + "BM25" => reader.ReadValue(options, null), + "boolean" => reader.ReadValue(options, null), + "DFI" => reader.ReadValue(options, null), + "DFR" => reader.ReadValue(options, null), + "IB" => reader.ReadValue(options, null), + "LMDirichlet" => reader.ReadValue(options, null), + "LMJelinekMercer" => reader.ReadValue(options, null), + "scripted" => reader.ReadValue(options, null), + _ => throw new System.Text.Json.JsonException($"Variant '{discriminator}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.ISettingsSimilarity)}'.") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ISettingsSimilarity value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Type) + { + case "BM25": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityBm25)value, null); + break; + case "boolean": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityBoolean)value, null); + break; + case "DFI": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityDfi)value, null); + break; + case "DFR": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityDfr)value, null); + break; + case "IB": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityIb)value, null); + break; + case "LMDirichlet": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityLmd)value, null); + break; + case "LMJelinekMercer": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityLmj)value, null); + break; + case "scripted": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityScripted)value, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.Type}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.ISettingsSimilarity)}'."); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarity.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarity.g.cs index b73d264d83c..3780c6feb74 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarity.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarity.g.cs @@ -23,75 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ISettingsSimilarityConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDiscriminator = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ISettingsSimilarity Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - var readerSnapshot = reader; - string? discriminator = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.TryReadProperty(options, PropDiscriminator, ref discriminator, null)) - { - break; - } - - reader.Skip(); - } - - reader = readerSnapshot; - return discriminator switch - { - "BM25" => reader.ReadValue(options, null), - "boolean" => reader.ReadValue(options, null), - "DFI" => reader.ReadValue(options, null), - "DFR" => reader.ReadValue(options, null), - "IB" => reader.ReadValue(options, null), - "LMDirichlet" => reader.ReadValue(options, null), - "LMJelinekMercer" => reader.ReadValue(options, null), - "scripted" => reader.ReadValue(options, null), - _ => throw new System.Text.Json.JsonException($"Variant '{discriminator}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.ISettingsSimilarity)}'.") - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ISettingsSimilarity value, System.Text.Json.JsonSerializerOptions options) - { - switch (value.Type) - { - case "BM25": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityBm25)value, null); - break; - case "boolean": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityBoolean)value, null); - break; - case "DFI": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityDfi)value, null); - break; - case "DFR": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityDfr)value, null); - break; - case "IB": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityIb)value, null); - break; - case "LMDirichlet": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityLmd)value, null); - break; - case "LMJelinekMercer": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityLmj)value, null); - break; - case "scripted": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityScripted)value, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.Type}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.ISettingsSimilarity)}'."); - } - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ISettingsSimilarityConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ISettingsSimilarityConverter))] public partial interface ISettingsSimilarity { public string Type { get; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityBm25.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityBm25.Converters.g.cs new file mode 100644 index 00000000000..d2d72adae0b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityBm25.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SettingsSimilarityBm25Converter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropB = System.Text.Json.JsonEncodedText.Encode("b"); + private static readonly System.Text.Json.JsonEncodedText PropDiscountOverlaps = System.Text.Json.JsonEncodedText.Encode("discount_overlaps"); + private static readonly System.Text.Json.JsonEncodedText PropK1 = System.Text.Json.JsonEncodedText.Encode("k1"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityBm25 Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propB = default; + LocalJsonValue propDiscountOverlaps = default; + LocalJsonValue propK1 = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propB.TryReadProperty(ref reader, options, PropB, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDiscountOverlaps.TryReadProperty(ref reader, options, PropDiscountOverlaps, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propK1.TryReadProperty(ref reader, options, PropK1, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityBm25(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + B = propB.Value, + DiscountOverlaps = propDiscountOverlaps.Value, + K1 = propK1.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityBm25 value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropB, value.B, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDiscountOverlaps, value.DiscountOverlaps, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropK1, value.K1, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityBm25.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityBm25.g.cs index 1e4889ef433..6bc4ebc2a2f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityBm25.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityBm25.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class SettingsSimilarityBm25Converter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropB = System.Text.Json.JsonEncodedText.Encode("b"); - private static readonly System.Text.Json.JsonEncodedText PropDiscountOverlaps = System.Text.Json.JsonEncodedText.Encode("discount_overlaps"); - private static readonly System.Text.Json.JsonEncodedText PropK1 = System.Text.Json.JsonEncodedText.Encode("k1"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityBm25 Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propB = default; - LocalJsonValue propDiscountOverlaps = default; - LocalJsonValue propK1 = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propB.TryReadProperty(ref reader, options, PropB, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDiscountOverlaps.TryReadProperty(ref reader, options, PropDiscountOverlaps, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propK1.TryReadProperty(ref reader, options, PropK1, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityBm25(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - B = propB.Value, - DiscountOverlaps = propDiscountOverlaps.Value, - K1 = propK1.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityBm25 value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropB, value.B, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDiscountOverlaps, value.DiscountOverlaps, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropK1, value.K1, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityBm25Converter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SettingsSimilarityBm25Converter))] public sealed partial class SettingsSimilarityBm25 : Elastic.Clients.Elasticsearch.IndexManagement.ISettingsSimilarity { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityBoolean.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityBoolean.Converters.g.cs new file mode 100644 index 00000000000..99ba83afd66 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityBoolean.Converters.g.cs @@ -0,0 +1,62 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SettingsSimilarityBooleanConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityBoolean Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityBoolean(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityBoolean value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityBoolean.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityBoolean.g.cs index e8d41cdf5d9..a9375a54b8c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityBoolean.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityBoolean.g.cs @@ -23,45 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class SettingsSimilarityBooleanConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityBoolean Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityBoolean(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityBoolean value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityBooleanConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SettingsSimilarityBooleanConverter))] public sealed partial class SettingsSimilarityBoolean : Elastic.Clients.Elasticsearch.IndexManagement.ISettingsSimilarity { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityDfi.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityDfi.Converters.g.cs new file mode 100644 index 00000000000..2021328180f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityDfi.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SettingsSimilarityDfiConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndependenceMeasure = System.Text.Json.JsonEncodedText.Encode("independence_measure"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityDfi Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndependenceMeasure = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndependenceMeasure.TryReadProperty(ref reader, options, PropIndependenceMeasure, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityDfi(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + IndependenceMeasure = propIndependenceMeasure.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityDfi value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndependenceMeasure, value.IndependenceMeasure, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityDfi.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityDfi.g.cs index ddd3800fb35..30b4206b1a2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityDfi.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityDfi.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class SettingsSimilarityDfiConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndependenceMeasure = System.Text.Json.JsonEncodedText.Encode("independence_measure"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityDfi Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndependenceMeasure = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndependenceMeasure.TryReadProperty(ref reader, options, PropIndependenceMeasure, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityDfi(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - IndependenceMeasure = propIndependenceMeasure.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityDfi value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndependenceMeasure, value.IndependenceMeasure, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityDfiConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SettingsSimilarityDfiConverter))] public sealed partial class SettingsSimilarityDfi : Elastic.Clients.Elasticsearch.IndexManagement.ISettingsSimilarity { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityDfr.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityDfr.Converters.g.cs new file mode 100644 index 00000000000..c988cebc6d8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityDfr.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SettingsSimilarityDfrConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAfterEffect = System.Text.Json.JsonEncodedText.Encode("after_effect"); + private static readonly System.Text.Json.JsonEncodedText PropBasicModel = System.Text.Json.JsonEncodedText.Encode("basic_model"); + private static readonly System.Text.Json.JsonEncodedText PropNormalization = System.Text.Json.JsonEncodedText.Encode("normalization"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityDfr Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAfterEffect = default; + LocalJsonValue propBasicModel = default; + LocalJsonValue propNormalization = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAfterEffect.TryReadProperty(ref reader, options, PropAfterEffect, null)) + { + continue; + } + + if (propBasicModel.TryReadProperty(ref reader, options, PropBasicModel, null)) + { + continue; + } + + if (propNormalization.TryReadProperty(ref reader, options, PropNormalization, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityDfr(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AfterEffect = propAfterEffect.Value, + BasicModel = propBasicModel.Value, + Normalization = propNormalization.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityDfr value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAfterEffect, value.AfterEffect, null, null); + writer.WriteProperty(options, PropBasicModel, value.BasicModel, null, null); + writer.WriteProperty(options, PropNormalization, value.Normalization, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityDfr.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityDfr.g.cs index 85329ec12ad..ebe70d2c596 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityDfr.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityDfr.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class SettingsSimilarityDfrConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAfterEffect = System.Text.Json.JsonEncodedText.Encode("after_effect"); - private static readonly System.Text.Json.JsonEncodedText PropBasicModel = System.Text.Json.JsonEncodedText.Encode("basic_model"); - private static readonly System.Text.Json.JsonEncodedText PropNormalization = System.Text.Json.JsonEncodedText.Encode("normalization"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityDfr Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAfterEffect = default; - LocalJsonValue propBasicModel = default; - LocalJsonValue propNormalization = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAfterEffect.TryReadProperty(ref reader, options, PropAfterEffect, null)) - { - continue; - } - - if (propBasicModel.TryReadProperty(ref reader, options, PropBasicModel, null)) - { - continue; - } - - if (propNormalization.TryReadProperty(ref reader, options, PropNormalization, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityDfr(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AfterEffect = propAfterEffect.Value, - BasicModel = propBasicModel.Value, - Normalization = propNormalization.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityDfr value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAfterEffect, value.AfterEffect, null, null); - writer.WriteProperty(options, PropBasicModel, value.BasicModel, null, null); - writer.WriteProperty(options, PropNormalization, value.Normalization, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityDfrConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SettingsSimilarityDfrConverter))] public sealed partial class SettingsSimilarityDfr : Elastic.Clients.Elasticsearch.IndexManagement.ISettingsSimilarity { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityIb.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityIb.Converters.g.cs new file mode 100644 index 00000000000..59c532fb221 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityIb.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SettingsSimilarityIbConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDistribution = System.Text.Json.JsonEncodedText.Encode("distribution"); + private static readonly System.Text.Json.JsonEncodedText PropLambda = System.Text.Json.JsonEncodedText.Encode("lambda"); + private static readonly System.Text.Json.JsonEncodedText PropNormalization = System.Text.Json.JsonEncodedText.Encode("normalization"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityIb Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDistribution = default; + LocalJsonValue propLambda = default; + LocalJsonValue propNormalization = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDistribution.TryReadProperty(ref reader, options, PropDistribution, null)) + { + continue; + } + + if (propLambda.TryReadProperty(ref reader, options, PropLambda, null)) + { + continue; + } + + if (propNormalization.TryReadProperty(ref reader, options, PropNormalization, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityIb(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Distribution = propDistribution.Value, + Lambda = propLambda.Value, + Normalization = propNormalization.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityIb value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDistribution, value.Distribution, null, null); + writer.WriteProperty(options, PropLambda, value.Lambda, null, null); + writer.WriteProperty(options, PropNormalization, value.Normalization, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityIb.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityIb.g.cs index dc8eeaf71d9..a1b1b22b5c6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityIb.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityIb.g.cs @@ -23,72 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class SettingsSimilarityIbConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDistribution = System.Text.Json.JsonEncodedText.Encode("distribution"); - private static readonly System.Text.Json.JsonEncodedText PropLambda = System.Text.Json.JsonEncodedText.Encode("lambda"); - private static readonly System.Text.Json.JsonEncodedText PropNormalization = System.Text.Json.JsonEncodedText.Encode("normalization"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityIb Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDistribution = default; - LocalJsonValue propLambda = default; - LocalJsonValue propNormalization = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDistribution.TryReadProperty(ref reader, options, PropDistribution, null)) - { - continue; - } - - if (propLambda.TryReadProperty(ref reader, options, PropLambda, null)) - { - continue; - } - - if (propNormalization.TryReadProperty(ref reader, options, PropNormalization, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityIb(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Distribution = propDistribution.Value, - Lambda = propLambda.Value, - Normalization = propNormalization.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityIb value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDistribution, value.Distribution, null, null); - writer.WriteProperty(options, PropLambda, value.Lambda, null, null); - writer.WriteProperty(options, PropNormalization, value.Normalization, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityIbConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SettingsSimilarityIbConverter))] public sealed partial class SettingsSimilarityIb : Elastic.Clients.Elasticsearch.IndexManagement.ISettingsSimilarity { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityLmd.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityLmd.Converters.g.cs new file mode 100644 index 00000000000..c9847ad4353 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityLmd.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SettingsSimilarityLmdConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMu = System.Text.Json.JsonEncodedText.Encode("mu"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityLmd Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMu = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMu.TryReadProperty(ref reader, options, PropMu, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityLmd(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Mu = propMu.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityLmd value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMu, value.Mu, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityLmd.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityLmd.g.cs index 2216adc468e..f297bce7cf9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityLmd.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityLmd.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class SettingsSimilarityLmdConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMu = System.Text.Json.JsonEncodedText.Encode("mu"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityLmd Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMu = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMu.TryReadProperty(ref reader, options, PropMu, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityLmd(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Mu = propMu.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityLmd value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMu, value.Mu, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityLmdConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SettingsSimilarityLmdConverter))] public sealed partial class SettingsSimilarityLmd : Elastic.Clients.Elasticsearch.IndexManagement.ISettingsSimilarity { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityLmj.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityLmj.Converters.g.cs new file mode 100644 index 00000000000..1b38a71398d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityLmj.Converters.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SettingsSimilarityLmjConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLambda = System.Text.Json.JsonEncodedText.Encode("lambda"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityLmj Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLambda = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLambda.TryReadProperty(ref reader, options, PropLambda, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityLmj(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Lambda = propLambda.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityLmj value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLambda, value.Lambda, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityLmj.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityLmj.g.cs index 6a4343e9d38..47740602487 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityLmj.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityLmj.g.cs @@ -23,54 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class SettingsSimilarityLmjConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLambda = System.Text.Json.JsonEncodedText.Encode("lambda"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityLmj Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLambda = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLambda.TryReadProperty(ref reader, options, PropLambda, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityLmj(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Lambda = propLambda.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityLmj value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLambda, value.Lambda, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityLmjConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SettingsSimilarityLmjConverter))] public sealed partial class SettingsSimilarityLmj : Elastic.Clients.Elasticsearch.IndexManagement.ISettingsSimilarity { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityScripted.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityScripted.Converters.g.cs new file mode 100644 index 00000000000..fd5eafc1b3d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityScripted.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SettingsSimilarityScriptedConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropWeightScript = System.Text.Json.JsonEncodedText.Encode("weight_script"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityScripted Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propScript = default; + LocalJsonValue propWeightScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propWeightScript.TryReadProperty(ref reader, options, PropWeightScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityScripted(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Script = propScript.Value, + WeightScript = propWeightScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityScripted value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropWeightScript, value.WeightScript, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityScripted.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityScripted.g.cs index 47a81075eec..9b31587ae24 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityScripted.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityScripted.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class SettingsSimilarityScriptedConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropWeightScript = System.Text.Json.JsonEncodedText.Encode("weight_script"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityScripted Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propScript = default; - LocalJsonValue propWeightScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propWeightScript.TryReadProperty(ref reader, options, PropWeightScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityScripted(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Script = propScript.Value, - WeightScript = propWeightScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityScripted value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropWeightScript, value.WeightScript, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SettingsSimilarityScriptedConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SettingsSimilarityScriptedConverter))] public sealed partial class SettingsSimilarityScripted : Elastic.Clients.Elasticsearch.IndexManagement.ISettingsSimilarity { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardCommit.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardCommit.Converters.g.cs new file mode 100644 index 00000000000..b4e65368e7c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardCommit.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ShardCommitConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropGeneration = System.Text.Json.JsonEncodedText.Encode("generation"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropNumDocs = System.Text.Json.JsonEncodedText.Encode("num_docs"); + private static readonly System.Text.Json.JsonEncodedText PropUserData = System.Text.Json.JsonEncodedText.Encode("user_data"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShardCommit Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propGeneration = default; + LocalJsonValue propId = default; + LocalJsonValue propNumDocs = default; + LocalJsonValue> propUserData = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propGeneration.TryReadProperty(ref reader, options, PropGeneration, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propNumDocs.TryReadProperty(ref reader, options, PropNumDocs, null)) + { + continue; + } + + if (propUserData.TryReadProperty(ref reader, options, PropUserData, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ShardCommit(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Generation = propGeneration.Value, + Id = propId.Value, + NumDocs = propNumDocs.Value, + UserData = propUserData.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardCommit value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropGeneration, value.Generation, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropNumDocs, value.NumDocs, null, null); + writer.WriteProperty(options, PropUserData, value.UserData, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardCommit.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardCommit.g.cs index 0640223238f..6c2fa2cd816 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardCommit.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardCommit.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ShardCommitConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropGeneration = System.Text.Json.JsonEncodedText.Encode("generation"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropNumDocs = System.Text.Json.JsonEncodedText.Encode("num_docs"); - private static readonly System.Text.Json.JsonEncodedText PropUserData = System.Text.Json.JsonEncodedText.Encode("user_data"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShardCommit Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propGeneration = default; - LocalJsonValue propId = default; - LocalJsonValue propNumDocs = default; - LocalJsonValue> propUserData = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propGeneration.TryReadProperty(ref reader, options, PropGeneration, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propNumDocs.TryReadProperty(ref reader, options, PropNumDocs, null)) - { - continue; - } - - if (propUserData.TryReadProperty(ref reader, options, PropUserData, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ShardCommit(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Generation = propGeneration.Value, - Id = propId.Value, - NumDocs = propNumDocs.Value, - UserData = propUserData.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardCommit value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropGeneration, value.Generation, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropNumDocs, value.NumDocs, null, null); - writer.WriteProperty(options, PropUserData, value.UserData, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ShardCommitConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ShardCommitConverter))] public sealed partial class ShardCommit { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardFileSizeInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardFileSizeInfo.Converters.g.cs new file mode 100644 index 00000000000..c66dbaee455 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardFileSizeInfo.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ShardFileSizeInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAverageSizeInBytes = System.Text.Json.JsonEncodedText.Encode("average_size_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropMaxSizeInBytes = System.Text.Json.JsonEncodedText.Encode("max_size_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropMinSizeInBytes = System.Text.Json.JsonEncodedText.Encode("min_size_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropSizeInBytes = System.Text.Json.JsonEncodedText.Encode("size_in_bytes"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShardFileSizeInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAverageSizeInBytes = default; + LocalJsonValue propCount = default; + LocalJsonValue propDescription = default; + LocalJsonValue propMaxSizeInBytes = default; + LocalJsonValue propMinSizeInBytes = default; + LocalJsonValue propSizeInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAverageSizeInBytes.TryReadProperty(ref reader, options, PropAverageSizeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCount.TryReadProperty(ref reader, options, PropCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propMaxSizeInBytes.TryReadProperty(ref reader, options, PropMaxSizeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinSizeInBytes.TryReadProperty(ref reader, options, PropMinSizeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSizeInBytes.TryReadProperty(ref reader, options, PropSizeInBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ShardFileSizeInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AverageSizeInBytes = propAverageSizeInBytes.Value, + Count = propCount.Value, + Description = propDescription.Value, + MaxSizeInBytes = propMaxSizeInBytes.Value, + MinSizeInBytes = propMinSizeInBytes.Value, + SizeInBytes = propSizeInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardFileSizeInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAverageSizeInBytes, value.AverageSizeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCount, value.Count, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropMaxSizeInBytes, value.MaxSizeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinSizeInBytes, value.MinSizeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSizeInBytes, value.SizeInBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardFileSizeInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardFileSizeInfo.g.cs index eb1d6158481..4982e73450e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardFileSizeInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardFileSizeInfo.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ShardFileSizeInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAverageSizeInBytes = System.Text.Json.JsonEncodedText.Encode("average_size_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropMaxSizeInBytes = System.Text.Json.JsonEncodedText.Encode("max_size_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropMinSizeInBytes = System.Text.Json.JsonEncodedText.Encode("min_size_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropSizeInBytes = System.Text.Json.JsonEncodedText.Encode("size_in_bytes"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShardFileSizeInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAverageSizeInBytes = default; - LocalJsonValue propCount = default; - LocalJsonValue propDescription = default; - LocalJsonValue propMaxSizeInBytes = default; - LocalJsonValue propMinSizeInBytes = default; - LocalJsonValue propSizeInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAverageSizeInBytes.TryReadProperty(ref reader, options, PropAverageSizeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCount.TryReadProperty(ref reader, options, PropCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propMaxSizeInBytes.TryReadProperty(ref reader, options, PropMaxSizeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinSizeInBytes.TryReadProperty(ref reader, options, PropMinSizeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSizeInBytes.TryReadProperty(ref reader, options, PropSizeInBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ShardFileSizeInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AverageSizeInBytes = propAverageSizeInBytes.Value, - Count = propCount.Value, - Description = propDescription.Value, - MaxSizeInBytes = propMaxSizeInBytes.Value, - MinSizeInBytes = propMinSizeInBytes.Value, - SizeInBytes = propSizeInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardFileSizeInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAverageSizeInBytes, value.AverageSizeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCount, value.Count, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropMaxSizeInBytes, value.MaxSizeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinSizeInBytes, value.MinSizeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSizeInBytes, value.SizeInBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ShardFileSizeInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ShardFileSizeInfoConverter))] public sealed partial class ShardFileSizeInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardLease.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardLease.Converters.g.cs new file mode 100644 index 00000000000..6222fe272c1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardLease.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ShardLeaseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropRetainingSeqNo = System.Text.Json.JsonEncodedText.Encode("retaining_seq_no"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShardLease Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propRetainingSeqNo = default; + LocalJsonValue propSource = default; + LocalJsonValue propTimestamp = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propRetainingSeqNo.TryReadProperty(ref reader, options, PropRetainingSeqNo, null)) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ShardLease(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + RetainingSeqNo = propRetainingSeqNo.Value, + Source = propSource.Value, + Timestamp = propTimestamp.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardLease value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropRetainingSeqNo, value.RetainingSeqNo, null, null); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardLease.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardLease.g.cs index e8918d4fce0..74f4d45261e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardLease.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardLease.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ShardLeaseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropRetainingSeqNo = System.Text.Json.JsonEncodedText.Encode("retaining_seq_no"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShardLease Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue propRetainingSeqNo = default; - LocalJsonValue propSource = default; - LocalJsonValue propTimestamp = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propRetainingSeqNo.TryReadProperty(ref reader, options, PropRetainingSeqNo, null)) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ShardLease(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - RetainingSeqNo = propRetainingSeqNo.Value, - Source = propSource.Value, - Timestamp = propTimestamp.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardLease value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropRetainingSeqNo, value.RetainingSeqNo, null, null); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ShardLeaseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ShardLeaseConverter))] public sealed partial class ShardLease { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardPath.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardPath.Converters.g.cs new file mode 100644 index 00000000000..59cbce1cdec --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardPath.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ShardPathConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDataPath = System.Text.Json.JsonEncodedText.Encode("data_path"); + private static readonly System.Text.Json.JsonEncodedText PropIsCustomDataPath = System.Text.Json.JsonEncodedText.Encode("is_custom_data_path"); + private static readonly System.Text.Json.JsonEncodedText PropStatePath = System.Text.Json.JsonEncodedText.Encode("state_path"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShardPath Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDataPath = default; + LocalJsonValue propIsCustomDataPath = default; + LocalJsonValue propStatePath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDataPath.TryReadProperty(ref reader, options, PropDataPath, null)) + { + continue; + } + + if (propIsCustomDataPath.TryReadProperty(ref reader, options, PropIsCustomDataPath, null)) + { + continue; + } + + if (propStatePath.TryReadProperty(ref reader, options, PropStatePath, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ShardPath(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DataPath = propDataPath.Value, + IsCustomDataPath = propIsCustomDataPath.Value, + StatePath = propStatePath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardPath value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDataPath, value.DataPath, null, null); + writer.WriteProperty(options, PropIsCustomDataPath, value.IsCustomDataPath, null, null); + writer.WriteProperty(options, PropStatePath, value.StatePath, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardPath.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardPath.g.cs index 647ccde0693..a255376034a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardPath.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardPath.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ShardPathConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDataPath = System.Text.Json.JsonEncodedText.Encode("data_path"); - private static readonly System.Text.Json.JsonEncodedText PropIsCustomDataPath = System.Text.Json.JsonEncodedText.Encode("is_custom_data_path"); - private static readonly System.Text.Json.JsonEncodedText PropStatePath = System.Text.Json.JsonEncodedText.Encode("state_path"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShardPath Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDataPath = default; - LocalJsonValue propIsCustomDataPath = default; - LocalJsonValue propStatePath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDataPath.TryReadProperty(ref reader, options, PropDataPath, null)) - { - continue; - } - - if (propIsCustomDataPath.TryReadProperty(ref reader, options, PropIsCustomDataPath, null)) - { - continue; - } - - if (propStatePath.TryReadProperty(ref reader, options, PropStatePath, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ShardPath(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DataPath = propDataPath.Value, - IsCustomDataPath = propIsCustomDataPath.Value, - StatePath = propStatePath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardPath value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDataPath, value.DataPath, null, null); - writer.WriteProperty(options, PropIsCustomDataPath, value.IsCustomDataPath, null, null); - writer.WriteProperty(options, PropStatePath, value.StatePath, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ShardPathConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ShardPathConverter))] public sealed partial class ShardPath { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardQueryCache.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardQueryCache.Converters.g.cs new file mode 100644 index 00000000000..4e4efeba4f3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardQueryCache.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ShardQueryCacheConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCacheCount = System.Text.Json.JsonEncodedText.Encode("cache_count"); + private static readonly System.Text.Json.JsonEncodedText PropCacheSize = System.Text.Json.JsonEncodedText.Encode("cache_size"); + private static readonly System.Text.Json.JsonEncodedText PropEvictions = System.Text.Json.JsonEncodedText.Encode("evictions"); + private static readonly System.Text.Json.JsonEncodedText PropHitCount = System.Text.Json.JsonEncodedText.Encode("hit_count"); + private static readonly System.Text.Json.JsonEncodedText PropMemorySizeInBytes = System.Text.Json.JsonEncodedText.Encode("memory_size_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropMissCount = System.Text.Json.JsonEncodedText.Encode("miss_count"); + private static readonly System.Text.Json.JsonEncodedText PropTotalCount = System.Text.Json.JsonEncodedText.Encode("total_count"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShardQueryCache Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCacheCount = default; + LocalJsonValue propCacheSize = default; + LocalJsonValue propEvictions = default; + LocalJsonValue propHitCount = default; + LocalJsonValue propMemorySizeInBytes = default; + LocalJsonValue propMissCount = default; + LocalJsonValue propTotalCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCacheCount.TryReadProperty(ref reader, options, PropCacheCount, null)) + { + continue; + } + + if (propCacheSize.TryReadProperty(ref reader, options, PropCacheSize, null)) + { + continue; + } + + if (propEvictions.TryReadProperty(ref reader, options, PropEvictions, null)) + { + continue; + } + + if (propHitCount.TryReadProperty(ref reader, options, PropHitCount, null)) + { + continue; + } + + if (propMemorySizeInBytes.TryReadProperty(ref reader, options, PropMemorySizeInBytes, null)) + { + continue; + } + + if (propMissCount.TryReadProperty(ref reader, options, PropMissCount, null)) + { + continue; + } + + if (propTotalCount.TryReadProperty(ref reader, options, PropTotalCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ShardQueryCache(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CacheCount = propCacheCount.Value, + CacheSize = propCacheSize.Value, + Evictions = propEvictions.Value, + HitCount = propHitCount.Value, + MemorySizeInBytes = propMemorySizeInBytes.Value, + MissCount = propMissCount.Value, + TotalCount = propTotalCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardQueryCache value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCacheCount, value.CacheCount, null, null); + writer.WriteProperty(options, PropCacheSize, value.CacheSize, null, null); + writer.WriteProperty(options, PropEvictions, value.Evictions, null, null); + writer.WriteProperty(options, PropHitCount, value.HitCount, null, null); + writer.WriteProperty(options, PropMemorySizeInBytes, value.MemorySizeInBytes, null, null); + writer.WriteProperty(options, PropMissCount, value.MissCount, null, null); + writer.WriteProperty(options, PropTotalCount, value.TotalCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardQueryCache.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardQueryCache.g.cs index 789e9c5593a..2bec88250a0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardQueryCache.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardQueryCache.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ShardQueryCacheConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCacheCount = System.Text.Json.JsonEncodedText.Encode("cache_count"); - private static readonly System.Text.Json.JsonEncodedText PropCacheSize = System.Text.Json.JsonEncodedText.Encode("cache_size"); - private static readonly System.Text.Json.JsonEncodedText PropEvictions = System.Text.Json.JsonEncodedText.Encode("evictions"); - private static readonly System.Text.Json.JsonEncodedText PropHitCount = System.Text.Json.JsonEncodedText.Encode("hit_count"); - private static readonly System.Text.Json.JsonEncodedText PropMemorySizeInBytes = System.Text.Json.JsonEncodedText.Encode("memory_size_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropMissCount = System.Text.Json.JsonEncodedText.Encode("miss_count"); - private static readonly System.Text.Json.JsonEncodedText PropTotalCount = System.Text.Json.JsonEncodedText.Encode("total_count"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShardQueryCache Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCacheCount = default; - LocalJsonValue propCacheSize = default; - LocalJsonValue propEvictions = default; - LocalJsonValue propHitCount = default; - LocalJsonValue propMemorySizeInBytes = default; - LocalJsonValue propMissCount = default; - LocalJsonValue propTotalCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCacheCount.TryReadProperty(ref reader, options, PropCacheCount, null)) - { - continue; - } - - if (propCacheSize.TryReadProperty(ref reader, options, PropCacheSize, null)) - { - continue; - } - - if (propEvictions.TryReadProperty(ref reader, options, PropEvictions, null)) - { - continue; - } - - if (propHitCount.TryReadProperty(ref reader, options, PropHitCount, null)) - { - continue; - } - - if (propMemorySizeInBytes.TryReadProperty(ref reader, options, PropMemorySizeInBytes, null)) - { - continue; - } - - if (propMissCount.TryReadProperty(ref reader, options, PropMissCount, null)) - { - continue; - } - - if (propTotalCount.TryReadProperty(ref reader, options, PropTotalCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ShardQueryCache(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CacheCount = propCacheCount.Value, - CacheSize = propCacheSize.Value, - Evictions = propEvictions.Value, - HitCount = propHitCount.Value, - MemorySizeInBytes = propMemorySizeInBytes.Value, - MissCount = propMissCount.Value, - TotalCount = propTotalCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardQueryCache value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCacheCount, value.CacheCount, null, null); - writer.WriteProperty(options, PropCacheSize, value.CacheSize, null, null); - writer.WriteProperty(options, PropEvictions, value.Evictions, null, null); - writer.WriteProperty(options, PropHitCount, value.HitCount, null, null); - writer.WriteProperty(options, PropMemorySizeInBytes, value.MemorySizeInBytes, null, null); - writer.WriteProperty(options, PropMissCount, value.MissCount, null, null); - writer.WriteProperty(options, PropTotalCount, value.TotalCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ShardQueryCacheConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ShardQueryCacheConverter))] public sealed partial class ShardQueryCache { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRecovery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRecovery.Converters.g.cs new file mode 100644 index 00000000000..5008758e5a0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRecovery.Converters.g.cs @@ -0,0 +1,198 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ShardRecoveryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropPrimary = System.Text.Json.JsonEncodedText.Encode("primary"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + private static readonly System.Text.Json.JsonEncodedText PropStage = System.Text.Json.JsonEncodedText.Encode("stage"); + private static readonly System.Text.Json.JsonEncodedText PropStart = System.Text.Json.JsonEncodedText.Encode("start"); + 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"); + private static readonly System.Text.Json.JsonEncodedText PropStopTime = System.Text.Json.JsonEncodedText.Encode("stop_time"); + private static readonly System.Text.Json.JsonEncodedText PropStopTimeInMillis = System.Text.Json.JsonEncodedText.Encode("stop_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTarget = System.Text.Json.JsonEncodedText.Encode("target"); + private static readonly System.Text.Json.JsonEncodedText PropTotalTime = System.Text.Json.JsonEncodedText.Encode("total_time"); + private static readonly System.Text.Json.JsonEncodedText PropTotalTimeInMillis = System.Text.Json.JsonEncodedText.Encode("total_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTranslog = System.Text.Json.JsonEncodedText.Encode("translog"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVerifyIndex = System.Text.Json.JsonEncodedText.Encode("verify_index"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShardRecovery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + LocalJsonValue propPrimary = default; + LocalJsonValue propSource = default; + LocalJsonValue propStage = default; + LocalJsonValue propStart = default; + LocalJsonValue propStartTime = default; + LocalJsonValue propStartTimeInMillis = default; + LocalJsonValue propStopTime = default; + LocalJsonValue propStopTimeInMillis = default; + LocalJsonValue propTarget = default; + LocalJsonValue propTotalTime = default; + LocalJsonValue propTotalTimeInMillis = default; + LocalJsonValue propTranslog = default; + LocalJsonValue propType = default; + LocalJsonValue propVerifyIndex = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propPrimary.TryReadProperty(ref reader, options, PropPrimary, null)) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (propStage.TryReadProperty(ref reader, options, PropStage, null)) + { + continue; + } + + if (propStart.TryReadProperty(ref reader, options, PropStart, null)) + { + continue; + } + + if (propStartTime.TryReadProperty(ref reader, options, PropStartTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propStopTime.TryReadProperty(ref reader, options, PropStopTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propStopTimeInMillis.TryReadProperty(ref reader, options, PropStopTimeInMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propTarget.TryReadProperty(ref reader, options, PropTarget, null)) + { + continue; + } + + if (propTotalTime.TryReadProperty(ref reader, options, PropTotalTime, null)) + { + continue; + } + + if (propTotalTimeInMillis.TryReadProperty(ref reader, options, PropTotalTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTranslog.TryReadProperty(ref reader, options, PropTranslog, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (propVerifyIndex.TryReadProperty(ref reader, options, PropVerifyIndex, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ShardRecovery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + Index = propIndex.Value, + Primary = propPrimary.Value, + Source = propSource.Value, + Stage = propStage.Value, + Start = propStart.Value, + StartTime = propStartTime.Value, + StartTimeInMillis = propStartTimeInMillis.Value, + StopTime = propStopTime.Value, + StopTimeInMillis = propStopTimeInMillis.Value, + Target = propTarget.Value, + TotalTime = propTotalTime.Value, + TotalTimeInMillis = propTotalTimeInMillis.Value, + Translog = propTranslog.Value, + Type = propType.Value, + VerifyIndex = propVerifyIndex.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardRecovery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropPrimary, value.Primary, null, null); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteProperty(options, PropStage, value.Stage, null, null); + writer.WriteProperty(options, PropStart, value.Start, null, null); + writer.WriteProperty(options, PropStartTime, value.StartTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropStopTime, value.StopTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropStopTimeInMillis, value.StopTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropTarget, value.Target, null, null); + writer.WriteProperty(options, PropTotalTime, value.TotalTime, null, null); + writer.WriteProperty(options, PropTotalTimeInMillis, value.TotalTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTranslog, value.Translog, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVerifyIndex, value.VerifyIndex, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRecovery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRecovery.g.cs index 4abadfe7498..58347e0c558 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRecovery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRecovery.g.cs @@ -23,181 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ShardRecoveryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropPrimary = System.Text.Json.JsonEncodedText.Encode("primary"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - private static readonly System.Text.Json.JsonEncodedText PropStage = System.Text.Json.JsonEncodedText.Encode("stage"); - private static readonly System.Text.Json.JsonEncodedText PropStart = System.Text.Json.JsonEncodedText.Encode("start"); - 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"); - private static readonly System.Text.Json.JsonEncodedText PropStopTime = System.Text.Json.JsonEncodedText.Encode("stop_time"); - private static readonly System.Text.Json.JsonEncodedText PropStopTimeInMillis = System.Text.Json.JsonEncodedText.Encode("stop_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTarget = System.Text.Json.JsonEncodedText.Encode("target"); - private static readonly System.Text.Json.JsonEncodedText PropTotalTime = System.Text.Json.JsonEncodedText.Encode("total_time"); - private static readonly System.Text.Json.JsonEncodedText PropTotalTimeInMillis = System.Text.Json.JsonEncodedText.Encode("total_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTranslog = System.Text.Json.JsonEncodedText.Encode("translog"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVerifyIndex = System.Text.Json.JsonEncodedText.Encode("verify_index"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShardRecovery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - LocalJsonValue propPrimary = default; - LocalJsonValue propSource = default; - LocalJsonValue propStage = default; - LocalJsonValue propStart = default; - LocalJsonValue propStartTime = default; - LocalJsonValue propStartTimeInMillis = default; - LocalJsonValue propStopTime = default; - LocalJsonValue propStopTimeInMillis = default; - LocalJsonValue propTarget = default; - LocalJsonValue propTotalTime = default; - LocalJsonValue propTotalTimeInMillis = default; - LocalJsonValue propTranslog = default; - LocalJsonValue propType = default; - LocalJsonValue propVerifyIndex = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propPrimary.TryReadProperty(ref reader, options, PropPrimary, null)) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (propStage.TryReadProperty(ref reader, options, PropStage, null)) - { - continue; - } - - if (propStart.TryReadProperty(ref reader, options, PropStart, null)) - { - continue; - } - - if (propStartTime.TryReadProperty(ref reader, options, PropStartTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propStopTime.TryReadProperty(ref reader, options, PropStopTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propStopTimeInMillis.TryReadProperty(ref reader, options, PropStopTimeInMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propTarget.TryReadProperty(ref reader, options, PropTarget, null)) - { - continue; - } - - if (propTotalTime.TryReadProperty(ref reader, options, PropTotalTime, null)) - { - continue; - } - - if (propTotalTimeInMillis.TryReadProperty(ref reader, options, PropTotalTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTranslog.TryReadProperty(ref reader, options, PropTranslog, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (propVerifyIndex.TryReadProperty(ref reader, options, PropVerifyIndex, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ShardRecovery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - Index = propIndex.Value, - Primary = propPrimary.Value, - Source = propSource.Value, - Stage = propStage.Value, - Start = propStart.Value, - StartTime = propStartTime.Value, - StartTimeInMillis = propStartTimeInMillis.Value, - StopTime = propStopTime.Value, - StopTimeInMillis = propStopTimeInMillis.Value, - Target = propTarget.Value, - TotalTime = propTotalTime.Value, - TotalTimeInMillis = propTotalTimeInMillis.Value, - Translog = propTranslog.Value, - Type = propType.Value, - VerifyIndex = propVerifyIndex.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardRecovery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropPrimary, value.Primary, null, null); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteProperty(options, PropStage, value.Stage, null, null); - writer.WriteProperty(options, PropStart, value.Start, null, null); - writer.WriteProperty(options, PropStartTime, value.StartTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropStopTime, value.StopTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropStopTimeInMillis, value.StopTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropTarget, value.Target, null, null); - writer.WriteProperty(options, PropTotalTime, value.TotalTime, null, null); - writer.WriteProperty(options, PropTotalTimeInMillis, value.TotalTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTranslog, value.Translog, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVerifyIndex, value.VerifyIndex, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ShardRecoveryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ShardRecoveryConverter))] public sealed partial class ShardRecovery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRetentionLeases.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRetentionLeases.Converters.g.cs new file mode 100644 index 00000000000..3d0b4f80ded --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRetentionLeases.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ShardRetentionLeasesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLeases = System.Text.Json.JsonEncodedText.Encode("leases"); + private static readonly System.Text.Json.JsonEncodedText PropPrimaryTerm = System.Text.Json.JsonEncodedText.Encode("primary_term"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShardRetentionLeases Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propLeases = default; + LocalJsonValue propPrimaryTerm = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLeases.TryReadProperty(ref reader, options, PropLeases, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propPrimaryTerm.TryReadProperty(ref reader, options, PropPrimaryTerm, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ShardRetentionLeases(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Leases = propLeases.Value, + PrimaryTerm = propPrimaryTerm.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardRetentionLeases value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLeases, value.Leases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPrimaryTerm, value.PrimaryTerm, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRetentionLeases.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRetentionLeases.g.cs index 1895a0754cb..a87cb2519c9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRetentionLeases.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRetentionLeases.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ShardRetentionLeasesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLeases = System.Text.Json.JsonEncodedText.Encode("leases"); - private static readonly System.Text.Json.JsonEncodedText PropPrimaryTerm = System.Text.Json.JsonEncodedText.Encode("primary_term"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShardRetentionLeases Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propLeases = default; - LocalJsonValue propPrimaryTerm = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLeases.TryReadProperty(ref reader, options, PropLeases, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propPrimaryTerm.TryReadProperty(ref reader, options, PropPrimaryTerm, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ShardRetentionLeases(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Leases = propLeases.Value, - PrimaryTerm = propPrimaryTerm.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardRetentionLeases value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLeases, value.Leases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPrimaryTerm, value.PrimaryTerm, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ShardRetentionLeasesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ShardRetentionLeasesConverter))] public sealed partial class ShardRetentionLeases { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRouting.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRouting.Converters.g.cs new file mode 100644 index 00000000000..afda82bb8dd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRouting.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ShardRoutingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); + private static readonly System.Text.Json.JsonEncodedText PropPrimary = System.Text.Json.JsonEncodedText.Encode("primary"); + private static readonly System.Text.Json.JsonEncodedText PropRelocatingNode = System.Text.Json.JsonEncodedText.Encode("relocating_node"); + private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShardRouting Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propNode = default; + LocalJsonValue propPrimary = default; + LocalJsonValue propRelocatingNode = default; + LocalJsonValue propState = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNode.TryReadProperty(ref reader, options, PropNode, null)) + { + continue; + } + + if (propPrimary.TryReadProperty(ref reader, options, PropPrimary, null)) + { + continue; + } + + if (propRelocatingNode.TryReadProperty(ref reader, options, PropRelocatingNode, null)) + { + continue; + } + + if (propState.TryReadProperty(ref reader, options, PropState, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ShardRouting(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Node = propNode.Value, + Primary = propPrimary.Value, + RelocatingNode = propRelocatingNode.Value, + State = propState.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardRouting value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNode, value.Node, null, null); + writer.WriteProperty(options, PropPrimary, value.Primary, null, null); + writer.WriteProperty(options, PropRelocatingNode, value.RelocatingNode, null, null); + writer.WriteProperty(options, PropState, value.State, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRouting.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRouting.g.cs index 448e3340c86..4d16839429a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRouting.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRouting.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ShardRoutingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); - private static readonly System.Text.Json.JsonEncodedText PropPrimary = System.Text.Json.JsonEncodedText.Encode("primary"); - private static readonly System.Text.Json.JsonEncodedText PropRelocatingNode = System.Text.Json.JsonEncodedText.Encode("relocating_node"); - private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShardRouting Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propNode = default; - LocalJsonValue propPrimary = default; - LocalJsonValue propRelocatingNode = default; - LocalJsonValue propState = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNode.TryReadProperty(ref reader, options, PropNode, null)) - { - continue; - } - - if (propPrimary.TryReadProperty(ref reader, options, PropPrimary, null)) - { - continue; - } - - if (propRelocatingNode.TryReadProperty(ref reader, options, PropRelocatingNode, null)) - { - continue; - } - - if (propState.TryReadProperty(ref reader, options, PropState, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ShardRouting(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Node = propNode.Value, - Primary = propPrimary.Value, - RelocatingNode = propRelocatingNode.Value, - State = propState.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardRouting value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNode, value.Node, null, null); - writer.WriteProperty(options, PropPrimary, value.Primary, null, null); - writer.WriteProperty(options, PropRelocatingNode, value.RelocatingNode, null, null); - writer.WriteProperty(options, PropState, value.State, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ShardRoutingConverter))] public sealed partial class ShardRouting { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRoutingState.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRoutingState.Converters.g.cs new file mode 100644 index 00000000000..037a1b1be65 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRoutingState.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ShardRoutingStateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberInitializing = System.Text.Json.JsonEncodedText.Encode("INITIALIZING"); + private static readonly System.Text.Json.JsonEncodedText MemberRelocating = System.Text.Json.JsonEncodedText.Encode("RELOCATING"); + private static readonly System.Text.Json.JsonEncodedText MemberStarted = System.Text.Json.JsonEncodedText.Encode("STARTED"); + private static readonly System.Text.Json.JsonEncodedText MemberUnassigned = System.Text.Json.JsonEncodedText.Encode("UNASSIGNED"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberInitializing)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState.Initializing; + } + + if (reader.ValueTextEquals(MemberRelocating)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState.Relocating; + } + + if (reader.ValueTextEquals(MemberStarted)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState.Started; + } + + if (reader.ValueTextEquals(MemberUnassigned)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState.Unassigned; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberInitializing.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState.Initializing; + } + + if (string.Equals(value, MemberRelocating.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState.Relocating; + } + + if (string.Equals(value, MemberStarted.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState.Started; + } + + if (string.Equals(value, MemberUnassigned.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState.Unassigned; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState.Initializing: + writer.WriteStringValue(MemberInitializing); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState.Relocating: + writer.WriteStringValue(MemberRelocating); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState.Started: + writer.WriteStringValue(MemberStarted); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState.Unassigned: + writer.WriteStringValue(MemberUnassigned); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardRoutingState value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRoutingState.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRoutingState.g.cs new file mode 100644 index 00000000000..218eac54f4f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardRoutingState.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ShardRoutingStateConverter))] +public enum ShardRoutingState +{ + [System.Runtime.Serialization.EnumMember(Value = "INITIALIZING")] + Initializing, + [System.Runtime.Serialization.EnumMember(Value = "RELOCATING")] + Relocating, + [System.Runtime.Serialization.EnumMember(Value = "STARTED")] + Started, + [System.Runtime.Serialization.EnumMember(Value = "UNASSIGNED")] + Unassigned +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardSegmentRouting.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardSegmentRouting.Converters.g.cs new file mode 100644 index 00000000000..c1e8e57b334 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardSegmentRouting.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ShardSegmentRoutingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); + private static readonly System.Text.Json.JsonEncodedText PropPrimary = System.Text.Json.JsonEncodedText.Encode("primary"); + private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShardSegmentRouting Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propNode = default; + LocalJsonValue propPrimary = default; + LocalJsonValue propState = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNode.TryReadProperty(ref reader, options, PropNode, null)) + { + continue; + } + + if (propPrimary.TryReadProperty(ref reader, options, PropPrimary, null)) + { + continue; + } + + if (propState.TryReadProperty(ref reader, options, PropState, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ShardSegmentRouting(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Node = propNode.Value, + Primary = propPrimary.Value, + State = propState.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardSegmentRouting value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNode, value.Node, null, null); + writer.WriteProperty(options, PropPrimary, value.Primary, null, null); + writer.WriteProperty(options, PropState, value.State, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardSegmentRouting.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardSegmentRouting.g.cs index 1cf71fee3e5..26b4fd265af 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardSegmentRouting.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardSegmentRouting.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ShardSegmentRoutingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); - private static readonly System.Text.Json.JsonEncodedText PropPrimary = System.Text.Json.JsonEncodedText.Encode("primary"); - private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShardSegmentRouting Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propNode = default; - LocalJsonValue propPrimary = default; - LocalJsonValue propState = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNode.TryReadProperty(ref reader, options, PropNode, null)) - { - continue; - } - - if (propPrimary.TryReadProperty(ref reader, options, PropPrimary, null)) - { - continue; - } - - if (propState.TryReadProperty(ref reader, options, PropState, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ShardSegmentRouting(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Node = propNode.Value, - Primary = propPrimary.Value, - State = propState.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardSegmentRouting value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNode, value.Node, null, null); - writer.WriteProperty(options, PropPrimary, value.Primary, null, null); - writer.WriteProperty(options, PropState, value.State, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ShardSegmentRoutingConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ShardSegmentRoutingConverter))] public sealed partial class ShardSegmentRouting { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardSequenceNumber.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardSequenceNumber.Converters.g.cs new file mode 100644 index 00000000000..cae1f486f3d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardSequenceNumber.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ShardSequenceNumberConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropGlobalCheckpoint = System.Text.Json.JsonEncodedText.Encode("global_checkpoint"); + private static readonly System.Text.Json.JsonEncodedText PropLocalCheckpoint = System.Text.Json.JsonEncodedText.Encode("local_checkpoint"); + private static readonly System.Text.Json.JsonEncodedText PropMaxSeqNo = System.Text.Json.JsonEncodedText.Encode("max_seq_no"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShardSequenceNumber Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propGlobalCheckpoint = default; + LocalJsonValue propLocalCheckpoint = default; + LocalJsonValue propMaxSeqNo = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propGlobalCheckpoint.TryReadProperty(ref reader, options, PropGlobalCheckpoint, null)) + { + continue; + } + + if (propLocalCheckpoint.TryReadProperty(ref reader, options, PropLocalCheckpoint, null)) + { + continue; + } + + if (propMaxSeqNo.TryReadProperty(ref reader, options, PropMaxSeqNo, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ShardSequenceNumber(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + GlobalCheckpoint = propGlobalCheckpoint.Value, + LocalCheckpoint = propLocalCheckpoint.Value, + MaxSeqNo = propMaxSeqNo.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardSequenceNumber value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropGlobalCheckpoint, value.GlobalCheckpoint, null, null); + writer.WriteProperty(options, PropLocalCheckpoint, value.LocalCheckpoint, null, null); + writer.WriteProperty(options, PropMaxSeqNo, value.MaxSeqNo, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardSequenceNumber.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardSequenceNumber.g.cs index 2214f9f9e46..98070135389 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardSequenceNumber.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardSequenceNumber.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ShardSequenceNumberConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropGlobalCheckpoint = System.Text.Json.JsonEncodedText.Encode("global_checkpoint"); - private static readonly System.Text.Json.JsonEncodedText PropLocalCheckpoint = System.Text.Json.JsonEncodedText.Encode("local_checkpoint"); - private static readonly System.Text.Json.JsonEncodedText PropMaxSeqNo = System.Text.Json.JsonEncodedText.Encode("max_seq_no"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShardSequenceNumber Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propGlobalCheckpoint = default; - LocalJsonValue propLocalCheckpoint = default; - LocalJsonValue propMaxSeqNo = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propGlobalCheckpoint.TryReadProperty(ref reader, options, PropGlobalCheckpoint, null)) - { - continue; - } - - if (propLocalCheckpoint.TryReadProperty(ref reader, options, PropLocalCheckpoint, null)) - { - continue; - } - - if (propMaxSeqNo.TryReadProperty(ref reader, options, PropMaxSeqNo, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ShardSequenceNumber(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - GlobalCheckpoint = propGlobalCheckpoint.Value, - LocalCheckpoint = propLocalCheckpoint.Value, - MaxSeqNo = propMaxSeqNo.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardSequenceNumber value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropGlobalCheckpoint, value.GlobalCheckpoint, null, null); - writer.WriteProperty(options, PropLocalCheckpoint, value.LocalCheckpoint, null, null); - writer.WriteProperty(options, PropMaxSeqNo, value.MaxSeqNo, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ShardSequenceNumberConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ShardSequenceNumberConverter))] public sealed partial class ShardSequenceNumber { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStats.Converters.g.cs new file mode 100644 index 00000000000..eba5ade6cf0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStats.Converters.g.cs @@ -0,0 +1,288 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ShardStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBulk = System.Text.Json.JsonEncodedText.Encode("bulk"); + private static readonly System.Text.Json.JsonEncodedText PropCommit = System.Text.Json.JsonEncodedText.Encode("commit"); + private static readonly System.Text.Json.JsonEncodedText PropCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); + private static readonly System.Text.Json.JsonEncodedText PropFielddata = System.Text.Json.JsonEncodedText.Encode("fielddata"); + private static readonly System.Text.Json.JsonEncodedText PropFlush = System.Text.Json.JsonEncodedText.Encode("flush"); + private static readonly System.Text.Json.JsonEncodedText PropGet = System.Text.Json.JsonEncodedText.Encode("get"); + private static readonly System.Text.Json.JsonEncodedText PropIndexing = System.Text.Json.JsonEncodedText.Encode("indexing"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); + private static readonly System.Text.Json.JsonEncodedText PropMerges = System.Text.Json.JsonEncodedText.Encode("merges"); + private static readonly System.Text.Json.JsonEncodedText PropQueryCache = System.Text.Json.JsonEncodedText.Encode("query_cache"); + private static readonly System.Text.Json.JsonEncodedText PropRecovery = System.Text.Json.JsonEncodedText.Encode("recovery"); + private static readonly System.Text.Json.JsonEncodedText PropRefresh = System.Text.Json.JsonEncodedText.Encode("refresh"); + private static readonly System.Text.Json.JsonEncodedText PropRequestCache = System.Text.Json.JsonEncodedText.Encode("request_cache"); + private static readonly System.Text.Json.JsonEncodedText PropRetentionLeases = System.Text.Json.JsonEncodedText.Encode("retention_leases"); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); + private static readonly System.Text.Json.JsonEncodedText PropSearch = System.Text.Json.JsonEncodedText.Encode("search"); + private static readonly System.Text.Json.JsonEncodedText PropSegments = System.Text.Json.JsonEncodedText.Encode("segments"); + private static readonly System.Text.Json.JsonEncodedText PropSeqNo = System.Text.Json.JsonEncodedText.Encode("seq_no"); + private static readonly System.Text.Json.JsonEncodedText PropShardPath = System.Text.Json.JsonEncodedText.Encode("shard_path"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); + private static readonly System.Text.Json.JsonEncodedText PropShardStats2 = System.Text.Json.JsonEncodedText.Encode("shard_stats"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropTranslog = System.Text.Json.JsonEncodedText.Encode("translog"); + private static readonly System.Text.Json.JsonEncodedText PropWarmer = System.Text.Json.JsonEncodedText.Encode("warmer"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShardStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBulk = default; + LocalJsonValue propCommit = default; + LocalJsonValue propCompletion = default; + LocalJsonValue propDocs = default; + LocalJsonValue propFielddata = default; + LocalJsonValue propFlush = default; + LocalJsonValue propGet = default; + LocalJsonValue propIndexing = default; + LocalJsonValue propIndices = default; + LocalJsonValue propMappings = default; + LocalJsonValue propMerges = default; + LocalJsonValue propQueryCache = default; + LocalJsonValue propRecovery = default; + LocalJsonValue propRefresh = default; + LocalJsonValue propRequestCache = default; + LocalJsonValue propRetentionLeases = default; + LocalJsonValue propRouting = default; + LocalJsonValue propSearch = default; + LocalJsonValue propSegments = default; + LocalJsonValue propSeqNo = default; + LocalJsonValue propShardPath = default; + LocalJsonValue?> propShards = default; + LocalJsonValue propShardStats2 = default; + LocalJsonValue propStore = default; + LocalJsonValue propTranslog = default; + LocalJsonValue propWarmer = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBulk.TryReadProperty(ref reader, options, PropBulk, null)) + { + continue; + } + + if (propCommit.TryReadProperty(ref reader, options, PropCommit, null)) + { + continue; + } + + if (propCompletion.TryReadProperty(ref reader, options, PropCompletion, null)) + { + continue; + } + + if (propDocs.TryReadProperty(ref reader, options, PropDocs, null)) + { + continue; + } + + if (propFielddata.TryReadProperty(ref reader, options, PropFielddata, null)) + { + continue; + } + + if (propFlush.TryReadProperty(ref reader, options, PropFlush, null)) + { + continue; + } + + if (propGet.TryReadProperty(ref reader, options, PropGet, null)) + { + continue; + } + + if (propIndexing.TryReadProperty(ref reader, options, PropIndexing, null)) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) + { + continue; + } + + if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) + { + continue; + } + + if (propMerges.TryReadProperty(ref reader, options, PropMerges, null)) + { + continue; + } + + if (propQueryCache.TryReadProperty(ref reader, options, PropQueryCache, null)) + { + continue; + } + + if (propRecovery.TryReadProperty(ref reader, options, PropRecovery, null)) + { + continue; + } + + if (propRefresh.TryReadProperty(ref reader, options, PropRefresh, null)) + { + continue; + } + + if (propRequestCache.TryReadProperty(ref reader, options, PropRequestCache, null)) + { + continue; + } + + if (propRetentionLeases.TryReadProperty(ref reader, options, PropRetentionLeases, null)) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (propSearch.TryReadProperty(ref reader, options, PropSearch, null)) + { + continue; + } + + if (propSegments.TryReadProperty(ref reader, options, PropSegments, null)) + { + continue; + } + + if (propSeqNo.TryReadProperty(ref reader, options, PropSeqNo, null)) + { + continue; + } + + if (propShardPath.TryReadProperty(ref reader, options, PropShardPath, null)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propShardStats2.TryReadProperty(ref reader, options, PropShardStats2, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, null)) + { + continue; + } + + if (propTranslog.TryReadProperty(ref reader, options, PropTranslog, null)) + { + continue; + } + + if (propWarmer.TryReadProperty(ref reader, options, PropWarmer, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ShardStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Bulk = propBulk.Value, + Commit = propCommit.Value, + Completion = propCompletion.Value, + Docs = propDocs.Value, + Fielddata = propFielddata.Value, + Flush = propFlush.Value, + Get = propGet.Value, + Indexing = propIndexing.Value, + Indices = propIndices.Value, + Mappings = propMappings.Value, + Merges = propMerges.Value, + QueryCache = propQueryCache.Value, + Recovery = propRecovery.Value, + Refresh = propRefresh.Value, + RequestCache = propRequestCache.Value, + RetentionLeases = propRetentionLeases.Value, + Routing = propRouting.Value, + Search = propSearch.Value, + Segments = propSegments.Value, + SeqNo = propSeqNo.Value, + ShardPath = propShardPath.Value, + Shards = propShards.Value, + ShardStats2 = propShardStats2.Value, + Store = propStore.Value, + Translog = propTranslog.Value, + Warmer = propWarmer.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBulk, value.Bulk, null, null); + writer.WriteProperty(options, PropCommit, value.Commit, null, null); + writer.WriteProperty(options, PropCompletion, value.Completion, null, null); + writer.WriteProperty(options, PropDocs, value.Docs, null, null); + writer.WriteProperty(options, PropFielddata, value.Fielddata, null, null); + writer.WriteProperty(options, PropFlush, value.Flush, null, null); + writer.WriteProperty(options, PropGet, value.Get, null, null); + writer.WriteProperty(options, PropIndexing, value.Indexing, null, null); + writer.WriteProperty(options, PropIndices, value.Indices, null, null); + writer.WriteProperty(options, PropMappings, value.Mappings, null, null); + writer.WriteProperty(options, PropMerges, value.Merges, null, null); + writer.WriteProperty(options, PropQueryCache, value.QueryCache, null, null); + writer.WriteProperty(options, PropRecovery, value.Recovery, null, null); + writer.WriteProperty(options, PropRefresh, value.Refresh, null, null); + writer.WriteProperty(options, PropRequestCache, value.RequestCache, null, null); + writer.WriteProperty(options, PropRetentionLeases, value.RetentionLeases, null, null); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteProperty(options, PropSearch, value.Search, null, null); + writer.WriteProperty(options, PropSegments, value.Segments, null, null); + writer.WriteProperty(options, PropSeqNo, value.SeqNo, null, null); + writer.WriteProperty(options, PropShardPath, value.ShardPath, null, null); + writer.WriteProperty(options, PropShards, value.Shards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropShardStats2, value.ShardStats2, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, null); + writer.WriteProperty(options, PropTranslog, value.Translog, null, null); + writer.WriteProperty(options, PropWarmer, value.Warmer, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStats.g.cs index b08fcb749f4..42f317eeeab 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStats.g.cs @@ -23,271 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ShardStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBulk = System.Text.Json.JsonEncodedText.Encode("bulk"); - private static readonly System.Text.Json.JsonEncodedText PropCommit = System.Text.Json.JsonEncodedText.Encode("commit"); - private static readonly System.Text.Json.JsonEncodedText PropCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); - private static readonly System.Text.Json.JsonEncodedText PropFielddata = System.Text.Json.JsonEncodedText.Encode("fielddata"); - private static readonly System.Text.Json.JsonEncodedText PropFlush = System.Text.Json.JsonEncodedText.Encode("flush"); - private static readonly System.Text.Json.JsonEncodedText PropGet = System.Text.Json.JsonEncodedText.Encode("get"); - private static readonly System.Text.Json.JsonEncodedText PropIndexing = System.Text.Json.JsonEncodedText.Encode("indexing"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); - private static readonly System.Text.Json.JsonEncodedText PropMerges = System.Text.Json.JsonEncodedText.Encode("merges"); - private static readonly System.Text.Json.JsonEncodedText PropQueryCache = System.Text.Json.JsonEncodedText.Encode("query_cache"); - private static readonly System.Text.Json.JsonEncodedText PropRecovery = System.Text.Json.JsonEncodedText.Encode("recovery"); - private static readonly System.Text.Json.JsonEncodedText PropRefresh = System.Text.Json.JsonEncodedText.Encode("refresh"); - private static readonly System.Text.Json.JsonEncodedText PropRequestCache = System.Text.Json.JsonEncodedText.Encode("request_cache"); - private static readonly System.Text.Json.JsonEncodedText PropRetentionLeases = System.Text.Json.JsonEncodedText.Encode("retention_leases"); - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); - private static readonly System.Text.Json.JsonEncodedText PropSearch = System.Text.Json.JsonEncodedText.Encode("search"); - private static readonly System.Text.Json.JsonEncodedText PropSegments = System.Text.Json.JsonEncodedText.Encode("segments"); - private static readonly System.Text.Json.JsonEncodedText PropSeqNo = System.Text.Json.JsonEncodedText.Encode("seq_no"); - private static readonly System.Text.Json.JsonEncodedText PropShardPath = System.Text.Json.JsonEncodedText.Encode("shard_path"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); - private static readonly System.Text.Json.JsonEncodedText PropShardStats2 = System.Text.Json.JsonEncodedText.Encode("shard_stats"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropTranslog = System.Text.Json.JsonEncodedText.Encode("translog"); - private static readonly System.Text.Json.JsonEncodedText PropWarmer = System.Text.Json.JsonEncodedText.Encode("warmer"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShardStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBulk = default; - LocalJsonValue propCommit = default; - LocalJsonValue propCompletion = default; - LocalJsonValue propDocs = default; - LocalJsonValue propFielddata = default; - LocalJsonValue propFlush = default; - LocalJsonValue propGet = default; - LocalJsonValue propIndexing = default; - LocalJsonValue propIndices = default; - LocalJsonValue propMappings = default; - LocalJsonValue propMerges = default; - LocalJsonValue propQueryCache = default; - LocalJsonValue propRecovery = default; - LocalJsonValue propRefresh = default; - LocalJsonValue propRequestCache = default; - LocalJsonValue propRetentionLeases = default; - LocalJsonValue propRouting = default; - LocalJsonValue propSearch = default; - LocalJsonValue propSegments = default; - LocalJsonValue propSeqNo = default; - LocalJsonValue propShardPath = default; - LocalJsonValue?> propShards = default; - LocalJsonValue propShardStats2 = default; - LocalJsonValue propStore = default; - LocalJsonValue propTranslog = default; - LocalJsonValue propWarmer = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBulk.TryReadProperty(ref reader, options, PropBulk, null)) - { - continue; - } - - if (propCommit.TryReadProperty(ref reader, options, PropCommit, null)) - { - continue; - } - - if (propCompletion.TryReadProperty(ref reader, options, PropCompletion, null)) - { - continue; - } - - if (propDocs.TryReadProperty(ref reader, options, PropDocs, null)) - { - continue; - } - - if (propFielddata.TryReadProperty(ref reader, options, PropFielddata, null)) - { - continue; - } - - if (propFlush.TryReadProperty(ref reader, options, PropFlush, null)) - { - continue; - } - - if (propGet.TryReadProperty(ref reader, options, PropGet, null)) - { - continue; - } - - if (propIndexing.TryReadProperty(ref reader, options, PropIndexing, null)) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) - { - continue; - } - - if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) - { - continue; - } - - if (propMerges.TryReadProperty(ref reader, options, PropMerges, null)) - { - continue; - } - - if (propQueryCache.TryReadProperty(ref reader, options, PropQueryCache, null)) - { - continue; - } - - if (propRecovery.TryReadProperty(ref reader, options, PropRecovery, null)) - { - continue; - } - - if (propRefresh.TryReadProperty(ref reader, options, PropRefresh, null)) - { - continue; - } - - if (propRequestCache.TryReadProperty(ref reader, options, PropRequestCache, null)) - { - continue; - } - - if (propRetentionLeases.TryReadProperty(ref reader, options, PropRetentionLeases, null)) - { - continue; - } - - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (propSearch.TryReadProperty(ref reader, options, PropSearch, null)) - { - continue; - } - - if (propSegments.TryReadProperty(ref reader, options, PropSegments, null)) - { - continue; - } - - if (propSeqNo.TryReadProperty(ref reader, options, PropSeqNo, null)) - { - continue; - } - - if (propShardPath.TryReadProperty(ref reader, options, PropShardPath, null)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propShardStats2.TryReadProperty(ref reader, options, PropShardStats2, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, null)) - { - continue; - } - - if (propTranslog.TryReadProperty(ref reader, options, PropTranslog, null)) - { - continue; - } - - if (propWarmer.TryReadProperty(ref reader, options, PropWarmer, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ShardStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Bulk = propBulk.Value, - Commit = propCommit.Value, - Completion = propCompletion.Value, - Docs = propDocs.Value, - Fielddata = propFielddata.Value, - Flush = propFlush.Value, - Get = propGet.Value, - Indexing = propIndexing.Value, - Indices = propIndices.Value, - Mappings = propMappings.Value, - Merges = propMerges.Value, - QueryCache = propQueryCache.Value, - Recovery = propRecovery.Value, - Refresh = propRefresh.Value, - RequestCache = propRequestCache.Value, - RetentionLeases = propRetentionLeases.Value, - Routing = propRouting.Value, - Search = propSearch.Value, - Segments = propSegments.Value, - SeqNo = propSeqNo.Value, - ShardPath = propShardPath.Value, - Shards = propShards.Value, - ShardStats2 = propShardStats2.Value, - Store = propStore.Value, - Translog = propTranslog.Value, - Warmer = propWarmer.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBulk, value.Bulk, null, null); - writer.WriteProperty(options, PropCommit, value.Commit, null, null); - writer.WriteProperty(options, PropCompletion, value.Completion, null, null); - writer.WriteProperty(options, PropDocs, value.Docs, null, null); - writer.WriteProperty(options, PropFielddata, value.Fielddata, null, null); - writer.WriteProperty(options, PropFlush, value.Flush, null, null); - writer.WriteProperty(options, PropGet, value.Get, null, null); - writer.WriteProperty(options, PropIndexing, value.Indexing, null, null); - writer.WriteProperty(options, PropIndices, value.Indices, null, null); - writer.WriteProperty(options, PropMappings, value.Mappings, null, null); - writer.WriteProperty(options, PropMerges, value.Merges, null, null); - writer.WriteProperty(options, PropQueryCache, value.QueryCache, null, null); - writer.WriteProperty(options, PropRecovery, value.Recovery, null, null); - writer.WriteProperty(options, PropRefresh, value.Refresh, null, null); - writer.WriteProperty(options, PropRequestCache, value.RequestCache, null, null); - writer.WriteProperty(options, PropRetentionLeases, value.RetentionLeases, null, null); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteProperty(options, PropSearch, value.Search, null, null); - writer.WriteProperty(options, PropSegments, value.Segments, null, null); - writer.WriteProperty(options, PropSeqNo, value.SeqNo, null, null); - writer.WriteProperty(options, PropShardPath, value.ShardPath, null, null); - writer.WriteProperty(options, PropShards, value.Shards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropShardStats2, value.ShardStats2, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, null); - writer.WriteProperty(options, PropTranslog, value.Translog, null, null); - writer.WriteProperty(options, PropWarmer, value.Warmer, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ShardStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ShardStatsConverter))] public sealed partial class ShardStats { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStore.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStore.Converters.g.cs new file mode 100644 index 00000000000..1463a39b266 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStore.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ShardStoreConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllocation = System.Text.Json.JsonEncodedText.Encode("allocation"); + private static readonly System.Text.Json.JsonEncodedText PropAllocationId = System.Text.Json.JsonEncodedText.Encode("allocation_id"); + private static readonly System.Text.Json.JsonEncodedText PropStoreException = System.Text.Json.JsonEncodedText.Encode("store_exception"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShardStore Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllocation = default; + LocalJsonValue propAllocationId = default; + LocalJsonValue propNode = default; + LocalJsonValue propNodeId = default; + LocalJsonValue propStoreException = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllocation.TryReadProperty(ref reader, options, PropAllocation, null)) + { + continue; + } + + if (propAllocationId.TryReadProperty(ref reader, options, PropAllocationId, null)) + { + continue; + } + + if (propStoreException.TryReadProperty(ref reader, options, PropStoreException, null)) + { + continue; + } + + propNodeId.Initialized = propNode.Initialized = true; + reader.ReadProperty(options, out propNodeId.Value, out propNode.Value, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!, null); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ShardStore(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Allocation = propAllocation.Value, + AllocationId = propAllocationId.Value, + Node = propNode.Value, + NodeId = propNodeId.Value, + StoreException = propStoreException.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardStore value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllocation, value.Allocation, null, null); + writer.WriteProperty(options, PropAllocationId, value.AllocationId, null, null); + writer.WriteProperty(options, PropStoreException, value.StoreException, null, null); + writer.WriteProperty(options, value.NodeId, value.Node, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStore.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStore.g.cs index e56bf57f5fc..4c5be2a203e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStore.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStore.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ShardStoreConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllocation = System.Text.Json.JsonEncodedText.Encode("allocation"); - private static readonly System.Text.Json.JsonEncodedText PropAllocationId = System.Text.Json.JsonEncodedText.Encode("allocation_id"); - private static readonly System.Text.Json.JsonEncodedText PropStoreException = System.Text.Json.JsonEncodedText.Encode("store_exception"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShardStore Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllocation = default; - LocalJsonValue propAllocationId = default; - LocalJsonValue propNode = default; - LocalJsonValue propNodeId = default; - LocalJsonValue propStoreException = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllocation.TryReadProperty(ref reader, options, PropAllocation, null)) - { - continue; - } - - if (propAllocationId.TryReadProperty(ref reader, options, PropAllocationId, null)) - { - continue; - } - - if (propStoreException.TryReadProperty(ref reader, options, PropStoreException, null)) - { - continue; - } - - propNodeId.Initialized = propNode.Initialized = true; - reader.ReadProperty(options, out propNodeId.Value, out propNode.Value, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!, null); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ShardStore(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Allocation = propAllocation.Value, - AllocationId = propAllocationId.Value, - Node = propNode.Value, - NodeId = propNodeId.Value, - StoreException = propStoreException.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardStore value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllocation, value.Allocation, null, null); - writer.WriteProperty(options, PropAllocationId, value.AllocationId, null, null); - writer.WriteProperty(options, PropStoreException, value.StoreException, null, null); - writer.WriteProperty(options, value.NodeId, value.Node, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ShardStoreConverter))] public sealed partial class ShardStore { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreAllocation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreAllocation.Converters.g.cs new file mode 100644 index 00000000000..385fcced4f2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreAllocation.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ShardStoreAllocationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberPrimary = System.Text.Json.JsonEncodedText.Encode("primary"); + private static readonly System.Text.Json.JsonEncodedText MemberReplica = System.Text.Json.JsonEncodedText.Encode("replica"); + private static readonly System.Text.Json.JsonEncodedText MemberUnused = System.Text.Json.JsonEncodedText.Encode("unused"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberPrimary)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation.Primary; + } + + if (reader.ValueTextEquals(MemberReplica)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation.Replica; + } + + if (reader.ValueTextEquals(MemberUnused)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation.Unused; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberPrimary.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation.Primary; + } + + if (string.Equals(value, MemberReplica.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation.Replica; + } + + if (string.Equals(value, MemberUnused.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation.Unused; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation.Primary: + writer.WriteStringValue(MemberPrimary); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation.Replica: + writer.WriteStringValue(MemberReplica); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation.Unused: + writer.WriteStringValue(MemberUnused); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreAllocation value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreAllocation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreAllocation.g.cs new file mode 100644 index 00000000000..fc7c7f3f8dc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreAllocation.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ShardStoreAllocationConverter))] +public enum ShardStoreAllocation +{ + [System.Runtime.Serialization.EnumMember(Value = "primary")] + Primary, + [System.Runtime.Serialization.EnumMember(Value = "replica")] + Replica, + [System.Runtime.Serialization.EnumMember(Value = "unused")] + Unused +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreException.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreException.Converters.g.cs new file mode 100644 index 00000000000..f7d3a588bd8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreException.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ShardStoreExceptionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreException Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propReason = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propReason.TryReadProperty(ref reader, options, PropReason, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreException(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Reason = propReason.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreException value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropReason, value.Reason, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreException.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreException.g.cs index 25f5613bf04..358bb82c5ea 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreException.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreException.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ShardStoreExceptionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreException Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propReason = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propReason.TryReadProperty(ref reader, options, PropReason, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreException(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Reason = propReason.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreException value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropReason, value.Reason, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreExceptionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ShardStoreExceptionConverter))] public sealed partial class ShardStoreException { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreNode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreNode.Converters.g.cs new file mode 100644 index 00000000000..6eb73cfbe6d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreNode.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ShardStoreNodeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); + private static readonly System.Text.Json.JsonEncodedText PropEphemeralId = System.Text.Json.JsonEncodedText.Encode("ephemeral_id"); + private static readonly System.Text.Json.JsonEncodedText PropExternalId = System.Text.Json.JsonEncodedText.Encode("external_id"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreNode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propAttributes = default; + LocalJsonValue propEphemeralId = default; + LocalJsonValue propExternalId = default; + LocalJsonValue propName = default; + LocalJsonValue> propRoles = default; + LocalJsonValue propTransportAddress = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propEphemeralId.TryReadProperty(ref reader, options, PropEphemeralId, null)) + { + continue; + } + + if (propExternalId.TryReadProperty(ref reader, options, PropExternalId, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreNode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Attributes = propAttributes.Value, + EphemeralId = propEphemeralId.Value, + ExternalId = propExternalId.Value, + Name = propName.Value, + Roles = propRoles.Value, + TransportAddress = propTransportAddress.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreNode value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropEphemeralId, value.EphemeralId, null, null); + writer.WriteProperty(options, PropExternalId, value.ExternalId, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreNode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreNode.g.cs index 5cbd7e9cdab..62ae0a4aab1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreNode.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreNode.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ShardStoreNodeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); - private static readonly System.Text.Json.JsonEncodedText PropEphemeralId = System.Text.Json.JsonEncodedText.Encode("ephemeral_id"); - private static readonly System.Text.Json.JsonEncodedText PropExternalId = System.Text.Json.JsonEncodedText.Encode("external_id"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); - private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreNode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propAttributes = default; - LocalJsonValue propEphemeralId = default; - LocalJsonValue propExternalId = default; - LocalJsonValue propName = default; - LocalJsonValue> propRoles = default; - LocalJsonValue propTransportAddress = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propEphemeralId.TryReadProperty(ref reader, options, PropEphemeralId, null)) - { - continue; - } - - if (propExternalId.TryReadProperty(ref reader, options, PropExternalId, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreNode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Attributes = propAttributes.Value, - EphemeralId = propEphemeralId.Value, - ExternalId = propExternalId.Value, - Name = propName.Value, - Roles = propRoles.Value, - TransportAddress = propTransportAddress.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreNode value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropEphemeralId, value.EphemeralId, null, null); - writer.WriteProperty(options, PropExternalId, value.ExternalId, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreNodeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ShardStoreNodeConverter))] public sealed partial class ShardStoreNode { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreStatus.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreStatus.Converters.g.cs new file mode 100644 index 00000000000..5cf768ee78f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreStatus.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ShardStoreStatusConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAll = System.Text.Json.JsonEncodedText.Encode("all"); + private static readonly System.Text.Json.JsonEncodedText MemberGreen = System.Text.Json.JsonEncodedText.Encode("green"); + private static readonly System.Text.Json.JsonEncodedText MemberRed = System.Text.Json.JsonEncodedText.Encode("red"); + private static readonly System.Text.Json.JsonEncodedText MemberYellow = System.Text.Json.JsonEncodedText.Encode("yellow"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAll)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus.All; + } + + if (reader.ValueTextEquals(MemberGreen)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus.Green; + } + + if (reader.ValueTextEquals(MemberRed)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus.Red; + } + + if (reader.ValueTextEquals(MemberYellow)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus.Yellow; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAll.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus.All; + } + + if (string.Equals(value, MemberGreen.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus.Green; + } + + if (string.Equals(value, MemberRed.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus.Red; + } + + if (string.Equals(value, MemberYellow.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus.Yellow; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus.All: + writer.WriteStringValue(MemberAll); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus.Green: + writer.WriteStringValue(MemberGreen); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus.Red: + writer.WriteStringValue(MemberRed); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus.Yellow: + writer.WriteStringValue(MemberYellow); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreStatus value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreStatus.g.cs new file mode 100644 index 00000000000..cb8f062ecae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreStatus.g.cs @@ -0,0 +1,57 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ShardStoreStatusConverter))] +public enum ShardStoreStatus +{ + /// + /// + /// Return all shards, regardless of health status. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "all")] + All, + /// + /// + /// The primary shard and all replica shards are assigned. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "green")] + Green, + /// + /// + /// The primary shard is unassigned. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "red")] + Red, + /// + /// + /// One or more replica shards are unassigned. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "yellow")] + Yellow +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreWrapper.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreWrapper.Converters.g.cs new file mode 100644 index 00000000000..2d196593efd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreWrapper.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ShardStoreWrapperConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStores = System.Text.Json.JsonEncodedText.Encode("stores"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreWrapper Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propStores = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStores.TryReadProperty(ref reader, options, PropStores, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreWrapper(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Stores = propStores.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreWrapper value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStores, value.Stores, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreWrapper.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreWrapper.g.cs index eeea1d3353d..3327cb778b3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreWrapper.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardStoreWrapper.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ShardStoreWrapperConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStores = System.Text.Json.JsonEncodedText.Encode("stores"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreWrapper Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propStores = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStores.TryReadProperty(ref reader, options, PropStores, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreWrapper(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Stores = propStores.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreWrapper value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStores, value.Stores, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ShardStoreWrapperConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ShardStoreWrapperConverter))] public sealed partial class ShardStoreWrapper { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardsSegment.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardsSegment.Converters.g.cs new file mode 100644 index 00000000000..6efadad8a86 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardsSegment.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ShardsSegmentConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNumCommittedSegments = System.Text.Json.JsonEncodedText.Encode("num_committed_segments"); + private static readonly System.Text.Json.JsonEncodedText PropNumSearchSegments = System.Text.Json.JsonEncodedText.Encode("num_search_segments"); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); + private static readonly System.Text.Json.JsonEncodedText PropSegments = System.Text.Json.JsonEncodedText.Encode("segments"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShardsSegment Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propNumCommittedSegments = default; + LocalJsonValue propNumSearchSegments = default; + LocalJsonValue propRouting = default; + LocalJsonValue> propSegments = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNumCommittedSegments.TryReadProperty(ref reader, options, PropNumCommittedSegments, null)) + { + continue; + } + + if (propNumSearchSegments.TryReadProperty(ref reader, options, PropNumSearchSegments, null)) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (propSegments.TryReadProperty(ref reader, options, PropSegments, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ShardsSegment(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + NumCommittedSegments = propNumCommittedSegments.Value, + NumSearchSegments = propNumSearchSegments.Value, + Routing = propRouting.Value, + Segments = propSegments.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardsSegment value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNumCommittedSegments, value.NumCommittedSegments, null, null); + writer.WriteProperty(options, PropNumSearchSegments, value.NumSearchSegments, null, null); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteProperty(options, PropSegments, value.Segments, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardsSegment.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardsSegment.g.cs index 38ec9f7b9ae..ed3f965056e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardsSegment.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardsSegment.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ShardsSegmentConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNumCommittedSegments = System.Text.Json.JsonEncodedText.Encode("num_committed_segments"); - private static readonly System.Text.Json.JsonEncodedText PropNumSearchSegments = System.Text.Json.JsonEncodedText.Encode("num_search_segments"); - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); - private static readonly System.Text.Json.JsonEncodedText PropSegments = System.Text.Json.JsonEncodedText.Encode("segments"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShardsSegment Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propNumCommittedSegments = default; - LocalJsonValue propNumSearchSegments = default; - LocalJsonValue propRouting = default; - LocalJsonValue> propSegments = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNumCommittedSegments.TryReadProperty(ref reader, options, PropNumCommittedSegments, null)) - { - continue; - } - - if (propNumSearchSegments.TryReadProperty(ref reader, options, PropNumSearchSegments, null)) - { - continue; - } - - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (propSegments.TryReadProperty(ref reader, options, PropSegments, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ShardsSegment(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - NumCommittedSegments = propNumCommittedSegments.Value, - NumSearchSegments = propNumSearchSegments.Value, - Routing = propRouting.Value, - Segments = propSegments.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardsSegment value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNumCommittedSegments, value.NumCommittedSegments, null, null); - writer.WriteProperty(options, PropNumSearchSegments, value.NumSearchSegments, null, null); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteProperty(options, PropSegments, value.Segments, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ShardsSegmentConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ShardsSegmentConverter))] public sealed partial class ShardsSegment { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardsStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardsStats.Converters.g.cs new file mode 100644 index 00000000000..37d40de8831 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardsStats.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ShardsStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllFields = System.Text.Json.JsonEncodedText.Encode("all_fields"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShardsStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllFields = default; + LocalJsonValue> propFields = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllFields.TryReadProperty(ref reader, options, PropAllFields, null)) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ShardsStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllFields = propAllFields.Value, + Fields = propFields.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardsStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllFields, value.AllFields, null, null); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardsStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardsStats.g.cs index 7a763a67717..afc96cf211d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardsStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardsStats.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ShardsStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllFields = System.Text.Json.JsonEncodedText.Encode("all_fields"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShardsStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllFields = default; - LocalJsonValue> propFields = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllFields.TryReadProperty(ref reader, options, PropAllFields, null)) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ShardsStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllFields = propAllFields.Value, - Fields = propFields.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardsStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllFields, value.AllFields, null, null); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ShardsStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ShardsStatsConverter))] public sealed partial class ShardsStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardsTotalStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardsTotalStats.Converters.g.cs new file mode 100644 index 00000000000..eb056bbdd9c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardsTotalStats.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class ShardsTotalStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropTotalCount = System.Text.Json.JsonEncodedText.Encode("total_count"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.ShardsTotalStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propTotalCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propTotalCount.TryReadProperty(ref reader, options, PropTotalCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.ShardsTotalStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + TotalCount = propTotalCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardsTotalStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropTotalCount, value.TotalCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardsTotalStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardsTotalStats.g.cs index 485368e411c..662d6f2a9f1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardsTotalStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/ShardsTotalStats.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class ShardsTotalStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropTotalCount = System.Text.Json.JsonEncodedText.Encode("total_count"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.ShardsTotalStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propTotalCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propTotalCount.TryReadProperty(ref reader, options, PropTotalCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.ShardsTotalStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - TotalCount = propTotalCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.ShardsTotalStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropTotalCount, value.TotalCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.ShardsTotalStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.ShardsTotalStatsConverter))] public sealed partial class ShardsTotalStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogSettings.Converters.g.cs new file mode 100644 index 00000000000..a7ed201b8cc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogSettings.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SlowlogSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLevel = System.Text.Json.JsonEncodedText.Encode("level"); + private static readonly System.Text.Json.JsonEncodedText PropReformat = System.Text.Json.JsonEncodedText.Encode("reformat"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + private static readonly System.Text.Json.JsonEncodedText PropThreshold = System.Text.Json.JsonEncodedText.Encode("threshold"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SlowlogSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLevel = default; + LocalJsonValue propReformat = default; + LocalJsonValue propSource = default; + LocalJsonValue propThreshold = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLevel.TryReadProperty(ref reader, options, PropLevel, null)) + { + continue; + } + + if (propReformat.TryReadProperty(ref reader, options, PropReformat, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propThreshold.TryReadProperty(ref reader, options, PropThreshold, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.SlowlogSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Level = propLevel.Value, + Reformat = propReformat.Value, + Source = propSource.Value, + Threshold = propThreshold.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SlowlogSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLevel, value.Level, null, null); + writer.WriteProperty(options, PropReformat, value.Reformat, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSource, value.Source, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropThreshold, value.Threshold, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogSettings.g.cs index 7dceb395a37..e7455b442cc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogSettings.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class SlowlogSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLevel = System.Text.Json.JsonEncodedText.Encode("level"); - private static readonly System.Text.Json.JsonEncodedText PropReformat = System.Text.Json.JsonEncodedText.Encode("reformat"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - private static readonly System.Text.Json.JsonEncodedText PropThreshold = System.Text.Json.JsonEncodedText.Encode("threshold"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SlowlogSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLevel = default; - LocalJsonValue propReformat = default; - LocalJsonValue propSource = default; - LocalJsonValue propThreshold = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLevel.TryReadProperty(ref reader, options, PropLevel, null)) - { - continue; - } - - if (propReformat.TryReadProperty(ref reader, options, PropReformat, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propThreshold.TryReadProperty(ref reader, options, PropThreshold, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SlowlogSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Level = propLevel.Value, - Reformat = propReformat.Value, - Source = propSource.Value, - Threshold = propThreshold.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SlowlogSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLevel, value.Level, null, null); - writer.WriteProperty(options, PropReformat, value.Reformat, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSource, value.Source, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropThreshold, value.Threshold, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SlowlogSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SlowlogSettingsConverter))] public sealed partial class SlowlogSettings { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogTresholdLevels.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogTresholdLevels.Converters.g.cs new file mode 100644 index 00000000000..bd90bc05217 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogTresholdLevels.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SlowlogTresholdLevelsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDebug = System.Text.Json.JsonEncodedText.Encode("debug"); + private static readonly System.Text.Json.JsonEncodedText PropInfo = System.Text.Json.JsonEncodedText.Encode("info"); + private static readonly System.Text.Json.JsonEncodedText PropTrace = System.Text.Json.JsonEncodedText.Encode("trace"); + private static readonly System.Text.Json.JsonEncodedText PropWarn = System.Text.Json.JsonEncodedText.Encode("warn"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevels Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDebug = default; + LocalJsonValue propInfo = default; + LocalJsonValue propTrace = default; + LocalJsonValue propWarn = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDebug.TryReadProperty(ref reader, options, PropDebug, null)) + { + continue; + } + + if (propInfo.TryReadProperty(ref reader, options, PropInfo, null)) + { + continue; + } + + if (propTrace.TryReadProperty(ref reader, options, PropTrace, null)) + { + continue; + } + + if (propWarn.TryReadProperty(ref reader, options, PropWarn, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevels(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Debug = propDebug.Value, + Info = propInfo.Value, + Trace = propTrace.Value, + Warn = propWarn.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevels value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDebug, value.Debug, null, null); + writer.WriteProperty(options, PropInfo, value.Info, null, null); + writer.WriteProperty(options, PropTrace, value.Trace, null, null); + writer.WriteProperty(options, PropWarn, value.Warn, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogTresholdLevels.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogTresholdLevels.g.cs index 1db1213edf8..e069680ed7e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogTresholdLevels.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogTresholdLevels.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class SlowlogTresholdLevelsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDebug = System.Text.Json.JsonEncodedText.Encode("debug"); - private static readonly System.Text.Json.JsonEncodedText PropInfo = System.Text.Json.JsonEncodedText.Encode("info"); - private static readonly System.Text.Json.JsonEncodedText PropTrace = System.Text.Json.JsonEncodedText.Encode("trace"); - private static readonly System.Text.Json.JsonEncodedText PropWarn = System.Text.Json.JsonEncodedText.Encode("warn"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevels Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDebug = default; - LocalJsonValue propInfo = default; - LocalJsonValue propTrace = default; - LocalJsonValue propWarn = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDebug.TryReadProperty(ref reader, options, PropDebug, null)) - { - continue; - } - - if (propInfo.TryReadProperty(ref reader, options, PropInfo, null)) - { - continue; - } - - if (propTrace.TryReadProperty(ref reader, options, PropTrace, null)) - { - continue; - } - - if (propWarn.TryReadProperty(ref reader, options, PropWarn, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevels(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Debug = propDebug.Value, - Info = propInfo.Value, - Trace = propTrace.Value, - Warn = propWarn.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevels value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDebug, value.Debug, null, null); - writer.WriteProperty(options, PropInfo, value.Info, null, null); - writer.WriteProperty(options, PropTrace, value.Trace, null, null); - writer.WriteProperty(options, PropWarn, value.Warn, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdLevelsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SlowlogTresholdLevelsConverter))] public sealed partial class SlowlogTresholdLevels { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogTresholds.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogTresholds.Converters.g.cs new file mode 100644 index 00000000000..cebb5cc8894 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogTresholds.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SlowlogTresholdsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFetch = System.Text.Json.JsonEncodedText.Encode("fetch"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholds Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFetch = default; + LocalJsonValue propQuery = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFetch.TryReadProperty(ref reader, options, PropFetch, null)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholds(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Fetch = propFetch.Value, + Query = propQuery.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholds value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFetch, value.Fetch, null, null); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogTresholds.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogTresholds.g.cs index f35c8bac0d2..e040151dc82 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogTresholds.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SlowlogTresholds.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class SlowlogTresholdsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFetch = System.Text.Json.JsonEncodedText.Encode("fetch"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholds Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFetch = default; - LocalJsonValue propQuery = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFetch.TryReadProperty(ref reader, options, PropFetch, null)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholds(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Fetch = propFetch.Value, - Query = propQuery.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholds value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFetch, value.Fetch, null, null); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SlowlogTresholdsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SlowlogTresholdsConverter))] public sealed partial class SlowlogTresholds { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SoftDeletes.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SoftDeletes.Converters.g.cs new file mode 100644 index 00000000000..799d5a5af15 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SoftDeletes.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SoftDeletesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropRetentionLease = System.Text.Json.JsonEncodedText.Encode("retention_lease"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SoftDeletes Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEnabled = default; + LocalJsonValue propRetentionLease = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRetentionLease.TryReadProperty(ref reader, options, PropRetentionLease, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.SoftDeletes(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Enabled = propEnabled.Value, + RetentionLease = propRetentionLease.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SoftDeletes value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRetentionLease, value.RetentionLease, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SoftDeletes.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SoftDeletes.g.cs index 4d2b1fae80d..c62394aa586 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SoftDeletes.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SoftDeletes.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class SoftDeletesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropRetentionLease = System.Text.Json.JsonEncodedText.Encode("retention_lease"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SoftDeletes Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEnabled = default; - LocalJsonValue propRetentionLease = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRetentionLease.TryReadProperty(ref reader, options, PropRetentionLease, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SoftDeletes(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Enabled = propEnabled.Value, - RetentionLease = propRetentionLease.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SoftDeletes value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRetentionLease, value.RetentionLease, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SoftDeletesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SoftDeletesConverter))] public sealed partial class SoftDeletes { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SourceIndex.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SourceIndex.Converters.g.cs new file mode 100644 index 00000000000..2353822085a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SourceIndex.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SourceIndexConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SourceIndex Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndex = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.SourceIndex(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Index = propIndex.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SourceIndex value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SourceIndex.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SourceIndex.g.cs index c028f3fe60b..7677c8559bd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SourceIndex.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SourceIndex.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class SourceIndexConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.SourceIndex Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndex = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.SourceIndex(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Index = propIndex.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SourceIndex value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.SourceIndexConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SourceIndexConverter))] public sealed partial class SourceIndex { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SourceMode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SourceMode.Converters.g.cs new file mode 100644 index 00000000000..d1138c0a58b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SourceMode.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class SourceModeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberDisabled = System.Text.Json.JsonEncodedText.Encode("disabled"); + private static readonly System.Text.Json.JsonEncodedText MemberStored = System.Text.Json.JsonEncodedText.Encode("stored"); + private static readonly System.Text.Json.JsonEncodedText MemberSynthetic = System.Text.Json.JsonEncodedText.Encode("synthetic"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.SourceMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberDisabled)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.SourceMode.Disabled; + } + + if (reader.ValueTextEquals(MemberStored)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.SourceMode.Stored; + } + + if (reader.ValueTextEquals(MemberSynthetic)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.SourceMode.Synthetic; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberDisabled.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.SourceMode.Disabled; + } + + if (string.Equals(value, MemberStored.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.SourceMode.Stored; + } + + if (string.Equals(value, MemberSynthetic.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.SourceMode.Synthetic; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.SourceMode)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SourceMode value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.IndexManagement.SourceMode.Disabled: + writer.WriteStringValue(MemberDisabled); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.SourceMode.Stored: + writer.WriteStringValue(MemberStored); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.SourceMode.Synthetic: + writer.WriteStringValue(MemberSynthetic); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.SourceMode)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.IndexManagement.SourceMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.SourceMode value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SourceMode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SourceMode.g.cs new file mode 100644 index 00000000000..5f4a6ad0a24 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SourceMode.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.SourceModeConverter))] +public enum SourceMode +{ + [System.Runtime.Serialization.EnumMember(Value = "disabled")] + Disabled, + [System.Runtime.Serialization.EnumMember(Value = "stored")] + Stored, + [System.Runtime.Serialization.EnumMember(Value = "synthetic")] + Synthetic +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/StatusError.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/StatusError.Converters.g.cs new file mode 100644 index 00000000000..1febe916e98 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/StatusError.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class StatusErrorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropMessage = System.Text.Json.JsonEncodedText.Encode("message"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.StatusError Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndex = default; + LocalJsonValue propMessage = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propMessage.TryReadProperty(ref reader, options, PropMessage, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.StatusError(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Index = propIndex.Value, + Message = propMessage.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.StatusError value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropMessage, value.Message, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/StatusError.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/StatusError.g.cs index b216e563d39..28980da7166 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/StatusError.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/StatusError.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class StatusErrorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropMessage = System.Text.Json.JsonEncodedText.Encode("message"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.StatusError Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndex = default; - LocalJsonValue propMessage = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propMessage.TryReadProperty(ref reader, options, PropMessage, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.StatusError(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Index = propIndex.Value, - Message = propMessage.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.StatusError value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropMessage, value.Message, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.StatusErrorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.StatusErrorConverter))] public sealed partial class StatusError { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/StatusInProgress.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/StatusInProgress.Converters.g.cs new file mode 100644 index 00000000000..20c21b2af03 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/StatusInProgress.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class StatusInProgressConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropReindexedDocCount = System.Text.Json.JsonEncodedText.Encode("reindexed_doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropTotalDocCount = System.Text.Json.JsonEncodedText.Encode("total_doc_count"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.StatusInProgress Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndex = default; + LocalJsonValue propReindexedDocCount = default; + LocalJsonValue propTotalDocCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propReindexedDocCount.TryReadProperty(ref reader, options, PropReindexedDocCount, null)) + { + continue; + } + + if (propTotalDocCount.TryReadProperty(ref reader, options, PropTotalDocCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.StatusInProgress(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Index = propIndex.Value, + ReindexedDocCount = propReindexedDocCount.Value, + TotalDocCount = propTotalDocCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.StatusInProgress value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropReindexedDocCount, value.ReindexedDocCount, null, null); + writer.WriteProperty(options, PropTotalDocCount, value.TotalDocCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/StatusInProgress.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/StatusInProgress.g.cs index eddb592c27b..38cc3eea603 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/StatusInProgress.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/StatusInProgress.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class StatusInProgressConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropReindexedDocCount = System.Text.Json.JsonEncodedText.Encode("reindexed_doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropTotalDocCount = System.Text.Json.JsonEncodedText.Encode("total_doc_count"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.StatusInProgress Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndex = default; - LocalJsonValue propReindexedDocCount = default; - LocalJsonValue propTotalDocCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propReindexedDocCount.TryReadProperty(ref reader, options, PropReindexedDocCount, null)) - { - continue; - } - - if (propTotalDocCount.TryReadProperty(ref reader, options, PropTotalDocCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.StatusInProgress(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Index = propIndex.Value, - ReindexedDocCount = propReindexedDocCount.Value, - TotalDocCount = propTotalDocCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.StatusInProgress value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropReindexedDocCount, value.ReindexedDocCount, null, null); - writer.WriteProperty(options, PropTotalDocCount, value.TotalDocCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.StatusInProgressConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.StatusInProgressConverter))] public sealed partial class StatusInProgress { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Storage.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Storage.Converters.g.cs new file mode 100644 index 00000000000..9c2b1769ba0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Storage.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class StorageConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowMmap = System.Text.Json.JsonEncodedText.Encode("allow_mmap"); + private static readonly System.Text.Json.JsonEncodedText PropStatsRefreshInterval = System.Text.Json.JsonEncodedText.Encode("stats_refresh_interval"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.Storage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowMmap = default; + LocalJsonValue propStatsRefreshInterval = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowMmap.TryReadProperty(ref reader, options, PropAllowMmap, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propStatsRefreshInterval.TryReadProperty(ref reader, options, PropStatsRefreshInterval, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.Storage(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowMmap = propAllowMmap.Value, + StatsRefreshInterval = propStatsRefreshInterval.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.Storage value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowMmap, value.AllowMmap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropStatsRefreshInterval, value.StatsRefreshInterval, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Storage.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Storage.g.cs index 3a50e687644..676cd3b2536 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Storage.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Storage.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class StorageConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowMmap = System.Text.Json.JsonEncodedText.Encode("allow_mmap"); - private static readonly System.Text.Json.JsonEncodedText PropStatsRefreshInterval = System.Text.Json.JsonEncodedText.Encode("stats_refresh_interval"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.Storage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowMmap = default; - LocalJsonValue propStatsRefreshInterval = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowMmap.TryReadProperty(ref reader, options, PropAllowMmap, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propStatsRefreshInterval.TryReadProperty(ref reader, options, PropStatsRefreshInterval, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.Storage(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowMmap = propAllowMmap.Value, - StatsRefreshInterval = propStatsRefreshInterval.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.Storage value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowMmap, value.AllowMmap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropStatsRefreshInterval, value.StatsRefreshInterval, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.StorageConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.StorageConverter))] public sealed partial class Storage { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/StorageType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/StorageType.Converters.g.cs new file mode 100644 index 00000000000..48deec3f97e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/StorageType.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class StorageTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.StorageType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.IndexManagement.StorageType(reader.ReadValue(options, null)); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.StorageType value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Value, null); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/StorageType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/StorageType.g.cs new file mode 100644 index 00000000000..8e050d9aa7d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/StorageType.g.cs @@ -0,0 +1,84 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.StorageTypeConverter))] +public readonly partial struct StorageType : Elastic.Clients.Elasticsearch.Serialization.IEnumStruct +{ + public StorageType(string value) => Value = value; +#if NET7_0_OR_GREATER + static StorageType IEnumStruct.Create(string value) => value; +#else + StorageType IEnumStruct.Create(string value) => value; +#endif + public readonly string Value { get; } + + /// + /// + /// Default file system implementation. This will pick the best implementation depending on the operating environment, which + /// is currently hybridfs on all supported systems but is subject to change. + /// + /// + public static StorageType Fs { get; } = new StorageType("fs"); + + /// + /// + /// The hybridfs type is a hybrid of niofs and mmapfs, which chooses the best file system type for each type of file + /// based on the read access pattern. Currently only the Lucene term dictionary, norms and doc values files are memory + /// mapped. All other files are opened using Lucene NIOFSDirectory. Similarly to mmapfs be sure you have allowed + /// plenty of virtual address space. + /// + /// + public static StorageType Hybridfs { get; } = new StorageType("hybridfs"); + + /// + /// + /// The MMap FS type stores the shard index on the file system (maps to Lucene MMapDirectory) by mapping a file into + /// memory (mmap). Memory mapping uses up a portion of the virtual memory address space in your process equal to the size + /// of the file being mapped. Before using this class, be sure you have allowed plenty of virtual address space. + /// + /// + public static StorageType Mmapfs { get; } = new StorageType("mmapfs"); + + /// + /// + /// The NIO FS type stores the shard index on the file system (maps to Lucene NIOFSDirectory) using NIO. It allows multiple + /// threads to read from the same file concurrently. It is not recommended on Windows because of a bug in the SUN Java + /// implementation and disables some optimizations for heap memory usage. + /// + /// + public static StorageType Niofs { get; } = new StorageType("niofs"); + + public override string ToString() => Value ?? string.Empty; + + public static implicit operator string(StorageType @enum) => @enum.Value; + public static implicit operator StorageType(string value) => new(value); + + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals(object obj) => obj is StorageType other && this.Equals(other); + public bool Equals(StorageType other) => Value == other.Value; + + public static bool operator ==(StorageType a, StorageType b) => a.Equals(b); + public static bool operator !=(StorageType a, StorageType b) => !(a == b); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Template.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Template.Converters.g.cs new file mode 100644 index 00000000000..d1703240636 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Template.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class TemplateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); + private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.Template Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propAliases = default; + LocalJsonValue propMappings = default; + LocalJsonValue propSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) + { + continue; + } + + if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.Template(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aliases = propAliases.Value, + Mappings = propMappings.Value, + Settings = propSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.Template value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropMappings, value.Mappings, null, null); + writer.WriteProperty(options, PropSettings, value.Settings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Template.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Template.g.cs index 9c2589e8d42..422ba70a8e6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Template.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Template.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class TemplateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); - private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.Template Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propAliases = default; - LocalJsonValue propMappings = default; - LocalJsonValue propSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) - { - continue; - } - - if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.Template(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aliases = propAliases.Value, - Mappings = propMappings.Value, - Settings = propSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.Template value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropMappings, value.Mappings, null, null); - writer.WriteProperty(options, PropSettings, value.Settings, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.TemplateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.TemplateConverter))] public sealed partial class Template { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TemplateMapping.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TemplateMapping.Converters.g.cs new file mode 100644 index 00000000000..3d15e6ff4bd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TemplateMapping.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class TemplateMappingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); + private static readonly System.Text.Json.JsonEncodedText PropIndexPatterns = System.Text.Json.JsonEncodedText.Encode("index_patterns"); + private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); + private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.TemplateMapping Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propAliases = default; + LocalJsonValue> propIndexPatterns = default; + LocalJsonValue propMappings = default; + LocalJsonValue propOrder = default; + LocalJsonValue> propSettings = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propIndexPatterns.TryReadProperty(ref reader, options, PropIndexPatterns, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) + { + continue; + } + + if (propOrder.TryReadProperty(ref reader, options, PropOrder, null)) + { + continue; + } + + if (propSettings.TryReadProperty(ref reader, options, PropSettings, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.TemplateMapping(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aliases = propAliases.Value, + IndexPatterns = propIndexPatterns.Value, + Mappings = propMappings.Value, + Order = propOrder.Value, + Settings = propSettings.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.TemplateMapping value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropIndexPatterns, value.IndexPatterns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMappings, value.Mappings, null, null); + writer.WriteProperty(options, PropOrder, value.Order, null, null); + writer.WriteProperty(options, PropSettings, value.Settings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TemplateMapping.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TemplateMapping.g.cs index cdb87625f2e..251c745d481 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TemplateMapping.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TemplateMapping.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class TemplateMappingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"); - private static readonly System.Text.Json.JsonEncodedText PropIndexPatterns = System.Text.Json.JsonEncodedText.Encode("index_patterns"); - private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); - private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.TemplateMapping Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propAliases = default; - LocalJsonValue> propIndexPatterns = default; - LocalJsonValue propMappings = default; - LocalJsonValue propOrder = default; - LocalJsonValue> propSettings = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propIndexPatterns.TryReadProperty(ref reader, options, PropIndexPatterns, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) - { - continue; - } - - if (propOrder.TryReadProperty(ref reader, options, PropOrder, null)) - { - continue; - } - - if (propSettings.TryReadProperty(ref reader, options, PropSettings, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.TemplateMapping(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aliases = propAliases.Value, - IndexPatterns = propIndexPatterns.Value, - Mappings = propMappings.Value, - Order = propOrder.Value, - Settings = propSettings.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.TemplateMapping value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropIndexPatterns, value.IndexPatterns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMappings, value.Mappings, null, null); - writer.WriteProperty(options, PropOrder, value.Order, null, null); - writer.WriteProperty(options, PropSettings, value.Settings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.TemplateMappingConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.TemplateMappingConverter))] public sealed partial class TemplateMapping { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TokenDetail.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TokenDetail.Converters.g.cs new file mode 100644 index 00000000000..bd663e40388 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TokenDetail.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class TokenDetailConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropTokens = System.Text.Json.JsonEncodedText.Encode("tokens"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.TokenDetail Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + LocalJsonValue> propTokens = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propTokens.TryReadProperty(ref reader, options, PropTokens, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.TokenDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value, + Tokens = propTokens.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.TokenDetail value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropTokens, value.Tokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TokenDetail.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TokenDetail.g.cs index d56d302da0a..f4ec00202de 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TokenDetail.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TokenDetail.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class TokenDetailConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropTokens = System.Text.Json.JsonEncodedText.Encode("tokens"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.TokenDetail Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - LocalJsonValue> propTokens = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propTokens.TryReadProperty(ref reader, options, PropTokens, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.TokenDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value, - Tokens = propTokens.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.TokenDetail value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropTokens, value.Tokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.TokenDetailConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.TokenDetailConverter))] public sealed partial class TokenDetail { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Translog.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Translog.Converters.g.cs new file mode 100644 index 00000000000..850255561b1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Translog.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class TranslogConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDurability = System.Text.Json.JsonEncodedText.Encode("durability"); + private static readonly System.Text.Json.JsonEncodedText PropFlushThresholdSize = System.Text.Json.JsonEncodedText.Encode("flush_threshold_size"); + private static readonly System.Text.Json.JsonEncodedText PropRetention = System.Text.Json.JsonEncodedText.Encode("retention"); + private static readonly System.Text.Json.JsonEncodedText PropSyncInterval = System.Text.Json.JsonEncodedText.Encode("sync_interval"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.Translog Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDurability = default; + LocalJsonValue propFlushThresholdSize = default; + LocalJsonValue propRetention = default; + LocalJsonValue propSyncInterval = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDurability.TryReadProperty(ref reader, options, PropDurability, static Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFlushThresholdSize.TryReadProperty(ref reader, options, PropFlushThresholdSize, null)) + { + continue; + } + + if (propRetention.TryReadProperty(ref reader, options, PropRetention, null)) + { + continue; + } + + if (propSyncInterval.TryReadProperty(ref reader, options, PropSyncInterval, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.Translog(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Durability = propDurability.Value, + FlushThresholdSize = propFlushThresholdSize.Value, + Retention = propRetention.Value, + SyncInterval = propSyncInterval.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.Translog value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDurability, value.Durability, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFlushThresholdSize, value.FlushThresholdSize, null, null); + writer.WriteProperty(options, PropRetention, value.Retention, null, null); + writer.WriteProperty(options, PropSyncInterval, value.SyncInterval, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Translog.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Translog.g.cs index f98db7abbfc..c305e54b69d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Translog.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/Translog.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class TranslogConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDurability = System.Text.Json.JsonEncodedText.Encode("durability"); - private static readonly System.Text.Json.JsonEncodedText PropFlushThresholdSize = System.Text.Json.JsonEncodedText.Encode("flush_threshold_size"); - private static readonly System.Text.Json.JsonEncodedText PropRetention = System.Text.Json.JsonEncodedText.Encode("retention"); - private static readonly System.Text.Json.JsonEncodedText PropSyncInterval = System.Text.Json.JsonEncodedText.Encode("sync_interval"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.Translog Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDurability = default; - LocalJsonValue propFlushThresholdSize = default; - LocalJsonValue propRetention = default; - LocalJsonValue propSyncInterval = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDurability.TryReadProperty(ref reader, options, PropDurability, static Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFlushThresholdSize.TryReadProperty(ref reader, options, PropFlushThresholdSize, null)) - { - continue; - } - - if (propRetention.TryReadProperty(ref reader, options, PropRetention, null)) - { - continue; - } - - if (propSyncInterval.TryReadProperty(ref reader, options, PropSyncInterval, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.Translog(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Durability = propDurability.Value, - FlushThresholdSize = propFlushThresholdSize.Value, - Retention = propRetention.Value, - SyncInterval = propSyncInterval.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.Translog value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDurability, value.Durability, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFlushThresholdSize, value.FlushThresholdSize, null, null); - writer.WriteProperty(options, PropRetention, value.Retention, null, null); - writer.WriteProperty(options, PropSyncInterval, value.SyncInterval, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.TranslogConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.TranslogConverter))] public sealed partial class Translog { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TranslogDurability.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TranslogDurability.Converters.g.cs new file mode 100644 index 00000000000..eac1d1a8803 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TranslogDurability.Converters.g.cs @@ -0,0 +1,83 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class TranslogDurabilityConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAsync = System.Text.Json.JsonEncodedText.Encode("async"); + private static readonly System.Text.Json.JsonEncodedText MemberAsync1 = System.Text.Json.JsonEncodedText.Encode("ASYNC"); + private static readonly System.Text.Json.JsonEncodedText MemberRequest = System.Text.Json.JsonEncodedText.Encode("request"); + private static readonly System.Text.Json.JsonEncodedText MemberRequest1 = System.Text.Json.JsonEncodedText.Encode("REQUEST"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAsync) || reader.ValueTextEquals(MemberAsync1)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability.Async; + } + + if (reader.ValueTextEquals(MemberRequest) || reader.ValueTextEquals(MemberRequest1)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability.Request; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAsync.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberAsync1.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability.Async; + } + + if (string.Equals(value, MemberRequest.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberRequest1.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability.Request; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability.Async: + writer.WriteStringValue(MemberAsync); + break; + case Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability.Request: + writer.WriteStringValue(MemberRequest); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.TranslogDurability value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TranslogDurability.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TranslogDurability.g.cs new file mode 100644 index 00000000000..84df7ac2af4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TranslogDurability.g.cs @@ -0,0 +1,45 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.TranslogDurabilityConverter))] +public enum TranslogDurability +{ + /// + /// + /// fsync and commit in the background every sync_interval. In the event of a failure, all acknowledged writes + /// since the last automatic commit will be discarded. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "async")] + Async, + /// + /// + /// (default) fsync and commit after every request. In the event of hardware failure, all acknowledged writes + /// will already have been committed to disk. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "request")] + Request +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TranslogRetention.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TranslogRetention.Converters.g.cs new file mode 100644 index 00000000000..4285339a58a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TranslogRetention.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class TranslogRetentionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAge = System.Text.Json.JsonEncodedText.Encode("age"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.TranslogRetention Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAge = default; + LocalJsonValue propSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAge.TryReadProperty(ref reader, options, PropAge, null)) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.TranslogRetention(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Age = propAge.Value, + Size = propSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.TranslogRetention value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAge, value.Age, null, null); + writer.WriteProperty(options, PropSize, value.Size, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TranslogRetention.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TranslogRetention.g.cs index f49a8450849..f2dfdfb4785 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TranslogRetention.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TranslogRetention.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class TranslogRetentionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAge = System.Text.Json.JsonEncodedText.Encode("age"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.TranslogRetention Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAge = default; - LocalJsonValue propSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAge.TryReadProperty(ref reader, options, PropAge, null)) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.TranslogRetention(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Age = propAge.Value, - Size = propSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.TranslogRetention value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAge, value.Age, null, null); - writer.WriteProperty(options, PropSize, value.Size, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.TranslogRetentionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.TranslogRetentionConverter))] public sealed partial class TranslogRetention { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TranslogStatus.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TranslogStatus.Converters.g.cs new file mode 100644 index 00000000000..1fcce0d4207 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TranslogStatus.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class TranslogStatusConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPercent = System.Text.Json.JsonEncodedText.Encode("percent"); + private static readonly System.Text.Json.JsonEncodedText PropRecovered = System.Text.Json.JsonEncodedText.Encode("recovered"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + private static readonly System.Text.Json.JsonEncodedText PropTotalOnStart = System.Text.Json.JsonEncodedText.Encode("total_on_start"); + private static readonly System.Text.Json.JsonEncodedText PropTotalTime = System.Text.Json.JsonEncodedText.Encode("total_time"); + private static readonly System.Text.Json.JsonEncodedText PropTotalTimeInMillis = System.Text.Json.JsonEncodedText.Encode("total_time_in_millis"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.TranslogStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPercent = default; + LocalJsonValue propRecovered = default; + LocalJsonValue propTotal = default; + LocalJsonValue propTotalOnStart = default; + LocalJsonValue propTotalTime = default; + LocalJsonValue propTotalTimeInMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPercent.TryReadProperty(ref reader, options, PropPercent, null)) + { + continue; + } + + if (propRecovered.TryReadProperty(ref reader, options, PropRecovered, null)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (propTotalOnStart.TryReadProperty(ref reader, options, PropTotalOnStart, null)) + { + continue; + } + + if (propTotalTime.TryReadProperty(ref reader, options, PropTotalTime, null)) + { + continue; + } + + if (propTotalTimeInMillis.TryReadProperty(ref reader, options, PropTotalTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.TranslogStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Percent = propPercent.Value, + Recovered = propRecovered.Value, + Total = propTotal.Value, + TotalOnStart = propTotalOnStart.Value, + TotalTime = propTotalTime.Value, + TotalTimeInMillis = propTotalTimeInMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.TranslogStatus value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPercent, value.Percent, null, null); + writer.WriteProperty(options, PropRecovered, value.Recovered, null, null); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteProperty(options, PropTotalOnStart, value.TotalOnStart, null, null); + writer.WriteProperty(options, PropTotalTime, value.TotalTime, null, null); + writer.WriteProperty(options, PropTotalTimeInMillis, value.TotalTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TranslogStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TranslogStatus.g.cs index 30509b0327b..366a1176849 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TranslogStatus.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TranslogStatus.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class TranslogStatusConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPercent = System.Text.Json.JsonEncodedText.Encode("percent"); - private static readonly System.Text.Json.JsonEncodedText PropRecovered = System.Text.Json.JsonEncodedText.Encode("recovered"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - private static readonly System.Text.Json.JsonEncodedText PropTotalOnStart = System.Text.Json.JsonEncodedText.Encode("total_on_start"); - private static readonly System.Text.Json.JsonEncodedText PropTotalTime = System.Text.Json.JsonEncodedText.Encode("total_time"); - private static readonly System.Text.Json.JsonEncodedText PropTotalTimeInMillis = System.Text.Json.JsonEncodedText.Encode("total_time_in_millis"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.TranslogStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPercent = default; - LocalJsonValue propRecovered = default; - LocalJsonValue propTotal = default; - LocalJsonValue propTotalOnStart = default; - LocalJsonValue propTotalTime = default; - LocalJsonValue propTotalTimeInMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPercent.TryReadProperty(ref reader, options, PropPercent, null)) - { - continue; - } - - if (propRecovered.TryReadProperty(ref reader, options, PropRecovered, null)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (propTotalOnStart.TryReadProperty(ref reader, options, PropTotalOnStart, null)) - { - continue; - } - - if (propTotalTime.TryReadProperty(ref reader, options, PropTotalTime, null)) - { - continue; - } - - if (propTotalTimeInMillis.TryReadProperty(ref reader, options, PropTotalTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.TranslogStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Percent = propPercent.Value, - Recovered = propRecovered.Value, - Total = propTotal.Value, - TotalOnStart = propTotalOnStart.Value, - TotalTime = propTotalTime.Value, - TotalTimeInMillis = propTotalTimeInMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.TranslogStatus value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPercent, value.Percent, null, null); - writer.WriteProperty(options, PropRecovered, value.Recovered, null, null); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteProperty(options, PropTotalOnStart, value.TotalOnStart, null, null); - writer.WriteProperty(options, PropTotalTime, value.TotalTime, null, null); - writer.WriteProperty(options, PropTotalTimeInMillis, value.TotalTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.TranslogStatusConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.TranslogStatusConverter))] public sealed partial class TranslogStatus { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TypeFieldMappings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TypeFieldMappings.Converters.g.cs new file mode 100644 index 00000000000..df777a5fcc3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TypeFieldMappings.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class TypeFieldMappingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.TypeFieldMappings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propMappings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMappings.TryReadProperty(ref reader, options, PropMappings, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.TypeFieldMappings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Mappings = propMappings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.TypeFieldMappings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMappings, value.Mappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TypeFieldMappings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TypeFieldMappings.g.cs index 4f2a98944f0..d75b888e341 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TypeFieldMappings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/TypeFieldMappings.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class TypeFieldMappingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.TypeFieldMappings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propMappings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMappings.TryReadProperty(ref reader, options, PropMappings, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.TypeFieldMappings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Mappings = propMappings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.TypeFieldMappings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMappings, value.Mappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.TypeFieldMappingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.TypeFieldMappingsConverter))] public sealed partial class TypeFieldMappings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UpdatedDataStreamMappings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UpdatedDataStreamMappings.Converters.g.cs new file mode 100644 index 00000000000..cdad7635828 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UpdatedDataStreamMappings.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class UpdatedDataStreamMappingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAppliedToDataStream = System.Text.Json.JsonEncodedText.Encode("applied_to_data_stream"); + private static readonly System.Text.Json.JsonEncodedText PropEffectiveMappings = System.Text.Json.JsonEncodedText.Encode("effective_mappings"); + private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); + private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.UpdatedDataStreamMappings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAppliedToDataStream = default; + LocalJsonValue propEffectiveMappings = default; + LocalJsonValue propError = default; + LocalJsonValue propMappings = default; + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAppliedToDataStream.TryReadProperty(ref reader, options, PropAppliedToDataStream, null)) + { + continue; + } + + if (propEffectiveMappings.TryReadProperty(ref reader, options, PropEffectiveMappings, null)) + { + continue; + } + + if (propError.TryReadProperty(ref reader, options, PropError, null)) + { + continue; + } + + if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.UpdatedDataStreamMappings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AppliedToDataStream = propAppliedToDataStream.Value, + EffectiveMappings = propEffectiveMappings.Value, + Error = propError.Value, + Mappings = propMappings.Value, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.UpdatedDataStreamMappings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAppliedToDataStream, value.AppliedToDataStream, null, null); + writer.WriteProperty(options, PropEffectiveMappings, value.EffectiveMappings, null, null); + writer.WriteProperty(options, PropError, value.Error, null, null); + writer.WriteProperty(options, PropMappings, value.Mappings, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UpdatedDataStreamMappings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UpdatedDataStreamMappings.g.cs index 922ea3435f5..3cd748f4b95 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UpdatedDataStreamMappings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UpdatedDataStreamMappings.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class UpdatedDataStreamMappingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAppliedToDataStream = System.Text.Json.JsonEncodedText.Encode("applied_to_data_stream"); - private static readonly System.Text.Json.JsonEncodedText PropEffectiveMappings = System.Text.Json.JsonEncodedText.Encode("effective_mappings"); - private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); - private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.UpdatedDataStreamMappings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAppliedToDataStream = default; - LocalJsonValue propEffectiveMappings = default; - LocalJsonValue propError = default; - LocalJsonValue propMappings = default; - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAppliedToDataStream.TryReadProperty(ref reader, options, PropAppliedToDataStream, null)) - { - continue; - } - - if (propEffectiveMappings.TryReadProperty(ref reader, options, PropEffectiveMappings, null)) - { - continue; - } - - if (propError.TryReadProperty(ref reader, options, PropError, null)) - { - continue; - } - - if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.UpdatedDataStreamMappings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AppliedToDataStream = propAppliedToDataStream.Value, - EffectiveMappings = propEffectiveMappings.Value, - Error = propError.Value, - Mappings = propMappings.Value, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.UpdatedDataStreamMappings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAppliedToDataStream, value.AppliedToDataStream, null, null); - writer.WriteProperty(options, PropEffectiveMappings, value.EffectiveMappings, null, null); - writer.WriteProperty(options, PropError, value.Error, null, null); - writer.WriteProperty(options, PropMappings, value.Mappings, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.UpdatedDataStreamMappingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.UpdatedDataStreamMappingsConverter))] public sealed partial class UpdatedDataStreamMappings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UpdatedDataStreamSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UpdatedDataStreamSettings.Converters.g.cs new file mode 100644 index 00000000000..1bf1491586b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UpdatedDataStreamSettings.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class UpdatedDataStreamSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAppliedToDataStream = System.Text.Json.JsonEncodedText.Encode("applied_to_data_stream"); + private static readonly System.Text.Json.JsonEncodedText PropEffectiveSettings = System.Text.Json.JsonEncodedText.Encode("effective_settings"); + private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); + private static readonly System.Text.Json.JsonEncodedText PropIndexSettingsResults = System.Text.Json.JsonEncodedText.Encode("index_settings_results"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.UpdatedDataStreamSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAppliedToDataStream = default; + LocalJsonValue propEffectiveSettings = default; + LocalJsonValue propError = default; + LocalJsonValue propIndexSettingsResults = default; + LocalJsonValue propName = default; + LocalJsonValue propSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAppliedToDataStream.TryReadProperty(ref reader, options, PropAppliedToDataStream, null)) + { + continue; + } + + if (propEffectiveSettings.TryReadProperty(ref reader, options, PropEffectiveSettings, null)) + { + continue; + } + + if (propError.TryReadProperty(ref reader, options, PropError, null)) + { + continue; + } + + if (propIndexSettingsResults.TryReadProperty(ref reader, options, PropIndexSettingsResults, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.UpdatedDataStreamSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AppliedToDataStream = propAppliedToDataStream.Value, + EffectiveSettings = propEffectiveSettings.Value, + Error = propError.Value, + IndexSettingsResults = propIndexSettingsResults.Value, + Name = propName.Value, + Settings = propSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.UpdatedDataStreamSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAppliedToDataStream, value.AppliedToDataStream, null, null); + writer.WriteProperty(options, PropEffectiveSettings, value.EffectiveSettings, null, null); + writer.WriteProperty(options, PropError, value.Error, null, null); + writer.WriteProperty(options, PropIndexSettingsResults, value.IndexSettingsResults, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropSettings, value.Settings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UpdatedDataStreamSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UpdatedDataStreamSettings.g.cs index 87138a7e5f1..d1d0d4d7f2a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UpdatedDataStreamSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UpdatedDataStreamSettings.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class UpdatedDataStreamSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAppliedToDataStream = System.Text.Json.JsonEncodedText.Encode("applied_to_data_stream"); - private static readonly System.Text.Json.JsonEncodedText PropEffectiveSettings = System.Text.Json.JsonEncodedText.Encode("effective_settings"); - private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); - private static readonly System.Text.Json.JsonEncodedText PropIndexSettingsResults = System.Text.Json.JsonEncodedText.Encode("index_settings_results"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.UpdatedDataStreamSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAppliedToDataStream = default; - LocalJsonValue propEffectiveSettings = default; - LocalJsonValue propError = default; - LocalJsonValue propIndexSettingsResults = default; - LocalJsonValue propName = default; - LocalJsonValue propSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAppliedToDataStream.TryReadProperty(ref reader, options, PropAppliedToDataStream, null)) - { - continue; - } - - if (propEffectiveSettings.TryReadProperty(ref reader, options, PropEffectiveSettings, null)) - { - continue; - } - - if (propError.TryReadProperty(ref reader, options, PropError, null)) - { - continue; - } - - if (propIndexSettingsResults.TryReadProperty(ref reader, options, PropIndexSettingsResults, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.UpdatedDataStreamSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AppliedToDataStream = propAppliedToDataStream.Value, - EffectiveSettings = propEffectiveSettings.Value, - Error = propError.Value, - IndexSettingsResults = propIndexSettingsResults.Value, - Name = propName.Value, - Settings = propSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.UpdatedDataStreamSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAppliedToDataStream, value.AppliedToDataStream, null, null); - writer.WriteProperty(options, PropEffectiveSettings, value.EffectiveSettings, null, null); - writer.WriteProperty(options, PropError, value.Error, null, null); - writer.WriteProperty(options, PropIndexSettingsResults, value.IndexSettingsResults, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropSettings, value.Settings, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.UpdatedDataStreamSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.UpdatedDataStreamSettingsConverter))] public sealed partial class UpdatedDataStreamSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UsageStatsIndex.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UsageStatsIndex.Converters.g.cs new file mode 100644 index 00000000000..3926cf25031 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UsageStatsIndex.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class UsageStatsIndexConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.UsageStatsIndex Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propShards = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propShards.TryReadProperty(ref reader, options, PropShards, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.UsageStatsIndex(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Shards = propShards.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.UsageStatsIndex value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropShards, value.Shards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UsageStatsIndex.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UsageStatsIndex.g.cs index 6ff62f0dbc5..3c2fc62185f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UsageStatsIndex.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UsageStatsIndex.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class UsageStatsIndexConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.UsageStatsIndex Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propShards = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propShards.TryReadProperty(ref reader, options, PropShards, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.UsageStatsIndex(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Shards = propShards.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.UsageStatsIndex value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropShards, value.Shards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.UsageStatsIndexConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.UsageStatsIndexConverter))] public sealed partial class UsageStatsIndex { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UsageStatsShards.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UsageStatsShards.Converters.g.cs new file mode 100644 index 00000000000..ea67fbab2be --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UsageStatsShards.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class UsageStatsShardsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); + private static readonly System.Text.Json.JsonEncodedText PropStats = System.Text.Json.JsonEncodedText.Encode("stats"); + private static readonly System.Text.Json.JsonEncodedText PropTrackingId = System.Text.Json.JsonEncodedText.Encode("tracking_id"); + private static readonly System.Text.Json.JsonEncodedText PropTrackingStartedAtMillis = System.Text.Json.JsonEncodedText.Encode("tracking_started_at_millis"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.UsageStatsShards Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propRouting = default; + LocalJsonValue propStats = default; + LocalJsonValue propTrackingId = default; + LocalJsonValue propTrackingStartedAtMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (propStats.TryReadProperty(ref reader, options, PropStats, null)) + { + continue; + } + + if (propTrackingId.TryReadProperty(ref reader, options, PropTrackingId, null)) + { + continue; + } + + if (propTrackingStartedAtMillis.TryReadProperty(ref reader, options, PropTrackingStartedAtMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.UsageStatsShards(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Routing = propRouting.Value, + Stats = propStats.Value, + TrackingId = propTrackingId.Value, + TrackingStartedAtMillis = propTrackingStartedAtMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.UsageStatsShards value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteProperty(options, PropStats, value.Stats, null, null); + writer.WriteProperty(options, PropTrackingId, value.TrackingId, null, null); + writer.WriteProperty(options, PropTrackingStartedAtMillis, value.TrackingStartedAtMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UsageStatsShards.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UsageStatsShards.g.cs index 87d0ab19022..c24e750abbe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UsageStatsShards.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/UsageStatsShards.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class UsageStatsShardsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); - private static readonly System.Text.Json.JsonEncodedText PropStats = System.Text.Json.JsonEncodedText.Encode("stats"); - private static readonly System.Text.Json.JsonEncodedText PropTrackingId = System.Text.Json.JsonEncodedText.Encode("tracking_id"); - private static readonly System.Text.Json.JsonEncodedText PropTrackingStartedAtMillis = System.Text.Json.JsonEncodedText.Encode("tracking_started_at_millis"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.UsageStatsShards Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propRouting = default; - LocalJsonValue propStats = default; - LocalJsonValue propTrackingId = default; - LocalJsonValue propTrackingStartedAtMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (propStats.TryReadProperty(ref reader, options, PropStats, null)) - { - continue; - } - - if (propTrackingId.TryReadProperty(ref reader, options, PropTrackingId, null)) - { - continue; - } - - if (propTrackingStartedAtMillis.TryReadProperty(ref reader, options, PropTrackingStartedAtMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.UsageStatsShards(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Routing = propRouting.Value, - Stats = propStats.Value, - TrackingId = propTrackingId.Value, - TrackingStartedAtMillis = propTrackingStartedAtMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.UsageStatsShards value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteProperty(options, PropStats, value.Stats, null, null); - writer.WriteProperty(options, PropTrackingId, value.TrackingId, null, null); - writer.WriteProperty(options, PropTrackingStartedAtMillis, value.TrackingStartedAtMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.UsageStatsShardsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.UsageStatsShardsConverter))] public sealed partial class UsageStatsShards { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/VerifyIndex.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/VerifyIndex.Converters.g.cs new file mode 100644 index 00000000000..fbbc0c026de --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/VerifyIndex.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class VerifyIndexConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCheckIndexTime = System.Text.Json.JsonEncodedText.Encode("check_index_time"); + private static readonly System.Text.Json.JsonEncodedText PropCheckIndexTimeInMillis = System.Text.Json.JsonEncodedText.Encode("check_index_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTotalTime = System.Text.Json.JsonEncodedText.Encode("total_time"); + private static readonly System.Text.Json.JsonEncodedText PropTotalTimeInMillis = System.Text.Json.JsonEncodedText.Encode("total_time_in_millis"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.VerifyIndex Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCheckIndexTime = default; + LocalJsonValue propCheckIndexTimeInMillis = default; + LocalJsonValue propTotalTime = default; + LocalJsonValue propTotalTimeInMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCheckIndexTime.TryReadProperty(ref reader, options, PropCheckIndexTime, null)) + { + continue; + } + + if (propCheckIndexTimeInMillis.TryReadProperty(ref reader, options, PropCheckIndexTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTotalTime.TryReadProperty(ref reader, options, PropTotalTime, null)) + { + continue; + } + + if (propTotalTimeInMillis.TryReadProperty(ref reader, options, PropTotalTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.VerifyIndex(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CheckIndexTime = propCheckIndexTime.Value, + CheckIndexTimeInMillis = propCheckIndexTimeInMillis.Value, + TotalTime = propTotalTime.Value, + TotalTimeInMillis = propTotalTimeInMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.VerifyIndex value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCheckIndexTime, value.CheckIndexTime, null, null); + writer.WriteProperty(options, PropCheckIndexTimeInMillis, value.CheckIndexTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTotalTime, value.TotalTime, null, null); + writer.WriteProperty(options, PropTotalTimeInMillis, value.TotalTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/VerifyIndex.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/VerifyIndex.g.cs index 99cedeb8098..81ef8a88970 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/VerifyIndex.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/VerifyIndex.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; -internal sealed partial class VerifyIndexConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCheckIndexTime = System.Text.Json.JsonEncodedText.Encode("check_index_time"); - private static readonly System.Text.Json.JsonEncodedText PropCheckIndexTimeInMillis = System.Text.Json.JsonEncodedText.Encode("check_index_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTotalTime = System.Text.Json.JsonEncodedText.Encode("total_time"); - private static readonly System.Text.Json.JsonEncodedText PropTotalTimeInMillis = System.Text.Json.JsonEncodedText.Encode("total_time_in_millis"); - - public override Elastic.Clients.Elasticsearch.IndexManagement.VerifyIndex Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCheckIndexTime = default; - LocalJsonValue propCheckIndexTimeInMillis = default; - LocalJsonValue propTotalTime = default; - LocalJsonValue propTotalTimeInMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCheckIndexTime.TryReadProperty(ref reader, options, PropCheckIndexTime, null)) - { - continue; - } - - if (propCheckIndexTimeInMillis.TryReadProperty(ref reader, options, PropCheckIndexTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTotalTime.TryReadProperty(ref reader, options, PropTotalTime, null)) - { - continue; - } - - if (propTotalTimeInMillis.TryReadProperty(ref reader, options, PropTotalTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexManagement.VerifyIndex(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CheckIndexTime = propCheckIndexTime.Value, - CheckIndexTimeInMillis = propCheckIndexTimeInMillis.Value, - TotalTime = propTotalTime.Value, - TotalTimeInMillis = propTotalTimeInMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.VerifyIndex value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCheckIndexTime, value.CheckIndexTime, null, null); - writer.WriteProperty(options, PropCheckIndexTimeInMillis, value.CheckIndexTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTotalTime, value.TotalTime, null, null); - writer.WriteProperty(options, PropTotalTimeInMillis, value.TotalTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.VerifyIndexConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.VerifyIndexConverter))] public sealed partial class VerifyIndex { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexingStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexingStats.Converters.g.cs new file mode 100644 index 00000000000..312e4f8581e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexingStats.Converters.g.cs @@ -0,0 +1,207 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class IndexingStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDeleteCurrent = System.Text.Json.JsonEncodedText.Encode("delete_current"); + private static readonly System.Text.Json.JsonEncodedText PropDeleteTime = System.Text.Json.JsonEncodedText.Encode("delete_time"); + private static readonly System.Text.Json.JsonEncodedText PropDeleteTimeInMillis = System.Text.Json.JsonEncodedText.Encode("delete_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropDeleteTotal = System.Text.Json.JsonEncodedText.Encode("delete_total"); + private static readonly System.Text.Json.JsonEncodedText PropIndexCurrent = System.Text.Json.JsonEncodedText.Encode("index_current"); + private static readonly System.Text.Json.JsonEncodedText PropIndexFailed = System.Text.Json.JsonEncodedText.Encode("index_failed"); + private static readonly System.Text.Json.JsonEncodedText PropIndexTime = System.Text.Json.JsonEncodedText.Encode("index_time"); + private static readonly System.Text.Json.JsonEncodedText PropIndexTimeInMillis = System.Text.Json.JsonEncodedText.Encode("index_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropIndexTotal = System.Text.Json.JsonEncodedText.Encode("index_total"); + private static readonly System.Text.Json.JsonEncodedText PropIsThrottled = System.Text.Json.JsonEncodedText.Encode("is_throttled"); + private static readonly System.Text.Json.JsonEncodedText PropNoopUpdateTotal = System.Text.Json.JsonEncodedText.Encode("noop_update_total"); + private static readonly System.Text.Json.JsonEncodedText PropPeakWriteLoad = System.Text.Json.JsonEncodedText.Encode("peak_write_load"); + private static readonly System.Text.Json.JsonEncodedText PropRecentWriteLoad = System.Text.Json.JsonEncodedText.Encode("recent_write_load"); + private static readonly System.Text.Json.JsonEncodedText PropThrottleTime = System.Text.Json.JsonEncodedText.Encode("throttle_time"); + private static readonly System.Text.Json.JsonEncodedText PropThrottleTimeInMillis = System.Text.Json.JsonEncodedText.Encode("throttle_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTypes = System.Text.Json.JsonEncodedText.Encode("types"); + private static readonly System.Text.Json.JsonEncodedText PropWriteLoad = System.Text.Json.JsonEncodedText.Encode("write_load"); + + public override Elastic.Clients.Elasticsearch.IndexingStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDeleteCurrent = default; + LocalJsonValue propDeleteTime = default; + LocalJsonValue propDeleteTimeInMillis = default; + LocalJsonValue propDeleteTotal = default; + LocalJsonValue propIndexCurrent = default; + LocalJsonValue propIndexFailed = default; + LocalJsonValue propIndexTime = default; + LocalJsonValue propIndexTimeInMillis = default; + LocalJsonValue propIndexTotal = default; + LocalJsonValue propIsThrottled = default; + LocalJsonValue propNoopUpdateTotal = default; + LocalJsonValue propPeakWriteLoad = default; + LocalJsonValue propRecentWriteLoad = default; + LocalJsonValue propThrottleTime = default; + LocalJsonValue propThrottleTimeInMillis = default; + LocalJsonValue?> propTypes = default; + LocalJsonValue propWriteLoad = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDeleteCurrent.TryReadProperty(ref reader, options, PropDeleteCurrent, null)) + { + continue; + } + + if (propDeleteTime.TryReadProperty(ref reader, options, PropDeleteTime, null)) + { + continue; + } + + if (propDeleteTimeInMillis.TryReadProperty(ref reader, options, PropDeleteTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propDeleteTotal.TryReadProperty(ref reader, options, PropDeleteTotal, null)) + { + continue; + } + + if (propIndexCurrent.TryReadProperty(ref reader, options, PropIndexCurrent, null)) + { + continue; + } + + if (propIndexFailed.TryReadProperty(ref reader, options, PropIndexFailed, null)) + { + continue; + } + + if (propIndexTime.TryReadProperty(ref reader, options, PropIndexTime, null)) + { + continue; + } + + if (propIndexTimeInMillis.TryReadProperty(ref reader, options, PropIndexTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propIndexTotal.TryReadProperty(ref reader, options, PropIndexTotal, null)) + { + continue; + } + + if (propIsThrottled.TryReadProperty(ref reader, options, PropIsThrottled, null)) + { + continue; + } + + if (propNoopUpdateTotal.TryReadProperty(ref reader, options, PropNoopUpdateTotal, null)) + { + continue; + } + + if (propPeakWriteLoad.TryReadProperty(ref reader, options, PropPeakWriteLoad, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRecentWriteLoad.TryReadProperty(ref reader, options, PropRecentWriteLoad, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propThrottleTime.TryReadProperty(ref reader, options, PropThrottleTime, null)) + { + continue; + } + + if (propThrottleTimeInMillis.TryReadProperty(ref reader, options, PropThrottleTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTypes.TryReadProperty(ref reader, options, PropTypes, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propWriteLoad.TryReadProperty(ref reader, options, PropWriteLoad, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexingStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DeleteCurrent = propDeleteCurrent.Value, + DeleteTime = propDeleteTime.Value, + DeleteTimeInMillis = propDeleteTimeInMillis.Value, + DeleteTotal = propDeleteTotal.Value, + IndexCurrent = propIndexCurrent.Value, + IndexFailed = propIndexFailed.Value, + IndexTime = propIndexTime.Value, + IndexTimeInMillis = propIndexTimeInMillis.Value, + IndexTotal = propIndexTotal.Value, + IsThrottled = propIsThrottled.Value, + NoopUpdateTotal = propNoopUpdateTotal.Value, + PeakWriteLoad = propPeakWriteLoad.Value, + RecentWriteLoad = propRecentWriteLoad.Value, + ThrottleTime = propThrottleTime.Value, + ThrottleTimeInMillis = propThrottleTimeInMillis.Value, + Types = propTypes.Value, + WriteLoad = propWriteLoad.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexingStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDeleteCurrent, value.DeleteCurrent, null, null); + writer.WriteProperty(options, PropDeleteTime, value.DeleteTime, null, null); + writer.WriteProperty(options, PropDeleteTimeInMillis, value.DeleteTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropDeleteTotal, value.DeleteTotal, null, null); + writer.WriteProperty(options, PropIndexCurrent, value.IndexCurrent, null, null); + writer.WriteProperty(options, PropIndexFailed, value.IndexFailed, null, null); + writer.WriteProperty(options, PropIndexTime, value.IndexTime, null, null); + writer.WriteProperty(options, PropIndexTimeInMillis, value.IndexTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropIndexTotal, value.IndexTotal, null, null); + writer.WriteProperty(options, PropIsThrottled, value.IsThrottled, null, null); + writer.WriteProperty(options, PropNoopUpdateTotal, value.NoopUpdateTotal, null, null); + writer.WriteProperty(options, PropPeakWriteLoad, value.PeakWriteLoad, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRecentWriteLoad, value.RecentWriteLoad, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropThrottleTime, value.ThrottleTime, null, null); + writer.WriteProperty(options, PropThrottleTimeInMillis, value.ThrottleTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTypes, value.Types, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropWriteLoad, value.WriteLoad, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexingStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexingStats.g.cs index c5d1019b3f1..54cef3987ec 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexingStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexingStats.g.cs @@ -23,190 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class IndexingStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDeleteCurrent = System.Text.Json.JsonEncodedText.Encode("delete_current"); - private static readonly System.Text.Json.JsonEncodedText PropDeleteTime = System.Text.Json.JsonEncodedText.Encode("delete_time"); - private static readonly System.Text.Json.JsonEncodedText PropDeleteTimeInMillis = System.Text.Json.JsonEncodedText.Encode("delete_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropDeleteTotal = System.Text.Json.JsonEncodedText.Encode("delete_total"); - private static readonly System.Text.Json.JsonEncodedText PropIndexCurrent = System.Text.Json.JsonEncodedText.Encode("index_current"); - private static readonly System.Text.Json.JsonEncodedText PropIndexFailed = System.Text.Json.JsonEncodedText.Encode("index_failed"); - private static readonly System.Text.Json.JsonEncodedText PropIndexTime = System.Text.Json.JsonEncodedText.Encode("index_time"); - private static readonly System.Text.Json.JsonEncodedText PropIndexTimeInMillis = System.Text.Json.JsonEncodedText.Encode("index_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropIndexTotal = System.Text.Json.JsonEncodedText.Encode("index_total"); - private static readonly System.Text.Json.JsonEncodedText PropIsThrottled = System.Text.Json.JsonEncodedText.Encode("is_throttled"); - private static readonly System.Text.Json.JsonEncodedText PropNoopUpdateTotal = System.Text.Json.JsonEncodedText.Encode("noop_update_total"); - private static readonly System.Text.Json.JsonEncodedText PropPeakWriteLoad = System.Text.Json.JsonEncodedText.Encode("peak_write_load"); - private static readonly System.Text.Json.JsonEncodedText PropRecentWriteLoad = System.Text.Json.JsonEncodedText.Encode("recent_write_load"); - private static readonly System.Text.Json.JsonEncodedText PropThrottleTime = System.Text.Json.JsonEncodedText.Encode("throttle_time"); - private static readonly System.Text.Json.JsonEncodedText PropThrottleTimeInMillis = System.Text.Json.JsonEncodedText.Encode("throttle_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTypes = System.Text.Json.JsonEncodedText.Encode("types"); - private static readonly System.Text.Json.JsonEncodedText PropWriteLoad = System.Text.Json.JsonEncodedText.Encode("write_load"); - - public override Elastic.Clients.Elasticsearch.IndexingStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDeleteCurrent = default; - LocalJsonValue propDeleteTime = default; - LocalJsonValue propDeleteTimeInMillis = default; - LocalJsonValue propDeleteTotal = default; - LocalJsonValue propIndexCurrent = default; - LocalJsonValue propIndexFailed = default; - LocalJsonValue propIndexTime = default; - LocalJsonValue propIndexTimeInMillis = default; - LocalJsonValue propIndexTotal = default; - LocalJsonValue propIsThrottled = default; - LocalJsonValue propNoopUpdateTotal = default; - LocalJsonValue propPeakWriteLoad = default; - LocalJsonValue propRecentWriteLoad = default; - LocalJsonValue propThrottleTime = default; - LocalJsonValue propThrottleTimeInMillis = default; - LocalJsonValue?> propTypes = default; - LocalJsonValue propWriteLoad = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDeleteCurrent.TryReadProperty(ref reader, options, PropDeleteCurrent, null)) - { - continue; - } - - if (propDeleteTime.TryReadProperty(ref reader, options, PropDeleteTime, null)) - { - continue; - } - - if (propDeleteTimeInMillis.TryReadProperty(ref reader, options, PropDeleteTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propDeleteTotal.TryReadProperty(ref reader, options, PropDeleteTotal, null)) - { - continue; - } - - if (propIndexCurrent.TryReadProperty(ref reader, options, PropIndexCurrent, null)) - { - continue; - } - - if (propIndexFailed.TryReadProperty(ref reader, options, PropIndexFailed, null)) - { - continue; - } - - if (propIndexTime.TryReadProperty(ref reader, options, PropIndexTime, null)) - { - continue; - } - - if (propIndexTimeInMillis.TryReadProperty(ref reader, options, PropIndexTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propIndexTotal.TryReadProperty(ref reader, options, PropIndexTotal, null)) - { - continue; - } - - if (propIsThrottled.TryReadProperty(ref reader, options, PropIsThrottled, null)) - { - continue; - } - - if (propNoopUpdateTotal.TryReadProperty(ref reader, options, PropNoopUpdateTotal, null)) - { - continue; - } - - if (propPeakWriteLoad.TryReadProperty(ref reader, options, PropPeakWriteLoad, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRecentWriteLoad.TryReadProperty(ref reader, options, PropRecentWriteLoad, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propThrottleTime.TryReadProperty(ref reader, options, PropThrottleTime, null)) - { - continue; - } - - if (propThrottleTimeInMillis.TryReadProperty(ref reader, options, PropThrottleTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTypes.TryReadProperty(ref reader, options, PropTypes, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propWriteLoad.TryReadProperty(ref reader, options, PropWriteLoad, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndexingStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DeleteCurrent = propDeleteCurrent.Value, - DeleteTime = propDeleteTime.Value, - DeleteTimeInMillis = propDeleteTimeInMillis.Value, - DeleteTotal = propDeleteTotal.Value, - IndexCurrent = propIndexCurrent.Value, - IndexFailed = propIndexFailed.Value, - IndexTime = propIndexTime.Value, - IndexTimeInMillis = propIndexTimeInMillis.Value, - IndexTotal = propIndexTotal.Value, - IsThrottled = propIsThrottled.Value, - NoopUpdateTotal = propNoopUpdateTotal.Value, - PeakWriteLoad = propPeakWriteLoad.Value, - RecentWriteLoad = propRecentWriteLoad.Value, - ThrottleTime = propThrottleTime.Value, - ThrottleTimeInMillis = propThrottleTimeInMillis.Value, - Types = propTypes.Value, - WriteLoad = propWriteLoad.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexingStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDeleteCurrent, value.DeleteCurrent, null, null); - writer.WriteProperty(options, PropDeleteTime, value.DeleteTime, null, null); - writer.WriteProperty(options, PropDeleteTimeInMillis, value.DeleteTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropDeleteTotal, value.DeleteTotal, null, null); - writer.WriteProperty(options, PropIndexCurrent, value.IndexCurrent, null, null); - writer.WriteProperty(options, PropIndexFailed, value.IndexFailed, null, null); - writer.WriteProperty(options, PropIndexTime, value.IndexTime, null, null); - writer.WriteProperty(options, PropIndexTimeInMillis, value.IndexTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropIndexTotal, value.IndexTotal, null, null); - writer.WriteProperty(options, PropIsThrottled, value.IsThrottled, null, null); - writer.WriteProperty(options, PropNoopUpdateTotal, value.NoopUpdateTotal, null, null); - writer.WriteProperty(options, PropPeakWriteLoad, value.PeakWriteLoad, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRecentWriteLoad, value.RecentWriteLoad, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropThrottleTime, value.ThrottleTime, null, null); - writer.WriteProperty(options, PropThrottleTimeInMillis, value.ThrottleTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTypes, value.Types, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropWriteLoad, value.WriteLoad, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexingStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.IndexingStatsConverter))] public sealed partial class IndexingStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndicesOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndicesOptions.Converters.g.cs new file mode 100644 index 00000000000..aa32ddb5d8f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndicesOptions.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class IndicesOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowNoIndices = System.Text.Json.JsonEncodedText.Encode("allow_no_indices"); + private static readonly System.Text.Json.JsonEncodedText PropExpandWildcards = System.Text.Json.JsonEncodedText.Encode("expand_wildcards"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreThrottled = System.Text.Json.JsonEncodedText.Encode("ignore_throttled"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnavailable = System.Text.Json.JsonEncodedText.Encode("ignore_unavailable"); + + public override Elastic.Clients.Elasticsearch.IndicesOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowNoIndices = default; + LocalJsonValue?> propExpandWildcards = default; + LocalJsonValue propIgnoreThrottled = default; + LocalJsonValue propIgnoreUnavailable = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowNoIndices.TryReadProperty(ref reader, options, PropAllowNoIndices, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propExpandWildcards.TryReadProperty(ref reader, options, PropExpandWildcards, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propIgnoreThrottled.TryReadProperty(ref reader, options, PropIgnoreThrottled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreUnavailable.TryReadProperty(ref reader, options, PropIgnoreUnavailable, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndicesOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowNoIndices = propAllowNoIndices.Value, + ExpandWildcards = propExpandWildcards.Value, + IgnoreThrottled = propIgnoreThrottled.Value, + IgnoreUnavailable = propIgnoreUnavailable.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndicesOptions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowNoIndices, value.AllowNoIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropExpandWildcards, value.ExpandWildcards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIgnoreThrottled, value.IgnoreThrottled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreUnavailable, value.IgnoreUnavailable, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndicesOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndicesOptions.g.cs index ace167d6a4b..1a20dcb44d3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndicesOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndicesOptions.g.cs @@ -23,79 +23,13 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class IndicesOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowNoIndices = System.Text.Json.JsonEncodedText.Encode("allow_no_indices"); - private static readonly System.Text.Json.JsonEncodedText PropExpandWildcards = System.Text.Json.JsonEncodedText.Encode("expand_wildcards"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreThrottled = System.Text.Json.JsonEncodedText.Encode("ignore_throttled"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnavailable = System.Text.Json.JsonEncodedText.Encode("ignore_unavailable"); - - public override Elastic.Clients.Elasticsearch.IndicesOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowNoIndices = default; - LocalJsonValue?> propExpandWildcards = default; - LocalJsonValue propIgnoreThrottled = default; - LocalJsonValue propIgnoreUnavailable = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowNoIndices.TryReadProperty(ref reader, options, PropAllowNoIndices, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propExpandWildcards.TryReadProperty(ref reader, options, PropExpandWildcards, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propIgnoreThrottled.TryReadProperty(ref reader, options, PropIgnoreThrottled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreUnavailable.TryReadProperty(ref reader, options, PropIgnoreUnavailable, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.IndicesOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowNoIndices = propAllowNoIndices.Value, - ExpandWildcards = propExpandWildcards.Value, - IgnoreThrottled = propIgnoreThrottled.Value, - IgnoreUnavailable = propIgnoreUnavailable.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndicesOptions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowNoIndices, value.AllowNoIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropExpandWildcards, value.ExpandWildcards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIgnoreThrottled, value.IgnoreThrottled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreUnavailable, value.IgnoreUnavailable, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// Controls how to deal with unavailable concrete indices (closed or missing), how wildcard expressions are expanded /// to actual indices (all, closed or open indices) and how to deal with wildcard expressions that resolve to no indices. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndicesOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.IndicesOptionsConverter))] public sealed partial class IndicesOptions { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AdaptiveAllocations.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AdaptiveAllocations.Converters.g.cs new file mode 100644 index 00000000000..94a7d49a139 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AdaptiveAllocations.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class AdaptiveAllocationsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropMaxNumberOfAllocations = System.Text.Json.JsonEncodedText.Encode("max_number_of_allocations"); + private static readonly System.Text.Json.JsonEncodedText PropMinNumberOfAllocations = System.Text.Json.JsonEncodedText.Encode("min_number_of_allocations"); + + public override Elastic.Clients.Elasticsearch.Inference.AdaptiveAllocations Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEnabled = default; + LocalJsonValue propMaxNumberOfAllocations = default; + LocalJsonValue propMinNumberOfAllocations = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxNumberOfAllocations.TryReadProperty(ref reader, options, PropMaxNumberOfAllocations, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinNumberOfAllocations.TryReadProperty(ref reader, options, PropMinNumberOfAllocations, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.AdaptiveAllocations(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Enabled = propEnabled.Value, + MaxNumberOfAllocations = propMaxNumberOfAllocations.Value, + MinNumberOfAllocations = propMinNumberOfAllocations.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AdaptiveAllocations value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxNumberOfAllocations, value.MaxNumberOfAllocations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinNumberOfAllocations, value.MinNumberOfAllocations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AdaptiveAllocations.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AdaptiveAllocations.g.cs index b95ff6b7478..87e33288519 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AdaptiveAllocations.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AdaptiveAllocations.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class AdaptiveAllocationsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropMaxNumberOfAllocations = System.Text.Json.JsonEncodedText.Encode("max_number_of_allocations"); - private static readonly System.Text.Json.JsonEncodedText PropMinNumberOfAllocations = System.Text.Json.JsonEncodedText.Encode("min_number_of_allocations"); - - public override Elastic.Clients.Elasticsearch.Inference.AdaptiveAllocations Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEnabled = default; - LocalJsonValue propMaxNumberOfAllocations = default; - LocalJsonValue propMinNumberOfAllocations = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxNumberOfAllocations.TryReadProperty(ref reader, options, PropMaxNumberOfAllocations, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinNumberOfAllocations.TryReadProperty(ref reader, options, PropMinNumberOfAllocations, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.AdaptiveAllocations(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Enabled = propEnabled.Value, - MaxNumberOfAllocations = propMaxNumberOfAllocations.Value, - MinNumberOfAllocations = propMinNumberOfAllocations.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AdaptiveAllocations value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxNumberOfAllocations, value.MaxNumberOfAllocations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinNumberOfAllocations, value.MinNumberOfAllocations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.AdaptiveAllocationsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.AdaptiveAllocationsConverter))] public sealed partial class AdaptiveAllocations { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Ai21ServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Ai21ServiceSettings.Converters.g.cs new file mode 100644 index 00000000000..ffeaa11a4e4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Ai21ServiceSettings.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class Ai21ServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); + private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); + private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); + + public override Elastic.Clients.Elasticsearch.Inference.Ai21ServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApiKey = default; + LocalJsonValue propModelId = default; + LocalJsonValue propRateLimit = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) + { + continue; + } + + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) + { + continue; + } + + if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.Ai21ServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ApiKey = propApiKey.Value, + ModelId = propModelId.Value, + RateLimit = propRateLimit.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.Ai21ServiceSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); + writer.WriteProperty(options, PropModelId, value.ModelId, null, null); + writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Ai21ServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Ai21ServiceSettings.g.cs index 53304c6606e..a3d0f779852 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Ai21ServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Ai21ServiceSettings.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class Ai21ServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); - private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); - private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); - - public override Elastic.Clients.Elasticsearch.Inference.Ai21ServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propApiKey = default; - LocalJsonValue propModelId = default; - LocalJsonValue propRateLimit = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) - { - continue; - } - - if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) - { - continue; - } - - if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.Ai21ServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ApiKey = propApiKey.Value, - ModelId = propModelId.Value, - RateLimit = propRateLimit.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.Ai21ServiceSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); - writer.WriteProperty(options, PropModelId, value.ModelId, null, null); - writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Ai21ServiceSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.Ai21ServiceSettingsConverter))] public sealed partial class Ai21ServiceSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Ai21TaskType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Ai21TaskType.Converters.g.cs new file mode 100644 index 00000000000..524698951d6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Ai21TaskType.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class Ai21TaskTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + + public override Elastic.Clients.Elasticsearch.Inference.Ai21TaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberChatCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.Ai21TaskType.ChatCompletion; + } + + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.Ai21TaskType.Completion; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.Ai21TaskType.ChatCompletion; + } + + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.Ai21TaskType.Completion; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.Ai21TaskType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.Ai21TaskType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.Ai21TaskType.ChatCompletion: + writer.WriteStringValue(MemberChatCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.Ai21TaskType.Completion: + writer.WriteStringValue(MemberCompletion); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.Ai21TaskType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.Ai21TaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.Ai21TaskType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Ai21TaskType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Ai21TaskType.g.cs new file mode 100644 index 00000000000..2c857a3c13b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Ai21TaskType.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.Ai21TaskTypeConverter))] +public enum Ai21TaskType +{ + [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] + ChatCompletion, + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AlibabaCloudServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AlibabaCloudServiceSettings.Converters.g.cs new file mode 100644 index 00000000000..7f4351c81ba --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AlibabaCloudServiceSettings.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class AlibabaCloudServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); + private static readonly System.Text.Json.JsonEncodedText PropHost = System.Text.Json.JsonEncodedText.Encode("host"); + private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); + private static readonly System.Text.Json.JsonEncodedText PropServiceId = System.Text.Json.JsonEncodedText.Encode("service_id"); + private static readonly System.Text.Json.JsonEncodedText PropWorkspace = System.Text.Json.JsonEncodedText.Encode("workspace"); + + public override Elastic.Clients.Elasticsearch.Inference.AlibabaCloudServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApiKey = default; + LocalJsonValue propHost = default; + LocalJsonValue propRateLimit = default; + LocalJsonValue propServiceId = default; + LocalJsonValue propWorkspace = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) + { + continue; + } + + if (propHost.TryReadProperty(ref reader, options, PropHost, null)) + { + continue; + } + + if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) + { + continue; + } + + if (propServiceId.TryReadProperty(ref reader, options, PropServiceId, null)) + { + continue; + } + + if (propWorkspace.TryReadProperty(ref reader, options, PropWorkspace, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.AlibabaCloudServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ApiKey = propApiKey.Value, + Host = propHost.Value, + RateLimit = propRateLimit.Value, + ServiceId = propServiceId.Value, + Workspace = propWorkspace.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AlibabaCloudServiceSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); + writer.WriteProperty(options, PropHost, value.Host, null, null); + writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); + writer.WriteProperty(options, PropServiceId, value.ServiceId, null, null); + writer.WriteProperty(options, PropWorkspace, value.Workspace, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AlibabaCloudServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AlibabaCloudServiceSettings.g.cs index 9c08fcc0740..c37d7d06411 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AlibabaCloudServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AlibabaCloudServiceSettings.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class AlibabaCloudServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); - private static readonly System.Text.Json.JsonEncodedText PropHost = System.Text.Json.JsonEncodedText.Encode("host"); - private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); - private static readonly System.Text.Json.JsonEncodedText PropServiceId = System.Text.Json.JsonEncodedText.Encode("service_id"); - private static readonly System.Text.Json.JsonEncodedText PropWorkspace = System.Text.Json.JsonEncodedText.Encode("workspace"); - - public override Elastic.Clients.Elasticsearch.Inference.AlibabaCloudServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propApiKey = default; - LocalJsonValue propHost = default; - LocalJsonValue propRateLimit = default; - LocalJsonValue propServiceId = default; - LocalJsonValue propWorkspace = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) - { - continue; - } - - if (propHost.TryReadProperty(ref reader, options, PropHost, null)) - { - continue; - } - - if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) - { - continue; - } - - if (propServiceId.TryReadProperty(ref reader, options, PropServiceId, null)) - { - continue; - } - - if (propWorkspace.TryReadProperty(ref reader, options, PropWorkspace, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.AlibabaCloudServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ApiKey = propApiKey.Value, - Host = propHost.Value, - RateLimit = propRateLimit.Value, - ServiceId = propServiceId.Value, - Workspace = propWorkspace.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AlibabaCloudServiceSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); - writer.WriteProperty(options, PropHost, value.Host, null, null); - writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); - writer.WriteProperty(options, PropServiceId, value.ServiceId, null, null); - writer.WriteProperty(options, PropWorkspace, value.Workspace, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.AlibabaCloudServiceSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.AlibabaCloudServiceSettingsConverter))] public sealed partial class AlibabaCloudServiceSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AlibabaCloudTaskSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AlibabaCloudTaskSettings.Converters.g.cs new file mode 100644 index 00000000000..e3e5fa25180 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AlibabaCloudTaskSettings.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class AlibabaCloudTaskSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropInputType = System.Text.Json.JsonEncodedText.Encode("input_type"); + private static readonly System.Text.Json.JsonEncodedText PropReturnToken = System.Text.Json.JsonEncodedText.Encode("return_token"); + + public override Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propInputType = default; + LocalJsonValue propReturnToken = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propInputType.TryReadProperty(ref reader, options, PropInputType, null)) + { + continue; + } + + if (propReturnToken.TryReadProperty(ref reader, options, PropReturnToken, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + InputType = propInputType.Value, + ReturnToken = propReturnToken.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropInputType, value.InputType, null, null); + writer.WriteProperty(options, PropReturnToken, value.ReturnToken, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AlibabaCloudTaskSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AlibabaCloudTaskSettings.g.cs index 51d1e9d8e99..1807a98a6fb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AlibabaCloudTaskSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AlibabaCloudTaskSettings.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class AlibabaCloudTaskSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropInputType = System.Text.Json.JsonEncodedText.Encode("input_type"); - private static readonly System.Text.Json.JsonEncodedText PropReturnToken = System.Text.Json.JsonEncodedText.Encode("return_token"); - - public override Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propInputType = default; - LocalJsonValue propReturnToken = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propInputType.TryReadProperty(ref reader, options, PropInputType, null)) - { - continue; - } - - if (propReturnToken.TryReadProperty(ref reader, options, PropReturnToken, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - InputType = propInputType.Value, - ReturnToken = propReturnToken.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropInputType, value.InputType, null, null); - writer.WriteProperty(options, PropReturnToken, value.ReturnToken, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.AlibabaCloudTaskSettingsConverter))] public sealed partial class AlibabaCloudTaskSettings { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AlibabaCloudTaskType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AlibabaCloudTaskType.Converters.g.cs new file mode 100644 index 00000000000..32296faf85e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AlibabaCloudTaskType.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class AlibabaCloudTaskTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); + private static readonly System.Text.Json.JsonEncodedText MemberSpaceEmbedding = System.Text.Json.JsonEncodedText.Encode("space_embedding"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType.Completion; + } + + if (reader.ValueTextEquals(MemberRerank)) + { + return Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType.Rerank; + } + + if (reader.ValueTextEquals(MemberSpaceEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType.SpaceEmbedding; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType.Completion; + } + + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType.Rerank; + } + + if (string.Equals(value, MemberSpaceEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType.SpaceEmbedding; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType.Rerank: + writer.WriteStringValue(MemberRerank); + break; + case Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType.SpaceEmbedding: + writer.WriteStringValue(MemberSpaceEmbedding); + break; + case Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AlibabaCloudTaskType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AlibabaCloudTaskType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AlibabaCloudTaskType.g.cs new file mode 100644 index 00000000000..a70ff054998 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AlibabaCloudTaskType.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.AlibabaCloudTaskTypeConverter))] +public enum AlibabaCloudTaskType +{ + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "rerank")] + Rerank, + [System.Runtime.Serialization.EnumMember(Value = "space_embedding")] + SpaceEmbedding, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockServiceSettings.Converters.g.cs new file mode 100644 index 00000000000..3acc0331196 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockServiceSettings.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class AmazonBedrockServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAccessKey = System.Text.Json.JsonEncodedText.Encode("access_key"); + private static readonly System.Text.Json.JsonEncodedText PropModel = System.Text.Json.JsonEncodedText.Encode("model"); + private static readonly System.Text.Json.JsonEncodedText PropProvider = System.Text.Json.JsonEncodedText.Encode("provider"); + private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); + private static readonly System.Text.Json.JsonEncodedText PropRegion = System.Text.Json.JsonEncodedText.Encode("region"); + private static readonly System.Text.Json.JsonEncodedText PropSecretKey = System.Text.Json.JsonEncodedText.Encode("secret_key"); + + public override Elastic.Clients.Elasticsearch.Inference.AmazonBedrockServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAccessKey = default; + LocalJsonValue propModel = default; + LocalJsonValue propProvider = default; + LocalJsonValue propRateLimit = default; + LocalJsonValue propRegion = default; + LocalJsonValue propSecretKey = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAccessKey.TryReadProperty(ref reader, options, PropAccessKey, null)) + { + continue; + } + + if (propModel.TryReadProperty(ref reader, options, PropModel, null)) + { + continue; + } + + if (propProvider.TryReadProperty(ref reader, options, PropProvider, null)) + { + continue; + } + + if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) + { + continue; + } + + if (propRegion.TryReadProperty(ref reader, options, PropRegion, null)) + { + continue; + } + + if (propSecretKey.TryReadProperty(ref reader, options, PropSecretKey, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.AmazonBedrockServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AccessKey = propAccessKey.Value, + Model = propModel.Value, + Provider = propProvider.Value, + RateLimit = propRateLimit.Value, + Region = propRegion.Value, + SecretKey = propSecretKey.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AmazonBedrockServiceSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAccessKey, value.AccessKey, null, null); + writer.WriteProperty(options, PropModel, value.Model, null, null); + writer.WriteProperty(options, PropProvider, value.Provider, null, null); + writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); + writer.WriteProperty(options, PropRegion, value.Region, null, null); + writer.WriteProperty(options, PropSecretKey, value.SecretKey, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockServiceSettings.g.cs index 0aa12dfb596..bc0c463b74e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockServiceSettings.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class AmazonBedrockServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAccessKey = System.Text.Json.JsonEncodedText.Encode("access_key"); - private static readonly System.Text.Json.JsonEncodedText PropModel = System.Text.Json.JsonEncodedText.Encode("model"); - private static readonly System.Text.Json.JsonEncodedText PropProvider = System.Text.Json.JsonEncodedText.Encode("provider"); - private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); - private static readonly System.Text.Json.JsonEncodedText PropRegion = System.Text.Json.JsonEncodedText.Encode("region"); - private static readonly System.Text.Json.JsonEncodedText PropSecretKey = System.Text.Json.JsonEncodedText.Encode("secret_key"); - - public override Elastic.Clients.Elasticsearch.Inference.AmazonBedrockServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAccessKey = default; - LocalJsonValue propModel = default; - LocalJsonValue propProvider = default; - LocalJsonValue propRateLimit = default; - LocalJsonValue propRegion = default; - LocalJsonValue propSecretKey = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAccessKey.TryReadProperty(ref reader, options, PropAccessKey, null)) - { - continue; - } - - if (propModel.TryReadProperty(ref reader, options, PropModel, null)) - { - continue; - } - - if (propProvider.TryReadProperty(ref reader, options, PropProvider, null)) - { - continue; - } - - if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) - { - continue; - } - - if (propRegion.TryReadProperty(ref reader, options, PropRegion, null)) - { - continue; - } - - if (propSecretKey.TryReadProperty(ref reader, options, PropSecretKey, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.AmazonBedrockServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AccessKey = propAccessKey.Value, - Model = propModel.Value, - Provider = propProvider.Value, - RateLimit = propRateLimit.Value, - Region = propRegion.Value, - SecretKey = propSecretKey.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AmazonBedrockServiceSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAccessKey, value.AccessKey, null, null); - writer.WriteProperty(options, PropModel, value.Model, null, null); - writer.WriteProperty(options, PropProvider, value.Provider, null, null); - writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); - writer.WriteProperty(options, PropRegion, value.Region, null, null); - writer.WriteProperty(options, PropSecretKey, value.SecretKey, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.AmazonBedrockServiceSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.AmazonBedrockServiceSettingsConverter))] public sealed partial class AmazonBedrockServiceSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockTaskSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockTaskSettings.Converters.g.cs new file mode 100644 index 00000000000..adbd12f5545 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockTaskSettings.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class AmazonBedrockTaskSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxNewTokens = System.Text.Json.JsonEncodedText.Encode("max_new_tokens"); + private static readonly System.Text.Json.JsonEncodedText PropTemperature = System.Text.Json.JsonEncodedText.Encode("temperature"); + private static readonly System.Text.Json.JsonEncodedText PropTopK = System.Text.Json.JsonEncodedText.Encode("top_k"); + private static readonly System.Text.Json.JsonEncodedText PropTopP = System.Text.Json.JsonEncodedText.Encode("top_p"); + + public override Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxNewTokens = default; + LocalJsonValue propTemperature = default; + LocalJsonValue propTopK = default; + LocalJsonValue propTopP = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxNewTokens.TryReadProperty(ref reader, options, PropMaxNewTokens, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTemperature.TryReadProperty(ref reader, options, PropTemperature, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTopK.TryReadProperty(ref reader, options, PropTopK, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTopP.TryReadProperty(ref reader, options, PropTopP, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxNewTokens = propMaxNewTokens.Value, + Temperature = propTemperature.Value, + TopK = propTopK.Value, + TopP = propTopP.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxNewTokens, value.MaxNewTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTemperature, value.Temperature, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTopK, value.TopK, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTopP, value.TopP, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockTaskSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockTaskSettings.g.cs index d1415c2eb51..fd980628072 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockTaskSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockTaskSettings.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class AmazonBedrockTaskSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxNewTokens = System.Text.Json.JsonEncodedText.Encode("max_new_tokens"); - private static readonly System.Text.Json.JsonEncodedText PropTemperature = System.Text.Json.JsonEncodedText.Encode("temperature"); - private static readonly System.Text.Json.JsonEncodedText PropTopK = System.Text.Json.JsonEncodedText.Encode("top_k"); - private static readonly System.Text.Json.JsonEncodedText PropTopP = System.Text.Json.JsonEncodedText.Encode("top_p"); - - public override Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxNewTokens = default; - LocalJsonValue propTemperature = default; - LocalJsonValue propTopK = default; - LocalJsonValue propTopP = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxNewTokens.TryReadProperty(ref reader, options, PropMaxNewTokens, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTemperature.TryReadProperty(ref reader, options, PropTemperature, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTopK.TryReadProperty(ref reader, options, PropTopK, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTopP.TryReadProperty(ref reader, options, PropTopP, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxNewTokens = propMaxNewTokens.Value, - Temperature = propTemperature.Value, - TopK = propTopK.Value, - TopP = propTopP.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxNewTokens, value.MaxNewTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTemperature, value.Temperature, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTopK, value.TopK, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTopP, value.TopP, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.AmazonBedrockTaskSettingsConverter))] public sealed partial class AmazonBedrockTaskSettings { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockTaskType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockTaskType.Converters.g.cs new file mode 100644 index 00000000000..9032c413c23 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockTaskType.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class AmazonBedrockTaskTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType.Completion; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType.Completion; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AmazonBedrockTaskType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockTaskType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockTaskType.g.cs new file mode 100644 index 00000000000..d12806761ed --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonBedrockTaskType.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.AmazonBedrockTaskTypeConverter))] +public enum AmazonBedrockTaskType +{ + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonSageMakerApi.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonSageMakerApi.Converters.g.cs new file mode 100644 index 00000000000..fb7c57269f5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonSageMakerApi.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class AmazonSageMakerApiConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberElastic = System.Text.Json.JsonEncodedText.Encode("elastic"); + private static readonly System.Text.Json.JsonEncodedText MemberOpenai = System.Text.Json.JsonEncodedText.Encode("openai"); + + public override Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerApi Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberElastic)) + { + return Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerApi.Elastic; + } + + if (reader.ValueTextEquals(MemberOpenai)) + { + return Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerApi.Openai; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberElastic.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerApi.Elastic; + } + + if (string.Equals(value, MemberOpenai.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerApi.Openai; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerApi)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerApi value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerApi.Elastic: + writer.WriteStringValue(MemberElastic); + break; + case Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerApi.Openai: + writer.WriteStringValue(MemberOpenai); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerApi)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerApi ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerApi value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonSageMakerApi.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonSageMakerApi.g.cs new file mode 100644 index 00000000000..fd8dc1966cf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonSageMakerApi.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.AmazonSageMakerApiConverter))] +public enum AmazonSageMakerApi +{ + [System.Runtime.Serialization.EnumMember(Value = "elastic")] + Elastic, + [System.Runtime.Serialization.EnumMember(Value = "openai")] + Openai +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonSageMakerServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonSageMakerServiceSettings.Converters.g.cs new file mode 100644 index 00000000000..6a26c5030d6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonSageMakerServiceSettings.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class AmazonSageMakerServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAccessKey = System.Text.Json.JsonEncodedText.Encode("access_key"); + private static readonly System.Text.Json.JsonEncodedText PropApi = System.Text.Json.JsonEncodedText.Encode("api"); + private static readonly System.Text.Json.JsonEncodedText PropBatchSize = System.Text.Json.JsonEncodedText.Encode("batch_size"); + private static readonly System.Text.Json.JsonEncodedText PropDimensions = System.Text.Json.JsonEncodedText.Encode("dimensions"); + private static readonly System.Text.Json.JsonEncodedText PropEndpointName = System.Text.Json.JsonEncodedText.Encode("endpoint_name"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceComponentName = System.Text.Json.JsonEncodedText.Encode("inference_component_name"); + private static readonly System.Text.Json.JsonEncodedText PropRegion = System.Text.Json.JsonEncodedText.Encode("region"); + private static readonly System.Text.Json.JsonEncodedText PropSecretKey = System.Text.Json.JsonEncodedText.Encode("secret_key"); + private static readonly System.Text.Json.JsonEncodedText PropTargetContainerHostname = System.Text.Json.JsonEncodedText.Encode("target_container_hostname"); + private static readonly System.Text.Json.JsonEncodedText PropTargetModel = System.Text.Json.JsonEncodedText.Encode("target_model"); + + public override Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAccessKey = default; + LocalJsonValue propApi = default; + LocalJsonValue propBatchSize = default; + LocalJsonValue propDimensions = default; + LocalJsonValue propEndpointName = default; + LocalJsonValue propInferenceComponentName = default; + LocalJsonValue propRegion = default; + LocalJsonValue propSecretKey = default; + LocalJsonValue propTargetContainerHostname = default; + LocalJsonValue propTargetModel = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAccessKey.TryReadProperty(ref reader, options, PropAccessKey, null)) + { + continue; + } + + if (propApi.TryReadProperty(ref reader, options, PropApi, null)) + { + continue; + } + + if (propBatchSize.TryReadProperty(ref reader, options, PropBatchSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDimensions.TryReadProperty(ref reader, options, PropDimensions, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEndpointName.TryReadProperty(ref reader, options, PropEndpointName, null)) + { + continue; + } + + if (propInferenceComponentName.TryReadProperty(ref reader, options, PropInferenceComponentName, null)) + { + continue; + } + + if (propRegion.TryReadProperty(ref reader, options, PropRegion, null)) + { + continue; + } + + if (propSecretKey.TryReadProperty(ref reader, options, PropSecretKey, null)) + { + continue; + } + + if (propTargetContainerHostname.TryReadProperty(ref reader, options, PropTargetContainerHostname, null)) + { + continue; + } + + if (propTargetModel.TryReadProperty(ref reader, options, PropTargetModel, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AccessKey = propAccessKey.Value, + Api = propApi.Value, + BatchSize = propBatchSize.Value, + Dimensions = propDimensions.Value, + EndpointName = propEndpointName.Value, + InferenceComponentName = propInferenceComponentName.Value, + Region = propRegion.Value, + SecretKey = propSecretKey.Value, + TargetContainerHostname = propTargetContainerHostname.Value, + TargetModel = propTargetModel.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerServiceSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAccessKey, value.AccessKey, null, null); + writer.WriteProperty(options, PropApi, value.Api, null, null); + writer.WriteProperty(options, PropBatchSize, value.BatchSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDimensions, value.Dimensions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEndpointName, value.EndpointName, null, null); + writer.WriteProperty(options, PropInferenceComponentName, value.InferenceComponentName, null, null); + writer.WriteProperty(options, PropRegion, value.Region, null, null); + writer.WriteProperty(options, PropSecretKey, value.SecretKey, null, null); + writer.WriteProperty(options, PropTargetContainerHostname, value.TargetContainerHostname, null, null); + writer.WriteProperty(options, PropTargetModel, value.TargetModel, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonSageMakerServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonSageMakerServiceSettings.g.cs index 3fa710e92d7..912ddf4f791 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonSageMakerServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonSageMakerServiceSettings.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class AmazonSageMakerServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAccessKey = System.Text.Json.JsonEncodedText.Encode("access_key"); - private static readonly System.Text.Json.JsonEncodedText PropApi = System.Text.Json.JsonEncodedText.Encode("api"); - private static readonly System.Text.Json.JsonEncodedText PropBatchSize = System.Text.Json.JsonEncodedText.Encode("batch_size"); - private static readonly System.Text.Json.JsonEncodedText PropDimensions = System.Text.Json.JsonEncodedText.Encode("dimensions"); - private static readonly System.Text.Json.JsonEncodedText PropEndpointName = System.Text.Json.JsonEncodedText.Encode("endpoint_name"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceComponentName = System.Text.Json.JsonEncodedText.Encode("inference_component_name"); - private static readonly System.Text.Json.JsonEncodedText PropRegion = System.Text.Json.JsonEncodedText.Encode("region"); - private static readonly System.Text.Json.JsonEncodedText PropSecretKey = System.Text.Json.JsonEncodedText.Encode("secret_key"); - private static readonly System.Text.Json.JsonEncodedText PropTargetContainerHostname = System.Text.Json.JsonEncodedText.Encode("target_container_hostname"); - private static readonly System.Text.Json.JsonEncodedText PropTargetModel = System.Text.Json.JsonEncodedText.Encode("target_model"); - - public override Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAccessKey = default; - LocalJsonValue propApi = default; - LocalJsonValue propBatchSize = default; - LocalJsonValue propDimensions = default; - LocalJsonValue propEndpointName = default; - LocalJsonValue propInferenceComponentName = default; - LocalJsonValue propRegion = default; - LocalJsonValue propSecretKey = default; - LocalJsonValue propTargetContainerHostname = default; - LocalJsonValue propTargetModel = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAccessKey.TryReadProperty(ref reader, options, PropAccessKey, null)) - { - continue; - } - - if (propApi.TryReadProperty(ref reader, options, PropApi, null)) - { - continue; - } - - if (propBatchSize.TryReadProperty(ref reader, options, PropBatchSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDimensions.TryReadProperty(ref reader, options, PropDimensions, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEndpointName.TryReadProperty(ref reader, options, PropEndpointName, null)) - { - continue; - } - - if (propInferenceComponentName.TryReadProperty(ref reader, options, PropInferenceComponentName, null)) - { - continue; - } - - if (propRegion.TryReadProperty(ref reader, options, PropRegion, null)) - { - continue; - } - - if (propSecretKey.TryReadProperty(ref reader, options, PropSecretKey, null)) - { - continue; - } - - if (propTargetContainerHostname.TryReadProperty(ref reader, options, PropTargetContainerHostname, null)) - { - continue; - } - - if (propTargetModel.TryReadProperty(ref reader, options, PropTargetModel, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AccessKey = propAccessKey.Value, - Api = propApi.Value, - BatchSize = propBatchSize.Value, - Dimensions = propDimensions.Value, - EndpointName = propEndpointName.Value, - InferenceComponentName = propInferenceComponentName.Value, - Region = propRegion.Value, - SecretKey = propSecretKey.Value, - TargetContainerHostname = propTargetContainerHostname.Value, - TargetModel = propTargetModel.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerServiceSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAccessKey, value.AccessKey, null, null); - writer.WriteProperty(options, PropApi, value.Api, null, null); - writer.WriteProperty(options, PropBatchSize, value.BatchSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDimensions, value.Dimensions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEndpointName, value.EndpointName, null, null); - writer.WriteProperty(options, PropInferenceComponentName, value.InferenceComponentName, null, null); - writer.WriteProperty(options, PropRegion, value.Region, null, null); - writer.WriteProperty(options, PropSecretKey, value.SecretKey, null, null); - writer.WriteProperty(options, PropTargetContainerHostname, value.TargetContainerHostname, null, null); - writer.WriteProperty(options, PropTargetModel, value.TargetModel, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerServiceSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.AmazonSageMakerServiceSettingsConverter))] public sealed partial class AmazonSageMakerServiceSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonSageMakerTaskSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonSageMakerTaskSettings.Converters.g.cs new file mode 100644 index 00000000000..0a0994cae19 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonSageMakerTaskSettings.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class AmazonSageMakerTaskSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCustomAttributes = System.Text.Json.JsonEncodedText.Encode("custom_attributes"); + private static readonly System.Text.Json.JsonEncodedText PropEnableExplanations = System.Text.Json.JsonEncodedText.Encode("enable_explanations"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropSessionId = System.Text.Json.JsonEncodedText.Encode("session_id"); + private static readonly System.Text.Json.JsonEncodedText PropTargetVariant = System.Text.Json.JsonEncodedText.Encode("target_variant"); + + public override Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerTaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCustomAttributes = default; + LocalJsonValue propEnableExplanations = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propSessionId = default; + LocalJsonValue propTargetVariant = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCustomAttributes.TryReadProperty(ref reader, options, PropCustomAttributes, null)) + { + continue; + } + + if (propEnableExplanations.TryReadProperty(ref reader, options, PropEnableExplanations, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propSessionId.TryReadProperty(ref reader, options, PropSessionId, null)) + { + continue; + } + + if (propTargetVariant.TryReadProperty(ref reader, options, PropTargetVariant, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerTaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CustomAttributes = propCustomAttributes.Value, + EnableExplanations = propEnableExplanations.Value, + InferenceId = propInferenceId.Value, + SessionId = propSessionId.Value, + TargetVariant = propTargetVariant.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerTaskSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCustomAttributes, value.CustomAttributes, null, null); + writer.WriteProperty(options, PropEnableExplanations, value.EnableExplanations, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropSessionId, value.SessionId, null, null); + writer.WriteProperty(options, PropTargetVariant, value.TargetVariant, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonSageMakerTaskSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonSageMakerTaskSettings.g.cs index 24d4c922e28..7f5bf45a45b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonSageMakerTaskSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AmazonSageMakerTaskSettings.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class AmazonSageMakerTaskSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCustomAttributes = System.Text.Json.JsonEncodedText.Encode("custom_attributes"); - private static readonly System.Text.Json.JsonEncodedText PropEnableExplanations = System.Text.Json.JsonEncodedText.Encode("enable_explanations"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropSessionId = System.Text.Json.JsonEncodedText.Encode("session_id"); - private static readonly System.Text.Json.JsonEncodedText PropTargetVariant = System.Text.Json.JsonEncodedText.Encode("target_variant"); - - public override Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerTaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCustomAttributes = default; - LocalJsonValue propEnableExplanations = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue propSessionId = default; - LocalJsonValue propTargetVariant = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCustomAttributes.TryReadProperty(ref reader, options, PropCustomAttributes, null)) - { - continue; - } - - if (propEnableExplanations.TryReadProperty(ref reader, options, PropEnableExplanations, null)) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propSessionId.TryReadProperty(ref reader, options, PropSessionId, null)) - { - continue; - } - - if (propTargetVariant.TryReadProperty(ref reader, options, PropTargetVariant, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerTaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CustomAttributes = propCustomAttributes.Value, - EnableExplanations = propEnableExplanations.Value, - InferenceId = propInferenceId.Value, - SessionId = propSessionId.Value, - TargetVariant = propTargetVariant.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerTaskSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCustomAttributes, value.CustomAttributes, null, null); - writer.WriteProperty(options, PropEnableExplanations, value.EnableExplanations, null, null); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropSessionId, value.SessionId, null, null); - writer.WriteProperty(options, PropTargetVariant, value.TargetVariant, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.AmazonSageMakerTaskSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.AmazonSageMakerTaskSettingsConverter))] public sealed partial class AmazonSageMakerTaskSettings { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AnthropicServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AnthropicServiceSettings.Converters.g.cs new file mode 100644 index 00000000000..caf0f7b36fc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AnthropicServiceSettings.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class AnthropicServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); + private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); + private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); + + public override Elastic.Clients.Elasticsearch.Inference.AnthropicServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApiKey = default; + LocalJsonValue propModelId = default; + LocalJsonValue propRateLimit = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) + { + continue; + } + + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) + { + continue; + } + + if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.AnthropicServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ApiKey = propApiKey.Value, + ModelId = propModelId.Value, + RateLimit = propRateLimit.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AnthropicServiceSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); + writer.WriteProperty(options, PropModelId, value.ModelId, null, null); + writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AnthropicServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AnthropicServiceSettings.g.cs index 82db6ae2258..9600ed9a6e8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AnthropicServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AnthropicServiceSettings.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class AnthropicServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); - private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); - private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); - - public override Elastic.Clients.Elasticsearch.Inference.AnthropicServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propApiKey = default; - LocalJsonValue propModelId = default; - LocalJsonValue propRateLimit = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) - { - continue; - } - - if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) - { - continue; - } - - if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.AnthropicServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ApiKey = propApiKey.Value, - ModelId = propModelId.Value, - RateLimit = propRateLimit.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AnthropicServiceSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); - writer.WriteProperty(options, PropModelId, value.ModelId, null, null); - writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.AnthropicServiceSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.AnthropicServiceSettingsConverter))] public sealed partial class AnthropicServiceSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AnthropicTaskSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AnthropicTaskSettings.Converters.g.cs new file mode 100644 index 00000000000..c05b347e619 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AnthropicTaskSettings.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class AnthropicTaskSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxTokens = System.Text.Json.JsonEncodedText.Encode("max_tokens"); + private static readonly System.Text.Json.JsonEncodedText PropTemperature = System.Text.Json.JsonEncodedText.Encode("temperature"); + private static readonly System.Text.Json.JsonEncodedText PropTopK = System.Text.Json.JsonEncodedText.Encode("top_k"); + private static readonly System.Text.Json.JsonEncodedText PropTopP = System.Text.Json.JsonEncodedText.Encode("top_p"); + + public override Elastic.Clients.Elasticsearch.Inference.AnthropicTaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxTokens = default; + LocalJsonValue propTemperature = default; + LocalJsonValue propTopK = default; + LocalJsonValue propTopP = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxTokens.TryReadProperty(ref reader, options, PropMaxTokens, null)) + { + continue; + } + + if (propTemperature.TryReadProperty(ref reader, options, PropTemperature, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTopK.TryReadProperty(ref reader, options, PropTopK, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTopP.TryReadProperty(ref reader, options, PropTopP, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.AnthropicTaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxTokens = propMaxTokens.Value, + Temperature = propTemperature.Value, + TopK = propTopK.Value, + TopP = propTopP.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AnthropicTaskSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxTokens, value.MaxTokens, null, null); + writer.WriteProperty(options, PropTemperature, value.Temperature, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTopK, value.TopK, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTopP, value.TopP, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AnthropicTaskSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AnthropicTaskSettings.g.cs index cddb0d47054..060fa7a41d1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AnthropicTaskSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AnthropicTaskSettings.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class AnthropicTaskSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxTokens = System.Text.Json.JsonEncodedText.Encode("max_tokens"); - private static readonly System.Text.Json.JsonEncodedText PropTemperature = System.Text.Json.JsonEncodedText.Encode("temperature"); - private static readonly System.Text.Json.JsonEncodedText PropTopK = System.Text.Json.JsonEncodedText.Encode("top_k"); - private static readonly System.Text.Json.JsonEncodedText PropTopP = System.Text.Json.JsonEncodedText.Encode("top_p"); - - public override Elastic.Clients.Elasticsearch.Inference.AnthropicTaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxTokens = default; - LocalJsonValue propTemperature = default; - LocalJsonValue propTopK = default; - LocalJsonValue propTopP = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxTokens.TryReadProperty(ref reader, options, PropMaxTokens, null)) - { - continue; - } - - if (propTemperature.TryReadProperty(ref reader, options, PropTemperature, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTopK.TryReadProperty(ref reader, options, PropTopK, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTopP.TryReadProperty(ref reader, options, PropTopP, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.AnthropicTaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxTokens = propMaxTokens.Value, - Temperature = propTemperature.Value, - TopK = propTopK.Value, - TopP = propTopP.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AnthropicTaskSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxTokens, value.MaxTokens, null, null); - writer.WriteProperty(options, PropTemperature, value.Temperature, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTopK, value.TopK, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTopP, value.TopP, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.AnthropicTaskSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.AnthropicTaskSettingsConverter))] public sealed partial class AnthropicTaskSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AnthropicTaskType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AnthropicTaskType.Converters.g.cs new file mode 100644 index 00000000000..fb5fb1b76e3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AnthropicTaskType.Converters.g.cs @@ -0,0 +1,67 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class AnthropicTaskTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + + public override Elastic.Clients.Elasticsearch.Inference.AnthropicTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.AnthropicTaskType.Completion; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.AnthropicTaskType.Completion; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.AnthropicTaskType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AnthropicTaskType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.AnthropicTaskType.Completion: + writer.WriteStringValue(MemberCompletion); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.AnthropicTaskType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.AnthropicTaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AnthropicTaskType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AnthropicTaskType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AnthropicTaskType.g.cs new file mode 100644 index 00000000000..20416b3a416 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AnthropicTaskType.g.cs @@ -0,0 +1,31 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.AnthropicTaskTypeConverter))] +public enum AnthropicTaskType +{ + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureAiStudioServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureAiStudioServiceSettings.Converters.g.cs new file mode 100644 index 00000000000..d520b85ac06 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureAiStudioServiceSettings.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class AzureAiStudioServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); + private static readonly System.Text.Json.JsonEncodedText PropEndpointType = System.Text.Json.JsonEncodedText.Encode("endpoint_type"); + private static readonly System.Text.Json.JsonEncodedText PropProvider = System.Text.Json.JsonEncodedText.Encode("provider"); + private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); + private static readonly System.Text.Json.JsonEncodedText PropTarget = System.Text.Json.JsonEncodedText.Encode("target"); + + public override Elastic.Clients.Elasticsearch.Inference.AzureAiStudioServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApiKey = default; + LocalJsonValue propEndpointType = default; + LocalJsonValue propProvider = default; + LocalJsonValue propRateLimit = default; + LocalJsonValue propTarget = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) + { + continue; + } + + if (propEndpointType.TryReadProperty(ref reader, options, PropEndpointType, null)) + { + continue; + } + + if (propProvider.TryReadProperty(ref reader, options, PropProvider, null)) + { + continue; + } + + if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) + { + continue; + } + + if (propTarget.TryReadProperty(ref reader, options, PropTarget, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.AzureAiStudioServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ApiKey = propApiKey.Value, + EndpointType = propEndpointType.Value, + Provider = propProvider.Value, + RateLimit = propRateLimit.Value, + Target = propTarget.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AzureAiStudioServiceSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); + writer.WriteProperty(options, PropEndpointType, value.EndpointType, null, null); + writer.WriteProperty(options, PropProvider, value.Provider, null, null); + writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); + writer.WriteProperty(options, PropTarget, value.Target, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureAiStudioServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureAiStudioServiceSettings.g.cs index 1b990fb566f..65c5eed9d75 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureAiStudioServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureAiStudioServiceSettings.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class AzureAiStudioServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); - private static readonly System.Text.Json.JsonEncodedText PropEndpointType = System.Text.Json.JsonEncodedText.Encode("endpoint_type"); - private static readonly System.Text.Json.JsonEncodedText PropProvider = System.Text.Json.JsonEncodedText.Encode("provider"); - private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); - private static readonly System.Text.Json.JsonEncodedText PropTarget = System.Text.Json.JsonEncodedText.Encode("target"); - - public override Elastic.Clients.Elasticsearch.Inference.AzureAiStudioServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propApiKey = default; - LocalJsonValue propEndpointType = default; - LocalJsonValue propProvider = default; - LocalJsonValue propRateLimit = default; - LocalJsonValue propTarget = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) - { - continue; - } - - if (propEndpointType.TryReadProperty(ref reader, options, PropEndpointType, null)) - { - continue; - } - - if (propProvider.TryReadProperty(ref reader, options, PropProvider, null)) - { - continue; - } - - if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) - { - continue; - } - - if (propTarget.TryReadProperty(ref reader, options, PropTarget, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.AzureAiStudioServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ApiKey = propApiKey.Value, - EndpointType = propEndpointType.Value, - Provider = propProvider.Value, - RateLimit = propRateLimit.Value, - Target = propTarget.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AzureAiStudioServiceSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); - writer.WriteProperty(options, PropEndpointType, value.EndpointType, null, null); - writer.WriteProperty(options, PropProvider, value.Provider, null, null); - writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); - writer.WriteProperty(options, PropTarget, value.Target, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.AzureAiStudioServiceSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.AzureAiStudioServiceSettingsConverter))] public sealed partial class AzureAiStudioServiceSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureAiStudioTaskSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureAiStudioTaskSettings.Converters.g.cs new file mode 100644 index 00000000000..f72fffda659 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureAiStudioTaskSettings.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class AzureAiStudioTaskSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDoSample = System.Text.Json.JsonEncodedText.Encode("do_sample"); + private static readonly System.Text.Json.JsonEncodedText PropMaxNewTokens = System.Text.Json.JsonEncodedText.Encode("max_new_tokens"); + private static readonly System.Text.Json.JsonEncodedText PropReturnDocuments = System.Text.Json.JsonEncodedText.Encode("return_documents"); + private static readonly System.Text.Json.JsonEncodedText PropTemperature = System.Text.Json.JsonEncodedText.Encode("temperature"); + private static readonly System.Text.Json.JsonEncodedText PropTopN = System.Text.Json.JsonEncodedText.Encode("top_n"); + private static readonly System.Text.Json.JsonEncodedText PropTopP = System.Text.Json.JsonEncodedText.Encode("top_p"); + private static readonly System.Text.Json.JsonEncodedText PropUser = System.Text.Json.JsonEncodedText.Encode("user"); + + public override Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDoSample = default; + LocalJsonValue propMaxNewTokens = default; + LocalJsonValue propReturnDocuments = default; + LocalJsonValue propTemperature = default; + LocalJsonValue propTopN = default; + LocalJsonValue propTopP = default; + LocalJsonValue propUser = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDoSample.TryReadProperty(ref reader, options, PropDoSample, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxNewTokens.TryReadProperty(ref reader, options, PropMaxNewTokens, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propReturnDocuments.TryReadProperty(ref reader, options, PropReturnDocuments, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTemperature.TryReadProperty(ref reader, options, PropTemperature, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTopN.TryReadProperty(ref reader, options, PropTopN, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTopP.TryReadProperty(ref reader, options, PropTopP, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propUser.TryReadProperty(ref reader, options, PropUser, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DoSample = propDoSample.Value, + MaxNewTokens = propMaxNewTokens.Value, + ReturnDocuments = propReturnDocuments.Value, + Temperature = propTemperature.Value, + TopN = propTopN.Value, + TopP = propTopP.Value, + User = propUser.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDoSample, value.DoSample, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxNewTokens, value.MaxNewTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropReturnDocuments, value.ReturnDocuments, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTemperature, value.Temperature, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTopN, value.TopN, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTopP, value.TopP, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropUser, value.User, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureAiStudioTaskSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureAiStudioTaskSettings.g.cs index 0f1856e19ff..2d83dafbb59 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureAiStudioTaskSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureAiStudioTaskSettings.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class AzureAiStudioTaskSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDoSample = System.Text.Json.JsonEncodedText.Encode("do_sample"); - private static readonly System.Text.Json.JsonEncodedText PropMaxNewTokens = System.Text.Json.JsonEncodedText.Encode("max_new_tokens"); - private static readonly System.Text.Json.JsonEncodedText PropReturnDocuments = System.Text.Json.JsonEncodedText.Encode("return_documents"); - private static readonly System.Text.Json.JsonEncodedText PropTemperature = System.Text.Json.JsonEncodedText.Encode("temperature"); - private static readonly System.Text.Json.JsonEncodedText PropTopN = System.Text.Json.JsonEncodedText.Encode("top_n"); - private static readonly System.Text.Json.JsonEncodedText PropTopP = System.Text.Json.JsonEncodedText.Encode("top_p"); - private static readonly System.Text.Json.JsonEncodedText PropUser = System.Text.Json.JsonEncodedText.Encode("user"); - - public override Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDoSample = default; - LocalJsonValue propMaxNewTokens = default; - LocalJsonValue propReturnDocuments = default; - LocalJsonValue propTemperature = default; - LocalJsonValue propTopN = default; - LocalJsonValue propTopP = default; - LocalJsonValue propUser = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDoSample.TryReadProperty(ref reader, options, PropDoSample, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxNewTokens.TryReadProperty(ref reader, options, PropMaxNewTokens, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propReturnDocuments.TryReadProperty(ref reader, options, PropReturnDocuments, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTemperature.TryReadProperty(ref reader, options, PropTemperature, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTopN.TryReadProperty(ref reader, options, PropTopN, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTopP.TryReadProperty(ref reader, options, PropTopP, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propUser.TryReadProperty(ref reader, options, PropUser, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DoSample = propDoSample.Value, - MaxNewTokens = propMaxNewTokens.Value, - ReturnDocuments = propReturnDocuments.Value, - Temperature = propTemperature.Value, - TopN = propTopN.Value, - TopP = propTopP.Value, - User = propUser.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDoSample, value.DoSample, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxNewTokens, value.MaxNewTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropReturnDocuments, value.ReturnDocuments, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTemperature, value.Temperature, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTopN, value.TopN, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTopP, value.TopP, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropUser, value.User, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.AzureAiStudioTaskSettingsConverter))] public sealed partial class AzureAiStudioTaskSettings { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureAiStudioTaskType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureAiStudioTaskType.Converters.g.cs new file mode 100644 index 00000000000..03d6ef28c89 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureAiStudioTaskType.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class AzureAiStudioTaskTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType.Completion; + } + + if (reader.ValueTextEquals(MemberRerank)) + { + return Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType.Rerank; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType.Completion; + } + + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType.Rerank; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType.Rerank: + writer.WriteStringValue(MemberRerank); + break; + case Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AzureAiStudioTaskType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureAiStudioTaskType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureAiStudioTaskType.g.cs new file mode 100644 index 00000000000..638b55ccbe1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureAiStudioTaskType.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.AzureAiStudioTaskTypeConverter))] +public enum AzureAiStudioTaskType +{ + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "rerank")] + Rerank, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAIServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAIServiceSettings.Converters.g.cs new file mode 100644 index 00000000000..1d0387563ba --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAIServiceSettings.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class AzureOpenAIServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); + private static readonly System.Text.Json.JsonEncodedText PropApiVersion = System.Text.Json.JsonEncodedText.Encode("api_version"); + private static readonly System.Text.Json.JsonEncodedText PropDeploymentId = System.Text.Json.JsonEncodedText.Encode("deployment_id"); + private static readonly System.Text.Json.JsonEncodedText PropEntraId = System.Text.Json.JsonEncodedText.Encode("entra_id"); + private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); + private static readonly System.Text.Json.JsonEncodedText PropResourceName = System.Text.Json.JsonEncodedText.Encode("resource_name"); + + public override Elastic.Clients.Elasticsearch.Inference.AzureOpenAIServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApiKey = default; + LocalJsonValue propApiVersion = default; + LocalJsonValue propDeploymentId = default; + LocalJsonValue propEntraId = default; + LocalJsonValue propRateLimit = default; + LocalJsonValue propResourceName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) + { + continue; + } + + if (propApiVersion.TryReadProperty(ref reader, options, PropApiVersion, null)) + { + continue; + } + + if (propDeploymentId.TryReadProperty(ref reader, options, PropDeploymentId, null)) + { + continue; + } + + if (propEntraId.TryReadProperty(ref reader, options, PropEntraId, null)) + { + continue; + } + + if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) + { + continue; + } + + if (propResourceName.TryReadProperty(ref reader, options, PropResourceName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.AzureOpenAIServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ApiKey = propApiKey.Value, + ApiVersion = propApiVersion.Value, + DeploymentId = propDeploymentId.Value, + EntraId = propEntraId.Value, + RateLimit = propRateLimit.Value, + ResourceName = propResourceName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AzureOpenAIServiceSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); + writer.WriteProperty(options, PropApiVersion, value.ApiVersion, null, null); + writer.WriteProperty(options, PropDeploymentId, value.DeploymentId, null, null); + writer.WriteProperty(options, PropEntraId, value.EntraId, null, null); + writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); + writer.WriteProperty(options, PropResourceName, value.ResourceName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAIServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAIServiceSettings.g.cs index 57847cc9e84..d15723e7ecc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAIServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAIServiceSettings.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class AzureOpenAIServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); - private static readonly System.Text.Json.JsonEncodedText PropApiVersion = System.Text.Json.JsonEncodedText.Encode("api_version"); - private static readonly System.Text.Json.JsonEncodedText PropDeploymentId = System.Text.Json.JsonEncodedText.Encode("deployment_id"); - private static readonly System.Text.Json.JsonEncodedText PropEntraId = System.Text.Json.JsonEncodedText.Encode("entra_id"); - private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); - private static readonly System.Text.Json.JsonEncodedText PropResourceName = System.Text.Json.JsonEncodedText.Encode("resource_name"); - - public override Elastic.Clients.Elasticsearch.Inference.AzureOpenAIServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propApiKey = default; - LocalJsonValue propApiVersion = default; - LocalJsonValue propDeploymentId = default; - LocalJsonValue propEntraId = default; - LocalJsonValue propRateLimit = default; - LocalJsonValue propResourceName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) - { - continue; - } - - if (propApiVersion.TryReadProperty(ref reader, options, PropApiVersion, null)) - { - continue; - } - - if (propDeploymentId.TryReadProperty(ref reader, options, PropDeploymentId, null)) - { - continue; - } - - if (propEntraId.TryReadProperty(ref reader, options, PropEntraId, null)) - { - continue; - } - - if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) - { - continue; - } - - if (propResourceName.TryReadProperty(ref reader, options, PropResourceName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.AzureOpenAIServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ApiKey = propApiKey.Value, - ApiVersion = propApiVersion.Value, - DeploymentId = propDeploymentId.Value, - EntraId = propEntraId.Value, - RateLimit = propRateLimit.Value, - ResourceName = propResourceName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AzureOpenAIServiceSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); - writer.WriteProperty(options, PropApiVersion, value.ApiVersion, null, null); - writer.WriteProperty(options, PropDeploymentId, value.DeploymentId, null, null); - writer.WriteProperty(options, PropEntraId, value.EntraId, null, null); - writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); - writer.WriteProperty(options, PropResourceName, value.ResourceName, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.AzureOpenAIServiceSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.AzureOpenAIServiceSettingsConverter))] public sealed partial class AzureOpenAIServiceSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAITaskSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAITaskSettings.Converters.g.cs new file mode 100644 index 00000000000..e5907c20aa8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAITaskSettings.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class AzureOpenAITaskSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropUser = System.Text.Json.JsonEncodedText.Encode("user"); + + public override Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propUser = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propUser.TryReadProperty(ref reader, options, PropUser, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + User = propUser.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropUser, value.User, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAITaskSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAITaskSettings.g.cs index 03aca0eec46..dc78a0007a6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAITaskSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAITaskSettings.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class AzureOpenAITaskSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropUser = System.Text.Json.JsonEncodedText.Encode("user"); - - public override Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propUser = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propUser.TryReadProperty(ref reader, options, PropUser, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - User = propUser.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropUser, value.User, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.AzureOpenAITaskSettingsConverter))] public sealed partial class AzureOpenAITaskSettings { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAITaskType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAITaskType.Converters.g.cs new file mode 100644 index 00000000000..f3915c9af83 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAITaskType.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class AzureOpenAITaskTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskType.Completion; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskType.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskType.Completion; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskType.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskType.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskType.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAITaskType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAITaskType.g.cs new file mode 100644 index 00000000000..a39376d97a5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAITaskType.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.AzureOpenAITaskTypeConverter))] +public enum AzureOpenAITaskType +{ + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereEmbeddingType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereEmbeddingType.Converters.g.cs new file mode 100644 index 00000000000..e7b5e1f6e4e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereEmbeddingType.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class CohereEmbeddingTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberBinary = System.Text.Json.JsonEncodedText.Encode("binary"); + private static readonly System.Text.Json.JsonEncodedText MemberBit = System.Text.Json.JsonEncodedText.Encode("bit"); + private static readonly System.Text.Json.JsonEncodedText MemberByte = System.Text.Json.JsonEncodedText.Encode("byte"); + private static readonly System.Text.Json.JsonEncodedText MemberFloat = System.Text.Json.JsonEncodedText.Encode("float"); + private static readonly System.Text.Json.JsonEncodedText MemberInt8 = System.Text.Json.JsonEncodedText.Encode("int8"); + + public override Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberBinary)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Binary; + } + + if (reader.ValueTextEquals(MemberBit)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Bit; + } + + if (reader.ValueTextEquals(MemberByte)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Byte; + } + + if (reader.ValueTextEquals(MemberFloat)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Float; + } + + if (reader.ValueTextEquals(MemberInt8)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Int8; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberBinary.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Binary; + } + + if (string.Equals(value, MemberBit.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Bit; + } + + if (string.Equals(value, MemberByte.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Byte; + } + + if (string.Equals(value, MemberFloat.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Float; + } + + if (string.Equals(value, MemberInt8.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Int8; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Binary: + writer.WriteStringValue(MemberBinary); + break; + case Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Bit: + writer.WriteStringValue(MemberBit); + break; + case Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Byte: + writer.WriteStringValue(MemberByte); + break; + case Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Float: + writer.WriteStringValue(MemberFloat); + break; + case Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType.Int8: + writer.WriteStringValue(MemberInt8); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereEmbeddingType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereEmbeddingType.g.cs new file mode 100644 index 00000000000..9457416ce16 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereEmbeddingType.g.cs @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.CohereEmbeddingTypeConverter))] +public enum CohereEmbeddingType +{ + [System.Runtime.Serialization.EnumMember(Value = "binary")] + Binary, + [System.Runtime.Serialization.EnumMember(Value = "bit")] + Bit, + [System.Runtime.Serialization.EnumMember(Value = "byte")] + Byte, + [System.Runtime.Serialization.EnumMember(Value = "float")] + Float, + [System.Runtime.Serialization.EnumMember(Value = "int8")] + Int8 +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereInputType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereInputType.Converters.g.cs new file mode 100644 index 00000000000..aea7d918854 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereInputType.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class CohereInputTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberClassification = System.Text.Json.JsonEncodedText.Encode("classification"); + private static readonly System.Text.Json.JsonEncodedText MemberClustering = System.Text.Json.JsonEncodedText.Encode("clustering"); + private static readonly System.Text.Json.JsonEncodedText MemberIngest = System.Text.Json.JsonEncodedText.Encode("ingest"); + private static readonly System.Text.Json.JsonEncodedText MemberSearch = System.Text.Json.JsonEncodedText.Encode("search"); + + public override Elastic.Clients.Elasticsearch.Inference.CohereInputType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberClassification)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereInputType.Classification; + } + + if (reader.ValueTextEquals(MemberClustering)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereInputType.Clustering; + } + + if (reader.ValueTextEquals(MemberIngest)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereInputType.Ingest; + } + + if (reader.ValueTextEquals(MemberSearch)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereInputType.Search; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberClassification.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereInputType.Classification; + } + + if (string.Equals(value, MemberClustering.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereInputType.Clustering; + } + + if (string.Equals(value, MemberIngest.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereInputType.Ingest; + } + + if (string.Equals(value, MemberSearch.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereInputType.Search; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.CohereInputType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CohereInputType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.CohereInputType.Classification: + writer.WriteStringValue(MemberClassification); + break; + case Elastic.Clients.Elasticsearch.Inference.CohereInputType.Clustering: + writer.WriteStringValue(MemberClustering); + break; + case Elastic.Clients.Elasticsearch.Inference.CohereInputType.Ingest: + writer.WriteStringValue(MemberIngest); + break; + case Elastic.Clients.Elasticsearch.Inference.CohereInputType.Search: + writer.WriteStringValue(MemberSearch); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.CohereInputType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.CohereInputType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CohereInputType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereInputType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereInputType.g.cs new file mode 100644 index 00000000000..cb3a90b35d9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereInputType.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.CohereInputTypeConverter))] +public enum CohereInputType +{ + [System.Runtime.Serialization.EnumMember(Value = "classification")] + Classification, + [System.Runtime.Serialization.EnumMember(Value = "clustering")] + Clustering, + [System.Runtime.Serialization.EnumMember(Value = "ingest")] + Ingest, + [System.Runtime.Serialization.EnumMember(Value = "search")] + Search +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereServiceSettings.Converters.g.cs new file mode 100644 index 00000000000..1f8c8798175 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereServiceSettings.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class CohereServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); + private static readonly System.Text.Json.JsonEncodedText PropEmbeddingType = System.Text.Json.JsonEncodedText.Encode("embedding_type"); + private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); + private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); + private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); + + public override Elastic.Clients.Elasticsearch.Inference.CohereServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApiKey = default; + LocalJsonValue propEmbeddingType = default; + LocalJsonValue propModelId = default; + LocalJsonValue propRateLimit = default; + LocalJsonValue propSimilarity = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) + { + continue; + } + + if (propEmbeddingType.TryReadProperty(ref reader, options, PropEmbeddingType, static Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) + { + continue; + } + + if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) + { + continue; + } + + if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, static Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.CohereServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ApiKey = propApiKey.Value, + EmbeddingType = propEmbeddingType.Value, + ModelId = propModelId.Value, + RateLimit = propRateLimit.Value, + Similarity = propSimilarity.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CohereServiceSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); + writer.WriteProperty(options, PropEmbeddingType, value.EmbeddingType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropModelId, value.ModelId, null, null); + writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); + writer.WriteProperty(options, PropSimilarity, value.Similarity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereServiceSettings.g.cs index 5c9f0a08a08..7f38933b82f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereServiceSettings.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class CohereServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); - private static readonly System.Text.Json.JsonEncodedText PropEmbeddingType = System.Text.Json.JsonEncodedText.Encode("embedding_type"); - private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); - private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); - private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); - - public override Elastic.Clients.Elasticsearch.Inference.CohereServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propApiKey = default; - LocalJsonValue propEmbeddingType = default; - LocalJsonValue propModelId = default; - LocalJsonValue propRateLimit = default; - LocalJsonValue propSimilarity = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) - { - continue; - } - - if (propEmbeddingType.TryReadProperty(ref reader, options, PropEmbeddingType, static Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) - { - continue; - } - - if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) - { - continue; - } - - if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, static Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.CohereServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ApiKey = propApiKey.Value, - EmbeddingType = propEmbeddingType.Value, - ModelId = propModelId.Value, - RateLimit = propRateLimit.Value, - Similarity = propSimilarity.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CohereServiceSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); - writer.WriteProperty(options, PropEmbeddingType, value.EmbeddingType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Inference.CohereEmbeddingType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropModelId, value.ModelId, null, null); - writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); - writer.WriteProperty(options, PropSimilarity, value.Similarity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.CohereServiceSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.CohereServiceSettingsConverter))] public sealed partial class CohereServiceSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereSimilarityType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereSimilarityType.Converters.g.cs new file mode 100644 index 00000000000..ba4f8b34565 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereSimilarityType.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class CohereSimilarityTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCosine = System.Text.Json.JsonEncodedText.Encode("cosine"); + private static readonly System.Text.Json.JsonEncodedText MemberDotProduct = System.Text.Json.JsonEncodedText.Encode("dot_product"); + private static readonly System.Text.Json.JsonEncodedText MemberL2Norm = System.Text.Json.JsonEncodedText.Encode("l2_norm"); + + public override Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCosine)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType.Cosine; + } + + if (reader.ValueTextEquals(MemberDotProduct)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType.DotProduct; + } + + if (reader.ValueTextEquals(MemberL2Norm)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType.L2Norm; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCosine.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType.Cosine; + } + + if (string.Equals(value, MemberDotProduct.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType.DotProduct; + } + + if (string.Equals(value, MemberL2Norm.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType.L2Norm; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType.Cosine: + writer.WriteStringValue(MemberCosine); + break; + case Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType.DotProduct: + writer.WriteStringValue(MemberDotProduct); + break; + case Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType.L2Norm: + writer.WriteStringValue(MemberL2Norm); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CohereSimilarityType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereSimilarityType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereSimilarityType.g.cs new file mode 100644 index 00000000000..8d99d64aed8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereSimilarityType.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.CohereSimilarityTypeConverter))] +public enum CohereSimilarityType +{ + [System.Runtime.Serialization.EnumMember(Value = "cosine")] + Cosine, + [System.Runtime.Serialization.EnumMember(Value = "dot_product")] + DotProduct, + [System.Runtime.Serialization.EnumMember(Value = "l2_norm")] + L2Norm +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereTaskSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereTaskSettings.Converters.g.cs new file mode 100644 index 00000000000..d1e552576a8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereTaskSettings.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class CohereTaskSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropInputType = System.Text.Json.JsonEncodedText.Encode("input_type"); + private static readonly System.Text.Json.JsonEncodedText PropReturnDocuments = System.Text.Json.JsonEncodedText.Encode("return_documents"); + private static readonly System.Text.Json.JsonEncodedText PropTopN = System.Text.Json.JsonEncodedText.Encode("top_n"); + private static readonly System.Text.Json.JsonEncodedText PropTruncate = System.Text.Json.JsonEncodedText.Encode("truncate"); + + public override Elastic.Clients.Elasticsearch.Inference.CohereTaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propInputType = default; + LocalJsonValue propReturnDocuments = default; + LocalJsonValue propTopN = default; + LocalJsonValue propTruncate = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propInputType.TryReadProperty(ref reader, options, PropInputType, null)) + { + continue; + } + + if (propReturnDocuments.TryReadProperty(ref reader, options, PropReturnDocuments, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTopN.TryReadProperty(ref reader, options, PropTopN, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTruncate.TryReadProperty(ref reader, options, PropTruncate, static Elastic.Clients.Elasticsearch.Inference.CohereTruncateType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.CohereTaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + InputType = propInputType.Value, + ReturnDocuments = propReturnDocuments.Value, + TopN = propTopN.Value, + Truncate = propTruncate.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CohereTaskSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropInputType, value.InputType, null, null); + writer.WriteProperty(options, PropReturnDocuments, value.ReturnDocuments, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTopN, value.TopN, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTruncate, value.Truncate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Inference.CohereTruncateType? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereTaskSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereTaskSettings.g.cs index b2770b6c076..df26c9e5521 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereTaskSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereTaskSettings.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class CohereTaskSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropInputType = System.Text.Json.JsonEncodedText.Encode("input_type"); - private static readonly System.Text.Json.JsonEncodedText PropReturnDocuments = System.Text.Json.JsonEncodedText.Encode("return_documents"); - private static readonly System.Text.Json.JsonEncodedText PropTopN = System.Text.Json.JsonEncodedText.Encode("top_n"); - private static readonly System.Text.Json.JsonEncodedText PropTruncate = System.Text.Json.JsonEncodedText.Encode("truncate"); - - public override Elastic.Clients.Elasticsearch.Inference.CohereTaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propInputType = default; - LocalJsonValue propReturnDocuments = default; - LocalJsonValue propTopN = default; - LocalJsonValue propTruncate = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propInputType.TryReadProperty(ref reader, options, PropInputType, null)) - { - continue; - } - - if (propReturnDocuments.TryReadProperty(ref reader, options, PropReturnDocuments, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTopN.TryReadProperty(ref reader, options, PropTopN, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTruncate.TryReadProperty(ref reader, options, PropTruncate, static Elastic.Clients.Elasticsearch.Inference.CohereTruncateType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.CohereTaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - InputType = propInputType.Value, - ReturnDocuments = propReturnDocuments.Value, - TopN = propTopN.Value, - Truncate = propTruncate.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CohereTaskSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropInputType, value.InputType, null, null); - writer.WriteProperty(options, PropReturnDocuments, value.ReturnDocuments, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTopN, value.TopN, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTruncate, value.Truncate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Inference.CohereTruncateType? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.CohereTaskSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.CohereTaskSettingsConverter))] public sealed partial class CohereTaskSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereTaskType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereTaskType.Converters.g.cs new file mode 100644 index 00000000000..8268daf7432 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereTaskType.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class CohereTaskTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.CohereTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereTaskType.Completion; + } + + if (reader.ValueTextEquals(MemberRerank)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereTaskType.Rerank; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereTaskType.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereTaskType.Completion; + } + + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereTaskType.Rerank; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereTaskType.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.CohereTaskType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CohereTaskType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.CohereTaskType.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.CohereTaskType.Rerank: + writer.WriteStringValue(MemberRerank); + break; + case Elastic.Clients.Elasticsearch.Inference.CohereTaskType.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.CohereTaskType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.CohereTaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CohereTaskType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereTaskType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereTaskType.g.cs new file mode 100644 index 00000000000..304dfab8a5a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereTaskType.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.CohereTaskTypeConverter))] +public enum CohereTaskType +{ + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "rerank")] + Rerank, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereTruncateType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereTruncateType.Converters.g.cs new file mode 100644 index 00000000000..61c741bfff0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereTruncateType.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class CohereTruncateTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberEnd = System.Text.Json.JsonEncodedText.Encode("END"); + private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("NONE"); + private static readonly System.Text.Json.JsonEncodedText MemberStart = System.Text.Json.JsonEncodedText.Encode("START"); + + public override Elastic.Clients.Elasticsearch.Inference.CohereTruncateType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberEnd)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereTruncateType.End; + } + + if (reader.ValueTextEquals(MemberNone)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereTruncateType.None; + } + + if (reader.ValueTextEquals(MemberStart)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereTruncateType.Start; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberEnd.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereTruncateType.End; + } + + if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereTruncateType.None; + } + + if (string.Equals(value, MemberStart.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CohereTruncateType.Start; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.CohereTruncateType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CohereTruncateType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.CohereTruncateType.End: + writer.WriteStringValue(MemberEnd); + break; + case Elastic.Clients.Elasticsearch.Inference.CohereTruncateType.None: + writer.WriteStringValue(MemberNone); + break; + case Elastic.Clients.Elasticsearch.Inference.CohereTruncateType.Start: + writer.WriteStringValue(MemberStart); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.CohereTruncateType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.CohereTruncateType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CohereTruncateType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereTruncateType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereTruncateType.g.cs new file mode 100644 index 00000000000..655f3035ec8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CohereTruncateType.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.CohereTruncateTypeConverter))] +public enum CohereTruncateType +{ + [System.Runtime.Serialization.EnumMember(Value = "END")] + End, + [System.Runtime.Serialization.EnumMember(Value = "NONE")] + None, + [System.Runtime.Serialization.EnumMember(Value = "START")] + Start +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionResult.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionResult.Converters.g.cs new file mode 100644 index 00000000000..ee36cf6cc3d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionResult.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class CompletionResultConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropResult = System.Text.Json.JsonEncodedText.Encode("result"); + + public override Elastic.Clients.Elasticsearch.Inference.CompletionResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propResult = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propResult.TryReadProperty(ref reader, options, PropResult, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.CompletionResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Result = propResult.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CompletionResult value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropResult, value.Result, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionResult.g.cs index a5273b02b43..6c34c665429 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionResult.g.cs @@ -23,51 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class CompletionResultConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropResult = System.Text.Json.JsonEncodedText.Encode("result"); - - public override Elastic.Clients.Elasticsearch.Inference.CompletionResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propResult = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propResult.TryReadProperty(ref reader, options, PropResult, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.CompletionResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Result = propResult.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CompletionResult value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropResult, value.Result, null, null); - writer.WriteEndObject(); - } -} - /// /// /// The completion result object /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.CompletionResultConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.CompletionResultConverter))] public sealed partial class CompletionResult { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionTool.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionTool.Converters.g.cs new file mode 100644 index 00000000000..c765d0f7531 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionTool.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class CompletionToolConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFunction = System.Text.Json.JsonEncodedText.Encode("function"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Inference.CompletionTool Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFunction = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFunction.TryReadProperty(ref reader, options, PropFunction, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.CompletionTool(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Function = propFunction.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CompletionTool value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFunction, value.Function, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionTool.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionTool.g.cs index bbf5117bd61..1e51c0647d5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionTool.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionTool.g.cs @@ -23,60 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class CompletionToolConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFunction = System.Text.Json.JsonEncodedText.Encode("function"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Inference.CompletionTool Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFunction = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFunction.TryReadProperty(ref reader, options, PropFunction, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.CompletionTool(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Function = propFunction.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CompletionTool value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFunction, value.Function, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - /// /// /// A list of tools that the model can call. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.CompletionToolConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.CompletionToolConverter))] public sealed partial class CompletionTool { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionToolChoice.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionToolChoice.Converters.g.cs new file mode 100644 index 00000000000..5ac4c55ce6b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionToolChoice.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class CompletionToolChoiceConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFunction = System.Text.Json.JsonEncodedText.Encode("function"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Inference.CompletionToolChoice Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFunction = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFunction.TryReadProperty(ref reader, options, PropFunction, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.CompletionToolChoice(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Function = propFunction.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CompletionToolChoice value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFunction, value.Function, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionToolChoice.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionToolChoice.g.cs index 553090ce8b3..ad2e1b745d0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionToolChoice.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionToolChoice.g.cs @@ -23,60 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class CompletionToolChoiceConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFunction = System.Text.Json.JsonEncodedText.Encode("function"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Inference.CompletionToolChoice Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFunction = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFunction.TryReadProperty(ref reader, options, PropFunction, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.CompletionToolChoice(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Function = propFunction.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CompletionToolChoice value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFunction, value.Function, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Controls which tool is called by the model. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.CompletionToolChoiceConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.CompletionToolChoiceConverter))] public sealed partial class CompletionToolChoice { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionToolChoiceFunction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionToolChoiceFunction.Converters.g.cs new file mode 100644 index 00000000000..54ecfe8399d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionToolChoiceFunction.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class CompletionToolChoiceFunctionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.Inference.CompletionToolChoiceFunction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.CompletionToolChoiceFunction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CompletionToolChoiceFunction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionToolChoiceFunction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionToolChoiceFunction.g.cs index b6884af38c7..b4084d51d89 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionToolChoiceFunction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionToolChoiceFunction.g.cs @@ -23,51 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class CompletionToolChoiceFunctionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.Inference.CompletionToolChoiceFunction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.CompletionToolChoiceFunction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CompletionToolChoiceFunction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - /// /// /// The tool choice function. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.CompletionToolChoiceFunctionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.CompletionToolChoiceFunctionConverter))] public sealed partial class CompletionToolChoiceFunction { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionToolFunction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionToolFunction.Converters.g.cs new file mode 100644 index 00000000000..8189d532834 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionToolFunction.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class CompletionToolFunctionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropParameters = System.Text.Json.JsonEncodedText.Encode("parameters"); + private static readonly System.Text.Json.JsonEncodedText PropStrict = System.Text.Json.JsonEncodedText.Encode("strict"); + + public override Elastic.Clients.Elasticsearch.Inference.CompletionToolFunction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propName = default; + LocalJsonValue propParameters = default; + LocalJsonValue propStrict = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propParameters.TryReadProperty(ref reader, options, PropParameters, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propStrict.TryReadProperty(ref reader, options, PropStrict, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.CompletionToolFunction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Name = propName.Value, + Parameters = propParameters.Value, + Strict = propStrict.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CompletionToolFunction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropParameters, value.Parameters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropStrict, value.Strict, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionToolFunction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionToolFunction.g.cs index 7633245c562..10699734c82 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionToolFunction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CompletionToolFunction.g.cs @@ -23,78 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class CompletionToolFunctionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropParameters = System.Text.Json.JsonEncodedText.Encode("parameters"); - private static readonly System.Text.Json.JsonEncodedText PropStrict = System.Text.Json.JsonEncodedText.Encode("strict"); - - public override Elastic.Clients.Elasticsearch.Inference.CompletionToolFunction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propName = default; - LocalJsonValue propParameters = default; - LocalJsonValue propStrict = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propParameters.TryReadProperty(ref reader, options, PropParameters, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propStrict.TryReadProperty(ref reader, options, PropStrict, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.CompletionToolFunction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Name = propName.Value, - Parameters = propParameters.Value, - Strict = propStrict.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CompletionToolFunction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropParameters, value.Parameters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropStrict, value.Strict, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// The completion tool function definition. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.CompletionToolFunctionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.CompletionToolFunctionConverter))] public sealed partial class CompletionToolFunction { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContentObject.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContentObject.Converters.g.cs new file mode 100644 index 00000000000..8692d4dc2b4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContentObject.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class ContentObjectConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Inference.ContentObject Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propText = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propText.TryReadProperty(ref reader, options, PropText, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.ContentObject(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Text = propText.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ContentObject value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropText, value.Text, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContentObject.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContentObject.g.cs index 8b590476dee..3d2bd04a288 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContentObject.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContentObject.g.cs @@ -23,60 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class ContentObjectConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Inference.ContentObject Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propText = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propText.TryReadProperty(ref reader, options, PropText, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.ContentObject(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Text = propText.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ContentObject value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropText, value.Text, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - /// /// /// An object style representation of a single portion of a conversation. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.ContentObjectConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.ContentObjectConverter))] public sealed partial class ContentObject { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomRequestParams.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomRequestParams.Converters.g.cs new file mode 100644 index 00000000000..d7beb697832 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomRequestParams.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class CustomRequestParamsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropContent = System.Text.Json.JsonEncodedText.Encode("content"); + + public override Elastic.Clients.Elasticsearch.Inference.CustomRequestParams Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propContent = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propContent.TryReadProperty(ref reader, options, PropContent, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.CustomRequestParams(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Content = propContent.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CustomRequestParams value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropContent, value.Content, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomRequestParams.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomRequestParams.g.cs index 735a62c0a57..0bceabbf3f0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomRequestParams.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomRequestParams.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class CustomRequestParamsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropContent = System.Text.Json.JsonEncodedText.Encode("content"); - - public override Elastic.Clients.Elasticsearch.Inference.CustomRequestParams Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propContent = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propContent.TryReadProperty(ref reader, options, PropContent, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.CustomRequestParams(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Content = propContent.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CustomRequestParams value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropContent, value.Content, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.CustomRequestParamsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.CustomRequestParamsConverter))] public sealed partial class CustomRequestParams { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomResponseParams.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomResponseParams.Converters.g.cs new file mode 100644 index 00000000000..c41f7efd6e5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomResponseParams.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class CustomResponseParamsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropJsonParser = System.Text.Json.JsonEncodedText.Encode("json_parser"); + + public override Elastic.Clients.Elasticsearch.Inference.CustomResponseParams Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propJsonParser = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propJsonParser.TryReadProperty(ref reader, options, PropJsonParser, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.CustomResponseParams(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + JsonParser = propJsonParser.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CustomResponseParams value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropJsonParser, value.JsonParser, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomResponseParams.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomResponseParams.g.cs index 3aad26829a9..11bc600c960 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomResponseParams.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomResponseParams.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class CustomResponseParamsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropJsonParser = System.Text.Json.JsonEncodedText.Encode("json_parser"); - - public override Elastic.Clients.Elasticsearch.Inference.CustomResponseParams Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propJsonParser = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propJsonParser.TryReadProperty(ref reader, options, PropJsonParser, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.CustomResponseParams(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - JsonParser = propJsonParser.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CustomResponseParams value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropJsonParser, value.JsonParser, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.CustomResponseParamsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.CustomResponseParamsConverter))] public sealed partial class CustomResponseParams { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomServiceSettings.Converters.g.cs new file mode 100644 index 00000000000..1aa08a2570f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomServiceSettings.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class CustomServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropHeaders = System.Text.Json.JsonEncodedText.Encode("headers"); + private static readonly System.Text.Json.JsonEncodedText PropInputType = System.Text.Json.JsonEncodedText.Encode("input_type"); + private static readonly System.Text.Json.JsonEncodedText PropQueryParameters = System.Text.Json.JsonEncodedText.Encode("query_parameters"); + private static readonly System.Text.Json.JsonEncodedText PropRequest = System.Text.Json.JsonEncodedText.Encode("request"); + private static readonly System.Text.Json.JsonEncodedText PropResponse = System.Text.Json.JsonEncodedText.Encode("response"); + private static readonly System.Text.Json.JsonEncodedText PropSecretParameters = System.Text.Json.JsonEncodedText.Encode("secret_parameters"); + private static readonly System.Text.Json.JsonEncodedText PropUrl = System.Text.Json.JsonEncodedText.Encode("url"); + + public override Elastic.Clients.Elasticsearch.Inference.CustomServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propHeaders = default; + LocalJsonValue propInputType = default; + LocalJsonValue propQueryParameters = default; + LocalJsonValue propRequest = default; + LocalJsonValue propResponse = default; + LocalJsonValue propSecretParameters = default; + LocalJsonValue propUrl = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propHeaders.TryReadProperty(ref reader, options, PropHeaders, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propInputType.TryReadProperty(ref reader, options, PropInputType, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propQueryParameters.TryReadProperty(ref reader, options, PropQueryParameters, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propRequest.TryReadProperty(ref reader, options, PropRequest, null)) + { + continue; + } + + if (propResponse.TryReadProperty(ref reader, options, PropResponse, null)) + { + continue; + } + + if (propSecretParameters.TryReadProperty(ref reader, options, PropSecretParameters, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propUrl.TryReadProperty(ref reader, options, PropUrl, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.CustomServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Headers = propHeaders.Value, + InputType = propInputType.Value, + QueryParameters = propQueryParameters.Value, + Request = propRequest.Value, + Response = propResponse.Value, + SecretParameters = propSecretParameters.Value, + Url = propUrl.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CustomServiceSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropHeaders, value.Headers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropInputType, value.InputType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropQueryParameters, value.QueryParameters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropRequest, value.Request, null, null); + writer.WriteProperty(options, PropResponse, value.Response, null, null); + writer.WriteProperty(options, PropSecretParameters, value.SecretParameters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropUrl, value.Url, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomServiceSettings.g.cs index f73cd008070..4b30f9d66e4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomServiceSettings.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class CustomServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropHeaders = System.Text.Json.JsonEncodedText.Encode("headers"); - private static readonly System.Text.Json.JsonEncodedText PropInputType = System.Text.Json.JsonEncodedText.Encode("input_type"); - private static readonly System.Text.Json.JsonEncodedText PropQueryParameters = System.Text.Json.JsonEncodedText.Encode("query_parameters"); - private static readonly System.Text.Json.JsonEncodedText PropRequest = System.Text.Json.JsonEncodedText.Encode("request"); - private static readonly System.Text.Json.JsonEncodedText PropResponse = System.Text.Json.JsonEncodedText.Encode("response"); - private static readonly System.Text.Json.JsonEncodedText PropSecretParameters = System.Text.Json.JsonEncodedText.Encode("secret_parameters"); - private static readonly System.Text.Json.JsonEncodedText PropUrl = System.Text.Json.JsonEncodedText.Encode("url"); - - public override Elastic.Clients.Elasticsearch.Inference.CustomServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propHeaders = default; - LocalJsonValue propInputType = default; - LocalJsonValue propQueryParameters = default; - LocalJsonValue propRequest = default; - LocalJsonValue propResponse = default; - LocalJsonValue propSecretParameters = default; - LocalJsonValue propUrl = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propHeaders.TryReadProperty(ref reader, options, PropHeaders, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propInputType.TryReadProperty(ref reader, options, PropInputType, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propQueryParameters.TryReadProperty(ref reader, options, PropQueryParameters, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propRequest.TryReadProperty(ref reader, options, PropRequest, null)) - { - continue; - } - - if (propResponse.TryReadProperty(ref reader, options, PropResponse, null)) - { - continue; - } - - if (propSecretParameters.TryReadProperty(ref reader, options, PropSecretParameters, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propUrl.TryReadProperty(ref reader, options, PropUrl, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.CustomServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Headers = propHeaders.Value, - InputType = propInputType.Value, - QueryParameters = propQueryParameters.Value, - Request = propRequest.Value, - Response = propResponse.Value, - SecretParameters = propSecretParameters.Value, - Url = propUrl.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CustomServiceSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropHeaders, value.Headers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropInputType, value.InputType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropQueryParameters, value.QueryParameters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropRequest, value.Request, null, null); - writer.WriteProperty(options, PropResponse, value.Response, null, null); - writer.WriteProperty(options, PropSecretParameters, value.SecretParameters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropUrl, value.Url, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.CustomServiceSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.CustomServiceSettingsConverter))] public sealed partial class CustomServiceSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomTaskSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomTaskSettings.Converters.g.cs new file mode 100644 index 00000000000..b96b37c72e5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomTaskSettings.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class CustomTaskSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropParameters = System.Text.Json.JsonEncodedText.Encode("parameters"); + + public override Elastic.Clients.Elasticsearch.Inference.CustomTaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propParameters = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propParameters.TryReadProperty(ref reader, options, PropParameters, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.CustomTaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Parameters = propParameters.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CustomTaskSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropParameters, value.Parameters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomTaskSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomTaskSettings.g.cs index 2c4081c5480..18e2f9c61ad 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomTaskSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomTaskSettings.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class CustomTaskSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropParameters = System.Text.Json.JsonEncodedText.Encode("parameters"); - - public override Elastic.Clients.Elasticsearch.Inference.CustomTaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propParameters = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propParameters.TryReadProperty(ref reader, options, PropParameters, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.CustomTaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Parameters = propParameters.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CustomTaskSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropParameters, value.Parameters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.CustomTaskSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.CustomTaskSettingsConverter))] public sealed partial class CustomTaskSettings { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomTaskType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomTaskType.Converters.g.cs new file mode 100644 index 00000000000..7adbf0e6de5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomTaskType.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class CustomTaskTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); + private static readonly System.Text.Json.JsonEncodedText MemberSparseEmbedding = System.Text.Json.JsonEncodedText.Encode("sparse_embedding"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.CustomTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.CustomTaskType.Completion; + } + + if (reader.ValueTextEquals(MemberRerank)) + { + return Elastic.Clients.Elasticsearch.Inference.CustomTaskType.Rerank; + } + + if (reader.ValueTextEquals(MemberSparseEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.CustomTaskType.SparseEmbedding; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.CustomTaskType.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CustomTaskType.Completion; + } + + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CustomTaskType.Rerank; + } + + if (string.Equals(value, MemberSparseEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CustomTaskType.SparseEmbedding; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CustomTaskType.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.CustomTaskType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CustomTaskType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.CustomTaskType.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.CustomTaskType.Rerank: + writer.WriteStringValue(MemberRerank); + break; + case Elastic.Clients.Elasticsearch.Inference.CustomTaskType.SparseEmbedding: + writer.WriteStringValue(MemberSparseEmbedding); + break; + case Elastic.Clients.Elasticsearch.Inference.CustomTaskType.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.CustomTaskType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.CustomTaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CustomTaskType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomTaskType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomTaskType.g.cs new file mode 100644 index 00000000000..ec69622f9fc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomTaskType.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.CustomTaskTypeConverter))] +public enum CustomTaskType +{ + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "rerank")] + Rerank, + [System.Runtime.Serialization.EnumMember(Value = "sparse_embedding")] + SparseEmbedding, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/DeepSeekServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/DeepSeekServiceSettings.Converters.g.cs new file mode 100644 index 00000000000..54acab92cb6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/DeepSeekServiceSettings.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class DeepSeekServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); + private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); + private static readonly System.Text.Json.JsonEncodedText PropUrl = System.Text.Json.JsonEncodedText.Encode("url"); + + public override Elastic.Clients.Elasticsearch.Inference.DeepSeekServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApiKey = default; + LocalJsonValue propModelId = default; + LocalJsonValue propUrl = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) + { + continue; + } + + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) + { + continue; + } + + if (propUrl.TryReadProperty(ref reader, options, PropUrl, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.DeepSeekServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ApiKey = propApiKey.Value, + ModelId = propModelId.Value, + Url = propUrl.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.DeepSeekServiceSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); + writer.WriteProperty(options, PropModelId, value.ModelId, null, null); + writer.WriteProperty(options, PropUrl, value.Url, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/DeepSeekServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/DeepSeekServiceSettings.g.cs index b5a14569d3c..7813fa2288f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/DeepSeekServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/DeepSeekServiceSettings.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class DeepSeekServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); - private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); - private static readonly System.Text.Json.JsonEncodedText PropUrl = System.Text.Json.JsonEncodedText.Encode("url"); - - public override Elastic.Clients.Elasticsearch.Inference.DeepSeekServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propApiKey = default; - LocalJsonValue propModelId = default; - LocalJsonValue propUrl = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) - { - continue; - } - - if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) - { - continue; - } - - if (propUrl.TryReadProperty(ref reader, options, PropUrl, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.DeepSeekServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ApiKey = propApiKey.Value, - ModelId = propModelId.Value, - Url = propUrl.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.DeepSeekServiceSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); - writer.WriteProperty(options, PropModelId, value.ModelId, null, null); - writer.WriteProperty(options, PropUrl, value.Url, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.DeepSeekServiceSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.DeepSeekServiceSettingsConverter))] public sealed partial class DeepSeekServiceSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchServiceSettings.Converters.g.cs new file mode 100644 index 00000000000..98c991f785f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchServiceSettings.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class ElasticsearchServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAdaptiveAllocations = System.Text.Json.JsonEncodedText.Encode("adaptive_allocations"); + private static readonly System.Text.Json.JsonEncodedText PropDeploymentId = System.Text.Json.JsonEncodedText.Encode("deployment_id"); + private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); + private static readonly System.Text.Json.JsonEncodedText PropNumAllocations = System.Text.Json.JsonEncodedText.Encode("num_allocations"); + private static readonly System.Text.Json.JsonEncodedText PropNumThreads = System.Text.Json.JsonEncodedText.Encode("num_threads"); + + public override Elastic.Clients.Elasticsearch.Inference.ElasticsearchServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAdaptiveAllocations = default; + LocalJsonValue propDeploymentId = default; + LocalJsonValue propModelId = default; + LocalJsonValue propNumAllocations = default; + LocalJsonValue propNumThreads = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAdaptiveAllocations.TryReadProperty(ref reader, options, PropAdaptiveAllocations, null)) + { + continue; + } + + if (propDeploymentId.TryReadProperty(ref reader, options, PropDeploymentId, null)) + { + continue; + } + + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) + { + continue; + } + + if (propNumAllocations.TryReadProperty(ref reader, options, PropNumAllocations, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNumThreads.TryReadProperty(ref reader, options, PropNumThreads, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.ElasticsearchServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AdaptiveAllocations = propAdaptiveAllocations.Value, + DeploymentId = propDeploymentId.Value, + ModelId = propModelId.Value, + NumAllocations = propNumAllocations.Value, + NumThreads = propNumThreads.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ElasticsearchServiceSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAdaptiveAllocations, value.AdaptiveAllocations, null, null); + writer.WriteProperty(options, PropDeploymentId, value.DeploymentId, null, null); + writer.WriteProperty(options, PropModelId, value.ModelId, null, null); + writer.WriteProperty(options, PropNumAllocations, value.NumAllocations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNumThreads, value.NumThreads, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchServiceSettings.g.cs index 8baea6e16ad..759c0887af1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchServiceSettings.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class ElasticsearchServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAdaptiveAllocations = System.Text.Json.JsonEncodedText.Encode("adaptive_allocations"); - private static readonly System.Text.Json.JsonEncodedText PropDeploymentId = System.Text.Json.JsonEncodedText.Encode("deployment_id"); - private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); - private static readonly System.Text.Json.JsonEncodedText PropNumAllocations = System.Text.Json.JsonEncodedText.Encode("num_allocations"); - private static readonly System.Text.Json.JsonEncodedText PropNumThreads = System.Text.Json.JsonEncodedText.Encode("num_threads"); - - public override Elastic.Clients.Elasticsearch.Inference.ElasticsearchServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAdaptiveAllocations = default; - LocalJsonValue propDeploymentId = default; - LocalJsonValue propModelId = default; - LocalJsonValue propNumAllocations = default; - LocalJsonValue propNumThreads = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAdaptiveAllocations.TryReadProperty(ref reader, options, PropAdaptiveAllocations, null)) - { - continue; - } - - if (propDeploymentId.TryReadProperty(ref reader, options, PropDeploymentId, null)) - { - continue; - } - - if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) - { - continue; - } - - if (propNumAllocations.TryReadProperty(ref reader, options, PropNumAllocations, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNumThreads.TryReadProperty(ref reader, options, PropNumThreads, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.ElasticsearchServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AdaptiveAllocations = propAdaptiveAllocations.Value, - DeploymentId = propDeploymentId.Value, - ModelId = propModelId.Value, - NumAllocations = propNumAllocations.Value, - NumThreads = propNumThreads.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ElasticsearchServiceSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAdaptiveAllocations, value.AdaptiveAllocations, null, null); - writer.WriteProperty(options, PropDeploymentId, value.DeploymentId, null, null); - writer.WriteProperty(options, PropModelId, value.ModelId, null, null); - writer.WriteProperty(options, PropNumAllocations, value.NumAllocations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNumThreads, value.NumThreads, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.ElasticsearchServiceSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.ElasticsearchServiceSettingsConverter))] public sealed partial class ElasticsearchServiceSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchTaskSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchTaskSettings.Converters.g.cs new file mode 100644 index 00000000000..31cabdffc13 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchTaskSettings.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class ElasticsearchTaskSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropReturnDocuments = System.Text.Json.JsonEncodedText.Encode("return_documents"); + + public override Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propReturnDocuments = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propReturnDocuments.TryReadProperty(ref reader, options, PropReturnDocuments, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ReturnDocuments = propReturnDocuments.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropReturnDocuments, value.ReturnDocuments, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchTaskSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchTaskSettings.g.cs index fdd264fc9ec..4a2258ed23d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchTaskSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchTaskSettings.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class ElasticsearchTaskSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropReturnDocuments = System.Text.Json.JsonEncodedText.Encode("return_documents"); - - public override Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propReturnDocuments = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propReturnDocuments.TryReadProperty(ref reader, options, PropReturnDocuments, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ReturnDocuments = propReturnDocuments.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropReturnDocuments, value.ReturnDocuments, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.ElasticsearchTaskSettingsConverter))] public sealed partial class ElasticsearchTaskSettings { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchTaskType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchTaskType.Converters.g.cs new file mode 100644 index 00000000000..ea242795a1f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchTaskType.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class ElasticsearchTaskTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); + private static readonly System.Text.Json.JsonEncodedText MemberSparseEmbedding = System.Text.Json.JsonEncodedText.Encode("sparse_embedding"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberRerank)) + { + return Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType.Rerank; + } + + if (reader.ValueTextEquals(MemberSparseEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType.SparseEmbedding; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType.Rerank; + } + + if (string.Equals(value, MemberSparseEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType.SparseEmbedding; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType.Rerank: + writer.WriteStringValue(MemberRerank); + break; + case Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType.SparseEmbedding: + writer.WriteStringValue(MemberSparseEmbedding); + break; + case Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ElasticsearchTaskType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchTaskType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchTaskType.g.cs new file mode 100644 index 00000000000..f27e88f9bf5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchTaskType.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.ElasticsearchTaskTypeConverter))] +public enum ElasticsearchTaskType +{ + [System.Runtime.Serialization.EnumMember(Value = "rerank")] + Rerank, + [System.Runtime.Serialization.EnumMember(Value = "sparse_embedding")] + SparseEmbedding, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElserServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElserServiceSettings.Converters.g.cs new file mode 100644 index 00000000000..6865b8e974f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElserServiceSettings.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class ElserServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAdaptiveAllocations = System.Text.Json.JsonEncodedText.Encode("adaptive_allocations"); + private static readonly System.Text.Json.JsonEncodedText PropNumAllocations = System.Text.Json.JsonEncodedText.Encode("num_allocations"); + private static readonly System.Text.Json.JsonEncodedText PropNumThreads = System.Text.Json.JsonEncodedText.Encode("num_threads"); + + public override Elastic.Clients.Elasticsearch.Inference.ElserServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAdaptiveAllocations = default; + LocalJsonValue propNumAllocations = default; + LocalJsonValue propNumThreads = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAdaptiveAllocations.TryReadProperty(ref reader, options, PropAdaptiveAllocations, null)) + { + continue; + } + + if (propNumAllocations.TryReadProperty(ref reader, options, PropNumAllocations, null)) + { + continue; + } + + if (propNumThreads.TryReadProperty(ref reader, options, PropNumThreads, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.ElserServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AdaptiveAllocations = propAdaptiveAllocations.Value, + NumAllocations = propNumAllocations.Value, + NumThreads = propNumThreads.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ElserServiceSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAdaptiveAllocations, value.AdaptiveAllocations, null, null); + writer.WriteProperty(options, PropNumAllocations, value.NumAllocations, null, null); + writer.WriteProperty(options, PropNumThreads, value.NumThreads, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElserServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElserServiceSettings.g.cs index 2f0b5880552..6dc7d3fe38a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElserServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElserServiceSettings.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class ElserServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAdaptiveAllocations = System.Text.Json.JsonEncodedText.Encode("adaptive_allocations"); - private static readonly System.Text.Json.JsonEncodedText PropNumAllocations = System.Text.Json.JsonEncodedText.Encode("num_allocations"); - private static readonly System.Text.Json.JsonEncodedText PropNumThreads = System.Text.Json.JsonEncodedText.Encode("num_threads"); - - public override Elastic.Clients.Elasticsearch.Inference.ElserServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAdaptiveAllocations = default; - LocalJsonValue propNumAllocations = default; - LocalJsonValue propNumThreads = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAdaptiveAllocations.TryReadProperty(ref reader, options, PropAdaptiveAllocations, null)) - { - continue; - } - - if (propNumAllocations.TryReadProperty(ref reader, options, PropNumAllocations, null)) - { - continue; - } - - if (propNumThreads.TryReadProperty(ref reader, options, PropNumThreads, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.ElserServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AdaptiveAllocations = propAdaptiveAllocations.Value, - NumAllocations = propNumAllocations.Value, - NumThreads = propNumThreads.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ElserServiceSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAdaptiveAllocations, value.AdaptiveAllocations, null, null); - writer.WriteProperty(options, PropNumAllocations, value.NumAllocations, null, null); - writer.WriteProperty(options, PropNumThreads, value.NumThreads, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.ElserServiceSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.ElserServiceSettingsConverter))] public sealed partial class ElserServiceSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElserTaskType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElserTaskType.Converters.g.cs new file mode 100644 index 00000000000..5eca1993a25 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElserTaskType.Converters.g.cs @@ -0,0 +1,67 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class ElserTaskTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberSparseEmbedding = System.Text.Json.JsonEncodedText.Encode("sparse_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.ElserTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberSparseEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.ElserTaskType.SparseEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberSparseEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.ElserTaskType.SparseEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.ElserTaskType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ElserTaskType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.ElserTaskType.SparseEmbedding: + writer.WriteStringValue(MemberSparseEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.ElserTaskType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.ElserTaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ElserTaskType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElserTaskType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElserTaskType.g.cs new file mode 100644 index 00000000000..b1b5a0708ee --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElserTaskType.g.cs @@ -0,0 +1,31 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.ElserTaskTypeConverter))] +public enum ElserTaskType +{ + [System.Runtime.Serialization.EnumMember(Value = "sparse_embedding")] + SparseEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleAiStudioServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleAiStudioServiceSettings.Converters.g.cs new file mode 100644 index 00000000000..59dd0544393 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleAiStudioServiceSettings.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class GoogleAiStudioServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); + private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); + private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); + + public override Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApiKey = default; + LocalJsonValue propModelId = default; + LocalJsonValue propRateLimit = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) + { + continue; + } + + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) + { + continue; + } + + if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ApiKey = propApiKey.Value, + ModelId = propModelId.Value, + RateLimit = propRateLimit.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioServiceSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); + writer.WriteProperty(options, PropModelId, value.ModelId, null, null); + writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleAiStudioServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleAiStudioServiceSettings.g.cs index 6b7976b5540..b5ff2d3c686 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleAiStudioServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleAiStudioServiceSettings.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class GoogleAiStudioServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); - private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); - private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); - - public override Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propApiKey = default; - LocalJsonValue propModelId = default; - LocalJsonValue propRateLimit = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) - { - continue; - } - - if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) - { - continue; - } - - if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ApiKey = propApiKey.Value, - ModelId = propModelId.Value, - RateLimit = propRateLimit.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioServiceSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); - writer.WriteProperty(options, PropModelId, value.ModelId, null, null); - writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioServiceSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.GoogleAiStudioServiceSettingsConverter))] public sealed partial class GoogleAiStudioServiceSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleAiStudioTaskType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleAiStudioTaskType.Converters.g.cs new file mode 100644 index 00000000000..24fec25b693 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleAiStudioTaskType.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class GoogleAiStudioTaskTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioTaskType.Completion; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioTaskType.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioTaskType.Completion; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioTaskType.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioTaskType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioTaskType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioTaskType.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioTaskType.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioTaskType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioTaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.GoogleAiStudioTaskType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleAiStudioTaskType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleAiStudioTaskType.g.cs new file mode 100644 index 00000000000..2062d54bede --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleAiStudioTaskType.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.GoogleAiStudioTaskTypeConverter))] +public enum GoogleAiStudioTaskType +{ + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.Converters.g.cs new file mode 100644 index 00000000000..d26f24f0893 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class GoogleVertexAIServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLocation = System.Text.Json.JsonEncodedText.Encode("location"); + private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); + private static readonly System.Text.Json.JsonEncodedText PropProjectId = System.Text.Json.JsonEncodedText.Encode("project_id"); + private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); + private static readonly System.Text.Json.JsonEncodedText PropServiceAccountJson = System.Text.Json.JsonEncodedText.Encode("service_account_json"); + + public override Elastic.Clients.Elasticsearch.Inference.GoogleVertexAIServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLocation = default; + LocalJsonValue propModelId = default; + LocalJsonValue propProjectId = default; + LocalJsonValue propRateLimit = default; + LocalJsonValue propServiceAccountJson = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLocation.TryReadProperty(ref reader, options, PropLocation, null)) + { + continue; + } + + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) + { + continue; + } + + if (propProjectId.TryReadProperty(ref reader, options, PropProjectId, null)) + { + continue; + } + + if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) + { + continue; + } + + if (propServiceAccountJson.TryReadProperty(ref reader, options, PropServiceAccountJson, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.GoogleVertexAIServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Location = propLocation.Value, + ModelId = propModelId.Value, + ProjectId = propProjectId.Value, + RateLimit = propRateLimit.Value, + ServiceAccountJson = propServiceAccountJson.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.GoogleVertexAIServiceSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLocation, value.Location, null, null); + writer.WriteProperty(options, PropModelId, value.ModelId, null, null); + writer.WriteProperty(options, PropProjectId, value.ProjectId, null, null); + writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); + writer.WriteProperty(options, PropServiceAccountJson, value.ServiceAccountJson, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.g.cs index c89444e3f8e..be605af4909 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class GoogleVertexAIServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLocation = System.Text.Json.JsonEncodedText.Encode("location"); - private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); - private static readonly System.Text.Json.JsonEncodedText PropProjectId = System.Text.Json.JsonEncodedText.Encode("project_id"); - private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); - private static readonly System.Text.Json.JsonEncodedText PropServiceAccountJson = System.Text.Json.JsonEncodedText.Encode("service_account_json"); - - public override Elastic.Clients.Elasticsearch.Inference.GoogleVertexAIServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLocation = default; - LocalJsonValue propModelId = default; - LocalJsonValue propProjectId = default; - LocalJsonValue propRateLimit = default; - LocalJsonValue propServiceAccountJson = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLocation.TryReadProperty(ref reader, options, PropLocation, null)) - { - continue; - } - - if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) - { - continue; - } - - if (propProjectId.TryReadProperty(ref reader, options, PropProjectId, null)) - { - continue; - } - - if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) - { - continue; - } - - if (propServiceAccountJson.TryReadProperty(ref reader, options, PropServiceAccountJson, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.GoogleVertexAIServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Location = propLocation.Value, - ModelId = propModelId.Value, - ProjectId = propProjectId.Value, - RateLimit = propRateLimit.Value, - ServiceAccountJson = propServiceAccountJson.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.GoogleVertexAIServiceSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLocation, value.Location, null, null); - writer.WriteProperty(options, PropModelId, value.ModelId, null, null); - writer.WriteProperty(options, PropProjectId, value.ProjectId, null, null); - writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); - writer.WriteProperty(options, PropServiceAccountJson, value.ServiceAccountJson, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.GoogleVertexAIServiceSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.GoogleVertexAIServiceSettingsConverter))] public sealed partial class GoogleVertexAIServiceSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAITaskSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAITaskSettings.Converters.g.cs new file mode 100644 index 00000000000..b47475dfb04 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAITaskSettings.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class GoogleVertexAITaskSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAutoTruncate = System.Text.Json.JsonEncodedText.Encode("auto_truncate"); + private static readonly System.Text.Json.JsonEncodedText PropTopN = System.Text.Json.JsonEncodedText.Encode("top_n"); + + public override Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAutoTruncate = default; + LocalJsonValue propTopN = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAutoTruncate.TryReadProperty(ref reader, options, PropAutoTruncate, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTopN.TryReadProperty(ref reader, options, PropTopN, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AutoTruncate = propAutoTruncate.Value, + TopN = propTopN.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAutoTruncate, value.AutoTruncate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTopN, value.TopN, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAITaskSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAITaskSettings.g.cs index 9fe39debb81..b04b731dc7a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAITaskSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAITaskSettings.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class GoogleVertexAITaskSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAutoTruncate = System.Text.Json.JsonEncodedText.Encode("auto_truncate"); - private static readonly System.Text.Json.JsonEncodedText PropTopN = System.Text.Json.JsonEncodedText.Encode("top_n"); - - public override Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAutoTruncate = default; - LocalJsonValue propTopN = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAutoTruncate.TryReadProperty(ref reader, options, PropAutoTruncate, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTopN.TryReadProperty(ref reader, options, PropTopN, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AutoTruncate = propAutoTruncate.Value, - TopN = propTopN.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAutoTruncate, value.AutoTruncate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTopN, value.TopN, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.GoogleVertexAITaskSettingsConverter))] public sealed partial class GoogleVertexAITaskSettings { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAITaskType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAITaskType.Converters.g.cs new file mode 100644 index 00000000000..3a88a685f63 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAITaskType.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class GoogleVertexAITaskTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberChatCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType.ChatCompletion; + } + + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType.Completion; + } + + if (reader.ValueTextEquals(MemberRerank)) + { + return Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType.Rerank; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType.ChatCompletion; + } + + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType.Completion; + } + + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType.Rerank; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType.ChatCompletion: + writer.WriteStringValue(MemberChatCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType.Rerank: + writer.WriteStringValue(MemberRerank); + break; + case Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAITaskType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAITaskType.g.cs new file mode 100644 index 00000000000..e66852ddae4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAITaskType.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.GoogleVertexAITaskTypeConverter))] +public enum GoogleVertexAITaskType +{ + [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] + ChatCompletion, + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "rerank")] + Rerank, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/HuggingFaceServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/HuggingFaceServiceSettings.Converters.g.cs new file mode 100644 index 00000000000..1686726731a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/HuggingFaceServiceSettings.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class HuggingFaceServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); + private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); + private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); + private static readonly System.Text.Json.JsonEncodedText PropUrl = System.Text.Json.JsonEncodedText.Encode("url"); + + public override Elastic.Clients.Elasticsearch.Inference.HuggingFaceServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApiKey = default; + LocalJsonValue propModelId = default; + LocalJsonValue propRateLimit = default; + LocalJsonValue propUrl = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) + { + continue; + } + + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) + { + continue; + } + + if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) + { + continue; + } + + if (propUrl.TryReadProperty(ref reader, options, PropUrl, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.HuggingFaceServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ApiKey = propApiKey.Value, + ModelId = propModelId.Value, + RateLimit = propRateLimit.Value, + Url = propUrl.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.HuggingFaceServiceSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); + writer.WriteProperty(options, PropModelId, value.ModelId, null, null); + writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); + writer.WriteProperty(options, PropUrl, value.Url, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/HuggingFaceServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/HuggingFaceServiceSettings.g.cs index 2b9934509da..33b5aef8fe8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/HuggingFaceServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/HuggingFaceServiceSettings.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class HuggingFaceServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); - private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); - private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); - private static readonly System.Text.Json.JsonEncodedText PropUrl = System.Text.Json.JsonEncodedText.Encode("url"); - - public override Elastic.Clients.Elasticsearch.Inference.HuggingFaceServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propApiKey = default; - LocalJsonValue propModelId = default; - LocalJsonValue propRateLimit = default; - LocalJsonValue propUrl = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) - { - continue; - } - - if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) - { - continue; - } - - if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) - { - continue; - } - - if (propUrl.TryReadProperty(ref reader, options, PropUrl, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.HuggingFaceServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ApiKey = propApiKey.Value, - ModelId = propModelId.Value, - RateLimit = propRateLimit.Value, - Url = propUrl.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.HuggingFaceServiceSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); - writer.WriteProperty(options, PropModelId, value.ModelId, null, null); - writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); - writer.WriteProperty(options, PropUrl, value.Url, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.HuggingFaceServiceSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.HuggingFaceServiceSettingsConverter))] public sealed partial class HuggingFaceServiceSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/HuggingFaceTaskSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/HuggingFaceTaskSettings.Converters.g.cs new file mode 100644 index 00000000000..55c4bca9622 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/HuggingFaceTaskSettings.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class HuggingFaceTaskSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropReturnDocuments = System.Text.Json.JsonEncodedText.Encode("return_documents"); + private static readonly System.Text.Json.JsonEncodedText PropTopN = System.Text.Json.JsonEncodedText.Encode("top_n"); + + public override Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propReturnDocuments = default; + LocalJsonValue propTopN = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propReturnDocuments.TryReadProperty(ref reader, options, PropReturnDocuments, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTopN.TryReadProperty(ref reader, options, PropTopN, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ReturnDocuments = propReturnDocuments.Value, + TopN = propTopN.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropReturnDocuments, value.ReturnDocuments, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTopN, value.TopN, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/HuggingFaceTaskSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/HuggingFaceTaskSettings.g.cs index 67501bd5d0b..692d2b21bea 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/HuggingFaceTaskSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/HuggingFaceTaskSettings.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class HuggingFaceTaskSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropReturnDocuments = System.Text.Json.JsonEncodedText.Encode("return_documents"); - private static readonly System.Text.Json.JsonEncodedText PropTopN = System.Text.Json.JsonEncodedText.Encode("top_n"); - - public override Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propReturnDocuments = default; - LocalJsonValue propTopN = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propReturnDocuments.TryReadProperty(ref reader, options, PropReturnDocuments, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTopN.TryReadProperty(ref reader, options, PropTopN, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ReturnDocuments = propReturnDocuments.Value, - TopN = propTopN.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropReturnDocuments, value.ReturnDocuments, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTopN, value.TopN, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.HuggingFaceTaskSettingsConverter))] public sealed partial class HuggingFaceTaskSettings { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/HuggingFaceTaskType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/HuggingFaceTaskType.Converters.g.cs new file mode 100644 index 00000000000..204c7e7daad --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/HuggingFaceTaskType.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class HuggingFaceTaskTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberChatCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType.ChatCompletion; + } + + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType.Completion; + } + + if (reader.ValueTextEquals(MemberRerank)) + { + return Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType.Rerank; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType.ChatCompletion; + } + + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType.Completion; + } + + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType.Rerank; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType.ChatCompletion: + writer.WriteStringValue(MemberChatCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType.Rerank: + writer.WriteStringValue(MemberRerank); + break; + case Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.HuggingFaceTaskType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/HuggingFaceTaskType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/HuggingFaceTaskType.g.cs new file mode 100644 index 00000000000..f0d9d410853 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/HuggingFaceTaskType.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.HuggingFaceTaskTypeConverter))] +public enum HuggingFaceTaskType +{ + [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] + ChatCompletion, + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "rerank")] + Rerank, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceChunkingSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceChunkingSettings.Converters.g.cs new file mode 100644 index 00000000000..13bcc574cfe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceChunkingSettings.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class InferenceChunkingSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxChunkSize = System.Text.Json.JsonEncodedText.Encode("max_chunk_size"); + private static readonly System.Text.Json.JsonEncodedText PropOverlap = System.Text.Json.JsonEncodedText.Encode("overlap"); + private static readonly System.Text.Json.JsonEncodedText PropSentenceOverlap = System.Text.Json.JsonEncodedText.Encode("sentence_overlap"); + private static readonly System.Text.Json.JsonEncodedText PropSeparatorGroup = System.Text.Json.JsonEncodedText.Encode("separator_group"); + private static readonly System.Text.Json.JsonEncodedText PropSeparators = System.Text.Json.JsonEncodedText.Encode("separators"); + private static readonly System.Text.Json.JsonEncodedText PropStrategy = System.Text.Json.JsonEncodedText.Encode("strategy"); + + public override Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxChunkSize = default; + LocalJsonValue propOverlap = default; + LocalJsonValue propSentenceOverlap = default; + LocalJsonValue propSeparatorGroup = default; + LocalJsonValue> propSeparators = default; + LocalJsonValue propStrategy = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxChunkSize.TryReadProperty(ref reader, options, PropMaxChunkSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOverlap.TryReadProperty(ref reader, options, PropOverlap, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSentenceOverlap.TryReadProperty(ref reader, options, PropSentenceOverlap, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSeparatorGroup.TryReadProperty(ref reader, options, PropSeparatorGroup, null)) + { + continue; + } + + if (propSeparators.TryReadProperty(ref reader, options, PropSeparators, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propStrategy.TryReadProperty(ref reader, options, PropStrategy, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxChunkSize = propMaxChunkSize.Value, + Overlap = propOverlap.Value, + SentenceOverlap = propSentenceOverlap.Value, + SeparatorGroup = propSeparatorGroup.Value, + Separators = propSeparators.Value, + Strategy = propStrategy.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxChunkSize, value.MaxChunkSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOverlap, value.Overlap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSentenceOverlap, value.SentenceOverlap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSeparatorGroup, value.SeparatorGroup, null, null); + writer.WriteProperty(options, PropSeparators, value.Separators, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStrategy, value.Strategy, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceChunkingSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceChunkingSettings.g.cs index 6bbcd493b0e..c6e2f879de2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceChunkingSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceChunkingSettings.g.cs @@ -23,96 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class InferenceChunkingSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxChunkSize = System.Text.Json.JsonEncodedText.Encode("max_chunk_size"); - private static readonly System.Text.Json.JsonEncodedText PropOverlap = System.Text.Json.JsonEncodedText.Encode("overlap"); - private static readonly System.Text.Json.JsonEncodedText PropSentenceOverlap = System.Text.Json.JsonEncodedText.Encode("sentence_overlap"); - private static readonly System.Text.Json.JsonEncodedText PropSeparatorGroup = System.Text.Json.JsonEncodedText.Encode("separator_group"); - private static readonly System.Text.Json.JsonEncodedText PropSeparators = System.Text.Json.JsonEncodedText.Encode("separators"); - private static readonly System.Text.Json.JsonEncodedText PropStrategy = System.Text.Json.JsonEncodedText.Encode("strategy"); - - public override Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxChunkSize = default; - LocalJsonValue propOverlap = default; - LocalJsonValue propSentenceOverlap = default; - LocalJsonValue propSeparatorGroup = default; - LocalJsonValue> propSeparators = default; - LocalJsonValue propStrategy = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxChunkSize.TryReadProperty(ref reader, options, PropMaxChunkSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOverlap.TryReadProperty(ref reader, options, PropOverlap, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSentenceOverlap.TryReadProperty(ref reader, options, PropSentenceOverlap, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSeparatorGroup.TryReadProperty(ref reader, options, PropSeparatorGroup, null)) - { - continue; - } - - if (propSeparators.TryReadProperty(ref reader, options, PropSeparators, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propStrategy.TryReadProperty(ref reader, options, PropStrategy, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxChunkSize = propMaxChunkSize.Value, - Overlap = propOverlap.Value, - SentenceOverlap = propSentenceOverlap.Value, - SeparatorGroup = propSeparatorGroup.Value, - Separators = propSeparators.Value, - Strategy = propStrategy.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxChunkSize, value.MaxChunkSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOverlap, value.Overlap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSentenceOverlap, value.SentenceOverlap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSeparatorGroup, value.SeparatorGroup, null, null); - writer.WriteProperty(options, PropSeparators, value.Separators, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStrategy, value.Strategy, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Chunking configuration object /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.InferenceChunkingSettingsConverter))] public sealed partial class InferenceChunkingSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpoint.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpoint.Converters.g.cs new file mode 100644 index 00000000000..05215707b4a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpoint.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class InferenceEndpointConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.InferenceEndpoint Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.InferenceEndpoint(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.InferenceEndpoint value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpoint.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpoint.g.cs index ffcc560573e..304daa42996 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpoint.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpoint.g.cs @@ -23,78 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class InferenceEndpointConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - - public override Elastic.Clients.Elasticsearch.Inference.InferenceEndpoint Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propService = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (propService.TryReadProperty(ref reader, options, PropService, null)) - { - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.InferenceEndpoint(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - Service = propService.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.InferenceEndpoint value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteEndObject(); - } -} - /// /// /// Configuration options when storing the inference endpoint /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.InferenceEndpointConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.InferenceEndpointConverter))] public sealed partial class InferenceEndpoint { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpointInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpointInfo.Converters.g.cs new file mode 100644 index 00000000000..56f10b6faa0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpointInfo.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class InferenceEndpointInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); + + public override Elastic.Clients.Elasticsearch.Inference.InferenceEndpointInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + LocalJsonValue propTaskType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.InferenceEndpointInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + InferenceId = propInferenceId.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value, + TaskType = propTaskType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.InferenceEndpointInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpointInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpointInfo.g.cs index c90c517ee9f..3a6dae0bd94 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpointInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpointInfo.g.cs @@ -23,96 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class InferenceEndpointInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); - private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); - private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); - - public override Elastic.Clients.Elasticsearch.Inference.InferenceEndpointInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue propService = default; - LocalJsonValue propServiceSettings = default; - LocalJsonValue propTaskSettings = default; - LocalJsonValue propTaskType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propService.TryReadProperty(ref reader, options, PropService, null)) - { - continue; - } - - if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.InferenceEndpointInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - InferenceId = propInferenceId.Value, - Service = propService.Value, - ServiceSettings = propServiceSettings.Value, - TaskSettings = propTaskSettings.Value, - TaskType = propTaskType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.InferenceEndpointInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropService, value.Service, null, null); - writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropTaskType, value.TaskType, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Represents an inference endpoint as returned by the GET API /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.InferenceEndpointInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.InferenceEndpointInfoConverter))] public sealed partial class InferenceEndpointInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceResult.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceResult.Converters.g.cs new file mode 100644 index 00000000000..35fb8298e7f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceResult.Converters.g.cs @@ -0,0 +1,138 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class InferenceResultConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText VariantRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); + private static readonly System.Text.Json.JsonEncodedText VariantSparseEmbedding = System.Text.Json.JsonEncodedText.Encode("sparse_embedding"); + private static readonly System.Text.Json.JsonEncodedText VariantTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + private static readonly System.Text.Json.JsonEncodedText VariantTextEmbeddingBits = System.Text.Json.JsonEncodedText.Encode("text_embedding_bits"); + private static readonly System.Text.Json.JsonEncodedText VariantTextEmbeddingBytes = System.Text.Json.JsonEncodedText.Encode("text_embedding_bytes"); + + public override Elastic.Clients.Elasticsearch.Inference.InferenceResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantCompletion)) + { + variantType = VariantCompletion.Value; + reader.Read(); + variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); + continue; + } + + if (reader.ValueTextEquals(VariantRerank)) + { + variantType = VariantRerank.Value; + reader.Read(); + variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); + continue; + } + + if (reader.ValueTextEquals(VariantSparseEmbedding)) + { + variantType = VariantSparseEmbedding.Value; + reader.Read(); + variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); + continue; + } + + if (reader.ValueTextEquals(VariantTextEmbedding)) + { + variantType = VariantTextEmbedding.Value; + reader.Read(); + variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); + continue; + } + + if (reader.ValueTextEquals(VariantTextEmbeddingBits)) + { + variantType = VariantTextEmbeddingBits.Value; + reader.Read(); + variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); + continue; + } + + if (reader.ValueTextEquals(VariantTextEmbeddingBytes)) + { + variantType = VariantTextEmbeddingBytes.Value; + reader.Read(); + variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.InferenceResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.InferenceResult value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "completion": + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + break; + case "rerank": + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + break; + case "sparse_embedding": + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + break; + case "text_embedding": + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + break; + case "text_embedding_bits": + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + break; + case "text_embedding_bytes": + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Inference.InferenceResult)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceResult.g.cs index dc386988932..5b12f8bdd8f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceResult.g.cs @@ -23,121 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class InferenceResultConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); - private static readonly System.Text.Json.JsonEncodedText VariantRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); - private static readonly System.Text.Json.JsonEncodedText VariantSparseEmbedding = System.Text.Json.JsonEncodedText.Encode("sparse_embedding"); - private static readonly System.Text.Json.JsonEncodedText VariantTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - private static readonly System.Text.Json.JsonEncodedText VariantTextEmbeddingBits = System.Text.Json.JsonEncodedText.Encode("text_embedding_bits"); - private static readonly System.Text.Json.JsonEncodedText VariantTextEmbeddingBytes = System.Text.Json.JsonEncodedText.Encode("text_embedding_bytes"); - - public override Elastic.Clients.Elasticsearch.Inference.InferenceResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantCompletion)) - { - variantType = VariantCompletion.Value; - reader.Read(); - variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); - continue; - } - - if (reader.ValueTextEquals(VariantRerank)) - { - variantType = VariantRerank.Value; - reader.Read(); - variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); - continue; - } - - if (reader.ValueTextEquals(VariantSparseEmbedding)) - { - variantType = VariantSparseEmbedding.Value; - reader.Read(); - variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); - continue; - } - - if (reader.ValueTextEquals(VariantTextEmbedding)) - { - variantType = VariantTextEmbedding.Value; - reader.Read(); - variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); - continue; - } - - if (reader.ValueTextEquals(VariantTextEmbeddingBits)) - { - variantType = VariantTextEmbeddingBits.Value; - reader.Read(); - variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); - continue; - } - - if (reader.ValueTextEquals(VariantTextEmbeddingBytes)) - { - variantType = VariantTextEmbeddingBytes.Value; - reader.Read(); - variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.InferenceResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.InferenceResult value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "completion": - writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - break; - case "rerank": - writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - break; - case "sparse_embedding": - writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - break; - case "text_embedding": - writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - break; - case "text_embedding_bits": - writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - break; - case "text_embedding_bytes": - writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Inference.InferenceResult)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.InferenceResultConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.InferenceResultConverter))] public sealed partial class InferenceResult { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAIServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAIServiceSettings.Converters.g.cs new file mode 100644 index 00000000000..9df720289bc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAIServiceSettings.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class JinaAIServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); + private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); + private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); + private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); + + public override Elastic.Clients.Elasticsearch.Inference.JinaAIServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApiKey = default; + LocalJsonValue propModelId = default; + LocalJsonValue propRateLimit = default; + LocalJsonValue propSimilarity = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) + { + continue; + } + + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) + { + continue; + } + + if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) + { + continue; + } + + if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, static Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.JinaAIServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ApiKey = propApiKey.Value, + ModelId = propModelId.Value, + RateLimit = propRateLimit.Value, + Similarity = propSimilarity.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.JinaAIServiceSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); + writer.WriteProperty(options, PropModelId, value.ModelId, null, null); + writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); + writer.WriteProperty(options, PropSimilarity, value.Similarity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAIServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAIServiceSettings.g.cs index 8b9cb8ec2d2..4ccefdf000b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAIServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAIServiceSettings.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class JinaAIServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); - private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); - private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); - private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); - - public override Elastic.Clients.Elasticsearch.Inference.JinaAIServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propApiKey = default; - LocalJsonValue propModelId = default; - LocalJsonValue propRateLimit = default; - LocalJsonValue propSimilarity = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) - { - continue; - } - - if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) - { - continue; - } - - if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) - { - continue; - } - - if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, static Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.JinaAIServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ApiKey = propApiKey.Value, - ModelId = propModelId.Value, - RateLimit = propRateLimit.Value, - Similarity = propSimilarity.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.JinaAIServiceSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); - writer.WriteProperty(options, PropModelId, value.ModelId, null, null); - writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); - writer.WriteProperty(options, PropSimilarity, value.Similarity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.JinaAIServiceSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.JinaAIServiceSettingsConverter))] public sealed partial class JinaAIServiceSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAISimilarityType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAISimilarityType.Converters.g.cs new file mode 100644 index 00000000000..d8aadbe20c2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAISimilarityType.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class JinaAISimilarityTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCosine = System.Text.Json.JsonEncodedText.Encode("cosine"); + private static readonly System.Text.Json.JsonEncodedText MemberDotProduct = System.Text.Json.JsonEncodedText.Encode("dot_product"); + private static readonly System.Text.Json.JsonEncodedText MemberL2Norm = System.Text.Json.JsonEncodedText.Encode("l2_norm"); + + public override Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCosine)) + { + return Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType.Cosine; + } + + if (reader.ValueTextEquals(MemberDotProduct)) + { + return Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType.DotProduct; + } + + if (reader.ValueTextEquals(MemberL2Norm)) + { + return Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType.L2Norm; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCosine.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType.Cosine; + } + + if (string.Equals(value, MemberDotProduct.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType.DotProduct; + } + + if (string.Equals(value, MemberL2Norm.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType.L2Norm; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType.Cosine: + writer.WriteStringValue(MemberCosine); + break; + case Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType.DotProduct: + writer.WriteStringValue(MemberDotProduct); + break; + case Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType.L2Norm: + writer.WriteStringValue(MemberL2Norm); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.JinaAISimilarityType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAISimilarityType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAISimilarityType.g.cs new file mode 100644 index 00000000000..c3fd8b92396 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAISimilarityType.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.JinaAISimilarityTypeConverter))] +public enum JinaAISimilarityType +{ + [System.Runtime.Serialization.EnumMember(Value = "cosine")] + Cosine, + [System.Runtime.Serialization.EnumMember(Value = "dot_product")] + DotProduct, + [System.Runtime.Serialization.EnumMember(Value = "l2_norm")] + L2Norm +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskSettings.Converters.g.cs new file mode 100644 index 00000000000..59ff8f656af --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskSettings.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class JinaAITaskSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropReturnDocuments = System.Text.Json.JsonEncodedText.Encode("return_documents"); + private static readonly System.Text.Json.JsonEncodedText PropTask = System.Text.Json.JsonEncodedText.Encode("task"); + private static readonly System.Text.Json.JsonEncodedText PropTopN = System.Text.Json.JsonEncodedText.Encode("top_n"); + + public override Elastic.Clients.Elasticsearch.Inference.JinaAITaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propReturnDocuments = default; + LocalJsonValue propTask = default; + LocalJsonValue propTopN = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propReturnDocuments.TryReadProperty(ref reader, options, PropReturnDocuments, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTask.TryReadProperty(ref reader, options, PropTask, static Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTopN.TryReadProperty(ref reader, options, PropTopN, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.JinaAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ReturnDocuments = propReturnDocuments.Value, + Task = propTask.Value, + TopN = propTopN.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.JinaAITaskSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropReturnDocuments, value.ReturnDocuments, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTask, value.Task, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTopN, value.TopN, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskSettings.g.cs index 487112a0a00..41465c85e2c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskSettings.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class JinaAITaskSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropReturnDocuments = System.Text.Json.JsonEncodedText.Encode("return_documents"); - private static readonly System.Text.Json.JsonEncodedText PropTask = System.Text.Json.JsonEncodedText.Encode("task"); - private static readonly System.Text.Json.JsonEncodedText PropTopN = System.Text.Json.JsonEncodedText.Encode("top_n"); - - public override Elastic.Clients.Elasticsearch.Inference.JinaAITaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propReturnDocuments = default; - LocalJsonValue propTask = default; - LocalJsonValue propTopN = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propReturnDocuments.TryReadProperty(ref reader, options, PropReturnDocuments, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTask.TryReadProperty(ref reader, options, PropTask, static Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTopN.TryReadProperty(ref reader, options, PropTopN, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.JinaAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ReturnDocuments = propReturnDocuments.Value, - Task = propTask.Value, - TopN = propTopN.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.JinaAITaskSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropReturnDocuments, value.ReturnDocuments, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTask, value.Task, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTopN, value.TopN, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.JinaAITaskSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.JinaAITaskSettingsConverter))] public sealed partial class JinaAITaskSettings { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskType.Converters.g.cs new file mode 100644 index 00000000000..b6aa41a4bc8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskType.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class JinaAITaskTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.JinaAITaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberRerank)) + { + return Elastic.Clients.Elasticsearch.Inference.JinaAITaskType.Rerank; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.JinaAITaskType.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.JinaAITaskType.Rerank; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.JinaAITaskType.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.JinaAITaskType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.JinaAITaskType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.JinaAITaskType.Rerank: + writer.WriteStringValue(MemberRerank); + break; + case Elastic.Clients.Elasticsearch.Inference.JinaAITaskType.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.JinaAITaskType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.JinaAITaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.JinaAITaskType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskType.g.cs new file mode 100644 index 00000000000..934318b2ff6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITaskType.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.JinaAITaskTypeConverter))] +public enum JinaAITaskType +{ + [System.Runtime.Serialization.EnumMember(Value = "rerank")] + Rerank, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITextEmbeddingTask.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITextEmbeddingTask.Converters.g.cs new file mode 100644 index 00000000000..a1b1bf62b96 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITextEmbeddingTask.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class JinaAITextEmbeddingTaskConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberClassification = System.Text.Json.JsonEncodedText.Encode("classification"); + private static readonly System.Text.Json.JsonEncodedText MemberClustering = System.Text.Json.JsonEncodedText.Encode("clustering"); + private static readonly System.Text.Json.JsonEncodedText MemberIngest = System.Text.Json.JsonEncodedText.Encode("ingest"); + private static readonly System.Text.Json.JsonEncodedText MemberSearch = System.Text.Json.JsonEncodedText.Encode("search"); + + public override Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberClassification)) + { + return Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask.Classification; + } + + if (reader.ValueTextEquals(MemberClustering)) + { + return Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask.Clustering; + } + + if (reader.ValueTextEquals(MemberIngest)) + { + return Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask.Ingest; + } + + if (reader.ValueTextEquals(MemberSearch)) + { + return Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask.Search; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberClassification.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask.Classification; + } + + if (string.Equals(value, MemberClustering.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask.Clustering; + } + + if (string.Equals(value, MemberIngest.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask.Ingest; + } + + if (string.Equals(value, MemberSearch.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask.Search; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask.Classification: + writer.WriteStringValue(MemberClassification); + break; + case Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask.Clustering: + writer.WriteStringValue(MemberClustering); + break; + case Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask.Ingest: + writer.WriteStringValue(MemberIngest); + break; + case Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask.Search: + writer.WriteStringValue(MemberSearch); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.JinaAITextEmbeddingTask value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITextEmbeddingTask.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITextEmbeddingTask.g.cs new file mode 100644 index 00000000000..520976d91ce --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/JinaAITextEmbeddingTask.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.JinaAITextEmbeddingTaskConverter))] +public enum JinaAITextEmbeddingTask +{ + [System.Runtime.Serialization.EnumMember(Value = "classification")] + Classification, + [System.Runtime.Serialization.EnumMember(Value = "clustering")] + Clustering, + [System.Runtime.Serialization.EnumMember(Value = "ingest")] + Ingest, + [System.Runtime.Serialization.EnumMember(Value = "search")] + Search +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/LlamaServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/LlamaServiceSettings.Converters.g.cs new file mode 100644 index 00000000000..f2405b91d20 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/LlamaServiceSettings.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class LlamaServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxInputTokens = System.Text.Json.JsonEncodedText.Encode("max_input_tokens"); + private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); + private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); + private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); + private static readonly System.Text.Json.JsonEncodedText PropUrl = System.Text.Json.JsonEncodedText.Encode("url"); + + public override Elastic.Clients.Elasticsearch.Inference.LlamaServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxInputTokens = default; + LocalJsonValue propModelId = default; + LocalJsonValue propRateLimit = default; + LocalJsonValue propSimilarity = default; + LocalJsonValue propUrl = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxInputTokens.TryReadProperty(ref reader, options, PropMaxInputTokens, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) + { + continue; + } + + if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) + { + continue; + } + + if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, static Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propUrl.TryReadProperty(ref reader, options, PropUrl, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.LlamaServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxInputTokens = propMaxInputTokens.Value, + ModelId = propModelId.Value, + RateLimit = propRateLimit.Value, + Similarity = propSimilarity.Value, + Url = propUrl.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.LlamaServiceSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxInputTokens, value.MaxInputTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropModelId, value.ModelId, null, null); + writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); + writer.WriteProperty(options, PropSimilarity, value.Similarity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropUrl, value.Url, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/LlamaServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/LlamaServiceSettings.g.cs index 325e67bee82..b299e58d2c5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/LlamaServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/LlamaServiceSettings.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class LlamaServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxInputTokens = System.Text.Json.JsonEncodedText.Encode("max_input_tokens"); - private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); - private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); - private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); - private static readonly System.Text.Json.JsonEncodedText PropUrl = System.Text.Json.JsonEncodedText.Encode("url"); - - public override Elastic.Clients.Elasticsearch.Inference.LlamaServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxInputTokens = default; - LocalJsonValue propModelId = default; - LocalJsonValue propRateLimit = default; - LocalJsonValue propSimilarity = default; - LocalJsonValue propUrl = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxInputTokens.TryReadProperty(ref reader, options, PropMaxInputTokens, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) - { - continue; - } - - if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) - { - continue; - } - - if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, static Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propUrl.TryReadProperty(ref reader, options, PropUrl, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.LlamaServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxInputTokens = propMaxInputTokens.Value, - ModelId = propModelId.Value, - RateLimit = propRateLimit.Value, - Similarity = propSimilarity.Value, - Url = propUrl.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.LlamaServiceSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxInputTokens, value.MaxInputTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropModelId, value.ModelId, null, null); - writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); - writer.WriteProperty(options, PropSimilarity, value.Similarity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropUrl, value.Url, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.LlamaServiceSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.LlamaServiceSettingsConverter))] public sealed partial class LlamaServiceSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/LlamaSimilarityType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/LlamaSimilarityType.Converters.g.cs new file mode 100644 index 00000000000..177592ac1a0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/LlamaSimilarityType.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class LlamaSimilarityTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCosine = System.Text.Json.JsonEncodedText.Encode("cosine"); + private static readonly System.Text.Json.JsonEncodedText MemberDotProduct = System.Text.Json.JsonEncodedText.Encode("dot_product"); + private static readonly System.Text.Json.JsonEncodedText MemberL2Norm = System.Text.Json.JsonEncodedText.Encode("l2_norm"); + + public override Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCosine)) + { + return Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType.Cosine; + } + + if (reader.ValueTextEquals(MemberDotProduct)) + { + return Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType.DotProduct; + } + + if (reader.ValueTextEquals(MemberL2Norm)) + { + return Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType.L2Norm; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCosine.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType.Cosine; + } + + if (string.Equals(value, MemberDotProduct.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType.DotProduct; + } + + if (string.Equals(value, MemberL2Norm.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType.L2Norm; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType.Cosine: + writer.WriteStringValue(MemberCosine); + break; + case Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType.DotProduct: + writer.WriteStringValue(MemberDotProduct); + break; + case Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType.L2Norm: + writer.WriteStringValue(MemberL2Norm); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.LlamaSimilarityType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/LlamaSimilarityType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/LlamaSimilarityType.g.cs new file mode 100644 index 00000000000..070612a6ef6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/LlamaSimilarityType.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.LlamaSimilarityTypeConverter))] +public enum LlamaSimilarityType +{ + [System.Runtime.Serialization.EnumMember(Value = "cosine")] + Cosine, + [System.Runtime.Serialization.EnumMember(Value = "dot_product")] + DotProduct, + [System.Runtime.Serialization.EnumMember(Value = "l2_norm")] + L2Norm +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/LlamaTaskType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/LlamaTaskType.Converters.g.cs new file mode 100644 index 00000000000..e91ff607ecd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/LlamaTaskType.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class LlamaTaskTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.LlamaTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberChatCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.LlamaTaskType.ChatCompletion; + } + + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.LlamaTaskType.Completion; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.LlamaTaskType.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.LlamaTaskType.ChatCompletion; + } + + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.LlamaTaskType.Completion; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.LlamaTaskType.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.LlamaTaskType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.LlamaTaskType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.LlamaTaskType.ChatCompletion: + writer.WriteStringValue(MemberChatCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.LlamaTaskType.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.LlamaTaskType.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.LlamaTaskType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.LlamaTaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.LlamaTaskType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/LlamaTaskType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/LlamaTaskType.g.cs new file mode 100644 index 00000000000..ae1d6ff55c8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/LlamaTaskType.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.LlamaTaskTypeConverter))] +public enum LlamaTaskType +{ + [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] + ChatCompletion, + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Message.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Message.Converters.g.cs new file mode 100644 index 00000000000..2a759117de2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Message.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class MessageConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropContent = System.Text.Json.JsonEncodedText.Encode("content"); + private static readonly System.Text.Json.JsonEncodedText PropRole = System.Text.Json.JsonEncodedText.Encode("role"); + private static readonly System.Text.Json.JsonEncodedText PropToolCallId = System.Text.Json.JsonEncodedText.Encode("tool_call_id"); + private static readonly System.Text.Json.JsonEncodedText PropToolCalls = System.Text.Json.JsonEncodedText.Encode("tool_calls"); + + public override Elastic.Clients.Elasticsearch.Inference.Message Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>?> propContent = default; + LocalJsonValue propRole = default; + LocalJsonValue propToolCallId = default; + LocalJsonValue?> propToolCalls = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propContent.TryReadProperty(ref reader, options, PropContent, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propRole.TryReadProperty(ref reader, options, PropRole, null)) + { + continue; + } + + if (propToolCallId.TryReadProperty(ref reader, options, PropToolCallId, null)) + { + continue; + } + + if (propToolCalls.TryReadProperty(ref reader, options, PropToolCalls, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.Message(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Content = propContent.Value, + Role = propRole.Value, + ToolCallId = propToolCallId.Value, + ToolCalls = propToolCalls.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.Message value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropContent, value.Content, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropRole, value.Role, null, null); + writer.WriteProperty(options, PropToolCallId, value.ToolCallId, null, null); + writer.WriteProperty(options, PropToolCalls, value.ToolCalls, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Message.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Message.g.cs index 35037af3295..f25c2a73747 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Message.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Message.g.cs @@ -23,78 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class MessageConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropContent = System.Text.Json.JsonEncodedText.Encode("content"); - private static readonly System.Text.Json.JsonEncodedText PropRole = System.Text.Json.JsonEncodedText.Encode("role"); - private static readonly System.Text.Json.JsonEncodedText PropToolCallId = System.Text.Json.JsonEncodedText.Encode("tool_call_id"); - private static readonly System.Text.Json.JsonEncodedText PropToolCalls = System.Text.Json.JsonEncodedText.Encode("tool_calls"); - - public override Elastic.Clients.Elasticsearch.Inference.Message Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>?> propContent = default; - LocalJsonValue propRole = default; - LocalJsonValue propToolCallId = default; - LocalJsonValue?> propToolCalls = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propContent.TryReadProperty(ref reader, options, PropContent, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propRole.TryReadProperty(ref reader, options, PropRole, null)) - { - continue; - } - - if (propToolCallId.TryReadProperty(ref reader, options, PropToolCallId, null)) - { - continue; - } - - if (propToolCalls.TryReadProperty(ref reader, options, PropToolCalls, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.Message(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Content = propContent.Value, - Role = propRole.Value, - ToolCallId = propToolCallId.Value, - ToolCalls = propToolCalls.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.Message value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropContent, value.Content, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropRole, value.Role, null, null); - writer.WriteProperty(options, PropToolCallId, value.ToolCallId, null, null); - writer.WriteProperty(options, PropToolCalls, value.ToolCalls, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// An object representing part of the conversation. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.MessageConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.MessageConverter))] public sealed partial class Message { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/MistralServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/MistralServiceSettings.Converters.g.cs new file mode 100644 index 00000000000..b23153c1846 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/MistralServiceSettings.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class MistralServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); + private static readonly System.Text.Json.JsonEncodedText PropMaxInputTokens = System.Text.Json.JsonEncodedText.Encode("max_input_tokens"); + private static readonly System.Text.Json.JsonEncodedText PropModel = System.Text.Json.JsonEncodedText.Encode("model"); + private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); + + public override Elastic.Clients.Elasticsearch.Inference.MistralServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApiKey = default; + LocalJsonValue propMaxInputTokens = default; + LocalJsonValue propModel = default; + LocalJsonValue propRateLimit = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) + { + continue; + } + + if (propMaxInputTokens.TryReadProperty(ref reader, options, PropMaxInputTokens, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propModel.TryReadProperty(ref reader, options, PropModel, null)) + { + continue; + } + + if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.MistralServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ApiKey = propApiKey.Value, + MaxInputTokens = propMaxInputTokens.Value, + Model = propModel.Value, + RateLimit = propRateLimit.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.MistralServiceSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); + writer.WriteProperty(options, PropMaxInputTokens, value.MaxInputTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropModel, value.Model, null, null); + writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/MistralServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/MistralServiceSettings.g.cs index 95acd2b7cd6..3bf1dbf21bd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/MistralServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/MistralServiceSettings.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class MistralServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); - private static readonly System.Text.Json.JsonEncodedText PropMaxInputTokens = System.Text.Json.JsonEncodedText.Encode("max_input_tokens"); - private static readonly System.Text.Json.JsonEncodedText PropModel = System.Text.Json.JsonEncodedText.Encode("model"); - private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); - - public override Elastic.Clients.Elasticsearch.Inference.MistralServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propApiKey = default; - LocalJsonValue propMaxInputTokens = default; - LocalJsonValue propModel = default; - LocalJsonValue propRateLimit = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) - { - continue; - } - - if (propMaxInputTokens.TryReadProperty(ref reader, options, PropMaxInputTokens, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propModel.TryReadProperty(ref reader, options, PropModel, null)) - { - continue; - } - - if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.MistralServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ApiKey = propApiKey.Value, - MaxInputTokens = propMaxInputTokens.Value, - Model = propModel.Value, - RateLimit = propRateLimit.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.MistralServiceSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); - writer.WriteProperty(options, PropMaxInputTokens, value.MaxInputTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropModel, value.Model, null, null); - writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.MistralServiceSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.MistralServiceSettingsConverter))] public sealed partial class MistralServiceSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/MistralTaskType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/MistralTaskType.Converters.g.cs new file mode 100644 index 00000000000..5df5f997638 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/MistralTaskType.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class MistralTaskTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.MistralTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberChatCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.MistralTaskType.ChatCompletion; + } + + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.MistralTaskType.Completion; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.MistralTaskType.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.MistralTaskType.ChatCompletion; + } + + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.MistralTaskType.Completion; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.MistralTaskType.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.MistralTaskType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.MistralTaskType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.MistralTaskType.ChatCompletion: + writer.WriteStringValue(MemberChatCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.MistralTaskType.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.MistralTaskType.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.MistralTaskType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.MistralTaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.MistralTaskType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/MistralTaskType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/MistralTaskType.g.cs new file mode 100644 index 00000000000..da8fb037734 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/MistralTaskType.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.MistralTaskTypeConverter))] +public enum MistralTaskType +{ + [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] + ChatCompletion, + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAIServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAIServiceSettings.Converters.g.cs new file mode 100644 index 00000000000..17b9065084d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAIServiceSettings.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class OpenAIServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); + private static readonly System.Text.Json.JsonEncodedText PropDimensions = System.Text.Json.JsonEncodedText.Encode("dimensions"); + private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); + private static readonly System.Text.Json.JsonEncodedText PropOrganizationId = System.Text.Json.JsonEncodedText.Encode("organization_id"); + private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); + private static readonly System.Text.Json.JsonEncodedText PropUrl = System.Text.Json.JsonEncodedText.Encode("url"); + + public override Elastic.Clients.Elasticsearch.Inference.OpenAIServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApiKey = default; + LocalJsonValue propDimensions = default; + LocalJsonValue propModelId = default; + LocalJsonValue propOrganizationId = default; + LocalJsonValue propRateLimit = default; + LocalJsonValue propUrl = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) + { + continue; + } + + if (propDimensions.TryReadProperty(ref reader, options, PropDimensions, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) + { + continue; + } + + if (propOrganizationId.TryReadProperty(ref reader, options, PropOrganizationId, null)) + { + continue; + } + + if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) + { + continue; + } + + if (propUrl.TryReadProperty(ref reader, options, PropUrl, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.OpenAIServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ApiKey = propApiKey.Value, + Dimensions = propDimensions.Value, + ModelId = propModelId.Value, + OrganizationId = propOrganizationId.Value, + RateLimit = propRateLimit.Value, + Url = propUrl.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.OpenAIServiceSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); + writer.WriteProperty(options, PropDimensions, value.Dimensions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropModelId, value.ModelId, null, null); + writer.WriteProperty(options, PropOrganizationId, value.OrganizationId, null, null); + writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); + writer.WriteProperty(options, PropUrl, value.Url, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAIServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAIServiceSettings.g.cs index 04833602fec..60c2879b683 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAIServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAIServiceSettings.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class OpenAIServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); - private static readonly System.Text.Json.JsonEncodedText PropDimensions = System.Text.Json.JsonEncodedText.Encode("dimensions"); - private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); - private static readonly System.Text.Json.JsonEncodedText PropOrganizationId = System.Text.Json.JsonEncodedText.Encode("organization_id"); - private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); - private static readonly System.Text.Json.JsonEncodedText PropUrl = System.Text.Json.JsonEncodedText.Encode("url"); - - public override Elastic.Clients.Elasticsearch.Inference.OpenAIServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propApiKey = default; - LocalJsonValue propDimensions = default; - LocalJsonValue propModelId = default; - LocalJsonValue propOrganizationId = default; - LocalJsonValue propRateLimit = default; - LocalJsonValue propUrl = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) - { - continue; - } - - if (propDimensions.TryReadProperty(ref reader, options, PropDimensions, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) - { - continue; - } - - if (propOrganizationId.TryReadProperty(ref reader, options, PropOrganizationId, null)) - { - continue; - } - - if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) - { - continue; - } - - if (propUrl.TryReadProperty(ref reader, options, PropUrl, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.OpenAIServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ApiKey = propApiKey.Value, - Dimensions = propDimensions.Value, - ModelId = propModelId.Value, - OrganizationId = propOrganizationId.Value, - RateLimit = propRateLimit.Value, - Url = propUrl.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.OpenAIServiceSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); - writer.WriteProperty(options, PropDimensions, value.Dimensions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropModelId, value.ModelId, null, null); - writer.WriteProperty(options, PropOrganizationId, value.OrganizationId, null, null); - writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); - writer.WriteProperty(options, PropUrl, value.Url, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.OpenAIServiceSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.OpenAIServiceSettingsConverter))] public sealed partial class OpenAIServiceSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskSettings.Converters.g.cs new file mode 100644 index 00000000000..12a5b5c6b80 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskSettings.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class OpenAITaskSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropUser = System.Text.Json.JsonEncodedText.Encode("user"); + + public override Elastic.Clients.Elasticsearch.Inference.OpenAITaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propUser = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propUser.TryReadProperty(ref reader, options, PropUser, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.OpenAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + User = propUser.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.OpenAITaskSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropUser, value.User, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskSettings.g.cs index 5e310b6d477..905706ae577 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskSettings.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class OpenAITaskSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropUser = System.Text.Json.JsonEncodedText.Encode("user"); - - public override Elastic.Clients.Elasticsearch.Inference.OpenAITaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propUser = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propUser.TryReadProperty(ref reader, options, PropUser, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.OpenAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - User = propUser.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.OpenAITaskSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropUser, value.User, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.OpenAITaskSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.OpenAITaskSettingsConverter))] public sealed partial class OpenAITaskSettings { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskType.Converters.g.cs new file mode 100644 index 00000000000..8ea9f177392 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskType.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class OpenAITaskTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.OpenAITaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberChatCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.OpenAITaskType.ChatCompletion; + } + + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.OpenAITaskType.Completion; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.OpenAITaskType.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.OpenAITaskType.ChatCompletion; + } + + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.OpenAITaskType.Completion; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.OpenAITaskType.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.OpenAITaskType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.OpenAITaskType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.OpenAITaskType.ChatCompletion: + writer.WriteStringValue(MemberChatCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.OpenAITaskType.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.OpenAITaskType.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.OpenAITaskType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.OpenAITaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.OpenAITaskType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskType.g.cs new file mode 100644 index 00000000000..8ce0eaa6cc2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskType.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.OpenAITaskTypeConverter))] +public enum OpenAITaskType +{ + [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] + ChatCompletion, + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RankedDocument.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RankedDocument.Converters.g.cs new file mode 100644 index 00000000000..1229ca0d93c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RankedDocument.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class RankedDocumentConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropRelevanceScore = System.Text.Json.JsonEncodedText.Encode("relevance_score"); + private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); + + public override Elastic.Clients.Elasticsearch.Inference.RankedDocument Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndex = default; + LocalJsonValue propRelevanceScore = default; + LocalJsonValue propText = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propRelevanceScore.TryReadProperty(ref reader, options, PropRelevanceScore, null)) + { + continue; + } + + if (propText.TryReadProperty(ref reader, options, PropText, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.RankedDocument(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Index = propIndex.Value, + RelevanceScore = propRelevanceScore.Value, + Text = propText.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.RankedDocument value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropRelevanceScore, value.RelevanceScore, null, null); + writer.WriteProperty(options, PropText, value.Text, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RankedDocument.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RankedDocument.g.cs index 2628ccb8216..1404d5bbead 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RankedDocument.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RankedDocument.g.cs @@ -23,63 +23,6 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class RankedDocumentConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropRelevanceScore = System.Text.Json.JsonEncodedText.Encode("relevance_score"); - private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"); - - public override Elastic.Clients.Elasticsearch.Inference.RankedDocument Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndex = default; - LocalJsonValue propRelevanceScore = default; - LocalJsonValue propText = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propRelevanceScore.TryReadProperty(ref reader, options, PropRelevanceScore, null)) - { - continue; - } - - if (propText.TryReadProperty(ref reader, options, PropText, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.RankedDocument(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Index = propIndex.Value, - RelevanceScore = propRelevanceScore.Value, - Text = propText.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.RankedDocument value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropRelevanceScore, value.RelevanceScore, null, null); - writer.WriteProperty(options, PropText, value.Text, null, null); - writer.WriteEndObject(); - } -} - /// /// /// The rerank result object representing a single ranked document @@ -88,7 +31,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// text: Optional, the text of the document, if requested /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.RankedDocumentConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.RankedDocumentConverter))] public sealed partial class RankedDocument { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RateLimitSetting.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RateLimitSetting.Converters.g.cs new file mode 100644 index 00000000000..eacf0a2f5eb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RateLimitSetting.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class RateLimitSettingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRequestsPerMinute = System.Text.Json.JsonEncodedText.Encode("requests_per_minute"); + + public override Elastic.Clients.Elasticsearch.Inference.RateLimitSetting Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propRequestsPerMinute = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRequestsPerMinute.TryReadProperty(ref reader, options, PropRequestsPerMinute, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.RateLimitSetting(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + RequestsPerMinute = propRequestsPerMinute.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.RateLimitSetting value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRequestsPerMinute, value.RequestsPerMinute, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RateLimitSetting.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RateLimitSetting.g.cs index 5d2f15da286..5f9460697c9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RateLimitSetting.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RateLimitSetting.g.cs @@ -23,51 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class RateLimitSettingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRequestsPerMinute = System.Text.Json.JsonEncodedText.Encode("requests_per_minute"); - - public override Elastic.Clients.Elasticsearch.Inference.RateLimitSetting Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propRequestsPerMinute = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRequestsPerMinute.TryReadProperty(ref reader, options, PropRequestsPerMinute, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.RateLimitSetting(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - RequestsPerMinute = propRequestsPerMinute.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.RateLimitSetting value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRequestsPerMinute, value.RequestsPerMinute, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// This setting helps to minimize the number of rate limit errors returned from the service. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.RateLimitSettingConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.RateLimitSettingConverter))] public sealed partial class RateLimitSetting { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestChatCompletion.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestChatCompletion.Converters.g.cs new file mode 100644 index 00000000000..709c1f32eb3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestChatCompletion.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class RequestChatCompletionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxCompletionTokens = System.Text.Json.JsonEncodedText.Encode("max_completion_tokens"); + private static readonly System.Text.Json.JsonEncodedText PropMessages = System.Text.Json.JsonEncodedText.Encode("messages"); + private static readonly System.Text.Json.JsonEncodedText PropModel = System.Text.Json.JsonEncodedText.Encode("model"); + private static readonly System.Text.Json.JsonEncodedText PropStop = System.Text.Json.JsonEncodedText.Encode("stop"); + private static readonly System.Text.Json.JsonEncodedText PropTemperature = System.Text.Json.JsonEncodedText.Encode("temperature"); + private static readonly System.Text.Json.JsonEncodedText PropToolChoice = System.Text.Json.JsonEncodedText.Encode("tool_choice"); + private static readonly System.Text.Json.JsonEncodedText PropTools = System.Text.Json.JsonEncodedText.Encode("tools"); + private static readonly System.Text.Json.JsonEncodedText PropTopP = System.Text.Json.JsonEncodedText.Encode("top_p"); + + public override Elastic.Clients.Elasticsearch.Inference.RequestChatCompletion Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxCompletionTokens = default; + LocalJsonValue> propMessages = default; + LocalJsonValue propModel = default; + LocalJsonValue?> propStop = default; + LocalJsonValue propTemperature = default; + LocalJsonValue?> propToolChoice = default; + LocalJsonValue?> propTools = default; + LocalJsonValue propTopP = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxCompletionTokens.TryReadProperty(ref reader, options, PropMaxCompletionTokens, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMessages.TryReadProperty(ref reader, options, PropMessages, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propModel.TryReadProperty(ref reader, options, PropModel, null)) + { + continue; + } + + if (propStop.TryReadProperty(ref reader, options, PropStop, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTemperature.TryReadProperty(ref reader, options, PropTemperature, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propToolChoice.TryReadProperty(ref reader, options, PropToolChoice, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject), null, null))) + { + continue; + } + + if (propTools.TryReadProperty(ref reader, options, PropTools, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTopP.TryReadProperty(ref reader, options, PropTopP, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.RequestChatCompletion(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxCompletionTokens = propMaxCompletionTokens.Value, + Messages = propMessages.Value, + Model = propModel.Value, + Stop = propStop.Value, + Temperature = propTemperature.Value, + ToolChoice = propToolChoice.Value, + Tools = propTools.Value, + TopP = propTopP.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.RequestChatCompletion value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxCompletionTokens, value.MaxCompletionTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMessages, value.Messages, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropModel, value.Model, null, null); + writer.WriteProperty(options, PropStop, value.Stop, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTemperature, value.Temperature, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropToolChoice, value.ToolChoice, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); + writer.WriteProperty(options, PropTools, value.Tools, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTopP, value.TopP, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestChatCompletion.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestChatCompletion.g.cs index 27a1cae4ba6..f2e4fe76c94 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestChatCompletion.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestChatCompletion.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class RequestChatCompletionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxCompletionTokens = System.Text.Json.JsonEncodedText.Encode("max_completion_tokens"); - private static readonly System.Text.Json.JsonEncodedText PropMessages = System.Text.Json.JsonEncodedText.Encode("messages"); - private static readonly System.Text.Json.JsonEncodedText PropModel = System.Text.Json.JsonEncodedText.Encode("model"); - private static readonly System.Text.Json.JsonEncodedText PropStop = System.Text.Json.JsonEncodedText.Encode("stop"); - private static readonly System.Text.Json.JsonEncodedText PropTemperature = System.Text.Json.JsonEncodedText.Encode("temperature"); - private static readonly System.Text.Json.JsonEncodedText PropToolChoice = System.Text.Json.JsonEncodedText.Encode("tool_choice"); - private static readonly System.Text.Json.JsonEncodedText PropTools = System.Text.Json.JsonEncodedText.Encode("tools"); - private static readonly System.Text.Json.JsonEncodedText PropTopP = System.Text.Json.JsonEncodedText.Encode("top_p"); - - public override Elastic.Clients.Elasticsearch.Inference.RequestChatCompletion Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxCompletionTokens = default; - LocalJsonValue> propMessages = default; - LocalJsonValue propModel = default; - LocalJsonValue?> propStop = default; - LocalJsonValue propTemperature = default; - LocalJsonValue?> propToolChoice = default; - LocalJsonValue?> propTools = default; - LocalJsonValue propTopP = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxCompletionTokens.TryReadProperty(ref reader, options, PropMaxCompletionTokens, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMessages.TryReadProperty(ref reader, options, PropMessages, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propModel.TryReadProperty(ref reader, options, PropModel, null)) - { - continue; - } - - if (propStop.TryReadProperty(ref reader, options, PropStop, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTemperature.TryReadProperty(ref reader, options, PropTemperature, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propToolChoice.TryReadProperty(ref reader, options, PropToolChoice, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject), null, null))) - { - continue; - } - - if (propTools.TryReadProperty(ref reader, options, PropTools, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTopP.TryReadProperty(ref reader, options, PropTopP, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.RequestChatCompletion(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxCompletionTokens = propMaxCompletionTokens.Value, - Messages = propMessages.Value, - Model = propModel.Value, - Stop = propStop.Value, - Temperature = propTemperature.Value, - ToolChoice = propToolChoice.Value, - Tools = propTools.Value, - TopP = propTopP.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.RequestChatCompletion value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxCompletionTokens, value.MaxCompletionTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMessages, value.Messages, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropModel, value.Model, null, null); - writer.WriteProperty(options, PropStop, value.Stop, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTemperature, value.Temperature, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropToolChoice, value.ToolChoice, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); - writer.WriteProperty(options, PropTools, value.Tools, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTopP, value.TopP, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.RequestChatCompletionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.RequestChatCompletionConverter))] public sealed partial class RequestChatCompletion { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/SparseEmbeddingResult.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/SparseEmbeddingResult.Converters.g.cs new file mode 100644 index 00000000000..c2c2d1ea02b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/SparseEmbeddingResult.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class SparseEmbeddingResultConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEmbedding = System.Text.Json.JsonEncodedText.Encode("embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.SparseEmbeddingResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propEmbedding = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEmbedding.TryReadProperty(ref reader, options, PropEmbedding, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.SparseEmbeddingResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Embedding = propEmbedding.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.SparseEmbeddingResult value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEmbedding, value.Embedding, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/SparseEmbeddingResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/SparseEmbeddingResult.g.cs index 9eeb98deeda..230a4ce2d78 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/SparseEmbeddingResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/SparseEmbeddingResult.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class SparseEmbeddingResultConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEmbedding = System.Text.Json.JsonEncodedText.Encode("embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.SparseEmbeddingResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propEmbedding = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEmbedding.TryReadProperty(ref reader, options, PropEmbedding, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.SparseEmbeddingResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Embedding = propEmbedding.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.SparseEmbeddingResult value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEmbedding, value.Embedding, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.SparseEmbeddingResultConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.SparseEmbeddingResultConverter))] public sealed partial class SparseEmbeddingResult { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskType.Converters.g.cs new file mode 100644 index 00000000000..424a7d76d35 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskType.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TaskTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); + private static readonly System.Text.Json.JsonEncodedText MemberSparseEmbedding = System.Text.Json.JsonEncodedText.Encode("sparse_embedding"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.TaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberChatCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskType.ChatCompletion; + } + + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskType.Completion; + } + + if (reader.ValueTextEquals(MemberRerank)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskType.Rerank; + } + + if (reader.ValueTextEquals(MemberSparseEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskType.SparseEmbedding; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskType.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskType.ChatCompletion; + } + + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskType.Completion; + } + + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskType.Rerank; + } + + if (string.Equals(value, MemberSparseEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskType.SparseEmbedding; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskType.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.TaskType.ChatCompletion: + writer.WriteStringValue(MemberChatCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskType.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskType.Rerank: + writer.WriteStringValue(MemberRerank); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskType.SparseEmbedding: + writer.WriteStringValue(MemberSparseEmbedding); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskType.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.TaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskType.g.cs new file mode 100644 index 00000000000..00416479812 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskType.g.cs @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TaskTypeConverter))] +public enum TaskType +{ + [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] + ChatCompletion, + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "rerank")] + Rerank, + [System.Runtime.Serialization.EnumMember(Value = "sparse_embedding")] + SparseEmbedding, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAi21.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAi21.Converters.g.cs new file mode 100644 index 00000000000..ddf50006e2a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAi21.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TaskTypeAi21Converter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAi21 Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberChatCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAi21.ChatCompletion; + } + + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAi21.Completion; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAi21.ChatCompletion; + } + + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAi21.Completion; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAi21)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAi21 value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeAi21.ChatCompletion: + writer.WriteStringValue(MemberChatCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeAi21.Completion: + writer.WriteStringValue(MemberCompletion); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAi21)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAi21 ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAi21 value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAi21.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAi21.g.cs new file mode 100644 index 00000000000..c521e6c937c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAi21.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TaskTypeAi21Converter))] +public enum TaskTypeAi21 +{ + [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] + ChatCompletion, + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAlibabaCloudAI.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAlibabaCloudAI.Converters.g.cs new file mode 100644 index 00000000000..dc5e4490452 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAlibabaCloudAI.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TaskTypeAlibabaCloudAIConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); + private static readonly System.Text.Json.JsonEncodedText MemberSparseEmbedding = System.Text.Json.JsonEncodedText.Encode("sparse_embedding"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.Completion; + } + + if (reader.ValueTextEquals(MemberRerank)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.Rerank; + } + + if (reader.ValueTextEquals(MemberSparseEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.SparseEmbedding; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.Completion; + } + + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.Rerank; + } + + if (string.Equals(value, MemberSparseEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.SparseEmbedding; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.Rerank: + writer.WriteStringValue(MemberRerank); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.SparseEmbedding: + writer.WriteStringValue(MemberSparseEmbedding); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAlibabaCloudAI value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAlibabaCloudAI.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAlibabaCloudAI.g.cs new file mode 100644 index 00000000000..6f6f4e65f37 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAlibabaCloudAI.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TaskTypeAlibabaCloudAIConverter))] +public enum TaskTypeAlibabaCloudAI +{ + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "rerank")] + Rerank, + [System.Runtime.Serialization.EnumMember(Value = "sparse_embedding")] + SparseEmbedding, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAmazonBedrock.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAmazonBedrock.Converters.g.cs new file mode 100644 index 00000000000..2ddc01d18e5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAmazonBedrock.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TaskTypeAmazonBedrockConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock.Completion; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock.Completion; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonBedrock value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAmazonBedrock.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAmazonBedrock.g.cs new file mode 100644 index 00000000000..a8d0157feea --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAmazonBedrock.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TaskTypeAmazonBedrockConverter))] +public enum TaskTypeAmazonBedrock +{ + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAmazonSageMaker.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAmazonSageMaker.Converters.g.cs new file mode 100644 index 00000000000..a6282de1ab6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAmazonSageMaker.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TaskTypeAmazonSageMakerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); + private static readonly System.Text.Json.JsonEncodedText MemberSparseEmbedding = System.Text.Json.JsonEncodedText.Encode("sparse_embedding"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberChatCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.ChatCompletion; + } + + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.Completion; + } + + if (reader.ValueTextEquals(MemberRerank)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.Rerank; + } + + if (reader.ValueTextEquals(MemberSparseEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.SparseEmbedding; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.ChatCompletion; + } + + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.Completion; + } + + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.Rerank; + } + + if (string.Equals(value, MemberSparseEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.SparseEmbedding; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.ChatCompletion: + writer.WriteStringValue(MemberChatCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.Rerank: + writer.WriteStringValue(MemberRerank); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.SparseEmbedding: + writer.WriteStringValue(MemberSparseEmbedding); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAmazonSageMaker value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAmazonSageMaker.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAmazonSageMaker.g.cs new file mode 100644 index 00000000000..360bc98cb01 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAmazonSageMaker.g.cs @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TaskTypeAmazonSageMakerConverter))] +public enum TaskTypeAmazonSageMaker +{ + [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] + ChatCompletion, + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "rerank")] + Rerank, + [System.Runtime.Serialization.EnumMember(Value = "sparse_embedding")] + SparseEmbedding, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAnthropic.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAnthropic.Converters.g.cs new file mode 100644 index 00000000000..8f53e8e5697 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAnthropic.Converters.g.cs @@ -0,0 +1,67 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TaskTypeAnthropicConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAnthropic Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAnthropic.Completion; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAnthropic.Completion; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAnthropic)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAnthropic value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeAnthropic.Completion: + writer.WriteStringValue(MemberCompletion); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAnthropic)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAnthropic ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAnthropic value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAnthropic.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAnthropic.g.cs new file mode 100644 index 00000000000..a03047899a8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAnthropic.g.cs @@ -0,0 +1,31 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TaskTypeAnthropicConverter))] +public enum TaskTypeAnthropic +{ + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAzureAIStudio.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAzureAIStudio.Converters.g.cs new file mode 100644 index 00000000000..dc829d331fa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAzureAIStudio.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TaskTypeAzureAIStudioConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio.Completion; + } + + if (reader.ValueTextEquals(MemberRerank)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio.Rerank; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio.Completion; + } + + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio.Rerank; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio.Rerank: + writer.WriteStringValue(MemberRerank); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureAIStudio value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAzureAIStudio.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAzureAIStudio.g.cs new file mode 100644 index 00000000000..b36ef1486a4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAzureAIStudio.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TaskTypeAzureAIStudioConverter))] +public enum TaskTypeAzureAIStudio +{ + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "rerank")] + Rerank, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAzureOpenAI.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAzureOpenAI.Converters.g.cs new file mode 100644 index 00000000000..1b53766b0fe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAzureOpenAI.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TaskTypeAzureOpenAIConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureOpenAI Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureOpenAI.Completion; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureOpenAI.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureOpenAI.Completion; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureOpenAI.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureOpenAI)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureOpenAI value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureOpenAI.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureOpenAI.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureOpenAI)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureOpenAI ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeAzureOpenAI value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAzureOpenAI.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAzureOpenAI.g.cs new file mode 100644 index 00000000000..4197fde5039 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeAzureOpenAI.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TaskTypeAzureOpenAIConverter))] +public enum TaskTypeAzureOpenAI +{ + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeCohere.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeCohere.Converters.g.cs new file mode 100644 index 00000000000..286b83fbaa2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeCohere.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TaskTypeCohereConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere.Completion; + } + + if (reader.ValueTextEquals(MemberRerank)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere.Rerank; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere.Completion; + } + + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere.Rerank; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere.Rerank: + writer.WriteStringValue(MemberRerank); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeCohere value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeCohere.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeCohere.g.cs new file mode 100644 index 00000000000..2e3b96231d7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeCohere.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TaskTypeCohereConverter))] +public enum TaskTypeCohere +{ + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "rerank")] + Rerank, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeCustom.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeCustom.Converters.g.cs new file mode 100644 index 00000000000..55e73935aec --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeCustom.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TaskTypeCustomConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); + private static readonly System.Text.Json.JsonEncodedText MemberSparseEmbedding = System.Text.Json.JsonEncodedText.Encode("sparse_embedding"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom.Completion; + } + + if (reader.ValueTextEquals(MemberRerank)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom.Rerank; + } + + if (reader.ValueTextEquals(MemberSparseEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom.SparseEmbedding; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom.Completion; + } + + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom.Rerank; + } + + if (string.Equals(value, MemberSparseEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom.SparseEmbedding; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom.Rerank: + writer.WriteStringValue(MemberRerank); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom.SparseEmbedding: + writer.WriteStringValue(MemberSparseEmbedding); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeCustom value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeCustom.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeCustom.g.cs new file mode 100644 index 00000000000..b9330dbfd3f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeCustom.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TaskTypeCustomConverter))] +public enum TaskTypeCustom +{ + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "rerank")] + Rerank, + [System.Runtime.Serialization.EnumMember(Value = "sparse_embedding")] + SparseEmbedding, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeDeepSeek.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeDeepSeek.Converters.g.cs new file mode 100644 index 00000000000..c0af90c7e10 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeDeepSeek.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TaskTypeDeepSeekConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeDeepSeek Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberChatCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeDeepSeek.ChatCompletion; + } + + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeDeepSeek.Completion; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeDeepSeek.ChatCompletion; + } + + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeDeepSeek.Completion; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeDeepSeek)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeDeepSeek value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeDeepSeek.ChatCompletion: + writer.WriteStringValue(MemberChatCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeDeepSeek.Completion: + writer.WriteStringValue(MemberCompletion); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeDeepSeek)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeDeepSeek ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeDeepSeek value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeDeepSeek.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeDeepSeek.g.cs new file mode 100644 index 00000000000..35ccee2d7d3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeDeepSeek.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TaskTypeDeepSeekConverter))] +public enum TaskTypeDeepSeek +{ + [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] + ChatCompletion, + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeELSER.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeELSER.Converters.g.cs new file mode 100644 index 00000000000..bb80b606d55 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeELSER.Converters.g.cs @@ -0,0 +1,67 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TaskTypeELSERConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberSparseEmbedding = System.Text.Json.JsonEncodedText.Encode("sparse_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeELSER Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberSparseEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeELSER.SparseEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberSparseEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeELSER.SparseEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeELSER)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeELSER value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeELSER.SparseEmbedding: + writer.WriteStringValue(MemberSparseEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeELSER)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeELSER ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeELSER value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeELSER.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeELSER.g.cs new file mode 100644 index 00000000000..a6203073de0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeELSER.g.cs @@ -0,0 +1,31 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TaskTypeELSERConverter))] +public enum TaskTypeELSER +{ + [System.Runtime.Serialization.EnumMember(Value = "sparse_embedding")] + SparseEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeElasticsearch.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeElasticsearch.Converters.g.cs new file mode 100644 index 00000000000..8217d63c4f7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeElasticsearch.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TaskTypeElasticsearchConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); + private static readonly System.Text.Json.JsonEncodedText MemberSparseEmbedding = System.Text.Json.JsonEncodedText.Encode("sparse_embedding"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberRerank)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch.Rerank; + } + + if (reader.ValueTextEquals(MemberSparseEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch.SparseEmbedding; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch.Rerank; + } + + if (string.Equals(value, MemberSparseEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch.SparseEmbedding; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch.Rerank: + writer.WriteStringValue(MemberRerank); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch.SparseEmbedding: + writer.WriteStringValue(MemberSparseEmbedding); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeElasticsearch value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeElasticsearch.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeElasticsearch.g.cs new file mode 100644 index 00000000000..9c5e611a337 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeElasticsearch.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TaskTypeElasticsearchConverter))] +public enum TaskTypeElasticsearch +{ + [System.Runtime.Serialization.EnumMember(Value = "rerank")] + Rerank, + [System.Runtime.Serialization.EnumMember(Value = "sparse_embedding")] + SparseEmbedding, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeGoogleAIStudio.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeGoogleAIStudio.Converters.g.cs new file mode 100644 index 00000000000..2aab02ee77f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeGoogleAIStudio.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TaskTypeGoogleAIStudioConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleAIStudio Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleAIStudio.Completion; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleAIStudio.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleAIStudio.Completion; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleAIStudio.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleAIStudio)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleAIStudio value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleAIStudio.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleAIStudio.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleAIStudio)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleAIStudio ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleAIStudio value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeGoogleAIStudio.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeGoogleAIStudio.g.cs new file mode 100644 index 00000000000..02ba3fb8850 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeGoogleAIStudio.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TaskTypeGoogleAIStudioConverter))] +public enum TaskTypeGoogleAIStudio +{ + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeGoogleVertexAI.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeGoogleVertexAI.Converters.g.cs new file mode 100644 index 00000000000..bfc939c9240 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeGoogleVertexAI.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TaskTypeGoogleVertexAIConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberRerank)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI.Rerank; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI.Rerank; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI.Rerank: + writer.WriteStringValue(MemberRerank); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeGoogleVertexAI.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeGoogleVertexAI.g.cs new file mode 100644 index 00000000000..ad2099eda5a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeGoogleVertexAI.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TaskTypeGoogleVertexAIConverter))] +public enum TaskTypeGoogleVertexAI +{ + [System.Runtime.Serialization.EnumMember(Value = "rerank")] + Rerank, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeHuggingFace.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeHuggingFace.Converters.g.cs new file mode 100644 index 00000000000..db5d4ce54f7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeHuggingFace.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TaskTypeHuggingFaceConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberChatCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace.ChatCompletion; + } + + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace.Completion; + } + + if (reader.ValueTextEquals(MemberRerank)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace.Rerank; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace.ChatCompletion; + } + + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace.Completion; + } + + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace.Rerank; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace.ChatCompletion: + writer.WriteStringValue(MemberChatCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace.Rerank: + writer.WriteStringValue(MemberRerank); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeHuggingFace value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeHuggingFace.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeHuggingFace.g.cs new file mode 100644 index 00000000000..85792c78e1d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeHuggingFace.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TaskTypeHuggingFaceConverter))] +public enum TaskTypeHuggingFace +{ + [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] + ChatCompletion, + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "rerank")] + Rerank, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeJinaAi.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeJinaAi.Converters.g.cs new file mode 100644 index 00000000000..dbbd20cb1af --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeJinaAi.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TaskTypeJinaAiConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberRerank)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi.Rerank; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi.Rerank; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi.Rerank: + writer.WriteStringValue(MemberRerank); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeJinaAi value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeJinaAi.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeJinaAi.g.cs new file mode 100644 index 00000000000..0fe1406d187 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeJinaAi.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TaskTypeJinaAiConverter))] +public enum TaskTypeJinaAi +{ + [System.Runtime.Serialization.EnumMember(Value = "rerank")] + Rerank, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeLlama.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeLlama.Converters.g.cs new file mode 100644 index 00000000000..a92c46fafc1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeLlama.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TaskTypeLlamaConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberChatCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama.ChatCompletion; + } + + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama.Completion; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama.ChatCompletion; + } + + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama.Completion; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama.ChatCompletion: + writer.WriteStringValue(MemberChatCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeLlama value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeLlama.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeLlama.g.cs new file mode 100644 index 00000000000..71898244bf3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeLlama.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TaskTypeLlamaConverter))] +public enum TaskTypeLlama +{ + [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] + ChatCompletion, + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeMistral.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeMistral.Converters.g.cs new file mode 100644 index 00000000000..a67aad253b2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeMistral.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TaskTypeMistralConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberChatCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral.ChatCompletion; + } + + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral.Completion; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral.ChatCompletion; + } + + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral.Completion; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral.ChatCompletion: + writer.WriteStringValue(MemberChatCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeMistral value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeMistral.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeMistral.g.cs new file mode 100644 index 00000000000..a050b807049 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeMistral.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TaskTypeMistralConverter))] +public enum TaskTypeMistral +{ + [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] + ChatCompletion, + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeOpenAI.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeOpenAI.Converters.g.cs new file mode 100644 index 00000000000..4a8c60c6169 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeOpenAI.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TaskTypeOpenAIConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberChatCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI.ChatCompletion; + } + + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI.Completion; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI.ChatCompletion; + } + + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI.Completion; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI.ChatCompletion: + writer.WriteStringValue(MemberChatCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeOpenAI value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeOpenAI.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeOpenAI.g.cs new file mode 100644 index 00000000000..081b1571ae4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeOpenAI.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TaskTypeOpenAIConverter))] +public enum TaskTypeOpenAI +{ + [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] + ChatCompletion, + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeVoyageAI.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeVoyageAI.Converters.g.cs new file mode 100644 index 00000000000..2f6672c10d7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeVoyageAI.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TaskTypeVoyageAIConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeVoyageAI Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberRerank)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeVoyageAI.Rerank; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeVoyageAI.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeVoyageAI.Rerank; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeVoyageAI.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeVoyageAI)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeVoyageAI value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeVoyageAI.Rerank: + writer.WriteStringValue(MemberRerank); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeVoyageAI.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeVoyageAI)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeVoyageAI ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeVoyageAI value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeVoyageAI.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeVoyageAI.g.cs new file mode 100644 index 00000000000..8c4ca01b532 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeVoyageAI.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TaskTypeVoyageAIConverter))] +public enum TaskTypeVoyageAI +{ + [System.Runtime.Serialization.EnumMember(Value = "rerank")] + Rerank, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeWatsonx.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeWatsonx.Converters.g.cs new file mode 100644 index 00000000000..c714ed30378 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeWatsonx.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TaskTypeWatsonxConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberChatCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx.ChatCompletion; + } + + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx.Completion; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx.ChatCompletion; + } + + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx.Completion; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx.ChatCompletion: + writer.WriteStringValue(MemberChatCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeWatsonx value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeWatsonx.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeWatsonx.g.cs new file mode 100644 index 00000000000..e33ef766b32 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeWatsonx.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TaskTypeWatsonxConverter))] +public enum TaskTypeWatsonx +{ + [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] + ChatCompletion, + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingByteResult.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingByteResult.Converters.g.cs new file mode 100644 index 00000000000..60272cc22b7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingByteResult.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TextEmbeddingByteResultConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEmbedding = System.Text.Json.JsonEncodedText.Encode("embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.TextEmbeddingByteResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propEmbedding = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEmbedding.TryReadProperty(ref reader, options, PropEmbedding, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.TextEmbeddingByteResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Embedding = propEmbedding.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TextEmbeddingByteResult value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEmbedding, value.Embedding, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingByteResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingByteResult.g.cs index bc8631eb841..7c69ae865e7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingByteResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingByteResult.g.cs @@ -23,51 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class TextEmbeddingByteResultConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEmbedding = System.Text.Json.JsonEncodedText.Encode("embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.TextEmbeddingByteResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propEmbedding = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEmbedding.TryReadProperty(ref reader, options, PropEmbedding, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.TextEmbeddingByteResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Embedding = propEmbedding.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TextEmbeddingByteResult value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEmbedding, value.Embedding, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// The text embedding result object for byte representation /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TextEmbeddingByteResultConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TextEmbeddingByteResultConverter))] public sealed partial class TextEmbeddingByteResult { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingInferenceResult.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingInferenceResult.Converters.g.cs new file mode 100644 index 00000000000..be03c1cbf54 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingInferenceResult.Converters.g.cs @@ -0,0 +1,102 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TextEmbeddingInferenceResultConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + private static readonly System.Text.Json.JsonEncodedText VariantTextEmbeddingBits = System.Text.Json.JsonEncodedText.Encode("text_embedding_bits"); + private static readonly System.Text.Json.JsonEncodedText VariantTextEmbeddingBytes = System.Text.Json.JsonEncodedText.Encode("text_embedding_bytes"); + + public override Elastic.Clients.Elasticsearch.Inference.TextEmbeddingInferenceResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantTextEmbedding)) + { + variantType = VariantTextEmbedding.Value; + reader.Read(); + variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); + continue; + } + + if (reader.ValueTextEquals(VariantTextEmbeddingBits)) + { + variantType = VariantTextEmbeddingBits.Value; + reader.Read(); + variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); + continue; + } + + if (reader.ValueTextEquals(VariantTextEmbeddingBytes)) + { + variantType = VariantTextEmbeddingBytes.Value; + reader.Read(); + variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.TextEmbeddingInferenceResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TextEmbeddingInferenceResult value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "text_embedding": + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + break; + case "text_embedding_bits": + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + break; + case "text_embedding_bytes": + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Inference.TextEmbeddingInferenceResult)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingInferenceResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingInferenceResult.g.cs index f55fa97ce65..c2c4dcbfd59 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingInferenceResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingInferenceResult.g.cs @@ -23,85 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class TextEmbeddingInferenceResultConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - private static readonly System.Text.Json.JsonEncodedText VariantTextEmbeddingBits = System.Text.Json.JsonEncodedText.Encode("text_embedding_bits"); - private static readonly System.Text.Json.JsonEncodedText VariantTextEmbeddingBytes = System.Text.Json.JsonEncodedText.Encode("text_embedding_bytes"); - - public override Elastic.Clients.Elasticsearch.Inference.TextEmbeddingInferenceResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantTextEmbedding)) - { - variantType = VariantTextEmbedding.Value; - reader.Read(); - variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); - continue; - } - - if (reader.ValueTextEquals(VariantTextEmbeddingBits)) - { - variantType = VariantTextEmbeddingBits.Value; - reader.Read(); - variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); - continue; - } - - if (reader.ValueTextEquals(VariantTextEmbeddingBytes)) - { - variantType = VariantTextEmbeddingBytes.Value; - reader.Read(); - variant = reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.TextEmbeddingInferenceResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TextEmbeddingInferenceResult value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "text_embedding": - writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - break; - case "text_embedding_bits": - writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - break; - case "text_embedding_bytes": - writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.IReadOnlyCollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Inference.TextEmbeddingInferenceResult)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TextEmbeddingInferenceResultConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TextEmbeddingInferenceResultConverter))] public sealed partial class TextEmbeddingInferenceResult { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingResult.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingResult.Converters.g.cs new file mode 100644 index 00000000000..58941894d1b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingResult.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class TextEmbeddingResultConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEmbedding = System.Text.Json.JsonEncodedText.Encode("embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.TextEmbeddingResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propEmbedding = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEmbedding.TryReadProperty(ref reader, options, PropEmbedding, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.TextEmbeddingResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Embedding = propEmbedding.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TextEmbeddingResult value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEmbedding, value.Embedding, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingResult.g.cs index 5285bdb8d5d..43fdac4b3b0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextEmbeddingResult.g.cs @@ -23,51 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class TextEmbeddingResultConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEmbedding = System.Text.Json.JsonEncodedText.Encode("embedding"); - - public override Elastic.Clients.Elasticsearch.Inference.TextEmbeddingResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propEmbedding = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEmbedding.TryReadProperty(ref reader, options, PropEmbedding, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.TextEmbeddingResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Embedding = propEmbedding.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TextEmbeddingResult value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEmbedding, value.Embedding, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// The text embedding result object /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.TextEmbeddingResultConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TextEmbeddingResultConverter))] public sealed partial class TextEmbeddingResult { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ToolCall.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ToolCall.Converters.g.cs new file mode 100644 index 00000000000..c799669d90b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ToolCall.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class ToolCallConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFunction = System.Text.Json.JsonEncodedText.Encode("function"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Inference.ToolCall Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFunction = default; + LocalJsonValue propId = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFunction.TryReadProperty(ref reader, options, PropFunction, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.ToolCall(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Function = propFunction.Value, + Id = propId.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ToolCall value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFunction, value.Function, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ToolCall.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ToolCall.g.cs index 0c922930ae6..0f0954a80e7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ToolCall.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ToolCall.g.cs @@ -23,69 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class ToolCallConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFunction = System.Text.Json.JsonEncodedText.Encode("function"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Inference.ToolCall Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFunction = default; - LocalJsonValue propId = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFunction.TryReadProperty(ref reader, options, PropFunction, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.ToolCall(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Function = propFunction.Value, - Id = propId.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ToolCall value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFunction, value.Function, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - /// /// /// A tool call generated by the model. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.ToolCallConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.ToolCallConverter))] public sealed partial class ToolCall { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ToolCallFunction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ToolCallFunction.Converters.g.cs new file mode 100644 index 00000000000..d9f9bcfb406 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ToolCallFunction.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class ToolCallFunctionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropArguments = System.Text.Json.JsonEncodedText.Encode("arguments"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.Inference.ToolCallFunction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propArguments = default; + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propArguments.TryReadProperty(ref reader, options, PropArguments, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.ToolCallFunction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Arguments = propArguments.Value, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ToolCallFunction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropArguments, value.Arguments, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ToolCallFunction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ToolCallFunction.g.cs index f3951dafb0f..f2a16fc9e7a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ToolCallFunction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ToolCallFunction.g.cs @@ -23,60 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class ToolCallFunctionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropArguments = System.Text.Json.JsonEncodedText.Encode("arguments"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.Inference.ToolCallFunction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propArguments = default; - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propArguments.TryReadProperty(ref reader, options, PropArguments, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.ToolCallFunction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Arguments = propArguments.Value, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ToolCallFunction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropArguments, value.Arguments, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - /// /// /// The function that the model called. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.ToolCallFunctionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.ToolCallFunctionConverter))] public sealed partial class ToolCallFunction { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/VoyageAIServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/VoyageAIServiceSettings.Converters.g.cs new file mode 100644 index 00000000000..b9270093a0d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/VoyageAIServiceSettings.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class VoyageAIServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDimensions = System.Text.Json.JsonEncodedText.Encode("dimensions"); + private static readonly System.Text.Json.JsonEncodedText PropEmbeddingType = System.Text.Json.JsonEncodedText.Encode("embedding_type"); + private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); + private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); + + public override Elastic.Clients.Elasticsearch.Inference.VoyageAIServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDimensions = default; + LocalJsonValue propEmbeddingType = default; + LocalJsonValue propModelId = default; + LocalJsonValue propRateLimit = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDimensions.TryReadProperty(ref reader, options, PropDimensions, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEmbeddingType.TryReadProperty(ref reader, options, PropEmbeddingType, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) + { + continue; + } + + if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.VoyageAIServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Dimensions = propDimensions.Value, + EmbeddingType = propEmbeddingType.Value, + ModelId = propModelId.Value, + RateLimit = propRateLimit.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.VoyageAIServiceSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDimensions, value.Dimensions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEmbeddingType, value.EmbeddingType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropModelId, value.ModelId, null, null); + writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/VoyageAIServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/VoyageAIServiceSettings.g.cs index 4f70809a62a..3e7ae4b06e3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/VoyageAIServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/VoyageAIServiceSettings.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class VoyageAIServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDimensions = System.Text.Json.JsonEncodedText.Encode("dimensions"); - private static readonly System.Text.Json.JsonEncodedText PropEmbeddingType = System.Text.Json.JsonEncodedText.Encode("embedding_type"); - private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); - private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); - - public override Elastic.Clients.Elasticsearch.Inference.VoyageAIServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDimensions = default; - LocalJsonValue propEmbeddingType = default; - LocalJsonValue propModelId = default; - LocalJsonValue propRateLimit = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDimensions.TryReadProperty(ref reader, options, PropDimensions, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEmbeddingType.TryReadProperty(ref reader, options, PropEmbeddingType, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) - { - continue; - } - - if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.VoyageAIServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Dimensions = propDimensions.Value, - EmbeddingType = propEmbeddingType.Value, - ModelId = propModelId.Value, - RateLimit = propRateLimit.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.VoyageAIServiceSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDimensions, value.Dimensions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEmbeddingType, value.EmbeddingType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropModelId, value.ModelId, null, null); - writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.VoyageAIServiceSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.VoyageAIServiceSettingsConverter))] public sealed partial class VoyageAIServiceSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/VoyageAITaskSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/VoyageAITaskSettings.Converters.g.cs new file mode 100644 index 00000000000..2ba0aa997a9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/VoyageAITaskSettings.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class VoyageAITaskSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropInputType = System.Text.Json.JsonEncodedText.Encode("input_type"); + private static readonly System.Text.Json.JsonEncodedText PropReturnDocuments = System.Text.Json.JsonEncodedText.Encode("return_documents"); + private static readonly System.Text.Json.JsonEncodedText PropTopK = System.Text.Json.JsonEncodedText.Encode("top_k"); + private static readonly System.Text.Json.JsonEncodedText PropTruncation = System.Text.Json.JsonEncodedText.Encode("truncation"); + + public override Elastic.Clients.Elasticsearch.Inference.VoyageAITaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propInputType = default; + LocalJsonValue propReturnDocuments = default; + LocalJsonValue propTopK = default; + LocalJsonValue propTruncation = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propInputType.TryReadProperty(ref reader, options, PropInputType, null)) + { + continue; + } + + if (propReturnDocuments.TryReadProperty(ref reader, options, PropReturnDocuments, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTopK.TryReadProperty(ref reader, options, PropTopK, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTruncation.TryReadProperty(ref reader, options, PropTruncation, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.VoyageAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + InputType = propInputType.Value, + ReturnDocuments = propReturnDocuments.Value, + TopK = propTopK.Value, + Truncation = propTruncation.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.VoyageAITaskSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropInputType, value.InputType, null, null); + writer.WriteProperty(options, PropReturnDocuments, value.ReturnDocuments, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTopK, value.TopK, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTruncation, value.Truncation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/VoyageAITaskSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/VoyageAITaskSettings.g.cs index d73e91e77c2..5aa95f33e74 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/VoyageAITaskSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/VoyageAITaskSettings.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class VoyageAITaskSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropInputType = System.Text.Json.JsonEncodedText.Encode("input_type"); - private static readonly System.Text.Json.JsonEncodedText PropReturnDocuments = System.Text.Json.JsonEncodedText.Encode("return_documents"); - private static readonly System.Text.Json.JsonEncodedText PropTopK = System.Text.Json.JsonEncodedText.Encode("top_k"); - private static readonly System.Text.Json.JsonEncodedText PropTruncation = System.Text.Json.JsonEncodedText.Encode("truncation"); - - public override Elastic.Clients.Elasticsearch.Inference.VoyageAITaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propInputType = default; - LocalJsonValue propReturnDocuments = default; - LocalJsonValue propTopK = default; - LocalJsonValue propTruncation = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propInputType.TryReadProperty(ref reader, options, PropInputType, null)) - { - continue; - } - - if (propReturnDocuments.TryReadProperty(ref reader, options, PropReturnDocuments, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTopK.TryReadProperty(ref reader, options, PropTopK, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTruncation.TryReadProperty(ref reader, options, PropTruncation, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.VoyageAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - InputType = propInputType.Value, - ReturnDocuments = propReturnDocuments.Value, - TopK = propTopK.Value, - Truncation = propTruncation.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.VoyageAITaskSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropInputType, value.InputType, null, null); - writer.WriteProperty(options, PropReturnDocuments, value.ReturnDocuments, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTopK, value.TopK, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTruncation, value.Truncation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.VoyageAITaskSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.VoyageAITaskSettingsConverter))] public sealed partial class VoyageAITaskSettings { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/VoyageAITaskType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/VoyageAITaskType.Converters.g.cs new file mode 100644 index 00000000000..014d9025fa0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/VoyageAITaskType.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class VoyageAITaskTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.VoyageAITaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberRerank)) + { + return Elastic.Clients.Elasticsearch.Inference.VoyageAITaskType.Rerank; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.VoyageAITaskType.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.VoyageAITaskType.Rerank; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.VoyageAITaskType.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.VoyageAITaskType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.VoyageAITaskType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.VoyageAITaskType.Rerank: + writer.WriteStringValue(MemberRerank); + break; + case Elastic.Clients.Elasticsearch.Inference.VoyageAITaskType.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.VoyageAITaskType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.VoyageAITaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.VoyageAITaskType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/VoyageAITaskType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/VoyageAITaskType.g.cs new file mode 100644 index 00000000000..0af6559a408 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/VoyageAITaskType.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.VoyageAITaskTypeConverter))] +public enum VoyageAITaskType +{ + [System.Runtime.Serialization.EnumMember(Value = "rerank")] + Rerank, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/WatsonxServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/WatsonxServiceSettings.Converters.g.cs new file mode 100644 index 00000000000..6d49d5e0c24 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/WatsonxServiceSettings.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class WatsonxServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); + private static readonly System.Text.Json.JsonEncodedText PropApiVersion = System.Text.Json.JsonEncodedText.Encode("api_version"); + private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); + private static readonly System.Text.Json.JsonEncodedText PropProjectId = System.Text.Json.JsonEncodedText.Encode("project_id"); + private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); + private static readonly System.Text.Json.JsonEncodedText PropUrl = System.Text.Json.JsonEncodedText.Encode("url"); + + public override Elastic.Clients.Elasticsearch.Inference.WatsonxServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApiKey = default; + LocalJsonValue propApiVersion = default; + LocalJsonValue propModelId = default; + LocalJsonValue propProjectId = default; + LocalJsonValue propRateLimit = default; + LocalJsonValue propUrl = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) + { + continue; + } + + if (propApiVersion.TryReadProperty(ref reader, options, PropApiVersion, null)) + { + continue; + } + + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) + { + continue; + } + + if (propProjectId.TryReadProperty(ref reader, options, PropProjectId, null)) + { + continue; + } + + if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) + { + continue; + } + + if (propUrl.TryReadProperty(ref reader, options, PropUrl, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Inference.WatsonxServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ApiKey = propApiKey.Value, + ApiVersion = propApiVersion.Value, + ModelId = propModelId.Value, + ProjectId = propProjectId.Value, + RateLimit = propRateLimit.Value, + Url = propUrl.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.WatsonxServiceSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); + writer.WriteProperty(options, PropApiVersion, value.ApiVersion, null, null); + writer.WriteProperty(options, PropModelId, value.ModelId, null, null); + writer.WriteProperty(options, PropProjectId, value.ProjectId, null, null); + writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); + writer.WriteProperty(options, PropUrl, value.Url, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/WatsonxServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/WatsonxServiceSettings.g.cs index b4aef361b59..d0f8f82b983 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/WatsonxServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/WatsonxServiceSettings.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; -internal sealed partial class WatsonxServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); - private static readonly System.Text.Json.JsonEncodedText PropApiVersion = System.Text.Json.JsonEncodedText.Encode("api_version"); - private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); - private static readonly System.Text.Json.JsonEncodedText PropProjectId = System.Text.Json.JsonEncodedText.Encode("project_id"); - private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); - private static readonly System.Text.Json.JsonEncodedText PropUrl = System.Text.Json.JsonEncodedText.Encode("url"); - - public override Elastic.Clients.Elasticsearch.Inference.WatsonxServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propApiKey = default; - LocalJsonValue propApiVersion = default; - LocalJsonValue propModelId = default; - LocalJsonValue propProjectId = default; - LocalJsonValue propRateLimit = default; - LocalJsonValue propUrl = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) - { - continue; - } - - if (propApiVersion.TryReadProperty(ref reader, options, PropApiVersion, null)) - { - continue; - } - - if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) - { - continue; - } - - if (propProjectId.TryReadProperty(ref reader, options, PropProjectId, null)) - { - continue; - } - - if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) - { - continue; - } - - if (propUrl.TryReadProperty(ref reader, options, PropUrl, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Inference.WatsonxServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ApiKey = propApiKey.Value, - ApiVersion = propApiVersion.Value, - ModelId = propModelId.Value, - ProjectId = propProjectId.Value, - RateLimit = propRateLimit.Value, - Url = propUrl.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.WatsonxServiceSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); - writer.WriteProperty(options, PropApiVersion, value.ApiVersion, null, null); - writer.WriteProperty(options, PropModelId, value.ModelId, null, null); - writer.WriteProperty(options, PropProjectId, value.ProjectId, null, null); - writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); - writer.WriteProperty(options, PropUrl, value.Url, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.WatsonxServiceSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.WatsonxServiceSettingsConverter))] public sealed partial class WatsonxServiceSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/WatsonxTaskType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/WatsonxTaskType.Converters.g.cs new file mode 100644 index 00000000000..751acbf2497 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/WatsonxTaskType.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class WatsonxTaskTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberChatCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.ChatCompletion; + } + + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.Completion; + } + + if (reader.ValueTextEquals(MemberTextEmbedding)) + { + return Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.TextEmbedding; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.ChatCompletion; + } + + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.Completion; + } + + if (string.Equals(value, MemberTextEmbedding.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.TextEmbedding; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.ChatCompletion: + writer.WriteStringValue(MemberChatCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType.TextEmbedding: + writer.WriteStringValue(MemberTextEmbedding); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.WatsonxTaskType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/WatsonxTaskType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/WatsonxTaskType.g.cs new file mode 100644 index 00000000000..296a8a994e1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/WatsonxTaskType.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.WatsonxTaskTypeConverter))] +public enum WatsonxTaskType +{ + [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] + ChatCompletion, + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] + TextEmbedding +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AppendProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AppendProcessor.Converters.g.cs new file mode 100644 index 00000000000..309640403ae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AppendProcessor.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class AppendProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowDuplicates = System.Text.Json.JsonEncodedText.Encode("allow_duplicates"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + + public override Elastic.Clients.Elasticsearch.Ingest.AppendProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowDuplicates = default; + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propTag = default; + LocalJsonValue> propValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowDuplicates.TryReadProperty(ref reader, options, PropAllowDuplicates, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.AppendProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowDuplicates = propAllowDuplicates.Value, + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + OnFailure = propOnFailure.Value, + Tag = propTag.Value, + Value = propValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.AppendProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowDuplicates, value.AllowDuplicates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AppendProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AppendProcessor.g.cs index 4abfb374f4e..aaf9d11cae8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AppendProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AppendProcessor.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class AppendProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowDuplicates = System.Text.Json.JsonEncodedText.Encode("allow_duplicates"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - - public override Elastic.Clients.Elasticsearch.Ingest.AppendProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowDuplicates = default; - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propTag = default; - LocalJsonValue> propValue = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowDuplicates.TryReadProperty(ref reader, options, PropAllowDuplicates, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.AppendProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowDuplicates = propAllowDuplicates.Value, - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - OnFailure = propOnFailure.Value, - Tag = propTag.Value, - Value = propValue.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.AppendProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowDuplicates, value.AllowDuplicates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.AppendProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.AppendProcessorConverter))] public sealed partial class AppendProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AttachmentProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AttachmentProcessor.Converters.g.cs new file mode 100644 index 00000000000..29622c46f04 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AttachmentProcessor.Converters.g.cs @@ -0,0 +1,171 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class AttachmentProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropIndexedChars = System.Text.Json.JsonEncodedText.Encode("indexed_chars"); + private static readonly System.Text.Json.JsonEncodedText PropIndexedCharsField = System.Text.Json.JsonEncodedText.Encode("indexed_chars_field"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropRemoveBinary = System.Text.Json.JsonEncodedText.Encode("remove_binary"); + private static readonly System.Text.Json.JsonEncodedText PropResourceName = System.Text.Json.JsonEncodedText.Encode("resource_name"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + + public override Elastic.Clients.Elasticsearch.Ingest.AttachmentProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue propIndexedChars = default; + LocalJsonValue propIndexedCharsField = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue?> propProperties = default; + LocalJsonValue propRemoveBinary = default; + LocalJsonValue propResourceName = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndexedChars.TryReadProperty(ref reader, options, PropIndexedChars, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndexedCharsField.TryReadProperty(ref reader, options, PropIndexedCharsField, null)) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propRemoveBinary.TryReadProperty(ref reader, options, PropRemoveBinary, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propResourceName.TryReadProperty(ref reader, options, PropResourceName, null)) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.AttachmentProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + IndexedChars = propIndexedChars.Value, + IndexedCharsField = propIndexedCharsField.Value, + OnFailure = propOnFailure.Value, + Properties = propProperties.Value, + RemoveBinary = propRemoveBinary.Value, + ResourceName = propResourceName.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.AttachmentProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndexedChars, value.IndexedChars, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndexedCharsField, value.IndexedCharsField, null, null); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropProperties, value.Properties, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRemoveBinary, value.RemoveBinary, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropResourceName, value.ResourceName, null, null); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AttachmentProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AttachmentProcessor.g.cs index 33fc6571fd9..30dcfb7b1e1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AttachmentProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/AttachmentProcessor.g.cs @@ -23,154 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class AttachmentProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropIndexedChars = System.Text.Json.JsonEncodedText.Encode("indexed_chars"); - private static readonly System.Text.Json.JsonEncodedText PropIndexedCharsField = System.Text.Json.JsonEncodedText.Encode("indexed_chars_field"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropRemoveBinary = System.Text.Json.JsonEncodedText.Encode("remove_binary"); - private static readonly System.Text.Json.JsonEncodedText PropResourceName = System.Text.Json.JsonEncodedText.Encode("resource_name"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - - public override Elastic.Clients.Elasticsearch.Ingest.AttachmentProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue propIndexedChars = default; - LocalJsonValue propIndexedCharsField = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue?> propProperties = default; - LocalJsonValue propRemoveBinary = default; - LocalJsonValue propResourceName = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndexedChars.TryReadProperty(ref reader, options, PropIndexedChars, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndexedCharsField.TryReadProperty(ref reader, options, PropIndexedCharsField, null)) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propRemoveBinary.TryReadProperty(ref reader, options, PropRemoveBinary, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propResourceName.TryReadProperty(ref reader, options, PropResourceName, null)) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.AttachmentProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - IndexedChars = propIndexedChars.Value, - IndexedCharsField = propIndexedCharsField.Value, - OnFailure = propOnFailure.Value, - Properties = propProperties.Value, - RemoveBinary = propRemoveBinary.Value, - ResourceName = propResourceName.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.AttachmentProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndexedChars, value.IndexedChars, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndexedCharsField, value.IndexedCharsField, null, null); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropProperties, value.Properties, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRemoveBinary, value.RemoveBinary, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropResourceName, value.ResourceName, null, null); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.AttachmentProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.AttachmentProcessorConverter))] public sealed partial class AttachmentProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/BytesProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/BytesProcessor.Converters.g.cs new file mode 100644 index 00000000000..ce55f8d242f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/BytesProcessor.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class BytesProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + + public override Elastic.Clients.Elasticsearch.Ingest.BytesProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.BytesProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + OnFailure = propOnFailure.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.BytesProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/BytesProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/BytesProcessor.g.cs index 19be11967cb..4815bc67b47 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/BytesProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/BytesProcessor.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class BytesProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - - public override Elastic.Clients.Elasticsearch.Ingest.BytesProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.BytesProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - OnFailure = propOnFailure.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.BytesProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.BytesProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.BytesProcessorConverter))] public sealed partial class BytesProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CircleProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CircleProcessor.Converters.g.cs new file mode 100644 index 00000000000..e9a295db813 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CircleProcessor.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class CircleProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropErrorDistance = System.Text.Json.JsonEncodedText.Encode("error_distance"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropShapeType = System.Text.Json.JsonEncodedText.Encode("shape_type"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + + public override Elastic.Clients.Elasticsearch.Ingest.CircleProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propErrorDistance = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propShapeType = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propErrorDistance.TryReadProperty(ref reader, options, PropErrorDistance, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propShapeType.TryReadProperty(ref reader, options, PropShapeType, null)) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.CircleProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + ErrorDistance = propErrorDistance.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + OnFailure = propOnFailure.Value, + ShapeType = propShapeType.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.CircleProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropErrorDistance, value.ErrorDistance, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropShapeType, value.ShapeType, null, null); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CircleProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CircleProcessor.g.cs index 81d5ddfa03e..84e056df878 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CircleProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CircleProcessor.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class CircleProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropErrorDistance = System.Text.Json.JsonEncodedText.Encode("error_distance"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropShapeType = System.Text.Json.JsonEncodedText.Encode("shape_type"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - - public override Elastic.Clients.Elasticsearch.Ingest.CircleProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propErrorDistance = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propShapeType = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propErrorDistance.TryReadProperty(ref reader, options, PropErrorDistance, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propShapeType.TryReadProperty(ref reader, options, PropShapeType, null)) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.CircleProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - ErrorDistance = propErrorDistance.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - OnFailure = propOnFailure.Value, - ShapeType = propShapeType.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.CircleProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropErrorDistance, value.ErrorDistance, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropShapeType, value.ShapeType, null, null); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.CircleProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.CircleProcessorConverter))] public sealed partial class CircleProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CommunityIDProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CommunityIDProcessor.Converters.g.cs new file mode 100644 index 00000000000..551741004dd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CommunityIDProcessor.Converters.g.cs @@ -0,0 +1,198 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class CommunityIDProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropDestinationIp = System.Text.Json.JsonEncodedText.Encode("destination_ip"); + private static readonly System.Text.Json.JsonEncodedText PropDestinationPort = System.Text.Json.JsonEncodedText.Encode("destination_port"); + private static readonly System.Text.Json.JsonEncodedText PropIanaNumber = System.Text.Json.JsonEncodedText.Encode("iana_number"); + private static readonly System.Text.Json.JsonEncodedText PropIcmpCode = System.Text.Json.JsonEncodedText.Encode("icmp_code"); + private static readonly System.Text.Json.JsonEncodedText PropIcmpType = System.Text.Json.JsonEncodedText.Encode("icmp_type"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropSeed = System.Text.Json.JsonEncodedText.Encode("seed"); + private static readonly System.Text.Json.JsonEncodedText PropSourceIp = System.Text.Json.JsonEncodedText.Encode("source_ip"); + private static readonly System.Text.Json.JsonEncodedText PropSourcePort = System.Text.Json.JsonEncodedText.Encode("source_port"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + private static readonly System.Text.Json.JsonEncodedText PropTransport = System.Text.Json.JsonEncodedText.Encode("transport"); + + public override Elastic.Clients.Elasticsearch.Ingest.CommunityIDProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propDestinationIp = default; + LocalJsonValue propDestinationPort = default; + LocalJsonValue propIanaNumber = default; + LocalJsonValue propIcmpCode = default; + LocalJsonValue propIcmpType = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propSeed = default; + LocalJsonValue propSourceIp = default; + LocalJsonValue propSourcePort = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + LocalJsonValue propTransport = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propDestinationIp.TryReadProperty(ref reader, options, PropDestinationIp, null)) + { + continue; + } + + if (propDestinationPort.TryReadProperty(ref reader, options, PropDestinationPort, null)) + { + continue; + } + + if (propIanaNumber.TryReadProperty(ref reader, options, PropIanaNumber, null)) + { + continue; + } + + if (propIcmpCode.TryReadProperty(ref reader, options, PropIcmpCode, null)) + { + continue; + } + + if (propIcmpType.TryReadProperty(ref reader, options, PropIcmpType, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propSeed.TryReadProperty(ref reader, options, PropSeed, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSourceIp.TryReadProperty(ref reader, options, PropSourceIp, null)) + { + continue; + } + + if (propSourcePort.TryReadProperty(ref reader, options, PropSourcePort, null)) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (propTransport.TryReadProperty(ref reader, options, PropTransport, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.CommunityIDProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + DestinationIp = propDestinationIp.Value, + DestinationPort = propDestinationPort.Value, + IanaNumber = propIanaNumber.Value, + IcmpCode = propIcmpCode.Value, + IcmpType = propIcmpType.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + OnFailure = propOnFailure.Value, + Seed = propSeed.Value, + SourceIp = propSourceIp.Value, + SourcePort = propSourcePort.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value, + Transport = propTransport.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.CommunityIDProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropDestinationIp, value.DestinationIp, null, null); + writer.WriteProperty(options, PropDestinationPort, value.DestinationPort, null, null); + writer.WriteProperty(options, PropIanaNumber, value.IanaNumber, null, null); + writer.WriteProperty(options, PropIcmpCode, value.IcmpCode, null, null); + writer.WriteProperty(options, PropIcmpType, value.IcmpType, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSeed, value.Seed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSourceIp, value.SourceIp, null, null); + writer.WriteProperty(options, PropSourcePort, value.SourcePort, null, null); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteProperty(options, PropTransport, value.Transport, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CommunityIDProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CommunityIDProcessor.g.cs index 7b82c7827bb..832fe8fdbcf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CommunityIDProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CommunityIDProcessor.g.cs @@ -23,181 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class CommunityIDProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropDestinationIp = System.Text.Json.JsonEncodedText.Encode("destination_ip"); - private static readonly System.Text.Json.JsonEncodedText PropDestinationPort = System.Text.Json.JsonEncodedText.Encode("destination_port"); - private static readonly System.Text.Json.JsonEncodedText PropIanaNumber = System.Text.Json.JsonEncodedText.Encode("iana_number"); - private static readonly System.Text.Json.JsonEncodedText PropIcmpCode = System.Text.Json.JsonEncodedText.Encode("icmp_code"); - private static readonly System.Text.Json.JsonEncodedText PropIcmpType = System.Text.Json.JsonEncodedText.Encode("icmp_type"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropSeed = System.Text.Json.JsonEncodedText.Encode("seed"); - private static readonly System.Text.Json.JsonEncodedText PropSourceIp = System.Text.Json.JsonEncodedText.Encode("source_ip"); - private static readonly System.Text.Json.JsonEncodedText PropSourcePort = System.Text.Json.JsonEncodedText.Encode("source_port"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - private static readonly System.Text.Json.JsonEncodedText PropTransport = System.Text.Json.JsonEncodedText.Encode("transport"); - - public override Elastic.Clients.Elasticsearch.Ingest.CommunityIDProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propDestinationIp = default; - LocalJsonValue propDestinationPort = default; - LocalJsonValue propIanaNumber = default; - LocalJsonValue propIcmpCode = default; - LocalJsonValue propIcmpType = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propSeed = default; - LocalJsonValue propSourceIp = default; - LocalJsonValue propSourcePort = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - LocalJsonValue propTransport = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propDestinationIp.TryReadProperty(ref reader, options, PropDestinationIp, null)) - { - continue; - } - - if (propDestinationPort.TryReadProperty(ref reader, options, PropDestinationPort, null)) - { - continue; - } - - if (propIanaNumber.TryReadProperty(ref reader, options, PropIanaNumber, null)) - { - continue; - } - - if (propIcmpCode.TryReadProperty(ref reader, options, PropIcmpCode, null)) - { - continue; - } - - if (propIcmpType.TryReadProperty(ref reader, options, PropIcmpType, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propSeed.TryReadProperty(ref reader, options, PropSeed, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSourceIp.TryReadProperty(ref reader, options, PropSourceIp, null)) - { - continue; - } - - if (propSourcePort.TryReadProperty(ref reader, options, PropSourcePort, null)) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (propTransport.TryReadProperty(ref reader, options, PropTransport, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.CommunityIDProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - DestinationIp = propDestinationIp.Value, - DestinationPort = propDestinationPort.Value, - IanaNumber = propIanaNumber.Value, - IcmpCode = propIcmpCode.Value, - IcmpType = propIcmpType.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - OnFailure = propOnFailure.Value, - Seed = propSeed.Value, - SourceIp = propSourceIp.Value, - SourcePort = propSourcePort.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value, - Transport = propTransport.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.CommunityIDProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropDestinationIp, value.DestinationIp, null, null); - writer.WriteProperty(options, PropDestinationPort, value.DestinationPort, null, null); - writer.WriteProperty(options, PropIanaNumber, value.IanaNumber, null, null); - writer.WriteProperty(options, PropIcmpCode, value.IcmpCode, null, null); - writer.WriteProperty(options, PropIcmpType, value.IcmpType, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSeed, value.Seed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSourceIp, value.SourceIp, null, null); - writer.WriteProperty(options, PropSourcePort, value.SourcePort, null, null); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteProperty(options, PropTransport, value.Transport, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.CommunityIDProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.CommunityIDProcessorConverter))] public sealed partial class CommunityIDProcessor { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ConvertProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ConvertProcessor.Converters.g.cs new file mode 100644 index 00000000000..6703872d9c9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ConvertProcessor.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class ConvertProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Ingest.ConvertProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.ConvertProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + OnFailure = propOnFailure.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.ConvertProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ConvertProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ConvertProcessor.g.cs index 5deea221414..5a864730cc1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ConvertProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ConvertProcessor.g.cs @@ -23,118 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class ConvertProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Ingest.ConvertProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.ConvertProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - OnFailure = propOnFailure.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.ConvertProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.ConvertProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.ConvertProcessorConverter))] public sealed partial class ConvertProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ConvertType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ConvertType.Converters.g.cs new file mode 100644 index 00000000000..72692e8d164 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ConvertType.Converters.g.cs @@ -0,0 +1,165 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class ConvertTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAuto = System.Text.Json.JsonEncodedText.Encode("auto"); + private static readonly System.Text.Json.JsonEncodedText MemberBoolean = System.Text.Json.JsonEncodedText.Encode("boolean"); + private static readonly System.Text.Json.JsonEncodedText MemberDouble = System.Text.Json.JsonEncodedText.Encode("double"); + private static readonly System.Text.Json.JsonEncodedText MemberFloat = System.Text.Json.JsonEncodedText.Encode("float"); + private static readonly System.Text.Json.JsonEncodedText MemberInteger = System.Text.Json.JsonEncodedText.Encode("integer"); + private static readonly System.Text.Json.JsonEncodedText MemberIp = System.Text.Json.JsonEncodedText.Encode("ip"); + private static readonly System.Text.Json.JsonEncodedText MemberLong = System.Text.Json.JsonEncodedText.Encode("long"); + private static readonly System.Text.Json.JsonEncodedText MemberString = System.Text.Json.JsonEncodedText.Encode("string"); + + public override Elastic.Clients.Elasticsearch.Ingest.ConvertType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAuto)) + { + return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Auto; + } + + if (reader.ValueTextEquals(MemberBoolean)) + { + return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Boolean; + } + + if (reader.ValueTextEquals(MemberDouble)) + { + return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Double; + } + + if (reader.ValueTextEquals(MemberFloat)) + { + return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Float; + } + + if (reader.ValueTextEquals(MemberInteger)) + { + return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Integer; + } + + if (reader.ValueTextEquals(MemberIp)) + { + return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Ip; + } + + if (reader.ValueTextEquals(MemberLong)) + { + return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Long; + } + + if (reader.ValueTextEquals(MemberString)) + { + return Elastic.Clients.Elasticsearch.Ingest.ConvertType.String; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAuto.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Auto; + } + + if (string.Equals(value, MemberBoolean.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Boolean; + } + + if (string.Equals(value, MemberDouble.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Double; + } + + if (string.Equals(value, MemberFloat.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Float; + } + + if (string.Equals(value, MemberInteger.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Integer; + } + + if (string.Equals(value, MemberIp.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Ip; + } + + if (string.Equals(value, MemberLong.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.ConvertType.Long; + } + + if (string.Equals(value, MemberString.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.ConvertType.String; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.ConvertType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.ConvertType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Ingest.ConvertType.Auto: + writer.WriteStringValue(MemberAuto); + break; + case Elastic.Clients.Elasticsearch.Ingest.ConvertType.Boolean: + writer.WriteStringValue(MemberBoolean); + break; + case Elastic.Clients.Elasticsearch.Ingest.ConvertType.Double: + writer.WriteStringValue(MemberDouble); + break; + case Elastic.Clients.Elasticsearch.Ingest.ConvertType.Float: + writer.WriteStringValue(MemberFloat); + break; + case Elastic.Clients.Elasticsearch.Ingest.ConvertType.Integer: + writer.WriteStringValue(MemberInteger); + break; + case Elastic.Clients.Elasticsearch.Ingest.ConvertType.Ip: + writer.WriteStringValue(MemberIp); + break; + case Elastic.Clients.Elasticsearch.Ingest.ConvertType.Long: + writer.WriteStringValue(MemberLong); + break; + case Elastic.Clients.Elasticsearch.Ingest.ConvertType.String: + writer.WriteStringValue(MemberString); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.ConvertType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Ingest.ConvertType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.ConvertType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ConvertType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ConvertType.g.cs new file mode 100644 index 00000000000..fc1f25d7ac3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ConvertType.g.cs @@ -0,0 +1,45 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.ConvertTypeConverter))] +public enum ConvertType +{ + [System.Runtime.Serialization.EnumMember(Value = "auto")] + Auto, + [System.Runtime.Serialization.EnumMember(Value = "boolean")] + Boolean, + [System.Runtime.Serialization.EnumMember(Value = "double")] + Double, + [System.Runtime.Serialization.EnumMember(Value = "float")] + Float, + [System.Runtime.Serialization.EnumMember(Value = "integer")] + Integer, + [System.Runtime.Serialization.EnumMember(Value = "ip")] + Ip, + [System.Runtime.Serialization.EnumMember(Value = "long")] + Long, + [System.Runtime.Serialization.EnumMember(Value = "string")] + String +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CsvProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CsvProcessor.Converters.g.cs new file mode 100644 index 00000000000..df817313e13 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CsvProcessor.Converters.g.cs @@ -0,0 +1,162 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class CsvProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropEmptyValue = System.Text.Json.JsonEncodedText.Encode("empty_value"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropQuote = System.Text.Json.JsonEncodedText.Encode("quote"); + private static readonly System.Text.Json.JsonEncodedText PropSeparator = System.Text.Json.JsonEncodedText.Encode("separator"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetFields = System.Text.Json.JsonEncodedText.Encode("target_fields"); + private static readonly System.Text.Json.JsonEncodedText PropTrim = System.Text.Json.JsonEncodedText.Encode("trim"); + + public override Elastic.Clients.Elasticsearch.Ingest.CsvProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propEmptyValue = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propQuote = default; + LocalJsonValue propSeparator = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetFields = default; + LocalJsonValue propTrim = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propEmptyValue.TryReadProperty(ref reader, options, PropEmptyValue, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propQuote.TryReadProperty(ref reader, options, PropQuote, null)) + { + continue; + } + + if (propSeparator.TryReadProperty(ref reader, options, PropSeparator, null)) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetFields.TryReadProperty(ref reader, options, PropTargetFields, static Elastic.Clients.Elasticsearch.Fields (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propTrim.TryReadProperty(ref reader, options, PropTrim, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.CsvProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + EmptyValue = propEmptyValue.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + OnFailure = propOnFailure.Value, + Quote = propQuote.Value, + Separator = propSeparator.Value, + Tag = propTag.Value, + TargetFields = propTargetFields.Value, + Trim = propTrim.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.CsvProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropEmptyValue, value.EmptyValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropQuote, value.Quote, null, null); + writer.WriteProperty(options, PropSeparator, value.Separator, null, null); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetFields, value.TargetFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropTrim, value.Trim, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CsvProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CsvProcessor.g.cs index db1438b2775..cba34fc3316 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CsvProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/CsvProcessor.g.cs @@ -23,145 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class CsvProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropEmptyValue = System.Text.Json.JsonEncodedText.Encode("empty_value"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropQuote = System.Text.Json.JsonEncodedText.Encode("quote"); - private static readonly System.Text.Json.JsonEncodedText PropSeparator = System.Text.Json.JsonEncodedText.Encode("separator"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetFields = System.Text.Json.JsonEncodedText.Encode("target_fields"); - private static readonly System.Text.Json.JsonEncodedText PropTrim = System.Text.Json.JsonEncodedText.Encode("trim"); - - public override Elastic.Clients.Elasticsearch.Ingest.CsvProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propEmptyValue = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propQuote = default; - LocalJsonValue propSeparator = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetFields = default; - LocalJsonValue propTrim = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propEmptyValue.TryReadProperty(ref reader, options, PropEmptyValue, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propQuote.TryReadProperty(ref reader, options, PropQuote, null)) - { - continue; - } - - if (propSeparator.TryReadProperty(ref reader, options, PropSeparator, null)) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetFields.TryReadProperty(ref reader, options, PropTargetFields, static Elastic.Clients.Elasticsearch.Fields (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propTrim.TryReadProperty(ref reader, options, PropTrim, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.CsvProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - EmptyValue = propEmptyValue.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - OnFailure = propOnFailure.Value, - Quote = propQuote.Value, - Separator = propSeparator.Value, - Tag = propTag.Value, - TargetFields = propTargetFields.Value, - Trim = propTrim.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.CsvProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropEmptyValue, value.EmptyValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropQuote, value.Quote, null, null); - writer.WriteProperty(options, PropSeparator, value.Separator, null, null); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetFields, value.TargetFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropTrim, value.Trim, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.CsvProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.CsvProcessorConverter))] public sealed partial class CsvProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DatabaseConfiguration.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DatabaseConfiguration.Converters.g.cs new file mode 100644 index 00000000000..ef8c296871a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DatabaseConfiguration.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class DatabaseConfigurationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText VariantIpinfo = System.Text.Json.JsonEncodedText.Encode("ipinfo"); + private static readonly System.Text.Json.JsonEncodedText VariantMaxmind = System.Text.Json.JsonEncodedText.Encode("maxmind"); + + public override Elastic.Clients.Elasticsearch.Ingest.DatabaseConfiguration Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (reader.ValueTextEquals(VariantIpinfo)) + { + variantType = VariantIpinfo.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMaxmind)) + { + variantType = VariantMaxmind.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.DatabaseConfiguration(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DatabaseConfiguration value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "ipinfo": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.Ipinfo)value.Variant, null, null); + break; + case "maxmind": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.Maxmind)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Ingest.DatabaseConfiguration)}'."); + } + + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DatabaseConfiguration.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DatabaseConfiguration.g.cs index c1a90495c75..61e447ba1f7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DatabaseConfiguration.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DatabaseConfiguration.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class DatabaseConfigurationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText VariantIpinfo = System.Text.Json.JsonEncodedText.Encode("ipinfo"); - private static readonly System.Text.Json.JsonEncodedText VariantMaxmind = System.Text.Json.JsonEncodedText.Encode("maxmind"); - - public override Elastic.Clients.Elasticsearch.Ingest.DatabaseConfiguration Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (reader.ValueTextEquals(VariantIpinfo)) - { - variantType = VariantIpinfo.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMaxmind)) - { - variantType = VariantMaxmind.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.DatabaseConfiguration(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DatabaseConfiguration value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "ipinfo": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.Ipinfo)value.Variant, null, null); - break; - case "maxmind": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.Maxmind)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Ingest.DatabaseConfiguration)}'."); - } - - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.DatabaseConfigurationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.DatabaseConfigurationConverter))] public sealed partial class DatabaseConfiguration { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DatabaseConfigurationFull.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DatabaseConfigurationFull.Converters.g.cs new file mode 100644 index 00000000000..1e1911ea0ff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DatabaseConfigurationFull.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class DatabaseConfigurationFullConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText VariantIpinfo = System.Text.Json.JsonEncodedText.Encode("ipinfo"); + private static readonly System.Text.Json.JsonEncodedText VariantLocal = System.Text.Json.JsonEncodedText.Encode("local"); + private static readonly System.Text.Json.JsonEncodedText VariantMaxmind = System.Text.Json.JsonEncodedText.Encode("maxmind"); + private static readonly System.Text.Json.JsonEncodedText VariantWeb = System.Text.Json.JsonEncodedText.Encode("web"); + + public override Elastic.Clients.Elasticsearch.Ingest.DatabaseConfigurationFull Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (reader.ValueTextEquals(VariantIpinfo)) + { + variantType = VariantIpinfo.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantLocal)) + { + variantType = VariantLocal.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMaxmind)) + { + variantType = VariantMaxmind.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantWeb)) + { + variantType = VariantWeb.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.DatabaseConfigurationFull(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DatabaseConfigurationFull value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "ipinfo": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.Ipinfo)value.Variant, null, null); + break; + case "local": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.Local)value.Variant, null, null); + break; + case "maxmind": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.Maxmind)value.Variant, null, null); + break; + case "web": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.Web)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Ingest.DatabaseConfigurationFull)}'."); + } + + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DatabaseConfigurationFull.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DatabaseConfigurationFull.g.cs index 0b01ba0a48a..359f32f7647 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DatabaseConfigurationFull.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DatabaseConfigurationFull.g.cs @@ -23,106 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class DatabaseConfigurationFullConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText VariantIpinfo = System.Text.Json.JsonEncodedText.Encode("ipinfo"); - private static readonly System.Text.Json.JsonEncodedText VariantLocal = System.Text.Json.JsonEncodedText.Encode("local"); - private static readonly System.Text.Json.JsonEncodedText VariantMaxmind = System.Text.Json.JsonEncodedText.Encode("maxmind"); - private static readonly System.Text.Json.JsonEncodedText VariantWeb = System.Text.Json.JsonEncodedText.Encode("web"); - - public override Elastic.Clients.Elasticsearch.Ingest.DatabaseConfigurationFull Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (reader.ValueTextEquals(VariantIpinfo)) - { - variantType = VariantIpinfo.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantLocal)) - { - variantType = VariantLocal.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMaxmind)) - { - variantType = VariantMaxmind.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantWeb)) - { - variantType = VariantWeb.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.DatabaseConfigurationFull(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DatabaseConfigurationFull value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "ipinfo": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.Ipinfo)value.Variant, null, null); - break; - case "local": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.Local)value.Variant, null, null); - break; - case "maxmind": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.Maxmind)value.Variant, null, null); - break; - case "web": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.Web)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Ingest.DatabaseConfigurationFull)}'."); - } - - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.DatabaseConfigurationFullConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.DatabaseConfigurationFullConverter))] public sealed partial class DatabaseConfigurationFull { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DatabaseConfigurationMetadata.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DatabaseConfigurationMetadata.Converters.g.cs new file mode 100644 index 00000000000..a364dc76e63 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DatabaseConfigurationMetadata.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class DatabaseConfigurationMetadataConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDatabase = System.Text.Json.JsonEncodedText.Encode("database"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropModifiedDateMillis = System.Text.Json.JsonEncodedText.Encode("modified_date_millis"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Ingest.DatabaseConfigurationMetadata Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDatabase = default; + LocalJsonValue propId = default; + LocalJsonValue propModifiedDateMillis = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDatabase.TryReadProperty(ref reader, options, PropDatabase, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propModifiedDateMillis.TryReadProperty(ref reader, options, PropModifiedDateMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.DatabaseConfigurationMetadata(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Database = propDatabase.Value, + Id = propId.Value, + ModifiedDateMillis = propModifiedDateMillis.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DatabaseConfigurationMetadata value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDatabase, value.Database, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropModifiedDateMillis, value.ModifiedDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DatabaseConfigurationMetadata.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DatabaseConfigurationMetadata.g.cs index 5dc76acfe25..1c14f99ca6e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DatabaseConfigurationMetadata.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DatabaseConfigurationMetadata.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class DatabaseConfigurationMetadataConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDatabase = System.Text.Json.JsonEncodedText.Encode("database"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropModifiedDateMillis = System.Text.Json.JsonEncodedText.Encode("modified_date_millis"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Ingest.DatabaseConfigurationMetadata Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDatabase = default; - LocalJsonValue propId = default; - LocalJsonValue propModifiedDateMillis = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDatabase.TryReadProperty(ref reader, options, PropDatabase, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propModifiedDateMillis.TryReadProperty(ref reader, options, PropModifiedDateMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.DatabaseConfigurationMetadata(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Database = propDatabase.Value, - Id = propId.Value, - ModifiedDateMillis = propModifiedDateMillis.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DatabaseConfigurationMetadata value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDatabase, value.Database, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropModifiedDateMillis, value.ModifiedDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.DatabaseConfigurationMetadataConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.DatabaseConfigurationMetadataConverter))] public sealed partial class DatabaseConfigurationMetadata { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DateIndexNameProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DateIndexNameProcessor.Converters.g.cs new file mode 100644 index 00000000000..39377796491 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DateIndexNameProcessor.Converters.g.cs @@ -0,0 +1,162 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class DateIndexNameProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDateFormats = System.Text.Json.JsonEncodedText.Encode("date_formats"); + private static readonly System.Text.Json.JsonEncodedText PropDateRounding = System.Text.Json.JsonEncodedText.Encode("date_rounding"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIndexNameFormat = System.Text.Json.JsonEncodedText.Encode("index_name_format"); + private static readonly System.Text.Json.JsonEncodedText PropIndexNamePrefix = System.Text.Json.JsonEncodedText.Encode("index_name_prefix"); + private static readonly System.Text.Json.JsonEncodedText PropLocale = System.Text.Json.JsonEncodedText.Encode("locale"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTimezone = System.Text.Json.JsonEncodedText.Encode("timezone"); + + public override Elastic.Clients.Elasticsearch.Ingest.DateIndexNameProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propDateFormats = default; + LocalJsonValue propDateRounding = default; + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIndexNameFormat = default; + LocalJsonValue propIndexNamePrefix = default; + LocalJsonValue propLocale = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propTag = default; + LocalJsonValue propTimezone = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDateFormats.TryReadProperty(ref reader, options, PropDateFormats, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propDateRounding.TryReadProperty(ref reader, options, PropDateRounding, null)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndexNameFormat.TryReadProperty(ref reader, options, PropIndexNameFormat, null)) + { + continue; + } + + if (propIndexNamePrefix.TryReadProperty(ref reader, options, PropIndexNamePrefix, null)) + { + continue; + } + + if (propLocale.TryReadProperty(ref reader, options, PropLocale, null)) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTimezone.TryReadProperty(ref reader, options, PropTimezone, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.DateIndexNameProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DateFormats = propDateFormats.Value, + DateRounding = propDateRounding.Value, + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IndexNameFormat = propIndexNameFormat.Value, + IndexNamePrefix = propIndexNamePrefix.Value, + Locale = propLocale.Value, + OnFailure = propOnFailure.Value, + Tag = propTag.Value, + Timezone = propTimezone.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DateIndexNameProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDateFormats, value.DateFormats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDateRounding, value.DateRounding, null, null); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndexNameFormat, value.IndexNameFormat, null, null); + writer.WriteProperty(options, PropIndexNamePrefix, value.IndexNamePrefix, null, null); + writer.WriteProperty(options, PropLocale, value.Locale, null, null); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTimezone, value.Timezone, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DateIndexNameProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DateIndexNameProcessor.g.cs index 91f007ea026..dfc38eff7f0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DateIndexNameProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DateIndexNameProcessor.g.cs @@ -23,145 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class DateIndexNameProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDateFormats = System.Text.Json.JsonEncodedText.Encode("date_formats"); - private static readonly System.Text.Json.JsonEncodedText PropDateRounding = System.Text.Json.JsonEncodedText.Encode("date_rounding"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIndexNameFormat = System.Text.Json.JsonEncodedText.Encode("index_name_format"); - private static readonly System.Text.Json.JsonEncodedText PropIndexNamePrefix = System.Text.Json.JsonEncodedText.Encode("index_name_prefix"); - private static readonly System.Text.Json.JsonEncodedText PropLocale = System.Text.Json.JsonEncodedText.Encode("locale"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTimezone = System.Text.Json.JsonEncodedText.Encode("timezone"); - - public override Elastic.Clients.Elasticsearch.Ingest.DateIndexNameProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propDateFormats = default; - LocalJsonValue propDateRounding = default; - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIndexNameFormat = default; - LocalJsonValue propIndexNamePrefix = default; - LocalJsonValue propLocale = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propTag = default; - LocalJsonValue propTimezone = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDateFormats.TryReadProperty(ref reader, options, PropDateFormats, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propDateRounding.TryReadProperty(ref reader, options, PropDateRounding, null)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndexNameFormat.TryReadProperty(ref reader, options, PropIndexNameFormat, null)) - { - continue; - } - - if (propIndexNamePrefix.TryReadProperty(ref reader, options, PropIndexNamePrefix, null)) - { - continue; - } - - if (propLocale.TryReadProperty(ref reader, options, PropLocale, null)) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTimezone.TryReadProperty(ref reader, options, PropTimezone, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.DateIndexNameProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DateFormats = propDateFormats.Value, - DateRounding = propDateRounding.Value, - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IndexNameFormat = propIndexNameFormat.Value, - IndexNamePrefix = propIndexNamePrefix.Value, - Locale = propLocale.Value, - OnFailure = propOnFailure.Value, - Tag = propTag.Value, - Timezone = propTimezone.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DateIndexNameProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDateFormats, value.DateFormats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDateRounding, value.DateRounding, null, null); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndexNameFormat, value.IndexNameFormat, null, null); - writer.WriteProperty(options, PropIndexNamePrefix, value.IndexNamePrefix, null, null); - writer.WriteProperty(options, PropLocale, value.Locale, null, null); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTimezone, value.Timezone, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.DateIndexNameProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.DateIndexNameProcessorConverter))] public sealed partial class DateIndexNameProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DateProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DateProcessor.Converters.g.cs new file mode 100644 index 00000000000..aaa0908f9cc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DateProcessor.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class DateProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFormats = System.Text.Json.JsonEncodedText.Encode("formats"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropLocale = System.Text.Json.JsonEncodedText.Encode("locale"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropOutputFormat = System.Text.Json.JsonEncodedText.Encode("output_format"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + private static readonly System.Text.Json.JsonEncodedText PropTimezone = System.Text.Json.JsonEncodedText.Encode("timezone"); + + public override Elastic.Clients.Elasticsearch.Ingest.DateProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue> propFormats = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propLocale = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propOutputFormat = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + LocalJsonValue propTimezone = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFormats.TryReadProperty(ref reader, options, PropFormats, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLocale.TryReadProperty(ref reader, options, PropLocale, null)) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propOutputFormat.TryReadProperty(ref reader, options, PropOutputFormat, null)) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (propTimezone.TryReadProperty(ref reader, options, PropTimezone, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.DateProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Field = propField.Value, + Formats = propFormats.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + Locale = propLocale.Value, + OnFailure = propOnFailure.Value, + OutputFormat = propOutputFormat.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value, + Timezone = propTimezone.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DateProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFormats, value.Formats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLocale, value.Locale, null, null); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropOutputFormat, value.OutputFormat, null, null); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteProperty(options, PropTimezone, value.Timezone, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DateProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DateProcessor.g.cs index 1981132e775..57ac04e0939 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DateProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DateProcessor.g.cs @@ -23,136 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class DateProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFormats = System.Text.Json.JsonEncodedText.Encode("formats"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropLocale = System.Text.Json.JsonEncodedText.Encode("locale"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropOutputFormat = System.Text.Json.JsonEncodedText.Encode("output_format"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - private static readonly System.Text.Json.JsonEncodedText PropTimezone = System.Text.Json.JsonEncodedText.Encode("timezone"); - - public override Elastic.Clients.Elasticsearch.Ingest.DateProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue> propFormats = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propLocale = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propOutputFormat = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - LocalJsonValue propTimezone = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFormats.TryReadProperty(ref reader, options, PropFormats, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLocale.TryReadProperty(ref reader, options, PropLocale, null)) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propOutputFormat.TryReadProperty(ref reader, options, PropOutputFormat, null)) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (propTimezone.TryReadProperty(ref reader, options, PropTimezone, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.DateProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Field = propField.Value, - Formats = propFormats.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - Locale = propLocale.Value, - OnFailure = propOnFailure.Value, - OutputFormat = propOutputFormat.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value, - Timezone = propTimezone.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DateProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFormats, value.Formats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLocale, value.Locale, null, null); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropOutputFormat, value.OutputFormat, null, null); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteProperty(options, PropTimezone, value.Timezone, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.DateProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.DateProcessorConverter))] public sealed partial class DateProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DissectProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DissectProcessor.Converters.g.cs new file mode 100644 index 00000000000..9a9db774465 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DissectProcessor.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class DissectProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAppendSeparator = System.Text.Json.JsonEncodedText.Encode("append_separator"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropPattern = System.Text.Json.JsonEncodedText.Encode("pattern"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + + public override Elastic.Clients.Elasticsearch.Ingest.DissectProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAppendSeparator = default; + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propPattern = default; + LocalJsonValue propTag = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAppendSeparator.TryReadProperty(ref reader, options, PropAppendSeparator, null)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propPattern.TryReadProperty(ref reader, options, PropPattern, null)) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.DissectProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AppendSeparator = propAppendSeparator.Value, + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + OnFailure = propOnFailure.Value, + Pattern = propPattern.Value, + Tag = propTag.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DissectProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAppendSeparator, value.AppendSeparator, null, null); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPattern, value.Pattern, null, null); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DissectProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DissectProcessor.g.cs index e9cede0a93d..9c746c808ef 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DissectProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DissectProcessor.g.cs @@ -23,118 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class DissectProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAppendSeparator = System.Text.Json.JsonEncodedText.Encode("append_separator"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropPattern = System.Text.Json.JsonEncodedText.Encode("pattern"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - - public override Elastic.Clients.Elasticsearch.Ingest.DissectProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAppendSeparator = default; - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propPattern = default; - LocalJsonValue propTag = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAppendSeparator.TryReadProperty(ref reader, options, PropAppendSeparator, null)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propPattern.TryReadProperty(ref reader, options, PropPattern, null)) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.DissectProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AppendSeparator = propAppendSeparator.Value, - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - OnFailure = propOnFailure.Value, - Pattern = propPattern.Value, - Tag = propTag.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DissectProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAppendSeparator, value.AppendSeparator, null, null); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPattern, value.Pattern, null, null); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.DissectProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.DissectProcessorConverter))] public sealed partial class DissectProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Document.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Document.Converters.g.cs new file mode 100644 index 00000000000..12d8e5c59ca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Document.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class DocumentConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); + + public override Elastic.Clients.Elasticsearch.Ingest.Document Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + LocalJsonValue propSource = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.Document(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + Index = propIndex.Value, + Source = propSource.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.Document value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropSource, value.Source, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Document.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Document.g.cs index 1fb5ce77020..358bdbac228 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Document.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Document.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class DocumentConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); - - public override Elastic.Clients.Elasticsearch.Ingest.Document Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - LocalJsonValue propSource = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.Document(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - Index = propIndex.Value, - Source = propSource.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.Document value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropSource, value.Source, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.DocumentConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.DocumentConverter))] public sealed partial class Document { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DocumentSimulation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DocumentSimulation.Converters.g.cs new file mode 100644 index 00000000000..51f2ffdd228 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DocumentSimulation.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class DocumentSimulationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); + private static readonly System.Text.Json.JsonEncodedText PropIngest = System.Text.Json.JsonEncodedText.Encode("_ingest"); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("_routing"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("_version"); + private static readonly System.Text.Json.JsonEncodedText PropVersionType = System.Text.Json.JsonEncodedText.Encode("_version_type"); + + public override Elastic.Clients.Elasticsearch.Ingest.DocumentSimulation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + LocalJsonValue propIngest = default; + System.Collections.Generic.Dictionary? propMetadata = default; + LocalJsonValue propRouting = default; + LocalJsonValue> propSource = default; + LocalJsonValue propVersion = default; + LocalJsonValue propVersionType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propIngest.TryReadProperty(ref reader, options, PropIngest, null)) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propVersionType.TryReadProperty(ref reader, options, PropVersionType, static Elastic.Clients.Elasticsearch.VersionType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + propMetadata ??= new System.Collections.Generic.Dictionary(); + reader.ReadProperty(options, out string key, out string value, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!, null); + propMetadata[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.DocumentSimulation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + Index = propIndex.Value, + Ingest = propIngest.Value, + Metadata = propMetadata, + Routing = propRouting.Value, + Source = propSource.Value, + Version = propVersion.Value, + VersionType = propVersionType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DocumentSimulation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropIngest, value.Ingest, null, null); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteProperty(options, PropSource, value.Source, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVersionType, value.VersionType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.VersionType? v) => w.WriteNullableValue(o, v)); + if (value.Metadata is not null) + { + foreach (var item in value.Metadata) + { + writer.WriteProperty(options, item.Key, item.Value, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), null); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DocumentSimulation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DocumentSimulation.g.cs index da756cb0331..c838b2eee86 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DocumentSimulation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DocumentSimulation.g.cs @@ -23,111 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class DocumentSimulationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); - private static readonly System.Text.Json.JsonEncodedText PropIngest = System.Text.Json.JsonEncodedText.Encode("_ingest"); - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("_routing"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("_version"); - private static readonly System.Text.Json.JsonEncodedText PropVersionType = System.Text.Json.JsonEncodedText.Encode("_version_type"); - - public override Elastic.Clients.Elasticsearch.Ingest.DocumentSimulation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - LocalJsonValue propIngest = default; - System.Collections.Generic.Dictionary? propMetadata = default; - LocalJsonValue propRouting = default; - LocalJsonValue> propSource = default; - LocalJsonValue propVersion = default; - LocalJsonValue propVersionType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propIngest.TryReadProperty(ref reader, options, PropIngest, null)) - { - continue; - } - - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propVersionType.TryReadProperty(ref reader, options, PropVersionType, static Elastic.Clients.Elasticsearch.VersionType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - propMetadata ??= new System.Collections.Generic.Dictionary(); - reader.ReadProperty(options, out string key, out string value, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!, null); - propMetadata[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.DocumentSimulation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - Index = propIndex.Value, - Ingest = propIngest.Value, - Metadata = propMetadata, - Routing = propRouting.Value, - Source = propSource.Value, - Version = propVersion.Value, - VersionType = propVersionType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DocumentSimulation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropIngest, value.Ingest, null, null); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteProperty(options, PropSource, value.Source, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropVersionType, value.VersionType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.VersionType? v) => w.WriteNullableValue(o, v)); - if (value.Metadata is not null) - { - foreach (var item in value.Metadata) - { - writer.WriteProperty(options, item.Key, item.Value, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), null); - } - } - - writer.WriteEndObject(); - } -} - /// /// /// The simulated document, with optional metadata. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.DocumentSimulationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.DocumentSimulationConverter))] public sealed partial class DocumentSimulation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DotExpanderProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DotExpanderProcessor.Converters.g.cs new file mode 100644 index 00000000000..0aed3fdbc2a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DotExpanderProcessor.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class DotExpanderProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropOverride = System.Text.Json.JsonEncodedText.Encode("override"); + private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + + public override Elastic.Clients.Elasticsearch.Ingest.DotExpanderProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propOverride = default; + LocalJsonValue propPath = default; + LocalJsonValue propTag = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propOverride.TryReadProperty(ref reader, options, PropOverride, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPath.TryReadProperty(ref reader, options, PropPath, null)) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.DotExpanderProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + OnFailure = propOnFailure.Value, + Override = propOverride.Value, + Path = propPath.Value, + Tag = propTag.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DotExpanderProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropOverride, value.Override, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPath, value.Path, null, null); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DotExpanderProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DotExpanderProcessor.g.cs index a84ca819053..c1b374e1056 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DotExpanderProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DotExpanderProcessor.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class DotExpanderProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropOverride = System.Text.Json.JsonEncodedText.Encode("override"); - private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - - public override Elastic.Clients.Elasticsearch.Ingest.DotExpanderProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propOverride = default; - LocalJsonValue propPath = default; - LocalJsonValue propTag = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propOverride.TryReadProperty(ref reader, options, PropOverride, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPath.TryReadProperty(ref reader, options, PropPath, null)) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.DotExpanderProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - OnFailure = propOnFailure.Value, - Override = propOverride.Value, - Path = propPath.Value, - Tag = propTag.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DotExpanderProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropOverride, value.Override, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPath, value.Path, null, null); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.DotExpanderProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.DotExpanderProcessorConverter))] public sealed partial class DotExpanderProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DropProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DropProcessor.Converters.g.cs new file mode 100644 index 00000000000..b820b48125d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DropProcessor.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class DropProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + + public override Elastic.Clients.Elasticsearch.Ingest.DropProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propTag = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.DropProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + OnFailure = propOnFailure.Value, + Tag = propTag.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DropProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DropProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DropProcessor.g.cs index 03d5231b1b5..b05d7167d2d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DropProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/DropProcessor.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class DropProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - - public override Elastic.Clients.Elasticsearch.Ingest.DropProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propTag = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.DropProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - OnFailure = propOnFailure.Value, - Tag = propTag.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.DropProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.DropProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.DropProcessorConverter))] public sealed partial class DropProcessor { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/EnrichProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/EnrichProcessor.Converters.g.cs new file mode 100644 index 00000000000..917eadc7de2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/EnrichProcessor.Converters.g.cs @@ -0,0 +1,162 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class EnrichProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropMaxMatches = System.Text.Json.JsonEncodedText.Encode("max_matches"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropOverride = System.Text.Json.JsonEncodedText.Encode("override"); + private static readonly System.Text.Json.JsonEncodedText PropPolicyName = System.Text.Json.JsonEncodedText.Encode("policy_name"); + private static readonly System.Text.Json.JsonEncodedText PropShapeRelation = System.Text.Json.JsonEncodedText.Encode("shape_relation"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + + public override Elastic.Clients.Elasticsearch.Ingest.EnrichProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue propMaxMatches = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propOverride = default; + LocalJsonValue propPolicyName = default; + LocalJsonValue propShapeRelation = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxMatches.TryReadProperty(ref reader, options, PropMaxMatches, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propOverride.TryReadProperty(ref reader, options, PropOverride, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPolicyName.TryReadProperty(ref reader, options, PropPolicyName, null)) + { + continue; + } + + if (propShapeRelation.TryReadProperty(ref reader, options, PropShapeRelation, static Elastic.Clients.Elasticsearch.GeoShapeRelation? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.EnrichProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + MaxMatches = propMaxMatches.Value, + OnFailure = propOnFailure.Value, + Override = propOverride.Value, + PolicyName = propPolicyName.Value, + ShapeRelation = propShapeRelation.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.EnrichProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxMatches, value.MaxMatches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropOverride, value.Override, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPolicyName, value.PolicyName, null, null); + writer.WriteProperty(options, PropShapeRelation, value.ShapeRelation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.GeoShapeRelation? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/EnrichProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/EnrichProcessor.g.cs index 3b354c91444..48cff4daa97 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/EnrichProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/EnrichProcessor.g.cs @@ -23,145 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class EnrichProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropMaxMatches = System.Text.Json.JsonEncodedText.Encode("max_matches"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropOverride = System.Text.Json.JsonEncodedText.Encode("override"); - private static readonly System.Text.Json.JsonEncodedText PropPolicyName = System.Text.Json.JsonEncodedText.Encode("policy_name"); - private static readonly System.Text.Json.JsonEncodedText PropShapeRelation = System.Text.Json.JsonEncodedText.Encode("shape_relation"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - - public override Elastic.Clients.Elasticsearch.Ingest.EnrichProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue propMaxMatches = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propOverride = default; - LocalJsonValue propPolicyName = default; - LocalJsonValue propShapeRelation = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxMatches.TryReadProperty(ref reader, options, PropMaxMatches, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propOverride.TryReadProperty(ref reader, options, PropOverride, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPolicyName.TryReadProperty(ref reader, options, PropPolicyName, null)) - { - continue; - } - - if (propShapeRelation.TryReadProperty(ref reader, options, PropShapeRelation, static Elastic.Clients.Elasticsearch.GeoShapeRelation? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.EnrichProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - MaxMatches = propMaxMatches.Value, - OnFailure = propOnFailure.Value, - Override = propOverride.Value, - PolicyName = propPolicyName.Value, - ShapeRelation = propShapeRelation.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.EnrichProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxMatches, value.MaxMatches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropOverride, value.Override, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPolicyName, value.PolicyName, null, null); - writer.WriteProperty(options, PropShapeRelation, value.ShapeRelation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.GeoShapeRelation? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.EnrichProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.EnrichProcessorConverter))] public sealed partial class EnrichProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FailProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FailProcessor.Converters.g.cs new file mode 100644 index 00000000000..5e819e62f24 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FailProcessor.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class FailProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropMessage = System.Text.Json.JsonEncodedText.Encode("message"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + + public override Elastic.Clients.Elasticsearch.Ingest.FailProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propMessage = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propTag = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMessage.TryReadProperty(ref reader, options, PropMessage, null)) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.FailProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + Message = propMessage.Value, + OnFailure = propOnFailure.Value, + Tag = propTag.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.FailProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMessage, value.Message, null, null); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FailProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FailProcessor.g.cs index 64f373d6de1..69736674f06 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FailProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FailProcessor.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class FailProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropMessage = System.Text.Json.JsonEncodedText.Encode("message"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - - public override Elastic.Clients.Elasticsearch.Ingest.FailProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propMessage = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propTag = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMessage.TryReadProperty(ref reader, options, PropMessage, null)) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.FailProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - Message = propMessage.Value, - OnFailure = propOnFailure.Value, - Tag = propTag.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.FailProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMessage, value.Message, null, null); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.FailProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.FailProcessorConverter))] public sealed partial class FailProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FingerprintDigest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FingerprintDigest.Converters.g.cs new file mode 100644 index 00000000000..1c85ab45e39 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FingerprintDigest.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class FingerprintDigestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberMd5 = System.Text.Json.JsonEncodedText.Encode("MD5"); + private static readonly System.Text.Json.JsonEncodedText MemberMurmurHash3 = System.Text.Json.JsonEncodedText.Encode("MurmurHash3"); + private static readonly System.Text.Json.JsonEncodedText MemberSha1 = System.Text.Json.JsonEncodedText.Encode("SHA-1"); + private static readonly System.Text.Json.JsonEncodedText MemberSha256 = System.Text.Json.JsonEncodedText.Encode("SHA-256"); + private static readonly System.Text.Json.JsonEncodedText MemberSha512 = System.Text.Json.JsonEncodedText.Encode("SHA-512"); + + public override Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberMd5)) + { + return Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.Md5; + } + + if (reader.ValueTextEquals(MemberMurmurHash3)) + { + return Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.MurmurHash3; + } + + if (reader.ValueTextEquals(MemberSha1)) + { + return Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.Sha1; + } + + if (reader.ValueTextEquals(MemberSha256)) + { + return Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.Sha256; + } + + if (reader.ValueTextEquals(MemberSha512)) + { + return Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.Sha512; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberMd5.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.Md5; + } + + if (string.Equals(value, MemberMurmurHash3.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.MurmurHash3; + } + + if (string.Equals(value, MemberSha1.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.Sha1; + } + + if (string.Equals(value, MemberSha256.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.Sha256; + } + + if (string.Equals(value, MemberSha512.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.Sha512; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.Md5: + writer.WriteStringValue(MemberMd5); + break; + case Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.MurmurHash3: + writer.WriteStringValue(MemberMurmurHash3); + break; + case Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.Sha1: + writer.WriteStringValue(MemberSha1); + break; + case Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.Sha256: + writer.WriteStringValue(MemberSha256); + break; + case Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest.Sha512: + writer.WriteStringValue(MemberSha512); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FingerprintDigest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FingerprintDigest.g.cs new file mode 100644 index 00000000000..0c12b970ca5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FingerprintDigest.g.cs @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.FingerprintDigestConverter))] +public enum FingerprintDigest +{ + [System.Runtime.Serialization.EnumMember(Value = "MD5")] + Md5, + [System.Runtime.Serialization.EnumMember(Value = "MurmurHash3")] + MurmurHash3, + [System.Runtime.Serialization.EnumMember(Value = "SHA-1")] + Sha1, + [System.Runtime.Serialization.EnumMember(Value = "SHA-256")] + Sha256, + [System.Runtime.Serialization.EnumMember(Value = "SHA-512")] + Sha512 +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FingerprintProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FingerprintProcessor.Converters.g.cs new file mode 100644 index 00000000000..1033e7525ef --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FingerprintProcessor.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class FingerprintProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropMethod = System.Text.Json.JsonEncodedText.Encode("method"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropSalt = System.Text.Json.JsonEncodedText.Encode("salt"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + + public override Elastic.Clients.Elasticsearch.Ingest.FingerprintProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propFields = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue propMethod = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propSalt = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, static Elastic.Clients.Elasticsearch.Fields (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMethod.TryReadProperty(ref reader, options, PropMethod, static Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propSalt.TryReadProperty(ref reader, options, PropSalt, null)) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.FingerprintProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Fields = propFields.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + Method = propMethod.Value, + OnFailure = propOnFailure.Value, + Salt = propSalt.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.FingerprintProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMethod, value.Method, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSalt, value.Salt, null, null); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FingerprintProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FingerprintProcessor.g.cs index 59d3ae5bfa1..328c7ef6cc8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FingerprintProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/FingerprintProcessor.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class FingerprintProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropMethod = System.Text.Json.JsonEncodedText.Encode("method"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropSalt = System.Text.Json.JsonEncodedText.Encode("salt"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - - public override Elastic.Clients.Elasticsearch.Ingest.FingerprintProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propFields = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue propMethod = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propSalt = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, static Elastic.Clients.Elasticsearch.Fields (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMethod.TryReadProperty(ref reader, options, PropMethod, static Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propSalt.TryReadProperty(ref reader, options, PropSalt, null)) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.FingerprintProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Fields = propFields.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - Method = propMethod.Value, - OnFailure = propOnFailure.Value, - Salt = propSalt.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.FingerprintProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMethod, value.Method, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Ingest.FingerprintDigest? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSalt, value.Salt, null, null); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.FingerprintProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.FingerprintProcessorConverter))] public sealed partial class FingerprintProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ForeachProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ForeachProcessor.Converters.g.cs new file mode 100644 index 00000000000..c5e05d64cee --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ForeachProcessor.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class ForeachProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropProcessor = System.Text.Json.JsonEncodedText.Encode("processor"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + + public override Elastic.Clients.Elasticsearch.Ingest.ForeachProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propProcessor = default; + LocalJsonValue propTag = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propProcessor.TryReadProperty(ref reader, options, PropProcessor, null)) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.ForeachProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + OnFailure = propOnFailure.Value, + Processor = propProcessor.Value, + Tag = propTag.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.ForeachProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropProcessor, value.Processor, null, null); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ForeachProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ForeachProcessor.g.cs index 89d90e33628..ba0844a45aa 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ForeachProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ForeachProcessor.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class ForeachProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropProcessor = System.Text.Json.JsonEncodedText.Encode("processor"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - - public override Elastic.Clients.Elasticsearch.Ingest.ForeachProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propProcessor = default; - LocalJsonValue propTag = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propProcessor.TryReadProperty(ref reader, options, PropProcessor, null)) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.ForeachProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - OnFailure = propOnFailure.Value, - Processor = propProcessor.Value, - Tag = propTag.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.ForeachProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropProcessor, value.Processor, null, null); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.ForeachProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.ForeachProcessorConverter))] public sealed partial class ForeachProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoGridProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoGridProcessor.Converters.g.cs new file mode 100644 index 00000000000..1f84664cd00 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoGridProcessor.Converters.g.cs @@ -0,0 +1,180 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class GeoGridProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChildrenField = System.Text.Json.JsonEncodedText.Encode("children_field"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropNonChildrenField = System.Text.Json.JsonEncodedText.Encode("non_children_field"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropParentField = System.Text.Json.JsonEncodedText.Encode("parent_field"); + private static readonly System.Text.Json.JsonEncodedText PropPrecisionField = System.Text.Json.JsonEncodedText.Encode("precision_field"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + private static readonly System.Text.Json.JsonEncodedText PropTargetFormat = System.Text.Json.JsonEncodedText.Encode("target_format"); + private static readonly System.Text.Json.JsonEncodedText PropTileType = System.Text.Json.JsonEncodedText.Encode("tile_type"); + + public override Elastic.Clients.Elasticsearch.Ingest.GeoGridProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChildrenField = default; + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue propNonChildrenField = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propParentField = default; + LocalJsonValue propPrecisionField = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + LocalJsonValue propTargetFormat = default; + LocalJsonValue propTileType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChildrenField.TryReadProperty(ref reader, options, PropChildrenField, null)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNonChildrenField.TryReadProperty(ref reader, options, PropNonChildrenField, null)) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propParentField.TryReadProperty(ref reader, options, PropParentField, null)) + { + continue; + } + + if (propPrecisionField.TryReadProperty(ref reader, options, PropPrecisionField, null)) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (propTargetFormat.TryReadProperty(ref reader, options, PropTargetFormat, static Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTileType.TryReadProperty(ref reader, options, PropTileType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.GeoGridProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChildrenField = propChildrenField.Value, + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + NonChildrenField = propNonChildrenField.Value, + OnFailure = propOnFailure.Value, + ParentField = propParentField.Value, + PrecisionField = propPrecisionField.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value, + TargetFormat = propTargetFormat.Value, + TileType = propTileType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GeoGridProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChildrenField, value.ChildrenField, null, null); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNonChildrenField, value.NonChildrenField, null, null); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropParentField, value.ParentField, null, null); + writer.WriteProperty(options, PropPrecisionField, value.PrecisionField, null, null); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteProperty(options, PropTargetFormat, value.TargetFormat, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTileType, value.TileType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoGridProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoGridProcessor.g.cs index 75422676386..0f664103ed3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoGridProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoGridProcessor.g.cs @@ -23,163 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class GeoGridProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChildrenField = System.Text.Json.JsonEncodedText.Encode("children_field"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropNonChildrenField = System.Text.Json.JsonEncodedText.Encode("non_children_field"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropParentField = System.Text.Json.JsonEncodedText.Encode("parent_field"); - private static readonly System.Text.Json.JsonEncodedText PropPrecisionField = System.Text.Json.JsonEncodedText.Encode("precision_field"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - private static readonly System.Text.Json.JsonEncodedText PropTargetFormat = System.Text.Json.JsonEncodedText.Encode("target_format"); - private static readonly System.Text.Json.JsonEncodedText PropTileType = System.Text.Json.JsonEncodedText.Encode("tile_type"); - - public override Elastic.Clients.Elasticsearch.Ingest.GeoGridProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChildrenField = default; - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue propNonChildrenField = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propParentField = default; - LocalJsonValue propPrecisionField = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - LocalJsonValue propTargetFormat = default; - LocalJsonValue propTileType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChildrenField.TryReadProperty(ref reader, options, PropChildrenField, null)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNonChildrenField.TryReadProperty(ref reader, options, PropNonChildrenField, null)) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propParentField.TryReadProperty(ref reader, options, PropParentField, null)) - { - continue; - } - - if (propPrecisionField.TryReadProperty(ref reader, options, PropPrecisionField, null)) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (propTargetFormat.TryReadProperty(ref reader, options, PropTargetFormat, static Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTileType.TryReadProperty(ref reader, options, PropTileType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.GeoGridProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChildrenField = propChildrenField.Value, - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - NonChildrenField = propNonChildrenField.Value, - OnFailure = propOnFailure.Value, - ParentField = propParentField.Value, - PrecisionField = propPrecisionField.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value, - TargetFormat = propTargetFormat.Value, - TileType = propTileType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GeoGridProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChildrenField, value.ChildrenField, null, null); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNonChildrenField, value.NonChildrenField, null, null); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropParentField, value.ParentField, null, null); - writer.WriteProperty(options, PropPrecisionField, value.PrecisionField, null, null); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteProperty(options, PropTargetFormat, value.TargetFormat, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTileType, value.TileType, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.GeoGridProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.GeoGridProcessorConverter))] public sealed partial class GeoGridProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoGridTargetFormat.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoGridTargetFormat.Converters.g.cs new file mode 100644 index 00000000000..31fd099e209 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoGridTargetFormat.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class GeoGridTargetFormatConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberGeojson = System.Text.Json.JsonEncodedText.Encode("geojson"); + private static readonly System.Text.Json.JsonEncodedText MemberWkt = System.Text.Json.JsonEncodedText.Encode("wkt"); + + public override Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberGeojson)) + { + return Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat.Geojson; + } + + if (reader.ValueTextEquals(MemberWkt)) + { + return Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat.Wkt; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberGeojson.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat.Geojson; + } + + if (string.Equals(value, MemberWkt.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat.Wkt; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat.Geojson: + writer.WriteStringValue(MemberGeojson); + break; + case Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat.Wkt: + writer.WriteStringValue(MemberWkt); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GeoGridTargetFormat value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoGridTargetFormat.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoGridTargetFormat.g.cs new file mode 100644 index 00000000000..83c0a0b07fa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoGridTargetFormat.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.GeoGridTargetFormatConverter))] +public enum GeoGridTargetFormat +{ + [System.Runtime.Serialization.EnumMember(Value = "geojson")] + Geojson, + [System.Runtime.Serialization.EnumMember(Value = "wkt")] + Wkt +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoGridTileType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoGridTileType.Converters.g.cs new file mode 100644 index 00000000000..8db54f181ab --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoGridTileType.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class GeoGridTileTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberGeohash = System.Text.Json.JsonEncodedText.Encode("geohash"); + private static readonly System.Text.Json.JsonEncodedText MemberGeohex = System.Text.Json.JsonEncodedText.Encode("geohex"); + private static readonly System.Text.Json.JsonEncodedText MemberGeotile = System.Text.Json.JsonEncodedText.Encode("geotile"); + + public override Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberGeohash)) + { + return Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType.Geohash; + } + + if (reader.ValueTextEquals(MemberGeohex)) + { + return Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType.Geohex; + } + + if (reader.ValueTextEquals(MemberGeotile)) + { + return Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType.Geotile; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberGeohash.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType.Geohash; + } + + if (string.Equals(value, MemberGeohex.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType.Geohex; + } + + if (string.Equals(value, MemberGeotile.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType.Geotile; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType.Geohash: + writer.WriteStringValue(MemberGeohash); + break; + case Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType.Geohex: + writer.WriteStringValue(MemberGeohex); + break; + case Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType.Geotile: + writer.WriteStringValue(MemberGeotile); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GeoGridTileType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoGridTileType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoGridTileType.g.cs new file mode 100644 index 00000000000..46200183138 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoGridTileType.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.GeoGridTileTypeConverter))] +public enum GeoGridTileType +{ + [System.Runtime.Serialization.EnumMember(Value = "geohash")] + Geohash, + [System.Runtime.Serialization.EnumMember(Value = "geohex")] + Geohex, + [System.Runtime.Serialization.EnumMember(Value = "geotile")] + Geotile +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpDownloadStatistics.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpDownloadStatistics.Converters.g.cs new file mode 100644 index 00000000000..7bda626aa9e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpDownloadStatistics.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class GeoIpDownloadStatisticsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDatabasesCount = System.Text.Json.JsonEncodedText.Encode("databases_count"); + private static readonly System.Text.Json.JsonEncodedText PropExpiredDatabases = System.Text.Json.JsonEncodedText.Encode("expired_databases"); + private static readonly System.Text.Json.JsonEncodedText PropFailedDownloads = System.Text.Json.JsonEncodedText.Encode("failed_downloads"); + private static readonly System.Text.Json.JsonEncodedText PropSkippedUpdates = System.Text.Json.JsonEncodedText.Encode("skipped_updates"); + private static readonly System.Text.Json.JsonEncodedText PropSuccessfulDownloads = System.Text.Json.JsonEncodedText.Encode("successful_downloads"); + private static readonly System.Text.Json.JsonEncodedText PropTotalDownloadTime = System.Text.Json.JsonEncodedText.Encode("total_download_time"); + + public override Elastic.Clients.Elasticsearch.Ingest.GeoIpDownloadStatistics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDatabasesCount = default; + LocalJsonValue propExpiredDatabases = default; + LocalJsonValue propFailedDownloads = default; + LocalJsonValue propSkippedUpdates = default; + LocalJsonValue propSuccessfulDownloads = default; + LocalJsonValue propTotalDownloadTime = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDatabasesCount.TryReadProperty(ref reader, options, PropDatabasesCount, null)) + { + continue; + } + + if (propExpiredDatabases.TryReadProperty(ref reader, options, PropExpiredDatabases, null)) + { + continue; + } + + if (propFailedDownloads.TryReadProperty(ref reader, options, PropFailedDownloads, null)) + { + continue; + } + + if (propSkippedUpdates.TryReadProperty(ref reader, options, PropSkippedUpdates, null)) + { + continue; + } + + if (propSuccessfulDownloads.TryReadProperty(ref reader, options, PropSuccessfulDownloads, null)) + { + continue; + } + + if (propTotalDownloadTime.TryReadProperty(ref reader, options, PropTotalDownloadTime, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.GeoIpDownloadStatistics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DatabasesCount = propDatabasesCount.Value, + ExpiredDatabases = propExpiredDatabases.Value, + FailedDownloads = propFailedDownloads.Value, + SkippedUpdates = propSkippedUpdates.Value, + SuccessfulDownloads = propSuccessfulDownloads.Value, + TotalDownloadTime = propTotalDownloadTime.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GeoIpDownloadStatistics value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDatabasesCount, value.DatabasesCount, null, null); + writer.WriteProperty(options, PropExpiredDatabases, value.ExpiredDatabases, null, null); + writer.WriteProperty(options, PropFailedDownloads, value.FailedDownloads, null, null); + writer.WriteProperty(options, PropSkippedUpdates, value.SkippedUpdates, null, null); + writer.WriteProperty(options, PropSuccessfulDownloads, value.SuccessfulDownloads, null, null); + writer.WriteProperty(options, PropTotalDownloadTime, value.TotalDownloadTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpDownloadStatistics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpDownloadStatistics.g.cs index 7906566a761..b217ad8bc1c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpDownloadStatistics.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpDownloadStatistics.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class GeoIpDownloadStatisticsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDatabasesCount = System.Text.Json.JsonEncodedText.Encode("databases_count"); - private static readonly System.Text.Json.JsonEncodedText PropExpiredDatabases = System.Text.Json.JsonEncodedText.Encode("expired_databases"); - private static readonly System.Text.Json.JsonEncodedText PropFailedDownloads = System.Text.Json.JsonEncodedText.Encode("failed_downloads"); - private static readonly System.Text.Json.JsonEncodedText PropSkippedUpdates = System.Text.Json.JsonEncodedText.Encode("skipped_updates"); - private static readonly System.Text.Json.JsonEncodedText PropSuccessfulDownloads = System.Text.Json.JsonEncodedText.Encode("successful_downloads"); - private static readonly System.Text.Json.JsonEncodedText PropTotalDownloadTime = System.Text.Json.JsonEncodedText.Encode("total_download_time"); - - public override Elastic.Clients.Elasticsearch.Ingest.GeoIpDownloadStatistics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDatabasesCount = default; - LocalJsonValue propExpiredDatabases = default; - LocalJsonValue propFailedDownloads = default; - LocalJsonValue propSkippedUpdates = default; - LocalJsonValue propSuccessfulDownloads = default; - LocalJsonValue propTotalDownloadTime = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDatabasesCount.TryReadProperty(ref reader, options, PropDatabasesCount, null)) - { - continue; - } - - if (propExpiredDatabases.TryReadProperty(ref reader, options, PropExpiredDatabases, null)) - { - continue; - } - - if (propFailedDownloads.TryReadProperty(ref reader, options, PropFailedDownloads, null)) - { - continue; - } - - if (propSkippedUpdates.TryReadProperty(ref reader, options, PropSkippedUpdates, null)) - { - continue; - } - - if (propSuccessfulDownloads.TryReadProperty(ref reader, options, PropSuccessfulDownloads, null)) - { - continue; - } - - if (propTotalDownloadTime.TryReadProperty(ref reader, options, PropTotalDownloadTime, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.GeoIpDownloadStatistics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DatabasesCount = propDatabasesCount.Value, - ExpiredDatabases = propExpiredDatabases.Value, - FailedDownloads = propFailedDownloads.Value, - SkippedUpdates = propSkippedUpdates.Value, - SuccessfulDownloads = propSuccessfulDownloads.Value, - TotalDownloadTime = propTotalDownloadTime.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GeoIpDownloadStatistics value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDatabasesCount, value.DatabasesCount, null, null); - writer.WriteProperty(options, PropExpiredDatabases, value.ExpiredDatabases, null, null); - writer.WriteProperty(options, PropFailedDownloads, value.FailedDownloads, null, null); - writer.WriteProperty(options, PropSkippedUpdates, value.SkippedUpdates, null, null); - writer.WriteProperty(options, PropSuccessfulDownloads, value.SuccessfulDownloads, null, null); - writer.WriteProperty(options, PropTotalDownloadTime, value.TotalDownloadTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.GeoIpDownloadStatisticsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.GeoIpDownloadStatisticsConverter))] public sealed partial class GeoIpDownloadStatistics { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpNodeDatabaseName.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpNodeDatabaseName.Converters.g.cs new file mode 100644 index 00000000000..de0491c693e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpNodeDatabaseName.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class GeoIpNodeDatabaseNameConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.Ingest.GeoIpNodeDatabaseName Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.GeoIpNodeDatabaseName(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GeoIpNodeDatabaseName value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpNodeDatabaseName.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpNodeDatabaseName.g.cs index 9a657211df9..08e139c9f08 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpNodeDatabaseName.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpNodeDatabaseName.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class GeoIpNodeDatabaseNameConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.Ingest.GeoIpNodeDatabaseName Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.GeoIpNodeDatabaseName(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GeoIpNodeDatabaseName value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.GeoIpNodeDatabaseNameConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.GeoIpNodeDatabaseNameConverter))] public sealed partial class GeoIpNodeDatabaseName { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpNodeDatabases.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpNodeDatabases.Converters.g.cs new file mode 100644 index 00000000000..2c86f038a3b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpNodeDatabases.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class GeoIpNodeDatabasesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDatabases = System.Text.Json.JsonEncodedText.Encode("databases"); + private static readonly System.Text.Json.JsonEncodedText PropFilesInTemp = System.Text.Json.JsonEncodedText.Encode("files_in_temp"); + + public override Elastic.Clients.Elasticsearch.Ingest.GeoIpNodeDatabases Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propDatabases = default; + LocalJsonValue> propFilesInTemp = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDatabases.TryReadProperty(ref reader, options, PropDatabases, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propFilesInTemp.TryReadProperty(ref reader, options, PropFilesInTemp, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.GeoIpNodeDatabases(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Databases = propDatabases.Value, + FilesInTemp = propFilesInTemp.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GeoIpNodeDatabases value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDatabases, value.Databases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFilesInTemp, value.FilesInTemp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpNodeDatabases.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpNodeDatabases.g.cs index a04a34b0dcb..8a4ee4ce7bd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpNodeDatabases.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpNodeDatabases.g.cs @@ -23,60 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class GeoIpNodeDatabasesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDatabases = System.Text.Json.JsonEncodedText.Encode("databases"); - private static readonly System.Text.Json.JsonEncodedText PropFilesInTemp = System.Text.Json.JsonEncodedText.Encode("files_in_temp"); - - public override Elastic.Clients.Elasticsearch.Ingest.GeoIpNodeDatabases Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propDatabases = default; - LocalJsonValue> propFilesInTemp = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDatabases.TryReadProperty(ref reader, options, PropDatabases, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propFilesInTemp.TryReadProperty(ref reader, options, PropFilesInTemp, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.GeoIpNodeDatabases(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Databases = propDatabases.Value, - FilesInTemp = propFilesInTemp.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GeoIpNodeDatabases value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDatabases, value.Databases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFilesInTemp, value.FilesInTemp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// Downloaded databases for the node. The field key is the node ID. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.GeoIpNodeDatabasesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.GeoIpNodeDatabasesConverter))] public sealed partial class GeoIpNodeDatabases { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpProcessor.Converters.g.cs new file mode 100644 index 00000000000..f39c1e51035 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpProcessor.Converters.g.cs @@ -0,0 +1,162 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class GeoIpProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDatabaseFile = System.Text.Json.JsonEncodedText.Encode("database_file"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropDownloadDatabaseOnPipelineCreation = System.Text.Json.JsonEncodedText.Encode("download_database_on_pipeline_creation"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFirstOnly = System.Text.Json.JsonEncodedText.Encode("first_only"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + + public override Elastic.Clients.Elasticsearch.Ingest.GeoIpProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDatabaseFile = default; + LocalJsonValue propDescription = default; + LocalJsonValue propDownloadDatabaseOnPipelineCreation = default; + LocalJsonValue propField = default; + LocalJsonValue propFirstOnly = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue?> propProperties = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDatabaseFile.TryReadProperty(ref reader, options, PropDatabaseFile, null)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propDownloadDatabaseOnPipelineCreation.TryReadProperty(ref reader, options, PropDownloadDatabaseOnPipelineCreation, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFirstOnly.TryReadProperty(ref reader, options, PropFirstOnly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.GeoIpProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DatabaseFile = propDatabaseFile.Value, + Description = propDescription.Value, + DownloadDatabaseOnPipelineCreation = propDownloadDatabaseOnPipelineCreation.Value, + Field = propField.Value, + FirstOnly = propFirstOnly.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + OnFailure = propOnFailure.Value, + Properties = propProperties.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GeoIpProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDatabaseFile, value.DatabaseFile, null, null); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropDownloadDatabaseOnPipelineCreation, value.DownloadDatabaseOnPipelineCreation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFirstOnly, value.FirstOnly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropProperties, value.Properties, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpProcessor.g.cs index d3a87fe3c8f..418d5fb5a10 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GeoIpProcessor.g.cs @@ -23,145 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class GeoIpProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDatabaseFile = System.Text.Json.JsonEncodedText.Encode("database_file"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropDownloadDatabaseOnPipelineCreation = System.Text.Json.JsonEncodedText.Encode("download_database_on_pipeline_creation"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFirstOnly = System.Text.Json.JsonEncodedText.Encode("first_only"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - - public override Elastic.Clients.Elasticsearch.Ingest.GeoIpProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDatabaseFile = default; - LocalJsonValue propDescription = default; - LocalJsonValue propDownloadDatabaseOnPipelineCreation = default; - LocalJsonValue propField = default; - LocalJsonValue propFirstOnly = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue?> propProperties = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDatabaseFile.TryReadProperty(ref reader, options, PropDatabaseFile, null)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propDownloadDatabaseOnPipelineCreation.TryReadProperty(ref reader, options, PropDownloadDatabaseOnPipelineCreation, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFirstOnly.TryReadProperty(ref reader, options, PropFirstOnly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.GeoIpProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DatabaseFile = propDatabaseFile.Value, - Description = propDescription.Value, - DownloadDatabaseOnPipelineCreation = propDownloadDatabaseOnPipelineCreation.Value, - Field = propField.Value, - FirstOnly = propFirstOnly.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - OnFailure = propOnFailure.Value, - Properties = propProperties.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GeoIpProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDatabaseFile, value.DatabaseFile, null, null); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropDownloadDatabaseOnPipelineCreation, value.DownloadDatabaseOnPipelineCreation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFirstOnly, value.FirstOnly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropProperties, value.Properties, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.GeoIpProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.GeoIpProcessorConverter))] public sealed partial class GeoIpProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GrokProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GrokProcessor.Converters.g.cs new file mode 100644 index 00000000000..3ac586ff442 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GrokProcessor.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class GrokProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropEcsCompatibility = System.Text.Json.JsonEncodedText.Encode("ecs_compatibility"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropPatternDefinitions = System.Text.Json.JsonEncodedText.Encode("pattern_definitions"); + private static readonly System.Text.Json.JsonEncodedText PropPatterns = System.Text.Json.JsonEncodedText.Encode("patterns"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTraceMatch = System.Text.Json.JsonEncodedText.Encode("trace_match"); + + public override Elastic.Clients.Elasticsearch.Ingest.GrokProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propEcsCompatibility = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue?> propPatternDefinitions = default; + LocalJsonValue> propPatterns = default; + LocalJsonValue propTag = default; + LocalJsonValue propTraceMatch = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propEcsCompatibility.TryReadProperty(ref reader, options, PropEcsCompatibility, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propPatternDefinitions.TryReadProperty(ref reader, options, PropPatternDefinitions, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propPatterns.TryReadProperty(ref reader, options, PropPatterns, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTraceMatch.TryReadProperty(ref reader, options, PropTraceMatch, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.GrokProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + EcsCompatibility = propEcsCompatibility.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + OnFailure = propOnFailure.Value, + PatternDefinitions = propPatternDefinitions.Value, + Patterns = propPatterns.Value, + Tag = propTag.Value, + TraceMatch = propTraceMatch.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GrokProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropEcsCompatibility, value.EcsCompatibility, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPatternDefinitions, value.PatternDefinitions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropPatterns, value.Patterns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTraceMatch, value.TraceMatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GrokProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GrokProcessor.g.cs index 34a07fcf120..89349327329 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GrokProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GrokProcessor.g.cs @@ -23,136 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class GrokProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropEcsCompatibility = System.Text.Json.JsonEncodedText.Encode("ecs_compatibility"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropPatternDefinitions = System.Text.Json.JsonEncodedText.Encode("pattern_definitions"); - private static readonly System.Text.Json.JsonEncodedText PropPatterns = System.Text.Json.JsonEncodedText.Encode("patterns"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTraceMatch = System.Text.Json.JsonEncodedText.Encode("trace_match"); - - public override Elastic.Clients.Elasticsearch.Ingest.GrokProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propEcsCompatibility = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue?> propPatternDefinitions = default; - LocalJsonValue> propPatterns = default; - LocalJsonValue propTag = default; - LocalJsonValue propTraceMatch = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propEcsCompatibility.TryReadProperty(ref reader, options, PropEcsCompatibility, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propPatternDefinitions.TryReadProperty(ref reader, options, PropPatternDefinitions, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propPatterns.TryReadProperty(ref reader, options, PropPatterns, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTraceMatch.TryReadProperty(ref reader, options, PropTraceMatch, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.GrokProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - EcsCompatibility = propEcsCompatibility.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - OnFailure = propOnFailure.Value, - PatternDefinitions = propPatternDefinitions.Value, - Patterns = propPatterns.Value, - Tag = propTag.Value, - TraceMatch = propTraceMatch.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GrokProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropEcsCompatibility, value.EcsCompatibility, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPatternDefinitions, value.PatternDefinitions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropPatterns, value.Patterns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTraceMatch, value.TraceMatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.GrokProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.GrokProcessorConverter))] public sealed partial class GrokProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GsubProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GsubProcessor.Converters.g.cs new file mode 100644 index 00000000000..3debdfea750 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GsubProcessor.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class GsubProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropPattern = System.Text.Json.JsonEncodedText.Encode("pattern"); + private static readonly System.Text.Json.JsonEncodedText PropReplacement = System.Text.Json.JsonEncodedText.Encode("replacement"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + + public override Elastic.Clients.Elasticsearch.Ingest.GsubProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propPattern = default; + LocalJsonValue propReplacement = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propPattern.TryReadProperty(ref reader, options, PropPattern, null)) + { + continue; + } + + if (propReplacement.TryReadProperty(ref reader, options, PropReplacement, null)) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.GsubProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + OnFailure = propOnFailure.Value, + Pattern = propPattern.Value, + Replacement = propReplacement.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GsubProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPattern, value.Pattern, null, null); + writer.WriteProperty(options, PropReplacement, value.Replacement, null, null); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GsubProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GsubProcessor.g.cs index 5bcfc062437..a88050adb96 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GsubProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/GsubProcessor.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class GsubProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropPattern = System.Text.Json.JsonEncodedText.Encode("pattern"); - private static readonly System.Text.Json.JsonEncodedText PropReplacement = System.Text.Json.JsonEncodedText.Encode("replacement"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - - public override Elastic.Clients.Elasticsearch.Ingest.GsubProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propPattern = default; - LocalJsonValue propReplacement = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propPattern.TryReadProperty(ref reader, options, PropPattern, null)) - { - continue; - } - - if (propReplacement.TryReadProperty(ref reader, options, PropReplacement, null)) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.GsubProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - OnFailure = propOnFailure.Value, - Pattern = propPattern.Value, - Replacement = propReplacement.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.GsubProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPattern, value.Pattern, null, null); - writer.WriteProperty(options, PropReplacement, value.Replacement, null, null); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.GsubProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.GsubProcessorConverter))] public sealed partial class GsubProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/HtmlStripProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/HtmlStripProcessor.Converters.g.cs new file mode 100644 index 00000000000..a84c19589a5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/HtmlStripProcessor.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class HtmlStripProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + + public override Elastic.Clients.Elasticsearch.Ingest.HtmlStripProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.HtmlStripProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + OnFailure = propOnFailure.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.HtmlStripProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/HtmlStripProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/HtmlStripProcessor.g.cs index be17953f9cd..fdf48473b18 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/HtmlStripProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/HtmlStripProcessor.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class HtmlStripProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - - public override Elastic.Clients.Elasticsearch.Ingest.HtmlStripProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.HtmlStripProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - OnFailure = propOnFailure.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.HtmlStripProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.HtmlStripProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.HtmlStripProcessorConverter))] public sealed partial class HtmlStripProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfig.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfig.Converters.g.cs new file mode 100644 index 00000000000..2d8de4fe860 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfig.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class InferenceConfigConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantClassification = System.Text.Json.JsonEncodedText.Encode("classification"); + private static readonly System.Text.Json.JsonEncodedText VariantRegression = System.Text.Json.JsonEncodedText.Encode("regression"); + + public override Elastic.Clients.Elasticsearch.Ingest.InferenceConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantClassification)) + { + variantType = VariantClassification.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRegression)) + { + variantType = VariantRegression.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.InferenceConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.InferenceConfig value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "classification": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.InferenceConfigClassification)value.Variant, null, null); + break; + case "regression": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.InferenceConfigRegression)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Ingest.InferenceConfig)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfig.g.cs index 07c1cf028f8..8c99a22ccec 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfig.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class InferenceConfigConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantClassification = System.Text.Json.JsonEncodedText.Encode("classification"); - private static readonly System.Text.Json.JsonEncodedText VariantRegression = System.Text.Json.JsonEncodedText.Encode("regression"); - - public override Elastic.Clients.Elasticsearch.Ingest.InferenceConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantClassification)) - { - variantType = VariantClassification.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRegression)) - { - variantType = VariantRegression.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.InferenceConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.InferenceConfig value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "classification": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.InferenceConfigClassification)value.Variant, null, null); - break; - case "regression": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.InferenceConfigRegression)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Ingest.InferenceConfig)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.InferenceConfigConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.InferenceConfigConverter))] public sealed partial class InferenceConfig { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfigClassification.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfigClassification.Converters.g.cs new file mode 100644 index 00000000000..70951da316e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfigClassification.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class InferenceConfigClassificationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNumTopClasses = System.Text.Json.JsonEncodedText.Encode("num_top_classes"); + private static readonly System.Text.Json.JsonEncodedText PropNumTopFeatureImportanceValues = System.Text.Json.JsonEncodedText.Encode("num_top_feature_importance_values"); + private static readonly System.Text.Json.JsonEncodedText PropPredictionFieldType = System.Text.Json.JsonEncodedText.Encode("prediction_field_type"); + private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); + private static readonly System.Text.Json.JsonEncodedText PropTopClassesResultsField = System.Text.Json.JsonEncodedText.Encode("top_classes_results_field"); + + public override Elastic.Clients.Elasticsearch.Ingest.InferenceConfigClassification Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propNumTopClasses = default; + LocalJsonValue propNumTopFeatureImportanceValues = default; + LocalJsonValue propPredictionFieldType = default; + LocalJsonValue propResultsField = default; + LocalJsonValue propTopClassesResultsField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNumTopClasses.TryReadProperty(ref reader, options, PropNumTopClasses, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNumTopFeatureImportanceValues.TryReadProperty(ref reader, options, PropNumTopFeatureImportanceValues, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPredictionFieldType.TryReadProperty(ref reader, options, PropPredictionFieldType, null)) + { + continue; + } + + if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) + { + continue; + } + + if (propTopClassesResultsField.TryReadProperty(ref reader, options, PropTopClassesResultsField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.InferenceConfigClassification(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + NumTopClasses = propNumTopClasses.Value, + NumTopFeatureImportanceValues = propNumTopFeatureImportanceValues.Value, + PredictionFieldType = propPredictionFieldType.Value, + ResultsField = propResultsField.Value, + TopClassesResultsField = propTopClassesResultsField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.InferenceConfigClassification value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNumTopClasses, value.NumTopClasses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNumTopFeatureImportanceValues, value.NumTopFeatureImportanceValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPredictionFieldType, value.PredictionFieldType, null, null); + writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); + writer.WriteProperty(options, PropTopClassesResultsField, value.TopClassesResultsField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfigClassification.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfigClassification.g.cs index b9059dda8ca..27f20b3ec98 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfigClassification.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfigClassification.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class InferenceConfigClassificationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNumTopClasses = System.Text.Json.JsonEncodedText.Encode("num_top_classes"); - private static readonly System.Text.Json.JsonEncodedText PropNumTopFeatureImportanceValues = System.Text.Json.JsonEncodedText.Encode("num_top_feature_importance_values"); - private static readonly System.Text.Json.JsonEncodedText PropPredictionFieldType = System.Text.Json.JsonEncodedText.Encode("prediction_field_type"); - private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); - private static readonly System.Text.Json.JsonEncodedText PropTopClassesResultsField = System.Text.Json.JsonEncodedText.Encode("top_classes_results_field"); - - public override Elastic.Clients.Elasticsearch.Ingest.InferenceConfigClassification Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propNumTopClasses = default; - LocalJsonValue propNumTopFeatureImportanceValues = default; - LocalJsonValue propPredictionFieldType = default; - LocalJsonValue propResultsField = default; - LocalJsonValue propTopClassesResultsField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNumTopClasses.TryReadProperty(ref reader, options, PropNumTopClasses, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNumTopFeatureImportanceValues.TryReadProperty(ref reader, options, PropNumTopFeatureImportanceValues, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPredictionFieldType.TryReadProperty(ref reader, options, PropPredictionFieldType, null)) - { - continue; - } - - if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) - { - continue; - } - - if (propTopClassesResultsField.TryReadProperty(ref reader, options, PropTopClassesResultsField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.InferenceConfigClassification(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - NumTopClasses = propNumTopClasses.Value, - NumTopFeatureImportanceValues = propNumTopFeatureImportanceValues.Value, - PredictionFieldType = propPredictionFieldType.Value, - ResultsField = propResultsField.Value, - TopClassesResultsField = propTopClassesResultsField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.InferenceConfigClassification value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNumTopClasses, value.NumTopClasses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNumTopFeatureImportanceValues, value.NumTopFeatureImportanceValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPredictionFieldType, value.PredictionFieldType, null, null); - writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); - writer.WriteProperty(options, PropTopClassesResultsField, value.TopClassesResultsField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.InferenceConfigClassificationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.InferenceConfigClassificationConverter))] public sealed partial class InferenceConfigClassification { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfigRegression.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfigRegression.Converters.g.cs new file mode 100644 index 00000000000..e46b7b3b581 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfigRegression.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class InferenceConfigRegressionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNumTopFeatureImportanceValues = System.Text.Json.JsonEncodedText.Encode("num_top_feature_importance_values"); + private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); + + public override Elastic.Clients.Elasticsearch.Ingest.InferenceConfigRegression Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propNumTopFeatureImportanceValues = default; + LocalJsonValue propResultsField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNumTopFeatureImportanceValues.TryReadProperty(ref reader, options, PropNumTopFeatureImportanceValues, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.InferenceConfigRegression(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + NumTopFeatureImportanceValues = propNumTopFeatureImportanceValues.Value, + ResultsField = propResultsField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.InferenceConfigRegression value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNumTopFeatureImportanceValues, value.NumTopFeatureImportanceValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfigRegression.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfigRegression.g.cs index 69ee088a1bb..e461fc27f5b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfigRegression.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceConfigRegression.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class InferenceConfigRegressionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNumTopFeatureImportanceValues = System.Text.Json.JsonEncodedText.Encode("num_top_feature_importance_values"); - private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); - - public override Elastic.Clients.Elasticsearch.Ingest.InferenceConfigRegression Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propNumTopFeatureImportanceValues = default; - LocalJsonValue propResultsField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNumTopFeatureImportanceValues.TryReadProperty(ref reader, options, PropNumTopFeatureImportanceValues, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.InferenceConfigRegression(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - NumTopFeatureImportanceValues = propNumTopFeatureImportanceValues.Value, - ResultsField = propResultsField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.InferenceConfigRegression value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNumTopFeatureImportanceValues, value.NumTopFeatureImportanceValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.InferenceConfigRegressionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.InferenceConfigRegressionConverter))] public sealed partial class InferenceConfigRegression { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceProcessor.Converters.g.cs new file mode 100644 index 00000000000..e863c7c7ecd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceProcessor.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class InferenceProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropFieldMap = System.Text.Json.JsonEncodedText.Encode("field_map"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceConfig = System.Text.Json.JsonEncodedText.Encode("inference_config"); + private static readonly System.Text.Json.JsonEncodedText PropInputOutput = System.Text.Json.JsonEncodedText.Encode("input_output"); + private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + + public override Elastic.Clients.Elasticsearch.Ingest.InferenceProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue?> propFieldMap = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue propInferenceConfig = default; + LocalJsonValue?> propInputOutput = default; + LocalJsonValue propModelId = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propFieldMap.TryReadProperty(ref reader, options, PropFieldMap, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propInferenceConfig.TryReadProperty(ref reader, options, PropInferenceConfig, null)) + { + continue; + } + + if (propInputOutput.TryReadProperty(ref reader, options, PropInputOutput, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.InferenceProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + FieldMap = propFieldMap.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + InferenceConfig = propInferenceConfig.Value, + InputOutput = propInputOutput.Value, + ModelId = propModelId.Value, + OnFailure = propOnFailure.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.InferenceProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropFieldMap, value.FieldMap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropInferenceConfig, value.InferenceConfig, null, null); + writer.WriteProperty(options, PropInputOutput, value.InputOutput, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropModelId, value.ModelId, null, null); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceProcessor.g.cs index 4aa5e9e732d..6145c6ea47a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InferenceProcessor.g.cs @@ -23,136 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class InferenceProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropFieldMap = System.Text.Json.JsonEncodedText.Encode("field_map"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceConfig = System.Text.Json.JsonEncodedText.Encode("inference_config"); - private static readonly System.Text.Json.JsonEncodedText PropInputOutput = System.Text.Json.JsonEncodedText.Encode("input_output"); - private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - - public override Elastic.Clients.Elasticsearch.Ingest.InferenceProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue?> propFieldMap = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue propInferenceConfig = default; - LocalJsonValue?> propInputOutput = default; - LocalJsonValue propModelId = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propFieldMap.TryReadProperty(ref reader, options, PropFieldMap, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propInferenceConfig.TryReadProperty(ref reader, options, PropInferenceConfig, null)) - { - continue; - } - - if (propInputOutput.TryReadProperty(ref reader, options, PropInputOutput, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.InferenceProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - FieldMap = propFieldMap.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - InferenceConfig = propInferenceConfig.Value, - InputOutput = propInputOutput.Value, - ModelId = propModelId.Value, - OnFailure = propOnFailure.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.InferenceProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropFieldMap, value.FieldMap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropInferenceConfig, value.InferenceConfig, null, null); - writer.WriteProperty(options, PropInputOutput, value.InputOutput, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropModelId, value.ModelId, null, null); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.InferenceProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.InferenceProcessorConverter))] public sealed partial class InferenceProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Ingest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Ingest.Converters.g.cs new file mode 100644 index 00000000000..27dd9f89abc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Ingest.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class IngestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPipeline = System.Text.Json.JsonEncodedText.Encode("pipeline"); + private static readonly System.Text.Json.JsonEncodedText PropRedact = System.Text.Json.JsonEncodedText.Encode("_redact"); + private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); + + public override Elastic.Clients.Elasticsearch.Ingest.Ingest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPipeline = default; + LocalJsonValue propRedact = default; + LocalJsonValue propTimestamp = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPipeline.TryReadProperty(ref reader, options, PropPipeline, null)) + { + continue; + } + + if (propRedact.TryReadProperty(ref reader, options, PropRedact, null)) + { + continue; + } + + if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.Ingest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Pipeline = propPipeline.Value, + Redact = propRedact.Value, + Timestamp = propTimestamp.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.Ingest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPipeline, value.Pipeline, null, null); + writer.WriteProperty(options, PropRedact, value.Redact, null, null); + writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Ingest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Ingest.g.cs index 26243ea7bf9..dd2ebcc49d1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Ingest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Ingest.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class IngestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPipeline = System.Text.Json.JsonEncodedText.Encode("pipeline"); - private static readonly System.Text.Json.JsonEncodedText PropRedact = System.Text.Json.JsonEncodedText.Encode("_redact"); - private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); - - public override Elastic.Clients.Elasticsearch.Ingest.Ingest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPipeline = default; - LocalJsonValue propRedact = default; - LocalJsonValue propTimestamp = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPipeline.TryReadProperty(ref reader, options, PropPipeline, null)) - { - continue; - } - - if (propRedact.TryReadProperty(ref reader, options, PropRedact, null)) - { - continue; - } - - if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.Ingest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Pipeline = propPipeline.Value, - Redact = propRedact.Value, - Timestamp = propTimestamp.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.Ingest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPipeline, value.Pipeline, null, null); - writer.WriteProperty(options, PropRedact, value.Redact, null, null); - writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.IngestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.IngestConverter))] public sealed partial class Ingest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InputConfig.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InputConfig.Converters.g.cs new file mode 100644 index 00000000000..31c620b2d01 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InputConfig.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class InputConfigConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropInputField = System.Text.Json.JsonEncodedText.Encode("input_field"); + private static readonly System.Text.Json.JsonEncodedText PropOutputField = System.Text.Json.JsonEncodedText.Encode("output_field"); + + public override Elastic.Clients.Elasticsearch.Ingest.InputConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propInputField = default; + LocalJsonValue propOutputField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propInputField.TryReadProperty(ref reader, options, PropInputField, null)) + { + continue; + } + + if (propOutputField.TryReadProperty(ref reader, options, PropOutputField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.InputConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + InputField = propInputField.Value, + OutputField = propOutputField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.InputConfig value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropInputField, value.InputField, null, null); + writer.WriteProperty(options, PropOutputField, value.OutputField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InputConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InputConfig.g.cs index 6f5abc6100c..5b71af06a08 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InputConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/InputConfig.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class InputConfigConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropInputField = System.Text.Json.JsonEncodedText.Encode("input_field"); - private static readonly System.Text.Json.JsonEncodedText PropOutputField = System.Text.Json.JsonEncodedText.Encode("output_field"); - - public override Elastic.Clients.Elasticsearch.Ingest.InputConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propInputField = default; - LocalJsonValue propOutputField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propInputField.TryReadProperty(ref reader, options, PropInputField, null)) - { - continue; - } - - if (propOutputField.TryReadProperty(ref reader, options, PropOutputField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.InputConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - InputField = propInputField.Value, - OutputField = propOutputField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.InputConfig value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropInputField, value.InputField, null, null); - writer.WriteProperty(options, PropOutputField, value.OutputField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.InputConfigConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.InputConfigConverter))] public sealed partial class InputConfig { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/IpDatabaseConfigurationMetadata.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/IpDatabaseConfigurationMetadata.Converters.g.cs new file mode 100644 index 00000000000..93b5f1cbe0a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/IpDatabaseConfigurationMetadata.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class IpDatabaseConfigurationMetadataConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDatabase = System.Text.Json.JsonEncodedText.Encode("database"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropModifiedDate = System.Text.Json.JsonEncodedText.Encode("modified_date"); + private static readonly System.Text.Json.JsonEncodedText PropModifiedDateMillis = System.Text.Json.JsonEncodedText.Encode("modified_date_millis"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Ingest.IpDatabaseConfigurationMetadata Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDatabase = default; + LocalJsonValue propId = default; + LocalJsonValue propModifiedDate = default; + LocalJsonValue propModifiedDateMillis = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDatabase.TryReadProperty(ref reader, options, PropDatabase, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propModifiedDate.TryReadProperty(ref reader, options, PropModifiedDate, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propModifiedDateMillis.TryReadProperty(ref reader, options, PropModifiedDateMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.IpDatabaseConfigurationMetadata(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Database = propDatabase.Value, + Id = propId.Value, + ModifiedDate = propModifiedDate.Value, + ModifiedDateMillis = propModifiedDateMillis.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.IpDatabaseConfigurationMetadata value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDatabase, value.Database, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropModifiedDate, value.ModifiedDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropModifiedDateMillis, value.ModifiedDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/IpDatabaseConfigurationMetadata.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/IpDatabaseConfigurationMetadata.g.cs index e9b56001a11..6399f9e3f08 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/IpDatabaseConfigurationMetadata.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/IpDatabaseConfigurationMetadata.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class IpDatabaseConfigurationMetadataConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDatabase = System.Text.Json.JsonEncodedText.Encode("database"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropModifiedDate = System.Text.Json.JsonEncodedText.Encode("modified_date"); - private static readonly System.Text.Json.JsonEncodedText PropModifiedDateMillis = System.Text.Json.JsonEncodedText.Encode("modified_date_millis"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Ingest.IpDatabaseConfigurationMetadata Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDatabase = default; - LocalJsonValue propId = default; - LocalJsonValue propModifiedDate = default; - LocalJsonValue propModifiedDateMillis = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDatabase.TryReadProperty(ref reader, options, PropDatabase, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propModifiedDate.TryReadProperty(ref reader, options, PropModifiedDate, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propModifiedDateMillis.TryReadProperty(ref reader, options, PropModifiedDateMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.IpDatabaseConfigurationMetadata(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Database = propDatabase.Value, - Id = propId.Value, - ModifiedDate = propModifiedDate.Value, - ModifiedDateMillis = propModifiedDateMillis.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.IpDatabaseConfigurationMetadata value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDatabase, value.Database, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropModifiedDate, value.ModifiedDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropModifiedDateMillis, value.ModifiedDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.IpDatabaseConfigurationMetadataConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.IpDatabaseConfigurationMetadataConverter))] public sealed partial class IpDatabaseConfigurationMetadata { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/IpLocationProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/IpLocationProcessor.Converters.g.cs new file mode 100644 index 00000000000..4599665e3f3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/IpLocationProcessor.Converters.g.cs @@ -0,0 +1,162 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class IpLocationProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDatabaseFile = System.Text.Json.JsonEncodedText.Encode("database_file"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropDownloadDatabaseOnPipelineCreation = System.Text.Json.JsonEncodedText.Encode("download_database_on_pipeline_creation"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFirstOnly = System.Text.Json.JsonEncodedText.Encode("first_only"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + + public override Elastic.Clients.Elasticsearch.Ingest.IpLocationProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDatabaseFile = default; + LocalJsonValue propDescription = default; + LocalJsonValue propDownloadDatabaseOnPipelineCreation = default; + LocalJsonValue propField = default; + LocalJsonValue propFirstOnly = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue?> propProperties = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDatabaseFile.TryReadProperty(ref reader, options, PropDatabaseFile, null)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propDownloadDatabaseOnPipelineCreation.TryReadProperty(ref reader, options, PropDownloadDatabaseOnPipelineCreation, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFirstOnly.TryReadProperty(ref reader, options, PropFirstOnly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.IpLocationProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DatabaseFile = propDatabaseFile.Value, + Description = propDescription.Value, + DownloadDatabaseOnPipelineCreation = propDownloadDatabaseOnPipelineCreation.Value, + Field = propField.Value, + FirstOnly = propFirstOnly.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + OnFailure = propOnFailure.Value, + Properties = propProperties.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.IpLocationProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDatabaseFile, value.DatabaseFile, null, null); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropDownloadDatabaseOnPipelineCreation, value.DownloadDatabaseOnPipelineCreation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFirstOnly, value.FirstOnly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropProperties, value.Properties, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/IpLocationProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/IpLocationProcessor.g.cs index 9d4907c2d82..ac5afe044e5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/IpLocationProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/IpLocationProcessor.g.cs @@ -23,145 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class IpLocationProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDatabaseFile = System.Text.Json.JsonEncodedText.Encode("database_file"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropDownloadDatabaseOnPipelineCreation = System.Text.Json.JsonEncodedText.Encode("download_database_on_pipeline_creation"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFirstOnly = System.Text.Json.JsonEncodedText.Encode("first_only"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - - public override Elastic.Clients.Elasticsearch.Ingest.IpLocationProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDatabaseFile = default; - LocalJsonValue propDescription = default; - LocalJsonValue propDownloadDatabaseOnPipelineCreation = default; - LocalJsonValue propField = default; - LocalJsonValue propFirstOnly = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue?> propProperties = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDatabaseFile.TryReadProperty(ref reader, options, PropDatabaseFile, null)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propDownloadDatabaseOnPipelineCreation.TryReadProperty(ref reader, options, PropDownloadDatabaseOnPipelineCreation, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFirstOnly.TryReadProperty(ref reader, options, PropFirstOnly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.IpLocationProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DatabaseFile = propDatabaseFile.Value, - Description = propDescription.Value, - DownloadDatabaseOnPipelineCreation = propDownloadDatabaseOnPipelineCreation.Value, - Field = propField.Value, - FirstOnly = propFirstOnly.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - OnFailure = propOnFailure.Value, - Properties = propProperties.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.IpLocationProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDatabaseFile, value.DatabaseFile, null, null); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropDownloadDatabaseOnPipelineCreation, value.DownloadDatabaseOnPipelineCreation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFirstOnly, value.FirstOnly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropProperties, value.Properties, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.IpLocationProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.IpLocationProcessorConverter))] public sealed partial class IpLocationProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Ipinfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Ipinfo.Converters.g.cs new file mode 100644 index 00000000000..abc5814ec2e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Ipinfo.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class IpinfoConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Ingest.Ipinfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.Ipinfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.Ipinfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Ipinfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Ipinfo.g.cs index 0fb7a8dde29..b4c09b65f59 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Ipinfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Ipinfo.g.cs @@ -23,36 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class IpinfoConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Ingest.Ipinfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.Ipinfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.Ipinfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.IpinfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.IpinfoConverter))] public sealed partial class Ipinfo { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JoinProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JoinProcessor.Converters.g.cs new file mode 100644 index 00000000000..8ea71051ef1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JoinProcessor.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class JoinProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropSeparator = System.Text.Json.JsonEncodedText.Encode("separator"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + + public override Elastic.Clients.Elasticsearch.Ingest.JoinProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propSeparator = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propSeparator.TryReadProperty(ref reader, options, PropSeparator, null)) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.JoinProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + OnFailure = propOnFailure.Value, + Separator = propSeparator.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.JoinProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSeparator, value.Separator, null, null); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JoinProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JoinProcessor.g.cs index b9460fecbfe..c190374b6e8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JoinProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JoinProcessor.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class JoinProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropSeparator = System.Text.Json.JsonEncodedText.Encode("separator"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - - public override Elastic.Clients.Elasticsearch.Ingest.JoinProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propSeparator = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propSeparator.TryReadProperty(ref reader, options, PropSeparator, null)) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.JoinProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - OnFailure = propOnFailure.Value, - Separator = propSeparator.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.JoinProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSeparator, value.Separator, null, null); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.JoinProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.JoinProcessorConverter))] public sealed partial class JoinProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JsonProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JsonProcessor.Converters.g.cs new file mode 100644 index 00000000000..6d219c422a1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JsonProcessor.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class JsonProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAddToRoot = System.Text.Json.JsonEncodedText.Encode("add_to_root"); + private static readonly System.Text.Json.JsonEncodedText PropAddToRootConflictStrategy = System.Text.Json.JsonEncodedText.Encode("add_to_root_conflict_strategy"); + private static readonly System.Text.Json.JsonEncodedText PropAllowDuplicateKeys = System.Text.Json.JsonEncodedText.Encode("allow_duplicate_keys"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + + public override Elastic.Clients.Elasticsearch.Ingest.JsonProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAddToRoot = default; + LocalJsonValue propAddToRootConflictStrategy = default; + LocalJsonValue propAllowDuplicateKeys = default; + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAddToRoot.TryReadProperty(ref reader, options, PropAddToRoot, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propAddToRootConflictStrategy.TryReadProperty(ref reader, options, PropAddToRootConflictStrategy, static Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propAllowDuplicateKeys.TryReadProperty(ref reader, options, PropAllowDuplicateKeys, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.JsonProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AddToRoot = propAddToRoot.Value, + AddToRootConflictStrategy = propAddToRootConflictStrategy.Value, + AllowDuplicateKeys = propAllowDuplicateKeys.Value, + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + OnFailure = propOnFailure.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.JsonProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAddToRoot, value.AddToRoot, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropAddToRootConflictStrategy, value.AddToRootConflictStrategy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropAllowDuplicateKeys, value.AllowDuplicateKeys, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JsonProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JsonProcessor.g.cs index c2ace87b7cb..14b79bddfea 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JsonProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JsonProcessor.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class JsonProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAddToRoot = System.Text.Json.JsonEncodedText.Encode("add_to_root"); - private static readonly System.Text.Json.JsonEncodedText PropAddToRootConflictStrategy = System.Text.Json.JsonEncodedText.Encode("add_to_root_conflict_strategy"); - private static readonly System.Text.Json.JsonEncodedText PropAllowDuplicateKeys = System.Text.Json.JsonEncodedText.Encode("allow_duplicate_keys"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - - public override Elastic.Clients.Elasticsearch.Ingest.JsonProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAddToRoot = default; - LocalJsonValue propAddToRootConflictStrategy = default; - LocalJsonValue propAllowDuplicateKeys = default; - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAddToRoot.TryReadProperty(ref reader, options, PropAddToRoot, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propAddToRootConflictStrategy.TryReadProperty(ref reader, options, PropAddToRootConflictStrategy, static Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propAllowDuplicateKeys.TryReadProperty(ref reader, options, PropAllowDuplicateKeys, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.JsonProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AddToRoot = propAddToRoot.Value, - AddToRootConflictStrategy = propAddToRootConflictStrategy.Value, - AllowDuplicateKeys = propAllowDuplicateKeys.Value, - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - OnFailure = propOnFailure.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.JsonProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAddToRoot, value.AddToRoot, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropAddToRootConflictStrategy, value.AddToRootConflictStrategy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropAllowDuplicateKeys, value.AllowDuplicateKeys, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.JsonProcessorConverter))] public sealed partial class JsonProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JsonProcessorConflictStrategy.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JsonProcessorConflictStrategy.Converters.g.cs new file mode 100644 index 00000000000..39f7ee5dd1c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JsonProcessorConflictStrategy.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class JsonProcessorConflictStrategyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberMerge = System.Text.Json.JsonEncodedText.Encode("merge"); + private static readonly System.Text.Json.JsonEncodedText MemberReplace = System.Text.Json.JsonEncodedText.Encode("replace"); + + public override Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberMerge)) + { + return Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy.Merge; + } + + if (reader.ValueTextEquals(MemberReplace)) + { + return Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy.Replace; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberMerge.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy.Merge; + } + + if (string.Equals(value, MemberReplace.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy.Replace; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy.Merge: + writer.WriteStringValue(MemberMerge); + break; + case Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy.Replace: + writer.WriteStringValue(MemberReplace); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.JsonProcessorConflictStrategy value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JsonProcessorConflictStrategy.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JsonProcessorConflictStrategy.g.cs new file mode 100644 index 00000000000..53120c5d8fe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/JsonProcessorConflictStrategy.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.JsonProcessorConflictStrategyConverter))] +public enum JsonProcessorConflictStrategy +{ + /// + /// + /// Conflicting fields will be merged. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "merge")] + Merge, + /// + /// + /// Root fields that conflict with fields from the parsed JSON will be overridden. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "replace")] + Replace +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/KeyValueProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/KeyValueProcessor.Converters.g.cs new file mode 100644 index 00000000000..8995cee130a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/KeyValueProcessor.Converters.g.cs @@ -0,0 +1,198 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class KeyValueProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropExcludeKeys = System.Text.Json.JsonEncodedText.Encode("exclude_keys"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFieldSplit = System.Text.Json.JsonEncodedText.Encode("field_split"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropIncludeKeys = System.Text.Json.JsonEncodedText.Encode("include_keys"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropPrefix = System.Text.Json.JsonEncodedText.Encode("prefix"); + private static readonly System.Text.Json.JsonEncodedText PropStripBrackets = System.Text.Json.JsonEncodedText.Encode("strip_brackets"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + private static readonly System.Text.Json.JsonEncodedText PropTrimKey = System.Text.Json.JsonEncodedText.Encode("trim_key"); + private static readonly System.Text.Json.JsonEncodedText PropTrimValue = System.Text.Json.JsonEncodedText.Encode("trim_value"); + private static readonly System.Text.Json.JsonEncodedText PropValueSplit = System.Text.Json.JsonEncodedText.Encode("value_split"); + + public override Elastic.Clients.Elasticsearch.Ingest.KeyValueProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue?> propExcludeKeys = default; + LocalJsonValue propField = default; + LocalJsonValue propFieldSplit = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue?> propIncludeKeys = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propPrefix = default; + LocalJsonValue propStripBrackets = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + LocalJsonValue propTrimKey = default; + LocalJsonValue propTrimValue = default; + LocalJsonValue propValueSplit = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propExcludeKeys.TryReadProperty(ref reader, options, PropExcludeKeys, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFieldSplit.TryReadProperty(ref reader, options, PropFieldSplit, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIncludeKeys.TryReadProperty(ref reader, options, PropIncludeKeys, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propPrefix.TryReadProperty(ref reader, options, PropPrefix, null)) + { + continue; + } + + if (propStripBrackets.TryReadProperty(ref reader, options, PropStripBrackets, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (propTrimKey.TryReadProperty(ref reader, options, PropTrimKey, null)) + { + continue; + } + + if (propTrimValue.TryReadProperty(ref reader, options, PropTrimValue, null)) + { + continue; + } + + if (propValueSplit.TryReadProperty(ref reader, options, PropValueSplit, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.KeyValueProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + ExcludeKeys = propExcludeKeys.Value, + Field = propField.Value, + FieldSplit = propFieldSplit.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + IncludeKeys = propIncludeKeys.Value, + OnFailure = propOnFailure.Value, + Prefix = propPrefix.Value, + StripBrackets = propStripBrackets.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value, + TrimKey = propTrimKey.Value, + TrimValue = propTrimValue.Value, + ValueSplit = propValueSplit.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.KeyValueProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropExcludeKeys, value.ExcludeKeys, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFieldSplit, value.FieldSplit, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIncludeKeys, value.IncludeKeys, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPrefix, value.Prefix, null, null); + writer.WriteProperty(options, PropStripBrackets, value.StripBrackets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteProperty(options, PropTrimKey, value.TrimKey, null, null); + writer.WriteProperty(options, PropTrimValue, value.TrimValue, null, null); + writer.WriteProperty(options, PropValueSplit, value.ValueSplit, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/KeyValueProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/KeyValueProcessor.g.cs index aee2791ea0f..39ae7c490f0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/KeyValueProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/KeyValueProcessor.g.cs @@ -23,181 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class KeyValueProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropExcludeKeys = System.Text.Json.JsonEncodedText.Encode("exclude_keys"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFieldSplit = System.Text.Json.JsonEncodedText.Encode("field_split"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropIncludeKeys = System.Text.Json.JsonEncodedText.Encode("include_keys"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropPrefix = System.Text.Json.JsonEncodedText.Encode("prefix"); - private static readonly System.Text.Json.JsonEncodedText PropStripBrackets = System.Text.Json.JsonEncodedText.Encode("strip_brackets"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - private static readonly System.Text.Json.JsonEncodedText PropTrimKey = System.Text.Json.JsonEncodedText.Encode("trim_key"); - private static readonly System.Text.Json.JsonEncodedText PropTrimValue = System.Text.Json.JsonEncodedText.Encode("trim_value"); - private static readonly System.Text.Json.JsonEncodedText PropValueSplit = System.Text.Json.JsonEncodedText.Encode("value_split"); - - public override Elastic.Clients.Elasticsearch.Ingest.KeyValueProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue?> propExcludeKeys = default; - LocalJsonValue propField = default; - LocalJsonValue propFieldSplit = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue?> propIncludeKeys = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propPrefix = default; - LocalJsonValue propStripBrackets = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - LocalJsonValue propTrimKey = default; - LocalJsonValue propTrimValue = default; - LocalJsonValue propValueSplit = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propExcludeKeys.TryReadProperty(ref reader, options, PropExcludeKeys, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFieldSplit.TryReadProperty(ref reader, options, PropFieldSplit, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIncludeKeys.TryReadProperty(ref reader, options, PropIncludeKeys, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propPrefix.TryReadProperty(ref reader, options, PropPrefix, null)) - { - continue; - } - - if (propStripBrackets.TryReadProperty(ref reader, options, PropStripBrackets, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (propTrimKey.TryReadProperty(ref reader, options, PropTrimKey, null)) - { - continue; - } - - if (propTrimValue.TryReadProperty(ref reader, options, PropTrimValue, null)) - { - continue; - } - - if (propValueSplit.TryReadProperty(ref reader, options, PropValueSplit, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.KeyValueProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - ExcludeKeys = propExcludeKeys.Value, - Field = propField.Value, - FieldSplit = propFieldSplit.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - IncludeKeys = propIncludeKeys.Value, - OnFailure = propOnFailure.Value, - Prefix = propPrefix.Value, - StripBrackets = propStripBrackets.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value, - TrimKey = propTrimKey.Value, - TrimValue = propTrimValue.Value, - ValueSplit = propValueSplit.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.KeyValueProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropExcludeKeys, value.ExcludeKeys, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFieldSplit, value.FieldSplit, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIncludeKeys, value.IncludeKeys, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPrefix, value.Prefix, null, null); - writer.WriteProperty(options, PropStripBrackets, value.StripBrackets, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteProperty(options, PropTrimKey, value.TrimKey, null, null); - writer.WriteProperty(options, PropTrimValue, value.TrimValue, null, null); - writer.WriteProperty(options, PropValueSplit, value.ValueSplit, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.KeyValueProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.KeyValueProcessorConverter))] public sealed partial class KeyValueProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Local.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Local.Converters.g.cs new file mode 100644 index 00000000000..a384e96005f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Local.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class LocalConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Ingest.Local Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.Local(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.Local value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Local.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Local.g.cs index bb20c67dedc..9d7e4c22a03 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Local.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Local.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class LocalConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Ingest.Local Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.Local(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.Local value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.LocalConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.LocalConverter))] public sealed partial class Local { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/LowercaseProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/LowercaseProcessor.Converters.g.cs new file mode 100644 index 00000000000..7741f6ef838 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/LowercaseProcessor.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class LowercaseProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + + public override Elastic.Clients.Elasticsearch.Ingest.LowercaseProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.LowercaseProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + OnFailure = propOnFailure.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.LowercaseProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/LowercaseProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/LowercaseProcessor.g.cs index 05d74d429db..36581211df1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/LowercaseProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/LowercaseProcessor.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class LowercaseProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - - public override Elastic.Clients.Elasticsearch.Ingest.LowercaseProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.LowercaseProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - OnFailure = propOnFailure.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.LowercaseProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.LowercaseProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.LowercaseProcessorConverter))] public sealed partial class LowercaseProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Maxmind.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Maxmind.Converters.g.cs new file mode 100644 index 00000000000..8631ef045f8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Maxmind.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class MaxmindConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAccountId = System.Text.Json.JsonEncodedText.Encode("account_id"); + + public override Elastic.Clients.Elasticsearch.Ingest.Maxmind Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAccountId = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAccountId.TryReadProperty(ref reader, options, PropAccountId, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.Maxmind(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AccountId = propAccountId.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.Maxmind value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAccountId, value.AccountId, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Maxmind.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Maxmind.g.cs index 45e1a679ab4..fec08b9ff13 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Maxmind.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Maxmind.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class MaxmindConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAccountId = System.Text.Json.JsonEncodedText.Encode("account_id"); - - public override Elastic.Clients.Elasticsearch.Ingest.Maxmind Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAccountId = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAccountId.TryReadProperty(ref reader, options, PropAccountId, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.Maxmind(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AccountId = propAccountId.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.Maxmind value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAccountId, value.AccountId, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.MaxmindConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.MaxmindConverter))] public sealed partial class Maxmind { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/NetworkDirectionProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/NetworkDirectionProcessor.Converters.g.cs new file mode 100644 index 00000000000..3fd4c19aac3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/NetworkDirectionProcessor.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class NetworkDirectionProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropDestinationIp = System.Text.Json.JsonEncodedText.Encode("destination_ip"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropInternalNetworks = System.Text.Json.JsonEncodedText.Encode("internal_networks"); + private static readonly System.Text.Json.JsonEncodedText PropInternalNetworksField = System.Text.Json.JsonEncodedText.Encode("internal_networks_field"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropSourceIp = System.Text.Json.JsonEncodedText.Encode("source_ip"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + + public override Elastic.Clients.Elasticsearch.Ingest.NetworkDirectionProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propDestinationIp = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue?> propInternalNetworks = default; + LocalJsonValue propInternalNetworksField = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propSourceIp = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propDestinationIp.TryReadProperty(ref reader, options, PropDestinationIp, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propInternalNetworks.TryReadProperty(ref reader, options, PropInternalNetworks, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propInternalNetworksField.TryReadProperty(ref reader, options, PropInternalNetworksField, null)) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propSourceIp.TryReadProperty(ref reader, options, PropSourceIp, null)) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.NetworkDirectionProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + DestinationIp = propDestinationIp.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + InternalNetworks = propInternalNetworks.Value, + InternalNetworksField = propInternalNetworksField.Value, + OnFailure = propOnFailure.Value, + SourceIp = propSourceIp.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.NetworkDirectionProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropDestinationIp, value.DestinationIp, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropInternalNetworks, value.InternalNetworks, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropInternalNetworksField, value.InternalNetworksField, null, null); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSourceIp, value.SourceIp, null, null); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/NetworkDirectionProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/NetworkDirectionProcessor.g.cs index 256c0eaac92..3607ce212ef 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/NetworkDirectionProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/NetworkDirectionProcessor.g.cs @@ -23,136 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class NetworkDirectionProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropDestinationIp = System.Text.Json.JsonEncodedText.Encode("destination_ip"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropInternalNetworks = System.Text.Json.JsonEncodedText.Encode("internal_networks"); - private static readonly System.Text.Json.JsonEncodedText PropInternalNetworksField = System.Text.Json.JsonEncodedText.Encode("internal_networks_field"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropSourceIp = System.Text.Json.JsonEncodedText.Encode("source_ip"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - - public override Elastic.Clients.Elasticsearch.Ingest.NetworkDirectionProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propDestinationIp = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue?> propInternalNetworks = default; - LocalJsonValue propInternalNetworksField = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propSourceIp = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propDestinationIp.TryReadProperty(ref reader, options, PropDestinationIp, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propInternalNetworks.TryReadProperty(ref reader, options, PropInternalNetworks, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propInternalNetworksField.TryReadProperty(ref reader, options, PropInternalNetworksField, null)) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propSourceIp.TryReadProperty(ref reader, options, PropSourceIp, null)) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.NetworkDirectionProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - DestinationIp = propDestinationIp.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - InternalNetworks = propInternalNetworks.Value, - InternalNetworksField = propInternalNetworksField.Value, - OnFailure = propOnFailure.Value, - SourceIp = propSourceIp.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.NetworkDirectionProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropDestinationIp, value.DestinationIp, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropInternalNetworks, value.InternalNetworks, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropInternalNetworksField, value.InternalNetworksField, null, null); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSourceIp, value.SourceIp, null, null); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.NetworkDirectionProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.NetworkDirectionProcessorConverter))] public sealed partial class NetworkDirectionProcessor { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Pipeline.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Pipeline.Converters.g.cs new file mode 100644 index 00000000000..0092801b15c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Pipeline.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class PipelineConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCreatedDate = System.Text.Json.JsonEncodedText.Encode("created_date"); + private static readonly System.Text.Json.JsonEncodedText PropCreatedDateMillis = System.Text.Json.JsonEncodedText.Encode("created_date_millis"); + private static readonly System.Text.Json.JsonEncodedText PropDeprecated = System.Text.Json.JsonEncodedText.Encode("deprecated"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); + private static readonly System.Text.Json.JsonEncodedText PropModifiedDate = System.Text.Json.JsonEncodedText.Encode("modified_date"); + private static readonly System.Text.Json.JsonEncodedText PropModifiedDateMillis = System.Text.Json.JsonEncodedText.Encode("modified_date_millis"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropProcessors = System.Text.Json.JsonEncodedText.Encode("processors"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Ingest.Pipeline Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCreatedDate = default; + LocalJsonValue propCreatedDateMillis = default; + LocalJsonValue propDeprecated = default; + LocalJsonValue propDescription = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propModifiedDate = default; + LocalJsonValue propModifiedDateMillis = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue?> propProcessors = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCreatedDate.TryReadProperty(ref reader, options, PropCreatedDate, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propCreatedDateMillis.TryReadProperty(ref reader, options, PropCreatedDateMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propDeprecated.TryReadProperty(ref reader, options, PropDeprecated, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propModifiedDate.TryReadProperty(ref reader, options, PropModifiedDate, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propModifiedDateMillis.TryReadProperty(ref reader, options, PropModifiedDateMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propProcessors.TryReadProperty(ref reader, options, PropProcessors, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.Pipeline(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CreatedDate = propCreatedDate.Value, + CreatedDateMillis = propCreatedDateMillis.Value, + Deprecated = propDeprecated.Value, + Description = propDescription.Value, + Meta = propMeta.Value, + ModifiedDate = propModifiedDate.Value, + ModifiedDateMillis = propModifiedDateMillis.Value, + OnFailure = propOnFailure.Value, + Processors = propProcessors.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.Pipeline value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCreatedDate, value.CreatedDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropCreatedDateMillis, value.CreatedDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropDeprecated, value.Deprecated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropModifiedDate, value.ModifiedDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropModifiedDateMillis, value.ModifiedDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropProcessors, value.Processors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Pipeline.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Pipeline.g.cs index 35343f57f5a..d69ca3ed000 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Pipeline.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Pipeline.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class PipelineConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCreatedDate = System.Text.Json.JsonEncodedText.Encode("created_date"); - private static readonly System.Text.Json.JsonEncodedText PropCreatedDateMillis = System.Text.Json.JsonEncodedText.Encode("created_date_millis"); - private static readonly System.Text.Json.JsonEncodedText PropDeprecated = System.Text.Json.JsonEncodedText.Encode("deprecated"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); - private static readonly System.Text.Json.JsonEncodedText PropModifiedDate = System.Text.Json.JsonEncodedText.Encode("modified_date"); - private static readonly System.Text.Json.JsonEncodedText PropModifiedDateMillis = System.Text.Json.JsonEncodedText.Encode("modified_date_millis"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropProcessors = System.Text.Json.JsonEncodedText.Encode("processors"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Ingest.Pipeline Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCreatedDate = default; - LocalJsonValue propCreatedDateMillis = default; - LocalJsonValue propDeprecated = default; - LocalJsonValue propDescription = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propModifiedDate = default; - LocalJsonValue propModifiedDateMillis = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue?> propProcessors = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCreatedDate.TryReadProperty(ref reader, options, PropCreatedDate, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propCreatedDateMillis.TryReadProperty(ref reader, options, PropCreatedDateMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propDeprecated.TryReadProperty(ref reader, options, PropDeprecated, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propModifiedDate.TryReadProperty(ref reader, options, PropModifiedDate, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propModifiedDateMillis.TryReadProperty(ref reader, options, PropModifiedDateMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propProcessors.TryReadProperty(ref reader, options, PropProcessors, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.Pipeline(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CreatedDate = propCreatedDate.Value, - CreatedDateMillis = propCreatedDateMillis.Value, - Deprecated = propDeprecated.Value, - Description = propDescription.Value, - Meta = propMeta.Value, - ModifiedDate = propModifiedDate.Value, - ModifiedDateMillis = propModifiedDateMillis.Value, - OnFailure = propOnFailure.Value, - Processors = propProcessors.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.Pipeline value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCreatedDate, value.CreatedDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropCreatedDateMillis, value.CreatedDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropDeprecated, value.Deprecated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropModifiedDate, value.ModifiedDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropModifiedDateMillis, value.ModifiedDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropProcessors, value.Processors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.PipelineConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.PipelineConverter))] public sealed partial class Pipeline { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineConfig.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineConfig.Converters.g.cs new file mode 100644 index 00000000000..cb00d80b007 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineConfig.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class PipelineConfigConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropProcessors = System.Text.Json.JsonEncodedText.Encode("processors"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Ingest.PipelineConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue> propProcessors = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propProcessors.TryReadProperty(ref reader, options, PropProcessors, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.PipelineConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Processors = propProcessors.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.PipelineConfig value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropProcessors, value.Processors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineConfig.g.cs index 7294700dd90..c5ae4f6bcf6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineConfig.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class PipelineConfigConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropProcessors = System.Text.Json.JsonEncodedText.Encode("processors"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Ingest.PipelineConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue> propProcessors = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propProcessors.TryReadProperty(ref reader, options, PropProcessors, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.PipelineConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Processors = propProcessors.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.PipelineConfig value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropProcessors, value.Processors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.PipelineConfigConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.PipelineConfigConverter))] public sealed partial class PipelineConfig { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineProcessor.Converters.g.cs new file mode 100644 index 00000000000..6563b80d48d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineProcessor.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class PipelineProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissingPipeline = System.Text.Json.JsonEncodedText.Encode("ignore_missing_pipeline"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + + public override Elastic.Clients.Elasticsearch.Ingest.PipelineProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissingPipeline = default; + LocalJsonValue propName = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propTag = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissingPipeline.TryReadProperty(ref reader, options, PropIgnoreMissingPipeline, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.PipelineProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissingPipeline = propIgnoreMissingPipeline.Value, + Name = propName.Value, + OnFailure = propOnFailure.Value, + Tag = propTag.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.PipelineProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissingPipeline, value.IgnoreMissingPipeline, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineProcessor.g.cs index a56cd4fda44..c4e14608030 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineProcessor.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class PipelineProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissingPipeline = System.Text.Json.JsonEncodedText.Encode("ignore_missing_pipeline"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - - public override Elastic.Clients.Elasticsearch.Ingest.PipelineProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissingPipeline = default; - LocalJsonValue propName = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propTag = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissingPipeline.TryReadProperty(ref reader, options, PropIgnoreMissingPipeline, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.PipelineProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissingPipeline = propIgnoreMissingPipeline.Value, - Name = propName.Value, - OnFailure = propOnFailure.Value, - Tag = propTag.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.PipelineProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissingPipeline, value.IgnoreMissingPipeline, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.PipelineProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.PipelineProcessorConverter))] public sealed partial class PipelineProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineProcessorResult.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineProcessorResult.Converters.g.cs new file mode 100644 index 00000000000..28dff8ed1f4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineProcessorResult.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class PipelineProcessorResultConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropDoc = System.Text.Json.JsonEncodedText.Encode("doc"); + private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoredError = System.Text.Json.JsonEncodedText.Encode("ignored_error"); + private static readonly System.Text.Json.JsonEncodedText PropProcessorType = System.Text.Json.JsonEncodedText.Encode("processor_type"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + + public override Elastic.Clients.Elasticsearch.Ingest.PipelineProcessorResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propDoc = default; + LocalJsonValue propError = default; + LocalJsonValue propIgnoredError = default; + LocalJsonValue propProcessorType = default; + LocalJsonValue propStatus = default; + LocalJsonValue propTag = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propDoc.TryReadProperty(ref reader, options, PropDoc, null)) + { + continue; + } + + if (propError.TryReadProperty(ref reader, options, PropError, null)) + { + continue; + } + + if (propIgnoredError.TryReadProperty(ref reader, options, PropIgnoredError, null)) + { + continue; + } + + if (propProcessorType.TryReadProperty(ref reader, options, PropProcessorType, null)) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, static Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.PipelineProcessorResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Doc = propDoc.Value, + Error = propError.Value, + IgnoredError = propIgnoredError.Value, + ProcessorType = propProcessorType.Value, + Status = propStatus.Value, + Tag = propTag.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.PipelineProcessorResult value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropDoc, value.Doc, null, null); + writer.WriteProperty(options, PropError, value.Error, null, null); + writer.WriteProperty(options, PropIgnoredError, value.IgnoredError, null, null); + writer.WriteProperty(options, PropProcessorType, value.ProcessorType, null, null); + writer.WriteProperty(options, PropStatus, value.Status, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineProcessorResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineProcessorResult.g.cs index d05d18274d2..f1910e875ca 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineProcessorResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineProcessorResult.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class PipelineProcessorResultConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropDoc = System.Text.Json.JsonEncodedText.Encode("doc"); - private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoredError = System.Text.Json.JsonEncodedText.Encode("ignored_error"); - private static readonly System.Text.Json.JsonEncodedText PropProcessorType = System.Text.Json.JsonEncodedText.Encode("processor_type"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - - public override Elastic.Clients.Elasticsearch.Ingest.PipelineProcessorResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propDoc = default; - LocalJsonValue propError = default; - LocalJsonValue propIgnoredError = default; - LocalJsonValue propProcessorType = default; - LocalJsonValue propStatus = default; - LocalJsonValue propTag = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propDoc.TryReadProperty(ref reader, options, PropDoc, null)) - { - continue; - } - - if (propError.TryReadProperty(ref reader, options, PropError, null)) - { - continue; - } - - if (propIgnoredError.TryReadProperty(ref reader, options, PropIgnoredError, null)) - { - continue; - } - - if (propProcessorType.TryReadProperty(ref reader, options, PropProcessorType, null)) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, static Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.PipelineProcessorResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Doc = propDoc.Value, - Error = propError.Value, - IgnoredError = propIgnoredError.Value, - ProcessorType = propProcessorType.Value, - Status = propStatus.Value, - Tag = propTag.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.PipelineProcessorResult value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropDoc, value.Doc, null, null); - writer.WriteProperty(options, PropError, value.Error, null, null); - writer.WriteProperty(options, PropIgnoredError, value.IgnoredError, null, null); - writer.WriteProperty(options, PropProcessorType, value.ProcessorType, null, null); - writer.WriteProperty(options, PropStatus, value.Status, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.PipelineProcessorResultConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.PipelineProcessorResultConverter))] public sealed partial class PipelineProcessorResult { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineSimulationStatusOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineSimulationStatusOptions.Converters.g.cs new file mode 100644 index 00000000000..281b511ebe4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineSimulationStatusOptions.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class PipelineSimulationStatusOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberDropped = System.Text.Json.JsonEncodedText.Encode("dropped"); + private static readonly System.Text.Json.JsonEncodedText MemberError = System.Text.Json.JsonEncodedText.Encode("error"); + private static readonly System.Text.Json.JsonEncodedText MemberErrorIgnored = System.Text.Json.JsonEncodedText.Encode("error_ignored"); + private static readonly System.Text.Json.JsonEncodedText MemberSkipped = System.Text.Json.JsonEncodedText.Encode("skipped"); + private static readonly System.Text.Json.JsonEncodedText MemberSuccess = System.Text.Json.JsonEncodedText.Encode("success"); + + public override Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberDropped)) + { + return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Dropped; + } + + if (reader.ValueTextEquals(MemberError)) + { + return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Error; + } + + if (reader.ValueTextEquals(MemberErrorIgnored)) + { + return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.ErrorIgnored; + } + + if (reader.ValueTextEquals(MemberSkipped)) + { + return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Skipped; + } + + if (reader.ValueTextEquals(MemberSuccess)) + { + return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Success; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberDropped.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Dropped; + } + + if (string.Equals(value, MemberError.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Error; + } + + if (string.Equals(value, MemberErrorIgnored.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.ErrorIgnored; + } + + if (string.Equals(value, MemberSkipped.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Skipped; + } + + if (string.Equals(value, MemberSuccess.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Success; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Dropped: + writer.WriteStringValue(MemberDropped); + break; + case Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Error: + writer.WriteStringValue(MemberError); + break; + case Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.ErrorIgnored: + writer.WriteStringValue(MemberErrorIgnored); + break; + case Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Skipped: + writer.WriteStringValue(MemberSkipped); + break; + case Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Success: + writer.WriteStringValue(MemberSuccess); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineSimulationStatusOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineSimulationStatusOptions.g.cs new file mode 100644 index 00000000000..de1de827573 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineSimulationStatusOptions.g.cs @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.PipelineSimulationStatusOptionsConverter))] +public enum PipelineSimulationStatusOptions +{ + [System.Runtime.Serialization.EnumMember(Value = "dropped")] + Dropped, + [System.Runtime.Serialization.EnumMember(Value = "error")] + Error, + [System.Runtime.Serialization.EnumMember(Value = "error_ignored")] + ErrorIgnored, + [System.Runtime.Serialization.EnumMember(Value = "skipped")] + Skipped, + [System.Runtime.Serialization.EnumMember(Value = "success")] + Success +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Processor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Processor.Converters.g.cs new file mode 100644 index 00000000000..f27fd2930d7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Processor.Converters.g.cs @@ -0,0 +1,606 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class ProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantAppend = System.Text.Json.JsonEncodedText.Encode("append"); + private static readonly System.Text.Json.JsonEncodedText VariantAttachment = System.Text.Json.JsonEncodedText.Encode("attachment"); + private static readonly System.Text.Json.JsonEncodedText VariantBytes = System.Text.Json.JsonEncodedText.Encode("bytes"); + private static readonly System.Text.Json.JsonEncodedText VariantCircle = System.Text.Json.JsonEncodedText.Encode("circle"); + private static readonly System.Text.Json.JsonEncodedText VariantCommunityId = System.Text.Json.JsonEncodedText.Encode("community_id"); + private static readonly System.Text.Json.JsonEncodedText VariantConvert = System.Text.Json.JsonEncodedText.Encode("convert"); + private static readonly System.Text.Json.JsonEncodedText VariantCsv = System.Text.Json.JsonEncodedText.Encode("csv"); + private static readonly System.Text.Json.JsonEncodedText VariantDate = System.Text.Json.JsonEncodedText.Encode("date"); + private static readonly System.Text.Json.JsonEncodedText VariantDateIndexName = System.Text.Json.JsonEncodedText.Encode("date_index_name"); + private static readonly System.Text.Json.JsonEncodedText VariantDissect = System.Text.Json.JsonEncodedText.Encode("dissect"); + private static readonly System.Text.Json.JsonEncodedText VariantDotExpander = System.Text.Json.JsonEncodedText.Encode("dot_expander"); + private static readonly System.Text.Json.JsonEncodedText VariantDrop = System.Text.Json.JsonEncodedText.Encode("drop"); + private static readonly System.Text.Json.JsonEncodedText VariantEnrich = System.Text.Json.JsonEncodedText.Encode("enrich"); + private static readonly System.Text.Json.JsonEncodedText VariantFail = System.Text.Json.JsonEncodedText.Encode("fail"); + private static readonly System.Text.Json.JsonEncodedText VariantFingerprint = System.Text.Json.JsonEncodedText.Encode("fingerprint"); + private static readonly System.Text.Json.JsonEncodedText VariantForeach = System.Text.Json.JsonEncodedText.Encode("foreach"); + private static readonly System.Text.Json.JsonEncodedText VariantGeoGrid = System.Text.Json.JsonEncodedText.Encode("geo_grid"); + private static readonly System.Text.Json.JsonEncodedText VariantGeoip = System.Text.Json.JsonEncodedText.Encode("geoip"); + private static readonly System.Text.Json.JsonEncodedText VariantGrok = System.Text.Json.JsonEncodedText.Encode("grok"); + private static readonly System.Text.Json.JsonEncodedText VariantGsub = System.Text.Json.JsonEncodedText.Encode("gsub"); + private static readonly System.Text.Json.JsonEncodedText VariantHtmlStrip = System.Text.Json.JsonEncodedText.Encode("html_strip"); + private static readonly System.Text.Json.JsonEncodedText VariantInference = System.Text.Json.JsonEncodedText.Encode("inference"); + private static readonly System.Text.Json.JsonEncodedText VariantIpLocation = System.Text.Json.JsonEncodedText.Encode("ip_location"); + private static readonly System.Text.Json.JsonEncodedText VariantJoin = System.Text.Json.JsonEncodedText.Encode("join"); + private static readonly System.Text.Json.JsonEncodedText VariantJson = System.Text.Json.JsonEncodedText.Encode("json"); + private static readonly System.Text.Json.JsonEncodedText VariantKv = System.Text.Json.JsonEncodedText.Encode("kv"); + private static readonly System.Text.Json.JsonEncodedText VariantLowercase = System.Text.Json.JsonEncodedText.Encode("lowercase"); + private static readonly System.Text.Json.JsonEncodedText VariantNetworkDirection = System.Text.Json.JsonEncodedText.Encode("network_direction"); + private static readonly System.Text.Json.JsonEncodedText VariantPipeline = System.Text.Json.JsonEncodedText.Encode("pipeline"); + private static readonly System.Text.Json.JsonEncodedText VariantRedact = System.Text.Json.JsonEncodedText.Encode("redact"); + private static readonly System.Text.Json.JsonEncodedText VariantRegisteredDomain = System.Text.Json.JsonEncodedText.Encode("registered_domain"); + private static readonly System.Text.Json.JsonEncodedText VariantRemove = System.Text.Json.JsonEncodedText.Encode("remove"); + private static readonly System.Text.Json.JsonEncodedText VariantRename = System.Text.Json.JsonEncodedText.Encode("rename"); + private static readonly System.Text.Json.JsonEncodedText VariantReroute = System.Text.Json.JsonEncodedText.Encode("reroute"); + private static readonly System.Text.Json.JsonEncodedText VariantScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText VariantSet = System.Text.Json.JsonEncodedText.Encode("set"); + private static readonly System.Text.Json.JsonEncodedText VariantSetSecurityUser = System.Text.Json.JsonEncodedText.Encode("set_security_user"); + private static readonly System.Text.Json.JsonEncodedText VariantSort = System.Text.Json.JsonEncodedText.Encode("sort"); + private static readonly System.Text.Json.JsonEncodedText VariantSplit = System.Text.Json.JsonEncodedText.Encode("split"); + private static readonly System.Text.Json.JsonEncodedText VariantTerminate = System.Text.Json.JsonEncodedText.Encode("terminate"); + private static readonly System.Text.Json.JsonEncodedText VariantTrim = System.Text.Json.JsonEncodedText.Encode("trim"); + private static readonly System.Text.Json.JsonEncodedText VariantUppercase = System.Text.Json.JsonEncodedText.Encode("uppercase"); + private static readonly System.Text.Json.JsonEncodedText VariantUriParts = System.Text.Json.JsonEncodedText.Encode("uri_parts"); + private static readonly System.Text.Json.JsonEncodedText VariantUrlDecode = System.Text.Json.JsonEncodedText.Encode("urldecode"); + private static readonly System.Text.Json.JsonEncodedText VariantUserAgent = System.Text.Json.JsonEncodedText.Encode("user_agent"); + + public override Elastic.Clients.Elasticsearch.Ingest.Processor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantAppend)) + { + variantType = VariantAppend.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantAttachment)) + { + variantType = VariantAttachment.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantBytes)) + { + variantType = VariantBytes.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantCircle)) + { + variantType = VariantCircle.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantCommunityId)) + { + variantType = VariantCommunityId.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantConvert)) + { + variantType = VariantConvert.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantCsv)) + { + variantType = VariantCsv.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantDate)) + { + variantType = VariantDate.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantDateIndexName)) + { + variantType = VariantDateIndexName.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantDissect)) + { + variantType = VariantDissect.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantDotExpander)) + { + variantType = VariantDotExpander.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantDrop)) + { + variantType = VariantDrop.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantEnrich)) + { + variantType = VariantEnrich.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantFail)) + { + variantType = VariantFail.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantFingerprint)) + { + variantType = VariantFingerprint.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantForeach)) + { + variantType = VariantForeach.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantGeoGrid)) + { + variantType = VariantGeoGrid.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantGeoip)) + { + variantType = VariantGeoip.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantGrok)) + { + variantType = VariantGrok.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantGsub)) + { + variantType = VariantGsub.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantHtmlStrip)) + { + variantType = VariantHtmlStrip.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantInference)) + { + variantType = VariantInference.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantIpLocation)) + { + variantType = VariantIpLocation.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantJoin)) + { + variantType = VariantJoin.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantJson)) + { + variantType = VariantJson.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantKv)) + { + variantType = VariantKv.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantLowercase)) + { + variantType = VariantLowercase.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantNetworkDirection)) + { + variantType = VariantNetworkDirection.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantPipeline)) + { + variantType = VariantPipeline.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRedact)) + { + variantType = VariantRedact.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRegisteredDomain)) + { + variantType = VariantRegisteredDomain.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRemove)) + { + variantType = VariantRemove.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRename)) + { + variantType = VariantRename.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantReroute)) + { + variantType = VariantReroute.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantScript)) + { + variantType = VariantScript.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSet)) + { + variantType = VariantSet.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSetSecurityUser)) + { + variantType = VariantSetSecurityUser.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSort)) + { + variantType = VariantSort.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSplit)) + { + variantType = VariantSplit.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTerminate)) + { + variantType = VariantTerminate.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTrim)) + { + variantType = VariantTrim.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantUppercase)) + { + variantType = VariantUppercase.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantUriParts)) + { + variantType = VariantUriParts.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantUrlDecode)) + { + variantType = VariantUrlDecode.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantUserAgent)) + { + variantType = VariantUserAgent.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.Processor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.Processor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "append": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.AppendProcessor)value.Variant, null, null); + break; + case "attachment": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.AttachmentProcessor)value.Variant, null, null); + break; + case "bytes": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.BytesProcessor)value.Variant, null, null); + break; + case "circle": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.CircleProcessor)value.Variant, null, null); + break; + case "community_id": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.CommunityIDProcessor)value.Variant, null, null); + break; + case "convert": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.ConvertProcessor)value.Variant, null, null); + break; + case "csv": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.CsvProcessor)value.Variant, null, null); + break; + case "date": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.DateProcessor)value.Variant, null, null); + break; + case "date_index_name": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.DateIndexNameProcessor)value.Variant, null, null); + break; + case "dissect": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.DissectProcessor)value.Variant, null, null); + break; + case "dot_expander": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.DotExpanderProcessor)value.Variant, null, null); + break; + case "drop": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.DropProcessor)value.Variant, null, null); + break; + case "enrich": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.EnrichProcessor)value.Variant, null, null); + break; + case "fail": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.FailProcessor)value.Variant, null, null); + break; + case "fingerprint": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.FingerprintProcessor)value.Variant, null, null); + break; + case "foreach": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.ForeachProcessor)value.Variant, null, null); + break; + case "geo_grid": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.GeoGridProcessor)value.Variant, null, null); + break; + case "geoip": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.GeoIpProcessor)value.Variant, null, null); + break; + case "grok": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.GrokProcessor)value.Variant, null, null); + break; + case "gsub": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.GsubProcessor)value.Variant, null, null); + break; + case "html_strip": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.HtmlStripProcessor)value.Variant, null, null); + break; + case "inference": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.InferenceProcessor)value.Variant, null, null); + break; + case "ip_location": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.IpLocationProcessor)value.Variant, null, null); + break; + case "join": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.JoinProcessor)value.Variant, null, null); + break; + case "json": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.JsonProcessor)value.Variant, null, null); + break; + case "kv": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.KeyValueProcessor)value.Variant, null, null); + break; + case "lowercase": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.LowercaseProcessor)value.Variant, null, null); + break; + case "network_direction": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.NetworkDirectionProcessor)value.Variant, null, null); + break; + case "pipeline": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.PipelineProcessor)value.Variant, null, null); + break; + case "redact": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.RedactProcessor)value.Variant, null, null); + break; + case "registered_domain": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.RegisteredDomainProcessor)value.Variant, null, null); + break; + case "remove": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.RemoveProcessor)value.Variant, null, null); + break; + case "rename": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.RenameProcessor)value.Variant, null, null); + break; + case "reroute": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.RerouteProcessor)value.Variant, null, null); + break; + case "script": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.ScriptProcessor)value.Variant, null, null); + break; + case "set": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.SetProcessor)value.Variant, null, null); + break; + case "set_security_user": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.SetSecurityUserProcessor)value.Variant, null, null); + break; + case "sort": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.SortProcessor)value.Variant, null, null); + break; + case "split": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.SplitProcessor)value.Variant, null, null); + break; + case "terminate": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.TerminateProcessor)value.Variant, null, null); + break; + case "trim": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.TrimProcessor)value.Variant, null, null); + break; + case "uppercase": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.UppercaseProcessor)value.Variant, null, null); + break; + case "uri_parts": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.UriPartsProcessor)value.Variant, null, null); + break; + case "urldecode": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.UrlDecodeProcessor)value.Variant, null, null); + break; + case "user_agent": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.UserAgentProcessor)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Ingest.Processor)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Processor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Processor.g.cs index d56a4a112e7..5649029e257 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Processor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Processor.g.cs @@ -23,589 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class ProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantAppend = System.Text.Json.JsonEncodedText.Encode("append"); - private static readonly System.Text.Json.JsonEncodedText VariantAttachment = System.Text.Json.JsonEncodedText.Encode("attachment"); - private static readonly System.Text.Json.JsonEncodedText VariantBytes = System.Text.Json.JsonEncodedText.Encode("bytes"); - private static readonly System.Text.Json.JsonEncodedText VariantCircle = System.Text.Json.JsonEncodedText.Encode("circle"); - private static readonly System.Text.Json.JsonEncodedText VariantCommunityId = System.Text.Json.JsonEncodedText.Encode("community_id"); - private static readonly System.Text.Json.JsonEncodedText VariantConvert = System.Text.Json.JsonEncodedText.Encode("convert"); - private static readonly System.Text.Json.JsonEncodedText VariantCsv = System.Text.Json.JsonEncodedText.Encode("csv"); - private static readonly System.Text.Json.JsonEncodedText VariantDate = System.Text.Json.JsonEncodedText.Encode("date"); - private static readonly System.Text.Json.JsonEncodedText VariantDateIndexName = System.Text.Json.JsonEncodedText.Encode("date_index_name"); - private static readonly System.Text.Json.JsonEncodedText VariantDissect = System.Text.Json.JsonEncodedText.Encode("dissect"); - private static readonly System.Text.Json.JsonEncodedText VariantDotExpander = System.Text.Json.JsonEncodedText.Encode("dot_expander"); - private static readonly System.Text.Json.JsonEncodedText VariantDrop = System.Text.Json.JsonEncodedText.Encode("drop"); - private static readonly System.Text.Json.JsonEncodedText VariantEnrich = System.Text.Json.JsonEncodedText.Encode("enrich"); - private static readonly System.Text.Json.JsonEncodedText VariantFail = System.Text.Json.JsonEncodedText.Encode("fail"); - private static readonly System.Text.Json.JsonEncodedText VariantFingerprint = System.Text.Json.JsonEncodedText.Encode("fingerprint"); - private static readonly System.Text.Json.JsonEncodedText VariantForeach = System.Text.Json.JsonEncodedText.Encode("foreach"); - private static readonly System.Text.Json.JsonEncodedText VariantGeoGrid = System.Text.Json.JsonEncodedText.Encode("geo_grid"); - private static readonly System.Text.Json.JsonEncodedText VariantGeoip = System.Text.Json.JsonEncodedText.Encode("geoip"); - private static readonly System.Text.Json.JsonEncodedText VariantGrok = System.Text.Json.JsonEncodedText.Encode("grok"); - private static readonly System.Text.Json.JsonEncodedText VariantGsub = System.Text.Json.JsonEncodedText.Encode("gsub"); - private static readonly System.Text.Json.JsonEncodedText VariantHtmlStrip = System.Text.Json.JsonEncodedText.Encode("html_strip"); - private static readonly System.Text.Json.JsonEncodedText VariantInference = System.Text.Json.JsonEncodedText.Encode("inference"); - private static readonly System.Text.Json.JsonEncodedText VariantIpLocation = System.Text.Json.JsonEncodedText.Encode("ip_location"); - private static readonly System.Text.Json.JsonEncodedText VariantJoin = System.Text.Json.JsonEncodedText.Encode("join"); - private static readonly System.Text.Json.JsonEncodedText VariantJson = System.Text.Json.JsonEncodedText.Encode("json"); - private static readonly System.Text.Json.JsonEncodedText VariantKv = System.Text.Json.JsonEncodedText.Encode("kv"); - private static readonly System.Text.Json.JsonEncodedText VariantLowercase = System.Text.Json.JsonEncodedText.Encode("lowercase"); - private static readonly System.Text.Json.JsonEncodedText VariantNetworkDirection = System.Text.Json.JsonEncodedText.Encode("network_direction"); - private static readonly System.Text.Json.JsonEncodedText VariantPipeline = System.Text.Json.JsonEncodedText.Encode("pipeline"); - private static readonly System.Text.Json.JsonEncodedText VariantRedact = System.Text.Json.JsonEncodedText.Encode("redact"); - private static readonly System.Text.Json.JsonEncodedText VariantRegisteredDomain = System.Text.Json.JsonEncodedText.Encode("registered_domain"); - private static readonly System.Text.Json.JsonEncodedText VariantRemove = System.Text.Json.JsonEncodedText.Encode("remove"); - private static readonly System.Text.Json.JsonEncodedText VariantRename = System.Text.Json.JsonEncodedText.Encode("rename"); - private static readonly System.Text.Json.JsonEncodedText VariantReroute = System.Text.Json.JsonEncodedText.Encode("reroute"); - private static readonly System.Text.Json.JsonEncodedText VariantScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText VariantSet = System.Text.Json.JsonEncodedText.Encode("set"); - private static readonly System.Text.Json.JsonEncodedText VariantSetSecurityUser = System.Text.Json.JsonEncodedText.Encode("set_security_user"); - private static readonly System.Text.Json.JsonEncodedText VariantSort = System.Text.Json.JsonEncodedText.Encode("sort"); - private static readonly System.Text.Json.JsonEncodedText VariantSplit = System.Text.Json.JsonEncodedText.Encode("split"); - private static readonly System.Text.Json.JsonEncodedText VariantTerminate = System.Text.Json.JsonEncodedText.Encode("terminate"); - private static readonly System.Text.Json.JsonEncodedText VariantTrim = System.Text.Json.JsonEncodedText.Encode("trim"); - private static readonly System.Text.Json.JsonEncodedText VariantUppercase = System.Text.Json.JsonEncodedText.Encode("uppercase"); - private static readonly System.Text.Json.JsonEncodedText VariantUriParts = System.Text.Json.JsonEncodedText.Encode("uri_parts"); - private static readonly System.Text.Json.JsonEncodedText VariantUrlDecode = System.Text.Json.JsonEncodedText.Encode("urldecode"); - private static readonly System.Text.Json.JsonEncodedText VariantUserAgent = System.Text.Json.JsonEncodedText.Encode("user_agent"); - - public override Elastic.Clients.Elasticsearch.Ingest.Processor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantAppend)) - { - variantType = VariantAppend.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantAttachment)) - { - variantType = VariantAttachment.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantBytes)) - { - variantType = VariantBytes.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantCircle)) - { - variantType = VariantCircle.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantCommunityId)) - { - variantType = VariantCommunityId.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantConvert)) - { - variantType = VariantConvert.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantCsv)) - { - variantType = VariantCsv.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantDate)) - { - variantType = VariantDate.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantDateIndexName)) - { - variantType = VariantDateIndexName.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantDissect)) - { - variantType = VariantDissect.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantDotExpander)) - { - variantType = VariantDotExpander.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantDrop)) - { - variantType = VariantDrop.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantEnrich)) - { - variantType = VariantEnrich.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantFail)) - { - variantType = VariantFail.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantFingerprint)) - { - variantType = VariantFingerprint.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantForeach)) - { - variantType = VariantForeach.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantGeoGrid)) - { - variantType = VariantGeoGrid.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantGeoip)) - { - variantType = VariantGeoip.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantGrok)) - { - variantType = VariantGrok.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantGsub)) - { - variantType = VariantGsub.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantHtmlStrip)) - { - variantType = VariantHtmlStrip.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantInference)) - { - variantType = VariantInference.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantIpLocation)) - { - variantType = VariantIpLocation.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantJoin)) - { - variantType = VariantJoin.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantJson)) - { - variantType = VariantJson.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantKv)) - { - variantType = VariantKv.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantLowercase)) - { - variantType = VariantLowercase.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantNetworkDirection)) - { - variantType = VariantNetworkDirection.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantPipeline)) - { - variantType = VariantPipeline.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRedact)) - { - variantType = VariantRedact.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRegisteredDomain)) - { - variantType = VariantRegisteredDomain.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRemove)) - { - variantType = VariantRemove.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRename)) - { - variantType = VariantRename.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantReroute)) - { - variantType = VariantReroute.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantScript)) - { - variantType = VariantScript.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSet)) - { - variantType = VariantSet.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSetSecurityUser)) - { - variantType = VariantSetSecurityUser.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSort)) - { - variantType = VariantSort.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSplit)) - { - variantType = VariantSplit.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTerminate)) - { - variantType = VariantTerminate.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTrim)) - { - variantType = VariantTrim.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantUppercase)) - { - variantType = VariantUppercase.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantUriParts)) - { - variantType = VariantUriParts.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantUrlDecode)) - { - variantType = VariantUrlDecode.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantUserAgent)) - { - variantType = VariantUserAgent.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.Processor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.Processor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "append": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.AppendProcessor)value.Variant, null, null); - break; - case "attachment": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.AttachmentProcessor)value.Variant, null, null); - break; - case "bytes": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.BytesProcessor)value.Variant, null, null); - break; - case "circle": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.CircleProcessor)value.Variant, null, null); - break; - case "community_id": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.CommunityIDProcessor)value.Variant, null, null); - break; - case "convert": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.ConvertProcessor)value.Variant, null, null); - break; - case "csv": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.CsvProcessor)value.Variant, null, null); - break; - case "date": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.DateProcessor)value.Variant, null, null); - break; - case "date_index_name": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.DateIndexNameProcessor)value.Variant, null, null); - break; - case "dissect": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.DissectProcessor)value.Variant, null, null); - break; - case "dot_expander": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.DotExpanderProcessor)value.Variant, null, null); - break; - case "drop": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.DropProcessor)value.Variant, null, null); - break; - case "enrich": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.EnrichProcessor)value.Variant, null, null); - break; - case "fail": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.FailProcessor)value.Variant, null, null); - break; - case "fingerprint": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.FingerprintProcessor)value.Variant, null, null); - break; - case "foreach": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.ForeachProcessor)value.Variant, null, null); - break; - case "geo_grid": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.GeoGridProcessor)value.Variant, null, null); - break; - case "geoip": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.GeoIpProcessor)value.Variant, null, null); - break; - case "grok": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.GrokProcessor)value.Variant, null, null); - break; - case "gsub": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.GsubProcessor)value.Variant, null, null); - break; - case "html_strip": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.HtmlStripProcessor)value.Variant, null, null); - break; - case "inference": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.InferenceProcessor)value.Variant, null, null); - break; - case "ip_location": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.IpLocationProcessor)value.Variant, null, null); - break; - case "join": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.JoinProcessor)value.Variant, null, null); - break; - case "json": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.JsonProcessor)value.Variant, null, null); - break; - case "kv": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.KeyValueProcessor)value.Variant, null, null); - break; - case "lowercase": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.LowercaseProcessor)value.Variant, null, null); - break; - case "network_direction": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.NetworkDirectionProcessor)value.Variant, null, null); - break; - case "pipeline": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.PipelineProcessor)value.Variant, null, null); - break; - case "redact": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.RedactProcessor)value.Variant, null, null); - break; - case "registered_domain": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.RegisteredDomainProcessor)value.Variant, null, null); - break; - case "remove": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.RemoveProcessor)value.Variant, null, null); - break; - case "rename": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.RenameProcessor)value.Variant, null, null); - break; - case "reroute": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.RerouteProcessor)value.Variant, null, null); - break; - case "script": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.ScriptProcessor)value.Variant, null, null); - break; - case "set": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.SetProcessor)value.Variant, null, null); - break; - case "set_security_user": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.SetSecurityUserProcessor)value.Variant, null, null); - break; - case "sort": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.SortProcessor)value.Variant, null, null); - break; - case "split": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.SplitProcessor)value.Variant, null, null); - break; - case "terminate": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.TerminateProcessor)value.Variant, null, null); - break; - case "trim": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.TrimProcessor)value.Variant, null, null); - break; - case "uppercase": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.UppercaseProcessor)value.Variant, null, null); - break; - case "uri_parts": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.UriPartsProcessor)value.Variant, null, null); - break; - case "urldecode": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.UrlDecodeProcessor)value.Variant, null, null); - break; - case "user_agent": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Ingest.UserAgentProcessor)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Ingest.Processor)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.ProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.ProcessorConverter))] public sealed partial class Processor { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Redact.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Redact.Converters.g.cs new file mode 100644 index 00000000000..64865e8ecdc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Redact.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class RedactConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIsRedacted = System.Text.Json.JsonEncodedText.Encode("_is_redacted"); + + public override Elastic.Clients.Elasticsearch.Ingest.Redact Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIsRedacted = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIsRedacted.TryReadProperty(ref reader, options, PropIsRedacted, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.Redact(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + IsRedacted = propIsRedacted.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.Redact value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIsRedacted, value.IsRedacted, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Redact.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Redact.g.cs index 579cc111c09..40a77a911e1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Redact.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Redact.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class RedactConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIsRedacted = System.Text.Json.JsonEncodedText.Encode("_is_redacted"); - - public override Elastic.Clients.Elasticsearch.Ingest.Redact Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIsRedacted = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIsRedacted.TryReadProperty(ref reader, options, PropIsRedacted, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.Redact(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - IsRedacted = propIsRedacted.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.Redact value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIsRedacted, value.IsRedacted, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.RedactConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.RedactConverter))] public sealed partial class Redact { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RedactProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RedactProcessor.Converters.g.cs new file mode 100644 index 00000000000..cea5a63d159 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RedactProcessor.Converters.g.cs @@ -0,0 +1,171 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class RedactProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropPatternDefinitions = System.Text.Json.JsonEncodedText.Encode("pattern_definitions"); + private static readonly System.Text.Json.JsonEncodedText PropPatterns = System.Text.Json.JsonEncodedText.Encode("patterns"); + private static readonly System.Text.Json.JsonEncodedText PropPrefix = System.Text.Json.JsonEncodedText.Encode("prefix"); + private static readonly System.Text.Json.JsonEncodedText PropSkipIfUnlicensed = System.Text.Json.JsonEncodedText.Encode("skip_if_unlicensed"); + private static readonly System.Text.Json.JsonEncodedText PropSuffix = System.Text.Json.JsonEncodedText.Encode("suffix"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTraceRedact = System.Text.Json.JsonEncodedText.Encode("trace_redact"); + + public override Elastic.Clients.Elasticsearch.Ingest.RedactProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue?> propPatternDefinitions = default; + LocalJsonValue> propPatterns = default; + LocalJsonValue propPrefix = default; + LocalJsonValue propSkipIfUnlicensed = default; + LocalJsonValue propSuffix = default; + LocalJsonValue propTag = default; + LocalJsonValue propTraceRedact = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propPatternDefinitions.TryReadProperty(ref reader, options, PropPatternDefinitions, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propPatterns.TryReadProperty(ref reader, options, PropPatterns, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propPrefix.TryReadProperty(ref reader, options, PropPrefix, null)) + { + continue; + } + + if (propSkipIfUnlicensed.TryReadProperty(ref reader, options, PropSkipIfUnlicensed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSuffix.TryReadProperty(ref reader, options, PropSuffix, null)) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTraceRedact.TryReadProperty(ref reader, options, PropTraceRedact, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.RedactProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + OnFailure = propOnFailure.Value, + PatternDefinitions = propPatternDefinitions.Value, + Patterns = propPatterns.Value, + Prefix = propPrefix.Value, + SkipIfUnlicensed = propSkipIfUnlicensed.Value, + Suffix = propSuffix.Value, + Tag = propTag.Value, + TraceRedact = propTraceRedact.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.RedactProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPatternDefinitions, value.PatternDefinitions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropPatterns, value.Patterns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPrefix, value.Prefix, null, null); + writer.WriteProperty(options, PropSkipIfUnlicensed, value.SkipIfUnlicensed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSuffix, value.Suffix, null, null); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTraceRedact, value.TraceRedact, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RedactProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RedactProcessor.g.cs index 6cc7a2eb681..62279833ac0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RedactProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RedactProcessor.g.cs @@ -23,154 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class RedactProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropPatternDefinitions = System.Text.Json.JsonEncodedText.Encode("pattern_definitions"); - private static readonly System.Text.Json.JsonEncodedText PropPatterns = System.Text.Json.JsonEncodedText.Encode("patterns"); - private static readonly System.Text.Json.JsonEncodedText PropPrefix = System.Text.Json.JsonEncodedText.Encode("prefix"); - private static readonly System.Text.Json.JsonEncodedText PropSkipIfUnlicensed = System.Text.Json.JsonEncodedText.Encode("skip_if_unlicensed"); - private static readonly System.Text.Json.JsonEncodedText PropSuffix = System.Text.Json.JsonEncodedText.Encode("suffix"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTraceRedact = System.Text.Json.JsonEncodedText.Encode("trace_redact"); - - public override Elastic.Clients.Elasticsearch.Ingest.RedactProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue?> propPatternDefinitions = default; - LocalJsonValue> propPatterns = default; - LocalJsonValue propPrefix = default; - LocalJsonValue propSkipIfUnlicensed = default; - LocalJsonValue propSuffix = default; - LocalJsonValue propTag = default; - LocalJsonValue propTraceRedact = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propPatternDefinitions.TryReadProperty(ref reader, options, PropPatternDefinitions, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propPatterns.TryReadProperty(ref reader, options, PropPatterns, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propPrefix.TryReadProperty(ref reader, options, PropPrefix, null)) - { - continue; - } - - if (propSkipIfUnlicensed.TryReadProperty(ref reader, options, PropSkipIfUnlicensed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSuffix.TryReadProperty(ref reader, options, PropSuffix, null)) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTraceRedact.TryReadProperty(ref reader, options, PropTraceRedact, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.RedactProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - OnFailure = propOnFailure.Value, - PatternDefinitions = propPatternDefinitions.Value, - Patterns = propPatterns.Value, - Prefix = propPrefix.Value, - SkipIfUnlicensed = propSkipIfUnlicensed.Value, - Suffix = propSuffix.Value, - Tag = propTag.Value, - TraceRedact = propTraceRedact.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.RedactProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPatternDefinitions, value.PatternDefinitions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropPatterns, value.Patterns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPrefix, value.Prefix, null, null); - writer.WriteProperty(options, PropSkipIfUnlicensed, value.SkipIfUnlicensed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSuffix, value.Suffix, null, null); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTraceRedact, value.TraceRedact, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.RedactProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.RedactProcessorConverter))] public sealed partial class RedactProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RegisteredDomainProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RegisteredDomainProcessor.Converters.g.cs new file mode 100644 index 00000000000..26442ea8872 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RegisteredDomainProcessor.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class RegisteredDomainProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + + public override Elastic.Clients.Elasticsearch.Ingest.RegisteredDomainProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.RegisteredDomainProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + OnFailure = propOnFailure.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.RegisteredDomainProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RegisteredDomainProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RegisteredDomainProcessor.g.cs index f1b4a6f788c..7c50898376f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RegisteredDomainProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RegisteredDomainProcessor.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class RegisteredDomainProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - - public override Elastic.Clients.Elasticsearch.Ingest.RegisteredDomainProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.RegisteredDomainProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - OnFailure = propOnFailure.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.RegisteredDomainProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.RegisteredDomainProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.RegisteredDomainProcessorConverter))] public sealed partial class RegisteredDomainProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RemoveProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RemoveProcessor.Converters.g.cs new file mode 100644 index 00000000000..64498327988 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RemoveProcessor.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class RemoveProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropKeep = System.Text.Json.JsonEncodedText.Encode("keep"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + + public override Elastic.Clients.Elasticsearch.Ingest.RemoveProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue propKeep = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propTag = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, static Elastic.Clients.Elasticsearch.Fields (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propKeep.TryReadProperty(ref reader, options, PropKeep, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.RemoveProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + Keep = propKeep.Value, + OnFailure = propOnFailure.Value, + Tag = propTag.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.RemoveProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropKeep, value.Keep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RemoveProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RemoveProcessor.g.cs index 7ddfd1d435e..f9998832176 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RemoveProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RemoveProcessor.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class RemoveProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropKeep = System.Text.Json.JsonEncodedText.Encode("keep"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - - public override Elastic.Clients.Elasticsearch.Ingest.RemoveProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue propKeep = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propTag = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, static Elastic.Clients.Elasticsearch.Fields (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propKeep.TryReadProperty(ref reader, options, PropKeep, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.RemoveProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - Keep = propKeep.Value, - OnFailure = propOnFailure.Value, - Tag = propTag.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.RemoveProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropKeep, value.Keep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.RemoveProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.RemoveProcessorConverter))] public sealed partial class RemoveProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RenameProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RenameProcessor.Converters.g.cs new file mode 100644 index 00000000000..ce8f0e89589 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RenameProcessor.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class RenameProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + + public override Elastic.Clients.Elasticsearch.Ingest.RenameProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.RenameProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + OnFailure = propOnFailure.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.RenameProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RenameProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RenameProcessor.g.cs index e97d22525f4..3b27eb88b39 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RenameProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RenameProcessor.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class RenameProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - - public override Elastic.Clients.Elasticsearch.Ingest.RenameProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.RenameProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - OnFailure = propOnFailure.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.RenameProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.RenameProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.RenameProcessorConverter))] public sealed partial class RenameProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RerouteProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RerouteProcessor.Converters.g.cs new file mode 100644 index 00000000000..e15ce2c62d2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RerouteProcessor.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class RerouteProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDataset = System.Text.Json.JsonEncodedText.Encode("dataset"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropDestination = System.Text.Json.JsonEncodedText.Encode("destination"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropNamespace = System.Text.Json.JsonEncodedText.Encode("namespace"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + + public override Elastic.Clients.Elasticsearch.Ingest.RerouteProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propDataset = default; + LocalJsonValue propDescription = default; + LocalJsonValue propDestination = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue?> propNamespace = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propTag = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDataset.TryReadProperty(ref reader, options, PropDataset, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propDestination.TryReadProperty(ref reader, options, PropDestination, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNamespace.TryReadProperty(ref reader, options, PropNamespace, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.RerouteProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Dataset = propDataset.Value, + Description = propDescription.Value, + Destination = propDestination.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + Namespace = propNamespace.Value, + OnFailure = propOnFailure.Value, + Tag = propTag.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.RerouteProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDataset, value.Dataset, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropDestination, value.Destination, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNamespace, value.Namespace, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RerouteProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RerouteProcessor.g.cs index bed5c25b1df..8e55b0df2b4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RerouteProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/RerouteProcessor.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class RerouteProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDataset = System.Text.Json.JsonEncodedText.Encode("dataset"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropDestination = System.Text.Json.JsonEncodedText.Encode("destination"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropNamespace = System.Text.Json.JsonEncodedText.Encode("namespace"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - - public override Elastic.Clients.Elasticsearch.Ingest.RerouteProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propDataset = default; - LocalJsonValue propDescription = default; - LocalJsonValue propDestination = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue?> propNamespace = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propTag = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDataset.TryReadProperty(ref reader, options, PropDataset, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propDestination.TryReadProperty(ref reader, options, PropDestination, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNamespace.TryReadProperty(ref reader, options, PropNamespace, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.RerouteProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Dataset = propDataset.Value, - Description = propDescription.Value, - Destination = propDestination.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - Namespace = propNamespace.Value, - OnFailure = propOnFailure.Value, - Tag = propTag.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.RerouteProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDataset, value.Dataset, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropDestination, value.Destination, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNamespace, value.Namespace, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.RerouteProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.RerouteProcessorConverter))] public sealed partial class RerouteProcessor { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ScriptProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ScriptProcessor.Converters.g.cs new file mode 100644 index 00000000000..c99d03143a8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ScriptProcessor.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class ScriptProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropLang = System.Text.Json.JsonEncodedText.Encode("lang"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + + public override Elastic.Clients.Elasticsearch.Ingest.ScriptProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propId = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propLang = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue?> propParams = default; + LocalJsonValue propSource = default; + LocalJsonValue propTag = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLang.TryReadProperty(ref reader, options, PropLang, static Elastic.Clients.Elasticsearch.ScriptLanguage? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.ScriptProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Id = propId.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + Lang = propLang.Value, + OnFailure = propOnFailure.Value, + Params = propParams.Value, + Source = propSource.Value, + Tag = propTag.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.ScriptProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLang, value.Lang, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.ScriptLanguage? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ScriptProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ScriptProcessor.g.cs index aecd2d573d8..71482c08d71 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ScriptProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ScriptProcessor.g.cs @@ -23,118 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class ScriptProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropLang = System.Text.Json.JsonEncodedText.Encode("lang"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - - public override Elastic.Clients.Elasticsearch.Ingest.ScriptProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propId = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propLang = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue?> propParams = default; - LocalJsonValue propSource = default; - LocalJsonValue propTag = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLang.TryReadProperty(ref reader, options, PropLang, static Elastic.Clients.Elasticsearch.ScriptLanguage? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.ScriptProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Id = propId.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - Lang = propLang.Value, - OnFailure = propOnFailure.Value, - Params = propParams.Value, - Source = propSource.Value, - Tag = propTag.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.ScriptProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLang, value.Lang, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.ScriptLanguage? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.ScriptProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.ScriptProcessorConverter))] public sealed partial class ScriptProcessor { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SetProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SetProcessor.Converters.g.cs new file mode 100644 index 00000000000..5e1ed2afbff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SetProcessor.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class SetProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCopyFrom = System.Text.Json.JsonEncodedText.Encode("copy_from"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreEmptyValue = System.Text.Json.JsonEncodedText.Encode("ignore_empty_value"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropMediaType = System.Text.Json.JsonEncodedText.Encode("media_type"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropOverride = System.Text.Json.JsonEncodedText.Encode("override"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + + public override Elastic.Clients.Elasticsearch.Ingest.SetProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCopyFrom = default; + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreEmptyValue = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propMediaType = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propOverride = default; + LocalJsonValue propTag = default; + LocalJsonValue propValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCopyFrom.TryReadProperty(ref reader, options, PropCopyFrom, null)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreEmptyValue.TryReadProperty(ref reader, options, PropIgnoreEmptyValue, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMediaType.TryReadProperty(ref reader, options, PropMediaType, null)) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propOverride.TryReadProperty(ref reader, options, PropOverride, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.SetProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CopyFrom = propCopyFrom.Value, + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreEmptyValue = propIgnoreEmptyValue.Value, + IgnoreFailure = propIgnoreFailure.Value, + MediaType = propMediaType.Value, + OnFailure = propOnFailure.Value, + Override = propOverride.Value, + Tag = propTag.Value, + Value = propValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.SetProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCopyFrom, value.CopyFrom, null, null); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreEmptyValue, value.IgnoreEmptyValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMediaType, value.MediaType, null, null); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropOverride, value.Override, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SetProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SetProcessor.g.cs index d52d493d73a..bec3f4cc1bc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SetProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SetProcessor.g.cs @@ -23,136 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class SetProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCopyFrom = System.Text.Json.JsonEncodedText.Encode("copy_from"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreEmptyValue = System.Text.Json.JsonEncodedText.Encode("ignore_empty_value"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropMediaType = System.Text.Json.JsonEncodedText.Encode("media_type"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropOverride = System.Text.Json.JsonEncodedText.Encode("override"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - - public override Elastic.Clients.Elasticsearch.Ingest.SetProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCopyFrom = default; - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreEmptyValue = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propMediaType = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propOverride = default; - LocalJsonValue propTag = default; - LocalJsonValue propValue = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCopyFrom.TryReadProperty(ref reader, options, PropCopyFrom, null)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreEmptyValue.TryReadProperty(ref reader, options, PropIgnoreEmptyValue, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMediaType.TryReadProperty(ref reader, options, PropMediaType, null)) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propOverride.TryReadProperty(ref reader, options, PropOverride, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.SetProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CopyFrom = propCopyFrom.Value, - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreEmptyValue = propIgnoreEmptyValue.Value, - IgnoreFailure = propIgnoreFailure.Value, - MediaType = propMediaType.Value, - OnFailure = propOnFailure.Value, - Override = propOverride.Value, - Tag = propTag.Value, - Value = propValue.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.SetProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCopyFrom, value.CopyFrom, null, null); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreEmptyValue, value.IgnoreEmptyValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMediaType, value.MediaType, null, null); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropOverride, value.Override, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.SetProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.SetProcessorConverter))] public sealed partial class SetProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SetSecurityUserProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SetSecurityUserProcessor.Converters.g.cs new file mode 100644 index 00000000000..adb40dc9b4d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SetSecurityUserProcessor.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class SetSecurityUserProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + + public override Elastic.Clients.Elasticsearch.Ingest.SetSecurityUserProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue?> propProperties = default; + LocalJsonValue propTag = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.SetSecurityUserProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + OnFailure = propOnFailure.Value, + Properties = propProperties.Value, + Tag = propTag.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.SetSecurityUserProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropProperties, value.Properties, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SetSecurityUserProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SetSecurityUserProcessor.g.cs index f107e5b9e12..f85e41d8426 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SetSecurityUserProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SetSecurityUserProcessor.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class SetSecurityUserProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - - public override Elastic.Clients.Elasticsearch.Ingest.SetSecurityUserProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue?> propProperties = default; - LocalJsonValue propTag = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.SetSecurityUserProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - OnFailure = propOnFailure.Value, - Properties = propProperties.Value, - Tag = propTag.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.SetSecurityUserProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropProperties, value.Properties, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.SetSecurityUserProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.SetSecurityUserProcessorConverter))] public sealed partial class SetSecurityUserProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ShapeType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ShapeType.Converters.g.cs new file mode 100644 index 00000000000..1e93c182690 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ShapeType.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class ShapeTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberGeoShape = System.Text.Json.JsonEncodedText.Encode("geo_shape"); + private static readonly System.Text.Json.JsonEncodedText MemberShape = System.Text.Json.JsonEncodedText.Encode("shape"); + + public override Elastic.Clients.Elasticsearch.Ingest.ShapeType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberGeoShape)) + { + return Elastic.Clients.Elasticsearch.Ingest.ShapeType.GeoShape; + } + + if (reader.ValueTextEquals(MemberShape)) + { + return Elastic.Clients.Elasticsearch.Ingest.ShapeType.Shape; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberGeoShape.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.ShapeType.GeoShape; + } + + if (string.Equals(value, MemberShape.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.ShapeType.Shape; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.ShapeType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.ShapeType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Ingest.ShapeType.GeoShape: + writer.WriteStringValue(MemberGeoShape); + break; + case Elastic.Clients.Elasticsearch.Ingest.ShapeType.Shape: + writer.WriteStringValue(MemberShape); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.ShapeType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Ingest.ShapeType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.ShapeType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ShapeType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ShapeType.g.cs new file mode 100644 index 00000000000..a7a8710ddd8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/ShapeType.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.ShapeTypeConverter))] +public enum ShapeType +{ + [System.Runtime.Serialization.EnumMember(Value = "geo_shape")] + GeoShape, + [System.Runtime.Serialization.EnumMember(Value = "shape")] + Shape +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SimulateDocumentResult.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SimulateDocumentResult.Converters.g.cs new file mode 100644 index 00000000000..77b2d1ad9ab --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SimulateDocumentResult.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class SimulateDocumentResultConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDoc = System.Text.Json.JsonEncodedText.Encode("doc"); + private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); + private static readonly System.Text.Json.JsonEncodedText PropProcessorResults = System.Text.Json.JsonEncodedText.Encode("processor_results"); + + public override Elastic.Clients.Elasticsearch.Ingest.SimulateDocumentResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDoc = default; + LocalJsonValue propError = default; + LocalJsonValue?> propProcessorResults = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDoc.TryReadProperty(ref reader, options, PropDoc, null)) + { + continue; + } + + if (propError.TryReadProperty(ref reader, options, PropError, null)) + { + continue; + } + + if (propProcessorResults.TryReadProperty(ref reader, options, PropProcessorResults, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.SimulateDocumentResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Doc = propDoc.Value, + Error = propError.Value, + ProcessorResults = propProcessorResults.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.SimulateDocumentResult value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDoc, value.Doc, null, null); + writer.WriteProperty(options, PropError, value.Error, null, null); + writer.WriteProperty(options, PropProcessorResults, value.ProcessorResults, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SimulateDocumentResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SimulateDocumentResult.g.cs index c2d92124014..62c80c1c7b2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SimulateDocumentResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SimulateDocumentResult.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class SimulateDocumentResultConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDoc = System.Text.Json.JsonEncodedText.Encode("doc"); - private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); - private static readonly System.Text.Json.JsonEncodedText PropProcessorResults = System.Text.Json.JsonEncodedText.Encode("processor_results"); - - public override Elastic.Clients.Elasticsearch.Ingest.SimulateDocumentResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDoc = default; - LocalJsonValue propError = default; - LocalJsonValue?> propProcessorResults = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDoc.TryReadProperty(ref reader, options, PropDoc, null)) - { - continue; - } - - if (propError.TryReadProperty(ref reader, options, PropError, null)) - { - continue; - } - - if (propProcessorResults.TryReadProperty(ref reader, options, PropProcessorResults, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.SimulateDocumentResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Doc = propDoc.Value, - Error = propError.Value, - ProcessorResults = propProcessorResults.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.SimulateDocumentResult value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDoc, value.Doc, null, null); - writer.WriteProperty(options, PropError, value.Error, null, null); - writer.WriteProperty(options, PropProcessorResults, value.ProcessorResults, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.SimulateDocumentResultConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.SimulateDocumentResultConverter))] public sealed partial class SimulateDocumentResult { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SortProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SortProcessor.Converters.g.cs new file mode 100644 index 00000000000..9380454b08d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SortProcessor.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class SortProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + + public override Elastic.Clients.Elasticsearch.Ingest.SortProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propOrder = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propOrder.TryReadProperty(ref reader, options, PropOrder, static Elastic.Clients.Elasticsearch.SortOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.SortProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + OnFailure = propOnFailure.Value, + Order = propOrder.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.SortProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortOrder? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SortProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SortProcessor.g.cs index 474647a4dba..7698a31e625 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SortProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SortProcessor.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class SortProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - - public override Elastic.Clients.Elasticsearch.Ingest.SortProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propOrder = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propOrder.TryReadProperty(ref reader, options, PropOrder, static Elastic.Clients.Elasticsearch.SortOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.SortProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - OnFailure = propOnFailure.Value, - Order = propOrder.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.SortProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortOrder? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.SortProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.SortProcessorConverter))] public sealed partial class SortProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SplitProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SplitProcessor.Converters.g.cs new file mode 100644 index 00000000000..be061330860 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SplitProcessor.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class SplitProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropPreserveTrailing = System.Text.Json.JsonEncodedText.Encode("preserve_trailing"); + private static readonly System.Text.Json.JsonEncodedText PropSeparator = System.Text.Json.JsonEncodedText.Encode("separator"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + + public override Elastic.Clients.Elasticsearch.Ingest.SplitProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propPreserveTrailing = default; + LocalJsonValue propSeparator = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propPreserveTrailing.TryReadProperty(ref reader, options, PropPreserveTrailing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSeparator.TryReadProperty(ref reader, options, PropSeparator, null)) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.SplitProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + OnFailure = propOnFailure.Value, + PreserveTrailing = propPreserveTrailing.Value, + Separator = propSeparator.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.SplitProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPreserveTrailing, value.PreserveTrailing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSeparator, value.Separator, null, null); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SplitProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SplitProcessor.g.cs index 9cdb0d03b6c..8a4c86786c1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SplitProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SplitProcessor.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class SplitProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropPreserveTrailing = System.Text.Json.JsonEncodedText.Encode("preserve_trailing"); - private static readonly System.Text.Json.JsonEncodedText PropSeparator = System.Text.Json.JsonEncodedText.Encode("separator"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - - public override Elastic.Clients.Elasticsearch.Ingest.SplitProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propPreserveTrailing = default; - LocalJsonValue propSeparator = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propPreserveTrailing.TryReadProperty(ref reader, options, PropPreserveTrailing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSeparator.TryReadProperty(ref reader, options, PropSeparator, null)) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.SplitProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - OnFailure = propOnFailure.Value, - PreserveTrailing = propPreserveTrailing.Value, - Separator = propSeparator.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.SplitProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPreserveTrailing, value.PreserveTrailing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSeparator, value.Separator, null, null); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.SplitProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.SplitProcessorConverter))] public sealed partial class SplitProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/TerminateProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/TerminateProcessor.Converters.g.cs new file mode 100644 index 00000000000..93656b15f2f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/TerminateProcessor.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class TerminateProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + + public override Elastic.Clients.Elasticsearch.Ingest.TerminateProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propTag = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.TerminateProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + OnFailure = propOnFailure.Value, + Tag = propTag.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.TerminateProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/TerminateProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/TerminateProcessor.g.cs index 02df042a9cb..3cb57b63071 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/TerminateProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/TerminateProcessor.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class TerminateProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - - public override Elastic.Clients.Elasticsearch.Ingest.TerminateProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propTag = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.TerminateProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - OnFailure = propOnFailure.Value, - Tag = propTag.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.TerminateProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.TerminateProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.TerminateProcessorConverter))] public sealed partial class TerminateProcessor { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/TrimProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/TrimProcessor.Converters.g.cs new file mode 100644 index 00000000000..095c2d21fdf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/TrimProcessor.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class TrimProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + + public override Elastic.Clients.Elasticsearch.Ingest.TrimProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.TrimProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + OnFailure = propOnFailure.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.TrimProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/TrimProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/TrimProcessor.g.cs index a7bec568812..50232e741bd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/TrimProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/TrimProcessor.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class TrimProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - - public override Elastic.Clients.Elasticsearch.Ingest.TrimProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.TrimProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - OnFailure = propOnFailure.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.TrimProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.TrimProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.TrimProcessorConverter))] public sealed partial class TrimProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UppercaseProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UppercaseProcessor.Converters.g.cs new file mode 100644 index 00000000000..19a5ffcf2b2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UppercaseProcessor.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class UppercaseProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + + public override Elastic.Clients.Elasticsearch.Ingest.UppercaseProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.UppercaseProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + OnFailure = propOnFailure.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.UppercaseProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UppercaseProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UppercaseProcessor.g.cs index d10668b2f9b..a52543d3880 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UppercaseProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UppercaseProcessor.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class UppercaseProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - - public override Elastic.Clients.Elasticsearch.Ingest.UppercaseProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.UppercaseProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - OnFailure = propOnFailure.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.UppercaseProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.UppercaseProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.UppercaseProcessorConverter))] public sealed partial class UppercaseProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UriPartsProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UriPartsProcessor.Converters.g.cs new file mode 100644 index 00000000000..2a9bbcdb67d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UriPartsProcessor.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class UriPartsProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropKeepOriginal = System.Text.Json.JsonEncodedText.Encode("keep_original"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropRemoveIfSuccessful = System.Text.Json.JsonEncodedText.Encode("remove_if_successful"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + + public override Elastic.Clients.Elasticsearch.Ingest.UriPartsProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue propKeepOriginal = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propRemoveIfSuccessful = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propKeepOriginal.TryReadProperty(ref reader, options, PropKeepOriginal, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propRemoveIfSuccessful.TryReadProperty(ref reader, options, PropRemoveIfSuccessful, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.UriPartsProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + KeepOriginal = propKeepOriginal.Value, + OnFailure = propOnFailure.Value, + RemoveIfSuccessful = propRemoveIfSuccessful.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.UriPartsProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropKeepOriginal, value.KeepOriginal, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRemoveIfSuccessful, value.RemoveIfSuccessful, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UriPartsProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UriPartsProcessor.g.cs index bcc3b0851da..47415adfb45 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UriPartsProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UriPartsProcessor.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class UriPartsProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropKeepOriginal = System.Text.Json.JsonEncodedText.Encode("keep_original"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropRemoveIfSuccessful = System.Text.Json.JsonEncodedText.Encode("remove_if_successful"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - - public override Elastic.Clients.Elasticsearch.Ingest.UriPartsProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue propKeepOriginal = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propRemoveIfSuccessful = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propKeepOriginal.TryReadProperty(ref reader, options, PropKeepOriginal, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propRemoveIfSuccessful.TryReadProperty(ref reader, options, PropRemoveIfSuccessful, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.UriPartsProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - KeepOriginal = propKeepOriginal.Value, - OnFailure = propOnFailure.Value, - RemoveIfSuccessful = propRemoveIfSuccessful.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.UriPartsProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropKeepOriginal, value.KeepOriginal, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRemoveIfSuccessful, value.RemoveIfSuccessful, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.UriPartsProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.UriPartsProcessorConverter))] public sealed partial class UriPartsProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UrlDecodeProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UrlDecodeProcessor.Converters.g.cs new file mode 100644 index 00000000000..7f430262be0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UrlDecodeProcessor.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class UrlDecodeProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + + public override Elastic.Clients.Elasticsearch.Ingest.UrlDecodeProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.UrlDecodeProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + OnFailure = propOnFailure.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.UrlDecodeProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UrlDecodeProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UrlDecodeProcessor.g.cs index 0872a673818..4c0d2bafa10 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UrlDecodeProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UrlDecodeProcessor.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class UrlDecodeProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - - public override Elastic.Clients.Elasticsearch.Ingest.UrlDecodeProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.UrlDecodeProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - OnFailure = propOnFailure.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.UrlDecodeProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.UrlDecodeProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.UrlDecodeProcessorConverter))] public sealed partial class UrlDecodeProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UserAgentProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UserAgentProcessor.Converters.g.cs new file mode 100644 index 00000000000..154cddc9903 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UserAgentProcessor.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class UserAgentProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropExtractDeviceType = System.Text.Json.JsonEncodedText.Encode("extract_device_type"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); + private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropRegexFile = System.Text.Json.JsonEncodedText.Encode("regex_file"); + private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + + public override Elastic.Clients.Elasticsearch.Ingest.UserAgentProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propExtractDeviceType = default; + LocalJsonValue propField = default; + LocalJsonValue propIf = default; + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propIgnoreMissing = default; + LocalJsonValue?> propOnFailure = default; + LocalJsonValue?> propProperties = default; + LocalJsonValue propRegexFile = default; + LocalJsonValue propTag = default; + LocalJsonValue propTargetField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propExtractDeviceType.TryReadProperty(ref reader, options, PropExtractDeviceType, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propIf.TryReadProperty(ref reader, options, PropIf, null)) + { + continue; + } + + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propRegexFile.TryReadProperty(ref reader, options, PropRegexFile, null)) + { + continue; + } + + if (propTag.TryReadProperty(ref reader, options, PropTag, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.UserAgentProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + ExtractDeviceType = propExtractDeviceType.Value, + Field = propField.Value, + If = propIf.Value, + IgnoreFailure = propIgnoreFailure.Value, + IgnoreMissing = propIgnoreMissing.Value, + OnFailure = propOnFailure.Value, + Properties = propProperties.Value, + RegexFile = propRegexFile.Value, + Tag = propTag.Value, + TargetField = propTargetField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.UserAgentProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropExtractDeviceType, value.ExtractDeviceType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropIf, value.If, null, null); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropProperties, value.Properties, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRegexFile, value.RegexFile, null, null); + writer.WriteProperty(options, PropTag, value.Tag, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UserAgentProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UserAgentProcessor.g.cs index f675d0151f5..6476bc3f163 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UserAgentProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UserAgentProcessor.g.cs @@ -23,136 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class UserAgentProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropExtractDeviceType = System.Text.Json.JsonEncodedText.Encode("extract_device_type"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropIf = System.Text.Json.JsonEncodedText.Encode("if"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissing = System.Text.Json.JsonEncodedText.Encode("ignore_missing"); - private static readonly System.Text.Json.JsonEncodedText PropOnFailure = System.Text.Json.JsonEncodedText.Encode("on_failure"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropRegexFile = System.Text.Json.JsonEncodedText.Encode("regex_file"); - private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - - public override Elastic.Clients.Elasticsearch.Ingest.UserAgentProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propExtractDeviceType = default; - LocalJsonValue propField = default; - LocalJsonValue propIf = default; - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propIgnoreMissing = default; - LocalJsonValue?> propOnFailure = default; - LocalJsonValue?> propProperties = default; - LocalJsonValue propRegexFile = default; - LocalJsonValue propTag = default; - LocalJsonValue propTargetField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propExtractDeviceType.TryReadProperty(ref reader, options, PropExtractDeviceType, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propIf.TryReadProperty(ref reader, options, PropIf, null)) - { - continue; - } - - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMissing.TryReadProperty(ref reader, options, PropIgnoreMissing, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnFailure.TryReadProperty(ref reader, options, PropOnFailure, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propRegexFile.TryReadProperty(ref reader, options, PropRegexFile, null)) - { - continue; - } - - if (propTag.TryReadProperty(ref reader, options, PropTag, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.UserAgentProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - ExtractDeviceType = propExtractDeviceType.Value, - Field = propField.Value, - If = propIf.Value, - IgnoreFailure = propIgnoreFailure.Value, - IgnoreMissing = propIgnoreMissing.Value, - OnFailure = propOnFailure.Value, - Properties = propProperties.Value, - RegexFile = propRegexFile.Value, - Tag = propTag.Value, - TargetField = propTargetField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.UserAgentProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropExtractDeviceType, value.ExtractDeviceType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropIf, value.If, null, null); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMissing, value.IgnoreMissing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnFailure, value.OnFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropProperties, value.Properties, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRegexFile, value.RegexFile, null, null); - writer.WriteProperty(options, PropTag, value.Tag, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.UserAgentProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.UserAgentProcessorConverter))] public sealed partial class UserAgentProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UserAgentProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UserAgentProperty.Converters.g.cs new file mode 100644 index 00000000000..cab5f27521b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UserAgentProperty.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class UserAgentPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberDevice = System.Text.Json.JsonEncodedText.Encode("device"); + private static readonly System.Text.Json.JsonEncodedText MemberName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText MemberOriginal = System.Text.Json.JsonEncodedText.Encode("original"); + private static readonly System.Text.Json.JsonEncodedText MemberOs = System.Text.Json.JsonEncodedText.Encode("os"); + private static readonly System.Text.Json.JsonEncodedText MemberVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberDevice)) + { + return Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Device; + } + + if (reader.ValueTextEquals(MemberName)) + { + return Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Name; + } + + if (reader.ValueTextEquals(MemberOriginal)) + { + return Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Original; + } + + if (reader.ValueTextEquals(MemberOs)) + { + return Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Os; + } + + if (reader.ValueTextEquals(MemberVersion)) + { + return Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Version; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberDevice.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Device; + } + + if (string.Equals(value, MemberName.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Name; + } + + if (string.Equals(value, MemberOriginal.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Original; + } + + if (string.Equals(value, MemberOs.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Os; + } + + if (string.Equals(value, MemberVersion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Version; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Device: + writer.WriteStringValue(MemberDevice); + break; + case Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Name: + writer.WriteStringValue(MemberName); + break; + case Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Original: + writer.WriteStringValue(MemberOriginal); + break; + case Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Os: + writer.WriteStringValue(MemberOs); + break; + case Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty.Version: + writer.WriteStringValue(MemberVersion); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.UserAgentProperty value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UserAgentProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UserAgentProperty.g.cs new file mode 100644 index 00000000000..392a8adb761 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/UserAgentProperty.g.cs @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.UserAgentPropertyConverter))] +public enum UserAgentProperty +{ + [System.Runtime.Serialization.EnumMember(Value = "device")] + Device, + [System.Runtime.Serialization.EnumMember(Value = "name")] + Name, + [System.Runtime.Serialization.EnumMember(Value = "original")] + Original, + [System.Runtime.Serialization.EnumMember(Value = "os")] + Os, + [System.Runtime.Serialization.EnumMember(Value = "version")] + Version +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Web.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Web.Converters.g.cs new file mode 100644 index 00000000000..8d6431e94d2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Web.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Ingest.Json; + +public sealed partial class WebConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Ingest.Web Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Ingest.Web(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.Web value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Web.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Web.g.cs index a2c3390b8b5..25ea67359f7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Web.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/Web.g.cs @@ -23,36 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class WebConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Ingest.Web Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.Web(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.Web value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.WebConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.Json.WebConverter))] public sealed partial class Web { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/InlineGet.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/InlineGet.Converters.g.cs new file mode 100644 index 00000000000..c8ef53c37de --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/InlineGet.Converters.g.cs @@ -0,0 +1,130 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class InlineGetConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropFound = System.Text.Json.JsonEncodedText.Encode("found"); + private static readonly System.Text.Json.JsonEncodedText PropPrimaryTerm = System.Text.Json.JsonEncodedText.Encode("_primary_term"); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("_routing"); + private static readonly System.Text.Json.JsonEncodedText PropSeqNo = System.Text.Json.JsonEncodedText.Encode("_seq_no"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); + + public override Elastic.Clients.Elasticsearch.InlineGet Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propFields = default; + LocalJsonValue propFound = default; + System.Collections.Generic.Dictionary? propMetadata = default; + LocalJsonValue propPrimaryTerm = default; + LocalJsonValue propRouting = default; + LocalJsonValue propSeqNo = default; + LocalJsonValue propSource = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propFound.TryReadProperty(ref reader, options, PropFound, null)) + { + continue; + } + + if (propPrimaryTerm.TryReadProperty(ref reader, options, PropPrimaryTerm, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (propSeqNo.TryReadProperty(ref reader, options, PropSeqNo, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + propMetadata ??= new System.Collections.Generic.Dictionary(); + reader.ReadProperty(options, out string key, out object value, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!); + propMetadata[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.InlineGet(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Fields = propFields.Value, + Found = propFound.Value, + Metadata = propMetadata, + PrimaryTerm = propPrimaryTerm.Value, + Routing = propRouting.Value, + SeqNo = propSeqNo.Value, + Source = propSource.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.InlineGet value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropFound, value.Found, null, null); + writer.WriteProperty(options, PropPrimaryTerm, value.PrimaryTerm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteProperty(options, PropSeqNo, value.SeqNo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSource, value.Source, null, null); + if (value.Metadata is not null) + { + foreach (var item in value.Metadata) + { + writer.WriteProperty(options, item.Key, item.Value, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + } + } + + writer.WriteEndObject(); + } +} + +public sealed partial class InlineGetConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(InlineGet<>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(InlineGetConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/InlineGet.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/InlineGet.g.cs index 16be2810912..cf7e7ae88dd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/InlineGet.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/InlineGet.g.cs @@ -23,113 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class InlineGetConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropFound = System.Text.Json.JsonEncodedText.Encode("found"); - private static readonly System.Text.Json.JsonEncodedText PropPrimaryTerm = System.Text.Json.JsonEncodedText.Encode("_primary_term"); - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("_routing"); - private static readonly System.Text.Json.JsonEncodedText PropSeqNo = System.Text.Json.JsonEncodedText.Encode("_seq_no"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); - - public override Elastic.Clients.Elasticsearch.InlineGet Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propFields = default; - LocalJsonValue propFound = default; - System.Collections.Generic.Dictionary? propMetadata = default; - LocalJsonValue propPrimaryTerm = default; - LocalJsonValue propRouting = default; - LocalJsonValue propSeqNo = default; - LocalJsonValue propSource = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propFound.TryReadProperty(ref reader, options, PropFound, null)) - { - continue; - } - - if (propPrimaryTerm.TryReadProperty(ref reader, options, PropPrimaryTerm, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (propSeqNo.TryReadProperty(ref reader, options, PropSeqNo, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - propMetadata ??= new System.Collections.Generic.Dictionary(); - reader.ReadProperty(options, out string key, out object value, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!); - propMetadata[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.InlineGet(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Fields = propFields.Value, - Found = propFound.Value, - Metadata = propMetadata, - PrimaryTerm = propPrimaryTerm.Value, - Routing = propRouting.Value, - SeqNo = propSeqNo.Value, - Source = propSource.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.InlineGet value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropFound, value.Found, null, null); - writer.WriteProperty(options, PropPrimaryTerm, value.PrimaryTerm, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteProperty(options, PropSeqNo, value.SeqNo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSource, value.Source, null, null); - if (value.Metadata is not null) - { - foreach (var item in value.Metadata) - { - writer.WriteProperty(options, item.Key, item.Value, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - } - } - - writer.WriteEndObject(); - } -} - -internal sealed partial class InlineGetConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(InlineGet<>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(InlineGetConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.InlineGetConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.InlineGetConverterFactory))] public sealed partial class InlineGet { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/InnerRetriever.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/InnerRetriever.Converters.g.cs new file mode 100644 index 00000000000..e55a3dbf3ff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/InnerRetriever.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class InnerRetrieverConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNormalizer = System.Text.Json.JsonEncodedText.Encode("normalizer"); + private static readonly System.Text.Json.JsonEncodedText PropRetriever = System.Text.Json.JsonEncodedText.Encode("retriever"); + private static readonly System.Text.Json.JsonEncodedText PropWeight = System.Text.Json.JsonEncodedText.Encode("weight"); + + public override Elastic.Clients.Elasticsearch.InnerRetriever Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propNormalizer = default; + LocalJsonValue propRetriever = default; + LocalJsonValue propWeight = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNormalizer.TryReadProperty(ref reader, options, PropNormalizer, null)) + { + continue; + } + + if (propRetriever.TryReadProperty(ref reader, options, PropRetriever, null)) + { + continue; + } + + if (propWeight.TryReadProperty(ref reader, options, PropWeight, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.InnerRetriever(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Normalizer = propNormalizer.Value, + Retriever = propRetriever.Value, + Weight = propWeight.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.InnerRetriever value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNormalizer, value.Normalizer, null, null); + writer.WriteProperty(options, PropRetriever, value.Retriever, null, null); + writer.WriteProperty(options, PropWeight, value.Weight, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/InnerRetriever.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/InnerRetriever.g.cs index 23bcebc4138..1ca31aa76fd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/InnerRetriever.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/InnerRetriever.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class InnerRetrieverConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNormalizer = System.Text.Json.JsonEncodedText.Encode("normalizer"); - private static readonly System.Text.Json.JsonEncodedText PropRetriever = System.Text.Json.JsonEncodedText.Encode("retriever"); - private static readonly System.Text.Json.JsonEncodedText PropWeight = System.Text.Json.JsonEncodedText.Encode("weight"); - - public override Elastic.Clients.Elasticsearch.InnerRetriever Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propNormalizer = default; - LocalJsonValue propRetriever = default; - LocalJsonValue propWeight = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNormalizer.TryReadProperty(ref reader, options, PropNormalizer, null)) - { - continue; - } - - if (propRetriever.TryReadProperty(ref reader, options, PropRetriever, null)) - { - continue; - } - - if (propWeight.TryReadProperty(ref reader, options, PropWeight, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.InnerRetriever(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Normalizer = propNormalizer.Value, - Retriever = propRetriever.Value, - Weight = propWeight.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.InnerRetriever value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNormalizer, value.Normalizer, null, null); - writer.WriteProperty(options, PropRetriever, value.Retriever, null, null); - writer.WriteProperty(options, PropWeight, value.Weight, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.InnerRetrieverConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.InnerRetrieverConverter))] public sealed partial class InnerRetriever { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnQuery.Converters.g.cs new file mode 100644 index 00000000000..2a3cf666763 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnQuery.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class KnnQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropK = System.Text.Json.JsonEncodedText.Encode("k"); + private static readonly System.Text.Json.JsonEncodedText PropNumCandidates = System.Text.Json.JsonEncodedText.Encode("num_candidates"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropQueryVector = System.Text.Json.JsonEncodedText.Encode("query_vector"); + private static readonly System.Text.Json.JsonEncodedText PropQueryVectorBuilder = System.Text.Json.JsonEncodedText.Encode("query_vector_builder"); + private static readonly System.Text.Json.JsonEncodedText PropRescoreVector = System.Text.Json.JsonEncodedText.Encode("rescore_vector"); + private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); + + public override Elastic.Clients.Elasticsearch.KnnQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propField = default; + LocalJsonValue?> propFilter = default; + LocalJsonValue propK = default; + LocalJsonValue propNumCandidates = default; + LocalJsonValue propQueryName = default; + LocalJsonValue?> propQueryVector = default; + LocalJsonValue propQueryVectorBuilder = default; + LocalJsonValue propRescoreVector = default; + LocalJsonValue propSimilarity = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propK.TryReadProperty(ref reader, options, PropK, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNumCandidates.TryReadProperty(ref reader, options, PropNumCandidates, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propQueryVector.TryReadProperty(ref reader, options, PropQueryVector, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propQueryVectorBuilder.TryReadProperty(ref reader, options, PropQueryVectorBuilder, null)) + { + continue; + } + + if (propRescoreVector.TryReadProperty(ref reader, options, PropRescoreVector, null)) + { + continue; + } + + if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.KnnQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Field = propField.Value, + Filter = propFilter.Value, + K = propK.Value, + NumCandidates = propNumCandidates.Value, + QueryName = propQueryName.Value, + QueryVector = propQueryVector.Value, + QueryVectorBuilder = propQueryVectorBuilder.Value, + RescoreVector = propRescoreVector.Value, + Similarity = propSimilarity.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.KnnQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropK, value.K, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNumCandidates, value.NumCandidates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropQueryVector, value.QueryVector, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropQueryVectorBuilder, value.QueryVectorBuilder, null, null); + writer.WriteProperty(options, PropRescoreVector, value.RescoreVector, null, null); + writer.WriteProperty(options, PropSimilarity, value.Similarity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnQuery.g.cs index 16a1c87ce7d..a0e73f252e7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnQuery.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class KnnQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropK = System.Text.Json.JsonEncodedText.Encode("k"); - private static readonly System.Text.Json.JsonEncodedText PropNumCandidates = System.Text.Json.JsonEncodedText.Encode("num_candidates"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropQueryVector = System.Text.Json.JsonEncodedText.Encode("query_vector"); - private static readonly System.Text.Json.JsonEncodedText PropQueryVectorBuilder = System.Text.Json.JsonEncodedText.Encode("query_vector_builder"); - private static readonly System.Text.Json.JsonEncodedText PropRescoreVector = System.Text.Json.JsonEncodedText.Encode("rescore_vector"); - private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); - - public override Elastic.Clients.Elasticsearch.KnnQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propField = default; - LocalJsonValue?> propFilter = default; - LocalJsonValue propK = default; - LocalJsonValue propNumCandidates = default; - LocalJsonValue propQueryName = default; - LocalJsonValue?> propQueryVector = default; - LocalJsonValue propQueryVectorBuilder = default; - LocalJsonValue propRescoreVector = default; - LocalJsonValue propSimilarity = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propK.TryReadProperty(ref reader, options, PropK, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNumCandidates.TryReadProperty(ref reader, options, PropNumCandidates, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propQueryVector.TryReadProperty(ref reader, options, PropQueryVector, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propQueryVectorBuilder.TryReadProperty(ref reader, options, PropQueryVectorBuilder, null)) - { - continue; - } - - if (propRescoreVector.TryReadProperty(ref reader, options, PropRescoreVector, null)) - { - continue; - } - - if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.KnnQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Field = propField.Value, - Filter = propFilter.Value, - K = propK.Value, - NumCandidates = propNumCandidates.Value, - QueryName = propQueryName.Value, - QueryVector = propQueryVector.Value, - QueryVectorBuilder = propQueryVectorBuilder.Value, - RescoreVector = propRescoreVector.Value, - Similarity = propSimilarity.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.KnnQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropK, value.K, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNumCandidates, value.NumCandidates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropQueryVector, value.QueryVector, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropQueryVectorBuilder, value.QueryVectorBuilder, null, null); - writer.WriteProperty(options, PropRescoreVector, value.RescoreVector, null, null); - writer.WriteProperty(options, PropSimilarity, value.Similarity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.KnnQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.KnnQueryConverter))] public sealed partial class KnnQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnRetriever.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnRetriever.Converters.g.cs new file mode 100644 index 00000000000..ac6816cb040 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnRetriever.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class KnnRetrieverConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropK = System.Text.Json.JsonEncodedText.Encode("k"); + private static readonly System.Text.Json.JsonEncodedText PropMinScore = System.Text.Json.JsonEncodedText.Encode("min_score"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropNumCandidates = System.Text.Json.JsonEncodedText.Encode("num_candidates"); + private static readonly System.Text.Json.JsonEncodedText PropQueryVector = System.Text.Json.JsonEncodedText.Encode("query_vector"); + private static readonly System.Text.Json.JsonEncodedText PropQueryVectorBuilder = System.Text.Json.JsonEncodedText.Encode("query_vector_builder"); + private static readonly System.Text.Json.JsonEncodedText PropRescoreVector = System.Text.Json.JsonEncodedText.Encode("rescore_vector"); + private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); + + public override Elastic.Clients.Elasticsearch.KnnRetriever Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue?> propFilter = default; + LocalJsonValue propK = default; + LocalJsonValue propMinScore = default; + LocalJsonValue propName = default; + LocalJsonValue propNumCandidates = default; + LocalJsonValue?> propQueryVector = default; + LocalJsonValue propQueryVectorBuilder = default; + LocalJsonValue propRescoreVector = default; + LocalJsonValue propSimilarity = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propK.TryReadProperty(ref reader, options, PropK, null)) + { + continue; + } + + if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propNumCandidates.TryReadProperty(ref reader, options, PropNumCandidates, null)) + { + continue; + } + + if (propQueryVector.TryReadProperty(ref reader, options, PropQueryVector, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propQueryVectorBuilder.TryReadProperty(ref reader, options, PropQueryVectorBuilder, null)) + { + continue; + } + + if (propRescoreVector.TryReadProperty(ref reader, options, PropRescoreVector, null)) + { + continue; + } + + if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.KnnRetriever(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Filter = propFilter.Value, + K = propK.Value, + MinScore = propMinScore.Value, + Name = propName.Value, + NumCandidates = propNumCandidates.Value, + QueryVector = propQueryVector.Value, + QueryVectorBuilder = propQueryVectorBuilder.Value, + RescoreVector = propRescoreVector.Value, + Similarity = propSimilarity.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.KnnRetriever value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropK, value.K, null, null); + writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropNumCandidates, value.NumCandidates, null, null); + writer.WriteProperty(options, PropQueryVector, value.QueryVector, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropQueryVectorBuilder, value.QueryVectorBuilder, null, null); + writer.WriteProperty(options, PropRescoreVector, value.RescoreVector, null, null); + writer.WriteProperty(options, PropSimilarity, value.Similarity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnRetriever.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnRetriever.g.cs index 7133ca37854..1b899698e2e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnRetriever.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnRetriever.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class KnnRetrieverConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropK = System.Text.Json.JsonEncodedText.Encode("k"); - private static readonly System.Text.Json.JsonEncodedText PropMinScore = System.Text.Json.JsonEncodedText.Encode("min_score"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropNumCandidates = System.Text.Json.JsonEncodedText.Encode("num_candidates"); - private static readonly System.Text.Json.JsonEncodedText PropQueryVector = System.Text.Json.JsonEncodedText.Encode("query_vector"); - private static readonly System.Text.Json.JsonEncodedText PropQueryVectorBuilder = System.Text.Json.JsonEncodedText.Encode("query_vector_builder"); - private static readonly System.Text.Json.JsonEncodedText PropRescoreVector = System.Text.Json.JsonEncodedText.Encode("rescore_vector"); - private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); - - public override Elastic.Clients.Elasticsearch.KnnRetriever Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue?> propFilter = default; - LocalJsonValue propK = default; - LocalJsonValue propMinScore = default; - LocalJsonValue propName = default; - LocalJsonValue propNumCandidates = default; - LocalJsonValue?> propQueryVector = default; - LocalJsonValue propQueryVectorBuilder = default; - LocalJsonValue propRescoreVector = default; - LocalJsonValue propSimilarity = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propK.TryReadProperty(ref reader, options, PropK, null)) - { - continue; - } - - if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propNumCandidates.TryReadProperty(ref reader, options, PropNumCandidates, null)) - { - continue; - } - - if (propQueryVector.TryReadProperty(ref reader, options, PropQueryVector, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propQueryVectorBuilder.TryReadProperty(ref reader, options, PropQueryVectorBuilder, null)) - { - continue; - } - - if (propRescoreVector.TryReadProperty(ref reader, options, PropRescoreVector, null)) - { - continue; - } - - if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.KnnRetriever(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Filter = propFilter.Value, - K = propK.Value, - MinScore = propMinScore.Value, - Name = propName.Value, - NumCandidates = propNumCandidates.Value, - QueryVector = propQueryVector.Value, - QueryVectorBuilder = propQueryVectorBuilder.Value, - RescoreVector = propRescoreVector.Value, - Similarity = propSimilarity.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.KnnRetriever value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropK, value.K, null, null); - writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropNumCandidates, value.NumCandidates, null, null); - writer.WriteProperty(options, PropQueryVector, value.QueryVector, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropQueryVectorBuilder, value.QueryVectorBuilder, null, null); - writer.WriteProperty(options, PropRescoreVector, value.RescoreVector, null, null); - writer.WriteProperty(options, PropSimilarity, value.Similarity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.KnnRetrieverConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.KnnRetrieverConverter))] public sealed partial class KnnRetriever { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnSearch.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnSearch.Converters.g.cs new file mode 100644 index 00000000000..0bf6d3e0ae5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnSearch.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class KnnSearchConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropInnerHits = System.Text.Json.JsonEncodedText.Encode("inner_hits"); + private static readonly System.Text.Json.JsonEncodedText PropK = System.Text.Json.JsonEncodedText.Encode("k"); + private static readonly System.Text.Json.JsonEncodedText PropNumCandidates = System.Text.Json.JsonEncodedText.Encode("num_candidates"); + private static readonly System.Text.Json.JsonEncodedText PropQueryVector = System.Text.Json.JsonEncodedText.Encode("query_vector"); + private static readonly System.Text.Json.JsonEncodedText PropQueryVectorBuilder = System.Text.Json.JsonEncodedText.Encode("query_vector_builder"); + private static readonly System.Text.Json.JsonEncodedText PropRescoreVector = System.Text.Json.JsonEncodedText.Encode("rescore_vector"); + private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); + + public override Elastic.Clients.Elasticsearch.KnnSearch Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propField = default; + LocalJsonValue?> propFilter = default; + LocalJsonValue propInnerHits = default; + LocalJsonValue propK = default; + LocalJsonValue propNumCandidates = default; + LocalJsonValue?> propQueryVector = default; + LocalJsonValue propQueryVectorBuilder = default; + LocalJsonValue propRescoreVector = default; + LocalJsonValue propSimilarity = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propInnerHits.TryReadProperty(ref reader, options, PropInnerHits, null)) + { + continue; + } + + if (propK.TryReadProperty(ref reader, options, PropK, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNumCandidates.TryReadProperty(ref reader, options, PropNumCandidates, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryVector.TryReadProperty(ref reader, options, PropQueryVector, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propQueryVectorBuilder.TryReadProperty(ref reader, options, PropQueryVectorBuilder, null)) + { + continue; + } + + if (propRescoreVector.TryReadProperty(ref reader, options, PropRescoreVector, null)) + { + continue; + } + + if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.KnnSearch(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Field = propField.Value, + Filter = propFilter.Value, + InnerHits = propInnerHits.Value, + K = propK.Value, + NumCandidates = propNumCandidates.Value, + QueryVector = propQueryVector.Value, + QueryVectorBuilder = propQueryVectorBuilder.Value, + RescoreVector = propRescoreVector.Value, + Similarity = propSimilarity.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.KnnSearch value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropInnerHits, value.InnerHits, null, null); + writer.WriteProperty(options, PropK, value.K, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNumCandidates, value.NumCandidates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryVector, value.QueryVector, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropQueryVectorBuilder, value.QueryVectorBuilder, null, null); + writer.WriteProperty(options, PropRescoreVector, value.RescoreVector, null, null); + writer.WriteProperty(options, PropSimilarity, value.Similarity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnSearch.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnSearch.g.cs index 03d39eb7895..f86b5e8b2ee 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnSearch.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnSearch.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class KnnSearchConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropInnerHits = System.Text.Json.JsonEncodedText.Encode("inner_hits"); - private static readonly System.Text.Json.JsonEncodedText PropK = System.Text.Json.JsonEncodedText.Encode("k"); - private static readonly System.Text.Json.JsonEncodedText PropNumCandidates = System.Text.Json.JsonEncodedText.Encode("num_candidates"); - private static readonly System.Text.Json.JsonEncodedText PropQueryVector = System.Text.Json.JsonEncodedText.Encode("query_vector"); - private static readonly System.Text.Json.JsonEncodedText PropQueryVectorBuilder = System.Text.Json.JsonEncodedText.Encode("query_vector_builder"); - private static readonly System.Text.Json.JsonEncodedText PropRescoreVector = System.Text.Json.JsonEncodedText.Encode("rescore_vector"); - private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); - - public override Elastic.Clients.Elasticsearch.KnnSearch Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propField = default; - LocalJsonValue?> propFilter = default; - LocalJsonValue propInnerHits = default; - LocalJsonValue propK = default; - LocalJsonValue propNumCandidates = default; - LocalJsonValue?> propQueryVector = default; - LocalJsonValue propQueryVectorBuilder = default; - LocalJsonValue propRescoreVector = default; - LocalJsonValue propSimilarity = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propInnerHits.TryReadProperty(ref reader, options, PropInnerHits, null)) - { - continue; - } - - if (propK.TryReadProperty(ref reader, options, PropK, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNumCandidates.TryReadProperty(ref reader, options, PropNumCandidates, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryVector.TryReadProperty(ref reader, options, PropQueryVector, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propQueryVectorBuilder.TryReadProperty(ref reader, options, PropQueryVectorBuilder, null)) - { - continue; - } - - if (propRescoreVector.TryReadProperty(ref reader, options, PropRescoreVector, null)) - { - continue; - } - - if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.KnnSearch(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Field = propField.Value, - Filter = propFilter.Value, - InnerHits = propInnerHits.Value, - K = propK.Value, - NumCandidates = propNumCandidates.Value, - QueryVector = propQueryVector.Value, - QueryVectorBuilder = propQueryVectorBuilder.Value, - RescoreVector = propRescoreVector.Value, - Similarity = propSimilarity.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.KnnSearch value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropInnerHits, value.InnerHits, null, null); - writer.WriteProperty(options, PropK, value.K, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNumCandidates, value.NumCandidates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryVector, value.QueryVector, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropQueryVectorBuilder, value.QueryVectorBuilder, null, null); - writer.WriteProperty(options, PropRescoreVector, value.RescoreVector, null, null); - writer.WriteProperty(options, PropSimilarity, value.Similarity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.KnnSearchConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.KnnSearchConverter))] public sealed partial class KnnSearch { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/LatLonGeoLocation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LatLonGeoLocation.Converters.g.cs new file mode 100644 index 00000000000..9b188b7753f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LatLonGeoLocation.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class LatLonGeoLocationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLat = System.Text.Json.JsonEncodedText.Encode("lat"); + private static readonly System.Text.Json.JsonEncodedText PropLon = System.Text.Json.JsonEncodedText.Encode("lon"); + + public override Elastic.Clients.Elasticsearch.LatLonGeoLocation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLat = default; + LocalJsonValue propLon = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLat.TryReadProperty(ref reader, options, PropLat, null)) + { + continue; + } + + if (propLon.TryReadProperty(ref reader, options, PropLon, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.LatLonGeoLocation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Lat = propLat.Value, + Lon = propLon.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LatLonGeoLocation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLat, value.Lat, null, null); + writer.WriteProperty(options, PropLon, value.Lon, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/LatLonGeoLocation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LatLonGeoLocation.g.cs index 2145e3dcbf3..fb9acab8fa5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/LatLonGeoLocation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LatLonGeoLocation.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class LatLonGeoLocationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLat = System.Text.Json.JsonEncodedText.Encode("lat"); - private static readonly System.Text.Json.JsonEncodedText PropLon = System.Text.Json.JsonEncodedText.Encode("lon"); - - public override Elastic.Clients.Elasticsearch.LatLonGeoLocation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLat = default; - LocalJsonValue propLon = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLat.TryReadProperty(ref reader, options, PropLat, null)) - { - continue; - } - - if (propLon.TryReadProperty(ref reader, options, PropLon, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.LatLonGeoLocation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Lat = propLat.Value, - Lon = propLon.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LatLonGeoLocation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLat, value.Lat, null, null); - writer.WriteProperty(options, PropLon, value.Lon, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LatLonGeoLocationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.LatLonGeoLocationConverter))] public sealed partial class LatLonGeoLocation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Level.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Level.Converters.g.cs new file mode 100644 index 00000000000..95a9dc4fdf8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Level.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class LevelConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); + private static readonly System.Text.Json.JsonEncodedText MemberIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText MemberShards = System.Text.Json.JsonEncodedText.Encode("shards"); + + public override Elastic.Clients.Elasticsearch.Level Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCluster)) + { + return Elastic.Clients.Elasticsearch.Level.Cluster; + } + + if (reader.ValueTextEquals(MemberIndices)) + { + return Elastic.Clients.Elasticsearch.Level.Indices; + } + + if (reader.ValueTextEquals(MemberShards)) + { + return Elastic.Clients.Elasticsearch.Level.Shards; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCluster.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Level.Cluster; + } + + if (string.Equals(value, MemberIndices.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Level.Indices; + } + + if (string.Equals(value, MemberShards.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Level.Shards; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Level)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Level value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Level.Cluster: + writer.WriteStringValue(MemberCluster); + break; + case Elastic.Clients.Elasticsearch.Level.Indices: + writer.WriteStringValue(MemberIndices); + break; + case Elastic.Clients.Elasticsearch.Level.Shards: + writer.WriteStringValue(MemberShards); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Level)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Level ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Level value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Level.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Level.g.cs new file mode 100644 index 00000000000..0bd3b0d60fb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Level.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.LevelConverter))] +public enum Level +{ + [System.Runtime.Serialization.EnumMember(Value = "cluster")] + Cluster, + [System.Runtime.Serialization.EnumMember(Value = "indices")] + Indices, + [System.Runtime.Serialization.EnumMember(Value = "shards")] + Shards +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/Acknowledgement.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/Acknowledgement.Converters.g.cs new file mode 100644 index 00000000000..a34b1e04f2f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/Acknowledgement.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement.Json; + +public sealed partial class AcknowledgementConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLicense = System.Text.Json.JsonEncodedText.Encode("license"); + private static readonly System.Text.Json.JsonEncodedText PropMessage = System.Text.Json.JsonEncodedText.Encode("message"); + + public override Elastic.Clients.Elasticsearch.LicenseManagement.Acknowledgement Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propLicense = default; + LocalJsonValue propMessage = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLicense.TryReadProperty(ref reader, options, PropLicense, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMessage.TryReadProperty(ref reader, options, PropMessage, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.LicenseManagement.Acknowledgement(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + License = propLicense.Value, + Message = propMessage.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.Acknowledgement value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLicense, value.License, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMessage, value.Message, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/Acknowledgement.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/Acknowledgement.g.cs index fd495341f74..5d6174b7cf1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/Acknowledgement.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/Acknowledgement.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.LicenseManagement; -internal sealed partial class AcknowledgementConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLicense = System.Text.Json.JsonEncodedText.Encode("license"); - private static readonly System.Text.Json.JsonEncodedText PropMessage = System.Text.Json.JsonEncodedText.Encode("message"); - - public override Elastic.Clients.Elasticsearch.LicenseManagement.Acknowledgement Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propLicense = default; - LocalJsonValue propMessage = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLicense.TryReadProperty(ref reader, options, PropLicense, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMessage.TryReadProperty(ref reader, options, PropMessage, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.LicenseManagement.Acknowledgement(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - License = propLicense.Value, - Message = propMessage.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.Acknowledgement value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLicense, value.License, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMessage, value.Message, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.AcknowledgementConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.Json.AcknowledgementConverter))] public sealed partial class Acknowledgement { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/License.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/License.Converters.g.cs new file mode 100644 index 00000000000..a245ec6cbaf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/License.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement.Json; + +public sealed partial class LicenseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExpiryDateInMillis = System.Text.Json.JsonEncodedText.Encode("expiry_date_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropIssueDateInMillis = System.Text.Json.JsonEncodedText.Encode("issue_date_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropIssuedTo = System.Text.Json.JsonEncodedText.Encode("issued_to"); + private static readonly System.Text.Json.JsonEncodedText PropIssuer = System.Text.Json.JsonEncodedText.Encode("issuer"); + private static readonly System.Text.Json.JsonEncodedText PropMaxNodes = System.Text.Json.JsonEncodedText.Encode("max_nodes"); + private static readonly System.Text.Json.JsonEncodedText PropMaxResourceUnits = System.Text.Json.JsonEncodedText.Encode("max_resource_units"); + private static readonly System.Text.Json.JsonEncodedText PropSignature = System.Text.Json.JsonEncodedText.Encode("signature"); + private static readonly System.Text.Json.JsonEncodedText PropStartDateInMillis = System.Text.Json.JsonEncodedText.Encode("start_date_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropUid = System.Text.Json.JsonEncodedText.Encode("uid"); + + public override Elastic.Clients.Elasticsearch.LicenseManagement.License Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExpiryDateInMillis = default; + LocalJsonValue propIssueDateInMillis = default; + LocalJsonValue propIssuedTo = default; + LocalJsonValue propIssuer = default; + LocalJsonValue propMaxNodes = default; + LocalJsonValue propMaxResourceUnits = default; + LocalJsonValue propSignature = default; + LocalJsonValue propStartDateInMillis = default; + LocalJsonValue propType = default; + LocalJsonValue propUid = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExpiryDateInMillis.TryReadProperty(ref reader, options, PropExpiryDateInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propIssueDateInMillis.TryReadProperty(ref reader, options, PropIssueDateInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propIssuedTo.TryReadProperty(ref reader, options, PropIssuedTo, null)) + { + continue; + } + + if (propIssuer.TryReadProperty(ref reader, options, PropIssuer, null)) + { + continue; + } + + if (propMaxNodes.TryReadProperty(ref reader, options, PropMaxNodes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxResourceUnits.TryReadProperty(ref reader, options, PropMaxResourceUnits, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSignature.TryReadProperty(ref reader, options, PropSignature, null)) + { + continue; + } + + if (propStartDateInMillis.TryReadProperty(ref reader, options, PropStartDateInMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (propUid.TryReadProperty(ref reader, options, PropUid, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.LicenseManagement.License(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ExpiryDateInMillis = propExpiryDateInMillis.Value, + IssueDateInMillis = propIssueDateInMillis.Value, + IssuedTo = propIssuedTo.Value, + Issuer = propIssuer.Value, + MaxNodes = propMaxNodes.Value, + MaxResourceUnits = propMaxResourceUnits.Value, + Signature = propSignature.Value, + StartDateInMillis = propStartDateInMillis.Value, + Type = propType.Value, + Uid = propUid.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.License value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExpiryDateInMillis, value.ExpiryDateInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropIssueDateInMillis, value.IssueDateInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropIssuedTo, value.IssuedTo, null, null); + writer.WriteProperty(options, PropIssuer, value.Issuer, null, null); + writer.WriteProperty(options, PropMaxNodes, value.MaxNodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxResourceUnits, value.MaxResourceUnits, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSignature, value.Signature, null, null); + writer.WriteProperty(options, PropStartDateInMillis, value.StartDateInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropUid, value.Uid, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/License.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/License.g.cs index de26596cdb8..e8fc69f8575 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/License.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/License.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.LicenseManagement; -internal sealed partial class LicenseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExpiryDateInMillis = System.Text.Json.JsonEncodedText.Encode("expiry_date_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropIssueDateInMillis = System.Text.Json.JsonEncodedText.Encode("issue_date_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropIssuedTo = System.Text.Json.JsonEncodedText.Encode("issued_to"); - private static readonly System.Text.Json.JsonEncodedText PropIssuer = System.Text.Json.JsonEncodedText.Encode("issuer"); - private static readonly System.Text.Json.JsonEncodedText PropMaxNodes = System.Text.Json.JsonEncodedText.Encode("max_nodes"); - private static readonly System.Text.Json.JsonEncodedText PropMaxResourceUnits = System.Text.Json.JsonEncodedText.Encode("max_resource_units"); - private static readonly System.Text.Json.JsonEncodedText PropSignature = System.Text.Json.JsonEncodedText.Encode("signature"); - private static readonly System.Text.Json.JsonEncodedText PropStartDateInMillis = System.Text.Json.JsonEncodedText.Encode("start_date_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropUid = System.Text.Json.JsonEncodedText.Encode("uid"); - - public override Elastic.Clients.Elasticsearch.LicenseManagement.License Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propExpiryDateInMillis = default; - LocalJsonValue propIssueDateInMillis = default; - LocalJsonValue propIssuedTo = default; - LocalJsonValue propIssuer = default; - LocalJsonValue propMaxNodes = default; - LocalJsonValue propMaxResourceUnits = default; - LocalJsonValue propSignature = default; - LocalJsonValue propStartDateInMillis = default; - LocalJsonValue propType = default; - LocalJsonValue propUid = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExpiryDateInMillis.TryReadProperty(ref reader, options, PropExpiryDateInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propIssueDateInMillis.TryReadProperty(ref reader, options, PropIssueDateInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propIssuedTo.TryReadProperty(ref reader, options, PropIssuedTo, null)) - { - continue; - } - - if (propIssuer.TryReadProperty(ref reader, options, PropIssuer, null)) - { - continue; - } - - if (propMaxNodes.TryReadProperty(ref reader, options, PropMaxNodes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxResourceUnits.TryReadProperty(ref reader, options, PropMaxResourceUnits, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSignature.TryReadProperty(ref reader, options, PropSignature, null)) - { - continue; - } - - if (propStartDateInMillis.TryReadProperty(ref reader, options, PropStartDateInMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (propUid.TryReadProperty(ref reader, options, PropUid, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.LicenseManagement.License(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ExpiryDateInMillis = propExpiryDateInMillis.Value, - IssueDateInMillis = propIssueDateInMillis.Value, - IssuedTo = propIssuedTo.Value, - Issuer = propIssuer.Value, - MaxNodes = propMaxNodes.Value, - MaxResourceUnits = propMaxResourceUnits.Value, - Signature = propSignature.Value, - StartDateInMillis = propStartDateInMillis.Value, - Type = propType.Value, - Uid = propUid.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.License value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExpiryDateInMillis, value.ExpiryDateInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropIssueDateInMillis, value.IssueDateInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropIssuedTo, value.IssuedTo, null, null); - writer.WriteProperty(options, PropIssuer, value.Issuer, null, null); - writer.WriteProperty(options, PropMaxNodes, value.MaxNodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxResourceUnits, value.MaxResourceUnits, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSignature, value.Signature, null, null); - writer.WriteProperty(options, PropStartDateInMillis, value.StartDateInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropUid, value.Uid, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.LicenseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.Json.LicenseConverter))] public sealed partial class License { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseInformation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseInformation.Converters.g.cs new file mode 100644 index 00000000000..a6b61ed52ca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseInformation.Converters.g.cs @@ -0,0 +1,162 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement.Json; + +public sealed partial class LicenseInformationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExpiryDate = System.Text.Json.JsonEncodedText.Encode("expiry_date"); + private static readonly System.Text.Json.JsonEncodedText PropExpiryDateInMillis = System.Text.Json.JsonEncodedText.Encode("expiry_date_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropIssueDate = System.Text.Json.JsonEncodedText.Encode("issue_date"); + private static readonly System.Text.Json.JsonEncodedText PropIssueDateInMillis = System.Text.Json.JsonEncodedText.Encode("issue_date_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropIssuedTo = System.Text.Json.JsonEncodedText.Encode("issued_to"); + private static readonly System.Text.Json.JsonEncodedText PropIssuer = System.Text.Json.JsonEncodedText.Encode("issuer"); + private static readonly System.Text.Json.JsonEncodedText PropMaxNodes = System.Text.Json.JsonEncodedText.Encode("max_nodes"); + private static readonly System.Text.Json.JsonEncodedText PropMaxResourceUnits = System.Text.Json.JsonEncodedText.Encode("max_resource_units"); + private static readonly System.Text.Json.JsonEncodedText PropStartDateInMillis = System.Text.Json.JsonEncodedText.Encode("start_date_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropUid = System.Text.Json.JsonEncodedText.Encode("uid"); + + public override Elastic.Clients.Elasticsearch.LicenseManagement.LicenseInformation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExpiryDate = default; + LocalJsonValue propExpiryDateInMillis = default; + LocalJsonValue propIssueDate = default; + LocalJsonValue propIssueDateInMillis = default; + LocalJsonValue propIssuedTo = default; + LocalJsonValue propIssuer = default; + LocalJsonValue propMaxNodes = default; + LocalJsonValue propMaxResourceUnits = default; + LocalJsonValue propStartDateInMillis = default; + LocalJsonValue propStatus = default; + LocalJsonValue propType = default; + LocalJsonValue propUid = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExpiryDate.TryReadProperty(ref reader, options, PropExpiryDate, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propExpiryDateInMillis.TryReadProperty(ref reader, options, PropExpiryDateInMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propIssueDate.TryReadProperty(ref reader, options, PropIssueDate, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propIssueDateInMillis.TryReadProperty(ref reader, options, PropIssueDateInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propIssuedTo.TryReadProperty(ref reader, options, PropIssuedTo, null)) + { + continue; + } + + if (propIssuer.TryReadProperty(ref reader, options, PropIssuer, null)) + { + continue; + } + + if (propMaxNodes.TryReadProperty(ref reader, options, PropMaxNodes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxResourceUnits.TryReadProperty(ref reader, options, PropMaxResourceUnits, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propStartDateInMillis.TryReadProperty(ref reader, options, PropStartDateInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (propUid.TryReadProperty(ref reader, options, PropUid, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.LicenseManagement.LicenseInformation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ExpiryDate = propExpiryDate.Value, + ExpiryDateInMillis = propExpiryDateInMillis.Value, + IssueDate = propIssueDate.Value, + IssueDateInMillis = propIssueDateInMillis.Value, + IssuedTo = propIssuedTo.Value, + Issuer = propIssuer.Value, + MaxNodes = propMaxNodes.Value, + MaxResourceUnits = propMaxResourceUnits.Value, + StartDateInMillis = propStartDateInMillis.Value, + Status = propStatus.Value, + Type = propType.Value, + Uid = propUid.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.LicenseInformation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExpiryDate, value.ExpiryDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropExpiryDateInMillis, value.ExpiryDateInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropIssueDate, value.IssueDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropIssueDateInMillis, value.IssueDateInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropIssuedTo, value.IssuedTo, null, null); + writer.WriteProperty(options, PropIssuer, value.Issuer, null, null); + writer.WriteProperty(options, PropMaxNodes, value.MaxNodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxResourceUnits, value.MaxResourceUnits, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropStartDateInMillis, value.StartDateInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropUid, value.Uid, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseInformation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseInformation.g.cs index f0a511d44be..844c46f1c58 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseInformation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseInformation.g.cs @@ -23,145 +23,7 @@ namespace Elastic.Clients.Elasticsearch.LicenseManagement; -internal sealed partial class LicenseInformationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExpiryDate = System.Text.Json.JsonEncodedText.Encode("expiry_date"); - private static readonly System.Text.Json.JsonEncodedText PropExpiryDateInMillis = System.Text.Json.JsonEncodedText.Encode("expiry_date_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropIssueDate = System.Text.Json.JsonEncodedText.Encode("issue_date"); - private static readonly System.Text.Json.JsonEncodedText PropIssueDateInMillis = System.Text.Json.JsonEncodedText.Encode("issue_date_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropIssuedTo = System.Text.Json.JsonEncodedText.Encode("issued_to"); - private static readonly System.Text.Json.JsonEncodedText PropIssuer = System.Text.Json.JsonEncodedText.Encode("issuer"); - private static readonly System.Text.Json.JsonEncodedText PropMaxNodes = System.Text.Json.JsonEncodedText.Encode("max_nodes"); - private static readonly System.Text.Json.JsonEncodedText PropMaxResourceUnits = System.Text.Json.JsonEncodedText.Encode("max_resource_units"); - private static readonly System.Text.Json.JsonEncodedText PropStartDateInMillis = System.Text.Json.JsonEncodedText.Encode("start_date_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropUid = System.Text.Json.JsonEncodedText.Encode("uid"); - - public override Elastic.Clients.Elasticsearch.LicenseManagement.LicenseInformation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propExpiryDate = default; - LocalJsonValue propExpiryDateInMillis = default; - LocalJsonValue propIssueDate = default; - LocalJsonValue propIssueDateInMillis = default; - LocalJsonValue propIssuedTo = default; - LocalJsonValue propIssuer = default; - LocalJsonValue propMaxNodes = default; - LocalJsonValue propMaxResourceUnits = default; - LocalJsonValue propStartDateInMillis = default; - LocalJsonValue propStatus = default; - LocalJsonValue propType = default; - LocalJsonValue propUid = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExpiryDate.TryReadProperty(ref reader, options, PropExpiryDate, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propExpiryDateInMillis.TryReadProperty(ref reader, options, PropExpiryDateInMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propIssueDate.TryReadProperty(ref reader, options, PropIssueDate, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propIssueDateInMillis.TryReadProperty(ref reader, options, PropIssueDateInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propIssuedTo.TryReadProperty(ref reader, options, PropIssuedTo, null)) - { - continue; - } - - if (propIssuer.TryReadProperty(ref reader, options, PropIssuer, null)) - { - continue; - } - - if (propMaxNodes.TryReadProperty(ref reader, options, PropMaxNodes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxResourceUnits.TryReadProperty(ref reader, options, PropMaxResourceUnits, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propStartDateInMillis.TryReadProperty(ref reader, options, PropStartDateInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (propUid.TryReadProperty(ref reader, options, PropUid, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.LicenseManagement.LicenseInformation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ExpiryDate = propExpiryDate.Value, - ExpiryDateInMillis = propExpiryDateInMillis.Value, - IssueDate = propIssueDate.Value, - IssueDateInMillis = propIssueDateInMillis.Value, - IssuedTo = propIssuedTo.Value, - Issuer = propIssuer.Value, - MaxNodes = propMaxNodes.Value, - MaxResourceUnits = propMaxResourceUnits.Value, - StartDateInMillis = propStartDateInMillis.Value, - Status = propStatus.Value, - Type = propType.Value, - Uid = propUid.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.LicenseInformation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExpiryDate, value.ExpiryDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropExpiryDateInMillis, value.ExpiryDateInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropIssueDate, value.IssueDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropIssueDateInMillis, value.IssueDateInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropIssuedTo, value.IssuedTo, null, null); - writer.WriteProperty(options, PropIssuer, value.Issuer, null, null); - writer.WriteProperty(options, PropMaxNodes, value.MaxNodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxResourceUnits, value.MaxResourceUnits, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropStartDateInMillis, value.StartDateInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropUid, value.Uid, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.LicenseInformationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.Json.LicenseInformationConverter))] public sealed partial class LicenseInformation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseStatus.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseStatus.Converters.g.cs new file mode 100644 index 00000000000..8ea46b79c60 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseStatus.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement.Json; + +public sealed partial class LicenseStatusConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberActive = System.Text.Json.JsonEncodedText.Encode("active"); + private static readonly System.Text.Json.JsonEncodedText MemberExpired = System.Text.Json.JsonEncodedText.Encode("expired"); + private static readonly System.Text.Json.JsonEncodedText MemberInvalid = System.Text.Json.JsonEncodedText.Encode("invalid"); + private static readonly System.Text.Json.JsonEncodedText MemberValid = System.Text.Json.JsonEncodedText.Encode("valid"); + + public override Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberActive)) + { + return Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus.Active; + } + + if (reader.ValueTextEquals(MemberExpired)) + { + return Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus.Expired; + } + + if (reader.ValueTextEquals(MemberInvalid)) + { + return Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus.Invalid; + } + + if (reader.ValueTextEquals(MemberValid)) + { + return Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus.Valid; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberActive.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus.Active; + } + + if (string.Equals(value, MemberExpired.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus.Expired; + } + + if (string.Equals(value, MemberInvalid.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus.Invalid; + } + + if (string.Equals(value, MemberValid.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus.Valid; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus.Active: + writer.WriteStringValue(MemberActive); + break; + case Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus.Expired: + writer.WriteStringValue(MemberExpired); + break; + case Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus.Invalid: + writer.WriteStringValue(MemberInvalid); + break; + case Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus.Valid: + writer.WriteStringValue(MemberValid); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseStatus.g.cs new file mode 100644 index 00000000000..e99abd72a4a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseStatus.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.Json.LicenseStatusConverter))] +public enum LicenseStatus +{ + [System.Runtime.Serialization.EnumMember(Value = "active")] + Active, + [System.Runtime.Serialization.EnumMember(Value = "expired")] + Expired, + [System.Runtime.Serialization.EnumMember(Value = "invalid")] + Invalid, + [System.Runtime.Serialization.EnumMember(Value = "valid")] + Valid +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.LicenseManagement.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseType.Converters.g.cs similarity index 59% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.LicenseManagement.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseType.Converters.g.cs index da6403296a0..64a5efd49dd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.LicenseManagement.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseType.Converters.g.cs @@ -21,94 +21,9 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.LicenseManagement; +namespace Elastic.Clients.Elasticsearch.LicenseManagement.Json; -internal sealed partial class LicenseStatusConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberActive = System.Text.Json.JsonEncodedText.Encode("active"); - private static readonly System.Text.Json.JsonEncodedText MemberExpired = System.Text.Json.JsonEncodedText.Encode("expired"); - private static readonly System.Text.Json.JsonEncodedText MemberInvalid = System.Text.Json.JsonEncodedText.Encode("invalid"); - private static readonly System.Text.Json.JsonEncodedText MemberValid = System.Text.Json.JsonEncodedText.Encode("valid"); - - public override Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberActive)) - { - return Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus.Active; - } - - if (reader.ValueTextEquals(MemberExpired)) - { - return Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus.Expired; - } - - if (reader.ValueTextEquals(MemberInvalid)) - { - return Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus.Invalid; - } - - if (reader.ValueTextEquals(MemberValid)) - { - return Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus.Valid; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberActive.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus.Active; - } - - if (string.Equals(value, MemberExpired.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus.Expired; - } - - if (string.Equals(value, MemberInvalid.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus.Invalid; - } - - if (string.Equals(value, MemberValid.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus.Valid; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus.Active: - writer.WriteStringValue(MemberActive); - break; - case Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus.Expired: - writer.WriteStringValue(MemberExpired); - break; - case Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus.Invalid: - writer.WriteStringValue(MemberInvalid); - break; - case Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus.Valid: - writer.WriteStringValue(MemberValid); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class LicenseTypeConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class LicenseTypeConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText MemberBasic = System.Text.Json.JsonEncodedText.Encode("basic"); private static readonly System.Text.Json.JsonEncodedText MemberDev = System.Text.Json.JsonEncodedText.Encode("dev"); @@ -261,40 +176,4 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, { Write(writer, value, options); } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatusConverter))] -public enum LicenseStatus -{ - [System.Runtime.Serialization.EnumMember(Value = "active")] - Active, - [System.Runtime.Serialization.EnumMember(Value = "expired")] - Expired, - [System.Runtime.Serialization.EnumMember(Value = "invalid")] - Invalid, - [System.Runtime.Serialization.EnumMember(Value = "valid")] - Valid -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.LicenseTypeConverter))] -public enum LicenseType -{ - [System.Runtime.Serialization.EnumMember(Value = "basic")] - Basic, - [System.Runtime.Serialization.EnumMember(Value = "dev")] - Dev, - [System.Runtime.Serialization.EnumMember(Value = "enterprise")] - Enterprise, - [System.Runtime.Serialization.EnumMember(Value = "gold")] - Gold, - [System.Runtime.Serialization.EnumMember(Value = "missing")] - Missing, - [System.Runtime.Serialization.EnumMember(Value = "platinum")] - Platinum, - [System.Runtime.Serialization.EnumMember(Value = "silver")] - Silver, - [System.Runtime.Serialization.EnumMember(Value = "standard")] - Standard, - [System.Runtime.Serialization.EnumMember(Value = "trial")] - Trial } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseType.g.cs new file mode 100644 index 00000000000..bc4243fe791 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseType.g.cs @@ -0,0 +1,47 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.LicenseManagement; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LicenseManagement.Json.LicenseTypeConverter))] +public enum LicenseType +{ + [System.Runtime.Serialization.EnumMember(Value = "basic")] + Basic, + [System.Runtime.Serialization.EnumMember(Value = "dev")] + Dev, + [System.Runtime.Serialization.EnumMember(Value = "enterprise")] + Enterprise, + [System.Runtime.Serialization.EnumMember(Value = "gold")] + Gold, + [System.Runtime.Serialization.EnumMember(Value = "missing")] + Missing, + [System.Runtime.Serialization.EnumMember(Value = "platinum")] + Platinum, + [System.Runtime.Serialization.EnumMember(Value = "silver")] + Silver, + [System.Runtime.Serialization.EnumMember(Value = "standard")] + Standard, + [System.Runtime.Serialization.EnumMember(Value = "trial")] + Trial +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/LifecycleOperationMode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LifecycleOperationMode.Converters.g.cs new file mode 100644 index 00000000000..44e4e0d990a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LifecycleOperationMode.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class LifecycleOperationModeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberRunning = System.Text.Json.JsonEncodedText.Encode("RUNNING"); + private static readonly System.Text.Json.JsonEncodedText MemberStopped = System.Text.Json.JsonEncodedText.Encode("STOPPED"); + private static readonly System.Text.Json.JsonEncodedText MemberStopping = System.Text.Json.JsonEncodedText.Encode("STOPPING"); + + public override Elastic.Clients.Elasticsearch.LifecycleOperationMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberRunning)) + { + return Elastic.Clients.Elasticsearch.LifecycleOperationMode.Running; + } + + if (reader.ValueTextEquals(MemberStopped)) + { + return Elastic.Clients.Elasticsearch.LifecycleOperationMode.Stopped; + } + + if (reader.ValueTextEquals(MemberStopping)) + { + return Elastic.Clients.Elasticsearch.LifecycleOperationMode.Stopping; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberRunning.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.LifecycleOperationMode.Running; + } + + if (string.Equals(value, MemberStopped.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.LifecycleOperationMode.Stopped; + } + + if (string.Equals(value, MemberStopping.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.LifecycleOperationMode.Stopping; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.LifecycleOperationMode)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LifecycleOperationMode value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.LifecycleOperationMode.Running: + writer.WriteStringValue(MemberRunning); + break; + case Elastic.Clients.Elasticsearch.LifecycleOperationMode.Stopped: + writer.WriteStringValue(MemberStopped); + break; + case Elastic.Clients.Elasticsearch.LifecycleOperationMode.Stopping: + writer.WriteStringValue(MemberStopping); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.LifecycleOperationMode)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.LifecycleOperationMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LifecycleOperationMode value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/LifecycleOperationMode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LifecycleOperationMode.g.cs new file mode 100644 index 00000000000..a66dfbf74d3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LifecycleOperationMode.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.LifecycleOperationModeConverter))] +public enum LifecycleOperationMode +{ + [System.Runtime.Serialization.EnumMember(Value = "RUNNING")] + Running, + [System.Runtime.Serialization.EnumMember(Value = "STOPPED")] + Stopped, + [System.Runtime.Serialization.EnumMember(Value = "STOPPING")] + Stopping +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/LinearRetriever.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LinearRetriever.Converters.g.cs new file mode 100644 index 00000000000..f513e20949b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LinearRetriever.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class LinearRetrieverConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropMinScore = System.Text.Json.JsonEncodedText.Encode("min_score"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropNormalizer = System.Text.Json.JsonEncodedText.Encode("normalizer"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropRankWindowSize = System.Text.Json.JsonEncodedText.Encode("rank_window_size"); + private static readonly System.Text.Json.JsonEncodedText PropRetrievers = System.Text.Json.JsonEncodedText.Encode("retrievers"); + + public override Elastic.Clients.Elasticsearch.LinearRetriever Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propFields = default; + LocalJsonValue?> propFilter = default; + LocalJsonValue propMinScore = default; + LocalJsonValue propName = default; + LocalJsonValue propNormalizer = default; + LocalJsonValue propQuery = default; + LocalJsonValue propRankWindowSize = default; + LocalJsonValue?> propRetrievers = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propNormalizer.TryReadProperty(ref reader, options, PropNormalizer, static Elastic.Clients.Elasticsearch.ScoreNormalizer? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propRankWindowSize.TryReadProperty(ref reader, options, PropRankWindowSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRetrievers.TryReadProperty(ref reader, options, PropRetrievers, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.LinearRetriever(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Fields = propFields.Value, + Filter = propFilter.Value, + MinScore = propMinScore.Value, + Name = propName.Value, + Normalizer = propNormalizer.Value, + Query = propQuery.Value, + RankWindowSize = propRankWindowSize.Value, + Retrievers = propRetrievers.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LinearRetriever value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropNormalizer, value.Normalizer, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.ScoreNormalizer? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropRankWindowSize, value.RankWindowSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRetrievers, value.Retrievers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/LinearRetriever.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LinearRetriever.g.cs index f993e4a875b..5e166275d42 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/LinearRetriever.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LinearRetriever.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class LinearRetrieverConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropMinScore = System.Text.Json.JsonEncodedText.Encode("min_score"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropNormalizer = System.Text.Json.JsonEncodedText.Encode("normalizer"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropRankWindowSize = System.Text.Json.JsonEncodedText.Encode("rank_window_size"); - private static readonly System.Text.Json.JsonEncodedText PropRetrievers = System.Text.Json.JsonEncodedText.Encode("retrievers"); - - public override Elastic.Clients.Elasticsearch.LinearRetriever Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propFields = default; - LocalJsonValue?> propFilter = default; - LocalJsonValue propMinScore = default; - LocalJsonValue propName = default; - LocalJsonValue propNormalizer = default; - LocalJsonValue propQuery = default; - LocalJsonValue propRankWindowSize = default; - LocalJsonValue?> propRetrievers = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propNormalizer.TryReadProperty(ref reader, options, PropNormalizer, static Elastic.Clients.Elasticsearch.ScoreNormalizer? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propRankWindowSize.TryReadProperty(ref reader, options, PropRankWindowSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRetrievers.TryReadProperty(ref reader, options, PropRetrievers, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.LinearRetriever(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Fields = propFields.Value, - Filter = propFilter.Value, - MinScore = propMinScore.Value, - Name = propName.Value, - Normalizer = propNormalizer.Value, - Query = propQuery.Value, - RankWindowSize = propRankWindowSize.Value, - Retrievers = propRetrievers.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.LinearRetriever value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropNormalizer, value.Normalizer, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.ScoreNormalizer? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropRankWindowSize, value.RankWindowSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRetrievers, value.Retrievers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.LinearRetrieverConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.LinearRetrieverConverter))] public sealed partial class LinearRetriever { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AdaptiveAllocationsSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AdaptiveAllocationsSettings.Converters.g.cs new file mode 100644 index 00000000000..f9569a4e847 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AdaptiveAllocationsSettings.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class AdaptiveAllocationsSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropMaxNumberOfAllocations = System.Text.Json.JsonEncodedText.Encode("max_number_of_allocations"); + private static readonly System.Text.Json.JsonEncodedText PropMinNumberOfAllocations = System.Text.Json.JsonEncodedText.Encode("min_number_of_allocations"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.AdaptiveAllocationsSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEnabled = default; + LocalJsonValue propMaxNumberOfAllocations = default; + LocalJsonValue propMinNumberOfAllocations = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propMaxNumberOfAllocations.TryReadProperty(ref reader, options, PropMaxNumberOfAllocations, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinNumberOfAllocations.TryReadProperty(ref reader, options, PropMinNumberOfAllocations, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.AdaptiveAllocationsSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Enabled = propEnabled.Value, + MaxNumberOfAllocations = propMaxNumberOfAllocations.Value, + MinNumberOfAllocations = propMinNumberOfAllocations.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.AdaptiveAllocationsSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropMaxNumberOfAllocations, value.MaxNumberOfAllocations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinNumberOfAllocations, value.MinNumberOfAllocations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AdaptiveAllocationsSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AdaptiveAllocationsSettings.g.cs index e869ddcca30..da669e7ac5f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AdaptiveAllocationsSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AdaptiveAllocationsSettings.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class AdaptiveAllocationsSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropMaxNumberOfAllocations = System.Text.Json.JsonEncodedText.Encode("max_number_of_allocations"); - private static readonly System.Text.Json.JsonEncodedText PropMinNumberOfAllocations = System.Text.Json.JsonEncodedText.Encode("min_number_of_allocations"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.AdaptiveAllocationsSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEnabled = default; - LocalJsonValue propMaxNumberOfAllocations = default; - LocalJsonValue propMinNumberOfAllocations = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propMaxNumberOfAllocations.TryReadProperty(ref reader, options, PropMaxNumberOfAllocations, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinNumberOfAllocations.TryReadProperty(ref reader, options, PropMinNumberOfAllocations, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.AdaptiveAllocationsSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Enabled = propEnabled.Value, - MaxNumberOfAllocations = propMaxNumberOfAllocations.Value, - MinNumberOfAllocations = propMinNumberOfAllocations.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.AdaptiveAllocationsSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropMaxNumberOfAllocations, value.MaxNumberOfAllocations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinNumberOfAllocations, value.MinNumberOfAllocations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.AdaptiveAllocationsSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.AdaptiveAllocationsSettingsConverter))] public sealed partial class AdaptiveAllocationsSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AggregateOutput.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AggregateOutput.Converters.g.cs new file mode 100644 index 00000000000..5398aa39836 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AggregateOutput.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class AggregateOutputConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExponent = System.Text.Json.JsonEncodedText.Encode("exponent"); + private static readonly System.Text.Json.JsonEncodedText PropLogisticRegression = System.Text.Json.JsonEncodedText.Encode("logistic_regression"); + private static readonly System.Text.Json.JsonEncodedText PropWeightedMode = System.Text.Json.JsonEncodedText.Encode("weighted_mode"); + private static readonly System.Text.Json.JsonEncodedText PropWeightedSum = System.Text.Json.JsonEncodedText.Encode("weighted_sum"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.AggregateOutput Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExponent = default; + LocalJsonValue propLogisticRegression = default; + LocalJsonValue propWeightedMode = default; + LocalJsonValue propWeightedSum = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExponent.TryReadProperty(ref reader, options, PropExponent, null)) + { + continue; + } + + if (propLogisticRegression.TryReadProperty(ref reader, options, PropLogisticRegression, null)) + { + continue; + } + + if (propWeightedMode.TryReadProperty(ref reader, options, PropWeightedMode, null)) + { + continue; + } + + if (propWeightedSum.TryReadProperty(ref reader, options, PropWeightedSum, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.AggregateOutput(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Exponent = propExponent.Value, + LogisticRegression = propLogisticRegression.Value, + WeightedMode = propWeightedMode.Value, + WeightedSum = propWeightedSum.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.AggregateOutput value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExponent, value.Exponent, null, null); + writer.WriteProperty(options, PropLogisticRegression, value.LogisticRegression, null, null); + writer.WriteProperty(options, PropWeightedMode, value.WeightedMode, null, null); + writer.WriteProperty(options, PropWeightedSum, value.WeightedSum, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AggregateOutput.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AggregateOutput.g.cs index 278798e5d19..9095188663a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AggregateOutput.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AggregateOutput.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class AggregateOutputConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExponent = System.Text.Json.JsonEncodedText.Encode("exponent"); - private static readonly System.Text.Json.JsonEncodedText PropLogisticRegression = System.Text.Json.JsonEncodedText.Encode("logistic_regression"); - private static readonly System.Text.Json.JsonEncodedText PropWeightedMode = System.Text.Json.JsonEncodedText.Encode("weighted_mode"); - private static readonly System.Text.Json.JsonEncodedText PropWeightedSum = System.Text.Json.JsonEncodedText.Encode("weighted_sum"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.AggregateOutput Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propExponent = default; - LocalJsonValue propLogisticRegression = default; - LocalJsonValue propWeightedMode = default; - LocalJsonValue propWeightedSum = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExponent.TryReadProperty(ref reader, options, PropExponent, null)) - { - continue; - } - - if (propLogisticRegression.TryReadProperty(ref reader, options, PropLogisticRegression, null)) - { - continue; - } - - if (propWeightedMode.TryReadProperty(ref reader, options, PropWeightedMode, null)) - { - continue; - } - - if (propWeightedSum.TryReadProperty(ref reader, options, PropWeightedSum, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.AggregateOutput(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Exponent = propExponent.Value, - LogisticRegression = propLogisticRegression.Value, - WeightedMode = propWeightedMode.Value, - WeightedSum = propWeightedSum.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.AggregateOutput value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExponent, value.Exponent, null, null); - writer.WriteProperty(options, PropLogisticRegression, value.LogisticRegression, null, null); - writer.WriteProperty(options, PropWeightedMode, value.WeightedMode, null, null); - writer.WriteProperty(options, PropWeightedSum, value.WeightedSum, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.AggregateOutputConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.AggregateOutputConverter))] public sealed partial class AggregateOutput { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisConfig.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisConfig.Converters.g.cs new file mode 100644 index 00000000000..385ad4a26bf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisConfig.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class AnalysisConfigConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucketSpan = System.Text.Json.JsonEncodedText.Encode("bucket_span"); + private static readonly System.Text.Json.JsonEncodedText PropCategorizationAnalyzer = System.Text.Json.JsonEncodedText.Encode("categorization_analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropCategorizationFieldName = System.Text.Json.JsonEncodedText.Encode("categorization_field_name"); + private static readonly System.Text.Json.JsonEncodedText PropCategorizationFilters = System.Text.Json.JsonEncodedText.Encode("categorization_filters"); + private static readonly System.Text.Json.JsonEncodedText PropDetectors = System.Text.Json.JsonEncodedText.Encode("detectors"); + private static readonly System.Text.Json.JsonEncodedText PropInfluencers = System.Text.Json.JsonEncodedText.Encode("influencers"); + private static readonly System.Text.Json.JsonEncodedText PropLatency = System.Text.Json.JsonEncodedText.Encode("latency"); + private static readonly System.Text.Json.JsonEncodedText PropModelPruneWindow = System.Text.Json.JsonEncodedText.Encode("model_prune_window"); + private static readonly System.Text.Json.JsonEncodedText PropMultivariateByFields = System.Text.Json.JsonEncodedText.Encode("multivariate_by_fields"); + private static readonly System.Text.Json.JsonEncodedText PropPerPartitionCategorization = System.Text.Json.JsonEncodedText.Encode("per_partition_categorization"); + private static readonly System.Text.Json.JsonEncodedText PropSummaryCountFieldName = System.Text.Json.JsonEncodedText.Encode("summary_count_field_name"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucketSpan = default; + LocalJsonValue propCategorizationAnalyzer = default; + LocalJsonValue propCategorizationFieldName = default; + LocalJsonValue?> propCategorizationFilters = default; + LocalJsonValue> propDetectors = default; + LocalJsonValue propInfluencers = default; + LocalJsonValue propLatency = default; + LocalJsonValue propModelPruneWindow = default; + LocalJsonValue propMultivariateByFields = default; + LocalJsonValue propPerPartitionCategorization = default; + LocalJsonValue propSummaryCountFieldName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucketSpan.TryReadProperty(ref reader, options, PropBucketSpan, null)) + { + continue; + } + + if (propCategorizationAnalyzer.TryReadProperty(ref reader, options, PropCategorizationAnalyzer, null)) + { + continue; + } + + if (propCategorizationFieldName.TryReadProperty(ref reader, options, PropCategorizationFieldName, null)) + { + continue; + } + + if (propCategorizationFilters.TryReadProperty(ref reader, options, PropCategorizationFilters, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propDetectors.TryReadProperty(ref reader, options, PropDetectors, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propInfluencers.TryReadProperty(ref reader, options, PropInfluencers, null)) + { + continue; + } + + if (propLatency.TryReadProperty(ref reader, options, PropLatency, null)) + { + continue; + } + + if (propModelPruneWindow.TryReadProperty(ref reader, options, PropModelPruneWindow, null)) + { + continue; + } + + if (propMultivariateByFields.TryReadProperty(ref reader, options, PropMultivariateByFields, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPerPartitionCategorization.TryReadProperty(ref reader, options, PropPerPartitionCategorization, null)) + { + continue; + } + + if (propSummaryCountFieldName.TryReadProperty(ref reader, options, PropSummaryCountFieldName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BucketSpan = propBucketSpan.Value, + CategorizationAnalyzer = propCategorizationAnalyzer.Value, + CategorizationFieldName = propCategorizationFieldName.Value, + CategorizationFilters = propCategorizationFilters.Value, + Detectors = propDetectors.Value, + Influencers = propInfluencers.Value, + Latency = propLatency.Value, + ModelPruneWindow = propModelPruneWindow.Value, + MultivariateByFields = propMultivariateByFields.Value, + PerPartitionCategorization = propPerPartitionCategorization.Value, + SummaryCountFieldName = propSummaryCountFieldName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfig value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucketSpan, value.BucketSpan, null, null); + writer.WriteProperty(options, PropCategorizationAnalyzer, value.CategorizationAnalyzer, null, null); + writer.WriteProperty(options, PropCategorizationFieldName, value.CategorizationFieldName, null, null); + writer.WriteProperty(options, PropCategorizationFilters, value.CategorizationFilters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDetectors, value.Detectors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropInfluencers, value.Influencers, null, null); + writer.WriteProperty(options, PropLatency, value.Latency, null, null); + writer.WriteProperty(options, PropModelPruneWindow, value.ModelPruneWindow, null, null); + writer.WriteProperty(options, PropMultivariateByFields, value.MultivariateByFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPerPartitionCategorization, value.PerPartitionCategorization, null, null); + writer.WriteProperty(options, PropSummaryCountFieldName, value.SummaryCountFieldName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisConfig.g.cs index 3a01ed0721b..e728c26caad 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisConfig.g.cs @@ -23,136 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class AnalysisConfigConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBucketSpan = System.Text.Json.JsonEncodedText.Encode("bucket_span"); - private static readonly System.Text.Json.JsonEncodedText PropCategorizationAnalyzer = System.Text.Json.JsonEncodedText.Encode("categorization_analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropCategorizationFieldName = System.Text.Json.JsonEncodedText.Encode("categorization_field_name"); - private static readonly System.Text.Json.JsonEncodedText PropCategorizationFilters = System.Text.Json.JsonEncodedText.Encode("categorization_filters"); - private static readonly System.Text.Json.JsonEncodedText PropDetectors = System.Text.Json.JsonEncodedText.Encode("detectors"); - private static readonly System.Text.Json.JsonEncodedText PropInfluencers = System.Text.Json.JsonEncodedText.Encode("influencers"); - private static readonly System.Text.Json.JsonEncodedText PropLatency = System.Text.Json.JsonEncodedText.Encode("latency"); - private static readonly System.Text.Json.JsonEncodedText PropModelPruneWindow = System.Text.Json.JsonEncodedText.Encode("model_prune_window"); - private static readonly System.Text.Json.JsonEncodedText PropMultivariateByFields = System.Text.Json.JsonEncodedText.Encode("multivariate_by_fields"); - private static readonly System.Text.Json.JsonEncodedText PropPerPartitionCategorization = System.Text.Json.JsonEncodedText.Encode("per_partition_categorization"); - private static readonly System.Text.Json.JsonEncodedText PropSummaryCountFieldName = System.Text.Json.JsonEncodedText.Encode("summary_count_field_name"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBucketSpan = default; - LocalJsonValue propCategorizationAnalyzer = default; - LocalJsonValue propCategorizationFieldName = default; - LocalJsonValue?> propCategorizationFilters = default; - LocalJsonValue> propDetectors = default; - LocalJsonValue propInfluencers = default; - LocalJsonValue propLatency = default; - LocalJsonValue propModelPruneWindow = default; - LocalJsonValue propMultivariateByFields = default; - LocalJsonValue propPerPartitionCategorization = default; - LocalJsonValue propSummaryCountFieldName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBucketSpan.TryReadProperty(ref reader, options, PropBucketSpan, null)) - { - continue; - } - - if (propCategorizationAnalyzer.TryReadProperty(ref reader, options, PropCategorizationAnalyzer, null)) - { - continue; - } - - if (propCategorizationFieldName.TryReadProperty(ref reader, options, PropCategorizationFieldName, null)) - { - continue; - } - - if (propCategorizationFilters.TryReadProperty(ref reader, options, PropCategorizationFilters, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propDetectors.TryReadProperty(ref reader, options, PropDetectors, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propInfluencers.TryReadProperty(ref reader, options, PropInfluencers, null)) - { - continue; - } - - if (propLatency.TryReadProperty(ref reader, options, PropLatency, null)) - { - continue; - } - - if (propModelPruneWindow.TryReadProperty(ref reader, options, PropModelPruneWindow, null)) - { - continue; - } - - if (propMultivariateByFields.TryReadProperty(ref reader, options, PropMultivariateByFields, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPerPartitionCategorization.TryReadProperty(ref reader, options, PropPerPartitionCategorization, null)) - { - continue; - } - - if (propSummaryCountFieldName.TryReadProperty(ref reader, options, PropSummaryCountFieldName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BucketSpan = propBucketSpan.Value, - CategorizationAnalyzer = propCategorizationAnalyzer.Value, - CategorizationFieldName = propCategorizationFieldName.Value, - CategorizationFilters = propCategorizationFilters.Value, - Detectors = propDetectors.Value, - Influencers = propInfluencers.Value, - Latency = propLatency.Value, - ModelPruneWindow = propModelPruneWindow.Value, - MultivariateByFields = propMultivariateByFields.Value, - PerPartitionCategorization = propPerPartitionCategorization.Value, - SummaryCountFieldName = propSummaryCountFieldName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfig value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBucketSpan, value.BucketSpan, null, null); - writer.WriteProperty(options, PropCategorizationAnalyzer, value.CategorizationAnalyzer, null, null); - writer.WriteProperty(options, PropCategorizationFieldName, value.CategorizationFieldName, null, null); - writer.WriteProperty(options, PropCategorizationFilters, value.CategorizationFilters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDetectors, value.Detectors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropInfluencers, value.Influencers, null, null); - writer.WriteProperty(options, PropLatency, value.Latency, null, null); - writer.WriteProperty(options, PropModelPruneWindow, value.ModelPruneWindow, null, null); - writer.WriteProperty(options, PropMultivariateByFields, value.MultivariateByFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPerPartitionCategorization, value.PerPartitionCategorization, null, null); - writer.WriteProperty(options, PropSummaryCountFieldName, value.SummaryCountFieldName, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.AnalysisConfigConverter))] public sealed partial class AnalysisConfig { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisConfigRead.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisConfigRead.Converters.g.cs new file mode 100644 index 00000000000..720b10720ea --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisConfigRead.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class AnalysisConfigReadConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucketSpan = System.Text.Json.JsonEncodedText.Encode("bucket_span"); + private static readonly System.Text.Json.JsonEncodedText PropCategorizationAnalyzer = System.Text.Json.JsonEncodedText.Encode("categorization_analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropCategorizationFieldName = System.Text.Json.JsonEncodedText.Encode("categorization_field_name"); + private static readonly System.Text.Json.JsonEncodedText PropCategorizationFilters = System.Text.Json.JsonEncodedText.Encode("categorization_filters"); + private static readonly System.Text.Json.JsonEncodedText PropDetectors = System.Text.Json.JsonEncodedText.Encode("detectors"); + private static readonly System.Text.Json.JsonEncodedText PropInfluencers = System.Text.Json.JsonEncodedText.Encode("influencers"); + private static readonly System.Text.Json.JsonEncodedText PropLatency = System.Text.Json.JsonEncodedText.Encode("latency"); + private static readonly System.Text.Json.JsonEncodedText PropModelPruneWindow = System.Text.Json.JsonEncodedText.Encode("model_prune_window"); + private static readonly System.Text.Json.JsonEncodedText PropMultivariateByFields = System.Text.Json.JsonEncodedText.Encode("multivariate_by_fields"); + private static readonly System.Text.Json.JsonEncodedText PropPerPartitionCategorization = System.Text.Json.JsonEncodedText.Encode("per_partition_categorization"); + private static readonly System.Text.Json.JsonEncodedText PropSummaryCountFieldName = System.Text.Json.JsonEncodedText.Encode("summary_count_field_name"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigRead Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucketSpan = default; + LocalJsonValue propCategorizationAnalyzer = default; + LocalJsonValue propCategorizationFieldName = default; + LocalJsonValue?> propCategorizationFilters = default; + LocalJsonValue> propDetectors = default; + LocalJsonValue propInfluencers = default; + LocalJsonValue propLatency = default; + LocalJsonValue propModelPruneWindow = default; + LocalJsonValue propMultivariateByFields = default; + LocalJsonValue propPerPartitionCategorization = default; + LocalJsonValue propSummaryCountFieldName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucketSpan.TryReadProperty(ref reader, options, PropBucketSpan, null)) + { + continue; + } + + if (propCategorizationAnalyzer.TryReadProperty(ref reader, options, PropCategorizationAnalyzer, null)) + { + continue; + } + + if (propCategorizationFieldName.TryReadProperty(ref reader, options, PropCategorizationFieldName, null)) + { + continue; + } + + if (propCategorizationFilters.TryReadProperty(ref reader, options, PropCategorizationFilters, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propDetectors.TryReadProperty(ref reader, options, PropDetectors, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propInfluencers.TryReadProperty(ref reader, options, PropInfluencers, null)) + { + continue; + } + + if (propLatency.TryReadProperty(ref reader, options, PropLatency, null)) + { + continue; + } + + if (propModelPruneWindow.TryReadProperty(ref reader, options, PropModelPruneWindow, null)) + { + continue; + } + + if (propMultivariateByFields.TryReadProperty(ref reader, options, PropMultivariateByFields, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPerPartitionCategorization.TryReadProperty(ref reader, options, PropPerPartitionCategorization, null)) + { + continue; + } + + if (propSummaryCountFieldName.TryReadProperty(ref reader, options, PropSummaryCountFieldName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigRead(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BucketSpan = propBucketSpan.Value, + CategorizationAnalyzer = propCategorizationAnalyzer.Value, + CategorizationFieldName = propCategorizationFieldName.Value, + CategorizationFilters = propCategorizationFilters.Value, + Detectors = propDetectors.Value, + Influencers = propInfluencers.Value, + Latency = propLatency.Value, + ModelPruneWindow = propModelPruneWindow.Value, + MultivariateByFields = propMultivariateByFields.Value, + PerPartitionCategorization = propPerPartitionCategorization.Value, + SummaryCountFieldName = propSummaryCountFieldName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigRead value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucketSpan, value.BucketSpan, null, null); + writer.WriteProperty(options, PropCategorizationAnalyzer, value.CategorizationAnalyzer, null, null); + writer.WriteProperty(options, PropCategorizationFieldName, value.CategorizationFieldName, null, null); + writer.WriteProperty(options, PropCategorizationFilters, value.CategorizationFilters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDetectors, value.Detectors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropInfluencers, value.Influencers, null, null); + writer.WriteProperty(options, PropLatency, value.Latency, null, null); + writer.WriteProperty(options, PropModelPruneWindow, value.ModelPruneWindow, null, null); + writer.WriteProperty(options, PropMultivariateByFields, value.MultivariateByFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPerPartitionCategorization, value.PerPartitionCategorization, null, null); + writer.WriteProperty(options, PropSummaryCountFieldName, value.SummaryCountFieldName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisConfigRead.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisConfigRead.g.cs index 275d6ee826e..6f97fcd061d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisConfigRead.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisConfigRead.g.cs @@ -23,136 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class AnalysisConfigReadConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBucketSpan = System.Text.Json.JsonEncodedText.Encode("bucket_span"); - private static readonly System.Text.Json.JsonEncodedText PropCategorizationAnalyzer = System.Text.Json.JsonEncodedText.Encode("categorization_analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropCategorizationFieldName = System.Text.Json.JsonEncodedText.Encode("categorization_field_name"); - private static readonly System.Text.Json.JsonEncodedText PropCategorizationFilters = System.Text.Json.JsonEncodedText.Encode("categorization_filters"); - private static readonly System.Text.Json.JsonEncodedText PropDetectors = System.Text.Json.JsonEncodedText.Encode("detectors"); - private static readonly System.Text.Json.JsonEncodedText PropInfluencers = System.Text.Json.JsonEncodedText.Encode("influencers"); - private static readonly System.Text.Json.JsonEncodedText PropLatency = System.Text.Json.JsonEncodedText.Encode("latency"); - private static readonly System.Text.Json.JsonEncodedText PropModelPruneWindow = System.Text.Json.JsonEncodedText.Encode("model_prune_window"); - private static readonly System.Text.Json.JsonEncodedText PropMultivariateByFields = System.Text.Json.JsonEncodedText.Encode("multivariate_by_fields"); - private static readonly System.Text.Json.JsonEncodedText PropPerPartitionCategorization = System.Text.Json.JsonEncodedText.Encode("per_partition_categorization"); - private static readonly System.Text.Json.JsonEncodedText PropSummaryCountFieldName = System.Text.Json.JsonEncodedText.Encode("summary_count_field_name"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigRead Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBucketSpan = default; - LocalJsonValue propCategorizationAnalyzer = default; - LocalJsonValue propCategorizationFieldName = default; - LocalJsonValue?> propCategorizationFilters = default; - LocalJsonValue> propDetectors = default; - LocalJsonValue propInfluencers = default; - LocalJsonValue propLatency = default; - LocalJsonValue propModelPruneWindow = default; - LocalJsonValue propMultivariateByFields = default; - LocalJsonValue propPerPartitionCategorization = default; - LocalJsonValue propSummaryCountFieldName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBucketSpan.TryReadProperty(ref reader, options, PropBucketSpan, null)) - { - continue; - } - - if (propCategorizationAnalyzer.TryReadProperty(ref reader, options, PropCategorizationAnalyzer, null)) - { - continue; - } - - if (propCategorizationFieldName.TryReadProperty(ref reader, options, PropCategorizationFieldName, null)) - { - continue; - } - - if (propCategorizationFilters.TryReadProperty(ref reader, options, PropCategorizationFilters, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propDetectors.TryReadProperty(ref reader, options, PropDetectors, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propInfluencers.TryReadProperty(ref reader, options, PropInfluencers, null)) - { - continue; - } - - if (propLatency.TryReadProperty(ref reader, options, PropLatency, null)) - { - continue; - } - - if (propModelPruneWindow.TryReadProperty(ref reader, options, PropModelPruneWindow, null)) - { - continue; - } - - if (propMultivariateByFields.TryReadProperty(ref reader, options, PropMultivariateByFields, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPerPartitionCategorization.TryReadProperty(ref reader, options, PropPerPartitionCategorization, null)) - { - continue; - } - - if (propSummaryCountFieldName.TryReadProperty(ref reader, options, PropSummaryCountFieldName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigRead(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BucketSpan = propBucketSpan.Value, - CategorizationAnalyzer = propCategorizationAnalyzer.Value, - CategorizationFieldName = propCategorizationFieldName.Value, - CategorizationFilters = propCategorizationFilters.Value, - Detectors = propDetectors.Value, - Influencers = propInfluencers.Value, - Latency = propLatency.Value, - ModelPruneWindow = propModelPruneWindow.Value, - MultivariateByFields = propMultivariateByFields.Value, - PerPartitionCategorization = propPerPartitionCategorization.Value, - SummaryCountFieldName = propSummaryCountFieldName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigRead value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBucketSpan, value.BucketSpan, null, null); - writer.WriteProperty(options, PropCategorizationAnalyzer, value.CategorizationAnalyzer, null, null); - writer.WriteProperty(options, PropCategorizationFieldName, value.CategorizationFieldName, null, null); - writer.WriteProperty(options, PropCategorizationFilters, value.CategorizationFilters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDetectors, value.Detectors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropInfluencers, value.Influencers, null, null); - writer.WriteProperty(options, PropLatency, value.Latency, null, null); - writer.WriteProperty(options, PropModelPruneWindow, value.ModelPruneWindow, null, null); - writer.WriteProperty(options, PropMultivariateByFields, value.MultivariateByFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPerPartitionCategorization, value.PerPartitionCategorization, null, null); - writer.WriteProperty(options, PropSummaryCountFieldName, value.SummaryCountFieldName, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisConfigReadConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.AnalysisConfigReadConverter))] public sealed partial class AnalysisConfigRead { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisLimits.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisLimits.Converters.g.cs new file mode 100644 index 00000000000..2d57ecef50c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisLimits.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class AnalysisLimitsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCategorizationExamplesLimit = System.Text.Json.JsonEncodedText.Encode("categorization_examples_limit"); + private static readonly System.Text.Json.JsonEncodedText PropModelMemoryLimit = System.Text.Json.JsonEncodedText.Encode("model_memory_limit"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimits Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCategorizationExamplesLimit = default; + LocalJsonValue propModelMemoryLimit = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCategorizationExamplesLimit.TryReadProperty(ref reader, options, PropCategorizationExamplesLimit, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propModelMemoryLimit.TryReadProperty(ref reader, options, PropModelMemoryLimit, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimits(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CategorizationExamplesLimit = propCategorizationExamplesLimit.Value, + ModelMemoryLimit = propModelMemoryLimit.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimits value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCategorizationExamplesLimit, value.CategorizationExamplesLimit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropModelMemoryLimit, value.ModelMemoryLimit, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisLimits.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisLimits.g.cs index 5b3bbc73df9..ee262c6b318 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisLimits.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisLimits.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class AnalysisLimitsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCategorizationExamplesLimit = System.Text.Json.JsonEncodedText.Encode("categorization_examples_limit"); - private static readonly System.Text.Json.JsonEncodedText PropModelMemoryLimit = System.Text.Json.JsonEncodedText.Encode("model_memory_limit"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimits Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCategorizationExamplesLimit = default; - LocalJsonValue propModelMemoryLimit = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCategorizationExamplesLimit.TryReadProperty(ref reader, options, PropCategorizationExamplesLimit, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propModelMemoryLimit.TryReadProperty(ref reader, options, PropModelMemoryLimit, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimits(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CategorizationExamplesLimit = propCategorizationExamplesLimit.Value, - ModelMemoryLimit = propModelMemoryLimit.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimits value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCategorizationExamplesLimit, value.CategorizationExamplesLimit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropModelMemoryLimit, value.ModelMemoryLimit, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisLimitsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.AnalysisLimitsConverter))] public sealed partial class AnalysisLimits { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisMemoryLimit.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisMemoryLimit.Converters.g.cs new file mode 100644 index 00000000000..c5be0963e0e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisMemoryLimit.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class AnalysisMemoryLimitConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropModelMemoryLimit = System.Text.Json.JsonEncodedText.Encode("model_memory_limit"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.AnalysisMemoryLimit Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propModelMemoryLimit = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propModelMemoryLimit.TryReadProperty(ref reader, options, PropModelMemoryLimit, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.AnalysisMemoryLimit(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ModelMemoryLimit = propModelMemoryLimit.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.AnalysisMemoryLimit value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropModelMemoryLimit, value.ModelMemoryLimit, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisMemoryLimit.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisMemoryLimit.g.cs index 9c9508f586e..20581c29d9f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisMemoryLimit.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisMemoryLimit.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class AnalysisMemoryLimitConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropModelMemoryLimit = System.Text.Json.JsonEncodedText.Encode("model_memory_limit"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.AnalysisMemoryLimit Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propModelMemoryLimit = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propModelMemoryLimit.TryReadProperty(ref reader, options, PropModelMemoryLimit, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.AnalysisMemoryLimit(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ModelMemoryLimit = propModelMemoryLimit.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.AnalysisMemoryLimit value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropModelMemoryLimit, value.ModelMemoryLimit, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.AnalysisMemoryLimitConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.AnalysisMemoryLimitConverter))] public sealed partial class AnalysisMemoryLimit { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Anomaly.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Anomaly.Converters.g.cs new file mode 100644 index 00000000000..5f5ac8d1852 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Anomaly.Converters.g.cs @@ -0,0 +1,270 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class AnomalyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropActual = System.Text.Json.JsonEncodedText.Encode("actual"); + private static readonly System.Text.Json.JsonEncodedText PropAnomalyScoreExplanation = System.Text.Json.JsonEncodedText.Encode("anomaly_score_explanation"); + private static readonly System.Text.Json.JsonEncodedText PropBucketSpan = System.Text.Json.JsonEncodedText.Encode("bucket_span"); + private static readonly System.Text.Json.JsonEncodedText PropByFieldName = System.Text.Json.JsonEncodedText.Encode("by_field_name"); + private static readonly System.Text.Json.JsonEncodedText PropByFieldValue = System.Text.Json.JsonEncodedText.Encode("by_field_value"); + private static readonly System.Text.Json.JsonEncodedText PropCauses = System.Text.Json.JsonEncodedText.Encode("causes"); + private static readonly System.Text.Json.JsonEncodedText PropDetectorIndex = System.Text.Json.JsonEncodedText.Encode("detector_index"); + private static readonly System.Text.Json.JsonEncodedText PropFieldName = System.Text.Json.JsonEncodedText.Encode("field_name"); + private static readonly System.Text.Json.JsonEncodedText PropFunction = System.Text.Json.JsonEncodedText.Encode("function"); + private static readonly System.Text.Json.JsonEncodedText PropFunctionDescription = System.Text.Json.JsonEncodedText.Encode("function_description"); + private static readonly System.Text.Json.JsonEncodedText PropGeoResults = System.Text.Json.JsonEncodedText.Encode("geo_results"); + private static readonly System.Text.Json.JsonEncodedText PropInfluencers = System.Text.Json.JsonEncodedText.Encode("influencers"); + private static readonly System.Text.Json.JsonEncodedText PropInitialRecordScore = System.Text.Json.JsonEncodedText.Encode("initial_record_score"); + private static readonly System.Text.Json.JsonEncodedText PropIsInterim = System.Text.Json.JsonEncodedText.Encode("is_interim"); + private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); + private static readonly System.Text.Json.JsonEncodedText PropOverFieldName = System.Text.Json.JsonEncodedText.Encode("over_field_name"); + private static readonly System.Text.Json.JsonEncodedText PropOverFieldValue = System.Text.Json.JsonEncodedText.Encode("over_field_value"); + private static readonly System.Text.Json.JsonEncodedText PropPartitionFieldName = System.Text.Json.JsonEncodedText.Encode("partition_field_name"); + private static readonly System.Text.Json.JsonEncodedText PropPartitionFieldValue = System.Text.Json.JsonEncodedText.Encode("partition_field_value"); + private static readonly System.Text.Json.JsonEncodedText PropProbability = System.Text.Json.JsonEncodedText.Encode("probability"); + private static readonly System.Text.Json.JsonEncodedText PropRecordScore = System.Text.Json.JsonEncodedText.Encode("record_score"); + private static readonly System.Text.Json.JsonEncodedText PropResultType = System.Text.Json.JsonEncodedText.Encode("result_type"); + private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); + private static readonly System.Text.Json.JsonEncodedText PropTypical = System.Text.Json.JsonEncodedText.Encode("typical"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.Anomaly Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propActual = default; + LocalJsonValue propAnomalyScoreExplanation = default; + LocalJsonValue propBucketSpan = default; + LocalJsonValue propByFieldName = default; + LocalJsonValue propByFieldValue = default; + LocalJsonValue?> propCauses = default; + LocalJsonValue propDetectorIndex = default; + LocalJsonValue propFieldName = default; + LocalJsonValue propFunction = default; + LocalJsonValue propFunctionDescription = default; + LocalJsonValue propGeoResults = default; + LocalJsonValue?> propInfluencers = default; + LocalJsonValue propInitialRecordScore = default; + LocalJsonValue propIsInterim = default; + LocalJsonValue propJobId = default; + LocalJsonValue propOverFieldName = default; + LocalJsonValue propOverFieldValue = default; + LocalJsonValue propPartitionFieldName = default; + LocalJsonValue propPartitionFieldValue = default; + LocalJsonValue propProbability = default; + LocalJsonValue propRecordScore = default; + LocalJsonValue propResultType = default; + LocalJsonValue propTimestamp = default; + LocalJsonValue?> propTypical = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propActual.TryReadProperty(ref reader, options, PropActual, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propAnomalyScoreExplanation.TryReadProperty(ref reader, options, PropAnomalyScoreExplanation, null)) + { + continue; + } + + if (propBucketSpan.TryReadProperty(ref reader, options, PropBucketSpan, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanSecondsMarker)))) + { + continue; + } + + if (propByFieldName.TryReadProperty(ref reader, options, PropByFieldName, null)) + { + continue; + } + + if (propByFieldValue.TryReadProperty(ref reader, options, PropByFieldValue, null)) + { + continue; + } + + if (propCauses.TryReadProperty(ref reader, options, PropCauses, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propDetectorIndex.TryReadProperty(ref reader, options, PropDetectorIndex, null)) + { + continue; + } + + if (propFieldName.TryReadProperty(ref reader, options, PropFieldName, null)) + { + continue; + } + + if (propFunction.TryReadProperty(ref reader, options, PropFunction, null)) + { + continue; + } + + if (propFunctionDescription.TryReadProperty(ref reader, options, PropFunctionDescription, null)) + { + continue; + } + + if (propGeoResults.TryReadProperty(ref reader, options, PropGeoResults, null)) + { + continue; + } + + if (propInfluencers.TryReadProperty(ref reader, options, PropInfluencers, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propInitialRecordScore.TryReadProperty(ref reader, options, PropInitialRecordScore, null)) + { + continue; + } + + if (propIsInterim.TryReadProperty(ref reader, options, PropIsInterim, null)) + { + continue; + } + + if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) + { + continue; + } + + if (propOverFieldName.TryReadProperty(ref reader, options, PropOverFieldName, null)) + { + continue; + } + + if (propOverFieldValue.TryReadProperty(ref reader, options, PropOverFieldValue, null)) + { + continue; + } + + if (propPartitionFieldName.TryReadProperty(ref reader, options, PropPartitionFieldName, null)) + { + continue; + } + + if (propPartitionFieldValue.TryReadProperty(ref reader, options, PropPartitionFieldValue, null)) + { + continue; + } + + if (propProbability.TryReadProperty(ref reader, options, PropProbability, null)) + { + continue; + } + + if (propRecordScore.TryReadProperty(ref reader, options, PropRecordScore, null)) + { + continue; + } + + if (propResultType.TryReadProperty(ref reader, options, PropResultType, null)) + { + continue; + } + + if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propTypical.TryReadProperty(ref reader, options, PropTypical, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.Anomaly(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Actual = propActual.Value, + AnomalyScoreExplanation = propAnomalyScoreExplanation.Value, + BucketSpan = propBucketSpan.Value, + ByFieldName = propByFieldName.Value, + ByFieldValue = propByFieldValue.Value, + Causes = propCauses.Value, + DetectorIndex = propDetectorIndex.Value, + FieldName = propFieldName.Value, + Function = propFunction.Value, + FunctionDescription = propFunctionDescription.Value, + GeoResults = propGeoResults.Value, + Influencers = propInfluencers.Value, + InitialRecordScore = propInitialRecordScore.Value, + IsInterim = propIsInterim.Value, + JobId = propJobId.Value, + OverFieldName = propOverFieldName.Value, + OverFieldValue = propOverFieldValue.Value, + PartitionFieldName = propPartitionFieldName.Value, + PartitionFieldValue = propPartitionFieldValue.Value, + Probability = propProbability.Value, + RecordScore = propRecordScore.Value, + ResultType = propResultType.Value, + Timestamp = propTimestamp.Value, + Typical = propTypical.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Anomaly value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropActual, value.Actual, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropAnomalyScoreExplanation, value.AnomalyScoreExplanation, null, null); + writer.WriteProperty(options, PropBucketSpan, value.BucketSpan, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanSecondsMarker))); + writer.WriteProperty(options, PropByFieldName, value.ByFieldName, null, null); + writer.WriteProperty(options, PropByFieldValue, value.ByFieldValue, null, null); + writer.WriteProperty(options, PropCauses, value.Causes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDetectorIndex, value.DetectorIndex, null, null); + writer.WriteProperty(options, PropFieldName, value.FieldName, null, null); + writer.WriteProperty(options, PropFunction, value.Function, null, null); + writer.WriteProperty(options, PropFunctionDescription, value.FunctionDescription, null, null); + writer.WriteProperty(options, PropGeoResults, value.GeoResults, null, null); + writer.WriteProperty(options, PropInfluencers, value.Influencers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropInitialRecordScore, value.InitialRecordScore, null, null); + writer.WriteProperty(options, PropIsInterim, value.IsInterim, null, null); + writer.WriteProperty(options, PropJobId, value.JobId, null, null); + writer.WriteProperty(options, PropOverFieldName, value.OverFieldName, null, null); + writer.WriteProperty(options, PropOverFieldValue, value.OverFieldValue, null, null); + writer.WriteProperty(options, PropPartitionFieldName, value.PartitionFieldName, null, null); + writer.WriteProperty(options, PropPartitionFieldValue, value.PartitionFieldValue, null, null); + writer.WriteProperty(options, PropProbability, value.Probability, null, null); + writer.WriteProperty(options, PropRecordScore, value.RecordScore, null, null); + writer.WriteProperty(options, PropResultType, value.ResultType, null, null); + writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropTypical, value.Typical, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Anomaly.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Anomaly.g.cs index a2c22bc2bb6..93de9d1b4a7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Anomaly.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Anomaly.g.cs @@ -23,253 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class AnomalyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropActual = System.Text.Json.JsonEncodedText.Encode("actual"); - private static readonly System.Text.Json.JsonEncodedText PropAnomalyScoreExplanation = System.Text.Json.JsonEncodedText.Encode("anomaly_score_explanation"); - private static readonly System.Text.Json.JsonEncodedText PropBucketSpan = System.Text.Json.JsonEncodedText.Encode("bucket_span"); - private static readonly System.Text.Json.JsonEncodedText PropByFieldName = System.Text.Json.JsonEncodedText.Encode("by_field_name"); - private static readonly System.Text.Json.JsonEncodedText PropByFieldValue = System.Text.Json.JsonEncodedText.Encode("by_field_value"); - private static readonly System.Text.Json.JsonEncodedText PropCauses = System.Text.Json.JsonEncodedText.Encode("causes"); - private static readonly System.Text.Json.JsonEncodedText PropDetectorIndex = System.Text.Json.JsonEncodedText.Encode("detector_index"); - private static readonly System.Text.Json.JsonEncodedText PropFieldName = System.Text.Json.JsonEncodedText.Encode("field_name"); - private static readonly System.Text.Json.JsonEncodedText PropFunction = System.Text.Json.JsonEncodedText.Encode("function"); - private static readonly System.Text.Json.JsonEncodedText PropFunctionDescription = System.Text.Json.JsonEncodedText.Encode("function_description"); - private static readonly System.Text.Json.JsonEncodedText PropGeoResults = System.Text.Json.JsonEncodedText.Encode("geo_results"); - private static readonly System.Text.Json.JsonEncodedText PropInfluencers = System.Text.Json.JsonEncodedText.Encode("influencers"); - private static readonly System.Text.Json.JsonEncodedText PropInitialRecordScore = System.Text.Json.JsonEncodedText.Encode("initial_record_score"); - private static readonly System.Text.Json.JsonEncodedText PropIsInterim = System.Text.Json.JsonEncodedText.Encode("is_interim"); - private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); - private static readonly System.Text.Json.JsonEncodedText PropOverFieldName = System.Text.Json.JsonEncodedText.Encode("over_field_name"); - private static readonly System.Text.Json.JsonEncodedText PropOverFieldValue = System.Text.Json.JsonEncodedText.Encode("over_field_value"); - private static readonly System.Text.Json.JsonEncodedText PropPartitionFieldName = System.Text.Json.JsonEncodedText.Encode("partition_field_name"); - private static readonly System.Text.Json.JsonEncodedText PropPartitionFieldValue = System.Text.Json.JsonEncodedText.Encode("partition_field_value"); - private static readonly System.Text.Json.JsonEncodedText PropProbability = System.Text.Json.JsonEncodedText.Encode("probability"); - private static readonly System.Text.Json.JsonEncodedText PropRecordScore = System.Text.Json.JsonEncodedText.Encode("record_score"); - private static readonly System.Text.Json.JsonEncodedText PropResultType = System.Text.Json.JsonEncodedText.Encode("result_type"); - private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); - private static readonly System.Text.Json.JsonEncodedText PropTypical = System.Text.Json.JsonEncodedText.Encode("typical"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.Anomaly Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propActual = default; - LocalJsonValue propAnomalyScoreExplanation = default; - LocalJsonValue propBucketSpan = default; - LocalJsonValue propByFieldName = default; - LocalJsonValue propByFieldValue = default; - LocalJsonValue?> propCauses = default; - LocalJsonValue propDetectorIndex = default; - LocalJsonValue propFieldName = default; - LocalJsonValue propFunction = default; - LocalJsonValue propFunctionDescription = default; - LocalJsonValue propGeoResults = default; - LocalJsonValue?> propInfluencers = default; - LocalJsonValue propInitialRecordScore = default; - LocalJsonValue propIsInterim = default; - LocalJsonValue propJobId = default; - LocalJsonValue propOverFieldName = default; - LocalJsonValue propOverFieldValue = default; - LocalJsonValue propPartitionFieldName = default; - LocalJsonValue propPartitionFieldValue = default; - LocalJsonValue propProbability = default; - LocalJsonValue propRecordScore = default; - LocalJsonValue propResultType = default; - LocalJsonValue propTimestamp = default; - LocalJsonValue?> propTypical = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propActual.TryReadProperty(ref reader, options, PropActual, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propAnomalyScoreExplanation.TryReadProperty(ref reader, options, PropAnomalyScoreExplanation, null)) - { - continue; - } - - if (propBucketSpan.TryReadProperty(ref reader, options, PropBucketSpan, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanSecondsMarker)))) - { - continue; - } - - if (propByFieldName.TryReadProperty(ref reader, options, PropByFieldName, null)) - { - continue; - } - - if (propByFieldValue.TryReadProperty(ref reader, options, PropByFieldValue, null)) - { - continue; - } - - if (propCauses.TryReadProperty(ref reader, options, PropCauses, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propDetectorIndex.TryReadProperty(ref reader, options, PropDetectorIndex, null)) - { - continue; - } - - if (propFieldName.TryReadProperty(ref reader, options, PropFieldName, null)) - { - continue; - } - - if (propFunction.TryReadProperty(ref reader, options, PropFunction, null)) - { - continue; - } - - if (propFunctionDescription.TryReadProperty(ref reader, options, PropFunctionDescription, null)) - { - continue; - } - - if (propGeoResults.TryReadProperty(ref reader, options, PropGeoResults, null)) - { - continue; - } - - if (propInfluencers.TryReadProperty(ref reader, options, PropInfluencers, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propInitialRecordScore.TryReadProperty(ref reader, options, PropInitialRecordScore, null)) - { - continue; - } - - if (propIsInterim.TryReadProperty(ref reader, options, PropIsInterim, null)) - { - continue; - } - - if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) - { - continue; - } - - if (propOverFieldName.TryReadProperty(ref reader, options, PropOverFieldName, null)) - { - continue; - } - - if (propOverFieldValue.TryReadProperty(ref reader, options, PropOverFieldValue, null)) - { - continue; - } - - if (propPartitionFieldName.TryReadProperty(ref reader, options, PropPartitionFieldName, null)) - { - continue; - } - - if (propPartitionFieldValue.TryReadProperty(ref reader, options, PropPartitionFieldValue, null)) - { - continue; - } - - if (propProbability.TryReadProperty(ref reader, options, PropProbability, null)) - { - continue; - } - - if (propRecordScore.TryReadProperty(ref reader, options, PropRecordScore, null)) - { - continue; - } - - if (propResultType.TryReadProperty(ref reader, options, PropResultType, null)) - { - continue; - } - - if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propTypical.TryReadProperty(ref reader, options, PropTypical, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.Anomaly(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Actual = propActual.Value, - AnomalyScoreExplanation = propAnomalyScoreExplanation.Value, - BucketSpan = propBucketSpan.Value, - ByFieldName = propByFieldName.Value, - ByFieldValue = propByFieldValue.Value, - Causes = propCauses.Value, - DetectorIndex = propDetectorIndex.Value, - FieldName = propFieldName.Value, - Function = propFunction.Value, - FunctionDescription = propFunctionDescription.Value, - GeoResults = propGeoResults.Value, - Influencers = propInfluencers.Value, - InitialRecordScore = propInitialRecordScore.Value, - IsInterim = propIsInterim.Value, - JobId = propJobId.Value, - OverFieldName = propOverFieldName.Value, - OverFieldValue = propOverFieldValue.Value, - PartitionFieldName = propPartitionFieldName.Value, - PartitionFieldValue = propPartitionFieldValue.Value, - Probability = propProbability.Value, - RecordScore = propRecordScore.Value, - ResultType = propResultType.Value, - Timestamp = propTimestamp.Value, - Typical = propTypical.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Anomaly value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropActual, value.Actual, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropAnomalyScoreExplanation, value.AnomalyScoreExplanation, null, null); - writer.WriteProperty(options, PropBucketSpan, value.BucketSpan, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanSecondsMarker))); - writer.WriteProperty(options, PropByFieldName, value.ByFieldName, null, null); - writer.WriteProperty(options, PropByFieldValue, value.ByFieldValue, null, null); - writer.WriteProperty(options, PropCauses, value.Causes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDetectorIndex, value.DetectorIndex, null, null); - writer.WriteProperty(options, PropFieldName, value.FieldName, null, null); - writer.WriteProperty(options, PropFunction, value.Function, null, null); - writer.WriteProperty(options, PropFunctionDescription, value.FunctionDescription, null, null); - writer.WriteProperty(options, PropGeoResults, value.GeoResults, null, null); - writer.WriteProperty(options, PropInfluencers, value.Influencers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropInitialRecordScore, value.InitialRecordScore, null, null); - writer.WriteProperty(options, PropIsInterim, value.IsInterim, null, null); - writer.WriteProperty(options, PropJobId, value.JobId, null, null); - writer.WriteProperty(options, PropOverFieldName, value.OverFieldName, null, null); - writer.WriteProperty(options, PropOverFieldValue, value.OverFieldValue, null, null); - writer.WriteProperty(options, PropPartitionFieldName, value.PartitionFieldName, null, null); - writer.WriteProperty(options, PropPartitionFieldValue, value.PartitionFieldValue, null, null); - writer.WriteProperty(options, PropProbability, value.Probability, null, null); - writer.WriteProperty(options, PropRecordScore, value.RecordScore, null, null); - writer.WriteProperty(options, PropResultType, value.ResultType, null, null); - writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropTypical, value.Typical, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.AnomalyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.AnomalyConverter))] public sealed partial class Anomaly { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyCause.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyCause.Converters.g.cs new file mode 100644 index 00000000000..26bdaa63be8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyCause.Converters.g.cs @@ -0,0 +1,189 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class AnomalyCauseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropActual = System.Text.Json.JsonEncodedText.Encode("actual"); + private static readonly System.Text.Json.JsonEncodedText PropByFieldName = System.Text.Json.JsonEncodedText.Encode("by_field_name"); + private static readonly System.Text.Json.JsonEncodedText PropByFieldValue = System.Text.Json.JsonEncodedText.Encode("by_field_value"); + private static readonly System.Text.Json.JsonEncodedText PropCorrelatedByFieldValue = System.Text.Json.JsonEncodedText.Encode("correlated_by_field_value"); + private static readonly System.Text.Json.JsonEncodedText PropFieldName = System.Text.Json.JsonEncodedText.Encode("field_name"); + private static readonly System.Text.Json.JsonEncodedText PropFunction = System.Text.Json.JsonEncodedText.Encode("function"); + private static readonly System.Text.Json.JsonEncodedText PropFunctionDescription = System.Text.Json.JsonEncodedText.Encode("function_description"); + private static readonly System.Text.Json.JsonEncodedText PropGeoResults = System.Text.Json.JsonEncodedText.Encode("geo_results"); + private static readonly System.Text.Json.JsonEncodedText PropInfluencers = System.Text.Json.JsonEncodedText.Encode("influencers"); + private static readonly System.Text.Json.JsonEncodedText PropOverFieldName = System.Text.Json.JsonEncodedText.Encode("over_field_name"); + private static readonly System.Text.Json.JsonEncodedText PropOverFieldValue = System.Text.Json.JsonEncodedText.Encode("over_field_value"); + private static readonly System.Text.Json.JsonEncodedText PropPartitionFieldName = System.Text.Json.JsonEncodedText.Encode("partition_field_name"); + private static readonly System.Text.Json.JsonEncodedText PropPartitionFieldValue = System.Text.Json.JsonEncodedText.Encode("partition_field_value"); + private static readonly System.Text.Json.JsonEncodedText PropProbability = System.Text.Json.JsonEncodedText.Encode("probability"); + private static readonly System.Text.Json.JsonEncodedText PropTypical = System.Text.Json.JsonEncodedText.Encode("typical"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.AnomalyCause Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propActual = default; + LocalJsonValue propByFieldName = default; + LocalJsonValue propByFieldValue = default; + LocalJsonValue propCorrelatedByFieldValue = default; + LocalJsonValue propFieldName = default; + LocalJsonValue propFunction = default; + LocalJsonValue propFunctionDescription = default; + LocalJsonValue propGeoResults = default; + LocalJsonValue?> propInfluencers = default; + LocalJsonValue propOverFieldName = default; + LocalJsonValue propOverFieldValue = default; + LocalJsonValue propPartitionFieldName = default; + LocalJsonValue propPartitionFieldValue = default; + LocalJsonValue propProbability = default; + LocalJsonValue?> propTypical = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propActual.TryReadProperty(ref reader, options, PropActual, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propByFieldName.TryReadProperty(ref reader, options, PropByFieldName, null)) + { + continue; + } + + if (propByFieldValue.TryReadProperty(ref reader, options, PropByFieldValue, null)) + { + continue; + } + + if (propCorrelatedByFieldValue.TryReadProperty(ref reader, options, PropCorrelatedByFieldValue, null)) + { + continue; + } + + if (propFieldName.TryReadProperty(ref reader, options, PropFieldName, null)) + { + continue; + } + + if (propFunction.TryReadProperty(ref reader, options, PropFunction, null)) + { + continue; + } + + if (propFunctionDescription.TryReadProperty(ref reader, options, PropFunctionDescription, null)) + { + continue; + } + + if (propGeoResults.TryReadProperty(ref reader, options, PropGeoResults, null)) + { + continue; + } + + if (propInfluencers.TryReadProperty(ref reader, options, PropInfluencers, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propOverFieldName.TryReadProperty(ref reader, options, PropOverFieldName, null)) + { + continue; + } + + if (propOverFieldValue.TryReadProperty(ref reader, options, PropOverFieldValue, null)) + { + continue; + } + + if (propPartitionFieldName.TryReadProperty(ref reader, options, PropPartitionFieldName, null)) + { + continue; + } + + if (propPartitionFieldValue.TryReadProperty(ref reader, options, PropPartitionFieldValue, null)) + { + continue; + } + + if (propProbability.TryReadProperty(ref reader, options, PropProbability, null)) + { + continue; + } + + if (propTypical.TryReadProperty(ref reader, options, PropTypical, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.AnomalyCause(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Actual = propActual.Value, + ByFieldName = propByFieldName.Value, + ByFieldValue = propByFieldValue.Value, + CorrelatedByFieldValue = propCorrelatedByFieldValue.Value, + FieldName = propFieldName.Value, + Function = propFunction.Value, + FunctionDescription = propFunctionDescription.Value, + GeoResults = propGeoResults.Value, + Influencers = propInfluencers.Value, + OverFieldName = propOverFieldName.Value, + OverFieldValue = propOverFieldValue.Value, + PartitionFieldName = propPartitionFieldName.Value, + PartitionFieldValue = propPartitionFieldValue.Value, + Probability = propProbability.Value, + Typical = propTypical.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.AnomalyCause value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropActual, value.Actual, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropByFieldName, value.ByFieldName, null, null); + writer.WriteProperty(options, PropByFieldValue, value.ByFieldValue, null, null); + writer.WriteProperty(options, PropCorrelatedByFieldValue, value.CorrelatedByFieldValue, null, null); + writer.WriteProperty(options, PropFieldName, value.FieldName, null, null); + writer.WriteProperty(options, PropFunction, value.Function, null, null); + writer.WriteProperty(options, PropFunctionDescription, value.FunctionDescription, null, null); + writer.WriteProperty(options, PropGeoResults, value.GeoResults, null, null); + writer.WriteProperty(options, PropInfluencers, value.Influencers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropOverFieldName, value.OverFieldName, null, null); + writer.WriteProperty(options, PropOverFieldValue, value.OverFieldValue, null, null); + writer.WriteProperty(options, PropPartitionFieldName, value.PartitionFieldName, null, null); + writer.WriteProperty(options, PropPartitionFieldValue, value.PartitionFieldValue, null, null); + writer.WriteProperty(options, PropProbability, value.Probability, null, null); + writer.WriteProperty(options, PropTypical, value.Typical, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyCause.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyCause.g.cs index 69365edb8e5..ec14d44f7fe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyCause.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyCause.g.cs @@ -23,172 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class AnomalyCauseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropActual = System.Text.Json.JsonEncodedText.Encode("actual"); - private static readonly System.Text.Json.JsonEncodedText PropByFieldName = System.Text.Json.JsonEncodedText.Encode("by_field_name"); - private static readonly System.Text.Json.JsonEncodedText PropByFieldValue = System.Text.Json.JsonEncodedText.Encode("by_field_value"); - private static readonly System.Text.Json.JsonEncodedText PropCorrelatedByFieldValue = System.Text.Json.JsonEncodedText.Encode("correlated_by_field_value"); - private static readonly System.Text.Json.JsonEncodedText PropFieldName = System.Text.Json.JsonEncodedText.Encode("field_name"); - private static readonly System.Text.Json.JsonEncodedText PropFunction = System.Text.Json.JsonEncodedText.Encode("function"); - private static readonly System.Text.Json.JsonEncodedText PropFunctionDescription = System.Text.Json.JsonEncodedText.Encode("function_description"); - private static readonly System.Text.Json.JsonEncodedText PropGeoResults = System.Text.Json.JsonEncodedText.Encode("geo_results"); - private static readonly System.Text.Json.JsonEncodedText PropInfluencers = System.Text.Json.JsonEncodedText.Encode("influencers"); - private static readonly System.Text.Json.JsonEncodedText PropOverFieldName = System.Text.Json.JsonEncodedText.Encode("over_field_name"); - private static readonly System.Text.Json.JsonEncodedText PropOverFieldValue = System.Text.Json.JsonEncodedText.Encode("over_field_value"); - private static readonly System.Text.Json.JsonEncodedText PropPartitionFieldName = System.Text.Json.JsonEncodedText.Encode("partition_field_name"); - private static readonly System.Text.Json.JsonEncodedText PropPartitionFieldValue = System.Text.Json.JsonEncodedText.Encode("partition_field_value"); - private static readonly System.Text.Json.JsonEncodedText PropProbability = System.Text.Json.JsonEncodedText.Encode("probability"); - private static readonly System.Text.Json.JsonEncodedText PropTypical = System.Text.Json.JsonEncodedText.Encode("typical"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.AnomalyCause Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propActual = default; - LocalJsonValue propByFieldName = default; - LocalJsonValue propByFieldValue = default; - LocalJsonValue propCorrelatedByFieldValue = default; - LocalJsonValue propFieldName = default; - LocalJsonValue propFunction = default; - LocalJsonValue propFunctionDescription = default; - LocalJsonValue propGeoResults = default; - LocalJsonValue?> propInfluencers = default; - LocalJsonValue propOverFieldName = default; - LocalJsonValue propOverFieldValue = default; - LocalJsonValue propPartitionFieldName = default; - LocalJsonValue propPartitionFieldValue = default; - LocalJsonValue propProbability = default; - LocalJsonValue?> propTypical = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propActual.TryReadProperty(ref reader, options, PropActual, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propByFieldName.TryReadProperty(ref reader, options, PropByFieldName, null)) - { - continue; - } - - if (propByFieldValue.TryReadProperty(ref reader, options, PropByFieldValue, null)) - { - continue; - } - - if (propCorrelatedByFieldValue.TryReadProperty(ref reader, options, PropCorrelatedByFieldValue, null)) - { - continue; - } - - if (propFieldName.TryReadProperty(ref reader, options, PropFieldName, null)) - { - continue; - } - - if (propFunction.TryReadProperty(ref reader, options, PropFunction, null)) - { - continue; - } - - if (propFunctionDescription.TryReadProperty(ref reader, options, PropFunctionDescription, null)) - { - continue; - } - - if (propGeoResults.TryReadProperty(ref reader, options, PropGeoResults, null)) - { - continue; - } - - if (propInfluencers.TryReadProperty(ref reader, options, PropInfluencers, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propOverFieldName.TryReadProperty(ref reader, options, PropOverFieldName, null)) - { - continue; - } - - if (propOverFieldValue.TryReadProperty(ref reader, options, PropOverFieldValue, null)) - { - continue; - } - - if (propPartitionFieldName.TryReadProperty(ref reader, options, PropPartitionFieldName, null)) - { - continue; - } - - if (propPartitionFieldValue.TryReadProperty(ref reader, options, PropPartitionFieldValue, null)) - { - continue; - } - - if (propProbability.TryReadProperty(ref reader, options, PropProbability, null)) - { - continue; - } - - if (propTypical.TryReadProperty(ref reader, options, PropTypical, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.AnomalyCause(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Actual = propActual.Value, - ByFieldName = propByFieldName.Value, - ByFieldValue = propByFieldValue.Value, - CorrelatedByFieldValue = propCorrelatedByFieldValue.Value, - FieldName = propFieldName.Value, - Function = propFunction.Value, - FunctionDescription = propFunctionDescription.Value, - GeoResults = propGeoResults.Value, - Influencers = propInfluencers.Value, - OverFieldName = propOverFieldName.Value, - OverFieldValue = propOverFieldValue.Value, - PartitionFieldName = propPartitionFieldName.Value, - PartitionFieldValue = propPartitionFieldValue.Value, - Probability = propProbability.Value, - Typical = propTypical.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.AnomalyCause value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropActual, value.Actual, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropByFieldName, value.ByFieldName, null, null); - writer.WriteProperty(options, PropByFieldValue, value.ByFieldValue, null, null); - writer.WriteProperty(options, PropCorrelatedByFieldValue, value.CorrelatedByFieldValue, null, null); - writer.WriteProperty(options, PropFieldName, value.FieldName, null, null); - writer.WriteProperty(options, PropFunction, value.Function, null, null); - writer.WriteProperty(options, PropFunctionDescription, value.FunctionDescription, null, null); - writer.WriteProperty(options, PropGeoResults, value.GeoResults, null, null); - writer.WriteProperty(options, PropInfluencers, value.Influencers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropOverFieldName, value.OverFieldName, null, null); - writer.WriteProperty(options, PropOverFieldValue, value.OverFieldValue, null, null); - writer.WriteProperty(options, PropPartitionFieldName, value.PartitionFieldName, null, null); - writer.WriteProperty(options, PropPartitionFieldValue, value.PartitionFieldValue, null, null); - writer.WriteProperty(options, PropProbability, value.Probability, null, null); - writer.WriteProperty(options, PropTypical, value.Typical, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.AnomalyCauseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.AnomalyCauseConverter))] public sealed partial class AnomalyCause { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyDetectors.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyDetectors.Converters.g.cs new file mode 100644 index 00000000000..6712f26785e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyDetectors.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class AnomalyDetectorsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCategorizationAnalyzer = System.Text.Json.JsonEncodedText.Encode("categorization_analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropCategorizationExamplesLimit = System.Text.Json.JsonEncodedText.Encode("categorization_examples_limit"); + private static readonly System.Text.Json.JsonEncodedText PropDailyModelSnapshotRetentionAfterDays = System.Text.Json.JsonEncodedText.Encode("daily_model_snapshot_retention_after_days"); + private static readonly System.Text.Json.JsonEncodedText PropModelMemoryLimit = System.Text.Json.JsonEncodedText.Encode("model_memory_limit"); + private static readonly System.Text.Json.JsonEncodedText PropModelSnapshotRetentionDays = System.Text.Json.JsonEncodedText.Encode("model_snapshot_retention_days"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.AnomalyDetectors Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCategorizationAnalyzer = default; + LocalJsonValue propCategorizationExamplesLimit = default; + LocalJsonValue propDailyModelSnapshotRetentionAfterDays = default; + LocalJsonValue propModelMemoryLimit = default; + LocalJsonValue propModelSnapshotRetentionDays = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCategorizationAnalyzer.TryReadProperty(ref reader, options, PropCategorizationAnalyzer, null)) + { + continue; + } + + if (propCategorizationExamplesLimit.TryReadProperty(ref reader, options, PropCategorizationExamplesLimit, null)) + { + continue; + } + + if (propDailyModelSnapshotRetentionAfterDays.TryReadProperty(ref reader, options, PropDailyModelSnapshotRetentionAfterDays, null)) + { + continue; + } + + if (propModelMemoryLimit.TryReadProperty(ref reader, options, PropModelMemoryLimit, null)) + { + continue; + } + + if (propModelSnapshotRetentionDays.TryReadProperty(ref reader, options, PropModelSnapshotRetentionDays, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.AnomalyDetectors(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CategorizationAnalyzer = propCategorizationAnalyzer.Value, + CategorizationExamplesLimit = propCategorizationExamplesLimit.Value, + DailyModelSnapshotRetentionAfterDays = propDailyModelSnapshotRetentionAfterDays.Value, + ModelMemoryLimit = propModelMemoryLimit.Value, + ModelSnapshotRetentionDays = propModelSnapshotRetentionDays.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.AnomalyDetectors value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCategorizationAnalyzer, value.CategorizationAnalyzer, null, null); + writer.WriteProperty(options, PropCategorizationExamplesLimit, value.CategorizationExamplesLimit, null, null); + writer.WriteProperty(options, PropDailyModelSnapshotRetentionAfterDays, value.DailyModelSnapshotRetentionAfterDays, null, null); + writer.WriteProperty(options, PropModelMemoryLimit, value.ModelMemoryLimit, null, null); + writer.WriteProperty(options, PropModelSnapshotRetentionDays, value.ModelSnapshotRetentionDays, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyDetectors.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyDetectors.g.cs index bd60d147eed..4e07386837f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyDetectors.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyDetectors.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class AnomalyDetectorsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCategorizationAnalyzer = System.Text.Json.JsonEncodedText.Encode("categorization_analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropCategorizationExamplesLimit = System.Text.Json.JsonEncodedText.Encode("categorization_examples_limit"); - private static readonly System.Text.Json.JsonEncodedText PropDailyModelSnapshotRetentionAfterDays = System.Text.Json.JsonEncodedText.Encode("daily_model_snapshot_retention_after_days"); - private static readonly System.Text.Json.JsonEncodedText PropModelMemoryLimit = System.Text.Json.JsonEncodedText.Encode("model_memory_limit"); - private static readonly System.Text.Json.JsonEncodedText PropModelSnapshotRetentionDays = System.Text.Json.JsonEncodedText.Encode("model_snapshot_retention_days"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.AnomalyDetectors Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCategorizationAnalyzer = default; - LocalJsonValue propCategorizationExamplesLimit = default; - LocalJsonValue propDailyModelSnapshotRetentionAfterDays = default; - LocalJsonValue propModelMemoryLimit = default; - LocalJsonValue propModelSnapshotRetentionDays = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCategorizationAnalyzer.TryReadProperty(ref reader, options, PropCategorizationAnalyzer, null)) - { - continue; - } - - if (propCategorizationExamplesLimit.TryReadProperty(ref reader, options, PropCategorizationExamplesLimit, null)) - { - continue; - } - - if (propDailyModelSnapshotRetentionAfterDays.TryReadProperty(ref reader, options, PropDailyModelSnapshotRetentionAfterDays, null)) - { - continue; - } - - if (propModelMemoryLimit.TryReadProperty(ref reader, options, PropModelMemoryLimit, null)) - { - continue; - } - - if (propModelSnapshotRetentionDays.TryReadProperty(ref reader, options, PropModelSnapshotRetentionDays, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.AnomalyDetectors(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CategorizationAnalyzer = propCategorizationAnalyzer.Value, - CategorizationExamplesLimit = propCategorizationExamplesLimit.Value, - DailyModelSnapshotRetentionAfterDays = propDailyModelSnapshotRetentionAfterDays.Value, - ModelMemoryLimit = propModelMemoryLimit.Value, - ModelSnapshotRetentionDays = propModelSnapshotRetentionDays.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.AnomalyDetectors value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCategorizationAnalyzer, value.CategorizationAnalyzer, null, null); - writer.WriteProperty(options, PropCategorizationExamplesLimit, value.CategorizationExamplesLimit, null, null); - writer.WriteProperty(options, PropDailyModelSnapshotRetentionAfterDays, value.DailyModelSnapshotRetentionAfterDays, null, null); - writer.WriteProperty(options, PropModelMemoryLimit, value.ModelMemoryLimit, null, null); - writer.WriteProperty(options, PropModelSnapshotRetentionDays, value.ModelSnapshotRetentionDays, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.AnomalyDetectorsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.AnomalyDetectorsConverter))] public sealed partial class AnomalyDetectors { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyExplanation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyExplanation.Converters.g.cs new file mode 100644 index 00000000000..143198fa16f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyExplanation.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class AnomalyExplanationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnomalyCharacteristicsImpact = System.Text.Json.JsonEncodedText.Encode("anomaly_characteristics_impact"); + private static readonly System.Text.Json.JsonEncodedText PropAnomalyLength = System.Text.Json.JsonEncodedText.Encode("anomaly_length"); + private static readonly System.Text.Json.JsonEncodedText PropAnomalyType = System.Text.Json.JsonEncodedText.Encode("anomaly_type"); + private static readonly System.Text.Json.JsonEncodedText PropHighVariancePenalty = System.Text.Json.JsonEncodedText.Encode("high_variance_penalty"); + private static readonly System.Text.Json.JsonEncodedText PropIncompleteBucketPenalty = System.Text.Json.JsonEncodedText.Encode("incomplete_bucket_penalty"); + private static readonly System.Text.Json.JsonEncodedText PropLowerConfidenceBound = System.Text.Json.JsonEncodedText.Encode("lower_confidence_bound"); + private static readonly System.Text.Json.JsonEncodedText PropMultiBucketImpact = System.Text.Json.JsonEncodedText.Encode("multi_bucket_impact"); + private static readonly System.Text.Json.JsonEncodedText PropSingleBucketImpact = System.Text.Json.JsonEncodedText.Encode("single_bucket_impact"); + private static readonly System.Text.Json.JsonEncodedText PropTypicalValue = System.Text.Json.JsonEncodedText.Encode("typical_value"); + private static readonly System.Text.Json.JsonEncodedText PropUpperConfidenceBound = System.Text.Json.JsonEncodedText.Encode("upper_confidence_bound"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.AnomalyExplanation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnomalyCharacteristicsImpact = default; + LocalJsonValue propAnomalyLength = default; + LocalJsonValue propAnomalyType = default; + LocalJsonValue propHighVariancePenalty = default; + LocalJsonValue propIncompleteBucketPenalty = default; + LocalJsonValue propLowerConfidenceBound = default; + LocalJsonValue propMultiBucketImpact = default; + LocalJsonValue propSingleBucketImpact = default; + LocalJsonValue propTypicalValue = default; + LocalJsonValue propUpperConfidenceBound = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnomalyCharacteristicsImpact.TryReadProperty(ref reader, options, PropAnomalyCharacteristicsImpact, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propAnomalyLength.TryReadProperty(ref reader, options, PropAnomalyLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propAnomalyType.TryReadProperty(ref reader, options, PropAnomalyType, null)) + { + continue; + } + + if (propHighVariancePenalty.TryReadProperty(ref reader, options, PropHighVariancePenalty, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIncompleteBucketPenalty.TryReadProperty(ref reader, options, PropIncompleteBucketPenalty, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLowerConfidenceBound.TryReadProperty(ref reader, options, PropLowerConfidenceBound, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMultiBucketImpact.TryReadProperty(ref reader, options, PropMultiBucketImpact, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSingleBucketImpact.TryReadProperty(ref reader, options, PropSingleBucketImpact, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTypicalValue.TryReadProperty(ref reader, options, PropTypicalValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propUpperConfidenceBound.TryReadProperty(ref reader, options, PropUpperConfidenceBound, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.AnomalyExplanation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AnomalyCharacteristicsImpact = propAnomalyCharacteristicsImpact.Value, + AnomalyLength = propAnomalyLength.Value, + AnomalyType = propAnomalyType.Value, + HighVariancePenalty = propHighVariancePenalty.Value, + IncompleteBucketPenalty = propIncompleteBucketPenalty.Value, + LowerConfidenceBound = propLowerConfidenceBound.Value, + MultiBucketImpact = propMultiBucketImpact.Value, + SingleBucketImpact = propSingleBucketImpact.Value, + TypicalValue = propTypicalValue.Value, + UpperConfidenceBound = propUpperConfidenceBound.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.AnomalyExplanation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnomalyCharacteristicsImpact, value.AnomalyCharacteristicsImpact, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropAnomalyLength, value.AnomalyLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropAnomalyType, value.AnomalyType, null, null); + writer.WriteProperty(options, PropHighVariancePenalty, value.HighVariancePenalty, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIncompleteBucketPenalty, value.IncompleteBucketPenalty, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLowerConfidenceBound, value.LowerConfidenceBound, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMultiBucketImpact, value.MultiBucketImpact, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSingleBucketImpact, value.SingleBucketImpact, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTypicalValue, value.TypicalValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropUpperConfidenceBound, value.UpperConfidenceBound, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyExplanation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyExplanation.g.cs index 2608051edd8..a21897bfdba 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyExplanation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnomalyExplanation.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class AnomalyExplanationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnomalyCharacteristicsImpact = System.Text.Json.JsonEncodedText.Encode("anomaly_characteristics_impact"); - private static readonly System.Text.Json.JsonEncodedText PropAnomalyLength = System.Text.Json.JsonEncodedText.Encode("anomaly_length"); - private static readonly System.Text.Json.JsonEncodedText PropAnomalyType = System.Text.Json.JsonEncodedText.Encode("anomaly_type"); - private static readonly System.Text.Json.JsonEncodedText PropHighVariancePenalty = System.Text.Json.JsonEncodedText.Encode("high_variance_penalty"); - private static readonly System.Text.Json.JsonEncodedText PropIncompleteBucketPenalty = System.Text.Json.JsonEncodedText.Encode("incomplete_bucket_penalty"); - private static readonly System.Text.Json.JsonEncodedText PropLowerConfidenceBound = System.Text.Json.JsonEncodedText.Encode("lower_confidence_bound"); - private static readonly System.Text.Json.JsonEncodedText PropMultiBucketImpact = System.Text.Json.JsonEncodedText.Encode("multi_bucket_impact"); - private static readonly System.Text.Json.JsonEncodedText PropSingleBucketImpact = System.Text.Json.JsonEncodedText.Encode("single_bucket_impact"); - private static readonly System.Text.Json.JsonEncodedText PropTypicalValue = System.Text.Json.JsonEncodedText.Encode("typical_value"); - private static readonly System.Text.Json.JsonEncodedText PropUpperConfidenceBound = System.Text.Json.JsonEncodedText.Encode("upper_confidence_bound"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.AnomalyExplanation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnomalyCharacteristicsImpact = default; - LocalJsonValue propAnomalyLength = default; - LocalJsonValue propAnomalyType = default; - LocalJsonValue propHighVariancePenalty = default; - LocalJsonValue propIncompleteBucketPenalty = default; - LocalJsonValue propLowerConfidenceBound = default; - LocalJsonValue propMultiBucketImpact = default; - LocalJsonValue propSingleBucketImpact = default; - LocalJsonValue propTypicalValue = default; - LocalJsonValue propUpperConfidenceBound = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnomalyCharacteristicsImpact.TryReadProperty(ref reader, options, PropAnomalyCharacteristicsImpact, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propAnomalyLength.TryReadProperty(ref reader, options, PropAnomalyLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propAnomalyType.TryReadProperty(ref reader, options, PropAnomalyType, null)) - { - continue; - } - - if (propHighVariancePenalty.TryReadProperty(ref reader, options, PropHighVariancePenalty, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIncompleteBucketPenalty.TryReadProperty(ref reader, options, PropIncompleteBucketPenalty, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLowerConfidenceBound.TryReadProperty(ref reader, options, PropLowerConfidenceBound, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMultiBucketImpact.TryReadProperty(ref reader, options, PropMultiBucketImpact, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSingleBucketImpact.TryReadProperty(ref reader, options, PropSingleBucketImpact, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTypicalValue.TryReadProperty(ref reader, options, PropTypicalValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propUpperConfidenceBound.TryReadProperty(ref reader, options, PropUpperConfidenceBound, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.AnomalyExplanation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AnomalyCharacteristicsImpact = propAnomalyCharacteristicsImpact.Value, - AnomalyLength = propAnomalyLength.Value, - AnomalyType = propAnomalyType.Value, - HighVariancePenalty = propHighVariancePenalty.Value, - IncompleteBucketPenalty = propIncompleteBucketPenalty.Value, - LowerConfidenceBound = propLowerConfidenceBound.Value, - MultiBucketImpact = propMultiBucketImpact.Value, - SingleBucketImpact = propSingleBucketImpact.Value, - TypicalValue = propTypicalValue.Value, - UpperConfidenceBound = propUpperConfidenceBound.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.AnomalyExplanation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnomalyCharacteristicsImpact, value.AnomalyCharacteristicsImpact, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropAnomalyLength, value.AnomalyLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropAnomalyType, value.AnomalyType, null, null); - writer.WriteProperty(options, PropHighVariancePenalty, value.HighVariancePenalty, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIncompleteBucketPenalty, value.IncompleteBucketPenalty, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLowerConfidenceBound, value.LowerConfidenceBound, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMultiBucketImpact, value.MultiBucketImpact, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSingleBucketImpact, value.SingleBucketImpact, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTypicalValue, value.TypicalValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropUpperConfidenceBound, value.UpperConfidenceBound, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.AnomalyExplanationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.AnomalyExplanationConverter))] public sealed partial class AnomalyExplanation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ApiKeyAuthorization.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ApiKeyAuthorization.Converters.g.cs new file mode 100644 index 00000000000..36f0dae25f5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ApiKeyAuthorization.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ApiKeyAuthorizationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.ApiKeyAuthorization Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.ApiKeyAuthorization(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ApiKeyAuthorization value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ApiKeyAuthorization.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ApiKeyAuthorization.g.cs index 5f938778daa..4a766d494c4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ApiKeyAuthorization.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ApiKeyAuthorization.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class ApiKeyAuthorizationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.ApiKeyAuthorization Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.ApiKeyAuthorization(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ApiKeyAuthorization value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ApiKeyAuthorizationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ApiKeyAuthorizationConverter))] public sealed partial class ApiKeyAuthorization { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AppliesTo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AppliesTo.Converters.g.cs new file mode 100644 index 00000000000..5d1d7759303 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AppliesTo.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class AppliesToConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberActual = System.Text.Json.JsonEncodedText.Encode("actual"); + private static readonly System.Text.Json.JsonEncodedText MemberDiffFromTypical = System.Text.Json.JsonEncodedText.Encode("diff_from_typical"); + private static readonly System.Text.Json.JsonEncodedText MemberTime = System.Text.Json.JsonEncodedText.Encode("time"); + private static readonly System.Text.Json.JsonEncodedText MemberTypical = System.Text.Json.JsonEncodedText.Encode("typical"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberActual)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo.Actual; + } + + if (reader.ValueTextEquals(MemberDiffFromTypical)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo.DiffFromTypical; + } + + if (reader.ValueTextEquals(MemberTime)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo.Time; + } + + if (reader.ValueTextEquals(MemberTypical)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo.Typical; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberActual.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo.Actual; + } + + if (string.Equals(value, MemberDiffFromTypical.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo.DiffFromTypical; + } + + if (string.Equals(value, MemberTime.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo.Time; + } + + if (string.Equals(value, MemberTypical.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo.Typical; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo.Actual: + writer.WriteStringValue(MemberActual); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo.DiffFromTypical: + writer.WriteStringValue(MemberDiffFromTypical); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo.Time: + writer.WriteStringValue(MemberTime); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo.Typical: + writer.WriteStringValue(MemberTypical); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.AppliesTo value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AppliesTo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AppliesTo.g.cs new file mode 100644 index 00000000000..4d1c11f54c5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AppliesTo.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.AppliesToConverter))] +public enum AppliesTo +{ + [System.Runtime.Serialization.EnumMember(Value = "actual")] + Actual, + [System.Runtime.Serialization.EnumMember(Value = "diff_from_typical")] + DiffFromTypical, + [System.Runtime.Serialization.EnumMember(Value = "time")] + Time, + [System.Runtime.Serialization.EnumMember(Value = "typical")] + Typical +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/BucketInfluencer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/BucketInfluencer.Converters.g.cs new file mode 100644 index 00000000000..c41fe4ceb1b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/BucketInfluencer.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class BucketInfluencerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnomalyScore = System.Text.Json.JsonEncodedText.Encode("anomaly_score"); + private static readonly System.Text.Json.JsonEncodedText PropBucketSpan = System.Text.Json.JsonEncodedText.Encode("bucket_span"); + private static readonly System.Text.Json.JsonEncodedText PropInfluencerFieldName = System.Text.Json.JsonEncodedText.Encode("influencer_field_name"); + private static readonly System.Text.Json.JsonEncodedText PropInitialAnomalyScore = System.Text.Json.JsonEncodedText.Encode("initial_anomaly_score"); + private static readonly System.Text.Json.JsonEncodedText PropIsInterim = System.Text.Json.JsonEncodedText.Encode("is_interim"); + private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); + private static readonly System.Text.Json.JsonEncodedText PropProbability = System.Text.Json.JsonEncodedText.Encode("probability"); + private static readonly System.Text.Json.JsonEncodedText PropRawAnomalyScore = System.Text.Json.JsonEncodedText.Encode("raw_anomaly_score"); + private static readonly System.Text.Json.JsonEncodedText PropResultType = System.Text.Json.JsonEncodedText.Encode("result_type"); + private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); + private static readonly System.Text.Json.JsonEncodedText PropTimestampString = System.Text.Json.JsonEncodedText.Encode("timestamp_string"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.BucketInfluencer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnomalyScore = default; + LocalJsonValue propBucketSpan = default; + LocalJsonValue propInfluencerFieldName = default; + LocalJsonValue propInitialAnomalyScore = default; + LocalJsonValue propIsInterim = default; + LocalJsonValue propJobId = default; + LocalJsonValue propProbability = default; + LocalJsonValue propRawAnomalyScore = default; + LocalJsonValue propResultType = default; + LocalJsonValue propTimestamp = default; + LocalJsonValue propTimestampString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnomalyScore.TryReadProperty(ref reader, options, PropAnomalyScore, null)) + { + continue; + } + + if (propBucketSpan.TryReadProperty(ref reader, options, PropBucketSpan, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanSecondsMarker)))) + { + continue; + } + + if (propInfluencerFieldName.TryReadProperty(ref reader, options, PropInfluencerFieldName, null)) + { + continue; + } + + if (propInitialAnomalyScore.TryReadProperty(ref reader, options, PropInitialAnomalyScore, null)) + { + continue; + } + + if (propIsInterim.TryReadProperty(ref reader, options, PropIsInterim, null)) + { + continue; + } + + if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) + { + continue; + } + + if (propProbability.TryReadProperty(ref reader, options, PropProbability, null)) + { + continue; + } + + if (propRawAnomalyScore.TryReadProperty(ref reader, options, PropRawAnomalyScore, null)) + { + continue; + } + + if (propResultType.TryReadProperty(ref reader, options, PropResultType, null)) + { + continue; + } + + if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propTimestampString.TryReadProperty(ref reader, options, PropTimestampString, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.BucketInfluencer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AnomalyScore = propAnomalyScore.Value, + BucketSpan = propBucketSpan.Value, + InfluencerFieldName = propInfluencerFieldName.Value, + InitialAnomalyScore = propInitialAnomalyScore.Value, + IsInterim = propIsInterim.Value, + JobId = propJobId.Value, + Probability = propProbability.Value, + RawAnomalyScore = propRawAnomalyScore.Value, + ResultType = propResultType.Value, + Timestamp = propTimestamp.Value, + TimestampString = propTimestampString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.BucketInfluencer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnomalyScore, value.AnomalyScore, null, null); + writer.WriteProperty(options, PropBucketSpan, value.BucketSpan, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanSecondsMarker))); + writer.WriteProperty(options, PropInfluencerFieldName, value.InfluencerFieldName, null, null); + writer.WriteProperty(options, PropInitialAnomalyScore, value.InitialAnomalyScore, null, null); + writer.WriteProperty(options, PropIsInterim, value.IsInterim, null, null); + writer.WriteProperty(options, PropJobId, value.JobId, null, null); + writer.WriteProperty(options, PropProbability, value.Probability, null, null); + writer.WriteProperty(options, PropRawAnomalyScore, value.RawAnomalyScore, null, null); + writer.WriteProperty(options, PropResultType, value.ResultType, null, null); + writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropTimestampString, value.TimestampString, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/BucketInfluencer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/BucketInfluencer.g.cs index 6a083661574..47e3402b233 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/BucketInfluencer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/BucketInfluencer.g.cs @@ -23,136 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class BucketInfluencerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnomalyScore = System.Text.Json.JsonEncodedText.Encode("anomaly_score"); - private static readonly System.Text.Json.JsonEncodedText PropBucketSpan = System.Text.Json.JsonEncodedText.Encode("bucket_span"); - private static readonly System.Text.Json.JsonEncodedText PropInfluencerFieldName = System.Text.Json.JsonEncodedText.Encode("influencer_field_name"); - private static readonly System.Text.Json.JsonEncodedText PropInitialAnomalyScore = System.Text.Json.JsonEncodedText.Encode("initial_anomaly_score"); - private static readonly System.Text.Json.JsonEncodedText PropIsInterim = System.Text.Json.JsonEncodedText.Encode("is_interim"); - private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); - private static readonly System.Text.Json.JsonEncodedText PropProbability = System.Text.Json.JsonEncodedText.Encode("probability"); - private static readonly System.Text.Json.JsonEncodedText PropRawAnomalyScore = System.Text.Json.JsonEncodedText.Encode("raw_anomaly_score"); - private static readonly System.Text.Json.JsonEncodedText PropResultType = System.Text.Json.JsonEncodedText.Encode("result_type"); - private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); - private static readonly System.Text.Json.JsonEncodedText PropTimestampString = System.Text.Json.JsonEncodedText.Encode("timestamp_string"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.BucketInfluencer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnomalyScore = default; - LocalJsonValue propBucketSpan = default; - LocalJsonValue propInfluencerFieldName = default; - LocalJsonValue propInitialAnomalyScore = default; - LocalJsonValue propIsInterim = default; - LocalJsonValue propJobId = default; - LocalJsonValue propProbability = default; - LocalJsonValue propRawAnomalyScore = default; - LocalJsonValue propResultType = default; - LocalJsonValue propTimestamp = default; - LocalJsonValue propTimestampString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnomalyScore.TryReadProperty(ref reader, options, PropAnomalyScore, null)) - { - continue; - } - - if (propBucketSpan.TryReadProperty(ref reader, options, PropBucketSpan, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanSecondsMarker)))) - { - continue; - } - - if (propInfluencerFieldName.TryReadProperty(ref reader, options, PropInfluencerFieldName, null)) - { - continue; - } - - if (propInitialAnomalyScore.TryReadProperty(ref reader, options, PropInitialAnomalyScore, null)) - { - continue; - } - - if (propIsInterim.TryReadProperty(ref reader, options, PropIsInterim, null)) - { - continue; - } - - if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) - { - continue; - } - - if (propProbability.TryReadProperty(ref reader, options, PropProbability, null)) - { - continue; - } - - if (propRawAnomalyScore.TryReadProperty(ref reader, options, PropRawAnomalyScore, null)) - { - continue; - } - - if (propResultType.TryReadProperty(ref reader, options, PropResultType, null)) - { - continue; - } - - if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propTimestampString.TryReadProperty(ref reader, options, PropTimestampString, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.BucketInfluencer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AnomalyScore = propAnomalyScore.Value, - BucketSpan = propBucketSpan.Value, - InfluencerFieldName = propInfluencerFieldName.Value, - InitialAnomalyScore = propInitialAnomalyScore.Value, - IsInterim = propIsInterim.Value, - JobId = propJobId.Value, - Probability = propProbability.Value, - RawAnomalyScore = propRawAnomalyScore.Value, - ResultType = propResultType.Value, - Timestamp = propTimestamp.Value, - TimestampString = propTimestampString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.BucketInfluencer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnomalyScore, value.AnomalyScore, null, null); - writer.WriteProperty(options, PropBucketSpan, value.BucketSpan, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanSecondsMarker))); - writer.WriteProperty(options, PropInfluencerFieldName, value.InfluencerFieldName, null, null); - writer.WriteProperty(options, PropInitialAnomalyScore, value.InitialAnomalyScore, null, null); - writer.WriteProperty(options, PropIsInterim, value.IsInterim, null, null); - writer.WriteProperty(options, PropJobId, value.JobId, null, null); - writer.WriteProperty(options, PropProbability, value.Probability, null, null); - writer.WriteProperty(options, PropRawAnomalyScore, value.RawAnomalyScore, null, null); - writer.WriteProperty(options, PropResultType, value.ResultType, null, null); - writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropTimestampString, value.TimestampString, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.BucketInfluencerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.BucketInfluencerConverter))] public sealed partial class BucketInfluencer { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/BucketSummary.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/BucketSummary.Converters.g.cs new file mode 100644 index 00000000000..e65e1912fc9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/BucketSummary.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class BucketSummaryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnomalyScore = System.Text.Json.JsonEncodedText.Encode("anomaly_score"); + private static readonly System.Text.Json.JsonEncodedText PropBucketInfluencers = System.Text.Json.JsonEncodedText.Encode("bucket_influencers"); + private static readonly System.Text.Json.JsonEncodedText PropBucketSpan = System.Text.Json.JsonEncodedText.Encode("bucket_span"); + private static readonly System.Text.Json.JsonEncodedText PropEventCount = System.Text.Json.JsonEncodedText.Encode("event_count"); + private static readonly System.Text.Json.JsonEncodedText PropInitialAnomalyScore = System.Text.Json.JsonEncodedText.Encode("initial_anomaly_score"); + private static readonly System.Text.Json.JsonEncodedText PropIsInterim = System.Text.Json.JsonEncodedText.Encode("is_interim"); + private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); + private static readonly System.Text.Json.JsonEncodedText PropProcessingTimeMs = System.Text.Json.JsonEncodedText.Encode("processing_time_ms"); + private static readonly System.Text.Json.JsonEncodedText PropResultType = System.Text.Json.JsonEncodedText.Encode("result_type"); + private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); + private static readonly System.Text.Json.JsonEncodedText PropTimestampString = System.Text.Json.JsonEncodedText.Encode("timestamp_string"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.BucketSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnomalyScore = default; + LocalJsonValue> propBucketInfluencers = default; + LocalJsonValue propBucketSpan = default; + LocalJsonValue propEventCount = default; + LocalJsonValue propInitialAnomalyScore = default; + LocalJsonValue propIsInterim = default; + LocalJsonValue propJobId = default; + LocalJsonValue propProcessingTimeMs = default; + LocalJsonValue propResultType = default; + LocalJsonValue propTimestamp = default; + LocalJsonValue propTimestampString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnomalyScore.TryReadProperty(ref reader, options, PropAnomalyScore, null)) + { + continue; + } + + if (propBucketInfluencers.TryReadProperty(ref reader, options, PropBucketInfluencers, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propBucketSpan.TryReadProperty(ref reader, options, PropBucketSpan, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanSecondsMarker)))) + { + continue; + } + + if (propEventCount.TryReadProperty(ref reader, options, PropEventCount, null)) + { + continue; + } + + if (propInitialAnomalyScore.TryReadProperty(ref reader, options, PropInitialAnomalyScore, null)) + { + continue; + } + + if (propIsInterim.TryReadProperty(ref reader, options, PropIsInterim, null)) + { + continue; + } + + if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) + { + continue; + } + + if (propProcessingTimeMs.TryReadProperty(ref reader, options, PropProcessingTimeMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propResultType.TryReadProperty(ref reader, options, PropResultType, null)) + { + continue; + } + + if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propTimestampString.TryReadProperty(ref reader, options, PropTimestampString, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.BucketSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AnomalyScore = propAnomalyScore.Value, + BucketInfluencers = propBucketInfluencers.Value, + BucketSpan = propBucketSpan.Value, + EventCount = propEventCount.Value, + InitialAnomalyScore = propInitialAnomalyScore.Value, + IsInterim = propIsInterim.Value, + JobId = propJobId.Value, + ProcessingTimeMs = propProcessingTimeMs.Value, + ResultType = propResultType.Value, + Timestamp = propTimestamp.Value, + TimestampString = propTimestampString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.BucketSummary value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnomalyScore, value.AnomalyScore, null, null); + writer.WriteProperty(options, PropBucketInfluencers, value.BucketInfluencers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropBucketSpan, value.BucketSpan, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanSecondsMarker))); + writer.WriteProperty(options, PropEventCount, value.EventCount, null, null); + writer.WriteProperty(options, PropInitialAnomalyScore, value.InitialAnomalyScore, null, null); + writer.WriteProperty(options, PropIsInterim, value.IsInterim, null, null); + writer.WriteProperty(options, PropJobId, value.JobId, null, null); + writer.WriteProperty(options, PropProcessingTimeMs, value.ProcessingTimeMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropResultType, value.ResultType, null, null); + writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropTimestampString, value.TimestampString, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/BucketSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/BucketSummary.g.cs index a1d1aa46b6f..47f606c3102 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/BucketSummary.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/BucketSummary.g.cs @@ -23,136 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class BucketSummaryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnomalyScore = System.Text.Json.JsonEncodedText.Encode("anomaly_score"); - private static readonly System.Text.Json.JsonEncodedText PropBucketInfluencers = System.Text.Json.JsonEncodedText.Encode("bucket_influencers"); - private static readonly System.Text.Json.JsonEncodedText PropBucketSpan = System.Text.Json.JsonEncodedText.Encode("bucket_span"); - private static readonly System.Text.Json.JsonEncodedText PropEventCount = System.Text.Json.JsonEncodedText.Encode("event_count"); - private static readonly System.Text.Json.JsonEncodedText PropInitialAnomalyScore = System.Text.Json.JsonEncodedText.Encode("initial_anomaly_score"); - private static readonly System.Text.Json.JsonEncodedText PropIsInterim = System.Text.Json.JsonEncodedText.Encode("is_interim"); - private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); - private static readonly System.Text.Json.JsonEncodedText PropProcessingTimeMs = System.Text.Json.JsonEncodedText.Encode("processing_time_ms"); - private static readonly System.Text.Json.JsonEncodedText PropResultType = System.Text.Json.JsonEncodedText.Encode("result_type"); - private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); - private static readonly System.Text.Json.JsonEncodedText PropTimestampString = System.Text.Json.JsonEncodedText.Encode("timestamp_string"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.BucketSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnomalyScore = default; - LocalJsonValue> propBucketInfluencers = default; - LocalJsonValue propBucketSpan = default; - LocalJsonValue propEventCount = default; - LocalJsonValue propInitialAnomalyScore = default; - LocalJsonValue propIsInterim = default; - LocalJsonValue propJobId = default; - LocalJsonValue propProcessingTimeMs = default; - LocalJsonValue propResultType = default; - LocalJsonValue propTimestamp = default; - LocalJsonValue propTimestampString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnomalyScore.TryReadProperty(ref reader, options, PropAnomalyScore, null)) - { - continue; - } - - if (propBucketInfluencers.TryReadProperty(ref reader, options, PropBucketInfluencers, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propBucketSpan.TryReadProperty(ref reader, options, PropBucketSpan, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanSecondsMarker)))) - { - continue; - } - - if (propEventCount.TryReadProperty(ref reader, options, PropEventCount, null)) - { - continue; - } - - if (propInitialAnomalyScore.TryReadProperty(ref reader, options, PropInitialAnomalyScore, null)) - { - continue; - } - - if (propIsInterim.TryReadProperty(ref reader, options, PropIsInterim, null)) - { - continue; - } - - if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) - { - continue; - } - - if (propProcessingTimeMs.TryReadProperty(ref reader, options, PropProcessingTimeMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propResultType.TryReadProperty(ref reader, options, PropResultType, null)) - { - continue; - } - - if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propTimestampString.TryReadProperty(ref reader, options, PropTimestampString, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.BucketSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AnomalyScore = propAnomalyScore.Value, - BucketInfluencers = propBucketInfluencers.Value, - BucketSpan = propBucketSpan.Value, - EventCount = propEventCount.Value, - InitialAnomalyScore = propInitialAnomalyScore.Value, - IsInterim = propIsInterim.Value, - JobId = propJobId.Value, - ProcessingTimeMs = propProcessingTimeMs.Value, - ResultType = propResultType.Value, - Timestamp = propTimestamp.Value, - TimestampString = propTimestampString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.BucketSummary value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnomalyScore, value.AnomalyScore, null, null); - writer.WriteProperty(options, PropBucketInfluencers, value.BucketInfluencers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropBucketSpan, value.BucketSpan, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanSecondsMarker))); - writer.WriteProperty(options, PropEventCount, value.EventCount, null, null); - writer.WriteProperty(options, PropInitialAnomalyScore, value.InitialAnomalyScore, null, null); - writer.WriteProperty(options, PropIsInterim, value.IsInterim, null, null); - writer.WriteProperty(options, PropJobId, value.JobId, null, null); - writer.WriteProperty(options, PropProcessingTimeMs, value.ProcessingTimeMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropResultType, value.ResultType, null, null); - writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropTimestampString, value.TimestampString, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.BucketSummaryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.BucketSummaryConverter))] public sealed partial class BucketSummary { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Calendar.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Calendar.Converters.g.cs new file mode 100644 index 00000000000..f79d71155a7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Calendar.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class CalendarConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCalendarId = System.Text.Json.JsonEncodedText.Encode("calendar_id"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropJobIds = System.Text.Json.JsonEncodedText.Encode("job_ids"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.Calendar Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCalendarId = default; + LocalJsonValue propDescription = default; + LocalJsonValue> propJobIds = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCalendarId.TryReadProperty(ref reader, options, PropCalendarId, null)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propJobIds.TryReadProperty(ref reader, options, PropJobIds, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.Calendar(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CalendarId = propCalendarId.Value, + Description = propDescription.Value, + JobIds = propJobIds.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Calendar value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCalendarId, value.CalendarId, null, null); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropJobIds, value.JobIds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Calendar.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Calendar.g.cs index 6f859fb20e5..c4d6e1e305f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Calendar.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Calendar.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class CalendarConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCalendarId = System.Text.Json.JsonEncodedText.Encode("calendar_id"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropJobIds = System.Text.Json.JsonEncodedText.Encode("job_ids"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.Calendar Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCalendarId = default; - LocalJsonValue propDescription = default; - LocalJsonValue> propJobIds = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCalendarId.TryReadProperty(ref reader, options, PropCalendarId, null)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propJobIds.TryReadProperty(ref reader, options, PropJobIds, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.Calendar(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CalendarId = propCalendarId.Value, - Description = propDescription.Value, - JobIds = propJobIds.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Calendar value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCalendarId, value.CalendarId, null, null); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropJobIds, value.JobIds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.CalendarConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.CalendarConverter))] public sealed partial class Calendar { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CalendarEvent.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CalendarEvent.Converters.g.cs new file mode 100644 index 00000000000..8e0564057c6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CalendarEvent.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class CalendarEventConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCalendarId = System.Text.Json.JsonEncodedText.Encode("calendar_id"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropEndTime = System.Text.Json.JsonEncodedText.Encode("end_time"); + private static readonly System.Text.Json.JsonEncodedText PropEventId = System.Text.Json.JsonEncodedText.Encode("event_id"); + private static readonly System.Text.Json.JsonEncodedText PropForceTimeShift = System.Text.Json.JsonEncodedText.Encode("force_time_shift"); + private static readonly System.Text.Json.JsonEncodedText PropSkipModelUpdate = System.Text.Json.JsonEncodedText.Encode("skip_model_update"); + private static readonly System.Text.Json.JsonEncodedText PropSkipResult = System.Text.Json.JsonEncodedText.Encode("skip_result"); + private static readonly System.Text.Json.JsonEncodedText PropStartTime = System.Text.Json.JsonEncodedText.Encode("start_time"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.CalendarEvent Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCalendarId = default; + LocalJsonValue propDescription = default; + LocalJsonValue propEndTime = default; + LocalJsonValue propEventId = default; + LocalJsonValue propForceTimeShift = default; + LocalJsonValue propSkipModelUpdate = default; + LocalJsonValue propSkipResult = default; + LocalJsonValue propStartTime = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCalendarId.TryReadProperty(ref reader, options, PropCalendarId, null)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propEndTime.TryReadProperty(ref reader, options, PropEndTime, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propEventId.TryReadProperty(ref reader, options, PropEventId, null)) + { + continue; + } + + if (propForceTimeShift.TryReadProperty(ref reader, options, PropForceTimeShift, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSkipModelUpdate.TryReadProperty(ref reader, options, PropSkipModelUpdate, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSkipResult.TryReadProperty(ref reader, options, PropSkipResult, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propStartTime.TryReadProperty(ref reader, options, PropStartTime, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.CalendarEvent(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CalendarId = propCalendarId.Value, + Description = propDescription.Value, + EndTime = propEndTime.Value, + EventId = propEventId.Value, + ForceTimeShift = propForceTimeShift.Value, + SkipModelUpdate = propSkipModelUpdate.Value, + SkipResult = propSkipResult.Value, + StartTime = propStartTime.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.CalendarEvent value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCalendarId, value.CalendarId, null, null); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropEndTime, value.EndTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropEventId, value.EventId, null, null); + writer.WriteProperty(options, PropForceTimeShift, value.ForceTimeShift, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSkipModelUpdate, value.SkipModelUpdate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSkipResult, value.SkipResult, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropStartTime, value.StartTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CalendarEvent.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CalendarEvent.g.cs index bd7e21aa60e..0477e4e3c49 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CalendarEvent.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CalendarEvent.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class CalendarEventConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCalendarId = System.Text.Json.JsonEncodedText.Encode("calendar_id"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropEndTime = System.Text.Json.JsonEncodedText.Encode("end_time"); - private static readonly System.Text.Json.JsonEncodedText PropEventId = System.Text.Json.JsonEncodedText.Encode("event_id"); - private static readonly System.Text.Json.JsonEncodedText PropForceTimeShift = System.Text.Json.JsonEncodedText.Encode("force_time_shift"); - private static readonly System.Text.Json.JsonEncodedText PropSkipModelUpdate = System.Text.Json.JsonEncodedText.Encode("skip_model_update"); - private static readonly System.Text.Json.JsonEncodedText PropSkipResult = System.Text.Json.JsonEncodedText.Encode("skip_result"); - private static readonly System.Text.Json.JsonEncodedText PropStartTime = System.Text.Json.JsonEncodedText.Encode("start_time"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.CalendarEvent Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCalendarId = default; - LocalJsonValue propDescription = default; - LocalJsonValue propEndTime = default; - LocalJsonValue propEventId = default; - LocalJsonValue propForceTimeShift = default; - LocalJsonValue propSkipModelUpdate = default; - LocalJsonValue propSkipResult = default; - LocalJsonValue propStartTime = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCalendarId.TryReadProperty(ref reader, options, PropCalendarId, null)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propEndTime.TryReadProperty(ref reader, options, PropEndTime, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propEventId.TryReadProperty(ref reader, options, PropEventId, null)) - { - continue; - } - - if (propForceTimeShift.TryReadProperty(ref reader, options, PropForceTimeShift, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSkipModelUpdate.TryReadProperty(ref reader, options, PropSkipModelUpdate, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSkipResult.TryReadProperty(ref reader, options, PropSkipResult, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propStartTime.TryReadProperty(ref reader, options, PropStartTime, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.CalendarEvent(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CalendarId = propCalendarId.Value, - Description = propDescription.Value, - EndTime = propEndTime.Value, - EventId = propEventId.Value, - ForceTimeShift = propForceTimeShift.Value, - SkipModelUpdate = propSkipModelUpdate.Value, - SkipResult = propSkipResult.Value, - StartTime = propStartTime.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.CalendarEvent value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCalendarId, value.CalendarId, null, null); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropEndTime, value.EndTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropEventId, value.EventId, null, null); - writer.WriteProperty(options, PropForceTimeShift, value.ForceTimeShift, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSkipModelUpdate, value.SkipModelUpdate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSkipResult, value.SkipResult, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropStartTime, value.StartTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.CalendarEventConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.CalendarEventConverter))] public sealed partial class CalendarEvent { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationAnalyzer.Converters.g.cs new file mode 100644 index 00000000000..c483bb813cb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationAnalyzer.Converters.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class CategorizationAnalyzerConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject); + return selector(ref reader, options) switch + { + Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer(reader.ReadValue(options, null)), + Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer(reader.ReadValue(options, null)), + _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer)}") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Tag) + { + case Elastic.Clients.Elasticsearch.UnionTag.T1: + { + writer.WriteValue(options, value.Value1, null); + break; + } + + case Elastic.Clients.Elasticsearch.UnionTag.T2: + { + writer.WriteValue(options, value.Value2, null); + break; + } + + default: + throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationAnalyzer.g.cs index 946e25d90c1..1d9e63d523a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationAnalyzer.g.cs @@ -23,42 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class CategorizationAnalyzerConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject); - return selector(ref reader, options) switch - { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer(reader.ReadValue(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer(reader.ReadValue(options, null)), - _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer)}") - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer value, System.Text.Json.JsonSerializerOptions options) - { - switch (value.Tag) - { - case Elastic.Clients.Elasticsearch.UnionTag.T1: - { - writer.WriteValue(options, value.Value1, null); - break; - } - - case Elastic.Clients.Elasticsearch.UnionTag.T2: - { - writer.WriteValue(options, value.Value2, null); - break; - } - - default: - throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); - } - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.CategorizationAnalyzerConverter))] public sealed partial class CategorizationAnalyzer : Elastic.Clients.Elasticsearch.Union { public CategorizationAnalyzer(string value) : base(value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationAnalyzerDefinition.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationAnalyzerDefinition.Converters.g.cs new file mode 100644 index 00000000000..3bc999c5ffd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationAnalyzerDefinition.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class CategorizationAnalyzerDefinitionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCharFilter = System.Text.Json.JsonEncodedText.Encode("char_filter"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropTokenizer = System.Text.Json.JsonEncodedText.Encode("tokenizer"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzerDefinition Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propCharFilter = default; + LocalJsonValue?> propFilter = default; + LocalJsonValue propTokenizer = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCharFilter.TryReadProperty(ref reader, options, PropCharFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTokenizer.TryReadProperty(ref reader, options, PropTokenizer, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzerDefinition(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CharFilter = propCharFilter.Value, + Filter = propFilter.Value, + Tokenizer = propTokenizer.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzerDefinition value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCharFilter, value.CharFilter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTokenizer, value.Tokenizer, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationAnalyzerDefinition.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationAnalyzerDefinition.g.cs index a61a1e55c54..e4999cab911 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationAnalyzerDefinition.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationAnalyzerDefinition.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class CategorizationAnalyzerDefinitionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCharFilter = System.Text.Json.JsonEncodedText.Encode("char_filter"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropTokenizer = System.Text.Json.JsonEncodedText.Encode("tokenizer"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzerDefinition Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propCharFilter = default; - LocalJsonValue?> propFilter = default; - LocalJsonValue propTokenizer = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCharFilter.TryReadProperty(ref reader, options, PropCharFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTokenizer.TryReadProperty(ref reader, options, PropTokenizer, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzerDefinition(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CharFilter = propCharFilter.Value, - Filter = propFilter.Value, - Tokenizer = propTokenizer.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzerDefinition value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCharFilter, value.CharFilter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTokenizer, value.Tokenizer, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzerDefinitionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.CategorizationAnalyzerDefinitionConverter))] public sealed partial class CategorizationAnalyzerDefinition { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationStatus.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationStatus.Converters.g.cs new file mode 100644 index 00000000000..82d5091df52 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationStatus.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class CategorizationStatusConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberOk = System.Text.Json.JsonEncodedText.Encode("ok"); + private static readonly System.Text.Json.JsonEncodedText MemberWarn = System.Text.Json.JsonEncodedText.Encode("warn"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.CategorizationStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberOk)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.CategorizationStatus.Ok; + } + + if (reader.ValueTextEquals(MemberWarn)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.CategorizationStatus.Warn; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberOk.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.CategorizationStatus.Ok; + } + + if (string.Equals(value, MemberWarn.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.CategorizationStatus.Warn; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.CategorizationStatus)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.CategorizationStatus value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.MachineLearning.CategorizationStatus.Ok: + writer.WriteStringValue(MemberOk); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.CategorizationStatus.Warn: + writer.WriteStringValue(MemberWarn); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.CategorizationStatus)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.MachineLearning.CategorizationStatus ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.CategorizationStatus value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationStatus.g.cs new file mode 100644 index 00000000000..b5d8fd64314 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/CategorizationStatus.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.CategorizationStatusConverter))] +public enum CategorizationStatus +{ + [System.Runtime.Serialization.EnumMember(Value = "ok")] + Ok, + [System.Runtime.Serialization.EnumMember(Value = "warn")] + Warn +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Category.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Category.Converters.g.cs new file mode 100644 index 00000000000..841dfd5b34d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Category.Converters.g.cs @@ -0,0 +1,180 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class CategoryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCategoryId = System.Text.Json.JsonEncodedText.Encode("category_id"); + private static readonly System.Text.Json.JsonEncodedText PropExamples = System.Text.Json.JsonEncodedText.Encode("examples"); + private static readonly System.Text.Json.JsonEncodedText PropGrokPattern = System.Text.Json.JsonEncodedText.Encode("grok_pattern"); + private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); + private static readonly System.Text.Json.JsonEncodedText PropMaxMatchingLength = System.Text.Json.JsonEncodedText.Encode("max_matching_length"); + private static readonly System.Text.Json.JsonEncodedText PropMlcategory = System.Text.Json.JsonEncodedText.Encode("mlcategory"); + private static readonly System.Text.Json.JsonEncodedText PropNumMatches = System.Text.Json.JsonEncodedText.Encode("num_matches"); + private static readonly System.Text.Json.JsonEncodedText PropP = System.Text.Json.JsonEncodedText.Encode("p"); + private static readonly System.Text.Json.JsonEncodedText PropPartitionFieldName = System.Text.Json.JsonEncodedText.Encode("partition_field_name"); + private static readonly System.Text.Json.JsonEncodedText PropPartitionFieldValue = System.Text.Json.JsonEncodedText.Encode("partition_field_value"); + private static readonly System.Text.Json.JsonEncodedText PropPreferredToCategories = System.Text.Json.JsonEncodedText.Encode("preferred_to_categories"); + private static readonly System.Text.Json.JsonEncodedText PropRegex = System.Text.Json.JsonEncodedText.Encode("regex"); + private static readonly System.Text.Json.JsonEncodedText PropResultType = System.Text.Json.JsonEncodedText.Encode("result_type"); + private static readonly System.Text.Json.JsonEncodedText PropTerms = System.Text.Json.JsonEncodedText.Encode("terms"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.Category Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCategoryId = default; + LocalJsonValue> propExamples = default; + LocalJsonValue propGrokPattern = default; + LocalJsonValue propJobId = default; + LocalJsonValue propMaxMatchingLength = default; + LocalJsonValue propMlcategory = default; + LocalJsonValue propNumMatches = default; + LocalJsonValue propP = default; + LocalJsonValue propPartitionFieldName = default; + LocalJsonValue propPartitionFieldValue = default; + LocalJsonValue?> propPreferredToCategories = default; + LocalJsonValue propRegex = default; + LocalJsonValue propResultType = default; + LocalJsonValue propTerms = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCategoryId.TryReadProperty(ref reader, options, PropCategoryId, null)) + { + continue; + } + + if (propExamples.TryReadProperty(ref reader, options, PropExamples, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propGrokPattern.TryReadProperty(ref reader, options, PropGrokPattern, null)) + { + continue; + } + + if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) + { + continue; + } + + if (propMaxMatchingLength.TryReadProperty(ref reader, options, PropMaxMatchingLength, null)) + { + continue; + } + + if (propMlcategory.TryReadProperty(ref reader, options, PropMlcategory, null)) + { + continue; + } + + if (propNumMatches.TryReadProperty(ref reader, options, PropNumMatches, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propP.TryReadProperty(ref reader, options, PropP, null)) + { + continue; + } + + if (propPartitionFieldName.TryReadProperty(ref reader, options, PropPartitionFieldName, null)) + { + continue; + } + + if (propPartitionFieldValue.TryReadProperty(ref reader, options, PropPartitionFieldValue, null)) + { + continue; + } + + if (propPreferredToCategories.TryReadProperty(ref reader, options, PropPreferredToCategories, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propRegex.TryReadProperty(ref reader, options, PropRegex, null)) + { + continue; + } + + if (propResultType.TryReadProperty(ref reader, options, PropResultType, null)) + { + continue; + } + + if (propTerms.TryReadProperty(ref reader, options, PropTerms, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.Category(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CategoryId = propCategoryId.Value, + Examples = propExamples.Value, + GrokPattern = propGrokPattern.Value, + JobId = propJobId.Value, + MaxMatchingLength = propMaxMatchingLength.Value, + Mlcategory = propMlcategory.Value, + NumMatches = propNumMatches.Value, + P = propP.Value, + PartitionFieldName = propPartitionFieldName.Value, + PartitionFieldValue = propPartitionFieldValue.Value, + PreferredToCategories = propPreferredToCategories.Value, + Regex = propRegex.Value, + ResultType = propResultType.Value, + Terms = propTerms.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Category value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCategoryId, value.CategoryId, null, null); + writer.WriteProperty(options, PropExamples, value.Examples, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropGrokPattern, value.GrokPattern, null, null); + writer.WriteProperty(options, PropJobId, value.JobId, null, null); + writer.WriteProperty(options, PropMaxMatchingLength, value.MaxMatchingLength, null, null); + writer.WriteProperty(options, PropMlcategory, value.Mlcategory, null, null); + writer.WriteProperty(options, PropNumMatches, value.NumMatches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropP, value.P, null, null); + writer.WriteProperty(options, PropPartitionFieldName, value.PartitionFieldName, null, null); + writer.WriteProperty(options, PropPartitionFieldValue, value.PartitionFieldValue, null, null); + writer.WriteProperty(options, PropPreferredToCategories, value.PreferredToCategories, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRegex, value.Regex, null, null); + writer.WriteProperty(options, PropResultType, value.ResultType, null, null); + writer.WriteProperty(options, PropTerms, value.Terms, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Category.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Category.g.cs index 594ca4dc5f2..f1a900bca2f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Category.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Category.g.cs @@ -23,163 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class CategoryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCategoryId = System.Text.Json.JsonEncodedText.Encode("category_id"); - private static readonly System.Text.Json.JsonEncodedText PropExamples = System.Text.Json.JsonEncodedText.Encode("examples"); - private static readonly System.Text.Json.JsonEncodedText PropGrokPattern = System.Text.Json.JsonEncodedText.Encode("grok_pattern"); - private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); - private static readonly System.Text.Json.JsonEncodedText PropMaxMatchingLength = System.Text.Json.JsonEncodedText.Encode("max_matching_length"); - private static readonly System.Text.Json.JsonEncodedText PropMlcategory = System.Text.Json.JsonEncodedText.Encode("mlcategory"); - private static readonly System.Text.Json.JsonEncodedText PropNumMatches = System.Text.Json.JsonEncodedText.Encode("num_matches"); - private static readonly System.Text.Json.JsonEncodedText PropP = System.Text.Json.JsonEncodedText.Encode("p"); - private static readonly System.Text.Json.JsonEncodedText PropPartitionFieldName = System.Text.Json.JsonEncodedText.Encode("partition_field_name"); - private static readonly System.Text.Json.JsonEncodedText PropPartitionFieldValue = System.Text.Json.JsonEncodedText.Encode("partition_field_value"); - private static readonly System.Text.Json.JsonEncodedText PropPreferredToCategories = System.Text.Json.JsonEncodedText.Encode("preferred_to_categories"); - private static readonly System.Text.Json.JsonEncodedText PropRegex = System.Text.Json.JsonEncodedText.Encode("regex"); - private static readonly System.Text.Json.JsonEncodedText PropResultType = System.Text.Json.JsonEncodedText.Encode("result_type"); - private static readonly System.Text.Json.JsonEncodedText PropTerms = System.Text.Json.JsonEncodedText.Encode("terms"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.Category Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCategoryId = default; - LocalJsonValue> propExamples = default; - LocalJsonValue propGrokPattern = default; - LocalJsonValue propJobId = default; - LocalJsonValue propMaxMatchingLength = default; - LocalJsonValue propMlcategory = default; - LocalJsonValue propNumMatches = default; - LocalJsonValue propP = default; - LocalJsonValue propPartitionFieldName = default; - LocalJsonValue propPartitionFieldValue = default; - LocalJsonValue?> propPreferredToCategories = default; - LocalJsonValue propRegex = default; - LocalJsonValue propResultType = default; - LocalJsonValue propTerms = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCategoryId.TryReadProperty(ref reader, options, PropCategoryId, null)) - { - continue; - } - - if (propExamples.TryReadProperty(ref reader, options, PropExamples, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propGrokPattern.TryReadProperty(ref reader, options, PropGrokPattern, null)) - { - continue; - } - - if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) - { - continue; - } - - if (propMaxMatchingLength.TryReadProperty(ref reader, options, PropMaxMatchingLength, null)) - { - continue; - } - - if (propMlcategory.TryReadProperty(ref reader, options, PropMlcategory, null)) - { - continue; - } - - if (propNumMatches.TryReadProperty(ref reader, options, PropNumMatches, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propP.TryReadProperty(ref reader, options, PropP, null)) - { - continue; - } - - if (propPartitionFieldName.TryReadProperty(ref reader, options, PropPartitionFieldName, null)) - { - continue; - } - - if (propPartitionFieldValue.TryReadProperty(ref reader, options, PropPartitionFieldValue, null)) - { - continue; - } - - if (propPreferredToCategories.TryReadProperty(ref reader, options, PropPreferredToCategories, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propRegex.TryReadProperty(ref reader, options, PropRegex, null)) - { - continue; - } - - if (propResultType.TryReadProperty(ref reader, options, PropResultType, null)) - { - continue; - } - - if (propTerms.TryReadProperty(ref reader, options, PropTerms, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.Category(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CategoryId = propCategoryId.Value, - Examples = propExamples.Value, - GrokPattern = propGrokPattern.Value, - JobId = propJobId.Value, - MaxMatchingLength = propMaxMatchingLength.Value, - Mlcategory = propMlcategory.Value, - NumMatches = propNumMatches.Value, - P = propP.Value, - PartitionFieldName = propPartitionFieldName.Value, - PartitionFieldValue = propPartitionFieldValue.Value, - PreferredToCategories = propPreferredToCategories.Value, - Regex = propRegex.Value, - ResultType = propResultType.Value, - Terms = propTerms.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Category value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCategoryId, value.CategoryId, null, null); - writer.WriteProperty(options, PropExamples, value.Examples, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropGrokPattern, value.GrokPattern, null, null); - writer.WriteProperty(options, PropJobId, value.JobId, null, null); - writer.WriteProperty(options, PropMaxMatchingLength, value.MaxMatchingLength, null, null); - writer.WriteProperty(options, PropMlcategory, value.Mlcategory, null, null); - writer.WriteProperty(options, PropNumMatches, value.NumMatches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropP, value.P, null, null); - writer.WriteProperty(options, PropPartitionFieldName, value.PartitionFieldName, null, null); - writer.WriteProperty(options, PropPartitionFieldValue, value.PartitionFieldValue, null, null); - writer.WriteProperty(options, PropPreferredToCategories, value.PreferredToCategories, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRegex, value.Regex, null, null); - writer.WriteProperty(options, PropResultType, value.ResultType, null, null); - writer.WriteProperty(options, PropTerms, value.Terms, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.CategoryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.CategoryConverter))] public sealed partial class Category { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ChunkingConfig.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ChunkingConfig.Converters.g.cs new file mode 100644 index 00000000000..302b8bd6c17 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ChunkingConfig.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ChunkingConfigConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSpan = System.Text.Json.JsonEncodedText.Encode("time_span"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMode = default; + LocalJsonValue propTimeSpan = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMode.TryReadProperty(ref reader, options, PropMode, null)) + { + continue; + } + + if (propTimeSpan.TryReadProperty(ref reader, options, PropTimeSpan, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Mode = propMode.Value, + TimeSpan = propTimeSpan.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMode, value.Mode, null, null); + writer.WriteProperty(options, PropTimeSpan, value.TimeSpan, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ChunkingConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ChunkingConfig.g.cs index 17af0ae7f3e..0ba01d5dca3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ChunkingConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ChunkingConfig.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class ChunkingConfigConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSpan = System.Text.Json.JsonEncodedText.Encode("time_span"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMode = default; - LocalJsonValue propTimeSpan = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMode.TryReadProperty(ref reader, options, PropMode, null)) - { - continue; - } - - if (propTimeSpan.TryReadProperty(ref reader, options, PropTimeSpan, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Mode = propMode.Value, - TimeSpan = propTimeSpan.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfig value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMode, value.Mode, null, null); - writer.WriteProperty(options, PropTimeSpan, value.TimeSpan, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ChunkingConfigConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ChunkingConfigConverter))] public sealed partial class ChunkingConfig { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ChunkingMode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ChunkingMode.Converters.g.cs new file mode 100644 index 00000000000..f9762aa55cc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ChunkingMode.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ChunkingModeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAuto = System.Text.Json.JsonEncodedText.Encode("auto"); + private static readonly System.Text.Json.JsonEncodedText MemberManual = System.Text.Json.JsonEncodedText.Encode("manual"); + private static readonly System.Text.Json.JsonEncodedText MemberOff = System.Text.Json.JsonEncodedText.Encode("off"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAuto)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode.Auto; + } + + if (reader.ValueTextEquals(MemberManual)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode.Manual; + } + + if (reader.ValueTextEquals(MemberOff)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode.Off; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAuto.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode.Auto; + } + + if (string.Equals(value, MemberManual.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode.Manual; + } + + if (string.Equals(value, MemberOff.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode.Off; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode.Auto: + writer.WriteStringValue(MemberAuto); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode.Manual: + writer.WriteStringValue(MemberManual); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode.Off: + writer.WriteStringValue(MemberOff); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ChunkingMode value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ChunkingMode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ChunkingMode.g.cs new file mode 100644 index 00000000000..c2c7202362e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ChunkingMode.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ChunkingModeConverter))] +public enum ChunkingMode +{ + [System.Runtime.Serialization.EnumMember(Value = "auto")] + Auto, + [System.Runtime.Serialization.EnumMember(Value = "manual")] + Manual, + [System.Runtime.Serialization.EnumMember(Value = "off")] + Off +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ClassificationInferenceOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ClassificationInferenceOptions.Converters.g.cs new file mode 100644 index 00000000000..de6c1210431 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ClassificationInferenceOptions.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ClassificationInferenceOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNumTopClasses = System.Text.Json.JsonEncodedText.Encode("num_top_classes"); + private static readonly System.Text.Json.JsonEncodedText PropNumTopFeatureImportanceValues = System.Text.Json.JsonEncodedText.Encode("num_top_feature_importance_values"); + private static readonly System.Text.Json.JsonEncodedText PropPredictionFieldType = System.Text.Json.JsonEncodedText.Encode("prediction_field_type"); + private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); + private static readonly System.Text.Json.JsonEncodedText PropTopClassesResultsField = System.Text.Json.JsonEncodedText.Encode("top_classes_results_field"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.ClassificationInferenceOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propNumTopClasses = default; + LocalJsonValue propNumTopFeatureImportanceValues = default; + LocalJsonValue propPredictionFieldType = default; + LocalJsonValue propResultsField = default; + LocalJsonValue propTopClassesResultsField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNumTopClasses.TryReadProperty(ref reader, options, PropNumTopClasses, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNumTopFeatureImportanceValues.TryReadProperty(ref reader, options, PropNumTopFeatureImportanceValues, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPredictionFieldType.TryReadProperty(ref reader, options, PropPredictionFieldType, null)) + { + continue; + } + + if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) + { + continue; + } + + if (propTopClassesResultsField.TryReadProperty(ref reader, options, PropTopClassesResultsField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.ClassificationInferenceOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + NumTopClasses = propNumTopClasses.Value, + NumTopFeatureImportanceValues = propNumTopFeatureImportanceValues.Value, + PredictionFieldType = propPredictionFieldType.Value, + ResultsField = propResultsField.Value, + TopClassesResultsField = propTopClassesResultsField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ClassificationInferenceOptions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNumTopClasses, value.NumTopClasses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNumTopFeatureImportanceValues, value.NumTopFeatureImportanceValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPredictionFieldType, value.PredictionFieldType, null, null); + writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); + writer.WriteProperty(options, PropTopClassesResultsField, value.TopClassesResultsField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ClassificationInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ClassificationInferenceOptions.g.cs index 1bc4d270947..0065fbe2054 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ClassificationInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ClassificationInferenceOptions.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class ClassificationInferenceOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNumTopClasses = System.Text.Json.JsonEncodedText.Encode("num_top_classes"); - private static readonly System.Text.Json.JsonEncodedText PropNumTopFeatureImportanceValues = System.Text.Json.JsonEncodedText.Encode("num_top_feature_importance_values"); - private static readonly System.Text.Json.JsonEncodedText PropPredictionFieldType = System.Text.Json.JsonEncodedText.Encode("prediction_field_type"); - private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); - private static readonly System.Text.Json.JsonEncodedText PropTopClassesResultsField = System.Text.Json.JsonEncodedText.Encode("top_classes_results_field"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.ClassificationInferenceOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propNumTopClasses = default; - LocalJsonValue propNumTopFeatureImportanceValues = default; - LocalJsonValue propPredictionFieldType = default; - LocalJsonValue propResultsField = default; - LocalJsonValue propTopClassesResultsField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNumTopClasses.TryReadProperty(ref reader, options, PropNumTopClasses, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNumTopFeatureImportanceValues.TryReadProperty(ref reader, options, PropNumTopFeatureImportanceValues, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPredictionFieldType.TryReadProperty(ref reader, options, PropPredictionFieldType, null)) - { - continue; - } - - if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) - { - continue; - } - - if (propTopClassesResultsField.TryReadProperty(ref reader, options, PropTopClassesResultsField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.ClassificationInferenceOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - NumTopClasses = propNumTopClasses.Value, - NumTopFeatureImportanceValues = propNumTopFeatureImportanceValues.Value, - PredictionFieldType = propPredictionFieldType.Value, - ResultsField = propResultsField.Value, - TopClassesResultsField = propTopClassesResultsField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ClassificationInferenceOptions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNumTopClasses, value.NumTopClasses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNumTopFeatureImportanceValues, value.NumTopFeatureImportanceValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPredictionFieldType, value.PredictionFieldType, null, null); - writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); - writer.WriteProperty(options, PropTopClassesResultsField, value.TopClassesResultsField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ClassificationInferenceOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ClassificationInferenceOptionsConverter))] public sealed partial class ClassificationInferenceOptions { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConditionOperator.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConditionOperator.Converters.g.cs new file mode 100644 index 00000000000..e26537eb25c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConditionOperator.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ConditionOperatorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberGt = System.Text.Json.JsonEncodedText.Encode("gt"); + private static readonly System.Text.Json.JsonEncodedText MemberGte = System.Text.Json.JsonEncodedText.Encode("gte"); + private static readonly System.Text.Json.JsonEncodedText MemberLt = System.Text.Json.JsonEncodedText.Encode("lt"); + private static readonly System.Text.Json.JsonEncodedText MemberLte = System.Text.Json.JsonEncodedText.Encode("lte"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberGt)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator.Gt; + } + + if (reader.ValueTextEquals(MemberGte)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator.Gte; + } + + if (reader.ValueTextEquals(MemberLt)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator.Lt; + } + + if (reader.ValueTextEquals(MemberLte)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator.Lte; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberGt.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator.Gt; + } + + if (string.Equals(value, MemberGte.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator.Gte; + } + + if (string.Equals(value, MemberLt.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator.Lt; + } + + if (string.Equals(value, MemberLte.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator.Lte; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator.Gt: + writer.WriteStringValue(MemberGt); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator.Gte: + writer.WriteStringValue(MemberGte); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator.Lt: + writer.WriteStringValue(MemberLt); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator.Lte: + writer.WriteStringValue(MemberLte); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ConditionOperator value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConditionOperator.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConditionOperator.g.cs new file mode 100644 index 00000000000..17f9a007c8d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConditionOperator.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ConditionOperatorConverter))] +public enum ConditionOperator +{ + [System.Runtime.Serialization.EnumMember(Value = "gt")] + Gt, + [System.Runtime.Serialization.EnumMember(Value = "gte")] + Gte, + [System.Runtime.Serialization.EnumMember(Value = "lt")] + Lt, + [System.Runtime.Serialization.EnumMember(Value = "lte")] + Lte +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixItem.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixItem.Converters.g.cs new file mode 100644 index 00000000000..90438c4dadd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixItem.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ConfusionMatrixItemConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropActualClass = System.Text.Json.JsonEncodedText.Encode("actual_class"); + private static readonly System.Text.Json.JsonEncodedText PropActualClassDocCount = System.Text.Json.JsonEncodedText.Encode("actual_class_doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropOtherPredictedClassDocCount = System.Text.Json.JsonEncodedText.Encode("other_predicted_class_doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropPredictedClasses = System.Text.Json.JsonEncodedText.Encode("predicted_classes"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.ConfusionMatrixItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propActualClass = default; + LocalJsonValue propActualClassDocCount = default; + LocalJsonValue propOtherPredictedClassDocCount = default; + LocalJsonValue> propPredictedClasses = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propActualClass.TryReadProperty(ref reader, options, PropActualClass, null)) + { + continue; + } + + if (propActualClassDocCount.TryReadProperty(ref reader, options, PropActualClassDocCount, null)) + { + continue; + } + + if (propOtherPredictedClassDocCount.TryReadProperty(ref reader, options, PropOtherPredictedClassDocCount, null)) + { + continue; + } + + if (propPredictedClasses.TryReadProperty(ref reader, options, PropPredictedClasses, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.ConfusionMatrixItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ActualClass = propActualClass.Value, + ActualClassDocCount = propActualClassDocCount.Value, + OtherPredictedClassDocCount = propOtherPredictedClassDocCount.Value, + PredictedClasses = propPredictedClasses.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ConfusionMatrixItem value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropActualClass, value.ActualClass, null, null); + writer.WriteProperty(options, PropActualClassDocCount, value.ActualClassDocCount, null, null); + writer.WriteProperty(options, PropOtherPredictedClassDocCount, value.OtherPredictedClassDocCount, null, null); + writer.WriteProperty(options, PropPredictedClasses, value.PredictedClasses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixItem.g.cs index 4b5467c2c42..5b06ac6ac03 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixItem.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class ConfusionMatrixItemConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropActualClass = System.Text.Json.JsonEncodedText.Encode("actual_class"); - private static readonly System.Text.Json.JsonEncodedText PropActualClassDocCount = System.Text.Json.JsonEncodedText.Encode("actual_class_doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropOtherPredictedClassDocCount = System.Text.Json.JsonEncodedText.Encode("other_predicted_class_doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropPredictedClasses = System.Text.Json.JsonEncodedText.Encode("predicted_classes"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.ConfusionMatrixItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propActualClass = default; - LocalJsonValue propActualClassDocCount = default; - LocalJsonValue propOtherPredictedClassDocCount = default; - LocalJsonValue> propPredictedClasses = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propActualClass.TryReadProperty(ref reader, options, PropActualClass, null)) - { - continue; - } - - if (propActualClassDocCount.TryReadProperty(ref reader, options, PropActualClassDocCount, null)) - { - continue; - } - - if (propOtherPredictedClassDocCount.TryReadProperty(ref reader, options, PropOtherPredictedClassDocCount, null)) - { - continue; - } - - if (propPredictedClasses.TryReadProperty(ref reader, options, PropPredictedClasses, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.ConfusionMatrixItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ActualClass = propActualClass.Value, - ActualClassDocCount = propActualClassDocCount.Value, - OtherPredictedClassDocCount = propOtherPredictedClassDocCount.Value, - PredictedClasses = propPredictedClasses.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ConfusionMatrixItem value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropActualClass, value.ActualClass, null, null); - writer.WriteProperty(options, PropActualClassDocCount, value.ActualClassDocCount, null, null); - writer.WriteProperty(options, PropOtherPredictedClassDocCount, value.OtherPredictedClassDocCount, null, null); - writer.WriteProperty(options, PropPredictedClasses, value.PredictedClasses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ConfusionMatrixItemConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ConfusionMatrixItemConverter))] public sealed partial class ConfusionMatrixItem { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixPrediction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixPrediction.Converters.g.cs new file mode 100644 index 00000000000..2558a8cd962 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixPrediction.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ConfusionMatrixPredictionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropPredictedClass = System.Text.Json.JsonEncodedText.Encode("predicted_class"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.ConfusionMatrixPrediction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propPredictedClass = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propPredictedClass.TryReadProperty(ref reader, options, PropPredictedClass, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.ConfusionMatrixPrediction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + PredictedClass = propPredictedClass.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ConfusionMatrixPrediction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropPredictedClass, value.PredictedClass, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixPrediction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixPrediction.g.cs index b61ffa602bd..653e577d030 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixPrediction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixPrediction.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class ConfusionMatrixPredictionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropPredictedClass = System.Text.Json.JsonEncodedText.Encode("predicted_class"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.ConfusionMatrixPrediction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propPredictedClass = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propPredictedClass.TryReadProperty(ref reader, options, PropPredictedClass, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.ConfusionMatrixPrediction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - PredictedClass = propPredictedClass.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ConfusionMatrixPrediction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropPredictedClass, value.PredictedClass, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ConfusionMatrixPredictionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ConfusionMatrixPredictionConverter))] public sealed partial class ConfusionMatrixPrediction { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixThreshold.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixThreshold.Converters.g.cs new file mode 100644 index 00000000000..7c03c954c5f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixThreshold.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ConfusionMatrixThresholdConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFalseNegative = System.Text.Json.JsonEncodedText.Encode("fn"); + private static readonly System.Text.Json.JsonEncodedText PropFalsePositive = System.Text.Json.JsonEncodedText.Encode("fp"); + private static readonly System.Text.Json.JsonEncodedText PropTrueNegative = System.Text.Json.JsonEncodedText.Encode("tn"); + private static readonly System.Text.Json.JsonEncodedText PropTruePositive = System.Text.Json.JsonEncodedText.Encode("tp"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.ConfusionMatrixThreshold Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFalseNegative = default; + LocalJsonValue propFalsePositive = default; + LocalJsonValue propTrueNegative = default; + LocalJsonValue propTruePositive = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFalseNegative.TryReadProperty(ref reader, options, PropFalseNegative, null)) + { + continue; + } + + if (propFalsePositive.TryReadProperty(ref reader, options, PropFalsePositive, null)) + { + continue; + } + + if (propTrueNegative.TryReadProperty(ref reader, options, PropTrueNegative, null)) + { + continue; + } + + if (propTruePositive.TryReadProperty(ref reader, options, PropTruePositive, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.ConfusionMatrixThreshold(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FalseNegative = propFalseNegative.Value, + FalsePositive = propFalsePositive.Value, + TrueNegative = propTrueNegative.Value, + TruePositive = propTruePositive.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ConfusionMatrixThreshold value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFalseNegative, value.FalseNegative, null, null); + writer.WriteProperty(options, PropFalsePositive, value.FalsePositive, null, null); + writer.WriteProperty(options, PropTrueNegative, value.TrueNegative, null, null); + writer.WriteProperty(options, PropTruePositive, value.TruePositive, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixThreshold.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixThreshold.g.cs index 3074f63b49f..e59d1656d78 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixThreshold.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ConfusionMatrixThreshold.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class ConfusionMatrixThresholdConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFalseNegative = System.Text.Json.JsonEncodedText.Encode("fn"); - private static readonly System.Text.Json.JsonEncodedText PropFalsePositive = System.Text.Json.JsonEncodedText.Encode("fp"); - private static readonly System.Text.Json.JsonEncodedText PropTrueNegative = System.Text.Json.JsonEncodedText.Encode("tn"); - private static readonly System.Text.Json.JsonEncodedText PropTruePositive = System.Text.Json.JsonEncodedText.Encode("tp"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.ConfusionMatrixThreshold Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFalseNegative = default; - LocalJsonValue propFalsePositive = default; - LocalJsonValue propTrueNegative = default; - LocalJsonValue propTruePositive = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFalseNegative.TryReadProperty(ref reader, options, PropFalseNegative, null)) - { - continue; - } - - if (propFalsePositive.TryReadProperty(ref reader, options, PropFalsePositive, null)) - { - continue; - } - - if (propTrueNegative.TryReadProperty(ref reader, options, PropTrueNegative, null)) - { - continue; - } - - if (propTruePositive.TryReadProperty(ref reader, options, PropTruePositive, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.ConfusionMatrixThreshold(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FalseNegative = propFalseNegative.Value, - FalsePositive = propFalsePositive.Value, - TrueNegative = propTrueNegative.Value, - TruePositive = propTruePositive.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ConfusionMatrixThreshold value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFalseNegative, value.FalseNegative, null, null); - writer.WriteProperty(options, PropFalsePositive, value.FalsePositive, null, null); - writer.WriteProperty(options, PropTrueNegative, value.TrueNegative, null, null); - writer.WriteProperty(options, PropTruePositive, value.TruePositive, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ConfusionMatrixThresholdConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ConfusionMatrixThresholdConverter))] public sealed partial class ConfusionMatrixThreshold { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataCounts.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataCounts.Converters.g.cs new file mode 100644 index 00000000000..507c0561b7c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataCounts.Converters.g.cs @@ -0,0 +1,225 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataCountsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucketCount = System.Text.Json.JsonEncodedText.Encode("bucket_count"); + private static readonly System.Text.Json.JsonEncodedText PropEarliestRecordTimestamp = System.Text.Json.JsonEncodedText.Encode("earliest_record_timestamp"); + private static readonly System.Text.Json.JsonEncodedText PropEmptyBucketCount = System.Text.Json.JsonEncodedText.Encode("empty_bucket_count"); + private static readonly System.Text.Json.JsonEncodedText PropInputBytes = System.Text.Json.JsonEncodedText.Encode("input_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropInputFieldCount = System.Text.Json.JsonEncodedText.Encode("input_field_count"); + private static readonly System.Text.Json.JsonEncodedText PropInputRecordCount = System.Text.Json.JsonEncodedText.Encode("input_record_count"); + private static readonly System.Text.Json.JsonEncodedText PropInvalidDateCount = System.Text.Json.JsonEncodedText.Encode("invalid_date_count"); + private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); + private static readonly System.Text.Json.JsonEncodedText PropLastDataTime = System.Text.Json.JsonEncodedText.Encode("last_data_time"); + private static readonly System.Text.Json.JsonEncodedText PropLatestBucketTimestamp = System.Text.Json.JsonEncodedText.Encode("latest_bucket_timestamp"); + private static readonly System.Text.Json.JsonEncodedText PropLatestEmptyBucketTimestamp = System.Text.Json.JsonEncodedText.Encode("latest_empty_bucket_timestamp"); + private static readonly System.Text.Json.JsonEncodedText PropLatestRecordTimestamp = System.Text.Json.JsonEncodedText.Encode("latest_record_timestamp"); + private static readonly System.Text.Json.JsonEncodedText PropLatestSparseBucketTimestamp = System.Text.Json.JsonEncodedText.Encode("latest_sparse_bucket_timestamp"); + private static readonly System.Text.Json.JsonEncodedText PropLogTime = System.Text.Json.JsonEncodedText.Encode("log_time"); + private static readonly System.Text.Json.JsonEncodedText PropMissingFieldCount = System.Text.Json.JsonEncodedText.Encode("missing_field_count"); + private static readonly System.Text.Json.JsonEncodedText PropOutOfOrderTimestampCount = System.Text.Json.JsonEncodedText.Encode("out_of_order_timestamp_count"); + private static readonly System.Text.Json.JsonEncodedText PropProcessedFieldCount = System.Text.Json.JsonEncodedText.Encode("processed_field_count"); + private static readonly System.Text.Json.JsonEncodedText PropProcessedRecordCount = System.Text.Json.JsonEncodedText.Encode("processed_record_count"); + private static readonly System.Text.Json.JsonEncodedText PropSparseBucketCount = System.Text.Json.JsonEncodedText.Encode("sparse_bucket_count"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataCounts Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucketCount = default; + LocalJsonValue propEarliestRecordTimestamp = default; + LocalJsonValue propEmptyBucketCount = default; + LocalJsonValue propInputBytes = default; + LocalJsonValue propInputFieldCount = default; + LocalJsonValue propInputRecordCount = default; + LocalJsonValue propInvalidDateCount = default; + LocalJsonValue propJobId = default; + LocalJsonValue propLastDataTime = default; + LocalJsonValue propLatestBucketTimestamp = default; + LocalJsonValue propLatestEmptyBucketTimestamp = default; + LocalJsonValue propLatestRecordTimestamp = default; + LocalJsonValue propLatestSparseBucketTimestamp = default; + LocalJsonValue propLogTime = default; + LocalJsonValue propMissingFieldCount = default; + LocalJsonValue propOutOfOrderTimestampCount = default; + LocalJsonValue propProcessedFieldCount = default; + LocalJsonValue propProcessedRecordCount = default; + LocalJsonValue propSparseBucketCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucketCount.TryReadProperty(ref reader, options, PropBucketCount, null)) + { + continue; + } + + if (propEarliestRecordTimestamp.TryReadProperty(ref reader, options, PropEarliestRecordTimestamp, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEmptyBucketCount.TryReadProperty(ref reader, options, PropEmptyBucketCount, null)) + { + continue; + } + + if (propInputBytes.TryReadProperty(ref reader, options, PropInputBytes, null)) + { + continue; + } + + if (propInputFieldCount.TryReadProperty(ref reader, options, PropInputFieldCount, null)) + { + continue; + } + + if (propInputRecordCount.TryReadProperty(ref reader, options, PropInputRecordCount, null)) + { + continue; + } + + if (propInvalidDateCount.TryReadProperty(ref reader, options, PropInvalidDateCount, null)) + { + continue; + } + + if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) + { + continue; + } + + if (propLastDataTime.TryReadProperty(ref reader, options, PropLastDataTime, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLatestBucketTimestamp.TryReadProperty(ref reader, options, PropLatestBucketTimestamp, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLatestEmptyBucketTimestamp.TryReadProperty(ref reader, options, PropLatestEmptyBucketTimestamp, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLatestRecordTimestamp.TryReadProperty(ref reader, options, PropLatestRecordTimestamp, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLatestSparseBucketTimestamp.TryReadProperty(ref reader, options, PropLatestSparseBucketTimestamp, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLogTime.TryReadProperty(ref reader, options, PropLogTime, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMissingFieldCount.TryReadProperty(ref reader, options, PropMissingFieldCount, null)) + { + continue; + } + + if (propOutOfOrderTimestampCount.TryReadProperty(ref reader, options, PropOutOfOrderTimestampCount, null)) + { + continue; + } + + if (propProcessedFieldCount.TryReadProperty(ref reader, options, PropProcessedFieldCount, null)) + { + continue; + } + + if (propProcessedRecordCount.TryReadProperty(ref reader, options, PropProcessedRecordCount, null)) + { + continue; + } + + if (propSparseBucketCount.TryReadProperty(ref reader, options, PropSparseBucketCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataCounts(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BucketCount = propBucketCount.Value, + EarliestRecordTimestamp = propEarliestRecordTimestamp.Value, + EmptyBucketCount = propEmptyBucketCount.Value, + InputBytes = propInputBytes.Value, + InputFieldCount = propInputFieldCount.Value, + InputRecordCount = propInputRecordCount.Value, + InvalidDateCount = propInvalidDateCount.Value, + JobId = propJobId.Value, + LastDataTime = propLastDataTime.Value, + LatestBucketTimestamp = propLatestBucketTimestamp.Value, + LatestEmptyBucketTimestamp = propLatestEmptyBucketTimestamp.Value, + LatestRecordTimestamp = propLatestRecordTimestamp.Value, + LatestSparseBucketTimestamp = propLatestSparseBucketTimestamp.Value, + LogTime = propLogTime.Value, + MissingFieldCount = propMissingFieldCount.Value, + OutOfOrderTimestampCount = propOutOfOrderTimestampCount.Value, + ProcessedFieldCount = propProcessedFieldCount.Value, + ProcessedRecordCount = propProcessedRecordCount.Value, + SparseBucketCount = propSparseBucketCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataCounts value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucketCount, value.BucketCount, null, null); + writer.WriteProperty(options, PropEarliestRecordTimestamp, value.EarliestRecordTimestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEmptyBucketCount, value.EmptyBucketCount, null, null); + writer.WriteProperty(options, PropInputBytes, value.InputBytes, null, null); + writer.WriteProperty(options, PropInputFieldCount, value.InputFieldCount, null, null); + writer.WriteProperty(options, PropInputRecordCount, value.InputRecordCount, null, null); + writer.WriteProperty(options, PropInvalidDateCount, value.InvalidDateCount, null, null); + writer.WriteProperty(options, PropJobId, value.JobId, null, null); + writer.WriteProperty(options, PropLastDataTime, value.LastDataTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLatestBucketTimestamp, value.LatestBucketTimestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLatestEmptyBucketTimestamp, value.LatestEmptyBucketTimestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLatestRecordTimestamp, value.LatestRecordTimestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLatestSparseBucketTimestamp, value.LatestSparseBucketTimestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLogTime, value.LogTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMissingFieldCount, value.MissingFieldCount, null, null); + writer.WriteProperty(options, PropOutOfOrderTimestampCount, value.OutOfOrderTimestampCount, null, null); + writer.WriteProperty(options, PropProcessedFieldCount, value.ProcessedFieldCount, null, null); + writer.WriteProperty(options, PropProcessedRecordCount, value.ProcessedRecordCount, null, null); + writer.WriteProperty(options, PropSparseBucketCount, value.SparseBucketCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataCounts.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataCounts.g.cs index 5dd3f7a6e1d..3973a261e3b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataCounts.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataCounts.g.cs @@ -23,208 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataCountsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBucketCount = System.Text.Json.JsonEncodedText.Encode("bucket_count"); - private static readonly System.Text.Json.JsonEncodedText PropEarliestRecordTimestamp = System.Text.Json.JsonEncodedText.Encode("earliest_record_timestamp"); - private static readonly System.Text.Json.JsonEncodedText PropEmptyBucketCount = System.Text.Json.JsonEncodedText.Encode("empty_bucket_count"); - private static readonly System.Text.Json.JsonEncodedText PropInputBytes = System.Text.Json.JsonEncodedText.Encode("input_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropInputFieldCount = System.Text.Json.JsonEncodedText.Encode("input_field_count"); - private static readonly System.Text.Json.JsonEncodedText PropInputRecordCount = System.Text.Json.JsonEncodedText.Encode("input_record_count"); - private static readonly System.Text.Json.JsonEncodedText PropInvalidDateCount = System.Text.Json.JsonEncodedText.Encode("invalid_date_count"); - private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); - private static readonly System.Text.Json.JsonEncodedText PropLastDataTime = System.Text.Json.JsonEncodedText.Encode("last_data_time"); - private static readonly System.Text.Json.JsonEncodedText PropLatestBucketTimestamp = System.Text.Json.JsonEncodedText.Encode("latest_bucket_timestamp"); - private static readonly System.Text.Json.JsonEncodedText PropLatestEmptyBucketTimestamp = System.Text.Json.JsonEncodedText.Encode("latest_empty_bucket_timestamp"); - private static readonly System.Text.Json.JsonEncodedText PropLatestRecordTimestamp = System.Text.Json.JsonEncodedText.Encode("latest_record_timestamp"); - private static readonly System.Text.Json.JsonEncodedText PropLatestSparseBucketTimestamp = System.Text.Json.JsonEncodedText.Encode("latest_sparse_bucket_timestamp"); - private static readonly System.Text.Json.JsonEncodedText PropLogTime = System.Text.Json.JsonEncodedText.Encode("log_time"); - private static readonly System.Text.Json.JsonEncodedText PropMissingFieldCount = System.Text.Json.JsonEncodedText.Encode("missing_field_count"); - private static readonly System.Text.Json.JsonEncodedText PropOutOfOrderTimestampCount = System.Text.Json.JsonEncodedText.Encode("out_of_order_timestamp_count"); - private static readonly System.Text.Json.JsonEncodedText PropProcessedFieldCount = System.Text.Json.JsonEncodedText.Encode("processed_field_count"); - private static readonly System.Text.Json.JsonEncodedText PropProcessedRecordCount = System.Text.Json.JsonEncodedText.Encode("processed_record_count"); - private static readonly System.Text.Json.JsonEncodedText PropSparseBucketCount = System.Text.Json.JsonEncodedText.Encode("sparse_bucket_count"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataCounts Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBucketCount = default; - LocalJsonValue propEarliestRecordTimestamp = default; - LocalJsonValue propEmptyBucketCount = default; - LocalJsonValue propInputBytes = default; - LocalJsonValue propInputFieldCount = default; - LocalJsonValue propInputRecordCount = default; - LocalJsonValue propInvalidDateCount = default; - LocalJsonValue propJobId = default; - LocalJsonValue propLastDataTime = default; - LocalJsonValue propLatestBucketTimestamp = default; - LocalJsonValue propLatestEmptyBucketTimestamp = default; - LocalJsonValue propLatestRecordTimestamp = default; - LocalJsonValue propLatestSparseBucketTimestamp = default; - LocalJsonValue propLogTime = default; - LocalJsonValue propMissingFieldCount = default; - LocalJsonValue propOutOfOrderTimestampCount = default; - LocalJsonValue propProcessedFieldCount = default; - LocalJsonValue propProcessedRecordCount = default; - LocalJsonValue propSparseBucketCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBucketCount.TryReadProperty(ref reader, options, PropBucketCount, null)) - { - continue; - } - - if (propEarliestRecordTimestamp.TryReadProperty(ref reader, options, PropEarliestRecordTimestamp, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEmptyBucketCount.TryReadProperty(ref reader, options, PropEmptyBucketCount, null)) - { - continue; - } - - if (propInputBytes.TryReadProperty(ref reader, options, PropInputBytes, null)) - { - continue; - } - - if (propInputFieldCount.TryReadProperty(ref reader, options, PropInputFieldCount, null)) - { - continue; - } - - if (propInputRecordCount.TryReadProperty(ref reader, options, PropInputRecordCount, null)) - { - continue; - } - - if (propInvalidDateCount.TryReadProperty(ref reader, options, PropInvalidDateCount, null)) - { - continue; - } - - if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) - { - continue; - } - - if (propLastDataTime.TryReadProperty(ref reader, options, PropLastDataTime, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLatestBucketTimestamp.TryReadProperty(ref reader, options, PropLatestBucketTimestamp, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLatestEmptyBucketTimestamp.TryReadProperty(ref reader, options, PropLatestEmptyBucketTimestamp, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLatestRecordTimestamp.TryReadProperty(ref reader, options, PropLatestRecordTimestamp, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLatestSparseBucketTimestamp.TryReadProperty(ref reader, options, PropLatestSparseBucketTimestamp, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLogTime.TryReadProperty(ref reader, options, PropLogTime, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMissingFieldCount.TryReadProperty(ref reader, options, PropMissingFieldCount, null)) - { - continue; - } - - if (propOutOfOrderTimestampCount.TryReadProperty(ref reader, options, PropOutOfOrderTimestampCount, null)) - { - continue; - } - - if (propProcessedFieldCount.TryReadProperty(ref reader, options, PropProcessedFieldCount, null)) - { - continue; - } - - if (propProcessedRecordCount.TryReadProperty(ref reader, options, PropProcessedRecordCount, null)) - { - continue; - } - - if (propSparseBucketCount.TryReadProperty(ref reader, options, PropSparseBucketCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataCounts(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BucketCount = propBucketCount.Value, - EarliestRecordTimestamp = propEarliestRecordTimestamp.Value, - EmptyBucketCount = propEmptyBucketCount.Value, - InputBytes = propInputBytes.Value, - InputFieldCount = propInputFieldCount.Value, - InputRecordCount = propInputRecordCount.Value, - InvalidDateCount = propInvalidDateCount.Value, - JobId = propJobId.Value, - LastDataTime = propLastDataTime.Value, - LatestBucketTimestamp = propLatestBucketTimestamp.Value, - LatestEmptyBucketTimestamp = propLatestEmptyBucketTimestamp.Value, - LatestRecordTimestamp = propLatestRecordTimestamp.Value, - LatestSparseBucketTimestamp = propLatestSparseBucketTimestamp.Value, - LogTime = propLogTime.Value, - MissingFieldCount = propMissingFieldCount.Value, - OutOfOrderTimestampCount = propOutOfOrderTimestampCount.Value, - ProcessedFieldCount = propProcessedFieldCount.Value, - ProcessedRecordCount = propProcessedRecordCount.Value, - SparseBucketCount = propSparseBucketCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataCounts value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBucketCount, value.BucketCount, null, null); - writer.WriteProperty(options, PropEarliestRecordTimestamp, value.EarliestRecordTimestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEmptyBucketCount, value.EmptyBucketCount, null, null); - writer.WriteProperty(options, PropInputBytes, value.InputBytes, null, null); - writer.WriteProperty(options, PropInputFieldCount, value.InputFieldCount, null, null); - writer.WriteProperty(options, PropInputRecordCount, value.InputRecordCount, null, null); - writer.WriteProperty(options, PropInvalidDateCount, value.InvalidDateCount, null, null); - writer.WriteProperty(options, PropJobId, value.JobId, null, null); - writer.WriteProperty(options, PropLastDataTime, value.LastDataTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLatestBucketTimestamp, value.LatestBucketTimestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLatestEmptyBucketTimestamp, value.LatestEmptyBucketTimestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLatestRecordTimestamp, value.LatestRecordTimestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLatestSparseBucketTimestamp, value.LatestSparseBucketTimestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLogTime, value.LogTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMissingFieldCount, value.MissingFieldCount, null, null); - writer.WriteProperty(options, PropOutOfOrderTimestampCount, value.OutOfOrderTimestampCount, null, null); - writer.WriteProperty(options, PropProcessedFieldCount, value.ProcessedFieldCount, null, null); - writer.WriteProperty(options, PropProcessedRecordCount, value.ProcessedRecordCount, null, null); - writer.WriteProperty(options, PropSparseBucketCount, value.SparseBucketCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataCountsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataCountsConverter))] public sealed partial class DataCounts { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataDescription.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataDescription.Converters.g.cs new file mode 100644 index 00000000000..ad39b5dfdd9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataDescription.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataDescriptionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFieldDelimiter = System.Text.Json.JsonEncodedText.Encode("field_delimiter"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropTimeField = System.Text.Json.JsonEncodedText.Encode("time_field"); + private static readonly System.Text.Json.JsonEncodedText PropTimeFormat = System.Text.Json.JsonEncodedText.Encode("time_format"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataDescription Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFieldDelimiter = default; + LocalJsonValue propFormat = default; + LocalJsonValue propTimeField = default; + LocalJsonValue propTimeFormat = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFieldDelimiter.TryReadProperty(ref reader, options, PropFieldDelimiter, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propTimeField.TryReadProperty(ref reader, options, PropTimeField, null)) + { + continue; + } + + if (propTimeFormat.TryReadProperty(ref reader, options, PropTimeFormat, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataDescription(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FieldDelimiter = propFieldDelimiter.Value, + Format = propFormat.Value, + TimeField = propTimeField.Value, + TimeFormat = propTimeFormat.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataDescription value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFieldDelimiter, value.FieldDelimiter, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropTimeField, value.TimeField, null, null); + writer.WriteProperty(options, PropTimeFormat, value.TimeFormat, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataDescription.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataDescription.g.cs index bc5a8c53c74..aa687668e10 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataDescription.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataDescription.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataDescriptionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFieldDelimiter = System.Text.Json.JsonEncodedText.Encode("field_delimiter"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropTimeField = System.Text.Json.JsonEncodedText.Encode("time_field"); - private static readonly System.Text.Json.JsonEncodedText PropTimeFormat = System.Text.Json.JsonEncodedText.Encode("time_format"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataDescription Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFieldDelimiter = default; - LocalJsonValue propFormat = default; - LocalJsonValue propTimeField = default; - LocalJsonValue propTimeFormat = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFieldDelimiter.TryReadProperty(ref reader, options, PropFieldDelimiter, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propTimeField.TryReadProperty(ref reader, options, PropTimeField, null)) - { - continue; - } - - if (propTimeFormat.TryReadProperty(ref reader, options, PropTimeFormat, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataDescription(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FieldDelimiter = propFieldDelimiter.Value, - Format = propFormat.Value, - TimeField = propTimeField.Value, - TimeFormat = propTimeFormat.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataDescription value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFieldDelimiter, value.FieldDelimiter, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropTimeField, value.TimeField, null, null); - writer.WriteProperty(options, PropTimeFormat, value.TimeFormat, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataDescriptionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataDescriptionConverter))] public sealed partial class DataDescription { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Datafeed.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Datafeed.Converters.g.cs new file mode 100644 index 00000000000..d04bcf09b41 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Datafeed.Converters.g.cs @@ -0,0 +1,199 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DatafeedConverter : System.Text.Json.Serialization.JsonConverter +{ + 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 PropAuthorization = System.Text.Json.JsonEncodedText.Encode("authorization"); + private static readonly System.Text.Json.JsonEncodedText PropChunkingConfig = System.Text.Json.JsonEncodedText.Encode("chunking_config"); + private static readonly System.Text.Json.JsonEncodedText PropDatafeedId = System.Text.Json.JsonEncodedText.Encode("datafeed_id"); + private static readonly System.Text.Json.JsonEncodedText PropDelayedDataCheckConfig = System.Text.Json.JsonEncodedText.Encode("delayed_data_check_config"); + private static readonly System.Text.Json.JsonEncodedText PropFrequency = System.Text.Json.JsonEncodedText.Encode("frequency"); + private static readonly System.Text.Json.JsonEncodedText PropIndexes = System.Text.Json.JsonEncodedText.Encode("indexes"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropIndicesOptions = System.Text.Json.JsonEncodedText.Encode("indices_options"); + private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); + private static readonly System.Text.Json.JsonEncodedText PropMaxEmptySearches = System.Text.Json.JsonEncodedText.Encode("max_empty_searches"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropQueryDelay = System.Text.Json.JsonEncodedText.Encode("query_delay"); + 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 PropScrollSize = System.Text.Json.JsonEncodedText.Encode("scroll_size"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.Datafeed Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAggregations = default; + LocalJsonValue propAuthorization = default; + LocalJsonValue propChunkingConfig = default; + LocalJsonValue propDatafeedId = default; + LocalJsonValue propDelayedDataCheckConfig = default; + LocalJsonValue propFrequency = default; + LocalJsonValue?> propIndexes = default; + LocalJsonValue> propIndices = default; + LocalJsonValue propIndicesOptions = default; + LocalJsonValue propJobId = default; + LocalJsonValue propMaxEmptySearches = default; + LocalJsonValue propQuery = default; + LocalJsonValue propQueryDelay = default; + LocalJsonValue?> propRuntimeMappings = default; + LocalJsonValue?> propScriptFields = default; + LocalJsonValue propScrollSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)) || propAggregations.TryReadProperty(ref reader, options, PropAggregations1, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propAuthorization.TryReadProperty(ref reader, options, PropAuthorization, null)) + { + continue; + } + + if (propChunkingConfig.TryReadProperty(ref reader, options, PropChunkingConfig, null)) + { + continue; + } + + if (propDatafeedId.TryReadProperty(ref reader, options, PropDatafeedId, null)) + { + continue; + } + + if (propDelayedDataCheckConfig.TryReadProperty(ref reader, options, PropDelayedDataCheckConfig, null)) + { + continue; + } + + if (propFrequency.TryReadProperty(ref reader, options, PropFrequency, null)) + { + continue; + } + + if (propIndexes.TryReadProperty(ref reader, options, PropIndexes, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propIndicesOptions.TryReadProperty(ref reader, options, PropIndicesOptions, null)) + { + continue; + } + + if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) + { + continue; + } + + if (propMaxEmptySearches.TryReadProperty(ref reader, options, PropMaxEmptySearches, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propQueryDelay.TryReadProperty(ref reader, options, PropQueryDelay, null)) + { + continue; + } + + if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propScriptFields.TryReadProperty(ref reader, options, PropScriptFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propScrollSize.TryReadProperty(ref reader, options, PropScrollSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.Datafeed(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = propAggregations.Value, + Authorization = propAuthorization.Value, + ChunkingConfig = propChunkingConfig.Value, + DatafeedId = propDatafeedId.Value, + DelayedDataCheckConfig = propDelayedDataCheckConfig.Value, + Frequency = propFrequency.Value, + Indexes = propIndexes.Value, + Indices = propIndices.Value, + IndicesOptions = propIndicesOptions.Value, + JobId = propJobId.Value, + MaxEmptySearches = propMaxEmptySearches.Value, + Query = propQuery.Value, + QueryDelay = propQueryDelay.Value, + RuntimeMappings = propRuntimeMappings.Value, + ScriptFields = propScriptFields.Value, + ScrollSize = propScrollSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Datafeed value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropAuthorization, value.Authorization, null, null); + writer.WriteProperty(options, PropChunkingConfig, value.ChunkingConfig, null, null); + writer.WriteProperty(options, PropDatafeedId, value.DatafeedId, null, null); + writer.WriteProperty(options, PropDelayedDataCheckConfig, value.DelayedDataCheckConfig, null, null); + writer.WriteProperty(options, PropFrequency, value.Frequency, null, null); + writer.WriteProperty(options, PropIndexes, value.Indexes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIndicesOptions, value.IndicesOptions, null, null); + writer.WriteProperty(options, PropJobId, value.JobId, null, null); + writer.WriteProperty(options, PropMaxEmptySearches, value.MaxEmptySearches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropQueryDelay, value.QueryDelay, null, null); + writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropScriptFields, value.ScriptFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropScrollSize, value.ScrollSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Datafeed.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Datafeed.g.cs index 753ccee94dd..a86b38eab37 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Datafeed.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Datafeed.g.cs @@ -23,182 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DatafeedConverter : System.Text.Json.Serialization.JsonConverter -{ - 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 PropAuthorization = System.Text.Json.JsonEncodedText.Encode("authorization"); - private static readonly System.Text.Json.JsonEncodedText PropChunkingConfig = System.Text.Json.JsonEncodedText.Encode("chunking_config"); - private static readonly System.Text.Json.JsonEncodedText PropDatafeedId = System.Text.Json.JsonEncodedText.Encode("datafeed_id"); - private static readonly System.Text.Json.JsonEncodedText PropDelayedDataCheckConfig = System.Text.Json.JsonEncodedText.Encode("delayed_data_check_config"); - private static readonly System.Text.Json.JsonEncodedText PropFrequency = System.Text.Json.JsonEncodedText.Encode("frequency"); - private static readonly System.Text.Json.JsonEncodedText PropIndexes = System.Text.Json.JsonEncodedText.Encode("indexes"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropIndicesOptions = System.Text.Json.JsonEncodedText.Encode("indices_options"); - private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); - private static readonly System.Text.Json.JsonEncodedText PropMaxEmptySearches = System.Text.Json.JsonEncodedText.Encode("max_empty_searches"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropQueryDelay = System.Text.Json.JsonEncodedText.Encode("query_delay"); - 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 PropScrollSize = System.Text.Json.JsonEncodedText.Encode("scroll_size"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.Datafeed Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAggregations = default; - LocalJsonValue propAuthorization = default; - LocalJsonValue propChunkingConfig = default; - LocalJsonValue propDatafeedId = default; - LocalJsonValue propDelayedDataCheckConfig = default; - LocalJsonValue propFrequency = default; - LocalJsonValue?> propIndexes = default; - LocalJsonValue> propIndices = default; - LocalJsonValue propIndicesOptions = default; - LocalJsonValue propJobId = default; - LocalJsonValue propMaxEmptySearches = default; - LocalJsonValue propQuery = default; - LocalJsonValue propQueryDelay = default; - LocalJsonValue?> propRuntimeMappings = default; - LocalJsonValue?> propScriptFields = default; - LocalJsonValue propScrollSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)) || propAggregations.TryReadProperty(ref reader, options, PropAggregations1, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propAuthorization.TryReadProperty(ref reader, options, PropAuthorization, null)) - { - continue; - } - - if (propChunkingConfig.TryReadProperty(ref reader, options, PropChunkingConfig, null)) - { - continue; - } - - if (propDatafeedId.TryReadProperty(ref reader, options, PropDatafeedId, null)) - { - continue; - } - - if (propDelayedDataCheckConfig.TryReadProperty(ref reader, options, PropDelayedDataCheckConfig, null)) - { - continue; - } - - if (propFrequency.TryReadProperty(ref reader, options, PropFrequency, null)) - { - continue; - } - - if (propIndexes.TryReadProperty(ref reader, options, PropIndexes, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propIndicesOptions.TryReadProperty(ref reader, options, PropIndicesOptions, null)) - { - continue; - } - - if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) - { - continue; - } - - if (propMaxEmptySearches.TryReadProperty(ref reader, options, PropMaxEmptySearches, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propQueryDelay.TryReadProperty(ref reader, options, PropQueryDelay, null)) - { - continue; - } - - if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propScriptFields.TryReadProperty(ref reader, options, PropScriptFields, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propScrollSize.TryReadProperty(ref reader, options, PropScrollSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.Datafeed(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = propAggregations.Value, - Authorization = propAuthorization.Value, - ChunkingConfig = propChunkingConfig.Value, - DatafeedId = propDatafeedId.Value, - DelayedDataCheckConfig = propDelayedDataCheckConfig.Value, - Frequency = propFrequency.Value, - Indexes = propIndexes.Value, - Indices = propIndices.Value, - IndicesOptions = propIndicesOptions.Value, - JobId = propJobId.Value, - MaxEmptySearches = propMaxEmptySearches.Value, - Query = propQuery.Value, - QueryDelay = propQueryDelay.Value, - RuntimeMappings = propRuntimeMappings.Value, - ScriptFields = propScriptFields.Value, - ScrollSize = propScrollSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Datafeed value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropAuthorization, value.Authorization, null, null); - writer.WriteProperty(options, PropChunkingConfig, value.ChunkingConfig, null, null); - writer.WriteProperty(options, PropDatafeedId, value.DatafeedId, null, null); - writer.WriteProperty(options, PropDelayedDataCheckConfig, value.DelayedDataCheckConfig, null, null); - writer.WriteProperty(options, PropFrequency, value.Frequency, null, null); - writer.WriteProperty(options, PropIndexes, value.Indexes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIndicesOptions, value.IndicesOptions, null, null); - writer.WriteProperty(options, PropJobId, value.JobId, null, null); - writer.WriteProperty(options, PropMaxEmptySearches, value.MaxEmptySearches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropQueryDelay, value.QueryDelay, null, null); - writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropScriptFields, value.ScriptFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropScrollSize, value.ScrollSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DatafeedConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DatafeedConverter))] public sealed partial class Datafeed { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedAuthorization.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedAuthorization.Converters.g.cs new file mode 100644 index 00000000000..696659365bb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedAuthorization.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DatafeedAuthorizationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + private static readonly System.Text.Json.JsonEncodedText PropServiceAccount = System.Text.Json.JsonEncodedText.Encode("service_account"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DatafeedAuthorization Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApiKey = default; + LocalJsonValue?> propRoles = default; + LocalJsonValue propServiceAccount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) + { + continue; + } + + if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propServiceAccount.TryReadProperty(ref reader, options, PropServiceAccount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DatafeedAuthorization(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ApiKey = propApiKey.Value, + Roles = propRoles.Value, + ServiceAccount = propServiceAccount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DatafeedAuthorization value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); + writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropServiceAccount, value.ServiceAccount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedAuthorization.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedAuthorization.g.cs index 5c28b35a1f6..57d0166f8a2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedAuthorization.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedAuthorization.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DatafeedAuthorizationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); - private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); - private static readonly System.Text.Json.JsonEncodedText PropServiceAccount = System.Text.Json.JsonEncodedText.Encode("service_account"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DatafeedAuthorization Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propApiKey = default; - LocalJsonValue?> propRoles = default; - LocalJsonValue propServiceAccount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) - { - continue; - } - - if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propServiceAccount.TryReadProperty(ref reader, options, PropServiceAccount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DatafeedAuthorization(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ApiKey = propApiKey.Value, - Roles = propRoles.Value, - ServiceAccount = propServiceAccount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DatafeedAuthorization value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); - writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropServiceAccount, value.ServiceAccount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DatafeedAuthorizationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DatafeedAuthorizationConverter))] public sealed partial class DatafeedAuthorization { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedConfig.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedConfig.Converters.g.cs new file mode 100644 index 00000000000..9cf2058531e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedConfig.Converters.g.cs @@ -0,0 +1,182 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DatafeedConfigConverter : System.Text.Json.Serialization.JsonConverter +{ + 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 PropChunkingConfig = System.Text.Json.JsonEncodedText.Encode("chunking_config"); + private static readonly System.Text.Json.JsonEncodedText PropDatafeedId = System.Text.Json.JsonEncodedText.Encode("datafeed_id"); + private static readonly System.Text.Json.JsonEncodedText PropDelayedDataCheckConfig = System.Text.Json.JsonEncodedText.Encode("delayed_data_check_config"); + private static readonly System.Text.Json.JsonEncodedText PropFrequency = System.Text.Json.JsonEncodedText.Encode("frequency"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropIndices1 = System.Text.Json.JsonEncodedText.Encode("indexes"); + private static readonly System.Text.Json.JsonEncodedText PropIndicesOptions = System.Text.Json.JsonEncodedText.Encode("indices_options"); + private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); + private static readonly System.Text.Json.JsonEncodedText PropMaxEmptySearches = System.Text.Json.JsonEncodedText.Encode("max_empty_searches"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropQueryDelay = System.Text.Json.JsonEncodedText.Encode("query_delay"); + 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 PropScrollSize = System.Text.Json.JsonEncodedText.Encode("scroll_size"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DatafeedConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAggregations = default; + LocalJsonValue propChunkingConfig = default; + LocalJsonValue propDatafeedId = default; + LocalJsonValue propDelayedDataCheckConfig = default; + LocalJsonValue propFrequency = default; + LocalJsonValue propIndices = default; + LocalJsonValue propIndicesOptions = default; + LocalJsonValue propJobId = default; + LocalJsonValue propMaxEmptySearches = default; + LocalJsonValue propQuery = default; + LocalJsonValue propQueryDelay = default; + LocalJsonValue?> propRuntimeMappings = default; + LocalJsonValue?> propScriptFields = default; + LocalJsonValue propScrollSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)) || propAggregations.TryReadProperty(ref reader, options, PropAggregations1, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propChunkingConfig.TryReadProperty(ref reader, options, PropChunkingConfig, null)) + { + continue; + } + + if (propDatafeedId.TryReadProperty(ref reader, options, PropDatafeedId, null)) + { + continue; + } + + if (propDelayedDataCheckConfig.TryReadProperty(ref reader, options, PropDelayedDataCheckConfig, null)) + { + continue; + } + + if (propFrequency.TryReadProperty(ref reader, options, PropFrequency, null)) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, null) || propIndices.TryReadProperty(ref reader, options, PropIndices1, null)) + { + continue; + } + + if (propIndicesOptions.TryReadProperty(ref reader, options, PropIndicesOptions, null)) + { + continue; + } + + if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) + { + continue; + } + + if (propMaxEmptySearches.TryReadProperty(ref reader, options, PropMaxEmptySearches, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propQueryDelay.TryReadProperty(ref reader, options, PropQueryDelay, null)) + { + continue; + } + + if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propScriptFields.TryReadProperty(ref reader, options, PropScriptFields, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propScrollSize.TryReadProperty(ref reader, options, PropScrollSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DatafeedConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = propAggregations.Value, + ChunkingConfig = propChunkingConfig.Value, + DatafeedId = propDatafeedId.Value, + DelayedDataCheckConfig = propDelayedDataCheckConfig.Value, + Frequency = propFrequency.Value, + Indices = propIndices.Value, + IndicesOptions = propIndicesOptions.Value, + JobId = propJobId.Value, + MaxEmptySearches = propMaxEmptySearches.Value, + Query = propQuery.Value, + QueryDelay = propQueryDelay.Value, + RuntimeMappings = propRuntimeMappings.Value, + ScriptFields = propScriptFields.Value, + ScrollSize = propScrollSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DatafeedConfig value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropChunkingConfig, value.ChunkingConfig, null, null); + writer.WriteProperty(options, PropDatafeedId, value.DatafeedId, null, null); + writer.WriteProperty(options, PropDelayedDataCheckConfig, value.DelayedDataCheckConfig, null, null); + writer.WriteProperty(options, PropFrequency, value.Frequency, null, null); + writer.WriteProperty(options, PropIndices, value.Indices, null, null); + writer.WriteProperty(options, PropIndicesOptions, value.IndicesOptions, null, null); + writer.WriteProperty(options, PropJobId, value.JobId, null, null); + writer.WriteProperty(options, PropMaxEmptySearches, value.MaxEmptySearches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropQueryDelay, value.QueryDelay, null, null); + writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropScriptFields, value.ScriptFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropScrollSize, value.ScrollSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedConfig.g.cs index e1c8b249fef..cf7c22560c4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedConfig.g.cs @@ -23,165 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DatafeedConfigConverter : System.Text.Json.Serialization.JsonConverter -{ - 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 PropChunkingConfig = System.Text.Json.JsonEncodedText.Encode("chunking_config"); - private static readonly System.Text.Json.JsonEncodedText PropDatafeedId = System.Text.Json.JsonEncodedText.Encode("datafeed_id"); - private static readonly System.Text.Json.JsonEncodedText PropDelayedDataCheckConfig = System.Text.Json.JsonEncodedText.Encode("delayed_data_check_config"); - private static readonly System.Text.Json.JsonEncodedText PropFrequency = System.Text.Json.JsonEncodedText.Encode("frequency"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropIndices1 = System.Text.Json.JsonEncodedText.Encode("indexes"); - private static readonly System.Text.Json.JsonEncodedText PropIndicesOptions = System.Text.Json.JsonEncodedText.Encode("indices_options"); - private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); - private static readonly System.Text.Json.JsonEncodedText PropMaxEmptySearches = System.Text.Json.JsonEncodedText.Encode("max_empty_searches"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropQueryDelay = System.Text.Json.JsonEncodedText.Encode("query_delay"); - 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 PropScrollSize = System.Text.Json.JsonEncodedText.Encode("scroll_size"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DatafeedConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAggregations = default; - LocalJsonValue propChunkingConfig = default; - LocalJsonValue propDatafeedId = default; - LocalJsonValue propDelayedDataCheckConfig = default; - LocalJsonValue propFrequency = default; - LocalJsonValue propIndices = default; - LocalJsonValue propIndicesOptions = default; - LocalJsonValue propJobId = default; - LocalJsonValue propMaxEmptySearches = default; - LocalJsonValue propQuery = default; - LocalJsonValue propQueryDelay = default; - LocalJsonValue?> propRuntimeMappings = default; - LocalJsonValue?> propScriptFields = default; - LocalJsonValue propScrollSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)) || propAggregations.TryReadProperty(ref reader, options, PropAggregations1, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propChunkingConfig.TryReadProperty(ref reader, options, PropChunkingConfig, null)) - { - continue; - } - - if (propDatafeedId.TryReadProperty(ref reader, options, PropDatafeedId, null)) - { - continue; - } - - if (propDelayedDataCheckConfig.TryReadProperty(ref reader, options, PropDelayedDataCheckConfig, null)) - { - continue; - } - - if (propFrequency.TryReadProperty(ref reader, options, PropFrequency, null)) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, null) || propIndices.TryReadProperty(ref reader, options, PropIndices1, null)) - { - continue; - } - - if (propIndicesOptions.TryReadProperty(ref reader, options, PropIndicesOptions, null)) - { - continue; - } - - if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) - { - continue; - } - - if (propMaxEmptySearches.TryReadProperty(ref reader, options, PropMaxEmptySearches, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propQueryDelay.TryReadProperty(ref reader, options, PropQueryDelay, null)) - { - continue; - } - - if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propScriptFields.TryReadProperty(ref reader, options, PropScriptFields, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propScrollSize.TryReadProperty(ref reader, options, PropScrollSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DatafeedConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = propAggregations.Value, - ChunkingConfig = propChunkingConfig.Value, - DatafeedId = propDatafeedId.Value, - DelayedDataCheckConfig = propDelayedDataCheckConfig.Value, - Frequency = propFrequency.Value, - Indices = propIndices.Value, - IndicesOptions = propIndicesOptions.Value, - JobId = propJobId.Value, - MaxEmptySearches = propMaxEmptySearches.Value, - Query = propQuery.Value, - QueryDelay = propQueryDelay.Value, - RuntimeMappings = propRuntimeMappings.Value, - ScriptFields = propScriptFields.Value, - ScrollSize = propScrollSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DatafeedConfig value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropChunkingConfig, value.ChunkingConfig, null, null); - writer.WriteProperty(options, PropDatafeedId, value.DatafeedId, null, null); - writer.WriteProperty(options, PropDelayedDataCheckConfig, value.DelayedDataCheckConfig, null, null); - writer.WriteProperty(options, PropFrequency, value.Frequency, null, null); - writer.WriteProperty(options, PropIndices, value.Indices, null, null); - writer.WriteProperty(options, PropIndicesOptions, value.IndicesOptions, null, null); - writer.WriteProperty(options, PropJobId, value.JobId, null, null); - writer.WriteProperty(options, PropMaxEmptySearches, value.MaxEmptySearches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropQueryDelay, value.QueryDelay, null, null); - writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropScriptFields, value.ScriptFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropScrollSize, value.ScrollSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DatafeedConfigConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DatafeedConfigConverter))] public sealed partial class DatafeedConfig { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedRunningState.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedRunningState.Converters.g.cs new file mode 100644 index 00000000000..f7f7d976078 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedRunningState.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DatafeedRunningStateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRealTimeConfigured = System.Text.Json.JsonEncodedText.Encode("real_time_configured"); + private static readonly System.Text.Json.JsonEncodedText PropRealTimeRunning = System.Text.Json.JsonEncodedText.Encode("real_time_running"); + private static readonly System.Text.Json.JsonEncodedText PropSearchInterval = System.Text.Json.JsonEncodedText.Encode("search_interval"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DatafeedRunningState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propRealTimeConfigured = default; + LocalJsonValue propRealTimeRunning = default; + LocalJsonValue propSearchInterval = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRealTimeConfigured.TryReadProperty(ref reader, options, PropRealTimeConfigured, null)) + { + continue; + } + + if (propRealTimeRunning.TryReadProperty(ref reader, options, PropRealTimeRunning, null)) + { + continue; + } + + if (propSearchInterval.TryReadProperty(ref reader, options, PropSearchInterval, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DatafeedRunningState(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + RealTimeConfigured = propRealTimeConfigured.Value, + RealTimeRunning = propRealTimeRunning.Value, + SearchInterval = propSearchInterval.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DatafeedRunningState value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRealTimeConfigured, value.RealTimeConfigured, null, null); + writer.WriteProperty(options, PropRealTimeRunning, value.RealTimeRunning, null, null); + writer.WriteProperty(options, PropSearchInterval, value.SearchInterval, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedRunningState.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedRunningState.g.cs index 4150fdcf00e..2897d14cf39 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedRunningState.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedRunningState.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DatafeedRunningStateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRealTimeConfigured = System.Text.Json.JsonEncodedText.Encode("real_time_configured"); - private static readonly System.Text.Json.JsonEncodedText PropRealTimeRunning = System.Text.Json.JsonEncodedText.Encode("real_time_running"); - private static readonly System.Text.Json.JsonEncodedText PropSearchInterval = System.Text.Json.JsonEncodedText.Encode("search_interval"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DatafeedRunningState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propRealTimeConfigured = default; - LocalJsonValue propRealTimeRunning = default; - LocalJsonValue propSearchInterval = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRealTimeConfigured.TryReadProperty(ref reader, options, PropRealTimeConfigured, null)) - { - continue; - } - - if (propRealTimeRunning.TryReadProperty(ref reader, options, PropRealTimeRunning, null)) - { - continue; - } - - if (propSearchInterval.TryReadProperty(ref reader, options, PropSearchInterval, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DatafeedRunningState(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - RealTimeConfigured = propRealTimeConfigured.Value, - RealTimeRunning = propRealTimeRunning.Value, - SearchInterval = propSearchInterval.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DatafeedRunningState value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRealTimeConfigured, value.RealTimeConfigured, null, null); - writer.WriteProperty(options, PropRealTimeRunning, value.RealTimeRunning, null, null); - writer.WriteProperty(options, PropSearchInterval, value.SearchInterval, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DatafeedRunningStateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DatafeedRunningStateConverter))] public sealed partial class DatafeedRunningState { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedState.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedState.Converters.g.cs new file mode 100644 index 00000000000..b06f1529095 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedState.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DatafeedStateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberStarted = System.Text.Json.JsonEncodedText.Encode("started"); + private static readonly System.Text.Json.JsonEncodedText MemberStarting = System.Text.Json.JsonEncodedText.Encode("starting"); + private static readonly System.Text.Json.JsonEncodedText MemberStopped = System.Text.Json.JsonEncodedText.Encode("stopped"); + private static readonly System.Text.Json.JsonEncodedText MemberStopping = System.Text.Json.JsonEncodedText.Encode("stopping"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberStarted)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState.Started; + } + + if (reader.ValueTextEquals(MemberStarting)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState.Starting; + } + + if (reader.ValueTextEquals(MemberStopped)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState.Stopped; + } + + if (reader.ValueTextEquals(MemberStopping)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState.Stopping; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberStarted.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState.Started; + } + + if (string.Equals(value, MemberStarting.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState.Starting; + } + + if (string.Equals(value, MemberStopped.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState.Stopped; + } + + if (string.Equals(value, MemberStopping.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState.Stopping; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState.Started: + writer.WriteStringValue(MemberStarted); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState.Starting: + writer.WriteStringValue(MemberStarting); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState.Stopped: + writer.WriteStringValue(MemberStopped); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState.Stopping: + writer.WriteStringValue(MemberStopping); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DatafeedState value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedState.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedState.g.cs new file mode 100644 index 00000000000..8e3d124c6bb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedState.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DatafeedStateConverter))] +public enum DatafeedState +{ + [System.Runtime.Serialization.EnumMember(Value = "started")] + Started, + [System.Runtime.Serialization.EnumMember(Value = "starting")] + Starting, + [System.Runtime.Serialization.EnumMember(Value = "stopped")] + Stopped, + [System.Runtime.Serialization.EnumMember(Value = "stopping")] + Stopping +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedStats.Converters.g.cs new file mode 100644 index 00000000000..199693aa690 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedStats.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DatafeedStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAssignmentExplanation = System.Text.Json.JsonEncodedText.Encode("assignment_explanation"); + private static readonly System.Text.Json.JsonEncodedText PropDatafeedId = System.Text.Json.JsonEncodedText.Encode("datafeed_id"); + private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); + private static readonly System.Text.Json.JsonEncodedText PropRunningState = System.Text.Json.JsonEncodedText.Encode("running_state"); + private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); + private static readonly System.Text.Json.JsonEncodedText PropTimingStats = System.Text.Json.JsonEncodedText.Encode("timing_stats"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DatafeedStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAssignmentExplanation = default; + LocalJsonValue propDatafeedId = default; + LocalJsonValue propNode = default; + LocalJsonValue propRunningState = default; + LocalJsonValue propState = default; + LocalJsonValue propTimingStats = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAssignmentExplanation.TryReadProperty(ref reader, options, PropAssignmentExplanation, null)) + { + continue; + } + + if (propDatafeedId.TryReadProperty(ref reader, options, PropDatafeedId, null)) + { + continue; + } + + if (propNode.TryReadProperty(ref reader, options, PropNode, null)) + { + continue; + } + + if (propRunningState.TryReadProperty(ref reader, options, PropRunningState, null)) + { + continue; + } + + if (propState.TryReadProperty(ref reader, options, PropState, null)) + { + continue; + } + + if (propTimingStats.TryReadProperty(ref reader, options, PropTimingStats, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DatafeedStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AssignmentExplanation = propAssignmentExplanation.Value, + DatafeedId = propDatafeedId.Value, + Node = propNode.Value, + RunningState = propRunningState.Value, + State = propState.Value, + TimingStats = propTimingStats.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DatafeedStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAssignmentExplanation, value.AssignmentExplanation, null, null); + writer.WriteProperty(options, PropDatafeedId, value.DatafeedId, null, null); + writer.WriteProperty(options, PropNode, value.Node, null, null); + writer.WriteProperty(options, PropRunningState, value.RunningState, null, null); + writer.WriteProperty(options, PropState, value.State, null, null); + writer.WriteProperty(options, PropTimingStats, value.TimingStats, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedStats.g.cs index 4373371e21e..c74af611be3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedStats.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DatafeedStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAssignmentExplanation = System.Text.Json.JsonEncodedText.Encode("assignment_explanation"); - private static readonly System.Text.Json.JsonEncodedText PropDatafeedId = System.Text.Json.JsonEncodedText.Encode("datafeed_id"); - private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); - private static readonly System.Text.Json.JsonEncodedText PropRunningState = System.Text.Json.JsonEncodedText.Encode("running_state"); - private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); - private static readonly System.Text.Json.JsonEncodedText PropTimingStats = System.Text.Json.JsonEncodedText.Encode("timing_stats"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DatafeedStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAssignmentExplanation = default; - LocalJsonValue propDatafeedId = default; - LocalJsonValue propNode = default; - LocalJsonValue propRunningState = default; - LocalJsonValue propState = default; - LocalJsonValue propTimingStats = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAssignmentExplanation.TryReadProperty(ref reader, options, PropAssignmentExplanation, null)) - { - continue; - } - - if (propDatafeedId.TryReadProperty(ref reader, options, PropDatafeedId, null)) - { - continue; - } - - if (propNode.TryReadProperty(ref reader, options, PropNode, null)) - { - continue; - } - - if (propRunningState.TryReadProperty(ref reader, options, PropRunningState, null)) - { - continue; - } - - if (propState.TryReadProperty(ref reader, options, PropState, null)) - { - continue; - } - - if (propTimingStats.TryReadProperty(ref reader, options, PropTimingStats, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DatafeedStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AssignmentExplanation = propAssignmentExplanation.Value, - DatafeedId = propDatafeedId.Value, - Node = propNode.Value, - RunningState = propRunningState.Value, - State = propState.Value, - TimingStats = propTimingStats.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DatafeedStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAssignmentExplanation, value.AssignmentExplanation, null, null); - writer.WriteProperty(options, PropDatafeedId, value.DatafeedId, null, null); - writer.WriteProperty(options, PropNode, value.Node, null, null); - writer.WriteProperty(options, PropRunningState, value.RunningState, null, null); - writer.WriteProperty(options, PropState, value.State, null, null); - writer.WriteProperty(options, PropTimingStats, value.TimingStats, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DatafeedStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DatafeedStatsConverter))] public sealed partial class DatafeedStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedTimingStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedTimingStats.Converters.g.cs new file mode 100644 index 00000000000..b7d584a6c33 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedTimingStats.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DatafeedTimingStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAverageSearchTimePerBucketMs = System.Text.Json.JsonEncodedText.Encode("average_search_time_per_bucket_ms"); + private static readonly System.Text.Json.JsonEncodedText PropBucketCount = System.Text.Json.JsonEncodedText.Encode("bucket_count"); + private static readonly System.Text.Json.JsonEncodedText PropExponentialAverageCalculationContext = System.Text.Json.JsonEncodedText.Encode("exponential_average_calculation_context"); + private static readonly System.Text.Json.JsonEncodedText PropExponentialAverageSearchTimePerHourMs = System.Text.Json.JsonEncodedText.Encode("exponential_average_search_time_per_hour_ms"); + private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); + private static readonly System.Text.Json.JsonEncodedText PropSearchCount = System.Text.Json.JsonEncodedText.Encode("search_count"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSearchTimeMs = System.Text.Json.JsonEncodedText.Encode("total_search_time_ms"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DatafeedTimingStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAverageSearchTimePerBucketMs = default; + LocalJsonValue propBucketCount = default; + LocalJsonValue propExponentialAverageCalculationContext = default; + LocalJsonValue propExponentialAverageSearchTimePerHourMs = default; + LocalJsonValue propJobId = default; + LocalJsonValue propSearchCount = default; + LocalJsonValue propTotalSearchTimeMs = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAverageSearchTimePerBucketMs.TryReadProperty(ref reader, options, PropAverageSearchTimePerBucketMs, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propBucketCount.TryReadProperty(ref reader, options, PropBucketCount, null)) + { + continue; + } + + if (propExponentialAverageCalculationContext.TryReadProperty(ref reader, options, PropExponentialAverageCalculationContext, null)) + { + continue; + } + + if (propExponentialAverageSearchTimePerHourMs.TryReadProperty(ref reader, options, PropExponentialAverageSearchTimePerHourMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) + { + continue; + } + + if (propSearchCount.TryReadProperty(ref reader, options, PropSearchCount, null)) + { + continue; + } + + if (propTotalSearchTimeMs.TryReadProperty(ref reader, options, PropTotalSearchTimeMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DatafeedTimingStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AverageSearchTimePerBucketMs = propAverageSearchTimePerBucketMs.Value, + BucketCount = propBucketCount.Value, + ExponentialAverageCalculationContext = propExponentialAverageCalculationContext.Value, + ExponentialAverageSearchTimePerHourMs = propExponentialAverageSearchTimePerHourMs.Value, + JobId = propJobId.Value, + SearchCount = propSearchCount.Value, + TotalSearchTimeMs = propTotalSearchTimeMs.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DatafeedTimingStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAverageSearchTimePerBucketMs, value.AverageSearchTimePerBucketMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropBucketCount, value.BucketCount, null, null); + writer.WriteProperty(options, PropExponentialAverageCalculationContext, value.ExponentialAverageCalculationContext, null, null); + writer.WriteProperty(options, PropExponentialAverageSearchTimePerHourMs, value.ExponentialAverageSearchTimePerHourMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropJobId, value.JobId, null, null); + writer.WriteProperty(options, PropSearchCount, value.SearchCount, null, null); + writer.WriteProperty(options, PropTotalSearchTimeMs, value.TotalSearchTimeMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedTimingStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedTimingStats.g.cs index f50d4fa5145..38856c8d77a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedTimingStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DatafeedTimingStats.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DatafeedTimingStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAverageSearchTimePerBucketMs = System.Text.Json.JsonEncodedText.Encode("average_search_time_per_bucket_ms"); - private static readonly System.Text.Json.JsonEncodedText PropBucketCount = System.Text.Json.JsonEncodedText.Encode("bucket_count"); - private static readonly System.Text.Json.JsonEncodedText PropExponentialAverageCalculationContext = System.Text.Json.JsonEncodedText.Encode("exponential_average_calculation_context"); - private static readonly System.Text.Json.JsonEncodedText PropExponentialAverageSearchTimePerHourMs = System.Text.Json.JsonEncodedText.Encode("exponential_average_search_time_per_hour_ms"); - private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); - private static readonly System.Text.Json.JsonEncodedText PropSearchCount = System.Text.Json.JsonEncodedText.Encode("search_count"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSearchTimeMs = System.Text.Json.JsonEncodedText.Encode("total_search_time_ms"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DatafeedTimingStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAverageSearchTimePerBucketMs = default; - LocalJsonValue propBucketCount = default; - LocalJsonValue propExponentialAverageCalculationContext = default; - LocalJsonValue propExponentialAverageSearchTimePerHourMs = default; - LocalJsonValue propJobId = default; - LocalJsonValue propSearchCount = default; - LocalJsonValue propTotalSearchTimeMs = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAverageSearchTimePerBucketMs.TryReadProperty(ref reader, options, PropAverageSearchTimePerBucketMs, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propBucketCount.TryReadProperty(ref reader, options, PropBucketCount, null)) - { - continue; - } - - if (propExponentialAverageCalculationContext.TryReadProperty(ref reader, options, PropExponentialAverageCalculationContext, null)) - { - continue; - } - - if (propExponentialAverageSearchTimePerHourMs.TryReadProperty(ref reader, options, PropExponentialAverageSearchTimePerHourMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) - { - continue; - } - - if (propSearchCount.TryReadProperty(ref reader, options, PropSearchCount, null)) - { - continue; - } - - if (propTotalSearchTimeMs.TryReadProperty(ref reader, options, PropTotalSearchTimeMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DatafeedTimingStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AverageSearchTimePerBucketMs = propAverageSearchTimePerBucketMs.Value, - BucketCount = propBucketCount.Value, - ExponentialAverageCalculationContext = propExponentialAverageCalculationContext.Value, - ExponentialAverageSearchTimePerHourMs = propExponentialAverageSearchTimePerHourMs.Value, - JobId = propJobId.Value, - SearchCount = propSearchCount.Value, - TotalSearchTimeMs = propTotalSearchTimeMs.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DatafeedTimingStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAverageSearchTimePerBucketMs, value.AverageSearchTimePerBucketMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropBucketCount, value.BucketCount, null, null); - writer.WriteProperty(options, PropExponentialAverageCalculationContext, value.ExponentialAverageCalculationContext, null, null); - writer.WriteProperty(options, PropExponentialAverageSearchTimePerHourMs, value.ExponentialAverageSearchTimePerHourMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropJobId, value.JobId, null, null); - writer.WriteProperty(options, PropSearchCount, value.SearchCount, null, null); - writer.WriteProperty(options, PropTotalSearchTimeMs, value.TotalSearchTimeMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DatafeedTimingStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DatafeedTimingStatsConverter))] public sealed partial class DatafeedTimingStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Datafeeds.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Datafeeds.Converters.g.cs new file mode 100644 index 00000000000..74434fefe94 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Datafeeds.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DatafeedsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropScrollSize = System.Text.Json.JsonEncodedText.Encode("scroll_size"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.Datafeeds Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propScrollSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propScrollSize.TryReadProperty(ref reader, options, PropScrollSize, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.Datafeeds(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ScrollSize = propScrollSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Datafeeds value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropScrollSize, value.ScrollSize, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Datafeeds.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Datafeeds.g.cs index 1434d9cb1f5..618670703cf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Datafeeds.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Datafeeds.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DatafeedsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropScrollSize = System.Text.Json.JsonEncodedText.Encode("scroll_size"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.Datafeeds Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propScrollSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propScrollSize.TryReadProperty(ref reader, options, PropScrollSize, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.Datafeeds(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ScrollSize = propScrollSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Datafeeds value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropScrollSize, value.ScrollSize, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DatafeedsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DatafeedsConverter))] public sealed partial class Datafeeds { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysis.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysis.Converters.g.cs new file mode 100644 index 00000000000..d2edbbf977f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysis.Converters.g.cs @@ -0,0 +1,102 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeAnalysisConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantClassification = System.Text.Json.JsonEncodedText.Encode("classification"); + private static readonly System.Text.Json.JsonEncodedText VariantOutlierDetection = System.Text.Json.JsonEncodedText.Encode("outlier_detection"); + private static readonly System.Text.Json.JsonEncodedText VariantRegression = System.Text.Json.JsonEncodedText.Encode("regression"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantClassification)) + { + variantType = VariantClassification.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantOutlierDetection)) + { + variantType = VariantOutlierDetection.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRegression)) + { + variantType = VariantRegression.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "classification": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisClassification)value.Variant, null, null); + break; + case "outlier_detection": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisOutlierDetection)value.Variant, null, null); + break; + case "regression": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisRegression)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysis.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysis.g.cs index 8ee77a5391c..325c38f2870 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysis.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysis.g.cs @@ -23,85 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeAnalysisConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantClassification = System.Text.Json.JsonEncodedText.Encode("classification"); - private static readonly System.Text.Json.JsonEncodedText VariantOutlierDetection = System.Text.Json.JsonEncodedText.Encode("outlier_detection"); - private static readonly System.Text.Json.JsonEncodedText VariantRegression = System.Text.Json.JsonEncodedText.Encode("regression"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantClassification)) - { - variantType = VariantClassification.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantOutlierDetection)) - { - variantType = VariantOutlierDetection.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRegression)) - { - variantType = VariantRegression.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "classification": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisClassification)value.Variant, null, null); - break; - case "outlier_detection": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisOutlierDetection)value.Variant, null, null); - break; - case "regression": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisRegression)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysis)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeAnalysisConverter))] public sealed partial class DataframeAnalysis { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisAnalyzedFields.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisAnalyzedFields.Converters.g.cs new file mode 100644 index 00000000000..51faa370bac --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisAnalyzedFields.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeAnalysisAnalyzedFieldsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExcludes = System.Text.Json.JsonEncodedText.Encode("excludes"); + private static readonly System.Text.Json.JsonEncodedText PropIncludes = System.Text.Json.JsonEncodedText.Encode("includes"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) + { + var value = reader.ReadValue?>(options, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Includes = value + }; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propExcludes = default; + LocalJsonValue?> propIncludes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExcludes.TryReadProperty(ref reader, options, PropExcludes, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propIncludes.TryReadProperty(ref reader, options, PropIncludes, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Excludes = propExcludes.Value, + Includes = propIncludes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExcludes, value.Excludes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIncludes, value.Includes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisAnalyzedFields.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisAnalyzedFields.g.cs index 321ef230cea..1e056b8d531 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisAnalyzedFields.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisAnalyzedFields.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeAnalysisAnalyzedFieldsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExcludes = System.Text.Json.JsonEncodedText.Encode("excludes"); - private static readonly System.Text.Json.JsonEncodedText PropIncludes = System.Text.Json.JsonEncodedText.Encode("includes"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) - { - var value = reader.ReadValue?>(options, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Includes = value - }; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propExcludes = default; - LocalJsonValue?> propIncludes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExcludes.TryReadProperty(ref reader, options, PropExcludes, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propIncludes.TryReadProperty(ref reader, options, PropIncludes, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Excludes = propExcludes.Value, - Includes = propIncludes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFields value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExcludes, value.Excludes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIncludes, value.Includes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisAnalyzedFieldsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeAnalysisAnalyzedFieldsConverter))] public sealed partial class DataframeAnalysisAnalyzedFields { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisClassification.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisClassification.Converters.g.cs new file mode 100644 index 00000000000..60cf174fbbb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisClassification.Converters.g.cs @@ -0,0 +1,235 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeAnalysisClassificationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAlpha = System.Text.Json.JsonEncodedText.Encode("alpha"); + private static readonly System.Text.Json.JsonEncodedText PropClassAssignmentObjective = System.Text.Json.JsonEncodedText.Encode("class_assignment_objective"); + private static readonly System.Text.Json.JsonEncodedText PropDependentVariable = System.Text.Json.JsonEncodedText.Encode("dependent_variable"); + private static readonly System.Text.Json.JsonEncodedText PropDownsampleFactor = System.Text.Json.JsonEncodedText.Encode("downsample_factor"); + private static readonly System.Text.Json.JsonEncodedText PropEarlyStoppingEnabled = System.Text.Json.JsonEncodedText.Encode("early_stopping_enabled"); + private static readonly System.Text.Json.JsonEncodedText PropEta = System.Text.Json.JsonEncodedText.Encode("eta"); + private static readonly System.Text.Json.JsonEncodedText PropEtaGrowthRatePerTree = System.Text.Json.JsonEncodedText.Encode("eta_growth_rate_per_tree"); + private static readonly System.Text.Json.JsonEncodedText PropFeatureBagFraction = System.Text.Json.JsonEncodedText.Encode("feature_bag_fraction"); + private static readonly System.Text.Json.JsonEncodedText PropFeatureProcessors = System.Text.Json.JsonEncodedText.Encode("feature_processors"); + private static readonly System.Text.Json.JsonEncodedText PropGamma = System.Text.Json.JsonEncodedText.Encode("gamma"); + private static readonly System.Text.Json.JsonEncodedText PropLambda = System.Text.Json.JsonEncodedText.Encode("lambda"); + private static readonly System.Text.Json.JsonEncodedText PropMaxOptimizationRoundsPerHyperparameter = System.Text.Json.JsonEncodedText.Encode("max_optimization_rounds_per_hyperparameter"); + private static readonly System.Text.Json.JsonEncodedText PropMaxTrees = System.Text.Json.JsonEncodedText.Encode("max_trees"); + private static readonly System.Text.Json.JsonEncodedText PropMaxTrees1 = System.Text.Json.JsonEncodedText.Encode("maximum_number_trees"); + private static readonly System.Text.Json.JsonEncodedText PropNumTopClasses = System.Text.Json.JsonEncodedText.Encode("num_top_classes"); + private static readonly System.Text.Json.JsonEncodedText PropNumTopFeatureImportanceValues = System.Text.Json.JsonEncodedText.Encode("num_top_feature_importance_values"); + private static readonly System.Text.Json.JsonEncodedText PropPredictionFieldName = System.Text.Json.JsonEncodedText.Encode("prediction_field_name"); + private static readonly System.Text.Json.JsonEncodedText PropRandomizeSeed = System.Text.Json.JsonEncodedText.Encode("randomize_seed"); + private static readonly System.Text.Json.JsonEncodedText PropSoftTreeDepthLimit = System.Text.Json.JsonEncodedText.Encode("soft_tree_depth_limit"); + private static readonly System.Text.Json.JsonEncodedText PropSoftTreeDepthTolerance = System.Text.Json.JsonEncodedText.Encode("soft_tree_depth_tolerance"); + private static readonly System.Text.Json.JsonEncodedText PropTrainingPercent = System.Text.Json.JsonEncodedText.Encode("training_percent"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisClassification Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAlpha = default; + LocalJsonValue propClassAssignmentObjective = default; + LocalJsonValue propDependentVariable = default; + LocalJsonValue propDownsampleFactor = default; + LocalJsonValue propEarlyStoppingEnabled = default; + LocalJsonValue propEta = default; + LocalJsonValue propEtaGrowthRatePerTree = default; + LocalJsonValue propFeatureBagFraction = default; + LocalJsonValue?> propFeatureProcessors = default; + LocalJsonValue propGamma = default; + LocalJsonValue propLambda = default; + LocalJsonValue propMaxOptimizationRoundsPerHyperparameter = default; + LocalJsonValue propMaxTrees = default; + LocalJsonValue propNumTopClasses = default; + LocalJsonValue propNumTopFeatureImportanceValues = default; + LocalJsonValue propPredictionFieldName = default; + LocalJsonValue propRandomizeSeed = default; + LocalJsonValue propSoftTreeDepthLimit = default; + LocalJsonValue propSoftTreeDepthTolerance = default; + LocalJsonValue propTrainingPercent = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAlpha.TryReadProperty(ref reader, options, PropAlpha, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propClassAssignmentObjective.TryReadProperty(ref reader, options, PropClassAssignmentObjective, null)) + { + continue; + } + + if (propDependentVariable.TryReadProperty(ref reader, options, PropDependentVariable, null)) + { + continue; + } + + if (propDownsampleFactor.TryReadProperty(ref reader, options, PropDownsampleFactor, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEarlyStoppingEnabled.TryReadProperty(ref reader, options, PropEarlyStoppingEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEta.TryReadProperty(ref reader, options, PropEta, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEtaGrowthRatePerTree.TryReadProperty(ref reader, options, PropEtaGrowthRatePerTree, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFeatureBagFraction.TryReadProperty(ref reader, options, PropFeatureBagFraction, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFeatureProcessors.TryReadProperty(ref reader, options, PropFeatureProcessors, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propGamma.TryReadProperty(ref reader, options, PropGamma, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLambda.TryReadProperty(ref reader, options, PropLambda, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxOptimizationRoundsPerHyperparameter.TryReadProperty(ref reader, options, PropMaxOptimizationRoundsPerHyperparameter, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxTrees.TryReadProperty(ref reader, options, PropMaxTrees, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o)) || propMaxTrees.TryReadProperty(ref reader, options, PropMaxTrees1, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNumTopClasses.TryReadProperty(ref reader, options, PropNumTopClasses, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNumTopFeatureImportanceValues.TryReadProperty(ref reader, options, PropNumTopFeatureImportanceValues, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPredictionFieldName.TryReadProperty(ref reader, options, PropPredictionFieldName, null)) + { + continue; + } + + if (propRandomizeSeed.TryReadProperty(ref reader, options, PropRandomizeSeed, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSoftTreeDepthLimit.TryReadProperty(ref reader, options, PropSoftTreeDepthLimit, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSoftTreeDepthTolerance.TryReadProperty(ref reader, options, PropSoftTreeDepthTolerance, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTrainingPercent.TryReadProperty(ref reader, options, PropTrainingPercent, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisClassification(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Alpha = propAlpha.Value, + ClassAssignmentObjective = propClassAssignmentObjective.Value, + DependentVariable = propDependentVariable.Value, + DownsampleFactor = propDownsampleFactor.Value, + EarlyStoppingEnabled = propEarlyStoppingEnabled.Value, + Eta = propEta.Value, + EtaGrowthRatePerTree = propEtaGrowthRatePerTree.Value, + FeatureBagFraction = propFeatureBagFraction.Value, + FeatureProcessors = propFeatureProcessors.Value, + Gamma = propGamma.Value, + Lambda = propLambda.Value, + MaxOptimizationRoundsPerHyperparameter = propMaxOptimizationRoundsPerHyperparameter.Value, + MaxTrees = propMaxTrees.Value, + NumTopClasses = propNumTopClasses.Value, + NumTopFeatureImportanceValues = propNumTopFeatureImportanceValues.Value, + PredictionFieldName = propPredictionFieldName.Value, + RandomizeSeed = propRandomizeSeed.Value, + SoftTreeDepthLimit = propSoftTreeDepthLimit.Value, + SoftTreeDepthTolerance = propSoftTreeDepthTolerance.Value, + TrainingPercent = propTrainingPercent.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisClassification value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAlpha, value.Alpha, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropClassAssignmentObjective, value.ClassAssignmentObjective, null, null); + writer.WriteProperty(options, PropDependentVariable, value.DependentVariable, null, null); + writer.WriteProperty(options, PropDownsampleFactor, value.DownsampleFactor, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEarlyStoppingEnabled, value.EarlyStoppingEnabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEta, value.Eta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEtaGrowthRatePerTree, value.EtaGrowthRatePerTree, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFeatureBagFraction, value.FeatureBagFraction, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFeatureProcessors, value.FeatureProcessors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropGamma, value.Gamma, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLambda, value.Lambda, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxOptimizationRoundsPerHyperparameter, value.MaxOptimizationRoundsPerHyperparameter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxTrees, value.MaxTrees, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNumTopClasses, value.NumTopClasses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNumTopFeatureImportanceValues, value.NumTopFeatureImportanceValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPredictionFieldName, value.PredictionFieldName, null, null); + writer.WriteProperty(options, PropRandomizeSeed, value.RandomizeSeed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSoftTreeDepthLimit, value.SoftTreeDepthLimit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSoftTreeDepthTolerance, value.SoftTreeDepthTolerance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTrainingPercent, value.TrainingPercent, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisClassification.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisClassification.g.cs index f9e3031c3e4..72a1d24c057 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisClassification.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisClassification.g.cs @@ -23,218 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeAnalysisClassificationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAlpha = System.Text.Json.JsonEncodedText.Encode("alpha"); - private static readonly System.Text.Json.JsonEncodedText PropClassAssignmentObjective = System.Text.Json.JsonEncodedText.Encode("class_assignment_objective"); - private static readonly System.Text.Json.JsonEncodedText PropDependentVariable = System.Text.Json.JsonEncodedText.Encode("dependent_variable"); - private static readonly System.Text.Json.JsonEncodedText PropDownsampleFactor = System.Text.Json.JsonEncodedText.Encode("downsample_factor"); - private static readonly System.Text.Json.JsonEncodedText PropEarlyStoppingEnabled = System.Text.Json.JsonEncodedText.Encode("early_stopping_enabled"); - private static readonly System.Text.Json.JsonEncodedText PropEta = System.Text.Json.JsonEncodedText.Encode("eta"); - private static readonly System.Text.Json.JsonEncodedText PropEtaGrowthRatePerTree = System.Text.Json.JsonEncodedText.Encode("eta_growth_rate_per_tree"); - private static readonly System.Text.Json.JsonEncodedText PropFeatureBagFraction = System.Text.Json.JsonEncodedText.Encode("feature_bag_fraction"); - private static readonly System.Text.Json.JsonEncodedText PropFeatureProcessors = System.Text.Json.JsonEncodedText.Encode("feature_processors"); - private static readonly System.Text.Json.JsonEncodedText PropGamma = System.Text.Json.JsonEncodedText.Encode("gamma"); - private static readonly System.Text.Json.JsonEncodedText PropLambda = System.Text.Json.JsonEncodedText.Encode("lambda"); - private static readonly System.Text.Json.JsonEncodedText PropMaxOptimizationRoundsPerHyperparameter = System.Text.Json.JsonEncodedText.Encode("max_optimization_rounds_per_hyperparameter"); - private static readonly System.Text.Json.JsonEncodedText PropMaxTrees = System.Text.Json.JsonEncodedText.Encode("max_trees"); - private static readonly System.Text.Json.JsonEncodedText PropMaxTrees1 = System.Text.Json.JsonEncodedText.Encode("maximum_number_trees"); - private static readonly System.Text.Json.JsonEncodedText PropNumTopClasses = System.Text.Json.JsonEncodedText.Encode("num_top_classes"); - private static readonly System.Text.Json.JsonEncodedText PropNumTopFeatureImportanceValues = System.Text.Json.JsonEncodedText.Encode("num_top_feature_importance_values"); - private static readonly System.Text.Json.JsonEncodedText PropPredictionFieldName = System.Text.Json.JsonEncodedText.Encode("prediction_field_name"); - private static readonly System.Text.Json.JsonEncodedText PropRandomizeSeed = System.Text.Json.JsonEncodedText.Encode("randomize_seed"); - private static readonly System.Text.Json.JsonEncodedText PropSoftTreeDepthLimit = System.Text.Json.JsonEncodedText.Encode("soft_tree_depth_limit"); - private static readonly System.Text.Json.JsonEncodedText PropSoftTreeDepthTolerance = System.Text.Json.JsonEncodedText.Encode("soft_tree_depth_tolerance"); - private static readonly System.Text.Json.JsonEncodedText PropTrainingPercent = System.Text.Json.JsonEncodedText.Encode("training_percent"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisClassification Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAlpha = default; - LocalJsonValue propClassAssignmentObjective = default; - LocalJsonValue propDependentVariable = default; - LocalJsonValue propDownsampleFactor = default; - LocalJsonValue propEarlyStoppingEnabled = default; - LocalJsonValue propEta = default; - LocalJsonValue propEtaGrowthRatePerTree = default; - LocalJsonValue propFeatureBagFraction = default; - LocalJsonValue?> propFeatureProcessors = default; - LocalJsonValue propGamma = default; - LocalJsonValue propLambda = default; - LocalJsonValue propMaxOptimizationRoundsPerHyperparameter = default; - LocalJsonValue propMaxTrees = default; - LocalJsonValue propNumTopClasses = default; - LocalJsonValue propNumTopFeatureImportanceValues = default; - LocalJsonValue propPredictionFieldName = default; - LocalJsonValue propRandomizeSeed = default; - LocalJsonValue propSoftTreeDepthLimit = default; - LocalJsonValue propSoftTreeDepthTolerance = default; - LocalJsonValue propTrainingPercent = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAlpha.TryReadProperty(ref reader, options, PropAlpha, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propClassAssignmentObjective.TryReadProperty(ref reader, options, PropClassAssignmentObjective, null)) - { - continue; - } - - if (propDependentVariable.TryReadProperty(ref reader, options, PropDependentVariable, null)) - { - continue; - } - - if (propDownsampleFactor.TryReadProperty(ref reader, options, PropDownsampleFactor, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEarlyStoppingEnabled.TryReadProperty(ref reader, options, PropEarlyStoppingEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEta.TryReadProperty(ref reader, options, PropEta, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEtaGrowthRatePerTree.TryReadProperty(ref reader, options, PropEtaGrowthRatePerTree, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFeatureBagFraction.TryReadProperty(ref reader, options, PropFeatureBagFraction, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFeatureProcessors.TryReadProperty(ref reader, options, PropFeatureProcessors, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propGamma.TryReadProperty(ref reader, options, PropGamma, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLambda.TryReadProperty(ref reader, options, PropLambda, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxOptimizationRoundsPerHyperparameter.TryReadProperty(ref reader, options, PropMaxOptimizationRoundsPerHyperparameter, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxTrees.TryReadProperty(ref reader, options, PropMaxTrees, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o)) || propMaxTrees.TryReadProperty(ref reader, options, PropMaxTrees1, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNumTopClasses.TryReadProperty(ref reader, options, PropNumTopClasses, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNumTopFeatureImportanceValues.TryReadProperty(ref reader, options, PropNumTopFeatureImportanceValues, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPredictionFieldName.TryReadProperty(ref reader, options, PropPredictionFieldName, null)) - { - continue; - } - - if (propRandomizeSeed.TryReadProperty(ref reader, options, PropRandomizeSeed, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSoftTreeDepthLimit.TryReadProperty(ref reader, options, PropSoftTreeDepthLimit, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSoftTreeDepthTolerance.TryReadProperty(ref reader, options, PropSoftTreeDepthTolerance, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTrainingPercent.TryReadProperty(ref reader, options, PropTrainingPercent, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisClassification(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Alpha = propAlpha.Value, - ClassAssignmentObjective = propClassAssignmentObjective.Value, - DependentVariable = propDependentVariable.Value, - DownsampleFactor = propDownsampleFactor.Value, - EarlyStoppingEnabled = propEarlyStoppingEnabled.Value, - Eta = propEta.Value, - EtaGrowthRatePerTree = propEtaGrowthRatePerTree.Value, - FeatureBagFraction = propFeatureBagFraction.Value, - FeatureProcessors = propFeatureProcessors.Value, - Gamma = propGamma.Value, - Lambda = propLambda.Value, - MaxOptimizationRoundsPerHyperparameter = propMaxOptimizationRoundsPerHyperparameter.Value, - MaxTrees = propMaxTrees.Value, - NumTopClasses = propNumTopClasses.Value, - NumTopFeatureImportanceValues = propNumTopFeatureImportanceValues.Value, - PredictionFieldName = propPredictionFieldName.Value, - RandomizeSeed = propRandomizeSeed.Value, - SoftTreeDepthLimit = propSoftTreeDepthLimit.Value, - SoftTreeDepthTolerance = propSoftTreeDepthTolerance.Value, - TrainingPercent = propTrainingPercent.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisClassification value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAlpha, value.Alpha, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropClassAssignmentObjective, value.ClassAssignmentObjective, null, null); - writer.WriteProperty(options, PropDependentVariable, value.DependentVariable, null, null); - writer.WriteProperty(options, PropDownsampleFactor, value.DownsampleFactor, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEarlyStoppingEnabled, value.EarlyStoppingEnabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEta, value.Eta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEtaGrowthRatePerTree, value.EtaGrowthRatePerTree, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFeatureBagFraction, value.FeatureBagFraction, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFeatureProcessors, value.FeatureProcessors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropGamma, value.Gamma, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLambda, value.Lambda, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxOptimizationRoundsPerHyperparameter, value.MaxOptimizationRoundsPerHyperparameter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxTrees, value.MaxTrees, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNumTopClasses, value.NumTopClasses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNumTopFeatureImportanceValues, value.NumTopFeatureImportanceValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPredictionFieldName, value.PredictionFieldName, null, null); - writer.WriteProperty(options, PropRandomizeSeed, value.RandomizeSeed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSoftTreeDepthLimit, value.SoftTreeDepthLimit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSoftTreeDepthTolerance, value.SoftTreeDepthTolerance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTrainingPercent, value.TrainingPercent, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisClassificationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeAnalysisClassificationConverter))] public sealed partial class DataframeAnalysisClassification { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessor.Converters.g.cs new file mode 100644 index 00000000000..1beba246162 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessor.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeAnalysisFeatureProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantFrequencyEncoding = System.Text.Json.JsonEncodedText.Encode("frequency_encoding"); + private static readonly System.Text.Json.JsonEncodedText VariantMultiEncoding = System.Text.Json.JsonEncodedText.Encode("multi_encoding"); + private static readonly System.Text.Json.JsonEncodedText VariantNGramEncoding = System.Text.Json.JsonEncodedText.Encode("n_gram_encoding"); + private static readonly System.Text.Json.JsonEncodedText VariantOneHotEncoding = System.Text.Json.JsonEncodedText.Encode("one_hot_encoding"); + private static readonly System.Text.Json.JsonEncodedText VariantTargetMeanEncoding = System.Text.Json.JsonEncodedText.Encode("target_mean_encoding"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantFrequencyEncoding)) + { + variantType = VariantFrequencyEncoding.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMultiEncoding)) + { + variantType = VariantMultiEncoding.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantNGramEncoding)) + { + variantType = VariantNGramEncoding.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantOneHotEncoding)) + { + variantType = VariantOneHotEncoding.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTargetMeanEncoding)) + { + variantType = VariantTargetMeanEncoding.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "frequency_encoding": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorFrequencyEncoding)value.Variant, null, null); + break; + case "multi_encoding": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorMultiEncoding)value.Variant, null, null); + break; + case "n_gram_encoding": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorNGramEncoding)value.Variant, null, null); + break; + case "one_hot_encoding": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorOneHotEncoding)value.Variant, null, null); + break; + case "target_mean_encoding": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorTargetMeanEncoding)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessor)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessor.g.cs index 5419a14eed3..871cb460b0c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessor.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeAnalysisFeatureProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantFrequencyEncoding = System.Text.Json.JsonEncodedText.Encode("frequency_encoding"); - private static readonly System.Text.Json.JsonEncodedText VariantMultiEncoding = System.Text.Json.JsonEncodedText.Encode("multi_encoding"); - private static readonly System.Text.Json.JsonEncodedText VariantNGramEncoding = System.Text.Json.JsonEncodedText.Encode("n_gram_encoding"); - private static readonly System.Text.Json.JsonEncodedText VariantOneHotEncoding = System.Text.Json.JsonEncodedText.Encode("one_hot_encoding"); - private static readonly System.Text.Json.JsonEncodedText VariantTargetMeanEncoding = System.Text.Json.JsonEncodedText.Encode("target_mean_encoding"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantFrequencyEncoding)) - { - variantType = VariantFrequencyEncoding.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMultiEncoding)) - { - variantType = VariantMultiEncoding.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantNGramEncoding)) - { - variantType = VariantNGramEncoding.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantOneHotEncoding)) - { - variantType = VariantOneHotEncoding.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTargetMeanEncoding)) - { - variantType = VariantTargetMeanEncoding.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "frequency_encoding": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorFrequencyEncoding)value.Variant, null, null); - break; - case "multi_encoding": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorMultiEncoding)value.Variant, null, null); - break; - case "n_gram_encoding": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorNGramEncoding)value.Variant, null, null); - break; - case "one_hot_encoding": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorOneHotEncoding)value.Variant, null, null); - break; - case "target_mean_encoding": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorTargetMeanEncoding)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessor)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeAnalysisFeatureProcessorConverter))] public sealed partial class DataframeAnalysisFeatureProcessor { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorFrequencyEncoding.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorFrequencyEncoding.Converters.g.cs new file mode 100644 index 00000000000..34c50aeca80 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorFrequencyEncoding.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeAnalysisFeatureProcessorFrequencyEncodingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFeatureName = System.Text.Json.JsonEncodedText.Encode("feature_name"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFrequencyMap = System.Text.Json.JsonEncodedText.Encode("frequency_map"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorFrequencyEncoding Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFeatureName = default; + LocalJsonValue propField = default; + LocalJsonValue> propFrequencyMap = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFeatureName.TryReadProperty(ref reader, options, PropFeatureName, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFrequencyMap.TryReadProperty(ref reader, options, PropFrequencyMap, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorFrequencyEncoding(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FeatureName = propFeatureName.Value, + Field = propField.Value, + FrequencyMap = propFrequencyMap.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorFrequencyEncoding value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFeatureName, value.FeatureName, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFrequencyMap, value.FrequencyMap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorFrequencyEncoding.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorFrequencyEncoding.g.cs index b2174f5025e..f9371e396b1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorFrequencyEncoding.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorFrequencyEncoding.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeAnalysisFeatureProcessorFrequencyEncodingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFeatureName = System.Text.Json.JsonEncodedText.Encode("feature_name"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFrequencyMap = System.Text.Json.JsonEncodedText.Encode("frequency_map"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorFrequencyEncoding Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFeatureName = default; - LocalJsonValue propField = default; - LocalJsonValue> propFrequencyMap = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFeatureName.TryReadProperty(ref reader, options, PropFeatureName, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFrequencyMap.TryReadProperty(ref reader, options, PropFrequencyMap, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorFrequencyEncoding(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FeatureName = propFeatureName.Value, - Field = propField.Value, - FrequencyMap = propFrequencyMap.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorFrequencyEncoding value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFeatureName, value.FeatureName, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFrequencyMap, value.FrequencyMap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorFrequencyEncodingConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeAnalysisFeatureProcessorFrequencyEncodingConverter))] public sealed partial class DataframeAnalysisFeatureProcessorFrequencyEncoding { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorMultiEncoding.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorMultiEncoding.Converters.g.cs new file mode 100644 index 00000000000..e2688a4447f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorMultiEncoding.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeAnalysisFeatureProcessorMultiEncodingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropProcessors = System.Text.Json.JsonEncodedText.Encode("processors"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorMultiEncoding Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propProcessors = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propProcessors.TryReadProperty(ref reader, options, PropProcessors, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorMultiEncoding(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Processors = propProcessors.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorMultiEncoding value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropProcessors, value.Processors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorMultiEncoding.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorMultiEncoding.g.cs index 7848050438e..d90812e6315 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorMultiEncoding.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorMultiEncoding.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeAnalysisFeatureProcessorMultiEncodingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropProcessors = System.Text.Json.JsonEncodedText.Encode("processors"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorMultiEncoding Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propProcessors = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propProcessors.TryReadProperty(ref reader, options, PropProcessors, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorMultiEncoding(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Processors = propProcessors.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorMultiEncoding value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropProcessors, value.Processors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorMultiEncodingConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeAnalysisFeatureProcessorMultiEncodingConverter))] public sealed partial class DataframeAnalysisFeatureProcessorMultiEncoding { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorNGramEncoding.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorNGramEncoding.Converters.g.cs new file mode 100644 index 00000000000..80f43cd113f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorNGramEncoding.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeAnalysisFeatureProcessorNGramEncodingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCustom = System.Text.Json.JsonEncodedText.Encode("custom"); + private static readonly System.Text.Json.JsonEncodedText PropFeaturePrefix = System.Text.Json.JsonEncodedText.Encode("feature_prefix"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropLength = System.Text.Json.JsonEncodedText.Encode("length"); + private static readonly System.Text.Json.JsonEncodedText PropNGrams = System.Text.Json.JsonEncodedText.Encode("n_grams"); + private static readonly System.Text.Json.JsonEncodedText PropStart = System.Text.Json.JsonEncodedText.Encode("start"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorNGramEncoding Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCustom = default; + LocalJsonValue propFeaturePrefix = default; + LocalJsonValue propField = default; + LocalJsonValue propLength = default; + LocalJsonValue> propNGrams = default; + LocalJsonValue propStart = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCustom.TryReadProperty(ref reader, options, PropCustom, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFeaturePrefix.TryReadProperty(ref reader, options, PropFeaturePrefix, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propLength.TryReadProperty(ref reader, options, PropLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNGrams.TryReadProperty(ref reader, options, PropNGrams, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propStart.TryReadProperty(ref reader, options, PropStart, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorNGramEncoding(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Custom = propCustom.Value, + FeaturePrefix = propFeaturePrefix.Value, + Field = propField.Value, + Length = propLength.Value, + NGrams = propNGrams.Value, + Start = propStart.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorNGramEncoding value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCustom, value.Custom, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFeaturePrefix, value.FeaturePrefix, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropLength, value.Length, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNGrams, value.NGrams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStart, value.Start, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorNGramEncoding.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorNGramEncoding.g.cs index 699aa4d1341..885c8171342 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorNGramEncoding.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorNGramEncoding.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeAnalysisFeatureProcessorNGramEncodingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCustom = System.Text.Json.JsonEncodedText.Encode("custom"); - private static readonly System.Text.Json.JsonEncodedText PropFeaturePrefix = System.Text.Json.JsonEncodedText.Encode("feature_prefix"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropLength = System.Text.Json.JsonEncodedText.Encode("length"); - private static readonly System.Text.Json.JsonEncodedText PropNGrams = System.Text.Json.JsonEncodedText.Encode("n_grams"); - private static readonly System.Text.Json.JsonEncodedText PropStart = System.Text.Json.JsonEncodedText.Encode("start"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorNGramEncoding Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCustom = default; - LocalJsonValue propFeaturePrefix = default; - LocalJsonValue propField = default; - LocalJsonValue propLength = default; - LocalJsonValue> propNGrams = default; - LocalJsonValue propStart = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCustom.TryReadProperty(ref reader, options, PropCustom, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFeaturePrefix.TryReadProperty(ref reader, options, PropFeaturePrefix, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propLength.TryReadProperty(ref reader, options, PropLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNGrams.TryReadProperty(ref reader, options, PropNGrams, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propStart.TryReadProperty(ref reader, options, PropStart, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorNGramEncoding(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Custom = propCustom.Value, - FeaturePrefix = propFeaturePrefix.Value, - Field = propField.Value, - Length = propLength.Value, - NGrams = propNGrams.Value, - Start = propStart.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorNGramEncoding value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCustom, value.Custom, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFeaturePrefix, value.FeaturePrefix, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropLength, value.Length, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNGrams, value.NGrams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStart, value.Start, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorNGramEncodingConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeAnalysisFeatureProcessorNGramEncodingConverter))] public sealed partial class DataframeAnalysisFeatureProcessorNGramEncoding { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorOneHotEncoding.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorOneHotEncoding.Converters.g.cs new file mode 100644 index 00000000000..8f378a0fbe3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorOneHotEncoding.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeAnalysisFeatureProcessorOneHotEncodingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropHotMap = System.Text.Json.JsonEncodedText.Encode("hot_map"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorOneHotEncoding Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propHotMap = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propHotMap.TryReadProperty(ref reader, options, PropHotMap, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorOneHotEncoding(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + HotMap = propHotMap.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorOneHotEncoding value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropHotMap, value.HotMap, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorOneHotEncoding.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorOneHotEncoding.g.cs index 5ce3c5100a5..0c7a12a50e0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorOneHotEncoding.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorOneHotEncoding.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeAnalysisFeatureProcessorOneHotEncodingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropHotMap = System.Text.Json.JsonEncodedText.Encode("hot_map"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorOneHotEncoding Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propHotMap = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propHotMap.TryReadProperty(ref reader, options, PropHotMap, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorOneHotEncoding(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - HotMap = propHotMap.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorOneHotEncoding value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropHotMap, value.HotMap, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorOneHotEncodingConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeAnalysisFeatureProcessorOneHotEncodingConverter))] public sealed partial class DataframeAnalysisFeatureProcessorOneHotEncoding { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorTargetMeanEncoding.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorTargetMeanEncoding.Converters.g.cs new file mode 100644 index 00000000000..29c6b93f6ba --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorTargetMeanEncoding.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeAnalysisFeatureProcessorTargetMeanEncodingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDefaultValue = System.Text.Json.JsonEncodedText.Encode("default_value"); + private static readonly System.Text.Json.JsonEncodedText PropFeatureName = System.Text.Json.JsonEncodedText.Encode("feature_name"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropTargetMap = System.Text.Json.JsonEncodedText.Encode("target_map"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorTargetMeanEncoding Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDefaultValue = default; + LocalJsonValue propFeatureName = default; + LocalJsonValue propField = default; + LocalJsonValue> propTargetMap = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDefaultValue.TryReadProperty(ref reader, options, PropDefaultValue, null)) + { + continue; + } + + if (propFeatureName.TryReadProperty(ref reader, options, PropFeatureName, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propTargetMap.TryReadProperty(ref reader, options, PropTargetMap, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorTargetMeanEncoding(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DefaultValue = propDefaultValue.Value, + FeatureName = propFeatureName.Value, + Field = propField.Value, + TargetMap = propTargetMap.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorTargetMeanEncoding value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDefaultValue, value.DefaultValue, null, null); + writer.WriteProperty(options, PropFeatureName, value.FeatureName, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropTargetMap, value.TargetMap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorTargetMeanEncoding.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorTargetMeanEncoding.g.cs index 90c722376fc..66648ca2549 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorTargetMeanEncoding.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisFeatureProcessorTargetMeanEncoding.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeAnalysisFeatureProcessorTargetMeanEncodingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDefaultValue = System.Text.Json.JsonEncodedText.Encode("default_value"); - private static readonly System.Text.Json.JsonEncodedText PropFeatureName = System.Text.Json.JsonEncodedText.Encode("feature_name"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropTargetMap = System.Text.Json.JsonEncodedText.Encode("target_map"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorTargetMeanEncoding Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDefaultValue = default; - LocalJsonValue propFeatureName = default; - LocalJsonValue propField = default; - LocalJsonValue> propTargetMap = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDefaultValue.TryReadProperty(ref reader, options, PropDefaultValue, null)) - { - continue; - } - - if (propFeatureName.TryReadProperty(ref reader, options, PropFeatureName, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propTargetMap.TryReadProperty(ref reader, options, PropTargetMap, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorTargetMeanEncoding(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DefaultValue = propDefaultValue.Value, - FeatureName = propFeatureName.Value, - Field = propField.Value, - TargetMap = propTargetMap.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorTargetMeanEncoding value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDefaultValue, value.DefaultValue, null, null); - writer.WriteProperty(options, PropFeatureName, value.FeatureName, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropTargetMap, value.TargetMap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisFeatureProcessorTargetMeanEncodingConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeAnalysisFeatureProcessorTargetMeanEncodingConverter))] public sealed partial class DataframeAnalysisFeatureProcessorTargetMeanEncoding { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisOutlierDetection.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisOutlierDetection.Converters.g.cs new file mode 100644 index 00000000000..cd8a3331802 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisOutlierDetection.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeAnalysisOutlierDetectionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropComputeFeatureInfluence = System.Text.Json.JsonEncodedText.Encode("compute_feature_influence"); + private static readonly System.Text.Json.JsonEncodedText PropFeatureInfluenceThreshold = System.Text.Json.JsonEncodedText.Encode("feature_influence_threshold"); + private static readonly System.Text.Json.JsonEncodedText PropMethod = System.Text.Json.JsonEncodedText.Encode("method"); + private static readonly System.Text.Json.JsonEncodedText PropNNeighbors = System.Text.Json.JsonEncodedText.Encode("n_neighbors"); + private static readonly System.Text.Json.JsonEncodedText PropOutlierFraction = System.Text.Json.JsonEncodedText.Encode("outlier_fraction"); + private static readonly System.Text.Json.JsonEncodedText PropStandardizationEnabled = System.Text.Json.JsonEncodedText.Encode("standardization_enabled"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisOutlierDetection Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propComputeFeatureInfluence = default; + LocalJsonValue propFeatureInfluenceThreshold = default; + LocalJsonValue propMethod = default; + LocalJsonValue propNNeighbors = default; + LocalJsonValue propOutlierFraction = default; + LocalJsonValue propStandardizationEnabled = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propComputeFeatureInfluence.TryReadProperty(ref reader, options, PropComputeFeatureInfluence, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFeatureInfluenceThreshold.TryReadProperty(ref reader, options, PropFeatureInfluenceThreshold, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMethod.TryReadProperty(ref reader, options, PropMethod, null)) + { + continue; + } + + if (propNNeighbors.TryReadProperty(ref reader, options, PropNNeighbors, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOutlierFraction.TryReadProperty(ref reader, options, PropOutlierFraction, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propStandardizationEnabled.TryReadProperty(ref reader, options, PropStandardizationEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisOutlierDetection(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ComputeFeatureInfluence = propComputeFeatureInfluence.Value, + FeatureInfluenceThreshold = propFeatureInfluenceThreshold.Value, + Method = propMethod.Value, + NNeighbors = propNNeighbors.Value, + OutlierFraction = propOutlierFraction.Value, + StandardizationEnabled = propStandardizationEnabled.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisOutlierDetection value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropComputeFeatureInfluence, value.ComputeFeatureInfluence, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFeatureInfluenceThreshold, value.FeatureInfluenceThreshold, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMethod, value.Method, null, null); + writer.WriteProperty(options, PropNNeighbors, value.NNeighbors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOutlierFraction, value.OutlierFraction, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropStandardizationEnabled, value.StandardizationEnabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisOutlierDetection.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisOutlierDetection.g.cs index 2e433899141..5fab6cc4a44 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisOutlierDetection.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisOutlierDetection.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeAnalysisOutlierDetectionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropComputeFeatureInfluence = System.Text.Json.JsonEncodedText.Encode("compute_feature_influence"); - private static readonly System.Text.Json.JsonEncodedText PropFeatureInfluenceThreshold = System.Text.Json.JsonEncodedText.Encode("feature_influence_threshold"); - private static readonly System.Text.Json.JsonEncodedText PropMethod = System.Text.Json.JsonEncodedText.Encode("method"); - private static readonly System.Text.Json.JsonEncodedText PropNNeighbors = System.Text.Json.JsonEncodedText.Encode("n_neighbors"); - private static readonly System.Text.Json.JsonEncodedText PropOutlierFraction = System.Text.Json.JsonEncodedText.Encode("outlier_fraction"); - private static readonly System.Text.Json.JsonEncodedText PropStandardizationEnabled = System.Text.Json.JsonEncodedText.Encode("standardization_enabled"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisOutlierDetection Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propComputeFeatureInfluence = default; - LocalJsonValue propFeatureInfluenceThreshold = default; - LocalJsonValue propMethod = default; - LocalJsonValue propNNeighbors = default; - LocalJsonValue propOutlierFraction = default; - LocalJsonValue propStandardizationEnabled = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propComputeFeatureInfluence.TryReadProperty(ref reader, options, PropComputeFeatureInfluence, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFeatureInfluenceThreshold.TryReadProperty(ref reader, options, PropFeatureInfluenceThreshold, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMethod.TryReadProperty(ref reader, options, PropMethod, null)) - { - continue; - } - - if (propNNeighbors.TryReadProperty(ref reader, options, PropNNeighbors, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOutlierFraction.TryReadProperty(ref reader, options, PropOutlierFraction, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propStandardizationEnabled.TryReadProperty(ref reader, options, PropStandardizationEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisOutlierDetection(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ComputeFeatureInfluence = propComputeFeatureInfluence.Value, - FeatureInfluenceThreshold = propFeatureInfluenceThreshold.Value, - Method = propMethod.Value, - NNeighbors = propNNeighbors.Value, - OutlierFraction = propOutlierFraction.Value, - StandardizationEnabled = propStandardizationEnabled.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisOutlierDetection value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropComputeFeatureInfluence, value.ComputeFeatureInfluence, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFeatureInfluenceThreshold, value.FeatureInfluenceThreshold, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMethod, value.Method, null, null); - writer.WriteProperty(options, PropNNeighbors, value.NNeighbors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOutlierFraction, value.OutlierFraction, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropStandardizationEnabled, value.StandardizationEnabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisOutlierDetectionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeAnalysisOutlierDetectionConverter))] public sealed partial class DataframeAnalysisOutlierDetection { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisRegression.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisRegression.Converters.g.cs new file mode 100644 index 00000000000..7815df29e13 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisRegression.Converters.g.cs @@ -0,0 +1,235 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeAnalysisRegressionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAlpha = System.Text.Json.JsonEncodedText.Encode("alpha"); + private static readonly System.Text.Json.JsonEncodedText PropDependentVariable = System.Text.Json.JsonEncodedText.Encode("dependent_variable"); + private static readonly System.Text.Json.JsonEncodedText PropDownsampleFactor = System.Text.Json.JsonEncodedText.Encode("downsample_factor"); + private static readonly System.Text.Json.JsonEncodedText PropEarlyStoppingEnabled = System.Text.Json.JsonEncodedText.Encode("early_stopping_enabled"); + private static readonly System.Text.Json.JsonEncodedText PropEta = System.Text.Json.JsonEncodedText.Encode("eta"); + private static readonly System.Text.Json.JsonEncodedText PropEtaGrowthRatePerTree = System.Text.Json.JsonEncodedText.Encode("eta_growth_rate_per_tree"); + private static readonly System.Text.Json.JsonEncodedText PropFeatureBagFraction = System.Text.Json.JsonEncodedText.Encode("feature_bag_fraction"); + private static readonly System.Text.Json.JsonEncodedText PropFeatureProcessors = System.Text.Json.JsonEncodedText.Encode("feature_processors"); + private static readonly System.Text.Json.JsonEncodedText PropGamma = System.Text.Json.JsonEncodedText.Encode("gamma"); + private static readonly System.Text.Json.JsonEncodedText PropLambda = System.Text.Json.JsonEncodedText.Encode("lambda"); + private static readonly System.Text.Json.JsonEncodedText PropLossFunction = System.Text.Json.JsonEncodedText.Encode("loss_function"); + private static readonly System.Text.Json.JsonEncodedText PropLossFunctionParameter = System.Text.Json.JsonEncodedText.Encode("loss_function_parameter"); + private static readonly System.Text.Json.JsonEncodedText PropMaxOptimizationRoundsPerHyperparameter = System.Text.Json.JsonEncodedText.Encode("max_optimization_rounds_per_hyperparameter"); + private static readonly System.Text.Json.JsonEncodedText PropMaxTrees = System.Text.Json.JsonEncodedText.Encode("max_trees"); + private static readonly System.Text.Json.JsonEncodedText PropMaxTrees1 = System.Text.Json.JsonEncodedText.Encode("maximum_number_trees"); + private static readonly System.Text.Json.JsonEncodedText PropNumTopFeatureImportanceValues = System.Text.Json.JsonEncodedText.Encode("num_top_feature_importance_values"); + private static readonly System.Text.Json.JsonEncodedText PropPredictionFieldName = System.Text.Json.JsonEncodedText.Encode("prediction_field_name"); + private static readonly System.Text.Json.JsonEncodedText PropRandomizeSeed = System.Text.Json.JsonEncodedText.Encode("randomize_seed"); + private static readonly System.Text.Json.JsonEncodedText PropSoftTreeDepthLimit = System.Text.Json.JsonEncodedText.Encode("soft_tree_depth_limit"); + private static readonly System.Text.Json.JsonEncodedText PropSoftTreeDepthTolerance = System.Text.Json.JsonEncodedText.Encode("soft_tree_depth_tolerance"); + private static readonly System.Text.Json.JsonEncodedText PropTrainingPercent = System.Text.Json.JsonEncodedText.Encode("training_percent"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisRegression Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAlpha = default; + LocalJsonValue propDependentVariable = default; + LocalJsonValue propDownsampleFactor = default; + LocalJsonValue propEarlyStoppingEnabled = default; + LocalJsonValue propEta = default; + LocalJsonValue propEtaGrowthRatePerTree = default; + LocalJsonValue propFeatureBagFraction = default; + LocalJsonValue?> propFeatureProcessors = default; + LocalJsonValue propGamma = default; + LocalJsonValue propLambda = default; + LocalJsonValue propLossFunction = default; + LocalJsonValue propLossFunctionParameter = default; + LocalJsonValue propMaxOptimizationRoundsPerHyperparameter = default; + LocalJsonValue propMaxTrees = default; + LocalJsonValue propNumTopFeatureImportanceValues = default; + LocalJsonValue propPredictionFieldName = default; + LocalJsonValue propRandomizeSeed = default; + LocalJsonValue propSoftTreeDepthLimit = default; + LocalJsonValue propSoftTreeDepthTolerance = default; + LocalJsonValue propTrainingPercent = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAlpha.TryReadProperty(ref reader, options, PropAlpha, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDependentVariable.TryReadProperty(ref reader, options, PropDependentVariable, null)) + { + continue; + } + + if (propDownsampleFactor.TryReadProperty(ref reader, options, PropDownsampleFactor, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEarlyStoppingEnabled.TryReadProperty(ref reader, options, PropEarlyStoppingEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEta.TryReadProperty(ref reader, options, PropEta, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEtaGrowthRatePerTree.TryReadProperty(ref reader, options, PropEtaGrowthRatePerTree, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFeatureBagFraction.TryReadProperty(ref reader, options, PropFeatureBagFraction, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFeatureProcessors.TryReadProperty(ref reader, options, PropFeatureProcessors, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propGamma.TryReadProperty(ref reader, options, PropGamma, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLambda.TryReadProperty(ref reader, options, PropLambda, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLossFunction.TryReadProperty(ref reader, options, PropLossFunction, null)) + { + continue; + } + + if (propLossFunctionParameter.TryReadProperty(ref reader, options, PropLossFunctionParameter, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxOptimizationRoundsPerHyperparameter.TryReadProperty(ref reader, options, PropMaxOptimizationRoundsPerHyperparameter, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxTrees.TryReadProperty(ref reader, options, PropMaxTrees, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o)) || propMaxTrees.TryReadProperty(ref reader, options, PropMaxTrees1, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNumTopFeatureImportanceValues.TryReadProperty(ref reader, options, PropNumTopFeatureImportanceValues, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPredictionFieldName.TryReadProperty(ref reader, options, PropPredictionFieldName, null)) + { + continue; + } + + if (propRandomizeSeed.TryReadProperty(ref reader, options, PropRandomizeSeed, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSoftTreeDepthLimit.TryReadProperty(ref reader, options, PropSoftTreeDepthLimit, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSoftTreeDepthTolerance.TryReadProperty(ref reader, options, PropSoftTreeDepthTolerance, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTrainingPercent.TryReadProperty(ref reader, options, PropTrainingPercent, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisRegression(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Alpha = propAlpha.Value, + DependentVariable = propDependentVariable.Value, + DownsampleFactor = propDownsampleFactor.Value, + EarlyStoppingEnabled = propEarlyStoppingEnabled.Value, + Eta = propEta.Value, + EtaGrowthRatePerTree = propEtaGrowthRatePerTree.Value, + FeatureBagFraction = propFeatureBagFraction.Value, + FeatureProcessors = propFeatureProcessors.Value, + Gamma = propGamma.Value, + Lambda = propLambda.Value, + LossFunction = propLossFunction.Value, + LossFunctionParameter = propLossFunctionParameter.Value, + MaxOptimizationRoundsPerHyperparameter = propMaxOptimizationRoundsPerHyperparameter.Value, + MaxTrees = propMaxTrees.Value, + NumTopFeatureImportanceValues = propNumTopFeatureImportanceValues.Value, + PredictionFieldName = propPredictionFieldName.Value, + RandomizeSeed = propRandomizeSeed.Value, + SoftTreeDepthLimit = propSoftTreeDepthLimit.Value, + SoftTreeDepthTolerance = propSoftTreeDepthTolerance.Value, + TrainingPercent = propTrainingPercent.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisRegression value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAlpha, value.Alpha, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDependentVariable, value.DependentVariable, null, null); + writer.WriteProperty(options, PropDownsampleFactor, value.DownsampleFactor, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEarlyStoppingEnabled, value.EarlyStoppingEnabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEta, value.Eta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEtaGrowthRatePerTree, value.EtaGrowthRatePerTree, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFeatureBagFraction, value.FeatureBagFraction, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFeatureProcessors, value.FeatureProcessors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropGamma, value.Gamma, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLambda, value.Lambda, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLossFunction, value.LossFunction, null, null); + writer.WriteProperty(options, PropLossFunctionParameter, value.LossFunctionParameter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxOptimizationRoundsPerHyperparameter, value.MaxOptimizationRoundsPerHyperparameter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxTrees, value.MaxTrees, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNumTopFeatureImportanceValues, value.NumTopFeatureImportanceValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPredictionFieldName, value.PredictionFieldName, null, null); + writer.WriteProperty(options, PropRandomizeSeed, value.RandomizeSeed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSoftTreeDepthLimit, value.SoftTreeDepthLimit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSoftTreeDepthTolerance, value.SoftTreeDepthTolerance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTrainingPercent, value.TrainingPercent, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisRegression.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisRegression.g.cs index 64030936e1f..88603eedc53 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisRegression.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalysisRegression.g.cs @@ -23,218 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeAnalysisRegressionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAlpha = System.Text.Json.JsonEncodedText.Encode("alpha"); - private static readonly System.Text.Json.JsonEncodedText PropDependentVariable = System.Text.Json.JsonEncodedText.Encode("dependent_variable"); - private static readonly System.Text.Json.JsonEncodedText PropDownsampleFactor = System.Text.Json.JsonEncodedText.Encode("downsample_factor"); - private static readonly System.Text.Json.JsonEncodedText PropEarlyStoppingEnabled = System.Text.Json.JsonEncodedText.Encode("early_stopping_enabled"); - private static readonly System.Text.Json.JsonEncodedText PropEta = System.Text.Json.JsonEncodedText.Encode("eta"); - private static readonly System.Text.Json.JsonEncodedText PropEtaGrowthRatePerTree = System.Text.Json.JsonEncodedText.Encode("eta_growth_rate_per_tree"); - private static readonly System.Text.Json.JsonEncodedText PropFeatureBagFraction = System.Text.Json.JsonEncodedText.Encode("feature_bag_fraction"); - private static readonly System.Text.Json.JsonEncodedText PropFeatureProcessors = System.Text.Json.JsonEncodedText.Encode("feature_processors"); - private static readonly System.Text.Json.JsonEncodedText PropGamma = System.Text.Json.JsonEncodedText.Encode("gamma"); - private static readonly System.Text.Json.JsonEncodedText PropLambda = System.Text.Json.JsonEncodedText.Encode("lambda"); - private static readonly System.Text.Json.JsonEncodedText PropLossFunction = System.Text.Json.JsonEncodedText.Encode("loss_function"); - private static readonly System.Text.Json.JsonEncodedText PropLossFunctionParameter = System.Text.Json.JsonEncodedText.Encode("loss_function_parameter"); - private static readonly System.Text.Json.JsonEncodedText PropMaxOptimizationRoundsPerHyperparameter = System.Text.Json.JsonEncodedText.Encode("max_optimization_rounds_per_hyperparameter"); - private static readonly System.Text.Json.JsonEncodedText PropMaxTrees = System.Text.Json.JsonEncodedText.Encode("max_trees"); - private static readonly System.Text.Json.JsonEncodedText PropMaxTrees1 = System.Text.Json.JsonEncodedText.Encode("maximum_number_trees"); - private static readonly System.Text.Json.JsonEncodedText PropNumTopFeatureImportanceValues = System.Text.Json.JsonEncodedText.Encode("num_top_feature_importance_values"); - private static readonly System.Text.Json.JsonEncodedText PropPredictionFieldName = System.Text.Json.JsonEncodedText.Encode("prediction_field_name"); - private static readonly System.Text.Json.JsonEncodedText PropRandomizeSeed = System.Text.Json.JsonEncodedText.Encode("randomize_seed"); - private static readonly System.Text.Json.JsonEncodedText PropSoftTreeDepthLimit = System.Text.Json.JsonEncodedText.Encode("soft_tree_depth_limit"); - private static readonly System.Text.Json.JsonEncodedText PropSoftTreeDepthTolerance = System.Text.Json.JsonEncodedText.Encode("soft_tree_depth_tolerance"); - private static readonly System.Text.Json.JsonEncodedText PropTrainingPercent = System.Text.Json.JsonEncodedText.Encode("training_percent"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisRegression Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAlpha = default; - LocalJsonValue propDependentVariable = default; - LocalJsonValue propDownsampleFactor = default; - LocalJsonValue propEarlyStoppingEnabled = default; - LocalJsonValue propEta = default; - LocalJsonValue propEtaGrowthRatePerTree = default; - LocalJsonValue propFeatureBagFraction = default; - LocalJsonValue?> propFeatureProcessors = default; - LocalJsonValue propGamma = default; - LocalJsonValue propLambda = default; - LocalJsonValue propLossFunction = default; - LocalJsonValue propLossFunctionParameter = default; - LocalJsonValue propMaxOptimizationRoundsPerHyperparameter = default; - LocalJsonValue propMaxTrees = default; - LocalJsonValue propNumTopFeatureImportanceValues = default; - LocalJsonValue propPredictionFieldName = default; - LocalJsonValue propRandomizeSeed = default; - LocalJsonValue propSoftTreeDepthLimit = default; - LocalJsonValue propSoftTreeDepthTolerance = default; - LocalJsonValue propTrainingPercent = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAlpha.TryReadProperty(ref reader, options, PropAlpha, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDependentVariable.TryReadProperty(ref reader, options, PropDependentVariable, null)) - { - continue; - } - - if (propDownsampleFactor.TryReadProperty(ref reader, options, PropDownsampleFactor, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEarlyStoppingEnabled.TryReadProperty(ref reader, options, PropEarlyStoppingEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEta.TryReadProperty(ref reader, options, PropEta, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEtaGrowthRatePerTree.TryReadProperty(ref reader, options, PropEtaGrowthRatePerTree, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFeatureBagFraction.TryReadProperty(ref reader, options, PropFeatureBagFraction, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFeatureProcessors.TryReadProperty(ref reader, options, PropFeatureProcessors, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propGamma.TryReadProperty(ref reader, options, PropGamma, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLambda.TryReadProperty(ref reader, options, PropLambda, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLossFunction.TryReadProperty(ref reader, options, PropLossFunction, null)) - { - continue; - } - - if (propLossFunctionParameter.TryReadProperty(ref reader, options, PropLossFunctionParameter, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxOptimizationRoundsPerHyperparameter.TryReadProperty(ref reader, options, PropMaxOptimizationRoundsPerHyperparameter, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxTrees.TryReadProperty(ref reader, options, PropMaxTrees, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o)) || propMaxTrees.TryReadProperty(ref reader, options, PropMaxTrees1, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNumTopFeatureImportanceValues.TryReadProperty(ref reader, options, PropNumTopFeatureImportanceValues, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPredictionFieldName.TryReadProperty(ref reader, options, PropPredictionFieldName, null)) - { - continue; - } - - if (propRandomizeSeed.TryReadProperty(ref reader, options, PropRandomizeSeed, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSoftTreeDepthLimit.TryReadProperty(ref reader, options, PropSoftTreeDepthLimit, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSoftTreeDepthTolerance.TryReadProperty(ref reader, options, PropSoftTreeDepthTolerance, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTrainingPercent.TryReadProperty(ref reader, options, PropTrainingPercent, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisRegression(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Alpha = propAlpha.Value, - DependentVariable = propDependentVariable.Value, - DownsampleFactor = propDownsampleFactor.Value, - EarlyStoppingEnabled = propEarlyStoppingEnabled.Value, - Eta = propEta.Value, - EtaGrowthRatePerTree = propEtaGrowthRatePerTree.Value, - FeatureBagFraction = propFeatureBagFraction.Value, - FeatureProcessors = propFeatureProcessors.Value, - Gamma = propGamma.Value, - Lambda = propLambda.Value, - LossFunction = propLossFunction.Value, - LossFunctionParameter = propLossFunctionParameter.Value, - MaxOptimizationRoundsPerHyperparameter = propMaxOptimizationRoundsPerHyperparameter.Value, - MaxTrees = propMaxTrees.Value, - NumTopFeatureImportanceValues = propNumTopFeatureImportanceValues.Value, - PredictionFieldName = propPredictionFieldName.Value, - RandomizeSeed = propRandomizeSeed.Value, - SoftTreeDepthLimit = propSoftTreeDepthLimit.Value, - SoftTreeDepthTolerance = propSoftTreeDepthTolerance.Value, - TrainingPercent = propTrainingPercent.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisRegression value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAlpha, value.Alpha, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDependentVariable, value.DependentVariable, null, null); - writer.WriteProperty(options, PropDownsampleFactor, value.DownsampleFactor, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEarlyStoppingEnabled, value.EarlyStoppingEnabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEta, value.Eta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEtaGrowthRatePerTree, value.EtaGrowthRatePerTree, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFeatureBagFraction, value.FeatureBagFraction, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFeatureProcessors, value.FeatureProcessors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropGamma, value.Gamma, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLambda, value.Lambda, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLossFunction, value.LossFunction, null, null); - writer.WriteProperty(options, PropLossFunctionParameter, value.LossFunctionParameter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxOptimizationRoundsPerHyperparameter, value.MaxOptimizationRoundsPerHyperparameter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxTrees, value.MaxTrees, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNumTopFeatureImportanceValues, value.NumTopFeatureImportanceValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPredictionFieldName, value.PredictionFieldName, null, null); - writer.WriteProperty(options, PropRandomizeSeed, value.RandomizeSeed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSoftTreeDepthLimit, value.SoftTreeDepthLimit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSoftTreeDepthTolerance, value.SoftTreeDepthTolerance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTrainingPercent, value.TrainingPercent, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalysisRegressionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeAnalysisRegressionConverter))] public sealed partial class DataframeAnalysisRegression { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalytics.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalytics.Converters.g.cs new file mode 100644 index 00000000000..79d535c3b18 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalytics.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeAnalyticsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAssignmentExplanation = System.Text.Json.JsonEncodedText.Encode("assignment_explanation"); + private static readonly System.Text.Json.JsonEncodedText PropDataCounts = System.Text.Json.JsonEncodedText.Encode("data_counts"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropMemoryUsage = System.Text.Json.JsonEncodedText.Encode("memory_usage"); + private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); + private static readonly System.Text.Json.JsonEncodedText PropProgress = System.Text.Json.JsonEncodedText.Encode("progress"); + private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalytics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAssignmentExplanation = default; + LocalJsonValue propDataCounts = default; + LocalJsonValue propId = default; + LocalJsonValue propMemoryUsage = default; + LocalJsonValue propNode = default; + LocalJsonValue> propProgress = default; + LocalJsonValue propState = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAssignmentExplanation.TryReadProperty(ref reader, options, PropAssignmentExplanation, null)) + { + continue; + } + + if (propDataCounts.TryReadProperty(ref reader, options, PropDataCounts, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propMemoryUsage.TryReadProperty(ref reader, options, PropMemoryUsage, null)) + { + continue; + } + + if (propNode.TryReadProperty(ref reader, options, PropNode, null)) + { + continue; + } + + if (propProgress.TryReadProperty(ref reader, options, PropProgress, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propState.TryReadProperty(ref reader, options, PropState, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalytics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AssignmentExplanation = propAssignmentExplanation.Value, + DataCounts = propDataCounts.Value, + Id = propId.Value, + MemoryUsage = propMemoryUsage.Value, + Node = propNode.Value, + Progress = propProgress.Value, + State = propState.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalytics value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAssignmentExplanation, value.AssignmentExplanation, null, null); + writer.WriteProperty(options, PropDataCounts, value.DataCounts, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropMemoryUsage, value.MemoryUsage, null, null); + writer.WriteProperty(options, PropNode, value.Node, null, null); + writer.WriteProperty(options, PropProgress, value.Progress, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropState, value.State, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalytics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalytics.g.cs index d80c45ac957..17128e9e0e4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalytics.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalytics.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeAnalyticsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAssignmentExplanation = System.Text.Json.JsonEncodedText.Encode("assignment_explanation"); - private static readonly System.Text.Json.JsonEncodedText PropDataCounts = System.Text.Json.JsonEncodedText.Encode("data_counts"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropMemoryUsage = System.Text.Json.JsonEncodedText.Encode("memory_usage"); - private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); - private static readonly System.Text.Json.JsonEncodedText PropProgress = System.Text.Json.JsonEncodedText.Encode("progress"); - private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalytics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAssignmentExplanation = default; - LocalJsonValue propDataCounts = default; - LocalJsonValue propId = default; - LocalJsonValue propMemoryUsage = default; - LocalJsonValue propNode = default; - LocalJsonValue> propProgress = default; - LocalJsonValue propState = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAssignmentExplanation.TryReadProperty(ref reader, options, PropAssignmentExplanation, null)) - { - continue; - } - - if (propDataCounts.TryReadProperty(ref reader, options, PropDataCounts, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propMemoryUsage.TryReadProperty(ref reader, options, PropMemoryUsage, null)) - { - continue; - } - - if (propNode.TryReadProperty(ref reader, options, PropNode, null)) - { - continue; - } - - if (propProgress.TryReadProperty(ref reader, options, PropProgress, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propState.TryReadProperty(ref reader, options, PropState, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalytics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AssignmentExplanation = propAssignmentExplanation.Value, - DataCounts = propDataCounts.Value, - Id = propId.Value, - MemoryUsage = propMemoryUsage.Value, - Node = propNode.Value, - Progress = propProgress.Value, - State = propState.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalytics value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAssignmentExplanation, value.AssignmentExplanation, null, null); - writer.WriteProperty(options, PropDataCounts, value.DataCounts, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropMemoryUsage, value.MemoryUsage, null, null); - writer.WriteProperty(options, PropNode, value.Node, null, null); - writer.WriteProperty(options, PropProgress, value.Progress, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropState, value.State, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeAnalyticsConverter))] public sealed partial class DataframeAnalytics { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsAuthorization.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsAuthorization.Converters.g.cs new file mode 100644 index 00000000000..4931e5f456a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsAuthorization.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeAnalyticsAuthorizationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + private static readonly System.Text.Json.JsonEncodedText PropServiceAccount = System.Text.Json.JsonEncodedText.Encode("service_account"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsAuthorization Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApiKey = default; + LocalJsonValue?> propRoles = default; + LocalJsonValue propServiceAccount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) + { + continue; + } + + if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propServiceAccount.TryReadProperty(ref reader, options, PropServiceAccount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsAuthorization(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ApiKey = propApiKey.Value, + Roles = propRoles.Value, + ServiceAccount = propServiceAccount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsAuthorization value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); + writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropServiceAccount, value.ServiceAccount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsAuthorization.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsAuthorization.g.cs index 10fb142ea61..5520053564c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsAuthorization.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsAuthorization.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeAnalyticsAuthorizationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); - private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); - private static readonly System.Text.Json.JsonEncodedText PropServiceAccount = System.Text.Json.JsonEncodedText.Encode("service_account"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsAuthorization Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propApiKey = default; - LocalJsonValue?> propRoles = default; - LocalJsonValue propServiceAccount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) - { - continue; - } - - if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propServiceAccount.TryReadProperty(ref reader, options, PropServiceAccount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsAuthorization(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ApiKey = propApiKey.Value, - Roles = propRoles.Value, - ServiceAccount = propServiceAccount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsAuthorization value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); - writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropServiceAccount, value.ServiceAccount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsAuthorizationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeAnalyticsAuthorizationConverter))] public sealed partial class DataframeAnalyticsAuthorization { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsDestination.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsDestination.Converters.g.cs new file mode 100644 index 00000000000..b08b341b062 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsDestination.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeAnalyticsDestinationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestination Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndex = default; + LocalJsonValue propResultsField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestination(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Index = propIndex.Value, + ResultsField = propResultsField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestination value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsDestination.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsDestination.g.cs index ca5accd66ce..9c610ee8f6a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsDestination.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsDestination.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeAnalyticsDestinationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestination Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndex = default; - LocalJsonValue propResultsField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestination(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Index = propIndex.Value, - ResultsField = propResultsField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestination value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsDestinationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeAnalyticsDestinationConverter))] public sealed partial class DataframeAnalyticsDestination { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsFieldSelection.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsFieldSelection.Converters.g.cs new file mode 100644 index 00000000000..e1e5c3c18a0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsFieldSelection.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeAnalyticsFieldSelectionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFeatureType = System.Text.Json.JsonEncodedText.Encode("feature_type"); + private static readonly System.Text.Json.JsonEncodedText PropIsIncluded = System.Text.Json.JsonEncodedText.Encode("is_included"); + private static readonly System.Text.Json.JsonEncodedText PropIsRequired = System.Text.Json.JsonEncodedText.Encode("is_required"); + private static readonly System.Text.Json.JsonEncodedText PropMappingTypes = System.Text.Json.JsonEncodedText.Encode("mapping_types"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsFieldSelection Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFeatureType = default; + LocalJsonValue propIsIncluded = default; + LocalJsonValue propIsRequired = default; + LocalJsonValue> propMappingTypes = default; + LocalJsonValue propName = default; + LocalJsonValue propReason = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFeatureType.TryReadProperty(ref reader, options, PropFeatureType, null)) + { + continue; + } + + if (propIsIncluded.TryReadProperty(ref reader, options, PropIsIncluded, null)) + { + continue; + } + + if (propIsRequired.TryReadProperty(ref reader, options, PropIsRequired, null)) + { + continue; + } + + if (propMappingTypes.TryReadProperty(ref reader, options, PropMappingTypes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propReason.TryReadProperty(ref reader, options, PropReason, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsFieldSelection(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FeatureType = propFeatureType.Value, + IsIncluded = propIsIncluded.Value, + IsRequired = propIsRequired.Value, + MappingTypes = propMappingTypes.Value, + Name = propName.Value, + Reason = propReason.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsFieldSelection value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFeatureType, value.FeatureType, null, null); + writer.WriteProperty(options, PropIsIncluded, value.IsIncluded, null, null); + writer.WriteProperty(options, PropIsRequired, value.IsRequired, null, null); + writer.WriteProperty(options, PropMappingTypes, value.MappingTypes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropReason, value.Reason, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsFieldSelection.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsFieldSelection.g.cs index ce8f4e583c2..c2101403fdb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsFieldSelection.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsFieldSelection.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeAnalyticsFieldSelectionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFeatureType = System.Text.Json.JsonEncodedText.Encode("feature_type"); - private static readonly System.Text.Json.JsonEncodedText PropIsIncluded = System.Text.Json.JsonEncodedText.Encode("is_included"); - private static readonly System.Text.Json.JsonEncodedText PropIsRequired = System.Text.Json.JsonEncodedText.Encode("is_required"); - private static readonly System.Text.Json.JsonEncodedText PropMappingTypes = System.Text.Json.JsonEncodedText.Encode("mapping_types"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsFieldSelection Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFeatureType = default; - LocalJsonValue propIsIncluded = default; - LocalJsonValue propIsRequired = default; - LocalJsonValue> propMappingTypes = default; - LocalJsonValue propName = default; - LocalJsonValue propReason = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFeatureType.TryReadProperty(ref reader, options, PropFeatureType, null)) - { - continue; - } - - if (propIsIncluded.TryReadProperty(ref reader, options, PropIsIncluded, null)) - { - continue; - } - - if (propIsRequired.TryReadProperty(ref reader, options, PropIsRequired, null)) - { - continue; - } - - if (propMappingTypes.TryReadProperty(ref reader, options, PropMappingTypes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propReason.TryReadProperty(ref reader, options, PropReason, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsFieldSelection(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FeatureType = propFeatureType.Value, - IsIncluded = propIsIncluded.Value, - IsRequired = propIsRequired.Value, - MappingTypes = propMappingTypes.Value, - Name = propName.Value, - Reason = propReason.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsFieldSelection value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFeatureType, value.FeatureType, null, null); - writer.WriteProperty(options, PropIsIncluded, value.IsIncluded, null, null); - writer.WriteProperty(options, PropIsRequired, value.IsRequired, null, null); - writer.WriteProperty(options, PropMappingTypes, value.MappingTypes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropReason, value.Reason, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsFieldSelectionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeAnalyticsFieldSelectionConverter))] public sealed partial class DataframeAnalyticsFieldSelection { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsMemoryEstimation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsMemoryEstimation.Converters.g.cs new file mode 100644 index 00000000000..32fb26b9733 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsMemoryEstimation.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeAnalyticsMemoryEstimationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExpectedMemoryWithDisk = System.Text.Json.JsonEncodedText.Encode("expected_memory_with_disk"); + private static readonly System.Text.Json.JsonEncodedText PropExpectedMemoryWithoutDisk = System.Text.Json.JsonEncodedText.Encode("expected_memory_without_disk"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsMemoryEstimation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExpectedMemoryWithDisk = default; + LocalJsonValue propExpectedMemoryWithoutDisk = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExpectedMemoryWithDisk.TryReadProperty(ref reader, options, PropExpectedMemoryWithDisk, null)) + { + continue; + } + + if (propExpectedMemoryWithoutDisk.TryReadProperty(ref reader, options, PropExpectedMemoryWithoutDisk, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsMemoryEstimation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ExpectedMemoryWithDisk = propExpectedMemoryWithDisk.Value, + ExpectedMemoryWithoutDisk = propExpectedMemoryWithoutDisk.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsMemoryEstimation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExpectedMemoryWithDisk, value.ExpectedMemoryWithDisk, null, null); + writer.WriteProperty(options, PropExpectedMemoryWithoutDisk, value.ExpectedMemoryWithoutDisk, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsMemoryEstimation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsMemoryEstimation.g.cs index d1e395b5c49..9ff8787cf84 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsMemoryEstimation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsMemoryEstimation.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeAnalyticsMemoryEstimationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExpectedMemoryWithDisk = System.Text.Json.JsonEncodedText.Encode("expected_memory_with_disk"); - private static readonly System.Text.Json.JsonEncodedText PropExpectedMemoryWithoutDisk = System.Text.Json.JsonEncodedText.Encode("expected_memory_without_disk"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsMemoryEstimation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propExpectedMemoryWithDisk = default; - LocalJsonValue propExpectedMemoryWithoutDisk = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExpectedMemoryWithDisk.TryReadProperty(ref reader, options, PropExpectedMemoryWithDisk, null)) - { - continue; - } - - if (propExpectedMemoryWithoutDisk.TryReadProperty(ref reader, options, PropExpectedMemoryWithoutDisk, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsMemoryEstimation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ExpectedMemoryWithDisk = propExpectedMemoryWithDisk.Value, - ExpectedMemoryWithoutDisk = propExpectedMemoryWithoutDisk.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsMemoryEstimation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExpectedMemoryWithDisk, value.ExpectedMemoryWithDisk, null, null); - writer.WriteProperty(options, PropExpectedMemoryWithoutDisk, value.ExpectedMemoryWithoutDisk, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsMemoryEstimationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeAnalyticsMemoryEstimationConverter))] public sealed partial class DataframeAnalyticsMemoryEstimation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsSource.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsSource.Converters.g.cs new file mode 100644 index 00000000000..583f7302b38 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsSource.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeAnalyticsSourceConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropRuntimeMappings = System.Text.Json.JsonEncodedText.Encode("runtime_mappings"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndices = default; + LocalJsonValue propQuery = default; + LocalJsonValue?> propRuntimeMappings = default; + LocalJsonValue propSource = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Indices = propIndices.Value, + Query = propQuery.Value, + RuntimeMappings = propRuntimeMappings.Value, + Source = propSource.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndices, value.Indices, null, null); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsSource.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsSource.g.cs index 8406c123a9a..1b154a482fa 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsSource.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsSource.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeAnalyticsSourceConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropRuntimeMappings = System.Text.Json.JsonEncodedText.Encode("runtime_mappings"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndices = default; - LocalJsonValue propQuery = default; - LocalJsonValue?> propRuntimeMappings = default; - LocalJsonValue propSource = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Indices = propIndices.Value, - Query = propQuery.Value, - RuntimeMappings = propRuntimeMappings.Value, - Source = propSource.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSource value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndices, value.Indices, null, null); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSourceConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeAnalyticsSourceConverter))] public sealed partial class DataframeAnalyticsSource { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsDataCounts.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsDataCounts.Converters.g.cs new file mode 100644 index 00000000000..13eda24863c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsDataCounts.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeAnalyticsStatsDataCountsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSkippedDocsCount = System.Text.Json.JsonEncodedText.Encode("skipped_docs_count"); + private static readonly System.Text.Json.JsonEncodedText PropTestDocsCount = System.Text.Json.JsonEncodedText.Encode("test_docs_count"); + private static readonly System.Text.Json.JsonEncodedText PropTrainingDocsCount = System.Text.Json.JsonEncodedText.Encode("training_docs_count"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsStatsDataCounts Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propSkippedDocsCount = default; + LocalJsonValue propTestDocsCount = default; + LocalJsonValue propTrainingDocsCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSkippedDocsCount.TryReadProperty(ref reader, options, PropSkippedDocsCount, null)) + { + continue; + } + + if (propTestDocsCount.TryReadProperty(ref reader, options, PropTestDocsCount, null)) + { + continue; + } + + if (propTrainingDocsCount.TryReadProperty(ref reader, options, PropTrainingDocsCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsStatsDataCounts(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + SkippedDocsCount = propSkippedDocsCount.Value, + TestDocsCount = propTestDocsCount.Value, + TrainingDocsCount = propTrainingDocsCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsStatsDataCounts value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSkippedDocsCount, value.SkippedDocsCount, null, null); + writer.WriteProperty(options, PropTestDocsCount, value.TestDocsCount, null, null); + writer.WriteProperty(options, PropTrainingDocsCount, value.TrainingDocsCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsDataCounts.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsDataCounts.g.cs index 93fd1c7c655..2cf2de85c0a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsDataCounts.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsDataCounts.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeAnalyticsStatsDataCountsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSkippedDocsCount = System.Text.Json.JsonEncodedText.Encode("skipped_docs_count"); - private static readonly System.Text.Json.JsonEncodedText PropTestDocsCount = System.Text.Json.JsonEncodedText.Encode("test_docs_count"); - private static readonly System.Text.Json.JsonEncodedText PropTrainingDocsCount = System.Text.Json.JsonEncodedText.Encode("training_docs_count"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsStatsDataCounts Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propSkippedDocsCount = default; - LocalJsonValue propTestDocsCount = default; - LocalJsonValue propTrainingDocsCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSkippedDocsCount.TryReadProperty(ref reader, options, PropSkippedDocsCount, null)) - { - continue; - } - - if (propTestDocsCount.TryReadProperty(ref reader, options, PropTestDocsCount, null)) - { - continue; - } - - if (propTrainingDocsCount.TryReadProperty(ref reader, options, PropTrainingDocsCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsStatsDataCounts(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - SkippedDocsCount = propSkippedDocsCount.Value, - TestDocsCount = propTestDocsCount.Value, - TrainingDocsCount = propTrainingDocsCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsStatsDataCounts value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSkippedDocsCount, value.SkippedDocsCount, null, null); - writer.WriteProperty(options, PropTestDocsCount, value.TestDocsCount, null, null); - writer.WriteProperty(options, PropTrainingDocsCount, value.TrainingDocsCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsStatsDataCountsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeAnalyticsStatsDataCountsConverter))] public sealed partial class DataframeAnalyticsStatsDataCounts { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsMemoryUsage.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsMemoryUsage.Converters.g.cs new file mode 100644 index 00000000000..46552241d59 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsMemoryUsage.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeAnalyticsStatsMemoryUsageConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMemoryReestimateBytes = System.Text.Json.JsonEncodedText.Encode("memory_reestimate_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropPeakUsageBytes = System.Text.Json.JsonEncodedText.Encode("peak_usage_bytes"); + 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 Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsStatsMemoryUsage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMemoryReestimateBytes = default; + LocalJsonValue propPeakUsageBytes = default; + LocalJsonValue propStatus = default; + LocalJsonValue propTimestamp = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMemoryReestimateBytes.TryReadProperty(ref reader, options, PropMemoryReestimateBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPeakUsageBytes.TryReadProperty(ref reader, options, PropPeakUsageBytes, null)) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsStatsMemoryUsage(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MemoryReestimateBytes = propMemoryReestimateBytes.Value, + PeakUsageBytes = propPeakUsageBytes.Value, + Status = propStatus.Value, + Timestamp = propTimestamp.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsStatsMemoryUsage value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMemoryReestimateBytes, value.MemoryReestimateBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPeakUsageBytes, value.PeakUsageBytes, null, null); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsMemoryUsage.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsMemoryUsage.g.cs index 6b75e16a831..9104c717c07 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsMemoryUsage.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsMemoryUsage.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeAnalyticsStatsMemoryUsageConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMemoryReestimateBytes = System.Text.Json.JsonEncodedText.Encode("memory_reestimate_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropPeakUsageBytes = System.Text.Json.JsonEncodedText.Encode("peak_usage_bytes"); - 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 Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsStatsMemoryUsage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMemoryReestimateBytes = default; - LocalJsonValue propPeakUsageBytes = default; - LocalJsonValue propStatus = default; - LocalJsonValue propTimestamp = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMemoryReestimateBytes.TryReadProperty(ref reader, options, PropMemoryReestimateBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPeakUsageBytes.TryReadProperty(ref reader, options, PropPeakUsageBytes, null)) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsStatsMemoryUsage(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MemoryReestimateBytes = propMemoryReestimateBytes.Value, - PeakUsageBytes = propPeakUsageBytes.Value, - Status = propStatus.Value, - Timestamp = propTimestamp.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsStatsMemoryUsage value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMemoryReestimateBytes, value.MemoryReestimateBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPeakUsageBytes, value.PeakUsageBytes, null, null); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsStatsMemoryUsageConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeAnalyticsStatsMemoryUsageConverter))] public sealed partial class DataframeAnalyticsStatsMemoryUsage { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsProgress.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsProgress.Converters.g.cs new file mode 100644 index 00000000000..a5995a922b5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsProgress.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeAnalyticsStatsProgressConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPhase = System.Text.Json.JsonEncodedText.Encode("phase"); + private static readonly System.Text.Json.JsonEncodedText PropProgressPercent = System.Text.Json.JsonEncodedText.Encode("progress_percent"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsStatsProgress Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPhase = default; + LocalJsonValue propProgressPercent = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPhase.TryReadProperty(ref reader, options, PropPhase, null)) + { + continue; + } + + if (propProgressPercent.TryReadProperty(ref reader, options, PropProgressPercent, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsStatsProgress(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Phase = propPhase.Value, + ProgressPercent = propProgressPercent.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsStatsProgress value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPhase, value.Phase, null, null); + writer.WriteProperty(options, PropProgressPercent, value.ProgressPercent, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsProgress.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsProgress.g.cs index bf56705484a..98b8e74743c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsProgress.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsStatsProgress.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeAnalyticsStatsProgressConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPhase = System.Text.Json.JsonEncodedText.Encode("phase"); - private static readonly System.Text.Json.JsonEncodedText PropProgressPercent = System.Text.Json.JsonEncodedText.Encode("progress_percent"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsStatsProgress Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPhase = default; - LocalJsonValue propProgressPercent = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPhase.TryReadProperty(ref reader, options, PropPhase, null)) - { - continue; - } - - if (propProgressPercent.TryReadProperty(ref reader, options, PropProgressPercent, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsStatsProgress(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Phase = propPhase.Value, - ProgressPercent = propProgressPercent.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsStatsProgress value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPhase, value.Phase, null, null); - writer.WriteProperty(options, PropProgressPercent, value.ProgressPercent, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsStatsProgressConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeAnalyticsStatsProgressConverter))] public sealed partial class DataframeAnalyticsStatsProgress { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsSummary.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsSummary.Converters.g.cs new file mode 100644 index 00000000000..50bf3197716 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsSummary.Converters.g.cs @@ -0,0 +1,171 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeAnalyticsSummaryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowLazyStart = System.Text.Json.JsonEncodedText.Encode("allow_lazy_start"); + private static readonly System.Text.Json.JsonEncodedText PropAnalysis = System.Text.Json.JsonEncodedText.Encode("analysis"); + private static readonly System.Text.Json.JsonEncodedText PropAnalyzedFields = System.Text.Json.JsonEncodedText.Encode("analyzed_fields"); + private static readonly System.Text.Json.JsonEncodedText PropAuthorization = System.Text.Json.JsonEncodedText.Encode("authorization"); + private static readonly System.Text.Json.JsonEncodedText PropCreateTime = System.Text.Json.JsonEncodedText.Encode("create_time"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropDest = System.Text.Json.JsonEncodedText.Encode("dest"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropMaxNumThreads = System.Text.Json.JsonEncodedText.Encode("max_num_threads"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); + private static readonly System.Text.Json.JsonEncodedText PropModelMemoryLimit = System.Text.Json.JsonEncodedText.Encode("model_memory_limit"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowLazyStart = default; + LocalJsonValue propAnalysis = default; + LocalJsonValue propAnalyzedFields = default; + LocalJsonValue propAuthorization = default; + LocalJsonValue propCreateTime = default; + LocalJsonValue propDescription = default; + LocalJsonValue propDest = default; + LocalJsonValue propId = default; + LocalJsonValue propMaxNumThreads = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propModelMemoryLimit = default; + LocalJsonValue propSource = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowLazyStart.TryReadProperty(ref reader, options, PropAllowLazyStart, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propAnalysis.TryReadProperty(ref reader, options, PropAnalysis, null)) + { + continue; + } + + if (propAnalyzedFields.TryReadProperty(ref reader, options, PropAnalyzedFields, null)) + { + continue; + } + + if (propAuthorization.TryReadProperty(ref reader, options, PropAuthorization, null)) + { + continue; + } + + if (propCreateTime.TryReadProperty(ref reader, options, PropCreateTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propDest.TryReadProperty(ref reader, options, PropDest, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propMaxNumThreads.TryReadProperty(ref reader, options, PropMaxNumThreads, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propModelMemoryLimit.TryReadProperty(ref reader, options, PropModelMemoryLimit, null)) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowLazyStart = propAllowLazyStart.Value, + Analysis = propAnalysis.Value, + AnalyzedFields = propAnalyzedFields.Value, + Authorization = propAuthorization.Value, + CreateTime = propCreateTime.Value, + Description = propDescription.Value, + Dest = propDest.Value, + Id = propId.Value, + MaxNumThreads = propMaxNumThreads.Value, + Meta = propMeta.Value, + ModelMemoryLimit = propModelMemoryLimit.Value, + Source = propSource.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSummary value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowLazyStart, value.AllowLazyStart, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropAnalysis, value.Analysis, null, null); + writer.WriteProperty(options, PropAnalyzedFields, value.AnalyzedFields, null, null); + writer.WriteProperty(options, PropAuthorization, value.Authorization, null, null); + writer.WriteProperty(options, PropCreateTime, value.CreateTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropDest, value.Dest, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropMaxNumThreads, value.MaxNumThreads, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropModelMemoryLimit, value.ModelMemoryLimit, null, null); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsSummary.g.cs index d43b98f3c89..a84ac98ae2d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsSummary.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeAnalyticsSummary.g.cs @@ -23,154 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeAnalyticsSummaryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowLazyStart = System.Text.Json.JsonEncodedText.Encode("allow_lazy_start"); - private static readonly System.Text.Json.JsonEncodedText PropAnalysis = System.Text.Json.JsonEncodedText.Encode("analysis"); - private static readonly System.Text.Json.JsonEncodedText PropAnalyzedFields = System.Text.Json.JsonEncodedText.Encode("analyzed_fields"); - private static readonly System.Text.Json.JsonEncodedText PropAuthorization = System.Text.Json.JsonEncodedText.Encode("authorization"); - private static readonly System.Text.Json.JsonEncodedText PropCreateTime = System.Text.Json.JsonEncodedText.Encode("create_time"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropDest = System.Text.Json.JsonEncodedText.Encode("dest"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropMaxNumThreads = System.Text.Json.JsonEncodedText.Encode("max_num_threads"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); - private static readonly System.Text.Json.JsonEncodedText PropModelMemoryLimit = System.Text.Json.JsonEncodedText.Encode("model_memory_limit"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowLazyStart = default; - LocalJsonValue propAnalysis = default; - LocalJsonValue propAnalyzedFields = default; - LocalJsonValue propAuthorization = default; - LocalJsonValue propCreateTime = default; - LocalJsonValue propDescription = default; - LocalJsonValue propDest = default; - LocalJsonValue propId = default; - LocalJsonValue propMaxNumThreads = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propModelMemoryLimit = default; - LocalJsonValue propSource = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowLazyStart.TryReadProperty(ref reader, options, PropAllowLazyStart, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propAnalysis.TryReadProperty(ref reader, options, PropAnalysis, null)) - { - continue; - } - - if (propAnalyzedFields.TryReadProperty(ref reader, options, PropAnalyzedFields, null)) - { - continue; - } - - if (propAuthorization.TryReadProperty(ref reader, options, PropAuthorization, null)) - { - continue; - } - - if (propCreateTime.TryReadProperty(ref reader, options, PropCreateTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propDest.TryReadProperty(ref reader, options, PropDest, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propMaxNumThreads.TryReadProperty(ref reader, options, PropMaxNumThreads, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propModelMemoryLimit.TryReadProperty(ref reader, options, PropModelMemoryLimit, null)) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowLazyStart = propAllowLazyStart.Value, - Analysis = propAnalysis.Value, - AnalyzedFields = propAnalyzedFields.Value, - Authorization = propAuthorization.Value, - CreateTime = propCreateTime.Value, - Description = propDescription.Value, - Dest = propDest.Value, - Id = propId.Value, - MaxNumThreads = propMaxNumThreads.Value, - Meta = propMeta.Value, - ModelMemoryLimit = propModelMemoryLimit.Value, - Source = propSource.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSummary value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowLazyStart, value.AllowLazyStart, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropAnalysis, value.Analysis, null, null); - writer.WriteProperty(options, PropAnalyzedFields, value.AnalyzedFields, null, null); - writer.WriteProperty(options, PropAuthorization, value.Authorization, null, null); - writer.WriteProperty(options, PropCreateTime, value.CreateTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropDest, value.Dest, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropMaxNumThreads, value.MaxNumThreads, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropModelMemoryLimit, value.ModelMemoryLimit, null, null); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeAnalyticsSummaryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeAnalyticsSummaryConverter))] public sealed partial class DataframeAnalyticsSummary { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummary.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummary.Converters.g.cs new file mode 100644 index 00000000000..7f3606e3fc4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummary.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeClassificationSummaryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAccuracy = System.Text.Json.JsonEncodedText.Encode("accuracy"); + private static readonly System.Text.Json.JsonEncodedText PropAucRoc = System.Text.Json.JsonEncodedText.Encode("auc_roc"); + private static readonly System.Text.Json.JsonEncodedText PropMulticlassConfusionMatrix = System.Text.Json.JsonEncodedText.Encode("multiclass_confusion_matrix"); + private static readonly System.Text.Json.JsonEncodedText PropPrecision = System.Text.Json.JsonEncodedText.Encode("precision"); + private static readonly System.Text.Json.JsonEncodedText PropRecall = System.Text.Json.JsonEncodedText.Encode("recall"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAccuracy = default; + LocalJsonValue propAucRoc = default; + LocalJsonValue propMulticlassConfusionMatrix = default; + LocalJsonValue propPrecision = default; + LocalJsonValue propRecall = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAccuracy.TryReadProperty(ref reader, options, PropAccuracy, null)) + { + continue; + } + + if (propAucRoc.TryReadProperty(ref reader, options, PropAucRoc, null)) + { + continue; + } + + if (propMulticlassConfusionMatrix.TryReadProperty(ref reader, options, PropMulticlassConfusionMatrix, null)) + { + continue; + } + + if (propPrecision.TryReadProperty(ref reader, options, PropPrecision, null)) + { + continue; + } + + if (propRecall.TryReadProperty(ref reader, options, PropRecall, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Accuracy = propAccuracy.Value, + AucRoc = propAucRoc.Value, + MulticlassConfusionMatrix = propMulticlassConfusionMatrix.Value, + Precision = propPrecision.Value, + Recall = propRecall.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummary value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAccuracy, value.Accuracy, null, null); + writer.WriteProperty(options, PropAucRoc, value.AucRoc, null, null); + writer.WriteProperty(options, PropMulticlassConfusionMatrix, value.MulticlassConfusionMatrix, null, null); + writer.WriteProperty(options, PropPrecision, value.Precision, null, null); + writer.WriteProperty(options, PropRecall, value.Recall, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummary.g.cs index 881d3623ee1..99ac78e123b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummary.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummary.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeClassificationSummaryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAccuracy = System.Text.Json.JsonEncodedText.Encode("accuracy"); - private static readonly System.Text.Json.JsonEncodedText PropAucRoc = System.Text.Json.JsonEncodedText.Encode("auc_roc"); - private static readonly System.Text.Json.JsonEncodedText PropMulticlassConfusionMatrix = System.Text.Json.JsonEncodedText.Encode("multiclass_confusion_matrix"); - private static readonly System.Text.Json.JsonEncodedText PropPrecision = System.Text.Json.JsonEncodedText.Encode("precision"); - private static readonly System.Text.Json.JsonEncodedText PropRecall = System.Text.Json.JsonEncodedText.Encode("recall"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAccuracy = default; - LocalJsonValue propAucRoc = default; - LocalJsonValue propMulticlassConfusionMatrix = default; - LocalJsonValue propPrecision = default; - LocalJsonValue propRecall = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAccuracy.TryReadProperty(ref reader, options, PropAccuracy, null)) - { - continue; - } - - if (propAucRoc.TryReadProperty(ref reader, options, PropAucRoc, null)) - { - continue; - } - - if (propMulticlassConfusionMatrix.TryReadProperty(ref reader, options, PropMulticlassConfusionMatrix, null)) - { - continue; - } - - if (propPrecision.TryReadProperty(ref reader, options, PropPrecision, null)) - { - continue; - } - - if (propRecall.TryReadProperty(ref reader, options, PropRecall, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Accuracy = propAccuracy.Value, - AucRoc = propAucRoc.Value, - MulticlassConfusionMatrix = propMulticlassConfusionMatrix.Value, - Precision = propPrecision.Value, - Recall = propRecall.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummary value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAccuracy, value.Accuracy, null, null); - writer.WriteProperty(options, PropAucRoc, value.AucRoc, null, null); - writer.WriteProperty(options, PropMulticlassConfusionMatrix, value.MulticlassConfusionMatrix, null, null); - writer.WriteProperty(options, PropPrecision, value.Precision, null, null); - writer.WriteProperty(options, PropRecall, value.Recall, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeClassificationSummaryConverter))] public sealed partial class DataframeClassificationSummary { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryAccuracy.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryAccuracy.Converters.g.cs new file mode 100644 index 00000000000..5a8fdddd43d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryAccuracy.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeClassificationSummaryAccuracyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClasses = System.Text.Json.JsonEncodedText.Encode("classes"); + private static readonly System.Text.Json.JsonEncodedText PropOverallAccuracy = System.Text.Json.JsonEncodedText.Encode("overall_accuracy"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryAccuracy Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propClasses = default; + LocalJsonValue propOverallAccuracy = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClasses.TryReadProperty(ref reader, options, PropClasses, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propOverallAccuracy.TryReadProperty(ref reader, options, PropOverallAccuracy, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryAccuracy(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Classes = propClasses.Value, + OverallAccuracy = propOverallAccuracy.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryAccuracy value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClasses, value.Classes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropOverallAccuracy, value.OverallAccuracy, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryAccuracy.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryAccuracy.g.cs index 05657fa40ca..3d6eea04516 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryAccuracy.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryAccuracy.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeClassificationSummaryAccuracyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClasses = System.Text.Json.JsonEncodedText.Encode("classes"); - private static readonly System.Text.Json.JsonEncodedText PropOverallAccuracy = System.Text.Json.JsonEncodedText.Encode("overall_accuracy"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryAccuracy Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propClasses = default; - LocalJsonValue propOverallAccuracy = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClasses.TryReadProperty(ref reader, options, PropClasses, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propOverallAccuracy.TryReadProperty(ref reader, options, PropOverallAccuracy, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryAccuracy(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Classes = propClasses.Value, - OverallAccuracy = propOverallAccuracy.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryAccuracy value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClasses, value.Classes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropOverallAccuracy, value.OverallAccuracy, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryAccuracyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeClassificationSummaryAccuracyConverter))] public sealed partial class DataframeClassificationSummaryAccuracy { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryMulticlassConfusionMatrix.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryMulticlassConfusionMatrix.Converters.g.cs new file mode 100644 index 00000000000..867fa18abc3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryMulticlassConfusionMatrix.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeClassificationSummaryMulticlassConfusionMatrixConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropConfusionMatrix = System.Text.Json.JsonEncodedText.Encode("confusion_matrix"); + private static readonly System.Text.Json.JsonEncodedText PropOtherActualClassCount = System.Text.Json.JsonEncodedText.Encode("other_actual_class_count"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryMulticlassConfusionMatrix Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propConfusionMatrix = default; + LocalJsonValue propOtherActualClassCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propConfusionMatrix.TryReadProperty(ref reader, options, PropConfusionMatrix, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propOtherActualClassCount.TryReadProperty(ref reader, options, PropOtherActualClassCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryMulticlassConfusionMatrix(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ConfusionMatrix = propConfusionMatrix.Value, + OtherActualClassCount = propOtherActualClassCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryMulticlassConfusionMatrix value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropConfusionMatrix, value.ConfusionMatrix, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropOtherActualClassCount, value.OtherActualClassCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryMulticlassConfusionMatrix.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryMulticlassConfusionMatrix.g.cs index e10dd3a3ddd..3dfd97815d0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryMulticlassConfusionMatrix.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryMulticlassConfusionMatrix.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeClassificationSummaryMulticlassConfusionMatrixConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropConfusionMatrix = System.Text.Json.JsonEncodedText.Encode("confusion_matrix"); - private static readonly System.Text.Json.JsonEncodedText PropOtherActualClassCount = System.Text.Json.JsonEncodedText.Encode("other_actual_class_count"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryMulticlassConfusionMatrix Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propConfusionMatrix = default; - LocalJsonValue propOtherActualClassCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propConfusionMatrix.TryReadProperty(ref reader, options, PropConfusionMatrix, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propOtherActualClassCount.TryReadProperty(ref reader, options, PropOtherActualClassCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryMulticlassConfusionMatrix(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ConfusionMatrix = propConfusionMatrix.Value, - OtherActualClassCount = propOtherActualClassCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryMulticlassConfusionMatrix value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropConfusionMatrix, value.ConfusionMatrix, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropOtherActualClassCount, value.OtherActualClassCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryMulticlassConfusionMatrixConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeClassificationSummaryMulticlassConfusionMatrixConverter))] public sealed partial class DataframeClassificationSummaryMulticlassConfusionMatrix { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryPrecision.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryPrecision.Converters.g.cs new file mode 100644 index 00000000000..70f258d3675 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryPrecision.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeClassificationSummaryPrecisionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvgPrecision = System.Text.Json.JsonEncodedText.Encode("avg_precision"); + private static readonly System.Text.Json.JsonEncodedText PropClasses = System.Text.Json.JsonEncodedText.Encode("classes"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryPrecision Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvgPrecision = default; + LocalJsonValue> propClasses = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvgPrecision.TryReadProperty(ref reader, options, PropAvgPrecision, null)) + { + continue; + } + + if (propClasses.TryReadProperty(ref reader, options, PropClasses, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryPrecision(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AvgPrecision = propAvgPrecision.Value, + Classes = propClasses.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryPrecision value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvgPrecision, value.AvgPrecision, null, null); + writer.WriteProperty(options, PropClasses, value.Classes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryPrecision.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryPrecision.g.cs index a973742a53a..8a11fb2530a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryPrecision.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryPrecision.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeClassificationSummaryPrecisionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvgPrecision = System.Text.Json.JsonEncodedText.Encode("avg_precision"); - private static readonly System.Text.Json.JsonEncodedText PropClasses = System.Text.Json.JsonEncodedText.Encode("classes"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryPrecision Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvgPrecision = default; - LocalJsonValue> propClasses = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvgPrecision.TryReadProperty(ref reader, options, PropAvgPrecision, null)) - { - continue; - } - - if (propClasses.TryReadProperty(ref reader, options, PropClasses, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryPrecision(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AvgPrecision = propAvgPrecision.Value, - Classes = propClasses.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryPrecision value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvgPrecision, value.AvgPrecision, null, null); - writer.WriteProperty(options, PropClasses, value.Classes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryPrecisionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeClassificationSummaryPrecisionConverter))] public sealed partial class DataframeClassificationSummaryPrecision { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryRecall.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryRecall.Converters.g.cs new file mode 100644 index 00000000000..59c799b86df --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryRecall.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeClassificationSummaryRecallConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvgRecall = System.Text.Json.JsonEncodedText.Encode("avg_recall"); + private static readonly System.Text.Json.JsonEncodedText PropClasses = System.Text.Json.JsonEncodedText.Encode("classes"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryRecall Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvgRecall = default; + LocalJsonValue> propClasses = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvgRecall.TryReadProperty(ref reader, options, PropAvgRecall, null)) + { + continue; + } + + if (propClasses.TryReadProperty(ref reader, options, PropClasses, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryRecall(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AvgRecall = propAvgRecall.Value, + Classes = propClasses.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryRecall value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvgRecall, value.AvgRecall, null, null); + writer.WriteProperty(options, PropClasses, value.Classes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryRecall.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryRecall.g.cs index c522a11c3fa..80060c338ca 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryRecall.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeClassificationSummaryRecall.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeClassificationSummaryRecallConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvgRecall = System.Text.Json.JsonEncodedText.Encode("avg_recall"); - private static readonly System.Text.Json.JsonEncodedText PropClasses = System.Text.Json.JsonEncodedText.Encode("classes"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryRecall Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvgRecall = default; - LocalJsonValue> propClasses = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvgRecall.TryReadProperty(ref reader, options, PropAvgRecall, null)) - { - continue; - } - - if (propClasses.TryReadProperty(ref reader, options, PropClasses, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryRecall(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AvgRecall = propAvgRecall.Value, - Classes = propClasses.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryRecall value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvgRecall, value.AvgRecall, null, null); - writer.WriteProperty(options, PropClasses, value.Classes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeClassificationSummaryRecallConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeClassificationSummaryRecallConverter))] public sealed partial class DataframeClassificationSummaryRecall { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluation.Converters.g.cs new file mode 100644 index 00000000000..adec9b4c676 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluation.Converters.g.cs @@ -0,0 +1,102 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeEvaluationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantClassification = System.Text.Json.JsonEncodedText.Encode("classification"); + private static readonly System.Text.Json.JsonEncodedText VariantOutlierDetection = System.Text.Json.JsonEncodedText.Encode("outlier_detection"); + private static readonly System.Text.Json.JsonEncodedText VariantRegression = System.Text.Json.JsonEncodedText.Encode("regression"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantClassification)) + { + variantType = VariantClassification.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantOutlierDetection)) + { + variantType = VariantOutlierDetection.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRegression)) + { + variantType = VariantRegression.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "classification": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassification)value.Variant, null, null); + break; + case "outlier_detection": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetection)value.Variant, null, null); + break; + case "regression": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegression)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluation)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluation.g.cs index 4fb266c9311..79610a4fca3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluation.g.cs @@ -23,85 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeEvaluationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantClassification = System.Text.Json.JsonEncodedText.Encode("classification"); - private static readonly System.Text.Json.JsonEncodedText VariantOutlierDetection = System.Text.Json.JsonEncodedText.Encode("outlier_detection"); - private static readonly System.Text.Json.JsonEncodedText VariantRegression = System.Text.Json.JsonEncodedText.Encode("regression"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantClassification)) - { - variantType = VariantClassification.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantOutlierDetection)) - { - variantType = VariantOutlierDetection.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRegression)) - { - variantType = VariantRegression.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "classification": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassification)value.Variant, null, null); - break; - case "outlier_detection": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetection)value.Variant, null, null); - break; - case "regression": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegression)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluation)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeEvaluationConverter))] public sealed partial class DataframeEvaluation { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClass.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClass.Converters.g.cs new file mode 100644 index 00000000000..399eef0c882 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClass.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeEvaluationClassConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClassName = System.Text.Json.JsonEncodedText.Encode("class_name"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClass Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClassName = default; + LocalJsonValue propValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClassName.TryReadProperty(ref reader, options, PropClassName, null)) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClass(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClassName = propClassName.Value, + Value = propValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClass value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClassName, value.ClassName, null, null); + writer.WriteProperty(options, PropValue, value.Value, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClass.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClass.g.cs index f5b389cb2d6..0616a3088d4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClass.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClass.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeEvaluationClassConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClassName = System.Text.Json.JsonEncodedText.Encode("class_name"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClass Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClassName = default; - LocalJsonValue propValue = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClassName.TryReadProperty(ref reader, options, PropClassName, null)) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClass(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClassName = propClassName.Value, - Value = propValue.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClass value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClassName, value.ClassName, null, null); - writer.WriteProperty(options, PropValue, value.Value, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeEvaluationClassConverter))] public sealed partial class DataframeEvaluationClass { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassification.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassification.Converters.g.cs new file mode 100644 index 00000000000..ff504e12b24 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassification.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeEvaluationClassificationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropActualField = System.Text.Json.JsonEncodedText.Encode("actual_field"); + private static readonly System.Text.Json.JsonEncodedText PropMetrics = System.Text.Json.JsonEncodedText.Encode("metrics"); + private static readonly System.Text.Json.JsonEncodedText PropPredictedField = System.Text.Json.JsonEncodedText.Encode("predicted_field"); + private static readonly System.Text.Json.JsonEncodedText PropTopClassesField = System.Text.Json.JsonEncodedText.Encode("top_classes_field"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassification Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propActualField = default; + LocalJsonValue propMetrics = default; + LocalJsonValue propPredictedField = default; + LocalJsonValue propTopClassesField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propActualField.TryReadProperty(ref reader, options, PropActualField, null)) + { + continue; + } + + if (propMetrics.TryReadProperty(ref reader, options, PropMetrics, null)) + { + continue; + } + + if (propPredictedField.TryReadProperty(ref reader, options, PropPredictedField, null)) + { + continue; + } + + if (propTopClassesField.TryReadProperty(ref reader, options, PropTopClassesField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassification(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ActualField = propActualField.Value, + Metrics = propMetrics.Value, + PredictedField = propPredictedField.Value, + TopClassesField = propTopClassesField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassification value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropActualField, value.ActualField, null, null); + writer.WriteProperty(options, PropMetrics, value.Metrics, null, null); + writer.WriteProperty(options, PropPredictedField, value.PredictedField, null, null); + writer.WriteProperty(options, PropTopClassesField, value.TopClassesField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassification.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassification.g.cs index 99d1cc731b9..f176d0bd0ff 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassification.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassification.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeEvaluationClassificationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropActualField = System.Text.Json.JsonEncodedText.Encode("actual_field"); - private static readonly System.Text.Json.JsonEncodedText PropMetrics = System.Text.Json.JsonEncodedText.Encode("metrics"); - private static readonly System.Text.Json.JsonEncodedText PropPredictedField = System.Text.Json.JsonEncodedText.Encode("predicted_field"); - private static readonly System.Text.Json.JsonEncodedText PropTopClassesField = System.Text.Json.JsonEncodedText.Encode("top_classes_field"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassification Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propActualField = default; - LocalJsonValue propMetrics = default; - LocalJsonValue propPredictedField = default; - LocalJsonValue propTopClassesField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propActualField.TryReadProperty(ref reader, options, PropActualField, null)) - { - continue; - } - - if (propMetrics.TryReadProperty(ref reader, options, PropMetrics, null)) - { - continue; - } - - if (propPredictedField.TryReadProperty(ref reader, options, PropPredictedField, null)) - { - continue; - } - - if (propTopClassesField.TryReadProperty(ref reader, options, PropTopClassesField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassification(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ActualField = propActualField.Value, - Metrics = propMetrics.Value, - PredictedField = propPredictedField.Value, - TopClassesField = propTopClassesField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassification value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropActualField, value.ActualField, null, null); - writer.WriteProperty(options, PropMetrics, value.Metrics, null, null); - writer.WriteProperty(options, PropPredictedField, value.PredictedField, null, null); - writer.WriteProperty(options, PropTopClassesField, value.TopClassesField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeEvaluationClassificationConverter))] public sealed partial class DataframeEvaluationClassification { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetrics.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetrics.Converters.g.cs new file mode 100644 index 00000000000..1136817f95f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetrics.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeEvaluationClassificationMetricsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAccuracy = System.Text.Json.JsonEncodedText.Encode("accuracy"); + private static readonly System.Text.Json.JsonEncodedText PropAucRoc = System.Text.Json.JsonEncodedText.Encode("auc_roc"); + private static readonly System.Text.Json.JsonEncodedText PropMulticlassConfusionMatrix = System.Text.Json.JsonEncodedText.Encode("multiclass_confusion_matrix"); + private static readonly System.Text.Json.JsonEncodedText PropPrecision = System.Text.Json.JsonEncodedText.Encode("precision"); + private static readonly System.Text.Json.JsonEncodedText PropRecall = System.Text.Json.JsonEncodedText.Encode("recall"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetrics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAccuracy = default; + LocalJsonValue propAucRoc = default; + LocalJsonValue?> propMulticlassConfusionMatrix = default; + LocalJsonValue?> propPrecision = default; + LocalJsonValue?> propRecall = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAccuracy.TryReadProperty(ref reader, options, PropAccuracy, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propAucRoc.TryReadProperty(ref reader, options, PropAucRoc, null)) + { + continue; + } + + if (propMulticlassConfusionMatrix.TryReadProperty(ref reader, options, PropMulticlassConfusionMatrix, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propPrecision.TryReadProperty(ref reader, options, PropPrecision, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propRecall.TryReadProperty(ref reader, options, PropRecall, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetrics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Accuracy = propAccuracy.Value, + AucRoc = propAucRoc.Value, + MulticlassConfusionMatrix = propMulticlassConfusionMatrix.Value, + Precision = propPrecision.Value, + Recall = propRecall.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetrics value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAccuracy, value.Accuracy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropAucRoc, value.AucRoc, null, null); + writer.WriteProperty(options, PropMulticlassConfusionMatrix, value.MulticlassConfusionMatrix, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropPrecision, value.Precision, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropRecall, value.Recall, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetrics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetrics.g.cs index 4eac2e9bb88..7da3af6a67c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetrics.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetrics.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeEvaluationClassificationMetricsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAccuracy = System.Text.Json.JsonEncodedText.Encode("accuracy"); - private static readonly System.Text.Json.JsonEncodedText PropAucRoc = System.Text.Json.JsonEncodedText.Encode("auc_roc"); - private static readonly System.Text.Json.JsonEncodedText PropMulticlassConfusionMatrix = System.Text.Json.JsonEncodedText.Encode("multiclass_confusion_matrix"); - private static readonly System.Text.Json.JsonEncodedText PropPrecision = System.Text.Json.JsonEncodedText.Encode("precision"); - private static readonly System.Text.Json.JsonEncodedText PropRecall = System.Text.Json.JsonEncodedText.Encode("recall"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetrics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAccuracy = default; - LocalJsonValue propAucRoc = default; - LocalJsonValue?> propMulticlassConfusionMatrix = default; - LocalJsonValue?> propPrecision = default; - LocalJsonValue?> propRecall = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAccuracy.TryReadProperty(ref reader, options, PropAccuracy, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propAucRoc.TryReadProperty(ref reader, options, PropAucRoc, null)) - { - continue; - } - - if (propMulticlassConfusionMatrix.TryReadProperty(ref reader, options, PropMulticlassConfusionMatrix, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propPrecision.TryReadProperty(ref reader, options, PropPrecision, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propRecall.TryReadProperty(ref reader, options, PropRecall, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetrics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Accuracy = propAccuracy.Value, - AucRoc = propAucRoc.Value, - MulticlassConfusionMatrix = propMulticlassConfusionMatrix.Value, - Precision = propPrecision.Value, - Recall = propRecall.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetrics value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAccuracy, value.Accuracy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropAucRoc, value.AucRoc, null, null); - writer.WriteProperty(options, PropMulticlassConfusionMatrix, value.MulticlassConfusionMatrix, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropPrecision, value.Precision, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropRecall, value.Recall, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetricsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeEvaluationClassificationMetricsConverter))] public sealed partial class DataframeEvaluationClassificationMetrics { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetricsAucRoc.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetricsAucRoc.Converters.g.cs new file mode 100644 index 00000000000..aeb239b0e20 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetricsAucRoc.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeEvaluationClassificationMetricsAucRocConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClassName = System.Text.Json.JsonEncodedText.Encode("class_name"); + private static readonly System.Text.Json.JsonEncodedText PropIncludeCurve = System.Text.Json.JsonEncodedText.Encode("include_curve"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetricsAucRoc Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClassName = default; + LocalJsonValue propIncludeCurve = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClassName.TryReadProperty(ref reader, options, PropClassName, null)) + { + continue; + } + + if (propIncludeCurve.TryReadProperty(ref reader, options, PropIncludeCurve, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetricsAucRoc(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClassName = propClassName.Value, + IncludeCurve = propIncludeCurve.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetricsAucRoc value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClassName, value.ClassName, null, null); + writer.WriteProperty(options, PropIncludeCurve, value.IncludeCurve, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetricsAucRoc.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetricsAucRoc.g.cs index 4c82b9a88d6..a73cbf1e0fb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetricsAucRoc.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationClassificationMetricsAucRoc.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeEvaluationClassificationMetricsAucRocConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClassName = System.Text.Json.JsonEncodedText.Encode("class_name"); - private static readonly System.Text.Json.JsonEncodedText PropIncludeCurve = System.Text.Json.JsonEncodedText.Encode("include_curve"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetricsAucRoc Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClassName = default; - LocalJsonValue propIncludeCurve = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClassName.TryReadProperty(ref reader, options, PropClassName, null)) - { - continue; - } - - if (propIncludeCurve.TryReadProperty(ref reader, options, PropIncludeCurve, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetricsAucRoc(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClassName = propClassName.Value, - IncludeCurve = propIncludeCurve.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetricsAucRoc value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClassName, value.ClassName, null, null); - writer.WriteProperty(options, PropIncludeCurve, value.IncludeCurve, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationClassificationMetricsAucRocConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeEvaluationClassificationMetricsAucRocConverter))] public sealed partial class DataframeEvaluationClassificationMetricsAucRoc { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetection.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetection.Converters.g.cs new file mode 100644 index 00000000000..9c3c157a6de --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetection.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeEvaluationOutlierDetectionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropActualField = System.Text.Json.JsonEncodedText.Encode("actual_field"); + private static readonly System.Text.Json.JsonEncodedText PropMetrics = System.Text.Json.JsonEncodedText.Encode("metrics"); + private static readonly System.Text.Json.JsonEncodedText PropPredictedProbabilityField = System.Text.Json.JsonEncodedText.Encode("predicted_probability_field"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetection Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propActualField = default; + LocalJsonValue propMetrics = default; + LocalJsonValue propPredictedProbabilityField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propActualField.TryReadProperty(ref reader, options, PropActualField, null)) + { + continue; + } + + if (propMetrics.TryReadProperty(ref reader, options, PropMetrics, null)) + { + continue; + } + + if (propPredictedProbabilityField.TryReadProperty(ref reader, options, PropPredictedProbabilityField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetection(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ActualField = propActualField.Value, + Metrics = propMetrics.Value, + PredictedProbabilityField = propPredictedProbabilityField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetection value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropActualField, value.ActualField, null, null); + writer.WriteProperty(options, PropMetrics, value.Metrics, null, null); + writer.WriteProperty(options, PropPredictedProbabilityField, value.PredictedProbabilityField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetection.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetection.g.cs index 77513fb014d..b6a445b2bbd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetection.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetection.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeEvaluationOutlierDetectionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropActualField = System.Text.Json.JsonEncodedText.Encode("actual_field"); - private static readonly System.Text.Json.JsonEncodedText PropMetrics = System.Text.Json.JsonEncodedText.Encode("metrics"); - private static readonly System.Text.Json.JsonEncodedText PropPredictedProbabilityField = System.Text.Json.JsonEncodedText.Encode("predicted_probability_field"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetection Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propActualField = default; - LocalJsonValue propMetrics = default; - LocalJsonValue propPredictedProbabilityField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propActualField.TryReadProperty(ref reader, options, PropActualField, null)) - { - continue; - } - - if (propMetrics.TryReadProperty(ref reader, options, PropMetrics, null)) - { - continue; - } - - if (propPredictedProbabilityField.TryReadProperty(ref reader, options, PropPredictedProbabilityField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetection(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ActualField = propActualField.Value, - Metrics = propMetrics.Value, - PredictedProbabilityField = propPredictedProbabilityField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetection value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropActualField, value.ActualField, null, null); - writer.WriteProperty(options, PropMetrics, value.Metrics, null, null); - writer.WriteProperty(options, PropPredictedProbabilityField, value.PredictedProbabilityField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetectionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeEvaluationOutlierDetectionConverter))] public sealed partial class DataframeEvaluationOutlierDetection { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetectionMetrics.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetectionMetrics.Converters.g.cs new file mode 100644 index 00000000000..3ad26743c83 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetectionMetrics.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeEvaluationOutlierDetectionMetricsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAucRoc = System.Text.Json.JsonEncodedText.Encode("auc_roc"); + private static readonly System.Text.Json.JsonEncodedText PropConfusionMatrix = System.Text.Json.JsonEncodedText.Encode("confusion_matrix"); + private static readonly System.Text.Json.JsonEncodedText PropPrecision = System.Text.Json.JsonEncodedText.Encode("precision"); + private static readonly System.Text.Json.JsonEncodedText PropRecall = System.Text.Json.JsonEncodedText.Encode("recall"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetectionMetrics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAucRoc = default; + LocalJsonValue?> propConfusionMatrix = default; + LocalJsonValue?> propPrecision = default; + LocalJsonValue?> propRecall = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAucRoc.TryReadProperty(ref reader, options, PropAucRoc, null)) + { + continue; + } + + if (propConfusionMatrix.TryReadProperty(ref reader, options, PropConfusionMatrix, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propPrecision.TryReadProperty(ref reader, options, PropPrecision, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propRecall.TryReadProperty(ref reader, options, PropRecall, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetectionMetrics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AucRoc = propAucRoc.Value, + ConfusionMatrix = propConfusionMatrix.Value, + Precision = propPrecision.Value, + Recall = propRecall.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetectionMetrics value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAucRoc, value.AucRoc, null, null); + writer.WriteProperty(options, PropConfusionMatrix, value.ConfusionMatrix, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropPrecision, value.Precision, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropRecall, value.Recall, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetectionMetrics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetectionMetrics.g.cs index 1101cc8ffe2..29a99324ff0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetectionMetrics.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationOutlierDetectionMetrics.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeEvaluationOutlierDetectionMetricsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAucRoc = System.Text.Json.JsonEncodedText.Encode("auc_roc"); - private static readonly System.Text.Json.JsonEncodedText PropConfusionMatrix = System.Text.Json.JsonEncodedText.Encode("confusion_matrix"); - private static readonly System.Text.Json.JsonEncodedText PropPrecision = System.Text.Json.JsonEncodedText.Encode("precision"); - private static readonly System.Text.Json.JsonEncodedText PropRecall = System.Text.Json.JsonEncodedText.Encode("recall"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetectionMetrics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAucRoc = default; - LocalJsonValue?> propConfusionMatrix = default; - LocalJsonValue?> propPrecision = default; - LocalJsonValue?> propRecall = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAucRoc.TryReadProperty(ref reader, options, PropAucRoc, null)) - { - continue; - } - - if (propConfusionMatrix.TryReadProperty(ref reader, options, PropConfusionMatrix, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propPrecision.TryReadProperty(ref reader, options, PropPrecision, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propRecall.TryReadProperty(ref reader, options, PropRecall, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetectionMetrics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AucRoc = propAucRoc.Value, - ConfusionMatrix = propConfusionMatrix.Value, - Precision = propPrecision.Value, - Recall = propRecall.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetectionMetrics value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAucRoc, value.AucRoc, null, null); - writer.WriteProperty(options, PropConfusionMatrix, value.ConfusionMatrix, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropPrecision, value.Precision, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropRecall, value.Recall, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationOutlierDetectionMetricsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeEvaluationOutlierDetectionMetricsConverter))] public sealed partial class DataframeEvaluationOutlierDetectionMetrics { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegression.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegression.Converters.g.cs new file mode 100644 index 00000000000..898c50922d6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegression.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeEvaluationRegressionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropActualField = System.Text.Json.JsonEncodedText.Encode("actual_field"); + private static readonly System.Text.Json.JsonEncodedText PropMetrics = System.Text.Json.JsonEncodedText.Encode("metrics"); + private static readonly System.Text.Json.JsonEncodedText PropPredictedField = System.Text.Json.JsonEncodedText.Encode("predicted_field"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegression Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propActualField = default; + LocalJsonValue propMetrics = default; + LocalJsonValue propPredictedField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propActualField.TryReadProperty(ref reader, options, PropActualField, null)) + { + continue; + } + + if (propMetrics.TryReadProperty(ref reader, options, PropMetrics, null)) + { + continue; + } + + if (propPredictedField.TryReadProperty(ref reader, options, PropPredictedField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegression(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ActualField = propActualField.Value, + Metrics = propMetrics.Value, + PredictedField = propPredictedField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegression value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropActualField, value.ActualField, null, null); + writer.WriteProperty(options, PropMetrics, value.Metrics, null, null); + writer.WriteProperty(options, PropPredictedField, value.PredictedField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegression.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegression.g.cs index 8997c5ef594..69178f970c1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegression.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegression.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeEvaluationRegressionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropActualField = System.Text.Json.JsonEncodedText.Encode("actual_field"); - private static readonly System.Text.Json.JsonEncodedText PropMetrics = System.Text.Json.JsonEncodedText.Encode("metrics"); - private static readonly System.Text.Json.JsonEncodedText PropPredictedField = System.Text.Json.JsonEncodedText.Encode("predicted_field"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegression Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propActualField = default; - LocalJsonValue propMetrics = default; - LocalJsonValue propPredictedField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propActualField.TryReadProperty(ref reader, options, PropActualField, null)) - { - continue; - } - - if (propMetrics.TryReadProperty(ref reader, options, PropMetrics, null)) - { - continue; - } - - if (propPredictedField.TryReadProperty(ref reader, options, PropPredictedField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegression(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ActualField = propActualField.Value, - Metrics = propMetrics.Value, - PredictedField = propPredictedField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegression value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropActualField, value.ActualField, null, null); - writer.WriteProperty(options, PropMetrics, value.Metrics, null, null); - writer.WriteProperty(options, PropPredictedField, value.PredictedField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeEvaluationRegressionConverter))] public sealed partial class DataframeEvaluationRegression { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetrics.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetrics.Converters.g.cs new file mode 100644 index 00000000000..6eff118120e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetrics.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeEvaluationRegressionMetricsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropHuber = System.Text.Json.JsonEncodedText.Encode("huber"); + private static readonly System.Text.Json.JsonEncodedText PropMse = System.Text.Json.JsonEncodedText.Encode("mse"); + private static readonly System.Text.Json.JsonEncodedText PropMsle = System.Text.Json.JsonEncodedText.Encode("msle"); + private static readonly System.Text.Json.JsonEncodedText PropRSquared = System.Text.Json.JsonEncodedText.Encode("r_squared"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetrics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propHuber = default; + LocalJsonValue?> propMse = default; + LocalJsonValue propMsle = default; + LocalJsonValue?> propRSquared = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propHuber.TryReadProperty(ref reader, options, PropHuber, null)) + { + continue; + } + + if (propMse.TryReadProperty(ref reader, options, PropMse, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propMsle.TryReadProperty(ref reader, options, PropMsle, null)) + { + continue; + } + + if (propRSquared.TryReadProperty(ref reader, options, PropRSquared, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetrics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Huber = propHuber.Value, + Mse = propMse.Value, + Msle = propMsle.Value, + RSquared = propRSquared.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetrics value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropHuber, value.Huber, null, null); + writer.WriteProperty(options, PropMse, value.Mse, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropMsle, value.Msle, null, null); + writer.WriteProperty(options, PropRSquared, value.RSquared, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetrics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetrics.g.cs index 571bf6a37c1..1a5425e09c8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetrics.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetrics.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeEvaluationRegressionMetricsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropHuber = System.Text.Json.JsonEncodedText.Encode("huber"); - private static readonly System.Text.Json.JsonEncodedText PropMse = System.Text.Json.JsonEncodedText.Encode("mse"); - private static readonly System.Text.Json.JsonEncodedText PropMsle = System.Text.Json.JsonEncodedText.Encode("msle"); - private static readonly System.Text.Json.JsonEncodedText PropRSquared = System.Text.Json.JsonEncodedText.Encode("r_squared"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetrics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propHuber = default; - LocalJsonValue?> propMse = default; - LocalJsonValue propMsle = default; - LocalJsonValue?> propRSquared = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propHuber.TryReadProperty(ref reader, options, PropHuber, null)) - { - continue; - } - - if (propMse.TryReadProperty(ref reader, options, PropMse, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propMsle.TryReadProperty(ref reader, options, PropMsle, null)) - { - continue; - } - - if (propRSquared.TryReadProperty(ref reader, options, PropRSquared, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetrics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Huber = propHuber.Value, - Mse = propMse.Value, - Msle = propMsle.Value, - RSquared = propRSquared.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetrics value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropHuber, value.Huber, null, null); - writer.WriteProperty(options, PropMse, value.Mse, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropMsle, value.Msle, null, null); - writer.WriteProperty(options, PropRSquared, value.RSquared, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeEvaluationRegressionMetricsConverter))] public sealed partial class DataframeEvaluationRegressionMetrics { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsHuber.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsHuber.Converters.g.cs new file mode 100644 index 00000000000..4eec28c9daa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsHuber.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeEvaluationRegressionMetricsHuberConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDelta = System.Text.Json.JsonEncodedText.Encode("delta"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsHuber Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDelta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDelta.TryReadProperty(ref reader, options, PropDelta, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsHuber(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Delta = propDelta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsHuber value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDelta, value.Delta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsHuber.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsHuber.g.cs index 75ade7ef216..f4d35a837b7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsHuber.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsHuber.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeEvaluationRegressionMetricsHuberConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDelta = System.Text.Json.JsonEncodedText.Encode("delta"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsHuber Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDelta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDelta.TryReadProperty(ref reader, options, PropDelta, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsHuber(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Delta = propDelta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsHuber value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDelta, value.Delta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsHuberConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeEvaluationRegressionMetricsHuberConverter))] public sealed partial class DataframeEvaluationRegressionMetricsHuber { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsMsle.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsMsle.Converters.g.cs new file mode 100644 index 00000000000..95b4df0d2d1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsMsle.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeEvaluationRegressionMetricsMsleConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropOffset = System.Text.Json.JsonEncodedText.Encode("offset"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsMsle Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propOffset = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propOffset.TryReadProperty(ref reader, options, PropOffset, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsMsle(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Offset = propOffset.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsMsle value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropOffset, value.Offset, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsMsle.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsMsle.g.cs index c8351f60ebd..05f56cd79a6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsMsle.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationRegressionMetricsMsle.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeEvaluationRegressionMetricsMsleConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropOffset = System.Text.Json.JsonEncodedText.Encode("offset"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsMsle Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propOffset = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propOffset.TryReadProperty(ref reader, options, PropOffset, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsMsle(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Offset = propOffset.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsMsle value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropOffset, value.Offset, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationRegressionMetricsMsleConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeEvaluationRegressionMetricsMsleConverter))] public sealed partial class DataframeEvaluationRegressionMetricsMsle { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRoc.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRoc.Converters.g.cs new file mode 100644 index 00000000000..50df963e703 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRoc.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeEvaluationSummaryAucRocConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCurve = System.Text.Json.JsonEncodedText.Encode("curve"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationSummaryAucRoc Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propCurve = default; + LocalJsonValue propValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCurve.TryReadProperty(ref reader, options, PropCurve, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationSummaryAucRoc(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Curve = propCurve.Value, + Value = propValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationSummaryAucRoc value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCurve, value.Curve, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropValue, value.Value, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRoc.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRoc.g.cs index 0ad4ca0031f..072b484cec6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRoc.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRoc.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeEvaluationSummaryAucRocConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCurve = System.Text.Json.JsonEncodedText.Encode("curve"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationSummaryAucRoc Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propCurve = default; - LocalJsonValue propValue = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCurve.TryReadProperty(ref reader, options, PropCurve, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationSummaryAucRoc(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Curve = propCurve.Value, - Value = propValue.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationSummaryAucRoc value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCurve, value.Curve, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropValue, value.Value, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationSummaryAucRocConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeEvaluationSummaryAucRocConverter))] public sealed partial class DataframeEvaluationSummaryAucRoc { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRocCurveItem.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRocCurveItem.Converters.g.cs new file mode 100644 index 00000000000..19d40399a6f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRocCurveItem.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeEvaluationSummaryAucRocCurveItemConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFpr = System.Text.Json.JsonEncodedText.Encode("fpr"); + private static readonly System.Text.Json.JsonEncodedText PropThreshold = System.Text.Json.JsonEncodedText.Encode("threshold"); + private static readonly System.Text.Json.JsonEncodedText PropTpr = System.Text.Json.JsonEncodedText.Encode("tpr"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationSummaryAucRocCurveItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFpr = default; + LocalJsonValue propThreshold = default; + LocalJsonValue propTpr = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFpr.TryReadProperty(ref reader, options, PropFpr, null)) + { + continue; + } + + if (propThreshold.TryReadProperty(ref reader, options, PropThreshold, null)) + { + continue; + } + + if (propTpr.TryReadProperty(ref reader, options, PropTpr, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationSummaryAucRocCurveItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Fpr = propFpr.Value, + Threshold = propThreshold.Value, + Tpr = propTpr.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationSummaryAucRocCurveItem value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFpr, value.Fpr, null, null); + writer.WriteProperty(options, PropThreshold, value.Threshold, null, null); + writer.WriteProperty(options, PropTpr, value.Tpr, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRocCurveItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRocCurveItem.g.cs index d704afc5bcb..3ff95bc1ecd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRocCurveItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationSummaryAucRocCurveItem.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeEvaluationSummaryAucRocCurveItemConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFpr = System.Text.Json.JsonEncodedText.Encode("fpr"); - private static readonly System.Text.Json.JsonEncodedText PropThreshold = System.Text.Json.JsonEncodedText.Encode("threshold"); - private static readonly System.Text.Json.JsonEncodedText PropTpr = System.Text.Json.JsonEncodedText.Encode("tpr"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationSummaryAucRocCurveItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFpr = default; - LocalJsonValue propThreshold = default; - LocalJsonValue propTpr = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFpr.TryReadProperty(ref reader, options, PropFpr, null)) - { - continue; - } - - if (propThreshold.TryReadProperty(ref reader, options, PropThreshold, null)) - { - continue; - } - - if (propTpr.TryReadProperty(ref reader, options, PropTpr, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationSummaryAucRocCurveItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Fpr = propFpr.Value, - Threshold = propThreshold.Value, - Tpr = propTpr.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationSummaryAucRocCurveItem value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFpr, value.Fpr, null, null); - writer.WriteProperty(options, PropThreshold, value.Threshold, null, null); - writer.WriteProperty(options, PropTpr, value.Tpr, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationSummaryAucRocCurveItemConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeEvaluationSummaryAucRocCurveItemConverter))] public sealed partial class DataframeEvaluationSummaryAucRocCurveItem { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationValue.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationValue.Converters.g.cs new file mode 100644 index 00000000000..623f630a819 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationValue.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeEvaluationValueConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationValue Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propValue.TryReadProperty(ref reader, options, PropValue, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationValue(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Value = propValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationValue value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropValue, value.Value, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationValue.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationValue.g.cs index 5d33d18d711..f5653477d33 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationValue.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeEvaluationValue.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeEvaluationValueConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationValue Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propValue = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propValue.TryReadProperty(ref reader, options, PropValue, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationValue(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Value = propValue.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationValue value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropValue, value.Value, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeEvaluationValueConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeEvaluationValueConverter))] public sealed partial class DataframeEvaluationValue { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeOutlierDetectionSummary.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeOutlierDetectionSummary.Converters.g.cs new file mode 100644 index 00000000000..fa4f136050f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeOutlierDetectionSummary.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeOutlierDetectionSummaryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAucRoc = System.Text.Json.JsonEncodedText.Encode("auc_roc"); + private static readonly System.Text.Json.JsonEncodedText PropConfusionMatrix = System.Text.Json.JsonEncodedText.Encode("confusion_matrix"); + private static readonly System.Text.Json.JsonEncodedText PropPrecision = System.Text.Json.JsonEncodedText.Encode("precision"); + private static readonly System.Text.Json.JsonEncodedText PropRecall = System.Text.Json.JsonEncodedText.Encode("recall"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeOutlierDetectionSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAucRoc = default; + LocalJsonValue?> propConfusionMatrix = default; + LocalJsonValue?> propPrecision = default; + LocalJsonValue?> propRecall = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAucRoc.TryReadProperty(ref reader, options, PropAucRoc, null)) + { + continue; + } + + if (propConfusionMatrix.TryReadProperty(ref reader, options, PropConfusionMatrix, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propPrecision.TryReadProperty(ref reader, options, PropPrecision, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propRecall.TryReadProperty(ref reader, options, PropRecall, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeOutlierDetectionSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AucRoc = propAucRoc.Value, + ConfusionMatrix = propConfusionMatrix.Value, + Precision = propPrecision.Value, + Recall = propRecall.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeOutlierDetectionSummary value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAucRoc, value.AucRoc, null, null); + writer.WriteProperty(options, PropConfusionMatrix, value.ConfusionMatrix, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropPrecision, value.Precision, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropRecall, value.Recall, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeOutlierDetectionSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeOutlierDetectionSummary.g.cs index 8e09c5a9fd8..8f505230f46 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeOutlierDetectionSummary.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeOutlierDetectionSummary.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeOutlierDetectionSummaryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAucRoc = System.Text.Json.JsonEncodedText.Encode("auc_roc"); - private static readonly System.Text.Json.JsonEncodedText PropConfusionMatrix = System.Text.Json.JsonEncodedText.Encode("confusion_matrix"); - private static readonly System.Text.Json.JsonEncodedText PropPrecision = System.Text.Json.JsonEncodedText.Encode("precision"); - private static readonly System.Text.Json.JsonEncodedText PropRecall = System.Text.Json.JsonEncodedText.Encode("recall"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeOutlierDetectionSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAucRoc = default; - LocalJsonValue?> propConfusionMatrix = default; - LocalJsonValue?> propPrecision = default; - LocalJsonValue?> propRecall = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAucRoc.TryReadProperty(ref reader, options, PropAucRoc, null)) - { - continue; - } - - if (propConfusionMatrix.TryReadProperty(ref reader, options, PropConfusionMatrix, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propPrecision.TryReadProperty(ref reader, options, PropPrecision, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propRecall.TryReadProperty(ref reader, options, PropRecall, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeOutlierDetectionSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AucRoc = propAucRoc.Value, - ConfusionMatrix = propConfusionMatrix.Value, - Precision = propPrecision.Value, - Recall = propRecall.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeOutlierDetectionSummary value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAucRoc, value.AucRoc, null, null); - writer.WriteProperty(options, PropConfusionMatrix, value.ConfusionMatrix, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropPrecision, value.Precision, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropRecall, value.Recall, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeOutlierDetectionSummaryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeOutlierDetectionSummaryConverter))] public sealed partial class DataframeOutlierDetectionSummary { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframePreviewConfig.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframePreviewConfig.Converters.g.cs new file mode 100644 index 00000000000..ce811684234 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframePreviewConfig.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframePreviewConfigConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalysis = System.Text.Json.JsonEncodedText.Encode("analysis"); + private static readonly System.Text.Json.JsonEncodedText PropAnalyzedFields = System.Text.Json.JsonEncodedText.Encode("analyzed_fields"); + private static readonly System.Text.Json.JsonEncodedText PropMaxNumThreads = System.Text.Json.JsonEncodedText.Encode("max_num_threads"); + private static readonly System.Text.Json.JsonEncodedText PropModelMemoryLimit = System.Text.Json.JsonEncodedText.Encode("model_memory_limit"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframePreviewConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalysis = default; + LocalJsonValue propAnalyzedFields = default; + LocalJsonValue propMaxNumThreads = default; + LocalJsonValue propModelMemoryLimit = default; + LocalJsonValue propSource = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalysis.TryReadProperty(ref reader, options, PropAnalysis, null)) + { + continue; + } + + if (propAnalyzedFields.TryReadProperty(ref reader, options, PropAnalyzedFields, null)) + { + continue; + } + + if (propMaxNumThreads.TryReadProperty(ref reader, options, PropMaxNumThreads, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propModelMemoryLimit.TryReadProperty(ref reader, options, PropModelMemoryLimit, null)) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframePreviewConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analysis = propAnalysis.Value, + AnalyzedFields = propAnalyzedFields.Value, + MaxNumThreads = propMaxNumThreads.Value, + ModelMemoryLimit = propModelMemoryLimit.Value, + Source = propSource.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframePreviewConfig value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalysis, value.Analysis, null, null); + writer.WriteProperty(options, PropAnalyzedFields, value.AnalyzedFields, null, null); + writer.WriteProperty(options, PropMaxNumThreads, value.MaxNumThreads, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropModelMemoryLimit, value.ModelMemoryLimit, null, null); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframePreviewConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframePreviewConfig.g.cs index 69e3769a798..6d63a33d23f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframePreviewConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframePreviewConfig.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframePreviewConfigConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalysis = System.Text.Json.JsonEncodedText.Encode("analysis"); - private static readonly System.Text.Json.JsonEncodedText PropAnalyzedFields = System.Text.Json.JsonEncodedText.Encode("analyzed_fields"); - private static readonly System.Text.Json.JsonEncodedText PropMaxNumThreads = System.Text.Json.JsonEncodedText.Encode("max_num_threads"); - private static readonly System.Text.Json.JsonEncodedText PropModelMemoryLimit = System.Text.Json.JsonEncodedText.Encode("model_memory_limit"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframePreviewConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalysis = default; - LocalJsonValue propAnalyzedFields = default; - LocalJsonValue propMaxNumThreads = default; - LocalJsonValue propModelMemoryLimit = default; - LocalJsonValue propSource = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalysis.TryReadProperty(ref reader, options, PropAnalysis, null)) - { - continue; - } - - if (propAnalyzedFields.TryReadProperty(ref reader, options, PropAnalyzedFields, null)) - { - continue; - } - - if (propMaxNumThreads.TryReadProperty(ref reader, options, PropMaxNumThreads, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propModelMemoryLimit.TryReadProperty(ref reader, options, PropModelMemoryLimit, null)) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframePreviewConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analysis = propAnalysis.Value, - AnalyzedFields = propAnalyzedFields.Value, - MaxNumThreads = propMaxNumThreads.Value, - ModelMemoryLimit = propModelMemoryLimit.Value, - Source = propSource.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframePreviewConfig value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalysis, value.Analysis, null, null); - writer.WriteProperty(options, PropAnalyzedFields, value.AnalyzedFields, null, null); - writer.WriteProperty(options, PropMaxNumThreads, value.MaxNumThreads, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropModelMemoryLimit, value.ModelMemoryLimit, null, null); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframePreviewConfigConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframePreviewConfigConverter))] public sealed partial class DataframePreviewConfig { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeRegressionSummary.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeRegressionSummary.Converters.g.cs new file mode 100644 index 00000000000..94a29a452a7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeRegressionSummary.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeRegressionSummaryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropHuber = System.Text.Json.JsonEncodedText.Encode("huber"); + private static readonly System.Text.Json.JsonEncodedText PropMse = System.Text.Json.JsonEncodedText.Encode("mse"); + private static readonly System.Text.Json.JsonEncodedText PropMsle = System.Text.Json.JsonEncodedText.Encode("msle"); + private static readonly System.Text.Json.JsonEncodedText PropRSquared = System.Text.Json.JsonEncodedText.Encode("r_squared"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeRegressionSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propHuber = default; + LocalJsonValue propMse = default; + LocalJsonValue propMsle = default; + LocalJsonValue propRSquared = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propHuber.TryReadProperty(ref reader, options, PropHuber, null)) + { + continue; + } + + if (propMse.TryReadProperty(ref reader, options, PropMse, null)) + { + continue; + } + + if (propMsle.TryReadProperty(ref reader, options, PropMsle, null)) + { + continue; + } + + if (propRSquared.TryReadProperty(ref reader, options, PropRSquared, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeRegressionSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Huber = propHuber.Value, + Mse = propMse.Value, + Msle = propMsle.Value, + RSquared = propRSquared.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeRegressionSummary value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropHuber, value.Huber, null, null); + writer.WriteProperty(options, PropMse, value.Mse, null, null); + writer.WriteProperty(options, PropMsle, value.Msle, null, null); + writer.WriteProperty(options, PropRSquared, value.RSquared, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeRegressionSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeRegressionSummary.g.cs index d08bfa2afde..24be739b5cc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeRegressionSummary.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeRegressionSummary.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DataframeRegressionSummaryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropHuber = System.Text.Json.JsonEncodedText.Encode("huber"); - private static readonly System.Text.Json.JsonEncodedText PropMse = System.Text.Json.JsonEncodedText.Encode("mse"); - private static readonly System.Text.Json.JsonEncodedText PropMsle = System.Text.Json.JsonEncodedText.Encode("msle"); - private static readonly System.Text.Json.JsonEncodedText PropRSquared = System.Text.Json.JsonEncodedText.Encode("r_squared"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeRegressionSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propHuber = default; - LocalJsonValue propMse = default; - LocalJsonValue propMsle = default; - LocalJsonValue propRSquared = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propHuber.TryReadProperty(ref reader, options, PropHuber, null)) - { - continue; - } - - if (propMse.TryReadProperty(ref reader, options, PropMse, null)) - { - continue; - } - - if (propMsle.TryReadProperty(ref reader, options, PropMsle, null)) - { - continue; - } - - if (propRSquared.TryReadProperty(ref reader, options, PropRSquared, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DataframeRegressionSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Huber = propHuber.Value, - Mse = propMse.Value, - Msle = propMsle.Value, - RSquared = propRSquared.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeRegressionSummary value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropHuber, value.Huber, null, null); - writer.WriteProperty(options, PropMse, value.Mse, null, null); - writer.WriteProperty(options, PropMsle, value.Msle, null, null); - writer.WriteProperty(options, PropRSquared, value.RSquared, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeRegressionSummaryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeRegressionSummaryConverter))] public sealed partial class DataframeRegressionSummary { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeState.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeState.Converters.g.cs new file mode 100644 index 00000000000..8f7609df976 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeState.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DataframeStateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberFailed = System.Text.Json.JsonEncodedText.Encode("failed"); + private static readonly System.Text.Json.JsonEncodedText MemberStarted = System.Text.Json.JsonEncodedText.Encode("started"); + private static readonly System.Text.Json.JsonEncodedText MemberStarting = System.Text.Json.JsonEncodedText.Encode("starting"); + private static readonly System.Text.Json.JsonEncodedText MemberStopped = System.Text.Json.JsonEncodedText.Encode("stopped"); + private static readonly System.Text.Json.JsonEncodedText MemberStopping = System.Text.Json.JsonEncodedText.Encode("stopping"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberFailed)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Failed; + } + + if (reader.ValueTextEquals(MemberStarted)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Started; + } + + if (reader.ValueTextEquals(MemberStarting)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Starting; + } + + if (reader.ValueTextEquals(MemberStopped)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Stopped; + } + + if (reader.ValueTextEquals(MemberStopping)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Stopping; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberFailed.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Failed; + } + + if (string.Equals(value, MemberStarted.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Started; + } + + if (string.Equals(value, MemberStarting.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Starting; + } + + if (string.Equals(value, MemberStopped.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Stopped; + } + + if (string.Equals(value, MemberStopping.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Stopping; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeState)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeState value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Failed: + writer.WriteStringValue(MemberFailed); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Started: + writer.WriteStringValue(MemberStarted); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Starting: + writer.WriteStringValue(MemberStarting); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Stopped: + writer.WriteStringValue(MemberStopped); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.DataframeState.Stopping: + writer.WriteStringValue(MemberStopping); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.DataframeState)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.MachineLearning.DataframeState ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DataframeState value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeState.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeState.g.cs new file mode 100644 index 00000000000..bfb8a80e1f9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DataframeState.g.cs @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DataframeStateConverter))] +public enum DataframeState +{ + [System.Runtime.Serialization.EnumMember(Value = "failed")] + Failed, + [System.Runtime.Serialization.EnumMember(Value = "started")] + Started, + [System.Runtime.Serialization.EnumMember(Value = "starting")] + Starting, + [System.Runtime.Serialization.EnumMember(Value = "stopped")] + Stopped, + [System.Runtime.Serialization.EnumMember(Value = "stopping")] + Stopping +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Defaults.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Defaults.Converters.g.cs new file mode 100644 index 00000000000..0664f3b8677 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Defaults.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DefaultsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnomalyDetectors = System.Text.Json.JsonEncodedText.Encode("anomaly_detectors"); + private static readonly System.Text.Json.JsonEncodedText PropDatafeeds = System.Text.Json.JsonEncodedText.Encode("datafeeds"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.Defaults Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnomalyDetectors = default; + LocalJsonValue propDatafeeds = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnomalyDetectors.TryReadProperty(ref reader, options, PropAnomalyDetectors, null)) + { + continue; + } + + if (propDatafeeds.TryReadProperty(ref reader, options, PropDatafeeds, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.Defaults(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AnomalyDetectors = propAnomalyDetectors.Value, + Datafeeds = propDatafeeds.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Defaults value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnomalyDetectors, value.AnomalyDetectors, null, null); + writer.WriteProperty(options, PropDatafeeds, value.Datafeeds, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Defaults.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Defaults.g.cs index 13d971352a2..b2f5bf57cd5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Defaults.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Defaults.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DefaultsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnomalyDetectors = System.Text.Json.JsonEncodedText.Encode("anomaly_detectors"); - private static readonly System.Text.Json.JsonEncodedText PropDatafeeds = System.Text.Json.JsonEncodedText.Encode("datafeeds"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.Defaults Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnomalyDetectors = default; - LocalJsonValue propDatafeeds = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnomalyDetectors.TryReadProperty(ref reader, options, PropAnomalyDetectors, null)) - { - continue; - } - - if (propDatafeeds.TryReadProperty(ref reader, options, PropDatafeeds, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.Defaults(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AnomalyDetectors = propAnomalyDetectors.Value, - Datafeeds = propDatafeeds.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Defaults value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnomalyDetectors, value.AnomalyDetectors, null, null); - writer.WriteProperty(options, PropDatafeeds, value.Datafeeds, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DefaultsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DefaultsConverter))] public sealed partial class Defaults { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Definition.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Definition.Converters.g.cs new file mode 100644 index 00000000000..07c31db2bdc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Definition.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DefinitionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPreprocessors = System.Text.Json.JsonEncodedText.Encode("preprocessors"); + private static readonly System.Text.Json.JsonEncodedText PropTrainedModel = System.Text.Json.JsonEncodedText.Encode("trained_model"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.Definition Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propPreprocessors = default; + LocalJsonValue propTrainedModel = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPreprocessors.TryReadProperty(ref reader, options, PropPreprocessors, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTrainedModel.TryReadProperty(ref reader, options, PropTrainedModel, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.Definition(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Preprocessors = propPreprocessors.Value, + TrainedModel = propTrainedModel.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Definition value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPreprocessors, value.Preprocessors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTrainedModel, value.TrainedModel, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Definition.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Definition.g.cs index b3c34cd0a08..538ebeaf282 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Definition.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Definition.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DefinitionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPreprocessors = System.Text.Json.JsonEncodedText.Encode("preprocessors"); - private static readonly System.Text.Json.JsonEncodedText PropTrainedModel = System.Text.Json.JsonEncodedText.Encode("trained_model"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.Definition Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propPreprocessors = default; - LocalJsonValue propTrainedModel = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPreprocessors.TryReadProperty(ref reader, options, PropPreprocessors, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTrainedModel.TryReadProperty(ref reader, options, PropTrainedModel, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.Definition(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Preprocessors = propPreprocessors.Value, - TrainedModel = propTrainedModel.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Definition value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPreprocessors, value.Preprocessors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTrainedModel, value.TrainedModel, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DefinitionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DefinitionConverter))] public sealed partial class Definition { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DelayedDataCheckConfig.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DelayedDataCheckConfig.Converters.g.cs new file mode 100644 index 00000000000..f07842b1161 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DelayedDataCheckConfig.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DelayedDataCheckConfigConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCheckWindow = System.Text.Json.JsonEncodedText.Encode("check_window"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCheckWindow = default; + LocalJsonValue propEnabled = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCheckWindow.TryReadProperty(ref reader, options, PropCheckWindow, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CheckWindow = propCheckWindow.Value, + Enabled = propEnabled.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCheckWindow, value.CheckWindow, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DelayedDataCheckConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DelayedDataCheckConfig.g.cs index 01b381290f2..4b1de945c0c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DelayedDataCheckConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DelayedDataCheckConfig.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DelayedDataCheckConfigConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCheckWindow = System.Text.Json.JsonEncodedText.Encode("check_window"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCheckWindow = default; - LocalJsonValue propEnabled = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCheckWindow.TryReadProperty(ref reader, options, PropCheckWindow, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CheckWindow = propCheckWindow.Value, - Enabled = propEnabled.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfig value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCheckWindow, value.CheckWindow, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DelayedDataCheckConfigConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DelayedDataCheckConfigConverter))] public sealed partial class DelayedDataCheckConfig { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DeploymentAllocationState.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DeploymentAllocationState.Converters.g.cs new file mode 100644 index 00000000000..320e029c9d4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DeploymentAllocationState.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DeploymentAllocationStateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberFullyAllocated = System.Text.Json.JsonEncodedText.Encode("fully_allocated"); + private static readonly System.Text.Json.JsonEncodedText MemberStarted = System.Text.Json.JsonEncodedText.Encode("started"); + private static readonly System.Text.Json.JsonEncodedText MemberStarting = System.Text.Json.JsonEncodedText.Encode("starting"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberFullyAllocated)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState.FullyAllocated; + } + + if (reader.ValueTextEquals(MemberStarted)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState.Started; + } + + if (reader.ValueTextEquals(MemberStarting)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState.Starting; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberFullyAllocated.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState.FullyAllocated; + } + + if (string.Equals(value, MemberStarted.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState.Started; + } + + if (string.Equals(value, MemberStarting.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState.Starting; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState.FullyAllocated: + writer.WriteStringValue(MemberFullyAllocated); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState.Started: + writer.WriteStringValue(MemberStarted); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState.Starting: + writer.WriteStringValue(MemberStarting); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAllocationState value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DeploymentAllocationState.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DeploymentAllocationState.g.cs new file mode 100644 index 00000000000..63c89a3f0ed --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DeploymentAllocationState.g.cs @@ -0,0 +1,50 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DeploymentAllocationStateConverter))] +public enum DeploymentAllocationState +{ + /// + /// + /// Trained model deployment has started on all valid nodes. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "fully_allocated")] + FullyAllocated, + /// + /// + /// The trained model is started on at least one node. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "started")] + Started, + /// + /// + /// Trained model deployment is starting but it is not yet deployed on any nodes. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "starting")] + Starting +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DeploymentAssignmentState.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DeploymentAssignmentState.Converters.g.cs new file mode 100644 index 00000000000..3239dccd338 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DeploymentAssignmentState.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DeploymentAssignmentStateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberFailed = System.Text.Json.JsonEncodedText.Encode("failed"); + private static readonly System.Text.Json.JsonEncodedText MemberStarted = System.Text.Json.JsonEncodedText.Encode("started"); + private static readonly System.Text.Json.JsonEncodedText MemberStarting = System.Text.Json.JsonEncodedText.Encode("starting"); + private static readonly System.Text.Json.JsonEncodedText MemberStopping = System.Text.Json.JsonEncodedText.Encode("stopping"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberFailed)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState.Failed; + } + + if (reader.ValueTextEquals(MemberStarted)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState.Started; + } + + if (reader.ValueTextEquals(MemberStarting)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState.Starting; + } + + if (reader.ValueTextEquals(MemberStopping)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState.Stopping; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberFailed.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState.Failed; + } + + if (string.Equals(value, MemberStarted.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState.Started; + } + + if (string.Equals(value, MemberStarting.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState.Starting; + } + + if (string.Equals(value, MemberStopping.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState.Stopping; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState.Failed: + writer.WriteStringValue(MemberFailed); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState.Started: + writer.WriteStringValue(MemberStarted); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState.Starting: + writer.WriteStringValue(MemberStarting); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState.Stopping: + writer.WriteStringValue(MemberStopping); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DeploymentAssignmentState.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DeploymentAssignmentState.g.cs new file mode 100644 index 00000000000..6871adbc3dc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DeploymentAssignmentState.g.cs @@ -0,0 +1,57 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DeploymentAssignmentStateConverter))] +public enum DeploymentAssignmentState +{ + /// + /// + /// The deployment is on a failed state and must be re-deployed. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "failed")] + Failed, + /// + /// + /// The deployment is usable; at least one node has the model allocated. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "started")] + Started, + /// + /// + /// The deployment has recently started but is not yet usable; the model is not allocated on any nodes. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "starting")] + Starting, + /// + /// + /// The deployment is preparing to stop and deallocate the model from the relevant nodes. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "stopping")] + Stopping +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectionRule.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectionRule.Converters.g.cs new file mode 100644 index 00000000000..a271dfabcff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectionRule.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DetectionRuleConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropActions = System.Text.Json.JsonEncodedText.Encode("actions"); + private static readonly System.Text.Json.JsonEncodedText PropConditions = System.Text.Json.JsonEncodedText.Encode("conditions"); + private static readonly System.Text.Json.JsonEncodedText PropScope = System.Text.Json.JsonEncodedText.Encode("scope"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DetectionRule Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propActions = default; + LocalJsonValue?> propConditions = default; + LocalJsonValue?> propScope = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propActions.TryReadProperty(ref reader, options, PropActions, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propConditions.TryReadProperty(ref reader, options, PropConditions, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propScope.TryReadProperty(ref reader, options, PropScope, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DetectionRule(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Actions = propActions.Value, + Conditions = propConditions.Value, + Scope = propScope.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DetectionRule value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropActions, value.Actions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropConditions, value.Conditions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropScope, value.Scope, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectionRule.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectionRule.g.cs index d65f8f5df66..da24e9429f3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectionRule.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectionRule.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DetectionRuleConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropActions = System.Text.Json.JsonEncodedText.Encode("actions"); - private static readonly System.Text.Json.JsonEncodedText PropConditions = System.Text.Json.JsonEncodedText.Encode("conditions"); - private static readonly System.Text.Json.JsonEncodedText PropScope = System.Text.Json.JsonEncodedText.Encode("scope"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DetectionRule Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propActions = default; - LocalJsonValue?> propConditions = default; - LocalJsonValue?> propScope = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propActions.TryReadProperty(ref reader, options, PropActions, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propConditions.TryReadProperty(ref reader, options, PropConditions, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propScope.TryReadProperty(ref reader, options, PropScope, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DetectionRule(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Actions = propActions.Value, - Conditions = propConditions.Value, - Scope = propScope.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DetectionRule value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropActions, value.Actions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropConditions, value.Conditions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropScope, value.Scope, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DetectionRuleConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DetectionRuleConverter))] public sealed partial class DetectionRule { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Detector.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Detector.Converters.g.cs new file mode 100644 index 00000000000..158a9284eb7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Detector.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DetectorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropByFieldName = System.Text.Json.JsonEncodedText.Encode("by_field_name"); + private static readonly System.Text.Json.JsonEncodedText PropCustomRules = System.Text.Json.JsonEncodedText.Encode("custom_rules"); + private static readonly System.Text.Json.JsonEncodedText PropDetectorDescription = System.Text.Json.JsonEncodedText.Encode("detector_description"); + private static readonly System.Text.Json.JsonEncodedText PropDetectorIndex = System.Text.Json.JsonEncodedText.Encode("detector_index"); + private static readonly System.Text.Json.JsonEncodedText PropExcludeFrequent = System.Text.Json.JsonEncodedText.Encode("exclude_frequent"); + private static readonly System.Text.Json.JsonEncodedText PropFieldName = System.Text.Json.JsonEncodedText.Encode("field_name"); + private static readonly System.Text.Json.JsonEncodedText PropFunction = System.Text.Json.JsonEncodedText.Encode("function"); + private static readonly System.Text.Json.JsonEncodedText PropOverFieldName = System.Text.Json.JsonEncodedText.Encode("over_field_name"); + private static readonly System.Text.Json.JsonEncodedText PropPartitionFieldName = System.Text.Json.JsonEncodedText.Encode("partition_field_name"); + private static readonly System.Text.Json.JsonEncodedText PropUseNull = System.Text.Json.JsonEncodedText.Encode("use_null"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.Detector Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propByFieldName = default; + LocalJsonValue?> propCustomRules = default; + LocalJsonValue propDetectorDescription = default; + LocalJsonValue propDetectorIndex = default; + LocalJsonValue propExcludeFrequent = default; + LocalJsonValue propFieldName = default; + LocalJsonValue propFunction = default; + LocalJsonValue propOverFieldName = default; + LocalJsonValue propPartitionFieldName = default; + LocalJsonValue propUseNull = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propByFieldName.TryReadProperty(ref reader, options, PropByFieldName, null)) + { + continue; + } + + if (propCustomRules.TryReadProperty(ref reader, options, PropCustomRules, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propDetectorDescription.TryReadProperty(ref reader, options, PropDetectorDescription, null)) + { + continue; + } + + if (propDetectorIndex.TryReadProperty(ref reader, options, PropDetectorIndex, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propExcludeFrequent.TryReadProperty(ref reader, options, PropExcludeFrequent, static Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFieldName.TryReadProperty(ref reader, options, PropFieldName, null)) + { + continue; + } + + if (propFunction.TryReadProperty(ref reader, options, PropFunction, null)) + { + continue; + } + + if (propOverFieldName.TryReadProperty(ref reader, options, PropOverFieldName, null)) + { + continue; + } + + if (propPartitionFieldName.TryReadProperty(ref reader, options, PropPartitionFieldName, null)) + { + continue; + } + + if (propUseNull.TryReadProperty(ref reader, options, PropUseNull, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.Detector(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ByFieldName = propByFieldName.Value, + CustomRules = propCustomRules.Value, + DetectorDescription = propDetectorDescription.Value, + DetectorIndex = propDetectorIndex.Value, + ExcludeFrequent = propExcludeFrequent.Value, + FieldName = propFieldName.Value, + Function = propFunction.Value, + OverFieldName = propOverFieldName.Value, + PartitionFieldName = propPartitionFieldName.Value, + UseNull = propUseNull.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Detector value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropByFieldName, value.ByFieldName, null, null); + writer.WriteProperty(options, PropCustomRules, value.CustomRules, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDetectorDescription, value.DetectorDescription, null, null); + writer.WriteProperty(options, PropDetectorIndex, value.DetectorIndex, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropExcludeFrequent, value.ExcludeFrequent, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFieldName, value.FieldName, null, null); + writer.WriteProperty(options, PropFunction, value.Function, null, null); + writer.WriteProperty(options, PropOverFieldName, value.OverFieldName, null, null); + writer.WriteProperty(options, PropPartitionFieldName, value.PartitionFieldName, null, null); + writer.WriteProperty(options, PropUseNull, value.UseNull, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Detector.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Detector.g.cs index 52b774d1ad6..c8845521f79 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Detector.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Detector.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DetectorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropByFieldName = System.Text.Json.JsonEncodedText.Encode("by_field_name"); - private static readonly System.Text.Json.JsonEncodedText PropCustomRules = System.Text.Json.JsonEncodedText.Encode("custom_rules"); - private static readonly System.Text.Json.JsonEncodedText PropDetectorDescription = System.Text.Json.JsonEncodedText.Encode("detector_description"); - private static readonly System.Text.Json.JsonEncodedText PropDetectorIndex = System.Text.Json.JsonEncodedText.Encode("detector_index"); - private static readonly System.Text.Json.JsonEncodedText PropExcludeFrequent = System.Text.Json.JsonEncodedText.Encode("exclude_frequent"); - private static readonly System.Text.Json.JsonEncodedText PropFieldName = System.Text.Json.JsonEncodedText.Encode("field_name"); - private static readonly System.Text.Json.JsonEncodedText PropFunction = System.Text.Json.JsonEncodedText.Encode("function"); - private static readonly System.Text.Json.JsonEncodedText PropOverFieldName = System.Text.Json.JsonEncodedText.Encode("over_field_name"); - private static readonly System.Text.Json.JsonEncodedText PropPartitionFieldName = System.Text.Json.JsonEncodedText.Encode("partition_field_name"); - private static readonly System.Text.Json.JsonEncodedText PropUseNull = System.Text.Json.JsonEncodedText.Encode("use_null"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.Detector Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propByFieldName = default; - LocalJsonValue?> propCustomRules = default; - LocalJsonValue propDetectorDescription = default; - LocalJsonValue propDetectorIndex = default; - LocalJsonValue propExcludeFrequent = default; - LocalJsonValue propFieldName = default; - LocalJsonValue propFunction = default; - LocalJsonValue propOverFieldName = default; - LocalJsonValue propPartitionFieldName = default; - LocalJsonValue propUseNull = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propByFieldName.TryReadProperty(ref reader, options, PropByFieldName, null)) - { - continue; - } - - if (propCustomRules.TryReadProperty(ref reader, options, PropCustomRules, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propDetectorDescription.TryReadProperty(ref reader, options, PropDetectorDescription, null)) - { - continue; - } - - if (propDetectorIndex.TryReadProperty(ref reader, options, PropDetectorIndex, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propExcludeFrequent.TryReadProperty(ref reader, options, PropExcludeFrequent, static Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFieldName.TryReadProperty(ref reader, options, PropFieldName, null)) - { - continue; - } - - if (propFunction.TryReadProperty(ref reader, options, PropFunction, null)) - { - continue; - } - - if (propOverFieldName.TryReadProperty(ref reader, options, PropOverFieldName, null)) - { - continue; - } - - if (propPartitionFieldName.TryReadProperty(ref reader, options, PropPartitionFieldName, null)) - { - continue; - } - - if (propUseNull.TryReadProperty(ref reader, options, PropUseNull, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.Detector(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ByFieldName = propByFieldName.Value, - CustomRules = propCustomRules.Value, - DetectorDescription = propDetectorDescription.Value, - DetectorIndex = propDetectorIndex.Value, - ExcludeFrequent = propExcludeFrequent.Value, - FieldName = propFieldName.Value, - Function = propFunction.Value, - OverFieldName = propOverFieldName.Value, - PartitionFieldName = propPartitionFieldName.Value, - UseNull = propUseNull.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Detector value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropByFieldName, value.ByFieldName, null, null); - writer.WriteProperty(options, PropCustomRules, value.CustomRules, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDetectorDescription, value.DetectorDescription, null, null); - writer.WriteProperty(options, PropDetectorIndex, value.DetectorIndex, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropExcludeFrequent, value.ExcludeFrequent, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFieldName, value.FieldName, null, null); - writer.WriteProperty(options, PropFunction, value.Function, null, null); - writer.WriteProperty(options, PropOverFieldName, value.OverFieldName, null, null); - writer.WriteProperty(options, PropPartitionFieldName, value.PartitionFieldName, null, null); - writer.WriteProperty(options, PropUseNull, value.UseNull, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DetectorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DetectorConverter))] public sealed partial class Detector { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectorRead.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectorRead.Converters.g.cs new file mode 100644 index 00000000000..96b7c86fd21 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectorRead.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DetectorReadConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropByFieldName = System.Text.Json.JsonEncodedText.Encode("by_field_name"); + private static readonly System.Text.Json.JsonEncodedText PropCustomRules = System.Text.Json.JsonEncodedText.Encode("custom_rules"); + private static readonly System.Text.Json.JsonEncodedText PropDetectorDescription = System.Text.Json.JsonEncodedText.Encode("detector_description"); + private static readonly System.Text.Json.JsonEncodedText PropDetectorIndex = System.Text.Json.JsonEncodedText.Encode("detector_index"); + private static readonly System.Text.Json.JsonEncodedText PropExcludeFrequent = System.Text.Json.JsonEncodedText.Encode("exclude_frequent"); + private static readonly System.Text.Json.JsonEncodedText PropFieldName = System.Text.Json.JsonEncodedText.Encode("field_name"); + private static readonly System.Text.Json.JsonEncodedText PropFunction = System.Text.Json.JsonEncodedText.Encode("function"); + private static readonly System.Text.Json.JsonEncodedText PropOverFieldName = System.Text.Json.JsonEncodedText.Encode("over_field_name"); + private static readonly System.Text.Json.JsonEncodedText PropPartitionFieldName = System.Text.Json.JsonEncodedText.Encode("partition_field_name"); + private static readonly System.Text.Json.JsonEncodedText PropUseNull = System.Text.Json.JsonEncodedText.Encode("use_null"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DetectorRead Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propByFieldName = default; + LocalJsonValue?> propCustomRules = default; + LocalJsonValue propDetectorDescription = default; + LocalJsonValue propDetectorIndex = default; + LocalJsonValue propExcludeFrequent = default; + LocalJsonValue propFieldName = default; + LocalJsonValue propFunction = default; + LocalJsonValue propOverFieldName = default; + LocalJsonValue propPartitionFieldName = default; + LocalJsonValue propUseNull = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propByFieldName.TryReadProperty(ref reader, options, PropByFieldName, null)) + { + continue; + } + + if (propCustomRules.TryReadProperty(ref reader, options, PropCustomRules, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propDetectorDescription.TryReadProperty(ref reader, options, PropDetectorDescription, null)) + { + continue; + } + + if (propDetectorIndex.TryReadProperty(ref reader, options, PropDetectorIndex, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propExcludeFrequent.TryReadProperty(ref reader, options, PropExcludeFrequent, static Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFieldName.TryReadProperty(ref reader, options, PropFieldName, null)) + { + continue; + } + + if (propFunction.TryReadProperty(ref reader, options, PropFunction, null)) + { + continue; + } + + if (propOverFieldName.TryReadProperty(ref reader, options, PropOverFieldName, null)) + { + continue; + } + + if (propPartitionFieldName.TryReadProperty(ref reader, options, PropPartitionFieldName, null)) + { + continue; + } + + if (propUseNull.TryReadProperty(ref reader, options, PropUseNull, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DetectorRead(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ByFieldName = propByFieldName.Value, + CustomRules = propCustomRules.Value, + DetectorDescription = propDetectorDescription.Value, + DetectorIndex = propDetectorIndex.Value, + ExcludeFrequent = propExcludeFrequent.Value, + FieldName = propFieldName.Value, + Function = propFunction.Value, + OverFieldName = propOverFieldName.Value, + PartitionFieldName = propPartitionFieldName.Value, + UseNull = propUseNull.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DetectorRead value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropByFieldName, value.ByFieldName, null, null); + writer.WriteProperty(options, PropCustomRules, value.CustomRules, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDetectorDescription, value.DetectorDescription, null, null); + writer.WriteProperty(options, PropDetectorIndex, value.DetectorIndex, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropExcludeFrequent, value.ExcludeFrequent, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFieldName, value.FieldName, null, null); + writer.WriteProperty(options, PropFunction, value.Function, null, null); + writer.WriteProperty(options, PropOverFieldName, value.OverFieldName, null, null); + writer.WriteProperty(options, PropPartitionFieldName, value.PartitionFieldName, null, null); + writer.WriteProperty(options, PropUseNull, value.UseNull, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectorRead.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectorRead.g.cs index 82d7f57ecab..7d4b3848f3b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectorRead.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectorRead.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DetectorReadConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropByFieldName = System.Text.Json.JsonEncodedText.Encode("by_field_name"); - private static readonly System.Text.Json.JsonEncodedText PropCustomRules = System.Text.Json.JsonEncodedText.Encode("custom_rules"); - private static readonly System.Text.Json.JsonEncodedText PropDetectorDescription = System.Text.Json.JsonEncodedText.Encode("detector_description"); - private static readonly System.Text.Json.JsonEncodedText PropDetectorIndex = System.Text.Json.JsonEncodedText.Encode("detector_index"); - private static readonly System.Text.Json.JsonEncodedText PropExcludeFrequent = System.Text.Json.JsonEncodedText.Encode("exclude_frequent"); - private static readonly System.Text.Json.JsonEncodedText PropFieldName = System.Text.Json.JsonEncodedText.Encode("field_name"); - private static readonly System.Text.Json.JsonEncodedText PropFunction = System.Text.Json.JsonEncodedText.Encode("function"); - private static readonly System.Text.Json.JsonEncodedText PropOverFieldName = System.Text.Json.JsonEncodedText.Encode("over_field_name"); - private static readonly System.Text.Json.JsonEncodedText PropPartitionFieldName = System.Text.Json.JsonEncodedText.Encode("partition_field_name"); - private static readonly System.Text.Json.JsonEncodedText PropUseNull = System.Text.Json.JsonEncodedText.Encode("use_null"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DetectorRead Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propByFieldName = default; - LocalJsonValue?> propCustomRules = default; - LocalJsonValue propDetectorDescription = default; - LocalJsonValue propDetectorIndex = default; - LocalJsonValue propExcludeFrequent = default; - LocalJsonValue propFieldName = default; - LocalJsonValue propFunction = default; - LocalJsonValue propOverFieldName = default; - LocalJsonValue propPartitionFieldName = default; - LocalJsonValue propUseNull = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propByFieldName.TryReadProperty(ref reader, options, PropByFieldName, null)) - { - continue; - } - - if (propCustomRules.TryReadProperty(ref reader, options, PropCustomRules, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propDetectorDescription.TryReadProperty(ref reader, options, PropDetectorDescription, null)) - { - continue; - } - - if (propDetectorIndex.TryReadProperty(ref reader, options, PropDetectorIndex, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propExcludeFrequent.TryReadProperty(ref reader, options, PropExcludeFrequent, static Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFieldName.TryReadProperty(ref reader, options, PropFieldName, null)) - { - continue; - } - - if (propFunction.TryReadProperty(ref reader, options, PropFunction, null)) - { - continue; - } - - if (propOverFieldName.TryReadProperty(ref reader, options, PropOverFieldName, null)) - { - continue; - } - - if (propPartitionFieldName.TryReadProperty(ref reader, options, PropPartitionFieldName, null)) - { - continue; - } - - if (propUseNull.TryReadProperty(ref reader, options, PropUseNull, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DetectorRead(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ByFieldName = propByFieldName.Value, - CustomRules = propCustomRules.Value, - DetectorDescription = propDetectorDescription.Value, - DetectorIndex = propDetectorIndex.Value, - ExcludeFrequent = propExcludeFrequent.Value, - FieldName = propFieldName.Value, - Function = propFunction.Value, - OverFieldName = propOverFieldName.Value, - PartitionFieldName = propPartitionFieldName.Value, - UseNull = propUseNull.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DetectorRead value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropByFieldName, value.ByFieldName, null, null); - writer.WriteProperty(options, PropCustomRules, value.CustomRules, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDetectorDescription, value.DetectorDescription, null, null); - writer.WriteProperty(options, PropDetectorIndex, value.DetectorIndex, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropExcludeFrequent, value.ExcludeFrequent, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFieldName, value.FieldName, null, null); - writer.WriteProperty(options, PropFunction, value.Function, null, null); - writer.WriteProperty(options, PropOverFieldName, value.OverFieldName, null, null); - writer.WriteProperty(options, PropPartitionFieldName, value.PartitionFieldName, null, null); - writer.WriteProperty(options, PropUseNull, value.UseNull, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DetectorReadConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DetectorReadConverter))] public sealed partial class DetectorRead { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectorUpdate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectorUpdate.Converters.g.cs new file mode 100644 index 00000000000..db804fd7efa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectorUpdate.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DetectorUpdateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCustomRules = System.Text.Json.JsonEncodedText.Encode("custom_rules"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropDetectorIndex = System.Text.Json.JsonEncodedText.Encode("detector_index"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DetectorUpdate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propCustomRules = default; + LocalJsonValue propDescription = default; + LocalJsonValue propDetectorIndex = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCustomRules.TryReadProperty(ref reader, options, PropCustomRules, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propDetectorIndex.TryReadProperty(ref reader, options, PropDetectorIndex, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DetectorUpdate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CustomRules = propCustomRules.Value, + Description = propDescription.Value, + DetectorIndex = propDetectorIndex.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DetectorUpdate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCustomRules, value.CustomRules, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropDetectorIndex, value.DetectorIndex, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectorUpdate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectorUpdate.g.cs index beb10ce4a73..0d46acf6a25 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectorUpdate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectorUpdate.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DetectorUpdateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCustomRules = System.Text.Json.JsonEncodedText.Encode("custom_rules"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropDetectorIndex = System.Text.Json.JsonEncodedText.Encode("detector_index"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DetectorUpdate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propCustomRules = default; - LocalJsonValue propDescription = default; - LocalJsonValue propDetectorIndex = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCustomRules.TryReadProperty(ref reader, options, PropCustomRules, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propDetectorIndex.TryReadProperty(ref reader, options, PropDetectorIndex, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DetectorUpdate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CustomRules = propCustomRules.Value, - Description = propDescription.Value, - DetectorIndex = propDetectorIndex.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DetectorUpdate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCustomRules, value.CustomRules, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropDetectorIndex, value.DetectorIndex, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DetectorUpdateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DetectorUpdateConverter))] public sealed partial class DetectorUpdate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DiscoveryNodeCompact.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DiscoveryNodeCompact.Converters.g.cs new file mode 100644 index 00000000000..6888363c3a7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DiscoveryNodeCompact.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DiscoveryNodeCompactConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); + private static readonly System.Text.Json.JsonEncodedText PropEphemeralId = System.Text.Json.JsonEncodedText.Encode("ephemeral_id"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DiscoveryNodeCompact Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propAttributes = default; + LocalJsonValue propEphemeralId = default; + LocalJsonValue propId = default; + LocalJsonValue propName = default; + LocalJsonValue propTransportAddress = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propEphemeralId.TryReadProperty(ref reader, options, PropEphemeralId, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DiscoveryNodeCompact(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Attributes = propAttributes.Value, + EphemeralId = propEphemeralId.Value, + Id = propId.Value, + Name = propName.Value, + TransportAddress = propTransportAddress.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DiscoveryNodeCompact value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropEphemeralId, value.EphemeralId, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DiscoveryNodeCompact.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DiscoveryNodeCompact.g.cs index 17e08b2042b..dbd0e60439d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DiscoveryNodeCompact.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DiscoveryNodeCompact.g.cs @@ -23,87 +23,12 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DiscoveryNodeCompactConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); - private static readonly System.Text.Json.JsonEncodedText PropEphemeralId = System.Text.Json.JsonEncodedText.Encode("ephemeral_id"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DiscoveryNodeCompact Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propAttributes = default; - LocalJsonValue propEphemeralId = default; - LocalJsonValue propId = default; - LocalJsonValue propName = default; - LocalJsonValue propTransportAddress = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propEphemeralId.TryReadProperty(ref reader, options, PropEphemeralId, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DiscoveryNodeCompact(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Attributes = propAttributes.Value, - EphemeralId = propEphemeralId.Value, - Id = propId.Value, - Name = propName.Value, - TransportAddress = propTransportAddress.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DiscoveryNodeCompact value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropEphemeralId, value.EphemeralId, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Alternative representation of DiscoveryNode used in ml.get_job_stats and ml.get_datafeed_stats /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DiscoveryNodeCompactConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DiscoveryNodeCompactConverter))] public sealed partial class DiscoveryNodeCompact { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DiscoveryNodeContent.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DiscoveryNodeContent.Converters.g.cs new file mode 100644 index 00000000000..97e5bcc4ec3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DiscoveryNodeContent.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class DiscoveryNodeContentConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); + private static readonly System.Text.Json.JsonEncodedText PropEphemeralId = System.Text.Json.JsonEncodedText.Encode("ephemeral_id"); + private static readonly System.Text.Json.JsonEncodedText PropExternalId = System.Text.Json.JsonEncodedText.Encode("external_id"); + private static readonly System.Text.Json.JsonEncodedText PropMaxIndexVersion = System.Text.Json.JsonEncodedText.Encode("max_index_version"); + private static readonly System.Text.Json.JsonEncodedText PropMinIndexVersion = System.Text.Json.JsonEncodedText.Encode("min_index_version"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.DiscoveryNodeContent Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propAttributes = default; + LocalJsonValue propEphemeralId = default; + LocalJsonValue propExternalId = default; + LocalJsonValue propMaxIndexVersion = default; + LocalJsonValue propMinIndexVersion = default; + LocalJsonValue propName = default; + LocalJsonValue> propRoles = default; + LocalJsonValue propTransportAddress = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propEphemeralId.TryReadProperty(ref reader, options, PropEphemeralId, null)) + { + continue; + } + + if (propExternalId.TryReadProperty(ref reader, options, PropExternalId, null)) + { + continue; + } + + if (propMaxIndexVersion.TryReadProperty(ref reader, options, PropMaxIndexVersion, null)) + { + continue; + } + + if (propMinIndexVersion.TryReadProperty(ref reader, options, PropMinIndexVersion, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.DiscoveryNodeContent(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Attributes = propAttributes.Value, + EphemeralId = propEphemeralId.Value, + ExternalId = propExternalId.Value, + MaxIndexVersion = propMaxIndexVersion.Value, + MinIndexVersion = propMinIndexVersion.Value, + Name = propName.Value, + Roles = propRoles.Value, + TransportAddress = propTransportAddress.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DiscoveryNodeContent value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropEphemeralId, value.EphemeralId, null, null); + writer.WriteProperty(options, PropExternalId, value.ExternalId, null, null); + writer.WriteProperty(options, PropMaxIndexVersion, value.MaxIndexVersion, null, null); + writer.WriteProperty(options, PropMinIndexVersion, value.MinIndexVersion, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DiscoveryNodeContent.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DiscoveryNodeContent.g.cs index 0c32aab8ff7..20c8101218a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DiscoveryNodeContent.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DiscoveryNodeContent.g.cs @@ -23,118 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class DiscoveryNodeContentConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); - private static readonly System.Text.Json.JsonEncodedText PropEphemeralId = System.Text.Json.JsonEncodedText.Encode("ephemeral_id"); - private static readonly System.Text.Json.JsonEncodedText PropExternalId = System.Text.Json.JsonEncodedText.Encode("external_id"); - private static readonly System.Text.Json.JsonEncodedText PropMaxIndexVersion = System.Text.Json.JsonEncodedText.Encode("max_index_version"); - private static readonly System.Text.Json.JsonEncodedText PropMinIndexVersion = System.Text.Json.JsonEncodedText.Encode("min_index_version"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); - private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.DiscoveryNodeContent Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propAttributes = default; - LocalJsonValue propEphemeralId = default; - LocalJsonValue propExternalId = default; - LocalJsonValue propMaxIndexVersion = default; - LocalJsonValue propMinIndexVersion = default; - LocalJsonValue propName = default; - LocalJsonValue> propRoles = default; - LocalJsonValue propTransportAddress = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propEphemeralId.TryReadProperty(ref reader, options, PropEphemeralId, null)) - { - continue; - } - - if (propExternalId.TryReadProperty(ref reader, options, PropExternalId, null)) - { - continue; - } - - if (propMaxIndexVersion.TryReadProperty(ref reader, options, PropMaxIndexVersion, null)) - { - continue; - } - - if (propMinIndexVersion.TryReadProperty(ref reader, options, PropMinIndexVersion, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.DiscoveryNodeContent(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Attributes = propAttributes.Value, - EphemeralId = propEphemeralId.Value, - ExternalId = propExternalId.Value, - MaxIndexVersion = propMaxIndexVersion.Value, - MinIndexVersion = propMinIndexVersion.Value, - Name = propName.Value, - Roles = propRoles.Value, - TransportAddress = propTransportAddress.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.DiscoveryNodeContent value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropEphemeralId, value.EphemeralId, null, null); - writer.WriteProperty(options, PropExternalId, value.ExternalId, null, null); - writer.WriteProperty(options, PropMaxIndexVersion, value.MaxIndexVersion, null, null); - writer.WriteProperty(options, PropMinIndexVersion, value.MinIndexVersion, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.DiscoveryNodeContentConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.DiscoveryNodeContentConverter))] public sealed partial class DiscoveryNodeContent { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Ensemble.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Ensemble.Converters.g.cs new file mode 100644 index 00000000000..b1662f3434e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Ensemble.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class EnsembleConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAggregateOutput = System.Text.Json.JsonEncodedText.Encode("aggregate_output"); + private static readonly System.Text.Json.JsonEncodedText PropClassificationLabels = System.Text.Json.JsonEncodedText.Encode("classification_labels"); + private static readonly System.Text.Json.JsonEncodedText PropFeatureNames = System.Text.Json.JsonEncodedText.Encode("feature_names"); + private static readonly System.Text.Json.JsonEncodedText PropTargetType = System.Text.Json.JsonEncodedText.Encode("target_type"); + private static readonly System.Text.Json.JsonEncodedText PropTrainedModels = System.Text.Json.JsonEncodedText.Encode("trained_models"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.Ensemble Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAggregateOutput = default; + LocalJsonValue?> propClassificationLabels = default; + LocalJsonValue?> propFeatureNames = default; + LocalJsonValue propTargetType = default; + LocalJsonValue> propTrainedModels = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregateOutput.TryReadProperty(ref reader, options, PropAggregateOutput, null)) + { + continue; + } + + if (propClassificationLabels.TryReadProperty(ref reader, options, PropClassificationLabels, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propFeatureNames.TryReadProperty(ref reader, options, PropFeatureNames, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTargetType.TryReadProperty(ref reader, options, PropTargetType, null)) + { + continue; + } + + if (propTrainedModels.TryReadProperty(ref reader, options, PropTrainedModels, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.Ensemble(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AggregateOutput = propAggregateOutput.Value, + ClassificationLabels = propClassificationLabels.Value, + FeatureNames = propFeatureNames.Value, + TargetType = propTargetType.Value, + TrainedModels = propTrainedModels.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Ensemble value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregateOutput, value.AggregateOutput, null, null); + writer.WriteProperty(options, PropClassificationLabels, value.ClassificationLabels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFeatureNames, value.FeatureNames, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTargetType, value.TargetType, null, null); + writer.WriteProperty(options, PropTrainedModels, value.TrainedModels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Ensemble.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Ensemble.g.cs index e2574577432..9f142059b00 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Ensemble.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Ensemble.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class EnsembleConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAggregateOutput = System.Text.Json.JsonEncodedText.Encode("aggregate_output"); - private static readonly System.Text.Json.JsonEncodedText PropClassificationLabels = System.Text.Json.JsonEncodedText.Encode("classification_labels"); - private static readonly System.Text.Json.JsonEncodedText PropFeatureNames = System.Text.Json.JsonEncodedText.Encode("feature_names"); - private static readonly System.Text.Json.JsonEncodedText PropTargetType = System.Text.Json.JsonEncodedText.Encode("target_type"); - private static readonly System.Text.Json.JsonEncodedText PropTrainedModels = System.Text.Json.JsonEncodedText.Encode("trained_models"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.Ensemble Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAggregateOutput = default; - LocalJsonValue?> propClassificationLabels = default; - LocalJsonValue?> propFeatureNames = default; - LocalJsonValue propTargetType = default; - LocalJsonValue> propTrainedModels = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregateOutput.TryReadProperty(ref reader, options, PropAggregateOutput, null)) - { - continue; - } - - if (propClassificationLabels.TryReadProperty(ref reader, options, PropClassificationLabels, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propFeatureNames.TryReadProperty(ref reader, options, PropFeatureNames, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTargetType.TryReadProperty(ref reader, options, PropTargetType, null)) - { - continue; - } - - if (propTrainedModels.TryReadProperty(ref reader, options, PropTrainedModels, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.Ensemble(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AggregateOutput = propAggregateOutput.Value, - ClassificationLabels = propClassificationLabels.Value, - FeatureNames = propFeatureNames.Value, - TargetType = propTargetType.Value, - TrainedModels = propTrainedModels.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Ensemble value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregateOutput, value.AggregateOutput, null, null); - writer.WriteProperty(options, PropClassificationLabels, value.ClassificationLabels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFeatureNames, value.FeatureNames, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTargetType, value.TargetType, null, null); - writer.WriteProperty(options, PropTrainedModels, value.TrainedModels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.EnsembleConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.EnsembleConverter))] public sealed partial class Ensemble { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ExcludeFrequent.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ExcludeFrequent.Converters.g.cs new file mode 100644 index 00000000000..e8373081799 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ExcludeFrequent.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ExcludeFrequentConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAll = System.Text.Json.JsonEncodedText.Encode("all"); + private static readonly System.Text.Json.JsonEncodedText MemberBy = System.Text.Json.JsonEncodedText.Encode("by"); + private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); + private static readonly System.Text.Json.JsonEncodedText MemberOver = System.Text.Json.JsonEncodedText.Encode("over"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAll)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent.All; + } + + if (reader.ValueTextEquals(MemberBy)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent.By; + } + + if (reader.ValueTextEquals(MemberNone)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent.None; + } + + if (reader.ValueTextEquals(MemberOver)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent.Over; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAll.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent.All; + } + + if (string.Equals(value, MemberBy.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent.By; + } + + if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent.None; + } + + if (string.Equals(value, MemberOver.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent.Over; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent.All: + writer.WriteStringValue(MemberAll); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent.By: + writer.WriteStringValue(MemberBy); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent.None: + writer.WriteStringValue(MemberNone); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent.Over: + writer.WriteStringValue(MemberOver); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ExcludeFrequent.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ExcludeFrequent.g.cs new file mode 100644 index 00000000000..8b02feef997 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ExcludeFrequent.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ExcludeFrequentConverter))] +public enum ExcludeFrequent +{ + [System.Runtime.Serialization.EnumMember(Value = "all")] + All, + [System.Runtime.Serialization.EnumMember(Value = "by")] + By, + [System.Runtime.Serialization.EnumMember(Value = "none")] + None, + [System.Runtime.Serialization.EnumMember(Value = "over")] + Over +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ExponentialAverageCalculationContext.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ExponentialAverageCalculationContext.Converters.g.cs new file mode 100644 index 00000000000..0d07e7438be --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ExponentialAverageCalculationContext.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ExponentialAverageCalculationContextConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIncrementalMetricValueMs = System.Text.Json.JsonEncodedText.Encode("incremental_metric_value_ms"); + private static readonly System.Text.Json.JsonEncodedText PropLatestTimestamp = System.Text.Json.JsonEncodedText.Encode("latest_timestamp"); + private static readonly System.Text.Json.JsonEncodedText PropPreviousExponentialAverageMs = System.Text.Json.JsonEncodedText.Encode("previous_exponential_average_ms"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.ExponentialAverageCalculationContext Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIncrementalMetricValueMs = default; + LocalJsonValue propLatestTimestamp = default; + LocalJsonValue propPreviousExponentialAverageMs = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIncrementalMetricValueMs.TryReadProperty(ref reader, options, PropIncrementalMetricValueMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propLatestTimestamp.TryReadProperty(ref reader, options, PropLatestTimestamp, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propPreviousExponentialAverageMs.TryReadProperty(ref reader, options, PropPreviousExponentialAverageMs, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.ExponentialAverageCalculationContext(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + IncrementalMetricValueMs = propIncrementalMetricValueMs.Value, + LatestTimestamp = propLatestTimestamp.Value, + PreviousExponentialAverageMs = propPreviousExponentialAverageMs.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ExponentialAverageCalculationContext value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIncrementalMetricValueMs, value.IncrementalMetricValueMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropLatestTimestamp, value.LatestTimestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropPreviousExponentialAverageMs, value.PreviousExponentialAverageMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ExponentialAverageCalculationContext.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ExponentialAverageCalculationContext.g.cs index 154069553a8..b1d0228ece6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ExponentialAverageCalculationContext.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ExponentialAverageCalculationContext.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class ExponentialAverageCalculationContextConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIncrementalMetricValueMs = System.Text.Json.JsonEncodedText.Encode("incremental_metric_value_ms"); - private static readonly System.Text.Json.JsonEncodedText PropLatestTimestamp = System.Text.Json.JsonEncodedText.Encode("latest_timestamp"); - private static readonly System.Text.Json.JsonEncodedText PropPreviousExponentialAverageMs = System.Text.Json.JsonEncodedText.Encode("previous_exponential_average_ms"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.ExponentialAverageCalculationContext Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIncrementalMetricValueMs = default; - LocalJsonValue propLatestTimestamp = default; - LocalJsonValue propPreviousExponentialAverageMs = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIncrementalMetricValueMs.TryReadProperty(ref reader, options, PropIncrementalMetricValueMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propLatestTimestamp.TryReadProperty(ref reader, options, PropLatestTimestamp, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propPreviousExponentialAverageMs.TryReadProperty(ref reader, options, PropPreviousExponentialAverageMs, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.ExponentialAverageCalculationContext(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - IncrementalMetricValueMs = propIncrementalMetricValueMs.Value, - LatestTimestamp = propLatestTimestamp.Value, - PreviousExponentialAverageMs = propPreviousExponentialAverageMs.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ExponentialAverageCalculationContext value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIncrementalMetricValueMs, value.IncrementalMetricValueMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropLatestTimestamp, value.LatestTimestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropPreviousExponentialAverageMs, value.PreviousExponentialAverageMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ExponentialAverageCalculationContextConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ExponentialAverageCalculationContextConverter))] public sealed partial class ExponentialAverageCalculationContext { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FillMaskInferenceOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FillMaskInferenceOptions.Converters.g.cs new file mode 100644 index 00000000000..e6688e1fa34 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FillMaskInferenceOptions.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class FillMaskInferenceOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaskToken = System.Text.Json.JsonEncodedText.Encode("mask_token"); + private static readonly System.Text.Json.JsonEncodedText PropNumTopClasses = System.Text.Json.JsonEncodedText.Encode("num_top_classes"); + private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); + private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); + private static readonly System.Text.Json.JsonEncodedText PropVocabulary = System.Text.Json.JsonEncodedText.Encode("vocabulary"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.FillMaskInferenceOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaskToken = default; + LocalJsonValue propNumTopClasses = default; + LocalJsonValue propResultsField = default; + LocalJsonValue propTokenization = default; + LocalJsonValue propVocabulary = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaskToken.TryReadProperty(ref reader, options, PropMaskToken, null)) + { + continue; + } + + if (propNumTopClasses.TryReadProperty(ref reader, options, PropNumTopClasses, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) + { + continue; + } + + if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) + { + continue; + } + + if (propVocabulary.TryReadProperty(ref reader, options, PropVocabulary, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.FillMaskInferenceOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaskToken = propMaskToken.Value, + NumTopClasses = propNumTopClasses.Value, + ResultsField = propResultsField.Value, + Tokenization = propTokenization.Value, + Vocabulary = propVocabulary.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.FillMaskInferenceOptions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaskToken, value.MaskToken, null, null); + writer.WriteProperty(options, PropNumTopClasses, value.NumTopClasses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); + writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); + writer.WriteProperty(options, PropVocabulary, value.Vocabulary, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FillMaskInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FillMaskInferenceOptions.g.cs index 7a211e3d0c3..b7a07af4de9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FillMaskInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FillMaskInferenceOptions.g.cs @@ -23,87 +23,12 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class FillMaskInferenceOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaskToken = System.Text.Json.JsonEncodedText.Encode("mask_token"); - private static readonly System.Text.Json.JsonEncodedText PropNumTopClasses = System.Text.Json.JsonEncodedText.Encode("num_top_classes"); - private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); - private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); - private static readonly System.Text.Json.JsonEncodedText PropVocabulary = System.Text.Json.JsonEncodedText.Encode("vocabulary"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.FillMaskInferenceOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaskToken = default; - LocalJsonValue propNumTopClasses = default; - LocalJsonValue propResultsField = default; - LocalJsonValue propTokenization = default; - LocalJsonValue propVocabulary = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaskToken.TryReadProperty(ref reader, options, PropMaskToken, null)) - { - continue; - } - - if (propNumTopClasses.TryReadProperty(ref reader, options, PropNumTopClasses, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) - { - continue; - } - - if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) - { - continue; - } - - if (propVocabulary.TryReadProperty(ref reader, options, PropVocabulary, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.FillMaskInferenceOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaskToken = propMaskToken.Value, - NumTopClasses = propNumTopClasses.Value, - ResultsField = propResultsField.Value, - Tokenization = propTokenization.Value, - Vocabulary = propVocabulary.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.FillMaskInferenceOptions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaskToken, value.MaskToken, null, null); - writer.WriteProperty(options, PropNumTopClasses, value.NumTopClasses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); - writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); - writer.WriteProperty(options, PropVocabulary, value.Vocabulary, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Fill mask inference options /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.FillMaskInferenceOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.FillMaskInferenceOptionsConverter))] public sealed partial class FillMaskInferenceOptions { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FillMaskInferenceUpdateOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FillMaskInferenceUpdateOptions.Converters.g.cs new file mode 100644 index 00000000000..6a7a4008452 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FillMaskInferenceUpdateOptions.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class FillMaskInferenceUpdateOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNumTopClasses = System.Text.Json.JsonEncodedText.Encode("num_top_classes"); + private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); + private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.FillMaskInferenceUpdateOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propNumTopClasses = default; + LocalJsonValue propResultsField = default; + LocalJsonValue propTokenization = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNumTopClasses.TryReadProperty(ref reader, options, PropNumTopClasses, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) + { + continue; + } + + if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.FillMaskInferenceUpdateOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + NumTopClasses = propNumTopClasses.Value, + ResultsField = propResultsField.Value, + Tokenization = propTokenization.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.FillMaskInferenceUpdateOptions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNumTopClasses, value.NumTopClasses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); + writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FillMaskInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FillMaskInferenceUpdateOptions.g.cs index 7495768c552..487e691d7e7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FillMaskInferenceUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FillMaskInferenceUpdateOptions.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class FillMaskInferenceUpdateOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNumTopClasses = System.Text.Json.JsonEncodedText.Encode("num_top_classes"); - private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); - private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.FillMaskInferenceUpdateOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propNumTopClasses = default; - LocalJsonValue propResultsField = default; - LocalJsonValue propTokenization = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNumTopClasses.TryReadProperty(ref reader, options, PropNumTopClasses, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) - { - continue; - } - - if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.FillMaskInferenceUpdateOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - NumTopClasses = propNumTopClasses.Value, - ResultsField = propResultsField.Value, - Tokenization = propTokenization.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.FillMaskInferenceUpdateOptions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNumTopClasses, value.NumTopClasses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); - writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.FillMaskInferenceUpdateOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.FillMaskInferenceUpdateOptionsConverter))] public sealed partial class FillMaskInferenceUpdateOptions { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Filter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Filter.Converters.g.cs new file mode 100644 index 00000000000..19bc64b41f1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Filter.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class FilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropFilterId = System.Text.Json.JsonEncodedText.Encode("filter_id"); + private static readonly System.Text.Json.JsonEncodedText PropItems = System.Text.Json.JsonEncodedText.Encode("items"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.Filter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propFilterId = default; + LocalJsonValue> propItems = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propFilterId.TryReadProperty(ref reader, options, PropFilterId, null)) + { + continue; + } + + if (propItems.TryReadProperty(ref reader, options, PropItems, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.Filter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + FilterId = propFilterId.Value, + Items = propItems.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Filter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropFilterId, value.FilterId, null, null); + writer.WriteProperty(options, PropItems, value.Items, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Filter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Filter.g.cs index 2d5356c2422..8c92633fe11 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Filter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Filter.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class FilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropFilterId = System.Text.Json.JsonEncodedText.Encode("filter_id"); - private static readonly System.Text.Json.JsonEncodedText PropItems = System.Text.Json.JsonEncodedText.Encode("items"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.Filter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propFilterId = default; - LocalJsonValue> propItems = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propFilterId.TryReadProperty(ref reader, options, PropFilterId, null)) - { - continue; - } - - if (propItems.TryReadProperty(ref reader, options, PropItems, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.Filter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - FilterId = propFilterId.Value, - Items = propItems.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Filter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropFilterId, value.FilterId, null, null); - writer.WriteProperty(options, PropItems, value.Items, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.FilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.FilterConverter))] public sealed partial class Filter { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FilterRef.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FilterRef.Converters.g.cs new file mode 100644 index 00000000000..370ce8de849 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FilterRef.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class FilterRefConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFilterId = System.Text.Json.JsonEncodedText.Encode("filter_id"); + private static readonly System.Text.Json.JsonEncodedText PropFilterType = System.Text.Json.JsonEncodedText.Encode("filter_type"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.FilterRef Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFilterId = default; + LocalJsonValue propFilterType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFilterId.TryReadProperty(ref reader, options, PropFilterId, null)) + { + continue; + } + + if (propFilterType.TryReadProperty(ref reader, options, PropFilterType, static Elastic.Clients.Elasticsearch.MachineLearning.FilterType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.FilterRef(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FilterId = propFilterId.Value, + FilterType = propFilterType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.FilterRef value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFilterId, value.FilterId, null, null); + writer.WriteProperty(options, PropFilterType, value.FilterType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.MachineLearning.FilterType? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FilterRef.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FilterRef.g.cs index a045392302b..804f43c4c09 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FilterRef.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FilterRef.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class FilterRefConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFilterId = System.Text.Json.JsonEncodedText.Encode("filter_id"); - private static readonly System.Text.Json.JsonEncodedText PropFilterType = System.Text.Json.JsonEncodedText.Encode("filter_type"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.FilterRef Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFilterId = default; - LocalJsonValue propFilterType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFilterId.TryReadProperty(ref reader, options, PropFilterId, null)) - { - continue; - } - - if (propFilterType.TryReadProperty(ref reader, options, PropFilterType, static Elastic.Clients.Elasticsearch.MachineLearning.FilterType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.FilterRef(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FilterId = propFilterId.Value, - FilterType = propFilterType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.FilterRef value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFilterId, value.FilterId, null, null); - writer.WriteProperty(options, PropFilterType, value.FilterType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.MachineLearning.FilterType? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.FilterRefConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.FilterRefConverter))] public sealed partial class FilterRef { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FilterType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FilterType.Converters.g.cs new file mode 100644 index 00000000000..4a2d6947076 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FilterType.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class FilterTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberExclude = System.Text.Json.JsonEncodedText.Encode("exclude"); + private static readonly System.Text.Json.JsonEncodedText MemberInclude = System.Text.Json.JsonEncodedText.Encode("include"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.FilterType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberExclude)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.FilterType.Exclude; + } + + if (reader.ValueTextEquals(MemberInclude)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.FilterType.Include; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberExclude.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.FilterType.Exclude; + } + + if (string.Equals(value, MemberInclude.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.FilterType.Include; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.FilterType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.FilterType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.MachineLearning.FilterType.Exclude: + writer.WriteStringValue(MemberExclude); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.FilterType.Include: + writer.WriteStringValue(MemberInclude); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.FilterType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.MachineLearning.FilterType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.FilterType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FilterType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FilterType.g.cs new file mode 100644 index 00000000000..179a8bb2dfa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FilterType.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.FilterTypeConverter))] +public enum FilterType +{ + [System.Runtime.Serialization.EnumMember(Value = "exclude")] + Exclude, + [System.Runtime.Serialization.EnumMember(Value = "include")] + Include +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FrequencyEncodingPreprocessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FrequencyEncodingPreprocessor.Converters.g.cs new file mode 100644 index 00000000000..8aeae4e9bd5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FrequencyEncodingPreprocessor.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class FrequencyEncodingPreprocessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFeatureName = System.Text.Json.JsonEncodedText.Encode("feature_name"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFrequencyMap = System.Text.Json.JsonEncodedText.Encode("frequency_map"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.FrequencyEncodingPreprocessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFeatureName = default; + LocalJsonValue propField = default; + LocalJsonValue> propFrequencyMap = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFeatureName.TryReadProperty(ref reader, options, PropFeatureName, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFrequencyMap.TryReadProperty(ref reader, options, PropFrequencyMap, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.FrequencyEncodingPreprocessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FeatureName = propFeatureName.Value, + Field = propField.Value, + FrequencyMap = propFrequencyMap.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.FrequencyEncodingPreprocessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFeatureName, value.FeatureName, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFrequencyMap, value.FrequencyMap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FrequencyEncodingPreprocessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FrequencyEncodingPreprocessor.g.cs index 75dbd6e9f1a..57ad205c3df 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FrequencyEncodingPreprocessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/FrequencyEncodingPreprocessor.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class FrequencyEncodingPreprocessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFeatureName = System.Text.Json.JsonEncodedText.Encode("feature_name"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFrequencyMap = System.Text.Json.JsonEncodedText.Encode("frequency_map"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.FrequencyEncodingPreprocessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFeatureName = default; - LocalJsonValue propField = default; - LocalJsonValue> propFrequencyMap = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFeatureName.TryReadProperty(ref reader, options, PropFeatureName, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFrequencyMap.TryReadProperty(ref reader, options, PropFrequencyMap, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.FrequencyEncodingPreprocessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FeatureName = propFeatureName.Value, - Field = propField.Value, - FrequencyMap = propFrequencyMap.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.FrequencyEncodingPreprocessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFeatureName, value.FeatureName, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFrequencyMap, value.FrequencyMap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.FrequencyEncodingPreprocessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.FrequencyEncodingPreprocessorConverter))] public sealed partial class FrequencyEncodingPreprocessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/GeoResults.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/GeoResults.Converters.g.cs new file mode 100644 index 00000000000..1516b4febb3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/GeoResults.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class GeoResultsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropActualPoint = System.Text.Json.JsonEncodedText.Encode("actual_point"); + private static readonly System.Text.Json.JsonEncodedText PropTypicalPoint = System.Text.Json.JsonEncodedText.Encode("typical_point"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.GeoResults Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propActualPoint = default; + LocalJsonValue propTypicalPoint = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propActualPoint.TryReadProperty(ref reader, options, PropActualPoint, null)) + { + continue; + } + + if (propTypicalPoint.TryReadProperty(ref reader, options, PropTypicalPoint, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.GeoResults(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ActualPoint = propActualPoint.Value, + TypicalPoint = propTypicalPoint.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GeoResults value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropActualPoint, value.ActualPoint, null, null); + writer.WriteProperty(options, PropTypicalPoint, value.TypicalPoint, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/GeoResults.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/GeoResults.g.cs index 653e1e38b13..b939c214adf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/GeoResults.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/GeoResults.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class GeoResultsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropActualPoint = System.Text.Json.JsonEncodedText.Encode("actual_point"); - private static readonly System.Text.Json.JsonEncodedText PropTypicalPoint = System.Text.Json.JsonEncodedText.Encode("typical_point"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.GeoResults Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propActualPoint = default; - LocalJsonValue propTypicalPoint = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propActualPoint.TryReadProperty(ref reader, options, PropActualPoint, null)) - { - continue; - } - - if (propTypicalPoint.TryReadProperty(ref reader, options, PropTypicalPoint, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.GeoResults(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ActualPoint = propActualPoint.Value, - TypicalPoint = propTypicalPoint.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.GeoResults value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropActualPoint, value.ActualPoint, null, null); - writer.WriteProperty(options, PropTypicalPoint, value.TypicalPoint, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.GeoResultsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.GeoResultsConverter))] public sealed partial class GeoResults { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Hyperparameter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Hyperparameter.Converters.g.cs new file mode 100644 index 00000000000..26c336a911f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Hyperparameter.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class HyperparameterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAbsoluteImportance = System.Text.Json.JsonEncodedText.Encode("absolute_importance"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropRelativeImportance = System.Text.Json.JsonEncodedText.Encode("relative_importance"); + private static readonly System.Text.Json.JsonEncodedText PropSupplied = System.Text.Json.JsonEncodedText.Encode("supplied"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.Hyperparameter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAbsoluteImportance = default; + LocalJsonValue propName = default; + LocalJsonValue propRelativeImportance = default; + LocalJsonValue propSupplied = default; + LocalJsonValue propValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAbsoluteImportance.TryReadProperty(ref reader, options, PropAbsoluteImportance, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propRelativeImportance.TryReadProperty(ref reader, options, PropRelativeImportance, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSupplied.TryReadProperty(ref reader, options, PropSupplied, null)) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.Hyperparameter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AbsoluteImportance = propAbsoluteImportance.Value, + Name = propName.Value, + RelativeImportance = propRelativeImportance.Value, + Supplied = propSupplied.Value, + Value = propValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Hyperparameter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAbsoluteImportance, value.AbsoluteImportance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropRelativeImportance, value.RelativeImportance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSupplied, value.Supplied, null, null); + writer.WriteProperty(options, PropValue, value.Value, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Hyperparameter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Hyperparameter.g.cs index 893ec048cd7..c2c5d95d815 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Hyperparameter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Hyperparameter.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class HyperparameterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAbsoluteImportance = System.Text.Json.JsonEncodedText.Encode("absolute_importance"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropRelativeImportance = System.Text.Json.JsonEncodedText.Encode("relative_importance"); - private static readonly System.Text.Json.JsonEncodedText PropSupplied = System.Text.Json.JsonEncodedText.Encode("supplied"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.Hyperparameter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAbsoluteImportance = default; - LocalJsonValue propName = default; - LocalJsonValue propRelativeImportance = default; - LocalJsonValue propSupplied = default; - LocalJsonValue propValue = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAbsoluteImportance.TryReadProperty(ref reader, options, PropAbsoluteImportance, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propRelativeImportance.TryReadProperty(ref reader, options, PropRelativeImportance, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSupplied.TryReadProperty(ref reader, options, PropSupplied, null)) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.Hyperparameter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AbsoluteImportance = propAbsoluteImportance.Value, - Name = propName.Value, - RelativeImportance = propRelativeImportance.Value, - Supplied = propSupplied.Value, - Value = propValue.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Hyperparameter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAbsoluteImportance, value.AbsoluteImportance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropRelativeImportance, value.RelativeImportance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSupplied, value.Supplied, null, null); - writer.WriteProperty(options, PropValue, value.Value, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.HyperparameterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.HyperparameterConverter))] public sealed partial class Hyperparameter { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Include.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Include.Converters.g.cs new file mode 100644 index 00000000000..2bd47b568c9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Include.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class IncludeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberDefinition = System.Text.Json.JsonEncodedText.Encode("definition"); + private static readonly System.Text.Json.JsonEncodedText MemberDefinitionStatus = System.Text.Json.JsonEncodedText.Encode("definition_status"); + private static readonly System.Text.Json.JsonEncodedText MemberFeatureImportanceBaseline = System.Text.Json.JsonEncodedText.Encode("feature_importance_baseline"); + private static readonly System.Text.Json.JsonEncodedText MemberHyperparameters = System.Text.Json.JsonEncodedText.Encode("hyperparameters"); + private static readonly System.Text.Json.JsonEncodedText MemberTotalFeatureImportance = System.Text.Json.JsonEncodedText.Encode("total_feature_importance"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.Include Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberDefinition)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.Include.Definition; + } + + if (reader.ValueTextEquals(MemberDefinitionStatus)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.Include.DefinitionStatus; + } + + if (reader.ValueTextEquals(MemberFeatureImportanceBaseline)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.Include.FeatureImportanceBaseline; + } + + if (reader.ValueTextEquals(MemberHyperparameters)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.Include.Hyperparameters; + } + + if (reader.ValueTextEquals(MemberTotalFeatureImportance)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.Include.TotalFeatureImportance; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberDefinition.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.Include.Definition; + } + + if (string.Equals(value, MemberDefinitionStatus.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.Include.DefinitionStatus; + } + + if (string.Equals(value, MemberFeatureImportanceBaseline.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.Include.FeatureImportanceBaseline; + } + + if (string.Equals(value, MemberHyperparameters.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.Include.Hyperparameters; + } + + if (string.Equals(value, MemberTotalFeatureImportance.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.Include.TotalFeatureImportance; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.Include)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Include value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.MachineLearning.Include.Definition: + writer.WriteStringValue(MemberDefinition); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.Include.DefinitionStatus: + writer.WriteStringValue(MemberDefinitionStatus); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.Include.FeatureImportanceBaseline: + writer.WriteStringValue(MemberFeatureImportanceBaseline); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.Include.Hyperparameters: + writer.WriteStringValue(MemberHyperparameters); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.Include.TotalFeatureImportance: + writer.WriteStringValue(MemberTotalFeatureImportance); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.Include)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.MachineLearning.Include ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Include value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Include.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Include.g.cs new file mode 100644 index 00000000000..0920a9c059e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Include.g.cs @@ -0,0 +1,69 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.IncludeConverter))] +public enum Include +{ + /// + /// + /// Includes the model definition. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "definition")] + Definition, + /// + /// + /// Includes the model definition status. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "definition_status")] + DefinitionStatus, + /// + /// + /// Includes the baseline for feature importance values. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "feature_importance_baseline")] + FeatureImportanceBaseline, + /// + /// + /// Includes the information about hyperparameters used to train the model. + /// This information consists of the value, the absolute and relative + /// importance of the hyperparameter as well as an indicator of whether it was + /// specified by the user or tuned during hyperparameter optimization. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "hyperparameters")] + Hyperparameters, + /// + /// + /// Includes the total feature importance for the training data set. The + /// baseline and total feature importance values are returned in the metadata + /// field in the response body. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "total_feature_importance")] + TotalFeatureImportance +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceConfigCreate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceConfigCreate.Converters.g.cs new file mode 100644 index 00000000000..7f2d953c075 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceConfigCreate.Converters.g.cs @@ -0,0 +1,198 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class InferenceConfigCreateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantClassification = System.Text.Json.JsonEncodedText.Encode("classification"); + private static readonly System.Text.Json.JsonEncodedText VariantFillMask = System.Text.Json.JsonEncodedText.Encode("fill_mask"); + private static readonly System.Text.Json.JsonEncodedText VariantLearningToRank = System.Text.Json.JsonEncodedText.Encode("learning_to_rank"); + private static readonly System.Text.Json.JsonEncodedText VariantNer = System.Text.Json.JsonEncodedText.Encode("ner"); + private static readonly System.Text.Json.JsonEncodedText VariantPassThrough = System.Text.Json.JsonEncodedText.Encode("pass_through"); + private static readonly System.Text.Json.JsonEncodedText VariantQuestionAnswering = System.Text.Json.JsonEncodedText.Encode("question_answering"); + private static readonly System.Text.Json.JsonEncodedText VariantRegression = System.Text.Json.JsonEncodedText.Encode("regression"); + private static readonly System.Text.Json.JsonEncodedText VariantTextClassification = System.Text.Json.JsonEncodedText.Encode("text_classification"); + private static readonly System.Text.Json.JsonEncodedText VariantTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + private static readonly System.Text.Json.JsonEncodedText VariantTextExpansion = System.Text.Json.JsonEncodedText.Encode("text_expansion"); + private static readonly System.Text.Json.JsonEncodedText VariantZeroShotClassification = System.Text.Json.JsonEncodedText.Encode("zero_shot_classification"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantClassification)) + { + variantType = VariantClassification.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantFillMask)) + { + variantType = VariantFillMask.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantLearningToRank)) + { + variantType = VariantLearningToRank.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantNer)) + { + variantType = VariantNer.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantPassThrough)) + { + variantType = VariantPassThrough.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantQuestionAnswering)) + { + variantType = VariantQuestionAnswering.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRegression)) + { + variantType = VariantRegression.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTextClassification)) + { + variantType = VariantTextClassification.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTextEmbedding)) + { + variantType = VariantTextEmbedding.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTextExpansion)) + { + variantType = VariantTextExpansion.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantZeroShotClassification)) + { + variantType = VariantZeroShotClassification.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "classification": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.ClassificationInferenceOptions)value.Variant, null, null); + break; + case "fill_mask": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.FillMaskInferenceOptions)value.Variant, null, null); + break; + case "learning_to_rank": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.LearningToRankConfig)value.Variant, null, null); + break; + case "ner": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.NerInferenceOptions)value.Variant, null, null); + break; + case "pass_through": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.PassThroughInferenceOptions)value.Variant, null, null); + break; + case "question_answering": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.QuestionAnsweringInferenceOptions)value.Variant, null, null); + break; + case "regression": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.RegressionInferenceOptions)value.Variant, null, null); + break; + case "text_classification": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.TextClassificationInferenceOptions)value.Variant, null, null); + break; + case "text_embedding": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.TextEmbeddingInferenceOptions)value.Variant, null, null); + break; + case "text_expansion": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.TextExpansionInferenceOptions)value.Variant, null, null); + break; + case "zero_shot_classification": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.ZeroShotClassificationInferenceOptions)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceConfigCreate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceConfigCreate.g.cs index a5ee7c1bd46..bf2d913e43d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceConfigCreate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceConfigCreate.g.cs @@ -23,181 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class InferenceConfigCreateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantClassification = System.Text.Json.JsonEncodedText.Encode("classification"); - private static readonly System.Text.Json.JsonEncodedText VariantFillMask = System.Text.Json.JsonEncodedText.Encode("fill_mask"); - private static readonly System.Text.Json.JsonEncodedText VariantLearningToRank = System.Text.Json.JsonEncodedText.Encode("learning_to_rank"); - private static readonly System.Text.Json.JsonEncodedText VariantNer = System.Text.Json.JsonEncodedText.Encode("ner"); - private static readonly System.Text.Json.JsonEncodedText VariantPassThrough = System.Text.Json.JsonEncodedText.Encode("pass_through"); - private static readonly System.Text.Json.JsonEncodedText VariantQuestionAnswering = System.Text.Json.JsonEncodedText.Encode("question_answering"); - private static readonly System.Text.Json.JsonEncodedText VariantRegression = System.Text.Json.JsonEncodedText.Encode("regression"); - private static readonly System.Text.Json.JsonEncodedText VariantTextClassification = System.Text.Json.JsonEncodedText.Encode("text_classification"); - private static readonly System.Text.Json.JsonEncodedText VariantTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - private static readonly System.Text.Json.JsonEncodedText VariantTextExpansion = System.Text.Json.JsonEncodedText.Encode("text_expansion"); - private static readonly System.Text.Json.JsonEncodedText VariantZeroShotClassification = System.Text.Json.JsonEncodedText.Encode("zero_shot_classification"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantClassification)) - { - variantType = VariantClassification.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantFillMask)) - { - variantType = VariantFillMask.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantLearningToRank)) - { - variantType = VariantLearningToRank.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantNer)) - { - variantType = VariantNer.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantPassThrough)) - { - variantType = VariantPassThrough.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantQuestionAnswering)) - { - variantType = VariantQuestionAnswering.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRegression)) - { - variantType = VariantRegression.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTextClassification)) - { - variantType = VariantTextClassification.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTextEmbedding)) - { - variantType = VariantTextEmbedding.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTextExpansion)) - { - variantType = VariantTextExpansion.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantZeroShotClassification)) - { - variantType = VariantZeroShotClassification.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "classification": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.ClassificationInferenceOptions)value.Variant, null, null); - break; - case "fill_mask": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.FillMaskInferenceOptions)value.Variant, null, null); - break; - case "learning_to_rank": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.LearningToRankConfig)value.Variant, null, null); - break; - case "ner": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.NerInferenceOptions)value.Variant, null, null); - break; - case "pass_through": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.PassThroughInferenceOptions)value.Variant, null, null); - break; - case "question_answering": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.QuestionAnsweringInferenceOptions)value.Variant, null, null); - break; - case "regression": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.RegressionInferenceOptions)value.Variant, null, null); - break; - case "text_classification": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.TextClassificationInferenceOptions)value.Variant, null, null); - break; - case "text_embedding": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.TextEmbeddingInferenceOptions)value.Variant, null, null); - break; - case "text_expansion": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.TextExpansionInferenceOptions)value.Variant, null, null); - break; - case "zero_shot_classification": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.ZeroShotClassificationInferenceOptions)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreate)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigCreateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.InferenceConfigCreateConverter))] public sealed partial class InferenceConfigCreate { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceConfigUpdate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceConfigUpdate.Converters.g.cs new file mode 100644 index 00000000000..c5b79518ef0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceConfigUpdate.Converters.g.cs @@ -0,0 +1,186 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class InferenceConfigUpdateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantClassification = System.Text.Json.JsonEncodedText.Encode("classification"); + private static readonly System.Text.Json.JsonEncodedText VariantFillMask = System.Text.Json.JsonEncodedText.Encode("fill_mask"); + private static readonly System.Text.Json.JsonEncodedText VariantNer = System.Text.Json.JsonEncodedText.Encode("ner"); + private static readonly System.Text.Json.JsonEncodedText VariantPassThrough = System.Text.Json.JsonEncodedText.Encode("pass_through"); + private static readonly System.Text.Json.JsonEncodedText VariantQuestionAnswering = System.Text.Json.JsonEncodedText.Encode("question_answering"); + private static readonly System.Text.Json.JsonEncodedText VariantRegression = System.Text.Json.JsonEncodedText.Encode("regression"); + private static readonly System.Text.Json.JsonEncodedText VariantTextClassification = System.Text.Json.JsonEncodedText.Encode("text_classification"); + private static readonly System.Text.Json.JsonEncodedText VariantTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + private static readonly System.Text.Json.JsonEncodedText VariantTextExpansion = System.Text.Json.JsonEncodedText.Encode("text_expansion"); + private static readonly System.Text.Json.JsonEncodedText VariantZeroShotClassification = System.Text.Json.JsonEncodedText.Encode("zero_shot_classification"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantClassification)) + { + variantType = VariantClassification.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantFillMask)) + { + variantType = VariantFillMask.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantNer)) + { + variantType = VariantNer.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantPassThrough)) + { + variantType = VariantPassThrough.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantQuestionAnswering)) + { + variantType = VariantQuestionAnswering.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRegression)) + { + variantType = VariantRegression.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTextClassification)) + { + variantType = VariantTextClassification.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTextEmbedding)) + { + variantType = VariantTextEmbedding.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTextExpansion)) + { + variantType = VariantTextExpansion.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantZeroShotClassification)) + { + variantType = VariantZeroShotClassification.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "classification": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.ClassificationInferenceOptions)value.Variant, null, null); + break; + case "fill_mask": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.FillMaskInferenceUpdateOptions)value.Variant, null, null); + break; + case "ner": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.NerInferenceUpdateOptions)value.Variant, null, null); + break; + case "pass_through": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.PassThroughInferenceUpdateOptions)value.Variant, null, null); + break; + case "question_answering": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.QuestionAnsweringInferenceUpdateOptions)value.Variant, null, null); + break; + case "regression": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.RegressionInferenceOptions)value.Variant, null, null); + break; + case "text_classification": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.TextClassificationInferenceUpdateOptions)value.Variant, null, null); + break; + case "text_embedding": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.TextEmbeddingInferenceUpdateOptions)value.Variant, null, null); + break; + case "text_expansion": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.TextExpansionInferenceUpdateOptions)value.Variant, null, null); + break; + case "zero_shot_classification": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.ZeroShotClassificationInferenceUpdateOptions)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceConfigUpdate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceConfigUpdate.g.cs index 5540d0cfc3c..fa816b61c56 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceConfigUpdate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceConfigUpdate.g.cs @@ -23,169 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class InferenceConfigUpdateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantClassification = System.Text.Json.JsonEncodedText.Encode("classification"); - private static readonly System.Text.Json.JsonEncodedText VariantFillMask = System.Text.Json.JsonEncodedText.Encode("fill_mask"); - private static readonly System.Text.Json.JsonEncodedText VariantNer = System.Text.Json.JsonEncodedText.Encode("ner"); - private static readonly System.Text.Json.JsonEncodedText VariantPassThrough = System.Text.Json.JsonEncodedText.Encode("pass_through"); - private static readonly System.Text.Json.JsonEncodedText VariantQuestionAnswering = System.Text.Json.JsonEncodedText.Encode("question_answering"); - private static readonly System.Text.Json.JsonEncodedText VariantRegression = System.Text.Json.JsonEncodedText.Encode("regression"); - private static readonly System.Text.Json.JsonEncodedText VariantTextClassification = System.Text.Json.JsonEncodedText.Encode("text_classification"); - private static readonly System.Text.Json.JsonEncodedText VariantTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - private static readonly System.Text.Json.JsonEncodedText VariantTextExpansion = System.Text.Json.JsonEncodedText.Encode("text_expansion"); - private static readonly System.Text.Json.JsonEncodedText VariantZeroShotClassification = System.Text.Json.JsonEncodedText.Encode("zero_shot_classification"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantClassification)) - { - variantType = VariantClassification.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantFillMask)) - { - variantType = VariantFillMask.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantNer)) - { - variantType = VariantNer.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantPassThrough)) - { - variantType = VariantPassThrough.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantQuestionAnswering)) - { - variantType = VariantQuestionAnswering.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRegression)) - { - variantType = VariantRegression.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTextClassification)) - { - variantType = VariantTextClassification.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTextEmbedding)) - { - variantType = VariantTextEmbedding.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTextExpansion)) - { - variantType = VariantTextExpansion.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantZeroShotClassification)) - { - variantType = VariantZeroShotClassification.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "classification": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.ClassificationInferenceOptions)value.Variant, null, null); - break; - case "fill_mask": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.FillMaskInferenceUpdateOptions)value.Variant, null, null); - break; - case "ner": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.NerInferenceUpdateOptions)value.Variant, null, null); - break; - case "pass_through": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.PassThroughInferenceUpdateOptions)value.Variant, null, null); - break; - case "question_answering": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.QuestionAnsweringInferenceUpdateOptions)value.Variant, null, null); - break; - case "regression": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.RegressionInferenceOptions)value.Variant, null, null); - break; - case "text_classification": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.TextClassificationInferenceUpdateOptions)value.Variant, null, null); - break; - case "text_embedding": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.TextEmbeddingInferenceUpdateOptions)value.Variant, null, null); - break; - case "text_expansion": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.TextExpansionInferenceUpdateOptions)value.Variant, null, null); - break; - case "zero_shot_classification": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.ZeroShotClassificationInferenceUpdateOptions)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdate)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.InferenceConfigUpdateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.InferenceConfigUpdateConverter))] public sealed partial class InferenceConfigUpdate { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceResponseResult.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceResponseResult.Converters.g.cs new file mode 100644 index 00000000000..4dba8f2950e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceResponseResult.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class InferenceResponseResultConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEntities = System.Text.Json.JsonEncodedText.Encode("entities"); + private static readonly System.Text.Json.JsonEncodedText PropFeatureImportance = System.Text.Json.JsonEncodedText.Encode("feature_importance"); + private static readonly System.Text.Json.JsonEncodedText PropIsTruncated = System.Text.Json.JsonEncodedText.Encode("is_truncated"); + private static readonly System.Text.Json.JsonEncodedText PropPredictedValue = System.Text.Json.JsonEncodedText.Encode("predicted_value"); + private static readonly System.Text.Json.JsonEncodedText PropPredictedValueSequence = System.Text.Json.JsonEncodedText.Encode("predicted_value_sequence"); + private static readonly System.Text.Json.JsonEncodedText PropPredictionProbability = System.Text.Json.JsonEncodedText.Encode("prediction_probability"); + private static readonly System.Text.Json.JsonEncodedText PropPredictionScore = System.Text.Json.JsonEncodedText.Encode("prediction_score"); + private static readonly System.Text.Json.JsonEncodedText PropTopClasses = System.Text.Json.JsonEncodedText.Encode("top_classes"); + private static readonly System.Text.Json.JsonEncodedText PropWarning = System.Text.Json.JsonEncodedText.Encode("warning"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.InferenceResponseResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propEntities = default; + LocalJsonValue?> propFeatureImportance = default; + LocalJsonValue propIsTruncated = default; + LocalJsonValue>?> propPredictedValue = default; + LocalJsonValue propPredictedValueSequence = default; + LocalJsonValue propPredictionProbability = default; + LocalJsonValue propPredictionScore = default; + LocalJsonValue?> propTopClasses = default; + LocalJsonValue propWarning = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEntities.TryReadProperty(ref reader, options, PropEntities, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propFeatureImportance.TryReadProperty(ref reader, options, PropFeatureImportance, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propIsTruncated.TryReadProperty(ref reader, options, PropIsTruncated, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPredictedValue.TryReadProperty(ref reader, options, PropPredictedValue, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue>(o, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!))) + { + continue; + } + + if (propPredictedValueSequence.TryReadProperty(ref reader, options, PropPredictedValueSequence, null)) + { + continue; + } + + if (propPredictionProbability.TryReadProperty(ref reader, options, PropPredictionProbability, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPredictionScore.TryReadProperty(ref reader, options, PropPredictionScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTopClasses.TryReadProperty(ref reader, options, PropTopClasses, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propWarning.TryReadProperty(ref reader, options, PropWarning, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.InferenceResponseResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Entities = propEntities.Value, + FeatureImportance = propFeatureImportance.Value, + IsTruncated = propIsTruncated.Value, + PredictedValue = propPredictedValue.Value, + PredictedValueSequence = propPredictedValueSequence.Value, + PredictionProbability = propPredictionProbability.Value, + PredictionScore = propPredictionScore.Value, + TopClasses = propTopClasses.Value, + Warning = propWarning.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.InferenceResponseResult value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEntities, value.Entities, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFeatureImportance, value.FeatureImportance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIsTruncated, value.IsTruncated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPredictedValue, value.PredictedValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteSingleOrManyCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); + writer.WriteProperty(options, PropPredictedValueSequence, value.PredictedValueSequence, null, null); + writer.WriteProperty(options, PropPredictionProbability, value.PredictionProbability, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPredictionScore, value.PredictionScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTopClasses, value.TopClasses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropWarning, value.Warning, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceResponseResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceResponseResult.g.cs index 1a48dfb655d..920558c662e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceResponseResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/InferenceResponseResult.g.cs @@ -23,118 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class InferenceResponseResultConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEntities = System.Text.Json.JsonEncodedText.Encode("entities"); - private static readonly System.Text.Json.JsonEncodedText PropFeatureImportance = System.Text.Json.JsonEncodedText.Encode("feature_importance"); - private static readonly System.Text.Json.JsonEncodedText PropIsTruncated = System.Text.Json.JsonEncodedText.Encode("is_truncated"); - private static readonly System.Text.Json.JsonEncodedText PropPredictedValue = System.Text.Json.JsonEncodedText.Encode("predicted_value"); - private static readonly System.Text.Json.JsonEncodedText PropPredictedValueSequence = System.Text.Json.JsonEncodedText.Encode("predicted_value_sequence"); - private static readonly System.Text.Json.JsonEncodedText PropPredictionProbability = System.Text.Json.JsonEncodedText.Encode("prediction_probability"); - private static readonly System.Text.Json.JsonEncodedText PropPredictionScore = System.Text.Json.JsonEncodedText.Encode("prediction_score"); - private static readonly System.Text.Json.JsonEncodedText PropTopClasses = System.Text.Json.JsonEncodedText.Encode("top_classes"); - private static readonly System.Text.Json.JsonEncodedText PropWarning = System.Text.Json.JsonEncodedText.Encode("warning"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.InferenceResponseResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propEntities = default; - LocalJsonValue?> propFeatureImportance = default; - LocalJsonValue propIsTruncated = default; - LocalJsonValue>?> propPredictedValue = default; - LocalJsonValue propPredictedValueSequence = default; - LocalJsonValue propPredictionProbability = default; - LocalJsonValue propPredictionScore = default; - LocalJsonValue?> propTopClasses = default; - LocalJsonValue propWarning = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEntities.TryReadProperty(ref reader, options, PropEntities, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propFeatureImportance.TryReadProperty(ref reader, options, PropFeatureImportance, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propIsTruncated.TryReadProperty(ref reader, options, PropIsTruncated, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPredictedValue.TryReadProperty(ref reader, options, PropPredictedValue, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue>(o, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!))) - { - continue; - } - - if (propPredictedValueSequence.TryReadProperty(ref reader, options, PropPredictedValueSequence, null)) - { - continue; - } - - if (propPredictionProbability.TryReadProperty(ref reader, options, PropPredictionProbability, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPredictionScore.TryReadProperty(ref reader, options, PropPredictionScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTopClasses.TryReadProperty(ref reader, options, PropTopClasses, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propWarning.TryReadProperty(ref reader, options, PropWarning, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.InferenceResponseResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Entities = propEntities.Value, - FeatureImportance = propFeatureImportance.Value, - IsTruncated = propIsTruncated.Value, - PredictedValue = propPredictedValue.Value, - PredictedValueSequence = propPredictedValueSequence.Value, - PredictionProbability = propPredictionProbability.Value, - PredictionScore = propPredictionScore.Value, - TopClasses = propTopClasses.Value, - Warning = propWarning.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.InferenceResponseResult value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEntities, value.Entities, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFeatureImportance, value.FeatureImportance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIsTruncated, value.IsTruncated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPredictedValue, value.PredictedValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteSingleOrManyCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); - writer.WriteProperty(options, PropPredictedValueSequence, value.PredictedValueSequence, null, null); - writer.WriteProperty(options, PropPredictionProbability, value.PredictionProbability, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPredictionScore, value.PredictionScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTopClasses, value.TopClasses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropWarning, value.Warning, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.InferenceResponseResultConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.InferenceResponseResultConverter))] public sealed partial class InferenceResponseResult { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Influence.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Influence.Converters.g.cs new file mode 100644 index 00000000000..9f33a850811 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Influence.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class InfluenceConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropInfluencerFieldName = System.Text.Json.JsonEncodedText.Encode("influencer_field_name"); + private static readonly System.Text.Json.JsonEncodedText PropInfluencerFieldValues = System.Text.Json.JsonEncodedText.Encode("influencer_field_values"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.Influence Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propInfluencerFieldName = default; + LocalJsonValue> propInfluencerFieldValues = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propInfluencerFieldName.TryReadProperty(ref reader, options, PropInfluencerFieldName, null)) + { + continue; + } + + if (propInfluencerFieldValues.TryReadProperty(ref reader, options, PropInfluencerFieldValues, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.Influence(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + InfluencerFieldName = propInfluencerFieldName.Value, + InfluencerFieldValues = propInfluencerFieldValues.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Influence value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropInfluencerFieldName, value.InfluencerFieldName, null, null); + writer.WriteProperty(options, PropInfluencerFieldValues, value.InfluencerFieldValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Influence.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Influence.g.cs index ea78fee2a7f..52f1caf2e95 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Influence.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Influence.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class InfluenceConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropInfluencerFieldName = System.Text.Json.JsonEncodedText.Encode("influencer_field_name"); - private static readonly System.Text.Json.JsonEncodedText PropInfluencerFieldValues = System.Text.Json.JsonEncodedText.Encode("influencer_field_values"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.Influence Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propInfluencerFieldName = default; - LocalJsonValue> propInfluencerFieldValues = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propInfluencerFieldName.TryReadProperty(ref reader, options, PropInfluencerFieldName, null)) - { - continue; - } - - if (propInfluencerFieldValues.TryReadProperty(ref reader, options, PropInfluencerFieldValues, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.Influence(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - InfluencerFieldName = propInfluencerFieldName.Value, - InfluencerFieldValues = propInfluencerFieldValues.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Influence value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropInfluencerFieldName, value.InfluencerFieldName, null, null); - writer.WriteProperty(options, PropInfluencerFieldValues, value.InfluencerFieldValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.InfluenceConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.InfluenceConverter))] public sealed partial class Influence { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Influencer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Influencer.Converters.g.cs new file mode 100644 index 00000000000..d1420d41b9b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Influencer.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class InfluencerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucketSpan = System.Text.Json.JsonEncodedText.Encode("bucket_span"); + private static readonly System.Text.Json.JsonEncodedText PropFoo = System.Text.Json.JsonEncodedText.Encode("foo"); + private static readonly System.Text.Json.JsonEncodedText PropInfluencerFieldName = System.Text.Json.JsonEncodedText.Encode("influencer_field_name"); + private static readonly System.Text.Json.JsonEncodedText PropInfluencerFieldValue = System.Text.Json.JsonEncodedText.Encode("influencer_field_value"); + private static readonly System.Text.Json.JsonEncodedText PropInfluencerScore = System.Text.Json.JsonEncodedText.Encode("influencer_score"); + private static readonly System.Text.Json.JsonEncodedText PropInitialInfluencerScore = System.Text.Json.JsonEncodedText.Encode("initial_influencer_score"); + private static readonly System.Text.Json.JsonEncodedText PropIsInterim = System.Text.Json.JsonEncodedText.Encode("is_interim"); + private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); + private static readonly System.Text.Json.JsonEncodedText PropProbability = System.Text.Json.JsonEncodedText.Encode("probability"); + private static readonly System.Text.Json.JsonEncodedText PropResultType = System.Text.Json.JsonEncodedText.Encode("result_type"); + private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.Influencer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucketSpan = default; + LocalJsonValue propFoo = default; + LocalJsonValue propInfluencerFieldName = default; + LocalJsonValue propInfluencerFieldValue = default; + LocalJsonValue propInfluencerScore = default; + LocalJsonValue propInitialInfluencerScore = default; + LocalJsonValue propIsInterim = default; + LocalJsonValue propJobId = default; + LocalJsonValue propProbability = default; + LocalJsonValue propResultType = default; + LocalJsonValue propTimestamp = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucketSpan.TryReadProperty(ref reader, options, PropBucketSpan, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanSecondsMarker)))) + { + continue; + } + + if (propFoo.TryReadProperty(ref reader, options, PropFoo, null)) + { + continue; + } + + if (propInfluencerFieldName.TryReadProperty(ref reader, options, PropInfluencerFieldName, null)) + { + continue; + } + + if (propInfluencerFieldValue.TryReadProperty(ref reader, options, PropInfluencerFieldValue, null)) + { + continue; + } + + if (propInfluencerScore.TryReadProperty(ref reader, options, PropInfluencerScore, null)) + { + continue; + } + + if (propInitialInfluencerScore.TryReadProperty(ref reader, options, PropInitialInfluencerScore, null)) + { + continue; + } + + if (propIsInterim.TryReadProperty(ref reader, options, PropIsInterim, null)) + { + continue; + } + + if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) + { + continue; + } + + if (propProbability.TryReadProperty(ref reader, options, PropProbability, null)) + { + continue; + } + + if (propResultType.TryReadProperty(ref reader, options, PropResultType, null)) + { + continue; + } + + if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.Influencer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BucketSpan = propBucketSpan.Value, + Foo = propFoo.Value, + InfluencerFieldName = propInfluencerFieldName.Value, + InfluencerFieldValue = propInfluencerFieldValue.Value, + InfluencerScore = propInfluencerScore.Value, + InitialInfluencerScore = propInitialInfluencerScore.Value, + IsInterim = propIsInterim.Value, + JobId = propJobId.Value, + Probability = propProbability.Value, + ResultType = propResultType.Value, + Timestamp = propTimestamp.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Influencer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucketSpan, value.BucketSpan, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanSecondsMarker))); + writer.WriteProperty(options, PropFoo, value.Foo, null, null); + writer.WriteProperty(options, PropInfluencerFieldName, value.InfluencerFieldName, null, null); + writer.WriteProperty(options, PropInfluencerFieldValue, value.InfluencerFieldValue, null, null); + writer.WriteProperty(options, PropInfluencerScore, value.InfluencerScore, null, null); + writer.WriteProperty(options, PropInitialInfluencerScore, value.InitialInfluencerScore, null, null); + writer.WriteProperty(options, PropIsInterim, value.IsInterim, null, null); + writer.WriteProperty(options, PropJobId, value.JobId, null, null); + writer.WriteProperty(options, PropProbability, value.Probability, null, null); + writer.WriteProperty(options, PropResultType, value.ResultType, null, null); + writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Influencer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Influencer.g.cs index 6974ec97aaf..76e61101f37 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Influencer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Influencer.g.cs @@ -23,136 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class InfluencerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBucketSpan = System.Text.Json.JsonEncodedText.Encode("bucket_span"); - private static readonly System.Text.Json.JsonEncodedText PropFoo = System.Text.Json.JsonEncodedText.Encode("foo"); - private static readonly System.Text.Json.JsonEncodedText PropInfluencerFieldName = System.Text.Json.JsonEncodedText.Encode("influencer_field_name"); - private static readonly System.Text.Json.JsonEncodedText PropInfluencerFieldValue = System.Text.Json.JsonEncodedText.Encode("influencer_field_value"); - private static readonly System.Text.Json.JsonEncodedText PropInfluencerScore = System.Text.Json.JsonEncodedText.Encode("influencer_score"); - private static readonly System.Text.Json.JsonEncodedText PropInitialInfluencerScore = System.Text.Json.JsonEncodedText.Encode("initial_influencer_score"); - private static readonly System.Text.Json.JsonEncodedText PropIsInterim = System.Text.Json.JsonEncodedText.Encode("is_interim"); - private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); - private static readonly System.Text.Json.JsonEncodedText PropProbability = System.Text.Json.JsonEncodedText.Encode("probability"); - private static readonly System.Text.Json.JsonEncodedText PropResultType = System.Text.Json.JsonEncodedText.Encode("result_type"); - private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.Influencer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBucketSpan = default; - LocalJsonValue propFoo = default; - LocalJsonValue propInfluencerFieldName = default; - LocalJsonValue propInfluencerFieldValue = default; - LocalJsonValue propInfluencerScore = default; - LocalJsonValue propInitialInfluencerScore = default; - LocalJsonValue propIsInterim = default; - LocalJsonValue propJobId = default; - LocalJsonValue propProbability = default; - LocalJsonValue propResultType = default; - LocalJsonValue propTimestamp = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBucketSpan.TryReadProperty(ref reader, options, PropBucketSpan, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanSecondsMarker)))) - { - continue; - } - - if (propFoo.TryReadProperty(ref reader, options, PropFoo, null)) - { - continue; - } - - if (propInfluencerFieldName.TryReadProperty(ref reader, options, PropInfluencerFieldName, null)) - { - continue; - } - - if (propInfluencerFieldValue.TryReadProperty(ref reader, options, PropInfluencerFieldValue, null)) - { - continue; - } - - if (propInfluencerScore.TryReadProperty(ref reader, options, PropInfluencerScore, null)) - { - continue; - } - - if (propInitialInfluencerScore.TryReadProperty(ref reader, options, PropInitialInfluencerScore, null)) - { - continue; - } - - if (propIsInterim.TryReadProperty(ref reader, options, PropIsInterim, null)) - { - continue; - } - - if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) - { - continue; - } - - if (propProbability.TryReadProperty(ref reader, options, PropProbability, null)) - { - continue; - } - - if (propResultType.TryReadProperty(ref reader, options, PropResultType, null)) - { - continue; - } - - if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.Influencer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BucketSpan = propBucketSpan.Value, - Foo = propFoo.Value, - InfluencerFieldName = propInfluencerFieldName.Value, - InfluencerFieldValue = propInfluencerFieldValue.Value, - InfluencerScore = propInfluencerScore.Value, - InitialInfluencerScore = propInitialInfluencerScore.Value, - IsInterim = propIsInterim.Value, - JobId = propJobId.Value, - Probability = propProbability.Value, - ResultType = propResultType.Value, - Timestamp = propTimestamp.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Influencer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBucketSpan, value.BucketSpan, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanSecondsMarker))); - writer.WriteProperty(options, PropFoo, value.Foo, null, null); - writer.WriteProperty(options, PropInfluencerFieldName, value.InfluencerFieldName, null, null); - writer.WriteProperty(options, PropInfluencerFieldValue, value.InfluencerFieldValue, null, null); - writer.WriteProperty(options, PropInfluencerScore, value.InfluencerScore, null, null); - writer.WriteProperty(options, PropInitialInfluencerScore, value.InitialInfluencerScore, null, null); - writer.WriteProperty(options, PropIsInterim, value.IsInterim, null, null); - writer.WriteProperty(options, PropJobId, value.JobId, null, null); - writer.WriteProperty(options, PropProbability, value.Probability, null, null); - writer.WriteProperty(options, PropResultType, value.ResultType, null, null); - writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.InfluencerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.InfluencerConverter))] public sealed partial class Influencer { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Input.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Input.Converters.g.cs new file mode 100644 index 00000000000..7f61a35605e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Input.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class InputConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFieldNames = System.Text.Json.JsonEncodedText.Encode("field_names"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.Input Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFieldNames = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFieldNames.TryReadProperty(ref reader, options, PropFieldNames, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.Input(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FieldNames = propFieldNames.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Input value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFieldNames, value.FieldNames, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Input.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Input.g.cs index 4e161a45874..ee047463577 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Input.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Input.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class InputConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFieldNames = System.Text.Json.JsonEncodedText.Encode("field_names"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.Input Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFieldNames = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFieldNames.TryReadProperty(ref reader, options, PropFieldNames, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.Input(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FieldNames = propFieldNames.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Input value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFieldNames, value.FieldNames, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.InputConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.InputConverter))] public sealed partial class Input { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Job.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Job.Converters.g.cs new file mode 100644 index 00000000000..d30300d0e15 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Job.Converters.g.cs @@ -0,0 +1,261 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class JobConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowLazyOpen = System.Text.Json.JsonEncodedText.Encode("allow_lazy_open"); + private static readonly System.Text.Json.JsonEncodedText PropAnalysisConfig = System.Text.Json.JsonEncodedText.Encode("analysis_config"); + private static readonly System.Text.Json.JsonEncodedText PropAnalysisLimits = System.Text.Json.JsonEncodedText.Encode("analysis_limits"); + private static readonly System.Text.Json.JsonEncodedText PropBackgroundPersistInterval = System.Text.Json.JsonEncodedText.Encode("background_persist_interval"); + private static readonly System.Text.Json.JsonEncodedText PropBlocked = System.Text.Json.JsonEncodedText.Encode("blocked"); + private static readonly System.Text.Json.JsonEncodedText PropCreateTime = System.Text.Json.JsonEncodedText.Encode("create_time"); + private static readonly System.Text.Json.JsonEncodedText PropCustomSettings = System.Text.Json.JsonEncodedText.Encode("custom_settings"); + private static readonly System.Text.Json.JsonEncodedText PropDailyModelSnapshotRetentionAfterDays = System.Text.Json.JsonEncodedText.Encode("daily_model_snapshot_retention_after_days"); + private static readonly System.Text.Json.JsonEncodedText PropDataDescription = System.Text.Json.JsonEncodedText.Encode("data_description"); + private static readonly System.Text.Json.JsonEncodedText PropDatafeedConfig = System.Text.Json.JsonEncodedText.Encode("datafeed_config"); + private static readonly System.Text.Json.JsonEncodedText PropDeleting = System.Text.Json.JsonEncodedText.Encode("deleting"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropFinishedTime = System.Text.Json.JsonEncodedText.Encode("finished_time"); + private static readonly System.Text.Json.JsonEncodedText PropGroups = System.Text.Json.JsonEncodedText.Encode("groups"); + private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); + private static readonly System.Text.Json.JsonEncodedText PropJobType = System.Text.Json.JsonEncodedText.Encode("job_type"); + private static readonly System.Text.Json.JsonEncodedText PropJobVersion = System.Text.Json.JsonEncodedText.Encode("job_version"); + private static readonly System.Text.Json.JsonEncodedText PropModelPlotConfig = System.Text.Json.JsonEncodedText.Encode("model_plot_config"); + private static readonly System.Text.Json.JsonEncodedText PropModelSnapshotId = System.Text.Json.JsonEncodedText.Encode("model_snapshot_id"); + private static readonly System.Text.Json.JsonEncodedText PropModelSnapshotRetentionDays = System.Text.Json.JsonEncodedText.Encode("model_snapshot_retention_days"); + private static readonly System.Text.Json.JsonEncodedText PropRenormalizationWindowDays = System.Text.Json.JsonEncodedText.Encode("renormalization_window_days"); + private static readonly System.Text.Json.JsonEncodedText PropResultsIndexName = System.Text.Json.JsonEncodedText.Encode("results_index_name"); + private static readonly System.Text.Json.JsonEncodedText PropResultsRetentionDays = System.Text.Json.JsonEncodedText.Encode("results_retention_days"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.Job Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowLazyOpen = default; + LocalJsonValue propAnalysisConfig = default; + LocalJsonValue propAnalysisLimits = default; + LocalJsonValue propBackgroundPersistInterval = default; + LocalJsonValue propBlocked = default; + LocalJsonValue propCreateTime = default; + LocalJsonValue propCustomSettings = default; + LocalJsonValue propDailyModelSnapshotRetentionAfterDays = default; + LocalJsonValue propDataDescription = default; + LocalJsonValue propDatafeedConfig = default; + LocalJsonValue propDeleting = default; + LocalJsonValue propDescription = default; + LocalJsonValue propFinishedTime = default; + LocalJsonValue?> propGroups = default; + LocalJsonValue propJobId = default; + LocalJsonValue propJobType = default; + LocalJsonValue propJobVersion = default; + LocalJsonValue propModelPlotConfig = default; + LocalJsonValue propModelSnapshotId = default; + LocalJsonValue propModelSnapshotRetentionDays = default; + LocalJsonValue propRenormalizationWindowDays = default; + LocalJsonValue propResultsIndexName = default; + LocalJsonValue propResultsRetentionDays = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowLazyOpen.TryReadProperty(ref reader, options, PropAllowLazyOpen, null)) + { + continue; + } + + if (propAnalysisConfig.TryReadProperty(ref reader, options, PropAnalysisConfig, null)) + { + continue; + } + + if (propAnalysisLimits.TryReadProperty(ref reader, options, PropAnalysisLimits, null)) + { + continue; + } + + if (propBackgroundPersistInterval.TryReadProperty(ref reader, options, PropBackgroundPersistInterval, null)) + { + continue; + } + + if (propBlocked.TryReadProperty(ref reader, options, PropBlocked, null)) + { + continue; + } + + if (propCreateTime.TryReadProperty(ref reader, options, PropCreateTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propCustomSettings.TryReadProperty(ref reader, options, PropCustomSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propDailyModelSnapshotRetentionAfterDays.TryReadProperty(ref reader, options, PropDailyModelSnapshotRetentionAfterDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDataDescription.TryReadProperty(ref reader, options, PropDataDescription, null)) + { + continue; + } + + if (propDatafeedConfig.TryReadProperty(ref reader, options, PropDatafeedConfig, null)) + { + continue; + } + + if (propDeleting.TryReadProperty(ref reader, options, PropDeleting, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propFinishedTime.TryReadProperty(ref reader, options, PropFinishedTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propGroups.TryReadProperty(ref reader, options, PropGroups, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) + { + continue; + } + + if (propJobType.TryReadProperty(ref reader, options, PropJobType, null)) + { + continue; + } + + if (propJobVersion.TryReadProperty(ref reader, options, PropJobVersion, null)) + { + continue; + } + + if (propModelPlotConfig.TryReadProperty(ref reader, options, PropModelPlotConfig, null)) + { + continue; + } + + if (propModelSnapshotId.TryReadProperty(ref reader, options, PropModelSnapshotId, null)) + { + continue; + } + + if (propModelSnapshotRetentionDays.TryReadProperty(ref reader, options, PropModelSnapshotRetentionDays, null)) + { + continue; + } + + if (propRenormalizationWindowDays.TryReadProperty(ref reader, options, PropRenormalizationWindowDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propResultsIndexName.TryReadProperty(ref reader, options, PropResultsIndexName, null)) + { + continue; + } + + if (propResultsRetentionDays.TryReadProperty(ref reader, options, PropResultsRetentionDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.Job(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowLazyOpen = propAllowLazyOpen.Value, + AnalysisConfig = propAnalysisConfig.Value, + AnalysisLimits = propAnalysisLimits.Value, + BackgroundPersistInterval = propBackgroundPersistInterval.Value, + Blocked = propBlocked.Value, + CreateTime = propCreateTime.Value, + CustomSettings = propCustomSettings.Value, + DailyModelSnapshotRetentionAfterDays = propDailyModelSnapshotRetentionAfterDays.Value, + DataDescription = propDataDescription.Value, + DatafeedConfig = propDatafeedConfig.Value, + Deleting = propDeleting.Value, + Description = propDescription.Value, + FinishedTime = propFinishedTime.Value, + Groups = propGroups.Value, + JobId = propJobId.Value, + JobType = propJobType.Value, + JobVersion = propJobVersion.Value, + ModelPlotConfig = propModelPlotConfig.Value, + ModelSnapshotId = propModelSnapshotId.Value, + ModelSnapshotRetentionDays = propModelSnapshotRetentionDays.Value, + RenormalizationWindowDays = propRenormalizationWindowDays.Value, + ResultsIndexName = propResultsIndexName.Value, + ResultsRetentionDays = propResultsRetentionDays.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Job value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowLazyOpen, value.AllowLazyOpen, null, null); + writer.WriteProperty(options, PropAnalysisConfig, value.AnalysisConfig, null, null); + writer.WriteProperty(options, PropAnalysisLimits, value.AnalysisLimits, null, null); + writer.WriteProperty(options, PropBackgroundPersistInterval, value.BackgroundPersistInterval, null, null); + writer.WriteProperty(options, PropBlocked, value.Blocked, null, null); + writer.WriteProperty(options, PropCreateTime, value.CreateTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropCustomSettings, value.CustomSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropDailyModelSnapshotRetentionAfterDays, value.DailyModelSnapshotRetentionAfterDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDataDescription, value.DataDescription, null, null); + writer.WriteProperty(options, PropDatafeedConfig, value.DatafeedConfig, null, null); + writer.WriteProperty(options, PropDeleting, value.Deleting, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropFinishedTime, value.FinishedTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropGroups, value.Groups, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropJobId, value.JobId, null, null); + writer.WriteProperty(options, PropJobType, value.JobType, null, null); + writer.WriteProperty(options, PropJobVersion, value.JobVersion, null, null); + writer.WriteProperty(options, PropModelPlotConfig, value.ModelPlotConfig, null, null); + writer.WriteProperty(options, PropModelSnapshotId, value.ModelSnapshotId, null, null); + writer.WriteProperty(options, PropModelSnapshotRetentionDays, value.ModelSnapshotRetentionDays, null, null); + writer.WriteProperty(options, PropRenormalizationWindowDays, value.RenormalizationWindowDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropResultsIndexName, value.ResultsIndexName, null, null); + writer.WriteProperty(options, PropResultsRetentionDays, value.ResultsRetentionDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Job.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Job.g.cs index fd848c973f8..7747a22e826 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Job.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Job.g.cs @@ -23,244 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class JobConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowLazyOpen = System.Text.Json.JsonEncodedText.Encode("allow_lazy_open"); - private static readonly System.Text.Json.JsonEncodedText PropAnalysisConfig = System.Text.Json.JsonEncodedText.Encode("analysis_config"); - private static readonly System.Text.Json.JsonEncodedText PropAnalysisLimits = System.Text.Json.JsonEncodedText.Encode("analysis_limits"); - private static readonly System.Text.Json.JsonEncodedText PropBackgroundPersistInterval = System.Text.Json.JsonEncodedText.Encode("background_persist_interval"); - private static readonly System.Text.Json.JsonEncodedText PropBlocked = System.Text.Json.JsonEncodedText.Encode("blocked"); - private static readonly System.Text.Json.JsonEncodedText PropCreateTime = System.Text.Json.JsonEncodedText.Encode("create_time"); - private static readonly System.Text.Json.JsonEncodedText PropCustomSettings = System.Text.Json.JsonEncodedText.Encode("custom_settings"); - private static readonly System.Text.Json.JsonEncodedText PropDailyModelSnapshotRetentionAfterDays = System.Text.Json.JsonEncodedText.Encode("daily_model_snapshot_retention_after_days"); - private static readonly System.Text.Json.JsonEncodedText PropDataDescription = System.Text.Json.JsonEncodedText.Encode("data_description"); - private static readonly System.Text.Json.JsonEncodedText PropDatafeedConfig = System.Text.Json.JsonEncodedText.Encode("datafeed_config"); - private static readonly System.Text.Json.JsonEncodedText PropDeleting = System.Text.Json.JsonEncodedText.Encode("deleting"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropFinishedTime = System.Text.Json.JsonEncodedText.Encode("finished_time"); - private static readonly System.Text.Json.JsonEncodedText PropGroups = System.Text.Json.JsonEncodedText.Encode("groups"); - private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); - private static readonly System.Text.Json.JsonEncodedText PropJobType = System.Text.Json.JsonEncodedText.Encode("job_type"); - private static readonly System.Text.Json.JsonEncodedText PropJobVersion = System.Text.Json.JsonEncodedText.Encode("job_version"); - private static readonly System.Text.Json.JsonEncodedText PropModelPlotConfig = System.Text.Json.JsonEncodedText.Encode("model_plot_config"); - private static readonly System.Text.Json.JsonEncodedText PropModelSnapshotId = System.Text.Json.JsonEncodedText.Encode("model_snapshot_id"); - private static readonly System.Text.Json.JsonEncodedText PropModelSnapshotRetentionDays = System.Text.Json.JsonEncodedText.Encode("model_snapshot_retention_days"); - private static readonly System.Text.Json.JsonEncodedText PropRenormalizationWindowDays = System.Text.Json.JsonEncodedText.Encode("renormalization_window_days"); - private static readonly System.Text.Json.JsonEncodedText PropResultsIndexName = System.Text.Json.JsonEncodedText.Encode("results_index_name"); - private static readonly System.Text.Json.JsonEncodedText PropResultsRetentionDays = System.Text.Json.JsonEncodedText.Encode("results_retention_days"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.Job Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowLazyOpen = default; - LocalJsonValue propAnalysisConfig = default; - LocalJsonValue propAnalysisLimits = default; - LocalJsonValue propBackgroundPersistInterval = default; - LocalJsonValue propBlocked = default; - LocalJsonValue propCreateTime = default; - LocalJsonValue propCustomSettings = default; - LocalJsonValue propDailyModelSnapshotRetentionAfterDays = default; - LocalJsonValue propDataDescription = default; - LocalJsonValue propDatafeedConfig = default; - LocalJsonValue propDeleting = default; - LocalJsonValue propDescription = default; - LocalJsonValue propFinishedTime = default; - LocalJsonValue?> propGroups = default; - LocalJsonValue propJobId = default; - LocalJsonValue propJobType = default; - LocalJsonValue propJobVersion = default; - LocalJsonValue propModelPlotConfig = default; - LocalJsonValue propModelSnapshotId = default; - LocalJsonValue propModelSnapshotRetentionDays = default; - LocalJsonValue propRenormalizationWindowDays = default; - LocalJsonValue propResultsIndexName = default; - LocalJsonValue propResultsRetentionDays = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowLazyOpen.TryReadProperty(ref reader, options, PropAllowLazyOpen, null)) - { - continue; - } - - if (propAnalysisConfig.TryReadProperty(ref reader, options, PropAnalysisConfig, null)) - { - continue; - } - - if (propAnalysisLimits.TryReadProperty(ref reader, options, PropAnalysisLimits, null)) - { - continue; - } - - if (propBackgroundPersistInterval.TryReadProperty(ref reader, options, PropBackgroundPersistInterval, null)) - { - continue; - } - - if (propBlocked.TryReadProperty(ref reader, options, PropBlocked, null)) - { - continue; - } - - if (propCreateTime.TryReadProperty(ref reader, options, PropCreateTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propCustomSettings.TryReadProperty(ref reader, options, PropCustomSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propDailyModelSnapshotRetentionAfterDays.TryReadProperty(ref reader, options, PropDailyModelSnapshotRetentionAfterDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDataDescription.TryReadProperty(ref reader, options, PropDataDescription, null)) - { - continue; - } - - if (propDatafeedConfig.TryReadProperty(ref reader, options, PropDatafeedConfig, null)) - { - continue; - } - - if (propDeleting.TryReadProperty(ref reader, options, PropDeleting, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propFinishedTime.TryReadProperty(ref reader, options, PropFinishedTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propGroups.TryReadProperty(ref reader, options, PropGroups, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) - { - continue; - } - - if (propJobType.TryReadProperty(ref reader, options, PropJobType, null)) - { - continue; - } - - if (propJobVersion.TryReadProperty(ref reader, options, PropJobVersion, null)) - { - continue; - } - - if (propModelPlotConfig.TryReadProperty(ref reader, options, PropModelPlotConfig, null)) - { - continue; - } - - if (propModelSnapshotId.TryReadProperty(ref reader, options, PropModelSnapshotId, null)) - { - continue; - } - - if (propModelSnapshotRetentionDays.TryReadProperty(ref reader, options, PropModelSnapshotRetentionDays, null)) - { - continue; - } - - if (propRenormalizationWindowDays.TryReadProperty(ref reader, options, PropRenormalizationWindowDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propResultsIndexName.TryReadProperty(ref reader, options, PropResultsIndexName, null)) - { - continue; - } - - if (propResultsRetentionDays.TryReadProperty(ref reader, options, PropResultsRetentionDays, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.Job(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowLazyOpen = propAllowLazyOpen.Value, - AnalysisConfig = propAnalysisConfig.Value, - AnalysisLimits = propAnalysisLimits.Value, - BackgroundPersistInterval = propBackgroundPersistInterval.Value, - Blocked = propBlocked.Value, - CreateTime = propCreateTime.Value, - CustomSettings = propCustomSettings.Value, - DailyModelSnapshotRetentionAfterDays = propDailyModelSnapshotRetentionAfterDays.Value, - DataDescription = propDataDescription.Value, - DatafeedConfig = propDatafeedConfig.Value, - Deleting = propDeleting.Value, - Description = propDescription.Value, - FinishedTime = propFinishedTime.Value, - Groups = propGroups.Value, - JobId = propJobId.Value, - JobType = propJobType.Value, - JobVersion = propJobVersion.Value, - ModelPlotConfig = propModelPlotConfig.Value, - ModelSnapshotId = propModelSnapshotId.Value, - ModelSnapshotRetentionDays = propModelSnapshotRetentionDays.Value, - RenormalizationWindowDays = propRenormalizationWindowDays.Value, - ResultsIndexName = propResultsIndexName.Value, - ResultsRetentionDays = propResultsRetentionDays.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Job value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowLazyOpen, value.AllowLazyOpen, null, null); - writer.WriteProperty(options, PropAnalysisConfig, value.AnalysisConfig, null, null); - writer.WriteProperty(options, PropAnalysisLimits, value.AnalysisLimits, null, null); - writer.WriteProperty(options, PropBackgroundPersistInterval, value.BackgroundPersistInterval, null, null); - writer.WriteProperty(options, PropBlocked, value.Blocked, null, null); - writer.WriteProperty(options, PropCreateTime, value.CreateTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropCustomSettings, value.CustomSettings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropDailyModelSnapshotRetentionAfterDays, value.DailyModelSnapshotRetentionAfterDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDataDescription, value.DataDescription, null, null); - writer.WriteProperty(options, PropDatafeedConfig, value.DatafeedConfig, null, null); - writer.WriteProperty(options, PropDeleting, value.Deleting, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropFinishedTime, value.FinishedTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropGroups, value.Groups, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropJobId, value.JobId, null, null); - writer.WriteProperty(options, PropJobType, value.JobType, null, null); - writer.WriteProperty(options, PropJobVersion, value.JobVersion, null, null); - writer.WriteProperty(options, PropModelPlotConfig, value.ModelPlotConfig, null, null); - writer.WriteProperty(options, PropModelSnapshotId, value.ModelSnapshotId, null, null); - writer.WriteProperty(options, PropModelSnapshotRetentionDays, value.ModelSnapshotRetentionDays, null, null); - writer.WriteProperty(options, PropRenormalizationWindowDays, value.RenormalizationWindowDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropResultsIndexName, value.ResultsIndexName, null, null); - writer.WriteProperty(options, PropResultsRetentionDays, value.ResultsRetentionDays, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.JobConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.JobConverter))] public sealed partial class Job { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobBlocked.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobBlocked.Converters.g.cs new file mode 100644 index 00000000000..fda03381825 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobBlocked.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class JobBlockedConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); + private static readonly System.Text.Json.JsonEncodedText PropTaskId = System.Text.Json.JsonEncodedText.Encode("task_id"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.JobBlocked Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propReason = default; + LocalJsonValue propTaskId = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propReason.TryReadProperty(ref reader, options, PropReason, null)) + { + continue; + } + + if (propTaskId.TryReadProperty(ref reader, options, PropTaskId, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.JobBlocked(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Reason = propReason.Value, + TaskId = propTaskId.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.JobBlocked value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropReason, value.Reason, null, null); + writer.WriteProperty(options, PropTaskId, value.TaskId, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobBlocked.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobBlocked.g.cs index abbd0d6fa4c..183f363f87b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobBlocked.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobBlocked.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class JobBlockedConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); - private static readonly System.Text.Json.JsonEncodedText PropTaskId = System.Text.Json.JsonEncodedText.Encode("task_id"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.JobBlocked Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propReason = default; - LocalJsonValue propTaskId = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propReason.TryReadProperty(ref reader, options, PropReason, null)) - { - continue; - } - - if (propTaskId.TryReadProperty(ref reader, options, PropTaskId, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.JobBlocked(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Reason = propReason.Value, - TaskId = propTaskId.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.JobBlocked value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropReason, value.Reason, null, null); - writer.WriteProperty(options, PropTaskId, value.TaskId, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.JobBlockedConverter))] public sealed partial class JobBlocked { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobBlockedReason.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobBlockedReason.Converters.g.cs new file mode 100644 index 00000000000..ede23813fa8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobBlockedReason.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class JobBlockedReasonConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberDelete = System.Text.Json.JsonEncodedText.Encode("delete"); + private static readonly System.Text.Json.JsonEncodedText MemberReset = System.Text.Json.JsonEncodedText.Encode("reset"); + private static readonly System.Text.Json.JsonEncodedText MemberRevert = System.Text.Json.JsonEncodedText.Encode("revert"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberDelete)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason.Delete; + } + + if (reader.ValueTextEquals(MemberReset)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason.Reset; + } + + if (reader.ValueTextEquals(MemberRevert)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason.Revert; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberDelete.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason.Delete; + } + + if (string.Equals(value, MemberReset.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason.Reset; + } + + if (string.Equals(value, MemberRevert.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason.Revert; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason.Delete: + writer.WriteStringValue(MemberDelete); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason.Reset: + writer.WriteStringValue(MemberReset); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason.Revert: + writer.WriteStringValue(MemberRevert); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.JobBlockedReason value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobBlockedReason.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobBlockedReason.g.cs new file mode 100644 index 00000000000..5dd9f25d15d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobBlockedReason.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.JobBlockedReasonConverter))] +public enum JobBlockedReason +{ + [System.Runtime.Serialization.EnumMember(Value = "delete")] + Delete, + [System.Runtime.Serialization.EnumMember(Value = "reset")] + Reset, + [System.Runtime.Serialization.EnumMember(Value = "revert")] + Revert +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobForecastStatistics.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobForecastStatistics.Converters.g.cs new file mode 100644 index 00000000000..84215f90da9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobForecastStatistics.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class JobForecastStatisticsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropForecastedJobs = System.Text.Json.JsonEncodedText.Encode("forecasted_jobs"); + private static readonly System.Text.Json.JsonEncodedText PropMemoryBytes = System.Text.Json.JsonEncodedText.Encode("memory_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropProcessingTimeMs = System.Text.Json.JsonEncodedText.Encode("processing_time_ms"); + private static readonly System.Text.Json.JsonEncodedText PropRecords = System.Text.Json.JsonEncodedText.Encode("records"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.JobForecastStatistics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propForecastedJobs = default; + LocalJsonValue propMemoryBytes = default; + LocalJsonValue propProcessingTimeMs = default; + LocalJsonValue propRecords = default; + LocalJsonValue?> propStatus = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propForecastedJobs.TryReadProperty(ref reader, options, PropForecastedJobs, null)) + { + continue; + } + + if (propMemoryBytes.TryReadProperty(ref reader, options, PropMemoryBytes, null)) + { + continue; + } + + if (propProcessingTimeMs.TryReadProperty(ref reader, options, PropProcessingTimeMs, null)) + { + continue; + } + + if (propRecords.TryReadProperty(ref reader, options, PropRecords, null)) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.JobForecastStatistics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ForecastedJobs = propForecastedJobs.Value, + MemoryBytes = propMemoryBytes.Value, + ProcessingTimeMs = propProcessingTimeMs.Value, + Records = propRecords.Value, + Status = propStatus.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.JobForecastStatistics value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropForecastedJobs, value.ForecastedJobs, null, null); + writer.WriteProperty(options, PropMemoryBytes, value.MemoryBytes, null, null); + writer.WriteProperty(options, PropProcessingTimeMs, value.ProcessingTimeMs, null, null); + writer.WriteProperty(options, PropRecords, value.Records, null, null); + writer.WriteProperty(options, PropStatus, value.Status, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobForecastStatistics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobForecastStatistics.g.cs index 7c5a573bd17..460e39fffa5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobForecastStatistics.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobForecastStatistics.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class JobForecastStatisticsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropForecastedJobs = System.Text.Json.JsonEncodedText.Encode("forecasted_jobs"); - private static readonly System.Text.Json.JsonEncodedText PropMemoryBytes = System.Text.Json.JsonEncodedText.Encode("memory_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropProcessingTimeMs = System.Text.Json.JsonEncodedText.Encode("processing_time_ms"); - private static readonly System.Text.Json.JsonEncodedText PropRecords = System.Text.Json.JsonEncodedText.Encode("records"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.JobForecastStatistics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propForecastedJobs = default; - LocalJsonValue propMemoryBytes = default; - LocalJsonValue propProcessingTimeMs = default; - LocalJsonValue propRecords = default; - LocalJsonValue?> propStatus = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propForecastedJobs.TryReadProperty(ref reader, options, PropForecastedJobs, null)) - { - continue; - } - - if (propMemoryBytes.TryReadProperty(ref reader, options, PropMemoryBytes, null)) - { - continue; - } - - if (propProcessingTimeMs.TryReadProperty(ref reader, options, PropProcessingTimeMs, null)) - { - continue; - } - - if (propRecords.TryReadProperty(ref reader, options, PropRecords, null)) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.JobForecastStatistics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ForecastedJobs = propForecastedJobs.Value, - MemoryBytes = propMemoryBytes.Value, - ProcessingTimeMs = propProcessingTimeMs.Value, - Records = propRecords.Value, - Status = propStatus.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.JobForecastStatistics value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropForecastedJobs, value.ForecastedJobs, null, null); - writer.WriteProperty(options, PropMemoryBytes, value.MemoryBytes, null, null); - writer.WriteProperty(options, PropProcessingTimeMs, value.ProcessingTimeMs, null, null); - writer.WriteProperty(options, PropRecords, value.Records, null, null); - writer.WriteProperty(options, PropStatus, value.Status, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.JobForecastStatisticsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.JobForecastStatisticsConverter))] public sealed partial class JobForecastStatistics { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobState.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobState.Converters.g.cs new file mode 100644 index 00000000000..aa6c7827c3e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobState.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class JobStateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberClosed = System.Text.Json.JsonEncodedText.Encode("closed"); + private static readonly System.Text.Json.JsonEncodedText MemberClosing = System.Text.Json.JsonEncodedText.Encode("closing"); + private static readonly System.Text.Json.JsonEncodedText MemberFailed = System.Text.Json.JsonEncodedText.Encode("failed"); + private static readonly System.Text.Json.JsonEncodedText MemberOpened = System.Text.Json.JsonEncodedText.Encode("opened"); + private static readonly System.Text.Json.JsonEncodedText MemberOpening = System.Text.Json.JsonEncodedText.Encode("opening"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.JobState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberClosed)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.JobState.Closed; + } + + if (reader.ValueTextEquals(MemberClosing)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.JobState.Closing; + } + + if (reader.ValueTextEquals(MemberFailed)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.JobState.Failed; + } + + if (reader.ValueTextEquals(MemberOpened)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.JobState.Opened; + } + + if (reader.ValueTextEquals(MemberOpening)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.JobState.Opening; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberClosed.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.JobState.Closed; + } + + if (string.Equals(value, MemberClosing.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.JobState.Closing; + } + + if (string.Equals(value, MemberFailed.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.JobState.Failed; + } + + if (string.Equals(value, MemberOpened.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.JobState.Opened; + } + + if (string.Equals(value, MemberOpening.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.JobState.Opening; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.JobState)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.JobState value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.MachineLearning.JobState.Closed: + writer.WriteStringValue(MemberClosed); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.JobState.Closing: + writer.WriteStringValue(MemberClosing); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.JobState.Failed: + writer.WriteStringValue(MemberFailed); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.JobState.Opened: + writer.WriteStringValue(MemberOpened); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.JobState.Opening: + writer.WriteStringValue(MemberOpening); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.JobState)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.MachineLearning.JobState ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.JobState value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobState.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobState.g.cs new file mode 100644 index 00000000000..58f1250b479 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobState.g.cs @@ -0,0 +1,67 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.JobStateConverter))] +public enum JobState +{ + /// + /// + /// The job finished successfully with its model state persisted. The job must be opened before it can accept further data. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "closed")] + Closed, + /// + /// + /// The job close action is in progress and has not yet completed. A closing job cannot accept further data. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "closing")] + Closing, + /// + /// + /// The job did not finish successfully due to an error. + /// This situation can occur due to invalid input data, a fatal error occurring during the analysis, or an external interaction such as the process being killed by the Linux out of memory (OOM) killer. + /// If the job had irrevocably failed, it must be force closed and then deleted. + /// If the datafeed can be corrected, the job can be closed and then re-opened. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "failed")] + Failed, + /// + /// + /// The job is available to receive and process data. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "opened")] + Opened, + /// + /// + /// The job open action is in progress and has not yet completed. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "opening")] + Opening +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobStatistics.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobStatistics.Converters.g.cs new file mode 100644 index 00000000000..2a6db9d65b5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobStatistics.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class JobStatisticsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvg = System.Text.Json.JsonEncodedText.Encode("avg"); + private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.JobStatistics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvg = default; + LocalJsonValue propMax = default; + LocalJsonValue propMin = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvg.TryReadProperty(ref reader, options, PropAvg, null)) + { + continue; + } + + if (propMax.TryReadProperty(ref reader, options, PropMax, null)) + { + continue; + } + + if (propMin.TryReadProperty(ref reader, options, PropMin, null)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.JobStatistics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Avg = propAvg.Value, + Max = propMax.Value, + Min = propMin.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.JobStatistics value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvg, value.Avg, null, null); + writer.WriteProperty(options, PropMax, value.Max, null, null); + writer.WriteProperty(options, PropMin, value.Min, null, null); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobStatistics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobStatistics.g.cs index 7fb1c45513a..b58432c3986 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobStatistics.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobStatistics.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class JobStatisticsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvg = System.Text.Json.JsonEncodedText.Encode("avg"); - private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); - private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.JobStatistics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvg = default; - LocalJsonValue propMax = default; - LocalJsonValue propMin = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvg.TryReadProperty(ref reader, options, PropAvg, null)) - { - continue; - } - - if (propMax.TryReadProperty(ref reader, options, PropMax, null)) - { - continue; - } - - if (propMin.TryReadProperty(ref reader, options, PropMin, null)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.JobStatistics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Avg = propAvg.Value, - Max = propMax.Value, - Min = propMin.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.JobStatistics value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvg, value.Avg, null, null); - writer.WriteProperty(options, PropMax, value.Max, null, null); - writer.WriteProperty(options, PropMin, value.Min, null, null); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.JobStatisticsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.JobStatisticsConverter))] public sealed partial class JobStatistics { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobStats.Converters.g.cs new file mode 100644 index 00000000000..e968f0731f0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobStats.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class JobStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAssignmentExplanation = System.Text.Json.JsonEncodedText.Encode("assignment_explanation"); + private static readonly System.Text.Json.JsonEncodedText PropDataCounts = System.Text.Json.JsonEncodedText.Encode("data_counts"); + private static readonly System.Text.Json.JsonEncodedText PropDeleting = System.Text.Json.JsonEncodedText.Encode("deleting"); + private static readonly System.Text.Json.JsonEncodedText PropForecastsStats = System.Text.Json.JsonEncodedText.Encode("forecasts_stats"); + private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); + private static readonly System.Text.Json.JsonEncodedText PropModelSizeStats = System.Text.Json.JsonEncodedText.Encode("model_size_stats"); + private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); + private static readonly System.Text.Json.JsonEncodedText PropOpenTime = System.Text.Json.JsonEncodedText.Encode("open_time"); + private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); + private static readonly System.Text.Json.JsonEncodedText PropTimingStats = System.Text.Json.JsonEncodedText.Encode("timing_stats"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.JobStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAssignmentExplanation = default; + LocalJsonValue propDataCounts = default; + LocalJsonValue propDeleting = default; + LocalJsonValue propForecastsStats = default; + LocalJsonValue propJobId = default; + LocalJsonValue propModelSizeStats = default; + LocalJsonValue propNode = default; + LocalJsonValue propOpenTime = default; + LocalJsonValue propState = default; + LocalJsonValue propTimingStats = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAssignmentExplanation.TryReadProperty(ref reader, options, PropAssignmentExplanation, null)) + { + continue; + } + + if (propDataCounts.TryReadProperty(ref reader, options, PropDataCounts, null)) + { + continue; + } + + if (propDeleting.TryReadProperty(ref reader, options, PropDeleting, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propForecastsStats.TryReadProperty(ref reader, options, PropForecastsStats, null)) + { + continue; + } + + if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) + { + continue; + } + + if (propModelSizeStats.TryReadProperty(ref reader, options, PropModelSizeStats, null)) + { + continue; + } + + if (propNode.TryReadProperty(ref reader, options, PropNode, null)) + { + continue; + } + + if (propOpenTime.TryReadProperty(ref reader, options, PropOpenTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propState.TryReadProperty(ref reader, options, PropState, null)) + { + continue; + } + + if (propTimingStats.TryReadProperty(ref reader, options, PropTimingStats, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.JobStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AssignmentExplanation = propAssignmentExplanation.Value, + DataCounts = propDataCounts.Value, + Deleting = propDeleting.Value, + ForecastsStats = propForecastsStats.Value, + JobId = propJobId.Value, + ModelSizeStats = propModelSizeStats.Value, + Node = propNode.Value, + OpenTime = propOpenTime.Value, + State = propState.Value, + TimingStats = propTimingStats.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.JobStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAssignmentExplanation, value.AssignmentExplanation, null, null); + writer.WriteProperty(options, PropDataCounts, value.DataCounts, null, null); + writer.WriteProperty(options, PropDeleting, value.Deleting, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropForecastsStats, value.ForecastsStats, null, null); + writer.WriteProperty(options, PropJobId, value.JobId, null, null); + writer.WriteProperty(options, PropModelSizeStats, value.ModelSizeStats, null, null); + writer.WriteProperty(options, PropNode, value.Node, null, null); + writer.WriteProperty(options, PropOpenTime, value.OpenTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropState, value.State, null, null); + writer.WriteProperty(options, PropTimingStats, value.TimingStats, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobStats.g.cs index be6a246d76d..8f54b112c86 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobStats.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class JobStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAssignmentExplanation = System.Text.Json.JsonEncodedText.Encode("assignment_explanation"); - private static readonly System.Text.Json.JsonEncodedText PropDataCounts = System.Text.Json.JsonEncodedText.Encode("data_counts"); - private static readonly System.Text.Json.JsonEncodedText PropDeleting = System.Text.Json.JsonEncodedText.Encode("deleting"); - private static readonly System.Text.Json.JsonEncodedText PropForecastsStats = System.Text.Json.JsonEncodedText.Encode("forecasts_stats"); - private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); - private static readonly System.Text.Json.JsonEncodedText PropModelSizeStats = System.Text.Json.JsonEncodedText.Encode("model_size_stats"); - private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); - private static readonly System.Text.Json.JsonEncodedText PropOpenTime = System.Text.Json.JsonEncodedText.Encode("open_time"); - private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); - private static readonly System.Text.Json.JsonEncodedText PropTimingStats = System.Text.Json.JsonEncodedText.Encode("timing_stats"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.JobStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAssignmentExplanation = default; - LocalJsonValue propDataCounts = default; - LocalJsonValue propDeleting = default; - LocalJsonValue propForecastsStats = default; - LocalJsonValue propJobId = default; - LocalJsonValue propModelSizeStats = default; - LocalJsonValue propNode = default; - LocalJsonValue propOpenTime = default; - LocalJsonValue propState = default; - LocalJsonValue propTimingStats = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAssignmentExplanation.TryReadProperty(ref reader, options, PropAssignmentExplanation, null)) - { - continue; - } - - if (propDataCounts.TryReadProperty(ref reader, options, PropDataCounts, null)) - { - continue; - } - - if (propDeleting.TryReadProperty(ref reader, options, PropDeleting, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propForecastsStats.TryReadProperty(ref reader, options, PropForecastsStats, null)) - { - continue; - } - - if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) - { - continue; - } - - if (propModelSizeStats.TryReadProperty(ref reader, options, PropModelSizeStats, null)) - { - continue; - } - - if (propNode.TryReadProperty(ref reader, options, PropNode, null)) - { - continue; - } - - if (propOpenTime.TryReadProperty(ref reader, options, PropOpenTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propState.TryReadProperty(ref reader, options, PropState, null)) - { - continue; - } - - if (propTimingStats.TryReadProperty(ref reader, options, PropTimingStats, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.JobStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AssignmentExplanation = propAssignmentExplanation.Value, - DataCounts = propDataCounts.Value, - Deleting = propDeleting.Value, - ForecastsStats = propForecastsStats.Value, - JobId = propJobId.Value, - ModelSizeStats = propModelSizeStats.Value, - Node = propNode.Value, - OpenTime = propOpenTime.Value, - State = propState.Value, - TimingStats = propTimingStats.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.JobStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAssignmentExplanation, value.AssignmentExplanation, null, null); - writer.WriteProperty(options, PropDataCounts, value.DataCounts, null, null); - writer.WriteProperty(options, PropDeleting, value.Deleting, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropForecastsStats, value.ForecastsStats, null, null); - writer.WriteProperty(options, PropJobId, value.JobId, null, null); - writer.WriteProperty(options, PropModelSizeStats, value.ModelSizeStats, null, null); - writer.WriteProperty(options, PropNode, value.Node, null, null); - writer.WriteProperty(options, PropOpenTime, value.OpenTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropState, value.State, null, null); - writer.WriteProperty(options, PropTimingStats, value.TimingStats, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.JobStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.JobStatsConverter))] public sealed partial class JobStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobTimingStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobTimingStats.Converters.g.cs new file mode 100644 index 00000000000..06d2d184487 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobTimingStats.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class JobTimingStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAverageBucketProcessingTimeMs = System.Text.Json.JsonEncodedText.Encode("average_bucket_processing_time_ms"); + private static readonly System.Text.Json.JsonEncodedText PropBucketCount = System.Text.Json.JsonEncodedText.Encode("bucket_count"); + private static readonly System.Text.Json.JsonEncodedText PropExponentialAverageBucketProcessingTimeMs = System.Text.Json.JsonEncodedText.Encode("exponential_average_bucket_processing_time_ms"); + private static readonly System.Text.Json.JsonEncodedText PropExponentialAverageBucketProcessingTimePerHourMs = System.Text.Json.JsonEncodedText.Encode("exponential_average_bucket_processing_time_per_hour_ms"); + private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); + private static readonly System.Text.Json.JsonEncodedText PropMaximumBucketProcessingTimeMs = System.Text.Json.JsonEncodedText.Encode("maximum_bucket_processing_time_ms"); + private static readonly System.Text.Json.JsonEncodedText PropMinimumBucketProcessingTimeMs = System.Text.Json.JsonEncodedText.Encode("minimum_bucket_processing_time_ms"); + private static readonly System.Text.Json.JsonEncodedText PropTotalBucketProcessingTimeMs = System.Text.Json.JsonEncodedText.Encode("total_bucket_processing_time_ms"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.JobTimingStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAverageBucketProcessingTimeMs = default; + LocalJsonValue propBucketCount = default; + LocalJsonValue propExponentialAverageBucketProcessingTimeMs = default; + LocalJsonValue propExponentialAverageBucketProcessingTimePerHourMs = default; + LocalJsonValue propJobId = default; + LocalJsonValue propMaximumBucketProcessingTimeMs = default; + LocalJsonValue propMinimumBucketProcessingTimeMs = default; + LocalJsonValue propTotalBucketProcessingTimeMs = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAverageBucketProcessingTimeMs.TryReadProperty(ref reader, options, PropAverageBucketProcessingTimeMs, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propBucketCount.TryReadProperty(ref reader, options, PropBucketCount, null)) + { + continue; + } + + if (propExponentialAverageBucketProcessingTimeMs.TryReadProperty(ref reader, options, PropExponentialAverageBucketProcessingTimeMs, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propExponentialAverageBucketProcessingTimePerHourMs.TryReadProperty(ref reader, options, PropExponentialAverageBucketProcessingTimePerHourMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) + { + continue; + } + + if (propMaximumBucketProcessingTimeMs.TryReadProperty(ref reader, options, PropMaximumBucketProcessingTimeMs, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propMinimumBucketProcessingTimeMs.TryReadProperty(ref reader, options, PropMinimumBucketProcessingTimeMs, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTotalBucketProcessingTimeMs.TryReadProperty(ref reader, options, PropTotalBucketProcessingTimeMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.JobTimingStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AverageBucketProcessingTimeMs = propAverageBucketProcessingTimeMs.Value, + BucketCount = propBucketCount.Value, + ExponentialAverageBucketProcessingTimeMs = propExponentialAverageBucketProcessingTimeMs.Value, + ExponentialAverageBucketProcessingTimePerHourMs = propExponentialAverageBucketProcessingTimePerHourMs.Value, + JobId = propJobId.Value, + MaximumBucketProcessingTimeMs = propMaximumBucketProcessingTimeMs.Value, + MinimumBucketProcessingTimeMs = propMinimumBucketProcessingTimeMs.Value, + TotalBucketProcessingTimeMs = propTotalBucketProcessingTimeMs.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.JobTimingStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAverageBucketProcessingTimeMs, value.AverageBucketProcessingTimeMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropBucketCount, value.BucketCount, null, null); + writer.WriteProperty(options, PropExponentialAverageBucketProcessingTimeMs, value.ExponentialAverageBucketProcessingTimeMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropExponentialAverageBucketProcessingTimePerHourMs, value.ExponentialAverageBucketProcessingTimePerHourMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropJobId, value.JobId, null, null); + writer.WriteProperty(options, PropMaximumBucketProcessingTimeMs, value.MaximumBucketProcessingTimeMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropMinimumBucketProcessingTimeMs, value.MinimumBucketProcessingTimeMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTotalBucketProcessingTimeMs, value.TotalBucketProcessingTimeMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobTimingStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobTimingStats.g.cs index 6be5fe2fe10..4b6d7d72120 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobTimingStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JobTimingStats.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class JobTimingStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAverageBucketProcessingTimeMs = System.Text.Json.JsonEncodedText.Encode("average_bucket_processing_time_ms"); - private static readonly System.Text.Json.JsonEncodedText PropBucketCount = System.Text.Json.JsonEncodedText.Encode("bucket_count"); - private static readonly System.Text.Json.JsonEncodedText PropExponentialAverageBucketProcessingTimeMs = System.Text.Json.JsonEncodedText.Encode("exponential_average_bucket_processing_time_ms"); - private static readonly System.Text.Json.JsonEncodedText PropExponentialAverageBucketProcessingTimePerHourMs = System.Text.Json.JsonEncodedText.Encode("exponential_average_bucket_processing_time_per_hour_ms"); - private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); - private static readonly System.Text.Json.JsonEncodedText PropMaximumBucketProcessingTimeMs = System.Text.Json.JsonEncodedText.Encode("maximum_bucket_processing_time_ms"); - private static readonly System.Text.Json.JsonEncodedText PropMinimumBucketProcessingTimeMs = System.Text.Json.JsonEncodedText.Encode("minimum_bucket_processing_time_ms"); - private static readonly System.Text.Json.JsonEncodedText PropTotalBucketProcessingTimeMs = System.Text.Json.JsonEncodedText.Encode("total_bucket_processing_time_ms"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.JobTimingStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAverageBucketProcessingTimeMs = default; - LocalJsonValue propBucketCount = default; - LocalJsonValue propExponentialAverageBucketProcessingTimeMs = default; - LocalJsonValue propExponentialAverageBucketProcessingTimePerHourMs = default; - LocalJsonValue propJobId = default; - LocalJsonValue propMaximumBucketProcessingTimeMs = default; - LocalJsonValue propMinimumBucketProcessingTimeMs = default; - LocalJsonValue propTotalBucketProcessingTimeMs = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAverageBucketProcessingTimeMs.TryReadProperty(ref reader, options, PropAverageBucketProcessingTimeMs, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propBucketCount.TryReadProperty(ref reader, options, PropBucketCount, null)) - { - continue; - } - - if (propExponentialAverageBucketProcessingTimeMs.TryReadProperty(ref reader, options, PropExponentialAverageBucketProcessingTimeMs, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propExponentialAverageBucketProcessingTimePerHourMs.TryReadProperty(ref reader, options, PropExponentialAverageBucketProcessingTimePerHourMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) - { - continue; - } - - if (propMaximumBucketProcessingTimeMs.TryReadProperty(ref reader, options, PropMaximumBucketProcessingTimeMs, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propMinimumBucketProcessingTimeMs.TryReadProperty(ref reader, options, PropMinimumBucketProcessingTimeMs, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTotalBucketProcessingTimeMs.TryReadProperty(ref reader, options, PropTotalBucketProcessingTimeMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.JobTimingStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AverageBucketProcessingTimeMs = propAverageBucketProcessingTimeMs.Value, - BucketCount = propBucketCount.Value, - ExponentialAverageBucketProcessingTimeMs = propExponentialAverageBucketProcessingTimeMs.Value, - ExponentialAverageBucketProcessingTimePerHourMs = propExponentialAverageBucketProcessingTimePerHourMs.Value, - JobId = propJobId.Value, - MaximumBucketProcessingTimeMs = propMaximumBucketProcessingTimeMs.Value, - MinimumBucketProcessingTimeMs = propMinimumBucketProcessingTimeMs.Value, - TotalBucketProcessingTimeMs = propTotalBucketProcessingTimeMs.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.JobTimingStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAverageBucketProcessingTimeMs, value.AverageBucketProcessingTimeMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropBucketCount, value.BucketCount, null, null); - writer.WriteProperty(options, PropExponentialAverageBucketProcessingTimeMs, value.ExponentialAverageBucketProcessingTimeMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropExponentialAverageBucketProcessingTimePerHourMs, value.ExponentialAverageBucketProcessingTimePerHourMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropJobId, value.JobId, null, null); - writer.WriteProperty(options, PropMaximumBucketProcessingTimeMs, value.MaximumBucketProcessingTimeMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropMinimumBucketProcessingTimeMs, value.MinimumBucketProcessingTimeMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTotalBucketProcessingTimeMs, value.TotalBucketProcessingTimeMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.JobTimingStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.JobTimingStatsConverter))] public sealed partial class JobTimingStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JvmStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JvmStats.Converters.g.cs new file mode 100644 index 00000000000..2dc344b1a9f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JvmStats.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class JvmStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropHeapMax = System.Text.Json.JsonEncodedText.Encode("heap_max"); + private static readonly System.Text.Json.JsonEncodedText PropHeapMaxInBytes = System.Text.Json.JsonEncodedText.Encode("heap_max_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropJavaInference = System.Text.Json.JsonEncodedText.Encode("java_inference"); + private static readonly System.Text.Json.JsonEncodedText PropJavaInferenceInBytes = System.Text.Json.JsonEncodedText.Encode("java_inference_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropJavaInferenceMax = System.Text.Json.JsonEncodedText.Encode("java_inference_max"); + private static readonly System.Text.Json.JsonEncodedText PropJavaInferenceMaxInBytes = System.Text.Json.JsonEncodedText.Encode("java_inference_max_in_bytes"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.JvmStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propHeapMax = default; + LocalJsonValue propHeapMaxInBytes = default; + LocalJsonValue propJavaInference = default; + LocalJsonValue propJavaInferenceInBytes = default; + LocalJsonValue propJavaInferenceMax = default; + LocalJsonValue propJavaInferenceMaxInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propHeapMax.TryReadProperty(ref reader, options, PropHeapMax, null)) + { + continue; + } + + if (propHeapMaxInBytes.TryReadProperty(ref reader, options, PropHeapMaxInBytes, null)) + { + continue; + } + + if (propJavaInference.TryReadProperty(ref reader, options, PropJavaInference, null)) + { + continue; + } + + if (propJavaInferenceInBytes.TryReadProperty(ref reader, options, PropJavaInferenceInBytes, null)) + { + continue; + } + + if (propJavaInferenceMax.TryReadProperty(ref reader, options, PropJavaInferenceMax, null)) + { + continue; + } + + if (propJavaInferenceMaxInBytes.TryReadProperty(ref reader, options, PropJavaInferenceMaxInBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.JvmStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + HeapMax = propHeapMax.Value, + HeapMaxInBytes = propHeapMaxInBytes.Value, + JavaInference = propJavaInference.Value, + JavaInferenceInBytes = propJavaInferenceInBytes.Value, + JavaInferenceMax = propJavaInferenceMax.Value, + JavaInferenceMaxInBytes = propJavaInferenceMaxInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.JvmStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropHeapMax, value.HeapMax, null, null); + writer.WriteProperty(options, PropHeapMaxInBytes, value.HeapMaxInBytes, null, null); + writer.WriteProperty(options, PropJavaInference, value.JavaInference, null, null); + writer.WriteProperty(options, PropJavaInferenceInBytes, value.JavaInferenceInBytes, null, null); + writer.WriteProperty(options, PropJavaInferenceMax, value.JavaInferenceMax, null, null); + writer.WriteProperty(options, PropJavaInferenceMaxInBytes, value.JavaInferenceMaxInBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JvmStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JvmStats.g.cs index ca8dbb9c8fe..370984c8719 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JvmStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/JvmStats.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class JvmStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropHeapMax = System.Text.Json.JsonEncodedText.Encode("heap_max"); - private static readonly System.Text.Json.JsonEncodedText PropHeapMaxInBytes = System.Text.Json.JsonEncodedText.Encode("heap_max_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropJavaInference = System.Text.Json.JsonEncodedText.Encode("java_inference"); - private static readonly System.Text.Json.JsonEncodedText PropJavaInferenceInBytes = System.Text.Json.JsonEncodedText.Encode("java_inference_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropJavaInferenceMax = System.Text.Json.JsonEncodedText.Encode("java_inference_max"); - private static readonly System.Text.Json.JsonEncodedText PropJavaInferenceMaxInBytes = System.Text.Json.JsonEncodedText.Encode("java_inference_max_in_bytes"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.JvmStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propHeapMax = default; - LocalJsonValue propHeapMaxInBytes = default; - LocalJsonValue propJavaInference = default; - LocalJsonValue propJavaInferenceInBytes = default; - LocalJsonValue propJavaInferenceMax = default; - LocalJsonValue propJavaInferenceMaxInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propHeapMax.TryReadProperty(ref reader, options, PropHeapMax, null)) - { - continue; - } - - if (propHeapMaxInBytes.TryReadProperty(ref reader, options, PropHeapMaxInBytes, null)) - { - continue; - } - - if (propJavaInference.TryReadProperty(ref reader, options, PropJavaInference, null)) - { - continue; - } - - if (propJavaInferenceInBytes.TryReadProperty(ref reader, options, PropJavaInferenceInBytes, null)) - { - continue; - } - - if (propJavaInferenceMax.TryReadProperty(ref reader, options, PropJavaInferenceMax, null)) - { - continue; - } - - if (propJavaInferenceMaxInBytes.TryReadProperty(ref reader, options, PropJavaInferenceMaxInBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.JvmStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - HeapMax = propHeapMax.Value, - HeapMaxInBytes = propHeapMaxInBytes.Value, - JavaInference = propJavaInference.Value, - JavaInferenceInBytes = propJavaInferenceInBytes.Value, - JavaInferenceMax = propJavaInferenceMax.Value, - JavaInferenceMaxInBytes = propJavaInferenceMaxInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.JvmStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropHeapMax, value.HeapMax, null, null); - writer.WriteProperty(options, PropHeapMaxInBytes, value.HeapMaxInBytes, null, null); - writer.WriteProperty(options, PropJavaInference, value.JavaInference, null, null); - writer.WriteProperty(options, PropJavaInferenceInBytes, value.JavaInferenceInBytes, null, null); - writer.WriteProperty(options, PropJavaInferenceMax, value.JavaInferenceMax, null, null); - writer.WriteProperty(options, PropJavaInferenceMaxInBytes, value.JavaInferenceMaxInBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.JvmStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.JvmStatsConverter))] public sealed partial class JvmStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/LearningToRankConfig.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/LearningToRankConfig.Converters.g.cs new file mode 100644 index 00000000000..3c1024f9ade --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/LearningToRankConfig.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class LearningToRankConfigConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDefaultParams = System.Text.Json.JsonEncodedText.Encode("default_params"); + private static readonly System.Text.Json.JsonEncodedText PropFeatureExtractors = System.Text.Json.JsonEncodedText.Encode("feature_extractors"); + private static readonly System.Text.Json.JsonEncodedText PropNumTopFeatureImportanceValues = System.Text.Json.JsonEncodedText.Encode("num_top_feature_importance_values"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.LearningToRankConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propDefaultParams = default; + LocalJsonValue>?> propFeatureExtractors = default; + LocalJsonValue propNumTopFeatureImportanceValues = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDefaultParams.TryReadProperty(ref reader, options, PropDefaultParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propFeatureExtractors.TryReadProperty(ref reader, options, PropFeatureExtractors, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!))) + { + continue; + } + + if (propNumTopFeatureImportanceValues.TryReadProperty(ref reader, options, PropNumTopFeatureImportanceValues, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.LearningToRankConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DefaultParams = propDefaultParams.Value, + FeatureExtractors = propFeatureExtractors.Value, + NumTopFeatureImportanceValues = propNumTopFeatureImportanceValues.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.LearningToRankConfig value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDefaultParams, value.DefaultParams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropFeatureExtractors, value.FeatureExtractors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, null))); + writer.WriteProperty(options, PropNumTopFeatureImportanceValues, value.NumTopFeatureImportanceValues, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/LearningToRankConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/LearningToRankConfig.g.cs index 45a558e0cda..aee2b3acbef 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/LearningToRankConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/LearningToRankConfig.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class LearningToRankConfigConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDefaultParams = System.Text.Json.JsonEncodedText.Encode("default_params"); - private static readonly System.Text.Json.JsonEncodedText PropFeatureExtractors = System.Text.Json.JsonEncodedText.Encode("feature_extractors"); - private static readonly System.Text.Json.JsonEncodedText PropNumTopFeatureImportanceValues = System.Text.Json.JsonEncodedText.Encode("num_top_feature_importance_values"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.LearningToRankConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propDefaultParams = default; - LocalJsonValue>?> propFeatureExtractors = default; - LocalJsonValue propNumTopFeatureImportanceValues = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDefaultParams.TryReadProperty(ref reader, options, PropDefaultParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propFeatureExtractors.TryReadProperty(ref reader, options, PropFeatureExtractors, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!))) - { - continue; - } - - if (propNumTopFeatureImportanceValues.TryReadProperty(ref reader, options, PropNumTopFeatureImportanceValues, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.LearningToRankConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DefaultParams = propDefaultParams.Value, - FeatureExtractors = propFeatureExtractors.Value, - NumTopFeatureImportanceValues = propNumTopFeatureImportanceValues.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.LearningToRankConfig value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDefaultParams, value.DefaultParams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropFeatureExtractors, value.FeatureExtractors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, null))); - writer.WriteProperty(options, PropNumTopFeatureImportanceValues, value.NumTopFeatureImportanceValues, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.LearningToRankConfigConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.LearningToRankConfigConverter))] public sealed partial class LearningToRankConfig { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Limits.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Limits.Converters.g.cs new file mode 100644 index 00000000000..7604b7fe984 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Limits.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class LimitsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEffectiveMaxModelMemoryLimit = System.Text.Json.JsonEncodedText.Encode("effective_max_model_memory_limit"); + private static readonly System.Text.Json.JsonEncodedText PropMaxModelMemoryLimit = System.Text.Json.JsonEncodedText.Encode("max_model_memory_limit"); + private static readonly System.Text.Json.JsonEncodedText PropMaxSingleMlNodeProcessors = System.Text.Json.JsonEncodedText.Encode("max_single_ml_node_processors"); + private static readonly System.Text.Json.JsonEncodedText PropTotalMlMemory = System.Text.Json.JsonEncodedText.Encode("total_ml_memory"); + private static readonly System.Text.Json.JsonEncodedText PropTotalMlProcessors = System.Text.Json.JsonEncodedText.Encode("total_ml_processors"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.Limits Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEffectiveMaxModelMemoryLimit = default; + LocalJsonValue propMaxModelMemoryLimit = default; + LocalJsonValue propMaxSingleMlNodeProcessors = default; + LocalJsonValue propTotalMlMemory = default; + LocalJsonValue propTotalMlProcessors = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEffectiveMaxModelMemoryLimit.TryReadProperty(ref reader, options, PropEffectiveMaxModelMemoryLimit, null)) + { + continue; + } + + if (propMaxModelMemoryLimit.TryReadProperty(ref reader, options, PropMaxModelMemoryLimit, null)) + { + continue; + } + + if (propMaxSingleMlNodeProcessors.TryReadProperty(ref reader, options, PropMaxSingleMlNodeProcessors, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotalMlMemory.TryReadProperty(ref reader, options, PropTotalMlMemory, null)) + { + continue; + } + + if (propTotalMlProcessors.TryReadProperty(ref reader, options, PropTotalMlProcessors, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.Limits(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + EffectiveMaxModelMemoryLimit = propEffectiveMaxModelMemoryLimit.Value, + MaxModelMemoryLimit = propMaxModelMemoryLimit.Value, + MaxSingleMlNodeProcessors = propMaxSingleMlNodeProcessors.Value, + TotalMlMemory = propTotalMlMemory.Value, + TotalMlProcessors = propTotalMlProcessors.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Limits value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEffectiveMaxModelMemoryLimit, value.EffectiveMaxModelMemoryLimit, null, null); + writer.WriteProperty(options, PropMaxModelMemoryLimit, value.MaxModelMemoryLimit, null, null); + writer.WriteProperty(options, PropMaxSingleMlNodeProcessors, value.MaxSingleMlNodeProcessors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotalMlMemory, value.TotalMlMemory, null, null); + writer.WriteProperty(options, PropTotalMlProcessors, value.TotalMlProcessors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Limits.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Limits.g.cs index fbc671aa8d7..3f0abc70c2c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Limits.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Limits.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class LimitsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEffectiveMaxModelMemoryLimit = System.Text.Json.JsonEncodedText.Encode("effective_max_model_memory_limit"); - private static readonly System.Text.Json.JsonEncodedText PropMaxModelMemoryLimit = System.Text.Json.JsonEncodedText.Encode("max_model_memory_limit"); - private static readonly System.Text.Json.JsonEncodedText PropMaxSingleMlNodeProcessors = System.Text.Json.JsonEncodedText.Encode("max_single_ml_node_processors"); - private static readonly System.Text.Json.JsonEncodedText PropTotalMlMemory = System.Text.Json.JsonEncodedText.Encode("total_ml_memory"); - private static readonly System.Text.Json.JsonEncodedText PropTotalMlProcessors = System.Text.Json.JsonEncodedText.Encode("total_ml_processors"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.Limits Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEffectiveMaxModelMemoryLimit = default; - LocalJsonValue propMaxModelMemoryLimit = default; - LocalJsonValue propMaxSingleMlNodeProcessors = default; - LocalJsonValue propTotalMlMemory = default; - LocalJsonValue propTotalMlProcessors = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEffectiveMaxModelMemoryLimit.TryReadProperty(ref reader, options, PropEffectiveMaxModelMemoryLimit, null)) - { - continue; - } - - if (propMaxModelMemoryLimit.TryReadProperty(ref reader, options, PropMaxModelMemoryLimit, null)) - { - continue; - } - - if (propMaxSingleMlNodeProcessors.TryReadProperty(ref reader, options, PropMaxSingleMlNodeProcessors, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotalMlMemory.TryReadProperty(ref reader, options, PropTotalMlMemory, null)) - { - continue; - } - - if (propTotalMlProcessors.TryReadProperty(ref reader, options, PropTotalMlProcessors, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.Limits(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - EffectiveMaxModelMemoryLimit = propEffectiveMaxModelMemoryLimit.Value, - MaxModelMemoryLimit = propMaxModelMemoryLimit.Value, - MaxSingleMlNodeProcessors = propMaxSingleMlNodeProcessors.Value, - TotalMlMemory = propTotalMlMemory.Value, - TotalMlProcessors = propTotalMlProcessors.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Limits value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEffectiveMaxModelMemoryLimit, value.EffectiveMaxModelMemoryLimit, null, null); - writer.WriteProperty(options, PropMaxModelMemoryLimit, value.MaxModelMemoryLimit, null, null); - writer.WriteProperty(options, PropMaxSingleMlNodeProcessors, value.MaxSingleMlNodeProcessors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotalMlMemory, value.TotalMlMemory, null, null); - writer.WriteProperty(options, PropTotalMlProcessors, value.TotalMlProcessors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.LimitsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.LimitsConverter))] public sealed partial class Limits { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemMlStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemMlStats.Converters.g.cs new file mode 100644 index 00000000000..162d4495f72 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemMlStats.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class MemMlStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnomalyDetectors = System.Text.Json.JsonEncodedText.Encode("anomaly_detectors"); + private static readonly System.Text.Json.JsonEncodedText PropAnomalyDetectorsInBytes = System.Text.Json.JsonEncodedText.Encode("anomaly_detectors_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropDataFrameAnalytics = System.Text.Json.JsonEncodedText.Encode("data_frame_analytics"); + private static readonly System.Text.Json.JsonEncodedText PropDataFrameAnalyticsInBytes = System.Text.Json.JsonEncodedText.Encode("data_frame_analytics_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText PropMaxInBytes = System.Text.Json.JsonEncodedText.Encode("max_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropNativeCodeOverhead = System.Text.Json.JsonEncodedText.Encode("native_code_overhead"); + private static readonly System.Text.Json.JsonEncodedText PropNativeCodeOverheadInBytes = System.Text.Json.JsonEncodedText.Encode("native_code_overhead_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropNativeInference = System.Text.Json.JsonEncodedText.Encode("native_inference"); + private static readonly System.Text.Json.JsonEncodedText PropNativeInferenceInBytes = System.Text.Json.JsonEncodedText.Encode("native_inference_in_bytes"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.MemMlStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnomalyDetectors = default; + LocalJsonValue propAnomalyDetectorsInBytes = default; + LocalJsonValue propDataFrameAnalytics = default; + LocalJsonValue propDataFrameAnalyticsInBytes = default; + LocalJsonValue propMax = default; + LocalJsonValue propMaxInBytes = default; + LocalJsonValue propNativeCodeOverhead = default; + LocalJsonValue propNativeCodeOverheadInBytes = default; + LocalJsonValue propNativeInference = default; + LocalJsonValue propNativeInferenceInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnomalyDetectors.TryReadProperty(ref reader, options, PropAnomalyDetectors, null)) + { + continue; + } + + if (propAnomalyDetectorsInBytes.TryReadProperty(ref reader, options, PropAnomalyDetectorsInBytes, null)) + { + continue; + } + + if (propDataFrameAnalytics.TryReadProperty(ref reader, options, PropDataFrameAnalytics, null)) + { + continue; + } + + if (propDataFrameAnalyticsInBytes.TryReadProperty(ref reader, options, PropDataFrameAnalyticsInBytes, null)) + { + continue; + } + + if (propMax.TryReadProperty(ref reader, options, PropMax, null)) + { + continue; + } + + if (propMaxInBytes.TryReadProperty(ref reader, options, PropMaxInBytes, null)) + { + continue; + } + + if (propNativeCodeOverhead.TryReadProperty(ref reader, options, PropNativeCodeOverhead, null)) + { + continue; + } + + if (propNativeCodeOverheadInBytes.TryReadProperty(ref reader, options, PropNativeCodeOverheadInBytes, null)) + { + continue; + } + + if (propNativeInference.TryReadProperty(ref reader, options, PropNativeInference, null)) + { + continue; + } + + if (propNativeInferenceInBytes.TryReadProperty(ref reader, options, PropNativeInferenceInBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.MemMlStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AnomalyDetectors = propAnomalyDetectors.Value, + AnomalyDetectorsInBytes = propAnomalyDetectorsInBytes.Value, + DataFrameAnalytics = propDataFrameAnalytics.Value, + DataFrameAnalyticsInBytes = propDataFrameAnalyticsInBytes.Value, + Max = propMax.Value, + MaxInBytes = propMaxInBytes.Value, + NativeCodeOverhead = propNativeCodeOverhead.Value, + NativeCodeOverheadInBytes = propNativeCodeOverheadInBytes.Value, + NativeInference = propNativeInference.Value, + NativeInferenceInBytes = propNativeInferenceInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.MemMlStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnomalyDetectors, value.AnomalyDetectors, null, null); + writer.WriteProperty(options, PropAnomalyDetectorsInBytes, value.AnomalyDetectorsInBytes, null, null); + writer.WriteProperty(options, PropDataFrameAnalytics, value.DataFrameAnalytics, null, null); + writer.WriteProperty(options, PropDataFrameAnalyticsInBytes, value.DataFrameAnalyticsInBytes, null, null); + writer.WriteProperty(options, PropMax, value.Max, null, null); + writer.WriteProperty(options, PropMaxInBytes, value.MaxInBytes, null, null); + writer.WriteProperty(options, PropNativeCodeOverhead, value.NativeCodeOverhead, null, null); + writer.WriteProperty(options, PropNativeCodeOverheadInBytes, value.NativeCodeOverheadInBytes, null, null); + writer.WriteProperty(options, PropNativeInference, value.NativeInference, null, null); + writer.WriteProperty(options, PropNativeInferenceInBytes, value.NativeInferenceInBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemMlStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemMlStats.g.cs index c4245e70ba3..983215a613a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemMlStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemMlStats.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class MemMlStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnomalyDetectors = System.Text.Json.JsonEncodedText.Encode("anomaly_detectors"); - private static readonly System.Text.Json.JsonEncodedText PropAnomalyDetectorsInBytes = System.Text.Json.JsonEncodedText.Encode("anomaly_detectors_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropDataFrameAnalytics = System.Text.Json.JsonEncodedText.Encode("data_frame_analytics"); - private static readonly System.Text.Json.JsonEncodedText PropDataFrameAnalyticsInBytes = System.Text.Json.JsonEncodedText.Encode("data_frame_analytics_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); - private static readonly System.Text.Json.JsonEncodedText PropMaxInBytes = System.Text.Json.JsonEncodedText.Encode("max_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropNativeCodeOverhead = System.Text.Json.JsonEncodedText.Encode("native_code_overhead"); - private static readonly System.Text.Json.JsonEncodedText PropNativeCodeOverheadInBytes = System.Text.Json.JsonEncodedText.Encode("native_code_overhead_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropNativeInference = System.Text.Json.JsonEncodedText.Encode("native_inference"); - private static readonly System.Text.Json.JsonEncodedText PropNativeInferenceInBytes = System.Text.Json.JsonEncodedText.Encode("native_inference_in_bytes"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.MemMlStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnomalyDetectors = default; - LocalJsonValue propAnomalyDetectorsInBytes = default; - LocalJsonValue propDataFrameAnalytics = default; - LocalJsonValue propDataFrameAnalyticsInBytes = default; - LocalJsonValue propMax = default; - LocalJsonValue propMaxInBytes = default; - LocalJsonValue propNativeCodeOverhead = default; - LocalJsonValue propNativeCodeOverheadInBytes = default; - LocalJsonValue propNativeInference = default; - LocalJsonValue propNativeInferenceInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnomalyDetectors.TryReadProperty(ref reader, options, PropAnomalyDetectors, null)) - { - continue; - } - - if (propAnomalyDetectorsInBytes.TryReadProperty(ref reader, options, PropAnomalyDetectorsInBytes, null)) - { - continue; - } - - if (propDataFrameAnalytics.TryReadProperty(ref reader, options, PropDataFrameAnalytics, null)) - { - continue; - } - - if (propDataFrameAnalyticsInBytes.TryReadProperty(ref reader, options, PropDataFrameAnalyticsInBytes, null)) - { - continue; - } - - if (propMax.TryReadProperty(ref reader, options, PropMax, null)) - { - continue; - } - - if (propMaxInBytes.TryReadProperty(ref reader, options, PropMaxInBytes, null)) - { - continue; - } - - if (propNativeCodeOverhead.TryReadProperty(ref reader, options, PropNativeCodeOverhead, null)) - { - continue; - } - - if (propNativeCodeOverheadInBytes.TryReadProperty(ref reader, options, PropNativeCodeOverheadInBytes, null)) - { - continue; - } - - if (propNativeInference.TryReadProperty(ref reader, options, PropNativeInference, null)) - { - continue; - } - - if (propNativeInferenceInBytes.TryReadProperty(ref reader, options, PropNativeInferenceInBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.MemMlStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AnomalyDetectors = propAnomalyDetectors.Value, - AnomalyDetectorsInBytes = propAnomalyDetectorsInBytes.Value, - DataFrameAnalytics = propDataFrameAnalytics.Value, - DataFrameAnalyticsInBytes = propDataFrameAnalyticsInBytes.Value, - Max = propMax.Value, - MaxInBytes = propMaxInBytes.Value, - NativeCodeOverhead = propNativeCodeOverhead.Value, - NativeCodeOverheadInBytes = propNativeCodeOverheadInBytes.Value, - NativeInference = propNativeInference.Value, - NativeInferenceInBytes = propNativeInferenceInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.MemMlStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnomalyDetectors, value.AnomalyDetectors, null, null); - writer.WriteProperty(options, PropAnomalyDetectorsInBytes, value.AnomalyDetectorsInBytes, null, null); - writer.WriteProperty(options, PropDataFrameAnalytics, value.DataFrameAnalytics, null, null); - writer.WriteProperty(options, PropDataFrameAnalyticsInBytes, value.DataFrameAnalyticsInBytes, null, null); - writer.WriteProperty(options, PropMax, value.Max, null, null); - writer.WriteProperty(options, PropMaxInBytes, value.MaxInBytes, null, null); - writer.WriteProperty(options, PropNativeCodeOverhead, value.NativeCodeOverhead, null, null); - writer.WriteProperty(options, PropNativeCodeOverheadInBytes, value.NativeCodeOverheadInBytes, null, null); - writer.WriteProperty(options, PropNativeInference, value.NativeInference, null, null); - writer.WriteProperty(options, PropNativeInferenceInBytes, value.NativeInferenceInBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.MemMlStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.MemMlStatsConverter))] public sealed partial class MemMlStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemStats.Converters.g.cs new file mode 100644 index 00000000000..8033c52342c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemStats.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class MemStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAdjustedTotal = System.Text.Json.JsonEncodedText.Encode("adjusted_total"); + private static readonly System.Text.Json.JsonEncodedText PropAdjustedTotalInBytes = System.Text.Json.JsonEncodedText.Encode("adjusted_total_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropMl = System.Text.Json.JsonEncodedText.Encode("ml"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + private static readonly System.Text.Json.JsonEncodedText PropTotalInBytes = System.Text.Json.JsonEncodedText.Encode("total_in_bytes"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.MemStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAdjustedTotal = default; + LocalJsonValue propAdjustedTotalInBytes = default; + LocalJsonValue propMl = default; + LocalJsonValue propTotal = default; + LocalJsonValue propTotalInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAdjustedTotal.TryReadProperty(ref reader, options, PropAdjustedTotal, null)) + { + continue; + } + + if (propAdjustedTotalInBytes.TryReadProperty(ref reader, options, PropAdjustedTotalInBytes, null)) + { + continue; + } + + if (propMl.TryReadProperty(ref reader, options, PropMl, null)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (propTotalInBytes.TryReadProperty(ref reader, options, PropTotalInBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.MemStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AdjustedTotal = propAdjustedTotal.Value, + AdjustedTotalInBytes = propAdjustedTotalInBytes.Value, + Ml = propMl.Value, + Total = propTotal.Value, + TotalInBytes = propTotalInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.MemStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAdjustedTotal, value.AdjustedTotal, null, null); + writer.WriteProperty(options, PropAdjustedTotalInBytes, value.AdjustedTotalInBytes, null, null); + writer.WriteProperty(options, PropMl, value.Ml, null, null); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteProperty(options, PropTotalInBytes, value.TotalInBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemStats.g.cs index b47331c0792..5490df07a4d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemStats.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class MemStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAdjustedTotal = System.Text.Json.JsonEncodedText.Encode("adjusted_total"); - private static readonly System.Text.Json.JsonEncodedText PropAdjustedTotalInBytes = System.Text.Json.JsonEncodedText.Encode("adjusted_total_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropMl = System.Text.Json.JsonEncodedText.Encode("ml"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - private static readonly System.Text.Json.JsonEncodedText PropTotalInBytes = System.Text.Json.JsonEncodedText.Encode("total_in_bytes"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.MemStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAdjustedTotal = default; - LocalJsonValue propAdjustedTotalInBytes = default; - LocalJsonValue propMl = default; - LocalJsonValue propTotal = default; - LocalJsonValue propTotalInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAdjustedTotal.TryReadProperty(ref reader, options, PropAdjustedTotal, null)) - { - continue; - } - - if (propAdjustedTotalInBytes.TryReadProperty(ref reader, options, PropAdjustedTotalInBytes, null)) - { - continue; - } - - if (propMl.TryReadProperty(ref reader, options, PropMl, null)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (propTotalInBytes.TryReadProperty(ref reader, options, PropTotalInBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.MemStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AdjustedTotal = propAdjustedTotal.Value, - AdjustedTotalInBytes = propAdjustedTotalInBytes.Value, - Ml = propMl.Value, - Total = propTotal.Value, - TotalInBytes = propTotalInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.MemStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAdjustedTotal, value.AdjustedTotal, null, null); - writer.WriteProperty(options, PropAdjustedTotalInBytes, value.AdjustedTotalInBytes, null, null); - writer.WriteProperty(options, PropMl, value.Ml, null, null); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteProperty(options, PropTotalInBytes, value.TotalInBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.MemStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.MemStatsConverter))] public sealed partial class MemStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Memory.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Memory.Converters.g.cs new file mode 100644 index 00000000000..13dd1d5fb63 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Memory.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class MemoryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); + private static readonly System.Text.Json.JsonEncodedText PropEphemeralId = System.Text.Json.JsonEncodedText.Encode("ephemeral_id"); + private static readonly System.Text.Json.JsonEncodedText PropJvm = System.Text.Json.JsonEncodedText.Encode("jvm"); + private static readonly System.Text.Json.JsonEncodedText PropMem = System.Text.Json.JsonEncodedText.Encode("mem"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.Memory Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propAttributes = default; + LocalJsonValue propEphemeralId = default; + LocalJsonValue propJvm = default; + LocalJsonValue propMem = default; + LocalJsonValue propName = default; + LocalJsonValue> propRoles = default; + LocalJsonValue propTransportAddress = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propEphemeralId.TryReadProperty(ref reader, options, PropEphemeralId, null)) + { + continue; + } + + if (propJvm.TryReadProperty(ref reader, options, PropJvm, null)) + { + continue; + } + + if (propMem.TryReadProperty(ref reader, options, PropMem, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.Memory(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Attributes = propAttributes.Value, + EphemeralId = propEphemeralId.Value, + Jvm = propJvm.Value, + Mem = propMem.Value, + Name = propName.Value, + Roles = propRoles.Value, + TransportAddress = propTransportAddress.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Memory value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropEphemeralId, value.EphemeralId, null, null); + writer.WriteProperty(options, PropJvm, value.Jvm, null, null); + writer.WriteProperty(options, PropMem, value.Mem, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Memory.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Memory.g.cs index 635650aec8b..114f1078f61 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Memory.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Memory.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class MemoryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); - private static readonly System.Text.Json.JsonEncodedText PropEphemeralId = System.Text.Json.JsonEncodedText.Encode("ephemeral_id"); - private static readonly System.Text.Json.JsonEncodedText PropJvm = System.Text.Json.JsonEncodedText.Encode("jvm"); - private static readonly System.Text.Json.JsonEncodedText PropMem = System.Text.Json.JsonEncodedText.Encode("mem"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); - private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.Memory Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propAttributes = default; - LocalJsonValue propEphemeralId = default; - LocalJsonValue propJvm = default; - LocalJsonValue propMem = default; - LocalJsonValue propName = default; - LocalJsonValue> propRoles = default; - LocalJsonValue propTransportAddress = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propEphemeralId.TryReadProperty(ref reader, options, PropEphemeralId, null)) - { - continue; - } - - if (propJvm.TryReadProperty(ref reader, options, PropJvm, null)) - { - continue; - } - - if (propMem.TryReadProperty(ref reader, options, PropMem, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.Memory(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Attributes = propAttributes.Value, - EphemeralId = propEphemeralId.Value, - Jvm = propJvm.Value, - Mem = propMem.Value, - Name = propName.Value, - Roles = propRoles.Value, - TransportAddress = propTransportAddress.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Memory value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropEphemeralId, value.EphemeralId, null, null); - writer.WriteProperty(options, PropJvm, value.Jvm, null, null); - writer.WriteProperty(options, PropMem, value.Mem, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.MemoryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.MemoryConverter))] public sealed partial class Memory { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemoryStatus.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemoryStatus.Converters.g.cs new file mode 100644 index 00000000000..eb9987b2dfd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemoryStatus.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class MemoryStatusConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberHardLimit = System.Text.Json.JsonEncodedText.Encode("hard_limit"); + private static readonly System.Text.Json.JsonEncodedText MemberOk = System.Text.Json.JsonEncodedText.Encode("ok"); + private static readonly System.Text.Json.JsonEncodedText MemberSoftLimit = System.Text.Json.JsonEncodedText.Encode("soft_limit"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberHardLimit)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus.HardLimit; + } + + if (reader.ValueTextEquals(MemberOk)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus.Ok; + } + + if (reader.ValueTextEquals(MemberSoftLimit)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus.SoftLimit; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberHardLimit.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus.HardLimit; + } + + if (string.Equals(value, MemberOk.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus.Ok; + } + + if (string.Equals(value, MemberSoftLimit.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus.SoftLimit; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus.HardLimit: + writer.WriteStringValue(MemberHardLimit); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus.Ok: + writer.WriteStringValue(MemberOk); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus.SoftLimit: + writer.WriteStringValue(MemberSoftLimit); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.MemoryStatus value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemoryStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemoryStatus.g.cs new file mode 100644 index 00000000000..5b18b2fef80 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/MemoryStatus.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.MemoryStatusConverter))] +public enum MemoryStatus +{ + [System.Runtime.Serialization.EnumMember(Value = "hard_limit")] + HardLimit, + [System.Runtime.Serialization.EnumMember(Value = "ok")] + Ok, + [System.Runtime.Serialization.EnumMember(Value = "soft_limit")] + SoftLimit +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelPackageConfig.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelPackageConfig.Converters.g.cs new file mode 100644 index 00000000000..77c9f689cbc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelPackageConfig.Converters.g.cs @@ -0,0 +1,180 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ModelPackageConfigConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCreateTime = System.Text.Json.JsonEncodedText.Encode("create_time"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceConfig = System.Text.Json.JsonEncodedText.Encode("inference_config"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropMinimumVersion = System.Text.Json.JsonEncodedText.Encode("minimum_version"); + private static readonly System.Text.Json.JsonEncodedText PropModelRepository = System.Text.Json.JsonEncodedText.Encode("model_repository"); + private static readonly System.Text.Json.JsonEncodedText PropModelType = System.Text.Json.JsonEncodedText.Encode("model_type"); + private static readonly System.Text.Json.JsonEncodedText PropPackagedModelId = System.Text.Json.JsonEncodedText.Encode("packaged_model_id"); + private static readonly System.Text.Json.JsonEncodedText PropPlatformArchitecture = System.Text.Json.JsonEncodedText.Encode("platform_architecture"); + private static readonly System.Text.Json.JsonEncodedText PropPrefixStrings = System.Text.Json.JsonEncodedText.Encode("prefix_strings"); + private static readonly System.Text.Json.JsonEncodedText PropSha256 = System.Text.Json.JsonEncodedText.Encode("sha256"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropTags = System.Text.Json.JsonEncodedText.Encode("tags"); + private static readonly System.Text.Json.JsonEncodedText PropVocabularyFile = System.Text.Json.JsonEncodedText.Encode("vocabulary_file"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.ModelPackageConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCreateTime = default; + LocalJsonValue propDescription = default; + LocalJsonValue?> propInferenceConfig = default; + LocalJsonValue?> propMetadata = default; + LocalJsonValue propMinimumVersion = default; + LocalJsonValue propModelRepository = default; + LocalJsonValue propModelType = default; + LocalJsonValue propPackagedModelId = default; + LocalJsonValue propPlatformArchitecture = default; + LocalJsonValue propPrefixStrings = default; + LocalJsonValue propSha256 = default; + LocalJsonValue propSize = default; + LocalJsonValue?> propTags = default; + LocalJsonValue propVocabularyFile = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCreateTime.TryReadProperty(ref reader, options, PropCreateTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propInferenceConfig.TryReadProperty(ref reader, options, PropInferenceConfig, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propMinimumVersion.TryReadProperty(ref reader, options, PropMinimumVersion, null)) + { + continue; + } + + if (propModelRepository.TryReadProperty(ref reader, options, PropModelRepository, null)) + { + continue; + } + + if (propModelType.TryReadProperty(ref reader, options, PropModelType, null)) + { + continue; + } + + if (propPackagedModelId.TryReadProperty(ref reader, options, PropPackagedModelId, null)) + { + continue; + } + + if (propPlatformArchitecture.TryReadProperty(ref reader, options, PropPlatformArchitecture, null)) + { + continue; + } + + if (propPrefixStrings.TryReadProperty(ref reader, options, PropPrefixStrings, null)) + { + continue; + } + + if (propSha256.TryReadProperty(ref reader, options, PropSha256, null)) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, null)) + { + continue; + } + + if (propTags.TryReadProperty(ref reader, options, PropTags, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propVocabularyFile.TryReadProperty(ref reader, options, PropVocabularyFile, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.ModelPackageConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CreateTime = propCreateTime.Value, + Description = propDescription.Value, + InferenceConfig = propInferenceConfig.Value, + Metadata = propMetadata.Value, + MinimumVersion = propMinimumVersion.Value, + ModelRepository = propModelRepository.Value, + ModelType = propModelType.Value, + PackagedModelId = propPackagedModelId.Value, + PlatformArchitecture = propPlatformArchitecture.Value, + PrefixStrings = propPrefixStrings.Value, + Sha256 = propSha256.Value, + Size = propSize.Value, + Tags = propTags.Value, + VocabularyFile = propVocabularyFile.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ModelPackageConfig value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCreateTime, value.CreateTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropInferenceConfig, value.InferenceConfig, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropMinimumVersion, value.MinimumVersion, null, null); + writer.WriteProperty(options, PropModelRepository, value.ModelRepository, null, null); + writer.WriteProperty(options, PropModelType, value.ModelType, null, null); + writer.WriteProperty(options, PropPackagedModelId, value.PackagedModelId, null, null); + writer.WriteProperty(options, PropPlatformArchitecture, value.PlatformArchitecture, null, null); + writer.WriteProperty(options, PropPrefixStrings, value.PrefixStrings, null, null); + writer.WriteProperty(options, PropSha256, value.Sha256, null, null); + writer.WriteProperty(options, PropSize, value.Size, null, null); + writer.WriteProperty(options, PropTags, value.Tags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropVocabularyFile, value.VocabularyFile, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelPackageConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelPackageConfig.g.cs index 03158e689e9..822bce78cfe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelPackageConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelPackageConfig.g.cs @@ -23,163 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class ModelPackageConfigConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCreateTime = System.Text.Json.JsonEncodedText.Encode("create_time"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceConfig = System.Text.Json.JsonEncodedText.Encode("inference_config"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropMinimumVersion = System.Text.Json.JsonEncodedText.Encode("minimum_version"); - private static readonly System.Text.Json.JsonEncodedText PropModelRepository = System.Text.Json.JsonEncodedText.Encode("model_repository"); - private static readonly System.Text.Json.JsonEncodedText PropModelType = System.Text.Json.JsonEncodedText.Encode("model_type"); - private static readonly System.Text.Json.JsonEncodedText PropPackagedModelId = System.Text.Json.JsonEncodedText.Encode("packaged_model_id"); - private static readonly System.Text.Json.JsonEncodedText PropPlatformArchitecture = System.Text.Json.JsonEncodedText.Encode("platform_architecture"); - private static readonly System.Text.Json.JsonEncodedText PropPrefixStrings = System.Text.Json.JsonEncodedText.Encode("prefix_strings"); - private static readonly System.Text.Json.JsonEncodedText PropSha256 = System.Text.Json.JsonEncodedText.Encode("sha256"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropTags = System.Text.Json.JsonEncodedText.Encode("tags"); - private static readonly System.Text.Json.JsonEncodedText PropVocabularyFile = System.Text.Json.JsonEncodedText.Encode("vocabulary_file"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.ModelPackageConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCreateTime = default; - LocalJsonValue propDescription = default; - LocalJsonValue?> propInferenceConfig = default; - LocalJsonValue?> propMetadata = default; - LocalJsonValue propMinimumVersion = default; - LocalJsonValue propModelRepository = default; - LocalJsonValue propModelType = default; - LocalJsonValue propPackagedModelId = default; - LocalJsonValue propPlatformArchitecture = default; - LocalJsonValue propPrefixStrings = default; - LocalJsonValue propSha256 = default; - LocalJsonValue propSize = default; - LocalJsonValue?> propTags = default; - LocalJsonValue propVocabularyFile = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCreateTime.TryReadProperty(ref reader, options, PropCreateTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propInferenceConfig.TryReadProperty(ref reader, options, PropInferenceConfig, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propMinimumVersion.TryReadProperty(ref reader, options, PropMinimumVersion, null)) - { - continue; - } - - if (propModelRepository.TryReadProperty(ref reader, options, PropModelRepository, null)) - { - continue; - } - - if (propModelType.TryReadProperty(ref reader, options, PropModelType, null)) - { - continue; - } - - if (propPackagedModelId.TryReadProperty(ref reader, options, PropPackagedModelId, null)) - { - continue; - } - - if (propPlatformArchitecture.TryReadProperty(ref reader, options, PropPlatformArchitecture, null)) - { - continue; - } - - if (propPrefixStrings.TryReadProperty(ref reader, options, PropPrefixStrings, null)) - { - continue; - } - - if (propSha256.TryReadProperty(ref reader, options, PropSha256, null)) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, null)) - { - continue; - } - - if (propTags.TryReadProperty(ref reader, options, PropTags, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propVocabularyFile.TryReadProperty(ref reader, options, PropVocabularyFile, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.ModelPackageConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CreateTime = propCreateTime.Value, - Description = propDescription.Value, - InferenceConfig = propInferenceConfig.Value, - Metadata = propMetadata.Value, - MinimumVersion = propMinimumVersion.Value, - ModelRepository = propModelRepository.Value, - ModelType = propModelType.Value, - PackagedModelId = propPackagedModelId.Value, - PlatformArchitecture = propPlatformArchitecture.Value, - PrefixStrings = propPrefixStrings.Value, - Sha256 = propSha256.Value, - Size = propSize.Value, - Tags = propTags.Value, - VocabularyFile = propVocabularyFile.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ModelPackageConfig value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCreateTime, value.CreateTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropInferenceConfig, value.InferenceConfig, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropMinimumVersion, value.MinimumVersion, null, null); - writer.WriteProperty(options, PropModelRepository, value.ModelRepository, null, null); - writer.WriteProperty(options, PropModelType, value.ModelType, null, null); - writer.WriteProperty(options, PropPackagedModelId, value.PackagedModelId, null, null); - writer.WriteProperty(options, PropPlatformArchitecture, value.PlatformArchitecture, null, null); - writer.WriteProperty(options, PropPrefixStrings, value.PrefixStrings, null, null); - writer.WriteProperty(options, PropSha256, value.Sha256, null, null); - writer.WriteProperty(options, PropSize, value.Size, null, null); - writer.WriteProperty(options, PropTags, value.Tags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropVocabularyFile, value.VocabularyFile, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ModelPackageConfigConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ModelPackageConfigConverter))] public sealed partial class ModelPackageConfig { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelPlotConfig.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelPlotConfig.Converters.g.cs new file mode 100644 index 00000000000..0681070fc65 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelPlotConfig.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ModelPlotConfigConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnnotationsEnabled = System.Text.Json.JsonEncodedText.Encode("annotations_enabled"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropTerms = System.Text.Json.JsonEncodedText.Encode("terms"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnnotationsEnabled = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propTerms = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnnotationsEnabled.TryReadProperty(ref reader, options, PropAnnotationsEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTerms.TryReadProperty(ref reader, options, PropTerms, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AnnotationsEnabled = propAnnotationsEnabled.Value, + Enabled = propEnabled.Value, + Terms = propTerms.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfig value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnnotationsEnabled, value.AnnotationsEnabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTerms, value.Terms, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelPlotConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelPlotConfig.g.cs index 74d2a5931e5..a510891eea2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelPlotConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelPlotConfig.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class ModelPlotConfigConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnnotationsEnabled = System.Text.Json.JsonEncodedText.Encode("annotations_enabled"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropTerms = System.Text.Json.JsonEncodedText.Encode("terms"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnnotationsEnabled = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propTerms = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnnotationsEnabled.TryReadProperty(ref reader, options, PropAnnotationsEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTerms.TryReadProperty(ref reader, options, PropTerms, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AnnotationsEnabled = propAnnotationsEnabled.Value, - Enabled = propEnabled.Value, - Terms = propTerms.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfig value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnnotationsEnabled, value.AnnotationsEnabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTerms, value.Terms, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ModelPlotConfigConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ModelPlotConfigConverter))] public sealed partial class ModelPlotConfig { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSizeStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSizeStats.Converters.g.cs new file mode 100644 index 00000000000..0fdd0baae8d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSizeStats.Converters.g.cs @@ -0,0 +1,252 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ModelSizeStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAssignmentMemoryBasis = System.Text.Json.JsonEncodedText.Encode("assignment_memory_basis"); + private static readonly System.Text.Json.JsonEncodedText PropBucketAllocationFailuresCount = System.Text.Json.JsonEncodedText.Encode("bucket_allocation_failures_count"); + private static readonly System.Text.Json.JsonEncodedText PropCategorizationStatus = System.Text.Json.JsonEncodedText.Encode("categorization_status"); + private static readonly System.Text.Json.JsonEncodedText PropCategorizedDocCount = System.Text.Json.JsonEncodedText.Encode("categorized_doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropDeadCategoryCount = System.Text.Json.JsonEncodedText.Encode("dead_category_count"); + private static readonly System.Text.Json.JsonEncodedText PropFailedCategoryCount = System.Text.Json.JsonEncodedText.Encode("failed_category_count"); + private static readonly System.Text.Json.JsonEncodedText PropFrequentCategoryCount = System.Text.Json.JsonEncodedText.Encode("frequent_category_count"); + private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); + private static readonly System.Text.Json.JsonEncodedText PropLogTime = System.Text.Json.JsonEncodedText.Encode("log_time"); + private static readonly System.Text.Json.JsonEncodedText PropMemoryStatus = System.Text.Json.JsonEncodedText.Encode("memory_status"); + private static readonly System.Text.Json.JsonEncodedText PropModelBytes = System.Text.Json.JsonEncodedText.Encode("model_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropModelBytesExceeded = System.Text.Json.JsonEncodedText.Encode("model_bytes_exceeded"); + private static readonly System.Text.Json.JsonEncodedText PropModelBytesMemoryLimit = System.Text.Json.JsonEncodedText.Encode("model_bytes_memory_limit"); + private static readonly System.Text.Json.JsonEncodedText PropOutputMemoryAllocatorBytes = System.Text.Json.JsonEncodedText.Encode("output_memory_allocator_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropPeakModelBytes = System.Text.Json.JsonEncodedText.Encode("peak_model_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropRareCategoryCount = System.Text.Json.JsonEncodedText.Encode("rare_category_count"); + private static readonly System.Text.Json.JsonEncodedText PropResultType = System.Text.Json.JsonEncodedText.Encode("result_type"); + private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); + private static readonly System.Text.Json.JsonEncodedText PropTotalByFieldCount = System.Text.Json.JsonEncodedText.Encode("total_by_field_count"); + private static readonly System.Text.Json.JsonEncodedText PropTotalCategoryCount = System.Text.Json.JsonEncodedText.Encode("total_category_count"); + private static readonly System.Text.Json.JsonEncodedText PropTotalOverFieldCount = System.Text.Json.JsonEncodedText.Encode("total_over_field_count"); + private static readonly System.Text.Json.JsonEncodedText PropTotalPartitionFieldCount = System.Text.Json.JsonEncodedText.Encode("total_partition_field_count"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.ModelSizeStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAssignmentMemoryBasis = default; + LocalJsonValue propBucketAllocationFailuresCount = default; + LocalJsonValue propCategorizationStatus = default; + LocalJsonValue propCategorizedDocCount = default; + LocalJsonValue propDeadCategoryCount = default; + LocalJsonValue propFailedCategoryCount = default; + LocalJsonValue propFrequentCategoryCount = default; + LocalJsonValue propJobId = default; + LocalJsonValue propLogTime = default; + LocalJsonValue propMemoryStatus = default; + LocalJsonValue propModelBytes = default; + LocalJsonValue propModelBytesExceeded = default; + LocalJsonValue propModelBytesMemoryLimit = default; + LocalJsonValue propOutputMemoryAllocatorBytes = default; + LocalJsonValue propPeakModelBytes = default; + LocalJsonValue propRareCategoryCount = default; + LocalJsonValue propResultType = default; + LocalJsonValue propTimestamp = default; + LocalJsonValue propTotalByFieldCount = default; + LocalJsonValue propTotalCategoryCount = default; + LocalJsonValue propTotalOverFieldCount = default; + LocalJsonValue propTotalPartitionFieldCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAssignmentMemoryBasis.TryReadProperty(ref reader, options, PropAssignmentMemoryBasis, null)) + { + continue; + } + + if (propBucketAllocationFailuresCount.TryReadProperty(ref reader, options, PropBucketAllocationFailuresCount, null)) + { + continue; + } + + if (propCategorizationStatus.TryReadProperty(ref reader, options, PropCategorizationStatus, null)) + { + continue; + } + + if (propCategorizedDocCount.TryReadProperty(ref reader, options, PropCategorizedDocCount, null)) + { + continue; + } + + if (propDeadCategoryCount.TryReadProperty(ref reader, options, PropDeadCategoryCount, null)) + { + continue; + } + + if (propFailedCategoryCount.TryReadProperty(ref reader, options, PropFailedCategoryCount, null)) + { + continue; + } + + if (propFrequentCategoryCount.TryReadProperty(ref reader, options, PropFrequentCategoryCount, null)) + { + continue; + } + + if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) + { + continue; + } + + if (propLogTime.TryReadProperty(ref reader, options, PropLogTime, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propMemoryStatus.TryReadProperty(ref reader, options, PropMemoryStatus, null)) + { + continue; + } + + if (propModelBytes.TryReadProperty(ref reader, options, PropModelBytes, null)) + { + continue; + } + + if (propModelBytesExceeded.TryReadProperty(ref reader, options, PropModelBytesExceeded, null)) + { + continue; + } + + if (propModelBytesMemoryLimit.TryReadProperty(ref reader, options, PropModelBytesMemoryLimit, null)) + { + continue; + } + + if (propOutputMemoryAllocatorBytes.TryReadProperty(ref reader, options, PropOutputMemoryAllocatorBytes, null)) + { + continue; + } + + if (propPeakModelBytes.TryReadProperty(ref reader, options, PropPeakModelBytes, null)) + { + continue; + } + + if (propRareCategoryCount.TryReadProperty(ref reader, options, PropRareCategoryCount, null)) + { + continue; + } + + if (propResultType.TryReadProperty(ref reader, options, PropResultType, null)) + { + continue; + } + + if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotalByFieldCount.TryReadProperty(ref reader, options, PropTotalByFieldCount, null)) + { + continue; + } + + if (propTotalCategoryCount.TryReadProperty(ref reader, options, PropTotalCategoryCount, null)) + { + continue; + } + + if (propTotalOverFieldCount.TryReadProperty(ref reader, options, PropTotalOverFieldCount, null)) + { + continue; + } + + if (propTotalPartitionFieldCount.TryReadProperty(ref reader, options, PropTotalPartitionFieldCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.ModelSizeStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AssignmentMemoryBasis = propAssignmentMemoryBasis.Value, + BucketAllocationFailuresCount = propBucketAllocationFailuresCount.Value, + CategorizationStatus = propCategorizationStatus.Value, + CategorizedDocCount = propCategorizedDocCount.Value, + DeadCategoryCount = propDeadCategoryCount.Value, + FailedCategoryCount = propFailedCategoryCount.Value, + FrequentCategoryCount = propFrequentCategoryCount.Value, + JobId = propJobId.Value, + LogTime = propLogTime.Value, + MemoryStatus = propMemoryStatus.Value, + ModelBytes = propModelBytes.Value, + ModelBytesExceeded = propModelBytesExceeded.Value, + ModelBytesMemoryLimit = propModelBytesMemoryLimit.Value, + OutputMemoryAllocatorBytes = propOutputMemoryAllocatorBytes.Value, + PeakModelBytes = propPeakModelBytes.Value, + RareCategoryCount = propRareCategoryCount.Value, + ResultType = propResultType.Value, + Timestamp = propTimestamp.Value, + TotalByFieldCount = propTotalByFieldCount.Value, + TotalCategoryCount = propTotalCategoryCount.Value, + TotalOverFieldCount = propTotalOverFieldCount.Value, + TotalPartitionFieldCount = propTotalPartitionFieldCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ModelSizeStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAssignmentMemoryBasis, value.AssignmentMemoryBasis, null, null); + writer.WriteProperty(options, PropBucketAllocationFailuresCount, value.BucketAllocationFailuresCount, null, null); + writer.WriteProperty(options, PropCategorizationStatus, value.CategorizationStatus, null, null); + writer.WriteProperty(options, PropCategorizedDocCount, value.CategorizedDocCount, null, null); + writer.WriteProperty(options, PropDeadCategoryCount, value.DeadCategoryCount, null, null); + writer.WriteProperty(options, PropFailedCategoryCount, value.FailedCategoryCount, null, null); + writer.WriteProperty(options, PropFrequentCategoryCount, value.FrequentCategoryCount, null, null); + writer.WriteProperty(options, PropJobId, value.JobId, null, null); + writer.WriteProperty(options, PropLogTime, value.LogTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropMemoryStatus, value.MemoryStatus, null, null); + writer.WriteProperty(options, PropModelBytes, value.ModelBytes, null, null); + writer.WriteProperty(options, PropModelBytesExceeded, value.ModelBytesExceeded, null, null); + writer.WriteProperty(options, PropModelBytesMemoryLimit, value.ModelBytesMemoryLimit, null, null); + writer.WriteProperty(options, PropOutputMemoryAllocatorBytes, value.OutputMemoryAllocatorBytes, null, null); + writer.WriteProperty(options, PropPeakModelBytes, value.PeakModelBytes, null, null); + writer.WriteProperty(options, PropRareCategoryCount, value.RareCategoryCount, null, null); + writer.WriteProperty(options, PropResultType, value.ResultType, null, null); + writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotalByFieldCount, value.TotalByFieldCount, null, null); + writer.WriteProperty(options, PropTotalCategoryCount, value.TotalCategoryCount, null, null); + writer.WriteProperty(options, PropTotalOverFieldCount, value.TotalOverFieldCount, null, null); + writer.WriteProperty(options, PropTotalPartitionFieldCount, value.TotalPartitionFieldCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSizeStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSizeStats.g.cs index 8ba7eb35939..46cdc0d555f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSizeStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSizeStats.g.cs @@ -23,235 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class ModelSizeStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAssignmentMemoryBasis = System.Text.Json.JsonEncodedText.Encode("assignment_memory_basis"); - private static readonly System.Text.Json.JsonEncodedText PropBucketAllocationFailuresCount = System.Text.Json.JsonEncodedText.Encode("bucket_allocation_failures_count"); - private static readonly System.Text.Json.JsonEncodedText PropCategorizationStatus = System.Text.Json.JsonEncodedText.Encode("categorization_status"); - private static readonly System.Text.Json.JsonEncodedText PropCategorizedDocCount = System.Text.Json.JsonEncodedText.Encode("categorized_doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropDeadCategoryCount = System.Text.Json.JsonEncodedText.Encode("dead_category_count"); - private static readonly System.Text.Json.JsonEncodedText PropFailedCategoryCount = System.Text.Json.JsonEncodedText.Encode("failed_category_count"); - private static readonly System.Text.Json.JsonEncodedText PropFrequentCategoryCount = System.Text.Json.JsonEncodedText.Encode("frequent_category_count"); - private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); - private static readonly System.Text.Json.JsonEncodedText PropLogTime = System.Text.Json.JsonEncodedText.Encode("log_time"); - private static readonly System.Text.Json.JsonEncodedText PropMemoryStatus = System.Text.Json.JsonEncodedText.Encode("memory_status"); - private static readonly System.Text.Json.JsonEncodedText PropModelBytes = System.Text.Json.JsonEncodedText.Encode("model_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropModelBytesExceeded = System.Text.Json.JsonEncodedText.Encode("model_bytes_exceeded"); - private static readonly System.Text.Json.JsonEncodedText PropModelBytesMemoryLimit = System.Text.Json.JsonEncodedText.Encode("model_bytes_memory_limit"); - private static readonly System.Text.Json.JsonEncodedText PropOutputMemoryAllocatorBytes = System.Text.Json.JsonEncodedText.Encode("output_memory_allocator_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropPeakModelBytes = System.Text.Json.JsonEncodedText.Encode("peak_model_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropRareCategoryCount = System.Text.Json.JsonEncodedText.Encode("rare_category_count"); - private static readonly System.Text.Json.JsonEncodedText PropResultType = System.Text.Json.JsonEncodedText.Encode("result_type"); - private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); - private static readonly System.Text.Json.JsonEncodedText PropTotalByFieldCount = System.Text.Json.JsonEncodedText.Encode("total_by_field_count"); - private static readonly System.Text.Json.JsonEncodedText PropTotalCategoryCount = System.Text.Json.JsonEncodedText.Encode("total_category_count"); - private static readonly System.Text.Json.JsonEncodedText PropTotalOverFieldCount = System.Text.Json.JsonEncodedText.Encode("total_over_field_count"); - private static readonly System.Text.Json.JsonEncodedText PropTotalPartitionFieldCount = System.Text.Json.JsonEncodedText.Encode("total_partition_field_count"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.ModelSizeStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAssignmentMemoryBasis = default; - LocalJsonValue propBucketAllocationFailuresCount = default; - LocalJsonValue propCategorizationStatus = default; - LocalJsonValue propCategorizedDocCount = default; - LocalJsonValue propDeadCategoryCount = default; - LocalJsonValue propFailedCategoryCount = default; - LocalJsonValue propFrequentCategoryCount = default; - LocalJsonValue propJobId = default; - LocalJsonValue propLogTime = default; - LocalJsonValue propMemoryStatus = default; - LocalJsonValue propModelBytes = default; - LocalJsonValue propModelBytesExceeded = default; - LocalJsonValue propModelBytesMemoryLimit = default; - LocalJsonValue propOutputMemoryAllocatorBytes = default; - LocalJsonValue propPeakModelBytes = default; - LocalJsonValue propRareCategoryCount = default; - LocalJsonValue propResultType = default; - LocalJsonValue propTimestamp = default; - LocalJsonValue propTotalByFieldCount = default; - LocalJsonValue propTotalCategoryCount = default; - LocalJsonValue propTotalOverFieldCount = default; - LocalJsonValue propTotalPartitionFieldCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAssignmentMemoryBasis.TryReadProperty(ref reader, options, PropAssignmentMemoryBasis, null)) - { - continue; - } - - if (propBucketAllocationFailuresCount.TryReadProperty(ref reader, options, PropBucketAllocationFailuresCount, null)) - { - continue; - } - - if (propCategorizationStatus.TryReadProperty(ref reader, options, PropCategorizationStatus, null)) - { - continue; - } - - if (propCategorizedDocCount.TryReadProperty(ref reader, options, PropCategorizedDocCount, null)) - { - continue; - } - - if (propDeadCategoryCount.TryReadProperty(ref reader, options, PropDeadCategoryCount, null)) - { - continue; - } - - if (propFailedCategoryCount.TryReadProperty(ref reader, options, PropFailedCategoryCount, null)) - { - continue; - } - - if (propFrequentCategoryCount.TryReadProperty(ref reader, options, PropFrequentCategoryCount, null)) - { - continue; - } - - if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) - { - continue; - } - - if (propLogTime.TryReadProperty(ref reader, options, PropLogTime, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propMemoryStatus.TryReadProperty(ref reader, options, PropMemoryStatus, null)) - { - continue; - } - - if (propModelBytes.TryReadProperty(ref reader, options, PropModelBytes, null)) - { - continue; - } - - if (propModelBytesExceeded.TryReadProperty(ref reader, options, PropModelBytesExceeded, null)) - { - continue; - } - - if (propModelBytesMemoryLimit.TryReadProperty(ref reader, options, PropModelBytesMemoryLimit, null)) - { - continue; - } - - if (propOutputMemoryAllocatorBytes.TryReadProperty(ref reader, options, PropOutputMemoryAllocatorBytes, null)) - { - continue; - } - - if (propPeakModelBytes.TryReadProperty(ref reader, options, PropPeakModelBytes, null)) - { - continue; - } - - if (propRareCategoryCount.TryReadProperty(ref reader, options, PropRareCategoryCount, null)) - { - continue; - } - - if (propResultType.TryReadProperty(ref reader, options, PropResultType, null)) - { - continue; - } - - if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotalByFieldCount.TryReadProperty(ref reader, options, PropTotalByFieldCount, null)) - { - continue; - } - - if (propTotalCategoryCount.TryReadProperty(ref reader, options, PropTotalCategoryCount, null)) - { - continue; - } - - if (propTotalOverFieldCount.TryReadProperty(ref reader, options, PropTotalOverFieldCount, null)) - { - continue; - } - - if (propTotalPartitionFieldCount.TryReadProperty(ref reader, options, PropTotalPartitionFieldCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.ModelSizeStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AssignmentMemoryBasis = propAssignmentMemoryBasis.Value, - BucketAllocationFailuresCount = propBucketAllocationFailuresCount.Value, - CategorizationStatus = propCategorizationStatus.Value, - CategorizedDocCount = propCategorizedDocCount.Value, - DeadCategoryCount = propDeadCategoryCount.Value, - FailedCategoryCount = propFailedCategoryCount.Value, - FrequentCategoryCount = propFrequentCategoryCount.Value, - JobId = propJobId.Value, - LogTime = propLogTime.Value, - MemoryStatus = propMemoryStatus.Value, - ModelBytes = propModelBytes.Value, - ModelBytesExceeded = propModelBytesExceeded.Value, - ModelBytesMemoryLimit = propModelBytesMemoryLimit.Value, - OutputMemoryAllocatorBytes = propOutputMemoryAllocatorBytes.Value, - PeakModelBytes = propPeakModelBytes.Value, - RareCategoryCount = propRareCategoryCount.Value, - ResultType = propResultType.Value, - Timestamp = propTimestamp.Value, - TotalByFieldCount = propTotalByFieldCount.Value, - TotalCategoryCount = propTotalCategoryCount.Value, - TotalOverFieldCount = propTotalOverFieldCount.Value, - TotalPartitionFieldCount = propTotalPartitionFieldCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ModelSizeStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAssignmentMemoryBasis, value.AssignmentMemoryBasis, null, null); - writer.WriteProperty(options, PropBucketAllocationFailuresCount, value.BucketAllocationFailuresCount, null, null); - writer.WriteProperty(options, PropCategorizationStatus, value.CategorizationStatus, null, null); - writer.WriteProperty(options, PropCategorizedDocCount, value.CategorizedDocCount, null, null); - writer.WriteProperty(options, PropDeadCategoryCount, value.DeadCategoryCount, null, null); - writer.WriteProperty(options, PropFailedCategoryCount, value.FailedCategoryCount, null, null); - writer.WriteProperty(options, PropFrequentCategoryCount, value.FrequentCategoryCount, null, null); - writer.WriteProperty(options, PropJobId, value.JobId, null, null); - writer.WriteProperty(options, PropLogTime, value.LogTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropMemoryStatus, value.MemoryStatus, null, null); - writer.WriteProperty(options, PropModelBytes, value.ModelBytes, null, null); - writer.WriteProperty(options, PropModelBytesExceeded, value.ModelBytesExceeded, null, null); - writer.WriteProperty(options, PropModelBytesMemoryLimit, value.ModelBytesMemoryLimit, null, null); - writer.WriteProperty(options, PropOutputMemoryAllocatorBytes, value.OutputMemoryAllocatorBytes, null, null); - writer.WriteProperty(options, PropPeakModelBytes, value.PeakModelBytes, null, null); - writer.WriteProperty(options, PropRareCategoryCount, value.RareCategoryCount, null, null); - writer.WriteProperty(options, PropResultType, value.ResultType, null, null); - writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotalByFieldCount, value.TotalByFieldCount, null, null); - writer.WriteProperty(options, PropTotalCategoryCount, value.TotalCategoryCount, null, null); - writer.WriteProperty(options, PropTotalOverFieldCount, value.TotalOverFieldCount, null, null); - writer.WriteProperty(options, PropTotalPartitionFieldCount, value.TotalPartitionFieldCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ModelSizeStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ModelSizeStatsConverter))] public sealed partial class ModelSizeStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSnapshot.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSnapshot.Converters.g.cs new file mode 100644 index 00000000000..f12110c0219 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSnapshot.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ModelSnapshotConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); + private static readonly System.Text.Json.JsonEncodedText PropLatestRecordTimeStamp = System.Text.Json.JsonEncodedText.Encode("latest_record_time_stamp"); + private static readonly System.Text.Json.JsonEncodedText PropLatestResultTimeStamp = System.Text.Json.JsonEncodedText.Encode("latest_result_time_stamp"); + private static readonly System.Text.Json.JsonEncodedText PropMinVersion = System.Text.Json.JsonEncodedText.Encode("min_version"); + private static readonly System.Text.Json.JsonEncodedText PropModelSizeStats = System.Text.Json.JsonEncodedText.Encode("model_size_stats"); + private static readonly System.Text.Json.JsonEncodedText PropRetain = System.Text.Json.JsonEncodedText.Encode("retain"); + private static readonly System.Text.Json.JsonEncodedText PropSnapshotDocCount = System.Text.Json.JsonEncodedText.Encode("snapshot_doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropSnapshotId = System.Text.Json.JsonEncodedText.Encode("snapshot_id"); + private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.ModelSnapshot Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDescription = default; + LocalJsonValue propJobId = default; + LocalJsonValue propLatestRecordTimeStamp = default; + LocalJsonValue propLatestResultTimeStamp = default; + LocalJsonValue propMinVersion = default; + LocalJsonValue propModelSizeStats = default; + LocalJsonValue propRetain = default; + LocalJsonValue propSnapshotDocCount = default; + LocalJsonValue propSnapshotId = default; + LocalJsonValue propTimestamp = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) + { + continue; + } + + if (propLatestRecordTimeStamp.TryReadProperty(ref reader, options, PropLatestRecordTimeStamp, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLatestResultTimeStamp.TryReadProperty(ref reader, options, PropLatestResultTimeStamp, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinVersion.TryReadProperty(ref reader, options, PropMinVersion, null)) + { + continue; + } + + if (propModelSizeStats.TryReadProperty(ref reader, options, PropModelSizeStats, null)) + { + continue; + } + + if (propRetain.TryReadProperty(ref reader, options, PropRetain, null)) + { + continue; + } + + if (propSnapshotDocCount.TryReadProperty(ref reader, options, PropSnapshotDocCount, null)) + { + continue; + } + + if (propSnapshotId.TryReadProperty(ref reader, options, PropSnapshotId, null)) + { + continue; + } + + if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.ModelSnapshot(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Description = propDescription.Value, + JobId = propJobId.Value, + LatestRecordTimeStamp = propLatestRecordTimeStamp.Value, + LatestResultTimeStamp = propLatestResultTimeStamp.Value, + MinVersion = propMinVersion.Value, + ModelSizeStats = propModelSizeStats.Value, + Retain = propRetain.Value, + SnapshotDocCount = propSnapshotDocCount.Value, + SnapshotId = propSnapshotId.Value, + Timestamp = propTimestamp.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ModelSnapshot value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropJobId, value.JobId, null, null); + writer.WriteProperty(options, PropLatestRecordTimeStamp, value.LatestRecordTimeStamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLatestResultTimeStamp, value.LatestResultTimeStamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinVersion, value.MinVersion, null, null); + writer.WriteProperty(options, PropModelSizeStats, value.ModelSizeStats, null, null); + writer.WriteProperty(options, PropRetain, value.Retain, null, null); + writer.WriteProperty(options, PropSnapshotDocCount, value.SnapshotDocCount, null, null); + writer.WriteProperty(options, PropSnapshotId, value.SnapshotId, null, null); + writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSnapshot.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSnapshot.g.cs index 2c63809a87e..d6e3250f80c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSnapshot.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSnapshot.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class ModelSnapshotConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); - private static readonly System.Text.Json.JsonEncodedText PropLatestRecordTimeStamp = System.Text.Json.JsonEncodedText.Encode("latest_record_time_stamp"); - private static readonly System.Text.Json.JsonEncodedText PropLatestResultTimeStamp = System.Text.Json.JsonEncodedText.Encode("latest_result_time_stamp"); - private static readonly System.Text.Json.JsonEncodedText PropMinVersion = System.Text.Json.JsonEncodedText.Encode("min_version"); - private static readonly System.Text.Json.JsonEncodedText PropModelSizeStats = System.Text.Json.JsonEncodedText.Encode("model_size_stats"); - private static readonly System.Text.Json.JsonEncodedText PropRetain = System.Text.Json.JsonEncodedText.Encode("retain"); - private static readonly System.Text.Json.JsonEncodedText PropSnapshotDocCount = System.Text.Json.JsonEncodedText.Encode("snapshot_doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropSnapshotId = System.Text.Json.JsonEncodedText.Encode("snapshot_id"); - private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.ModelSnapshot Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDescription = default; - LocalJsonValue propJobId = default; - LocalJsonValue propLatestRecordTimeStamp = default; - LocalJsonValue propLatestResultTimeStamp = default; - LocalJsonValue propMinVersion = default; - LocalJsonValue propModelSizeStats = default; - LocalJsonValue propRetain = default; - LocalJsonValue propSnapshotDocCount = default; - LocalJsonValue propSnapshotId = default; - LocalJsonValue propTimestamp = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) - { - continue; - } - - if (propLatestRecordTimeStamp.TryReadProperty(ref reader, options, PropLatestRecordTimeStamp, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLatestResultTimeStamp.TryReadProperty(ref reader, options, PropLatestResultTimeStamp, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinVersion.TryReadProperty(ref reader, options, PropMinVersion, null)) - { - continue; - } - - if (propModelSizeStats.TryReadProperty(ref reader, options, PropModelSizeStats, null)) - { - continue; - } - - if (propRetain.TryReadProperty(ref reader, options, PropRetain, null)) - { - continue; - } - - if (propSnapshotDocCount.TryReadProperty(ref reader, options, PropSnapshotDocCount, null)) - { - continue; - } - - if (propSnapshotId.TryReadProperty(ref reader, options, PropSnapshotId, null)) - { - continue; - } - - if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.ModelSnapshot(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Description = propDescription.Value, - JobId = propJobId.Value, - LatestRecordTimeStamp = propLatestRecordTimeStamp.Value, - LatestResultTimeStamp = propLatestResultTimeStamp.Value, - MinVersion = propMinVersion.Value, - ModelSizeStats = propModelSizeStats.Value, - Retain = propRetain.Value, - SnapshotDocCount = propSnapshotDocCount.Value, - SnapshotId = propSnapshotId.Value, - Timestamp = propTimestamp.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ModelSnapshot value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropJobId, value.JobId, null, null); - writer.WriteProperty(options, PropLatestRecordTimeStamp, value.LatestRecordTimeStamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLatestResultTimeStamp, value.LatestResultTimeStamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinVersion, value.MinVersion, null, null); - writer.WriteProperty(options, PropModelSizeStats, value.ModelSizeStats, null, null); - writer.WriteProperty(options, PropRetain, value.Retain, null, null); - writer.WriteProperty(options, PropSnapshotDocCount, value.SnapshotDocCount, null, null); - writer.WriteProperty(options, PropSnapshotId, value.SnapshotId, null, null); - writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ModelSnapshotConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ModelSnapshotConverter))] public sealed partial class ModelSnapshot { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSnapshotUpgrade.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSnapshotUpgrade.Converters.g.cs new file mode 100644 index 00000000000..23764063e0f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSnapshotUpgrade.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ModelSnapshotUpgradeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAssignmentExplanation = System.Text.Json.JsonEncodedText.Encode("assignment_explanation"); + private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); + private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); + private static readonly System.Text.Json.JsonEncodedText PropSnapshotId = System.Text.Json.JsonEncodedText.Encode("snapshot_id"); + private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.ModelSnapshotUpgrade Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAssignmentExplanation = default; + LocalJsonValue propJobId = default; + LocalJsonValue> propNode = default; + LocalJsonValue propSnapshotId = default; + LocalJsonValue propState = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAssignmentExplanation.TryReadProperty(ref reader, options, PropAssignmentExplanation, null)) + { + continue; + } + + if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) + { + continue; + } + + if (propNode.TryReadProperty(ref reader, options, PropNode, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null))) + { + continue; + } + + if (propSnapshotId.TryReadProperty(ref reader, options, PropSnapshotId, null)) + { + continue; + } + + if (propState.TryReadProperty(ref reader, options, PropState, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.ModelSnapshotUpgrade(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AssignmentExplanation = propAssignmentExplanation.Value, + JobId = propJobId.Value, + Node = propNode.Value, + SnapshotId = propSnapshotId.Value, + State = propState.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ModelSnapshotUpgrade value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAssignmentExplanation, value.AssignmentExplanation, null, null); + writer.WriteProperty(options, PropJobId, value.JobId, null, null); + writer.WriteProperty(options, PropNode, value.Node, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null)); + writer.WriteProperty(options, PropSnapshotId, value.SnapshotId, null, null); + writer.WriteProperty(options, PropState, value.State, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSnapshotUpgrade.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSnapshotUpgrade.g.cs index 0e8421a6bcb..3a49a68481d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSnapshotUpgrade.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ModelSnapshotUpgrade.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class ModelSnapshotUpgradeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAssignmentExplanation = System.Text.Json.JsonEncodedText.Encode("assignment_explanation"); - private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); - private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); - private static readonly System.Text.Json.JsonEncodedText PropSnapshotId = System.Text.Json.JsonEncodedText.Encode("snapshot_id"); - private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.ModelSnapshotUpgrade Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAssignmentExplanation = default; - LocalJsonValue propJobId = default; - LocalJsonValue> propNode = default; - LocalJsonValue propSnapshotId = default; - LocalJsonValue propState = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAssignmentExplanation.TryReadProperty(ref reader, options, PropAssignmentExplanation, null)) - { - continue; - } - - if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) - { - continue; - } - - if (propNode.TryReadProperty(ref reader, options, PropNode, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null))) - { - continue; - } - - if (propSnapshotId.TryReadProperty(ref reader, options, PropSnapshotId, null)) - { - continue; - } - - if (propState.TryReadProperty(ref reader, options, PropState, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.ModelSnapshotUpgrade(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AssignmentExplanation = propAssignmentExplanation.Value, - JobId = propJobId.Value, - Node = propNode.Value, - SnapshotId = propSnapshotId.Value, - State = propState.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ModelSnapshotUpgrade value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAssignmentExplanation, value.AssignmentExplanation, null, null); - writer.WriteProperty(options, PropJobId, value.JobId, null, null); - writer.WriteProperty(options, PropNode, value.Node, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null)); - writer.WriteProperty(options, PropSnapshotId, value.SnapshotId, null, null); - writer.WriteProperty(options, PropState, value.State, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ModelSnapshotUpgradeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ModelSnapshotUpgradeConverter))] public sealed partial class ModelSnapshotUpgrade { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NativeCode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NativeCode.Converters.g.cs new file mode 100644 index 00000000000..98a9758cffd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NativeCode.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class NativeCodeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuildHash = System.Text.Json.JsonEncodedText.Encode("build_hash"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.NativeCode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBuildHash = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuildHash.TryReadProperty(ref reader, options, PropBuildHash, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.NativeCode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BuildHash = propBuildHash.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.NativeCode value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuildHash, value.BuildHash, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NativeCode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NativeCode.g.cs index 0e35401c319..a66af399f00 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NativeCode.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NativeCode.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class NativeCodeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuildHash = System.Text.Json.JsonEncodedText.Encode("build_hash"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.NativeCode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBuildHash = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuildHash.TryReadProperty(ref reader, options, PropBuildHash, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.NativeCode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BuildHash = propBuildHash.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.NativeCode value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuildHash, value.BuildHash, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.NativeCodeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.NativeCodeConverter))] public sealed partial class NativeCode { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NerInferenceOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NerInferenceOptions.Converters.g.cs new file mode 100644 index 00000000000..dd82054f3fb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NerInferenceOptions.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class NerInferenceOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClassificationLabels = System.Text.Json.JsonEncodedText.Encode("classification_labels"); + private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); + private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); + private static readonly System.Text.Json.JsonEncodedText PropVocabulary = System.Text.Json.JsonEncodedText.Encode("vocabulary"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.NerInferenceOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propClassificationLabels = default; + LocalJsonValue propResultsField = default; + LocalJsonValue propTokenization = default; + LocalJsonValue propVocabulary = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClassificationLabels.TryReadProperty(ref reader, options, PropClassificationLabels, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) + { + continue; + } + + if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) + { + continue; + } + + if (propVocabulary.TryReadProperty(ref reader, options, PropVocabulary, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.NerInferenceOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClassificationLabels = propClassificationLabels.Value, + ResultsField = propResultsField.Value, + Tokenization = propTokenization.Value, + Vocabulary = propVocabulary.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.NerInferenceOptions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClassificationLabels, value.ClassificationLabels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); + writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); + writer.WriteProperty(options, PropVocabulary, value.Vocabulary, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NerInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NerInferenceOptions.g.cs index daa75ea4f80..47078e9f38a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NerInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NerInferenceOptions.g.cs @@ -23,78 +23,12 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class NerInferenceOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClassificationLabels = System.Text.Json.JsonEncodedText.Encode("classification_labels"); - private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); - private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); - private static readonly System.Text.Json.JsonEncodedText PropVocabulary = System.Text.Json.JsonEncodedText.Encode("vocabulary"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.NerInferenceOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propClassificationLabels = default; - LocalJsonValue propResultsField = default; - LocalJsonValue propTokenization = default; - LocalJsonValue propVocabulary = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClassificationLabels.TryReadProperty(ref reader, options, PropClassificationLabels, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) - { - continue; - } - - if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) - { - continue; - } - - if (propVocabulary.TryReadProperty(ref reader, options, PropVocabulary, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.NerInferenceOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClassificationLabels = propClassificationLabels.Value, - ResultsField = propResultsField.Value, - Tokenization = propTokenization.Value, - Vocabulary = propVocabulary.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.NerInferenceOptions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClassificationLabels, value.ClassificationLabels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); - writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); - writer.WriteProperty(options, PropVocabulary, value.Vocabulary, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Named entity recognition options /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.NerInferenceOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.NerInferenceOptionsConverter))] public sealed partial class NerInferenceOptions { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NerInferenceUpdateOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NerInferenceUpdateOptions.Converters.g.cs new file mode 100644 index 00000000000..6676556c4b5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NerInferenceUpdateOptions.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class NerInferenceUpdateOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); + private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.NerInferenceUpdateOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propResultsField = default; + LocalJsonValue propTokenization = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) + { + continue; + } + + if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.NerInferenceUpdateOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ResultsField = propResultsField.Value, + Tokenization = propTokenization.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.NerInferenceUpdateOptions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); + writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NerInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NerInferenceUpdateOptions.g.cs index e0f016b3fb8..b053267603c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NerInferenceUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NerInferenceUpdateOptions.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class NerInferenceUpdateOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); - private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.NerInferenceUpdateOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propResultsField = default; - LocalJsonValue propTokenization = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) - { - continue; - } - - if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.NerInferenceUpdateOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ResultsField = propResultsField.Value, - Tokenization = propTokenization.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.NerInferenceUpdateOptions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); - writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.NerInferenceUpdateOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.NerInferenceUpdateOptionsConverter))] public sealed partial class NerInferenceUpdateOptions { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpBertTokenizationConfig.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpBertTokenizationConfig.Converters.g.cs new file mode 100644 index 00000000000..9611b111080 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpBertTokenizationConfig.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class NlpBertTokenizationConfigConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDoLowerCase = System.Text.Json.JsonEncodedText.Encode("do_lower_case"); + private static readonly System.Text.Json.JsonEncodedText PropMaxSequenceLength = System.Text.Json.JsonEncodedText.Encode("max_sequence_length"); + private static readonly System.Text.Json.JsonEncodedText PropSpan = System.Text.Json.JsonEncodedText.Encode("span"); + private static readonly System.Text.Json.JsonEncodedText PropTruncate = System.Text.Json.JsonEncodedText.Encode("truncate"); + private static readonly System.Text.Json.JsonEncodedText PropWithSpecialTokens = System.Text.Json.JsonEncodedText.Encode("with_special_tokens"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.NlpBertTokenizationConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDoLowerCase = default; + LocalJsonValue propMaxSequenceLength = default; + LocalJsonValue propSpan = default; + LocalJsonValue propTruncate = default; + LocalJsonValue propWithSpecialTokens = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDoLowerCase.TryReadProperty(ref reader, options, PropDoLowerCase, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxSequenceLength.TryReadProperty(ref reader, options, PropMaxSequenceLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSpan.TryReadProperty(ref reader, options, PropSpan, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTruncate.TryReadProperty(ref reader, options, PropTruncate, static Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propWithSpecialTokens.TryReadProperty(ref reader, options, PropWithSpecialTokens, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.NlpBertTokenizationConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DoLowerCase = propDoLowerCase.Value, + MaxSequenceLength = propMaxSequenceLength.Value, + Span = propSpan.Value, + Truncate = propTruncate.Value, + WithSpecialTokens = propWithSpecialTokens.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.NlpBertTokenizationConfig value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDoLowerCase, value.DoLowerCase, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxSequenceLength, value.MaxSequenceLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSpan, value.Span, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTruncate, value.Truncate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropWithSpecialTokens, value.WithSpecialTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpBertTokenizationConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpBertTokenizationConfig.g.cs index 3345ba50678..ff529584f65 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpBertTokenizationConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpBertTokenizationConfig.g.cs @@ -23,87 +23,12 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class NlpBertTokenizationConfigConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDoLowerCase = System.Text.Json.JsonEncodedText.Encode("do_lower_case"); - private static readonly System.Text.Json.JsonEncodedText PropMaxSequenceLength = System.Text.Json.JsonEncodedText.Encode("max_sequence_length"); - private static readonly System.Text.Json.JsonEncodedText PropSpan = System.Text.Json.JsonEncodedText.Encode("span"); - private static readonly System.Text.Json.JsonEncodedText PropTruncate = System.Text.Json.JsonEncodedText.Encode("truncate"); - private static readonly System.Text.Json.JsonEncodedText PropWithSpecialTokens = System.Text.Json.JsonEncodedText.Encode("with_special_tokens"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.NlpBertTokenizationConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDoLowerCase = default; - LocalJsonValue propMaxSequenceLength = default; - LocalJsonValue propSpan = default; - LocalJsonValue propTruncate = default; - LocalJsonValue propWithSpecialTokens = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDoLowerCase.TryReadProperty(ref reader, options, PropDoLowerCase, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxSequenceLength.TryReadProperty(ref reader, options, PropMaxSequenceLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSpan.TryReadProperty(ref reader, options, PropSpan, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTruncate.TryReadProperty(ref reader, options, PropTruncate, static Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propWithSpecialTokens.TryReadProperty(ref reader, options, PropWithSpecialTokens, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.NlpBertTokenizationConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DoLowerCase = propDoLowerCase.Value, - MaxSequenceLength = propMaxSequenceLength.Value, - Span = propSpan.Value, - Truncate = propTruncate.Value, - WithSpecialTokens = propWithSpecialTokens.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.NlpBertTokenizationConfig value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDoLowerCase, value.DoLowerCase, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxSequenceLength, value.MaxSequenceLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSpan, value.Span, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTruncate, value.Truncate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropWithSpecialTokens, value.WithSpecialTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// BERT and MPNet tokenization configuration options /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.NlpBertTokenizationConfigConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.NlpBertTokenizationConfigConverter))] public sealed partial class NlpBertTokenizationConfig { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpRobertaTokenizationConfig.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpRobertaTokenizationConfig.Converters.g.cs new file mode 100644 index 00000000000..fdb7c98bf71 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpRobertaTokenizationConfig.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class NlpRobertaTokenizationConfigConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAddPrefixSpace = System.Text.Json.JsonEncodedText.Encode("add_prefix_space"); + private static readonly System.Text.Json.JsonEncodedText PropDoLowerCase = System.Text.Json.JsonEncodedText.Encode("do_lower_case"); + private static readonly System.Text.Json.JsonEncodedText PropMaxSequenceLength = System.Text.Json.JsonEncodedText.Encode("max_sequence_length"); + private static readonly System.Text.Json.JsonEncodedText PropSpan = System.Text.Json.JsonEncodedText.Encode("span"); + private static readonly System.Text.Json.JsonEncodedText PropTruncate = System.Text.Json.JsonEncodedText.Encode("truncate"); + private static readonly System.Text.Json.JsonEncodedText PropWithSpecialTokens = System.Text.Json.JsonEncodedText.Encode("with_special_tokens"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.NlpRobertaTokenizationConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAddPrefixSpace = default; + LocalJsonValue propDoLowerCase = default; + LocalJsonValue propMaxSequenceLength = default; + LocalJsonValue propSpan = default; + LocalJsonValue propTruncate = default; + LocalJsonValue propWithSpecialTokens = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAddPrefixSpace.TryReadProperty(ref reader, options, PropAddPrefixSpace, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDoLowerCase.TryReadProperty(ref reader, options, PropDoLowerCase, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxSequenceLength.TryReadProperty(ref reader, options, PropMaxSequenceLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSpan.TryReadProperty(ref reader, options, PropSpan, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTruncate.TryReadProperty(ref reader, options, PropTruncate, static Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propWithSpecialTokens.TryReadProperty(ref reader, options, PropWithSpecialTokens, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.NlpRobertaTokenizationConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AddPrefixSpace = propAddPrefixSpace.Value, + DoLowerCase = propDoLowerCase.Value, + MaxSequenceLength = propMaxSequenceLength.Value, + Span = propSpan.Value, + Truncate = propTruncate.Value, + WithSpecialTokens = propWithSpecialTokens.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.NlpRobertaTokenizationConfig value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAddPrefixSpace, value.AddPrefixSpace, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDoLowerCase, value.DoLowerCase, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxSequenceLength, value.MaxSequenceLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSpan, value.Span, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTruncate, value.Truncate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropWithSpecialTokens, value.WithSpecialTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpRobertaTokenizationConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpRobertaTokenizationConfig.g.cs index 521b29cdb9e..09584c8f456 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpRobertaTokenizationConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpRobertaTokenizationConfig.g.cs @@ -23,96 +23,12 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class NlpRobertaTokenizationConfigConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAddPrefixSpace = System.Text.Json.JsonEncodedText.Encode("add_prefix_space"); - private static readonly System.Text.Json.JsonEncodedText PropDoLowerCase = System.Text.Json.JsonEncodedText.Encode("do_lower_case"); - private static readonly System.Text.Json.JsonEncodedText PropMaxSequenceLength = System.Text.Json.JsonEncodedText.Encode("max_sequence_length"); - private static readonly System.Text.Json.JsonEncodedText PropSpan = System.Text.Json.JsonEncodedText.Encode("span"); - private static readonly System.Text.Json.JsonEncodedText PropTruncate = System.Text.Json.JsonEncodedText.Encode("truncate"); - private static readonly System.Text.Json.JsonEncodedText PropWithSpecialTokens = System.Text.Json.JsonEncodedText.Encode("with_special_tokens"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.NlpRobertaTokenizationConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAddPrefixSpace = default; - LocalJsonValue propDoLowerCase = default; - LocalJsonValue propMaxSequenceLength = default; - LocalJsonValue propSpan = default; - LocalJsonValue propTruncate = default; - LocalJsonValue propWithSpecialTokens = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAddPrefixSpace.TryReadProperty(ref reader, options, PropAddPrefixSpace, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDoLowerCase.TryReadProperty(ref reader, options, PropDoLowerCase, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxSequenceLength.TryReadProperty(ref reader, options, PropMaxSequenceLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSpan.TryReadProperty(ref reader, options, PropSpan, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTruncate.TryReadProperty(ref reader, options, PropTruncate, static Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propWithSpecialTokens.TryReadProperty(ref reader, options, PropWithSpecialTokens, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.NlpRobertaTokenizationConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AddPrefixSpace = propAddPrefixSpace.Value, - DoLowerCase = propDoLowerCase.Value, - MaxSequenceLength = propMaxSequenceLength.Value, - Span = propSpan.Value, - Truncate = propTruncate.Value, - WithSpecialTokens = propWithSpecialTokens.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.NlpRobertaTokenizationConfig value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAddPrefixSpace, value.AddPrefixSpace, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDoLowerCase, value.DoLowerCase, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxSequenceLength, value.MaxSequenceLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSpan, value.Span, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTruncate, value.Truncate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropWithSpecialTokens, value.WithSpecialTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// RoBERTa tokenization configuration options /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.NlpRobertaTokenizationConfigConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.NlpRobertaTokenizationConfigConverter))] public sealed partial class NlpRobertaTokenizationConfig { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpTokenizationUpdateOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpTokenizationUpdateOptions.Converters.g.cs new file mode 100644 index 00000000000..e7b9f043819 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpTokenizationUpdateOptions.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class NlpTokenizationUpdateOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSpan = System.Text.Json.JsonEncodedText.Encode("span"); + private static readonly System.Text.Json.JsonEncodedText PropTruncate = System.Text.Json.JsonEncodedText.Encode("truncate"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propSpan = default; + LocalJsonValue propTruncate = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSpan.TryReadProperty(ref reader, options, PropSpan, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTruncate.TryReadProperty(ref reader, options, PropTruncate, static Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Span = propSpan.Value, + Truncate = propTruncate.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSpan, value.Span, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTruncate, value.Truncate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpTokenizationUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpTokenizationUpdateOptions.g.cs index de9407568bc..e368b1841b7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpTokenizationUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/NlpTokenizationUpdateOptions.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class NlpTokenizationUpdateOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSpan = System.Text.Json.JsonEncodedText.Encode("span"); - private static readonly System.Text.Json.JsonEncodedText PropTruncate = System.Text.Json.JsonEncodedText.Encode("truncate"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propSpan = default; - LocalJsonValue propTruncate = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSpan.TryReadProperty(ref reader, options, PropSpan, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTruncate.TryReadProperty(ref reader, options, PropTruncate, static Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Span = propSpan.Value, - Truncate = propTruncate.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSpan, value.Span, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTruncate, value.Truncate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.NlpTokenizationUpdateOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.NlpTokenizationUpdateOptionsConverter))] public sealed partial class NlpTokenizationUpdateOptions { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OneHotEncodingPreprocessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OneHotEncodingPreprocessor.Converters.g.cs new file mode 100644 index 00000000000..cadcbbd5f82 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OneHotEncodingPreprocessor.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class OneHotEncodingPreprocessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropHotMap = System.Text.Json.JsonEncodedText.Encode("hot_map"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.OneHotEncodingPreprocessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue> propHotMap = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propHotMap.TryReadProperty(ref reader, options, PropHotMap, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.OneHotEncodingPreprocessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + HotMap = propHotMap.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.OneHotEncodingPreprocessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropHotMap, value.HotMap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OneHotEncodingPreprocessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OneHotEncodingPreprocessor.g.cs index 5d1a99a4b77..18743b9f7aa 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OneHotEncodingPreprocessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OneHotEncodingPreprocessor.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class OneHotEncodingPreprocessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropHotMap = System.Text.Json.JsonEncodedText.Encode("hot_map"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.OneHotEncodingPreprocessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue> propHotMap = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propHotMap.TryReadProperty(ref reader, options, PropHotMap, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.OneHotEncodingPreprocessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - HotMap = propHotMap.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.OneHotEncodingPreprocessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropHotMap, value.HotMap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.OneHotEncodingPreprocessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.OneHotEncodingPreprocessorConverter))] public sealed partial class OneHotEncodingPreprocessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OverallBucket.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OverallBucket.Converters.g.cs new file mode 100644 index 00000000000..7f46b8366c8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OverallBucket.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class OverallBucketConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucketSpan = System.Text.Json.JsonEncodedText.Encode("bucket_span"); + private static readonly System.Text.Json.JsonEncodedText PropIsInterim = System.Text.Json.JsonEncodedText.Encode("is_interim"); + private static readonly System.Text.Json.JsonEncodedText PropJobs = System.Text.Json.JsonEncodedText.Encode("jobs"); + private static readonly System.Text.Json.JsonEncodedText PropOverallScore = System.Text.Json.JsonEncodedText.Encode("overall_score"); + private static readonly System.Text.Json.JsonEncodedText PropResultType = System.Text.Json.JsonEncodedText.Encode("result_type"); + private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); + private static readonly System.Text.Json.JsonEncodedText PropTimestampString = System.Text.Json.JsonEncodedText.Encode("timestamp_string"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.OverallBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucketSpan = default; + LocalJsonValue propIsInterim = default; + LocalJsonValue> propJobs = default; + LocalJsonValue propOverallScore = default; + LocalJsonValue propResultType = default; + LocalJsonValue propTimestamp = default; + LocalJsonValue propTimestampString = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucketSpan.TryReadProperty(ref reader, options, PropBucketSpan, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanSecondsMarker)))) + { + continue; + } + + if (propIsInterim.TryReadProperty(ref reader, options, PropIsInterim, null)) + { + continue; + } + + if (propJobs.TryReadProperty(ref reader, options, PropJobs, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propOverallScore.TryReadProperty(ref reader, options, PropOverallScore, null)) + { + continue; + } + + if (propResultType.TryReadProperty(ref reader, options, PropResultType, null)) + { + continue; + } + + if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propTimestampString.TryReadProperty(ref reader, options, PropTimestampString, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.OverallBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BucketSpan = propBucketSpan.Value, + IsInterim = propIsInterim.Value, + Jobs = propJobs.Value, + OverallScore = propOverallScore.Value, + ResultType = propResultType.Value, + Timestamp = propTimestamp.Value, + TimestampString = propTimestampString.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.OverallBucket value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucketSpan, value.BucketSpan, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanSecondsMarker))); + writer.WriteProperty(options, PropIsInterim, value.IsInterim, null, null); + writer.WriteProperty(options, PropJobs, value.Jobs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropOverallScore, value.OverallScore, null, null); + writer.WriteProperty(options, PropResultType, value.ResultType, null, null); + writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropTimestampString, value.TimestampString, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OverallBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OverallBucket.g.cs index 6a605780719..fce40379a81 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OverallBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OverallBucket.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class OverallBucketConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBucketSpan = System.Text.Json.JsonEncodedText.Encode("bucket_span"); - private static readonly System.Text.Json.JsonEncodedText PropIsInterim = System.Text.Json.JsonEncodedText.Encode("is_interim"); - private static readonly System.Text.Json.JsonEncodedText PropJobs = System.Text.Json.JsonEncodedText.Encode("jobs"); - private static readonly System.Text.Json.JsonEncodedText PropOverallScore = System.Text.Json.JsonEncodedText.Encode("overall_score"); - private static readonly System.Text.Json.JsonEncodedText PropResultType = System.Text.Json.JsonEncodedText.Encode("result_type"); - private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); - private static readonly System.Text.Json.JsonEncodedText PropTimestampString = System.Text.Json.JsonEncodedText.Encode("timestamp_string"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.OverallBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBucketSpan = default; - LocalJsonValue propIsInterim = default; - LocalJsonValue> propJobs = default; - LocalJsonValue propOverallScore = default; - LocalJsonValue propResultType = default; - LocalJsonValue propTimestamp = default; - LocalJsonValue propTimestampString = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBucketSpan.TryReadProperty(ref reader, options, PropBucketSpan, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanSecondsMarker)))) - { - continue; - } - - if (propIsInterim.TryReadProperty(ref reader, options, PropIsInterim, null)) - { - continue; - } - - if (propJobs.TryReadProperty(ref reader, options, PropJobs, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propOverallScore.TryReadProperty(ref reader, options, PropOverallScore, null)) - { - continue; - } - - if (propResultType.TryReadProperty(ref reader, options, PropResultType, null)) - { - continue; - } - - if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propTimestampString.TryReadProperty(ref reader, options, PropTimestampString, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.OverallBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BucketSpan = propBucketSpan.Value, - IsInterim = propIsInterim.Value, - Jobs = propJobs.Value, - OverallScore = propOverallScore.Value, - ResultType = propResultType.Value, - Timestamp = propTimestamp.Value, - TimestampString = propTimestampString.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.OverallBucket value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBucketSpan, value.BucketSpan, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanSecondsMarker))); - writer.WriteProperty(options, PropIsInterim, value.IsInterim, null, null); - writer.WriteProperty(options, PropJobs, value.Jobs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropOverallScore, value.OverallScore, null, null); - writer.WriteProperty(options, PropResultType, value.ResultType, null, null); - writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropTimestampString, value.TimestampString, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.OverallBucketConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.OverallBucketConverter))] public sealed partial class OverallBucket { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OverallBucketJob.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OverallBucketJob.Converters.g.cs new file mode 100644 index 00000000000..aa572060961 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OverallBucketJob.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class OverallBucketJobConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); + private static readonly System.Text.Json.JsonEncodedText PropMaxAnomalyScore = System.Text.Json.JsonEncodedText.Encode("max_anomaly_score"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.OverallBucketJob Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propJobId = default; + LocalJsonValue propMaxAnomalyScore = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) + { + continue; + } + + if (propMaxAnomalyScore.TryReadProperty(ref reader, options, PropMaxAnomalyScore, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.OverallBucketJob(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + JobId = propJobId.Value, + MaxAnomalyScore = propMaxAnomalyScore.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.OverallBucketJob value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropJobId, value.JobId, null, null); + writer.WriteProperty(options, PropMaxAnomalyScore, value.MaxAnomalyScore, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OverallBucketJob.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OverallBucketJob.g.cs index 24910e8eea6..caa79df8d18 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OverallBucketJob.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/OverallBucketJob.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class OverallBucketJobConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); - private static readonly System.Text.Json.JsonEncodedText PropMaxAnomalyScore = System.Text.Json.JsonEncodedText.Encode("max_anomaly_score"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.OverallBucketJob Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propJobId = default; - LocalJsonValue propMaxAnomalyScore = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) - { - continue; - } - - if (propMaxAnomalyScore.TryReadProperty(ref reader, options, PropMaxAnomalyScore, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.OverallBucketJob(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - JobId = propJobId.Value, - MaxAnomalyScore = propMaxAnomalyScore.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.OverallBucketJob value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropJobId, value.JobId, null, null); - writer.WriteProperty(options, PropMaxAnomalyScore, value.MaxAnomalyScore, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.OverallBucketJobConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.OverallBucketJobConverter))] public sealed partial class OverallBucketJob { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Page.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Page.Converters.g.cs new file mode 100644 index 00000000000..5828083dbfd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Page.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PageConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFrom = System.Text.Json.JsonEncodedText.Encode("from"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.Page Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFrom = default; + LocalJsonValue propSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFrom.TryReadProperty(ref reader, options, PropFrom, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.Page(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + From = propFrom.Value, + Size = propSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Page value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFrom, value.From, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Page.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Page.g.cs index 8a2e6240be8..755cf4dfe1d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Page.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Page.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class PageConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFrom = System.Text.Json.JsonEncodedText.Encode("from"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.Page Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFrom = default; - LocalJsonValue propSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFrom.TryReadProperty(ref reader, options, PropFrom, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.Page(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - From = propFrom.Value, - Size = propSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Page value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFrom, value.From, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PageConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PageConverter))] public sealed partial class Page { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PassThroughInferenceOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PassThroughInferenceOptions.Converters.g.cs new file mode 100644 index 00000000000..60a13d35f6c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PassThroughInferenceOptions.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PassThroughInferenceOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); + private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); + private static readonly System.Text.Json.JsonEncodedText PropVocabulary = System.Text.Json.JsonEncodedText.Encode("vocabulary"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.PassThroughInferenceOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propResultsField = default; + LocalJsonValue propTokenization = default; + LocalJsonValue propVocabulary = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) + { + continue; + } + + if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) + { + continue; + } + + if (propVocabulary.TryReadProperty(ref reader, options, PropVocabulary, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PassThroughInferenceOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ResultsField = propResultsField.Value, + Tokenization = propTokenization.Value, + Vocabulary = propVocabulary.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PassThroughInferenceOptions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); + writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); + writer.WriteProperty(options, PropVocabulary, value.Vocabulary, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PassThroughInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PassThroughInferenceOptions.g.cs index e83b0707138..08c9e547cf7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PassThroughInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PassThroughInferenceOptions.g.cs @@ -23,69 +23,12 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class PassThroughInferenceOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); - private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); - private static readonly System.Text.Json.JsonEncodedText PropVocabulary = System.Text.Json.JsonEncodedText.Encode("vocabulary"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.PassThroughInferenceOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propResultsField = default; - LocalJsonValue propTokenization = default; - LocalJsonValue propVocabulary = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) - { - continue; - } - - if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) - { - continue; - } - - if (propVocabulary.TryReadProperty(ref reader, options, PropVocabulary, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PassThroughInferenceOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ResultsField = propResultsField.Value, - Tokenization = propTokenization.Value, - Vocabulary = propVocabulary.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PassThroughInferenceOptions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); - writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); - writer.WriteProperty(options, PropVocabulary, value.Vocabulary, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Pass through configuration options /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PassThroughInferenceOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PassThroughInferenceOptionsConverter))] public sealed partial class PassThroughInferenceOptions { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PassThroughInferenceUpdateOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PassThroughInferenceUpdateOptions.Converters.g.cs new file mode 100644 index 00000000000..143209ed096 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PassThroughInferenceUpdateOptions.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PassThroughInferenceUpdateOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); + private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.PassThroughInferenceUpdateOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propResultsField = default; + LocalJsonValue propTokenization = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) + { + continue; + } + + if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PassThroughInferenceUpdateOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ResultsField = propResultsField.Value, + Tokenization = propTokenization.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PassThroughInferenceUpdateOptions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); + writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PassThroughInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PassThroughInferenceUpdateOptions.g.cs index 425f7cb9abe..13003236ef8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PassThroughInferenceUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PassThroughInferenceUpdateOptions.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class PassThroughInferenceUpdateOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); - private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.PassThroughInferenceUpdateOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propResultsField = default; - LocalJsonValue propTokenization = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) - { - continue; - } - - if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PassThroughInferenceUpdateOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ResultsField = propResultsField.Value, - Tokenization = propTokenization.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PassThroughInferenceUpdateOptions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); - writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PassThroughInferenceUpdateOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PassThroughInferenceUpdateOptionsConverter))] public sealed partial class PassThroughInferenceUpdateOptions { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PerPartitionCategorization.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PerPartitionCategorization.Converters.g.cs new file mode 100644 index 00000000000..a27460914ba --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PerPartitionCategorization.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PerPartitionCategorizationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropStopOnWarn = System.Text.Json.JsonEncodedText.Encode("stop_on_warn"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorization Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEnabled = default; + LocalJsonValue propStopOnWarn = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propStopOnWarn.TryReadProperty(ref reader, options, PropStopOnWarn, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorization(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Enabled = propEnabled.Value, + StopOnWarn = propStopOnWarn.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorization value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropStopOnWarn, value.StopOnWarn, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PerPartitionCategorization.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PerPartitionCategorization.g.cs index 4ac9aa8443f..787fb2e2007 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PerPartitionCategorization.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/PerPartitionCategorization.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class PerPartitionCategorizationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropStopOnWarn = System.Text.Json.JsonEncodedText.Encode("stop_on_warn"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorization Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEnabled = default; - LocalJsonValue propStopOnWarn = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propStopOnWarn.TryReadProperty(ref reader, options, PropStopOnWarn, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorization(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Enabled = propEnabled.Value, - StopOnWarn = propStopOnWarn.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorization value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropStopOnWarn, value.StopOnWarn, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PerPartitionCategorizationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PerPartitionCategorizationConverter))] public sealed partial class PerPartitionCategorization { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Preprocessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Preprocessor.Converters.g.cs new file mode 100644 index 00000000000..d8e8577e171 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Preprocessor.Converters.g.cs @@ -0,0 +1,102 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class PreprocessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantFrequencyEncoding = System.Text.Json.JsonEncodedText.Encode("frequency_encoding"); + private static readonly System.Text.Json.JsonEncodedText VariantOneHotEncoding = System.Text.Json.JsonEncodedText.Encode("one_hot_encoding"); + private static readonly System.Text.Json.JsonEncodedText VariantTargetMeanEncoding = System.Text.Json.JsonEncodedText.Encode("target_mean_encoding"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.Preprocessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantFrequencyEncoding)) + { + variantType = VariantFrequencyEncoding.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantOneHotEncoding)) + { + variantType = VariantOneHotEncoding.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTargetMeanEncoding)) + { + variantType = VariantTargetMeanEncoding.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.Preprocessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Preprocessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "frequency_encoding": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.FrequencyEncodingPreprocessor)value.Variant, null, null); + break; + case "one_hot_encoding": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.OneHotEncodingPreprocessor)value.Variant, null, null); + break; + case "target_mean_encoding": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.TargetMeanEncodingPreprocessor)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.Preprocessor)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Preprocessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Preprocessor.g.cs index 3815ff3062e..4399adcdfe5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Preprocessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Preprocessor.g.cs @@ -23,85 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class PreprocessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantFrequencyEncoding = System.Text.Json.JsonEncodedText.Encode("frequency_encoding"); - private static readonly System.Text.Json.JsonEncodedText VariantOneHotEncoding = System.Text.Json.JsonEncodedText.Encode("one_hot_encoding"); - private static readonly System.Text.Json.JsonEncodedText VariantTargetMeanEncoding = System.Text.Json.JsonEncodedText.Encode("target_mean_encoding"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.Preprocessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantFrequencyEncoding)) - { - variantType = VariantFrequencyEncoding.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantOneHotEncoding)) - { - variantType = VariantOneHotEncoding.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTargetMeanEncoding)) - { - variantType = VariantTargetMeanEncoding.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.Preprocessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Preprocessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "frequency_encoding": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.FrequencyEncodingPreprocessor)value.Variant, null, null); - break; - case "one_hot_encoding": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.OneHotEncodingPreprocessor)value.Variant, null, null); - break; - case "target_mean_encoding": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.TargetMeanEncodingPreprocessor)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.Preprocessor)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.PreprocessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.PreprocessorConverter))] public sealed partial class Preprocessor { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QueryFeatureExtractor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QueryFeatureExtractor.Converters.g.cs new file mode 100644 index 00000000000..0623d708dff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QueryFeatureExtractor.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class QueryFeatureExtractorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDefaultScore = System.Text.Json.JsonEncodedText.Encode("default_score"); + private static readonly System.Text.Json.JsonEncodedText PropFeatureName = System.Text.Json.JsonEncodedText.Encode("feature_name"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.QueryFeatureExtractor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDefaultScore = default; + LocalJsonValue propFeatureName = default; + LocalJsonValue propQuery = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDefaultScore.TryReadProperty(ref reader, options, PropDefaultScore, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFeatureName.TryReadProperty(ref reader, options, PropFeatureName, null)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.QueryFeatureExtractor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DefaultScore = propDefaultScore.Value, + FeatureName = propFeatureName.Value, + Query = propQuery.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.QueryFeatureExtractor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDefaultScore, value.DefaultScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFeatureName, value.FeatureName, null, null); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QueryFeatureExtractor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QueryFeatureExtractor.g.cs index ed6caac50b5..00a3ea51874 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QueryFeatureExtractor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QueryFeatureExtractor.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class QueryFeatureExtractorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDefaultScore = System.Text.Json.JsonEncodedText.Encode("default_score"); - private static readonly System.Text.Json.JsonEncodedText PropFeatureName = System.Text.Json.JsonEncodedText.Encode("feature_name"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.QueryFeatureExtractor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDefaultScore = default; - LocalJsonValue propFeatureName = default; - LocalJsonValue propQuery = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDefaultScore.TryReadProperty(ref reader, options, PropDefaultScore, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFeatureName.TryReadProperty(ref reader, options, PropFeatureName, null)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.QueryFeatureExtractor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DefaultScore = propDefaultScore.Value, - FeatureName = propFeatureName.Value, - Query = propQuery.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.QueryFeatureExtractor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDefaultScore, value.DefaultScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFeatureName, value.FeatureName, null, null); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.QueryFeatureExtractorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.QueryFeatureExtractorConverter))] public sealed partial class QueryFeatureExtractor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QuestionAnsweringInferenceOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QuestionAnsweringInferenceOptions.Converters.g.cs new file mode 100644 index 00000000000..b05ac3c5016 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QuestionAnsweringInferenceOptions.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class QuestionAnsweringInferenceOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxAnswerLength = System.Text.Json.JsonEncodedText.Encode("max_answer_length"); + private static readonly System.Text.Json.JsonEncodedText PropNumTopClasses = System.Text.Json.JsonEncodedText.Encode("num_top_classes"); + private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); + private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.QuestionAnsweringInferenceOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxAnswerLength = default; + LocalJsonValue propNumTopClasses = default; + LocalJsonValue propResultsField = default; + LocalJsonValue propTokenization = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxAnswerLength.TryReadProperty(ref reader, options, PropMaxAnswerLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNumTopClasses.TryReadProperty(ref reader, options, PropNumTopClasses, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) + { + continue; + } + + if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.QuestionAnsweringInferenceOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxAnswerLength = propMaxAnswerLength.Value, + NumTopClasses = propNumTopClasses.Value, + ResultsField = propResultsField.Value, + Tokenization = propTokenization.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.QuestionAnsweringInferenceOptions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxAnswerLength, value.MaxAnswerLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNumTopClasses, value.NumTopClasses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); + writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QuestionAnsweringInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QuestionAnsweringInferenceOptions.g.cs index fe30b1b01b0..91598aa80a9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QuestionAnsweringInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QuestionAnsweringInferenceOptions.g.cs @@ -23,78 +23,12 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class QuestionAnsweringInferenceOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxAnswerLength = System.Text.Json.JsonEncodedText.Encode("max_answer_length"); - private static readonly System.Text.Json.JsonEncodedText PropNumTopClasses = System.Text.Json.JsonEncodedText.Encode("num_top_classes"); - private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); - private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.QuestionAnsweringInferenceOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxAnswerLength = default; - LocalJsonValue propNumTopClasses = default; - LocalJsonValue propResultsField = default; - LocalJsonValue propTokenization = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxAnswerLength.TryReadProperty(ref reader, options, PropMaxAnswerLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNumTopClasses.TryReadProperty(ref reader, options, PropNumTopClasses, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) - { - continue; - } - - if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.QuestionAnsweringInferenceOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxAnswerLength = propMaxAnswerLength.Value, - NumTopClasses = propNumTopClasses.Value, - ResultsField = propResultsField.Value, - Tokenization = propTokenization.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.QuestionAnsweringInferenceOptions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxAnswerLength, value.MaxAnswerLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNumTopClasses, value.NumTopClasses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); - writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Question answering inference options /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.QuestionAnsweringInferenceOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.QuestionAnsweringInferenceOptionsConverter))] public sealed partial class QuestionAnsweringInferenceOptions { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QuestionAnsweringInferenceUpdateOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QuestionAnsweringInferenceUpdateOptions.Converters.g.cs new file mode 100644 index 00000000000..15dbebe4302 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QuestionAnsweringInferenceUpdateOptions.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class QuestionAnsweringInferenceUpdateOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxAnswerLength = System.Text.Json.JsonEncodedText.Encode("max_answer_length"); + private static readonly System.Text.Json.JsonEncodedText PropNumTopClasses = System.Text.Json.JsonEncodedText.Encode("num_top_classes"); + private static readonly System.Text.Json.JsonEncodedText PropQuestion = System.Text.Json.JsonEncodedText.Encode("question"); + private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); + private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.QuestionAnsweringInferenceUpdateOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxAnswerLength = default; + LocalJsonValue propNumTopClasses = default; + LocalJsonValue propQuestion = default; + LocalJsonValue propResultsField = default; + LocalJsonValue propTokenization = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxAnswerLength.TryReadProperty(ref reader, options, PropMaxAnswerLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNumTopClasses.TryReadProperty(ref reader, options, PropNumTopClasses, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuestion.TryReadProperty(ref reader, options, PropQuestion, null)) + { + continue; + } + + if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) + { + continue; + } + + if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.QuestionAnsweringInferenceUpdateOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxAnswerLength = propMaxAnswerLength.Value, + NumTopClasses = propNumTopClasses.Value, + Question = propQuestion.Value, + ResultsField = propResultsField.Value, + Tokenization = propTokenization.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.QuestionAnsweringInferenceUpdateOptions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxAnswerLength, value.MaxAnswerLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNumTopClasses, value.NumTopClasses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuestion, value.Question, null, null); + writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); + writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QuestionAnsweringInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QuestionAnsweringInferenceUpdateOptions.g.cs index a36a9a647ce..894f980bb33 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QuestionAnsweringInferenceUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/QuestionAnsweringInferenceUpdateOptions.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class QuestionAnsweringInferenceUpdateOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxAnswerLength = System.Text.Json.JsonEncodedText.Encode("max_answer_length"); - private static readonly System.Text.Json.JsonEncodedText PropNumTopClasses = System.Text.Json.JsonEncodedText.Encode("num_top_classes"); - private static readonly System.Text.Json.JsonEncodedText PropQuestion = System.Text.Json.JsonEncodedText.Encode("question"); - private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); - private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.QuestionAnsweringInferenceUpdateOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxAnswerLength = default; - LocalJsonValue propNumTopClasses = default; - LocalJsonValue propQuestion = default; - LocalJsonValue propResultsField = default; - LocalJsonValue propTokenization = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxAnswerLength.TryReadProperty(ref reader, options, PropMaxAnswerLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNumTopClasses.TryReadProperty(ref reader, options, PropNumTopClasses, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuestion.TryReadProperty(ref reader, options, PropQuestion, null)) - { - continue; - } - - if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) - { - continue; - } - - if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.QuestionAnsweringInferenceUpdateOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxAnswerLength = propMaxAnswerLength.Value, - NumTopClasses = propNumTopClasses.Value, - Question = propQuestion.Value, - ResultsField = propResultsField.Value, - Tokenization = propTokenization.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.QuestionAnsweringInferenceUpdateOptions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxAnswerLength, value.MaxAnswerLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNumTopClasses, value.NumTopClasses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuestion, value.Question, null, null); - writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); - writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.QuestionAnsweringInferenceUpdateOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.QuestionAnsweringInferenceUpdateOptionsConverter))] public sealed partial class QuestionAnsweringInferenceUpdateOptions { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RegressionInferenceOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RegressionInferenceOptions.Converters.g.cs new file mode 100644 index 00000000000..811edc2dfba --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RegressionInferenceOptions.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class RegressionInferenceOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNumTopFeatureImportanceValues = System.Text.Json.JsonEncodedText.Encode("num_top_feature_importance_values"); + private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.RegressionInferenceOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propNumTopFeatureImportanceValues = default; + LocalJsonValue propResultsField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNumTopFeatureImportanceValues.TryReadProperty(ref reader, options, PropNumTopFeatureImportanceValues, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.RegressionInferenceOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + NumTopFeatureImportanceValues = propNumTopFeatureImportanceValues.Value, + ResultsField = propResultsField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.RegressionInferenceOptions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNumTopFeatureImportanceValues, value.NumTopFeatureImportanceValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RegressionInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RegressionInferenceOptions.g.cs index 743d684eabf..f916d93f905 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RegressionInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RegressionInferenceOptions.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class RegressionInferenceOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNumTopFeatureImportanceValues = System.Text.Json.JsonEncodedText.Encode("num_top_feature_importance_values"); - private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.RegressionInferenceOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propNumTopFeatureImportanceValues = default; - LocalJsonValue propResultsField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNumTopFeatureImportanceValues.TryReadProperty(ref reader, options, PropNumTopFeatureImportanceValues, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.RegressionInferenceOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - NumTopFeatureImportanceValues = propNumTopFeatureImportanceValues.Value, - ResultsField = propResultsField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.RegressionInferenceOptions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNumTopFeatureImportanceValues, value.NumTopFeatureImportanceValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.RegressionInferenceOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.RegressionInferenceOptionsConverter))] public sealed partial class RegressionInferenceOptions { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RoutingState.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RoutingState.Converters.g.cs new file mode 100644 index 00000000000..909efa3862a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RoutingState.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class RoutingStateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberFailed = System.Text.Json.JsonEncodedText.Encode("failed"); + private static readonly System.Text.Json.JsonEncodedText MemberStarted = System.Text.Json.JsonEncodedText.Encode("started"); + private static readonly System.Text.Json.JsonEncodedText MemberStarting = System.Text.Json.JsonEncodedText.Encode("starting"); + private static readonly System.Text.Json.JsonEncodedText MemberStopped = System.Text.Json.JsonEncodedText.Encode("stopped"); + private static readonly System.Text.Json.JsonEncodedText MemberStopping = System.Text.Json.JsonEncodedText.Encode("stopping"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.RoutingState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberFailed)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Failed; + } + + if (reader.ValueTextEquals(MemberStarted)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Started; + } + + if (reader.ValueTextEquals(MemberStarting)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Starting; + } + + if (reader.ValueTextEquals(MemberStopped)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Stopped; + } + + if (reader.ValueTextEquals(MemberStopping)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Stopping; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberFailed.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Failed; + } + + if (string.Equals(value, MemberStarted.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Started; + } + + if (string.Equals(value, MemberStarting.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Starting; + } + + if (string.Equals(value, MemberStopped.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Stopped; + } + + if (string.Equals(value, MemberStopping.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Stopping; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.RoutingState)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.RoutingState value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Failed: + writer.WriteStringValue(MemberFailed); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Started: + writer.WriteStringValue(MemberStarted); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Starting: + writer.WriteStringValue(MemberStarting); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Stopped: + writer.WriteStringValue(MemberStopped); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.RoutingState.Stopping: + writer.WriteStringValue(MemberStopping); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.RoutingState)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.MachineLearning.RoutingState ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.RoutingState value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RoutingState.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RoutingState.g.cs new file mode 100644 index 00000000000..37742f2ba88 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RoutingState.g.cs @@ -0,0 +1,64 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.RoutingStateConverter))] +public enum RoutingState +{ + /// + /// + /// The allocation attempt failed. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "failed")] + Failed, + /// + /// + /// The trained model is allocated and ready to accept inference requests. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "started")] + Started, + /// + /// + /// The trained model is attempting to allocate on this node; inference requests are not yet accepted. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "starting")] + Starting, + /// + /// + /// The trained model is fully deallocated from this node. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "stopped")] + Stopped, + /// + /// + /// The trained model is being deallocated from this node. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "stopping")] + Stopping +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RuleAction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RuleAction.Converters.g.cs new file mode 100644 index 00000000000..f05d5a21ead --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RuleAction.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class RuleActionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberSkipModelUpdate = System.Text.Json.JsonEncodedText.Encode("skip_model_update"); + private static readonly System.Text.Json.JsonEncodedText MemberSkipResult = System.Text.Json.JsonEncodedText.Encode("skip_result"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.RuleAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberSkipModelUpdate)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.RuleAction.SkipModelUpdate; + } + + if (reader.ValueTextEquals(MemberSkipResult)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.RuleAction.SkipResult; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberSkipModelUpdate.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.RuleAction.SkipModelUpdate; + } + + if (string.Equals(value, MemberSkipResult.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.RuleAction.SkipResult; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.RuleAction)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.RuleAction value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.MachineLearning.RuleAction.SkipModelUpdate: + writer.WriteStringValue(MemberSkipModelUpdate); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.RuleAction.SkipResult: + writer.WriteStringValue(MemberSkipResult); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.RuleAction)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.MachineLearning.RuleAction ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.RuleAction value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RuleAction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RuleAction.g.cs new file mode 100644 index 00000000000..795b488e78b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RuleAction.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.RuleActionConverter))] +public enum RuleAction +{ + /// + /// + /// The value for that series will not be used to update the model. Unless you also specify skip_result, the results will be created as usual. This action is suitable when certain values are expected to be consistently anomalous and they affect the model in a way that negatively impacts the rest of the results. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "skip_model_update")] + SkipModelUpdate, + /// + /// + /// The result will not be created. Unless you also specify skip_model_update, the model will be updated as usual with the corresponding series value. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "skip_result")] + SkipResult +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RuleCondition.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RuleCondition.Converters.g.cs new file mode 100644 index 00000000000..83fdb6666e2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RuleCondition.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class RuleConditionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAppliesTo = System.Text.Json.JsonEncodedText.Encode("applies_to"); + private static readonly System.Text.Json.JsonEncodedText PropOperator = System.Text.Json.JsonEncodedText.Encode("operator"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.RuleCondition Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAppliesTo = default; + LocalJsonValue propOperator = default; + LocalJsonValue propValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAppliesTo.TryReadProperty(ref reader, options, PropAppliesTo, null)) + { + continue; + } + + if (propOperator.TryReadProperty(ref reader, options, PropOperator, null)) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.RuleCondition(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AppliesTo = propAppliesTo.Value, + Operator = propOperator.Value, + Value = propValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.RuleCondition value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAppliesTo, value.AppliesTo, null, null); + writer.WriteProperty(options, PropOperator, value.Operator, null, null); + writer.WriteProperty(options, PropValue, value.Value, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RuleCondition.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RuleCondition.g.cs index c3e6436660c..c337841d481 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RuleCondition.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RuleCondition.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class RuleConditionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAppliesTo = System.Text.Json.JsonEncodedText.Encode("applies_to"); - private static readonly System.Text.Json.JsonEncodedText PropOperator = System.Text.Json.JsonEncodedText.Encode("operator"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.RuleCondition Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAppliesTo = default; - LocalJsonValue propOperator = default; - LocalJsonValue propValue = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAppliesTo.TryReadProperty(ref reader, options, PropAppliesTo, null)) - { - continue; - } - - if (propOperator.TryReadProperty(ref reader, options, PropOperator, null)) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.RuleCondition(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AppliesTo = propAppliesTo.Value, - Operator = propOperator.Value, - Value = propValue.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.RuleCondition value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAppliesTo, value.AppliesTo, null, null); - writer.WriteProperty(options, PropOperator, value.Operator, null, null); - writer.WriteProperty(options, PropValue, value.Value, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.RuleConditionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.RuleConditionConverter))] public sealed partial class RuleCondition { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RunningStateSearchInterval.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RunningStateSearchInterval.Converters.g.cs new file mode 100644 index 00000000000..4283509c9ef --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RunningStateSearchInterval.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class RunningStateSearchIntervalConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnd = System.Text.Json.JsonEncodedText.Encode("end"); + private static readonly System.Text.Json.JsonEncodedText PropEndMs = System.Text.Json.JsonEncodedText.Encode("end_ms"); + private static readonly System.Text.Json.JsonEncodedText PropStart = System.Text.Json.JsonEncodedText.Encode("start"); + private static readonly System.Text.Json.JsonEncodedText PropStartMs = System.Text.Json.JsonEncodedText.Encode("start_ms"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.RunningStateSearchInterval Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEnd = default; + LocalJsonValue propEndMs = default; + LocalJsonValue propStart = default; + LocalJsonValue propStartMs = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnd.TryReadProperty(ref reader, options, PropEnd, null)) + { + continue; + } + + if (propEndMs.TryReadProperty(ref reader, options, PropEndMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propStart.TryReadProperty(ref reader, options, PropStart, null)) + { + continue; + } + + if (propStartMs.TryReadProperty(ref reader, options, PropStartMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.RunningStateSearchInterval(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + End = propEnd.Value, + EndMs = propEndMs.Value, + Start = propStart.Value, + StartMs = propStartMs.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.RunningStateSearchInterval value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnd, value.End, null, null); + writer.WriteProperty(options, PropEndMs, value.EndMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropStart, value.Start, null, null); + writer.WriteProperty(options, PropStartMs, value.StartMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RunningStateSearchInterval.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RunningStateSearchInterval.g.cs index 23ef4f07d8e..3353c89223f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RunningStateSearchInterval.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/RunningStateSearchInterval.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class RunningStateSearchIntervalConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEnd = System.Text.Json.JsonEncodedText.Encode("end"); - private static readonly System.Text.Json.JsonEncodedText PropEndMs = System.Text.Json.JsonEncodedText.Encode("end_ms"); - private static readonly System.Text.Json.JsonEncodedText PropStart = System.Text.Json.JsonEncodedText.Encode("start"); - private static readonly System.Text.Json.JsonEncodedText PropStartMs = System.Text.Json.JsonEncodedText.Encode("start_ms"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.RunningStateSearchInterval Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEnd = default; - LocalJsonValue propEndMs = default; - LocalJsonValue propStart = default; - LocalJsonValue propStartMs = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEnd.TryReadProperty(ref reader, options, PropEnd, null)) - { - continue; - } - - if (propEndMs.TryReadProperty(ref reader, options, PropEndMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propStart.TryReadProperty(ref reader, options, PropStart, null)) - { - continue; - } - - if (propStartMs.TryReadProperty(ref reader, options, PropStartMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.RunningStateSearchInterval(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - End = propEnd.Value, - EndMs = propEndMs.Value, - Start = propStart.Value, - StartMs = propStartMs.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.RunningStateSearchInterval value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEnd, value.End, null, null); - writer.WriteProperty(options, PropEndMs, value.EndMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropStart, value.Start, null, null); - writer.WriteProperty(options, PropStartMs, value.StartMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.RunningStateSearchIntervalConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.RunningStateSearchIntervalConverter))] public sealed partial class RunningStateSearchInterval { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/SnapshotUpgradeState.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/SnapshotUpgradeState.Converters.g.cs new file mode 100644 index 00000000000..a06451fef5e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/SnapshotUpgradeState.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class SnapshotUpgradeStateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberFailed = System.Text.Json.JsonEncodedText.Encode("failed"); + private static readonly System.Text.Json.JsonEncodedText MemberLoadingOldState = System.Text.Json.JsonEncodedText.Encode("loading_old_state"); + private static readonly System.Text.Json.JsonEncodedText MemberSavingNewState = System.Text.Json.JsonEncodedText.Encode("saving_new_state"); + private static readonly System.Text.Json.JsonEncodedText MemberStopped = System.Text.Json.JsonEncodedText.Encode("stopped"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberFailed)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState.Failed; + } + + if (reader.ValueTextEquals(MemberLoadingOldState)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState.LoadingOldState; + } + + if (reader.ValueTextEquals(MemberSavingNewState)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState.SavingNewState; + } + + if (reader.ValueTextEquals(MemberStopped)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState.Stopped; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberFailed.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState.Failed; + } + + if (string.Equals(value, MemberLoadingOldState.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState.LoadingOldState; + } + + if (string.Equals(value, MemberSavingNewState.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState.SavingNewState; + } + + if (string.Equals(value, MemberStopped.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState.Stopped; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState.Failed: + writer.WriteStringValue(MemberFailed); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState.LoadingOldState: + writer.WriteStringValue(MemberLoadingOldState); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState.SavingNewState: + writer.WriteStringValue(MemberSavingNewState); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState.Stopped: + writer.WriteStringValue(MemberStopped); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.SnapshotUpgradeState value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/SnapshotUpgradeState.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/SnapshotUpgradeState.g.cs new file mode 100644 index 00000000000..e42f4a53a5c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/SnapshotUpgradeState.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.SnapshotUpgradeStateConverter))] +public enum SnapshotUpgradeState +{ + [System.Runtime.Serialization.EnumMember(Value = "failed")] + Failed, + [System.Runtime.Serialization.EnumMember(Value = "loading_old_state")] + LoadingOldState, + [System.Runtime.Serialization.EnumMember(Value = "saving_new_state")] + SavingNewState, + [System.Runtime.Serialization.EnumMember(Value = "stopped")] + Stopped +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TargetMeanEncodingPreprocessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TargetMeanEncodingPreprocessor.Converters.g.cs new file mode 100644 index 00000000000..6bb902249b6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TargetMeanEncodingPreprocessor.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TargetMeanEncodingPreprocessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDefaultValue = System.Text.Json.JsonEncodedText.Encode("default_value"); + private static readonly System.Text.Json.JsonEncodedText PropFeatureName = System.Text.Json.JsonEncodedText.Encode("feature_name"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropTargetMap = System.Text.Json.JsonEncodedText.Encode("target_map"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TargetMeanEncodingPreprocessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDefaultValue = default; + LocalJsonValue propFeatureName = default; + LocalJsonValue propField = default; + LocalJsonValue> propTargetMap = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDefaultValue.TryReadProperty(ref reader, options, PropDefaultValue, null)) + { + continue; + } + + if (propFeatureName.TryReadProperty(ref reader, options, PropFeatureName, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propTargetMap.TryReadProperty(ref reader, options, PropTargetMap, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TargetMeanEncodingPreprocessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DefaultValue = propDefaultValue.Value, + FeatureName = propFeatureName.Value, + Field = propField.Value, + TargetMap = propTargetMap.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TargetMeanEncodingPreprocessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDefaultValue, value.DefaultValue, null, null); + writer.WriteProperty(options, PropFeatureName, value.FeatureName, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropTargetMap, value.TargetMap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TargetMeanEncodingPreprocessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TargetMeanEncodingPreprocessor.g.cs index fd3dd5a0e1a..d8a09be504a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TargetMeanEncodingPreprocessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TargetMeanEncodingPreprocessor.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TargetMeanEncodingPreprocessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDefaultValue = System.Text.Json.JsonEncodedText.Encode("default_value"); - private static readonly System.Text.Json.JsonEncodedText PropFeatureName = System.Text.Json.JsonEncodedText.Encode("feature_name"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropTargetMap = System.Text.Json.JsonEncodedText.Encode("target_map"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TargetMeanEncodingPreprocessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDefaultValue = default; - LocalJsonValue propFeatureName = default; - LocalJsonValue propField = default; - LocalJsonValue> propTargetMap = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDefaultValue.TryReadProperty(ref reader, options, PropDefaultValue, null)) - { - continue; - } - - if (propFeatureName.TryReadProperty(ref reader, options, PropFeatureName, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propTargetMap.TryReadProperty(ref reader, options, PropTargetMap, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TargetMeanEncodingPreprocessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DefaultValue = propDefaultValue.Value, - FeatureName = propFeatureName.Value, - Field = propField.Value, - TargetMap = propTargetMap.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TargetMeanEncodingPreprocessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDefaultValue, value.DefaultValue, null, null); - writer.WriteProperty(options, PropFeatureName, value.FeatureName, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropTargetMap, value.TargetMap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TargetMeanEncodingPreprocessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TargetMeanEncodingPreprocessorConverter))] public sealed partial class TargetMeanEncodingPreprocessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextClassificationInferenceOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextClassificationInferenceOptions.Converters.g.cs new file mode 100644 index 00000000000..e9803603e0e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextClassificationInferenceOptions.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TextClassificationInferenceOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClassificationLabels = System.Text.Json.JsonEncodedText.Encode("classification_labels"); + private static readonly System.Text.Json.JsonEncodedText PropNumTopClasses = System.Text.Json.JsonEncodedText.Encode("num_top_classes"); + private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); + private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); + private static readonly System.Text.Json.JsonEncodedText PropVocabulary = System.Text.Json.JsonEncodedText.Encode("vocabulary"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TextClassificationInferenceOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propClassificationLabels = default; + LocalJsonValue propNumTopClasses = default; + LocalJsonValue propResultsField = default; + LocalJsonValue propTokenization = default; + LocalJsonValue propVocabulary = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClassificationLabels.TryReadProperty(ref reader, options, PropClassificationLabels, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propNumTopClasses.TryReadProperty(ref reader, options, PropNumTopClasses, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) + { + continue; + } + + if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) + { + continue; + } + + if (propVocabulary.TryReadProperty(ref reader, options, PropVocabulary, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TextClassificationInferenceOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClassificationLabels = propClassificationLabels.Value, + NumTopClasses = propNumTopClasses.Value, + ResultsField = propResultsField.Value, + Tokenization = propTokenization.Value, + Vocabulary = propVocabulary.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TextClassificationInferenceOptions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClassificationLabels, value.ClassificationLabels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropNumTopClasses, value.NumTopClasses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); + writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); + writer.WriteProperty(options, PropVocabulary, value.Vocabulary, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextClassificationInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextClassificationInferenceOptions.g.cs index 5110562d5af..c9109f1820f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextClassificationInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextClassificationInferenceOptions.g.cs @@ -23,87 +23,12 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TextClassificationInferenceOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClassificationLabels = System.Text.Json.JsonEncodedText.Encode("classification_labels"); - private static readonly System.Text.Json.JsonEncodedText PropNumTopClasses = System.Text.Json.JsonEncodedText.Encode("num_top_classes"); - private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); - private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); - private static readonly System.Text.Json.JsonEncodedText PropVocabulary = System.Text.Json.JsonEncodedText.Encode("vocabulary"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TextClassificationInferenceOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propClassificationLabels = default; - LocalJsonValue propNumTopClasses = default; - LocalJsonValue propResultsField = default; - LocalJsonValue propTokenization = default; - LocalJsonValue propVocabulary = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClassificationLabels.TryReadProperty(ref reader, options, PropClassificationLabels, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propNumTopClasses.TryReadProperty(ref reader, options, PropNumTopClasses, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) - { - continue; - } - - if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) - { - continue; - } - - if (propVocabulary.TryReadProperty(ref reader, options, PropVocabulary, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TextClassificationInferenceOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClassificationLabels = propClassificationLabels.Value, - NumTopClasses = propNumTopClasses.Value, - ResultsField = propResultsField.Value, - Tokenization = propTokenization.Value, - Vocabulary = propVocabulary.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TextClassificationInferenceOptions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClassificationLabels, value.ClassificationLabels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropNumTopClasses, value.NumTopClasses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); - writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); - writer.WriteProperty(options, PropVocabulary, value.Vocabulary, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Text classification configuration options /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TextClassificationInferenceOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TextClassificationInferenceOptionsConverter))] public sealed partial class TextClassificationInferenceOptions { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextClassificationInferenceUpdateOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextClassificationInferenceUpdateOptions.Converters.g.cs new file mode 100644 index 00000000000..75fc434e305 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextClassificationInferenceUpdateOptions.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TextClassificationInferenceUpdateOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClassificationLabels = System.Text.Json.JsonEncodedText.Encode("classification_labels"); + private static readonly System.Text.Json.JsonEncodedText PropNumTopClasses = System.Text.Json.JsonEncodedText.Encode("num_top_classes"); + private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); + private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TextClassificationInferenceUpdateOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propClassificationLabels = default; + LocalJsonValue propNumTopClasses = default; + LocalJsonValue propResultsField = default; + LocalJsonValue propTokenization = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClassificationLabels.TryReadProperty(ref reader, options, PropClassificationLabels, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propNumTopClasses.TryReadProperty(ref reader, options, PropNumTopClasses, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) + { + continue; + } + + if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TextClassificationInferenceUpdateOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClassificationLabels = propClassificationLabels.Value, + NumTopClasses = propNumTopClasses.Value, + ResultsField = propResultsField.Value, + Tokenization = propTokenization.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TextClassificationInferenceUpdateOptions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClassificationLabels, value.ClassificationLabels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropNumTopClasses, value.NumTopClasses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); + writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextClassificationInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextClassificationInferenceUpdateOptions.g.cs index 6be011e9cab..91a8a2b5628 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextClassificationInferenceUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextClassificationInferenceUpdateOptions.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TextClassificationInferenceUpdateOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClassificationLabels = System.Text.Json.JsonEncodedText.Encode("classification_labels"); - private static readonly System.Text.Json.JsonEncodedText PropNumTopClasses = System.Text.Json.JsonEncodedText.Encode("num_top_classes"); - private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); - private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TextClassificationInferenceUpdateOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propClassificationLabels = default; - LocalJsonValue propNumTopClasses = default; - LocalJsonValue propResultsField = default; - LocalJsonValue propTokenization = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClassificationLabels.TryReadProperty(ref reader, options, PropClassificationLabels, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propNumTopClasses.TryReadProperty(ref reader, options, PropNumTopClasses, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) - { - continue; - } - - if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TextClassificationInferenceUpdateOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClassificationLabels = propClassificationLabels.Value, - NumTopClasses = propNumTopClasses.Value, - ResultsField = propResultsField.Value, - Tokenization = propTokenization.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TextClassificationInferenceUpdateOptions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClassificationLabels, value.ClassificationLabels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropNumTopClasses, value.NumTopClasses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); - writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TextClassificationInferenceUpdateOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TextClassificationInferenceUpdateOptionsConverter))] public sealed partial class TextClassificationInferenceUpdateOptions { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextEmbeddingInferenceOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextEmbeddingInferenceOptions.Converters.g.cs new file mode 100644 index 00000000000..ae20084e57d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextEmbeddingInferenceOptions.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TextEmbeddingInferenceOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEmbeddingSize = System.Text.Json.JsonEncodedText.Encode("embedding_size"); + private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); + private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); + private static readonly System.Text.Json.JsonEncodedText PropVocabulary = System.Text.Json.JsonEncodedText.Encode("vocabulary"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TextEmbeddingInferenceOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEmbeddingSize = default; + LocalJsonValue propResultsField = default; + LocalJsonValue propTokenization = default; + LocalJsonValue propVocabulary = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEmbeddingSize.TryReadProperty(ref reader, options, PropEmbeddingSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) + { + continue; + } + + if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) + { + continue; + } + + if (propVocabulary.TryReadProperty(ref reader, options, PropVocabulary, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TextEmbeddingInferenceOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + EmbeddingSize = propEmbeddingSize.Value, + ResultsField = propResultsField.Value, + Tokenization = propTokenization.Value, + Vocabulary = propVocabulary.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TextEmbeddingInferenceOptions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEmbeddingSize, value.EmbeddingSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); + writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); + writer.WriteProperty(options, PropVocabulary, value.Vocabulary, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextEmbeddingInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextEmbeddingInferenceOptions.g.cs index 3e23ac87a11..4b8e83e5706 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextEmbeddingInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextEmbeddingInferenceOptions.g.cs @@ -23,78 +23,12 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TextEmbeddingInferenceOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEmbeddingSize = System.Text.Json.JsonEncodedText.Encode("embedding_size"); - private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); - private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); - private static readonly System.Text.Json.JsonEncodedText PropVocabulary = System.Text.Json.JsonEncodedText.Encode("vocabulary"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TextEmbeddingInferenceOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEmbeddingSize = default; - LocalJsonValue propResultsField = default; - LocalJsonValue propTokenization = default; - LocalJsonValue propVocabulary = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEmbeddingSize.TryReadProperty(ref reader, options, PropEmbeddingSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) - { - continue; - } - - if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) - { - continue; - } - - if (propVocabulary.TryReadProperty(ref reader, options, PropVocabulary, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TextEmbeddingInferenceOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - EmbeddingSize = propEmbeddingSize.Value, - ResultsField = propResultsField.Value, - Tokenization = propTokenization.Value, - Vocabulary = propVocabulary.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TextEmbeddingInferenceOptions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEmbeddingSize, value.EmbeddingSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); - writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); - writer.WriteProperty(options, PropVocabulary, value.Vocabulary, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Text embedding inference options /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TextEmbeddingInferenceOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TextEmbeddingInferenceOptionsConverter))] public sealed partial class TextEmbeddingInferenceOptions { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextEmbeddingInferenceUpdateOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextEmbeddingInferenceUpdateOptions.Converters.g.cs new file mode 100644 index 00000000000..68d8a01a8d8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextEmbeddingInferenceUpdateOptions.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TextEmbeddingInferenceUpdateOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); + private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TextEmbeddingInferenceUpdateOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propResultsField = default; + LocalJsonValue propTokenization = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) + { + continue; + } + + if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TextEmbeddingInferenceUpdateOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ResultsField = propResultsField.Value, + Tokenization = propTokenization.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TextEmbeddingInferenceUpdateOptions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); + writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextEmbeddingInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextEmbeddingInferenceUpdateOptions.g.cs index e784c8d0632..1ba697bd529 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextEmbeddingInferenceUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextEmbeddingInferenceUpdateOptions.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TextEmbeddingInferenceUpdateOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); - private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TextEmbeddingInferenceUpdateOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propResultsField = default; - LocalJsonValue propTokenization = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) - { - continue; - } - - if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TextEmbeddingInferenceUpdateOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ResultsField = propResultsField.Value, - Tokenization = propTokenization.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TextEmbeddingInferenceUpdateOptions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); - writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TextEmbeddingInferenceUpdateOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TextEmbeddingInferenceUpdateOptionsConverter))] public sealed partial class TextEmbeddingInferenceUpdateOptions { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextExpansionInferenceOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextExpansionInferenceOptions.Converters.g.cs new file mode 100644 index 00000000000..666e0daa1d5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextExpansionInferenceOptions.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TextExpansionInferenceOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); + private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); + private static readonly System.Text.Json.JsonEncodedText PropVocabulary = System.Text.Json.JsonEncodedText.Encode("vocabulary"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TextExpansionInferenceOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propResultsField = default; + LocalJsonValue propTokenization = default; + LocalJsonValue propVocabulary = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) + { + continue; + } + + if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) + { + continue; + } + + if (propVocabulary.TryReadProperty(ref reader, options, PropVocabulary, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TextExpansionInferenceOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ResultsField = propResultsField.Value, + Tokenization = propTokenization.Value, + Vocabulary = propVocabulary.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TextExpansionInferenceOptions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); + writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); + writer.WriteProperty(options, PropVocabulary, value.Vocabulary, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextExpansionInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextExpansionInferenceOptions.g.cs index d88795f9b22..42b0225e656 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextExpansionInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextExpansionInferenceOptions.g.cs @@ -23,69 +23,12 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TextExpansionInferenceOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); - private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); - private static readonly System.Text.Json.JsonEncodedText PropVocabulary = System.Text.Json.JsonEncodedText.Encode("vocabulary"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TextExpansionInferenceOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propResultsField = default; - LocalJsonValue propTokenization = default; - LocalJsonValue propVocabulary = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) - { - continue; - } - - if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) - { - continue; - } - - if (propVocabulary.TryReadProperty(ref reader, options, PropVocabulary, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TextExpansionInferenceOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ResultsField = propResultsField.Value, - Tokenization = propTokenization.Value, - Vocabulary = propVocabulary.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TextExpansionInferenceOptions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); - writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); - writer.WriteProperty(options, PropVocabulary, value.Vocabulary, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Text expansion inference options /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TextExpansionInferenceOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TextExpansionInferenceOptionsConverter))] public sealed partial class TextExpansionInferenceOptions { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextExpansionInferenceUpdateOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextExpansionInferenceUpdateOptions.Converters.g.cs new file mode 100644 index 00000000000..98e5d94f46a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextExpansionInferenceUpdateOptions.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TextExpansionInferenceUpdateOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); + private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TextExpansionInferenceUpdateOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propResultsField = default; + LocalJsonValue propTokenization = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) + { + continue; + } + + if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TextExpansionInferenceUpdateOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ResultsField = propResultsField.Value, + Tokenization = propTokenization.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TextExpansionInferenceUpdateOptions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); + writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextExpansionInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextExpansionInferenceUpdateOptions.g.cs index c6caa789bee..f7fcb465bbf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextExpansionInferenceUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TextExpansionInferenceUpdateOptions.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TextExpansionInferenceUpdateOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); - private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TextExpansionInferenceUpdateOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propResultsField = default; - LocalJsonValue propTokenization = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) - { - continue; - } - - if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TextExpansionInferenceUpdateOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ResultsField = propResultsField.Value, - Tokenization = propTokenization.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TextExpansionInferenceUpdateOptions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); - writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TextExpansionInferenceUpdateOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TextExpansionInferenceUpdateOptionsConverter))] public sealed partial class TextExpansionInferenceUpdateOptions { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TokenizationConfig.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TokenizationConfig.Converters.g.cs new file mode 100644 index 00000000000..3f4a0bf3ec8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TokenizationConfig.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TokenizationConfigConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantBert = System.Text.Json.JsonEncodedText.Encode("bert"); + private static readonly System.Text.Json.JsonEncodedText VariantBertJa = System.Text.Json.JsonEncodedText.Encode("bert_ja"); + private static readonly System.Text.Json.JsonEncodedText VariantMpnet = System.Text.Json.JsonEncodedText.Encode("mpnet"); + private static readonly System.Text.Json.JsonEncodedText VariantRoberta = System.Text.Json.JsonEncodedText.Encode("roberta"); + private static readonly System.Text.Json.JsonEncodedText VariantXlmRoberta = System.Text.Json.JsonEncodedText.Encode("xlm_roberta"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantBert)) + { + variantType = VariantBert.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantBertJa)) + { + variantType = VariantBertJa.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMpnet)) + { + variantType = VariantMpnet.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRoberta)) + { + variantType = VariantRoberta.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantXlmRoberta)) + { + variantType = VariantXlmRoberta.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "bert": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.NlpBertTokenizationConfig)value.Variant, null, null); + break; + case "bert_ja": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.NlpBertTokenizationConfig)value.Variant, null, null); + break; + case "mpnet": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.NlpBertTokenizationConfig)value.Variant, null, null); + break; + case "roberta": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.NlpRobertaTokenizationConfig)value.Variant, null, null); + break; + case "xlm_roberta": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.XlmRobertaTokenizationConfig)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TokenizationConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TokenizationConfig.g.cs index 83e5ef67bab..2f950efd8e3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TokenizationConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TokenizationConfig.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TokenizationConfigConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantBert = System.Text.Json.JsonEncodedText.Encode("bert"); - private static readonly System.Text.Json.JsonEncodedText VariantBertJa = System.Text.Json.JsonEncodedText.Encode("bert_ja"); - private static readonly System.Text.Json.JsonEncodedText VariantMpnet = System.Text.Json.JsonEncodedText.Encode("mpnet"); - private static readonly System.Text.Json.JsonEncodedText VariantRoberta = System.Text.Json.JsonEncodedText.Encode("roberta"); - private static readonly System.Text.Json.JsonEncodedText VariantXlmRoberta = System.Text.Json.JsonEncodedText.Encode("xlm_roberta"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantBert)) - { - variantType = VariantBert.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantBertJa)) - { - variantType = VariantBertJa.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMpnet)) - { - variantType = VariantMpnet.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRoberta)) - { - variantType = VariantRoberta.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantXlmRoberta)) - { - variantType = VariantXlmRoberta.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "bert": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.NlpBertTokenizationConfig)value.Variant, null, null); - break; - case "bert_ja": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.NlpBertTokenizationConfig)value.Variant, null, null); - break; - case "mpnet": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.NlpBertTokenizationConfig)value.Variant, null, null); - break; - case "roberta": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.NlpRobertaTokenizationConfig)value.Variant, null, null); - break; - case "xlm_roberta": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.MachineLearning.XlmRobertaTokenizationConfig)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfig)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationConfigConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TokenizationConfigConverter))] public sealed partial class TokenizationConfig { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TokenizationTruncate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TokenizationTruncate.Converters.g.cs new file mode 100644 index 00000000000..6c4fb730628 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TokenizationTruncate.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TokenizationTruncateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberFirst = System.Text.Json.JsonEncodedText.Encode("first"); + private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); + private static readonly System.Text.Json.JsonEncodedText MemberSecond = System.Text.Json.JsonEncodedText.Encode("second"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberFirst)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate.First; + } + + if (reader.ValueTextEquals(MemberNone)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate.None; + } + + if (reader.ValueTextEquals(MemberSecond)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate.Second; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberFirst.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate.First; + } + + if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate.None; + } + + if (string.Equals(value, MemberSecond.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate.Second; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate.First: + writer.WriteStringValue(MemberFirst); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate.None: + writer.WriteStringValue(MemberNone); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate.Second: + writer.WriteStringValue(MemberSecond); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TokenizationTruncate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TokenizationTruncate.g.cs new file mode 100644 index 00000000000..3459d335f42 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TokenizationTruncate.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TokenizationTruncateConverter))] +public enum TokenizationTruncate +{ + [System.Runtime.Serialization.EnumMember(Value = "first")] + First, + [System.Runtime.Serialization.EnumMember(Value = "none")] + None, + [System.Runtime.Serialization.EnumMember(Value = "second")] + Second +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TopClassEntry.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TopClassEntry.Converters.g.cs new file mode 100644 index 00000000000..b80e741566a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TopClassEntry.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TopClassEntryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClassName = System.Text.Json.JsonEncodedText.Encode("class_name"); + private static readonly System.Text.Json.JsonEncodedText PropClassProbability = System.Text.Json.JsonEncodedText.Encode("class_probability"); + private static readonly System.Text.Json.JsonEncodedText PropClassScore = System.Text.Json.JsonEncodedText.Encode("class_score"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TopClassEntry Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClassName = default; + LocalJsonValue propClassProbability = default; + LocalJsonValue propClassScore = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClassName.TryReadProperty(ref reader, options, PropClassName, null)) + { + continue; + } + + if (propClassProbability.TryReadProperty(ref reader, options, PropClassProbability, null)) + { + continue; + } + + if (propClassScore.TryReadProperty(ref reader, options, PropClassScore, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TopClassEntry(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClassName = propClassName.Value, + ClassProbability = propClassProbability.Value, + ClassScore = propClassScore.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TopClassEntry value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClassName, value.ClassName, null, null); + writer.WriteProperty(options, PropClassProbability, value.ClassProbability, null, null); + writer.WriteProperty(options, PropClassScore, value.ClassScore, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TopClassEntry.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TopClassEntry.g.cs index 0a519d8c330..11cb9bcfc9f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TopClassEntry.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TopClassEntry.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TopClassEntryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClassName = System.Text.Json.JsonEncodedText.Encode("class_name"); - private static readonly System.Text.Json.JsonEncodedText PropClassProbability = System.Text.Json.JsonEncodedText.Encode("class_probability"); - private static readonly System.Text.Json.JsonEncodedText PropClassScore = System.Text.Json.JsonEncodedText.Encode("class_score"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TopClassEntry Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClassName = default; - LocalJsonValue propClassProbability = default; - LocalJsonValue propClassScore = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClassName.TryReadProperty(ref reader, options, PropClassName, null)) - { - continue; - } - - if (propClassProbability.TryReadProperty(ref reader, options, PropClassProbability, null)) - { - continue; - } - - if (propClassScore.TryReadProperty(ref reader, options, PropClassScore, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TopClassEntry(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClassName = propClassName.Value, - ClassProbability = propClassProbability.Value, - ClassScore = propClassScore.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TopClassEntry value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClassName, value.ClassName, null, null); - writer.WriteProperty(options, PropClassProbability, value.ClassProbability, null, null); - writer.WriteProperty(options, PropClassScore, value.ClassScore, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TopClassEntryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TopClassEntryConverter))] public sealed partial class TopClassEntry { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportance.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportance.Converters.g.cs new file mode 100644 index 00000000000..90a37364e4b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportance.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TotalFeatureImportanceConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClasses = System.Text.Json.JsonEncodedText.Encode("classes"); + private static readonly System.Text.Json.JsonEncodedText PropFeatureName = System.Text.Json.JsonEncodedText.Encode("feature_name"); + private static readonly System.Text.Json.JsonEncodedText PropImportance = System.Text.Json.JsonEncodedText.Encode("importance"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TotalFeatureImportance Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propClasses = default; + LocalJsonValue propFeatureName = default; + LocalJsonValue> propImportance = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClasses.TryReadProperty(ref reader, options, PropClasses, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propFeatureName.TryReadProperty(ref reader, options, PropFeatureName, null)) + { + continue; + } + + if (propImportance.TryReadProperty(ref reader, options, PropImportance, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TotalFeatureImportance(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Classes = propClasses.Value, + FeatureName = propFeatureName.Value, + Importance = propImportance.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TotalFeatureImportance value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClasses, value.Classes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFeatureName, value.FeatureName, null, null); + writer.WriteProperty(options, PropImportance, value.Importance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportance.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportance.g.cs index 411f0441b09..451fa369bba 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportance.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportance.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TotalFeatureImportanceConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClasses = System.Text.Json.JsonEncodedText.Encode("classes"); - private static readonly System.Text.Json.JsonEncodedText PropFeatureName = System.Text.Json.JsonEncodedText.Encode("feature_name"); - private static readonly System.Text.Json.JsonEncodedText PropImportance = System.Text.Json.JsonEncodedText.Encode("importance"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TotalFeatureImportance Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propClasses = default; - LocalJsonValue propFeatureName = default; - LocalJsonValue> propImportance = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClasses.TryReadProperty(ref reader, options, PropClasses, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propFeatureName.TryReadProperty(ref reader, options, PropFeatureName, null)) - { - continue; - } - - if (propImportance.TryReadProperty(ref reader, options, PropImportance, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TotalFeatureImportance(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Classes = propClasses.Value, - FeatureName = propFeatureName.Value, - Importance = propImportance.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TotalFeatureImportance value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClasses, value.Classes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFeatureName, value.FeatureName, null, null); - writer.WriteProperty(options, PropImportance, value.Importance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TotalFeatureImportanceConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TotalFeatureImportanceConverter))] public sealed partial class TotalFeatureImportance { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportanceClass.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportanceClass.Converters.g.cs new file mode 100644 index 00000000000..61a38c4e4fc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportanceClass.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TotalFeatureImportanceClassConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClassName = System.Text.Json.JsonEncodedText.Encode("class_name"); + private static readonly System.Text.Json.JsonEncodedText PropImportance = System.Text.Json.JsonEncodedText.Encode("importance"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TotalFeatureImportanceClass Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClassName = default; + LocalJsonValue> propImportance = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClassName.TryReadProperty(ref reader, options, PropClassName, null)) + { + continue; + } + + if (propImportance.TryReadProperty(ref reader, options, PropImportance, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TotalFeatureImportanceClass(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClassName = propClassName.Value, + Importance = propImportance.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TotalFeatureImportanceClass value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClassName, value.ClassName, null, null); + writer.WriteProperty(options, PropImportance, value.Importance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportanceClass.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportanceClass.g.cs index 38bd0bebd1d..2ea698bd135 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportanceClass.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportanceClass.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TotalFeatureImportanceClassConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClassName = System.Text.Json.JsonEncodedText.Encode("class_name"); - private static readonly System.Text.Json.JsonEncodedText PropImportance = System.Text.Json.JsonEncodedText.Encode("importance"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TotalFeatureImportanceClass Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClassName = default; - LocalJsonValue> propImportance = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClassName.TryReadProperty(ref reader, options, PropClassName, null)) - { - continue; - } - - if (propImportance.TryReadProperty(ref reader, options, PropImportance, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TotalFeatureImportanceClass(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClassName = propClassName.Value, - Importance = propImportance.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TotalFeatureImportanceClass value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClassName, value.ClassName, null, null); - writer.WriteProperty(options, PropImportance, value.Importance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TotalFeatureImportanceClassConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TotalFeatureImportanceClassConverter))] public sealed partial class TotalFeatureImportanceClass { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportanceStatistics.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportanceStatistics.Converters.g.cs new file mode 100644 index 00000000000..cc6e6d6b67d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportanceStatistics.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TotalFeatureImportanceStatisticsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText PropMeanMagnitude = System.Text.Json.JsonEncodedText.Encode("mean_magnitude"); + private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TotalFeatureImportanceStatistics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMax = default; + LocalJsonValue propMeanMagnitude = default; + LocalJsonValue propMin = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMax.TryReadProperty(ref reader, options, PropMax, null)) + { + continue; + } + + if (propMeanMagnitude.TryReadProperty(ref reader, options, PropMeanMagnitude, null)) + { + continue; + } + + if (propMin.TryReadProperty(ref reader, options, PropMin, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TotalFeatureImportanceStatistics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Max = propMax.Value, + MeanMagnitude = propMeanMagnitude.Value, + Min = propMin.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TotalFeatureImportanceStatistics value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMax, value.Max, null, null); + writer.WriteProperty(options, PropMeanMagnitude, value.MeanMagnitude, null, null); + writer.WriteProperty(options, PropMin, value.Min, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportanceStatistics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportanceStatistics.g.cs index b2a4b23d729..80e5a93a435 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportanceStatistics.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TotalFeatureImportanceStatistics.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TotalFeatureImportanceStatisticsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); - private static readonly System.Text.Json.JsonEncodedText PropMeanMagnitude = System.Text.Json.JsonEncodedText.Encode("mean_magnitude"); - private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TotalFeatureImportanceStatistics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMax = default; - LocalJsonValue propMeanMagnitude = default; - LocalJsonValue propMin = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMax.TryReadProperty(ref reader, options, PropMax, null)) - { - continue; - } - - if (propMeanMagnitude.TryReadProperty(ref reader, options, PropMeanMagnitude, null)) - { - continue; - } - - if (propMin.TryReadProperty(ref reader, options, PropMin, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TotalFeatureImportanceStatistics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Max = propMax.Value, - MeanMagnitude = propMeanMagnitude.Value, - Min = propMin.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TotalFeatureImportanceStatistics value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMax, value.Max, null, null); - writer.WriteProperty(options, PropMeanMagnitude, value.MeanMagnitude, null, null); - writer.WriteProperty(options, PropMin, value.Min, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TotalFeatureImportanceStatisticsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TotalFeatureImportanceStatisticsConverter))] public sealed partial class TotalFeatureImportanceStatistics { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModel.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModel.Converters.g.cs new file mode 100644 index 00000000000..c71e2a6b2f3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModel.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TrainedModelConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnsemble = System.Text.Json.JsonEncodedText.Encode("ensemble"); + private static readonly System.Text.Json.JsonEncodedText PropTree = System.Text.Json.JsonEncodedText.Encode("tree"); + private static readonly System.Text.Json.JsonEncodedText PropTreeNode = System.Text.Json.JsonEncodedText.Encode("tree_node"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModel Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEnsemble = default; + LocalJsonValue propTree = default; + LocalJsonValue propTreeNode = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnsemble.TryReadProperty(ref reader, options, PropEnsemble, null)) + { + continue; + } + + if (propTree.TryReadProperty(ref reader, options, PropTree, null)) + { + continue; + } + + if (propTreeNode.TryReadProperty(ref reader, options, PropTreeNode, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModel(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Ensemble = propEnsemble.Value, + Tree = propTree.Value, + TreeNode = propTreeNode.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModel value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnsemble, value.Ensemble, null, null); + writer.WriteProperty(options, PropTree, value.Tree, null, null); + writer.WriteProperty(options, PropTreeNode, value.TreeNode, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModel.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModel.g.cs index cee0310e6fd..871f498b115 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModel.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModel.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TrainedModelConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEnsemble = System.Text.Json.JsonEncodedText.Encode("ensemble"); - private static readonly System.Text.Json.JsonEncodedText PropTree = System.Text.Json.JsonEncodedText.Encode("tree"); - private static readonly System.Text.Json.JsonEncodedText PropTreeNode = System.Text.Json.JsonEncodedText.Encode("tree_node"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModel Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEnsemble = default; - LocalJsonValue propTree = default; - LocalJsonValue propTreeNode = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEnsemble.TryReadProperty(ref reader, options, PropEnsemble, null)) - { - continue; - } - - if (propTree.TryReadProperty(ref reader, options, PropTree, null)) - { - continue; - } - - if (propTreeNode.TryReadProperty(ref reader, options, PropTreeNode, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModel(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Ensemble = propEnsemble.Value, - Tree = propTree.Value, - TreeNode = propTreeNode.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModel value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEnsemble, value.Ensemble, null, null); - writer.WriteProperty(options, PropTree, value.Tree, null, null); - writer.WriteProperty(options, PropTreeNode, value.TreeNode, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TrainedModelConverter))] public sealed partial class TrainedModel { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignment.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignment.Converters.g.cs new file mode 100644 index 00000000000..02e9ceb63c6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignment.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TrainedModelAssignmentConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAdaptiveAllocations = System.Text.Json.JsonEncodedText.Encode("adaptive_allocations"); + private static readonly System.Text.Json.JsonEncodedText PropAssignmentState = System.Text.Json.JsonEncodedText.Encode("assignment_state"); + private static readonly System.Text.Json.JsonEncodedText PropMaxAssignedAllocations = System.Text.Json.JsonEncodedText.Encode("max_assigned_allocations"); + private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); + private static readonly System.Text.Json.JsonEncodedText PropRoutingTable = System.Text.Json.JsonEncodedText.Encode("routing_table"); + private static readonly System.Text.Json.JsonEncodedText PropStartTime = System.Text.Json.JsonEncodedText.Encode("start_time"); + private static readonly System.Text.Json.JsonEncodedText PropTaskParameters = System.Text.Json.JsonEncodedText.Encode("task_parameters"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignment Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAdaptiveAllocations = default; + LocalJsonValue propAssignmentState = default; + LocalJsonValue propMaxAssignedAllocations = default; + LocalJsonValue propReason = default; + LocalJsonValue> propRoutingTable = default; + LocalJsonValue propStartTime = default; + LocalJsonValue propTaskParameters = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAdaptiveAllocations.TryReadProperty(ref reader, options, PropAdaptiveAllocations, null)) + { + continue; + } + + if (propAssignmentState.TryReadProperty(ref reader, options, PropAssignmentState, null)) + { + continue; + } + + if (propMaxAssignedAllocations.TryReadProperty(ref reader, options, PropMaxAssignedAllocations, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propReason.TryReadProperty(ref reader, options, PropReason, null)) + { + continue; + } + + if (propRoutingTable.TryReadProperty(ref reader, options, PropRoutingTable, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propStartTime.TryReadProperty(ref reader, options, PropStartTime, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propTaskParameters.TryReadProperty(ref reader, options, PropTaskParameters, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignment(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AdaptiveAllocations = propAdaptiveAllocations.Value, + AssignmentState = propAssignmentState.Value, + MaxAssignedAllocations = propMaxAssignedAllocations.Value, + Reason = propReason.Value, + RoutingTable = propRoutingTable.Value, + StartTime = propStartTime.Value, + TaskParameters = propTaskParameters.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignment value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAdaptiveAllocations, value.AdaptiveAllocations, null, null); + writer.WriteProperty(options, PropAssignmentState, value.AssignmentState, null, null); + writer.WriteProperty(options, PropMaxAssignedAllocations, value.MaxAssignedAllocations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropReason, value.Reason, null, null); + writer.WriteProperty(options, PropRoutingTable, value.RoutingTable, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropStartTime, value.StartTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropTaskParameters, value.TaskParameters, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignment.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignment.g.cs index 3fa8047e4cb..c92267c3868 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignment.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignment.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TrainedModelAssignmentConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAdaptiveAllocations = System.Text.Json.JsonEncodedText.Encode("adaptive_allocations"); - private static readonly System.Text.Json.JsonEncodedText PropAssignmentState = System.Text.Json.JsonEncodedText.Encode("assignment_state"); - private static readonly System.Text.Json.JsonEncodedText PropMaxAssignedAllocations = System.Text.Json.JsonEncodedText.Encode("max_assigned_allocations"); - private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); - private static readonly System.Text.Json.JsonEncodedText PropRoutingTable = System.Text.Json.JsonEncodedText.Encode("routing_table"); - private static readonly System.Text.Json.JsonEncodedText PropStartTime = System.Text.Json.JsonEncodedText.Encode("start_time"); - private static readonly System.Text.Json.JsonEncodedText PropTaskParameters = System.Text.Json.JsonEncodedText.Encode("task_parameters"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignment Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAdaptiveAllocations = default; - LocalJsonValue propAssignmentState = default; - LocalJsonValue propMaxAssignedAllocations = default; - LocalJsonValue propReason = default; - LocalJsonValue> propRoutingTable = default; - LocalJsonValue propStartTime = default; - LocalJsonValue propTaskParameters = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAdaptiveAllocations.TryReadProperty(ref reader, options, PropAdaptiveAllocations, null)) - { - continue; - } - - if (propAssignmentState.TryReadProperty(ref reader, options, PropAssignmentState, null)) - { - continue; - } - - if (propMaxAssignedAllocations.TryReadProperty(ref reader, options, PropMaxAssignedAllocations, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propReason.TryReadProperty(ref reader, options, PropReason, null)) - { - continue; - } - - if (propRoutingTable.TryReadProperty(ref reader, options, PropRoutingTable, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propStartTime.TryReadProperty(ref reader, options, PropStartTime, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propTaskParameters.TryReadProperty(ref reader, options, PropTaskParameters, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignment(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AdaptiveAllocations = propAdaptiveAllocations.Value, - AssignmentState = propAssignmentState.Value, - MaxAssignedAllocations = propMaxAssignedAllocations.Value, - Reason = propReason.Value, - RoutingTable = propRoutingTable.Value, - StartTime = propStartTime.Value, - TaskParameters = propTaskParameters.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignment value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAdaptiveAllocations, value.AdaptiveAllocations, null, null); - writer.WriteProperty(options, PropAssignmentState, value.AssignmentState, null, null); - writer.WriteProperty(options, PropMaxAssignedAllocations, value.MaxAssignedAllocations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropReason, value.Reason, null, null); - writer.WriteProperty(options, PropRoutingTable, value.RoutingTable, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropStartTime, value.StartTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropTaskParameters, value.TaskParameters, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignmentConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TrainedModelAssignmentConverter))] public sealed partial class TrainedModelAssignment { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentRoutingStateAndReason.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentRoutingStateAndReason.Converters.g.cs new file mode 100644 index 00000000000..49ff934e76a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentRoutingStateAndReason.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TrainedModelAssignmentRoutingStateAndReasonConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); + private static readonly System.Text.Json.JsonEncodedText PropRoutingState = System.Text.Json.JsonEncodedText.Encode("routing_state"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignmentRoutingStateAndReason Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propReason = default; + LocalJsonValue propRoutingState = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propReason.TryReadProperty(ref reader, options, PropReason, null)) + { + continue; + } + + if (propRoutingState.TryReadProperty(ref reader, options, PropRoutingState, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignmentRoutingStateAndReason(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Reason = propReason.Value, + RoutingState = propRoutingState.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignmentRoutingStateAndReason value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropReason, value.Reason, null, null); + writer.WriteProperty(options, PropRoutingState, value.RoutingState, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentRoutingStateAndReason.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentRoutingStateAndReason.g.cs index 30e32ed2df0..09151b4f29d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentRoutingStateAndReason.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentRoutingStateAndReason.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TrainedModelAssignmentRoutingStateAndReasonConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); - private static readonly System.Text.Json.JsonEncodedText PropRoutingState = System.Text.Json.JsonEncodedText.Encode("routing_state"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignmentRoutingStateAndReason Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propReason = default; - LocalJsonValue propRoutingState = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propReason.TryReadProperty(ref reader, options, PropReason, null)) - { - continue; - } - - if (propRoutingState.TryReadProperty(ref reader, options, PropRoutingState, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignmentRoutingStateAndReason(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Reason = propReason.Value, - RoutingState = propRoutingState.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignmentRoutingStateAndReason value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropReason, value.Reason, null, null); - writer.WriteProperty(options, PropRoutingState, value.RoutingState, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignmentRoutingStateAndReasonConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TrainedModelAssignmentRoutingStateAndReasonConverter))] public sealed partial class TrainedModelAssignmentRoutingStateAndReason { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentRoutingTable.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentRoutingTable.Converters.g.cs new file mode 100644 index 00000000000..a3814937a41 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentRoutingTable.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TrainedModelAssignmentRoutingTableConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCurrentAllocations = System.Text.Json.JsonEncodedText.Encode("current_allocations"); + private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); + private static readonly System.Text.Json.JsonEncodedText PropRoutingState = System.Text.Json.JsonEncodedText.Encode("routing_state"); + private static readonly System.Text.Json.JsonEncodedText PropTargetAllocations = System.Text.Json.JsonEncodedText.Encode("target_allocations"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignmentRoutingTable Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCurrentAllocations = default; + LocalJsonValue propReason = default; + LocalJsonValue propRoutingState = default; + LocalJsonValue propTargetAllocations = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCurrentAllocations.TryReadProperty(ref reader, options, PropCurrentAllocations, null)) + { + continue; + } + + if (propReason.TryReadProperty(ref reader, options, PropReason, null)) + { + continue; + } + + if (propRoutingState.TryReadProperty(ref reader, options, PropRoutingState, null)) + { + continue; + } + + if (propTargetAllocations.TryReadProperty(ref reader, options, PropTargetAllocations, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignmentRoutingTable(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CurrentAllocations = propCurrentAllocations.Value, + Reason = propReason.Value, + RoutingState = propRoutingState.Value, + TargetAllocations = propTargetAllocations.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignmentRoutingTable value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCurrentAllocations, value.CurrentAllocations, null, null); + writer.WriteProperty(options, PropReason, value.Reason, null, null); + writer.WriteProperty(options, PropRoutingState, value.RoutingState, null, null); + writer.WriteProperty(options, PropTargetAllocations, value.TargetAllocations, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentRoutingTable.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentRoutingTable.g.cs index 0d3f658d81c..a63ba21aa0e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentRoutingTable.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentRoutingTable.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TrainedModelAssignmentRoutingTableConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCurrentAllocations = System.Text.Json.JsonEncodedText.Encode("current_allocations"); - private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); - private static readonly System.Text.Json.JsonEncodedText PropRoutingState = System.Text.Json.JsonEncodedText.Encode("routing_state"); - private static readonly System.Text.Json.JsonEncodedText PropTargetAllocations = System.Text.Json.JsonEncodedText.Encode("target_allocations"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignmentRoutingTable Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCurrentAllocations = default; - LocalJsonValue propReason = default; - LocalJsonValue propRoutingState = default; - LocalJsonValue propTargetAllocations = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCurrentAllocations.TryReadProperty(ref reader, options, PropCurrentAllocations, null)) - { - continue; - } - - if (propReason.TryReadProperty(ref reader, options, PropReason, null)) - { - continue; - } - - if (propRoutingState.TryReadProperty(ref reader, options, PropRoutingState, null)) - { - continue; - } - - if (propTargetAllocations.TryReadProperty(ref reader, options, PropTargetAllocations, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignmentRoutingTable(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CurrentAllocations = propCurrentAllocations.Value, - Reason = propReason.Value, - RoutingState = propRoutingState.Value, - TargetAllocations = propTargetAllocations.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignmentRoutingTable value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCurrentAllocations, value.CurrentAllocations, null, null); - writer.WriteProperty(options, PropReason, value.Reason, null, null); - writer.WriteProperty(options, PropRoutingState, value.RoutingState, null, null); - writer.WriteProperty(options, PropTargetAllocations, value.TargetAllocations, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignmentRoutingTableConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TrainedModelAssignmentRoutingTableConverter))] public sealed partial class TrainedModelAssignmentRoutingTable { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentTaskParameters.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentTaskParameters.Converters.g.cs new file mode 100644 index 00000000000..5e6eca25191 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentTaskParameters.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TrainedModelAssignmentTaskParametersConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCacheSize = System.Text.Json.JsonEncodedText.Encode("cache_size"); + private static readonly System.Text.Json.JsonEncodedText PropDeploymentId = System.Text.Json.JsonEncodedText.Encode("deployment_id"); + private static readonly System.Text.Json.JsonEncodedText PropModelBytes = System.Text.Json.JsonEncodedText.Encode("model_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); + private static readonly System.Text.Json.JsonEncodedText PropNumberOfAllocations = System.Text.Json.JsonEncodedText.Encode("number_of_allocations"); + private static readonly System.Text.Json.JsonEncodedText PropPerAllocationMemoryBytes = System.Text.Json.JsonEncodedText.Encode("per_allocation_memory_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropPerDeploymentMemoryBytes = System.Text.Json.JsonEncodedText.Encode("per_deployment_memory_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropPriority = System.Text.Json.JsonEncodedText.Encode("priority"); + private static readonly System.Text.Json.JsonEncodedText PropQueueCapacity = System.Text.Json.JsonEncodedText.Encode("queue_capacity"); + private static readonly System.Text.Json.JsonEncodedText PropThreadsPerAllocation = System.Text.Json.JsonEncodedText.Encode("threads_per_allocation"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignmentTaskParameters Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCacheSize = default; + LocalJsonValue propDeploymentId = default; + LocalJsonValue propModelBytes = default; + LocalJsonValue propModelId = default; + LocalJsonValue propNumberOfAllocations = default; + LocalJsonValue propPerAllocationMemoryBytes = default; + LocalJsonValue propPerDeploymentMemoryBytes = default; + LocalJsonValue propPriority = default; + LocalJsonValue propQueueCapacity = default; + LocalJsonValue propThreadsPerAllocation = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCacheSize.TryReadProperty(ref reader, options, PropCacheSize, null)) + { + continue; + } + + if (propDeploymentId.TryReadProperty(ref reader, options, PropDeploymentId, null)) + { + continue; + } + + if (propModelBytes.TryReadProperty(ref reader, options, PropModelBytes, null)) + { + continue; + } + + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) + { + continue; + } + + if (propNumberOfAllocations.TryReadProperty(ref reader, options, PropNumberOfAllocations, null)) + { + continue; + } + + if (propPerAllocationMemoryBytes.TryReadProperty(ref reader, options, PropPerAllocationMemoryBytes, null)) + { + continue; + } + + if (propPerDeploymentMemoryBytes.TryReadProperty(ref reader, options, PropPerDeploymentMemoryBytes, null)) + { + continue; + } + + if (propPriority.TryReadProperty(ref reader, options, PropPriority, null)) + { + continue; + } + + if (propQueueCapacity.TryReadProperty(ref reader, options, PropQueueCapacity, null)) + { + continue; + } + + if (propThreadsPerAllocation.TryReadProperty(ref reader, options, PropThreadsPerAllocation, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignmentTaskParameters(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CacheSize = propCacheSize.Value, + DeploymentId = propDeploymentId.Value, + ModelBytes = propModelBytes.Value, + ModelId = propModelId.Value, + NumberOfAllocations = propNumberOfAllocations.Value, + PerAllocationMemoryBytes = propPerAllocationMemoryBytes.Value, + PerDeploymentMemoryBytes = propPerDeploymentMemoryBytes.Value, + Priority = propPriority.Value, + QueueCapacity = propQueueCapacity.Value, + ThreadsPerAllocation = propThreadsPerAllocation.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignmentTaskParameters value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCacheSize, value.CacheSize, null, null); + writer.WriteProperty(options, PropDeploymentId, value.DeploymentId, null, null); + writer.WriteProperty(options, PropModelBytes, value.ModelBytes, null, null); + writer.WriteProperty(options, PropModelId, value.ModelId, null, null); + writer.WriteProperty(options, PropNumberOfAllocations, value.NumberOfAllocations, null, null); + writer.WriteProperty(options, PropPerAllocationMemoryBytes, value.PerAllocationMemoryBytes, null, null); + writer.WriteProperty(options, PropPerDeploymentMemoryBytes, value.PerDeploymentMemoryBytes, null, null); + writer.WriteProperty(options, PropPriority, value.Priority, null, null); + writer.WriteProperty(options, PropQueueCapacity, value.QueueCapacity, null, null); + writer.WriteProperty(options, PropThreadsPerAllocation, value.ThreadsPerAllocation, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentTaskParameters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentTaskParameters.g.cs index 00748dbf6b2..1a43fd35ae4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentTaskParameters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelAssignmentTaskParameters.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TrainedModelAssignmentTaskParametersConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCacheSize = System.Text.Json.JsonEncodedText.Encode("cache_size"); - private static readonly System.Text.Json.JsonEncodedText PropDeploymentId = System.Text.Json.JsonEncodedText.Encode("deployment_id"); - private static readonly System.Text.Json.JsonEncodedText PropModelBytes = System.Text.Json.JsonEncodedText.Encode("model_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); - private static readonly System.Text.Json.JsonEncodedText PropNumberOfAllocations = System.Text.Json.JsonEncodedText.Encode("number_of_allocations"); - private static readonly System.Text.Json.JsonEncodedText PropPerAllocationMemoryBytes = System.Text.Json.JsonEncodedText.Encode("per_allocation_memory_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropPerDeploymentMemoryBytes = System.Text.Json.JsonEncodedText.Encode("per_deployment_memory_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropPriority = System.Text.Json.JsonEncodedText.Encode("priority"); - private static readonly System.Text.Json.JsonEncodedText PropQueueCapacity = System.Text.Json.JsonEncodedText.Encode("queue_capacity"); - private static readonly System.Text.Json.JsonEncodedText PropThreadsPerAllocation = System.Text.Json.JsonEncodedText.Encode("threads_per_allocation"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignmentTaskParameters Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCacheSize = default; - LocalJsonValue propDeploymentId = default; - LocalJsonValue propModelBytes = default; - LocalJsonValue propModelId = default; - LocalJsonValue propNumberOfAllocations = default; - LocalJsonValue propPerAllocationMemoryBytes = default; - LocalJsonValue propPerDeploymentMemoryBytes = default; - LocalJsonValue propPriority = default; - LocalJsonValue propQueueCapacity = default; - LocalJsonValue propThreadsPerAllocation = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCacheSize.TryReadProperty(ref reader, options, PropCacheSize, null)) - { - continue; - } - - if (propDeploymentId.TryReadProperty(ref reader, options, PropDeploymentId, null)) - { - continue; - } - - if (propModelBytes.TryReadProperty(ref reader, options, PropModelBytes, null)) - { - continue; - } - - if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) - { - continue; - } - - if (propNumberOfAllocations.TryReadProperty(ref reader, options, PropNumberOfAllocations, null)) - { - continue; - } - - if (propPerAllocationMemoryBytes.TryReadProperty(ref reader, options, PropPerAllocationMemoryBytes, null)) - { - continue; - } - - if (propPerDeploymentMemoryBytes.TryReadProperty(ref reader, options, PropPerDeploymentMemoryBytes, null)) - { - continue; - } - - if (propPriority.TryReadProperty(ref reader, options, PropPriority, null)) - { - continue; - } - - if (propQueueCapacity.TryReadProperty(ref reader, options, PropQueueCapacity, null)) - { - continue; - } - - if (propThreadsPerAllocation.TryReadProperty(ref reader, options, PropThreadsPerAllocation, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignmentTaskParameters(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CacheSize = propCacheSize.Value, - DeploymentId = propDeploymentId.Value, - ModelBytes = propModelBytes.Value, - ModelId = propModelId.Value, - NumberOfAllocations = propNumberOfAllocations.Value, - PerAllocationMemoryBytes = propPerAllocationMemoryBytes.Value, - PerDeploymentMemoryBytes = propPerDeploymentMemoryBytes.Value, - Priority = propPriority.Value, - QueueCapacity = propQueueCapacity.Value, - ThreadsPerAllocation = propThreadsPerAllocation.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignmentTaskParameters value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCacheSize, value.CacheSize, null, null); - writer.WriteProperty(options, PropDeploymentId, value.DeploymentId, null, null); - writer.WriteProperty(options, PropModelBytes, value.ModelBytes, null, null); - writer.WriteProperty(options, PropModelId, value.ModelId, null, null); - writer.WriteProperty(options, PropNumberOfAllocations, value.NumberOfAllocations, null, null); - writer.WriteProperty(options, PropPerAllocationMemoryBytes, value.PerAllocationMemoryBytes, null, null); - writer.WriteProperty(options, PropPerDeploymentMemoryBytes, value.PerDeploymentMemoryBytes, null, null); - writer.WriteProperty(options, PropPriority, value.Priority, null, null); - writer.WriteProperty(options, PropQueueCapacity, value.QueueCapacity, null, null); - writer.WriteProperty(options, PropThreadsPerAllocation, value.ThreadsPerAllocation, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelAssignmentTaskParametersConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TrainedModelAssignmentTaskParametersConverter))] public sealed partial class TrainedModelAssignmentTaskParameters { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfig.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfig.Converters.g.cs new file mode 100644 index 00000000000..199893b550f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfig.Converters.g.cs @@ -0,0 +1,243 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TrainedModelConfigConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCompressedDefinition = System.Text.Json.JsonEncodedText.Encode("compressed_definition"); + private static readonly System.Text.Json.JsonEncodedText PropCreatedBy = System.Text.Json.JsonEncodedText.Encode("created_by"); + private static readonly System.Text.Json.JsonEncodedText PropCreateTime = System.Text.Json.JsonEncodedText.Encode("create_time"); + private static readonly System.Text.Json.JsonEncodedText PropDefaultFieldMap = System.Text.Json.JsonEncodedText.Encode("default_field_map"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropEstimatedHeapMemoryUsageBytes = System.Text.Json.JsonEncodedText.Encode("estimated_heap_memory_usage_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropEstimatedOperations = System.Text.Json.JsonEncodedText.Encode("estimated_operations"); + private static readonly System.Text.Json.JsonEncodedText PropFullyDefined = System.Text.Json.JsonEncodedText.Encode("fully_defined"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceConfig = System.Text.Json.JsonEncodedText.Encode("inference_config"); + private static readonly System.Text.Json.JsonEncodedText PropInput = System.Text.Json.JsonEncodedText.Encode("input"); + private static readonly System.Text.Json.JsonEncodedText PropLicenseLevel = System.Text.Json.JsonEncodedText.Encode("license_level"); + private static readonly System.Text.Json.JsonEncodedText PropLocation = System.Text.Json.JsonEncodedText.Encode("location"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); + private static readonly System.Text.Json.JsonEncodedText PropModelPackage = System.Text.Json.JsonEncodedText.Encode("model_package"); + private static readonly System.Text.Json.JsonEncodedText PropModelSizeBytes = System.Text.Json.JsonEncodedText.Encode("model_size_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropModelType = System.Text.Json.JsonEncodedText.Encode("model_type"); + private static readonly System.Text.Json.JsonEncodedText PropPlatformArchitecture = System.Text.Json.JsonEncodedText.Encode("platform_architecture"); + private static readonly System.Text.Json.JsonEncodedText PropPrefixStrings = System.Text.Json.JsonEncodedText.Encode("prefix_strings"); + private static readonly System.Text.Json.JsonEncodedText PropTags = System.Text.Json.JsonEncodedText.Encode("tags"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCompressedDefinition = default; + LocalJsonValue propCreatedBy = default; + LocalJsonValue propCreateTime = default; + LocalJsonValue?> propDefaultFieldMap = default; + LocalJsonValue propDescription = default; + LocalJsonValue propEstimatedHeapMemoryUsageBytes = default; + LocalJsonValue propEstimatedOperations = default; + LocalJsonValue propFullyDefined = default; + LocalJsonValue propInferenceConfig = default; + LocalJsonValue propInput = default; + LocalJsonValue propLicenseLevel = default; + LocalJsonValue propLocation = default; + LocalJsonValue propMetadata = default; + LocalJsonValue propModelId = default; + LocalJsonValue propModelPackage = default; + LocalJsonValue propModelSizeBytes = default; + LocalJsonValue propModelType = default; + LocalJsonValue propPlatformArchitecture = default; + LocalJsonValue propPrefixStrings = default; + LocalJsonValue> propTags = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCompressedDefinition.TryReadProperty(ref reader, options, PropCompressedDefinition, null)) + { + continue; + } + + if (propCreatedBy.TryReadProperty(ref reader, options, PropCreatedBy, null)) + { + continue; + } + + if (propCreateTime.TryReadProperty(ref reader, options, PropCreateTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propDefaultFieldMap.TryReadProperty(ref reader, options, PropDefaultFieldMap, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propEstimatedHeapMemoryUsageBytes.TryReadProperty(ref reader, options, PropEstimatedHeapMemoryUsageBytes, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEstimatedOperations.TryReadProperty(ref reader, options, PropEstimatedOperations, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFullyDefined.TryReadProperty(ref reader, options, PropFullyDefined, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propInferenceConfig.TryReadProperty(ref reader, options, PropInferenceConfig, null)) + { + continue; + } + + if (propInput.TryReadProperty(ref reader, options, PropInput, null)) + { + continue; + } + + if (propLicenseLevel.TryReadProperty(ref reader, options, PropLicenseLevel, null)) + { + continue; + } + + if (propLocation.TryReadProperty(ref reader, options, PropLocation, null)) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, null)) + { + continue; + } + + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) + { + continue; + } + + if (propModelPackage.TryReadProperty(ref reader, options, PropModelPackage, null)) + { + continue; + } + + if (propModelSizeBytes.TryReadProperty(ref reader, options, PropModelSizeBytes, null)) + { + continue; + } + + if (propModelType.TryReadProperty(ref reader, options, PropModelType, static Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPlatformArchitecture.TryReadProperty(ref reader, options, PropPlatformArchitecture, null)) + { + continue; + } + + if (propPrefixStrings.TryReadProperty(ref reader, options, PropPrefixStrings, null)) + { + continue; + } + + if (propTags.TryReadProperty(ref reader, options, PropTags, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CompressedDefinition = propCompressedDefinition.Value, + CreatedBy = propCreatedBy.Value, + CreateTime = propCreateTime.Value, + DefaultFieldMap = propDefaultFieldMap.Value, + Description = propDescription.Value, + EstimatedHeapMemoryUsageBytes = propEstimatedHeapMemoryUsageBytes.Value, + EstimatedOperations = propEstimatedOperations.Value, + FullyDefined = propFullyDefined.Value, + InferenceConfig = propInferenceConfig.Value, + Input = propInput.Value, + LicenseLevel = propLicenseLevel.Value, + Location = propLocation.Value, + Metadata = propMetadata.Value, + ModelId = propModelId.Value, + ModelPackage = propModelPackage.Value, + ModelSizeBytes = propModelSizeBytes.Value, + ModelType = propModelType.Value, + PlatformArchitecture = propPlatformArchitecture.Value, + PrefixStrings = propPrefixStrings.Value, + Tags = propTags.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelConfig value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCompressedDefinition, value.CompressedDefinition, null, null); + writer.WriteProperty(options, PropCreatedBy, value.CreatedBy, null, null); + writer.WriteProperty(options, PropCreateTime, value.CreateTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropDefaultFieldMap, value.DefaultFieldMap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropEstimatedHeapMemoryUsageBytes, value.EstimatedHeapMemoryUsageBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEstimatedOperations, value.EstimatedOperations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFullyDefined, value.FullyDefined, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropInferenceConfig, value.InferenceConfig, null, null); + writer.WriteProperty(options, PropInput, value.Input, null, null); + writer.WriteProperty(options, PropLicenseLevel, value.LicenseLevel, null, null); + writer.WriteProperty(options, PropLocation, value.Location, null, null); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, null); + writer.WriteProperty(options, PropModelId, value.ModelId, null, null); + writer.WriteProperty(options, PropModelPackage, value.ModelPackage, null, null); + writer.WriteProperty(options, PropModelSizeBytes, value.ModelSizeBytes, null, null); + writer.WriteProperty(options, PropModelType, value.ModelType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPlatformArchitecture, value.PlatformArchitecture, null, null); + writer.WriteProperty(options, PropPrefixStrings, value.PrefixStrings, null, null); + writer.WriteProperty(options, PropTags, value.Tags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfig.g.cs index 5c4d98fae9a..af79f2682e5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfig.g.cs @@ -23,226 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TrainedModelConfigConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCompressedDefinition = System.Text.Json.JsonEncodedText.Encode("compressed_definition"); - private static readonly System.Text.Json.JsonEncodedText PropCreatedBy = System.Text.Json.JsonEncodedText.Encode("created_by"); - private static readonly System.Text.Json.JsonEncodedText PropCreateTime = System.Text.Json.JsonEncodedText.Encode("create_time"); - private static readonly System.Text.Json.JsonEncodedText PropDefaultFieldMap = System.Text.Json.JsonEncodedText.Encode("default_field_map"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropEstimatedHeapMemoryUsageBytes = System.Text.Json.JsonEncodedText.Encode("estimated_heap_memory_usage_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropEstimatedOperations = System.Text.Json.JsonEncodedText.Encode("estimated_operations"); - private static readonly System.Text.Json.JsonEncodedText PropFullyDefined = System.Text.Json.JsonEncodedText.Encode("fully_defined"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceConfig = System.Text.Json.JsonEncodedText.Encode("inference_config"); - private static readonly System.Text.Json.JsonEncodedText PropInput = System.Text.Json.JsonEncodedText.Encode("input"); - private static readonly System.Text.Json.JsonEncodedText PropLicenseLevel = System.Text.Json.JsonEncodedText.Encode("license_level"); - private static readonly System.Text.Json.JsonEncodedText PropLocation = System.Text.Json.JsonEncodedText.Encode("location"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); - private static readonly System.Text.Json.JsonEncodedText PropModelPackage = System.Text.Json.JsonEncodedText.Encode("model_package"); - private static readonly System.Text.Json.JsonEncodedText PropModelSizeBytes = System.Text.Json.JsonEncodedText.Encode("model_size_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropModelType = System.Text.Json.JsonEncodedText.Encode("model_type"); - private static readonly System.Text.Json.JsonEncodedText PropPlatformArchitecture = System.Text.Json.JsonEncodedText.Encode("platform_architecture"); - private static readonly System.Text.Json.JsonEncodedText PropPrefixStrings = System.Text.Json.JsonEncodedText.Encode("prefix_strings"); - private static readonly System.Text.Json.JsonEncodedText PropTags = System.Text.Json.JsonEncodedText.Encode("tags"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCompressedDefinition = default; - LocalJsonValue propCreatedBy = default; - LocalJsonValue propCreateTime = default; - LocalJsonValue?> propDefaultFieldMap = default; - LocalJsonValue propDescription = default; - LocalJsonValue propEstimatedHeapMemoryUsageBytes = default; - LocalJsonValue propEstimatedOperations = default; - LocalJsonValue propFullyDefined = default; - LocalJsonValue propInferenceConfig = default; - LocalJsonValue propInput = default; - LocalJsonValue propLicenseLevel = default; - LocalJsonValue propLocation = default; - LocalJsonValue propMetadata = default; - LocalJsonValue propModelId = default; - LocalJsonValue propModelPackage = default; - LocalJsonValue propModelSizeBytes = default; - LocalJsonValue propModelType = default; - LocalJsonValue propPlatformArchitecture = default; - LocalJsonValue propPrefixStrings = default; - LocalJsonValue> propTags = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCompressedDefinition.TryReadProperty(ref reader, options, PropCompressedDefinition, null)) - { - continue; - } - - if (propCreatedBy.TryReadProperty(ref reader, options, PropCreatedBy, null)) - { - continue; - } - - if (propCreateTime.TryReadProperty(ref reader, options, PropCreateTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propDefaultFieldMap.TryReadProperty(ref reader, options, PropDefaultFieldMap, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propEstimatedHeapMemoryUsageBytes.TryReadProperty(ref reader, options, PropEstimatedHeapMemoryUsageBytes, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEstimatedOperations.TryReadProperty(ref reader, options, PropEstimatedOperations, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFullyDefined.TryReadProperty(ref reader, options, PropFullyDefined, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propInferenceConfig.TryReadProperty(ref reader, options, PropInferenceConfig, null)) - { - continue; - } - - if (propInput.TryReadProperty(ref reader, options, PropInput, null)) - { - continue; - } - - if (propLicenseLevel.TryReadProperty(ref reader, options, PropLicenseLevel, null)) - { - continue; - } - - if (propLocation.TryReadProperty(ref reader, options, PropLocation, null)) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, null)) - { - continue; - } - - if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) - { - continue; - } - - if (propModelPackage.TryReadProperty(ref reader, options, PropModelPackage, null)) - { - continue; - } - - if (propModelSizeBytes.TryReadProperty(ref reader, options, PropModelSizeBytes, null)) - { - continue; - } - - if (propModelType.TryReadProperty(ref reader, options, PropModelType, static Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPlatformArchitecture.TryReadProperty(ref reader, options, PropPlatformArchitecture, null)) - { - continue; - } - - if (propPrefixStrings.TryReadProperty(ref reader, options, PropPrefixStrings, null)) - { - continue; - } - - if (propTags.TryReadProperty(ref reader, options, PropTags, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CompressedDefinition = propCompressedDefinition.Value, - CreatedBy = propCreatedBy.Value, - CreateTime = propCreateTime.Value, - DefaultFieldMap = propDefaultFieldMap.Value, - Description = propDescription.Value, - EstimatedHeapMemoryUsageBytes = propEstimatedHeapMemoryUsageBytes.Value, - EstimatedOperations = propEstimatedOperations.Value, - FullyDefined = propFullyDefined.Value, - InferenceConfig = propInferenceConfig.Value, - Input = propInput.Value, - LicenseLevel = propLicenseLevel.Value, - Location = propLocation.Value, - Metadata = propMetadata.Value, - ModelId = propModelId.Value, - ModelPackage = propModelPackage.Value, - ModelSizeBytes = propModelSizeBytes.Value, - ModelType = propModelType.Value, - PlatformArchitecture = propPlatformArchitecture.Value, - PrefixStrings = propPrefixStrings.Value, - Tags = propTags.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelConfig value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCompressedDefinition, value.CompressedDefinition, null, null); - writer.WriteProperty(options, PropCreatedBy, value.CreatedBy, null, null); - writer.WriteProperty(options, PropCreateTime, value.CreateTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropDefaultFieldMap, value.DefaultFieldMap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropEstimatedHeapMemoryUsageBytes, value.EstimatedHeapMemoryUsageBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEstimatedOperations, value.EstimatedOperations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFullyDefined, value.FullyDefined, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropInferenceConfig, value.InferenceConfig, null, null); - writer.WriteProperty(options, PropInput, value.Input, null, null); - writer.WriteProperty(options, PropLicenseLevel, value.LicenseLevel, null, null); - writer.WriteProperty(options, PropLocation, value.Location, null, null); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, null); - writer.WriteProperty(options, PropModelId, value.ModelId, null, null); - writer.WriteProperty(options, PropModelPackage, value.ModelPackage, null, null); - writer.WriteProperty(options, PropModelSizeBytes, value.ModelSizeBytes, null, null); - writer.WriteProperty(options, PropModelType, value.ModelType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPlatformArchitecture, value.PlatformArchitecture, null, null); - writer.WriteProperty(options, PropPrefixStrings, value.PrefixStrings, null, null); - writer.WriteProperty(options, PropTags, value.Tags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelConfigConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TrainedModelConfigConverter))] public sealed partial class TrainedModelConfig { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfigInput.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfigInput.Converters.g.cs new file mode 100644 index 00000000000..fc2afaab3ab --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfigInput.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TrainedModelConfigInputConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFieldNames = System.Text.Json.JsonEncodedText.Encode("field_names"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelConfigInput Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFieldNames = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFieldNames.TryReadProperty(ref reader, options, PropFieldNames, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelConfigInput(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FieldNames = propFieldNames.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelConfigInput value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFieldNames, value.FieldNames, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfigInput.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfigInput.g.cs index 4591a80649b..44b18ecffa3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfigInput.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfigInput.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TrainedModelConfigInputConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFieldNames = System.Text.Json.JsonEncodedText.Encode("field_names"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelConfigInput Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFieldNames = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFieldNames.TryReadProperty(ref reader, options, PropFieldNames, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelConfigInput(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FieldNames = propFieldNames.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelConfigInput value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFieldNames, value.FieldNames, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelConfigInputConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TrainedModelConfigInputConverter))] public sealed partial class TrainedModelConfigInput { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfigMetadata.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfigMetadata.Converters.g.cs new file mode 100644 index 00000000000..b1a318c5ff6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfigMetadata.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TrainedModelConfigMetadataConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFeatureImportanceBaseline = System.Text.Json.JsonEncodedText.Encode("feature_importance_baseline"); + private static readonly System.Text.Json.JsonEncodedText PropHyperparameters = System.Text.Json.JsonEncodedText.Encode("hyperparameters"); + private static readonly System.Text.Json.JsonEncodedText PropModelAliases = System.Text.Json.JsonEncodedText.Encode("model_aliases"); + private static readonly System.Text.Json.JsonEncodedText PropTotalFeatureImportance = System.Text.Json.JsonEncodedText.Encode("total_feature_importance"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelConfigMetadata Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propFeatureImportanceBaseline = default; + LocalJsonValue?> propHyperparameters = default; + LocalJsonValue?> propModelAliases = default; + LocalJsonValue?> propTotalFeatureImportance = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFeatureImportanceBaseline.TryReadProperty(ref reader, options, PropFeatureImportanceBaseline, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propHyperparameters.TryReadProperty(ref reader, options, PropHyperparameters, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propModelAliases.TryReadProperty(ref reader, options, PropModelAliases, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTotalFeatureImportance.TryReadProperty(ref reader, options, PropTotalFeatureImportance, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelConfigMetadata(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FeatureImportanceBaseline = propFeatureImportanceBaseline.Value, + Hyperparameters = propHyperparameters.Value, + ModelAliases = propModelAliases.Value, + TotalFeatureImportance = propTotalFeatureImportance.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelConfigMetadata value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFeatureImportanceBaseline, value.FeatureImportanceBaseline, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropHyperparameters, value.Hyperparameters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropModelAliases, value.ModelAliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTotalFeatureImportance, value.TotalFeatureImportance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfigMetadata.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfigMetadata.g.cs index f343462b19c..a90063c2fe2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfigMetadata.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelConfigMetadata.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TrainedModelConfigMetadataConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFeatureImportanceBaseline = System.Text.Json.JsonEncodedText.Encode("feature_importance_baseline"); - private static readonly System.Text.Json.JsonEncodedText PropHyperparameters = System.Text.Json.JsonEncodedText.Encode("hyperparameters"); - private static readonly System.Text.Json.JsonEncodedText PropModelAliases = System.Text.Json.JsonEncodedText.Encode("model_aliases"); - private static readonly System.Text.Json.JsonEncodedText PropTotalFeatureImportance = System.Text.Json.JsonEncodedText.Encode("total_feature_importance"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelConfigMetadata Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propFeatureImportanceBaseline = default; - LocalJsonValue?> propHyperparameters = default; - LocalJsonValue?> propModelAliases = default; - LocalJsonValue?> propTotalFeatureImportance = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFeatureImportanceBaseline.TryReadProperty(ref reader, options, PropFeatureImportanceBaseline, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propHyperparameters.TryReadProperty(ref reader, options, PropHyperparameters, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propModelAliases.TryReadProperty(ref reader, options, PropModelAliases, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTotalFeatureImportance.TryReadProperty(ref reader, options, PropTotalFeatureImportance, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelConfigMetadata(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FeatureImportanceBaseline = propFeatureImportanceBaseline.Value, - Hyperparameters = propHyperparameters.Value, - ModelAliases = propModelAliases.Value, - TotalFeatureImportance = propTotalFeatureImportance.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelConfigMetadata value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFeatureImportanceBaseline, value.FeatureImportanceBaseline, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropHyperparameters, value.Hyperparameters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropModelAliases, value.ModelAliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTotalFeatureImportance, value.TotalFeatureImportance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelConfigMetadataConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TrainedModelConfigMetadataConverter))] public sealed partial class TrainedModelConfigMetadata { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentAllocationStatus.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentAllocationStatus.Converters.g.cs new file mode 100644 index 00000000000..30cbd1e2602 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentAllocationStatus.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TrainedModelDeploymentAllocationStatusConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllocationCount = System.Text.Json.JsonEncodedText.Encode("allocation_count"); + private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); + private static readonly System.Text.Json.JsonEncodedText PropTargetAllocationCount = System.Text.Json.JsonEncodedText.Encode("target_allocation_count"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentAllocationStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllocationCount = default; + LocalJsonValue propState = default; + LocalJsonValue propTargetAllocationCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllocationCount.TryReadProperty(ref reader, options, PropAllocationCount, null)) + { + continue; + } + + if (propState.TryReadProperty(ref reader, options, PropState, null)) + { + continue; + } + + if (propTargetAllocationCount.TryReadProperty(ref reader, options, PropTargetAllocationCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentAllocationStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllocationCount = propAllocationCount.Value, + State = propState.Value, + TargetAllocationCount = propTargetAllocationCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentAllocationStatus value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllocationCount, value.AllocationCount, null, null); + writer.WriteProperty(options, PropState, value.State, null, null); + writer.WriteProperty(options, PropTargetAllocationCount, value.TargetAllocationCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentAllocationStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentAllocationStatus.g.cs index a775e89c3c3..1e3ed2723ec 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentAllocationStatus.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentAllocationStatus.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TrainedModelDeploymentAllocationStatusConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllocationCount = System.Text.Json.JsonEncodedText.Encode("allocation_count"); - private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); - private static readonly System.Text.Json.JsonEncodedText PropTargetAllocationCount = System.Text.Json.JsonEncodedText.Encode("target_allocation_count"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentAllocationStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllocationCount = default; - LocalJsonValue propState = default; - LocalJsonValue propTargetAllocationCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllocationCount.TryReadProperty(ref reader, options, PropAllocationCount, null)) - { - continue; - } - - if (propState.TryReadProperty(ref reader, options, PropState, null)) - { - continue; - } - - if (propTargetAllocationCount.TryReadProperty(ref reader, options, PropTargetAllocationCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentAllocationStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllocationCount = propAllocationCount.Value, - State = propState.Value, - TargetAllocationCount = propTargetAllocationCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentAllocationStatus value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllocationCount, value.AllocationCount, null, null); - writer.WriteProperty(options, PropState, value.State, null, null); - writer.WriteProperty(options, PropTargetAllocationCount, value.TargetAllocationCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentAllocationStatusConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TrainedModelDeploymentAllocationStatusConverter))] public sealed partial class TrainedModelDeploymentAllocationStatus { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentNodesStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentNodesStats.Converters.g.cs new file mode 100644 index 00000000000..cbcc536c722 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentNodesStats.Converters.g.cs @@ -0,0 +1,216 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TrainedModelDeploymentNodesStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAverageInferenceTimeMs = System.Text.Json.JsonEncodedText.Encode("average_inference_time_ms"); + private static readonly System.Text.Json.JsonEncodedText PropAverageInferenceTimeMsExcludingCacheHits = System.Text.Json.JsonEncodedText.Encode("average_inference_time_ms_excluding_cache_hits"); + private static readonly System.Text.Json.JsonEncodedText PropAverageInferenceTimeMsLastMinute = System.Text.Json.JsonEncodedText.Encode("average_inference_time_ms_last_minute"); + private static readonly System.Text.Json.JsonEncodedText PropErrorCount = System.Text.Json.JsonEncodedText.Encode("error_count"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceCacheHitCount = System.Text.Json.JsonEncodedText.Encode("inference_cache_hit_count"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceCacheHitCountLastMinute = System.Text.Json.JsonEncodedText.Encode("inference_cache_hit_count_last_minute"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceCount = System.Text.Json.JsonEncodedText.Encode("inference_count"); + private static readonly System.Text.Json.JsonEncodedText PropLastAccess = System.Text.Json.JsonEncodedText.Encode("last_access"); + private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); + private static readonly System.Text.Json.JsonEncodedText PropNumberOfAllocations = System.Text.Json.JsonEncodedText.Encode("number_of_allocations"); + private static readonly System.Text.Json.JsonEncodedText PropNumberOfPendingRequests = System.Text.Json.JsonEncodedText.Encode("number_of_pending_requests"); + private static readonly System.Text.Json.JsonEncodedText PropPeakThroughputPerMinute = System.Text.Json.JsonEncodedText.Encode("peak_throughput_per_minute"); + private static readonly System.Text.Json.JsonEncodedText PropRejectedExecutionCount = System.Text.Json.JsonEncodedText.Encode("rejected_execution_count"); + private static readonly System.Text.Json.JsonEncodedText PropRoutingState = System.Text.Json.JsonEncodedText.Encode("routing_state"); + private static readonly System.Text.Json.JsonEncodedText PropStartTime = System.Text.Json.JsonEncodedText.Encode("start_time"); + private static readonly System.Text.Json.JsonEncodedText PropThreadsPerAllocation = System.Text.Json.JsonEncodedText.Encode("threads_per_allocation"); + private static readonly System.Text.Json.JsonEncodedText PropThroughputLastMinute = System.Text.Json.JsonEncodedText.Encode("throughput_last_minute"); + private static readonly System.Text.Json.JsonEncodedText PropTimeoutCount = System.Text.Json.JsonEncodedText.Encode("timeout_count"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentNodesStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAverageInferenceTimeMs = default; + LocalJsonValue propAverageInferenceTimeMsExcludingCacheHits = default; + LocalJsonValue propAverageInferenceTimeMsLastMinute = default; + LocalJsonValue propErrorCount = default; + LocalJsonValue propInferenceCacheHitCount = default; + LocalJsonValue propInferenceCacheHitCountLastMinute = default; + LocalJsonValue propInferenceCount = default; + LocalJsonValue propLastAccess = default; + LocalJsonValue?> propNode = default; + LocalJsonValue propNumberOfAllocations = default; + LocalJsonValue propNumberOfPendingRequests = default; + LocalJsonValue propPeakThroughputPerMinute = default; + LocalJsonValue propRejectedExecutionCount = default; + LocalJsonValue propRoutingState = default; + LocalJsonValue propStartTime = default; + LocalJsonValue propThreadsPerAllocation = default; + LocalJsonValue propThroughputLastMinute = default; + LocalJsonValue propTimeoutCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAverageInferenceTimeMs.TryReadProperty(ref reader, options, PropAverageInferenceTimeMs, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propAverageInferenceTimeMsExcludingCacheHits.TryReadProperty(ref reader, options, PropAverageInferenceTimeMsExcludingCacheHits, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propAverageInferenceTimeMsLastMinute.TryReadProperty(ref reader, options, PropAverageInferenceTimeMsLastMinute, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propErrorCount.TryReadProperty(ref reader, options, PropErrorCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propInferenceCacheHitCount.TryReadProperty(ref reader, options, PropInferenceCacheHitCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propInferenceCacheHitCountLastMinute.TryReadProperty(ref reader, options, PropInferenceCacheHitCountLastMinute, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propInferenceCount.TryReadProperty(ref reader, options, PropInferenceCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLastAccess.TryReadProperty(ref reader, options, PropLastAccess, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propNode.TryReadProperty(ref reader, options, PropNode, static System.Collections.Generic.KeyValuePair? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null))) + { + continue; + } + + if (propNumberOfAllocations.TryReadProperty(ref reader, options, PropNumberOfAllocations, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNumberOfPendingRequests.TryReadProperty(ref reader, options, PropNumberOfPendingRequests, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPeakThroughputPerMinute.TryReadProperty(ref reader, options, PropPeakThroughputPerMinute, null)) + { + continue; + } + + if (propRejectedExecutionCount.TryReadProperty(ref reader, options, PropRejectedExecutionCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRoutingState.TryReadProperty(ref reader, options, PropRoutingState, null)) + { + continue; + } + + if (propStartTime.TryReadProperty(ref reader, options, PropStartTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propThreadsPerAllocation.TryReadProperty(ref reader, options, PropThreadsPerAllocation, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propThroughputLastMinute.TryReadProperty(ref reader, options, PropThroughputLastMinute, null)) + { + continue; + } + + if (propTimeoutCount.TryReadProperty(ref reader, options, PropTimeoutCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentNodesStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AverageInferenceTimeMs = propAverageInferenceTimeMs.Value, + AverageInferenceTimeMsExcludingCacheHits = propAverageInferenceTimeMsExcludingCacheHits.Value, + AverageInferenceTimeMsLastMinute = propAverageInferenceTimeMsLastMinute.Value, + ErrorCount = propErrorCount.Value, + InferenceCacheHitCount = propInferenceCacheHitCount.Value, + InferenceCacheHitCountLastMinute = propInferenceCacheHitCountLastMinute.Value, + InferenceCount = propInferenceCount.Value, + LastAccess = propLastAccess.Value, + Node = propNode.Value, + NumberOfAllocations = propNumberOfAllocations.Value, + NumberOfPendingRequests = propNumberOfPendingRequests.Value, + PeakThroughputPerMinute = propPeakThroughputPerMinute.Value, + RejectedExecutionCount = propRejectedExecutionCount.Value, + RoutingState = propRoutingState.Value, + StartTime = propStartTime.Value, + ThreadsPerAllocation = propThreadsPerAllocation.Value, + ThroughputLastMinute = propThroughputLastMinute.Value, + TimeoutCount = propTimeoutCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentNodesStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAverageInferenceTimeMs, value.AverageInferenceTimeMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropAverageInferenceTimeMsExcludingCacheHits, value.AverageInferenceTimeMsExcludingCacheHits, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropAverageInferenceTimeMsLastMinute, value.AverageInferenceTimeMsLastMinute, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropErrorCount, value.ErrorCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropInferenceCacheHitCount, value.InferenceCacheHitCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropInferenceCacheHitCountLastMinute, value.InferenceCacheHitCountLastMinute, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropInferenceCount, value.InferenceCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLastAccess, value.LastAccess, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropNode, value.Node, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair? v) => w.WriteKeyValuePairValue(o, v, null, null)); + writer.WriteProperty(options, PropNumberOfAllocations, value.NumberOfAllocations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNumberOfPendingRequests, value.NumberOfPendingRequests, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPeakThroughputPerMinute, value.PeakThroughputPerMinute, null, null); + writer.WriteProperty(options, PropRejectedExecutionCount, value.RejectedExecutionCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRoutingState, value.RoutingState, null, null); + writer.WriteProperty(options, PropStartTime, value.StartTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropThreadsPerAllocation, value.ThreadsPerAllocation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropThroughputLastMinute, value.ThroughputLastMinute, null, null); + writer.WriteProperty(options, PropTimeoutCount, value.TimeoutCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentNodesStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentNodesStats.g.cs index 882af60f97e..e974a1bfe97 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentNodesStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentNodesStats.g.cs @@ -23,199 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TrainedModelDeploymentNodesStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAverageInferenceTimeMs = System.Text.Json.JsonEncodedText.Encode("average_inference_time_ms"); - private static readonly System.Text.Json.JsonEncodedText PropAverageInferenceTimeMsExcludingCacheHits = System.Text.Json.JsonEncodedText.Encode("average_inference_time_ms_excluding_cache_hits"); - private static readonly System.Text.Json.JsonEncodedText PropAverageInferenceTimeMsLastMinute = System.Text.Json.JsonEncodedText.Encode("average_inference_time_ms_last_minute"); - private static readonly System.Text.Json.JsonEncodedText PropErrorCount = System.Text.Json.JsonEncodedText.Encode("error_count"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceCacheHitCount = System.Text.Json.JsonEncodedText.Encode("inference_cache_hit_count"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceCacheHitCountLastMinute = System.Text.Json.JsonEncodedText.Encode("inference_cache_hit_count_last_minute"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceCount = System.Text.Json.JsonEncodedText.Encode("inference_count"); - private static readonly System.Text.Json.JsonEncodedText PropLastAccess = System.Text.Json.JsonEncodedText.Encode("last_access"); - private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); - private static readonly System.Text.Json.JsonEncodedText PropNumberOfAllocations = System.Text.Json.JsonEncodedText.Encode("number_of_allocations"); - private static readonly System.Text.Json.JsonEncodedText PropNumberOfPendingRequests = System.Text.Json.JsonEncodedText.Encode("number_of_pending_requests"); - private static readonly System.Text.Json.JsonEncodedText PropPeakThroughputPerMinute = System.Text.Json.JsonEncodedText.Encode("peak_throughput_per_minute"); - private static readonly System.Text.Json.JsonEncodedText PropRejectedExecutionCount = System.Text.Json.JsonEncodedText.Encode("rejected_execution_count"); - private static readonly System.Text.Json.JsonEncodedText PropRoutingState = System.Text.Json.JsonEncodedText.Encode("routing_state"); - private static readonly System.Text.Json.JsonEncodedText PropStartTime = System.Text.Json.JsonEncodedText.Encode("start_time"); - private static readonly System.Text.Json.JsonEncodedText PropThreadsPerAllocation = System.Text.Json.JsonEncodedText.Encode("threads_per_allocation"); - private static readonly System.Text.Json.JsonEncodedText PropThroughputLastMinute = System.Text.Json.JsonEncodedText.Encode("throughput_last_minute"); - private static readonly System.Text.Json.JsonEncodedText PropTimeoutCount = System.Text.Json.JsonEncodedText.Encode("timeout_count"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentNodesStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAverageInferenceTimeMs = default; - LocalJsonValue propAverageInferenceTimeMsExcludingCacheHits = default; - LocalJsonValue propAverageInferenceTimeMsLastMinute = default; - LocalJsonValue propErrorCount = default; - LocalJsonValue propInferenceCacheHitCount = default; - LocalJsonValue propInferenceCacheHitCountLastMinute = default; - LocalJsonValue propInferenceCount = default; - LocalJsonValue propLastAccess = default; - LocalJsonValue?> propNode = default; - LocalJsonValue propNumberOfAllocations = default; - LocalJsonValue propNumberOfPendingRequests = default; - LocalJsonValue propPeakThroughputPerMinute = default; - LocalJsonValue propRejectedExecutionCount = default; - LocalJsonValue propRoutingState = default; - LocalJsonValue propStartTime = default; - LocalJsonValue propThreadsPerAllocation = default; - LocalJsonValue propThroughputLastMinute = default; - LocalJsonValue propTimeoutCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAverageInferenceTimeMs.TryReadProperty(ref reader, options, PropAverageInferenceTimeMs, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propAverageInferenceTimeMsExcludingCacheHits.TryReadProperty(ref reader, options, PropAverageInferenceTimeMsExcludingCacheHits, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propAverageInferenceTimeMsLastMinute.TryReadProperty(ref reader, options, PropAverageInferenceTimeMsLastMinute, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propErrorCount.TryReadProperty(ref reader, options, PropErrorCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propInferenceCacheHitCount.TryReadProperty(ref reader, options, PropInferenceCacheHitCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propInferenceCacheHitCountLastMinute.TryReadProperty(ref reader, options, PropInferenceCacheHitCountLastMinute, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propInferenceCount.TryReadProperty(ref reader, options, PropInferenceCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLastAccess.TryReadProperty(ref reader, options, PropLastAccess, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propNode.TryReadProperty(ref reader, options, PropNode, static System.Collections.Generic.KeyValuePair? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null))) - { - continue; - } - - if (propNumberOfAllocations.TryReadProperty(ref reader, options, PropNumberOfAllocations, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNumberOfPendingRequests.TryReadProperty(ref reader, options, PropNumberOfPendingRequests, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPeakThroughputPerMinute.TryReadProperty(ref reader, options, PropPeakThroughputPerMinute, null)) - { - continue; - } - - if (propRejectedExecutionCount.TryReadProperty(ref reader, options, PropRejectedExecutionCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRoutingState.TryReadProperty(ref reader, options, PropRoutingState, null)) - { - continue; - } - - if (propStartTime.TryReadProperty(ref reader, options, PropStartTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propThreadsPerAllocation.TryReadProperty(ref reader, options, PropThreadsPerAllocation, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propThroughputLastMinute.TryReadProperty(ref reader, options, PropThroughputLastMinute, null)) - { - continue; - } - - if (propTimeoutCount.TryReadProperty(ref reader, options, PropTimeoutCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentNodesStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AverageInferenceTimeMs = propAverageInferenceTimeMs.Value, - AverageInferenceTimeMsExcludingCacheHits = propAverageInferenceTimeMsExcludingCacheHits.Value, - AverageInferenceTimeMsLastMinute = propAverageInferenceTimeMsLastMinute.Value, - ErrorCount = propErrorCount.Value, - InferenceCacheHitCount = propInferenceCacheHitCount.Value, - InferenceCacheHitCountLastMinute = propInferenceCacheHitCountLastMinute.Value, - InferenceCount = propInferenceCount.Value, - LastAccess = propLastAccess.Value, - Node = propNode.Value, - NumberOfAllocations = propNumberOfAllocations.Value, - NumberOfPendingRequests = propNumberOfPendingRequests.Value, - PeakThroughputPerMinute = propPeakThroughputPerMinute.Value, - RejectedExecutionCount = propRejectedExecutionCount.Value, - RoutingState = propRoutingState.Value, - StartTime = propStartTime.Value, - ThreadsPerAllocation = propThreadsPerAllocation.Value, - ThroughputLastMinute = propThroughputLastMinute.Value, - TimeoutCount = propTimeoutCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentNodesStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAverageInferenceTimeMs, value.AverageInferenceTimeMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropAverageInferenceTimeMsExcludingCacheHits, value.AverageInferenceTimeMsExcludingCacheHits, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropAverageInferenceTimeMsLastMinute, value.AverageInferenceTimeMsLastMinute, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropErrorCount, value.ErrorCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropInferenceCacheHitCount, value.InferenceCacheHitCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropInferenceCacheHitCountLastMinute, value.InferenceCacheHitCountLastMinute, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropInferenceCount, value.InferenceCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLastAccess, value.LastAccess, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropNode, value.Node, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair? v) => w.WriteKeyValuePairValue(o, v, null, null)); - writer.WriteProperty(options, PropNumberOfAllocations, value.NumberOfAllocations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNumberOfPendingRequests, value.NumberOfPendingRequests, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPeakThroughputPerMinute, value.PeakThroughputPerMinute, null, null); - writer.WriteProperty(options, PropRejectedExecutionCount, value.RejectedExecutionCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRoutingState, value.RoutingState, null, null); - writer.WriteProperty(options, PropStartTime, value.StartTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropThreadsPerAllocation, value.ThreadsPerAllocation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropThroughputLastMinute, value.ThroughputLastMinute, null, null); - writer.WriteProperty(options, PropTimeoutCount, value.TimeoutCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentNodesStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TrainedModelDeploymentNodesStatsConverter))] public sealed partial class TrainedModelDeploymentNodesStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentStats.Converters.g.cs new file mode 100644 index 00000000000..ca1c2500e27 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentStats.Converters.g.cs @@ -0,0 +1,216 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TrainedModelDeploymentStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAdaptiveAllocations = System.Text.Json.JsonEncodedText.Encode("adaptive_allocations"); + private static readonly System.Text.Json.JsonEncodedText PropAllocationStatus = System.Text.Json.JsonEncodedText.Encode("allocation_status"); + private static readonly System.Text.Json.JsonEncodedText PropCacheSize = System.Text.Json.JsonEncodedText.Encode("cache_size"); + private static readonly System.Text.Json.JsonEncodedText PropDeploymentId = System.Text.Json.JsonEncodedText.Encode("deployment_id"); + private static readonly System.Text.Json.JsonEncodedText PropErrorCount = System.Text.Json.JsonEncodedText.Encode("error_count"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceCount = System.Text.Json.JsonEncodedText.Encode("inference_count"); + private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); + private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); + private static readonly System.Text.Json.JsonEncodedText PropNumberOfAllocations = System.Text.Json.JsonEncodedText.Encode("number_of_allocations"); + private static readonly System.Text.Json.JsonEncodedText PropPeakThroughputPerMinute = System.Text.Json.JsonEncodedText.Encode("peak_throughput_per_minute"); + private static readonly System.Text.Json.JsonEncodedText PropPriority = System.Text.Json.JsonEncodedText.Encode("priority"); + private static readonly System.Text.Json.JsonEncodedText PropQueueCapacity = System.Text.Json.JsonEncodedText.Encode("queue_capacity"); + private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); + private static readonly System.Text.Json.JsonEncodedText PropRejectedExecutionCount = System.Text.Json.JsonEncodedText.Encode("rejected_execution_count"); + private static readonly System.Text.Json.JsonEncodedText PropStartTime = System.Text.Json.JsonEncodedText.Encode("start_time"); + private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); + private static readonly System.Text.Json.JsonEncodedText PropThreadsPerAllocation = System.Text.Json.JsonEncodedText.Encode("threads_per_allocation"); + private static readonly System.Text.Json.JsonEncodedText PropTimeoutCount = System.Text.Json.JsonEncodedText.Encode("timeout_count"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAdaptiveAllocations = default; + LocalJsonValue propAllocationStatus = default; + LocalJsonValue propCacheSize = default; + LocalJsonValue propDeploymentId = default; + LocalJsonValue propErrorCount = default; + LocalJsonValue propInferenceCount = default; + LocalJsonValue propModelId = default; + LocalJsonValue> propNodes = default; + LocalJsonValue propNumberOfAllocations = default; + LocalJsonValue propPeakThroughputPerMinute = default; + LocalJsonValue propPriority = default; + LocalJsonValue propQueueCapacity = default; + LocalJsonValue propReason = default; + LocalJsonValue propRejectedExecutionCount = default; + LocalJsonValue propStartTime = default; + LocalJsonValue propState = default; + LocalJsonValue propThreadsPerAllocation = default; + LocalJsonValue propTimeoutCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAdaptiveAllocations.TryReadProperty(ref reader, options, PropAdaptiveAllocations, null)) + { + continue; + } + + if (propAllocationStatus.TryReadProperty(ref reader, options, PropAllocationStatus, null)) + { + continue; + } + + if (propCacheSize.TryReadProperty(ref reader, options, PropCacheSize, null)) + { + continue; + } + + if (propDeploymentId.TryReadProperty(ref reader, options, PropDeploymentId, null)) + { + continue; + } + + if (propErrorCount.TryReadProperty(ref reader, options, PropErrorCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propInferenceCount.TryReadProperty(ref reader, options, PropInferenceCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) + { + continue; + } + + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propNumberOfAllocations.TryReadProperty(ref reader, options, PropNumberOfAllocations, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPeakThroughputPerMinute.TryReadProperty(ref reader, options, PropPeakThroughputPerMinute, null)) + { + continue; + } + + if (propPriority.TryReadProperty(ref reader, options, PropPriority, null)) + { + continue; + } + + if (propQueueCapacity.TryReadProperty(ref reader, options, PropQueueCapacity, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propReason.TryReadProperty(ref reader, options, PropReason, null)) + { + continue; + } + + if (propRejectedExecutionCount.TryReadProperty(ref reader, options, PropRejectedExecutionCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propStartTime.TryReadProperty(ref reader, options, PropStartTime, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propState.TryReadProperty(ref reader, options, PropState, static Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propThreadsPerAllocation.TryReadProperty(ref reader, options, PropThreadsPerAllocation, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeoutCount.TryReadProperty(ref reader, options, PropTimeoutCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AdaptiveAllocations = propAdaptiveAllocations.Value, + AllocationStatus = propAllocationStatus.Value, + CacheSize = propCacheSize.Value, + DeploymentId = propDeploymentId.Value, + ErrorCount = propErrorCount.Value, + InferenceCount = propInferenceCount.Value, + ModelId = propModelId.Value, + Nodes = propNodes.Value, + NumberOfAllocations = propNumberOfAllocations.Value, + PeakThroughputPerMinute = propPeakThroughputPerMinute.Value, + Priority = propPriority.Value, + QueueCapacity = propQueueCapacity.Value, + Reason = propReason.Value, + RejectedExecutionCount = propRejectedExecutionCount.Value, + StartTime = propStartTime.Value, + State = propState.Value, + ThreadsPerAllocation = propThreadsPerAllocation.Value, + TimeoutCount = propTimeoutCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAdaptiveAllocations, value.AdaptiveAllocations, null, null); + writer.WriteProperty(options, PropAllocationStatus, value.AllocationStatus, null, null); + writer.WriteProperty(options, PropCacheSize, value.CacheSize, null, null); + writer.WriteProperty(options, PropDeploymentId, value.DeploymentId, null, null); + writer.WriteProperty(options, PropErrorCount, value.ErrorCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropInferenceCount, value.InferenceCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropModelId, value.ModelId, null, null); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropNumberOfAllocations, value.NumberOfAllocations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPeakThroughputPerMinute, value.PeakThroughputPerMinute, null, null); + writer.WriteProperty(options, PropPriority, value.Priority, null, null); + writer.WriteProperty(options, PropQueueCapacity, value.QueueCapacity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropReason, value.Reason, null, null); + writer.WriteProperty(options, PropRejectedExecutionCount, value.RejectedExecutionCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropStartTime, value.StartTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropState, value.State, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropThreadsPerAllocation, value.ThreadsPerAllocation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeoutCount, value.TimeoutCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentStats.g.cs index 3f2ed9e0782..8cd53520622 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelDeploymentStats.g.cs @@ -23,199 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TrainedModelDeploymentStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAdaptiveAllocations = System.Text.Json.JsonEncodedText.Encode("adaptive_allocations"); - private static readonly System.Text.Json.JsonEncodedText PropAllocationStatus = System.Text.Json.JsonEncodedText.Encode("allocation_status"); - private static readonly System.Text.Json.JsonEncodedText PropCacheSize = System.Text.Json.JsonEncodedText.Encode("cache_size"); - private static readonly System.Text.Json.JsonEncodedText PropDeploymentId = System.Text.Json.JsonEncodedText.Encode("deployment_id"); - private static readonly System.Text.Json.JsonEncodedText PropErrorCount = System.Text.Json.JsonEncodedText.Encode("error_count"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceCount = System.Text.Json.JsonEncodedText.Encode("inference_count"); - private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); - private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); - private static readonly System.Text.Json.JsonEncodedText PropNumberOfAllocations = System.Text.Json.JsonEncodedText.Encode("number_of_allocations"); - private static readonly System.Text.Json.JsonEncodedText PropPeakThroughputPerMinute = System.Text.Json.JsonEncodedText.Encode("peak_throughput_per_minute"); - private static readonly System.Text.Json.JsonEncodedText PropPriority = System.Text.Json.JsonEncodedText.Encode("priority"); - private static readonly System.Text.Json.JsonEncodedText PropQueueCapacity = System.Text.Json.JsonEncodedText.Encode("queue_capacity"); - private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); - private static readonly System.Text.Json.JsonEncodedText PropRejectedExecutionCount = System.Text.Json.JsonEncodedText.Encode("rejected_execution_count"); - private static readonly System.Text.Json.JsonEncodedText PropStartTime = System.Text.Json.JsonEncodedText.Encode("start_time"); - private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); - private static readonly System.Text.Json.JsonEncodedText PropThreadsPerAllocation = System.Text.Json.JsonEncodedText.Encode("threads_per_allocation"); - private static readonly System.Text.Json.JsonEncodedText PropTimeoutCount = System.Text.Json.JsonEncodedText.Encode("timeout_count"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAdaptiveAllocations = default; - LocalJsonValue propAllocationStatus = default; - LocalJsonValue propCacheSize = default; - LocalJsonValue propDeploymentId = default; - LocalJsonValue propErrorCount = default; - LocalJsonValue propInferenceCount = default; - LocalJsonValue propModelId = default; - LocalJsonValue> propNodes = default; - LocalJsonValue propNumberOfAllocations = default; - LocalJsonValue propPeakThroughputPerMinute = default; - LocalJsonValue propPriority = default; - LocalJsonValue propQueueCapacity = default; - LocalJsonValue propReason = default; - LocalJsonValue propRejectedExecutionCount = default; - LocalJsonValue propStartTime = default; - LocalJsonValue propState = default; - LocalJsonValue propThreadsPerAllocation = default; - LocalJsonValue propTimeoutCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAdaptiveAllocations.TryReadProperty(ref reader, options, PropAdaptiveAllocations, null)) - { - continue; - } - - if (propAllocationStatus.TryReadProperty(ref reader, options, PropAllocationStatus, null)) - { - continue; - } - - if (propCacheSize.TryReadProperty(ref reader, options, PropCacheSize, null)) - { - continue; - } - - if (propDeploymentId.TryReadProperty(ref reader, options, PropDeploymentId, null)) - { - continue; - } - - if (propErrorCount.TryReadProperty(ref reader, options, PropErrorCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propInferenceCount.TryReadProperty(ref reader, options, PropInferenceCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) - { - continue; - } - - if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propNumberOfAllocations.TryReadProperty(ref reader, options, PropNumberOfAllocations, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPeakThroughputPerMinute.TryReadProperty(ref reader, options, PropPeakThroughputPerMinute, null)) - { - continue; - } - - if (propPriority.TryReadProperty(ref reader, options, PropPriority, null)) - { - continue; - } - - if (propQueueCapacity.TryReadProperty(ref reader, options, PropQueueCapacity, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propReason.TryReadProperty(ref reader, options, PropReason, null)) - { - continue; - } - - if (propRejectedExecutionCount.TryReadProperty(ref reader, options, PropRejectedExecutionCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propStartTime.TryReadProperty(ref reader, options, PropStartTime, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propState.TryReadProperty(ref reader, options, PropState, static Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propThreadsPerAllocation.TryReadProperty(ref reader, options, PropThreadsPerAllocation, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeoutCount.TryReadProperty(ref reader, options, PropTimeoutCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AdaptiveAllocations = propAdaptiveAllocations.Value, - AllocationStatus = propAllocationStatus.Value, - CacheSize = propCacheSize.Value, - DeploymentId = propDeploymentId.Value, - ErrorCount = propErrorCount.Value, - InferenceCount = propInferenceCount.Value, - ModelId = propModelId.Value, - Nodes = propNodes.Value, - NumberOfAllocations = propNumberOfAllocations.Value, - PeakThroughputPerMinute = propPeakThroughputPerMinute.Value, - Priority = propPriority.Value, - QueueCapacity = propQueueCapacity.Value, - Reason = propReason.Value, - RejectedExecutionCount = propRejectedExecutionCount.Value, - StartTime = propStartTime.Value, - State = propState.Value, - ThreadsPerAllocation = propThreadsPerAllocation.Value, - TimeoutCount = propTimeoutCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAdaptiveAllocations, value.AdaptiveAllocations, null, null); - writer.WriteProperty(options, PropAllocationStatus, value.AllocationStatus, null, null); - writer.WriteProperty(options, PropCacheSize, value.CacheSize, null, null); - writer.WriteProperty(options, PropDeploymentId, value.DeploymentId, null, null); - writer.WriteProperty(options, PropErrorCount, value.ErrorCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropInferenceCount, value.InferenceCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropModelId, value.ModelId, null, null); - writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropNumberOfAllocations, value.NumberOfAllocations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPeakThroughputPerMinute, value.PeakThroughputPerMinute, null, null); - writer.WriteProperty(options, PropPriority, value.Priority, null, null); - writer.WriteProperty(options, PropQueueCapacity, value.QueueCapacity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropReason, value.Reason, null, null); - writer.WriteProperty(options, PropRejectedExecutionCount, value.RejectedExecutionCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropStartTime, value.StartTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropState, value.State, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.MachineLearning.DeploymentAssignmentState? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropThreadsPerAllocation, value.ThreadsPerAllocation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeoutCount, value.TimeoutCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelDeploymentStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TrainedModelDeploymentStatsConverter))] public sealed partial class TrainedModelDeploymentStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelEntities.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelEntities.Converters.g.cs new file mode 100644 index 00000000000..25abe498099 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelEntities.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TrainedModelEntitiesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClassName = System.Text.Json.JsonEncodedText.Encode("class_name"); + private static readonly System.Text.Json.JsonEncodedText PropClassProbability = System.Text.Json.JsonEncodedText.Encode("class_probability"); + private static readonly System.Text.Json.JsonEncodedText PropEndPos = System.Text.Json.JsonEncodedText.Encode("end_pos"); + private static readonly System.Text.Json.JsonEncodedText PropEntity = System.Text.Json.JsonEncodedText.Encode("entity"); + private static readonly System.Text.Json.JsonEncodedText PropStartPos = System.Text.Json.JsonEncodedText.Encode("start_pos"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelEntities Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClassName = default; + LocalJsonValue propClassProbability = default; + LocalJsonValue propEndPos = default; + LocalJsonValue propEntity = default; + LocalJsonValue propStartPos = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClassName.TryReadProperty(ref reader, options, PropClassName, null)) + { + continue; + } + + if (propClassProbability.TryReadProperty(ref reader, options, PropClassProbability, null)) + { + continue; + } + + if (propEndPos.TryReadProperty(ref reader, options, PropEndPos, null)) + { + continue; + } + + if (propEntity.TryReadProperty(ref reader, options, PropEntity, null)) + { + continue; + } + + if (propStartPos.TryReadProperty(ref reader, options, PropStartPos, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelEntities(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClassName = propClassName.Value, + ClassProbability = propClassProbability.Value, + EndPos = propEndPos.Value, + Entity = propEntity.Value, + StartPos = propStartPos.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelEntities value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClassName, value.ClassName, null, null); + writer.WriteProperty(options, PropClassProbability, value.ClassProbability, null, null); + writer.WriteProperty(options, PropEndPos, value.EndPos, null, null); + writer.WriteProperty(options, PropEntity, value.Entity, null, null); + writer.WriteProperty(options, PropStartPos, value.StartPos, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelEntities.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelEntities.g.cs index 512c9ae6c73..0df55936d6e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelEntities.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelEntities.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TrainedModelEntitiesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClassName = System.Text.Json.JsonEncodedText.Encode("class_name"); - private static readonly System.Text.Json.JsonEncodedText PropClassProbability = System.Text.Json.JsonEncodedText.Encode("class_probability"); - private static readonly System.Text.Json.JsonEncodedText PropEndPos = System.Text.Json.JsonEncodedText.Encode("end_pos"); - private static readonly System.Text.Json.JsonEncodedText PropEntity = System.Text.Json.JsonEncodedText.Encode("entity"); - private static readonly System.Text.Json.JsonEncodedText PropStartPos = System.Text.Json.JsonEncodedText.Encode("start_pos"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelEntities Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClassName = default; - LocalJsonValue propClassProbability = default; - LocalJsonValue propEndPos = default; - LocalJsonValue propEntity = default; - LocalJsonValue propStartPos = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClassName.TryReadProperty(ref reader, options, PropClassName, null)) - { - continue; - } - - if (propClassProbability.TryReadProperty(ref reader, options, PropClassProbability, null)) - { - continue; - } - - if (propEndPos.TryReadProperty(ref reader, options, PropEndPos, null)) - { - continue; - } - - if (propEntity.TryReadProperty(ref reader, options, PropEntity, null)) - { - continue; - } - - if (propStartPos.TryReadProperty(ref reader, options, PropStartPos, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelEntities(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClassName = propClassName.Value, - ClassProbability = propClassProbability.Value, - EndPos = propEndPos.Value, - Entity = propEntity.Value, - StartPos = propStartPos.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelEntities value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClassName, value.ClassName, null, null); - writer.WriteProperty(options, PropClassProbability, value.ClassProbability, null, null); - writer.WriteProperty(options, PropEndPos, value.EndPos, null, null); - writer.WriteProperty(options, PropEntity, value.Entity, null, null); - writer.WriteProperty(options, PropStartPos, value.StartPos, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelEntitiesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TrainedModelEntitiesConverter))] public sealed partial class TrainedModelEntities { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceClassImportance.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceClassImportance.Converters.g.cs new file mode 100644 index 00000000000..f7d0c8e2c88 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceClassImportance.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TrainedModelInferenceClassImportanceConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClassName = System.Text.Json.JsonEncodedText.Encode("class_name"); + private static readonly System.Text.Json.JsonEncodedText PropImportance = System.Text.Json.JsonEncodedText.Encode("importance"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelInferenceClassImportance Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClassName = default; + LocalJsonValue propImportance = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClassName.TryReadProperty(ref reader, options, PropClassName, null)) + { + continue; + } + + if (propImportance.TryReadProperty(ref reader, options, PropImportance, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelInferenceClassImportance(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClassName = propClassName.Value, + Importance = propImportance.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelInferenceClassImportance value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClassName, value.ClassName, null, null); + writer.WriteProperty(options, PropImportance, value.Importance, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceClassImportance.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceClassImportance.g.cs index 92651cbcca6..90edafc12f1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceClassImportance.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceClassImportance.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TrainedModelInferenceClassImportanceConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClassName = System.Text.Json.JsonEncodedText.Encode("class_name"); - private static readonly System.Text.Json.JsonEncodedText PropImportance = System.Text.Json.JsonEncodedText.Encode("importance"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelInferenceClassImportance Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClassName = default; - LocalJsonValue propImportance = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClassName.TryReadProperty(ref reader, options, PropClassName, null)) - { - continue; - } - - if (propImportance.TryReadProperty(ref reader, options, PropImportance, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelInferenceClassImportance(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClassName = propClassName.Value, - Importance = propImportance.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelInferenceClassImportance value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClassName, value.ClassName, null, null); - writer.WriteProperty(options, PropImportance, value.Importance, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelInferenceClassImportanceConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TrainedModelInferenceClassImportanceConverter))] public sealed partial class TrainedModelInferenceClassImportance { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceFeatureImportance.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceFeatureImportance.Converters.g.cs new file mode 100644 index 00000000000..384f2cfdbf4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceFeatureImportance.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TrainedModelInferenceFeatureImportanceConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClasses = System.Text.Json.JsonEncodedText.Encode("classes"); + private static readonly System.Text.Json.JsonEncodedText PropFeatureName = System.Text.Json.JsonEncodedText.Encode("feature_name"); + private static readonly System.Text.Json.JsonEncodedText PropImportance = System.Text.Json.JsonEncodedText.Encode("importance"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelInferenceFeatureImportance Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propClasses = default; + LocalJsonValue propFeatureName = default; + LocalJsonValue propImportance = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClasses.TryReadProperty(ref reader, options, PropClasses, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propFeatureName.TryReadProperty(ref reader, options, PropFeatureName, null)) + { + continue; + } + + if (propImportance.TryReadProperty(ref reader, options, PropImportance, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelInferenceFeatureImportance(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Classes = propClasses.Value, + FeatureName = propFeatureName.Value, + Importance = propImportance.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelInferenceFeatureImportance value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClasses, value.Classes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFeatureName, value.FeatureName, null, null); + writer.WriteProperty(options, PropImportance, value.Importance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceFeatureImportance.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceFeatureImportance.g.cs index 395abb3f6d9..f8e45816ba0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceFeatureImportance.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceFeatureImportance.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TrainedModelInferenceFeatureImportanceConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClasses = System.Text.Json.JsonEncodedText.Encode("classes"); - private static readonly System.Text.Json.JsonEncodedText PropFeatureName = System.Text.Json.JsonEncodedText.Encode("feature_name"); - private static readonly System.Text.Json.JsonEncodedText PropImportance = System.Text.Json.JsonEncodedText.Encode("importance"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelInferenceFeatureImportance Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propClasses = default; - LocalJsonValue propFeatureName = default; - LocalJsonValue propImportance = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClasses.TryReadProperty(ref reader, options, PropClasses, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propFeatureName.TryReadProperty(ref reader, options, PropFeatureName, null)) - { - continue; - } - - if (propImportance.TryReadProperty(ref reader, options, PropImportance, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelInferenceFeatureImportance(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Classes = propClasses.Value, - FeatureName = propFeatureName.Value, - Importance = propImportance.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelInferenceFeatureImportance value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClasses, value.Classes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFeatureName, value.FeatureName, null, null); - writer.WriteProperty(options, PropImportance, value.Importance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelInferenceFeatureImportanceConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TrainedModelInferenceFeatureImportanceConverter))] public sealed partial class TrainedModelInferenceFeatureImportance { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceStats.Converters.g.cs new file mode 100644 index 00000000000..96ddb304d3f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceStats.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TrainedModelInferenceStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCacheMissCount = System.Text.Json.JsonEncodedText.Encode("cache_miss_count"); + private static readonly System.Text.Json.JsonEncodedText PropFailureCount = System.Text.Json.JsonEncodedText.Encode("failure_count"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceCount = System.Text.Json.JsonEncodedText.Encode("inference_count"); + private static readonly System.Text.Json.JsonEncodedText PropMissingAllFieldsCount = System.Text.Json.JsonEncodedText.Encode("missing_all_fields_count"); + private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelInferenceStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCacheMissCount = default; + LocalJsonValue propFailureCount = default; + LocalJsonValue propInferenceCount = default; + LocalJsonValue propMissingAllFieldsCount = default; + LocalJsonValue propTimestamp = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCacheMissCount.TryReadProperty(ref reader, options, PropCacheMissCount, null)) + { + continue; + } + + if (propFailureCount.TryReadProperty(ref reader, options, PropFailureCount, null)) + { + continue; + } + + if (propInferenceCount.TryReadProperty(ref reader, options, PropInferenceCount, null)) + { + continue; + } + + if (propMissingAllFieldsCount.TryReadProperty(ref reader, options, PropMissingAllFieldsCount, null)) + { + continue; + } + + if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelInferenceStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CacheMissCount = propCacheMissCount.Value, + FailureCount = propFailureCount.Value, + InferenceCount = propInferenceCount.Value, + MissingAllFieldsCount = propMissingAllFieldsCount.Value, + Timestamp = propTimestamp.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelInferenceStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCacheMissCount, value.CacheMissCount, null, null); + writer.WriteProperty(options, PropFailureCount, value.FailureCount, null, null); + writer.WriteProperty(options, PropInferenceCount, value.InferenceCount, null, null); + writer.WriteProperty(options, PropMissingAllFieldsCount, value.MissingAllFieldsCount, null, null); + writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceStats.g.cs index f77da4125b1..ec95d555b4c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelInferenceStats.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TrainedModelInferenceStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCacheMissCount = System.Text.Json.JsonEncodedText.Encode("cache_miss_count"); - private static readonly System.Text.Json.JsonEncodedText PropFailureCount = System.Text.Json.JsonEncodedText.Encode("failure_count"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceCount = System.Text.Json.JsonEncodedText.Encode("inference_count"); - private static readonly System.Text.Json.JsonEncodedText PropMissingAllFieldsCount = System.Text.Json.JsonEncodedText.Encode("missing_all_fields_count"); - private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelInferenceStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCacheMissCount = default; - LocalJsonValue propFailureCount = default; - LocalJsonValue propInferenceCount = default; - LocalJsonValue propMissingAllFieldsCount = default; - LocalJsonValue propTimestamp = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCacheMissCount.TryReadProperty(ref reader, options, PropCacheMissCount, null)) - { - continue; - } - - if (propFailureCount.TryReadProperty(ref reader, options, PropFailureCount, null)) - { - continue; - } - - if (propInferenceCount.TryReadProperty(ref reader, options, PropInferenceCount, null)) - { - continue; - } - - if (propMissingAllFieldsCount.TryReadProperty(ref reader, options, PropMissingAllFieldsCount, null)) - { - continue; - } - - if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelInferenceStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CacheMissCount = propCacheMissCount.Value, - FailureCount = propFailureCount.Value, - InferenceCount = propInferenceCount.Value, - MissingAllFieldsCount = propMissingAllFieldsCount.Value, - Timestamp = propTimestamp.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelInferenceStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCacheMissCount, value.CacheMissCount, null, null); - writer.WriteProperty(options, PropFailureCount, value.FailureCount, null, null); - writer.WriteProperty(options, PropInferenceCount, value.InferenceCount, null, null); - writer.WriteProperty(options, PropMissingAllFieldsCount, value.MissingAllFieldsCount, null, null); - writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelInferenceStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TrainedModelInferenceStatsConverter))] public sealed partial class TrainedModelInferenceStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelLocation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelLocation.Converters.g.cs new file mode 100644 index 00000000000..42587e7a0a3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelLocation.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TrainedModelLocationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelLocation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndex = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelLocation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Index = propIndex.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelLocation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelLocation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelLocation.g.cs index 684d9d7c9e7..b3f2a9cec89 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelLocation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelLocation.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TrainedModelLocationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelLocation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndex = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelLocation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Index = propIndex.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelLocation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelLocationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TrainedModelLocationConverter))] public sealed partial class TrainedModelLocation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelLocationIndex.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelLocationIndex.Converters.g.cs new file mode 100644 index 00000000000..8484d0b86bc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelLocationIndex.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TrainedModelLocationIndexConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelLocationIndex Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelLocationIndex(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelLocationIndex value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelLocationIndex.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelLocationIndex.g.cs index e15135bb496..3235c4839a2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelLocationIndex.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelLocationIndex.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TrainedModelLocationIndexConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelLocationIndex Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelLocationIndex(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelLocationIndex value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelLocationIndexConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TrainedModelLocationIndexConverter))] public sealed partial class TrainedModelLocationIndex { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelPrefixStrings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelPrefixStrings.Converters.g.cs new file mode 100644 index 00000000000..636af9c792b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelPrefixStrings.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TrainedModelPrefixStringsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIngest = System.Text.Json.JsonEncodedText.Encode("ingest"); + private static readonly System.Text.Json.JsonEncodedText PropSearch = System.Text.Json.JsonEncodedText.Encode("search"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelPrefixStrings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIngest = default; + LocalJsonValue propSearch = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIngest.TryReadProperty(ref reader, options, PropIngest, null)) + { + continue; + } + + if (propSearch.TryReadProperty(ref reader, options, PropSearch, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelPrefixStrings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Ingest = propIngest.Value, + Search = propSearch.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelPrefixStrings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIngest, value.Ingest, null, null); + writer.WriteProperty(options, PropSearch, value.Search, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelPrefixStrings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelPrefixStrings.g.cs index 51d56942d9d..b5a8248e265 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelPrefixStrings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelPrefixStrings.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TrainedModelPrefixStringsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIngest = System.Text.Json.JsonEncodedText.Encode("ingest"); - private static readonly System.Text.Json.JsonEncodedText PropSearch = System.Text.Json.JsonEncodedText.Encode("search"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelPrefixStrings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIngest = default; - LocalJsonValue propSearch = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIngest.TryReadProperty(ref reader, options, PropIngest, null)) - { - continue; - } - - if (propSearch.TryReadProperty(ref reader, options, PropSearch, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelPrefixStrings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Ingest = propIngest.Value, - Search = propSearch.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelPrefixStrings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIngest, value.Ingest, null, null); - writer.WriteProperty(options, PropSearch, value.Search, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelPrefixStringsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TrainedModelPrefixStringsConverter))] public sealed partial class TrainedModelPrefixStrings { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelSizeStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelSizeStats.Converters.g.cs new file mode 100644 index 00000000000..61792b034ec --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelSizeStats.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TrainedModelSizeStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropModelSizeBytes = System.Text.Json.JsonEncodedText.Encode("model_size_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropRequiredNativeMemoryBytes = System.Text.Json.JsonEncodedText.Encode("required_native_memory_bytes"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelSizeStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propModelSizeBytes = default; + LocalJsonValue propRequiredNativeMemoryBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propModelSizeBytes.TryReadProperty(ref reader, options, PropModelSizeBytes, null)) + { + continue; + } + + if (propRequiredNativeMemoryBytes.TryReadProperty(ref reader, options, PropRequiredNativeMemoryBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelSizeStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ModelSizeBytes = propModelSizeBytes.Value, + RequiredNativeMemoryBytes = propRequiredNativeMemoryBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelSizeStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropModelSizeBytes, value.ModelSizeBytes, null, null); + writer.WriteProperty(options, PropRequiredNativeMemoryBytes, value.RequiredNativeMemoryBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelSizeStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelSizeStats.g.cs index 79e2dd7c0c0..e98764a8f6d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelSizeStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelSizeStats.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TrainedModelSizeStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropModelSizeBytes = System.Text.Json.JsonEncodedText.Encode("model_size_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropRequiredNativeMemoryBytes = System.Text.Json.JsonEncodedText.Encode("required_native_memory_bytes"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelSizeStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propModelSizeBytes = default; - LocalJsonValue propRequiredNativeMemoryBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propModelSizeBytes.TryReadProperty(ref reader, options, PropModelSizeBytes, null)) - { - continue; - } - - if (propRequiredNativeMemoryBytes.TryReadProperty(ref reader, options, PropRequiredNativeMemoryBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelSizeStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ModelSizeBytes = propModelSizeBytes.Value, - RequiredNativeMemoryBytes = propRequiredNativeMemoryBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelSizeStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropModelSizeBytes, value.ModelSizeBytes, null, null); - writer.WriteProperty(options, PropRequiredNativeMemoryBytes, value.RequiredNativeMemoryBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelSizeStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TrainedModelSizeStatsConverter))] public sealed partial class TrainedModelSizeStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelStats.Converters.g.cs new file mode 100644 index 00000000000..464e95728cc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelStats.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TrainedModelStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDeploymentStats = System.Text.Json.JsonEncodedText.Encode("deployment_stats"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceStats = System.Text.Json.JsonEncodedText.Encode("inference_stats"); + private static readonly System.Text.Json.JsonEncodedText PropIngest = System.Text.Json.JsonEncodedText.Encode("ingest"); + private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); + private static readonly System.Text.Json.JsonEncodedText PropModelSizeStats = System.Text.Json.JsonEncodedText.Encode("model_size_stats"); + private static readonly System.Text.Json.JsonEncodedText PropPipelineCount = System.Text.Json.JsonEncodedText.Encode("pipeline_count"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDeploymentStats = default; + LocalJsonValue propInferenceStats = default; + LocalJsonValue?> propIngest = default; + LocalJsonValue propModelId = default; + LocalJsonValue propModelSizeStats = default; + LocalJsonValue propPipelineCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDeploymentStats.TryReadProperty(ref reader, options, PropDeploymentStats, null)) + { + continue; + } + + if (propInferenceStats.TryReadProperty(ref reader, options, PropInferenceStats, null)) + { + continue; + } + + if (propIngest.TryReadProperty(ref reader, options, PropIngest, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) + { + continue; + } + + if (propModelSizeStats.TryReadProperty(ref reader, options, PropModelSizeStats, null)) + { + continue; + } + + if (propPipelineCount.TryReadProperty(ref reader, options, PropPipelineCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DeploymentStats = propDeploymentStats.Value, + InferenceStats = propInferenceStats.Value, + Ingest = propIngest.Value, + ModelId = propModelId.Value, + ModelSizeStats = propModelSizeStats.Value, + PipelineCount = propPipelineCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDeploymentStats, value.DeploymentStats, null, null); + writer.WriteProperty(options, PropInferenceStats, value.InferenceStats, null, null); + writer.WriteProperty(options, PropIngest, value.Ingest, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropModelId, value.ModelId, null, null); + writer.WriteProperty(options, PropModelSizeStats, value.ModelSizeStats, null, null); + writer.WriteProperty(options, PropPipelineCount, value.PipelineCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelStats.g.cs index 518ae2e8119..72ea7c405cf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelStats.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TrainedModelStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDeploymentStats = System.Text.Json.JsonEncodedText.Encode("deployment_stats"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceStats = System.Text.Json.JsonEncodedText.Encode("inference_stats"); - private static readonly System.Text.Json.JsonEncodedText PropIngest = System.Text.Json.JsonEncodedText.Encode("ingest"); - private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); - private static readonly System.Text.Json.JsonEncodedText PropModelSizeStats = System.Text.Json.JsonEncodedText.Encode("model_size_stats"); - private static readonly System.Text.Json.JsonEncodedText PropPipelineCount = System.Text.Json.JsonEncodedText.Encode("pipeline_count"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDeploymentStats = default; - LocalJsonValue propInferenceStats = default; - LocalJsonValue?> propIngest = default; - LocalJsonValue propModelId = default; - LocalJsonValue propModelSizeStats = default; - LocalJsonValue propPipelineCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDeploymentStats.TryReadProperty(ref reader, options, PropDeploymentStats, null)) - { - continue; - } - - if (propInferenceStats.TryReadProperty(ref reader, options, PropInferenceStats, null)) - { - continue; - } - - if (propIngest.TryReadProperty(ref reader, options, PropIngest, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) - { - continue; - } - - if (propModelSizeStats.TryReadProperty(ref reader, options, PropModelSizeStats, null)) - { - continue; - } - - if (propPipelineCount.TryReadProperty(ref reader, options, PropPipelineCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DeploymentStats = propDeploymentStats.Value, - InferenceStats = propInferenceStats.Value, - Ingest = propIngest.Value, - ModelId = propModelId.Value, - ModelSizeStats = propModelSizeStats.Value, - PipelineCount = propPipelineCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDeploymentStats, value.DeploymentStats, null, null); - writer.WriteProperty(options, PropInferenceStats, value.InferenceStats, null, null); - writer.WriteProperty(options, PropIngest, value.Ingest, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropModelId, value.ModelId, null, null); - writer.WriteProperty(options, PropModelSizeStats, value.ModelSizeStats, null, null); - writer.WriteProperty(options, PropPipelineCount, value.PipelineCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TrainedModelStatsConverter))] public sealed partial class TrainedModelStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelTree.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelTree.Converters.g.cs new file mode 100644 index 00000000000..e7fd0e4436d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelTree.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TrainedModelTreeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClassificationLabels = System.Text.Json.JsonEncodedText.Encode("classification_labels"); + private static readonly System.Text.Json.JsonEncodedText PropFeatureNames = System.Text.Json.JsonEncodedText.Encode("feature_names"); + private static readonly System.Text.Json.JsonEncodedText PropTargetType = System.Text.Json.JsonEncodedText.Encode("target_type"); + private static readonly System.Text.Json.JsonEncodedText PropTreeStructure = System.Text.Json.JsonEncodedText.Encode("tree_structure"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTree Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propClassificationLabels = default; + LocalJsonValue> propFeatureNames = default; + LocalJsonValue propTargetType = default; + LocalJsonValue> propTreeStructure = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClassificationLabels.TryReadProperty(ref reader, options, PropClassificationLabels, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propFeatureNames.TryReadProperty(ref reader, options, PropFeatureNames, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propTargetType.TryReadProperty(ref reader, options, PropTargetType, null)) + { + continue; + } + + if (propTreeStructure.TryReadProperty(ref reader, options, PropTreeStructure, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTree(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClassificationLabels = propClassificationLabels.Value, + FeatureNames = propFeatureNames.Value, + TargetType = propTargetType.Value, + TreeStructure = propTreeStructure.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTree value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClassificationLabels, value.ClassificationLabels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFeatureNames, value.FeatureNames, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTargetType, value.TargetType, null, null); + writer.WriteProperty(options, PropTreeStructure, value.TreeStructure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelTree.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelTree.g.cs index 227d976723c..cb8c268d4e7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelTree.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelTree.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TrainedModelTreeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClassificationLabels = System.Text.Json.JsonEncodedText.Encode("classification_labels"); - private static readonly System.Text.Json.JsonEncodedText PropFeatureNames = System.Text.Json.JsonEncodedText.Encode("feature_names"); - private static readonly System.Text.Json.JsonEncodedText PropTargetType = System.Text.Json.JsonEncodedText.Encode("target_type"); - private static readonly System.Text.Json.JsonEncodedText PropTreeStructure = System.Text.Json.JsonEncodedText.Encode("tree_structure"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTree Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propClassificationLabels = default; - LocalJsonValue> propFeatureNames = default; - LocalJsonValue propTargetType = default; - LocalJsonValue> propTreeStructure = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClassificationLabels.TryReadProperty(ref reader, options, PropClassificationLabels, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propFeatureNames.TryReadProperty(ref reader, options, PropFeatureNames, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propTargetType.TryReadProperty(ref reader, options, PropTargetType, null)) - { - continue; - } - - if (propTreeStructure.TryReadProperty(ref reader, options, PropTreeStructure, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTree(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClassificationLabels = propClassificationLabels.Value, - FeatureNames = propFeatureNames.Value, - TargetType = propTargetType.Value, - TreeStructure = propTreeStructure.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTree value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClassificationLabels, value.ClassificationLabels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFeatureNames, value.FeatureNames, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTargetType, value.TargetType, null, null); - writer.WriteProperty(options, PropTreeStructure, value.TreeStructure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTreeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TrainedModelTreeConverter))] public sealed partial class TrainedModelTree { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelTreeNode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelTreeNode.Converters.g.cs new file mode 100644 index 00000000000..faf1997f73f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelTreeNode.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TrainedModelTreeNodeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDecisionType = System.Text.Json.JsonEncodedText.Encode("decision_type"); + private static readonly System.Text.Json.JsonEncodedText PropDefaultLeft = System.Text.Json.JsonEncodedText.Encode("default_left"); + private static readonly System.Text.Json.JsonEncodedText PropLeafValue = System.Text.Json.JsonEncodedText.Encode("leaf_value"); + private static readonly System.Text.Json.JsonEncodedText PropLeftChild = System.Text.Json.JsonEncodedText.Encode("left_child"); + private static readonly System.Text.Json.JsonEncodedText PropNodeIndex = System.Text.Json.JsonEncodedText.Encode("node_index"); + private static readonly System.Text.Json.JsonEncodedText PropRightChild = System.Text.Json.JsonEncodedText.Encode("right_child"); + private static readonly System.Text.Json.JsonEncodedText PropSplitFeature = System.Text.Json.JsonEncodedText.Encode("split_feature"); + private static readonly System.Text.Json.JsonEncodedText PropSplitGain = System.Text.Json.JsonEncodedText.Encode("split_gain"); + private static readonly System.Text.Json.JsonEncodedText PropThreshold = System.Text.Json.JsonEncodedText.Encode("threshold"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTreeNode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDecisionType = default; + LocalJsonValue propDefaultLeft = default; + LocalJsonValue propLeafValue = default; + LocalJsonValue propLeftChild = default; + LocalJsonValue propNodeIndex = default; + LocalJsonValue propRightChild = default; + LocalJsonValue propSplitFeature = default; + LocalJsonValue propSplitGain = default; + LocalJsonValue propThreshold = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDecisionType.TryReadProperty(ref reader, options, PropDecisionType, null)) + { + continue; + } + + if (propDefaultLeft.TryReadProperty(ref reader, options, PropDefaultLeft, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLeafValue.TryReadProperty(ref reader, options, PropLeafValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLeftChild.TryReadProperty(ref reader, options, PropLeftChild, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNodeIndex.TryReadProperty(ref reader, options, PropNodeIndex, null)) + { + continue; + } + + if (propRightChild.TryReadProperty(ref reader, options, PropRightChild, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSplitFeature.TryReadProperty(ref reader, options, PropSplitFeature, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSplitGain.TryReadProperty(ref reader, options, PropSplitGain, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propThreshold.TryReadProperty(ref reader, options, PropThreshold, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTreeNode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DecisionType = propDecisionType.Value, + DefaultLeft = propDefaultLeft.Value, + LeafValue = propLeafValue.Value, + LeftChild = propLeftChild.Value, + NodeIndex = propNodeIndex.Value, + RightChild = propRightChild.Value, + SplitFeature = propSplitFeature.Value, + SplitGain = propSplitGain.Value, + Threshold = propThreshold.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTreeNode value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDecisionType, value.DecisionType, null, null); + writer.WriteProperty(options, PropDefaultLeft, value.DefaultLeft, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLeafValue, value.LeafValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLeftChild, value.LeftChild, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNodeIndex, value.NodeIndex, null, null); + writer.WriteProperty(options, PropRightChild, value.RightChild, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSplitFeature, value.SplitFeature, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSplitGain, value.SplitGain, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropThreshold, value.Threshold, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelTreeNode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelTreeNode.g.cs index 03e8f15cc5a..d517ab313c4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelTreeNode.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelTreeNode.g.cs @@ -23,118 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TrainedModelTreeNodeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDecisionType = System.Text.Json.JsonEncodedText.Encode("decision_type"); - private static readonly System.Text.Json.JsonEncodedText PropDefaultLeft = System.Text.Json.JsonEncodedText.Encode("default_left"); - private static readonly System.Text.Json.JsonEncodedText PropLeafValue = System.Text.Json.JsonEncodedText.Encode("leaf_value"); - private static readonly System.Text.Json.JsonEncodedText PropLeftChild = System.Text.Json.JsonEncodedText.Encode("left_child"); - private static readonly System.Text.Json.JsonEncodedText PropNodeIndex = System.Text.Json.JsonEncodedText.Encode("node_index"); - private static readonly System.Text.Json.JsonEncodedText PropRightChild = System.Text.Json.JsonEncodedText.Encode("right_child"); - private static readonly System.Text.Json.JsonEncodedText PropSplitFeature = System.Text.Json.JsonEncodedText.Encode("split_feature"); - private static readonly System.Text.Json.JsonEncodedText PropSplitGain = System.Text.Json.JsonEncodedText.Encode("split_gain"); - private static readonly System.Text.Json.JsonEncodedText PropThreshold = System.Text.Json.JsonEncodedText.Encode("threshold"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTreeNode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDecisionType = default; - LocalJsonValue propDefaultLeft = default; - LocalJsonValue propLeafValue = default; - LocalJsonValue propLeftChild = default; - LocalJsonValue propNodeIndex = default; - LocalJsonValue propRightChild = default; - LocalJsonValue propSplitFeature = default; - LocalJsonValue propSplitGain = default; - LocalJsonValue propThreshold = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDecisionType.TryReadProperty(ref reader, options, PropDecisionType, null)) - { - continue; - } - - if (propDefaultLeft.TryReadProperty(ref reader, options, PropDefaultLeft, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLeafValue.TryReadProperty(ref reader, options, PropLeafValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLeftChild.TryReadProperty(ref reader, options, PropLeftChild, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNodeIndex.TryReadProperty(ref reader, options, PropNodeIndex, null)) - { - continue; - } - - if (propRightChild.TryReadProperty(ref reader, options, PropRightChild, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSplitFeature.TryReadProperty(ref reader, options, PropSplitFeature, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSplitGain.TryReadProperty(ref reader, options, PropSplitGain, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propThreshold.TryReadProperty(ref reader, options, PropThreshold, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTreeNode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DecisionType = propDecisionType.Value, - DefaultLeft = propDefaultLeft.Value, - LeafValue = propLeafValue.Value, - LeftChild = propLeftChild.Value, - NodeIndex = propNodeIndex.Value, - RightChild = propRightChild.Value, - SplitFeature = propSplitFeature.Value, - SplitGain = propSplitGain.Value, - Threshold = propThreshold.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTreeNode value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDecisionType, value.DecisionType, null, null); - writer.WriteProperty(options, PropDefaultLeft, value.DefaultLeft, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLeafValue, value.LeafValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLeftChild, value.LeftChild, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNodeIndex, value.NodeIndex, null, null); - writer.WriteProperty(options, PropRightChild, value.RightChild, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSplitFeature, value.SplitFeature, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSplitGain, value.SplitGain, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropThreshold, value.Threshold, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelTreeNodeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TrainedModelTreeNodeConverter))] public sealed partial class TrainedModelTreeNode { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelType.Converters.g.cs new file mode 100644 index 00000000000..1f76239dad2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelType.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TrainedModelTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberLangIdent = System.Text.Json.JsonEncodedText.Encode("lang_ident"); + private static readonly System.Text.Json.JsonEncodedText MemberPytorch = System.Text.Json.JsonEncodedText.Encode("pytorch"); + private static readonly System.Text.Json.JsonEncodedText MemberTreeEnsemble = System.Text.Json.JsonEncodedText.Encode("tree_ensemble"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberLangIdent)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType.LangIdent; + } + + if (reader.ValueTextEquals(MemberPytorch)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType.Pytorch; + } + + if (reader.ValueTextEquals(MemberTreeEnsemble)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType.TreeEnsemble; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberLangIdent.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType.LangIdent; + } + + if (string.Equals(value, MemberPytorch.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType.Pytorch; + } + + if (string.Equals(value, MemberTreeEnsemble.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType.TreeEnsemble; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType.LangIdent: + writer.WriteStringValue(MemberLangIdent); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType.Pytorch: + writer.WriteStringValue(MemberPytorch); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType.TreeEnsemble: + writer.WriteStringValue(MemberTreeEnsemble); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainedModelType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelType.g.cs new file mode 100644 index 00000000000..f10a47dc3eb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainedModelType.g.cs @@ -0,0 +1,51 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TrainedModelTypeConverter))] +public enum TrainedModelType +{ + /// + /// + /// A special type reserved for language identification models. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "lang_ident")] + LangIdent, + /// + /// + /// The stored definition is a PyTorch (specifically a TorchScript) model. + /// Currently only NLP models are supported. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "pytorch")] + Pytorch, + /// + /// + /// The model definition is an ensemble model of decision trees. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "tree_ensemble")] + TreeEnsemble +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainingPriority.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainingPriority.Converters.g.cs new file mode 100644 index 00000000000..4297a908539 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainingPriority.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TrainingPriorityConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberLow = System.Text.Json.JsonEncodedText.Encode("low"); + private static readonly System.Text.Json.JsonEncodedText MemberNormal = System.Text.Json.JsonEncodedText.Encode("normal"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberLow)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority.Low; + } + + if (reader.ValueTextEquals(MemberNormal)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority.Normal; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberLow.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority.Low; + } + + if (string.Equals(value, MemberNormal.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority.Normal; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority.Low: + writer.WriteStringValue(MemberLow); + break; + case Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority.Normal: + writer.WriteStringValue(MemberNormal); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TrainingPriority value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainingPriority.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainingPriority.g.cs new file mode 100644 index 00000000000..17b9c279bf9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TrainingPriority.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TrainingPriorityConverter))] +public enum TrainingPriority +{ + [System.Runtime.Serialization.EnumMember(Value = "low")] + Low, + [System.Runtime.Serialization.EnumMember(Value = "normal")] + Normal +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TransformAuthorization.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TransformAuthorization.Converters.g.cs new file mode 100644 index 00000000000..c7f2547b5a1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TransformAuthorization.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class TransformAuthorizationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + private static readonly System.Text.Json.JsonEncodedText PropServiceAccount = System.Text.Json.JsonEncodedText.Encode("service_account"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.TransformAuthorization Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApiKey = default; + LocalJsonValue?> propRoles = default; + LocalJsonValue propServiceAccount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) + { + continue; + } + + if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propServiceAccount.TryReadProperty(ref reader, options, PropServiceAccount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.TransformAuthorization(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ApiKey = propApiKey.Value, + Roles = propRoles.Value, + ServiceAccount = propServiceAccount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TransformAuthorization value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); + writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropServiceAccount, value.ServiceAccount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TransformAuthorization.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TransformAuthorization.g.cs index a8502082a73..d3984810abd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TransformAuthorization.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/TransformAuthorization.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class TransformAuthorizationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); - private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); - private static readonly System.Text.Json.JsonEncodedText PropServiceAccount = System.Text.Json.JsonEncodedText.Encode("service_account"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.TransformAuthorization Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propApiKey = default; - LocalJsonValue?> propRoles = default; - LocalJsonValue propServiceAccount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) - { - continue; - } - - if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propServiceAccount.TryReadProperty(ref reader, options, PropServiceAccount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.TransformAuthorization(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ApiKey = propApiKey.Value, - Roles = propRoles.Value, - ServiceAccount = propServiceAccount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.TransformAuthorization value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); - writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropServiceAccount, value.ServiceAccount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.TransformAuthorizationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.TransformAuthorizationConverter))] public sealed partial class TransformAuthorization { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Vocabulary.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Vocabulary.Converters.g.cs new file mode 100644 index 00000000000..d0ddbc8672e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Vocabulary.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class VocabularyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.Vocabulary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndex = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.Vocabulary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Index = propIndex.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Vocabulary value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Vocabulary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Vocabulary.g.cs index 916332e96b5..74aaf4f820f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Vocabulary.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Vocabulary.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class VocabularyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.Vocabulary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndex = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.Vocabulary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Index = propIndex.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Vocabulary value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.VocabularyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.VocabularyConverter))] public sealed partial class Vocabulary { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Weights.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Weights.Converters.g.cs new file mode 100644 index 00000000000..c7294ecad3f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Weights.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class WeightsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropWeightsValue = System.Text.Json.JsonEncodedText.Encode("weights"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.Weights Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propWeightsValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propWeightsValue.TryReadProperty(ref reader, options, PropWeightsValue, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.Weights(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + WeightsValue = propWeightsValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Weights value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropWeightsValue, value.WeightsValue, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Weights.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Weights.g.cs index c0dea484dfe..03ee4d6b66d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Weights.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/Weights.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class WeightsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropWeightsValue = System.Text.Json.JsonEncodedText.Encode("weights"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.Weights Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propWeightsValue = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propWeightsValue.TryReadProperty(ref reader, options, PropWeightsValue, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.Weights(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - WeightsValue = propWeightsValue.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.Weights value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropWeightsValue, value.WeightsValue, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.WeightsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.WeightsConverter))] public sealed partial class Weights { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/XlmRobertaTokenizationConfig.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/XlmRobertaTokenizationConfig.Converters.g.cs new file mode 100644 index 00000000000..929bc27df0c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/XlmRobertaTokenizationConfig.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class XlmRobertaTokenizationConfigConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDoLowerCase = System.Text.Json.JsonEncodedText.Encode("do_lower_case"); + private static readonly System.Text.Json.JsonEncodedText PropMaxSequenceLength = System.Text.Json.JsonEncodedText.Encode("max_sequence_length"); + private static readonly System.Text.Json.JsonEncodedText PropSpan = System.Text.Json.JsonEncodedText.Encode("span"); + private static readonly System.Text.Json.JsonEncodedText PropTruncate = System.Text.Json.JsonEncodedText.Encode("truncate"); + private static readonly System.Text.Json.JsonEncodedText PropWithSpecialTokens = System.Text.Json.JsonEncodedText.Encode("with_special_tokens"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.XlmRobertaTokenizationConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDoLowerCase = default; + LocalJsonValue propMaxSequenceLength = default; + LocalJsonValue propSpan = default; + LocalJsonValue propTruncate = default; + LocalJsonValue propWithSpecialTokens = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDoLowerCase.TryReadProperty(ref reader, options, PropDoLowerCase, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxSequenceLength.TryReadProperty(ref reader, options, PropMaxSequenceLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSpan.TryReadProperty(ref reader, options, PropSpan, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTruncate.TryReadProperty(ref reader, options, PropTruncate, static Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propWithSpecialTokens.TryReadProperty(ref reader, options, PropWithSpecialTokens, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.XlmRobertaTokenizationConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DoLowerCase = propDoLowerCase.Value, + MaxSequenceLength = propMaxSequenceLength.Value, + Span = propSpan.Value, + Truncate = propTruncate.Value, + WithSpecialTokens = propWithSpecialTokens.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.XlmRobertaTokenizationConfig value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDoLowerCase, value.DoLowerCase, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxSequenceLength, value.MaxSequenceLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSpan, value.Span, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTruncate, value.Truncate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropWithSpecialTokens, value.WithSpecialTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/XlmRobertaTokenizationConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/XlmRobertaTokenizationConfig.g.cs index 7faa03118e6..fd6c9fdf735 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/XlmRobertaTokenizationConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/XlmRobertaTokenizationConfig.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class XlmRobertaTokenizationConfigConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDoLowerCase = System.Text.Json.JsonEncodedText.Encode("do_lower_case"); - private static readonly System.Text.Json.JsonEncodedText PropMaxSequenceLength = System.Text.Json.JsonEncodedText.Encode("max_sequence_length"); - private static readonly System.Text.Json.JsonEncodedText PropSpan = System.Text.Json.JsonEncodedText.Encode("span"); - private static readonly System.Text.Json.JsonEncodedText PropTruncate = System.Text.Json.JsonEncodedText.Encode("truncate"); - private static readonly System.Text.Json.JsonEncodedText PropWithSpecialTokens = System.Text.Json.JsonEncodedText.Encode("with_special_tokens"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.XlmRobertaTokenizationConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDoLowerCase = default; - LocalJsonValue propMaxSequenceLength = default; - LocalJsonValue propSpan = default; - LocalJsonValue propTruncate = default; - LocalJsonValue propWithSpecialTokens = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDoLowerCase.TryReadProperty(ref reader, options, PropDoLowerCase, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxSequenceLength.TryReadProperty(ref reader, options, PropMaxSequenceLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSpan.TryReadProperty(ref reader, options, PropSpan, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTruncate.TryReadProperty(ref reader, options, PropTruncate, static Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propWithSpecialTokens.TryReadProperty(ref reader, options, PropWithSpecialTokens, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.XlmRobertaTokenizationConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DoLowerCase = propDoLowerCase.Value, - MaxSequenceLength = propMaxSequenceLength.Value, - Span = propSpan.Value, - Truncate = propTruncate.Value, - WithSpecialTokens = propWithSpecialTokens.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.XlmRobertaTokenizationConfig value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDoLowerCase, value.DoLowerCase, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxSequenceLength, value.MaxSequenceLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSpan, value.Span, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTruncate, value.Truncate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.MachineLearning.TokenizationTruncate? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropWithSpecialTokens, value.WithSpecialTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.XlmRobertaTokenizationConfigConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.XlmRobertaTokenizationConfigConverter))] public sealed partial class XlmRobertaTokenizationConfig { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ZeroShotClassificationInferenceOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ZeroShotClassificationInferenceOptions.Converters.g.cs new file mode 100644 index 00000000000..c37aa75878a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ZeroShotClassificationInferenceOptions.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ZeroShotClassificationInferenceOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClassificationLabels = System.Text.Json.JsonEncodedText.Encode("classification_labels"); + private static readonly System.Text.Json.JsonEncodedText PropHypothesisTemplate = System.Text.Json.JsonEncodedText.Encode("hypothesis_template"); + private static readonly System.Text.Json.JsonEncodedText PropLabels = System.Text.Json.JsonEncodedText.Encode("labels"); + private static readonly System.Text.Json.JsonEncodedText PropMultiLabel = System.Text.Json.JsonEncodedText.Encode("multi_label"); + private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); + private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.ZeroShotClassificationInferenceOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propClassificationLabels = default; + LocalJsonValue propHypothesisTemplate = default; + LocalJsonValue?> propLabels = default; + LocalJsonValue propMultiLabel = default; + LocalJsonValue propResultsField = default; + LocalJsonValue propTokenization = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClassificationLabels.TryReadProperty(ref reader, options, PropClassificationLabels, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propHypothesisTemplate.TryReadProperty(ref reader, options, PropHypothesisTemplate, null)) + { + continue; + } + + if (propLabels.TryReadProperty(ref reader, options, PropLabels, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propMultiLabel.TryReadProperty(ref reader, options, PropMultiLabel, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) + { + continue; + } + + if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.ZeroShotClassificationInferenceOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClassificationLabels = propClassificationLabels.Value, + HypothesisTemplate = propHypothesisTemplate.Value, + Labels = propLabels.Value, + MultiLabel = propMultiLabel.Value, + ResultsField = propResultsField.Value, + Tokenization = propTokenization.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ZeroShotClassificationInferenceOptions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClassificationLabels, value.ClassificationLabels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropHypothesisTemplate, value.HypothesisTemplate, null, null); + writer.WriteProperty(options, PropLabels, value.Labels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMultiLabel, value.MultiLabel, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); + writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ZeroShotClassificationInferenceOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ZeroShotClassificationInferenceOptions.g.cs index 6800d6ee885..983fe70c892 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ZeroShotClassificationInferenceOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ZeroShotClassificationInferenceOptions.g.cs @@ -23,96 +23,12 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class ZeroShotClassificationInferenceOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClassificationLabels = System.Text.Json.JsonEncodedText.Encode("classification_labels"); - private static readonly System.Text.Json.JsonEncodedText PropHypothesisTemplate = System.Text.Json.JsonEncodedText.Encode("hypothesis_template"); - private static readonly System.Text.Json.JsonEncodedText PropLabels = System.Text.Json.JsonEncodedText.Encode("labels"); - private static readonly System.Text.Json.JsonEncodedText PropMultiLabel = System.Text.Json.JsonEncodedText.Encode("multi_label"); - private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); - private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.ZeroShotClassificationInferenceOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propClassificationLabels = default; - LocalJsonValue propHypothesisTemplate = default; - LocalJsonValue?> propLabels = default; - LocalJsonValue propMultiLabel = default; - LocalJsonValue propResultsField = default; - LocalJsonValue propTokenization = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClassificationLabels.TryReadProperty(ref reader, options, PropClassificationLabels, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propHypothesisTemplate.TryReadProperty(ref reader, options, PropHypothesisTemplate, null)) - { - continue; - } - - if (propLabels.TryReadProperty(ref reader, options, PropLabels, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propMultiLabel.TryReadProperty(ref reader, options, PropMultiLabel, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) - { - continue; - } - - if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.ZeroShotClassificationInferenceOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClassificationLabels = propClassificationLabels.Value, - HypothesisTemplate = propHypothesisTemplate.Value, - Labels = propLabels.Value, - MultiLabel = propMultiLabel.Value, - ResultsField = propResultsField.Value, - Tokenization = propTokenization.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ZeroShotClassificationInferenceOptions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClassificationLabels, value.ClassificationLabels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropHypothesisTemplate, value.HypothesisTemplate, null, null); - writer.WriteProperty(options, PropLabels, value.Labels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMultiLabel, value.MultiLabel, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); - writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Zero shot classification configuration options /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ZeroShotClassificationInferenceOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ZeroShotClassificationInferenceOptionsConverter))] public sealed partial class ZeroShotClassificationInferenceOptions { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ZeroShotClassificationInferenceUpdateOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ZeroShotClassificationInferenceUpdateOptions.Converters.g.cs new file mode 100644 index 00000000000..c107bf22178 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ZeroShotClassificationInferenceUpdateOptions.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.MachineLearning.Json; + +public sealed partial class ZeroShotClassificationInferenceUpdateOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLabels = System.Text.Json.JsonEncodedText.Encode("labels"); + private static readonly System.Text.Json.JsonEncodedText PropMultiLabel = System.Text.Json.JsonEncodedText.Encode("multi_label"); + private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); + private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); + + public override Elastic.Clients.Elasticsearch.MachineLearning.ZeroShotClassificationInferenceUpdateOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propLabels = default; + LocalJsonValue propMultiLabel = default; + LocalJsonValue propResultsField = default; + LocalJsonValue propTokenization = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLabels.TryReadProperty(ref reader, options, PropLabels, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMultiLabel.TryReadProperty(ref reader, options, PropMultiLabel, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) + { + continue; + } + + if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MachineLearning.ZeroShotClassificationInferenceUpdateOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Labels = propLabels.Value, + MultiLabel = propMultiLabel.Value, + ResultsField = propResultsField.Value, + Tokenization = propTokenization.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ZeroShotClassificationInferenceUpdateOptions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLabels, value.Labels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMultiLabel, value.MultiLabel, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); + writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ZeroShotClassificationInferenceUpdateOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ZeroShotClassificationInferenceUpdateOptions.g.cs index b8ec648f3cb..967c4afa419 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ZeroShotClassificationInferenceUpdateOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/ZeroShotClassificationInferenceUpdateOptions.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.MachineLearning; -internal sealed partial class ZeroShotClassificationInferenceUpdateOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLabels = System.Text.Json.JsonEncodedText.Encode("labels"); - private static readonly System.Text.Json.JsonEncodedText PropMultiLabel = System.Text.Json.JsonEncodedText.Encode("multi_label"); - private static readonly System.Text.Json.JsonEncodedText PropResultsField = System.Text.Json.JsonEncodedText.Encode("results_field"); - private static readonly System.Text.Json.JsonEncodedText PropTokenization = System.Text.Json.JsonEncodedText.Encode("tokenization"); - - public override Elastic.Clients.Elasticsearch.MachineLearning.ZeroShotClassificationInferenceUpdateOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propLabels = default; - LocalJsonValue propMultiLabel = default; - LocalJsonValue propResultsField = default; - LocalJsonValue propTokenization = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLabels.TryReadProperty(ref reader, options, PropLabels, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMultiLabel.TryReadProperty(ref reader, options, PropMultiLabel, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propResultsField.TryReadProperty(ref reader, options, PropResultsField, null)) - { - continue; - } - - if (propTokenization.TryReadProperty(ref reader, options, PropTokenization, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MachineLearning.ZeroShotClassificationInferenceUpdateOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Labels = propLabels.Value, - MultiLabel = propMultiLabel.Value, - ResultsField = propResultsField.Value, - Tokenization = propTokenization.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MachineLearning.ZeroShotClassificationInferenceUpdateOptions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLabels, value.Labels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMultiLabel, value.MultiLabel, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropResultsField, value.ResultsField, null, null); - writer.WriteProperty(options, PropTokenization, value.Tokenization, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.ZeroShotClassificationInferenceUpdateOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.ZeroShotClassificationInferenceUpdateOptionsConverter))] public sealed partial class ZeroShotClassificationInferenceUpdateOptions { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/AggregateMetricDoubleProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/AggregateMetricDoubleProperty.Converters.g.cs new file mode 100644 index 00000000000..75d4b40a585 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/AggregateMetricDoubleProperty.Converters.g.cs @@ -0,0 +1,152 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class AggregateMetricDoublePropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDefaultMetric = System.Text.Json.JsonEncodedText.Encode("default_metric"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropMetrics = System.Text.Json.JsonEncodedText.Encode("metrics"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.AggregateMetricDoubleProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDefaultMetric = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIgnoreMalformed = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue> propMetrics = default; + LocalJsonValue propProperties = default; + LocalJsonValue propSyntheticSourceKeep = default; + LocalJsonValue propTimeSeriesMetric = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDefaultMetric.TryReadProperty(ref reader, options, PropDefaultMetric, null)) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propMetrics.TryReadProperty(ref reader, options, PropMetrics, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.AggregateMetricDoubleProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DefaultMetric = propDefaultMetric.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + IgnoreMalformed = propIgnoreMalformed.Value, + Meta = propMeta.Value, + Metrics = propMetrics.Value, + Properties = propProperties.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value, + TimeSeriesMetric = propTimeSeriesMetric.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.AggregateMetricDoubleProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDefaultMetric, value.DefaultMetric, null, null); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropMetrics, value.Metrics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/AggregateMetricDoubleProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/AggregateMetricDoubleProperty.g.cs index 8948401df4e..8178934f804 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/AggregateMetricDoubleProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/AggregateMetricDoubleProperty.g.cs @@ -23,135 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class AggregateMetricDoublePropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDefaultMetric = System.Text.Json.JsonEncodedText.Encode("default_metric"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropMetrics = System.Text.Json.JsonEncodedText.Encode("metrics"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.AggregateMetricDoubleProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDefaultMetric = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIgnoreMalformed = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue> propMetrics = default; - LocalJsonValue propProperties = default; - LocalJsonValue propSyntheticSourceKeep = default; - LocalJsonValue propTimeSeriesMetric = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDefaultMetric.TryReadProperty(ref reader, options, PropDefaultMetric, null)) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propMetrics.TryReadProperty(ref reader, options, PropMetrics, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.AggregateMetricDoubleProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DefaultMetric = propDefaultMetric.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - IgnoreMalformed = propIgnoreMalformed.Value, - Meta = propMeta.Value, - Metrics = propMetrics.Value, - Properties = propProperties.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value, - TimeSeriesMetric = propTimeSeriesMetric.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.AggregateMetricDoubleProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDefaultMetric, value.DefaultMetric, null, null); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropMetrics, value.Metrics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.AggregateMetricDoublePropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.AggregateMetricDoublePropertyConverter))] public sealed partial class AggregateMetricDoubleProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/AllField.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/AllField.Converters.g.cs new file mode 100644 index 00000000000..01f2defeaab --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/AllField.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class AllFieldConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropOmitNorms = System.Text.Json.JsonEncodedText.Encode("omit_norms"); + private static readonly System.Text.Json.JsonEncodedText PropSearchAnalyzer = System.Text.Json.JsonEncodedText.Encode("search_analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropStoreTermVectorOffsets = System.Text.Json.JsonEncodedText.Encode("store_term_vector_offsets"); + private static readonly System.Text.Json.JsonEncodedText PropStoreTermVectorPayloads = System.Text.Json.JsonEncodedText.Encode("store_term_vector_payloads"); + private static readonly System.Text.Json.JsonEncodedText PropStoreTermVectorPositions = System.Text.Json.JsonEncodedText.Encode("store_term_vector_positions"); + private static readonly System.Text.Json.JsonEncodedText PropStoreTermVectors = System.Text.Json.JsonEncodedText.Encode("store_term_vectors"); + + public override Elastic.Clients.Elasticsearch.Mapping.AllField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzer = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propOmitNorms = default; + LocalJsonValue propSearchAnalyzer = default; + LocalJsonValue propSimilarity = default; + LocalJsonValue propStore = default; + LocalJsonValue propStoreTermVectorOffsets = default; + LocalJsonValue propStoreTermVectorPayloads = default; + LocalJsonValue propStoreTermVectorPositions = default; + LocalJsonValue propStoreTermVectors = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propOmitNorms.TryReadProperty(ref reader, options, PropOmitNorms, null)) + { + continue; + } + + if (propSearchAnalyzer.TryReadProperty(ref reader, options, PropSearchAnalyzer, null)) + { + continue; + } + + if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, null)) + { + continue; + } + + if (propStoreTermVectorOffsets.TryReadProperty(ref reader, options, PropStoreTermVectorOffsets, null)) + { + continue; + } + + if (propStoreTermVectorPayloads.TryReadProperty(ref reader, options, PropStoreTermVectorPayloads, null)) + { + continue; + } + + if (propStoreTermVectorPositions.TryReadProperty(ref reader, options, PropStoreTermVectorPositions, null)) + { + continue; + } + + if (propStoreTermVectors.TryReadProperty(ref reader, options, PropStoreTermVectors, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.AllField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analyzer = propAnalyzer.Value, + Enabled = propEnabled.Value, + OmitNorms = propOmitNorms.Value, + SearchAnalyzer = propSearchAnalyzer.Value, + Similarity = propSimilarity.Value, + Store = propStore.Value, + StoreTermVectorOffsets = propStoreTermVectorOffsets.Value, + StoreTermVectorPayloads = propStoreTermVectorPayloads.Value, + StoreTermVectorPositions = propStoreTermVectorPositions.Value, + StoreTermVectors = propStoreTermVectors.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.AllField value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropOmitNorms, value.OmitNorms, null, null); + writer.WriteProperty(options, PropSearchAnalyzer, value.SearchAnalyzer, null, null); + writer.WriteProperty(options, PropSimilarity, value.Similarity, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, null); + writer.WriteProperty(options, PropStoreTermVectorOffsets, value.StoreTermVectorOffsets, null, null); + writer.WriteProperty(options, PropStoreTermVectorPayloads, value.StoreTermVectorPayloads, null, null); + writer.WriteProperty(options, PropStoreTermVectorPositions, value.StoreTermVectorPositions, null, null); + writer.WriteProperty(options, PropStoreTermVectors, value.StoreTermVectors, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/AllField.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/AllField.g.cs index 16f5fd65eba..bf4dba5602b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/AllField.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/AllField.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class AllFieldConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropOmitNorms = System.Text.Json.JsonEncodedText.Encode("omit_norms"); - private static readonly System.Text.Json.JsonEncodedText PropSearchAnalyzer = System.Text.Json.JsonEncodedText.Encode("search_analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropStoreTermVectorOffsets = System.Text.Json.JsonEncodedText.Encode("store_term_vector_offsets"); - private static readonly System.Text.Json.JsonEncodedText PropStoreTermVectorPayloads = System.Text.Json.JsonEncodedText.Encode("store_term_vector_payloads"); - private static readonly System.Text.Json.JsonEncodedText PropStoreTermVectorPositions = System.Text.Json.JsonEncodedText.Encode("store_term_vector_positions"); - private static readonly System.Text.Json.JsonEncodedText PropStoreTermVectors = System.Text.Json.JsonEncodedText.Encode("store_term_vectors"); - - public override Elastic.Clients.Elasticsearch.Mapping.AllField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyzer = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propOmitNorms = default; - LocalJsonValue propSearchAnalyzer = default; - LocalJsonValue propSimilarity = default; - LocalJsonValue propStore = default; - LocalJsonValue propStoreTermVectorOffsets = default; - LocalJsonValue propStoreTermVectorPayloads = default; - LocalJsonValue propStoreTermVectorPositions = default; - LocalJsonValue propStoreTermVectors = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propOmitNorms.TryReadProperty(ref reader, options, PropOmitNorms, null)) - { - continue; - } - - if (propSearchAnalyzer.TryReadProperty(ref reader, options, PropSearchAnalyzer, null)) - { - continue; - } - - if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, null)) - { - continue; - } - - if (propStoreTermVectorOffsets.TryReadProperty(ref reader, options, PropStoreTermVectorOffsets, null)) - { - continue; - } - - if (propStoreTermVectorPayloads.TryReadProperty(ref reader, options, PropStoreTermVectorPayloads, null)) - { - continue; - } - - if (propStoreTermVectorPositions.TryReadProperty(ref reader, options, PropStoreTermVectorPositions, null)) - { - continue; - } - - if (propStoreTermVectors.TryReadProperty(ref reader, options, PropStoreTermVectors, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.AllField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analyzer = propAnalyzer.Value, - Enabled = propEnabled.Value, - OmitNorms = propOmitNorms.Value, - SearchAnalyzer = propSearchAnalyzer.Value, - Similarity = propSimilarity.Value, - Store = propStore.Value, - StoreTermVectorOffsets = propStoreTermVectorOffsets.Value, - StoreTermVectorPayloads = propStoreTermVectorPayloads.Value, - StoreTermVectorPositions = propStoreTermVectorPositions.Value, - StoreTermVectors = propStoreTermVectors.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.AllField value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropOmitNorms, value.OmitNorms, null, null); - writer.WriteProperty(options, PropSearchAnalyzer, value.SearchAnalyzer, null, null); - writer.WriteProperty(options, PropSimilarity, value.Similarity, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, null); - writer.WriteProperty(options, PropStoreTermVectorOffsets, value.StoreTermVectorOffsets, null, null); - writer.WriteProperty(options, PropStoreTermVectorPayloads, value.StoreTermVectorPayloads, null, null); - writer.WriteProperty(options, PropStoreTermVectorPositions, value.StoreTermVectorPositions, null, null); - writer.WriteProperty(options, PropStoreTermVectors, value.StoreTermVectors, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.AllFieldConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.AllFieldConverter))] public sealed partial class AllField { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BinaryProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BinaryProperty.Converters.g.cs new file mode 100644 index 00000000000..9e5f6fcebf0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BinaryProperty.Converters.g.cs @@ -0,0 +1,143 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class BinaryPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.BinaryProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propProperties = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.BinaryProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + Meta = propMeta.Value, + Properties = propProperties.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.BinaryProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BinaryProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BinaryProperty.g.cs index c8e83d3a3ce..802dd63c055 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BinaryProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BinaryProperty.g.cs @@ -23,126 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class BinaryPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.BinaryProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propProperties = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.BinaryProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - Meta = propMeta.Value, - Properties = propProperties.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.BinaryProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.BinaryPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.BinaryPropertyConverter))] public sealed partial class BinaryProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BooleanProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BooleanProperty.Converters.g.cs new file mode 100644 index 00000000000..72e1baecbb8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BooleanProperty.Converters.g.cs @@ -0,0 +1,215 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class BooleanPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFielddata = System.Text.Json.JsonEncodedText.Encode("fielddata"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); + private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.BooleanProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFielddata = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIgnoreMalformed = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propNullValue = default; + LocalJsonValue propOnScriptError = default; + LocalJsonValue propProperties = default; + LocalJsonValue propScript = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + LocalJsonValue propTimeSeriesDimension = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFielddata.TryReadProperty(ref reader, options, PropFielddata, null)) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.BooleanProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fielddata = propFielddata.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + IgnoreMalformed = propIgnoreMalformed.Value, + Index = propIndex.Value, + Meta = propMeta.Value, + NullValue = propNullValue.Value, + OnScriptError = propOnScriptError.Value, + Properties = propProperties.Value, + Script = propScript.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value, + TimeSeriesDimension = propTimeSeriesDimension.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.BooleanProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFielddata, value.Fielddata, null, null); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNullValue, value.NullValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BooleanProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BooleanProperty.g.cs index d658d5f1425..b62379b2862 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BooleanProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BooleanProperty.g.cs @@ -23,198 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class BooleanPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFielddata = System.Text.Json.JsonEncodedText.Encode("fielddata"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); - private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.BooleanProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFielddata = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIgnoreMalformed = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propNullValue = default; - LocalJsonValue propOnScriptError = default; - LocalJsonValue propProperties = default; - LocalJsonValue propScript = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - LocalJsonValue propTimeSeriesDimension = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFielddata.TryReadProperty(ref reader, options, PropFielddata, null)) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.BooleanProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fielddata = propFielddata.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - IgnoreMalformed = propIgnoreMalformed.Value, - Index = propIndex.Value, - Meta = propMeta.Value, - NullValue = propNullValue.Value, - OnScriptError = propOnScriptError.Value, - Properties = propProperties.Value, - Script = propScript.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value, - TimeSeriesDimension = propTimeSeriesDimension.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.BooleanProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFielddata, value.Fielddata, null, null); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNullValue, value.NullValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.BooleanPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.BooleanPropertyConverter))] public sealed partial class BooleanProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ByteNumberProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ByteNumberProperty.Converters.g.cs new file mode 100644 index 00000000000..91560f9de17 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ByteNumberProperty.Converters.g.cs @@ -0,0 +1,224 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class ByteNumberPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); + private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.ByteNumberProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propCoerce = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIgnoreMalformed = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propNullValue = default; + LocalJsonValue propOnScriptError = default; + LocalJsonValue propProperties = default; + LocalJsonValue propScript = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + LocalJsonValue propTimeSeriesDimension = default; + LocalJsonValue propTimeSeriesMetric = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, static byte? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.ByteNumberProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Coerce = propCoerce.Value, + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + IgnoreMalformed = propIgnoreMalformed.Value, + Index = propIndex.Value, + Meta = propMeta.Value, + NullValue = propNullValue.Value, + OnScriptError = propOnScriptError.Value, + Properties = propProperties.Value, + Script = propScript.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value, + TimeSeriesDimension = propTimeSeriesDimension.Value, + TimeSeriesMetric = propTimeSeriesMetric.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.ByteNumberProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNullValue, value.NullValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, byte? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ByteNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ByteNumberProperty.g.cs index c52cb587eac..2cf1ac84d1b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ByteNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ByteNumberProperty.g.cs @@ -23,207 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class ByteNumberPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); - private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.ByteNumberProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propCoerce = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIgnoreMalformed = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propNullValue = default; - LocalJsonValue propOnScriptError = default; - LocalJsonValue propProperties = default; - LocalJsonValue propScript = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - LocalJsonValue propTimeSeriesDimension = default; - LocalJsonValue propTimeSeriesMetric = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, static byte? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.ByteNumberProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Coerce = propCoerce.Value, - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - IgnoreMalformed = propIgnoreMalformed.Value, - Index = propIndex.Value, - Meta = propMeta.Value, - NullValue = propNullValue.Value, - OnScriptError = propOnScriptError.Value, - Properties = propProperties.Value, - Script = propScript.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value, - TimeSeriesDimension = propTimeSeriesDimension.Value, - TimeSeriesMetric = propTimeSeriesMetric.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.ByteNumberProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNullValue, value.NullValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, byte? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.ByteNumberPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.ByteNumberPropertyConverter))] public sealed partial class ByteNumberProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ChunkingSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ChunkingSettings.Converters.g.cs new file mode 100644 index 00000000000..1760c3ebb96 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ChunkingSettings.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class ChunkingSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxChunkSize = System.Text.Json.JsonEncodedText.Encode("max_chunk_size"); + private static readonly System.Text.Json.JsonEncodedText PropOverlap = System.Text.Json.JsonEncodedText.Encode("overlap"); + private static readonly System.Text.Json.JsonEncodedText PropSentenceOverlap = System.Text.Json.JsonEncodedText.Encode("sentence_overlap"); + private static readonly System.Text.Json.JsonEncodedText PropSeparatorGroup = System.Text.Json.JsonEncodedText.Encode("separator_group"); + private static readonly System.Text.Json.JsonEncodedText PropSeparators = System.Text.Json.JsonEncodedText.Encode("separators"); + private static readonly System.Text.Json.JsonEncodedText PropStrategy = System.Text.Json.JsonEncodedText.Encode("strategy"); + + public override Elastic.Clients.Elasticsearch.Mapping.ChunkingSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxChunkSize = default; + LocalJsonValue propOverlap = default; + LocalJsonValue propSentenceOverlap = default; + LocalJsonValue propSeparatorGroup = default; + LocalJsonValue> propSeparators = default; + LocalJsonValue propStrategy = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxChunkSize.TryReadProperty(ref reader, options, PropMaxChunkSize, null)) + { + continue; + } + + if (propOverlap.TryReadProperty(ref reader, options, PropOverlap, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSentenceOverlap.TryReadProperty(ref reader, options, PropSentenceOverlap, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSeparatorGroup.TryReadProperty(ref reader, options, PropSeparatorGroup, null)) + { + continue; + } + + if (propSeparators.TryReadProperty(ref reader, options, PropSeparators, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propStrategy.TryReadProperty(ref reader, options, PropStrategy, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.ChunkingSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxChunkSize = propMaxChunkSize.Value, + Overlap = propOverlap.Value, + SentenceOverlap = propSentenceOverlap.Value, + SeparatorGroup = propSeparatorGroup.Value, + Separators = propSeparators.Value, + Strategy = propStrategy.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.ChunkingSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxChunkSize, value.MaxChunkSize, null, null); + writer.WriteProperty(options, PropOverlap, value.Overlap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSentenceOverlap, value.SentenceOverlap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSeparatorGroup, value.SeparatorGroup, null, null); + writer.WriteProperty(options, PropSeparators, value.Separators, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStrategy, value.Strategy, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ChunkingSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ChunkingSettings.g.cs index 4c86f8c1328..46fa67cbd15 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ChunkingSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ChunkingSettings.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class ChunkingSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxChunkSize = System.Text.Json.JsonEncodedText.Encode("max_chunk_size"); - private static readonly System.Text.Json.JsonEncodedText PropOverlap = System.Text.Json.JsonEncodedText.Encode("overlap"); - private static readonly System.Text.Json.JsonEncodedText PropSentenceOverlap = System.Text.Json.JsonEncodedText.Encode("sentence_overlap"); - private static readonly System.Text.Json.JsonEncodedText PropSeparatorGroup = System.Text.Json.JsonEncodedText.Encode("separator_group"); - private static readonly System.Text.Json.JsonEncodedText PropSeparators = System.Text.Json.JsonEncodedText.Encode("separators"); - private static readonly System.Text.Json.JsonEncodedText PropStrategy = System.Text.Json.JsonEncodedText.Encode("strategy"); - - public override Elastic.Clients.Elasticsearch.Mapping.ChunkingSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxChunkSize = default; - LocalJsonValue propOverlap = default; - LocalJsonValue propSentenceOverlap = default; - LocalJsonValue propSeparatorGroup = default; - LocalJsonValue> propSeparators = default; - LocalJsonValue propStrategy = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxChunkSize.TryReadProperty(ref reader, options, PropMaxChunkSize, null)) - { - continue; - } - - if (propOverlap.TryReadProperty(ref reader, options, PropOverlap, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSentenceOverlap.TryReadProperty(ref reader, options, PropSentenceOverlap, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSeparatorGroup.TryReadProperty(ref reader, options, PropSeparatorGroup, null)) - { - continue; - } - - if (propSeparators.TryReadProperty(ref reader, options, PropSeparators, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propStrategy.TryReadProperty(ref reader, options, PropStrategy, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.ChunkingSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxChunkSize = propMaxChunkSize.Value, - Overlap = propOverlap.Value, - SentenceOverlap = propSentenceOverlap.Value, - SeparatorGroup = propSeparatorGroup.Value, - Separators = propSeparators.Value, - Strategy = propStrategy.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.ChunkingSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxChunkSize, value.MaxChunkSize, null, null); - writer.WriteProperty(options, PropOverlap, value.Overlap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSentenceOverlap, value.SentenceOverlap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSeparatorGroup, value.SeparatorGroup, null, null); - writer.WriteProperty(options, PropSeparators, value.Separators, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStrategy, value.Strategy, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.ChunkingSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.ChunkingSettingsConverter))] public sealed partial class ChunkingSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CompletionProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CompletionProperty.Converters.g.cs new file mode 100644 index 00000000000..b2e8d001145 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CompletionProperty.Converters.g.cs @@ -0,0 +1,197 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class CompletionPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropContexts = System.Text.Json.JsonEncodedText.Encode("contexts"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropMaxInputLength = System.Text.Json.JsonEncodedText.Encode("max_input_length"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropPreservePositionIncrements = System.Text.Json.JsonEncodedText.Encode("preserve_position_increments"); + private static readonly System.Text.Json.JsonEncodedText PropPreserveSeparators = System.Text.Json.JsonEncodedText.Encode("preserve_separators"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropSearchAnalyzer = System.Text.Json.JsonEncodedText.Encode("search_analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.CompletionProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzer = default; + LocalJsonValue?> propContexts = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propMaxInputLength = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propPreservePositionIncrements = default; + LocalJsonValue propPreserveSeparators = default; + LocalJsonValue propProperties = default; + LocalJsonValue propSearchAnalyzer = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) + { + continue; + } + + if (propContexts.TryReadProperty(ref reader, options, PropContexts, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxInputLength.TryReadProperty(ref reader, options, PropMaxInputLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propPreservePositionIncrements.TryReadProperty(ref reader, options, PropPreservePositionIncrements, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPreserveSeparators.TryReadProperty(ref reader, options, PropPreserveSeparators, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propSearchAnalyzer.TryReadProperty(ref reader, options, PropSearchAnalyzer, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.CompletionProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analyzer = propAnalyzer.Value, + Contexts = propContexts.Value, + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + MaxInputLength = propMaxInputLength.Value, + Meta = propMeta.Value, + PreservePositionIncrements = propPreservePositionIncrements.Value, + PreserveSeparators = propPreserveSeparators.Value, + Properties = propProperties.Value, + SearchAnalyzer = propSearchAnalyzer.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.CompletionProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); + writer.WriteProperty(options, PropContexts, value.Contexts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxInputLength, value.MaxInputLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropPreservePositionIncrements, value.PreservePositionIncrements, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPreserveSeparators, value.PreserveSeparators, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropSearchAnalyzer, value.SearchAnalyzer, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CompletionProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CompletionProperty.g.cs index e5a684fe19d..e2971467ea1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CompletionProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CompletionProperty.g.cs @@ -23,180 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class CompletionPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropContexts = System.Text.Json.JsonEncodedText.Encode("contexts"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropMaxInputLength = System.Text.Json.JsonEncodedText.Encode("max_input_length"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropPreservePositionIncrements = System.Text.Json.JsonEncodedText.Encode("preserve_position_increments"); - private static readonly System.Text.Json.JsonEncodedText PropPreserveSeparators = System.Text.Json.JsonEncodedText.Encode("preserve_separators"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropSearchAnalyzer = System.Text.Json.JsonEncodedText.Encode("search_analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.CompletionProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyzer = default; - LocalJsonValue?> propContexts = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propMaxInputLength = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propPreservePositionIncrements = default; - LocalJsonValue propPreserveSeparators = default; - LocalJsonValue propProperties = default; - LocalJsonValue propSearchAnalyzer = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) - { - continue; - } - - if (propContexts.TryReadProperty(ref reader, options, PropContexts, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxInputLength.TryReadProperty(ref reader, options, PropMaxInputLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propPreservePositionIncrements.TryReadProperty(ref reader, options, PropPreservePositionIncrements, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPreserveSeparators.TryReadProperty(ref reader, options, PropPreserveSeparators, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propSearchAnalyzer.TryReadProperty(ref reader, options, PropSearchAnalyzer, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.CompletionProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analyzer = propAnalyzer.Value, - Contexts = propContexts.Value, - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - MaxInputLength = propMaxInputLength.Value, - Meta = propMeta.Value, - PreservePositionIncrements = propPreservePositionIncrements.Value, - PreserveSeparators = propPreserveSeparators.Value, - Properties = propProperties.Value, - SearchAnalyzer = propSearchAnalyzer.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.CompletionProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); - writer.WriteProperty(options, PropContexts, value.Contexts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxInputLength, value.MaxInputLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropPreservePositionIncrements, value.PreservePositionIncrements, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPreserveSeparators, value.PreserveSeparators, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropSearchAnalyzer, value.SearchAnalyzer, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.CompletionPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.CompletionPropertyConverter))] public sealed partial class CompletionProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CompositeSubField.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CompositeSubField.Converters.g.cs new file mode 100644 index 00000000000..aa3bdcdce2f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CompositeSubField.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class CompositeSubFieldConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.CompositeSubField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.CompositeSubField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.CompositeSubField value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CompositeSubField.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CompositeSubField.g.cs index 19cbccf5278..70fb97411b2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CompositeSubField.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CompositeSubField.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class CompositeSubFieldConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.CompositeSubField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.CompositeSubField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.CompositeSubField value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.CompositeSubFieldConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.CompositeSubFieldConverter))] public sealed partial class CompositeSubField { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ConstantKeywordProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ConstantKeywordProperty.Converters.g.cs new file mode 100644 index 00000000000..ae5133027cc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ConstantKeywordProperty.Converters.g.cs @@ -0,0 +1,125 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class ConstantKeywordPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + + public override Elastic.Clients.Elasticsearch.Mapping.ConstantKeywordProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propProperties = default; + LocalJsonValue propSyntheticSourceKeep = default; + LocalJsonValue propValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.ConstantKeywordProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + Meta = propMeta.Value, + Properties = propProperties.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value, + Value = propValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.ConstantKeywordProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ConstantKeywordProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ConstantKeywordProperty.g.cs index e8411f60c49..861f5bfaaca 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ConstantKeywordProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ConstantKeywordProperty.g.cs @@ -23,108 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class ConstantKeywordPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - - public override Elastic.Clients.Elasticsearch.Mapping.ConstantKeywordProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propProperties = default; - LocalJsonValue propSyntheticSourceKeep = default; - LocalJsonValue propValue = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.ConstantKeywordProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - Meta = propMeta.Value, - Properties = propProperties.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value, - Value = propValue.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.ConstantKeywordProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.ConstantKeywordPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.ConstantKeywordPropertyConverter))] public sealed partial class ConstantKeywordProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CountedKeywordProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CountedKeywordProperty.Converters.g.cs new file mode 100644 index 00000000000..fa2479ed02d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CountedKeywordProperty.Converters.g.cs @@ -0,0 +1,125 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class CountedKeywordPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.CountedKeywordProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propProperties = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.CountedKeywordProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + Index = propIndex.Value, + Meta = propMeta.Value, + Properties = propProperties.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.CountedKeywordProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CountedKeywordProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CountedKeywordProperty.g.cs index 3f6bb929cbc..6d2b9590f3c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CountedKeywordProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CountedKeywordProperty.g.cs @@ -23,108 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class CountedKeywordPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.CountedKeywordProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propProperties = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.CountedKeywordProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - Index = propIndex.Value, - Meta = propMeta.Value, - Properties = propProperties.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.CountedKeywordProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.CountedKeywordPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.CountedKeywordPropertyConverter))] public sealed partial class CountedKeywordProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DataStreamTimestamp.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DataStreamTimestamp.Converters.g.cs new file mode 100644 index 00000000000..ed392435618 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DataStreamTimestamp.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class DataStreamTimestampConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + + public override Elastic.Clients.Elasticsearch.Mapping.DataStreamTimestamp Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEnabled = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.DataStreamTimestamp(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Enabled = propEnabled.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DataStreamTimestamp value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DataStreamTimestamp.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DataStreamTimestamp.g.cs index dade8ef8acc..ed228343640 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DataStreamTimestamp.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DataStreamTimestamp.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class DataStreamTimestampConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - - public override Elastic.Clients.Elasticsearch.Mapping.DataStreamTimestamp Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEnabled = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.DataStreamTimestamp(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Enabled = propEnabled.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DataStreamTimestamp value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.DataStreamTimestampConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.DataStreamTimestampConverter))] public sealed partial class DataStreamTimestamp { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateNanosProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateNanosProperty.Converters.g.cs new file mode 100644 index 00000000000..c5944c5615d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateNanosProperty.Converters.g.cs @@ -0,0 +1,215 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class DateNanosPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); + private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); + private static readonly System.Text.Json.JsonEncodedText PropPrecisionStep = System.Text.Json.JsonEncodedText.Encode("precision_step"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.DateNanosProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propFormat = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIgnoreMalformed = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propNullValue = default; + LocalJsonValue propOnScriptError = default; + LocalJsonValue propPrecisionStep = default; + LocalJsonValue propProperties = default; + LocalJsonValue propScript = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPrecisionStep.TryReadProperty(ref reader, options, PropPrecisionStep, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.DateNanosProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + Format = propFormat.Value, + IgnoreAbove = propIgnoreAbove.Value, + IgnoreMalformed = propIgnoreMalformed.Value, + Index = propIndex.Value, + Meta = propMeta.Value, + NullValue = propNullValue.Value, + OnScriptError = propOnScriptError.Value, + PrecisionStep = propPrecisionStep.Value, + Properties = propProperties.Value, + Script = propScript.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DateNanosProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNullValue, value.NullValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPrecisionStep, value.PrecisionStep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateNanosProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateNanosProperty.g.cs index 8308bbaf535..37bebfb2ea9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateNanosProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateNanosProperty.g.cs @@ -23,198 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class DateNanosPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); - private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); - private static readonly System.Text.Json.JsonEncodedText PropPrecisionStep = System.Text.Json.JsonEncodedText.Encode("precision_step"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.DateNanosProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propFormat = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIgnoreMalformed = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propNullValue = default; - LocalJsonValue propOnScriptError = default; - LocalJsonValue propPrecisionStep = default; - LocalJsonValue propProperties = default; - LocalJsonValue propScript = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPrecisionStep.TryReadProperty(ref reader, options, PropPrecisionStep, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.DateNanosProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - Format = propFormat.Value, - IgnoreAbove = propIgnoreAbove.Value, - IgnoreMalformed = propIgnoreMalformed.Value, - Index = propIndex.Value, - Meta = propMeta.Value, - NullValue = propNullValue.Value, - OnScriptError = propOnScriptError.Value, - PrecisionStep = propPrecisionStep.Value, - Properties = propProperties.Value, - Script = propScript.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DateNanosProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNullValue, value.NullValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPrecisionStep, value.PrecisionStep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.DateNanosPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.DateNanosPropertyConverter))] public sealed partial class DateNanosProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateProperty.Converters.g.cs new file mode 100644 index 00000000000..e1fb6cef438 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateProperty.Converters.g.cs @@ -0,0 +1,233 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class DatePropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFielddata = System.Text.Json.JsonEncodedText.Encode("fielddata"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropLocale = System.Text.Json.JsonEncodedText.Encode("locale"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); + private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); + private static readonly System.Text.Json.JsonEncodedText PropPrecisionStep = System.Text.Json.JsonEncodedText.Encode("precision_step"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.DateProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFielddata = default; + LocalJsonValue propFields = default; + LocalJsonValue propFormat = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIgnoreMalformed = default; + LocalJsonValue propIndex = default; + LocalJsonValue propLocale = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propNullValue = default; + LocalJsonValue propOnScriptError = default; + LocalJsonValue propPrecisionStep = default; + LocalJsonValue propProperties = default; + LocalJsonValue propScript = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFielddata.TryReadProperty(ref reader, options, PropFielddata, null)) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLocale.TryReadProperty(ref reader, options, PropLocale, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPrecisionStep.TryReadProperty(ref reader, options, PropPrecisionStep, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.DateProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fielddata = propFielddata.Value, + Fields = propFields.Value, + Format = propFormat.Value, + IgnoreAbove = propIgnoreAbove.Value, + IgnoreMalformed = propIgnoreMalformed.Value, + Index = propIndex.Value, + Locale = propLocale.Value, + Meta = propMeta.Value, + NullValue = propNullValue.Value, + OnScriptError = propOnScriptError.Value, + PrecisionStep = propPrecisionStep.Value, + Properties = propProperties.Value, + Script = propScript.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DateProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFielddata, value.Fielddata, null, null); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLocale, value.Locale, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNullValue, value.NullValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPrecisionStep, value.PrecisionStep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateProperty.g.cs index 4db4d7c1fa3..ace56d9eb6c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateProperty.g.cs @@ -23,216 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class DatePropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFielddata = System.Text.Json.JsonEncodedText.Encode("fielddata"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropLocale = System.Text.Json.JsonEncodedText.Encode("locale"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); - private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); - private static readonly System.Text.Json.JsonEncodedText PropPrecisionStep = System.Text.Json.JsonEncodedText.Encode("precision_step"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.DateProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFielddata = default; - LocalJsonValue propFields = default; - LocalJsonValue propFormat = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIgnoreMalformed = default; - LocalJsonValue propIndex = default; - LocalJsonValue propLocale = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propNullValue = default; - LocalJsonValue propOnScriptError = default; - LocalJsonValue propPrecisionStep = default; - LocalJsonValue propProperties = default; - LocalJsonValue propScript = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFielddata.TryReadProperty(ref reader, options, PropFielddata, null)) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLocale.TryReadProperty(ref reader, options, PropLocale, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPrecisionStep.TryReadProperty(ref reader, options, PropPrecisionStep, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.DateProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fielddata = propFielddata.Value, - Fields = propFields.Value, - Format = propFormat.Value, - IgnoreAbove = propIgnoreAbove.Value, - IgnoreMalformed = propIgnoreMalformed.Value, - Index = propIndex.Value, - Locale = propLocale.Value, - Meta = propMeta.Value, - NullValue = propNullValue.Value, - OnScriptError = propOnScriptError.Value, - PrecisionStep = propPrecisionStep.Value, - Properties = propProperties.Value, - Script = propScript.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DateProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFielddata, value.Fielddata, null, null); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLocale, value.Locale, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNullValue, value.NullValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPrecisionStep, value.PrecisionStep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.DatePropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.DatePropertyConverter))] public sealed partial class DateProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateRangeProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateRangeProperty.Converters.g.cs new file mode 100644 index 00000000000..90692dcc8df --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateRangeProperty.Converters.g.cs @@ -0,0 +1,179 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class DateRangePropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.DateRangeProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propCoerce = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propFormat = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propProperties = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.DateRangeProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Coerce = propCoerce.Value, + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + Format = propFormat.Value, + IgnoreAbove = propIgnoreAbove.Value, + Index = propIndex.Value, + Meta = propMeta.Value, + Properties = propProperties.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DateRangeProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateRangeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateRangeProperty.g.cs index 721ef629a94..c79807a859b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateRangeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateRangeProperty.g.cs @@ -23,162 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class DateRangePropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.DateRangeProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propCoerce = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propFormat = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propProperties = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.DateRangeProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Coerce = propCoerce.Value, - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - Format = propFormat.Value, - IgnoreAbove = propIgnoreAbove.Value, - Index = propIndex.Value, - Meta = propMeta.Value, - Properties = propProperties.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DateRangeProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.DateRangePropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.DateRangePropertyConverter))] public sealed partial class DateRangeProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorElementType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorElementType.Converters.g.cs new file mode 100644 index 00000000000..7f6ea5c7877 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorElementType.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class DenseVectorElementTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberBit = System.Text.Json.JsonEncodedText.Encode("bit"); + private static readonly System.Text.Json.JsonEncodedText MemberByte = System.Text.Json.JsonEncodedText.Encode("byte"); + private static readonly System.Text.Json.JsonEncodedText MemberFloat = System.Text.Json.JsonEncodedText.Encode("float"); + + public override Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberBit)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType.Bit; + } + + if (reader.ValueTextEquals(MemberByte)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType.Byte; + } + + if (reader.ValueTextEquals(MemberFloat)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType.Float; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberBit.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType.Bit; + } + + if (string.Equals(value, MemberByte.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType.Byte; + } + + if (string.Equals(value, MemberFloat.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType.Float; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType.Bit: + writer.WriteStringValue(MemberBit); + break; + case Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType.Byte: + writer.WriteStringValue(MemberByte); + break; + case Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType.Float: + writer.WriteStringValue(MemberFloat); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorElementType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorElementType.g.cs new file mode 100644 index 00000000000..bb1e2c7beef --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorElementType.g.cs @@ -0,0 +1,54 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.DenseVectorElementTypeConverter))] +public enum DenseVectorElementType +{ + /// + /// + /// Indexes a single bit per dimension. Useful for very high-dimensional vectors or models that specifically support + /// bit vectors. + /// + /// + /// NOTE: when using bit, the number of dimensions must be a multiple of 8 and must represent the number of bits. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "bit")] + Bit, + /// + /// + /// Indexes a 1-byte integer value per dimension. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "byte")] + Byte, + /// + /// + /// Indexes a 4-byte floating-point value per dimension. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "float")] + Float +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.Converters.g.cs new file mode 100644 index 00000000000..392d1926ad7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class DenseVectorIndexOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropConfidenceInterval = System.Text.Json.JsonEncodedText.Encode("confidence_interval"); + private static readonly System.Text.Json.JsonEncodedText PropEfConstruction = System.Text.Json.JsonEncodedText.Encode("ef_construction"); + private static readonly System.Text.Json.JsonEncodedText PropM = System.Text.Json.JsonEncodedText.Encode("m"); + private static readonly System.Text.Json.JsonEncodedText PropRescoreVector = System.Text.Json.JsonEncodedText.Encode("rescore_vector"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propConfidenceInterval = default; + LocalJsonValue propEfConstruction = default; + LocalJsonValue propM = default; + LocalJsonValue propRescoreVector = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propConfidenceInterval.TryReadProperty(ref reader, options, PropConfidenceInterval, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEfConstruction.TryReadProperty(ref reader, options, PropEfConstruction, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propM.TryReadProperty(ref reader, options, PropM, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRescoreVector.TryReadProperty(ref reader, options, PropRescoreVector, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ConfidenceInterval = propConfidenceInterval.Value, + EfConstruction = propEfConstruction.Value, + M = propM.Value, + RescoreVector = propRescoreVector.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropConfidenceInterval, value.ConfidenceInterval, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEfConstruction, value.EfConstruction, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropM, value.M, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRescoreVector, value.RescoreVector, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs index 209bdfc348d..58ac8f8e2c0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class DenseVectorIndexOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropConfidenceInterval = System.Text.Json.JsonEncodedText.Encode("confidence_interval"); - private static readonly System.Text.Json.JsonEncodedText PropEfConstruction = System.Text.Json.JsonEncodedText.Encode("ef_construction"); - private static readonly System.Text.Json.JsonEncodedText PropM = System.Text.Json.JsonEncodedText.Encode("m"); - private static readonly System.Text.Json.JsonEncodedText PropRescoreVector = System.Text.Json.JsonEncodedText.Encode("rescore_vector"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propConfidenceInterval = default; - LocalJsonValue propEfConstruction = default; - LocalJsonValue propM = default; - LocalJsonValue propRescoreVector = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propConfidenceInterval.TryReadProperty(ref reader, options, PropConfidenceInterval, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEfConstruction.TryReadProperty(ref reader, options, PropEfConstruction, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propM.TryReadProperty(ref reader, options, PropM, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRescoreVector.TryReadProperty(ref reader, options, PropRescoreVector, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ConfidenceInterval = propConfidenceInterval.Value, - EfConstruction = propEfConstruction.Value, - M = propM.Value, - RescoreVector = propRescoreVector.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropConfidenceInterval, value.ConfidenceInterval, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEfConstruction, value.EfConstruction, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropM, value.M, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRescoreVector, value.RescoreVector, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.DenseVectorIndexOptionsConverter))] public sealed partial class DenseVectorIndexOptions { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptionsRescoreVector.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptionsRescoreVector.Converters.g.cs new file mode 100644 index 00000000000..92f12bca703 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptionsRescoreVector.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class DenseVectorIndexOptionsRescoreVectorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropOversample = System.Text.Json.JsonEncodedText.Encode("oversample"); + + public override Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsRescoreVector Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propOversample = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propOversample.TryReadProperty(ref reader, options, PropOversample, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsRescoreVector(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Oversample = propOversample.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsRescoreVector value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropOversample, value.Oversample, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptionsRescoreVector.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptionsRescoreVector.g.cs index e890f1f386e..a099fc4f2c1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptionsRescoreVector.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptionsRescoreVector.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class DenseVectorIndexOptionsRescoreVectorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropOversample = System.Text.Json.JsonEncodedText.Encode("oversample"); - - public override Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsRescoreVector Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propOversample = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propOversample.TryReadProperty(ref reader, options, PropOversample, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsRescoreVector(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Oversample = propOversample.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsRescoreVector value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropOversample, value.Oversample, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsRescoreVectorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.DenseVectorIndexOptionsRescoreVectorConverter))] public sealed partial class DenseVectorIndexOptionsRescoreVector { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptionsType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptionsType.Converters.g.cs new file mode 100644 index 00000000000..70763f2ea20 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptionsType.Converters.g.cs @@ -0,0 +1,165 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class DenseVectorIndexOptionsTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberBbqFlat = System.Text.Json.JsonEncodedText.Encode("bbq_flat"); + private static readonly System.Text.Json.JsonEncodedText MemberBbqHnsw = System.Text.Json.JsonEncodedText.Encode("bbq_hnsw"); + private static readonly System.Text.Json.JsonEncodedText MemberFlat = System.Text.Json.JsonEncodedText.Encode("flat"); + private static readonly System.Text.Json.JsonEncodedText MemberHnsw = System.Text.Json.JsonEncodedText.Encode("hnsw"); + private static readonly System.Text.Json.JsonEncodedText MemberInt4Flat = System.Text.Json.JsonEncodedText.Encode("int4_flat"); + private static readonly System.Text.Json.JsonEncodedText MemberInt4Hnsw = System.Text.Json.JsonEncodedText.Encode("int4_hnsw"); + private static readonly System.Text.Json.JsonEncodedText MemberInt8Flat = System.Text.Json.JsonEncodedText.Encode("int8_flat"); + private static readonly System.Text.Json.JsonEncodedText MemberInt8Hnsw = System.Text.Json.JsonEncodedText.Encode("int8_hnsw"); + + public override Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberBbqFlat)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.BbqFlat; + } + + if (reader.ValueTextEquals(MemberBbqHnsw)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.BbqHnsw; + } + + if (reader.ValueTextEquals(MemberFlat)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Flat; + } + + if (reader.ValueTextEquals(MemberHnsw)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Hnsw; + } + + if (reader.ValueTextEquals(MemberInt4Flat)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Int4Flat; + } + + if (reader.ValueTextEquals(MemberInt4Hnsw)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Int4Hnsw; + } + + if (reader.ValueTextEquals(MemberInt8Flat)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Int8Flat; + } + + if (reader.ValueTextEquals(MemberInt8Hnsw)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Int8Hnsw; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberBbqFlat.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.BbqFlat; + } + + if (string.Equals(value, MemberBbqHnsw.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.BbqHnsw; + } + + if (string.Equals(value, MemberFlat.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Flat; + } + + if (string.Equals(value, MemberHnsw.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Hnsw; + } + + if (string.Equals(value, MemberInt4Flat.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Int4Flat; + } + + if (string.Equals(value, MemberInt4Hnsw.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Int4Hnsw; + } + + if (string.Equals(value, MemberInt8Flat.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Int8Flat; + } + + if (string.Equals(value, MemberInt8Hnsw.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Int8Hnsw; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.BbqFlat: + writer.WriteStringValue(MemberBbqFlat); + break; + case Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.BbqHnsw: + writer.WriteStringValue(MemberBbqHnsw); + break; + case Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Flat: + writer.WriteStringValue(MemberFlat); + break; + case Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Hnsw: + writer.WriteStringValue(MemberHnsw); + break; + case Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Int4Flat: + writer.WriteStringValue(MemberInt4Flat); + break; + case Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Int4Hnsw: + writer.WriteStringValue(MemberInt4Hnsw); + break; + case Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Int8Flat: + writer.WriteStringValue(MemberInt8Flat); + break; + case Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.Int8Hnsw: + writer.WriteStringValue(MemberInt8Hnsw); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptionsType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptionsType.g.cs new file mode 100644 index 00000000000..682f6daa44c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptionsType.g.cs @@ -0,0 +1,100 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.DenseVectorIndexOptionsTypeConverter))] +public enum DenseVectorIndexOptionsType +{ + /// + /// + /// This utilizes a brute-force search algorithm in addition to automatically quantizing to binary vectors. + /// Only supports element_type of float. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "bbq_flat")] + BbqFlat, + /// + /// + /// This utilizes the HNSW algorithm in addition to automatic binary quantization for scalable approximate kNN + /// search with element_type of float. + /// + /// + /// This can reduce the memory footprint by nearly 32x at the cost of some accuracy. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "bbq_hnsw")] + BbqHnsw, + /// + /// + /// This utilizes a brute-force search algorithm for exact kNN search. This supports all element_type values. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "flat")] + Flat, + /// + /// + /// This utilizes the HNSW algorithm for scalable approximate kNN search. This supports all element_type values. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "hnsw")] + Hnsw, + /// + /// + /// This utilizes a brute-force search algorithm in addition to automatically half-byte scalar quantization. + /// Only supports element_type of float. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "int4_flat")] + Int4Flat, + /// + /// + /// This utilizes the HNSW algorithm in addition to automatically scalar quantization for scalable approximate kNN + /// search with element_type of float. + /// + /// + /// This can reduce the memory footprint by 8x at the cost of some accuracy. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "int4_hnsw")] + Int4Hnsw, + /// + /// + /// This utilizes a brute-force search algorithm in addition to automatically scalar quantization. Only supports + /// element_type of float. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "int8_flat")] + Int8Flat, + /// + /// + /// The default index type for float vectors. This utilizes the HNSW algorithm in addition to automatically scalar + /// quantization for scalable approximate kNN search with element_type of float. + /// + /// + /// This can reduce the memory footprint by 4x at the cost of some accuracy. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "int8_hnsw")] + Int8Hnsw +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorProperty.Converters.g.cs new file mode 100644 index 00000000000..4ff311adc3f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorProperty.Converters.g.cs @@ -0,0 +1,161 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class DenseVectorPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDims = System.Text.Json.JsonEncodedText.Encode("dims"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropElementType = System.Text.Json.JsonEncodedText.Encode("element_type"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropIndexOptions = System.Text.Json.JsonEncodedText.Encode("index_options"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.DenseVectorProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDims = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propElementType = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIndex = default; + LocalJsonValue propIndexOptions = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propProperties = default; + LocalJsonValue propSimilarity = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDims.TryReadProperty(ref reader, options, PropDims, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propElementType.TryReadProperty(ref reader, options, PropElementType, static Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndexOptions.TryReadProperty(ref reader, options, PropIndexOptions, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, static Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.DenseVectorProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Dims = propDims.Value, + Dynamic = propDynamic.Value, + ElementType = propElementType.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + Index = propIndex.Value, + IndexOptions = propIndexOptions.Value, + Meta = propMeta.Value, + Properties = propProperties.Value, + Similarity = propSimilarity.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DenseVectorProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDims, value.Dims, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropElementType, value.ElementType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndexOptions, value.IndexOptions, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropSimilarity, value.Similarity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorProperty.g.cs index 95bdd0b7c8d..bdf2d13a16e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorProperty.g.cs @@ -23,144 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class DenseVectorPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDims = System.Text.Json.JsonEncodedText.Encode("dims"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropElementType = System.Text.Json.JsonEncodedText.Encode("element_type"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropIndexOptions = System.Text.Json.JsonEncodedText.Encode("index_options"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.DenseVectorProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDims = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propElementType = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIndex = default; - LocalJsonValue propIndexOptions = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propProperties = default; - LocalJsonValue propSimilarity = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDims.TryReadProperty(ref reader, options, PropDims, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propElementType.TryReadProperty(ref reader, options, PropElementType, static Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndexOptions.TryReadProperty(ref reader, options, PropIndexOptions, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, static Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.DenseVectorProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Dims = propDims.Value, - Dynamic = propDynamic.Value, - ElementType = propElementType.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - Index = propIndex.Value, - IndexOptions = propIndexOptions.Value, - Meta = propMeta.Value, - Properties = propProperties.Value, - Similarity = propSimilarity.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DenseVectorProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDims, value.Dims, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropElementType, value.ElementType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DenseVectorElementType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndexOptions, value.IndexOptions, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropSimilarity, value.Similarity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.DenseVectorPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.DenseVectorPropertyConverter))] public sealed partial class DenseVectorProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorSimilarity.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorSimilarity.Converters.g.cs new file mode 100644 index 00000000000..69c95385878 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorSimilarity.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class DenseVectorSimilarityConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCosine = System.Text.Json.JsonEncodedText.Encode("cosine"); + private static readonly System.Text.Json.JsonEncodedText MemberDotProduct = System.Text.Json.JsonEncodedText.Encode("dot_product"); + private static readonly System.Text.Json.JsonEncodedText MemberL2Norm = System.Text.Json.JsonEncodedText.Encode("l2_norm"); + private static readonly System.Text.Json.JsonEncodedText MemberMaxInnerProduct = System.Text.Json.JsonEncodedText.Encode("max_inner_product"); + + public override Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCosine)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity.Cosine; + } + + if (reader.ValueTextEquals(MemberDotProduct)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity.DotProduct; + } + + if (reader.ValueTextEquals(MemberL2Norm)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity.L2Norm; + } + + if (reader.ValueTextEquals(MemberMaxInnerProduct)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity.MaxInnerProduct; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCosine.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity.Cosine; + } + + if (string.Equals(value, MemberDotProduct.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity.DotProduct; + } + + if (string.Equals(value, MemberL2Norm.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity.L2Norm; + } + + if (string.Equals(value, MemberMaxInnerProduct.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity.MaxInnerProduct; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity.Cosine: + writer.WriteStringValue(MemberCosine); + break; + case Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity.DotProduct: + writer.WriteStringValue(MemberDotProduct); + break; + case Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity.L2Norm: + writer.WriteStringValue(MemberL2Norm); + break; + case Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity.MaxInnerProduct: + writer.WriteStringValue(MemberMaxInnerProduct); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DenseVectorSimilarity value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorSimilarity.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorSimilarity.g.cs new file mode 100644 index 00000000000..8664debea17 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorSimilarity.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.DenseVectorSimilarityConverter))] +public enum DenseVectorSimilarity +{ + /// + /// + /// Computes the cosine similarity. During indexing Elasticsearch automatically normalizes vectors with cosine + /// similarity to unit length. This allows to internally use dot_product for computing similarity, which is more + /// efficient. Original un-normalized vectors can be still accessed through scripts. + /// + /// + /// The document _score is computed as (1 + cosine(query, vector)) / 2. + /// + /// + /// The cosine similarity does not allow vectors with zero magnitude, since cosine is not defined in this case. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "cosine")] + Cosine, + /// + /// + /// Computes the dot product of two unit vectors. This option provides an optimized way to perform cosine similarity. + /// The constraints and computed score are defined by element_type. + /// + /// + /// When element_type is float, all vectors must be unit length, including both document and query vectors. + /// + /// + /// The document _score is computed as (1 + dot_product(query, vector)) / 2. + /// + /// + /// When element_type is byte, all vectors must have the same length including both document and query vectors or + /// results will be inaccurate. + /// + /// + /// The document _score is computed as 0.5 + (dot_product(query, vector) / (32768 * dims)) where dims is the + /// number of dimensions per vector. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "dot_product")] + DotProduct, + /// + /// + /// Computes similarity based on the L2 distance (also known as Euclidean distance) between the vectors. + /// + /// + /// The document _score is computed as 1 / (1 + l2_norm(query, vector)^2). + /// + /// + /// For bit vectors, instead of using l2_norm, the hamming distance between the vectors is used. + /// + /// + /// The _score transformation is (numBits - hamming(a, b)) / numBits. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "l2_norm")] + L2Norm, + /// + /// + /// Computes the maximum inner product of two vectors. This is similar to dot_product, but doesn't require vectors + /// to be normalized. This means that each vector’s magnitude can significantly effect the score. + /// + /// + /// The document _score is adjusted to prevent negative values. For max_inner_product values < 0, the _score + /// is 1 / (1 + -1 * max_inner_product(query, vector)). For non-negative max_inner_product results the _score + /// is calculated max_inner_product(query, vector) + 1. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "max_inner_product")] + MaxInnerProduct +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleNumberProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleNumberProperty.Converters.g.cs new file mode 100644 index 00000000000..b941ebf08e5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleNumberProperty.Converters.g.cs @@ -0,0 +1,224 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class DoubleNumberPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); + private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.DoubleNumberProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propCoerce = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIgnoreMalformed = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propNullValue = default; + LocalJsonValue propOnScriptError = default; + LocalJsonValue propProperties = default; + LocalJsonValue propScript = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + LocalJsonValue propTimeSeriesDimension = default; + LocalJsonValue propTimeSeriesMetric = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.DoubleNumberProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Coerce = propCoerce.Value, + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + IgnoreMalformed = propIgnoreMalformed.Value, + Index = propIndex.Value, + Meta = propMeta.Value, + NullValue = propNullValue.Value, + OnScriptError = propOnScriptError.Value, + Properties = propProperties.Value, + Script = propScript.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value, + TimeSeriesDimension = propTimeSeriesDimension.Value, + TimeSeriesMetric = propTimeSeriesMetric.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DoubleNumberProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNullValue, value.NullValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleNumberProperty.g.cs index cbbf2324a73..c876fc9f5eb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleNumberProperty.g.cs @@ -23,207 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class DoubleNumberPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); - private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.DoubleNumberProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propCoerce = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIgnoreMalformed = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propNullValue = default; - LocalJsonValue propOnScriptError = default; - LocalJsonValue propProperties = default; - LocalJsonValue propScript = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - LocalJsonValue propTimeSeriesDimension = default; - LocalJsonValue propTimeSeriesMetric = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.DoubleNumberProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Coerce = propCoerce.Value, - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - IgnoreMalformed = propIgnoreMalformed.Value, - Index = propIndex.Value, - Meta = propMeta.Value, - NullValue = propNullValue.Value, - OnScriptError = propOnScriptError.Value, - Properties = propProperties.Value, - Script = propScript.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value, - TimeSeriesDimension = propTimeSeriesDimension.Value, - TimeSeriesMetric = propTimeSeriesMetric.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DoubleNumberProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNullValue, value.NullValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.DoubleNumberPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.DoubleNumberPropertyConverter))] public sealed partial class DoubleNumberProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleRangeProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleRangeProperty.Converters.g.cs new file mode 100644 index 00000000000..a8449aaf395 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleRangeProperty.Converters.g.cs @@ -0,0 +1,170 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class DoubleRangePropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.DoubleRangeProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propCoerce = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propProperties = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.DoubleRangeProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Coerce = propCoerce.Value, + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + Index = propIndex.Value, + Meta = propMeta.Value, + Properties = propProperties.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DoubleRangeProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleRangeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleRangeProperty.g.cs index 46aef4c0cf7..08981225356 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleRangeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleRangeProperty.g.cs @@ -23,153 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class DoubleRangePropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.DoubleRangeProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propCoerce = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propProperties = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.DoubleRangeProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Coerce = propCoerce.Value, - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - Index = propIndex.Value, - Meta = propMeta.Value, - Properties = propProperties.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DoubleRangeProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.DoubleRangePropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.DoubleRangePropertyConverter))] public sealed partial class DoubleRangeProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicMapping.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicMapping.Converters.g.cs new file mode 100644 index 00000000000..1db43c3ffac --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicMapping.Converters.g.cs @@ -0,0 +1,114 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class DynamicMappingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberFalse = System.Text.Json.JsonEncodedText.Encode("false"); + private static readonly System.Text.Json.JsonEncodedText MemberRuntime = System.Text.Json.JsonEncodedText.Encode("runtime"); + private static readonly System.Text.Json.JsonEncodedText MemberStrict = System.Text.Json.JsonEncodedText.Encode("strict"); + private static readonly System.Text.Json.JsonEncodedText MemberTrue = System.Text.Json.JsonEncodedText.Encode("true"); + + public override Elastic.Clients.Elasticsearch.Mapping.DynamicMapping Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberFalse)) + { + return Elastic.Clients.Elasticsearch.Mapping.DynamicMapping.False; + } + + if (reader.ValueTextEquals(MemberRuntime)) + { + return Elastic.Clients.Elasticsearch.Mapping.DynamicMapping.Runtime; + } + + if (reader.ValueTextEquals(MemberStrict)) + { + return Elastic.Clients.Elasticsearch.Mapping.DynamicMapping.Strict; + } + + if (reader.ValueTextEquals(MemberTrue)) + { + return Elastic.Clients.Elasticsearch.Mapping.DynamicMapping.True; + } + + if (reader.TokenType is not System.Text.Json.JsonTokenType.String) + { + throw new System.Text.Json.JsonException($"Unknown member of type '{reader.TokenType}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.DynamicMapping)}'."); + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberFalse.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.DynamicMapping.False; + } + + if (string.Equals(value, MemberRuntime.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.DynamicMapping.Runtime; + } + + if (string.Equals(value, MemberStrict.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.DynamicMapping.Strict; + } + + if (string.Equals(value, MemberTrue.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.DynamicMapping.True; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.DynamicMapping)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Mapping.DynamicMapping.False: + writer.WriteRawValue(MemberFalse.EncodedUtf8Bytes); + break; + case Elastic.Clients.Elasticsearch.Mapping.DynamicMapping.Runtime: + writer.WriteStringValue(MemberRuntime); + break; + case Elastic.Clients.Elasticsearch.Mapping.DynamicMapping.Strict: + writer.WriteStringValue(MemberStrict); + break; + case Elastic.Clients.Elasticsearch.Mapping.DynamicMapping.True: + writer.WriteRawValue(MemberTrue.EncodedUtf8Bytes); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.DynamicMapping)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Mapping.DynamicMapping ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicMapping.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicMapping.g.cs new file mode 100644 index 00000000000..82f57e9ccdf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicMapping.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.DynamicMappingConverter))] +public enum DynamicMapping +{ + [System.Runtime.Serialization.EnumMember(Value = "false")] + False, + [System.Runtime.Serialization.EnumMember(Value = "runtime")] + Runtime, + [System.Runtime.Serialization.EnumMember(Value = "strict")] + Strict, + [System.Runtime.Serialization.EnumMember(Value = "true")] + True +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicProperty.Converters.g.cs new file mode 100644 index 00000000000..b94011c4592 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicProperty.Converters.g.cs @@ -0,0 +1,341 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class DynamicPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropEagerGlobalOrdinals = System.Text.Json.JsonEncodedText.Encode("eager_global_ordinals"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropIndexOptions = System.Text.Json.JsonEncodedText.Encode("index_options"); + private static readonly System.Text.Json.JsonEncodedText PropIndexPhrases = System.Text.Json.JsonEncodedText.Encode("index_phrases"); + private static readonly System.Text.Json.JsonEncodedText PropIndexPrefixes = System.Text.Json.JsonEncodedText.Encode("index_prefixes"); + private static readonly System.Text.Json.JsonEncodedText PropLocale = System.Text.Json.JsonEncodedText.Encode("locale"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropNorms = System.Text.Json.JsonEncodedText.Encode("norms"); + private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); + private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); + private static readonly System.Text.Json.JsonEncodedText PropPositionIncrementGap = System.Text.Json.JsonEncodedText.Encode("position_increment_gap"); + private static readonly System.Text.Json.JsonEncodedText PropPrecisionStep = System.Text.Json.JsonEncodedText.Encode("precision_step"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropSearchAnalyzer = System.Text.Json.JsonEncodedText.Encode("search_analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropSearchQuoteAnalyzer = System.Text.Json.JsonEncodedText.Encode("search_quote_analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropTermVector = System.Text.Json.JsonEncodedText.Encode("term_vector"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.DynamicProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzer = default; + LocalJsonValue propBoost = default; + LocalJsonValue propCoerce = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propEagerGlobalOrdinals = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propFields = default; + LocalJsonValue propFormat = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIgnoreMalformed = default; + LocalJsonValue propIndex = default; + LocalJsonValue propIndexOptions = default; + LocalJsonValue propIndexPhrases = default; + LocalJsonValue propIndexPrefixes = default; + LocalJsonValue propLocale = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propNorms = default; + LocalJsonValue propNullValue = default; + LocalJsonValue propOnScriptError = default; + LocalJsonValue propPositionIncrementGap = default; + LocalJsonValue propPrecisionStep = default; + LocalJsonValue propProperties = default; + LocalJsonValue propScript = default; + LocalJsonValue propSearchAnalyzer = default; + LocalJsonValue propSearchQuoteAnalyzer = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + LocalJsonValue propTermVector = default; + LocalJsonValue propTimeSeriesMetric = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) + { + continue; + } + + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEagerGlobalOrdinals.TryReadProperty(ref reader, options, PropEagerGlobalOrdinals, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndexOptions.TryReadProperty(ref reader, options, PropIndexOptions, static Elastic.Clients.Elasticsearch.Mapping.IndexOptions? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndexPhrases.TryReadProperty(ref reader, options, PropIndexPhrases, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndexPrefixes.TryReadProperty(ref reader, options, PropIndexPrefixes, null)) + { + continue; + } + + if (propLocale.TryReadProperty(ref reader, options, PropLocale, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propNorms.TryReadProperty(ref reader, options, PropNorms, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, null)) + { + continue; + } + + if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPositionIncrementGap.TryReadProperty(ref reader, options, PropPositionIncrementGap, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPrecisionStep.TryReadProperty(ref reader, options, PropPrecisionStep, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propSearchAnalyzer.TryReadProperty(ref reader, options, PropSearchAnalyzer, null)) + { + continue; + } + + if (propSearchQuoteAnalyzer.TryReadProperty(ref reader, options, PropSearchQuoteAnalyzer, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTermVector.TryReadProperty(ref reader, options, PropTermVector, static Elastic.Clients.Elasticsearch.Mapping.TermVectorOption? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.DynamicProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analyzer = propAnalyzer.Value, + Boost = propBoost.Value, + Coerce = propCoerce.Value, + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + EagerGlobalOrdinals = propEagerGlobalOrdinals.Value, + Enabled = propEnabled.Value, + Fields = propFields.Value, + Format = propFormat.Value, + IgnoreAbove = propIgnoreAbove.Value, + IgnoreMalformed = propIgnoreMalformed.Value, + Index = propIndex.Value, + IndexOptions = propIndexOptions.Value, + IndexPhrases = propIndexPhrases.Value, + IndexPrefixes = propIndexPrefixes.Value, + Locale = propLocale.Value, + Meta = propMeta.Value, + Norms = propNorms.Value, + NullValue = propNullValue.Value, + OnScriptError = propOnScriptError.Value, + PositionIncrementGap = propPositionIncrementGap.Value, + PrecisionStep = propPrecisionStep.Value, + Properties = propProperties.Value, + Script = propScript.Value, + SearchAnalyzer = propSearchAnalyzer.Value, + SearchQuoteAnalyzer = propSearchQuoteAnalyzer.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value, + TermVector = propTermVector.Value, + TimeSeriesMetric = propTimeSeriesMetric.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DynamicProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEagerGlobalOrdinals, value.EagerGlobalOrdinals, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndexOptions, value.IndexOptions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.IndexOptions? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndexPhrases, value.IndexPhrases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndexPrefixes, value.IndexPrefixes, null, null); + writer.WriteProperty(options, PropLocale, value.Locale, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNorms, value.Norms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNullValue, value.NullValue, null, null); + writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPositionIncrementGap, value.PositionIncrementGap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPrecisionStep, value.PrecisionStep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropSearchAnalyzer, value.SearchAnalyzer, null, null); + writer.WriteProperty(options, PropSearchQuoteAnalyzer, value.SearchQuoteAnalyzer, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTermVector, value.TermVector, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TermVectorOption? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicProperty.g.cs index 95e50ae9c60..6901f047f80 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicProperty.g.cs @@ -23,324 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class DynamicPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropEagerGlobalOrdinals = System.Text.Json.JsonEncodedText.Encode("eager_global_ordinals"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropIndexOptions = System.Text.Json.JsonEncodedText.Encode("index_options"); - private static readonly System.Text.Json.JsonEncodedText PropIndexPhrases = System.Text.Json.JsonEncodedText.Encode("index_phrases"); - private static readonly System.Text.Json.JsonEncodedText PropIndexPrefixes = System.Text.Json.JsonEncodedText.Encode("index_prefixes"); - private static readonly System.Text.Json.JsonEncodedText PropLocale = System.Text.Json.JsonEncodedText.Encode("locale"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropNorms = System.Text.Json.JsonEncodedText.Encode("norms"); - private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); - private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); - private static readonly System.Text.Json.JsonEncodedText PropPositionIncrementGap = System.Text.Json.JsonEncodedText.Encode("position_increment_gap"); - private static readonly System.Text.Json.JsonEncodedText PropPrecisionStep = System.Text.Json.JsonEncodedText.Encode("precision_step"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropSearchAnalyzer = System.Text.Json.JsonEncodedText.Encode("search_analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropSearchQuoteAnalyzer = System.Text.Json.JsonEncodedText.Encode("search_quote_analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropTermVector = System.Text.Json.JsonEncodedText.Encode("term_vector"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.DynamicProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyzer = default; - LocalJsonValue propBoost = default; - LocalJsonValue propCoerce = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propEagerGlobalOrdinals = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propFields = default; - LocalJsonValue propFormat = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIgnoreMalformed = default; - LocalJsonValue propIndex = default; - LocalJsonValue propIndexOptions = default; - LocalJsonValue propIndexPhrases = default; - LocalJsonValue propIndexPrefixes = default; - LocalJsonValue propLocale = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propNorms = default; - LocalJsonValue propNullValue = default; - LocalJsonValue propOnScriptError = default; - LocalJsonValue propPositionIncrementGap = default; - LocalJsonValue propPrecisionStep = default; - LocalJsonValue propProperties = default; - LocalJsonValue propScript = default; - LocalJsonValue propSearchAnalyzer = default; - LocalJsonValue propSearchQuoteAnalyzer = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - LocalJsonValue propTermVector = default; - LocalJsonValue propTimeSeriesMetric = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) - { - continue; - } - - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEagerGlobalOrdinals.TryReadProperty(ref reader, options, PropEagerGlobalOrdinals, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndexOptions.TryReadProperty(ref reader, options, PropIndexOptions, static Elastic.Clients.Elasticsearch.Mapping.IndexOptions? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndexPhrases.TryReadProperty(ref reader, options, PropIndexPhrases, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndexPrefixes.TryReadProperty(ref reader, options, PropIndexPrefixes, null)) - { - continue; - } - - if (propLocale.TryReadProperty(ref reader, options, PropLocale, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propNorms.TryReadProperty(ref reader, options, PropNorms, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, null)) - { - continue; - } - - if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPositionIncrementGap.TryReadProperty(ref reader, options, PropPositionIncrementGap, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPrecisionStep.TryReadProperty(ref reader, options, PropPrecisionStep, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propSearchAnalyzer.TryReadProperty(ref reader, options, PropSearchAnalyzer, null)) - { - continue; - } - - if (propSearchQuoteAnalyzer.TryReadProperty(ref reader, options, PropSearchQuoteAnalyzer, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTermVector.TryReadProperty(ref reader, options, PropTermVector, static Elastic.Clients.Elasticsearch.Mapping.TermVectorOption? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.DynamicProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analyzer = propAnalyzer.Value, - Boost = propBoost.Value, - Coerce = propCoerce.Value, - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - EagerGlobalOrdinals = propEagerGlobalOrdinals.Value, - Enabled = propEnabled.Value, - Fields = propFields.Value, - Format = propFormat.Value, - IgnoreAbove = propIgnoreAbove.Value, - IgnoreMalformed = propIgnoreMalformed.Value, - Index = propIndex.Value, - IndexOptions = propIndexOptions.Value, - IndexPhrases = propIndexPhrases.Value, - IndexPrefixes = propIndexPrefixes.Value, - Locale = propLocale.Value, - Meta = propMeta.Value, - Norms = propNorms.Value, - NullValue = propNullValue.Value, - OnScriptError = propOnScriptError.Value, - PositionIncrementGap = propPositionIncrementGap.Value, - PrecisionStep = propPrecisionStep.Value, - Properties = propProperties.Value, - Script = propScript.Value, - SearchAnalyzer = propSearchAnalyzer.Value, - SearchQuoteAnalyzer = propSearchQuoteAnalyzer.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value, - TermVector = propTermVector.Value, - TimeSeriesMetric = propTimeSeriesMetric.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DynamicProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEagerGlobalOrdinals, value.EagerGlobalOrdinals, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndexOptions, value.IndexOptions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.IndexOptions? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndexPhrases, value.IndexPhrases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndexPrefixes, value.IndexPrefixes, null, null); - writer.WriteProperty(options, PropLocale, value.Locale, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNorms, value.Norms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNullValue, value.NullValue, null, null); - writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPositionIncrementGap, value.PositionIncrementGap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPrecisionStep, value.PrecisionStep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropSearchAnalyzer, value.SearchAnalyzer, null, null); - writer.WriteProperty(options, PropSearchQuoteAnalyzer, value.SearchQuoteAnalyzer, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTermVector, value.TermVector, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TermVectorOption? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.DynamicPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.DynamicPropertyConverter))] public sealed partial class DynamicProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicTemplate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicTemplate.Converters.g.cs new file mode 100644 index 00000000000..fde3fdf4cea --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicTemplate.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class DynamicTemplateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMatch = System.Text.Json.JsonEncodedText.Encode("match"); + private static readonly System.Text.Json.JsonEncodedText PropMatchMappingType = System.Text.Json.JsonEncodedText.Encode("match_mapping_type"); + private static readonly System.Text.Json.JsonEncodedText PropMatchPattern = System.Text.Json.JsonEncodedText.Encode("match_pattern"); + private static readonly System.Text.Json.JsonEncodedText PropPathMatch = System.Text.Json.JsonEncodedText.Encode("path_match"); + private static readonly System.Text.Json.JsonEncodedText PropPathUnmatch = System.Text.Json.JsonEncodedText.Encode("path_unmatch"); + private static readonly System.Text.Json.JsonEncodedText PropUnmatch = System.Text.Json.JsonEncodedText.Encode("unmatch"); + private static readonly System.Text.Json.JsonEncodedText PropUnmatchMappingType = System.Text.Json.JsonEncodedText.Encode("unmatch_mapping_type"); + private static readonly System.Text.Json.JsonEncodedText VariantMapping = System.Text.Json.JsonEncodedText.Encode("mapping"); + private static readonly System.Text.Json.JsonEncodedText VariantRuntime = System.Text.Json.JsonEncodedText.Encode("runtime"); + + public override Elastic.Clients.Elasticsearch.Mapping.DynamicTemplate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propMatch = default; + LocalJsonValue?> propMatchMappingType = default; + LocalJsonValue propMatchPattern = default; + LocalJsonValue?> propPathMatch = default; + LocalJsonValue?> propPathUnmatch = default; + LocalJsonValue?> propUnmatch = default; + LocalJsonValue?> propUnmatchMappingType = default; + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMatch.TryReadProperty(ref reader, options, PropMatch, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propMatchMappingType.TryReadProperty(ref reader, options, PropMatchMappingType, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propMatchPattern.TryReadProperty(ref reader, options, PropMatchPattern, static Elastic.Clients.Elasticsearch.Mapping.MatchType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPathMatch.TryReadProperty(ref reader, options, PropPathMatch, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propPathUnmatch.TryReadProperty(ref reader, options, PropPathUnmatch, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propUnmatch.TryReadProperty(ref reader, options, PropUnmatch, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propUnmatchMappingType.TryReadProperty(ref reader, options, PropUnmatchMappingType, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (reader.ValueTextEquals(VariantMapping)) + { + variantType = VariantMapping.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRuntime)) + { + variantType = VariantRuntime.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.DynamicTemplate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant, + Match = propMatch.Value, + MatchMappingType = propMatchMappingType.Value, + MatchPattern = propMatchPattern.Value, + PathMatch = propPathMatch.Value, + PathUnmatch = propPathUnmatch.Value, + Unmatch = propUnmatch.Value, + UnmatchMappingType = propUnmatchMappingType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DynamicTemplate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "mapping": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Mapping.IProperty)value.Variant, null, null); + break; + case "runtime": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Mapping.RuntimeField)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Mapping.DynamicTemplate)}'."); + } + + writer.WriteProperty(options, PropMatch, value.Match, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMatchMappingType, value.MatchMappingType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMatchPattern, value.MatchPattern, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.MatchType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPathMatch, value.PathMatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPathUnmatch, value.PathUnmatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropUnmatch, value.Unmatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropUnmatchMappingType, value.UnmatchMappingType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicTemplate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicTemplate.g.cs index 9c4e2b6a31d..005c91063f1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicTemplate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicTemplate.g.cs @@ -23,136 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class DynamicTemplateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMatch = System.Text.Json.JsonEncodedText.Encode("match"); - private static readonly System.Text.Json.JsonEncodedText PropMatchMappingType = System.Text.Json.JsonEncodedText.Encode("match_mapping_type"); - private static readonly System.Text.Json.JsonEncodedText PropMatchPattern = System.Text.Json.JsonEncodedText.Encode("match_pattern"); - private static readonly System.Text.Json.JsonEncodedText PropPathMatch = System.Text.Json.JsonEncodedText.Encode("path_match"); - private static readonly System.Text.Json.JsonEncodedText PropPathUnmatch = System.Text.Json.JsonEncodedText.Encode("path_unmatch"); - private static readonly System.Text.Json.JsonEncodedText PropUnmatch = System.Text.Json.JsonEncodedText.Encode("unmatch"); - private static readonly System.Text.Json.JsonEncodedText PropUnmatchMappingType = System.Text.Json.JsonEncodedText.Encode("unmatch_mapping_type"); - private static readonly System.Text.Json.JsonEncodedText VariantMapping = System.Text.Json.JsonEncodedText.Encode("mapping"); - private static readonly System.Text.Json.JsonEncodedText VariantRuntime = System.Text.Json.JsonEncodedText.Encode("runtime"); - - public override Elastic.Clients.Elasticsearch.Mapping.DynamicTemplate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propMatch = default; - LocalJsonValue?> propMatchMappingType = default; - LocalJsonValue propMatchPattern = default; - LocalJsonValue?> propPathMatch = default; - LocalJsonValue?> propPathUnmatch = default; - LocalJsonValue?> propUnmatch = default; - LocalJsonValue?> propUnmatchMappingType = default; - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMatch.TryReadProperty(ref reader, options, PropMatch, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propMatchMappingType.TryReadProperty(ref reader, options, PropMatchMappingType, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propMatchPattern.TryReadProperty(ref reader, options, PropMatchPattern, static Elastic.Clients.Elasticsearch.Mapping.MatchType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPathMatch.TryReadProperty(ref reader, options, PropPathMatch, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propPathUnmatch.TryReadProperty(ref reader, options, PropPathUnmatch, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propUnmatch.TryReadProperty(ref reader, options, PropUnmatch, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propUnmatchMappingType.TryReadProperty(ref reader, options, PropUnmatchMappingType, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (reader.ValueTextEquals(VariantMapping)) - { - variantType = VariantMapping.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRuntime)) - { - variantType = VariantRuntime.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.DynamicTemplate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant, - Match = propMatch.Value, - MatchMappingType = propMatchMappingType.Value, - MatchPattern = propMatchPattern.Value, - PathMatch = propPathMatch.Value, - PathUnmatch = propPathUnmatch.Value, - Unmatch = propUnmatch.Value, - UnmatchMappingType = propUnmatchMappingType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.DynamicTemplate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "mapping": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Mapping.IProperty)value.Variant, null, null); - break; - case "runtime": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Mapping.RuntimeField)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Mapping.DynamicTemplate)}'."); - } - - writer.WriteProperty(options, PropMatch, value.Match, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMatchMappingType, value.MatchMappingType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMatchPattern, value.MatchPattern, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.MatchType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPathMatch, value.PathMatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPathUnmatch, value.PathUnmatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropUnmatch, value.Unmatch, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropUnmatchMappingType, value.UnmatchMappingType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.DynamicTemplateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.DynamicTemplateConverter))] public sealed partial class DynamicTemplate { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldAliasProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldAliasProperty.Converters.g.cs new file mode 100644 index 00000000000..552d8f45366 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldAliasProperty.Converters.g.cs @@ -0,0 +1,125 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class FieldAliasPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.FieldAliasProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propPath = default; + LocalJsonValue propProperties = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propPath.TryReadProperty(ref reader, options, PropPath, null)) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.FieldAliasProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + Meta = propMeta.Value, + Path = propPath.Value, + Properties = propProperties.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.FieldAliasProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropPath, value.Path, null, null); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldAliasProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldAliasProperty.g.cs index 85020207303..e1c1929e13e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldAliasProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldAliasProperty.g.cs @@ -23,108 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class FieldAliasPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.FieldAliasProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propPath = default; - LocalJsonValue propProperties = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propPath.TryReadProperty(ref reader, options, PropPath, null)) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.FieldAliasProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - Meta = propMeta.Value, - Path = propPath.Value, - Properties = propProperties.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.FieldAliasProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropPath, value.Path, null, null); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.FieldAliasPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.FieldAliasPropertyConverter))] public sealed partial class FieldAliasProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldMapping.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldMapping.Converters.g.cs new file mode 100644 index 00000000000..6a8ad0eec7b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldMapping.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class FieldMappingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFullName = System.Text.Json.JsonEncodedText.Encode("full_name"); + private static readonly System.Text.Json.JsonEncodedText PropMapping = System.Text.Json.JsonEncodedText.Encode("mapping"); + + public override Elastic.Clients.Elasticsearch.Mapping.FieldMapping Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFullName = default; + LocalJsonValue> propMapping = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFullName.TryReadProperty(ref reader, options, PropFullName, null)) + { + continue; + } + + if (propMapping.TryReadProperty(ref reader, options, PropMapping, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.FieldMapping(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FullName = propFullName.Value, + Mapping = propMapping.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.FieldMapping value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFullName, value.FullName, null, null); + writer.WriteProperty(options, PropMapping, value.Mapping, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldMapping.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldMapping.g.cs index 3c386286c9c..ea4c80e5978 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldMapping.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldMapping.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class FieldMappingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFullName = System.Text.Json.JsonEncodedText.Encode("full_name"); - private static readonly System.Text.Json.JsonEncodedText PropMapping = System.Text.Json.JsonEncodedText.Encode("mapping"); - - public override Elastic.Clients.Elasticsearch.Mapping.FieldMapping Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFullName = default; - LocalJsonValue> propMapping = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFullName.TryReadProperty(ref reader, options, PropFullName, null)) - { - continue; - } - - if (propMapping.TryReadProperty(ref reader, options, PropMapping, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.FieldMapping(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FullName = propFullName.Value, - Mapping = propMapping.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.FieldMapping value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFullName, value.FullName, null, null); - writer.WriteProperty(options, PropMapping, value.Mapping, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.FieldMappingConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.FieldMappingConverter))] public sealed partial class FieldMapping { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldNamesField.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldNamesField.Converters.g.cs new file mode 100644 index 00000000000..522ee86df87 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldNamesField.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class FieldNamesFieldConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + + public override Elastic.Clients.Elasticsearch.Mapping.FieldNamesField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEnabled = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.FieldNamesField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Enabled = propEnabled.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.FieldNamesField value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldNamesField.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldNamesField.g.cs index 42ae8880a3a..dfed9e4900d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldNamesField.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldNamesField.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class FieldNamesFieldConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - - public override Elastic.Clients.Elasticsearch.Mapping.FieldNamesField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEnabled = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.FieldNamesField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Enabled = propEnabled.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.FieldNamesField value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.FieldNamesFieldConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.FieldNamesFieldConverter))] public sealed partial class FieldNamesField { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldType.Converters.g.cs new file mode 100644 index 00000000000..c8a3ecdc447 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldType.Converters.g.cs @@ -0,0 +1,725 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class FieldTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAggregateMetricDouble = System.Text.Json.JsonEncodedText.Encode("aggregate_metric_double"); + private static readonly System.Text.Json.JsonEncodedText MemberAlias = System.Text.Json.JsonEncodedText.Encode("alias"); + private static readonly System.Text.Json.JsonEncodedText MemberBinary = System.Text.Json.JsonEncodedText.Encode("binary"); + private static readonly System.Text.Json.JsonEncodedText MemberBoolean = System.Text.Json.JsonEncodedText.Encode("boolean"); + private static readonly System.Text.Json.JsonEncodedText MemberByte = System.Text.Json.JsonEncodedText.Encode("byte"); + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); + private static readonly System.Text.Json.JsonEncodedText MemberConstantKeyword = System.Text.Json.JsonEncodedText.Encode("constant_keyword"); + private static readonly System.Text.Json.JsonEncodedText MemberCountedKeyword = System.Text.Json.JsonEncodedText.Encode("counted_keyword"); + private static readonly System.Text.Json.JsonEncodedText MemberDate = System.Text.Json.JsonEncodedText.Encode("date"); + private static readonly System.Text.Json.JsonEncodedText MemberDateNanos = System.Text.Json.JsonEncodedText.Encode("date_nanos"); + private static readonly System.Text.Json.JsonEncodedText MemberDateRange = System.Text.Json.JsonEncodedText.Encode("date_range"); + private static readonly System.Text.Json.JsonEncodedText MemberDenseVector = System.Text.Json.JsonEncodedText.Encode("dense_vector"); + private static readonly System.Text.Json.JsonEncodedText MemberDouble = System.Text.Json.JsonEncodedText.Encode("double"); + private static readonly System.Text.Json.JsonEncodedText MemberDoubleRange = System.Text.Json.JsonEncodedText.Encode("double_range"); + private static readonly System.Text.Json.JsonEncodedText MemberFlattened = System.Text.Json.JsonEncodedText.Encode("flattened"); + private static readonly System.Text.Json.JsonEncodedText MemberFloat = System.Text.Json.JsonEncodedText.Encode("float"); + private static readonly System.Text.Json.JsonEncodedText MemberFloatRange = System.Text.Json.JsonEncodedText.Encode("float_range"); + private static readonly System.Text.Json.JsonEncodedText MemberGeoPoint = System.Text.Json.JsonEncodedText.Encode("geo_point"); + private static readonly System.Text.Json.JsonEncodedText MemberGeoShape = System.Text.Json.JsonEncodedText.Encode("geo_shape"); + private static readonly System.Text.Json.JsonEncodedText MemberHalfFloat = System.Text.Json.JsonEncodedText.Encode("half_float"); + private static readonly System.Text.Json.JsonEncodedText MemberHistogram = System.Text.Json.JsonEncodedText.Encode("histogram"); + private static readonly System.Text.Json.JsonEncodedText MemberIcuCollationKeyword = System.Text.Json.JsonEncodedText.Encode("icu_collation_keyword"); + private static readonly System.Text.Json.JsonEncodedText MemberInteger = System.Text.Json.JsonEncodedText.Encode("integer"); + private static readonly System.Text.Json.JsonEncodedText MemberIntegerRange = System.Text.Json.JsonEncodedText.Encode("integer_range"); + private static readonly System.Text.Json.JsonEncodedText MemberIp = System.Text.Json.JsonEncodedText.Encode("ip"); + private static readonly System.Text.Json.JsonEncodedText MemberIpRange = System.Text.Json.JsonEncodedText.Encode("ip_range"); + private static readonly System.Text.Json.JsonEncodedText MemberJoin = System.Text.Json.JsonEncodedText.Encode("join"); + private static readonly System.Text.Json.JsonEncodedText MemberKeyword = System.Text.Json.JsonEncodedText.Encode("keyword"); + private static readonly System.Text.Json.JsonEncodedText MemberLong = System.Text.Json.JsonEncodedText.Encode("long"); + private static readonly System.Text.Json.JsonEncodedText MemberLongRange = System.Text.Json.JsonEncodedText.Encode("long_range"); + private static readonly System.Text.Json.JsonEncodedText MemberMatchOnlyText = System.Text.Json.JsonEncodedText.Encode("match_only_text"); + private static readonly System.Text.Json.JsonEncodedText MemberMurmur3 = System.Text.Json.JsonEncodedText.Encode("murmur3"); + private static readonly System.Text.Json.JsonEncodedText MemberNested = System.Text.Json.JsonEncodedText.Encode("nested"); + private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); + private static readonly System.Text.Json.JsonEncodedText MemberObject = System.Text.Json.JsonEncodedText.Encode("object"); + private static readonly System.Text.Json.JsonEncodedText MemberPassthrough = System.Text.Json.JsonEncodedText.Encode("passthrough"); + private static readonly System.Text.Json.JsonEncodedText MemberPercolator = System.Text.Json.JsonEncodedText.Encode("percolator"); + private static readonly System.Text.Json.JsonEncodedText MemberRankFeature = System.Text.Json.JsonEncodedText.Encode("rank_feature"); + private static readonly System.Text.Json.JsonEncodedText MemberRankFeatures = System.Text.Json.JsonEncodedText.Encode("rank_features"); + private static readonly System.Text.Json.JsonEncodedText MemberScaledFloat = System.Text.Json.JsonEncodedText.Encode("scaled_float"); + private static readonly System.Text.Json.JsonEncodedText MemberSearchAsYouType = System.Text.Json.JsonEncodedText.Encode("search_as_you_type"); + private static readonly System.Text.Json.JsonEncodedText MemberSemanticText = System.Text.Json.JsonEncodedText.Encode("semantic_text"); + private static readonly System.Text.Json.JsonEncodedText MemberShape = System.Text.Json.JsonEncodedText.Encode("shape"); + private static readonly System.Text.Json.JsonEncodedText MemberShort = System.Text.Json.JsonEncodedText.Encode("short"); + private static readonly System.Text.Json.JsonEncodedText MemberSparseVector = System.Text.Json.JsonEncodedText.Encode("sparse_vector"); + private static readonly System.Text.Json.JsonEncodedText MemberText = System.Text.Json.JsonEncodedText.Encode("text"); + private static readonly System.Text.Json.JsonEncodedText MemberTokenCount = System.Text.Json.JsonEncodedText.Encode("token_count"); + private static readonly System.Text.Json.JsonEncodedText MemberVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Mapping.FieldType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAggregateMetricDouble)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.AggregateMetricDouble; + } + + if (reader.ValueTextEquals(MemberAlias)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Alias; + } + + if (reader.ValueTextEquals(MemberBinary)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Binary; + } + + if (reader.ValueTextEquals(MemberBoolean)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Boolean; + } + + if (reader.ValueTextEquals(MemberByte)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Byte; + } + + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Completion; + } + + if (reader.ValueTextEquals(MemberConstantKeyword)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.ConstantKeyword; + } + + if (reader.ValueTextEquals(MemberCountedKeyword)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.CountedKeyword; + } + + if (reader.ValueTextEquals(MemberDate)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Date; + } + + if (reader.ValueTextEquals(MemberDateNanos)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.DateNanos; + } + + if (reader.ValueTextEquals(MemberDateRange)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.DateRange; + } + + if (reader.ValueTextEquals(MemberDenseVector)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.DenseVector; + } + + if (reader.ValueTextEquals(MemberDouble)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Double; + } + + if (reader.ValueTextEquals(MemberDoubleRange)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.DoubleRange; + } + + if (reader.ValueTextEquals(MemberFlattened)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Flattened; + } + + if (reader.ValueTextEquals(MemberFloat)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Float; + } + + if (reader.ValueTextEquals(MemberFloatRange)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.FloatRange; + } + + if (reader.ValueTextEquals(MemberGeoPoint)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.GeoPoint; + } + + if (reader.ValueTextEquals(MemberGeoShape)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.GeoShape; + } + + if (reader.ValueTextEquals(MemberHalfFloat)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.HalfFloat; + } + + if (reader.ValueTextEquals(MemberHistogram)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Histogram; + } + + if (reader.ValueTextEquals(MemberIcuCollationKeyword)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.IcuCollationKeyword; + } + + if (reader.ValueTextEquals(MemberInteger)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Integer; + } + + if (reader.ValueTextEquals(MemberIntegerRange)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.IntegerRange; + } + + if (reader.ValueTextEquals(MemberIp)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Ip; + } + + if (reader.ValueTextEquals(MemberIpRange)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.IpRange; + } + + if (reader.ValueTextEquals(MemberJoin)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Join; + } + + if (reader.ValueTextEquals(MemberKeyword)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Keyword; + } + + if (reader.ValueTextEquals(MemberLong)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Long; + } + + if (reader.ValueTextEquals(MemberLongRange)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.LongRange; + } + + if (reader.ValueTextEquals(MemberMatchOnlyText)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.MatchOnlyText; + } + + if (reader.ValueTextEquals(MemberMurmur3)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Murmur3; + } + + if (reader.ValueTextEquals(MemberNested)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Nested; + } + + if (reader.ValueTextEquals(MemberNone)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.None; + } + + if (reader.ValueTextEquals(MemberObject)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Object; + } + + if (reader.ValueTextEquals(MemberPassthrough)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Passthrough; + } + + if (reader.ValueTextEquals(MemberPercolator)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Percolator; + } + + if (reader.ValueTextEquals(MemberRankFeature)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.RankFeature; + } + + if (reader.ValueTextEquals(MemberRankFeatures)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.RankFeatures; + } + + if (reader.ValueTextEquals(MemberScaledFloat)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.ScaledFloat; + } + + if (reader.ValueTextEquals(MemberSearchAsYouType)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.SearchAsYouType; + } + + if (reader.ValueTextEquals(MemberSemanticText)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.SemanticText; + } + + if (reader.ValueTextEquals(MemberShape)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Shape; + } + + if (reader.ValueTextEquals(MemberShort)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Short; + } + + if (reader.ValueTextEquals(MemberSparseVector)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.SparseVector; + } + + if (reader.ValueTextEquals(MemberText)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Text; + } + + if (reader.ValueTextEquals(MemberTokenCount)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.TokenCount; + } + + if (reader.ValueTextEquals(MemberVersion)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Version; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAggregateMetricDouble.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.AggregateMetricDouble; + } + + if (string.Equals(value, MemberAlias.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Alias; + } + + if (string.Equals(value, MemberBinary.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Binary; + } + + if (string.Equals(value, MemberBoolean.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Boolean; + } + + if (string.Equals(value, MemberByte.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Byte; + } + + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Completion; + } + + if (string.Equals(value, MemberConstantKeyword.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.ConstantKeyword; + } + + if (string.Equals(value, MemberCountedKeyword.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.CountedKeyword; + } + + if (string.Equals(value, MemberDate.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Date; + } + + if (string.Equals(value, MemberDateNanos.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.DateNanos; + } + + if (string.Equals(value, MemberDateRange.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.DateRange; + } + + if (string.Equals(value, MemberDenseVector.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.DenseVector; + } + + if (string.Equals(value, MemberDouble.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Double; + } + + if (string.Equals(value, MemberDoubleRange.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.DoubleRange; + } + + if (string.Equals(value, MemberFlattened.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Flattened; + } + + if (string.Equals(value, MemberFloat.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Float; + } + + if (string.Equals(value, MemberFloatRange.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.FloatRange; + } + + if (string.Equals(value, MemberGeoPoint.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.GeoPoint; + } + + if (string.Equals(value, MemberGeoShape.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.GeoShape; + } + + if (string.Equals(value, MemberHalfFloat.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.HalfFloat; + } + + if (string.Equals(value, MemberHistogram.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Histogram; + } + + if (string.Equals(value, MemberIcuCollationKeyword.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.IcuCollationKeyword; + } + + if (string.Equals(value, MemberInteger.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Integer; + } + + if (string.Equals(value, MemberIntegerRange.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.IntegerRange; + } + + if (string.Equals(value, MemberIp.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Ip; + } + + if (string.Equals(value, MemberIpRange.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.IpRange; + } + + if (string.Equals(value, MemberJoin.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Join; + } + + if (string.Equals(value, MemberKeyword.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Keyword; + } + + if (string.Equals(value, MemberLong.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Long; + } + + if (string.Equals(value, MemberLongRange.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.LongRange; + } + + if (string.Equals(value, MemberMatchOnlyText.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.MatchOnlyText; + } + + if (string.Equals(value, MemberMurmur3.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Murmur3; + } + + if (string.Equals(value, MemberNested.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Nested; + } + + if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.None; + } + + if (string.Equals(value, MemberObject.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Object; + } + + if (string.Equals(value, MemberPassthrough.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Passthrough; + } + + if (string.Equals(value, MemberPercolator.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Percolator; + } + + if (string.Equals(value, MemberRankFeature.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.RankFeature; + } + + if (string.Equals(value, MemberRankFeatures.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.RankFeatures; + } + + if (string.Equals(value, MemberScaledFloat.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.ScaledFloat; + } + + if (string.Equals(value, MemberSearchAsYouType.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.SearchAsYouType; + } + + if (string.Equals(value, MemberSemanticText.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.SemanticText; + } + + if (string.Equals(value, MemberShape.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Shape; + } + + if (string.Equals(value, MemberShort.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Short; + } + + if (string.Equals(value, MemberSparseVector.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.SparseVector; + } + + if (string.Equals(value, MemberText.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Text; + } + + if (string.Equals(value, MemberTokenCount.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.TokenCount; + } + + if (string.Equals(value, MemberVersion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.FieldType.Version; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.FieldType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.FieldType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Mapping.FieldType.AggregateMetricDouble: + writer.WriteStringValue(MemberAggregateMetricDouble); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.Alias: + writer.WriteStringValue(MemberAlias); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.Binary: + writer.WriteStringValue(MemberBinary); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.Boolean: + writer.WriteStringValue(MemberBoolean); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.Byte: + writer.WriteStringValue(MemberByte); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.Completion: + writer.WriteStringValue(MemberCompletion); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.ConstantKeyword: + writer.WriteStringValue(MemberConstantKeyword); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.CountedKeyword: + writer.WriteStringValue(MemberCountedKeyword); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.Date: + writer.WriteStringValue(MemberDate); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.DateNanos: + writer.WriteStringValue(MemberDateNanos); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.DateRange: + writer.WriteStringValue(MemberDateRange); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.DenseVector: + writer.WriteStringValue(MemberDenseVector); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.Double: + writer.WriteStringValue(MemberDouble); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.DoubleRange: + writer.WriteStringValue(MemberDoubleRange); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.Flattened: + writer.WriteStringValue(MemberFlattened); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.Float: + writer.WriteStringValue(MemberFloat); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.FloatRange: + writer.WriteStringValue(MemberFloatRange); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.GeoPoint: + writer.WriteStringValue(MemberGeoPoint); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.GeoShape: + writer.WriteStringValue(MemberGeoShape); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.HalfFloat: + writer.WriteStringValue(MemberHalfFloat); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.Histogram: + writer.WriteStringValue(MemberHistogram); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.IcuCollationKeyword: + writer.WriteStringValue(MemberIcuCollationKeyword); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.Integer: + writer.WriteStringValue(MemberInteger); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.IntegerRange: + writer.WriteStringValue(MemberIntegerRange); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.Ip: + writer.WriteStringValue(MemberIp); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.IpRange: + writer.WriteStringValue(MemberIpRange); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.Join: + writer.WriteStringValue(MemberJoin); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.Keyword: + writer.WriteStringValue(MemberKeyword); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.Long: + writer.WriteStringValue(MemberLong); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.LongRange: + writer.WriteStringValue(MemberLongRange); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.MatchOnlyText: + writer.WriteStringValue(MemberMatchOnlyText); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.Murmur3: + writer.WriteStringValue(MemberMurmur3); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.Nested: + writer.WriteStringValue(MemberNested); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.None: + writer.WriteStringValue(MemberNone); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.Object: + writer.WriteStringValue(MemberObject); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.Passthrough: + writer.WriteStringValue(MemberPassthrough); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.Percolator: + writer.WriteStringValue(MemberPercolator); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.RankFeature: + writer.WriteStringValue(MemberRankFeature); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.RankFeatures: + writer.WriteStringValue(MemberRankFeatures); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.ScaledFloat: + writer.WriteStringValue(MemberScaledFloat); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.SearchAsYouType: + writer.WriteStringValue(MemberSearchAsYouType); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.SemanticText: + writer.WriteStringValue(MemberSemanticText); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.Shape: + writer.WriteStringValue(MemberShape); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.Short: + writer.WriteStringValue(MemberShort); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.SparseVector: + writer.WriteStringValue(MemberSparseVector); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.Text: + writer.WriteStringValue(MemberText); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.TokenCount: + writer.WriteStringValue(MemberTokenCount); + break; + case Elastic.Clients.Elasticsearch.Mapping.FieldType.Version: + writer.WriteStringValue(MemberVersion); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.FieldType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Mapping.FieldType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.FieldType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldType.g.cs new file mode 100644 index 00000000000..b7ccd41e473 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FieldType.g.cs @@ -0,0 +1,125 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.FieldTypeConverter))] +public enum FieldType +{ + [System.Runtime.Serialization.EnumMember(Value = "aggregate_metric_double")] + AggregateMetricDouble, + [System.Runtime.Serialization.EnumMember(Value = "alias")] + Alias, + [System.Runtime.Serialization.EnumMember(Value = "binary")] + Binary, + [System.Runtime.Serialization.EnumMember(Value = "boolean")] + Boolean, + [System.Runtime.Serialization.EnumMember(Value = "byte")] + Byte, + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, + [System.Runtime.Serialization.EnumMember(Value = "constant_keyword")] + ConstantKeyword, + [System.Runtime.Serialization.EnumMember(Value = "counted_keyword")] + CountedKeyword, + [System.Runtime.Serialization.EnumMember(Value = "date")] + Date, + [System.Runtime.Serialization.EnumMember(Value = "date_nanos")] + DateNanos, + [System.Runtime.Serialization.EnumMember(Value = "date_range")] + DateRange, + [System.Runtime.Serialization.EnumMember(Value = "dense_vector")] + DenseVector, + [System.Runtime.Serialization.EnumMember(Value = "double")] + Double, + [System.Runtime.Serialization.EnumMember(Value = "double_range")] + DoubleRange, + [System.Runtime.Serialization.EnumMember(Value = "flattened")] + Flattened, + [System.Runtime.Serialization.EnumMember(Value = "float")] + Float, + [System.Runtime.Serialization.EnumMember(Value = "float_range")] + FloatRange, + [System.Runtime.Serialization.EnumMember(Value = "geo_point")] + GeoPoint, + [System.Runtime.Serialization.EnumMember(Value = "geo_shape")] + GeoShape, + [System.Runtime.Serialization.EnumMember(Value = "half_float")] + HalfFloat, + [System.Runtime.Serialization.EnumMember(Value = "histogram")] + Histogram, + [System.Runtime.Serialization.EnumMember(Value = "icu_collation_keyword")] + IcuCollationKeyword, + [System.Runtime.Serialization.EnumMember(Value = "integer")] + Integer, + [System.Runtime.Serialization.EnumMember(Value = "integer_range")] + IntegerRange, + [System.Runtime.Serialization.EnumMember(Value = "ip")] + Ip, + [System.Runtime.Serialization.EnumMember(Value = "ip_range")] + IpRange, + [System.Runtime.Serialization.EnumMember(Value = "join")] + Join, + [System.Runtime.Serialization.EnumMember(Value = "keyword")] + Keyword, + [System.Runtime.Serialization.EnumMember(Value = "long")] + Long, + [System.Runtime.Serialization.EnumMember(Value = "long_range")] + LongRange, + [System.Runtime.Serialization.EnumMember(Value = "match_only_text")] + MatchOnlyText, + [System.Runtime.Serialization.EnumMember(Value = "murmur3")] + Murmur3, + [System.Runtime.Serialization.EnumMember(Value = "nested")] + Nested, + [System.Runtime.Serialization.EnumMember(Value = "none")] + None, + [System.Runtime.Serialization.EnumMember(Value = "object")] + Object, + [System.Runtime.Serialization.EnumMember(Value = "passthrough")] + Passthrough, + [System.Runtime.Serialization.EnumMember(Value = "percolator")] + Percolator, + [System.Runtime.Serialization.EnumMember(Value = "rank_feature")] + RankFeature, + [System.Runtime.Serialization.EnumMember(Value = "rank_features")] + RankFeatures, + [System.Runtime.Serialization.EnumMember(Value = "scaled_float")] + ScaledFloat, + [System.Runtime.Serialization.EnumMember(Value = "search_as_you_type")] + SearchAsYouType, + [System.Runtime.Serialization.EnumMember(Value = "semantic_text")] + SemanticText, + [System.Runtime.Serialization.EnumMember(Value = "shape")] + Shape, + [System.Runtime.Serialization.EnumMember(Value = "short")] + Short, + [System.Runtime.Serialization.EnumMember(Value = "sparse_vector")] + SparseVector, + [System.Runtime.Serialization.EnumMember(Value = "text")] + Text, + [System.Runtime.Serialization.EnumMember(Value = "token_count")] + TokenCount, + [System.Runtime.Serialization.EnumMember(Value = "version")] + Version +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FlattenedProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FlattenedProperty.Converters.g.cs new file mode 100644 index 00000000000..f1cdab37549 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FlattenedProperty.Converters.g.cs @@ -0,0 +1,206 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class FlattenedPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropDepthLimit = System.Text.Json.JsonEncodedText.Encode("depth_limit"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropEagerGlobalOrdinals = System.Text.Json.JsonEncodedText.Encode("eager_global_ordinals"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropIndexOptions = System.Text.Json.JsonEncodedText.Encode("index_options"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); + private static readonly System.Text.Json.JsonEncodedText PropSplitQueriesOnWhitespace = System.Text.Json.JsonEncodedText.Encode("split_queries_on_whitespace"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimensions = System.Text.Json.JsonEncodedText.Encode("time_series_dimensions"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.FlattenedProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propDepthLimit = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propEagerGlobalOrdinals = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIndex = default; + LocalJsonValue propIndexOptions = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propNullValue = default; + LocalJsonValue propProperties = default; + LocalJsonValue propSimilarity = default; + LocalJsonValue propSplitQueriesOnWhitespace = default; + LocalJsonValue propSyntheticSourceKeep = default; + LocalJsonValue?> propTimeSeriesDimensions = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDepthLimit.TryReadProperty(ref reader, options, PropDepthLimit, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEagerGlobalOrdinals.TryReadProperty(ref reader, options, PropEagerGlobalOrdinals, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndexOptions.TryReadProperty(ref reader, options, PropIndexOptions, static Elastic.Clients.Elasticsearch.Mapping.IndexOptions? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, null)) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, null)) + { + continue; + } + + if (propSplitQueriesOnWhitespace.TryReadProperty(ref reader, options, PropSplitQueriesOnWhitespace, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesDimensions.TryReadProperty(ref reader, options, PropTimeSeriesDimensions, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.FlattenedProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + DepthLimit = propDepthLimit.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + EagerGlobalOrdinals = propEagerGlobalOrdinals.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + Index = propIndex.Value, + IndexOptions = propIndexOptions.Value, + Meta = propMeta.Value, + NullValue = propNullValue.Value, + Properties = propProperties.Value, + Similarity = propSimilarity.Value, + SplitQueriesOnWhitespace = propSplitQueriesOnWhitespace.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value, + TimeSeriesDimensions = propTimeSeriesDimensions.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.FlattenedProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDepthLimit, value.DepthLimit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEagerGlobalOrdinals, value.EagerGlobalOrdinals, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndexOptions, value.IndexOptions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.IndexOptions? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNullValue, value.NullValue, null, null); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropSimilarity, value.Similarity, null, null); + writer.WriteProperty(options, PropSplitQueriesOnWhitespace, value.SplitQueriesOnWhitespace, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesDimensions, value.TimeSeriesDimensions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FlattenedProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FlattenedProperty.g.cs index 2b6e4859e01..9b7689065b5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FlattenedProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FlattenedProperty.g.cs @@ -23,189 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class FlattenedPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropDepthLimit = System.Text.Json.JsonEncodedText.Encode("depth_limit"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropEagerGlobalOrdinals = System.Text.Json.JsonEncodedText.Encode("eager_global_ordinals"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropIndexOptions = System.Text.Json.JsonEncodedText.Encode("index_options"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); - private static readonly System.Text.Json.JsonEncodedText PropSplitQueriesOnWhitespace = System.Text.Json.JsonEncodedText.Encode("split_queries_on_whitespace"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimensions = System.Text.Json.JsonEncodedText.Encode("time_series_dimensions"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.FlattenedProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propDepthLimit = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propEagerGlobalOrdinals = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIndex = default; - LocalJsonValue propIndexOptions = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propNullValue = default; - LocalJsonValue propProperties = default; - LocalJsonValue propSimilarity = default; - LocalJsonValue propSplitQueriesOnWhitespace = default; - LocalJsonValue propSyntheticSourceKeep = default; - LocalJsonValue?> propTimeSeriesDimensions = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDepthLimit.TryReadProperty(ref reader, options, PropDepthLimit, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEagerGlobalOrdinals.TryReadProperty(ref reader, options, PropEagerGlobalOrdinals, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndexOptions.TryReadProperty(ref reader, options, PropIndexOptions, static Elastic.Clients.Elasticsearch.Mapping.IndexOptions? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, null)) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, null)) - { - continue; - } - - if (propSplitQueriesOnWhitespace.TryReadProperty(ref reader, options, PropSplitQueriesOnWhitespace, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesDimensions.TryReadProperty(ref reader, options, PropTimeSeriesDimensions, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.FlattenedProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - DepthLimit = propDepthLimit.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - EagerGlobalOrdinals = propEagerGlobalOrdinals.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - Index = propIndex.Value, - IndexOptions = propIndexOptions.Value, - Meta = propMeta.Value, - NullValue = propNullValue.Value, - Properties = propProperties.Value, - Similarity = propSimilarity.Value, - SplitQueriesOnWhitespace = propSplitQueriesOnWhitespace.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value, - TimeSeriesDimensions = propTimeSeriesDimensions.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.FlattenedProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDepthLimit, value.DepthLimit, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEagerGlobalOrdinals, value.EagerGlobalOrdinals, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndexOptions, value.IndexOptions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.IndexOptions? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNullValue, value.NullValue, null, null); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropSimilarity, value.Similarity, null, null); - writer.WriteProperty(options, PropSplitQueriesOnWhitespace, value.SplitQueriesOnWhitespace, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesDimensions, value.TimeSeriesDimensions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.FlattenedPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.FlattenedPropertyConverter))] public sealed partial class FlattenedProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatNumberProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatNumberProperty.Converters.g.cs new file mode 100644 index 00000000000..d13d38adc79 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatNumberProperty.Converters.g.cs @@ -0,0 +1,224 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class FloatNumberPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); + private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.FloatNumberProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propCoerce = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIgnoreMalformed = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propNullValue = default; + LocalJsonValue propOnScriptError = default; + LocalJsonValue propProperties = default; + LocalJsonValue propScript = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + LocalJsonValue propTimeSeriesDimension = default; + LocalJsonValue propTimeSeriesMetric = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.FloatNumberProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Coerce = propCoerce.Value, + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + IgnoreMalformed = propIgnoreMalformed.Value, + Index = propIndex.Value, + Meta = propMeta.Value, + NullValue = propNullValue.Value, + OnScriptError = propOnScriptError.Value, + Properties = propProperties.Value, + Script = propScript.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value, + TimeSeriesDimension = propTimeSeriesDimension.Value, + TimeSeriesMetric = propTimeSeriesMetric.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.FloatNumberProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNullValue, value.NullValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatNumberProperty.g.cs index 6552082019b..95adab83d8e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatNumberProperty.g.cs @@ -23,207 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class FloatNumberPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); - private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.FloatNumberProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propCoerce = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIgnoreMalformed = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propNullValue = default; - LocalJsonValue propOnScriptError = default; - LocalJsonValue propProperties = default; - LocalJsonValue propScript = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - LocalJsonValue propTimeSeriesDimension = default; - LocalJsonValue propTimeSeriesMetric = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.FloatNumberProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Coerce = propCoerce.Value, - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - IgnoreMalformed = propIgnoreMalformed.Value, - Index = propIndex.Value, - Meta = propMeta.Value, - NullValue = propNullValue.Value, - OnScriptError = propOnScriptError.Value, - Properties = propProperties.Value, - Script = propScript.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value, - TimeSeriesDimension = propTimeSeriesDimension.Value, - TimeSeriesMetric = propTimeSeriesMetric.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.FloatNumberProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNullValue, value.NullValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.FloatNumberPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.FloatNumberPropertyConverter))] public sealed partial class FloatNumberProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatRangeProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatRangeProperty.Converters.g.cs new file mode 100644 index 00000000000..07691ba0b15 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatRangeProperty.Converters.g.cs @@ -0,0 +1,170 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class FloatRangePropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.FloatRangeProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propCoerce = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propProperties = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.FloatRangeProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Coerce = propCoerce.Value, + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + Index = propIndex.Value, + Meta = propMeta.Value, + Properties = propProperties.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.FloatRangeProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatRangeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatRangeProperty.g.cs index 507824ff8db..32394023eac 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatRangeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatRangeProperty.g.cs @@ -23,153 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class FloatRangePropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.FloatRangeProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propCoerce = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propProperties = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.FloatRangeProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Coerce = propCoerce.Value, - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - Index = propIndex.Value, - Meta = propMeta.Value, - Properties = propProperties.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.FloatRangeProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.FloatRangePropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.FloatRangePropertyConverter))] public sealed partial class FloatRangeProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoOrientation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoOrientation.Converters.g.cs new file mode 100644 index 00000000000..0bc971dcc51 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoOrientation.Converters.g.cs @@ -0,0 +1,87 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class GeoOrientationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberLeft = System.Text.Json.JsonEncodedText.Encode("left"); + private static readonly System.Text.Json.JsonEncodedText MemberLeft1 = System.Text.Json.JsonEncodedText.Encode("LEFT"); + private static readonly System.Text.Json.JsonEncodedText MemberLeft2 = System.Text.Json.JsonEncodedText.Encode("clockwise"); + private static readonly System.Text.Json.JsonEncodedText MemberLeft3 = System.Text.Json.JsonEncodedText.Encode("cw"); + private static readonly System.Text.Json.JsonEncodedText MemberRight = System.Text.Json.JsonEncodedText.Encode("right"); + private static readonly System.Text.Json.JsonEncodedText MemberRight1 = System.Text.Json.JsonEncodedText.Encode("RIGHT"); + private static readonly System.Text.Json.JsonEncodedText MemberRight2 = System.Text.Json.JsonEncodedText.Encode("counterclockwise"); + private static readonly System.Text.Json.JsonEncodedText MemberRight3 = System.Text.Json.JsonEncodedText.Encode("ccw"); + + public override Elastic.Clients.Elasticsearch.Mapping.GeoOrientation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberLeft) || reader.ValueTextEquals(MemberLeft1) || reader.ValueTextEquals(MemberLeft2) || reader.ValueTextEquals(MemberLeft3)) + { + return Elastic.Clients.Elasticsearch.Mapping.GeoOrientation.Left; + } + + if (reader.ValueTextEquals(MemberRight) || reader.ValueTextEquals(MemberRight1) || reader.ValueTextEquals(MemberRight2) || reader.ValueTextEquals(MemberRight3)) + { + return Elastic.Clients.Elasticsearch.Mapping.GeoOrientation.Right; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberLeft.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberLeft1.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberLeft2.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberLeft3.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.GeoOrientation.Left; + } + + if (string.Equals(value, MemberRight.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberRight1.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberRight2.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberRight3.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.GeoOrientation.Right; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.GeoOrientation)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.GeoOrientation value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Mapping.GeoOrientation.Left: + writer.WriteStringValue(MemberLeft); + break; + case Elastic.Clients.Elasticsearch.Mapping.GeoOrientation.Right: + writer.WriteStringValue(MemberRight); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.GeoOrientation)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Mapping.GeoOrientation ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.GeoOrientation value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoOrientation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoOrientation.g.cs new file mode 100644 index 00000000000..9a1d7ef49ad --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoOrientation.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.GeoOrientationConverter))] +public enum GeoOrientation +{ + [System.Runtime.Serialization.EnumMember(Value = "left")] + Left, + [System.Runtime.Serialization.EnumMember(Value = "right")] + Right +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoPointMetricType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoPointMetricType.Converters.g.cs new file mode 100644 index 00000000000..9bdaa4d3e37 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoPointMetricType.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class GeoPointMetricTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCounter = System.Text.Json.JsonEncodedText.Encode("counter"); + private static readonly System.Text.Json.JsonEncodedText MemberGauge = System.Text.Json.JsonEncodedText.Encode("gauge"); + private static readonly System.Text.Json.JsonEncodedText MemberPosition = System.Text.Json.JsonEncodedText.Encode("position"); + + public override Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCounter)) + { + return Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType.Counter; + } + + if (reader.ValueTextEquals(MemberGauge)) + { + return Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType.Gauge; + } + + if (reader.ValueTextEquals(MemberPosition)) + { + return Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType.Position; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCounter.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType.Counter; + } + + if (string.Equals(value, MemberGauge.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType.Gauge; + } + + if (string.Equals(value, MemberPosition.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType.Position; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType.Counter: + writer.WriteStringValue(MemberCounter); + break; + case Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType.Gauge: + writer.WriteStringValue(MemberGauge); + break; + case Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType.Position: + writer.WriteStringValue(MemberPosition); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoPointMetricType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoPointMetricType.g.cs new file mode 100644 index 00000000000..94ce64486a3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoPointMetricType.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.GeoPointMetricTypeConverter))] +public enum GeoPointMetricType +{ + [System.Runtime.Serialization.EnumMember(Value = "counter")] + Counter, + [System.Runtime.Serialization.EnumMember(Value = "gauge")] + Gauge, + [System.Runtime.Serialization.EnumMember(Value = "position")] + Position +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoPointProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoPointProperty.Converters.g.cs new file mode 100644 index 00000000000..44fa6831959 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoPointProperty.Converters.g.cs @@ -0,0 +1,206 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class GeoPointPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreZValue = System.Text.Json.JsonEncodedText.Encode("ignore_z_value"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); + private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.GeoPointProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIgnoreMalformed = default; + LocalJsonValue propIgnoreZValue = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propNullValue = default; + LocalJsonValue propOnScriptError = default; + LocalJsonValue propProperties = default; + LocalJsonValue propScript = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + LocalJsonValue propTimeSeriesMetric = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreZValue.TryReadProperty(ref reader, options, PropIgnoreZValue, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, null)) + { + continue; + } + + if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.GeoPointProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + IgnoreMalformed = propIgnoreMalformed.Value, + IgnoreZValue = propIgnoreZValue.Value, + Index = propIndex.Value, + Meta = propMeta.Value, + NullValue = propNullValue.Value, + OnScriptError = propOnScriptError.Value, + Properties = propProperties.Value, + Script = propScript.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value, + TimeSeriesMetric = propTimeSeriesMetric.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.GeoPointProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreZValue, value.IgnoreZValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNullValue, value.NullValue, null, null); + writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoPointProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoPointProperty.g.cs index 1a8260eb73b..8cd9a10d712 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoPointProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoPointProperty.g.cs @@ -23,189 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class GeoPointPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreZValue = System.Text.Json.JsonEncodedText.Encode("ignore_z_value"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); - private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.GeoPointProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIgnoreMalformed = default; - LocalJsonValue propIgnoreZValue = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propNullValue = default; - LocalJsonValue propOnScriptError = default; - LocalJsonValue propProperties = default; - LocalJsonValue propScript = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - LocalJsonValue propTimeSeriesMetric = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreZValue.TryReadProperty(ref reader, options, PropIgnoreZValue, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, null)) - { - continue; - } - - if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.GeoPointProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - IgnoreMalformed = propIgnoreMalformed.Value, - IgnoreZValue = propIgnoreZValue.Value, - Index = propIndex.Value, - Meta = propMeta.Value, - NullValue = propNullValue.Value, - OnScriptError = propOnScriptError.Value, - Properties = propProperties.Value, - Script = propScript.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value, - TimeSeriesMetric = propTimeSeriesMetric.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.GeoPointProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreZValue, value.IgnoreZValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNullValue, value.NullValue, null, null); - writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.GeoPointMetricType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.GeoPointPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.GeoPointPropertyConverter))] public sealed partial class GeoPointProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoShapeProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoShapeProperty.Converters.g.cs new file mode 100644 index 00000000000..347163303e0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoShapeProperty.Converters.g.cs @@ -0,0 +1,197 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class GeoShapePropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreZValue = System.Text.Json.JsonEncodedText.Encode("ignore_z_value"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropOrientation = System.Text.Json.JsonEncodedText.Encode("orientation"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropStrategy = System.Text.Json.JsonEncodedText.Encode("strategy"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.GeoShapeProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCoerce = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIgnoreMalformed = default; + LocalJsonValue propIgnoreZValue = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propOrientation = default; + LocalJsonValue propProperties = default; + LocalJsonValue propStore = default; + LocalJsonValue propStrategy = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreZValue.TryReadProperty(ref reader, options, PropIgnoreZValue, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propOrientation.TryReadProperty(ref reader, options, PropOrientation, static Elastic.Clients.Elasticsearch.Mapping.GeoOrientation? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propStrategy.TryReadProperty(ref reader, options, PropStrategy, static Elastic.Clients.Elasticsearch.Mapping.GeoStrategy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.GeoShapeProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Coerce = propCoerce.Value, + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + IgnoreMalformed = propIgnoreMalformed.Value, + IgnoreZValue = propIgnoreZValue.Value, + Index = propIndex.Value, + Meta = propMeta.Value, + Orientation = propOrientation.Value, + Properties = propProperties.Value, + Store = propStore.Value, + Strategy = propStrategy.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.GeoShapeProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreZValue, value.IgnoreZValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropOrientation, value.Orientation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.GeoOrientation? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropStrategy, value.Strategy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.GeoStrategy? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoShapeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoShapeProperty.g.cs index 53fd20bc316..121aa3561a8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoShapeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoShapeProperty.g.cs @@ -23,179 +23,6 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class GeoShapePropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreZValue = System.Text.Json.JsonEncodedText.Encode("ignore_z_value"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropOrientation = System.Text.Json.JsonEncodedText.Encode("orientation"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropStrategy = System.Text.Json.JsonEncodedText.Encode("strategy"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.GeoShapeProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCoerce = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIgnoreMalformed = default; - LocalJsonValue propIgnoreZValue = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propOrientation = default; - LocalJsonValue propProperties = default; - LocalJsonValue propStore = default; - LocalJsonValue propStrategy = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreZValue.TryReadProperty(ref reader, options, PropIgnoreZValue, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propOrientation.TryReadProperty(ref reader, options, PropOrientation, static Elastic.Clients.Elasticsearch.Mapping.GeoOrientation? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propStrategy.TryReadProperty(ref reader, options, PropStrategy, static Elastic.Clients.Elasticsearch.Mapping.GeoStrategy? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.GeoShapeProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Coerce = propCoerce.Value, - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - IgnoreMalformed = propIgnoreMalformed.Value, - IgnoreZValue = propIgnoreZValue.Value, - Index = propIndex.Value, - Meta = propMeta.Value, - Orientation = propOrientation.Value, - Properties = propProperties.Value, - Store = propStore.Value, - Strategy = propStrategy.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.GeoShapeProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreZValue, value.IgnoreZValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropOrientation, value.Orientation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.GeoOrientation? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropStrategy, value.Strategy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.GeoStrategy? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - /// /// /// The geo_shape data type facilitates the indexing of and searching with arbitrary geo shapes such as rectangles @@ -203,7 +30,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// Learn more about this API in the Elasticsearch documentation. /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.GeoShapePropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.GeoShapePropertyConverter))] public sealed partial class GeoShapeProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoStrategy.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoStrategy.Converters.g.cs new file mode 100644 index 00000000000..091acebbe0a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoStrategy.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class GeoStrategyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberRecursive = System.Text.Json.JsonEncodedText.Encode("recursive"); + private static readonly System.Text.Json.JsonEncodedText MemberTerm = System.Text.Json.JsonEncodedText.Encode("term"); + + public override Elastic.Clients.Elasticsearch.Mapping.GeoStrategy Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberRecursive)) + { + return Elastic.Clients.Elasticsearch.Mapping.GeoStrategy.Recursive; + } + + if (reader.ValueTextEquals(MemberTerm)) + { + return Elastic.Clients.Elasticsearch.Mapping.GeoStrategy.Term; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberRecursive.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.GeoStrategy.Recursive; + } + + if (string.Equals(value, MemberTerm.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.GeoStrategy.Term; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.GeoStrategy)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.GeoStrategy value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Mapping.GeoStrategy.Recursive: + writer.WriteStringValue(MemberRecursive); + break; + case Elastic.Clients.Elasticsearch.Mapping.GeoStrategy.Term: + writer.WriteStringValue(MemberTerm); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.GeoStrategy)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Mapping.GeoStrategy ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.GeoStrategy value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoStrategy.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoStrategy.g.cs new file mode 100644 index 00000000000..04b1dc920a3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoStrategy.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.GeoStrategyConverter))] +public enum GeoStrategy +{ + [System.Runtime.Serialization.EnumMember(Value = "recursive")] + Recursive, + [System.Runtime.Serialization.EnumMember(Value = "term")] + Term +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HalfFloatNumberProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HalfFloatNumberProperty.Converters.g.cs new file mode 100644 index 00000000000..6af14f84394 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HalfFloatNumberProperty.Converters.g.cs @@ -0,0 +1,224 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class HalfFloatNumberPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); + private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.HalfFloatNumberProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propCoerce = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIgnoreMalformed = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propNullValue = default; + LocalJsonValue propOnScriptError = default; + LocalJsonValue propProperties = default; + LocalJsonValue propScript = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + LocalJsonValue propTimeSeriesDimension = default; + LocalJsonValue propTimeSeriesMetric = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.HalfFloatNumberProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Coerce = propCoerce.Value, + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + IgnoreMalformed = propIgnoreMalformed.Value, + Index = propIndex.Value, + Meta = propMeta.Value, + NullValue = propNullValue.Value, + OnScriptError = propOnScriptError.Value, + Properties = propProperties.Value, + Script = propScript.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value, + TimeSeriesDimension = propTimeSeriesDimension.Value, + TimeSeriesMetric = propTimeSeriesMetric.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.HalfFloatNumberProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNullValue, value.NullValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HalfFloatNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HalfFloatNumberProperty.g.cs index 0b0f1fc3496..5317bae307a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HalfFloatNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HalfFloatNumberProperty.g.cs @@ -23,207 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class HalfFloatNumberPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); - private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.HalfFloatNumberProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propCoerce = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIgnoreMalformed = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propNullValue = default; - LocalJsonValue propOnScriptError = default; - LocalJsonValue propProperties = default; - LocalJsonValue propScript = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - LocalJsonValue propTimeSeriesDimension = default; - LocalJsonValue propTimeSeriesMetric = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.HalfFloatNumberProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Coerce = propCoerce.Value, - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - IgnoreMalformed = propIgnoreMalformed.Value, - Index = propIndex.Value, - Meta = propMeta.Value, - NullValue = propNullValue.Value, - OnScriptError = propOnScriptError.Value, - Properties = propProperties.Value, - Script = propScript.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value, - TimeSeriesDimension = propTimeSeriesDimension.Value, - TimeSeriesMetric = propTimeSeriesMetric.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.HalfFloatNumberProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNullValue, value.NullValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.HalfFloatNumberPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.HalfFloatNumberPropertyConverter))] public sealed partial class HalfFloatNumberProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HistogramProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HistogramProperty.Converters.g.cs new file mode 100644 index 00000000000..92d769e4bb8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HistogramProperty.Converters.g.cs @@ -0,0 +1,125 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class HistogramPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.HistogramProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIgnoreMalformed = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propProperties = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.HistogramProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + IgnoreMalformed = propIgnoreMalformed.Value, + Meta = propMeta.Value, + Properties = propProperties.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.HistogramProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HistogramProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HistogramProperty.g.cs index 5c22b48282d..566bc5735c4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HistogramProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HistogramProperty.g.cs @@ -23,108 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class HistogramPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.HistogramProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIgnoreMalformed = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propProperties = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.HistogramProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - IgnoreMalformed = propIgnoreMalformed.Value, - Meta = propMeta.Value, - Properties = propProperties.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.HistogramProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.HistogramPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.HistogramPropertyConverter))] public sealed partial class HistogramProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IcuCollationProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IcuCollationProperty.Converters.g.cs new file mode 100644 index 00000000000..7392b5b7d63 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IcuCollationProperty.Converters.g.cs @@ -0,0 +1,287 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class IcuCollationPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAlternate = System.Text.Json.JsonEncodedText.Encode("alternate"); + private static readonly System.Text.Json.JsonEncodedText PropCaseFirst = System.Text.Json.JsonEncodedText.Encode("case_first"); + private static readonly System.Text.Json.JsonEncodedText PropCaseLevel = System.Text.Json.JsonEncodedText.Encode("case_level"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropCountry = System.Text.Json.JsonEncodedText.Encode("country"); + private static readonly System.Text.Json.JsonEncodedText PropDecomposition = System.Text.Json.JsonEncodedText.Encode("decomposition"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropHiraganaQuaternaryMode = System.Text.Json.JsonEncodedText.Encode("hiragana_quaternary_mode"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropIndexOptions = System.Text.Json.JsonEncodedText.Encode("index_options"); + private static readonly System.Text.Json.JsonEncodedText PropLanguage = System.Text.Json.JsonEncodedText.Encode("language"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropNorms = System.Text.Json.JsonEncodedText.Encode("norms"); + private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); + private static readonly System.Text.Json.JsonEncodedText PropNumeric = System.Text.Json.JsonEncodedText.Encode("numeric"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropRules = System.Text.Json.JsonEncodedText.Encode("rules"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropStrength = System.Text.Json.JsonEncodedText.Encode("strength"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVariableTop = System.Text.Json.JsonEncodedText.Encode("variable_top"); + private static readonly System.Text.Json.JsonEncodedText PropVariant = System.Text.Json.JsonEncodedText.Encode("variant"); + + public override Elastic.Clients.Elasticsearch.Mapping.IcuCollationProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAlternate = default; + LocalJsonValue propCaseFirst = default; + LocalJsonValue propCaseLevel = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propCountry = default; + LocalJsonValue propDecomposition = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propHiraganaQuaternaryMode = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIndex = default; + LocalJsonValue propIndexOptions = default; + LocalJsonValue propLanguage = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propNorms = default; + LocalJsonValue propNullValue = default; + LocalJsonValue propNumeric = default; + LocalJsonValue propProperties = default; + LocalJsonValue propRules = default; + LocalJsonValue propStore = default; + LocalJsonValue propStrength = default; + LocalJsonValue propSyntheticSourceKeep = default; + LocalJsonValue propVariableTop = default; + LocalJsonValue propVariant = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAlternate.TryReadProperty(ref reader, options, PropAlternate, static Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCaseFirst.TryReadProperty(ref reader, options, PropCaseFirst, static Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCaseLevel.TryReadProperty(ref reader, options, PropCaseLevel, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propCountry.TryReadProperty(ref reader, options, PropCountry, null)) + { + continue; + } + + if (propDecomposition.TryReadProperty(ref reader, options, PropDecomposition, static Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propHiraganaQuaternaryMode.TryReadProperty(ref reader, options, PropHiraganaQuaternaryMode, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndexOptions.TryReadProperty(ref reader, options, PropIndexOptions, static Elastic.Clients.Elasticsearch.Mapping.IndexOptions? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLanguage.TryReadProperty(ref reader, options, PropLanguage, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propNorms.TryReadProperty(ref reader, options, PropNorms, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, null)) + { + continue; + } + + if (propNumeric.TryReadProperty(ref reader, options, PropNumeric, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propRules.TryReadProperty(ref reader, options, PropRules, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propStrength.TryReadProperty(ref reader, options, PropStrength, static Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVariableTop.TryReadProperty(ref reader, options, PropVariableTop, null)) + { + continue; + } + + if (propVariant.TryReadProperty(ref reader, options, PropVariant, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.IcuCollationProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Alternate = propAlternate.Value, + CaseFirst = propCaseFirst.Value, + CaseLevel = propCaseLevel.Value, + CopyTo = propCopyTo.Value, + Country = propCountry.Value, + Decomposition = propDecomposition.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + HiraganaQuaternaryMode = propHiraganaQuaternaryMode.Value, + IgnoreAbove = propIgnoreAbove.Value, + Index = propIndex.Value, + IndexOptions = propIndexOptions.Value, + Language = propLanguage.Value, + Meta = propMeta.Value, + Norms = propNorms.Value, + NullValue = propNullValue.Value, + Numeric = propNumeric.Value, + Properties = propProperties.Value, + Rules = propRules.Value, + Store = propStore.Value, + Strength = propStrength.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value, + VariableTop = propVariableTop.Value, + Variant = propVariant.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.IcuCollationProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAlternate, value.Alternate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCaseFirst, value.CaseFirst, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCaseLevel, value.CaseLevel, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropCountry, value.Country, null, null); + writer.WriteProperty(options, PropDecomposition, value.Decomposition, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropHiraganaQuaternaryMode, value.HiraganaQuaternaryMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndexOptions, value.IndexOptions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.IndexOptions? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLanguage, value.Language, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNorms, value.Norms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNullValue, value.NullValue, null, null); + writer.WriteProperty(options, PropNumeric, value.Numeric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropRules, value.Rules, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropStrength, value.Strength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVariableTop, value.VariableTop, null, null); + writer.WriteProperty(options, PropVariant, value.Variant, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IcuCollationProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IcuCollationProperty.g.cs index c1436301755..5d87f284758 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IcuCollationProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IcuCollationProperty.g.cs @@ -23,270 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class IcuCollationPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAlternate = System.Text.Json.JsonEncodedText.Encode("alternate"); - private static readonly System.Text.Json.JsonEncodedText PropCaseFirst = System.Text.Json.JsonEncodedText.Encode("case_first"); - private static readonly System.Text.Json.JsonEncodedText PropCaseLevel = System.Text.Json.JsonEncodedText.Encode("case_level"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropCountry = System.Text.Json.JsonEncodedText.Encode("country"); - private static readonly System.Text.Json.JsonEncodedText PropDecomposition = System.Text.Json.JsonEncodedText.Encode("decomposition"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropHiraganaQuaternaryMode = System.Text.Json.JsonEncodedText.Encode("hiragana_quaternary_mode"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropIndexOptions = System.Text.Json.JsonEncodedText.Encode("index_options"); - private static readonly System.Text.Json.JsonEncodedText PropLanguage = System.Text.Json.JsonEncodedText.Encode("language"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropNorms = System.Text.Json.JsonEncodedText.Encode("norms"); - private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); - private static readonly System.Text.Json.JsonEncodedText PropNumeric = System.Text.Json.JsonEncodedText.Encode("numeric"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropRules = System.Text.Json.JsonEncodedText.Encode("rules"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropStrength = System.Text.Json.JsonEncodedText.Encode("strength"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropVariableTop = System.Text.Json.JsonEncodedText.Encode("variable_top"); - private static readonly System.Text.Json.JsonEncodedText PropVariant = System.Text.Json.JsonEncodedText.Encode("variant"); - - public override Elastic.Clients.Elasticsearch.Mapping.IcuCollationProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAlternate = default; - LocalJsonValue propCaseFirst = default; - LocalJsonValue propCaseLevel = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propCountry = default; - LocalJsonValue propDecomposition = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propHiraganaQuaternaryMode = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIndex = default; - LocalJsonValue propIndexOptions = default; - LocalJsonValue propLanguage = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propNorms = default; - LocalJsonValue propNullValue = default; - LocalJsonValue propNumeric = default; - LocalJsonValue propProperties = default; - LocalJsonValue propRules = default; - LocalJsonValue propStore = default; - LocalJsonValue propStrength = default; - LocalJsonValue propSyntheticSourceKeep = default; - LocalJsonValue propVariableTop = default; - LocalJsonValue propVariant = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAlternate.TryReadProperty(ref reader, options, PropAlternate, static Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCaseFirst.TryReadProperty(ref reader, options, PropCaseFirst, static Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCaseLevel.TryReadProperty(ref reader, options, PropCaseLevel, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propCountry.TryReadProperty(ref reader, options, PropCountry, null)) - { - continue; - } - - if (propDecomposition.TryReadProperty(ref reader, options, PropDecomposition, static Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propHiraganaQuaternaryMode.TryReadProperty(ref reader, options, PropHiraganaQuaternaryMode, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndexOptions.TryReadProperty(ref reader, options, PropIndexOptions, static Elastic.Clients.Elasticsearch.Mapping.IndexOptions? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLanguage.TryReadProperty(ref reader, options, PropLanguage, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propNorms.TryReadProperty(ref reader, options, PropNorms, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, null)) - { - continue; - } - - if (propNumeric.TryReadProperty(ref reader, options, PropNumeric, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propRules.TryReadProperty(ref reader, options, PropRules, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propStrength.TryReadProperty(ref reader, options, PropStrength, static Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propVariableTop.TryReadProperty(ref reader, options, PropVariableTop, null)) - { - continue; - } - - if (propVariant.TryReadProperty(ref reader, options, PropVariant, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.IcuCollationProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Alternate = propAlternate.Value, - CaseFirst = propCaseFirst.Value, - CaseLevel = propCaseLevel.Value, - CopyTo = propCopyTo.Value, - Country = propCountry.Value, - Decomposition = propDecomposition.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - HiraganaQuaternaryMode = propHiraganaQuaternaryMode.Value, - IgnoreAbove = propIgnoreAbove.Value, - Index = propIndex.Value, - IndexOptions = propIndexOptions.Value, - Language = propLanguage.Value, - Meta = propMeta.Value, - Norms = propNorms.Value, - NullValue = propNullValue.Value, - Numeric = propNumeric.Value, - Properties = propProperties.Value, - Rules = propRules.Value, - Store = propStore.Value, - Strength = propStrength.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value, - VariableTop = propVariableTop.Value, - Variant = propVariant.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.IcuCollationProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAlternate, value.Alternate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.IcuCollationAlternate? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCaseFirst, value.CaseFirst, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.IcuCollationCaseFirst? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCaseLevel, value.CaseLevel, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropCountry, value.Country, null, null); - writer.WriteProperty(options, PropDecomposition, value.Decomposition, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.IcuCollationDecomposition? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropHiraganaQuaternaryMode, value.HiraganaQuaternaryMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndexOptions, value.IndexOptions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.IndexOptions? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLanguage, value.Language, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNorms, value.Norms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNullValue, value.NullValue, null, null); - writer.WriteProperty(options, PropNumeric, value.Numeric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropRules, value.Rules, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropStrength, value.Strength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.IcuCollationStrength? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropVariableTop, value.VariableTop, null, null); - writer.WriteProperty(options, PropVariant, value.Variant, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.IcuCollationPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.IcuCollationPropertyConverter))] public sealed partial class IcuCollationProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IndexField.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IndexField.Converters.g.cs new file mode 100644 index 00000000000..ab7c15e6b85 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IndexField.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class IndexFieldConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + + public override Elastic.Clients.Elasticsearch.Mapping.IndexField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEnabled = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.IndexField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Enabled = propEnabled.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.IndexField value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IndexField.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IndexField.g.cs index 8c6943b2cd6..84616512fec 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IndexField.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IndexField.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class IndexFieldConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - - public override Elastic.Clients.Elasticsearch.Mapping.IndexField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEnabled = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.IndexField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Enabled = propEnabled.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.IndexField value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.IndexFieldConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.IndexFieldConverter))] public sealed partial class IndexField { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IndexOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IndexOptions.Converters.g.cs new file mode 100644 index 00000000000..559a23340e6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IndexOptions.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class IndexOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberDocs = System.Text.Json.JsonEncodedText.Encode("docs"); + private static readonly System.Text.Json.JsonEncodedText MemberFreqs = System.Text.Json.JsonEncodedText.Encode("freqs"); + private static readonly System.Text.Json.JsonEncodedText MemberOffsets = System.Text.Json.JsonEncodedText.Encode("offsets"); + private static readonly System.Text.Json.JsonEncodedText MemberPositions = System.Text.Json.JsonEncodedText.Encode("positions"); + + public override Elastic.Clients.Elasticsearch.Mapping.IndexOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberDocs)) + { + return Elastic.Clients.Elasticsearch.Mapping.IndexOptions.Docs; + } + + if (reader.ValueTextEquals(MemberFreqs)) + { + return Elastic.Clients.Elasticsearch.Mapping.IndexOptions.Freqs; + } + + if (reader.ValueTextEquals(MemberOffsets)) + { + return Elastic.Clients.Elasticsearch.Mapping.IndexOptions.Offsets; + } + + if (reader.ValueTextEquals(MemberPositions)) + { + return Elastic.Clients.Elasticsearch.Mapping.IndexOptions.Positions; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberDocs.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.IndexOptions.Docs; + } + + if (string.Equals(value, MemberFreqs.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.IndexOptions.Freqs; + } + + if (string.Equals(value, MemberOffsets.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.IndexOptions.Offsets; + } + + if (string.Equals(value, MemberPositions.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.IndexOptions.Positions; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.IndexOptions)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.IndexOptions value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Mapping.IndexOptions.Docs: + writer.WriteStringValue(MemberDocs); + break; + case Elastic.Clients.Elasticsearch.Mapping.IndexOptions.Freqs: + writer.WriteStringValue(MemberFreqs); + break; + case Elastic.Clients.Elasticsearch.Mapping.IndexOptions.Offsets: + writer.WriteStringValue(MemberOffsets); + break; + case Elastic.Clients.Elasticsearch.Mapping.IndexOptions.Positions: + writer.WriteStringValue(MemberPositions); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.IndexOptions)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Mapping.IndexOptions ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.IndexOptions value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IndexOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IndexOptions.g.cs new file mode 100644 index 00000000000..0b3e3339828 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IndexOptions.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.IndexOptionsConverter))] +public enum IndexOptions +{ + [System.Runtime.Serialization.EnumMember(Value = "docs")] + Docs, + [System.Runtime.Serialization.EnumMember(Value = "freqs")] + Freqs, + [System.Runtime.Serialization.EnumMember(Value = "offsets")] + Offsets, + [System.Runtime.Serialization.EnumMember(Value = "positions")] + Positions +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerNumberProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerNumberProperty.Converters.g.cs new file mode 100644 index 00000000000..f6224b6e6b7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerNumberProperty.Converters.g.cs @@ -0,0 +1,224 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class IntegerNumberPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); + private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.IntegerNumberProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propCoerce = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIgnoreMalformed = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propNullValue = default; + LocalJsonValue propOnScriptError = default; + LocalJsonValue propProperties = default; + LocalJsonValue propScript = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + LocalJsonValue propTimeSeriesDimension = default; + LocalJsonValue propTimeSeriesMetric = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.IntegerNumberProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Coerce = propCoerce.Value, + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + IgnoreMalformed = propIgnoreMalformed.Value, + Index = propIndex.Value, + Meta = propMeta.Value, + NullValue = propNullValue.Value, + OnScriptError = propOnScriptError.Value, + Properties = propProperties.Value, + Script = propScript.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value, + TimeSeriesDimension = propTimeSeriesDimension.Value, + TimeSeriesMetric = propTimeSeriesMetric.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.IntegerNumberProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNullValue, value.NullValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerNumberProperty.g.cs index 29481d60dd7..fc4ef9fe4da 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerNumberProperty.g.cs @@ -23,207 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class IntegerNumberPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); - private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.IntegerNumberProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propCoerce = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIgnoreMalformed = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propNullValue = default; - LocalJsonValue propOnScriptError = default; - LocalJsonValue propProperties = default; - LocalJsonValue propScript = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - LocalJsonValue propTimeSeriesDimension = default; - LocalJsonValue propTimeSeriesMetric = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.IntegerNumberProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Coerce = propCoerce.Value, - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - IgnoreMalformed = propIgnoreMalformed.Value, - Index = propIndex.Value, - Meta = propMeta.Value, - NullValue = propNullValue.Value, - OnScriptError = propOnScriptError.Value, - Properties = propProperties.Value, - Script = propScript.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value, - TimeSeriesDimension = propTimeSeriesDimension.Value, - TimeSeriesMetric = propTimeSeriesMetric.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.IntegerNumberProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNullValue, value.NullValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.IntegerNumberPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.IntegerNumberPropertyConverter))] public sealed partial class IntegerNumberProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerRangeProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerRangeProperty.Converters.g.cs new file mode 100644 index 00000000000..c5f3ae94ee3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerRangeProperty.Converters.g.cs @@ -0,0 +1,170 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class IntegerRangePropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.IntegerRangeProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propCoerce = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propProperties = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.IntegerRangeProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Coerce = propCoerce.Value, + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + Index = propIndex.Value, + Meta = propMeta.Value, + Properties = propProperties.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.IntegerRangeProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerRangeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerRangeProperty.g.cs index b073085bc64..4f144406918 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerRangeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerRangeProperty.g.cs @@ -23,153 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class IntegerRangePropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.IntegerRangeProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propCoerce = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propProperties = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.IntegerRangeProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Coerce = propCoerce.Value, - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - Index = propIndex.Value, - Meta = propMeta.Value, - Properties = propProperties.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.IntegerRangeProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.IntegerRangePropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.IntegerRangePropertyConverter))] public sealed partial class IntegerRangeProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpProperty.Converters.g.cs new file mode 100644 index 00000000000..7cf3823b945 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpProperty.Converters.g.cs @@ -0,0 +1,206 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class IpPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); + private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.IpProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIgnoreMalformed = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propNullValue = default; + LocalJsonValue propOnScriptError = default; + LocalJsonValue propProperties = default; + LocalJsonValue propScript = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + LocalJsonValue propTimeSeriesDimension = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, null)) + { + continue; + } + + if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.IpProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + IgnoreMalformed = propIgnoreMalformed.Value, + Index = propIndex.Value, + Meta = propMeta.Value, + NullValue = propNullValue.Value, + OnScriptError = propOnScriptError.Value, + Properties = propProperties.Value, + Script = propScript.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value, + TimeSeriesDimension = propTimeSeriesDimension.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.IpProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNullValue, value.NullValue, null, null); + writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpProperty.g.cs index d0f3ea2e00f..25de688ccc6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpProperty.g.cs @@ -23,189 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class IpPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); - private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.IpProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIgnoreMalformed = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propNullValue = default; - LocalJsonValue propOnScriptError = default; - LocalJsonValue propProperties = default; - LocalJsonValue propScript = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - LocalJsonValue propTimeSeriesDimension = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, null)) - { - continue; - } - - if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.IpProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - IgnoreMalformed = propIgnoreMalformed.Value, - Index = propIndex.Value, - Meta = propMeta.Value, - NullValue = propNullValue.Value, - OnScriptError = propOnScriptError.Value, - Properties = propProperties.Value, - Script = propScript.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value, - TimeSeriesDimension = propTimeSeriesDimension.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.IpProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNullValue, value.NullValue, null, null); - writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.IpPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.IpPropertyConverter))] public sealed partial class IpProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpRangeProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpRangeProperty.Converters.g.cs new file mode 100644 index 00000000000..ba7c15acdcf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpRangeProperty.Converters.g.cs @@ -0,0 +1,170 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class IpRangePropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.IpRangeProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propCoerce = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propProperties = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.IpRangeProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Coerce = propCoerce.Value, + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + Index = propIndex.Value, + Meta = propMeta.Value, + Properties = propProperties.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.IpRangeProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpRangeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpRangeProperty.g.cs index 07d7d60e95e..bdc7c23e328 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpRangeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpRangeProperty.g.cs @@ -23,153 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class IpRangePropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.IpRangeProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propCoerce = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propProperties = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.IpRangeProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Coerce = propCoerce.Value, - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - Index = propIndex.Value, - Meta = propMeta.Value, - Properties = propProperties.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.IpRangeProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.IpRangePropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.IpRangePropertyConverter))] public sealed partial class IpRangeProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/JoinProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/JoinProperty.Converters.g.cs new file mode 100644 index 00000000000..ddc637e29fd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/JoinProperty.Converters.g.cs @@ -0,0 +1,134 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class JoinPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropEagerGlobalOrdinals = System.Text.Json.JsonEncodedText.Encode("eager_global_ordinals"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropRelations = System.Text.Json.JsonEncodedText.Encode("relations"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.JoinProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDynamic = default; + LocalJsonValue propEagerGlobalOrdinals = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propProperties = default; + LocalJsonValue>?> propRelations = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEagerGlobalOrdinals.TryReadProperty(ref reader, options, PropEagerGlobalOrdinals, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propRelations.TryReadProperty(ref reader, options, PropRelations, static System.Collections.Generic.IDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.JoinProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Dynamic = propDynamic.Value, + EagerGlobalOrdinals = propEagerGlobalOrdinals.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + Meta = propMeta.Value, + Properties = propProperties.Value, + Relations = propRelations.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.JoinProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEagerGlobalOrdinals, value.EagerGlobalOrdinals, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropRelations, value.Relations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/JoinProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/JoinProperty.g.cs index 83968a038ea..7285d8b0aa5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/JoinProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/JoinProperty.g.cs @@ -23,117 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class JoinPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropEagerGlobalOrdinals = System.Text.Json.JsonEncodedText.Encode("eager_global_ordinals"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropRelations = System.Text.Json.JsonEncodedText.Encode("relations"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.JoinProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDynamic = default; - LocalJsonValue propEagerGlobalOrdinals = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propProperties = default; - LocalJsonValue>?> propRelations = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEagerGlobalOrdinals.TryReadProperty(ref reader, options, PropEagerGlobalOrdinals, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propRelations.TryReadProperty(ref reader, options, PropRelations, static System.Collections.Generic.IDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.JoinProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Dynamic = propDynamic.Value, - EagerGlobalOrdinals = propEagerGlobalOrdinals.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - Meta = propMeta.Value, - Properties = propProperties.Value, - Relations = propRelations.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.JoinProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEagerGlobalOrdinals, value.EagerGlobalOrdinals, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropRelations, value.Relations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.JoinPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.JoinPropertyConverter))] public sealed partial class JoinProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/KeywordProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/KeywordProperty.Converters.g.cs new file mode 100644 index 00000000000..09201b576a7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/KeywordProperty.Converters.g.cs @@ -0,0 +1,251 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class KeywordPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropEagerGlobalOrdinals = System.Text.Json.JsonEncodedText.Encode("eager_global_ordinals"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropIndexOptions = System.Text.Json.JsonEncodedText.Encode("index_options"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropNormalizer = System.Text.Json.JsonEncodedText.Encode("normalizer"); + private static readonly System.Text.Json.JsonEncodedText PropNorms = System.Text.Json.JsonEncodedText.Encode("norms"); + private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); + private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); + private static readonly System.Text.Json.JsonEncodedText PropSplitQueriesOnWhitespace = System.Text.Json.JsonEncodedText.Encode("split_queries_on_whitespace"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.KeywordProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propEagerGlobalOrdinals = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIndex = default; + LocalJsonValue propIndexOptions = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propNormalizer = default; + LocalJsonValue propNorms = default; + LocalJsonValue propNullValue = default; + LocalJsonValue propOnScriptError = default; + LocalJsonValue propProperties = default; + LocalJsonValue propScript = default; + LocalJsonValue propSimilarity = default; + LocalJsonValue propSplitQueriesOnWhitespace = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + LocalJsonValue propTimeSeriesDimension = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEagerGlobalOrdinals.TryReadProperty(ref reader, options, PropEagerGlobalOrdinals, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndexOptions.TryReadProperty(ref reader, options, PropIndexOptions, static Elastic.Clients.Elasticsearch.Mapping.IndexOptions? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propNormalizer.TryReadProperty(ref reader, options, PropNormalizer, null)) + { + continue; + } + + if (propNorms.TryReadProperty(ref reader, options, PropNorms, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, null)) + { + continue; + } + + if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, null)) + { + continue; + } + + if (propSplitQueriesOnWhitespace.TryReadProperty(ref reader, options, PropSplitQueriesOnWhitespace, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.KeywordProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + EagerGlobalOrdinals = propEagerGlobalOrdinals.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + Index = propIndex.Value, + IndexOptions = propIndexOptions.Value, + Meta = propMeta.Value, + Normalizer = propNormalizer.Value, + Norms = propNorms.Value, + NullValue = propNullValue.Value, + OnScriptError = propOnScriptError.Value, + Properties = propProperties.Value, + Script = propScript.Value, + Similarity = propSimilarity.Value, + SplitQueriesOnWhitespace = propSplitQueriesOnWhitespace.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value, + TimeSeriesDimension = propTimeSeriesDimension.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.KeywordProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEagerGlobalOrdinals, value.EagerGlobalOrdinals, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndexOptions, value.IndexOptions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.IndexOptions? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNormalizer, value.Normalizer, null, null); + writer.WriteProperty(options, PropNorms, value.Norms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNullValue, value.NullValue, null, null); + writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropSimilarity, value.Similarity, null, null); + writer.WriteProperty(options, PropSplitQueriesOnWhitespace, value.SplitQueriesOnWhitespace, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/KeywordProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/KeywordProperty.g.cs index ab736045544..36e1d2fa90a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/KeywordProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/KeywordProperty.g.cs @@ -23,234 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class KeywordPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropEagerGlobalOrdinals = System.Text.Json.JsonEncodedText.Encode("eager_global_ordinals"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropIndexOptions = System.Text.Json.JsonEncodedText.Encode("index_options"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropNormalizer = System.Text.Json.JsonEncodedText.Encode("normalizer"); - private static readonly System.Text.Json.JsonEncodedText PropNorms = System.Text.Json.JsonEncodedText.Encode("norms"); - private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); - private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); - private static readonly System.Text.Json.JsonEncodedText PropSplitQueriesOnWhitespace = System.Text.Json.JsonEncodedText.Encode("split_queries_on_whitespace"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.KeywordProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propEagerGlobalOrdinals = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIndex = default; - LocalJsonValue propIndexOptions = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propNormalizer = default; - LocalJsonValue propNorms = default; - LocalJsonValue propNullValue = default; - LocalJsonValue propOnScriptError = default; - LocalJsonValue propProperties = default; - LocalJsonValue propScript = default; - LocalJsonValue propSimilarity = default; - LocalJsonValue propSplitQueriesOnWhitespace = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - LocalJsonValue propTimeSeriesDimension = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEagerGlobalOrdinals.TryReadProperty(ref reader, options, PropEagerGlobalOrdinals, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndexOptions.TryReadProperty(ref reader, options, PropIndexOptions, static Elastic.Clients.Elasticsearch.Mapping.IndexOptions? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propNormalizer.TryReadProperty(ref reader, options, PropNormalizer, null)) - { - continue; - } - - if (propNorms.TryReadProperty(ref reader, options, PropNorms, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, null)) - { - continue; - } - - if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, null)) - { - continue; - } - - if (propSplitQueriesOnWhitespace.TryReadProperty(ref reader, options, PropSplitQueriesOnWhitespace, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.KeywordProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - EagerGlobalOrdinals = propEagerGlobalOrdinals.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - Index = propIndex.Value, - IndexOptions = propIndexOptions.Value, - Meta = propMeta.Value, - Normalizer = propNormalizer.Value, - Norms = propNorms.Value, - NullValue = propNullValue.Value, - OnScriptError = propOnScriptError.Value, - Properties = propProperties.Value, - Script = propScript.Value, - Similarity = propSimilarity.Value, - SplitQueriesOnWhitespace = propSplitQueriesOnWhitespace.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value, - TimeSeriesDimension = propTimeSeriesDimension.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.KeywordProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEagerGlobalOrdinals, value.EagerGlobalOrdinals, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndexOptions, value.IndexOptions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.IndexOptions? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNormalizer, value.Normalizer, null, null); - writer.WriteProperty(options, PropNorms, value.Norms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNullValue, value.NullValue, null, null); - writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropSimilarity, value.Similarity, null, null); - writer.WriteProperty(options, PropSplitQueriesOnWhitespace, value.SplitQueriesOnWhitespace, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.KeywordPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.KeywordPropertyConverter))] public sealed partial class KeywordProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongNumberProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongNumberProperty.Converters.g.cs new file mode 100644 index 00000000000..7aeebff0a69 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongNumberProperty.Converters.g.cs @@ -0,0 +1,224 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class LongNumberPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); + private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.LongNumberProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propCoerce = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIgnoreMalformed = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propNullValue = default; + LocalJsonValue propOnScriptError = default; + LocalJsonValue propProperties = default; + LocalJsonValue propScript = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + LocalJsonValue propTimeSeriesDimension = default; + LocalJsonValue propTimeSeriesMetric = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.LongNumberProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Coerce = propCoerce.Value, + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + IgnoreMalformed = propIgnoreMalformed.Value, + Index = propIndex.Value, + Meta = propMeta.Value, + NullValue = propNullValue.Value, + OnScriptError = propOnScriptError.Value, + Properties = propProperties.Value, + Script = propScript.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value, + TimeSeriesDimension = propTimeSeriesDimension.Value, + TimeSeriesMetric = propTimeSeriesMetric.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.LongNumberProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNullValue, value.NullValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongNumberProperty.g.cs index a2f1aca80d9..8b1b61888bd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongNumberProperty.g.cs @@ -23,207 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class LongNumberPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); - private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.LongNumberProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propCoerce = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIgnoreMalformed = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propNullValue = default; - LocalJsonValue propOnScriptError = default; - LocalJsonValue propProperties = default; - LocalJsonValue propScript = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - LocalJsonValue propTimeSeriesDimension = default; - LocalJsonValue propTimeSeriesMetric = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.LongNumberProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Coerce = propCoerce.Value, - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - IgnoreMalformed = propIgnoreMalformed.Value, - Index = propIndex.Value, - Meta = propMeta.Value, - NullValue = propNullValue.Value, - OnScriptError = propOnScriptError.Value, - Properties = propProperties.Value, - Script = propScript.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value, - TimeSeriesDimension = propTimeSeriesDimension.Value, - TimeSeriesMetric = propTimeSeriesMetric.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.LongNumberProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNullValue, value.NullValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.LongNumberPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.LongNumberPropertyConverter))] public sealed partial class LongNumberProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongRangeProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongRangeProperty.Converters.g.cs new file mode 100644 index 00000000000..72a82c72190 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongRangeProperty.Converters.g.cs @@ -0,0 +1,170 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class LongRangePropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.LongRangeProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propCoerce = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propProperties = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.LongRangeProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Coerce = propCoerce.Value, + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + Index = propIndex.Value, + Meta = propMeta.Value, + Properties = propProperties.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.LongRangeProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongRangeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongRangeProperty.g.cs index 43c819273dd..e644e596ab6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongRangeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongRangeProperty.g.cs @@ -23,153 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class LongRangePropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.LongRangeProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propCoerce = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propProperties = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.LongRangeProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Coerce = propCoerce.Value, - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - Index = propIndex.Value, - Meta = propMeta.Value, - Properties = propProperties.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.LongRangeProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.LongRangePropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.LongRangePropertyConverter))] public sealed partial class LongRangeProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/MatchOnlyTextProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/MatchOnlyTextProperty.Converters.g.cs new file mode 100644 index 00000000000..3d008ecf5d9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/MatchOnlyTextProperty.Converters.g.cs @@ -0,0 +1,89 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class MatchOnlyTextPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.MatchOnlyTextProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCopyTo = default; + LocalJsonValue propFields = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.MatchOnlyTextProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CopyTo = propCopyTo.Value, + Fields = propFields.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.MatchOnlyTextProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/MatchOnlyTextProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/MatchOnlyTextProperty.g.cs index fc024575c4e..3e77bb707f5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/MatchOnlyTextProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/MatchOnlyTextProperty.g.cs @@ -23,71 +23,6 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class MatchOnlyTextPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.MatchOnlyTextProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCopyTo = default; - LocalJsonValue propFields = default; - LocalJsonValue?> propMeta = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.MatchOnlyTextProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CopyTo = propCopyTo.Value, - Fields = propFields.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.MatchOnlyTextProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - /// /// /// A variant of text that trades scoring and efficiency of positional queries for space efficiency. This field @@ -97,7 +32,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// to verify whether a phrase matches. All queries return constant scores that are equal to 1.0. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.MatchOnlyTextPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.MatchOnlyTextPropertyConverter))] public sealed partial class MatchOnlyTextProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/MatchType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/MatchType.Converters.g.cs new file mode 100644 index 00000000000..8b91ab70428 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/MatchType.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class MatchTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberRegex = System.Text.Json.JsonEncodedText.Encode("regex"); + private static readonly System.Text.Json.JsonEncodedText MemberSimple = System.Text.Json.JsonEncodedText.Encode("simple"); + + public override Elastic.Clients.Elasticsearch.Mapping.MatchType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberRegex)) + { + return Elastic.Clients.Elasticsearch.Mapping.MatchType.Regex; + } + + if (reader.ValueTextEquals(MemberSimple)) + { + return Elastic.Clients.Elasticsearch.Mapping.MatchType.Simple; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberRegex.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.MatchType.Regex; + } + + if (string.Equals(value, MemberSimple.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.MatchType.Simple; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.MatchType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.MatchType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Mapping.MatchType.Regex: + writer.WriteStringValue(MemberRegex); + break; + case Elastic.Clients.Elasticsearch.Mapping.MatchType.Simple: + writer.WriteStringValue(MemberSimple); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.MatchType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Mapping.MatchType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.MatchType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/MatchType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/MatchType.g.cs new file mode 100644 index 00000000000..3796ab9c03c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/MatchType.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.MatchTypeConverter))] +public enum MatchType +{ + [System.Runtime.Serialization.EnumMember(Value = "regex")] + Regex, + [System.Runtime.Serialization.EnumMember(Value = "simple")] + Simple +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Murmur3HashProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Murmur3HashProperty.Converters.g.cs new file mode 100644 index 00000000000..bc2789a3928 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Murmur3HashProperty.Converters.g.cs @@ -0,0 +1,143 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class Murmur3HashPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.Murmur3HashProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propProperties = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.Murmur3HashProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + Meta = propMeta.Value, + Properties = propProperties.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.Murmur3HashProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Murmur3HashProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Murmur3HashProperty.g.cs index a6cfa4bbeea..a24cbd0966c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Murmur3HashProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Murmur3HashProperty.g.cs @@ -23,126 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class Murmur3HashPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.Murmur3HashProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propProperties = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.Murmur3HashProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - Meta = propMeta.Value, - Properties = propProperties.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.Murmur3HashProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Murmur3HashPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.Murmur3HashPropertyConverter))] public sealed partial class Murmur3HashProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/NestedProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/NestedProperty.Converters.g.cs new file mode 100644 index 00000000000..b685d055c51 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/NestedProperty.Converters.g.cs @@ -0,0 +1,161 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class NestedPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIncludeInParent = System.Text.Json.JsonEncodedText.Encode("include_in_parent"); + private static readonly System.Text.Json.JsonEncodedText PropIncludeInRoot = System.Text.Json.JsonEncodedText.Encode("include_in_root"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.NestedProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCopyTo = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIncludeInParent = default; + LocalJsonValue propIncludeInRoot = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propProperties = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIncludeInParent.TryReadProperty(ref reader, options, PropIncludeInParent, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIncludeInRoot.TryReadProperty(ref reader, options, PropIncludeInRoot, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.NestedProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CopyTo = propCopyTo.Value, + Dynamic = propDynamic.Value, + Enabled = propEnabled.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + IncludeInParent = propIncludeInParent.Value, + IncludeInRoot = propIncludeInRoot.Value, + Meta = propMeta.Value, + Properties = propProperties.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.NestedProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIncludeInParent, value.IncludeInParent, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIncludeInRoot, value.IncludeInRoot, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/NestedProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/NestedProperty.g.cs index b1e3461f066..72511647a22 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/NestedProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/NestedProperty.g.cs @@ -23,144 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class NestedPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIncludeInParent = System.Text.Json.JsonEncodedText.Encode("include_in_parent"); - private static readonly System.Text.Json.JsonEncodedText PropIncludeInRoot = System.Text.Json.JsonEncodedText.Encode("include_in_root"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.NestedProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCopyTo = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIncludeInParent = default; - LocalJsonValue propIncludeInRoot = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propProperties = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIncludeInParent.TryReadProperty(ref reader, options, PropIncludeInParent, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIncludeInRoot.TryReadProperty(ref reader, options, PropIncludeInRoot, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.NestedProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CopyTo = propCopyTo.Value, - Dynamic = propDynamic.Value, - Enabled = propEnabled.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - IncludeInParent = propIncludeInParent.Value, - IncludeInRoot = propIncludeInRoot.Value, - Meta = propMeta.Value, - Properties = propProperties.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.NestedProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIncludeInParent, value.IncludeInParent, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIncludeInRoot, value.IncludeInRoot, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.NestedPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.NestedPropertyConverter))] public sealed partial class NestedProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ObjectProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ObjectProperty.Converters.g.cs new file mode 100644 index 00000000000..58a92bf2ed6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ObjectProperty.Converters.g.cs @@ -0,0 +1,152 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class ObjectPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSubobjects = System.Text.Json.JsonEncodedText.Encode("subobjects"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.ObjectProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCopyTo = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propProperties = default; + LocalJsonValue propStore = default; + LocalJsonValue propSubobjects = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSubobjects.TryReadProperty(ref reader, options, PropSubobjects, static Elastic.Clients.Elasticsearch.Mapping.Subobjects? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.ObjectProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CopyTo = propCopyTo.Value, + Dynamic = propDynamic.Value, + Enabled = propEnabled.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + Meta = propMeta.Value, + Properties = propProperties.Value, + Store = propStore.Value, + Subobjects = propSubobjects.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.ObjectProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSubobjects, value.Subobjects, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.Subobjects? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ObjectProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ObjectProperty.g.cs index 74b0d06742d..75b6d77dbe0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ObjectProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ObjectProperty.g.cs @@ -23,135 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class ObjectPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSubobjects = System.Text.Json.JsonEncodedText.Encode("subobjects"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.ObjectProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCopyTo = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propProperties = default; - LocalJsonValue propStore = default; - LocalJsonValue propSubobjects = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSubobjects.TryReadProperty(ref reader, options, PropSubobjects, static Elastic.Clients.Elasticsearch.Mapping.Subobjects? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.ObjectProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CopyTo = propCopyTo.Value, - Dynamic = propDynamic.Value, - Enabled = propEnabled.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - Meta = propMeta.Value, - Properties = propProperties.Value, - Store = propStore.Value, - Subobjects = propSubobjects.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.ObjectProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSubobjects, value.Subobjects, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.Subobjects? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.ObjectPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.ObjectPropertyConverter))] public sealed partial class ObjectProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/OnScriptError.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/OnScriptError.Converters.g.cs new file mode 100644 index 00000000000..babba82183c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/OnScriptError.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class OnScriptErrorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberContinue = System.Text.Json.JsonEncodedText.Encode("continue"); + private static readonly System.Text.Json.JsonEncodedText MemberFail = System.Text.Json.JsonEncodedText.Encode("fail"); + + public override Elastic.Clients.Elasticsearch.Mapping.OnScriptError Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberContinue)) + { + return Elastic.Clients.Elasticsearch.Mapping.OnScriptError.Continue; + } + + if (reader.ValueTextEquals(MemberFail)) + { + return Elastic.Clients.Elasticsearch.Mapping.OnScriptError.Fail; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberContinue.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.OnScriptError.Continue; + } + + if (string.Equals(value, MemberFail.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.OnScriptError.Fail; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.OnScriptError)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.OnScriptError value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Mapping.OnScriptError.Continue: + writer.WriteStringValue(MemberContinue); + break; + case Elastic.Clients.Elasticsearch.Mapping.OnScriptError.Fail: + writer.WriteStringValue(MemberFail); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.OnScriptError)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Mapping.OnScriptError ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.OnScriptError value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/OnScriptError.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/OnScriptError.g.cs new file mode 100644 index 00000000000..f6b8b7c46c5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/OnScriptError.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.OnScriptErrorConverter))] +public enum OnScriptError +{ + [System.Runtime.Serialization.EnumMember(Value = "continue")] + Continue, + [System.Runtime.Serialization.EnumMember(Value = "fail")] + Fail +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PassthroughObjectProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PassthroughObjectProperty.Converters.g.cs new file mode 100644 index 00000000000..7fe4abeeb8a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PassthroughObjectProperty.Converters.g.cs @@ -0,0 +1,161 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class PassthroughObjectPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropPriority = System.Text.Json.JsonEncodedText.Encode("priority"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.PassthroughObjectProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCopyTo = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propPriority = default; + LocalJsonValue propProperties = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + LocalJsonValue propTimeSeriesDimension = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propPriority.TryReadProperty(ref reader, options, PropPriority, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.PassthroughObjectProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CopyTo = propCopyTo.Value, + Dynamic = propDynamic.Value, + Enabled = propEnabled.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + Meta = propMeta.Value, + Priority = propPriority.Value, + Properties = propProperties.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value, + TimeSeriesDimension = propTimeSeriesDimension.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.PassthroughObjectProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropPriority, value.Priority, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PassthroughObjectProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PassthroughObjectProperty.g.cs index c4d4de33778..998a5a48bfb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PassthroughObjectProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PassthroughObjectProperty.g.cs @@ -23,144 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class PassthroughObjectPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropPriority = System.Text.Json.JsonEncodedText.Encode("priority"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.PassthroughObjectProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCopyTo = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propPriority = default; - LocalJsonValue propProperties = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - LocalJsonValue propTimeSeriesDimension = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propPriority.TryReadProperty(ref reader, options, PropPriority, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.PassthroughObjectProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CopyTo = propCopyTo.Value, - Dynamic = propDynamic.Value, - Enabled = propEnabled.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - Meta = propMeta.Value, - Priority = propPriority.Value, - Properties = propProperties.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value, - TimeSeriesDimension = propTimeSeriesDimension.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.PassthroughObjectProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropPriority, value.Priority, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.PassthroughObjectPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.PassthroughObjectPropertyConverter))] public sealed partial class PassthroughObjectProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PercolatorProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PercolatorProperty.Converters.g.cs new file mode 100644 index 00000000000..e8349ef56ff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PercolatorProperty.Converters.g.cs @@ -0,0 +1,116 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class PercolatorPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.PercolatorProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propProperties = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.PercolatorProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + Meta = propMeta.Value, + Properties = propProperties.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.PercolatorProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PercolatorProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PercolatorProperty.g.cs index 59227dfadde..eb291a37a3f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PercolatorProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PercolatorProperty.g.cs @@ -23,99 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class PercolatorPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.PercolatorProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propProperties = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.PercolatorProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - Meta = propMeta.Value, - Properties = propProperties.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.PercolatorProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.PercolatorPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.PercolatorPropertyConverter))] public sealed partial class PercolatorProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PointProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PointProperty.Converters.g.cs new file mode 100644 index 00000000000..c87467e58b8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PointProperty.Converters.g.cs @@ -0,0 +1,170 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class PointPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreZValue = System.Text.Json.JsonEncodedText.Encode("ignore_z_value"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.PointProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIgnoreMalformed = default; + LocalJsonValue propIgnoreZValue = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propNullValue = default; + LocalJsonValue propProperties = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreZValue.TryReadProperty(ref reader, options, PropIgnoreZValue, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, null)) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.PointProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + IgnoreMalformed = propIgnoreMalformed.Value, + IgnoreZValue = propIgnoreZValue.Value, + Meta = propMeta.Value, + NullValue = propNullValue.Value, + Properties = propProperties.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.PointProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreZValue, value.IgnoreZValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNullValue, value.NullValue, null, null); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PointProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PointProperty.g.cs index dd3499ef5a9..45dec877793 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PointProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PointProperty.g.cs @@ -23,153 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class PointPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreZValue = System.Text.Json.JsonEncodedText.Encode("ignore_z_value"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.PointProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIgnoreMalformed = default; - LocalJsonValue propIgnoreZValue = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propNullValue = default; - LocalJsonValue propProperties = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreZValue.TryReadProperty(ref reader, options, PropIgnoreZValue, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, null)) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.PointProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - IgnoreMalformed = propIgnoreMalformed.Value, - IgnoreZValue = propIgnoreZValue.Value, - Meta = propMeta.Value, - NullValue = propNullValue.Value, - Properties = propProperties.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.PointProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreZValue, value.IgnoreZValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNullValue, value.NullValue, null, null); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.PointPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.PointPropertyConverter))] public sealed partial class PointProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Property.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Property.Converters.g.cs new file mode 100644 index 00000000000..bd051b571e2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Property.Converters.g.cs @@ -0,0 +1,268 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class IPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDiscriminator = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.IProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + var readerSnapshot = reader; + string? discriminator = "object"; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.TryReadProperty(options, PropDiscriminator, ref discriminator, null)) + { + break; + } + + reader.Skip(); + } + + reader = readerSnapshot; + return discriminator switch + { + "{dynamic_type}" => reader.ReadValue(options, null), + "aggregate_metric_double" => reader.ReadValue(options, null), + "alias" => reader.ReadValue(options, null), + "binary" => reader.ReadValue(options, null), + "boolean" => reader.ReadValue(options, null), + "byte" => reader.ReadValue(options, null), + "completion" => reader.ReadValue(options, null), + "constant_keyword" => reader.ReadValue(options, null), + "counted_keyword" => reader.ReadValue(options, null), + "date" => reader.ReadValue(options, null), + "date_nanos" => reader.ReadValue(options, null), + "date_range" => reader.ReadValue(options, null), + "dense_vector" => reader.ReadValue(options, null), + "double" => reader.ReadValue(options, null), + "double_range" => reader.ReadValue(options, null), + "flattened" => reader.ReadValue(options, null), + "float" => reader.ReadValue(options, null), + "float_range" => reader.ReadValue(options, null), + "geo_point" => reader.ReadValue(options, null), + "geo_shape" => reader.ReadValue(options, null), + "half_float" => reader.ReadValue(options, null), + "histogram" => reader.ReadValue(options, null), + "icu_collation_keyword" => reader.ReadValue(options, null), + "integer" => reader.ReadValue(options, null), + "integer_range" => reader.ReadValue(options, null), + "ip" => reader.ReadValue(options, null), + "ip_range" => reader.ReadValue(options, null), + "join" => reader.ReadValue(options, null), + "keyword" => reader.ReadValue(options, null), + "long" => reader.ReadValue(options, null), + "long_range" => reader.ReadValue(options, null), + "match_only_text" => reader.ReadValue(options, null), + "murmur3" => reader.ReadValue(options, null), + "nested" => reader.ReadValue(options, null), + "object" => reader.ReadValue(options, null), + "passthrough" => reader.ReadValue(options, null), + "percolator" => reader.ReadValue(options, null), + "point" => reader.ReadValue(options, null), + "rank_feature" => reader.ReadValue(options, null), + "rank_features" => reader.ReadValue(options, null), + "rank_vectors" => reader.ReadValue(options, null), + "scaled_float" => reader.ReadValue(options, null), + "search_as_you_type" => reader.ReadValue(options, null), + "semantic_text" => reader.ReadValue(options, null), + "shape" => reader.ReadValue(options, null), + "short" => reader.ReadValue(options, null), + "sparse_vector" => reader.ReadValue(options, null), + "text" => reader.ReadValue(options, null), + "token_count" => reader.ReadValue(options, null), + "unsigned_long" => reader.ReadValue(options, null), + "version" => reader.ReadValue(options, null), + "wildcard" => reader.ReadValue(options, null), + _ => throw new System.Text.Json.JsonException($"Variant '{discriminator}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Mapping.IProperty)}'.") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.IProperty value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Type) + { + case "{dynamic_type}": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.DynamicProperty)value, null); + break; + case "aggregate_metric_double": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.AggregateMetricDoubleProperty)value, null); + break; + case "alias": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.FieldAliasProperty)value, null); + break; + case "binary": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.BinaryProperty)value, null); + break; + case "boolean": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.BooleanProperty)value, null); + break; + case "byte": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.ByteNumberProperty)value, null); + break; + case "completion": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.CompletionProperty)value, null); + break; + case "constant_keyword": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.ConstantKeywordProperty)value, null); + break; + case "counted_keyword": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.CountedKeywordProperty)value, null); + break; + case "date": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.DateProperty)value, null); + break; + case "date_nanos": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.DateNanosProperty)value, null); + break; + case "date_range": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.DateRangeProperty)value, null); + break; + case "dense_vector": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.DenseVectorProperty)value, null); + break; + case "double": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.DoubleNumberProperty)value, null); + break; + case "double_range": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.DoubleRangeProperty)value, null); + break; + case "flattened": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.FlattenedProperty)value, null); + break; + case "float": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.FloatNumberProperty)value, null); + break; + case "float_range": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.FloatRangeProperty)value, null); + break; + case "geo_point": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.GeoPointProperty)value, null); + break; + case "geo_shape": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.GeoShapeProperty)value, null); + break; + case "half_float": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.HalfFloatNumberProperty)value, null); + break; + case "histogram": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.HistogramProperty)value, null); + break; + case "icu_collation_keyword": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.IcuCollationProperty)value, null); + break; + case "integer": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.IntegerNumberProperty)value, null); + break; + case "integer_range": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.IntegerRangeProperty)value, null); + break; + case "ip": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.IpProperty)value, null); + break; + case "ip_range": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.IpRangeProperty)value, null); + break; + case "join": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.JoinProperty)value, null); + break; + case "keyword": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.KeywordProperty)value, null); + break; + case "long": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.LongNumberProperty)value, null); + break; + case "long_range": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.LongRangeProperty)value, null); + break; + case "match_only_text": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.MatchOnlyTextProperty)value, null); + break; + case "murmur3": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.Murmur3HashProperty)value, null); + break; + case "nested": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.NestedProperty)value, null); + break; + case "object": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.ObjectProperty)value, null); + break; + case "passthrough": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.PassthroughObjectProperty)value, null); + break; + case "percolator": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.PercolatorProperty)value, null); + break; + case "point": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.PointProperty)value, null); + break; + case "rank_feature": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.RankFeatureProperty)value, null); + break; + case "rank_features": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.RankFeaturesProperty)value, null); + break; + case "rank_vectors": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.RankVectorProperty)value, null); + break; + case "scaled_float": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.ScaledFloatNumberProperty)value, null); + break; + case "search_as_you_type": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.SearchAsYouTypeProperty)value, null); + break; + case "semantic_text": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.SemanticTextProperty)value, null); + break; + case "shape": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.ShapeProperty)value, null); + break; + case "short": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.ShortNumberProperty)value, null); + break; + case "sparse_vector": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.SparseVectorProperty)value, null); + break; + case "text": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.TextProperty)value, null); + break; + case "token_count": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.TokenCountProperty)value, null); + break; + case "unsigned_long": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.UnsignedLongNumberProperty)value, null); + break; + case "version": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.VersionProperty)value, null); + break; + case "wildcard": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.WildcardProperty)value, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.Type}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Mapping.IProperty)}'."); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Property.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Property.g.cs index e54747f7acd..8c2cfe9ab6c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Property.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Property.g.cs @@ -23,251 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class IPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDiscriminator = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.IProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - var readerSnapshot = reader; - string? discriminator = "object"; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.TryReadProperty(options, PropDiscriminator, ref discriminator, null)) - { - break; - } - - reader.Skip(); - } - - reader = readerSnapshot; - return discriminator switch - { - "{dynamic_type}" => reader.ReadValue(options, null), - "aggregate_metric_double" => reader.ReadValue(options, null), - "alias" => reader.ReadValue(options, null), - "binary" => reader.ReadValue(options, null), - "boolean" => reader.ReadValue(options, null), - "byte" => reader.ReadValue(options, null), - "completion" => reader.ReadValue(options, null), - "constant_keyword" => reader.ReadValue(options, null), - "counted_keyword" => reader.ReadValue(options, null), - "date" => reader.ReadValue(options, null), - "date_nanos" => reader.ReadValue(options, null), - "date_range" => reader.ReadValue(options, null), - "dense_vector" => reader.ReadValue(options, null), - "double" => reader.ReadValue(options, null), - "double_range" => reader.ReadValue(options, null), - "flattened" => reader.ReadValue(options, null), - "float" => reader.ReadValue(options, null), - "float_range" => reader.ReadValue(options, null), - "geo_point" => reader.ReadValue(options, null), - "geo_shape" => reader.ReadValue(options, null), - "half_float" => reader.ReadValue(options, null), - "histogram" => reader.ReadValue(options, null), - "icu_collation_keyword" => reader.ReadValue(options, null), - "integer" => reader.ReadValue(options, null), - "integer_range" => reader.ReadValue(options, null), - "ip" => reader.ReadValue(options, null), - "ip_range" => reader.ReadValue(options, null), - "join" => reader.ReadValue(options, null), - "keyword" => reader.ReadValue(options, null), - "long" => reader.ReadValue(options, null), - "long_range" => reader.ReadValue(options, null), - "match_only_text" => reader.ReadValue(options, null), - "murmur3" => reader.ReadValue(options, null), - "nested" => reader.ReadValue(options, null), - "object" => reader.ReadValue(options, null), - "passthrough" => reader.ReadValue(options, null), - "percolator" => reader.ReadValue(options, null), - "point" => reader.ReadValue(options, null), - "rank_feature" => reader.ReadValue(options, null), - "rank_features" => reader.ReadValue(options, null), - "rank_vectors" => reader.ReadValue(options, null), - "scaled_float" => reader.ReadValue(options, null), - "search_as_you_type" => reader.ReadValue(options, null), - "semantic_text" => reader.ReadValue(options, null), - "shape" => reader.ReadValue(options, null), - "short" => reader.ReadValue(options, null), - "sparse_vector" => reader.ReadValue(options, null), - "text" => reader.ReadValue(options, null), - "token_count" => reader.ReadValue(options, null), - "unsigned_long" => reader.ReadValue(options, null), - "version" => reader.ReadValue(options, null), - "wildcard" => reader.ReadValue(options, null), - _ => throw new System.Text.Json.JsonException($"Variant '{discriminator}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Mapping.IProperty)}'.") - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.IProperty value, System.Text.Json.JsonSerializerOptions options) - { - switch (value.Type) - { - case "{dynamic_type}": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.DynamicProperty)value, null); - break; - case "aggregate_metric_double": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.AggregateMetricDoubleProperty)value, null); - break; - case "alias": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.FieldAliasProperty)value, null); - break; - case "binary": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.BinaryProperty)value, null); - break; - case "boolean": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.BooleanProperty)value, null); - break; - case "byte": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.ByteNumberProperty)value, null); - break; - case "completion": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.CompletionProperty)value, null); - break; - case "constant_keyword": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.ConstantKeywordProperty)value, null); - break; - case "counted_keyword": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.CountedKeywordProperty)value, null); - break; - case "date": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.DateProperty)value, null); - break; - case "date_nanos": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.DateNanosProperty)value, null); - break; - case "date_range": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.DateRangeProperty)value, null); - break; - case "dense_vector": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.DenseVectorProperty)value, null); - break; - case "double": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.DoubleNumberProperty)value, null); - break; - case "double_range": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.DoubleRangeProperty)value, null); - break; - case "flattened": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.FlattenedProperty)value, null); - break; - case "float": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.FloatNumberProperty)value, null); - break; - case "float_range": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.FloatRangeProperty)value, null); - break; - case "geo_point": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.GeoPointProperty)value, null); - break; - case "geo_shape": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.GeoShapeProperty)value, null); - break; - case "half_float": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.HalfFloatNumberProperty)value, null); - break; - case "histogram": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.HistogramProperty)value, null); - break; - case "icu_collation_keyword": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.IcuCollationProperty)value, null); - break; - case "integer": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.IntegerNumberProperty)value, null); - break; - case "integer_range": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.IntegerRangeProperty)value, null); - break; - case "ip": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.IpProperty)value, null); - break; - case "ip_range": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.IpRangeProperty)value, null); - break; - case "join": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.JoinProperty)value, null); - break; - case "keyword": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.KeywordProperty)value, null); - break; - case "long": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.LongNumberProperty)value, null); - break; - case "long_range": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.LongRangeProperty)value, null); - break; - case "match_only_text": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.MatchOnlyTextProperty)value, null); - break; - case "murmur3": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.Murmur3HashProperty)value, null); - break; - case "nested": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.NestedProperty)value, null); - break; - case "object": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.ObjectProperty)value, null); - break; - case "passthrough": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.PassthroughObjectProperty)value, null); - break; - case "percolator": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.PercolatorProperty)value, null); - break; - case "point": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.PointProperty)value, null); - break; - case "rank_feature": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.RankFeatureProperty)value, null); - break; - case "rank_features": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.RankFeaturesProperty)value, null); - break; - case "rank_vectors": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.RankVectorProperty)value, null); - break; - case "scaled_float": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.ScaledFloatNumberProperty)value, null); - break; - case "search_as_you_type": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.SearchAsYouTypeProperty)value, null); - break; - case "semantic_text": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.SemanticTextProperty)value, null); - break; - case "shape": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.ShapeProperty)value, null); - break; - case "short": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.ShortNumberProperty)value, null); - break; - case "sparse_vector": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.SparseVectorProperty)value, null); - break; - case "text": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.TextProperty)value, null); - break; - case "token_count": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.TokenCountProperty)value, null); - break; - case "unsigned_long": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.UnsignedLongNumberProperty)value, null); - break; - case "version": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.VersionProperty)value, null); - break; - case "wildcard": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Mapping.WildcardProperty)value, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.Type}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Mapping.IProperty)}'."); - } - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.IPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.IPropertyConverter))] public partial interface IProperty { public string Type { get; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankFeatureProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankFeatureProperty.Converters.g.cs new file mode 100644 index 00000000000..1e853775c03 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankFeatureProperty.Converters.g.cs @@ -0,0 +1,125 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class RankFeaturePropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropPositiveScoreImpact = System.Text.Json.JsonEncodedText.Encode("positive_score_impact"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.RankFeatureProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propPositiveScoreImpact = default; + LocalJsonValue propProperties = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propPositiveScoreImpact.TryReadProperty(ref reader, options, PropPositiveScoreImpact, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.RankFeatureProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + Meta = propMeta.Value, + PositiveScoreImpact = propPositiveScoreImpact.Value, + Properties = propProperties.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.RankFeatureProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropPositiveScoreImpact, value.PositiveScoreImpact, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankFeatureProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankFeatureProperty.g.cs index a7c5b2342b5..5e8c81803b7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankFeatureProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankFeatureProperty.g.cs @@ -23,108 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class RankFeaturePropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropPositiveScoreImpact = System.Text.Json.JsonEncodedText.Encode("positive_score_impact"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.RankFeatureProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propPositiveScoreImpact = default; - LocalJsonValue propProperties = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propPositiveScoreImpact.TryReadProperty(ref reader, options, PropPositiveScoreImpact, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.RankFeatureProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - Meta = propMeta.Value, - PositiveScoreImpact = propPositiveScoreImpact.Value, - Properties = propProperties.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.RankFeatureProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropPositiveScoreImpact, value.PositiveScoreImpact, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.RankFeaturePropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.RankFeaturePropertyConverter))] public sealed partial class RankFeatureProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankFeaturesProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankFeaturesProperty.Converters.g.cs new file mode 100644 index 00000000000..8133731ff5c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankFeaturesProperty.Converters.g.cs @@ -0,0 +1,125 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class RankFeaturesPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropPositiveScoreImpact = System.Text.Json.JsonEncodedText.Encode("positive_score_impact"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.RankFeaturesProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propPositiveScoreImpact = default; + LocalJsonValue propProperties = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propPositiveScoreImpact.TryReadProperty(ref reader, options, PropPositiveScoreImpact, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.RankFeaturesProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + Meta = propMeta.Value, + PositiveScoreImpact = propPositiveScoreImpact.Value, + Properties = propProperties.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.RankFeaturesProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropPositiveScoreImpact, value.PositiveScoreImpact, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankFeaturesProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankFeaturesProperty.g.cs index 5cb8bb5e6c7..7809ecb99a0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankFeaturesProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankFeaturesProperty.g.cs @@ -23,108 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class RankFeaturesPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropPositiveScoreImpact = System.Text.Json.JsonEncodedText.Encode("positive_score_impact"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.RankFeaturesProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propPositiveScoreImpact = default; - LocalJsonValue propProperties = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propPositiveScoreImpact.TryReadProperty(ref reader, options, PropPositiveScoreImpact, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.RankFeaturesProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - Meta = propMeta.Value, - PositiveScoreImpact = propPositiveScoreImpact.Value, - Properties = propProperties.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.RankFeaturesProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropPositiveScoreImpact, value.PositiveScoreImpact, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.RankFeaturesPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.RankFeaturesPropertyConverter))] public sealed partial class RankFeaturesProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankVectorElementType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankVectorElementType.Converters.g.cs new file mode 100644 index 00000000000..27f22a6ef1f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankVectorElementType.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class RankVectorElementTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberBit = System.Text.Json.JsonEncodedText.Encode("bit"); + private static readonly System.Text.Json.JsonEncodedText MemberByte = System.Text.Json.JsonEncodedText.Encode("byte"); + private static readonly System.Text.Json.JsonEncodedText MemberFloat = System.Text.Json.JsonEncodedText.Encode("float"); + + public override Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberBit)) + { + return Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType.Bit; + } + + if (reader.ValueTextEquals(MemberByte)) + { + return Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType.Byte; + } + + if (reader.ValueTextEquals(MemberFloat)) + { + return Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType.Float; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberBit.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType.Bit; + } + + if (string.Equals(value, MemberByte.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType.Byte; + } + + if (string.Equals(value, MemberFloat.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType.Float; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType.Bit: + writer.WriteStringValue(MemberBit); + break; + case Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType.Byte: + writer.WriteStringValue(MemberByte); + break; + case Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType.Float: + writer.WriteStringValue(MemberFloat); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankVectorElementType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankVectorElementType.g.cs new file mode 100644 index 00000000000..fd4b8ab14b5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankVectorElementType.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.RankVectorElementTypeConverter))] +public enum RankVectorElementType +{ + [System.Runtime.Serialization.EnumMember(Value = "bit")] + Bit, + [System.Runtime.Serialization.EnumMember(Value = "byte")] + Byte, + [System.Runtime.Serialization.EnumMember(Value = "float")] + Float +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankVectorProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankVectorProperty.Converters.g.cs new file mode 100644 index 00000000000..43ea2841c99 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankVectorProperty.Converters.g.cs @@ -0,0 +1,134 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class RankVectorPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDims = System.Text.Json.JsonEncodedText.Encode("dims"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropElementType = System.Text.Json.JsonEncodedText.Encode("element_type"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.RankVectorProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDims = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propElementType = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propProperties = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDims.TryReadProperty(ref reader, options, PropDims, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propElementType.TryReadProperty(ref reader, options, PropElementType, static Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.RankVectorProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Dims = propDims.Value, + Dynamic = propDynamic.Value, + ElementType = propElementType.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + Meta = propMeta.Value, + Properties = propProperties.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.RankVectorProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDims, value.Dims, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropElementType, value.ElementType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankVectorProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankVectorProperty.g.cs index f4e6f68a7f2..07a41aac7b2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankVectorProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RankVectorProperty.g.cs @@ -23,122 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class RankVectorPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDims = System.Text.Json.JsonEncodedText.Encode("dims"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropElementType = System.Text.Json.JsonEncodedText.Encode("element_type"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.RankVectorProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDims = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propElementType = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propProperties = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDims.TryReadProperty(ref reader, options, PropDims, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propElementType.TryReadProperty(ref reader, options, PropElementType, static Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.RankVectorProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Dims = propDims.Value, - Dynamic = propDynamic.Value, - ElementType = propElementType.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - Meta = propMeta.Value, - Properties = propProperties.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.RankVectorProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDims, value.Dims, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropElementType, value.ElementType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.RankVectorElementType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Technical preview /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.RankVectorPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.RankVectorPropertyConverter))] public sealed partial class RankVectorProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RoutingField.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RoutingField.Converters.g.cs new file mode 100644 index 00000000000..f1136be6d3f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RoutingField.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class RoutingFieldConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRequired = System.Text.Json.JsonEncodedText.Encode("required"); + + public override Elastic.Clients.Elasticsearch.Mapping.RoutingField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propRequired = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRequired.TryReadProperty(ref reader, options, PropRequired, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.RoutingField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Required = propRequired.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.RoutingField value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRequired, value.Required, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RoutingField.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RoutingField.g.cs index 64a38fb09f8..1e23b7ef4f4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RoutingField.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RoutingField.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class RoutingFieldConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRequired = System.Text.Json.JsonEncodedText.Encode("required"); - - public override Elastic.Clients.Elasticsearch.Mapping.RoutingField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propRequired = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRequired.TryReadProperty(ref reader, options, PropRequired, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.RoutingField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Required = propRequired.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.RoutingField value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRequired, value.Required, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.RoutingFieldConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.RoutingFieldConverter))] public sealed partial class RoutingField { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeField.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeField.Converters.g.cs new file mode 100644 index 00000000000..92e16b605b7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeField.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class RuntimeFieldConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFetchFields = System.Text.Json.JsonEncodedText.Encode("fetch_fields"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropInputField = System.Text.Json.JsonEncodedText.Encode("input_field"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); + private static readonly System.Text.Json.JsonEncodedText PropTargetIndex = System.Text.Json.JsonEncodedText.Encode("target_index"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.RuntimeField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propFetchFields = default; + LocalJsonValue?> propFields = default; + LocalJsonValue propFormat = default; + LocalJsonValue propInputField = default; + LocalJsonValue propScript = default; + LocalJsonValue propTargetField = default; + LocalJsonValue propTargetIndex = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFetchFields.TryReadProperty(ref reader, options, PropFetchFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propInputField.TryReadProperty(ref reader, options, PropInputField, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) + { + continue; + } + + if (propTargetIndex.TryReadProperty(ref reader, options, PropTargetIndex, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.RuntimeField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FetchFields = propFetchFields.Value, + Fields = propFields.Value, + Format = propFormat.Value, + InputField = propInputField.Value, + Script = propScript.Value, + TargetField = propTargetField.Value, + TargetIndex = propTargetIndex.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.RuntimeField value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFetchFields, value.FetchFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropInputField, value.InputField, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); + writer.WriteProperty(options, PropTargetIndex, value.TargetIndex, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeField.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeField.g.cs index 2b911a997c3..617f40d0856 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeField.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeField.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class RuntimeFieldConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFetchFields = System.Text.Json.JsonEncodedText.Encode("fetch_fields"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropInputField = System.Text.Json.JsonEncodedText.Encode("input_field"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropTargetField = System.Text.Json.JsonEncodedText.Encode("target_field"); - private static readonly System.Text.Json.JsonEncodedText PropTargetIndex = System.Text.Json.JsonEncodedText.Encode("target_index"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.RuntimeField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propFetchFields = default; - LocalJsonValue?> propFields = default; - LocalJsonValue propFormat = default; - LocalJsonValue propInputField = default; - LocalJsonValue propScript = default; - LocalJsonValue propTargetField = default; - LocalJsonValue propTargetIndex = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFetchFields.TryReadProperty(ref reader, options, PropFetchFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propInputField.TryReadProperty(ref reader, options, PropInputField, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propTargetField.TryReadProperty(ref reader, options, PropTargetField, null)) - { - continue; - } - - if (propTargetIndex.TryReadProperty(ref reader, options, PropTargetIndex, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.RuntimeField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FetchFields = propFetchFields.Value, - Fields = propFields.Value, - Format = propFormat.Value, - InputField = propInputField.Value, - Script = propScript.Value, - TargetField = propTargetField.Value, - TargetIndex = propTargetIndex.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.RuntimeField value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFetchFields, value.FetchFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropInputField, value.InputField, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropTargetField, value.TargetField, null, null); - writer.WriteProperty(options, PropTargetIndex, value.TargetIndex, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.RuntimeFieldConverter))] public sealed partial class RuntimeField { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeFieldFetchFields.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeFieldFetchFields.Converters.g.cs new file mode 100644 index 00000000000..0a05a545f64 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeFieldFetchFields.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class RuntimeFieldFetchFieldsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + + public override Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldFetchFields Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) + { + var value = reader.ReadValue(options, null); + return new Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldFetchFields(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = value + }; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propFormat = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldFetchFields(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Format = propFormat.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldFetchFields value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeFieldFetchFields.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeFieldFetchFields.g.cs index b6f23d5712d..ef5966c3c49 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeFieldFetchFields.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeFieldFetchFields.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class RuntimeFieldFetchFieldsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - - public override Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldFetchFields Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) - { - var value = reader.ReadValue(options, null); - return new Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldFetchFields(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = value - }; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propFormat = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldFetchFields(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Format = propFormat.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldFetchFields value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldFetchFieldsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.RuntimeFieldFetchFieldsConverter))] public sealed partial class RuntimeFieldFetchFields { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeFieldType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeFieldType.Converters.g.cs new file mode 100644 index 00000000000..4220309d8c8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeFieldType.Converters.g.cs @@ -0,0 +1,193 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class RuntimeFieldTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberBoolean = System.Text.Json.JsonEncodedText.Encode("boolean"); + private static readonly System.Text.Json.JsonEncodedText MemberComposite = System.Text.Json.JsonEncodedText.Encode("composite"); + private static readonly System.Text.Json.JsonEncodedText MemberDate = System.Text.Json.JsonEncodedText.Encode("date"); + private static readonly System.Text.Json.JsonEncodedText MemberDouble = System.Text.Json.JsonEncodedText.Encode("double"); + private static readonly System.Text.Json.JsonEncodedText MemberGeoPoint = System.Text.Json.JsonEncodedText.Encode("geo_point"); + private static readonly System.Text.Json.JsonEncodedText MemberGeoShape = System.Text.Json.JsonEncodedText.Encode("geo_shape"); + private static readonly System.Text.Json.JsonEncodedText MemberIp = System.Text.Json.JsonEncodedText.Encode("ip"); + private static readonly System.Text.Json.JsonEncodedText MemberKeyword = System.Text.Json.JsonEncodedText.Encode("keyword"); + private static readonly System.Text.Json.JsonEncodedText MemberLong = System.Text.Json.JsonEncodedText.Encode("long"); + private static readonly System.Text.Json.JsonEncodedText MemberLookup = System.Text.Json.JsonEncodedText.Encode("lookup"); + + public override Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberBoolean)) + { + return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Boolean; + } + + if (reader.ValueTextEquals(MemberComposite)) + { + return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Composite; + } + + if (reader.ValueTextEquals(MemberDate)) + { + return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Date; + } + + if (reader.ValueTextEquals(MemberDouble)) + { + return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Double; + } + + if (reader.ValueTextEquals(MemberGeoPoint)) + { + return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.GeoPoint; + } + + if (reader.ValueTextEquals(MemberGeoShape)) + { + return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.GeoShape; + } + + if (reader.ValueTextEquals(MemberIp)) + { + return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Ip; + } + + if (reader.ValueTextEquals(MemberKeyword)) + { + return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Keyword; + } + + if (reader.ValueTextEquals(MemberLong)) + { + return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Long; + } + + if (reader.ValueTextEquals(MemberLookup)) + { + return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Lookup; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberBoolean.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Boolean; + } + + if (string.Equals(value, MemberComposite.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Composite; + } + + if (string.Equals(value, MemberDate.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Date; + } + + if (string.Equals(value, MemberDouble.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Double; + } + + if (string.Equals(value, MemberGeoPoint.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.GeoPoint; + } + + if (string.Equals(value, MemberGeoShape.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.GeoShape; + } + + if (string.Equals(value, MemberIp.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Ip; + } + + if (string.Equals(value, MemberKeyword.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Keyword; + } + + if (string.Equals(value, MemberLong.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Long; + } + + if (string.Equals(value, MemberLookup.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Lookup; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Boolean: + writer.WriteStringValue(MemberBoolean); + break; + case Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Composite: + writer.WriteStringValue(MemberComposite); + break; + case Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Date: + writer.WriteStringValue(MemberDate); + break; + case Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Double: + writer.WriteStringValue(MemberDouble); + break; + case Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.GeoPoint: + writer.WriteStringValue(MemberGeoPoint); + break; + case Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.GeoShape: + writer.WriteStringValue(MemberGeoShape); + break; + case Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Ip: + writer.WriteStringValue(MemberIp); + break; + case Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Keyword: + writer.WriteStringValue(MemberKeyword); + break; + case Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Long: + writer.WriteStringValue(MemberLong); + break; + case Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType.Lookup: + writer.WriteStringValue(MemberLookup); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.RuntimeFieldType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeFieldType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeFieldType.g.cs new file mode 100644 index 00000000000..fedc6efc887 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/RuntimeFieldType.g.cs @@ -0,0 +1,49 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.RuntimeFieldTypeConverter))] +public enum RuntimeFieldType +{ + [System.Runtime.Serialization.EnumMember(Value = "boolean")] + Boolean, + [System.Runtime.Serialization.EnumMember(Value = "composite")] + Composite, + [System.Runtime.Serialization.EnumMember(Value = "date")] + Date, + [System.Runtime.Serialization.EnumMember(Value = "double")] + Double, + [System.Runtime.Serialization.EnumMember(Value = "geo_point")] + GeoPoint, + [System.Runtime.Serialization.EnumMember(Value = "geo_shape")] + GeoShape, + [System.Runtime.Serialization.EnumMember(Value = "ip")] + Ip, + [System.Runtime.Serialization.EnumMember(Value = "keyword")] + Keyword, + [System.Runtime.Serialization.EnumMember(Value = "long")] + Long, + [System.Runtime.Serialization.EnumMember(Value = "lookup")] + Lookup +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ScaledFloatNumberProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ScaledFloatNumberProperty.Converters.g.cs new file mode 100644 index 00000000000..5a109c9f6f4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ScaledFloatNumberProperty.Converters.g.cs @@ -0,0 +1,233 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class ScaledFloatNumberPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); + private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropScalingFactor = System.Text.Json.JsonEncodedText.Encode("scaling_factor"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.ScaledFloatNumberProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propCoerce = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIgnoreMalformed = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propNullValue = default; + LocalJsonValue propOnScriptError = default; + LocalJsonValue propProperties = default; + LocalJsonValue propScalingFactor = default; + LocalJsonValue propScript = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + LocalJsonValue propTimeSeriesDimension = default; + LocalJsonValue propTimeSeriesMetric = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propScalingFactor.TryReadProperty(ref reader, options, PropScalingFactor, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.ScaledFloatNumberProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Coerce = propCoerce.Value, + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + IgnoreMalformed = propIgnoreMalformed.Value, + Index = propIndex.Value, + Meta = propMeta.Value, + NullValue = propNullValue.Value, + OnScriptError = propOnScriptError.Value, + Properties = propProperties.Value, + ScalingFactor = propScalingFactor.Value, + Script = propScript.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value, + TimeSeriesDimension = propTimeSeriesDimension.Value, + TimeSeriesMetric = propTimeSeriesMetric.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.ScaledFloatNumberProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNullValue, value.NullValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropScalingFactor, value.ScalingFactor, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ScaledFloatNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ScaledFloatNumberProperty.g.cs index 991e2a5b3b9..a44ba0398ab 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ScaledFloatNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ScaledFloatNumberProperty.g.cs @@ -23,216 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class ScaledFloatNumberPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); - private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropScalingFactor = System.Text.Json.JsonEncodedText.Encode("scaling_factor"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.ScaledFloatNumberProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propCoerce = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIgnoreMalformed = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propNullValue = default; - LocalJsonValue propOnScriptError = default; - LocalJsonValue propProperties = default; - LocalJsonValue propScalingFactor = default; - LocalJsonValue propScript = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - LocalJsonValue propTimeSeriesDimension = default; - LocalJsonValue propTimeSeriesMetric = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propScalingFactor.TryReadProperty(ref reader, options, PropScalingFactor, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.ScaledFloatNumberProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Coerce = propCoerce.Value, - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - IgnoreMalformed = propIgnoreMalformed.Value, - Index = propIndex.Value, - Meta = propMeta.Value, - NullValue = propNullValue.Value, - OnScriptError = propOnScriptError.Value, - Properties = propProperties.Value, - ScalingFactor = propScalingFactor.Value, - Script = propScript.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value, - TimeSeriesDimension = propTimeSeriesDimension.Value, - TimeSeriesMetric = propTimeSeriesMetric.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.ScaledFloatNumberProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNullValue, value.NullValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropScalingFactor, value.ScalingFactor, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.ScaledFloatNumberPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.ScaledFloatNumberPropertyConverter))] public sealed partial class ScaledFloatNumberProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SearchAsYouTypeProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SearchAsYouTypeProperty.Converters.g.cs new file mode 100644 index 00000000000..f70f2fb4e4c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SearchAsYouTypeProperty.Converters.g.cs @@ -0,0 +1,215 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class SearchAsYouTypePropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropIndexOptions = System.Text.Json.JsonEncodedText.Encode("index_options"); + private static readonly System.Text.Json.JsonEncodedText PropMaxShingleSize = System.Text.Json.JsonEncodedText.Encode("max_shingle_size"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropNorms = System.Text.Json.JsonEncodedText.Encode("norms"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropSearchAnalyzer = System.Text.Json.JsonEncodedText.Encode("search_analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropSearchQuoteAnalyzer = System.Text.Json.JsonEncodedText.Encode("search_quote_analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropTermVector = System.Text.Json.JsonEncodedText.Encode("term_vector"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.SearchAsYouTypeProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzer = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIndex = default; + LocalJsonValue propIndexOptions = default; + LocalJsonValue propMaxShingleSize = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propNorms = default; + LocalJsonValue propProperties = default; + LocalJsonValue propSearchAnalyzer = default; + LocalJsonValue propSearchQuoteAnalyzer = default; + LocalJsonValue propSimilarity = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + LocalJsonValue propTermVector = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndexOptions.TryReadProperty(ref reader, options, PropIndexOptions, static Elastic.Clients.Elasticsearch.Mapping.IndexOptions? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxShingleSize.TryReadProperty(ref reader, options, PropMaxShingleSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propNorms.TryReadProperty(ref reader, options, PropNorms, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propSearchAnalyzer.TryReadProperty(ref reader, options, PropSearchAnalyzer, null)) + { + continue; + } + + if (propSearchQuoteAnalyzer.TryReadProperty(ref reader, options, PropSearchQuoteAnalyzer, null)) + { + continue; + } + + if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTermVector.TryReadProperty(ref reader, options, PropTermVector, static Elastic.Clients.Elasticsearch.Mapping.TermVectorOption? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.SearchAsYouTypeProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analyzer = propAnalyzer.Value, + CopyTo = propCopyTo.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + Index = propIndex.Value, + IndexOptions = propIndexOptions.Value, + MaxShingleSize = propMaxShingleSize.Value, + Meta = propMeta.Value, + Norms = propNorms.Value, + Properties = propProperties.Value, + SearchAnalyzer = propSearchAnalyzer.Value, + SearchQuoteAnalyzer = propSearchQuoteAnalyzer.Value, + Similarity = propSimilarity.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value, + TermVector = propTermVector.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.SearchAsYouTypeProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndexOptions, value.IndexOptions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.IndexOptions? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxShingleSize, value.MaxShingleSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNorms, value.Norms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropSearchAnalyzer, value.SearchAnalyzer, null, null); + writer.WriteProperty(options, PropSearchQuoteAnalyzer, value.SearchQuoteAnalyzer, null, null); + writer.WriteProperty(options, PropSimilarity, value.Similarity, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTermVector, value.TermVector, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TermVectorOption? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SearchAsYouTypeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SearchAsYouTypeProperty.g.cs index 5d0c6375d21..f86ba14cb17 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SearchAsYouTypeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SearchAsYouTypeProperty.g.cs @@ -23,198 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class SearchAsYouTypePropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropIndexOptions = System.Text.Json.JsonEncodedText.Encode("index_options"); - private static readonly System.Text.Json.JsonEncodedText PropMaxShingleSize = System.Text.Json.JsonEncodedText.Encode("max_shingle_size"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropNorms = System.Text.Json.JsonEncodedText.Encode("norms"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropSearchAnalyzer = System.Text.Json.JsonEncodedText.Encode("search_analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropSearchQuoteAnalyzer = System.Text.Json.JsonEncodedText.Encode("search_quote_analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropTermVector = System.Text.Json.JsonEncodedText.Encode("term_vector"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.SearchAsYouTypeProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyzer = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIndex = default; - LocalJsonValue propIndexOptions = default; - LocalJsonValue propMaxShingleSize = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propNorms = default; - LocalJsonValue propProperties = default; - LocalJsonValue propSearchAnalyzer = default; - LocalJsonValue propSearchQuoteAnalyzer = default; - LocalJsonValue propSimilarity = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - LocalJsonValue propTermVector = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndexOptions.TryReadProperty(ref reader, options, PropIndexOptions, static Elastic.Clients.Elasticsearch.Mapping.IndexOptions? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxShingleSize.TryReadProperty(ref reader, options, PropMaxShingleSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propNorms.TryReadProperty(ref reader, options, PropNorms, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propSearchAnalyzer.TryReadProperty(ref reader, options, PropSearchAnalyzer, null)) - { - continue; - } - - if (propSearchQuoteAnalyzer.TryReadProperty(ref reader, options, PropSearchQuoteAnalyzer, null)) - { - continue; - } - - if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTermVector.TryReadProperty(ref reader, options, PropTermVector, static Elastic.Clients.Elasticsearch.Mapping.TermVectorOption? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.SearchAsYouTypeProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analyzer = propAnalyzer.Value, - CopyTo = propCopyTo.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - Index = propIndex.Value, - IndexOptions = propIndexOptions.Value, - MaxShingleSize = propMaxShingleSize.Value, - Meta = propMeta.Value, - Norms = propNorms.Value, - Properties = propProperties.Value, - SearchAnalyzer = propSearchAnalyzer.Value, - SearchQuoteAnalyzer = propSearchQuoteAnalyzer.Value, - Similarity = propSimilarity.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value, - TermVector = propTermVector.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.SearchAsYouTypeProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndexOptions, value.IndexOptions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.IndexOptions? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxShingleSize, value.MaxShingleSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNorms, value.Norms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropSearchAnalyzer, value.SearchAnalyzer, null, null); - writer.WriteProperty(options, PropSearchQuoteAnalyzer, value.SearchQuoteAnalyzer, null, null); - writer.WriteProperty(options, PropSimilarity, value.Similarity, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTermVector, value.TermVector, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TermVectorOption? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.SearchAsYouTypePropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.SearchAsYouTypePropertyConverter))] public sealed partial class SearchAsYouTypeProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextIndexOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextIndexOptions.Converters.g.cs new file mode 100644 index 00000000000..f360d16bd35 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextIndexOptions.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class SemanticTextIndexOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDenseVector = System.Text.Json.JsonEncodedText.Encode("dense_vector"); + + public override Elastic.Clients.Elasticsearch.Mapping.SemanticTextIndexOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDenseVector = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDenseVector.TryReadProperty(ref reader, options, PropDenseVector, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.SemanticTextIndexOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DenseVector = propDenseVector.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.SemanticTextIndexOptions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDenseVector, value.DenseVector, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextIndexOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextIndexOptions.g.cs index 21917cff553..b09d5346c47 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextIndexOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextIndexOptions.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class SemanticTextIndexOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDenseVector = System.Text.Json.JsonEncodedText.Encode("dense_vector"); - - public override Elastic.Clients.Elasticsearch.Mapping.SemanticTextIndexOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDenseVector = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDenseVector.TryReadProperty(ref reader, options, PropDenseVector, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.SemanticTextIndexOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DenseVector = propDenseVector.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.SemanticTextIndexOptions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDenseVector, value.DenseVector, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.SemanticTextIndexOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.SemanticTextIndexOptionsConverter))] public sealed partial class SemanticTextIndexOptions { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextProperty.Converters.g.cs new file mode 100644 index 00000000000..0a3d9b0698e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextProperty.Converters.g.cs @@ -0,0 +1,107 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class SemanticTextPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropIndexOptions = System.Text.Json.JsonEncodedText.Encode("index_options"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropSearchInferenceId = System.Text.Json.JsonEncodedText.Encode("search_inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.SemanticTextProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propIndexOptions = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propSearchInferenceId = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propIndexOptions.TryReadProperty(ref reader, options, PropIndexOptions, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propSearchInferenceId.TryReadProperty(ref reader, options, PropSearchInferenceId, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.SemanticTextProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + IndexOptions = propIndexOptions.Value, + InferenceId = propInferenceId.Value, + Meta = propMeta.Value, + SearchInferenceId = propSearchInferenceId.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.SemanticTextProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropIndexOptions, value.IndexOptions, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropSearchInferenceId, value.SearchInferenceId, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextProperty.g.cs index c4585f19e48..da57911ed4d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextProperty.g.cs @@ -23,90 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class SemanticTextPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); - private static readonly System.Text.Json.JsonEncodedText PropIndexOptions = System.Text.Json.JsonEncodedText.Encode("index_options"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropSearchInferenceId = System.Text.Json.JsonEncodedText.Encode("search_inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.SemanticTextProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkingSettings = default; - LocalJsonValue propIndexOptions = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propSearchInferenceId = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) - { - continue; - } - - if (propIndexOptions.TryReadProperty(ref reader, options, PropIndexOptions, null)) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propSearchInferenceId.TryReadProperty(ref reader, options, PropSearchInferenceId, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.SemanticTextProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkingSettings = propChunkingSettings.Value, - IndexOptions = propIndexOptions.Value, - InferenceId = propInferenceId.Value, - Meta = propMeta.Value, - SearchInferenceId = propSearchInferenceId.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.SemanticTextProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); - writer.WriteProperty(options, PropIndexOptions, value.IndexOptions, null, null); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropSearchInferenceId, value.SearchInferenceId, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.SemanticTextPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.SemanticTextPropertyConverter))] public sealed partial class SemanticTextProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShapeProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShapeProperty.Converters.g.cs new file mode 100644 index 00000000000..5ccdf7f203b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShapeProperty.Converters.g.cs @@ -0,0 +1,179 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class ShapePropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreZValue = System.Text.Json.JsonEncodedText.Encode("ignore_z_value"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropOrientation = System.Text.Json.JsonEncodedText.Encode("orientation"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.ShapeProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCoerce = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIgnoreMalformed = default; + LocalJsonValue propIgnoreZValue = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propOrientation = default; + LocalJsonValue propProperties = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreZValue.TryReadProperty(ref reader, options, PropIgnoreZValue, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propOrientation.TryReadProperty(ref reader, options, PropOrientation, static Elastic.Clients.Elasticsearch.Mapping.GeoOrientation? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.ShapeProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Coerce = propCoerce.Value, + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + IgnoreMalformed = propIgnoreMalformed.Value, + IgnoreZValue = propIgnoreZValue.Value, + Meta = propMeta.Value, + Orientation = propOrientation.Value, + Properties = propProperties.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.ShapeProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreZValue, value.IgnoreZValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropOrientation, value.Orientation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.GeoOrientation? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShapeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShapeProperty.g.cs index e28fcbd601b..e57a8737ca0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShapeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShapeProperty.g.cs @@ -23,161 +23,6 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class ShapePropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreZValue = System.Text.Json.JsonEncodedText.Encode("ignore_z_value"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropOrientation = System.Text.Json.JsonEncodedText.Encode("orientation"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.ShapeProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCoerce = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIgnoreMalformed = default; - LocalJsonValue propIgnoreZValue = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propOrientation = default; - LocalJsonValue propProperties = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreZValue.TryReadProperty(ref reader, options, PropIgnoreZValue, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propOrientation.TryReadProperty(ref reader, options, PropOrientation, static Elastic.Clients.Elasticsearch.Mapping.GeoOrientation? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.ShapeProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Coerce = propCoerce.Value, - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - IgnoreMalformed = propIgnoreMalformed.Value, - IgnoreZValue = propIgnoreZValue.Value, - Meta = propMeta.Value, - Orientation = propOrientation.Value, - Properties = propProperties.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.ShapeProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreZValue, value.IgnoreZValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropOrientation, value.Orientation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.GeoOrientation? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - /// /// /// The shape data type facilitates the indexing of and searching with arbitrary x, y cartesian shapes such as @@ -185,7 +30,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// Learn more about this API in the Elasticsearch documentation. /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.ShapePropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.ShapePropertyConverter))] public sealed partial class ShapeProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShortNumberProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShortNumberProperty.Converters.g.cs new file mode 100644 index 00000000000..f1bc6f3305c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShortNumberProperty.Converters.g.cs @@ -0,0 +1,224 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class ShortNumberPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); + private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.ShortNumberProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propCoerce = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIgnoreMalformed = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propNullValue = default; + LocalJsonValue propOnScriptError = default; + LocalJsonValue propProperties = default; + LocalJsonValue propScript = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + LocalJsonValue propTimeSeriesDimension = default; + LocalJsonValue propTimeSeriesMetric = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, static short? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.ShortNumberProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Coerce = propCoerce.Value, + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + IgnoreMalformed = propIgnoreMalformed.Value, + Index = propIndex.Value, + Meta = propMeta.Value, + NullValue = propNullValue.Value, + OnScriptError = propOnScriptError.Value, + Properties = propProperties.Value, + Script = propScript.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value, + TimeSeriesDimension = propTimeSeriesDimension.Value, + TimeSeriesMetric = propTimeSeriesMetric.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.ShortNumberProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNullValue, value.NullValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, short? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShortNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShortNumberProperty.g.cs index 1bb328da407..c43eaea06c9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShortNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShortNumberProperty.g.cs @@ -23,207 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class ShortNumberPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); - private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.ShortNumberProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propCoerce = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIgnoreMalformed = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propNullValue = default; - LocalJsonValue propOnScriptError = default; - LocalJsonValue propProperties = default; - LocalJsonValue propScript = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - LocalJsonValue propTimeSeriesDimension = default; - LocalJsonValue propTimeSeriesMetric = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, static short? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.ShortNumberProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Coerce = propCoerce.Value, - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - IgnoreMalformed = propIgnoreMalformed.Value, - Index = propIndex.Value, - Meta = propMeta.Value, - NullValue = propNullValue.Value, - OnScriptError = propOnScriptError.Value, - Properties = propProperties.Value, - Script = propScript.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value, - TimeSeriesDimension = propTimeSeriesDimension.Value, - TimeSeriesMetric = propTimeSeriesMetric.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.ShortNumberProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNullValue, value.NullValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, short? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.ShortNumberPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.ShortNumberPropertyConverter))] public sealed partial class ShortNumberProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SizeField.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SizeField.Converters.g.cs new file mode 100644 index 00000000000..7f7c06a6953 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SizeField.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class SizeFieldConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + + public override Elastic.Clients.Elasticsearch.Mapping.SizeField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEnabled = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.SizeField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Enabled = propEnabled.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.SizeField value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SizeField.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SizeField.g.cs index e967b01d7ad..774bef481e7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SizeField.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SizeField.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class SizeFieldConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - - public override Elastic.Clients.Elasticsearch.Mapping.SizeField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEnabled = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.SizeField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Enabled = propEnabled.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.SizeField value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.SizeFieldConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.SizeFieldConverter))] public sealed partial class SizeField { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SourceField.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SourceField.Converters.g.cs new file mode 100644 index 00000000000..17b59610b71 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SourceField.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class SourceFieldConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCompress = System.Text.Json.JsonEncodedText.Encode("compress"); + private static readonly System.Text.Json.JsonEncodedText PropCompressThreshold = System.Text.Json.JsonEncodedText.Encode("compress_threshold"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropExcludes = System.Text.Json.JsonEncodedText.Encode("excludes"); + private static readonly System.Text.Json.JsonEncodedText PropIncludes = System.Text.Json.JsonEncodedText.Encode("includes"); + private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); + + public override Elastic.Clients.Elasticsearch.Mapping.SourceField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCompress = default; + LocalJsonValue propCompressThreshold = default; + LocalJsonValue propEnabled = default; + LocalJsonValue?> propExcludes = default; + LocalJsonValue?> propIncludes = default; + LocalJsonValue propMode = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCompress.TryReadProperty(ref reader, options, PropCompress, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCompressThreshold.TryReadProperty(ref reader, options, PropCompressThreshold, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propExcludes.TryReadProperty(ref reader, options, PropExcludes, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propIncludes.TryReadProperty(ref reader, options, PropIncludes, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propMode.TryReadProperty(ref reader, options, PropMode, static Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.SourceField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Compress = propCompress.Value, + CompressThreshold = propCompressThreshold.Value, + Enabled = propEnabled.Value, + Excludes = propExcludes.Value, + Includes = propIncludes.Value, + Mode = propMode.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.SourceField value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCompress, value.Compress, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCompressThreshold, value.CompressThreshold, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropExcludes, value.Excludes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIncludes, value.Includes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMode, value.Mode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SourceField.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SourceField.g.cs index 453934aaf31..00c64d6a6f8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SourceField.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SourceField.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class SourceFieldConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCompress = System.Text.Json.JsonEncodedText.Encode("compress"); - private static readonly System.Text.Json.JsonEncodedText PropCompressThreshold = System.Text.Json.JsonEncodedText.Encode("compress_threshold"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropExcludes = System.Text.Json.JsonEncodedText.Encode("excludes"); - private static readonly System.Text.Json.JsonEncodedText PropIncludes = System.Text.Json.JsonEncodedText.Encode("includes"); - private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); - - public override Elastic.Clients.Elasticsearch.Mapping.SourceField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCompress = default; - LocalJsonValue propCompressThreshold = default; - LocalJsonValue propEnabled = default; - LocalJsonValue?> propExcludes = default; - LocalJsonValue?> propIncludes = default; - LocalJsonValue propMode = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCompress.TryReadProperty(ref reader, options, PropCompress, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCompressThreshold.TryReadProperty(ref reader, options, PropCompressThreshold, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propExcludes.TryReadProperty(ref reader, options, PropExcludes, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propIncludes.TryReadProperty(ref reader, options, PropIncludes, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propMode.TryReadProperty(ref reader, options, PropMode, static Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.SourceField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Compress = propCompress.Value, - CompressThreshold = propCompressThreshold.Value, - Enabled = propEnabled.Value, - Excludes = propExcludes.Value, - Includes = propIncludes.Value, - Mode = propMode.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.SourceField value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCompress, value.Compress, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCompressThreshold, value.CompressThreshold, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropExcludes, value.Excludes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIncludes, value.Includes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMode, value.Mode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.SourceFieldConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.SourceFieldConverter))] public sealed partial class SourceField { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SourceFieldMode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SourceFieldMode.Converters.g.cs new file mode 100644 index 00000000000..a28d8a525f8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SourceFieldMode.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class SourceFieldModeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberDisabled = System.Text.Json.JsonEncodedText.Encode("disabled"); + private static readonly System.Text.Json.JsonEncodedText MemberStored = System.Text.Json.JsonEncodedText.Encode("stored"); + private static readonly System.Text.Json.JsonEncodedText MemberSynthetic = System.Text.Json.JsonEncodedText.Encode("synthetic"); + + public override Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberDisabled)) + { + return Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode.Disabled; + } + + if (reader.ValueTextEquals(MemberStored)) + { + return Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode.Stored; + } + + if (reader.ValueTextEquals(MemberSynthetic)) + { + return Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode.Synthetic; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberDisabled.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode.Disabled; + } + + if (string.Equals(value, MemberStored.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode.Stored; + } + + if (string.Equals(value, MemberSynthetic.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode.Synthetic; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode.Disabled: + writer.WriteStringValue(MemberDisabled); + break; + case Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode.Stored: + writer.WriteStringValue(MemberStored); + break; + case Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode.Synthetic: + writer.WriteStringValue(MemberSynthetic); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SourceFieldMode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SourceFieldMode.g.cs new file mode 100644 index 00000000000..1b4302e608e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SourceFieldMode.g.cs @@ -0,0 +1,41 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.SourceFieldModeConverter))] +public enum SourceFieldMode +{ + [System.Runtime.Serialization.EnumMember(Value = "disabled")] + Disabled, + [System.Runtime.Serialization.EnumMember(Value = "stored")] + Stored, + /// + /// + /// Instead of storing source documents on disk exactly as you send them, + /// Elasticsearch can reconstruct source content on the fly upon retrieval. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "synthetic")] + Synthetic +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SparseVectorIndexOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SparseVectorIndexOptions.Converters.g.cs new file mode 100644 index 00000000000..f6457ba3e2f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SparseVectorIndexOptions.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class SparseVectorIndexOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPrune = System.Text.Json.JsonEncodedText.Encode("prune"); + private static readonly System.Text.Json.JsonEncodedText PropPruningConfig = System.Text.Json.JsonEncodedText.Encode("pruning_config"); + + public override Elastic.Clients.Elasticsearch.Mapping.SparseVectorIndexOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPrune = default; + LocalJsonValue propPruningConfig = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPrune.TryReadProperty(ref reader, options, PropPrune, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPruningConfig.TryReadProperty(ref reader, options, PropPruningConfig, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.SparseVectorIndexOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Prune = propPrune.Value, + PruningConfig = propPruningConfig.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.SparseVectorIndexOptions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPrune, value.Prune, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPruningConfig, value.PruningConfig, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SparseVectorIndexOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SparseVectorIndexOptions.g.cs index 60b4291c3b8..8ac80e9820c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SparseVectorIndexOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SparseVectorIndexOptions.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class SparseVectorIndexOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPrune = System.Text.Json.JsonEncodedText.Encode("prune"); - private static readonly System.Text.Json.JsonEncodedText PropPruningConfig = System.Text.Json.JsonEncodedText.Encode("pruning_config"); - - public override Elastic.Clients.Elasticsearch.Mapping.SparseVectorIndexOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPrune = default; - LocalJsonValue propPruningConfig = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPrune.TryReadProperty(ref reader, options, PropPrune, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPruningConfig.TryReadProperty(ref reader, options, PropPruningConfig, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.SparseVectorIndexOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Prune = propPrune.Value, - PruningConfig = propPruningConfig.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.SparseVectorIndexOptions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPrune, value.Prune, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPruningConfig, value.PruningConfig, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.SparseVectorIndexOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.SparseVectorIndexOptionsConverter))] public sealed partial class SparseVectorIndexOptions { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SparseVectorProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SparseVectorProperty.Converters.g.cs new file mode 100644 index 00000000000..2e7c065d3e1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SparseVectorProperty.Converters.g.cs @@ -0,0 +1,134 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class SparseVectorPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIndexOptions = System.Text.Json.JsonEncodedText.Encode("index_options"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.SparseVectorProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIndexOptions = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propProperties = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndexOptions.TryReadProperty(ref reader, options, PropIndexOptions, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.SparseVectorProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + IndexOptions = propIndexOptions.Value, + Meta = propMeta.Value, + Properties = propProperties.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.SparseVectorProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndexOptions, value.IndexOptions, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SparseVectorProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SparseVectorProperty.g.cs index 2ae41bd623c..2f7e6d4b628 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SparseVectorProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SparseVectorProperty.g.cs @@ -23,117 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class SparseVectorPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIndexOptions = System.Text.Json.JsonEncodedText.Encode("index_options"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.SparseVectorProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIndexOptions = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propProperties = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndexOptions.TryReadProperty(ref reader, options, PropIndexOptions, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.SparseVectorProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - IndexOptions = propIndexOptions.Value, - Meta = propMeta.Value, - Properties = propProperties.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.SparseVectorProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndexOptions, value.IndexOptions, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.SparseVectorPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.SparseVectorPropertyConverter))] public sealed partial class SparseVectorProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Subobjects.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Subobjects.Converters.g.cs new file mode 100644 index 00000000000..66350b1357e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Subobjects.Converters.g.cs @@ -0,0 +1,100 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class SubobjectsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAuto = System.Text.Json.JsonEncodedText.Encode("auto"); + private static readonly System.Text.Json.JsonEncodedText MemberFalse = System.Text.Json.JsonEncodedText.Encode("false"); + private static readonly System.Text.Json.JsonEncodedText MemberTrue = System.Text.Json.JsonEncodedText.Encode("true"); + + public override Elastic.Clients.Elasticsearch.Mapping.Subobjects Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAuto)) + { + return Elastic.Clients.Elasticsearch.Mapping.Subobjects.Auto; + } + + if (reader.ValueTextEquals(MemberFalse)) + { + return Elastic.Clients.Elasticsearch.Mapping.Subobjects.False; + } + + if (reader.ValueTextEquals(MemberTrue)) + { + return Elastic.Clients.Elasticsearch.Mapping.Subobjects.True; + } + + if (reader.TokenType is not System.Text.Json.JsonTokenType.String) + { + throw new System.Text.Json.JsonException($"Unknown member of type '{reader.TokenType}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.Subobjects)}'."); + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAuto.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.Subobjects.Auto; + } + + if (string.Equals(value, MemberFalse.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.Subobjects.False; + } + + if (string.Equals(value, MemberTrue.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.Subobjects.True; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.Subobjects)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.Subobjects value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Mapping.Subobjects.Auto: + writer.WriteStringValue(MemberAuto); + break; + case Elastic.Clients.Elasticsearch.Mapping.Subobjects.False: + writer.WriteRawValue(MemberFalse.EncodedUtf8Bytes); + break; + case Elastic.Clients.Elasticsearch.Mapping.Subobjects.True: + writer.WriteRawValue(MemberTrue.EncodedUtf8Bytes); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.Subobjects)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Mapping.Subobjects ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.Subobjects value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Subobjects.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Subobjects.g.cs new file mode 100644 index 00000000000..e7259c9f578 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Subobjects.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.SubobjectsConverter))] +public enum Subobjects +{ + [System.Runtime.Serialization.EnumMember(Value = "auto")] + Auto, + [System.Runtime.Serialization.EnumMember(Value = "false")] + False, + [System.Runtime.Serialization.EnumMember(Value = "true")] + True +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SuggestContext.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SuggestContext.Converters.g.cs new file mode 100644 index 00000000000..ca769bfa4d8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SuggestContext.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class SuggestContextConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); + private static readonly System.Text.Json.JsonEncodedText PropPrecision = System.Text.Json.JsonEncodedText.Encode("precision"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.SuggestContext Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + LocalJsonValue propPath = default; + LocalJsonValue?> propPrecision = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propPath.TryReadProperty(ref reader, options, PropPath, null)) + { + continue; + } + + if (propPrecision.TryReadProperty(ref reader, options, PropPrecision, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.SuggestContext(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value, + Path = propPath.Value, + Precision = propPrecision.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.SuggestContext value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropPath, value.Path, null, null); + writer.WriteProperty(options, PropPrecision, value.Precision, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SuggestContext.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SuggestContext.g.cs index 99d72d72401..2ffd57b4351 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SuggestContext.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SuggestContext.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class SuggestContextConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); - private static readonly System.Text.Json.JsonEncodedText PropPrecision = System.Text.Json.JsonEncodedText.Encode("precision"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.SuggestContext Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - LocalJsonValue propPath = default; - LocalJsonValue?> propPrecision = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propPath.TryReadProperty(ref reader, options, PropPath, null)) - { - continue; - } - - if (propPrecision.TryReadProperty(ref reader, options, PropPrecision, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.SuggestContext(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value, - Path = propPath.Value, - Precision = propPrecision.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.SuggestContext value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropPath, value.Path, null, null); - writer.WriteProperty(options, PropPrecision, value.Precision, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.SuggestContextConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.SuggestContextConverter))] public sealed partial class SuggestContext { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SyntheticSourceKeepEnum.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SyntheticSourceKeepEnum.Converters.g.cs new file mode 100644 index 00000000000..918b06400b5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SyntheticSourceKeepEnum.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class SyntheticSourceKeepEnumConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAll = System.Text.Json.JsonEncodedText.Encode("all"); + private static readonly System.Text.Json.JsonEncodedText MemberArrays = System.Text.Json.JsonEncodedText.Encode("arrays"); + private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); + + public override Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAll)) + { + return Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum.All; + } + + if (reader.ValueTextEquals(MemberArrays)) + { + return Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum.Arrays; + } + + if (reader.ValueTextEquals(MemberNone)) + { + return Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum.None; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAll.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum.All; + } + + if (string.Equals(value, MemberArrays.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum.Arrays; + } + + if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum.None; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum.All: + writer.WriteStringValue(MemberAll); + break; + case Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum.Arrays: + writer.WriteStringValue(MemberArrays); + break; + case Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum.None: + writer.WriteStringValue(MemberNone); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SyntheticSourceKeepEnum.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SyntheticSourceKeepEnum.g.cs new file mode 100644 index 00000000000..20ea4d5f16e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SyntheticSourceKeepEnum.g.cs @@ -0,0 +1,55 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.SyntheticSourceKeepEnumConverter))] +public enum SyntheticSourceKeepEnum +{ + /// + /// + /// The source for both singleton instances and arrays of the corresponding field or object gets recorded. + /// When applied to objects, the source of all sub-objects and sub-fields gets captured. + /// Furthermore, the original source of arrays gets captured and appears in synthetic source with no modifications. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "all")] + All, + /// + /// + /// Arrays of the corresponding field or object preserve the original element ordering and duplicate elements. + /// The synthetic source fragment for such arrays is not guaranteed to match the original source exactly, + /// e.g. array [1, 2, [5], [[4, [3]]], 5] may appear as-is or in an equivalent format like [1, 2, 5, 4, 3, 5]. + /// The exact format may change in the future, in an effort to reduce the storage overhead of this option. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "arrays")] + Arrays, + /// + /// + /// Synthetic source diverges from the original source (default) + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "none")] + None +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TermVectorOption.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TermVectorOption.Converters.g.cs new file mode 100644 index 00000000000..95def49e0b6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TermVectorOption.Converters.g.cs @@ -0,0 +1,151 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class TermVectorOptionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberNo = System.Text.Json.JsonEncodedText.Encode("no"); + private static readonly System.Text.Json.JsonEncodedText MemberWithOffsets = System.Text.Json.JsonEncodedText.Encode("with_offsets"); + private static readonly System.Text.Json.JsonEncodedText MemberWithPositions = System.Text.Json.JsonEncodedText.Encode("with_positions"); + private static readonly System.Text.Json.JsonEncodedText MemberWithPositionsOffsets = System.Text.Json.JsonEncodedText.Encode("with_positions_offsets"); + private static readonly System.Text.Json.JsonEncodedText MemberWithPositionsOffsetsPayloads = System.Text.Json.JsonEncodedText.Encode("with_positions_offsets_payloads"); + private static readonly System.Text.Json.JsonEncodedText MemberWithPositionsPayloads = System.Text.Json.JsonEncodedText.Encode("with_positions_payloads"); + private static readonly System.Text.Json.JsonEncodedText MemberYes = System.Text.Json.JsonEncodedText.Encode("yes"); + + public override Elastic.Clients.Elasticsearch.Mapping.TermVectorOption Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberNo)) + { + return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.No; + } + + if (reader.ValueTextEquals(MemberWithOffsets)) + { + return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithOffsets; + } + + if (reader.ValueTextEquals(MemberWithPositions)) + { + return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithPositions; + } + + if (reader.ValueTextEquals(MemberWithPositionsOffsets)) + { + return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithPositionsOffsets; + } + + if (reader.ValueTextEquals(MemberWithPositionsOffsetsPayloads)) + { + return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithPositionsOffsetsPayloads; + } + + if (reader.ValueTextEquals(MemberWithPositionsPayloads)) + { + return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithPositionsPayloads; + } + + if (reader.ValueTextEquals(MemberYes)) + { + return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.Yes; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberNo.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.No; + } + + if (string.Equals(value, MemberWithOffsets.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithOffsets; + } + + if (string.Equals(value, MemberWithPositions.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithPositions; + } + + if (string.Equals(value, MemberWithPositionsOffsets.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithPositionsOffsets; + } + + if (string.Equals(value, MemberWithPositionsOffsetsPayloads.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithPositionsOffsetsPayloads; + } + + if (string.Equals(value, MemberWithPositionsPayloads.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithPositionsPayloads; + } + + if (string.Equals(value, MemberYes.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.Yes; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.TermVectorOption)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.TermVectorOption value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.No: + writer.WriteStringValue(MemberNo); + break; + case Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithOffsets: + writer.WriteStringValue(MemberWithOffsets); + break; + case Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithPositions: + writer.WriteStringValue(MemberWithPositions); + break; + case Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithPositionsOffsets: + writer.WriteStringValue(MemberWithPositionsOffsets); + break; + case Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithPositionsOffsetsPayloads: + writer.WriteStringValue(MemberWithPositionsOffsetsPayloads); + break; + case Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.WithPositionsPayloads: + writer.WriteStringValue(MemberWithPositionsPayloads); + break; + case Elastic.Clients.Elasticsearch.Mapping.TermVectorOption.Yes: + writer.WriteStringValue(MemberYes); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.TermVectorOption)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Mapping.TermVectorOption ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.TermVectorOption value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TermVectorOption.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TermVectorOption.g.cs new file mode 100644 index 00000000000..8784b7fbb47 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TermVectorOption.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.TermVectorOptionConverter))] +public enum TermVectorOption +{ + [System.Runtime.Serialization.EnumMember(Value = "no")] + No, + [System.Runtime.Serialization.EnumMember(Value = "with_offsets")] + WithOffsets, + [System.Runtime.Serialization.EnumMember(Value = "with_positions")] + WithPositions, + [System.Runtime.Serialization.EnumMember(Value = "with_positions_offsets")] + WithPositionsOffsets, + [System.Runtime.Serialization.EnumMember(Value = "with_positions_offsets_payloads")] + WithPositionsOffsetsPayloads, + [System.Runtime.Serialization.EnumMember(Value = "with_positions_payloads")] + WithPositionsPayloads, + [System.Runtime.Serialization.EnumMember(Value = "yes")] + Yes +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TextIndexPrefixes.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TextIndexPrefixes.Converters.g.cs new file mode 100644 index 00000000000..6a9986184d6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TextIndexPrefixes.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class TextIndexPrefixesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxChars = System.Text.Json.JsonEncodedText.Encode("max_chars"); + private static readonly System.Text.Json.JsonEncodedText PropMinChars = System.Text.Json.JsonEncodedText.Encode("min_chars"); + + public override Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixes Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxChars = default; + LocalJsonValue propMinChars = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxChars.TryReadProperty(ref reader, options, PropMaxChars, null)) + { + continue; + } + + if (propMinChars.TryReadProperty(ref reader, options, PropMinChars, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixes(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxChars = propMaxChars.Value, + MinChars = propMinChars.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixes value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxChars, value.MaxChars, null, null); + writer.WriteProperty(options, PropMinChars, value.MinChars, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TextIndexPrefixes.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TextIndexPrefixes.g.cs index 814be0b047b..fdfd09b0892 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TextIndexPrefixes.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TextIndexPrefixes.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class TextIndexPrefixesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxChars = System.Text.Json.JsonEncodedText.Encode("max_chars"); - private static readonly System.Text.Json.JsonEncodedText PropMinChars = System.Text.Json.JsonEncodedText.Encode("min_chars"); - - public override Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixes Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxChars = default; - LocalJsonValue propMinChars = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxChars.TryReadProperty(ref reader, options, PropMaxChars, null)) - { - continue; - } - - if (propMinChars.TryReadProperty(ref reader, options, PropMinChars, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixes(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxChars = propMaxChars.Value, - MinChars = propMinChars.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixes value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxChars, value.MaxChars, null, null); - writer.WriteProperty(options, PropMinChars, value.MinChars, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.TextIndexPrefixesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.TextIndexPrefixesConverter))] public sealed partial class TextIndexPrefixes { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TextProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TextProperty.Converters.g.cs new file mode 100644 index 00000000000..e62fa1a24eb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TextProperty.Converters.g.cs @@ -0,0 +1,269 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class TextPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropEagerGlobalOrdinals = System.Text.Json.JsonEncodedText.Encode("eager_global_ordinals"); + private static readonly System.Text.Json.JsonEncodedText PropFielddata = System.Text.Json.JsonEncodedText.Encode("fielddata"); + private static readonly System.Text.Json.JsonEncodedText PropFielddataFrequencyFilter = System.Text.Json.JsonEncodedText.Encode("fielddata_frequency_filter"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropIndexOptions = System.Text.Json.JsonEncodedText.Encode("index_options"); + private static readonly System.Text.Json.JsonEncodedText PropIndexPhrases = System.Text.Json.JsonEncodedText.Encode("index_phrases"); + private static readonly System.Text.Json.JsonEncodedText PropIndexPrefixes = System.Text.Json.JsonEncodedText.Encode("index_prefixes"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropNorms = System.Text.Json.JsonEncodedText.Encode("norms"); + private static readonly System.Text.Json.JsonEncodedText PropPositionIncrementGap = System.Text.Json.JsonEncodedText.Encode("position_increment_gap"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropSearchAnalyzer = System.Text.Json.JsonEncodedText.Encode("search_analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropSearchQuoteAnalyzer = System.Text.Json.JsonEncodedText.Encode("search_quote_analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropTermVector = System.Text.Json.JsonEncodedText.Encode("term_vector"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.TextProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzer = default; + LocalJsonValue propBoost = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propEagerGlobalOrdinals = default; + LocalJsonValue propFielddata = default; + LocalJsonValue propFielddataFrequencyFilter = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIndex = default; + LocalJsonValue propIndexOptions = default; + LocalJsonValue propIndexPhrases = default; + LocalJsonValue propIndexPrefixes = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propNorms = default; + LocalJsonValue propPositionIncrementGap = default; + LocalJsonValue propProperties = default; + LocalJsonValue propSearchAnalyzer = default; + LocalJsonValue propSearchQuoteAnalyzer = default; + LocalJsonValue propSimilarity = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + LocalJsonValue propTermVector = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) + { + continue; + } + + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEagerGlobalOrdinals.TryReadProperty(ref reader, options, PropEagerGlobalOrdinals, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFielddata.TryReadProperty(ref reader, options, PropFielddata, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFielddataFrequencyFilter.TryReadProperty(ref reader, options, PropFielddataFrequencyFilter, null)) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndexOptions.TryReadProperty(ref reader, options, PropIndexOptions, static Elastic.Clients.Elasticsearch.Mapping.IndexOptions? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndexPhrases.TryReadProperty(ref reader, options, PropIndexPhrases, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndexPrefixes.TryReadProperty(ref reader, options, PropIndexPrefixes, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propNorms.TryReadProperty(ref reader, options, PropNorms, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPositionIncrementGap.TryReadProperty(ref reader, options, PropPositionIncrementGap, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propSearchAnalyzer.TryReadProperty(ref reader, options, PropSearchAnalyzer, null)) + { + continue; + } + + if (propSearchQuoteAnalyzer.TryReadProperty(ref reader, options, PropSearchQuoteAnalyzer, null)) + { + continue; + } + + if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTermVector.TryReadProperty(ref reader, options, PropTermVector, static Elastic.Clients.Elasticsearch.Mapping.TermVectorOption? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.TextProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analyzer = propAnalyzer.Value, + Boost = propBoost.Value, + CopyTo = propCopyTo.Value, + Dynamic = propDynamic.Value, + EagerGlobalOrdinals = propEagerGlobalOrdinals.Value, + Fielddata = propFielddata.Value, + FielddataFrequencyFilter = propFielddataFrequencyFilter.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + Index = propIndex.Value, + IndexOptions = propIndexOptions.Value, + IndexPhrases = propIndexPhrases.Value, + IndexPrefixes = propIndexPrefixes.Value, + Meta = propMeta.Value, + Norms = propNorms.Value, + PositionIncrementGap = propPositionIncrementGap.Value, + Properties = propProperties.Value, + SearchAnalyzer = propSearchAnalyzer.Value, + SearchQuoteAnalyzer = propSearchQuoteAnalyzer.Value, + Similarity = propSimilarity.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value, + TermVector = propTermVector.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.TextProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEagerGlobalOrdinals, value.EagerGlobalOrdinals, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFielddata, value.Fielddata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFielddataFrequencyFilter, value.FielddataFrequencyFilter, null, null); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndexOptions, value.IndexOptions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.IndexOptions? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndexPhrases, value.IndexPhrases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndexPrefixes, value.IndexPrefixes, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNorms, value.Norms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPositionIncrementGap, value.PositionIncrementGap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropSearchAnalyzer, value.SearchAnalyzer, null, null); + writer.WriteProperty(options, PropSearchQuoteAnalyzer, value.SearchQuoteAnalyzer, null, null); + writer.WriteProperty(options, PropSimilarity, value.Similarity, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTermVector, value.TermVector, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TermVectorOption? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TextProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TextProperty.g.cs index 955e8dff5fa..efb45617c5f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TextProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TextProperty.g.cs @@ -23,252 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class TextPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropEagerGlobalOrdinals = System.Text.Json.JsonEncodedText.Encode("eager_global_ordinals"); - private static readonly System.Text.Json.JsonEncodedText PropFielddata = System.Text.Json.JsonEncodedText.Encode("fielddata"); - private static readonly System.Text.Json.JsonEncodedText PropFielddataFrequencyFilter = System.Text.Json.JsonEncodedText.Encode("fielddata_frequency_filter"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropIndexOptions = System.Text.Json.JsonEncodedText.Encode("index_options"); - private static readonly System.Text.Json.JsonEncodedText PropIndexPhrases = System.Text.Json.JsonEncodedText.Encode("index_phrases"); - private static readonly System.Text.Json.JsonEncodedText PropIndexPrefixes = System.Text.Json.JsonEncodedText.Encode("index_prefixes"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropNorms = System.Text.Json.JsonEncodedText.Encode("norms"); - private static readonly System.Text.Json.JsonEncodedText PropPositionIncrementGap = System.Text.Json.JsonEncodedText.Encode("position_increment_gap"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropSearchAnalyzer = System.Text.Json.JsonEncodedText.Encode("search_analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropSearchQuoteAnalyzer = System.Text.Json.JsonEncodedText.Encode("search_quote_analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropTermVector = System.Text.Json.JsonEncodedText.Encode("term_vector"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.TextProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyzer = default; - LocalJsonValue propBoost = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propEagerGlobalOrdinals = default; - LocalJsonValue propFielddata = default; - LocalJsonValue propFielddataFrequencyFilter = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIndex = default; - LocalJsonValue propIndexOptions = default; - LocalJsonValue propIndexPhrases = default; - LocalJsonValue propIndexPrefixes = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propNorms = default; - LocalJsonValue propPositionIncrementGap = default; - LocalJsonValue propProperties = default; - LocalJsonValue propSearchAnalyzer = default; - LocalJsonValue propSearchQuoteAnalyzer = default; - LocalJsonValue propSimilarity = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - LocalJsonValue propTermVector = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) - { - continue; - } - - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEagerGlobalOrdinals.TryReadProperty(ref reader, options, PropEagerGlobalOrdinals, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFielddata.TryReadProperty(ref reader, options, PropFielddata, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFielddataFrequencyFilter.TryReadProperty(ref reader, options, PropFielddataFrequencyFilter, null)) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndexOptions.TryReadProperty(ref reader, options, PropIndexOptions, static Elastic.Clients.Elasticsearch.Mapping.IndexOptions? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndexPhrases.TryReadProperty(ref reader, options, PropIndexPhrases, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndexPrefixes.TryReadProperty(ref reader, options, PropIndexPrefixes, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propNorms.TryReadProperty(ref reader, options, PropNorms, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPositionIncrementGap.TryReadProperty(ref reader, options, PropPositionIncrementGap, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propSearchAnalyzer.TryReadProperty(ref reader, options, PropSearchAnalyzer, null)) - { - continue; - } - - if (propSearchQuoteAnalyzer.TryReadProperty(ref reader, options, PropSearchQuoteAnalyzer, null)) - { - continue; - } - - if (propSimilarity.TryReadProperty(ref reader, options, PropSimilarity, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTermVector.TryReadProperty(ref reader, options, PropTermVector, static Elastic.Clients.Elasticsearch.Mapping.TermVectorOption? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.TextProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analyzer = propAnalyzer.Value, - Boost = propBoost.Value, - CopyTo = propCopyTo.Value, - Dynamic = propDynamic.Value, - EagerGlobalOrdinals = propEagerGlobalOrdinals.Value, - Fielddata = propFielddata.Value, - FielddataFrequencyFilter = propFielddataFrequencyFilter.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - Index = propIndex.Value, - IndexOptions = propIndexOptions.Value, - IndexPhrases = propIndexPhrases.Value, - IndexPrefixes = propIndexPrefixes.Value, - Meta = propMeta.Value, - Norms = propNorms.Value, - PositionIncrementGap = propPositionIncrementGap.Value, - Properties = propProperties.Value, - SearchAnalyzer = propSearchAnalyzer.Value, - SearchQuoteAnalyzer = propSearchQuoteAnalyzer.Value, - Similarity = propSimilarity.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value, - TermVector = propTermVector.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.TextProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEagerGlobalOrdinals, value.EagerGlobalOrdinals, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFielddata, value.Fielddata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFielddataFrequencyFilter, value.FielddataFrequencyFilter, null, null); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndexOptions, value.IndexOptions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.IndexOptions? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndexPhrases, value.IndexPhrases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndexPrefixes, value.IndexPrefixes, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNorms, value.Norms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPositionIncrementGap, value.PositionIncrementGap, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropSearchAnalyzer, value.SearchAnalyzer, null, null); - writer.WriteProperty(options, PropSearchQuoteAnalyzer, value.SearchQuoteAnalyzer, null, null); - writer.WriteProperty(options, PropSimilarity, value.Similarity, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTermVector, value.TermVector, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TermVectorOption? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.TextPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.TextPropertyConverter))] public sealed partial class TextProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TimeSeriesMetricType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TimeSeriesMetricType.Converters.g.cs new file mode 100644 index 00000000000..8d37a3cbd6a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TimeSeriesMetricType.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class TimeSeriesMetricTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCounter = System.Text.Json.JsonEncodedText.Encode("counter"); + private static readonly System.Text.Json.JsonEncodedText MemberGauge = System.Text.Json.JsonEncodedText.Encode("gauge"); + private static readonly System.Text.Json.JsonEncodedText MemberHistogram = System.Text.Json.JsonEncodedText.Encode("histogram"); + private static readonly System.Text.Json.JsonEncodedText MemberPosition = System.Text.Json.JsonEncodedText.Encode("position"); + private static readonly System.Text.Json.JsonEncodedText MemberSummary = System.Text.Json.JsonEncodedText.Encode("summary"); + + public override Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCounter)) + { + return Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Counter; + } + + if (reader.ValueTextEquals(MemberGauge)) + { + return Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Gauge; + } + + if (reader.ValueTextEquals(MemberHistogram)) + { + return Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Histogram; + } + + if (reader.ValueTextEquals(MemberPosition)) + { + return Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Position; + } + + if (reader.ValueTextEquals(MemberSummary)) + { + return Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Summary; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCounter.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Counter; + } + + if (string.Equals(value, MemberGauge.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Gauge; + } + + if (string.Equals(value, MemberHistogram.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Histogram; + } + + if (string.Equals(value, MemberPosition.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Position; + } + + if (string.Equals(value, MemberSummary.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Summary; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Counter: + writer.WriteStringValue(MemberCounter); + break; + case Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Gauge: + writer.WriteStringValue(MemberGauge); + break; + case Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Histogram: + writer.WriteStringValue(MemberHistogram); + break; + case Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Position: + writer.WriteStringValue(MemberPosition); + break; + case Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType.Summary: + writer.WriteStringValue(MemberSummary); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TimeSeriesMetricType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TimeSeriesMetricType.g.cs new file mode 100644 index 00000000000..7d61f9b35cd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TimeSeriesMetricType.g.cs @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.TimeSeriesMetricTypeConverter))] +public enum TimeSeriesMetricType +{ + [System.Runtime.Serialization.EnumMember(Value = "counter")] + Counter, + [System.Runtime.Serialization.EnumMember(Value = "gauge")] + Gauge, + [System.Runtime.Serialization.EnumMember(Value = "histogram")] + Histogram, + [System.Runtime.Serialization.EnumMember(Value = "position")] + Position, + [System.Runtime.Serialization.EnumMember(Value = "summary")] + Summary +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TokenCountProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TokenCountProperty.Converters.g.cs new file mode 100644 index 00000000000..ba5c5d3bba7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TokenCountProperty.Converters.g.cs @@ -0,0 +1,188 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class TokenCountPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropEnablePositionIncrements = System.Text.Json.JsonEncodedText.Encode("enable_position_increments"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.TokenCountProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzer = default; + LocalJsonValue propBoost = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propEnablePositionIncrements = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propNullValue = default; + LocalJsonValue propProperties = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) + { + continue; + } + + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEnablePositionIncrements.TryReadProperty(ref reader, options, PropEnablePositionIncrements, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.TokenCountProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analyzer = propAnalyzer.Value, + Boost = propBoost.Value, + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + EnablePositionIncrements = propEnablePositionIncrements.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + Index = propIndex.Value, + Meta = propMeta.Value, + NullValue = propNullValue.Value, + Properties = propProperties.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.TokenCountProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEnablePositionIncrements, value.EnablePositionIncrements, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNullValue, value.NullValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TokenCountProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TokenCountProperty.g.cs index 448663ac3cc..25d051d59b0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TokenCountProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TokenCountProperty.g.cs @@ -23,171 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class TokenCountPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropEnablePositionIncrements = System.Text.Json.JsonEncodedText.Encode("enable_position_increments"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.TokenCountProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyzer = default; - LocalJsonValue propBoost = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propEnablePositionIncrements = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propNullValue = default; - LocalJsonValue propProperties = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) - { - continue; - } - - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEnablePositionIncrements.TryReadProperty(ref reader, options, PropEnablePositionIncrements, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.TokenCountProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analyzer = propAnalyzer.Value, - Boost = propBoost.Value, - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - EnablePositionIncrements = propEnablePositionIncrements.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - Index = propIndex.Value, - Meta = propMeta.Value, - NullValue = propNullValue.Value, - Properties = propProperties.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.TokenCountProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEnablePositionIncrements, value.EnablePositionIncrements, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNullValue, value.NullValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.TokenCountPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.TokenCountPropertyConverter))] public sealed partial class TokenCountProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TypeMapping.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TypeMapping.Converters.g.cs new file mode 100644 index 00000000000..853f809888d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TypeMapping.Converters.g.cs @@ -0,0 +1,207 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class TypeMappingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllField = System.Text.Json.JsonEncodedText.Encode("all_field"); + private static readonly System.Text.Json.JsonEncodedText PropDataStreamTimestamp = System.Text.Json.JsonEncodedText.Encode("_data_stream_timestamp"); + private static readonly System.Text.Json.JsonEncodedText PropDateDetection = System.Text.Json.JsonEncodedText.Encode("date_detection"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropDynamicDateFormats = System.Text.Json.JsonEncodedText.Encode("dynamic_date_formats"); + private static readonly System.Text.Json.JsonEncodedText PropDynamicTemplates = System.Text.Json.JsonEncodedText.Encode("dynamic_templates"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropFieldNames = System.Text.Json.JsonEncodedText.Encode("_field_names"); + private static readonly System.Text.Json.JsonEncodedText PropIndexField = System.Text.Json.JsonEncodedText.Encode("index_field"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); + private static readonly System.Text.Json.JsonEncodedText PropNumericDetection = System.Text.Json.JsonEncodedText.Encode("numeric_detection"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("_routing"); + private static readonly System.Text.Json.JsonEncodedText PropRuntime = System.Text.Json.JsonEncodedText.Encode("runtime"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("_size"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); + private static readonly System.Text.Json.JsonEncodedText PropSubobjects = System.Text.Json.JsonEncodedText.Encode("subobjects"); + + public override Elastic.Clients.Elasticsearch.Mapping.TypeMapping Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllField = default; + LocalJsonValue propDataStreamTimestamp = default; + LocalJsonValue propDateDetection = default; + LocalJsonValue propDynamic = default; + LocalJsonValue?> propDynamicDateFormats = default; + LocalJsonValue>?> propDynamicTemplates = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propFieldNames = default; + LocalJsonValue propIndexField = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propNumericDetection = default; + LocalJsonValue propProperties = default; + LocalJsonValue propRouting = default; + LocalJsonValue?> propRuntime = default; + LocalJsonValue propSize = default; + LocalJsonValue propSource = default; + LocalJsonValue propSubobjects = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllField.TryReadProperty(ref reader, options, PropAllField, null)) + { + continue; + } + + if (propDataStreamTimestamp.TryReadProperty(ref reader, options, PropDataStreamTimestamp, null)) + { + continue; + } + + if (propDateDetection.TryReadProperty(ref reader, options, PropDateDetection, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamicDateFormats.TryReadProperty(ref reader, options, PropDynamicDateFormats, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propDynamicTemplates.TryReadProperty(ref reader, options, PropDynamicTemplates, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null)))) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFieldNames.TryReadProperty(ref reader, options, PropFieldNames, null)) + { + continue; + } + + if (propIndexField.TryReadProperty(ref reader, options, PropIndexField, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propNumericDetection.TryReadProperty(ref reader, options, PropNumericDetection, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (propRuntime.TryReadProperty(ref reader, options, PropRuntime, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, null)) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (propSubobjects.TryReadProperty(ref reader, options, PropSubobjects, static Elastic.Clients.Elasticsearch.Mapping.Subobjects? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.TypeMapping(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllField = propAllField.Value, + DataStreamTimestamp = propDataStreamTimestamp.Value, + DateDetection = propDateDetection.Value, + Dynamic = propDynamic.Value, + DynamicDateFormats = propDynamicDateFormats.Value, + DynamicTemplates = propDynamicTemplates.Value, + Enabled = propEnabled.Value, + FieldNames = propFieldNames.Value, + IndexField = propIndexField.Value, + Meta = propMeta.Value, + NumericDetection = propNumericDetection.Value, + Properties = propProperties.Value, + Routing = propRouting.Value, + Runtime = propRuntime.Value, + Size = propSize.Value, + Source = propSource.Value, + Subobjects = propSubobjects.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.TypeMapping value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllField, value.AllField, null, null); + writer.WriteProperty(options, PropDataStreamTimestamp, value.DataStreamTimestamp, null, null); + writer.WriteProperty(options, PropDateDetection, value.DateDetection, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamicDateFormats, value.DynamicDateFormats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDynamicTemplates, value.DynamicTemplates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null))); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFieldNames, value.FieldNames, null, null); + writer.WriteProperty(options, PropIndexField, value.IndexField, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropNumericDetection, value.NumericDetection, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteProperty(options, PropRuntime, value.Runtime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropSize, value.Size, null, null); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteProperty(options, PropSubobjects, value.Subobjects, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.Subobjects? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TypeMapping.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TypeMapping.g.cs index 8ec9d46e4e5..54a7f73ed7e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TypeMapping.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TypeMapping.g.cs @@ -23,190 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class TypeMappingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllField = System.Text.Json.JsonEncodedText.Encode("all_field"); - private static readonly System.Text.Json.JsonEncodedText PropDataStreamTimestamp = System.Text.Json.JsonEncodedText.Encode("_data_stream_timestamp"); - private static readonly System.Text.Json.JsonEncodedText PropDateDetection = System.Text.Json.JsonEncodedText.Encode("date_detection"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropDynamicDateFormats = System.Text.Json.JsonEncodedText.Encode("dynamic_date_formats"); - private static readonly System.Text.Json.JsonEncodedText PropDynamicTemplates = System.Text.Json.JsonEncodedText.Encode("dynamic_templates"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropFieldNames = System.Text.Json.JsonEncodedText.Encode("_field_names"); - private static readonly System.Text.Json.JsonEncodedText PropIndexField = System.Text.Json.JsonEncodedText.Encode("index_field"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); - private static readonly System.Text.Json.JsonEncodedText PropNumericDetection = System.Text.Json.JsonEncodedText.Encode("numeric_detection"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("_routing"); - private static readonly System.Text.Json.JsonEncodedText PropRuntime = System.Text.Json.JsonEncodedText.Encode("runtime"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("_size"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); - private static readonly System.Text.Json.JsonEncodedText PropSubobjects = System.Text.Json.JsonEncodedText.Encode("subobjects"); - - public override Elastic.Clients.Elasticsearch.Mapping.TypeMapping Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllField = default; - LocalJsonValue propDataStreamTimestamp = default; - LocalJsonValue propDateDetection = default; - LocalJsonValue propDynamic = default; - LocalJsonValue?> propDynamicDateFormats = default; - LocalJsonValue>?> propDynamicTemplates = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propFieldNames = default; - LocalJsonValue propIndexField = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propNumericDetection = default; - LocalJsonValue propProperties = default; - LocalJsonValue propRouting = default; - LocalJsonValue?> propRuntime = default; - LocalJsonValue propSize = default; - LocalJsonValue propSource = default; - LocalJsonValue propSubobjects = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllField.TryReadProperty(ref reader, options, PropAllField, null)) - { - continue; - } - - if (propDataStreamTimestamp.TryReadProperty(ref reader, options, PropDataStreamTimestamp, null)) - { - continue; - } - - if (propDateDetection.TryReadProperty(ref reader, options, PropDateDetection, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamicDateFormats.TryReadProperty(ref reader, options, PropDynamicDateFormats, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propDynamicTemplates.TryReadProperty(ref reader, options, PropDynamicTemplates, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null)))) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFieldNames.TryReadProperty(ref reader, options, PropFieldNames, null)) - { - continue; - } - - if (propIndexField.TryReadProperty(ref reader, options, PropIndexField, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propNumericDetection.TryReadProperty(ref reader, options, PropNumericDetection, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (propRuntime.TryReadProperty(ref reader, options, PropRuntime, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, null)) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (propSubobjects.TryReadProperty(ref reader, options, PropSubobjects, static Elastic.Clients.Elasticsearch.Mapping.Subobjects? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.TypeMapping(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllField = propAllField.Value, - DataStreamTimestamp = propDataStreamTimestamp.Value, - DateDetection = propDateDetection.Value, - Dynamic = propDynamic.Value, - DynamicDateFormats = propDynamicDateFormats.Value, - DynamicTemplates = propDynamicTemplates.Value, - Enabled = propEnabled.Value, - FieldNames = propFieldNames.Value, - IndexField = propIndexField.Value, - Meta = propMeta.Value, - NumericDetection = propNumericDetection.Value, - Properties = propProperties.Value, - Routing = propRouting.Value, - Runtime = propRuntime.Value, - Size = propSize.Value, - Source = propSource.Value, - Subobjects = propSubobjects.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.TypeMapping value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllField, value.AllField, null, null); - writer.WriteProperty(options, PropDataStreamTimestamp, value.DataStreamTimestamp, null, null); - writer.WriteProperty(options, PropDateDetection, value.DateDetection, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamicDateFormats, value.DynamicDateFormats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDynamicTemplates, value.DynamicTemplates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null))); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFieldNames, value.FieldNames, null, null); - writer.WriteProperty(options, PropIndexField, value.IndexField, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropNumericDetection, value.NumericDetection, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteProperty(options, PropRuntime, value.Runtime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropSize, value.Size, null, null); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteProperty(options, PropSubobjects, value.Subobjects, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.Subobjects? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.TypeMappingConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.TypeMappingConverter))] public sealed partial class TypeMapping { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/UnsignedLongNumberProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/UnsignedLongNumberProperty.Converters.g.cs new file mode 100644 index 00000000000..13aef49c396 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/UnsignedLongNumberProperty.Converters.g.cs @@ -0,0 +1,224 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class UnsignedLongNumberPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); + private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.UnsignedLongNumberProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propCoerce = default; + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue propIgnoreMalformed = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propNullValue = default; + LocalJsonValue propOnScriptError = default; + LocalJsonValue propProperties = default; + LocalJsonValue propScript = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + LocalJsonValue propTimeSeriesDimension = default; + LocalJsonValue propTimeSeriesMetric = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.UnsignedLongNumberProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Coerce = propCoerce.Value, + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + IgnoreMalformed = propIgnoreMalformed.Value, + Index = propIndex.Value, + Meta = propMeta.Value, + NullValue = propNullValue.Value, + OnScriptError = propOnScriptError.Value, + Properties = propProperties.Value, + Script = propScript.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value, + TimeSeriesDimension = propTimeSeriesDimension.Value, + TimeSeriesMetric = propTimeSeriesMetric.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.UnsignedLongNumberProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNullValue, value.NullValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/UnsignedLongNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/UnsignedLongNumberProperty.g.cs index f7866fe4de3..7dc43dd9d0a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/UnsignedLongNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/UnsignedLongNumberProperty.g.cs @@ -23,207 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class UnsignedLongNumberPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); - private static readonly System.Text.Json.JsonEncodedText PropOnScriptError = System.Text.Json.JsonEncodedText.Encode("on_script_error"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesDimension = System.Text.Json.JsonEncodedText.Encode("time_series_dimension"); - private static readonly System.Text.Json.JsonEncodedText PropTimeSeriesMetric = System.Text.Json.JsonEncodedText.Encode("time_series_metric"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.UnsignedLongNumberProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propCoerce = default; - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue propIgnoreMalformed = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propNullValue = default; - LocalJsonValue propOnScriptError = default; - LocalJsonValue propProperties = default; - LocalJsonValue propScript = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - LocalJsonValue propTimeSeriesDimension = default; - LocalJsonValue propTimeSeriesMetric = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCoerce.TryReadProperty(ref reader, options, PropCoerce, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreMalformed.TryReadProperty(ref reader, options, PropIgnoreMalformed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOnScriptError.TryReadProperty(ref reader, options, PropOnScriptError, static Elastic.Clients.Elasticsearch.Mapping.OnScriptError? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesDimension.TryReadProperty(ref reader, options, PropTimeSeriesDimension, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeSeriesMetric.TryReadProperty(ref reader, options, PropTimeSeriesMetric, static Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.UnsignedLongNumberProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Coerce = propCoerce.Value, - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - IgnoreMalformed = propIgnoreMalformed.Value, - Index = propIndex.Value, - Meta = propMeta.Value, - NullValue = propNullValue.Value, - OnScriptError = propOnScriptError.Value, - Properties = propProperties.Value, - Script = propScript.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value, - TimeSeriesDimension = propTimeSeriesDimension.Value, - TimeSeriesMetric = propTimeSeriesMetric.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.UnsignedLongNumberProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCoerce, value.Coerce, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreMalformed, value.IgnoreMalformed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNullValue, value.NullValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOnScriptError, value.OnScriptError, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.OnScriptError? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesDimension, value.TimeSeriesDimension, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeSeriesMetric, value.TimeSeriesMetric, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.UnsignedLongNumberPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.UnsignedLongNumberPropertyConverter))] public sealed partial class UnsignedLongNumberProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/VersionProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/VersionProperty.Converters.g.cs new file mode 100644 index 00000000000..63f80452a75 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/VersionProperty.Converters.g.cs @@ -0,0 +1,143 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class VersionPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.VersionProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propProperties = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.VersionProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + Meta = propMeta.Value, + Properties = propProperties.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.VersionProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/VersionProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/VersionProperty.g.cs index 8566a0539ad..db484c1d269 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/VersionProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/VersionProperty.g.cs @@ -23,126 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class VersionPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.VersionProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propProperties = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.VersionProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - Meta = propMeta.Value, - Properties = propProperties.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.VersionProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.VersionPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.VersionPropertyConverter))] public sealed partial class VersionProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/WildcardProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/WildcardProperty.Converters.g.cs new file mode 100644 index 00000000000..44a62c8d409 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/WildcardProperty.Converters.g.cs @@ -0,0 +1,152 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Mapping.Json; + +public sealed partial class WildcardPropertyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); + private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); + private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); + private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); + private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); + private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Mapping.WildcardProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCopyTo = default; + LocalJsonValue propDocValues = default; + LocalJsonValue propDynamic = default; + LocalJsonValue propFields = default; + LocalJsonValue propIgnoreAbove = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propNullValue = default; + LocalJsonValue propProperties = default; + LocalJsonValue propStore = default; + LocalJsonValue propSyntheticSourceKeep = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, null)) + { + continue; + } + + if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) + { + continue; + } + + if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Mapping.WildcardProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CopyTo = propCopyTo.Value, + DocValues = propDocValues.Value, + Dynamic = propDynamic.Value, + Fields = propFields.Value, + IgnoreAbove = propIgnoreAbove.Value, + Meta = propMeta.Value, + NullValue = propNullValue.Value, + Properties = propProperties.Value, + Store = propStore.Value, + SyntheticSourceKeep = propSyntheticSourceKeep.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.WildcardProperty value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNullValue, value.NullValue, null, null); + writer.WriteProperty(options, PropProperties, value.Properties, null, null); + writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/WildcardProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/WildcardProperty.g.cs index f9b07a18195..ec92fb2d131 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/WildcardProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/WildcardProperty.g.cs @@ -23,135 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping; -internal sealed partial class WildcardPropertyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCopyTo = System.Text.Json.JsonEncodedText.Encode("copy_to"); - private static readonly System.Text.Json.JsonEncodedText PropDocValues = System.Text.Json.JsonEncodedText.Encode("doc_values"); - private static readonly System.Text.Json.JsonEncodedText PropDynamic = System.Text.Json.JsonEncodedText.Encode("dynamic"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreAbove = System.Text.Json.JsonEncodedText.Encode("ignore_above"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText PropNullValue = System.Text.Json.JsonEncodedText.Encode("null_value"); - private static readonly System.Text.Json.JsonEncodedText PropProperties = System.Text.Json.JsonEncodedText.Encode("properties"); - private static readonly System.Text.Json.JsonEncodedText PropStore = System.Text.Json.JsonEncodedText.Encode("store"); - private static readonly System.Text.Json.JsonEncodedText PropSyntheticSourceKeep = System.Text.Json.JsonEncodedText.Encode("synthetic_source_keep"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Mapping.WildcardProperty Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCopyTo = default; - LocalJsonValue propDocValues = default; - LocalJsonValue propDynamic = default; - LocalJsonValue propFields = default; - LocalJsonValue propIgnoreAbove = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propNullValue = default; - LocalJsonValue propProperties = default; - LocalJsonValue propStore = default; - LocalJsonValue propSyntheticSourceKeep = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCopyTo.TryReadProperty(ref reader, options, PropCopyTo, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propDocValues.TryReadProperty(ref reader, options, PropDocValues, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDynamic.TryReadProperty(ref reader, options, PropDynamic, static Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propIgnoreAbove.TryReadProperty(ref reader, options, PropIgnoreAbove, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propNullValue.TryReadProperty(ref reader, options, PropNullValue, null)) - { - continue; - } - - if (propProperties.TryReadProperty(ref reader, options, PropProperties, null)) - { - continue; - } - - if (propStore.TryReadProperty(ref reader, options, PropStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSyntheticSourceKeep.TryReadProperty(ref reader, options, PropSyntheticSourceKeep, static Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Mapping.WildcardProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CopyTo = propCopyTo.Value, - DocValues = propDocValues.Value, - Dynamic = propDynamic.Value, - Fields = propFields.Value, - IgnoreAbove = propIgnoreAbove.Value, - Meta = propMeta.Value, - NullValue = propNullValue.Value, - Properties = propProperties.Value, - Store = propStore.Value, - SyntheticSourceKeep = propSyntheticSourceKeep.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Mapping.WildcardProperty value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCopyTo, value.CopyTo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropDocValues, value.DocValues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDynamic, value.Dynamic, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropIgnoreAbove, value.IgnoreAbove, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNullValue, value.NullValue, null, null); - writer.WriteProperty(options, PropProperties, value.Properties, null, null); - writer.WriteProperty(options, PropStore, value.Store, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSyntheticSourceKeep, value.SyntheticSourceKeep, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Mapping.SyntheticSourceKeepEnum? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.WildcardPropertyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.WildcardPropertyConverter))] public sealed partial class WildcardProperty : Elastic.Clients.Elasticsearch.Mapping.IProperty { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MergesStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MergesStats.Converters.g.cs new file mode 100644 index 00000000000..9555750e261 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MergesStats.Converters.g.cs @@ -0,0 +1,198 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class MergesStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCurrent = System.Text.Json.JsonEncodedText.Encode("current"); + private static readonly System.Text.Json.JsonEncodedText PropCurrentDocs = System.Text.Json.JsonEncodedText.Encode("current_docs"); + private static readonly System.Text.Json.JsonEncodedText PropCurrentSize = System.Text.Json.JsonEncodedText.Encode("current_size"); + private static readonly System.Text.Json.JsonEncodedText PropCurrentSizeInBytes = System.Text.Json.JsonEncodedText.Encode("current_size_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + private static readonly System.Text.Json.JsonEncodedText PropTotalAutoThrottle = System.Text.Json.JsonEncodedText.Encode("total_auto_throttle"); + private static readonly System.Text.Json.JsonEncodedText PropTotalAutoThrottleInBytes = System.Text.Json.JsonEncodedText.Encode("total_auto_throttle_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTotalDocs = System.Text.Json.JsonEncodedText.Encode("total_docs"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSize = System.Text.Json.JsonEncodedText.Encode("total_size"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSizeInBytes = System.Text.Json.JsonEncodedText.Encode("total_size_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTotalStoppedTime = System.Text.Json.JsonEncodedText.Encode("total_stopped_time"); + private static readonly System.Text.Json.JsonEncodedText PropTotalStoppedTimeInMillis = System.Text.Json.JsonEncodedText.Encode("total_stopped_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTotalThrottledTime = System.Text.Json.JsonEncodedText.Encode("total_throttled_time"); + private static readonly System.Text.Json.JsonEncodedText PropTotalThrottledTimeInMillis = System.Text.Json.JsonEncodedText.Encode("total_throttled_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTotalTime = System.Text.Json.JsonEncodedText.Encode("total_time"); + private static readonly System.Text.Json.JsonEncodedText PropTotalTimeInMillis = System.Text.Json.JsonEncodedText.Encode("total_time_in_millis"); + + public override Elastic.Clients.Elasticsearch.MergesStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCurrent = default; + LocalJsonValue propCurrentDocs = default; + LocalJsonValue propCurrentSize = default; + LocalJsonValue propCurrentSizeInBytes = default; + LocalJsonValue propTotal = default; + LocalJsonValue propTotalAutoThrottle = default; + LocalJsonValue propTotalAutoThrottleInBytes = default; + LocalJsonValue propTotalDocs = default; + LocalJsonValue propTotalSize = default; + LocalJsonValue propTotalSizeInBytes = default; + LocalJsonValue propTotalStoppedTime = default; + LocalJsonValue propTotalStoppedTimeInMillis = default; + LocalJsonValue propTotalThrottledTime = default; + LocalJsonValue propTotalThrottledTimeInMillis = default; + LocalJsonValue propTotalTime = default; + LocalJsonValue propTotalTimeInMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCurrent.TryReadProperty(ref reader, options, PropCurrent, null)) + { + continue; + } + + if (propCurrentDocs.TryReadProperty(ref reader, options, PropCurrentDocs, null)) + { + continue; + } + + if (propCurrentSize.TryReadProperty(ref reader, options, PropCurrentSize, null)) + { + continue; + } + + if (propCurrentSizeInBytes.TryReadProperty(ref reader, options, PropCurrentSizeInBytes, null)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (propTotalAutoThrottle.TryReadProperty(ref reader, options, PropTotalAutoThrottle, null)) + { + continue; + } + + if (propTotalAutoThrottleInBytes.TryReadProperty(ref reader, options, PropTotalAutoThrottleInBytes, null)) + { + continue; + } + + if (propTotalDocs.TryReadProperty(ref reader, options, PropTotalDocs, null)) + { + continue; + } + + if (propTotalSize.TryReadProperty(ref reader, options, PropTotalSize, null)) + { + continue; + } + + if (propTotalSizeInBytes.TryReadProperty(ref reader, options, PropTotalSizeInBytes, null)) + { + continue; + } + + if (propTotalStoppedTime.TryReadProperty(ref reader, options, PropTotalStoppedTime, null)) + { + continue; + } + + if (propTotalStoppedTimeInMillis.TryReadProperty(ref reader, options, PropTotalStoppedTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTotalThrottledTime.TryReadProperty(ref reader, options, PropTotalThrottledTime, null)) + { + continue; + } + + if (propTotalThrottledTimeInMillis.TryReadProperty(ref reader, options, PropTotalThrottledTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTotalTime.TryReadProperty(ref reader, options, PropTotalTime, null)) + { + continue; + } + + if (propTotalTimeInMillis.TryReadProperty(ref reader, options, PropTotalTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.MergesStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Current = propCurrent.Value, + CurrentDocs = propCurrentDocs.Value, + CurrentSize = propCurrentSize.Value, + CurrentSizeInBytes = propCurrentSizeInBytes.Value, + Total = propTotal.Value, + TotalAutoThrottle = propTotalAutoThrottle.Value, + TotalAutoThrottleInBytes = propTotalAutoThrottleInBytes.Value, + TotalDocs = propTotalDocs.Value, + TotalSize = propTotalSize.Value, + TotalSizeInBytes = propTotalSizeInBytes.Value, + TotalStoppedTime = propTotalStoppedTime.Value, + TotalStoppedTimeInMillis = propTotalStoppedTimeInMillis.Value, + TotalThrottledTime = propTotalThrottledTime.Value, + TotalThrottledTimeInMillis = propTotalThrottledTimeInMillis.Value, + TotalTime = propTotalTime.Value, + TotalTimeInMillis = propTotalTimeInMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MergesStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCurrent, value.Current, null, null); + writer.WriteProperty(options, PropCurrentDocs, value.CurrentDocs, null, null); + writer.WriteProperty(options, PropCurrentSize, value.CurrentSize, null, null); + writer.WriteProperty(options, PropCurrentSizeInBytes, value.CurrentSizeInBytes, null, null); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteProperty(options, PropTotalAutoThrottle, value.TotalAutoThrottle, null, null); + writer.WriteProperty(options, PropTotalAutoThrottleInBytes, value.TotalAutoThrottleInBytes, null, null); + writer.WriteProperty(options, PropTotalDocs, value.TotalDocs, null, null); + writer.WriteProperty(options, PropTotalSize, value.TotalSize, null, null); + writer.WriteProperty(options, PropTotalSizeInBytes, value.TotalSizeInBytes, null, null); + writer.WriteProperty(options, PropTotalStoppedTime, value.TotalStoppedTime, null, null); + writer.WriteProperty(options, PropTotalStoppedTimeInMillis, value.TotalStoppedTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTotalThrottledTime, value.TotalThrottledTime, null, null); + writer.WriteProperty(options, PropTotalThrottledTimeInMillis, value.TotalThrottledTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTotalTime, value.TotalTime, null, null); + writer.WriteProperty(options, PropTotalTimeInMillis, value.TotalTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MergesStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MergesStats.g.cs index 1db8f5dcd8c..ce452c41f60 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MergesStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MergesStats.g.cs @@ -23,181 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class MergesStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCurrent = System.Text.Json.JsonEncodedText.Encode("current"); - private static readonly System.Text.Json.JsonEncodedText PropCurrentDocs = System.Text.Json.JsonEncodedText.Encode("current_docs"); - private static readonly System.Text.Json.JsonEncodedText PropCurrentSize = System.Text.Json.JsonEncodedText.Encode("current_size"); - private static readonly System.Text.Json.JsonEncodedText PropCurrentSizeInBytes = System.Text.Json.JsonEncodedText.Encode("current_size_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - private static readonly System.Text.Json.JsonEncodedText PropTotalAutoThrottle = System.Text.Json.JsonEncodedText.Encode("total_auto_throttle"); - private static readonly System.Text.Json.JsonEncodedText PropTotalAutoThrottleInBytes = System.Text.Json.JsonEncodedText.Encode("total_auto_throttle_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTotalDocs = System.Text.Json.JsonEncodedText.Encode("total_docs"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSize = System.Text.Json.JsonEncodedText.Encode("total_size"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSizeInBytes = System.Text.Json.JsonEncodedText.Encode("total_size_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTotalStoppedTime = System.Text.Json.JsonEncodedText.Encode("total_stopped_time"); - private static readonly System.Text.Json.JsonEncodedText PropTotalStoppedTimeInMillis = System.Text.Json.JsonEncodedText.Encode("total_stopped_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTotalThrottledTime = System.Text.Json.JsonEncodedText.Encode("total_throttled_time"); - private static readonly System.Text.Json.JsonEncodedText PropTotalThrottledTimeInMillis = System.Text.Json.JsonEncodedText.Encode("total_throttled_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTotalTime = System.Text.Json.JsonEncodedText.Encode("total_time"); - private static readonly System.Text.Json.JsonEncodedText PropTotalTimeInMillis = System.Text.Json.JsonEncodedText.Encode("total_time_in_millis"); - - public override Elastic.Clients.Elasticsearch.MergesStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCurrent = default; - LocalJsonValue propCurrentDocs = default; - LocalJsonValue propCurrentSize = default; - LocalJsonValue propCurrentSizeInBytes = default; - LocalJsonValue propTotal = default; - LocalJsonValue propTotalAutoThrottle = default; - LocalJsonValue propTotalAutoThrottleInBytes = default; - LocalJsonValue propTotalDocs = default; - LocalJsonValue propTotalSize = default; - LocalJsonValue propTotalSizeInBytes = default; - LocalJsonValue propTotalStoppedTime = default; - LocalJsonValue propTotalStoppedTimeInMillis = default; - LocalJsonValue propTotalThrottledTime = default; - LocalJsonValue propTotalThrottledTimeInMillis = default; - LocalJsonValue propTotalTime = default; - LocalJsonValue propTotalTimeInMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCurrent.TryReadProperty(ref reader, options, PropCurrent, null)) - { - continue; - } - - if (propCurrentDocs.TryReadProperty(ref reader, options, PropCurrentDocs, null)) - { - continue; - } - - if (propCurrentSize.TryReadProperty(ref reader, options, PropCurrentSize, null)) - { - continue; - } - - if (propCurrentSizeInBytes.TryReadProperty(ref reader, options, PropCurrentSizeInBytes, null)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (propTotalAutoThrottle.TryReadProperty(ref reader, options, PropTotalAutoThrottle, null)) - { - continue; - } - - if (propTotalAutoThrottleInBytes.TryReadProperty(ref reader, options, PropTotalAutoThrottleInBytes, null)) - { - continue; - } - - if (propTotalDocs.TryReadProperty(ref reader, options, PropTotalDocs, null)) - { - continue; - } - - if (propTotalSize.TryReadProperty(ref reader, options, PropTotalSize, null)) - { - continue; - } - - if (propTotalSizeInBytes.TryReadProperty(ref reader, options, PropTotalSizeInBytes, null)) - { - continue; - } - - if (propTotalStoppedTime.TryReadProperty(ref reader, options, PropTotalStoppedTime, null)) - { - continue; - } - - if (propTotalStoppedTimeInMillis.TryReadProperty(ref reader, options, PropTotalStoppedTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTotalThrottledTime.TryReadProperty(ref reader, options, PropTotalThrottledTime, null)) - { - continue; - } - - if (propTotalThrottledTimeInMillis.TryReadProperty(ref reader, options, PropTotalThrottledTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTotalTime.TryReadProperty(ref reader, options, PropTotalTime, null)) - { - continue; - } - - if (propTotalTimeInMillis.TryReadProperty(ref reader, options, PropTotalTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.MergesStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Current = propCurrent.Value, - CurrentDocs = propCurrentDocs.Value, - CurrentSize = propCurrentSize.Value, - CurrentSizeInBytes = propCurrentSizeInBytes.Value, - Total = propTotal.Value, - TotalAutoThrottle = propTotalAutoThrottle.Value, - TotalAutoThrottleInBytes = propTotalAutoThrottleInBytes.Value, - TotalDocs = propTotalDocs.Value, - TotalSize = propTotalSize.Value, - TotalSizeInBytes = propTotalSizeInBytes.Value, - TotalStoppedTime = propTotalStoppedTime.Value, - TotalStoppedTimeInMillis = propTotalStoppedTimeInMillis.Value, - TotalThrottledTime = propTotalThrottledTime.Value, - TotalThrottledTimeInMillis = propTotalThrottledTimeInMillis.Value, - TotalTime = propTotalTime.Value, - TotalTimeInMillis = propTotalTimeInMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.MergesStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCurrent, value.Current, null, null); - writer.WriteProperty(options, PropCurrentDocs, value.CurrentDocs, null, null); - writer.WriteProperty(options, PropCurrentSize, value.CurrentSize, null, null); - writer.WriteProperty(options, PropCurrentSizeInBytes, value.CurrentSizeInBytes, null, null); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteProperty(options, PropTotalAutoThrottle, value.TotalAutoThrottle, null, null); - writer.WriteProperty(options, PropTotalAutoThrottleInBytes, value.TotalAutoThrottleInBytes, null, null); - writer.WriteProperty(options, PropTotalDocs, value.TotalDocs, null, null); - writer.WriteProperty(options, PropTotalSize, value.TotalSize, null, null); - writer.WriteProperty(options, PropTotalSizeInBytes, value.TotalSizeInBytes, null, null); - writer.WriteProperty(options, PropTotalStoppedTime, value.TotalStoppedTime, null, null); - writer.WriteProperty(options, PropTotalStoppedTimeInMillis, value.TotalStoppedTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTotalThrottledTime, value.TotalThrottledTime, null, null); - writer.WriteProperty(options, PropTotalThrottledTimeInMillis, value.TotalThrottledTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTotalTime, value.TotalTime, null, null); - writer.WriteProperty(options, PropTotalTimeInMillis, value.TotalTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MergesStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.MergesStatsConverter))] public sealed partial class MergesStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/NestedSortValue.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/NestedSortValue.Converters.g.cs new file mode 100644 index 00000000000..e3ce2ec932a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/NestedSortValue.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class NestedSortValueConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropMaxChildren = System.Text.Json.JsonEncodedText.Encode("max_children"); + private static readonly System.Text.Json.JsonEncodedText PropNested = System.Text.Json.JsonEncodedText.Encode("nested"); + private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); + + public override Elastic.Clients.Elasticsearch.NestedSortValue Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFilter = default; + LocalJsonValue propMaxChildren = default; + LocalJsonValue propNested = default; + LocalJsonValue propPath = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) + { + continue; + } + + if (propMaxChildren.TryReadProperty(ref reader, options, PropMaxChildren, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNested.TryReadProperty(ref reader, options, PropNested, null)) + { + continue; + } + + if (propPath.TryReadProperty(ref reader, options, PropPath, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.NestedSortValue(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Filter = propFilter.Value, + MaxChildren = propMaxChildren.Value, + Nested = propNested.Value, + Path = propPath.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.NestedSortValue value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFilter, value.Filter, null, null); + writer.WriteProperty(options, PropMaxChildren, value.MaxChildren, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNested, value.Nested, null, null); + writer.WriteProperty(options, PropPath, value.Path, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/NestedSortValue.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/NestedSortValue.g.cs index 4e3eacd6096..ddb22b9d9fb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/NestedSortValue.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/NestedSortValue.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class NestedSortValueConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropMaxChildren = System.Text.Json.JsonEncodedText.Encode("max_children"); - private static readonly System.Text.Json.JsonEncodedText PropNested = System.Text.Json.JsonEncodedText.Encode("nested"); - private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); - - public override Elastic.Clients.Elasticsearch.NestedSortValue Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFilter = default; - LocalJsonValue propMaxChildren = default; - LocalJsonValue propNested = default; - LocalJsonValue propPath = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) - { - continue; - } - - if (propMaxChildren.TryReadProperty(ref reader, options, PropMaxChildren, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNested.TryReadProperty(ref reader, options, PropNested, null)) - { - continue; - } - - if (propPath.TryReadProperty(ref reader, options, PropPath, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.NestedSortValue(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Filter = propFilter.Value, - MaxChildren = propMaxChildren.Value, - Nested = propNested.Value, - Path = propPath.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.NestedSortValue value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFilter, value.Filter, null, null); - writer.WriteProperty(options, PropMaxChildren, value.MaxChildren, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNested, value.Nested, null, null); - writer.WriteProperty(options, PropPath, value.Path, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.NestedSortValueConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.NestedSortValueConverter))] public sealed partial class NestedSortValue { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeAttributes.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeAttributes.Converters.g.cs new file mode 100644 index 00000000000..9f3a94ac4df --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeAttributes.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class NodeAttributesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); + private static readonly System.Text.Json.JsonEncodedText PropEphemeralId = System.Text.Json.JsonEncodedText.Encode("ephemeral_id"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); + + public override Elastic.Clients.Elasticsearch.NodeAttributes Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propAttributes = default; + LocalJsonValue propEphemeralId = default; + LocalJsonValue propId = default; + LocalJsonValue propName = default; + LocalJsonValue propTransportAddress = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propEphemeralId.TryReadProperty(ref reader, options, PropEphemeralId, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.NodeAttributes(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Attributes = propAttributes.Value, + EphemeralId = propEphemeralId.Value, + Id = propId.Value, + Name = propName.Value, + TransportAddress = propTransportAddress.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.NodeAttributes value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropEphemeralId, value.EphemeralId, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeAttributes.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeAttributes.g.cs index 4c34f974941..16f4508a82b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeAttributes.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeAttributes.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class NodeAttributesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); - private static readonly System.Text.Json.JsonEncodedText PropEphemeralId = System.Text.Json.JsonEncodedText.Encode("ephemeral_id"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); - - public override Elastic.Clients.Elasticsearch.NodeAttributes Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propAttributes = default; - LocalJsonValue propEphemeralId = default; - LocalJsonValue propId = default; - LocalJsonValue propName = default; - LocalJsonValue propTransportAddress = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propEphemeralId.TryReadProperty(ref reader, options, PropEphemeralId, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.NodeAttributes(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Attributes = propAttributes.Value, - EphemeralId = propEphemeralId.Value, - Id = propId.Value, - Name = propName.Value, - TransportAddress = propTransportAddress.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.NodeAttributes value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropEphemeralId, value.EphemeralId, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.NodeAttributesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.NodeAttributesConverter))] public sealed partial class NodeAttributes { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeRole.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeRole.Converters.g.cs new file mode 100644 index 00000000000..ca060b998f0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeRole.Converters.g.cs @@ -0,0 +1,249 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class NodeRoleConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberClient = System.Text.Json.JsonEncodedText.Encode("client"); + private static readonly System.Text.Json.JsonEncodedText MemberCoordinatingOnly = System.Text.Json.JsonEncodedText.Encode("coordinating_only"); + private static readonly System.Text.Json.JsonEncodedText MemberData = System.Text.Json.JsonEncodedText.Encode("data"); + private static readonly System.Text.Json.JsonEncodedText MemberDataCold = System.Text.Json.JsonEncodedText.Encode("data_cold"); + private static readonly System.Text.Json.JsonEncodedText MemberDataContent = System.Text.Json.JsonEncodedText.Encode("data_content"); + private static readonly System.Text.Json.JsonEncodedText MemberDataFrozen = System.Text.Json.JsonEncodedText.Encode("data_frozen"); + private static readonly System.Text.Json.JsonEncodedText MemberDataHot = System.Text.Json.JsonEncodedText.Encode("data_hot"); + private static readonly System.Text.Json.JsonEncodedText MemberDataWarm = System.Text.Json.JsonEncodedText.Encode("data_warm"); + private static readonly System.Text.Json.JsonEncodedText MemberIngest = System.Text.Json.JsonEncodedText.Encode("ingest"); + private static readonly System.Text.Json.JsonEncodedText MemberMaster = System.Text.Json.JsonEncodedText.Encode("master"); + private static readonly System.Text.Json.JsonEncodedText MemberMl = System.Text.Json.JsonEncodedText.Encode("ml"); + private static readonly System.Text.Json.JsonEncodedText MemberRemoteClusterClient = System.Text.Json.JsonEncodedText.Encode("remote_cluster_client"); + private static readonly System.Text.Json.JsonEncodedText MemberTransform = System.Text.Json.JsonEncodedText.Encode("transform"); + private static readonly System.Text.Json.JsonEncodedText MemberVotingOnly = System.Text.Json.JsonEncodedText.Encode("voting_only"); + + public override Elastic.Clients.Elasticsearch.NodeRole Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberClient)) + { + return Elastic.Clients.Elasticsearch.NodeRole.Client; + } + + if (reader.ValueTextEquals(MemberCoordinatingOnly)) + { + return Elastic.Clients.Elasticsearch.NodeRole.CoordinatingOnly; + } + + if (reader.ValueTextEquals(MemberData)) + { + return Elastic.Clients.Elasticsearch.NodeRole.Data; + } + + if (reader.ValueTextEquals(MemberDataCold)) + { + return Elastic.Clients.Elasticsearch.NodeRole.DataCold; + } + + if (reader.ValueTextEquals(MemberDataContent)) + { + return Elastic.Clients.Elasticsearch.NodeRole.DataContent; + } + + if (reader.ValueTextEquals(MemberDataFrozen)) + { + return Elastic.Clients.Elasticsearch.NodeRole.DataFrozen; + } + + if (reader.ValueTextEquals(MemberDataHot)) + { + return Elastic.Clients.Elasticsearch.NodeRole.DataHot; + } + + if (reader.ValueTextEquals(MemberDataWarm)) + { + return Elastic.Clients.Elasticsearch.NodeRole.DataWarm; + } + + if (reader.ValueTextEquals(MemberIngest)) + { + return Elastic.Clients.Elasticsearch.NodeRole.Ingest; + } + + if (reader.ValueTextEquals(MemberMaster)) + { + return Elastic.Clients.Elasticsearch.NodeRole.Master; + } + + if (reader.ValueTextEquals(MemberMl)) + { + return Elastic.Clients.Elasticsearch.NodeRole.Ml; + } + + if (reader.ValueTextEquals(MemberRemoteClusterClient)) + { + return Elastic.Clients.Elasticsearch.NodeRole.RemoteClusterClient; + } + + if (reader.ValueTextEquals(MemberTransform)) + { + return Elastic.Clients.Elasticsearch.NodeRole.Transform; + } + + if (reader.ValueTextEquals(MemberVotingOnly)) + { + return Elastic.Clients.Elasticsearch.NodeRole.VotingOnly; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberClient.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.NodeRole.Client; + } + + if (string.Equals(value, MemberCoordinatingOnly.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.NodeRole.CoordinatingOnly; + } + + if (string.Equals(value, MemberData.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.NodeRole.Data; + } + + if (string.Equals(value, MemberDataCold.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.NodeRole.DataCold; + } + + if (string.Equals(value, MemberDataContent.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.NodeRole.DataContent; + } + + if (string.Equals(value, MemberDataFrozen.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.NodeRole.DataFrozen; + } + + if (string.Equals(value, MemberDataHot.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.NodeRole.DataHot; + } + + if (string.Equals(value, MemberDataWarm.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.NodeRole.DataWarm; + } + + if (string.Equals(value, MemberIngest.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.NodeRole.Ingest; + } + + if (string.Equals(value, MemberMaster.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.NodeRole.Master; + } + + if (string.Equals(value, MemberMl.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.NodeRole.Ml; + } + + if (string.Equals(value, MemberRemoteClusterClient.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.NodeRole.RemoteClusterClient; + } + + if (string.Equals(value, MemberTransform.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.NodeRole.Transform; + } + + if (string.Equals(value, MemberVotingOnly.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.NodeRole.VotingOnly; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.NodeRole)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.NodeRole value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.NodeRole.Client: + writer.WriteStringValue(MemberClient); + break; + case Elastic.Clients.Elasticsearch.NodeRole.CoordinatingOnly: + writer.WriteStringValue(MemberCoordinatingOnly); + break; + case Elastic.Clients.Elasticsearch.NodeRole.Data: + writer.WriteStringValue(MemberData); + break; + case Elastic.Clients.Elasticsearch.NodeRole.DataCold: + writer.WriteStringValue(MemberDataCold); + break; + case Elastic.Clients.Elasticsearch.NodeRole.DataContent: + writer.WriteStringValue(MemberDataContent); + break; + case Elastic.Clients.Elasticsearch.NodeRole.DataFrozen: + writer.WriteStringValue(MemberDataFrozen); + break; + case Elastic.Clients.Elasticsearch.NodeRole.DataHot: + writer.WriteStringValue(MemberDataHot); + break; + case Elastic.Clients.Elasticsearch.NodeRole.DataWarm: + writer.WriteStringValue(MemberDataWarm); + break; + case Elastic.Clients.Elasticsearch.NodeRole.Ingest: + writer.WriteStringValue(MemberIngest); + break; + case Elastic.Clients.Elasticsearch.NodeRole.Master: + writer.WriteStringValue(MemberMaster); + break; + case Elastic.Clients.Elasticsearch.NodeRole.Ml: + writer.WriteStringValue(MemberMl); + break; + case Elastic.Clients.Elasticsearch.NodeRole.RemoteClusterClient: + writer.WriteStringValue(MemberRemoteClusterClient); + break; + case Elastic.Clients.Elasticsearch.NodeRole.Transform: + writer.WriteStringValue(MemberTransform); + break; + case Elastic.Clients.Elasticsearch.NodeRole.VotingOnly: + writer.WriteStringValue(MemberVotingOnly); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.NodeRole)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.NodeRole ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.NodeRole value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeRole.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeRole.g.cs new file mode 100644 index 00000000000..2db71d8395e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeRole.g.cs @@ -0,0 +1,57 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.NodeRoleConverter))] +public enum NodeRole +{ + [System.Runtime.Serialization.EnumMember(Value = "client")] + Client, + [System.Runtime.Serialization.EnumMember(Value = "coordinating_only")] + CoordinatingOnly, + [System.Runtime.Serialization.EnumMember(Value = "data")] + Data, + [System.Runtime.Serialization.EnumMember(Value = "data_cold")] + DataCold, + [System.Runtime.Serialization.EnumMember(Value = "data_content")] + DataContent, + [System.Runtime.Serialization.EnumMember(Value = "data_frozen")] + DataFrozen, + [System.Runtime.Serialization.EnumMember(Value = "data_hot")] + DataHot, + [System.Runtime.Serialization.EnumMember(Value = "data_warm")] + DataWarm, + [System.Runtime.Serialization.EnumMember(Value = "ingest")] + Ingest, + [System.Runtime.Serialization.EnumMember(Value = "master")] + Master, + [System.Runtime.Serialization.EnumMember(Value = "ml")] + Ml, + [System.Runtime.Serialization.EnumMember(Value = "remote_cluster_client")] + RemoteClusterClient, + [System.Runtime.Serialization.EnumMember(Value = "transform")] + Transform, + [System.Runtime.Serialization.EnumMember(Value = "voting_only")] + VotingOnly +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeShard.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeShard.Converters.g.cs new file mode 100644 index 00000000000..645ab5c7888 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeShard.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class NodeShardConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllocationId = System.Text.Json.JsonEncodedText.Encode("allocation_id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); + private static readonly System.Text.Json.JsonEncodedText PropPrimary = System.Text.Json.JsonEncodedText.Encode("primary"); + private static readonly System.Text.Json.JsonEncodedText PropRecoverySource = System.Text.Json.JsonEncodedText.Encode("recovery_source"); + private static readonly System.Text.Json.JsonEncodedText PropRelocatingNode = System.Text.Json.JsonEncodedText.Encode("relocating_node"); + private static readonly System.Text.Json.JsonEncodedText PropRelocationFailureInfo = System.Text.Json.JsonEncodedText.Encode("relocation_failure_info"); + private static readonly System.Text.Json.JsonEncodedText PropShard = System.Text.Json.JsonEncodedText.Encode("shard"); + private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); + private static readonly System.Text.Json.JsonEncodedText PropUnassignedInfo = System.Text.Json.JsonEncodedText.Encode("unassigned_info"); + + public override Elastic.Clients.Elasticsearch.NodeShard Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAllocationId = default; + LocalJsonValue propIndex = default; + LocalJsonValue propNode = default; + LocalJsonValue propPrimary = default; + LocalJsonValue?> propRecoverySource = default; + LocalJsonValue propRelocatingNode = default; + LocalJsonValue propRelocationFailureInfo = default; + LocalJsonValue propShard = default; + LocalJsonValue propState = default; + LocalJsonValue propUnassignedInfo = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllocationId.TryReadProperty(ref reader, options, PropAllocationId, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propNode.TryReadProperty(ref reader, options, PropNode, null)) + { + continue; + } + + if (propPrimary.TryReadProperty(ref reader, options, PropPrimary, null)) + { + continue; + } + + if (propRecoverySource.TryReadProperty(ref reader, options, PropRecoverySource, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propRelocatingNode.TryReadProperty(ref reader, options, PropRelocatingNode, null)) + { + continue; + } + + if (propRelocationFailureInfo.TryReadProperty(ref reader, options, PropRelocationFailureInfo, null)) + { + continue; + } + + if (propShard.TryReadProperty(ref reader, options, PropShard, null)) + { + continue; + } + + if (propState.TryReadProperty(ref reader, options, PropState, null)) + { + continue; + } + + if (propUnassignedInfo.TryReadProperty(ref reader, options, PropUnassignedInfo, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.NodeShard(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllocationId = propAllocationId.Value, + Index = propIndex.Value, + Node = propNode.Value, + Primary = propPrimary.Value, + RecoverySource = propRecoverySource.Value, + RelocatingNode = propRelocatingNode.Value, + RelocationFailureInfo = propRelocationFailureInfo.Value, + Shard = propShard.Value, + State = propState.Value, + UnassignedInfo = propUnassignedInfo.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.NodeShard value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllocationId, value.AllocationId, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropNode, value.Node, null, null); + writer.WriteProperty(options, PropPrimary, value.Primary, null, null); + writer.WriteProperty(options, PropRecoverySource, value.RecoverySource, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropRelocatingNode, value.RelocatingNode, null, null); + writer.WriteProperty(options, PropRelocationFailureInfo, value.RelocationFailureInfo, null, null); + writer.WriteProperty(options, PropShard, value.Shard, null, null); + writer.WriteProperty(options, PropState, value.State, null, null); + writer.WriteProperty(options, PropUnassignedInfo, value.UnassignedInfo, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeShard.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeShard.g.cs index 75f16ab99e8..3524e270f21 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeShard.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeShard.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class NodeShardConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllocationId = System.Text.Json.JsonEncodedText.Encode("allocation_id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); - private static readonly System.Text.Json.JsonEncodedText PropPrimary = System.Text.Json.JsonEncodedText.Encode("primary"); - private static readonly System.Text.Json.JsonEncodedText PropRecoverySource = System.Text.Json.JsonEncodedText.Encode("recovery_source"); - private static readonly System.Text.Json.JsonEncodedText PropRelocatingNode = System.Text.Json.JsonEncodedText.Encode("relocating_node"); - private static readonly System.Text.Json.JsonEncodedText PropRelocationFailureInfo = System.Text.Json.JsonEncodedText.Encode("relocation_failure_info"); - private static readonly System.Text.Json.JsonEncodedText PropShard = System.Text.Json.JsonEncodedText.Encode("shard"); - private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); - private static readonly System.Text.Json.JsonEncodedText PropUnassignedInfo = System.Text.Json.JsonEncodedText.Encode("unassigned_info"); - - public override Elastic.Clients.Elasticsearch.NodeShard Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAllocationId = default; - LocalJsonValue propIndex = default; - LocalJsonValue propNode = default; - LocalJsonValue propPrimary = default; - LocalJsonValue?> propRecoverySource = default; - LocalJsonValue propRelocatingNode = default; - LocalJsonValue propRelocationFailureInfo = default; - LocalJsonValue propShard = default; - LocalJsonValue propState = default; - LocalJsonValue propUnassignedInfo = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllocationId.TryReadProperty(ref reader, options, PropAllocationId, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propNode.TryReadProperty(ref reader, options, PropNode, null)) - { - continue; - } - - if (propPrimary.TryReadProperty(ref reader, options, PropPrimary, null)) - { - continue; - } - - if (propRecoverySource.TryReadProperty(ref reader, options, PropRecoverySource, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propRelocatingNode.TryReadProperty(ref reader, options, PropRelocatingNode, null)) - { - continue; - } - - if (propRelocationFailureInfo.TryReadProperty(ref reader, options, PropRelocationFailureInfo, null)) - { - continue; - } - - if (propShard.TryReadProperty(ref reader, options, PropShard, null)) - { - continue; - } - - if (propState.TryReadProperty(ref reader, options, PropState, null)) - { - continue; - } - - if (propUnassignedInfo.TryReadProperty(ref reader, options, PropUnassignedInfo, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.NodeShard(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllocationId = propAllocationId.Value, - Index = propIndex.Value, - Node = propNode.Value, - Primary = propPrimary.Value, - RecoverySource = propRecoverySource.Value, - RelocatingNode = propRelocatingNode.Value, - RelocationFailureInfo = propRelocationFailureInfo.Value, - Shard = propShard.Value, - State = propState.Value, - UnassignedInfo = propUnassignedInfo.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.NodeShard value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllocationId, value.AllocationId, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropNode, value.Node, null, null); - writer.WriteProperty(options, PropPrimary, value.Primary, null, null); - writer.WriteProperty(options, PropRecoverySource, value.RecoverySource, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropRelocatingNode, value.RelocatingNode, null, null); - writer.WriteProperty(options, PropRelocationFailureInfo, value.RelocationFailureInfo, null, null); - writer.WriteProperty(options, PropShard, value.Shard, null, null); - writer.WriteProperty(options, PropState, value.State, null, null); - writer.WriteProperty(options, PropUnassignedInfo, value.UnassignedInfo, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.NodeShardConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.NodeShardConverter))] public sealed partial class NodeShard { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeStatistics.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeStatistics.Converters.g.cs new file mode 100644 index 00000000000..90958c5ff71 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeStatistics.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class NodeStatisticsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFailed = System.Text.Json.JsonEncodedText.Encode("failed"); + private static readonly System.Text.Json.JsonEncodedText PropFailures = System.Text.Json.JsonEncodedText.Encode("failures"); + private static readonly System.Text.Json.JsonEncodedText PropSuccessful = System.Text.Json.JsonEncodedText.Encode("successful"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.NodeStatistics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFailed = default; + LocalJsonValue?> propFailures = default; + LocalJsonValue propSuccessful = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFailed.TryReadProperty(ref reader, options, PropFailed, null)) + { + continue; + } + + if (propFailures.TryReadProperty(ref reader, options, PropFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propSuccessful.TryReadProperty(ref reader, options, PropSuccessful, null)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.NodeStatistics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Failed = propFailed.Value, + Failures = propFailures.Value, + Successful = propSuccessful.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.NodeStatistics value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFailed, value.Failed, null, null); + writer.WriteProperty(options, PropFailures, value.Failures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSuccessful, value.Successful, null, null); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeStatistics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeStatistics.g.cs index a08e819955c..11c87866e1c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeStatistics.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeStatistics.g.cs @@ -23,78 +23,12 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class NodeStatisticsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFailed = System.Text.Json.JsonEncodedText.Encode("failed"); - private static readonly System.Text.Json.JsonEncodedText PropFailures = System.Text.Json.JsonEncodedText.Encode("failures"); - private static readonly System.Text.Json.JsonEncodedText PropSuccessful = System.Text.Json.JsonEncodedText.Encode("successful"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.NodeStatistics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFailed = default; - LocalJsonValue?> propFailures = default; - LocalJsonValue propSuccessful = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFailed.TryReadProperty(ref reader, options, PropFailed, null)) - { - continue; - } - - if (propFailures.TryReadProperty(ref reader, options, PropFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propSuccessful.TryReadProperty(ref reader, options, PropSuccessful, null)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.NodeStatistics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Failed = propFailed.Value, - Failures = propFailures.Value, - Successful = propSuccessful.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.NodeStatistics value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFailed, value.Failed, null, null); - writer.WriteProperty(options, PropFailures, value.Failures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSuccessful, value.Successful, null, null); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - /// /// /// Contains statistics about the number of nodes selected by the request. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.NodeStatisticsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.NodeStatisticsConverter))] public sealed partial class NodeStatistics { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/AdaptiveSelection.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/AdaptiveSelection.Converters.g.cs new file mode 100644 index 00000000000..31f1d99ff9b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/AdaptiveSelection.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class AdaptiveSelectionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvgQueueSize = System.Text.Json.JsonEncodedText.Encode("avg_queue_size"); + private static readonly System.Text.Json.JsonEncodedText PropAvgResponseTime = System.Text.Json.JsonEncodedText.Encode("avg_response_time"); + private static readonly System.Text.Json.JsonEncodedText PropAvgResponseTimeNs = System.Text.Json.JsonEncodedText.Encode("avg_response_time_ns"); + private static readonly System.Text.Json.JsonEncodedText PropAvgServiceTime = System.Text.Json.JsonEncodedText.Encode("avg_service_time"); + private static readonly System.Text.Json.JsonEncodedText PropAvgServiceTimeNs = System.Text.Json.JsonEncodedText.Encode("avg_service_time_ns"); + private static readonly System.Text.Json.JsonEncodedText PropOutgoingSearches = System.Text.Json.JsonEncodedText.Encode("outgoing_searches"); + private static readonly System.Text.Json.JsonEncodedText PropRank = System.Text.Json.JsonEncodedText.Encode("rank"); + + public override Elastic.Clients.Elasticsearch.Nodes.AdaptiveSelection Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvgQueueSize = default; + LocalJsonValue propAvgResponseTime = default; + LocalJsonValue propAvgResponseTimeNs = default; + LocalJsonValue propAvgServiceTime = default; + LocalJsonValue propAvgServiceTimeNs = default; + LocalJsonValue propOutgoingSearches = default; + LocalJsonValue propRank = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvgQueueSize.TryReadProperty(ref reader, options, PropAvgQueueSize, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propAvgResponseTime.TryReadProperty(ref reader, options, PropAvgResponseTime, null)) + { + continue; + } + + if (propAvgResponseTimeNs.TryReadProperty(ref reader, options, PropAvgResponseTimeNs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propAvgServiceTime.TryReadProperty(ref reader, options, PropAvgServiceTime, null)) + { + continue; + } + + if (propAvgServiceTimeNs.TryReadProperty(ref reader, options, PropAvgServiceTimeNs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOutgoingSearches.TryReadProperty(ref reader, options, PropOutgoingSearches, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRank.TryReadProperty(ref reader, options, PropRank, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.AdaptiveSelection(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AvgQueueSize = propAvgQueueSize.Value, + AvgResponseTime = propAvgResponseTime.Value, + AvgResponseTimeNs = propAvgResponseTimeNs.Value, + AvgServiceTime = propAvgServiceTime.Value, + AvgServiceTimeNs = propAvgServiceTimeNs.Value, + OutgoingSearches = propOutgoingSearches.Value, + Rank = propRank.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.AdaptiveSelection value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvgQueueSize, value.AvgQueueSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropAvgResponseTime, value.AvgResponseTime, null, null); + writer.WriteProperty(options, PropAvgResponseTimeNs, value.AvgResponseTimeNs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropAvgServiceTime, value.AvgServiceTime, null, null); + writer.WriteProperty(options, PropAvgServiceTimeNs, value.AvgServiceTimeNs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOutgoingSearches, value.OutgoingSearches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRank, value.Rank, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/AdaptiveSelection.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/AdaptiveSelection.g.cs index 7efa35f1e18..e428e536a0f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/AdaptiveSelection.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/AdaptiveSelection.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class AdaptiveSelectionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvgQueueSize = System.Text.Json.JsonEncodedText.Encode("avg_queue_size"); - private static readonly System.Text.Json.JsonEncodedText PropAvgResponseTime = System.Text.Json.JsonEncodedText.Encode("avg_response_time"); - private static readonly System.Text.Json.JsonEncodedText PropAvgResponseTimeNs = System.Text.Json.JsonEncodedText.Encode("avg_response_time_ns"); - private static readonly System.Text.Json.JsonEncodedText PropAvgServiceTime = System.Text.Json.JsonEncodedText.Encode("avg_service_time"); - private static readonly System.Text.Json.JsonEncodedText PropAvgServiceTimeNs = System.Text.Json.JsonEncodedText.Encode("avg_service_time_ns"); - private static readonly System.Text.Json.JsonEncodedText PropOutgoingSearches = System.Text.Json.JsonEncodedText.Encode("outgoing_searches"); - private static readonly System.Text.Json.JsonEncodedText PropRank = System.Text.Json.JsonEncodedText.Encode("rank"); - - public override Elastic.Clients.Elasticsearch.Nodes.AdaptiveSelection Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvgQueueSize = default; - LocalJsonValue propAvgResponseTime = default; - LocalJsonValue propAvgResponseTimeNs = default; - LocalJsonValue propAvgServiceTime = default; - LocalJsonValue propAvgServiceTimeNs = default; - LocalJsonValue propOutgoingSearches = default; - LocalJsonValue propRank = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvgQueueSize.TryReadProperty(ref reader, options, PropAvgQueueSize, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propAvgResponseTime.TryReadProperty(ref reader, options, PropAvgResponseTime, null)) - { - continue; - } - - if (propAvgResponseTimeNs.TryReadProperty(ref reader, options, PropAvgResponseTimeNs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propAvgServiceTime.TryReadProperty(ref reader, options, PropAvgServiceTime, null)) - { - continue; - } - - if (propAvgServiceTimeNs.TryReadProperty(ref reader, options, PropAvgServiceTimeNs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOutgoingSearches.TryReadProperty(ref reader, options, PropOutgoingSearches, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRank.TryReadProperty(ref reader, options, PropRank, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.AdaptiveSelection(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AvgQueueSize = propAvgQueueSize.Value, - AvgResponseTime = propAvgResponseTime.Value, - AvgResponseTimeNs = propAvgResponseTimeNs.Value, - AvgServiceTime = propAvgServiceTime.Value, - AvgServiceTimeNs = propAvgServiceTimeNs.Value, - OutgoingSearches = propOutgoingSearches.Value, - Rank = propRank.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.AdaptiveSelection value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvgQueueSize, value.AvgQueueSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropAvgResponseTime, value.AvgResponseTime, null, null); - writer.WriteProperty(options, PropAvgResponseTimeNs, value.AvgResponseTimeNs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropAvgServiceTime, value.AvgServiceTime, null, null); - writer.WriteProperty(options, PropAvgServiceTimeNs, value.AvgServiceTimeNs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOutgoingSearches, value.OutgoingSearches, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRank, value.Rank, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.AdaptiveSelectionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.AdaptiveSelectionConverter))] public sealed partial class AdaptiveSelection { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Breaker.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Breaker.Converters.g.cs new file mode 100644 index 00000000000..c1d1a740eaa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Breaker.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class BreakerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEstimatedSize = System.Text.Json.JsonEncodedText.Encode("estimated_size"); + private static readonly System.Text.Json.JsonEncodedText PropEstimatedSizeInBytes = System.Text.Json.JsonEncodedText.Encode("estimated_size_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropLimitSize = System.Text.Json.JsonEncodedText.Encode("limit_size"); + private static readonly System.Text.Json.JsonEncodedText PropLimitSizeInBytes = System.Text.Json.JsonEncodedText.Encode("limit_size_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropOverhead = System.Text.Json.JsonEncodedText.Encode("overhead"); + private static readonly System.Text.Json.JsonEncodedText PropTripped = System.Text.Json.JsonEncodedText.Encode("tripped"); + + public override Elastic.Clients.Elasticsearch.Nodes.Breaker Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEstimatedSize = default; + LocalJsonValue propEstimatedSizeInBytes = default; + LocalJsonValue propLimitSize = default; + LocalJsonValue propLimitSizeInBytes = default; + LocalJsonValue propOverhead = default; + LocalJsonValue propTripped = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEstimatedSize.TryReadProperty(ref reader, options, PropEstimatedSize, null)) + { + continue; + } + + if (propEstimatedSizeInBytes.TryReadProperty(ref reader, options, PropEstimatedSizeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLimitSize.TryReadProperty(ref reader, options, PropLimitSize, null)) + { + continue; + } + + if (propLimitSizeInBytes.TryReadProperty(ref reader, options, PropLimitSizeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOverhead.TryReadProperty(ref reader, options, PropOverhead, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTripped.TryReadProperty(ref reader, options, PropTripped, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.Breaker(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + EstimatedSize = propEstimatedSize.Value, + EstimatedSizeInBytes = propEstimatedSizeInBytes.Value, + LimitSize = propLimitSize.Value, + LimitSizeInBytes = propLimitSizeInBytes.Value, + Overhead = propOverhead.Value, + Tripped = propTripped.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Breaker value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEstimatedSize, value.EstimatedSize, null, null); + writer.WriteProperty(options, PropEstimatedSizeInBytes, value.EstimatedSizeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLimitSize, value.LimitSize, null, null); + writer.WriteProperty(options, PropLimitSizeInBytes, value.LimitSizeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOverhead, value.Overhead, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTripped, value.Tripped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Breaker.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Breaker.g.cs index 88a6ef8da8d..4513a759a18 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Breaker.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Breaker.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class BreakerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEstimatedSize = System.Text.Json.JsonEncodedText.Encode("estimated_size"); - private static readonly System.Text.Json.JsonEncodedText PropEstimatedSizeInBytes = System.Text.Json.JsonEncodedText.Encode("estimated_size_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropLimitSize = System.Text.Json.JsonEncodedText.Encode("limit_size"); - private static readonly System.Text.Json.JsonEncodedText PropLimitSizeInBytes = System.Text.Json.JsonEncodedText.Encode("limit_size_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropOverhead = System.Text.Json.JsonEncodedText.Encode("overhead"); - private static readonly System.Text.Json.JsonEncodedText PropTripped = System.Text.Json.JsonEncodedText.Encode("tripped"); - - public override Elastic.Clients.Elasticsearch.Nodes.Breaker Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEstimatedSize = default; - LocalJsonValue propEstimatedSizeInBytes = default; - LocalJsonValue propLimitSize = default; - LocalJsonValue propLimitSizeInBytes = default; - LocalJsonValue propOverhead = default; - LocalJsonValue propTripped = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEstimatedSize.TryReadProperty(ref reader, options, PropEstimatedSize, null)) - { - continue; - } - - if (propEstimatedSizeInBytes.TryReadProperty(ref reader, options, PropEstimatedSizeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLimitSize.TryReadProperty(ref reader, options, PropLimitSize, null)) - { - continue; - } - - if (propLimitSizeInBytes.TryReadProperty(ref reader, options, PropLimitSizeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOverhead.TryReadProperty(ref reader, options, PropOverhead, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTripped.TryReadProperty(ref reader, options, PropTripped, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.Breaker(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - EstimatedSize = propEstimatedSize.Value, - EstimatedSizeInBytes = propEstimatedSizeInBytes.Value, - LimitSize = propLimitSize.Value, - LimitSizeInBytes = propLimitSizeInBytes.Value, - Overhead = propOverhead.Value, - Tripped = propTripped.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Breaker value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEstimatedSize, value.EstimatedSize, null, null); - writer.WriteProperty(options, PropEstimatedSizeInBytes, value.EstimatedSizeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLimitSize, value.LimitSize, null, null); - writer.WriteProperty(options, PropLimitSizeInBytes, value.LimitSizeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOverhead, value.Overhead, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTripped, value.Tripped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.BreakerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.BreakerConverter))] public sealed partial class Breaker { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Cgroup.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Cgroup.Converters.g.cs new file mode 100644 index 00000000000..85a36763f30 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Cgroup.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class CgroupConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCpu = System.Text.Json.JsonEncodedText.Encode("cpu"); + private static readonly System.Text.Json.JsonEncodedText PropCpuacct = System.Text.Json.JsonEncodedText.Encode("cpuacct"); + private static readonly System.Text.Json.JsonEncodedText PropMemory = System.Text.Json.JsonEncodedText.Encode("memory"); + + public override Elastic.Clients.Elasticsearch.Nodes.Cgroup Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCpu = default; + LocalJsonValue propCpuacct = default; + LocalJsonValue propMemory = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCpu.TryReadProperty(ref reader, options, PropCpu, null)) + { + continue; + } + + if (propCpuacct.TryReadProperty(ref reader, options, PropCpuacct, null)) + { + continue; + } + + if (propMemory.TryReadProperty(ref reader, options, PropMemory, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.Cgroup(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Cpu = propCpu.Value, + Cpuacct = propCpuacct.Value, + Memory = propMemory.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Cgroup value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCpu, value.Cpu, null, null); + writer.WriteProperty(options, PropCpuacct, value.Cpuacct, null, null); + writer.WriteProperty(options, PropMemory, value.Memory, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Cgroup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Cgroup.g.cs index baf1b100a9d..05b159b44fd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Cgroup.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Cgroup.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class CgroupConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCpu = System.Text.Json.JsonEncodedText.Encode("cpu"); - private static readonly System.Text.Json.JsonEncodedText PropCpuacct = System.Text.Json.JsonEncodedText.Encode("cpuacct"); - private static readonly System.Text.Json.JsonEncodedText PropMemory = System.Text.Json.JsonEncodedText.Encode("memory"); - - public override Elastic.Clients.Elasticsearch.Nodes.Cgroup Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCpu = default; - LocalJsonValue propCpuacct = default; - LocalJsonValue propMemory = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCpu.TryReadProperty(ref reader, options, PropCpu, null)) - { - continue; - } - - if (propCpuacct.TryReadProperty(ref reader, options, PropCpuacct, null)) - { - continue; - } - - if (propMemory.TryReadProperty(ref reader, options, PropMemory, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.Cgroup(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Cpu = propCpu.Value, - Cpuacct = propCpuacct.Value, - Memory = propMemory.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Cgroup value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCpu, value.Cpu, null, null); - writer.WriteProperty(options, PropCpuacct, value.Cpuacct, null, null); - writer.WriteProperty(options, PropMemory, value.Memory, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.CgroupConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.CgroupConverter))] public sealed partial class Cgroup { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupCpu.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupCpu.Converters.g.cs new file mode 100644 index 00000000000..f97d0d80878 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupCpu.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class CgroupCpuConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCfsPeriodMicros = System.Text.Json.JsonEncodedText.Encode("cfs_period_micros"); + private static readonly System.Text.Json.JsonEncodedText PropCfsQuotaMicros = System.Text.Json.JsonEncodedText.Encode("cfs_quota_micros"); + private static readonly System.Text.Json.JsonEncodedText PropControlGroup = System.Text.Json.JsonEncodedText.Encode("control_group"); + private static readonly System.Text.Json.JsonEncodedText PropStat = System.Text.Json.JsonEncodedText.Encode("stat"); + + public override Elastic.Clients.Elasticsearch.Nodes.CgroupCpu Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCfsPeriodMicros = default; + LocalJsonValue propCfsQuotaMicros = default; + LocalJsonValue propControlGroup = default; + LocalJsonValue propStat = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCfsPeriodMicros.TryReadProperty(ref reader, options, PropCfsPeriodMicros, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCfsQuotaMicros.TryReadProperty(ref reader, options, PropCfsQuotaMicros, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propControlGroup.TryReadProperty(ref reader, options, PropControlGroup, null)) + { + continue; + } + + if (propStat.TryReadProperty(ref reader, options, PropStat, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.CgroupCpu(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CfsPeriodMicros = propCfsPeriodMicros.Value, + CfsQuotaMicros = propCfsQuotaMicros.Value, + ControlGroup = propControlGroup.Value, + Stat = propStat.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.CgroupCpu value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCfsPeriodMicros, value.CfsPeriodMicros, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCfsQuotaMicros, value.CfsQuotaMicros, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropControlGroup, value.ControlGroup, null, null); + writer.WriteProperty(options, PropStat, value.Stat, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupCpu.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupCpu.g.cs index 47f2bee5d63..faf61a6d8a7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupCpu.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupCpu.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class CgroupCpuConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCfsPeriodMicros = System.Text.Json.JsonEncodedText.Encode("cfs_period_micros"); - private static readonly System.Text.Json.JsonEncodedText PropCfsQuotaMicros = System.Text.Json.JsonEncodedText.Encode("cfs_quota_micros"); - private static readonly System.Text.Json.JsonEncodedText PropControlGroup = System.Text.Json.JsonEncodedText.Encode("control_group"); - private static readonly System.Text.Json.JsonEncodedText PropStat = System.Text.Json.JsonEncodedText.Encode("stat"); - - public override Elastic.Clients.Elasticsearch.Nodes.CgroupCpu Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCfsPeriodMicros = default; - LocalJsonValue propCfsQuotaMicros = default; - LocalJsonValue propControlGroup = default; - LocalJsonValue propStat = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCfsPeriodMicros.TryReadProperty(ref reader, options, PropCfsPeriodMicros, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCfsQuotaMicros.TryReadProperty(ref reader, options, PropCfsQuotaMicros, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propControlGroup.TryReadProperty(ref reader, options, PropControlGroup, null)) - { - continue; - } - - if (propStat.TryReadProperty(ref reader, options, PropStat, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.CgroupCpu(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CfsPeriodMicros = propCfsPeriodMicros.Value, - CfsQuotaMicros = propCfsQuotaMicros.Value, - ControlGroup = propControlGroup.Value, - Stat = propStat.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.CgroupCpu value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCfsPeriodMicros, value.CfsPeriodMicros, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCfsQuotaMicros, value.CfsQuotaMicros, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropControlGroup, value.ControlGroup, null, null); - writer.WriteProperty(options, PropStat, value.Stat, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.CgroupCpuConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.CgroupCpuConverter))] public sealed partial class CgroupCpu { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupCpuStat.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupCpuStat.Converters.g.cs new file mode 100644 index 00000000000..c90e2579913 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupCpuStat.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class CgroupCpuStatConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNumberOfElapsedPeriods = System.Text.Json.JsonEncodedText.Encode("number_of_elapsed_periods"); + private static readonly System.Text.Json.JsonEncodedText PropNumberOfTimesThrottled = System.Text.Json.JsonEncodedText.Encode("number_of_times_throttled"); + private static readonly System.Text.Json.JsonEncodedText PropTimeThrottledNanos = System.Text.Json.JsonEncodedText.Encode("time_throttled_nanos"); + + public override Elastic.Clients.Elasticsearch.Nodes.CgroupCpuStat Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propNumberOfElapsedPeriods = default; + LocalJsonValue propNumberOfTimesThrottled = default; + LocalJsonValue propTimeThrottledNanos = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNumberOfElapsedPeriods.TryReadProperty(ref reader, options, PropNumberOfElapsedPeriods, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNumberOfTimesThrottled.TryReadProperty(ref reader, options, PropNumberOfTimesThrottled, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeThrottledNanos.TryReadProperty(ref reader, options, PropTimeThrottledNanos, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.CgroupCpuStat(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + NumberOfElapsedPeriods = propNumberOfElapsedPeriods.Value, + NumberOfTimesThrottled = propNumberOfTimesThrottled.Value, + TimeThrottledNanos = propTimeThrottledNanos.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.CgroupCpuStat value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNumberOfElapsedPeriods, value.NumberOfElapsedPeriods, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNumberOfTimesThrottled, value.NumberOfTimesThrottled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeThrottledNanos, value.TimeThrottledNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupCpuStat.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupCpuStat.g.cs index 60a24b5d546..3e9e70c5bcb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupCpuStat.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupCpuStat.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class CgroupCpuStatConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNumberOfElapsedPeriods = System.Text.Json.JsonEncodedText.Encode("number_of_elapsed_periods"); - private static readonly System.Text.Json.JsonEncodedText PropNumberOfTimesThrottled = System.Text.Json.JsonEncodedText.Encode("number_of_times_throttled"); - private static readonly System.Text.Json.JsonEncodedText PropTimeThrottledNanos = System.Text.Json.JsonEncodedText.Encode("time_throttled_nanos"); - - public override Elastic.Clients.Elasticsearch.Nodes.CgroupCpuStat Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propNumberOfElapsedPeriods = default; - LocalJsonValue propNumberOfTimesThrottled = default; - LocalJsonValue propTimeThrottledNanos = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNumberOfElapsedPeriods.TryReadProperty(ref reader, options, PropNumberOfElapsedPeriods, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNumberOfTimesThrottled.TryReadProperty(ref reader, options, PropNumberOfTimesThrottled, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeThrottledNanos.TryReadProperty(ref reader, options, PropTimeThrottledNanos, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.CgroupCpuStat(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - NumberOfElapsedPeriods = propNumberOfElapsedPeriods.Value, - NumberOfTimesThrottled = propNumberOfTimesThrottled.Value, - TimeThrottledNanos = propTimeThrottledNanos.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.CgroupCpuStat value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNumberOfElapsedPeriods, value.NumberOfElapsedPeriods, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNumberOfTimesThrottled, value.NumberOfTimesThrottled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeThrottledNanos, value.TimeThrottledNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.CgroupCpuStatConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.CgroupCpuStatConverter))] public sealed partial class CgroupCpuStat { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupMemory.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupMemory.Converters.g.cs new file mode 100644 index 00000000000..4586ea0b02b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupMemory.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class CgroupMemoryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropControlGroup = System.Text.Json.JsonEncodedText.Encode("control_group"); + private static readonly System.Text.Json.JsonEncodedText PropLimitInBytes = System.Text.Json.JsonEncodedText.Encode("limit_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropUsageInBytes = System.Text.Json.JsonEncodedText.Encode("usage_in_bytes"); + + public override Elastic.Clients.Elasticsearch.Nodes.CgroupMemory Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propControlGroup = default; + LocalJsonValue propLimitInBytes = default; + LocalJsonValue propUsageInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propControlGroup.TryReadProperty(ref reader, options, PropControlGroup, null)) + { + continue; + } + + if (propLimitInBytes.TryReadProperty(ref reader, options, PropLimitInBytes, null)) + { + continue; + } + + if (propUsageInBytes.TryReadProperty(ref reader, options, PropUsageInBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.CgroupMemory(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ControlGroup = propControlGroup.Value, + LimitInBytes = propLimitInBytes.Value, + UsageInBytes = propUsageInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.CgroupMemory value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropControlGroup, value.ControlGroup, null, null); + writer.WriteProperty(options, PropLimitInBytes, value.LimitInBytes, null, null); + writer.WriteProperty(options, PropUsageInBytes, value.UsageInBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupMemory.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupMemory.g.cs index 56151811f56..3bcb4e6c29a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupMemory.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CgroupMemory.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class CgroupMemoryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropControlGroup = System.Text.Json.JsonEncodedText.Encode("control_group"); - private static readonly System.Text.Json.JsonEncodedText PropLimitInBytes = System.Text.Json.JsonEncodedText.Encode("limit_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropUsageInBytes = System.Text.Json.JsonEncodedText.Encode("usage_in_bytes"); - - public override Elastic.Clients.Elasticsearch.Nodes.CgroupMemory Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propControlGroup = default; - LocalJsonValue propLimitInBytes = default; - LocalJsonValue propUsageInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propControlGroup.TryReadProperty(ref reader, options, PropControlGroup, null)) - { - continue; - } - - if (propLimitInBytes.TryReadProperty(ref reader, options, PropLimitInBytes, null)) - { - continue; - } - - if (propUsageInBytes.TryReadProperty(ref reader, options, PropUsageInBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.CgroupMemory(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ControlGroup = propControlGroup.Value, - LimitInBytes = propLimitInBytes.Value, - UsageInBytes = propUsageInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.CgroupMemory value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropControlGroup, value.ControlGroup, null, null); - writer.WriteProperty(options, PropLimitInBytes, value.LimitInBytes, null, null); - writer.WriteProperty(options, PropUsageInBytes, value.UsageInBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.CgroupMemoryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.CgroupMemoryConverter))] public sealed partial class CgroupMemory { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Client.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Client.Converters.g.cs new file mode 100644 index 00000000000..841b205a3e8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Client.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class ClientConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAgent = System.Text.Json.JsonEncodedText.Encode("agent"); + private static readonly System.Text.Json.JsonEncodedText PropClosedTimeMillis = System.Text.Json.JsonEncodedText.Encode("closed_time_millis"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropLastRequestTimeMillis = System.Text.Json.JsonEncodedText.Encode("last_request_time_millis"); + private static readonly System.Text.Json.JsonEncodedText PropLastUri = System.Text.Json.JsonEncodedText.Encode("last_uri"); + private static readonly System.Text.Json.JsonEncodedText PropLocalAddress = System.Text.Json.JsonEncodedText.Encode("local_address"); + private static readonly System.Text.Json.JsonEncodedText PropOpenedTimeMillis = System.Text.Json.JsonEncodedText.Encode("opened_time_millis"); + private static readonly System.Text.Json.JsonEncodedText PropRemoteAddress = System.Text.Json.JsonEncodedText.Encode("remote_address"); + private static readonly System.Text.Json.JsonEncodedText PropRequestCount = System.Text.Json.JsonEncodedText.Encode("request_count"); + private static readonly System.Text.Json.JsonEncodedText PropRequestSizeBytes = System.Text.Json.JsonEncodedText.Encode("request_size_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropXOpaqueId = System.Text.Json.JsonEncodedText.Encode("x_opaque_id"); + + public override Elastic.Clients.Elasticsearch.Nodes.Client Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAgent = default; + LocalJsonValue propClosedTimeMillis = default; + LocalJsonValue propId = default; + LocalJsonValue propLastRequestTimeMillis = default; + LocalJsonValue propLastUri = default; + LocalJsonValue propLocalAddress = default; + LocalJsonValue propOpenedTimeMillis = default; + LocalJsonValue propRemoteAddress = default; + LocalJsonValue propRequestCount = default; + LocalJsonValue propRequestSizeBytes = default; + LocalJsonValue propXOpaqueId = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAgent.TryReadProperty(ref reader, options, PropAgent, null)) + { + continue; + } + + if (propClosedTimeMillis.TryReadProperty(ref reader, options, PropClosedTimeMillis, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLastRequestTimeMillis.TryReadProperty(ref reader, options, PropLastRequestTimeMillis, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLastUri.TryReadProperty(ref reader, options, PropLastUri, null)) + { + continue; + } + + if (propLocalAddress.TryReadProperty(ref reader, options, PropLocalAddress, null)) + { + continue; + } + + if (propOpenedTimeMillis.TryReadProperty(ref reader, options, PropOpenedTimeMillis, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRemoteAddress.TryReadProperty(ref reader, options, PropRemoteAddress, null)) + { + continue; + } + + if (propRequestCount.TryReadProperty(ref reader, options, PropRequestCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRequestSizeBytes.TryReadProperty(ref reader, options, PropRequestSizeBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propXOpaqueId.TryReadProperty(ref reader, options, PropXOpaqueId, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.Client(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Agent = propAgent.Value, + ClosedTimeMillis = propClosedTimeMillis.Value, + Id = propId.Value, + LastRequestTimeMillis = propLastRequestTimeMillis.Value, + LastUri = propLastUri.Value, + LocalAddress = propLocalAddress.Value, + OpenedTimeMillis = propOpenedTimeMillis.Value, + RemoteAddress = propRemoteAddress.Value, + RequestCount = propRequestCount.Value, + RequestSizeBytes = propRequestSizeBytes.Value, + XOpaqueId = propXOpaqueId.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Client value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAgent, value.Agent, null, null); + writer.WriteProperty(options, PropClosedTimeMillis, value.ClosedTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropId, value.Id, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLastRequestTimeMillis, value.LastRequestTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLastUri, value.LastUri, null, null); + writer.WriteProperty(options, PropLocalAddress, value.LocalAddress, null, null); + writer.WriteProperty(options, PropOpenedTimeMillis, value.OpenedTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRemoteAddress, value.RemoteAddress, null, null); + writer.WriteProperty(options, PropRequestCount, value.RequestCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRequestSizeBytes, value.RequestSizeBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropXOpaqueId, value.XOpaqueId, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Client.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Client.g.cs index 1b97264e411..8f546fa21a1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Client.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Client.g.cs @@ -23,136 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class ClientConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAgent = System.Text.Json.JsonEncodedText.Encode("agent"); - private static readonly System.Text.Json.JsonEncodedText PropClosedTimeMillis = System.Text.Json.JsonEncodedText.Encode("closed_time_millis"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropLastRequestTimeMillis = System.Text.Json.JsonEncodedText.Encode("last_request_time_millis"); - private static readonly System.Text.Json.JsonEncodedText PropLastUri = System.Text.Json.JsonEncodedText.Encode("last_uri"); - private static readonly System.Text.Json.JsonEncodedText PropLocalAddress = System.Text.Json.JsonEncodedText.Encode("local_address"); - private static readonly System.Text.Json.JsonEncodedText PropOpenedTimeMillis = System.Text.Json.JsonEncodedText.Encode("opened_time_millis"); - private static readonly System.Text.Json.JsonEncodedText PropRemoteAddress = System.Text.Json.JsonEncodedText.Encode("remote_address"); - private static readonly System.Text.Json.JsonEncodedText PropRequestCount = System.Text.Json.JsonEncodedText.Encode("request_count"); - private static readonly System.Text.Json.JsonEncodedText PropRequestSizeBytes = System.Text.Json.JsonEncodedText.Encode("request_size_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropXOpaqueId = System.Text.Json.JsonEncodedText.Encode("x_opaque_id"); - - public override Elastic.Clients.Elasticsearch.Nodes.Client Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAgent = default; - LocalJsonValue propClosedTimeMillis = default; - LocalJsonValue propId = default; - LocalJsonValue propLastRequestTimeMillis = default; - LocalJsonValue propLastUri = default; - LocalJsonValue propLocalAddress = default; - LocalJsonValue propOpenedTimeMillis = default; - LocalJsonValue propRemoteAddress = default; - LocalJsonValue propRequestCount = default; - LocalJsonValue propRequestSizeBytes = default; - LocalJsonValue propXOpaqueId = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAgent.TryReadProperty(ref reader, options, PropAgent, null)) - { - continue; - } - - if (propClosedTimeMillis.TryReadProperty(ref reader, options, PropClosedTimeMillis, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLastRequestTimeMillis.TryReadProperty(ref reader, options, PropLastRequestTimeMillis, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLastUri.TryReadProperty(ref reader, options, PropLastUri, null)) - { - continue; - } - - if (propLocalAddress.TryReadProperty(ref reader, options, PropLocalAddress, null)) - { - continue; - } - - if (propOpenedTimeMillis.TryReadProperty(ref reader, options, PropOpenedTimeMillis, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRemoteAddress.TryReadProperty(ref reader, options, PropRemoteAddress, null)) - { - continue; - } - - if (propRequestCount.TryReadProperty(ref reader, options, PropRequestCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRequestSizeBytes.TryReadProperty(ref reader, options, PropRequestSizeBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propXOpaqueId.TryReadProperty(ref reader, options, PropXOpaqueId, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.Client(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Agent = propAgent.Value, - ClosedTimeMillis = propClosedTimeMillis.Value, - Id = propId.Value, - LastRequestTimeMillis = propLastRequestTimeMillis.Value, - LastUri = propLastUri.Value, - LocalAddress = propLocalAddress.Value, - OpenedTimeMillis = propOpenedTimeMillis.Value, - RemoteAddress = propRemoteAddress.Value, - RequestCount = propRequestCount.Value, - RequestSizeBytes = propRequestSizeBytes.Value, - XOpaqueId = propXOpaqueId.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Client value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAgent, value.Agent, null, null); - writer.WriteProperty(options, PropClosedTimeMillis, value.ClosedTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropId, value.Id, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLastRequestTimeMillis, value.LastRequestTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLastUri, value.LastUri, null, null); - writer.WriteProperty(options, PropLocalAddress, value.LocalAddress, null, null); - writer.WriteProperty(options, PropOpenedTimeMillis, value.OpenedTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRemoteAddress, value.RemoteAddress, null, null); - writer.WriteProperty(options, PropRequestCount, value.RequestCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRequestSizeBytes, value.RequestSizeBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropXOpaqueId, value.XOpaqueId, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.ClientConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.ClientConverter))] public sealed partial class Client { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterAppliedStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterAppliedStats.Converters.g.cs new file mode 100644 index 00000000000..45d6544910b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterAppliedStats.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class ClusterAppliedStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRecordings = System.Text.Json.JsonEncodedText.Encode("recordings"); + + public override Elastic.Clients.Elasticsearch.Nodes.ClusterAppliedStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propRecordings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRecordings.TryReadProperty(ref reader, options, PropRecordings, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.ClusterAppliedStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Recordings = propRecordings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.ClusterAppliedStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRecordings, value.Recordings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterAppliedStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterAppliedStats.g.cs index b2aab8c7da8..34fad6c4261 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterAppliedStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterAppliedStats.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class ClusterAppliedStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRecordings = System.Text.Json.JsonEncodedText.Encode("recordings"); - - public override Elastic.Clients.Elasticsearch.Nodes.ClusterAppliedStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propRecordings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRecordings.TryReadProperty(ref reader, options, PropRecordings, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.ClusterAppliedStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Recordings = propRecordings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.ClusterAppliedStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRecordings, value.Recordings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.ClusterAppliedStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.ClusterAppliedStatsConverter))] public sealed partial class ClusterAppliedStats { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterStateQueue.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterStateQueue.Converters.g.cs new file mode 100644 index 00000000000..83728a6847a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterStateQueue.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class ClusterStateQueueConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCommitted = System.Text.Json.JsonEncodedText.Encode("committed"); + private static readonly System.Text.Json.JsonEncodedText PropPending = System.Text.Json.JsonEncodedText.Encode("pending"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Nodes.ClusterStateQueue Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCommitted = default; + LocalJsonValue propPending = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCommitted.TryReadProperty(ref reader, options, PropCommitted, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPending.TryReadProperty(ref reader, options, PropPending, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.ClusterStateQueue(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Committed = propCommitted.Value, + Pending = propPending.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.ClusterStateQueue value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCommitted, value.Committed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPending, value.Pending, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotal, value.Total, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterStateQueue.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterStateQueue.g.cs index e3cf5feab2b..8c852a063d1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterStateQueue.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterStateQueue.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class ClusterStateQueueConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCommitted = System.Text.Json.JsonEncodedText.Encode("committed"); - private static readonly System.Text.Json.JsonEncodedText PropPending = System.Text.Json.JsonEncodedText.Encode("pending"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Nodes.ClusterStateQueue Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCommitted = default; - LocalJsonValue propPending = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCommitted.TryReadProperty(ref reader, options, PropCommitted, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPending.TryReadProperty(ref reader, options, PropPending, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.ClusterStateQueue(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Committed = propCommitted.Value, - Pending = propPending.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.ClusterStateQueue value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCommitted, value.Committed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPending, value.Pending, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotal, value.Total, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.ClusterStateQueueConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.ClusterStateQueueConverter))] public sealed partial class ClusterStateQueue { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterStateUpdate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterStateUpdate.Converters.g.cs new file mode 100644 index 00000000000..46fbd7f244d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterStateUpdate.Converters.g.cs @@ -0,0 +1,189 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class ClusterStateUpdateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCommitTime = System.Text.Json.JsonEncodedText.Encode("commit_time"); + private static readonly System.Text.Json.JsonEncodedText PropCommitTimeMillis = System.Text.Json.JsonEncodedText.Encode("commit_time_millis"); + private static readonly System.Text.Json.JsonEncodedText PropCompletionTime = System.Text.Json.JsonEncodedText.Encode("completion_time"); + private static readonly System.Text.Json.JsonEncodedText PropCompletionTimeMillis = System.Text.Json.JsonEncodedText.Encode("completion_time_millis"); + private static readonly System.Text.Json.JsonEncodedText PropComputationTime = System.Text.Json.JsonEncodedText.Encode("computation_time"); + private static readonly System.Text.Json.JsonEncodedText PropComputationTimeMillis = System.Text.Json.JsonEncodedText.Encode("computation_time_millis"); + private static readonly System.Text.Json.JsonEncodedText PropContextConstructionTime = System.Text.Json.JsonEncodedText.Encode("context_construction_time"); + private static readonly System.Text.Json.JsonEncodedText PropContextConstructionTimeMillis = System.Text.Json.JsonEncodedText.Encode("context_construction_time_millis"); + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropMasterApplyTime = System.Text.Json.JsonEncodedText.Encode("master_apply_time"); + private static readonly System.Text.Json.JsonEncodedText PropMasterApplyTimeMillis = System.Text.Json.JsonEncodedText.Encode("master_apply_time_millis"); + private static readonly System.Text.Json.JsonEncodedText PropNotificationTime = System.Text.Json.JsonEncodedText.Encode("notification_time"); + private static readonly System.Text.Json.JsonEncodedText PropNotificationTimeMillis = System.Text.Json.JsonEncodedText.Encode("notification_time_millis"); + private static readonly System.Text.Json.JsonEncodedText PropPublicationTime = System.Text.Json.JsonEncodedText.Encode("publication_time"); + private static readonly System.Text.Json.JsonEncodedText PropPublicationTimeMillis = System.Text.Json.JsonEncodedText.Encode("publication_time_millis"); + + public override Elastic.Clients.Elasticsearch.Nodes.ClusterStateUpdate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCommitTime = default; + LocalJsonValue propCommitTimeMillis = default; + LocalJsonValue propCompletionTime = default; + LocalJsonValue propCompletionTimeMillis = default; + LocalJsonValue propComputationTime = default; + LocalJsonValue propComputationTimeMillis = default; + LocalJsonValue propContextConstructionTime = default; + LocalJsonValue propContextConstructionTimeMillis = default; + LocalJsonValue propCount = default; + LocalJsonValue propMasterApplyTime = default; + LocalJsonValue propMasterApplyTimeMillis = default; + LocalJsonValue propNotificationTime = default; + LocalJsonValue propNotificationTimeMillis = default; + LocalJsonValue propPublicationTime = default; + LocalJsonValue propPublicationTimeMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCommitTime.TryReadProperty(ref reader, options, PropCommitTime, null)) + { + continue; + } + + if (propCommitTimeMillis.TryReadProperty(ref reader, options, PropCommitTimeMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propCompletionTime.TryReadProperty(ref reader, options, PropCompletionTime, null)) + { + continue; + } + + if (propCompletionTimeMillis.TryReadProperty(ref reader, options, PropCompletionTimeMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propComputationTime.TryReadProperty(ref reader, options, PropComputationTime, null)) + { + continue; + } + + if (propComputationTimeMillis.TryReadProperty(ref reader, options, PropComputationTimeMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propContextConstructionTime.TryReadProperty(ref reader, options, PropContextConstructionTime, null)) + { + continue; + } + + if (propContextConstructionTimeMillis.TryReadProperty(ref reader, options, PropContextConstructionTimeMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propMasterApplyTime.TryReadProperty(ref reader, options, PropMasterApplyTime, null)) + { + continue; + } + + if (propMasterApplyTimeMillis.TryReadProperty(ref reader, options, PropMasterApplyTimeMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propNotificationTime.TryReadProperty(ref reader, options, PropNotificationTime, null)) + { + continue; + } + + if (propNotificationTimeMillis.TryReadProperty(ref reader, options, PropNotificationTimeMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propPublicationTime.TryReadProperty(ref reader, options, PropPublicationTime, null)) + { + continue; + } + + if (propPublicationTimeMillis.TryReadProperty(ref reader, options, PropPublicationTimeMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.ClusterStateUpdate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CommitTime = propCommitTime.Value, + CommitTimeMillis = propCommitTimeMillis.Value, + CompletionTime = propCompletionTime.Value, + CompletionTimeMillis = propCompletionTimeMillis.Value, + ComputationTime = propComputationTime.Value, + ComputationTimeMillis = propComputationTimeMillis.Value, + ContextConstructionTime = propContextConstructionTime.Value, + ContextConstructionTimeMillis = propContextConstructionTimeMillis.Value, + Count = propCount.Value, + MasterApplyTime = propMasterApplyTime.Value, + MasterApplyTimeMillis = propMasterApplyTimeMillis.Value, + NotificationTime = propNotificationTime.Value, + NotificationTimeMillis = propNotificationTimeMillis.Value, + PublicationTime = propPublicationTime.Value, + PublicationTimeMillis = propPublicationTimeMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.ClusterStateUpdate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCommitTime, value.CommitTime, null, null); + writer.WriteProperty(options, PropCommitTimeMillis, value.CommitTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropCompletionTime, value.CompletionTime, null, null); + writer.WriteProperty(options, PropCompletionTimeMillis, value.CompletionTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropComputationTime, value.ComputationTime, null, null); + writer.WriteProperty(options, PropComputationTimeMillis, value.ComputationTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropContextConstructionTime, value.ContextConstructionTime, null, null); + writer.WriteProperty(options, PropContextConstructionTimeMillis, value.ContextConstructionTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropMasterApplyTime, value.MasterApplyTime, null, null); + writer.WriteProperty(options, PropMasterApplyTimeMillis, value.MasterApplyTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropNotificationTime, value.NotificationTime, null, null); + writer.WriteProperty(options, PropNotificationTimeMillis, value.NotificationTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropPublicationTime, value.PublicationTime, null, null); + writer.WriteProperty(options, PropPublicationTimeMillis, value.PublicationTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterStateUpdate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterStateUpdate.g.cs index 07eb4255579..014b41f9bbf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterStateUpdate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ClusterStateUpdate.g.cs @@ -23,172 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class ClusterStateUpdateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCommitTime = System.Text.Json.JsonEncodedText.Encode("commit_time"); - private static readonly System.Text.Json.JsonEncodedText PropCommitTimeMillis = System.Text.Json.JsonEncodedText.Encode("commit_time_millis"); - private static readonly System.Text.Json.JsonEncodedText PropCompletionTime = System.Text.Json.JsonEncodedText.Encode("completion_time"); - private static readonly System.Text.Json.JsonEncodedText PropCompletionTimeMillis = System.Text.Json.JsonEncodedText.Encode("completion_time_millis"); - private static readonly System.Text.Json.JsonEncodedText PropComputationTime = System.Text.Json.JsonEncodedText.Encode("computation_time"); - private static readonly System.Text.Json.JsonEncodedText PropComputationTimeMillis = System.Text.Json.JsonEncodedText.Encode("computation_time_millis"); - private static readonly System.Text.Json.JsonEncodedText PropContextConstructionTime = System.Text.Json.JsonEncodedText.Encode("context_construction_time"); - private static readonly System.Text.Json.JsonEncodedText PropContextConstructionTimeMillis = System.Text.Json.JsonEncodedText.Encode("context_construction_time_millis"); - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropMasterApplyTime = System.Text.Json.JsonEncodedText.Encode("master_apply_time"); - private static readonly System.Text.Json.JsonEncodedText PropMasterApplyTimeMillis = System.Text.Json.JsonEncodedText.Encode("master_apply_time_millis"); - private static readonly System.Text.Json.JsonEncodedText PropNotificationTime = System.Text.Json.JsonEncodedText.Encode("notification_time"); - private static readonly System.Text.Json.JsonEncodedText PropNotificationTimeMillis = System.Text.Json.JsonEncodedText.Encode("notification_time_millis"); - private static readonly System.Text.Json.JsonEncodedText PropPublicationTime = System.Text.Json.JsonEncodedText.Encode("publication_time"); - private static readonly System.Text.Json.JsonEncodedText PropPublicationTimeMillis = System.Text.Json.JsonEncodedText.Encode("publication_time_millis"); - - public override Elastic.Clients.Elasticsearch.Nodes.ClusterStateUpdate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCommitTime = default; - LocalJsonValue propCommitTimeMillis = default; - LocalJsonValue propCompletionTime = default; - LocalJsonValue propCompletionTimeMillis = default; - LocalJsonValue propComputationTime = default; - LocalJsonValue propComputationTimeMillis = default; - LocalJsonValue propContextConstructionTime = default; - LocalJsonValue propContextConstructionTimeMillis = default; - LocalJsonValue propCount = default; - LocalJsonValue propMasterApplyTime = default; - LocalJsonValue propMasterApplyTimeMillis = default; - LocalJsonValue propNotificationTime = default; - LocalJsonValue propNotificationTimeMillis = default; - LocalJsonValue propPublicationTime = default; - LocalJsonValue propPublicationTimeMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCommitTime.TryReadProperty(ref reader, options, PropCommitTime, null)) - { - continue; - } - - if (propCommitTimeMillis.TryReadProperty(ref reader, options, PropCommitTimeMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propCompletionTime.TryReadProperty(ref reader, options, PropCompletionTime, null)) - { - continue; - } - - if (propCompletionTimeMillis.TryReadProperty(ref reader, options, PropCompletionTimeMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propComputationTime.TryReadProperty(ref reader, options, PropComputationTime, null)) - { - continue; - } - - if (propComputationTimeMillis.TryReadProperty(ref reader, options, PropComputationTimeMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propContextConstructionTime.TryReadProperty(ref reader, options, PropContextConstructionTime, null)) - { - continue; - } - - if (propContextConstructionTimeMillis.TryReadProperty(ref reader, options, PropContextConstructionTimeMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propMasterApplyTime.TryReadProperty(ref reader, options, PropMasterApplyTime, null)) - { - continue; - } - - if (propMasterApplyTimeMillis.TryReadProperty(ref reader, options, PropMasterApplyTimeMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propNotificationTime.TryReadProperty(ref reader, options, PropNotificationTime, null)) - { - continue; - } - - if (propNotificationTimeMillis.TryReadProperty(ref reader, options, PropNotificationTimeMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propPublicationTime.TryReadProperty(ref reader, options, PropPublicationTime, null)) - { - continue; - } - - if (propPublicationTimeMillis.TryReadProperty(ref reader, options, PropPublicationTimeMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.ClusterStateUpdate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CommitTime = propCommitTime.Value, - CommitTimeMillis = propCommitTimeMillis.Value, - CompletionTime = propCompletionTime.Value, - CompletionTimeMillis = propCompletionTimeMillis.Value, - ComputationTime = propComputationTime.Value, - ComputationTimeMillis = propComputationTimeMillis.Value, - ContextConstructionTime = propContextConstructionTime.Value, - ContextConstructionTimeMillis = propContextConstructionTimeMillis.Value, - Count = propCount.Value, - MasterApplyTime = propMasterApplyTime.Value, - MasterApplyTimeMillis = propMasterApplyTimeMillis.Value, - NotificationTime = propNotificationTime.Value, - NotificationTimeMillis = propNotificationTimeMillis.Value, - PublicationTime = propPublicationTime.Value, - PublicationTimeMillis = propPublicationTimeMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.ClusterStateUpdate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCommitTime, value.CommitTime, null, null); - writer.WriteProperty(options, PropCommitTimeMillis, value.CommitTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropCompletionTime, value.CompletionTime, null, null); - writer.WriteProperty(options, PropCompletionTimeMillis, value.CompletionTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropComputationTime, value.ComputationTime, null, null); - writer.WriteProperty(options, PropComputationTimeMillis, value.ComputationTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropContextConstructionTime, value.ContextConstructionTime, null, null); - writer.WriteProperty(options, PropContextConstructionTimeMillis, value.ContextConstructionTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropMasterApplyTime, value.MasterApplyTime, null, null); - writer.WriteProperty(options, PropMasterApplyTimeMillis, value.MasterApplyTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropNotificationTime, value.NotificationTime, null, null); - writer.WriteProperty(options, PropNotificationTimeMillis, value.NotificationTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropPublicationTime, value.PublicationTime, null, null); - writer.WriteProperty(options, PropPublicationTimeMillis, value.PublicationTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.ClusterStateUpdateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.ClusterStateUpdateConverter))] public sealed partial class ClusterStateUpdate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Context.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Context.Converters.g.cs new file mode 100644 index 00000000000..4cde4f646b2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Context.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class ContextConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCacheEvictions = System.Text.Json.JsonEncodedText.Encode("cache_evictions"); + private static readonly System.Text.Json.JsonEncodedText PropCompilationLimitTriggered = System.Text.Json.JsonEncodedText.Encode("compilation_limit_triggered"); + private static readonly System.Text.Json.JsonEncodedText PropCompilations = System.Text.Json.JsonEncodedText.Encode("compilations"); + private static readonly System.Text.Json.JsonEncodedText PropContext2 = System.Text.Json.JsonEncodedText.Encode("context"); + + public override Elastic.Clients.Elasticsearch.Nodes.Context Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCacheEvictions = default; + LocalJsonValue propCompilationLimitTriggered = default; + LocalJsonValue propCompilations = default; + LocalJsonValue propContext2 = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCacheEvictions.TryReadProperty(ref reader, options, PropCacheEvictions, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCompilationLimitTriggered.TryReadProperty(ref reader, options, PropCompilationLimitTriggered, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCompilations.TryReadProperty(ref reader, options, PropCompilations, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propContext2.TryReadProperty(ref reader, options, PropContext2, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.Context(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CacheEvictions = propCacheEvictions.Value, + CompilationLimitTriggered = propCompilationLimitTriggered.Value, + Compilations = propCompilations.Value, + Context2 = propContext2.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Context value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCacheEvictions, value.CacheEvictions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCompilationLimitTriggered, value.CompilationLimitTriggered, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCompilations, value.Compilations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropContext2, value.Context2, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Context.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Context.g.cs index 17a67d4cdae..69110a71324 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Context.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Context.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class ContextConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCacheEvictions = System.Text.Json.JsonEncodedText.Encode("cache_evictions"); - private static readonly System.Text.Json.JsonEncodedText PropCompilationLimitTriggered = System.Text.Json.JsonEncodedText.Encode("compilation_limit_triggered"); - private static readonly System.Text.Json.JsonEncodedText PropCompilations = System.Text.Json.JsonEncodedText.Encode("compilations"); - private static readonly System.Text.Json.JsonEncodedText PropContext2 = System.Text.Json.JsonEncodedText.Encode("context"); - - public override Elastic.Clients.Elasticsearch.Nodes.Context Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCacheEvictions = default; - LocalJsonValue propCompilationLimitTriggered = default; - LocalJsonValue propCompilations = default; - LocalJsonValue propContext2 = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCacheEvictions.TryReadProperty(ref reader, options, PropCacheEvictions, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCompilationLimitTriggered.TryReadProperty(ref reader, options, PropCompilationLimitTriggered, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCompilations.TryReadProperty(ref reader, options, PropCompilations, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propContext2.TryReadProperty(ref reader, options, PropContext2, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.Context(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CacheEvictions = propCacheEvictions.Value, - CompilationLimitTriggered = propCompilationLimitTriggered.Value, - Compilations = propCompilations.Value, - Context2 = propContext2.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Context value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCacheEvictions, value.CacheEvictions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCompilationLimitTriggered, value.CompilationLimitTriggered, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCompilations, value.Compilations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropContext2, value.Context2, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.ContextConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.ContextConverter))] public sealed partial class Context { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Cpu.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Cpu.Converters.g.cs new file mode 100644 index 00000000000..df520857218 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Cpu.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class CpuConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLoadAverage = System.Text.Json.JsonEncodedText.Encode("load_average"); + private static readonly System.Text.Json.JsonEncodedText PropPercent = System.Text.Json.JsonEncodedText.Encode("percent"); + private static readonly System.Text.Json.JsonEncodedText PropSys = System.Text.Json.JsonEncodedText.Encode("sys"); + private static readonly System.Text.Json.JsonEncodedText PropSysInMillis = System.Text.Json.JsonEncodedText.Encode("sys_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + private static readonly System.Text.Json.JsonEncodedText PropTotalInMillis = System.Text.Json.JsonEncodedText.Encode("total_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropUser = System.Text.Json.JsonEncodedText.Encode("user"); + private static readonly System.Text.Json.JsonEncodedText PropUserInMillis = System.Text.Json.JsonEncodedText.Encode("user_in_millis"); + + public override Elastic.Clients.Elasticsearch.Nodes.Cpu Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propLoadAverage = default; + LocalJsonValue propPercent = default; + LocalJsonValue propSys = default; + LocalJsonValue propSysInMillis = default; + LocalJsonValue propTotal = default; + LocalJsonValue propTotalInMillis = default; + LocalJsonValue propUser = default; + LocalJsonValue propUserInMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLoadAverage.TryReadProperty(ref reader, options, PropLoadAverage, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propPercent.TryReadProperty(ref reader, options, PropPercent, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSys.TryReadProperty(ref reader, options, PropSys, null)) + { + continue; + } + + if (propSysInMillis.TryReadProperty(ref reader, options, PropSysInMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (propTotalInMillis.TryReadProperty(ref reader, options, PropTotalInMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propUser.TryReadProperty(ref reader, options, PropUser, null)) + { + continue; + } + + if (propUserInMillis.TryReadProperty(ref reader, options, PropUserInMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.Cpu(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + LoadAverage = propLoadAverage.Value, + Percent = propPercent.Value, + Sys = propSys.Value, + SysInMillis = propSysInMillis.Value, + Total = propTotal.Value, + TotalInMillis = propTotalInMillis.Value, + User = propUser.Value, + UserInMillis = propUserInMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Cpu value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLoadAverage, value.LoadAverage, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropPercent, value.Percent, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSys, value.Sys, null, null); + writer.WriteProperty(options, PropSysInMillis, value.SysInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteProperty(options, PropTotalInMillis, value.TotalInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropUser, value.User, null, null); + writer.WriteProperty(options, PropUserInMillis, value.UserInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Cpu.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Cpu.g.cs index 4f4907ba5ab..ed3911e4995 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Cpu.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Cpu.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class CpuConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLoadAverage = System.Text.Json.JsonEncodedText.Encode("load_average"); - private static readonly System.Text.Json.JsonEncodedText PropPercent = System.Text.Json.JsonEncodedText.Encode("percent"); - private static readonly System.Text.Json.JsonEncodedText PropSys = System.Text.Json.JsonEncodedText.Encode("sys"); - private static readonly System.Text.Json.JsonEncodedText PropSysInMillis = System.Text.Json.JsonEncodedText.Encode("sys_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - private static readonly System.Text.Json.JsonEncodedText PropTotalInMillis = System.Text.Json.JsonEncodedText.Encode("total_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropUser = System.Text.Json.JsonEncodedText.Encode("user"); - private static readonly System.Text.Json.JsonEncodedText PropUserInMillis = System.Text.Json.JsonEncodedText.Encode("user_in_millis"); - - public override Elastic.Clients.Elasticsearch.Nodes.Cpu Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propLoadAverage = default; - LocalJsonValue propPercent = default; - LocalJsonValue propSys = default; - LocalJsonValue propSysInMillis = default; - LocalJsonValue propTotal = default; - LocalJsonValue propTotalInMillis = default; - LocalJsonValue propUser = default; - LocalJsonValue propUserInMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLoadAverage.TryReadProperty(ref reader, options, PropLoadAverage, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propPercent.TryReadProperty(ref reader, options, PropPercent, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSys.TryReadProperty(ref reader, options, PropSys, null)) - { - continue; - } - - if (propSysInMillis.TryReadProperty(ref reader, options, PropSysInMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (propTotalInMillis.TryReadProperty(ref reader, options, PropTotalInMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propUser.TryReadProperty(ref reader, options, PropUser, null)) - { - continue; - } - - if (propUserInMillis.TryReadProperty(ref reader, options, PropUserInMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.Cpu(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - LoadAverage = propLoadAverage.Value, - Percent = propPercent.Value, - Sys = propSys.Value, - SysInMillis = propSysInMillis.Value, - Total = propTotal.Value, - TotalInMillis = propTotalInMillis.Value, - User = propUser.Value, - UserInMillis = propUserInMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Cpu value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLoadAverage, value.LoadAverage, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropPercent, value.Percent, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSys, value.Sys, null, null); - writer.WriteProperty(options, PropSysInMillis, value.SysInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteProperty(options, PropTotalInMillis, value.TotalInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropUser, value.User, null, null); - writer.WriteProperty(options, PropUserInMillis, value.UserInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.CpuConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.CpuConverter))] public sealed partial class Cpu { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CpuAcct.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CpuAcct.Converters.g.cs new file mode 100644 index 00000000000..a3e7c057a23 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CpuAcct.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class CpuAcctConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropControlGroup = System.Text.Json.JsonEncodedText.Encode("control_group"); + private static readonly System.Text.Json.JsonEncodedText PropUsageNanos = System.Text.Json.JsonEncodedText.Encode("usage_nanos"); + + public override Elastic.Clients.Elasticsearch.Nodes.CpuAcct Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propControlGroup = default; + LocalJsonValue propUsageNanos = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propControlGroup.TryReadProperty(ref reader, options, PropControlGroup, null)) + { + continue; + } + + if (propUsageNanos.TryReadProperty(ref reader, options, PropUsageNanos, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.CpuAcct(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ControlGroup = propControlGroup.Value, + UsageNanos = propUsageNanos.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.CpuAcct value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropControlGroup, value.ControlGroup, null, null); + writer.WriteProperty(options, PropUsageNanos, value.UsageNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CpuAcct.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CpuAcct.g.cs index 4ef4d282d2d..03053a73ec9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CpuAcct.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/CpuAcct.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class CpuAcctConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropControlGroup = System.Text.Json.JsonEncodedText.Encode("control_group"); - private static readonly System.Text.Json.JsonEncodedText PropUsageNanos = System.Text.Json.JsonEncodedText.Encode("usage_nanos"); - - public override Elastic.Clients.Elasticsearch.Nodes.CpuAcct Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propControlGroup = default; - LocalJsonValue propUsageNanos = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propControlGroup.TryReadProperty(ref reader, options, PropControlGroup, null)) - { - continue; - } - - if (propUsageNanos.TryReadProperty(ref reader, options, PropUsageNanos, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.CpuAcct(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ControlGroup = propControlGroup.Value, - UsageNanos = propUsageNanos.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.CpuAcct value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropControlGroup, value.ControlGroup, null, null); - writer.WriteProperty(options, PropUsageNanos, value.UsageNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.CpuAcctConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.CpuAcctConverter))] public sealed partial class CpuAcct { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/DataPathStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/DataPathStats.Converters.g.cs new file mode 100644 index 00000000000..02ee734c87d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/DataPathStats.Converters.g.cs @@ -0,0 +1,198 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class DataPathStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); + private static readonly System.Text.Json.JsonEncodedText PropAvailableInBytes = System.Text.Json.JsonEncodedText.Encode("available_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropDiskQueue = System.Text.Json.JsonEncodedText.Encode("disk_queue"); + private static readonly System.Text.Json.JsonEncodedText PropDiskReads = System.Text.Json.JsonEncodedText.Encode("disk_reads"); + private static readonly System.Text.Json.JsonEncodedText PropDiskReadSize = System.Text.Json.JsonEncodedText.Encode("disk_read_size"); + private static readonly System.Text.Json.JsonEncodedText PropDiskReadSizeInBytes = System.Text.Json.JsonEncodedText.Encode("disk_read_size_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropDiskWrites = System.Text.Json.JsonEncodedText.Encode("disk_writes"); + private static readonly System.Text.Json.JsonEncodedText PropDiskWriteSize = System.Text.Json.JsonEncodedText.Encode("disk_write_size"); + private static readonly System.Text.Json.JsonEncodedText PropDiskWriteSizeInBytes = System.Text.Json.JsonEncodedText.Encode("disk_write_size_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropFree = System.Text.Json.JsonEncodedText.Encode("free"); + private static readonly System.Text.Json.JsonEncodedText PropFreeInBytes = System.Text.Json.JsonEncodedText.Encode("free_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropMount = System.Text.Json.JsonEncodedText.Encode("mount"); + private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + private static readonly System.Text.Json.JsonEncodedText PropTotalInBytes = System.Text.Json.JsonEncodedText.Encode("total_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Nodes.DataPathStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvailable = default; + LocalJsonValue propAvailableInBytes = default; + LocalJsonValue propDiskQueue = default; + LocalJsonValue propDiskReads = default; + LocalJsonValue propDiskReadSize = default; + LocalJsonValue propDiskReadSizeInBytes = default; + LocalJsonValue propDiskWrites = default; + LocalJsonValue propDiskWriteSize = default; + LocalJsonValue propDiskWriteSizeInBytes = default; + LocalJsonValue propFree = default; + LocalJsonValue propFreeInBytes = default; + LocalJsonValue propMount = default; + LocalJsonValue propPath = default; + LocalJsonValue propTotal = default; + LocalJsonValue propTotalInBytes = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) + { + continue; + } + + if (propAvailableInBytes.TryReadProperty(ref reader, options, PropAvailableInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDiskQueue.TryReadProperty(ref reader, options, PropDiskQueue, null)) + { + continue; + } + + if (propDiskReads.TryReadProperty(ref reader, options, PropDiskReads, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDiskReadSize.TryReadProperty(ref reader, options, PropDiskReadSize, null)) + { + continue; + } + + if (propDiskReadSizeInBytes.TryReadProperty(ref reader, options, PropDiskReadSizeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDiskWrites.TryReadProperty(ref reader, options, PropDiskWrites, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDiskWriteSize.TryReadProperty(ref reader, options, PropDiskWriteSize, null)) + { + continue; + } + + if (propDiskWriteSizeInBytes.TryReadProperty(ref reader, options, PropDiskWriteSizeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFree.TryReadProperty(ref reader, options, PropFree, null)) + { + continue; + } + + if (propFreeInBytes.TryReadProperty(ref reader, options, PropFreeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMount.TryReadProperty(ref reader, options, PropMount, null)) + { + continue; + } + + if (propPath.TryReadProperty(ref reader, options, PropPath, null)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (propTotalInBytes.TryReadProperty(ref reader, options, PropTotalInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.DataPathStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Available = propAvailable.Value, + AvailableInBytes = propAvailableInBytes.Value, + DiskQueue = propDiskQueue.Value, + DiskReads = propDiskReads.Value, + DiskReadSize = propDiskReadSize.Value, + DiskReadSizeInBytes = propDiskReadSizeInBytes.Value, + DiskWrites = propDiskWrites.Value, + DiskWriteSize = propDiskWriteSize.Value, + DiskWriteSizeInBytes = propDiskWriteSizeInBytes.Value, + Free = propFree.Value, + FreeInBytes = propFreeInBytes.Value, + Mount = propMount.Value, + Path = propPath.Value, + Total = propTotal.Value, + TotalInBytes = propTotalInBytes.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.DataPathStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvailable, value.Available, null, null); + writer.WriteProperty(options, PropAvailableInBytes, value.AvailableInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDiskQueue, value.DiskQueue, null, null); + writer.WriteProperty(options, PropDiskReads, value.DiskReads, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDiskReadSize, value.DiskReadSize, null, null); + writer.WriteProperty(options, PropDiskReadSizeInBytes, value.DiskReadSizeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDiskWrites, value.DiskWrites, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDiskWriteSize, value.DiskWriteSize, null, null); + writer.WriteProperty(options, PropDiskWriteSizeInBytes, value.DiskWriteSizeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFree, value.Free, null, null); + writer.WriteProperty(options, PropFreeInBytes, value.FreeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMount, value.Mount, null, null); + writer.WriteProperty(options, PropPath, value.Path, null, null); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteProperty(options, PropTotalInBytes, value.TotalInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/DataPathStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/DataPathStats.g.cs index b0f042ff56f..19827c61797 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/DataPathStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/DataPathStats.g.cs @@ -23,181 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class DataPathStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); - private static readonly System.Text.Json.JsonEncodedText PropAvailableInBytes = System.Text.Json.JsonEncodedText.Encode("available_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropDiskQueue = System.Text.Json.JsonEncodedText.Encode("disk_queue"); - private static readonly System.Text.Json.JsonEncodedText PropDiskReads = System.Text.Json.JsonEncodedText.Encode("disk_reads"); - private static readonly System.Text.Json.JsonEncodedText PropDiskReadSize = System.Text.Json.JsonEncodedText.Encode("disk_read_size"); - private static readonly System.Text.Json.JsonEncodedText PropDiskReadSizeInBytes = System.Text.Json.JsonEncodedText.Encode("disk_read_size_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropDiskWrites = System.Text.Json.JsonEncodedText.Encode("disk_writes"); - private static readonly System.Text.Json.JsonEncodedText PropDiskWriteSize = System.Text.Json.JsonEncodedText.Encode("disk_write_size"); - private static readonly System.Text.Json.JsonEncodedText PropDiskWriteSizeInBytes = System.Text.Json.JsonEncodedText.Encode("disk_write_size_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropFree = System.Text.Json.JsonEncodedText.Encode("free"); - private static readonly System.Text.Json.JsonEncodedText PropFreeInBytes = System.Text.Json.JsonEncodedText.Encode("free_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropMount = System.Text.Json.JsonEncodedText.Encode("mount"); - private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - private static readonly System.Text.Json.JsonEncodedText PropTotalInBytes = System.Text.Json.JsonEncodedText.Encode("total_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Nodes.DataPathStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvailable = default; - LocalJsonValue propAvailableInBytes = default; - LocalJsonValue propDiskQueue = default; - LocalJsonValue propDiskReads = default; - LocalJsonValue propDiskReadSize = default; - LocalJsonValue propDiskReadSizeInBytes = default; - LocalJsonValue propDiskWrites = default; - LocalJsonValue propDiskWriteSize = default; - LocalJsonValue propDiskWriteSizeInBytes = default; - LocalJsonValue propFree = default; - LocalJsonValue propFreeInBytes = default; - LocalJsonValue propMount = default; - LocalJsonValue propPath = default; - LocalJsonValue propTotal = default; - LocalJsonValue propTotalInBytes = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) - { - continue; - } - - if (propAvailableInBytes.TryReadProperty(ref reader, options, PropAvailableInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDiskQueue.TryReadProperty(ref reader, options, PropDiskQueue, null)) - { - continue; - } - - if (propDiskReads.TryReadProperty(ref reader, options, PropDiskReads, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDiskReadSize.TryReadProperty(ref reader, options, PropDiskReadSize, null)) - { - continue; - } - - if (propDiskReadSizeInBytes.TryReadProperty(ref reader, options, PropDiskReadSizeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDiskWrites.TryReadProperty(ref reader, options, PropDiskWrites, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDiskWriteSize.TryReadProperty(ref reader, options, PropDiskWriteSize, null)) - { - continue; - } - - if (propDiskWriteSizeInBytes.TryReadProperty(ref reader, options, PropDiskWriteSizeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFree.TryReadProperty(ref reader, options, PropFree, null)) - { - continue; - } - - if (propFreeInBytes.TryReadProperty(ref reader, options, PropFreeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMount.TryReadProperty(ref reader, options, PropMount, null)) - { - continue; - } - - if (propPath.TryReadProperty(ref reader, options, PropPath, null)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (propTotalInBytes.TryReadProperty(ref reader, options, PropTotalInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.DataPathStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Available = propAvailable.Value, - AvailableInBytes = propAvailableInBytes.Value, - DiskQueue = propDiskQueue.Value, - DiskReads = propDiskReads.Value, - DiskReadSize = propDiskReadSize.Value, - DiskReadSizeInBytes = propDiskReadSizeInBytes.Value, - DiskWrites = propDiskWrites.Value, - DiskWriteSize = propDiskWriteSize.Value, - DiskWriteSizeInBytes = propDiskWriteSizeInBytes.Value, - Free = propFree.Value, - FreeInBytes = propFreeInBytes.Value, - Mount = propMount.Value, - Path = propPath.Value, - Total = propTotal.Value, - TotalInBytes = propTotalInBytes.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.DataPathStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvailable, value.Available, null, null); - writer.WriteProperty(options, PropAvailableInBytes, value.AvailableInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDiskQueue, value.DiskQueue, null, null); - writer.WriteProperty(options, PropDiskReads, value.DiskReads, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDiskReadSize, value.DiskReadSize, null, null); - writer.WriteProperty(options, PropDiskReadSizeInBytes, value.DiskReadSizeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDiskWrites, value.DiskWrites, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDiskWriteSize, value.DiskWriteSize, null, null); - writer.WriteProperty(options, PropDiskWriteSizeInBytes, value.DiskWriteSizeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFree, value.Free, null, null); - writer.WriteProperty(options, PropFreeInBytes, value.FreeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMount, value.Mount, null, null); - writer.WriteProperty(options, PropPath, value.Path, null, null); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteProperty(options, PropTotalInBytes, value.TotalInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.DataPathStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.DataPathStatsConverter))] public sealed partial class DataPathStats { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/DeprecationIndexing.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/DeprecationIndexing.Converters.g.cs new file mode 100644 index 00000000000..10dca34ba3e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/DeprecationIndexing.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class DeprecationIndexingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + + public override Elastic.Clients.Elasticsearch.Nodes.DeprecationIndexing Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propEnabled = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static Elastic.Clients.Elasticsearch.Union (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.DeprecationIndexing(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Enabled = propEnabled.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.DeprecationIndexing value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union v) => w.WriteUnionValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/DeprecationIndexing.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/DeprecationIndexing.g.cs index d73c1f7644f..035a1faeb3f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/DeprecationIndexing.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/DeprecationIndexing.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class DeprecationIndexingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - - public override Elastic.Clients.Elasticsearch.Nodes.DeprecationIndexing Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propEnabled = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static Elastic.Clients.Elasticsearch.Union (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.DeprecationIndexing(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Enabled = propEnabled.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.DeprecationIndexing value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union v) => w.WriteUnionValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.DeprecationIndexingConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.DeprecationIndexingConverter))] public sealed partial class DeprecationIndexing { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Discovery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Discovery.Converters.g.cs new file mode 100644 index 00000000000..51380873a2b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Discovery.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class DiscoveryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClusterApplierStats = System.Text.Json.JsonEncodedText.Encode("cluster_applier_stats"); + private static readonly System.Text.Json.JsonEncodedText PropClusterStateQueue = System.Text.Json.JsonEncodedText.Encode("cluster_state_queue"); + private static readonly System.Text.Json.JsonEncodedText PropClusterStateUpdate = System.Text.Json.JsonEncodedText.Encode("cluster_state_update"); + private static readonly System.Text.Json.JsonEncodedText PropPublishedClusterStates = System.Text.Json.JsonEncodedText.Encode("published_cluster_states"); + private static readonly System.Text.Json.JsonEncodedText PropSerializedClusterStates = System.Text.Json.JsonEncodedText.Encode("serialized_cluster_states"); + + public override Elastic.Clients.Elasticsearch.Nodes.Discovery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClusterApplierStats = default; + LocalJsonValue propClusterStateQueue = default; + LocalJsonValue?> propClusterStateUpdate = default; + LocalJsonValue propPublishedClusterStates = default; + LocalJsonValue propSerializedClusterStates = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClusterApplierStats.TryReadProperty(ref reader, options, PropClusterApplierStats, null)) + { + continue; + } + + if (propClusterStateQueue.TryReadProperty(ref reader, options, PropClusterStateQueue, null)) + { + continue; + } + + if (propClusterStateUpdate.TryReadProperty(ref reader, options, PropClusterStateUpdate, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propPublishedClusterStates.TryReadProperty(ref reader, options, PropPublishedClusterStates, null)) + { + continue; + } + + if (propSerializedClusterStates.TryReadProperty(ref reader, options, PropSerializedClusterStates, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.Discovery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClusterApplierStats = propClusterApplierStats.Value, + ClusterStateQueue = propClusterStateQueue.Value, + ClusterStateUpdate = propClusterStateUpdate.Value, + PublishedClusterStates = propPublishedClusterStates.Value, + SerializedClusterStates = propSerializedClusterStates.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Discovery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClusterApplierStats, value.ClusterApplierStats, null, null); + writer.WriteProperty(options, PropClusterStateQueue, value.ClusterStateQueue, null, null); + writer.WriteProperty(options, PropClusterStateUpdate, value.ClusterStateUpdate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropPublishedClusterStates, value.PublishedClusterStates, null, null); + writer.WriteProperty(options, PropSerializedClusterStates, value.SerializedClusterStates, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Discovery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Discovery.g.cs index 0c6c164c6e7..48f4d38c0ee 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Discovery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Discovery.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class DiscoveryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClusterApplierStats = System.Text.Json.JsonEncodedText.Encode("cluster_applier_stats"); - private static readonly System.Text.Json.JsonEncodedText PropClusterStateQueue = System.Text.Json.JsonEncodedText.Encode("cluster_state_queue"); - private static readonly System.Text.Json.JsonEncodedText PropClusterStateUpdate = System.Text.Json.JsonEncodedText.Encode("cluster_state_update"); - private static readonly System.Text.Json.JsonEncodedText PropPublishedClusterStates = System.Text.Json.JsonEncodedText.Encode("published_cluster_states"); - private static readonly System.Text.Json.JsonEncodedText PropSerializedClusterStates = System.Text.Json.JsonEncodedText.Encode("serialized_cluster_states"); - - public override Elastic.Clients.Elasticsearch.Nodes.Discovery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClusterApplierStats = default; - LocalJsonValue propClusterStateQueue = default; - LocalJsonValue?> propClusterStateUpdate = default; - LocalJsonValue propPublishedClusterStates = default; - LocalJsonValue propSerializedClusterStates = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClusterApplierStats.TryReadProperty(ref reader, options, PropClusterApplierStats, null)) - { - continue; - } - - if (propClusterStateQueue.TryReadProperty(ref reader, options, PropClusterStateQueue, null)) - { - continue; - } - - if (propClusterStateUpdate.TryReadProperty(ref reader, options, PropClusterStateUpdate, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propPublishedClusterStates.TryReadProperty(ref reader, options, PropPublishedClusterStates, null)) - { - continue; - } - - if (propSerializedClusterStates.TryReadProperty(ref reader, options, PropSerializedClusterStates, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.Discovery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ClusterApplierStats = propClusterApplierStats.Value, - ClusterStateQueue = propClusterStateQueue.Value, - ClusterStateUpdate = propClusterStateUpdate.Value, - PublishedClusterStates = propPublishedClusterStates.Value, - SerializedClusterStates = propSerializedClusterStates.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Discovery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClusterApplierStats, value.ClusterApplierStats, null, null); - writer.WriteProperty(options, PropClusterStateQueue, value.ClusterStateQueue, null, null); - writer.WriteProperty(options, PropClusterStateUpdate, value.ClusterStateUpdate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropPublishedClusterStates, value.PublishedClusterStates, null, null); - writer.WriteProperty(options, PropSerializedClusterStates, value.SerializedClusterStates, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.DiscoveryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.DiscoveryConverter))] public sealed partial class Discovery { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ExtendedMemoryStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ExtendedMemoryStats.Converters.g.cs new file mode 100644 index 00000000000..58ca22d8eeb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ExtendedMemoryStats.Converters.g.cs @@ -0,0 +1,162 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class ExtendedMemoryStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAdjustedTotalInBytes = System.Text.Json.JsonEncodedText.Encode("adjusted_total_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropFreeInBytes = System.Text.Json.JsonEncodedText.Encode("free_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropFreePercent = System.Text.Json.JsonEncodedText.Encode("free_percent"); + private static readonly System.Text.Json.JsonEncodedText PropResident = System.Text.Json.JsonEncodedText.Encode("resident"); + private static readonly System.Text.Json.JsonEncodedText PropResidentInBytes = System.Text.Json.JsonEncodedText.Encode("resident_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropShare = System.Text.Json.JsonEncodedText.Encode("share"); + private static readonly System.Text.Json.JsonEncodedText PropShareInBytes = System.Text.Json.JsonEncodedText.Encode("share_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTotalInBytes = System.Text.Json.JsonEncodedText.Encode("total_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTotalVirtual = System.Text.Json.JsonEncodedText.Encode("total_virtual"); + private static readonly System.Text.Json.JsonEncodedText PropTotalVirtualInBytes = System.Text.Json.JsonEncodedText.Encode("total_virtual_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropUsedInBytes = System.Text.Json.JsonEncodedText.Encode("used_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropUsedPercent = System.Text.Json.JsonEncodedText.Encode("used_percent"); + + public override Elastic.Clients.Elasticsearch.Nodes.ExtendedMemoryStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAdjustedTotalInBytes = default; + LocalJsonValue propFreeInBytes = default; + LocalJsonValue propFreePercent = default; + LocalJsonValue propResident = default; + LocalJsonValue propResidentInBytes = default; + LocalJsonValue propShare = default; + LocalJsonValue propShareInBytes = default; + LocalJsonValue propTotalInBytes = default; + LocalJsonValue propTotalVirtual = default; + LocalJsonValue propTotalVirtualInBytes = default; + LocalJsonValue propUsedInBytes = default; + LocalJsonValue propUsedPercent = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAdjustedTotalInBytes.TryReadProperty(ref reader, options, PropAdjustedTotalInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFreeInBytes.TryReadProperty(ref reader, options, PropFreeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFreePercent.TryReadProperty(ref reader, options, PropFreePercent, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propResident.TryReadProperty(ref reader, options, PropResident, null)) + { + continue; + } + + if (propResidentInBytes.TryReadProperty(ref reader, options, PropResidentInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propShare.TryReadProperty(ref reader, options, PropShare, null)) + { + continue; + } + + if (propShareInBytes.TryReadProperty(ref reader, options, PropShareInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotalInBytes.TryReadProperty(ref reader, options, PropTotalInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotalVirtual.TryReadProperty(ref reader, options, PropTotalVirtual, null)) + { + continue; + } + + if (propTotalVirtualInBytes.TryReadProperty(ref reader, options, PropTotalVirtualInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propUsedInBytes.TryReadProperty(ref reader, options, PropUsedInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propUsedPercent.TryReadProperty(ref reader, options, PropUsedPercent, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.ExtendedMemoryStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AdjustedTotalInBytes = propAdjustedTotalInBytes.Value, + FreeInBytes = propFreeInBytes.Value, + FreePercent = propFreePercent.Value, + Resident = propResident.Value, + ResidentInBytes = propResidentInBytes.Value, + Share = propShare.Value, + ShareInBytes = propShareInBytes.Value, + TotalInBytes = propTotalInBytes.Value, + TotalVirtual = propTotalVirtual.Value, + TotalVirtualInBytes = propTotalVirtualInBytes.Value, + UsedInBytes = propUsedInBytes.Value, + UsedPercent = propUsedPercent.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.ExtendedMemoryStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAdjustedTotalInBytes, value.AdjustedTotalInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFreeInBytes, value.FreeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFreePercent, value.FreePercent, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropResident, value.Resident, null, null); + writer.WriteProperty(options, PropResidentInBytes, value.ResidentInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropShare, value.Share, null, null); + writer.WriteProperty(options, PropShareInBytes, value.ShareInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotalInBytes, value.TotalInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotalVirtual, value.TotalVirtual, null, null); + writer.WriteProperty(options, PropTotalVirtualInBytes, value.TotalVirtualInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropUsedInBytes, value.UsedInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropUsedPercent, value.UsedPercent, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ExtendedMemoryStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ExtendedMemoryStats.g.cs index f7b6fb4d69b..f54f43a5e2d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ExtendedMemoryStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ExtendedMemoryStats.g.cs @@ -23,145 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class ExtendedMemoryStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAdjustedTotalInBytes = System.Text.Json.JsonEncodedText.Encode("adjusted_total_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropFreeInBytes = System.Text.Json.JsonEncodedText.Encode("free_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropFreePercent = System.Text.Json.JsonEncodedText.Encode("free_percent"); - private static readonly System.Text.Json.JsonEncodedText PropResident = System.Text.Json.JsonEncodedText.Encode("resident"); - private static readonly System.Text.Json.JsonEncodedText PropResidentInBytes = System.Text.Json.JsonEncodedText.Encode("resident_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropShare = System.Text.Json.JsonEncodedText.Encode("share"); - private static readonly System.Text.Json.JsonEncodedText PropShareInBytes = System.Text.Json.JsonEncodedText.Encode("share_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTotalInBytes = System.Text.Json.JsonEncodedText.Encode("total_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTotalVirtual = System.Text.Json.JsonEncodedText.Encode("total_virtual"); - private static readonly System.Text.Json.JsonEncodedText PropTotalVirtualInBytes = System.Text.Json.JsonEncodedText.Encode("total_virtual_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropUsedInBytes = System.Text.Json.JsonEncodedText.Encode("used_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropUsedPercent = System.Text.Json.JsonEncodedText.Encode("used_percent"); - - public override Elastic.Clients.Elasticsearch.Nodes.ExtendedMemoryStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAdjustedTotalInBytes = default; - LocalJsonValue propFreeInBytes = default; - LocalJsonValue propFreePercent = default; - LocalJsonValue propResident = default; - LocalJsonValue propResidentInBytes = default; - LocalJsonValue propShare = default; - LocalJsonValue propShareInBytes = default; - LocalJsonValue propTotalInBytes = default; - LocalJsonValue propTotalVirtual = default; - LocalJsonValue propTotalVirtualInBytes = default; - LocalJsonValue propUsedInBytes = default; - LocalJsonValue propUsedPercent = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAdjustedTotalInBytes.TryReadProperty(ref reader, options, PropAdjustedTotalInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFreeInBytes.TryReadProperty(ref reader, options, PropFreeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFreePercent.TryReadProperty(ref reader, options, PropFreePercent, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propResident.TryReadProperty(ref reader, options, PropResident, null)) - { - continue; - } - - if (propResidentInBytes.TryReadProperty(ref reader, options, PropResidentInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propShare.TryReadProperty(ref reader, options, PropShare, null)) - { - continue; - } - - if (propShareInBytes.TryReadProperty(ref reader, options, PropShareInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotalInBytes.TryReadProperty(ref reader, options, PropTotalInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotalVirtual.TryReadProperty(ref reader, options, PropTotalVirtual, null)) - { - continue; - } - - if (propTotalVirtualInBytes.TryReadProperty(ref reader, options, PropTotalVirtualInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propUsedInBytes.TryReadProperty(ref reader, options, PropUsedInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propUsedPercent.TryReadProperty(ref reader, options, PropUsedPercent, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.ExtendedMemoryStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AdjustedTotalInBytes = propAdjustedTotalInBytes.Value, - FreeInBytes = propFreeInBytes.Value, - FreePercent = propFreePercent.Value, - Resident = propResident.Value, - ResidentInBytes = propResidentInBytes.Value, - Share = propShare.Value, - ShareInBytes = propShareInBytes.Value, - TotalInBytes = propTotalInBytes.Value, - TotalVirtual = propTotalVirtual.Value, - TotalVirtualInBytes = propTotalVirtualInBytes.Value, - UsedInBytes = propUsedInBytes.Value, - UsedPercent = propUsedPercent.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.ExtendedMemoryStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAdjustedTotalInBytes, value.AdjustedTotalInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFreeInBytes, value.FreeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFreePercent, value.FreePercent, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropResident, value.Resident, null, null); - writer.WriteProperty(options, PropResidentInBytes, value.ResidentInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropShare, value.Share, null, null); - writer.WriteProperty(options, PropShareInBytes, value.ShareInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotalInBytes, value.TotalInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotalVirtual, value.TotalVirtual, null, null); - writer.WriteProperty(options, PropTotalVirtualInBytes, value.TotalVirtualInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropUsedInBytes, value.UsedInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropUsedPercent, value.UsedPercent, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.ExtendedMemoryStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.ExtendedMemoryStatsConverter))] public sealed partial class ExtendedMemoryStats { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/FileSystem.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/FileSystem.Converters.g.cs new file mode 100644 index 00000000000..521ed2ddf3b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/FileSystem.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class FileSystemConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropData = System.Text.Json.JsonEncodedText.Encode("data"); + private static readonly System.Text.Json.JsonEncodedText PropIoStats = System.Text.Json.JsonEncodedText.Encode("io_stats"); + private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Nodes.FileSystem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propData = default; + LocalJsonValue propIoStats = default; + LocalJsonValue propTimestamp = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propData.TryReadProperty(ref reader, options, PropData, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propIoStats.TryReadProperty(ref reader, options, PropIoStats, null)) + { + continue; + } + + if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.FileSystem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Data = propData.Value, + IoStats = propIoStats.Value, + Timestamp = propTimestamp.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.FileSystem value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropData, value.Data, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIoStats, value.IoStats, null, null); + writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/FileSystem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/FileSystem.g.cs index 01753213186..5e3eb54a4b0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/FileSystem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/FileSystem.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class FileSystemConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropData = System.Text.Json.JsonEncodedText.Encode("data"); - private static readonly System.Text.Json.JsonEncodedText PropIoStats = System.Text.Json.JsonEncodedText.Encode("io_stats"); - private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Nodes.FileSystem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propData = default; - LocalJsonValue propIoStats = default; - LocalJsonValue propTimestamp = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propData.TryReadProperty(ref reader, options, PropData, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propIoStats.TryReadProperty(ref reader, options, PropIoStats, null)) - { - continue; - } - - if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.FileSystem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Data = propData.Value, - IoStats = propIoStats.Value, - Timestamp = propTimestamp.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.FileSystem value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropData, value.Data, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIoStats, value.IoStats, null, null); - writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.FileSystemConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.FileSystemConverter))] public sealed partial class FileSystem { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/FileSystemTotal.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/FileSystemTotal.Converters.g.cs new file mode 100644 index 00000000000..58dcb6f191b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/FileSystemTotal.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class FileSystemTotalConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); + private static readonly System.Text.Json.JsonEncodedText PropAvailableInBytes = System.Text.Json.JsonEncodedText.Encode("available_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropFree = System.Text.Json.JsonEncodedText.Encode("free"); + private static readonly System.Text.Json.JsonEncodedText PropFreeInBytes = System.Text.Json.JsonEncodedText.Encode("free_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + private static readonly System.Text.Json.JsonEncodedText PropTotalInBytes = System.Text.Json.JsonEncodedText.Encode("total_in_bytes"); + + public override Elastic.Clients.Elasticsearch.Nodes.FileSystemTotal Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvailable = default; + LocalJsonValue propAvailableInBytes = default; + LocalJsonValue propFree = default; + LocalJsonValue propFreeInBytes = default; + LocalJsonValue propTotal = default; + LocalJsonValue propTotalInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) + { + continue; + } + + if (propAvailableInBytes.TryReadProperty(ref reader, options, PropAvailableInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFree.TryReadProperty(ref reader, options, PropFree, null)) + { + continue; + } + + if (propFreeInBytes.TryReadProperty(ref reader, options, PropFreeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (propTotalInBytes.TryReadProperty(ref reader, options, PropTotalInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.FileSystemTotal(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Available = propAvailable.Value, + AvailableInBytes = propAvailableInBytes.Value, + Free = propFree.Value, + FreeInBytes = propFreeInBytes.Value, + Total = propTotal.Value, + TotalInBytes = propTotalInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.FileSystemTotal value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvailable, value.Available, null, null); + writer.WriteProperty(options, PropAvailableInBytes, value.AvailableInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFree, value.Free, null, null); + writer.WriteProperty(options, PropFreeInBytes, value.FreeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteProperty(options, PropTotalInBytes, value.TotalInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/FileSystemTotal.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/FileSystemTotal.g.cs index 04f1bbc4bb5..0294393089d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/FileSystemTotal.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/FileSystemTotal.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class FileSystemTotalConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); - private static readonly System.Text.Json.JsonEncodedText PropAvailableInBytes = System.Text.Json.JsonEncodedText.Encode("available_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropFree = System.Text.Json.JsonEncodedText.Encode("free"); - private static readonly System.Text.Json.JsonEncodedText PropFreeInBytes = System.Text.Json.JsonEncodedText.Encode("free_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - private static readonly System.Text.Json.JsonEncodedText PropTotalInBytes = System.Text.Json.JsonEncodedText.Encode("total_in_bytes"); - - public override Elastic.Clients.Elasticsearch.Nodes.FileSystemTotal Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvailable = default; - LocalJsonValue propAvailableInBytes = default; - LocalJsonValue propFree = default; - LocalJsonValue propFreeInBytes = default; - LocalJsonValue propTotal = default; - LocalJsonValue propTotalInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) - { - continue; - } - - if (propAvailableInBytes.TryReadProperty(ref reader, options, PropAvailableInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFree.TryReadProperty(ref reader, options, PropFree, null)) - { - continue; - } - - if (propFreeInBytes.TryReadProperty(ref reader, options, PropFreeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (propTotalInBytes.TryReadProperty(ref reader, options, PropTotalInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.FileSystemTotal(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Available = propAvailable.Value, - AvailableInBytes = propAvailableInBytes.Value, - Free = propFree.Value, - FreeInBytes = propFreeInBytes.Value, - Total = propTotal.Value, - TotalInBytes = propTotalInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.FileSystemTotal value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvailable, value.Available, null, null); - writer.WriteProperty(options, PropAvailableInBytes, value.AvailableInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFree, value.Free, null, null); - writer.WriteProperty(options, PropFreeInBytes, value.FreeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteProperty(options, PropTotalInBytes, value.TotalInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.FileSystemTotalConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.FileSystemTotalConverter))] public sealed partial class FileSystemTotal { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/GarbageCollector.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/GarbageCollector.Converters.g.cs new file mode 100644 index 00000000000..9bda7bd8c46 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/GarbageCollector.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class GarbageCollectorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCollectors = System.Text.Json.JsonEncodedText.Encode("collectors"); + + public override Elastic.Clients.Elasticsearch.Nodes.GarbageCollector Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propCollectors = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCollectors.TryReadProperty(ref reader, options, PropCollectors, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.GarbageCollector(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Collectors = propCollectors.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.GarbageCollector value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCollectors, value.Collectors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/GarbageCollector.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/GarbageCollector.g.cs index 4bafb501675..6d575b6d4c7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/GarbageCollector.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/GarbageCollector.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class GarbageCollectorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCollectors = System.Text.Json.JsonEncodedText.Encode("collectors"); - - public override Elastic.Clients.Elasticsearch.Nodes.GarbageCollector Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propCollectors = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCollectors.TryReadProperty(ref reader, options, PropCollectors, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.GarbageCollector(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Collectors = propCollectors.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.GarbageCollector value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCollectors, value.Collectors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.GarbageCollectorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.GarbageCollectorConverter))] public sealed partial class GarbageCollector { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/GarbageCollectorTotal.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/GarbageCollectorTotal.Converters.g.cs new file mode 100644 index 00000000000..2499035337c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/GarbageCollectorTotal.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class GarbageCollectorTotalConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCollectionCount = System.Text.Json.JsonEncodedText.Encode("collection_count"); + private static readonly System.Text.Json.JsonEncodedText PropCollectionTime = System.Text.Json.JsonEncodedText.Encode("collection_time"); + private static readonly System.Text.Json.JsonEncodedText PropCollectionTimeInMillis = System.Text.Json.JsonEncodedText.Encode("collection_time_in_millis"); + + public override Elastic.Clients.Elasticsearch.Nodes.GarbageCollectorTotal Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCollectionCount = default; + LocalJsonValue propCollectionTime = default; + LocalJsonValue propCollectionTimeInMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCollectionCount.TryReadProperty(ref reader, options, PropCollectionCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCollectionTime.TryReadProperty(ref reader, options, PropCollectionTime, null)) + { + continue; + } + + if (propCollectionTimeInMillis.TryReadProperty(ref reader, options, PropCollectionTimeInMillis, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.GarbageCollectorTotal(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CollectionCount = propCollectionCount.Value, + CollectionTime = propCollectionTime.Value, + CollectionTimeInMillis = propCollectionTimeInMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.GarbageCollectorTotal value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCollectionCount, value.CollectionCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCollectionTime, value.CollectionTime, null, null); + writer.WriteProperty(options, PropCollectionTimeInMillis, value.CollectionTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/GarbageCollectorTotal.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/GarbageCollectorTotal.g.cs index 04295ce175c..11bb17b19a7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/GarbageCollectorTotal.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/GarbageCollectorTotal.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class GarbageCollectorTotalConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCollectionCount = System.Text.Json.JsonEncodedText.Encode("collection_count"); - private static readonly System.Text.Json.JsonEncodedText PropCollectionTime = System.Text.Json.JsonEncodedText.Encode("collection_time"); - private static readonly System.Text.Json.JsonEncodedText PropCollectionTimeInMillis = System.Text.Json.JsonEncodedText.Encode("collection_time_in_millis"); - - public override Elastic.Clients.Elasticsearch.Nodes.GarbageCollectorTotal Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCollectionCount = default; - LocalJsonValue propCollectionTime = default; - LocalJsonValue propCollectionTimeInMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCollectionCount.TryReadProperty(ref reader, options, PropCollectionCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCollectionTime.TryReadProperty(ref reader, options, PropCollectionTime, null)) - { - continue; - } - - if (propCollectionTimeInMillis.TryReadProperty(ref reader, options, PropCollectionTimeInMillis, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.GarbageCollectorTotal(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CollectionCount = propCollectionCount.Value, - CollectionTime = propCollectionTime.Value, - CollectionTimeInMillis = propCollectionTimeInMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.GarbageCollectorTotal value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCollectionCount, value.CollectionCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCollectionTime, value.CollectionTime, null, null); - writer.WriteProperty(options, PropCollectionTimeInMillis, value.CollectionTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.GarbageCollectorTotalConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.GarbageCollectorTotalConverter))] public sealed partial class GarbageCollectorTotal { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Http.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Http.Converters.g.cs new file mode 100644 index 00000000000..935000e4666 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Http.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class HttpConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClients = System.Text.Json.JsonEncodedText.Encode("clients"); + private static readonly System.Text.Json.JsonEncodedText PropCurrentOpen = System.Text.Json.JsonEncodedText.Encode("current_open"); + private static readonly System.Text.Json.JsonEncodedText PropRoutes = System.Text.Json.JsonEncodedText.Encode("routes"); + private static readonly System.Text.Json.JsonEncodedText PropTotalOpened = System.Text.Json.JsonEncodedText.Encode("total_opened"); + + public override Elastic.Clients.Elasticsearch.Nodes.Http Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propClients = default; + LocalJsonValue propCurrentOpen = default; + LocalJsonValue> propRoutes = default; + LocalJsonValue propTotalOpened = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClients.TryReadProperty(ref reader, options, PropClients, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propCurrentOpen.TryReadProperty(ref reader, options, PropCurrentOpen, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRoutes.TryReadProperty(ref reader, options, PropRoutes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propTotalOpened.TryReadProperty(ref reader, options, PropTotalOpened, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.Http(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Clients = propClients.Value, + CurrentOpen = propCurrentOpen.Value, + Routes = propRoutes.Value, + TotalOpened = propTotalOpened.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Http value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClients, value.Clients, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCurrentOpen, value.CurrentOpen, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRoutes, value.Routes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropTotalOpened, value.TotalOpened, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Http.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Http.g.cs index 15e035f2a80..4cd0184f9d9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Http.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Http.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class HttpConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClients = System.Text.Json.JsonEncodedText.Encode("clients"); - private static readonly System.Text.Json.JsonEncodedText PropCurrentOpen = System.Text.Json.JsonEncodedText.Encode("current_open"); - private static readonly System.Text.Json.JsonEncodedText PropRoutes = System.Text.Json.JsonEncodedText.Encode("routes"); - private static readonly System.Text.Json.JsonEncodedText PropTotalOpened = System.Text.Json.JsonEncodedText.Encode("total_opened"); - - public override Elastic.Clients.Elasticsearch.Nodes.Http Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propClients = default; - LocalJsonValue propCurrentOpen = default; - LocalJsonValue> propRoutes = default; - LocalJsonValue propTotalOpened = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClients.TryReadProperty(ref reader, options, PropClients, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propCurrentOpen.TryReadProperty(ref reader, options, PropCurrentOpen, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRoutes.TryReadProperty(ref reader, options, PropRoutes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propTotalOpened.TryReadProperty(ref reader, options, PropTotalOpened, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.Http(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Clients = propClients.Value, - CurrentOpen = propCurrentOpen.Value, - Routes = propRoutes.Value, - TotalOpened = propTotalOpened.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Http value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClients, value.Clients, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCurrentOpen, value.CurrentOpen, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRoutes, value.Routes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropTotalOpened, value.TotalOpened, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.HttpConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.HttpConverter))] public sealed partial class Http { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/HttpRoute.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/HttpRoute.Converters.g.cs new file mode 100644 index 00000000000..7de727618e7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/HttpRoute.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class HttpRouteConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRequests = System.Text.Json.JsonEncodedText.Encode("requests"); + private static readonly System.Text.Json.JsonEncodedText PropResponses = System.Text.Json.JsonEncodedText.Encode("responses"); + + public override Elastic.Clients.Elasticsearch.Nodes.HttpRoute Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propRequests = default; + LocalJsonValue propResponses = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRequests.TryReadProperty(ref reader, options, PropRequests, null)) + { + continue; + } + + if (propResponses.TryReadProperty(ref reader, options, PropResponses, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.HttpRoute(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Requests = propRequests.Value, + Responses = propResponses.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.HttpRoute value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRequests, value.Requests, null, null); + writer.WriteProperty(options, PropResponses, value.Responses, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/HttpRoute.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/HttpRoute.g.cs index af81213f663..a76c5ec8057 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/HttpRoute.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/HttpRoute.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class HttpRouteConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRequests = System.Text.Json.JsonEncodedText.Encode("requests"); - private static readonly System.Text.Json.JsonEncodedText PropResponses = System.Text.Json.JsonEncodedText.Encode("responses"); - - public override Elastic.Clients.Elasticsearch.Nodes.HttpRoute Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propRequests = default; - LocalJsonValue propResponses = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRequests.TryReadProperty(ref reader, options, PropRequests, null)) - { - continue; - } - - if (propResponses.TryReadProperty(ref reader, options, PropResponses, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.HttpRoute(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Requests = propRequests.Value, - Responses = propResponses.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.HttpRoute value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRequests, value.Requests, null, null); - writer.WriteProperty(options, PropResponses, value.Responses, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.HttpRouteConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.HttpRouteConverter))] public sealed partial class HttpRoute { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/HttpRouteRequests.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/HttpRouteRequests.Converters.g.cs new file mode 100644 index 00000000000..90d3484cd33 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/HttpRouteRequests.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class HttpRouteRequestsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropSizeHistogram = System.Text.Json.JsonEncodedText.Encode("size_histogram"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSizeInBytes = System.Text.Json.JsonEncodedText.Encode("total_size_in_bytes"); + + public override Elastic.Clients.Elasticsearch.Nodes.HttpRouteRequests Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propSizeHistogram = default; + LocalJsonValue propTotalSizeInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propSizeHistogram.TryReadProperty(ref reader, options, PropSizeHistogram, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propTotalSizeInBytes.TryReadProperty(ref reader, options, PropTotalSizeInBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.HttpRouteRequests(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + SizeHistogram = propSizeHistogram.Value, + TotalSizeInBytes = propTotalSizeInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.HttpRouteRequests value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropSizeHistogram, value.SizeHistogram, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTotalSizeInBytes, value.TotalSizeInBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/HttpRouteRequests.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/HttpRouteRequests.g.cs index fe3801894bc..b40fc4ba65b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/HttpRouteRequests.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/HttpRouteRequests.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class HttpRouteRequestsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropSizeHistogram = System.Text.Json.JsonEncodedText.Encode("size_histogram"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSizeInBytes = System.Text.Json.JsonEncodedText.Encode("total_size_in_bytes"); - - public override Elastic.Clients.Elasticsearch.Nodes.HttpRouteRequests Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propSizeHistogram = default; - LocalJsonValue propTotalSizeInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propSizeHistogram.TryReadProperty(ref reader, options, PropSizeHistogram, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propTotalSizeInBytes.TryReadProperty(ref reader, options, PropTotalSizeInBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.HttpRouteRequests(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - SizeHistogram = propSizeHistogram.Value, - TotalSizeInBytes = propTotalSizeInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.HttpRouteRequests value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropSizeHistogram, value.SizeHistogram, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTotalSizeInBytes, value.TotalSizeInBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.HttpRouteRequestsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.HttpRouteRequestsConverter))] public sealed partial class HttpRouteRequests { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/HttpRouteResponses.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/HttpRouteResponses.Converters.g.cs new file mode 100644 index 00000000000..87814881193 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/HttpRouteResponses.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class HttpRouteResponsesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropHandlingTimeHistogram = System.Text.Json.JsonEncodedText.Encode("handling_time_histogram"); + private static readonly System.Text.Json.JsonEncodedText PropSizeHistogram = System.Text.Json.JsonEncodedText.Encode("size_histogram"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSizeInBytes = System.Text.Json.JsonEncodedText.Encode("total_size_in_bytes"); + + public override Elastic.Clients.Elasticsearch.Nodes.HttpRouteResponses Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propHandlingTimeHistogram = default; + LocalJsonValue> propSizeHistogram = default; + LocalJsonValue propTotalSizeInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propHandlingTimeHistogram.TryReadProperty(ref reader, options, PropHandlingTimeHistogram, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propSizeHistogram.TryReadProperty(ref reader, options, PropSizeHistogram, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propTotalSizeInBytes.TryReadProperty(ref reader, options, PropTotalSizeInBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.HttpRouteResponses(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + HandlingTimeHistogram = propHandlingTimeHistogram.Value, + SizeHistogram = propSizeHistogram.Value, + TotalSizeInBytes = propTotalSizeInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.HttpRouteResponses value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropHandlingTimeHistogram, value.HandlingTimeHistogram, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSizeHistogram, value.SizeHistogram, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTotalSizeInBytes, value.TotalSizeInBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/HttpRouteResponses.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/HttpRouteResponses.g.cs index 1365e007d6e..7085c9170c5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/HttpRouteResponses.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/HttpRouteResponses.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class HttpRouteResponsesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropHandlingTimeHistogram = System.Text.Json.JsonEncodedText.Encode("handling_time_histogram"); - private static readonly System.Text.Json.JsonEncodedText PropSizeHistogram = System.Text.Json.JsonEncodedText.Encode("size_histogram"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSizeInBytes = System.Text.Json.JsonEncodedText.Encode("total_size_in_bytes"); - - public override Elastic.Clients.Elasticsearch.Nodes.HttpRouteResponses Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propHandlingTimeHistogram = default; - LocalJsonValue> propSizeHistogram = default; - LocalJsonValue propTotalSizeInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propHandlingTimeHistogram.TryReadProperty(ref reader, options, PropHandlingTimeHistogram, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propSizeHistogram.TryReadProperty(ref reader, options, PropSizeHistogram, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propTotalSizeInBytes.TryReadProperty(ref reader, options, PropTotalSizeInBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.HttpRouteResponses(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - HandlingTimeHistogram = propHandlingTimeHistogram.Value, - SizeHistogram = propSizeHistogram.Value, - TotalSizeInBytes = propTotalSizeInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.HttpRouteResponses value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropHandlingTimeHistogram, value.HandlingTimeHistogram, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSizeHistogram, value.SizeHistogram, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTotalSizeInBytes, value.TotalSizeInBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.HttpRouteResponsesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.HttpRouteResponsesConverter))] public sealed partial class HttpRouteResponses { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IndexingPressure.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IndexingPressure.Converters.g.cs new file mode 100644 index 00000000000..a90193bbd55 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IndexingPressure.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class IndexingPressureConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMemory = System.Text.Json.JsonEncodedText.Encode("memory"); + + public override Elastic.Clients.Elasticsearch.Nodes.IndexingPressure Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMemory = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMemory.TryReadProperty(ref reader, options, PropMemory, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.IndexingPressure(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Memory = propMemory.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.IndexingPressure value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMemory, value.Memory, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IndexingPressure.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IndexingPressure.g.cs index cadbcbd2926..3a5d4d68c3d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IndexingPressure.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IndexingPressure.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class IndexingPressureConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMemory = System.Text.Json.JsonEncodedText.Encode("memory"); - - public override Elastic.Clients.Elasticsearch.Nodes.IndexingPressure Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMemory = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMemory.TryReadProperty(ref reader, options, PropMemory, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.IndexingPressure(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Memory = propMemory.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.IndexingPressure value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMemory, value.Memory, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.IndexingPressureConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.IndexingPressureConverter))] public sealed partial class IndexingPressure { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IndexingPressureMemory.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IndexingPressureMemory.Converters.g.cs new file mode 100644 index 00000000000..6233490575c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IndexingPressureMemory.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class IndexingPressureMemoryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCurrent = System.Text.Json.JsonEncodedText.Encode("current"); + private static readonly System.Text.Json.JsonEncodedText PropLimit = System.Text.Json.JsonEncodedText.Encode("limit"); + private static readonly System.Text.Json.JsonEncodedText PropLimitInBytes = System.Text.Json.JsonEncodedText.Encode("limit_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Nodes.IndexingPressureMemory Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCurrent = default; + LocalJsonValue propLimit = default; + LocalJsonValue propLimitInBytes = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCurrent.TryReadProperty(ref reader, options, PropCurrent, null)) + { + continue; + } + + if (propLimit.TryReadProperty(ref reader, options, PropLimit, null)) + { + continue; + } + + if (propLimitInBytes.TryReadProperty(ref reader, options, PropLimitInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.IndexingPressureMemory(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Current = propCurrent.Value, + Limit = propLimit.Value, + LimitInBytes = propLimitInBytes.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.IndexingPressureMemory value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCurrent, value.Current, null, null); + writer.WriteProperty(options, PropLimit, value.Limit, null, null); + writer.WriteProperty(options, PropLimitInBytes, value.LimitInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IndexingPressureMemory.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IndexingPressureMemory.g.cs index a368fb0e90b..3e0cd72caac 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IndexingPressureMemory.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IndexingPressureMemory.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class IndexingPressureMemoryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCurrent = System.Text.Json.JsonEncodedText.Encode("current"); - private static readonly System.Text.Json.JsonEncodedText PropLimit = System.Text.Json.JsonEncodedText.Encode("limit"); - private static readonly System.Text.Json.JsonEncodedText PropLimitInBytes = System.Text.Json.JsonEncodedText.Encode("limit_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Nodes.IndexingPressureMemory Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCurrent = default; - LocalJsonValue propLimit = default; - LocalJsonValue propLimitInBytes = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCurrent.TryReadProperty(ref reader, options, PropCurrent, null)) - { - continue; - } - - if (propLimit.TryReadProperty(ref reader, options, PropLimit, null)) - { - continue; - } - - if (propLimitInBytes.TryReadProperty(ref reader, options, PropLimitInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.IndexingPressureMemory(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Current = propCurrent.Value, - Limit = propLimit.Value, - LimitInBytes = propLimitInBytes.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.IndexingPressureMemory value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCurrent, value.Current, null, null); - writer.WriteProperty(options, PropLimit, value.Limit, null, null); - writer.WriteProperty(options, PropLimitInBytes, value.LimitInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.IndexingPressureMemoryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.IndexingPressureMemoryConverter))] public sealed partial class IndexingPressureMemory { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Ingest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Ingest.Converters.g.cs new file mode 100644 index 00000000000..4689498a793 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Ingest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class IngestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPipelines = System.Text.Json.JsonEncodedText.Encode("pipelines"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Nodes.Ingest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propPipelines = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPipelines.TryReadProperty(ref reader, options, PropPipelines, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.Ingest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Pipelines = propPipelines.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Ingest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPipelines, value.Pipelines, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Ingest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Ingest.g.cs index e60bfde60cd..aee91b12948 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Ingest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Ingest.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class IngestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPipelines = System.Text.Json.JsonEncodedText.Encode("pipelines"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Nodes.Ingest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propPipelines = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPipelines.TryReadProperty(ref reader, options, PropPipelines, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.Ingest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Pipelines = propPipelines.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Ingest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPipelines, value.Pipelines, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.IngestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.IngestConverter))] public sealed partial class Ingest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IngestStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IngestStats.Converters.g.cs new file mode 100644 index 00000000000..6b91b121c3a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IngestStats.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class IngestStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropCurrent = System.Text.Json.JsonEncodedText.Encode("current"); + private static readonly System.Text.Json.JsonEncodedText PropFailed = System.Text.Json.JsonEncodedText.Encode("failed"); + private static readonly System.Text.Json.JsonEncodedText PropIngestedAsFirstPipelineInBytes = System.Text.Json.JsonEncodedText.Encode("ingested_as_first_pipeline_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropProcessors = System.Text.Json.JsonEncodedText.Encode("processors"); + private static readonly System.Text.Json.JsonEncodedText PropProducedAsFirstPipelineInBytes = System.Text.Json.JsonEncodedText.Encode("produced_as_first_pipeline_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTimeInMillis = System.Text.Json.JsonEncodedText.Encode("time_in_millis"); + + public override Elastic.Clients.Elasticsearch.Nodes.IngestStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propCurrent = default; + LocalJsonValue propFailed = default; + LocalJsonValue propIngestedAsFirstPipelineInBytes = default; + LocalJsonValue>> propProcessors = default; + LocalJsonValue propProducedAsFirstPipelineInBytes = default; + LocalJsonValue propTimeInMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propCurrent.TryReadProperty(ref reader, options, PropCurrent, null)) + { + continue; + } + + if (propFailed.TryReadProperty(ref reader, options, PropFailed, null)) + { + continue; + } + + if (propIngestedAsFirstPipelineInBytes.TryReadProperty(ref reader, options, PropIngestedAsFirstPipelineInBytes, null)) + { + continue; + } + + if (propProcessors.TryReadProperty(ref reader, options, PropProcessors, static System.Collections.Generic.IReadOnlyCollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)!)) + { + continue; + } + + if (propProducedAsFirstPipelineInBytes.TryReadProperty(ref reader, options, PropProducedAsFirstPipelineInBytes, null)) + { + continue; + } + + if (propTimeInMillis.TryReadProperty(ref reader, options, PropTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.IngestStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Current = propCurrent.Value, + Failed = propFailed.Value, + IngestedAsFirstPipelineInBytes = propIngestedAsFirstPipelineInBytes.Value, + Processors = propProcessors.Value, + ProducedAsFirstPipelineInBytes = propProducedAsFirstPipelineInBytes.Value, + TimeInMillis = propTimeInMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.IngestStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropCurrent, value.Current, null, null); + writer.WriteProperty(options, PropFailed, value.Failed, null, null); + writer.WriteProperty(options, PropIngestedAsFirstPipelineInBytes, value.IngestedAsFirstPipelineInBytes, null, null); + writer.WriteProperty(options, PropProcessors, value.Processors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection> v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null))); + writer.WriteProperty(options, PropProducedAsFirstPipelineInBytes, value.ProducedAsFirstPipelineInBytes, null, null); + writer.WriteProperty(options, PropTimeInMillis, value.TimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IngestStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IngestStats.g.cs index f9afe03d76a..cab1afacfde 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IngestStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IngestStats.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class IngestStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropCurrent = System.Text.Json.JsonEncodedText.Encode("current"); - private static readonly System.Text.Json.JsonEncodedText PropFailed = System.Text.Json.JsonEncodedText.Encode("failed"); - private static readonly System.Text.Json.JsonEncodedText PropIngestedAsFirstPipelineInBytes = System.Text.Json.JsonEncodedText.Encode("ingested_as_first_pipeline_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropProcessors = System.Text.Json.JsonEncodedText.Encode("processors"); - private static readonly System.Text.Json.JsonEncodedText PropProducedAsFirstPipelineInBytes = System.Text.Json.JsonEncodedText.Encode("produced_as_first_pipeline_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTimeInMillis = System.Text.Json.JsonEncodedText.Encode("time_in_millis"); - - public override Elastic.Clients.Elasticsearch.Nodes.IngestStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propCurrent = default; - LocalJsonValue propFailed = default; - LocalJsonValue propIngestedAsFirstPipelineInBytes = default; - LocalJsonValue>> propProcessors = default; - LocalJsonValue propProducedAsFirstPipelineInBytes = default; - LocalJsonValue propTimeInMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propCurrent.TryReadProperty(ref reader, options, PropCurrent, null)) - { - continue; - } - - if (propFailed.TryReadProperty(ref reader, options, PropFailed, null)) - { - continue; - } - - if (propIngestedAsFirstPipelineInBytes.TryReadProperty(ref reader, options, PropIngestedAsFirstPipelineInBytes, null)) - { - continue; - } - - if (propProcessors.TryReadProperty(ref reader, options, PropProcessors, static System.Collections.Generic.IReadOnlyCollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)!)) - { - continue; - } - - if (propProducedAsFirstPipelineInBytes.TryReadProperty(ref reader, options, PropProducedAsFirstPipelineInBytes, null)) - { - continue; - } - - if (propTimeInMillis.TryReadProperty(ref reader, options, PropTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.IngestStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Current = propCurrent.Value, - Failed = propFailed.Value, - IngestedAsFirstPipelineInBytes = propIngestedAsFirstPipelineInBytes.Value, - Processors = propProcessors.Value, - ProducedAsFirstPipelineInBytes = propProducedAsFirstPipelineInBytes.Value, - TimeInMillis = propTimeInMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.IngestStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropCurrent, value.Current, null, null); - writer.WriteProperty(options, PropFailed, value.Failed, null, null); - writer.WriteProperty(options, PropIngestedAsFirstPipelineInBytes, value.IngestedAsFirstPipelineInBytes, null, null); - writer.WriteProperty(options, PropProcessors, value.Processors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection> v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null))); - writer.WriteProperty(options, PropProducedAsFirstPipelineInBytes, value.ProducedAsFirstPipelineInBytes, null, null); - writer.WriteProperty(options, PropTimeInMillis, value.TimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.IngestStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.IngestStatsConverter))] public sealed partial class IngestStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IngestTotal.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IngestTotal.Converters.g.cs new file mode 100644 index 00000000000..9672d79c150 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IngestTotal.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class IngestTotalConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropCurrent = System.Text.Json.JsonEncodedText.Encode("current"); + private static readonly System.Text.Json.JsonEncodedText PropFailed = System.Text.Json.JsonEncodedText.Encode("failed"); + private static readonly System.Text.Json.JsonEncodedText PropTimeInMillis = System.Text.Json.JsonEncodedText.Encode("time_in_millis"); + + public override Elastic.Clients.Elasticsearch.Nodes.IngestTotal Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propCurrent = default; + LocalJsonValue propFailed = default; + LocalJsonValue propTimeInMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propCurrent.TryReadProperty(ref reader, options, PropCurrent, null)) + { + continue; + } + + if (propFailed.TryReadProperty(ref reader, options, PropFailed, null)) + { + continue; + } + + if (propTimeInMillis.TryReadProperty(ref reader, options, PropTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.IngestTotal(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Current = propCurrent.Value, + Failed = propFailed.Value, + TimeInMillis = propTimeInMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.IngestTotal value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropCurrent, value.Current, null, null); + writer.WriteProperty(options, PropFailed, value.Failed, null, null); + writer.WriteProperty(options, PropTimeInMillis, value.TimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IngestTotal.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IngestTotal.g.cs index f95c3188193..a5c8889b09d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IngestTotal.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IngestTotal.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class IngestTotalConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropCurrent = System.Text.Json.JsonEncodedText.Encode("current"); - private static readonly System.Text.Json.JsonEncodedText PropFailed = System.Text.Json.JsonEncodedText.Encode("failed"); - private static readonly System.Text.Json.JsonEncodedText PropTimeInMillis = System.Text.Json.JsonEncodedText.Encode("time_in_millis"); - - public override Elastic.Clients.Elasticsearch.Nodes.IngestTotal Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propCurrent = default; - LocalJsonValue propFailed = default; - LocalJsonValue propTimeInMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propCurrent.TryReadProperty(ref reader, options, PropCurrent, null)) - { - continue; - } - - if (propFailed.TryReadProperty(ref reader, options, PropFailed, null)) - { - continue; - } - - if (propTimeInMillis.TryReadProperty(ref reader, options, PropTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.IngestTotal(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Current = propCurrent.Value, - Failed = propFailed.Value, - TimeInMillis = propTimeInMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.IngestTotal value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropCurrent, value.Current, null, null); - writer.WriteProperty(options, PropFailed, value.Failed, null, null); - writer.WriteProperty(options, PropTimeInMillis, value.TimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.IngestTotalConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.IngestTotalConverter))] public sealed partial class IngestTotal { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IoStatDevice.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IoStatDevice.Converters.g.cs new file mode 100644 index 00000000000..b060eb3c713 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IoStatDevice.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class IoStatDeviceConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDeviceName = System.Text.Json.JsonEncodedText.Encode("device_name"); + private static readonly System.Text.Json.JsonEncodedText PropOperations = System.Text.Json.JsonEncodedText.Encode("operations"); + private static readonly System.Text.Json.JsonEncodedText PropReadKilobytes = System.Text.Json.JsonEncodedText.Encode("read_kilobytes"); + private static readonly System.Text.Json.JsonEncodedText PropReadOperations = System.Text.Json.JsonEncodedText.Encode("read_operations"); + private static readonly System.Text.Json.JsonEncodedText PropWriteKilobytes = System.Text.Json.JsonEncodedText.Encode("write_kilobytes"); + private static readonly System.Text.Json.JsonEncodedText PropWriteOperations = System.Text.Json.JsonEncodedText.Encode("write_operations"); + + public override Elastic.Clients.Elasticsearch.Nodes.IoStatDevice Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDeviceName = default; + LocalJsonValue propOperations = default; + LocalJsonValue propReadKilobytes = default; + LocalJsonValue propReadOperations = default; + LocalJsonValue propWriteKilobytes = default; + LocalJsonValue propWriteOperations = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDeviceName.TryReadProperty(ref reader, options, PropDeviceName, null)) + { + continue; + } + + if (propOperations.TryReadProperty(ref reader, options, PropOperations, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propReadKilobytes.TryReadProperty(ref reader, options, PropReadKilobytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propReadOperations.TryReadProperty(ref reader, options, PropReadOperations, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propWriteKilobytes.TryReadProperty(ref reader, options, PropWriteKilobytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propWriteOperations.TryReadProperty(ref reader, options, PropWriteOperations, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.IoStatDevice(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DeviceName = propDeviceName.Value, + Operations = propOperations.Value, + ReadKilobytes = propReadKilobytes.Value, + ReadOperations = propReadOperations.Value, + WriteKilobytes = propWriteKilobytes.Value, + WriteOperations = propWriteOperations.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.IoStatDevice value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDeviceName, value.DeviceName, null, null); + writer.WriteProperty(options, PropOperations, value.Operations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropReadKilobytes, value.ReadKilobytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropReadOperations, value.ReadOperations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropWriteKilobytes, value.WriteKilobytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropWriteOperations, value.WriteOperations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IoStatDevice.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IoStatDevice.g.cs index c4a4b0d5a08..9c4c86c5899 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IoStatDevice.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IoStatDevice.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class IoStatDeviceConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDeviceName = System.Text.Json.JsonEncodedText.Encode("device_name"); - private static readonly System.Text.Json.JsonEncodedText PropOperations = System.Text.Json.JsonEncodedText.Encode("operations"); - private static readonly System.Text.Json.JsonEncodedText PropReadKilobytes = System.Text.Json.JsonEncodedText.Encode("read_kilobytes"); - private static readonly System.Text.Json.JsonEncodedText PropReadOperations = System.Text.Json.JsonEncodedText.Encode("read_operations"); - private static readonly System.Text.Json.JsonEncodedText PropWriteKilobytes = System.Text.Json.JsonEncodedText.Encode("write_kilobytes"); - private static readonly System.Text.Json.JsonEncodedText PropWriteOperations = System.Text.Json.JsonEncodedText.Encode("write_operations"); - - public override Elastic.Clients.Elasticsearch.Nodes.IoStatDevice Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDeviceName = default; - LocalJsonValue propOperations = default; - LocalJsonValue propReadKilobytes = default; - LocalJsonValue propReadOperations = default; - LocalJsonValue propWriteKilobytes = default; - LocalJsonValue propWriteOperations = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDeviceName.TryReadProperty(ref reader, options, PropDeviceName, null)) - { - continue; - } - - if (propOperations.TryReadProperty(ref reader, options, PropOperations, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propReadKilobytes.TryReadProperty(ref reader, options, PropReadKilobytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propReadOperations.TryReadProperty(ref reader, options, PropReadOperations, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propWriteKilobytes.TryReadProperty(ref reader, options, PropWriteKilobytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propWriteOperations.TryReadProperty(ref reader, options, PropWriteOperations, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.IoStatDevice(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DeviceName = propDeviceName.Value, - Operations = propOperations.Value, - ReadKilobytes = propReadKilobytes.Value, - ReadOperations = propReadOperations.Value, - WriteKilobytes = propWriteKilobytes.Value, - WriteOperations = propWriteOperations.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.IoStatDevice value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDeviceName, value.DeviceName, null, null); - writer.WriteProperty(options, PropOperations, value.Operations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropReadKilobytes, value.ReadKilobytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropReadOperations, value.ReadOperations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropWriteKilobytes, value.WriteKilobytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropWriteOperations, value.WriteOperations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.IoStatDeviceConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.IoStatDeviceConverter))] public sealed partial class IoStatDevice { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IoStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IoStats.Converters.g.cs new file mode 100644 index 00000000000..33896eb0c97 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IoStats.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class IoStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDevices = System.Text.Json.JsonEncodedText.Encode("devices"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Nodes.IoStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propDevices = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDevices.TryReadProperty(ref reader, options, PropDevices, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.IoStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Devices = propDevices.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.IoStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDevices, value.Devices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IoStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IoStats.g.cs index 387c3d49c73..7c14e52c61b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IoStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/IoStats.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class IoStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDevices = System.Text.Json.JsonEncodedText.Encode("devices"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Nodes.IoStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propDevices = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDevices.TryReadProperty(ref reader, options, PropDevices, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.IoStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Devices = propDevices.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.IoStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDevices, value.Devices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.IoStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.IoStatsConverter))] public sealed partial class IoStats { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Jvm.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Jvm.Converters.g.cs new file mode 100644 index 00000000000..d69253a0be9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Jvm.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class JvmConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBufferPools = System.Text.Json.JsonEncodedText.Encode("buffer_pools"); + private static readonly System.Text.Json.JsonEncodedText PropClasses = System.Text.Json.JsonEncodedText.Encode("classes"); + private static readonly System.Text.Json.JsonEncodedText PropGc = System.Text.Json.JsonEncodedText.Encode("gc"); + private static readonly System.Text.Json.JsonEncodedText PropMem = System.Text.Json.JsonEncodedText.Encode("mem"); + private static readonly System.Text.Json.JsonEncodedText PropThreads = System.Text.Json.JsonEncodedText.Encode("threads"); + private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); + private static readonly System.Text.Json.JsonEncodedText PropUptime = System.Text.Json.JsonEncodedText.Encode("uptime"); + private static readonly System.Text.Json.JsonEncodedText PropUptimeInMillis = System.Text.Json.JsonEncodedText.Encode("uptime_in_millis"); + + public override Elastic.Clients.Elasticsearch.Nodes.Jvm Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propBufferPools = default; + LocalJsonValue propClasses = default; + LocalJsonValue propGc = default; + LocalJsonValue propMem = default; + LocalJsonValue propThreads = default; + LocalJsonValue propTimestamp = default; + LocalJsonValue propUptime = default; + LocalJsonValue propUptimeInMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBufferPools.TryReadProperty(ref reader, options, PropBufferPools, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propClasses.TryReadProperty(ref reader, options, PropClasses, null)) + { + continue; + } + + if (propGc.TryReadProperty(ref reader, options, PropGc, null)) + { + continue; + } + + if (propMem.TryReadProperty(ref reader, options, PropMem, null)) + { + continue; + } + + if (propThreads.TryReadProperty(ref reader, options, PropThreads, null)) + { + continue; + } + + if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propUptime.TryReadProperty(ref reader, options, PropUptime, null)) + { + continue; + } + + if (propUptimeInMillis.TryReadProperty(ref reader, options, PropUptimeInMillis, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.Jvm(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BufferPools = propBufferPools.Value, + Classes = propClasses.Value, + Gc = propGc.Value, + Mem = propMem.Value, + Threads = propThreads.Value, + Timestamp = propTimestamp.Value, + Uptime = propUptime.Value, + UptimeInMillis = propUptimeInMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Jvm value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBufferPools, value.BufferPools, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropClasses, value.Classes, null, null); + writer.WriteProperty(options, PropGc, value.Gc, null, null); + writer.WriteProperty(options, PropMem, value.Mem, null, null); + writer.WriteProperty(options, PropThreads, value.Threads, null, null); + writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropUptime, value.Uptime, null, null); + writer.WriteProperty(options, PropUptimeInMillis, value.UptimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Jvm.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Jvm.g.cs index 4dca710c2cf..0b9ff7f8a3f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Jvm.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Jvm.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class JvmConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBufferPools = System.Text.Json.JsonEncodedText.Encode("buffer_pools"); - private static readonly System.Text.Json.JsonEncodedText PropClasses = System.Text.Json.JsonEncodedText.Encode("classes"); - private static readonly System.Text.Json.JsonEncodedText PropGc = System.Text.Json.JsonEncodedText.Encode("gc"); - private static readonly System.Text.Json.JsonEncodedText PropMem = System.Text.Json.JsonEncodedText.Encode("mem"); - private static readonly System.Text.Json.JsonEncodedText PropThreads = System.Text.Json.JsonEncodedText.Encode("threads"); - private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); - private static readonly System.Text.Json.JsonEncodedText PropUptime = System.Text.Json.JsonEncodedText.Encode("uptime"); - private static readonly System.Text.Json.JsonEncodedText PropUptimeInMillis = System.Text.Json.JsonEncodedText.Encode("uptime_in_millis"); - - public override Elastic.Clients.Elasticsearch.Nodes.Jvm Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propBufferPools = default; - LocalJsonValue propClasses = default; - LocalJsonValue propGc = default; - LocalJsonValue propMem = default; - LocalJsonValue propThreads = default; - LocalJsonValue propTimestamp = default; - LocalJsonValue propUptime = default; - LocalJsonValue propUptimeInMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBufferPools.TryReadProperty(ref reader, options, PropBufferPools, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propClasses.TryReadProperty(ref reader, options, PropClasses, null)) - { - continue; - } - - if (propGc.TryReadProperty(ref reader, options, PropGc, null)) - { - continue; - } - - if (propMem.TryReadProperty(ref reader, options, PropMem, null)) - { - continue; - } - - if (propThreads.TryReadProperty(ref reader, options, PropThreads, null)) - { - continue; - } - - if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propUptime.TryReadProperty(ref reader, options, PropUptime, null)) - { - continue; - } - - if (propUptimeInMillis.TryReadProperty(ref reader, options, PropUptimeInMillis, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.Jvm(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BufferPools = propBufferPools.Value, - Classes = propClasses.Value, - Gc = propGc.Value, - Mem = propMem.Value, - Threads = propThreads.Value, - Timestamp = propTimestamp.Value, - Uptime = propUptime.Value, - UptimeInMillis = propUptimeInMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Jvm value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBufferPools, value.BufferPools, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropClasses, value.Classes, null, null); - writer.WriteProperty(options, PropGc, value.Gc, null, null); - writer.WriteProperty(options, PropMem, value.Mem, null, null); - writer.WriteProperty(options, PropThreads, value.Threads, null, null); - writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropUptime, value.Uptime, null, null); - writer.WriteProperty(options, PropUptimeInMillis, value.UptimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.JvmConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.JvmConverter))] public sealed partial class Jvm { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmClasses.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmClasses.Converters.g.cs new file mode 100644 index 00000000000..57bc6535266 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmClasses.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class JvmClassesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCurrentLoadedCount = System.Text.Json.JsonEncodedText.Encode("current_loaded_count"); + private static readonly System.Text.Json.JsonEncodedText PropTotalLoadedCount = System.Text.Json.JsonEncodedText.Encode("total_loaded_count"); + private static readonly System.Text.Json.JsonEncodedText PropTotalUnloadedCount = System.Text.Json.JsonEncodedText.Encode("total_unloaded_count"); + + public override Elastic.Clients.Elasticsearch.Nodes.JvmClasses Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCurrentLoadedCount = default; + LocalJsonValue propTotalLoadedCount = default; + LocalJsonValue propTotalUnloadedCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCurrentLoadedCount.TryReadProperty(ref reader, options, PropCurrentLoadedCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotalLoadedCount.TryReadProperty(ref reader, options, PropTotalLoadedCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotalUnloadedCount.TryReadProperty(ref reader, options, PropTotalUnloadedCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.JvmClasses(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CurrentLoadedCount = propCurrentLoadedCount.Value, + TotalLoadedCount = propTotalLoadedCount.Value, + TotalUnloadedCount = propTotalUnloadedCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.JvmClasses value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCurrentLoadedCount, value.CurrentLoadedCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotalLoadedCount, value.TotalLoadedCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotalUnloadedCount, value.TotalUnloadedCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmClasses.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmClasses.g.cs index 540b54f7db8..6f03027150a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmClasses.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmClasses.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class JvmClassesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCurrentLoadedCount = System.Text.Json.JsonEncodedText.Encode("current_loaded_count"); - private static readonly System.Text.Json.JsonEncodedText PropTotalLoadedCount = System.Text.Json.JsonEncodedText.Encode("total_loaded_count"); - private static readonly System.Text.Json.JsonEncodedText PropTotalUnloadedCount = System.Text.Json.JsonEncodedText.Encode("total_unloaded_count"); - - public override Elastic.Clients.Elasticsearch.Nodes.JvmClasses Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCurrentLoadedCount = default; - LocalJsonValue propTotalLoadedCount = default; - LocalJsonValue propTotalUnloadedCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCurrentLoadedCount.TryReadProperty(ref reader, options, PropCurrentLoadedCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotalLoadedCount.TryReadProperty(ref reader, options, PropTotalLoadedCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotalUnloadedCount.TryReadProperty(ref reader, options, PropTotalUnloadedCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.JvmClasses(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CurrentLoadedCount = propCurrentLoadedCount.Value, - TotalLoadedCount = propTotalLoadedCount.Value, - TotalUnloadedCount = propTotalUnloadedCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.JvmClasses value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCurrentLoadedCount, value.CurrentLoadedCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotalLoadedCount, value.TotalLoadedCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotalUnloadedCount, value.TotalUnloadedCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.JvmClassesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.JvmClassesConverter))] public sealed partial class JvmClasses { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmMemoryStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmMemoryStats.Converters.g.cs new file mode 100644 index 00000000000..d90f8f2d3df --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmMemoryStats.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class JvmMemoryStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropHeapCommittedInBytes = System.Text.Json.JsonEncodedText.Encode("heap_committed_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropHeapMax = System.Text.Json.JsonEncodedText.Encode("heap_max"); + private static readonly System.Text.Json.JsonEncodedText PropHeapMaxInBytes = System.Text.Json.JsonEncodedText.Encode("heap_max_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropHeapUsedInBytes = System.Text.Json.JsonEncodedText.Encode("heap_used_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropHeapUsedPercent = System.Text.Json.JsonEncodedText.Encode("heap_used_percent"); + private static readonly System.Text.Json.JsonEncodedText PropNonHeapCommittedInBytes = System.Text.Json.JsonEncodedText.Encode("non_heap_committed_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropNonHeapUsedInBytes = System.Text.Json.JsonEncodedText.Encode("non_heap_used_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropPools = System.Text.Json.JsonEncodedText.Encode("pools"); + + public override Elastic.Clients.Elasticsearch.Nodes.JvmMemoryStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propHeapCommittedInBytes = default; + LocalJsonValue propHeapMax = default; + LocalJsonValue propHeapMaxInBytes = default; + LocalJsonValue propHeapUsedInBytes = default; + LocalJsonValue propHeapUsedPercent = default; + LocalJsonValue propNonHeapCommittedInBytes = default; + LocalJsonValue propNonHeapUsedInBytes = default; + LocalJsonValue?> propPools = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propHeapCommittedInBytes.TryReadProperty(ref reader, options, PropHeapCommittedInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propHeapMax.TryReadProperty(ref reader, options, PropHeapMax, null)) + { + continue; + } + + if (propHeapMaxInBytes.TryReadProperty(ref reader, options, PropHeapMaxInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propHeapUsedInBytes.TryReadProperty(ref reader, options, PropHeapUsedInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propHeapUsedPercent.TryReadProperty(ref reader, options, PropHeapUsedPercent, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNonHeapCommittedInBytes.TryReadProperty(ref reader, options, PropNonHeapCommittedInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNonHeapUsedInBytes.TryReadProperty(ref reader, options, PropNonHeapUsedInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPools.TryReadProperty(ref reader, options, PropPools, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.JvmMemoryStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + HeapCommittedInBytes = propHeapCommittedInBytes.Value, + HeapMax = propHeapMax.Value, + HeapMaxInBytes = propHeapMaxInBytes.Value, + HeapUsedInBytes = propHeapUsedInBytes.Value, + HeapUsedPercent = propHeapUsedPercent.Value, + NonHeapCommittedInBytes = propNonHeapCommittedInBytes.Value, + NonHeapUsedInBytes = propNonHeapUsedInBytes.Value, + Pools = propPools.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.JvmMemoryStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropHeapCommittedInBytes, value.HeapCommittedInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropHeapMax, value.HeapMax, null, null); + writer.WriteProperty(options, PropHeapMaxInBytes, value.HeapMaxInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropHeapUsedInBytes, value.HeapUsedInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropHeapUsedPercent, value.HeapUsedPercent, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNonHeapCommittedInBytes, value.NonHeapCommittedInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNonHeapUsedInBytes, value.NonHeapUsedInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPools, value.Pools, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmMemoryStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmMemoryStats.g.cs index ee268382d7a..f2f8286c3d7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmMemoryStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmMemoryStats.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class JvmMemoryStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropHeapCommittedInBytes = System.Text.Json.JsonEncodedText.Encode("heap_committed_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropHeapMax = System.Text.Json.JsonEncodedText.Encode("heap_max"); - private static readonly System.Text.Json.JsonEncodedText PropHeapMaxInBytes = System.Text.Json.JsonEncodedText.Encode("heap_max_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropHeapUsedInBytes = System.Text.Json.JsonEncodedText.Encode("heap_used_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropHeapUsedPercent = System.Text.Json.JsonEncodedText.Encode("heap_used_percent"); - private static readonly System.Text.Json.JsonEncodedText PropNonHeapCommittedInBytes = System.Text.Json.JsonEncodedText.Encode("non_heap_committed_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropNonHeapUsedInBytes = System.Text.Json.JsonEncodedText.Encode("non_heap_used_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropPools = System.Text.Json.JsonEncodedText.Encode("pools"); - - public override Elastic.Clients.Elasticsearch.Nodes.JvmMemoryStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propHeapCommittedInBytes = default; - LocalJsonValue propHeapMax = default; - LocalJsonValue propHeapMaxInBytes = default; - LocalJsonValue propHeapUsedInBytes = default; - LocalJsonValue propHeapUsedPercent = default; - LocalJsonValue propNonHeapCommittedInBytes = default; - LocalJsonValue propNonHeapUsedInBytes = default; - LocalJsonValue?> propPools = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propHeapCommittedInBytes.TryReadProperty(ref reader, options, PropHeapCommittedInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propHeapMax.TryReadProperty(ref reader, options, PropHeapMax, null)) - { - continue; - } - - if (propHeapMaxInBytes.TryReadProperty(ref reader, options, PropHeapMaxInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propHeapUsedInBytes.TryReadProperty(ref reader, options, PropHeapUsedInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propHeapUsedPercent.TryReadProperty(ref reader, options, PropHeapUsedPercent, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNonHeapCommittedInBytes.TryReadProperty(ref reader, options, PropNonHeapCommittedInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNonHeapUsedInBytes.TryReadProperty(ref reader, options, PropNonHeapUsedInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPools.TryReadProperty(ref reader, options, PropPools, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.JvmMemoryStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - HeapCommittedInBytes = propHeapCommittedInBytes.Value, - HeapMax = propHeapMax.Value, - HeapMaxInBytes = propHeapMaxInBytes.Value, - HeapUsedInBytes = propHeapUsedInBytes.Value, - HeapUsedPercent = propHeapUsedPercent.Value, - NonHeapCommittedInBytes = propNonHeapCommittedInBytes.Value, - NonHeapUsedInBytes = propNonHeapUsedInBytes.Value, - Pools = propPools.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.JvmMemoryStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropHeapCommittedInBytes, value.HeapCommittedInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropHeapMax, value.HeapMax, null, null); - writer.WriteProperty(options, PropHeapMaxInBytes, value.HeapMaxInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropHeapUsedInBytes, value.HeapUsedInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropHeapUsedPercent, value.HeapUsedPercent, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNonHeapCommittedInBytes, value.NonHeapCommittedInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNonHeapUsedInBytes, value.NonHeapUsedInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPools, value.Pools, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.JvmMemoryStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.JvmMemoryStatsConverter))] public sealed partial class JvmMemoryStats { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmThreads.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmThreads.Converters.g.cs new file mode 100644 index 00000000000..aa17cc47754 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmThreads.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class JvmThreadsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropPeakCount = System.Text.Json.JsonEncodedText.Encode("peak_count"); + + public override Elastic.Clients.Elasticsearch.Nodes.JvmThreads Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propPeakCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPeakCount.TryReadProperty(ref reader, options, PropPeakCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.JvmThreads(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + PeakCount = propPeakCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.JvmThreads value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPeakCount, value.PeakCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmThreads.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmThreads.g.cs index 2b7c6b6a2cd..dc17c2b465e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmThreads.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/JvmThreads.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class JvmThreadsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropPeakCount = System.Text.Json.JsonEncodedText.Encode("peak_count"); - - public override Elastic.Clients.Elasticsearch.Nodes.JvmThreads Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propPeakCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPeakCount.TryReadProperty(ref reader, options, PropPeakCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.JvmThreads(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - PeakCount = propPeakCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.JvmThreads value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPeakCount, value.PeakCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.JvmThreadsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.JvmThreadsConverter))] public sealed partial class JvmThreads { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/KeyedProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/KeyedProcessor.Converters.g.cs new file mode 100644 index 00000000000..21a858ab3c5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/KeyedProcessor.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class KeyedProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStats = System.Text.Json.JsonEncodedText.Encode("stats"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Nodes.KeyedProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propStats = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStats.TryReadProperty(ref reader, options, PropStats, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.KeyedProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Stats = propStats.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.KeyedProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStats, value.Stats, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/KeyedProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/KeyedProcessor.g.cs index 58912b8dfb1..b6bfbad7f4b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/KeyedProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/KeyedProcessor.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class KeyedProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStats = System.Text.Json.JsonEncodedText.Encode("stats"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Nodes.KeyedProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propStats = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStats.TryReadProperty(ref reader, options, PropStats, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.KeyedProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Stats = propStats.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.KeyedProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStats, value.Stats, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.KeyedProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.KeyedProcessorConverter))] public sealed partial class KeyedProcessor { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/MemoryStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/MemoryStats.Converters.g.cs new file mode 100644 index 00000000000..5f5579cbb20 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/MemoryStats.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class MemoryStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAdjustedTotalInBytes = System.Text.Json.JsonEncodedText.Encode("adjusted_total_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropFreeInBytes = System.Text.Json.JsonEncodedText.Encode("free_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropResident = System.Text.Json.JsonEncodedText.Encode("resident"); + private static readonly System.Text.Json.JsonEncodedText PropResidentInBytes = System.Text.Json.JsonEncodedText.Encode("resident_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropShare = System.Text.Json.JsonEncodedText.Encode("share"); + private static readonly System.Text.Json.JsonEncodedText PropShareInBytes = System.Text.Json.JsonEncodedText.Encode("share_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTotalInBytes = System.Text.Json.JsonEncodedText.Encode("total_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTotalVirtual = System.Text.Json.JsonEncodedText.Encode("total_virtual"); + private static readonly System.Text.Json.JsonEncodedText PropTotalVirtualInBytes = System.Text.Json.JsonEncodedText.Encode("total_virtual_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropUsedInBytes = System.Text.Json.JsonEncodedText.Encode("used_in_bytes"); + + public override Elastic.Clients.Elasticsearch.Nodes.MemoryStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAdjustedTotalInBytes = default; + LocalJsonValue propFreeInBytes = default; + LocalJsonValue propResident = default; + LocalJsonValue propResidentInBytes = default; + LocalJsonValue propShare = default; + LocalJsonValue propShareInBytes = default; + LocalJsonValue propTotalInBytes = default; + LocalJsonValue propTotalVirtual = default; + LocalJsonValue propTotalVirtualInBytes = default; + LocalJsonValue propUsedInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAdjustedTotalInBytes.TryReadProperty(ref reader, options, PropAdjustedTotalInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFreeInBytes.TryReadProperty(ref reader, options, PropFreeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propResident.TryReadProperty(ref reader, options, PropResident, null)) + { + continue; + } + + if (propResidentInBytes.TryReadProperty(ref reader, options, PropResidentInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propShare.TryReadProperty(ref reader, options, PropShare, null)) + { + continue; + } + + if (propShareInBytes.TryReadProperty(ref reader, options, PropShareInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotalInBytes.TryReadProperty(ref reader, options, PropTotalInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotalVirtual.TryReadProperty(ref reader, options, PropTotalVirtual, null)) + { + continue; + } + + if (propTotalVirtualInBytes.TryReadProperty(ref reader, options, PropTotalVirtualInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propUsedInBytes.TryReadProperty(ref reader, options, PropUsedInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.MemoryStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AdjustedTotalInBytes = propAdjustedTotalInBytes.Value, + FreeInBytes = propFreeInBytes.Value, + Resident = propResident.Value, + ResidentInBytes = propResidentInBytes.Value, + Share = propShare.Value, + ShareInBytes = propShareInBytes.Value, + TotalInBytes = propTotalInBytes.Value, + TotalVirtual = propTotalVirtual.Value, + TotalVirtualInBytes = propTotalVirtualInBytes.Value, + UsedInBytes = propUsedInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.MemoryStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAdjustedTotalInBytes, value.AdjustedTotalInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFreeInBytes, value.FreeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropResident, value.Resident, null, null); + writer.WriteProperty(options, PropResidentInBytes, value.ResidentInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropShare, value.Share, null, null); + writer.WriteProperty(options, PropShareInBytes, value.ShareInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotalInBytes, value.TotalInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotalVirtual, value.TotalVirtual, null, null); + writer.WriteProperty(options, PropTotalVirtualInBytes, value.TotalVirtualInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropUsedInBytes, value.UsedInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/MemoryStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/MemoryStats.g.cs index ae85cf96e09..dda9e759960 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/MemoryStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/MemoryStats.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class MemoryStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAdjustedTotalInBytes = System.Text.Json.JsonEncodedText.Encode("adjusted_total_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropFreeInBytes = System.Text.Json.JsonEncodedText.Encode("free_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropResident = System.Text.Json.JsonEncodedText.Encode("resident"); - private static readonly System.Text.Json.JsonEncodedText PropResidentInBytes = System.Text.Json.JsonEncodedText.Encode("resident_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropShare = System.Text.Json.JsonEncodedText.Encode("share"); - private static readonly System.Text.Json.JsonEncodedText PropShareInBytes = System.Text.Json.JsonEncodedText.Encode("share_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTotalInBytes = System.Text.Json.JsonEncodedText.Encode("total_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTotalVirtual = System.Text.Json.JsonEncodedText.Encode("total_virtual"); - private static readonly System.Text.Json.JsonEncodedText PropTotalVirtualInBytes = System.Text.Json.JsonEncodedText.Encode("total_virtual_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropUsedInBytes = System.Text.Json.JsonEncodedText.Encode("used_in_bytes"); - - public override Elastic.Clients.Elasticsearch.Nodes.MemoryStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAdjustedTotalInBytes = default; - LocalJsonValue propFreeInBytes = default; - LocalJsonValue propResident = default; - LocalJsonValue propResidentInBytes = default; - LocalJsonValue propShare = default; - LocalJsonValue propShareInBytes = default; - LocalJsonValue propTotalInBytes = default; - LocalJsonValue propTotalVirtual = default; - LocalJsonValue propTotalVirtualInBytes = default; - LocalJsonValue propUsedInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAdjustedTotalInBytes.TryReadProperty(ref reader, options, PropAdjustedTotalInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFreeInBytes.TryReadProperty(ref reader, options, PropFreeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propResident.TryReadProperty(ref reader, options, PropResident, null)) - { - continue; - } - - if (propResidentInBytes.TryReadProperty(ref reader, options, PropResidentInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propShare.TryReadProperty(ref reader, options, PropShare, null)) - { - continue; - } - - if (propShareInBytes.TryReadProperty(ref reader, options, PropShareInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotalInBytes.TryReadProperty(ref reader, options, PropTotalInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotalVirtual.TryReadProperty(ref reader, options, PropTotalVirtual, null)) - { - continue; - } - - if (propTotalVirtualInBytes.TryReadProperty(ref reader, options, PropTotalVirtualInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propUsedInBytes.TryReadProperty(ref reader, options, PropUsedInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.MemoryStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AdjustedTotalInBytes = propAdjustedTotalInBytes.Value, - FreeInBytes = propFreeInBytes.Value, - Resident = propResident.Value, - ResidentInBytes = propResidentInBytes.Value, - Share = propShare.Value, - ShareInBytes = propShareInBytes.Value, - TotalInBytes = propTotalInBytes.Value, - TotalVirtual = propTotalVirtual.Value, - TotalVirtualInBytes = propTotalVirtualInBytes.Value, - UsedInBytes = propUsedInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.MemoryStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAdjustedTotalInBytes, value.AdjustedTotalInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFreeInBytes, value.FreeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropResident, value.Resident, null, null); - writer.WriteProperty(options, PropResidentInBytes, value.ResidentInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropShare, value.Share, null, null); - writer.WriteProperty(options, PropShareInBytes, value.ShareInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotalInBytes, value.TotalInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotalVirtual, value.TotalVirtual, null, null); - writer.WriteProperty(options, PropTotalVirtualInBytes, value.TotalVirtualInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropUsedInBytes, value.UsedInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.MemoryStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.MemoryStatsConverter))] public sealed partial class MemoryStats { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeBufferPool.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeBufferPool.Converters.g.cs new file mode 100644 index 00000000000..b8179d3a94b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeBufferPool.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeBufferPoolConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropTotalCapacity = System.Text.Json.JsonEncodedText.Encode("total_capacity"); + private static readonly System.Text.Json.JsonEncodedText PropTotalCapacityInBytes = System.Text.Json.JsonEncodedText.Encode("total_capacity_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropUsed = System.Text.Json.JsonEncodedText.Encode("used"); + private static readonly System.Text.Json.JsonEncodedText PropUsedInBytes = System.Text.Json.JsonEncodedText.Encode("used_in_bytes"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeBufferPool Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propTotalCapacity = default; + LocalJsonValue propTotalCapacityInBytes = default; + LocalJsonValue propUsed = default; + LocalJsonValue propUsedInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotalCapacity.TryReadProperty(ref reader, options, PropTotalCapacity, null)) + { + continue; + } + + if (propTotalCapacityInBytes.TryReadProperty(ref reader, options, PropTotalCapacityInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propUsed.TryReadProperty(ref reader, options, PropUsed, null)) + { + continue; + } + + if (propUsedInBytes.TryReadProperty(ref reader, options, PropUsedInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeBufferPool(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + TotalCapacity = propTotalCapacity.Value, + TotalCapacityInBytes = propTotalCapacityInBytes.Value, + Used = propUsed.Value, + UsedInBytes = propUsedInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeBufferPool value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotalCapacity, value.TotalCapacity, null, null); + writer.WriteProperty(options, PropTotalCapacityInBytes, value.TotalCapacityInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropUsed, value.Used, null, null); + writer.WriteProperty(options, PropUsedInBytes, value.UsedInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeBufferPool.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeBufferPool.g.cs index 512f68d9492..022c733fe00 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeBufferPool.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeBufferPool.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeBufferPoolConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropTotalCapacity = System.Text.Json.JsonEncodedText.Encode("total_capacity"); - private static readonly System.Text.Json.JsonEncodedText PropTotalCapacityInBytes = System.Text.Json.JsonEncodedText.Encode("total_capacity_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropUsed = System.Text.Json.JsonEncodedText.Encode("used"); - private static readonly System.Text.Json.JsonEncodedText PropUsedInBytes = System.Text.Json.JsonEncodedText.Encode("used_in_bytes"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeBufferPool Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propTotalCapacity = default; - LocalJsonValue propTotalCapacityInBytes = default; - LocalJsonValue propUsed = default; - LocalJsonValue propUsedInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotalCapacity.TryReadProperty(ref reader, options, PropTotalCapacity, null)) - { - continue; - } - - if (propTotalCapacityInBytes.TryReadProperty(ref reader, options, PropTotalCapacityInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propUsed.TryReadProperty(ref reader, options, PropUsed, null)) - { - continue; - } - - if (propUsedInBytes.TryReadProperty(ref reader, options, PropUsedInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeBufferPool(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - TotalCapacity = propTotalCapacity.Value, - TotalCapacityInBytes = propTotalCapacityInBytes.Value, - Used = propUsed.Value, - UsedInBytes = propUsedInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeBufferPool value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotalCapacity, value.TotalCapacity, null, null); - writer.WriteProperty(options, PropTotalCapacityInBytes, value.TotalCapacityInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropUsed, value.Used, null, null); - writer.WriteProperty(options, PropUsedInBytes, value.UsedInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeBufferPoolConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeBufferPoolConverter))] public sealed partial class NodeBufferPool { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfo.Converters.g.cs new file mode 100644 index 00000000000..4c95f154382 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfo.Converters.g.cs @@ -0,0 +1,297 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); + private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); + private static readonly System.Text.Json.JsonEncodedText PropBuildFlavor = System.Text.Json.JsonEncodedText.Encode("build_flavor"); + private static readonly System.Text.Json.JsonEncodedText PropBuildHash = System.Text.Json.JsonEncodedText.Encode("build_hash"); + private static readonly System.Text.Json.JsonEncodedText PropBuildType = System.Text.Json.JsonEncodedText.Encode("build_type"); + private static readonly System.Text.Json.JsonEncodedText PropComponentVersions = System.Text.Json.JsonEncodedText.Encode("component_versions"); + private static readonly System.Text.Json.JsonEncodedText PropHost = System.Text.Json.JsonEncodedText.Encode("host"); + private static readonly System.Text.Json.JsonEncodedText PropHttp = System.Text.Json.JsonEncodedText.Encode("http"); + private static readonly System.Text.Json.JsonEncodedText PropIndexVersion = System.Text.Json.JsonEncodedText.Encode("index_version"); + private static readonly System.Text.Json.JsonEncodedText PropIngest = System.Text.Json.JsonEncodedText.Encode("ingest"); + private static readonly System.Text.Json.JsonEncodedText PropIp = System.Text.Json.JsonEncodedText.Encode("ip"); + private static readonly System.Text.Json.JsonEncodedText PropJvm = System.Text.Json.JsonEncodedText.Encode("jvm"); + private static readonly System.Text.Json.JsonEncodedText PropModules = System.Text.Json.JsonEncodedText.Encode("modules"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropOs = System.Text.Json.JsonEncodedText.Encode("os"); + private static readonly System.Text.Json.JsonEncodedText PropPlugins = System.Text.Json.JsonEncodedText.Encode("plugins"); + private static readonly System.Text.Json.JsonEncodedText PropProcess = System.Text.Json.JsonEncodedText.Encode("process"); + private static readonly System.Text.Json.JsonEncodedText PropRemoteClusterServer = System.Text.Json.JsonEncodedText.Encode("remote_cluster_server"); + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + private static readonly System.Text.Json.JsonEncodedText PropThreadPool = System.Text.Json.JsonEncodedText.Encode("thread_pool"); + private static readonly System.Text.Json.JsonEncodedText PropTotalIndexingBuffer = System.Text.Json.JsonEncodedText.Encode("total_indexing_buffer"); + private static readonly System.Text.Json.JsonEncodedText PropTotalIndexingBufferInBytes = System.Text.Json.JsonEncodedText.Encode("total_indexing_buffer_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTransport = System.Text.Json.JsonEncodedText.Encode("transport"); + private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); + private static readonly System.Text.Json.JsonEncodedText PropTransportVersion = System.Text.Json.JsonEncodedText.Encode("transport_version"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAggregations = default; + LocalJsonValue> propAttributes = default; + LocalJsonValue propBuildFlavor = default; + LocalJsonValue propBuildHash = default; + LocalJsonValue propBuildType = default; + LocalJsonValue> propComponentVersions = default; + LocalJsonValue propHost = default; + LocalJsonValue propHttp = default; + LocalJsonValue propIndexVersion = default; + LocalJsonValue propIngest = default; + LocalJsonValue propIp = default; + LocalJsonValue propJvm = default; + LocalJsonValue?> propModules = default; + LocalJsonValue propName = default; + LocalJsonValue propOs = default; + LocalJsonValue?> propPlugins = default; + LocalJsonValue propProcess = default; + LocalJsonValue propRemoteClusterServer = default; + LocalJsonValue> propRoles = default; + LocalJsonValue propSettings = default; + LocalJsonValue?> propThreadPool = default; + LocalJsonValue propTotalIndexingBuffer = default; + LocalJsonValue propTotalIndexingBufferInBytes = default; + LocalJsonValue propTransport = default; + LocalJsonValue propTransportAddress = default; + LocalJsonValue propTransportVersion = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propBuildFlavor.TryReadProperty(ref reader, options, PropBuildFlavor, null)) + { + continue; + } + + if (propBuildHash.TryReadProperty(ref reader, options, PropBuildHash, null)) + { + continue; + } + + if (propBuildType.TryReadProperty(ref reader, options, PropBuildType, null)) + { + continue; + } + + if (propComponentVersions.TryReadProperty(ref reader, options, PropComponentVersions, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propHost.TryReadProperty(ref reader, options, PropHost, null)) + { + continue; + } + + if (propHttp.TryReadProperty(ref reader, options, PropHttp, null)) + { + continue; + } + + if (propIndexVersion.TryReadProperty(ref reader, options, PropIndexVersion, null)) + { + continue; + } + + if (propIngest.TryReadProperty(ref reader, options, PropIngest, null)) + { + continue; + } + + if (propIp.TryReadProperty(ref reader, options, PropIp, null)) + { + continue; + } + + if (propJvm.TryReadProperty(ref reader, options, PropJvm, null)) + { + continue; + } + + if (propModules.TryReadProperty(ref reader, options, PropModules, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propOs.TryReadProperty(ref reader, options, PropOs, null)) + { + continue; + } + + if (propPlugins.TryReadProperty(ref reader, options, PropPlugins, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propProcess.TryReadProperty(ref reader, options, PropProcess, null)) + { + continue; + } + + if (propRemoteClusterServer.TryReadProperty(ref reader, options, PropRemoteClusterServer, null)) + { + continue; + } + + if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) + { + continue; + } + + if (propThreadPool.TryReadProperty(ref reader, options, PropThreadPool, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propTotalIndexingBuffer.TryReadProperty(ref reader, options, PropTotalIndexingBuffer, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotalIndexingBufferInBytes.TryReadProperty(ref reader, options, PropTotalIndexingBufferInBytes, null)) + { + continue; + } + + if (propTransport.TryReadProperty(ref reader, options, PropTransport, null)) + { + continue; + } + + if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) + { + continue; + } + + if (propTransportVersion.TryReadProperty(ref reader, options, PropTransportVersion, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = propAggregations.Value, + Attributes = propAttributes.Value, + BuildFlavor = propBuildFlavor.Value, + BuildHash = propBuildHash.Value, + BuildType = propBuildType.Value, + ComponentVersions = propComponentVersions.Value, + Host = propHost.Value, + Http = propHttp.Value, + IndexVersion = propIndexVersion.Value, + Ingest = propIngest.Value, + Ip = propIp.Value, + Jvm = propJvm.Value, + Modules = propModules.Value, + Name = propName.Value, + Os = propOs.Value, + Plugins = propPlugins.Value, + Process = propProcess.Value, + RemoteClusterServer = propRemoteClusterServer.Value, + Roles = propRoles.Value, + Settings = propSettings.Value, + ThreadPool = propThreadPool.Value, + TotalIndexingBuffer = propTotalIndexingBuffer.Value, + TotalIndexingBufferInBytes = propTotalIndexingBufferInBytes.Value, + Transport = propTransport.Value, + TransportAddress = propTransportAddress.Value, + TransportVersion = propTransportVersion.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropBuildFlavor, value.BuildFlavor, null, null); + writer.WriteProperty(options, PropBuildHash, value.BuildHash, null, null); + writer.WriteProperty(options, PropBuildType, value.BuildType, null, null); + writer.WriteProperty(options, PropComponentVersions, value.ComponentVersions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropHost, value.Host, null, null); + writer.WriteProperty(options, PropHttp, value.Http, null, null); + writer.WriteProperty(options, PropIndexVersion, value.IndexVersion, null, null); + writer.WriteProperty(options, PropIngest, value.Ingest, null, null); + writer.WriteProperty(options, PropIp, value.Ip, null, null); + writer.WriteProperty(options, PropJvm, value.Jvm, null, null); + writer.WriteProperty(options, PropModules, value.Modules, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropOs, value.Os, null, null); + writer.WriteProperty(options, PropPlugins, value.Plugins, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropProcess, value.Process, null, null); + writer.WriteProperty(options, PropRemoteClusterServer, value.RemoteClusterServer, null, null); + writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSettings, value.Settings, null, null); + writer.WriteProperty(options, PropThreadPool, value.ThreadPool, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropTotalIndexingBuffer, value.TotalIndexingBuffer, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotalIndexingBufferInBytes, value.TotalIndexingBufferInBytes, null, null); + writer.WriteProperty(options, PropTransport, value.Transport, null, null); + writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); + writer.WriteProperty(options, PropTransportVersion, value.TransportVersion, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfo.g.cs index 322aa699ec6..cc43e66e1c9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfo.g.cs @@ -23,280 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); - private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); - private static readonly System.Text.Json.JsonEncodedText PropBuildFlavor = System.Text.Json.JsonEncodedText.Encode("build_flavor"); - private static readonly System.Text.Json.JsonEncodedText PropBuildHash = System.Text.Json.JsonEncodedText.Encode("build_hash"); - private static readonly System.Text.Json.JsonEncodedText PropBuildType = System.Text.Json.JsonEncodedText.Encode("build_type"); - private static readonly System.Text.Json.JsonEncodedText PropComponentVersions = System.Text.Json.JsonEncodedText.Encode("component_versions"); - private static readonly System.Text.Json.JsonEncodedText PropHost = System.Text.Json.JsonEncodedText.Encode("host"); - private static readonly System.Text.Json.JsonEncodedText PropHttp = System.Text.Json.JsonEncodedText.Encode("http"); - private static readonly System.Text.Json.JsonEncodedText PropIndexVersion = System.Text.Json.JsonEncodedText.Encode("index_version"); - private static readonly System.Text.Json.JsonEncodedText PropIngest = System.Text.Json.JsonEncodedText.Encode("ingest"); - private static readonly System.Text.Json.JsonEncodedText PropIp = System.Text.Json.JsonEncodedText.Encode("ip"); - private static readonly System.Text.Json.JsonEncodedText PropJvm = System.Text.Json.JsonEncodedText.Encode("jvm"); - private static readonly System.Text.Json.JsonEncodedText PropModules = System.Text.Json.JsonEncodedText.Encode("modules"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropOs = System.Text.Json.JsonEncodedText.Encode("os"); - private static readonly System.Text.Json.JsonEncodedText PropPlugins = System.Text.Json.JsonEncodedText.Encode("plugins"); - private static readonly System.Text.Json.JsonEncodedText PropProcess = System.Text.Json.JsonEncodedText.Encode("process"); - private static readonly System.Text.Json.JsonEncodedText PropRemoteClusterServer = System.Text.Json.JsonEncodedText.Encode("remote_cluster_server"); - private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - private static readonly System.Text.Json.JsonEncodedText PropThreadPool = System.Text.Json.JsonEncodedText.Encode("thread_pool"); - private static readonly System.Text.Json.JsonEncodedText PropTotalIndexingBuffer = System.Text.Json.JsonEncodedText.Encode("total_indexing_buffer"); - private static readonly System.Text.Json.JsonEncodedText PropTotalIndexingBufferInBytes = System.Text.Json.JsonEncodedText.Encode("total_indexing_buffer_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTransport = System.Text.Json.JsonEncodedText.Encode("transport"); - private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); - private static readonly System.Text.Json.JsonEncodedText PropTransportVersion = System.Text.Json.JsonEncodedText.Encode("transport_version"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAggregations = default; - LocalJsonValue> propAttributes = default; - LocalJsonValue propBuildFlavor = default; - LocalJsonValue propBuildHash = default; - LocalJsonValue propBuildType = default; - LocalJsonValue> propComponentVersions = default; - LocalJsonValue propHost = default; - LocalJsonValue propHttp = default; - LocalJsonValue propIndexVersion = default; - LocalJsonValue propIngest = default; - LocalJsonValue propIp = default; - LocalJsonValue propJvm = default; - LocalJsonValue?> propModules = default; - LocalJsonValue propName = default; - LocalJsonValue propOs = default; - LocalJsonValue?> propPlugins = default; - LocalJsonValue propProcess = default; - LocalJsonValue propRemoteClusterServer = default; - LocalJsonValue> propRoles = default; - LocalJsonValue propSettings = default; - LocalJsonValue?> propThreadPool = default; - LocalJsonValue propTotalIndexingBuffer = default; - LocalJsonValue propTotalIndexingBufferInBytes = default; - LocalJsonValue propTransport = default; - LocalJsonValue propTransportAddress = default; - LocalJsonValue propTransportVersion = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propBuildFlavor.TryReadProperty(ref reader, options, PropBuildFlavor, null)) - { - continue; - } - - if (propBuildHash.TryReadProperty(ref reader, options, PropBuildHash, null)) - { - continue; - } - - if (propBuildType.TryReadProperty(ref reader, options, PropBuildType, null)) - { - continue; - } - - if (propComponentVersions.TryReadProperty(ref reader, options, PropComponentVersions, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propHost.TryReadProperty(ref reader, options, PropHost, null)) - { - continue; - } - - if (propHttp.TryReadProperty(ref reader, options, PropHttp, null)) - { - continue; - } - - if (propIndexVersion.TryReadProperty(ref reader, options, PropIndexVersion, null)) - { - continue; - } - - if (propIngest.TryReadProperty(ref reader, options, PropIngest, null)) - { - continue; - } - - if (propIp.TryReadProperty(ref reader, options, PropIp, null)) - { - continue; - } - - if (propJvm.TryReadProperty(ref reader, options, PropJvm, null)) - { - continue; - } - - if (propModules.TryReadProperty(ref reader, options, PropModules, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propOs.TryReadProperty(ref reader, options, PropOs, null)) - { - continue; - } - - if (propPlugins.TryReadProperty(ref reader, options, PropPlugins, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propProcess.TryReadProperty(ref reader, options, PropProcess, null)) - { - continue; - } - - if (propRemoteClusterServer.TryReadProperty(ref reader, options, PropRemoteClusterServer, null)) - { - continue; - } - - if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) - { - continue; - } - - if (propThreadPool.TryReadProperty(ref reader, options, PropThreadPool, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propTotalIndexingBuffer.TryReadProperty(ref reader, options, PropTotalIndexingBuffer, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotalIndexingBufferInBytes.TryReadProperty(ref reader, options, PropTotalIndexingBufferInBytes, null)) - { - continue; - } - - if (propTransport.TryReadProperty(ref reader, options, PropTransport, null)) - { - continue; - } - - if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) - { - continue; - } - - if (propTransportVersion.TryReadProperty(ref reader, options, PropTransportVersion, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = propAggregations.Value, - Attributes = propAttributes.Value, - BuildFlavor = propBuildFlavor.Value, - BuildHash = propBuildHash.Value, - BuildType = propBuildType.Value, - ComponentVersions = propComponentVersions.Value, - Host = propHost.Value, - Http = propHttp.Value, - IndexVersion = propIndexVersion.Value, - Ingest = propIngest.Value, - Ip = propIp.Value, - Jvm = propJvm.Value, - Modules = propModules.Value, - Name = propName.Value, - Os = propOs.Value, - Plugins = propPlugins.Value, - Process = propProcess.Value, - RemoteClusterServer = propRemoteClusterServer.Value, - Roles = propRoles.Value, - Settings = propSettings.Value, - ThreadPool = propThreadPool.Value, - TotalIndexingBuffer = propTotalIndexingBuffer.Value, - TotalIndexingBufferInBytes = propTotalIndexingBufferInBytes.Value, - Transport = propTransport.Value, - TransportAddress = propTransportAddress.Value, - TransportVersion = propTransportVersion.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropBuildFlavor, value.BuildFlavor, null, null); - writer.WriteProperty(options, PropBuildHash, value.BuildHash, null, null); - writer.WriteProperty(options, PropBuildType, value.BuildType, null, null); - writer.WriteProperty(options, PropComponentVersions, value.ComponentVersions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropHost, value.Host, null, null); - writer.WriteProperty(options, PropHttp, value.Http, null, null); - writer.WriteProperty(options, PropIndexVersion, value.IndexVersion, null, null); - writer.WriteProperty(options, PropIngest, value.Ingest, null, null); - writer.WriteProperty(options, PropIp, value.Ip, null, null); - writer.WriteProperty(options, PropJvm, value.Jvm, null, null); - writer.WriteProperty(options, PropModules, value.Modules, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropOs, value.Os, null, null); - writer.WriteProperty(options, PropPlugins, value.Plugins, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropProcess, value.Process, null, null); - writer.WriteProperty(options, PropRemoteClusterServer, value.RemoteClusterServer, null, null); - writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSettings, value.Settings, null, null); - writer.WriteProperty(options, PropThreadPool, value.ThreadPool, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropTotalIndexingBuffer, value.TotalIndexingBuffer, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotalIndexingBufferInBytes, value.TotalIndexingBufferInBytes, null, null); - writer.WriteProperty(options, PropTransport, value.Transport, null, null); - writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); - writer.WriteProperty(options, PropTransportVersion, value.TransportVersion, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoConverter))] public sealed partial class NodeInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoAction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoAction.Converters.g.cs new file mode 100644 index 00000000000..be661e7b3b5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoAction.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoActionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDestructiveRequiresName = System.Text.Json.JsonEncodedText.Encode("destructive_requires_name"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDestructiveRequiresName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDestructiveRequiresName.TryReadProperty(ref reader, options, PropDestructiveRequiresName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DestructiveRequiresName = propDestructiveRequiresName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoAction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDestructiveRequiresName, value.DestructiveRequiresName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoAction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoAction.g.cs index 9d39f6efaf3..14ff68ec91a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoAction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoAction.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoActionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDestructiveRequiresName = System.Text.Json.JsonEncodedText.Encode("destructive_requires_name"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoAction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDestructiveRequiresName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDestructiveRequiresName.TryReadProperty(ref reader, options, PropDestructiveRequiresName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DestructiveRequiresName = propDestructiveRequiresName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoAction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDestructiveRequiresName, value.DestructiveRequiresName, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoActionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoActionConverter))] public sealed partial class NodeInfoAction { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoAggregation.Converters.g.cs new file mode 100644 index 00000000000..4c46582a128 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoAggregation.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropTypes = System.Text.Json.JsonEncodedText.Encode("types"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propTypes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propTypes.TryReadProperty(ref reader, options, PropTypes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Types = propTypes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropTypes, value.Types, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoAggregation.g.cs index bcf6cdc36be..3709c1bd767 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoAggregation.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropTypes = System.Text.Json.JsonEncodedText.Encode("types"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propTypes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propTypes.TryReadProperty(ref reader, options, PropTypes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Types = propTypes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropTypes, value.Types, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoAggregationConverter))] public sealed partial class NodeInfoAggregation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoBootstrap.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoBootstrap.Converters.g.cs new file mode 100644 index 00000000000..13a4d04c392 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoBootstrap.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoBootstrapConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMemoryLock = System.Text.Json.JsonEncodedText.Encode("memory_lock"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoBootstrap Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMemoryLock = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMemoryLock.TryReadProperty(ref reader, options, PropMemoryLock, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoBootstrap(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MemoryLock = propMemoryLock.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoBootstrap value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMemoryLock, value.MemoryLock, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoBootstrap.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoBootstrap.g.cs index 22db306b523..f506b655e61 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoBootstrap.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoBootstrap.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoBootstrapConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMemoryLock = System.Text.Json.JsonEncodedText.Encode("memory_lock"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoBootstrap Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMemoryLock = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMemoryLock.TryReadProperty(ref reader, options, PropMemoryLock, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoBootstrap(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MemoryLock = propMemoryLock.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoBootstrap value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMemoryLock, value.MemoryLock, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoBootstrapConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoBootstrapConverter))] public sealed partial class NodeInfoBootstrap { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoClient.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoClient.Converters.g.cs new file mode 100644 index 00000000000..2a9047db8e1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoClient.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoClientConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoClient Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoClient(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoClient value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoClient.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoClient.g.cs index d6cd8bdd8f0..3fde3ad2b42 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoClient.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoClient.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoClientConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoClient Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoClient(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoClient value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoClientConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoClientConverter))] public sealed partial class NodeInfoClient { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoDiscover.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoDiscover.Converters.g.cs new file mode 100644 index 00000000000..033994aa417 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoDiscover.Converters.g.cs @@ -0,0 +1,87 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoDiscoverConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSeedHosts = System.Text.Json.JsonEncodedText.Encode("seed_hosts"); + private static readonly System.Text.Json.JsonEncodedText PropSeedProviders = System.Text.Json.JsonEncodedText.Encode("seed_providers"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoDiscover Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propSeedHosts = default; + LocalJsonValue?> propSeedProviders = default; + System.Collections.Generic.Dictionary? propSettings = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSeedHosts.TryReadProperty(ref reader, options, PropSeedHosts, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propSeedProviders.TryReadProperty(ref reader, options, PropSeedProviders, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + propSettings ??= new System.Collections.Generic.Dictionary(); + reader.ReadProperty(options, out string key, out object value, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!); + propSettings[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoDiscover(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + SeedHosts = propSeedHosts.Value, + SeedProviders = propSeedProviders.Value, + Settings = propSettings, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoDiscover value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSeedHosts, value.SeedHosts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSeedProviders, value.SeedProviders, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropType, value.Type, null, null); + if (value.Settings is not null) + { + foreach (var item in value.Settings) + { + writer.WriteProperty(options, item.Key, item.Value, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoDiscover.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoDiscover.g.cs index 322a74bfb79..dfd40346dff 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoDiscover.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoDiscover.g.cs @@ -23,70 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoDiscoverConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSeedHosts = System.Text.Json.JsonEncodedText.Encode("seed_hosts"); - private static readonly System.Text.Json.JsonEncodedText PropSeedProviders = System.Text.Json.JsonEncodedText.Encode("seed_providers"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoDiscover Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propSeedHosts = default; - LocalJsonValue?> propSeedProviders = default; - System.Collections.Generic.Dictionary? propSettings = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSeedHosts.TryReadProperty(ref reader, options, PropSeedHosts, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propSeedProviders.TryReadProperty(ref reader, options, PropSeedProviders, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - propSettings ??= new System.Collections.Generic.Dictionary(); - reader.ReadProperty(options, out string key, out object value, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!); - propSettings[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoDiscover(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - SeedHosts = propSeedHosts.Value, - SeedProviders = propSeedProviders.Value, - Settings = propSettings, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoDiscover value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSeedHosts, value.SeedHosts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSeedProviders, value.SeedProviders, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropType, value.Type, null, null); - if (value.Settings is not null) - { - foreach (var item in value.Settings) - { - writer.WriteProperty(options, item.Key, item.Value, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - } - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoDiscoverConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoDiscoverConverter))] public sealed partial class NodeInfoDiscover { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoHttp.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoHttp.Converters.g.cs new file mode 100644 index 00000000000..428071f461d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoHttp.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoHttpConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoundAddress = System.Text.Json.JsonEncodedText.Encode("bound_address"); + private static readonly System.Text.Json.JsonEncodedText PropMaxContentLength = System.Text.Json.JsonEncodedText.Encode("max_content_length"); + private static readonly System.Text.Json.JsonEncodedText PropMaxContentLengthInBytes = System.Text.Json.JsonEncodedText.Encode("max_content_length_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropPublishAddress = System.Text.Json.JsonEncodedText.Encode("publish_address"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoHttp Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBoundAddress = default; + LocalJsonValue propMaxContentLength = default; + LocalJsonValue propMaxContentLengthInBytes = default; + LocalJsonValue propPublishAddress = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoundAddress.TryReadProperty(ref reader, options, PropBoundAddress, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMaxContentLength.TryReadProperty(ref reader, options, PropMaxContentLength, null)) + { + continue; + } + + if (propMaxContentLengthInBytes.TryReadProperty(ref reader, options, PropMaxContentLengthInBytes, null)) + { + continue; + } + + if (propPublishAddress.TryReadProperty(ref reader, options, PropPublishAddress, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoHttp(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BoundAddress = propBoundAddress.Value, + MaxContentLength = propMaxContentLength.Value, + MaxContentLengthInBytes = propMaxContentLengthInBytes.Value, + PublishAddress = propPublishAddress.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoHttp value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoundAddress, value.BoundAddress, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMaxContentLength, value.MaxContentLength, null, null); + writer.WriteProperty(options, PropMaxContentLengthInBytes, value.MaxContentLengthInBytes, null, null); + writer.WriteProperty(options, PropPublishAddress, value.PublishAddress, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoHttp.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoHttp.g.cs index fea1534a566..f8b035a3b44 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoHttp.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoHttp.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoHttpConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoundAddress = System.Text.Json.JsonEncodedText.Encode("bound_address"); - private static readonly System.Text.Json.JsonEncodedText PropMaxContentLength = System.Text.Json.JsonEncodedText.Encode("max_content_length"); - private static readonly System.Text.Json.JsonEncodedText PropMaxContentLengthInBytes = System.Text.Json.JsonEncodedText.Encode("max_content_length_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropPublishAddress = System.Text.Json.JsonEncodedText.Encode("publish_address"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoHttp Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBoundAddress = default; - LocalJsonValue propMaxContentLength = default; - LocalJsonValue propMaxContentLengthInBytes = default; - LocalJsonValue propPublishAddress = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoundAddress.TryReadProperty(ref reader, options, PropBoundAddress, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMaxContentLength.TryReadProperty(ref reader, options, PropMaxContentLength, null)) - { - continue; - } - - if (propMaxContentLengthInBytes.TryReadProperty(ref reader, options, PropMaxContentLengthInBytes, null)) - { - continue; - } - - if (propPublishAddress.TryReadProperty(ref reader, options, PropPublishAddress, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoHttp(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BoundAddress = propBoundAddress.Value, - MaxContentLength = propMaxContentLength.Value, - MaxContentLengthInBytes = propMaxContentLengthInBytes.Value, - PublishAddress = propPublishAddress.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoHttp value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoundAddress, value.BoundAddress, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMaxContentLength, value.MaxContentLength, null, null); - writer.WriteProperty(options, PropMaxContentLengthInBytes, value.MaxContentLengthInBytes, null, null); - writer.WriteProperty(options, PropPublishAddress, value.PublishAddress, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoHttpConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoHttpConverter))] public sealed partial class NodeInfoHttp { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngest.Converters.g.cs new file mode 100644 index 00000000000..740a11a0e31 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngest.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoIngestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropProcessors = System.Text.Json.JsonEncodedText.Encode("processors"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propProcessors = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propProcessors.TryReadProperty(ref reader, options, PropProcessors, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Processors = propProcessors.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropProcessors, value.Processors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngest.g.cs index 158808bafc1..d22cf4d513a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngest.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoIngestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropProcessors = System.Text.Json.JsonEncodedText.Encode("processors"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propProcessors = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propProcessors.TryReadProperty(ref reader, options, PropProcessors, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Processors = propProcessors.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropProcessors, value.Processors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoIngestConverter))] public sealed partial class NodeInfoIngest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestDownloader.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestDownloader.Converters.g.cs new file mode 100644 index 00000000000..6d613c103b3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestDownloader.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoIngestDownloaderConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestDownloader Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEnabled = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestDownloader(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Enabled = propEnabled.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestDownloader value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestDownloader.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestDownloader.g.cs index c3351267c2e..8f876515db1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestDownloader.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestDownloader.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoIngestDownloaderConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestDownloader Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEnabled = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestDownloader(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Enabled = propEnabled.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestDownloader value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestDownloaderConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoIngestDownloaderConverter))] public sealed partial class NodeInfoIngestDownloader { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestInfo.Converters.g.cs new file mode 100644 index 00000000000..31109ee3ce3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestInfo.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoIngestInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDownloader = System.Text.Json.JsonEncodedText.Encode("downloader"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDownloader = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDownloader.TryReadProperty(ref reader, options, PropDownloader, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Downloader = propDownloader.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDownloader, value.Downloader, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestInfo.g.cs index b5db0dcafa6..d929ad10a8c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestInfo.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoIngestInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDownloader = System.Text.Json.JsonEncodedText.Encode("downloader"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDownloader = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDownloader.TryReadProperty(ref reader, options, PropDownloader, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Downloader = propDownloader.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDownloader, value.Downloader, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoIngestInfoConverter))] public sealed partial class NodeInfoIngestInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestProcessor.Converters.g.cs new file mode 100644 index 00000000000..e7258323432 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestProcessor.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoIngestProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestProcessor.g.cs index f6b5bd4af43..1fb15316a25 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoIngestProcessor.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoIngestProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoIngestProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoIngestProcessorConverter))] public sealed partial class NodeInfoIngestProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoJvmMemory.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoJvmMemory.Converters.g.cs new file mode 100644 index 00000000000..f6cadc1f9fa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoJvmMemory.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoJvmMemoryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDirectMax = System.Text.Json.JsonEncodedText.Encode("direct_max"); + private static readonly System.Text.Json.JsonEncodedText PropDirectMaxInBytes = System.Text.Json.JsonEncodedText.Encode("direct_max_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropHeapInit = System.Text.Json.JsonEncodedText.Encode("heap_init"); + private static readonly System.Text.Json.JsonEncodedText PropHeapInitInBytes = System.Text.Json.JsonEncodedText.Encode("heap_init_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropHeapMax = System.Text.Json.JsonEncodedText.Encode("heap_max"); + private static readonly System.Text.Json.JsonEncodedText PropHeapMaxInBytes = System.Text.Json.JsonEncodedText.Encode("heap_max_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropNonHeapInit = System.Text.Json.JsonEncodedText.Encode("non_heap_init"); + private static readonly System.Text.Json.JsonEncodedText PropNonHeapInitInBytes = System.Text.Json.JsonEncodedText.Encode("non_heap_init_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropNonHeapMax = System.Text.Json.JsonEncodedText.Encode("non_heap_max"); + private static readonly System.Text.Json.JsonEncodedText PropNonHeapMaxInBytes = System.Text.Json.JsonEncodedText.Encode("non_heap_max_in_bytes"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoJvmMemory Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDirectMax = default; + LocalJsonValue propDirectMaxInBytes = default; + LocalJsonValue propHeapInit = default; + LocalJsonValue propHeapInitInBytes = default; + LocalJsonValue propHeapMax = default; + LocalJsonValue propHeapMaxInBytes = default; + LocalJsonValue propNonHeapInit = default; + LocalJsonValue propNonHeapInitInBytes = default; + LocalJsonValue propNonHeapMax = default; + LocalJsonValue propNonHeapMaxInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDirectMax.TryReadProperty(ref reader, options, PropDirectMax, null)) + { + continue; + } + + if (propDirectMaxInBytes.TryReadProperty(ref reader, options, PropDirectMaxInBytes, null)) + { + continue; + } + + if (propHeapInit.TryReadProperty(ref reader, options, PropHeapInit, null)) + { + continue; + } + + if (propHeapInitInBytes.TryReadProperty(ref reader, options, PropHeapInitInBytes, null)) + { + continue; + } + + if (propHeapMax.TryReadProperty(ref reader, options, PropHeapMax, null)) + { + continue; + } + + if (propHeapMaxInBytes.TryReadProperty(ref reader, options, PropHeapMaxInBytes, null)) + { + continue; + } + + if (propNonHeapInit.TryReadProperty(ref reader, options, PropNonHeapInit, null)) + { + continue; + } + + if (propNonHeapInitInBytes.TryReadProperty(ref reader, options, PropNonHeapInitInBytes, null)) + { + continue; + } + + if (propNonHeapMax.TryReadProperty(ref reader, options, PropNonHeapMax, null)) + { + continue; + } + + if (propNonHeapMaxInBytes.TryReadProperty(ref reader, options, PropNonHeapMaxInBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoJvmMemory(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DirectMax = propDirectMax.Value, + DirectMaxInBytes = propDirectMaxInBytes.Value, + HeapInit = propHeapInit.Value, + HeapInitInBytes = propHeapInitInBytes.Value, + HeapMax = propHeapMax.Value, + HeapMaxInBytes = propHeapMaxInBytes.Value, + NonHeapInit = propNonHeapInit.Value, + NonHeapInitInBytes = propNonHeapInitInBytes.Value, + NonHeapMax = propNonHeapMax.Value, + NonHeapMaxInBytes = propNonHeapMaxInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoJvmMemory value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDirectMax, value.DirectMax, null, null); + writer.WriteProperty(options, PropDirectMaxInBytes, value.DirectMaxInBytes, null, null); + writer.WriteProperty(options, PropHeapInit, value.HeapInit, null, null); + writer.WriteProperty(options, PropHeapInitInBytes, value.HeapInitInBytes, null, null); + writer.WriteProperty(options, PropHeapMax, value.HeapMax, null, null); + writer.WriteProperty(options, PropHeapMaxInBytes, value.HeapMaxInBytes, null, null); + writer.WriteProperty(options, PropNonHeapInit, value.NonHeapInit, null, null); + writer.WriteProperty(options, PropNonHeapInitInBytes, value.NonHeapInitInBytes, null, null); + writer.WriteProperty(options, PropNonHeapMax, value.NonHeapMax, null, null); + writer.WriteProperty(options, PropNonHeapMaxInBytes, value.NonHeapMaxInBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoJvmMemory.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoJvmMemory.g.cs index e0e311c9b7e..d12873a0f04 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoJvmMemory.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoJvmMemory.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoJvmMemoryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDirectMax = System.Text.Json.JsonEncodedText.Encode("direct_max"); - private static readonly System.Text.Json.JsonEncodedText PropDirectMaxInBytes = System.Text.Json.JsonEncodedText.Encode("direct_max_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropHeapInit = System.Text.Json.JsonEncodedText.Encode("heap_init"); - private static readonly System.Text.Json.JsonEncodedText PropHeapInitInBytes = System.Text.Json.JsonEncodedText.Encode("heap_init_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropHeapMax = System.Text.Json.JsonEncodedText.Encode("heap_max"); - private static readonly System.Text.Json.JsonEncodedText PropHeapMaxInBytes = System.Text.Json.JsonEncodedText.Encode("heap_max_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropNonHeapInit = System.Text.Json.JsonEncodedText.Encode("non_heap_init"); - private static readonly System.Text.Json.JsonEncodedText PropNonHeapInitInBytes = System.Text.Json.JsonEncodedText.Encode("non_heap_init_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropNonHeapMax = System.Text.Json.JsonEncodedText.Encode("non_heap_max"); - private static readonly System.Text.Json.JsonEncodedText PropNonHeapMaxInBytes = System.Text.Json.JsonEncodedText.Encode("non_heap_max_in_bytes"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoJvmMemory Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDirectMax = default; - LocalJsonValue propDirectMaxInBytes = default; - LocalJsonValue propHeapInit = default; - LocalJsonValue propHeapInitInBytes = default; - LocalJsonValue propHeapMax = default; - LocalJsonValue propHeapMaxInBytes = default; - LocalJsonValue propNonHeapInit = default; - LocalJsonValue propNonHeapInitInBytes = default; - LocalJsonValue propNonHeapMax = default; - LocalJsonValue propNonHeapMaxInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDirectMax.TryReadProperty(ref reader, options, PropDirectMax, null)) - { - continue; - } - - if (propDirectMaxInBytes.TryReadProperty(ref reader, options, PropDirectMaxInBytes, null)) - { - continue; - } - - if (propHeapInit.TryReadProperty(ref reader, options, PropHeapInit, null)) - { - continue; - } - - if (propHeapInitInBytes.TryReadProperty(ref reader, options, PropHeapInitInBytes, null)) - { - continue; - } - - if (propHeapMax.TryReadProperty(ref reader, options, PropHeapMax, null)) - { - continue; - } - - if (propHeapMaxInBytes.TryReadProperty(ref reader, options, PropHeapMaxInBytes, null)) - { - continue; - } - - if (propNonHeapInit.TryReadProperty(ref reader, options, PropNonHeapInit, null)) - { - continue; - } - - if (propNonHeapInitInBytes.TryReadProperty(ref reader, options, PropNonHeapInitInBytes, null)) - { - continue; - } - - if (propNonHeapMax.TryReadProperty(ref reader, options, PropNonHeapMax, null)) - { - continue; - } - - if (propNonHeapMaxInBytes.TryReadProperty(ref reader, options, PropNonHeapMaxInBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoJvmMemory(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DirectMax = propDirectMax.Value, - DirectMaxInBytes = propDirectMaxInBytes.Value, - HeapInit = propHeapInit.Value, - HeapInitInBytes = propHeapInitInBytes.Value, - HeapMax = propHeapMax.Value, - HeapMaxInBytes = propHeapMaxInBytes.Value, - NonHeapInit = propNonHeapInit.Value, - NonHeapInitInBytes = propNonHeapInitInBytes.Value, - NonHeapMax = propNonHeapMax.Value, - NonHeapMaxInBytes = propNonHeapMaxInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoJvmMemory value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDirectMax, value.DirectMax, null, null); - writer.WriteProperty(options, PropDirectMaxInBytes, value.DirectMaxInBytes, null, null); - writer.WriteProperty(options, PropHeapInit, value.HeapInit, null, null); - writer.WriteProperty(options, PropHeapInitInBytes, value.HeapInitInBytes, null, null); - writer.WriteProperty(options, PropHeapMax, value.HeapMax, null, null); - writer.WriteProperty(options, PropHeapMaxInBytes, value.HeapMaxInBytes, null, null); - writer.WriteProperty(options, PropNonHeapInit, value.NonHeapInit, null, null); - writer.WriteProperty(options, PropNonHeapInitInBytes, value.NonHeapInitInBytes, null, null); - writer.WriteProperty(options, PropNonHeapMax, value.NonHeapMax, null, null); - writer.WriteProperty(options, PropNonHeapMaxInBytes, value.NonHeapMaxInBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoJvmMemoryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoJvmMemoryConverter))] public sealed partial class NodeInfoJvmMemory { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoMemory.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoMemory.Converters.g.cs new file mode 100644 index 00000000000..b66f189fe2b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoMemory.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoMemoryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + private static readonly System.Text.Json.JsonEncodedText PropTotalInBytes = System.Text.Json.JsonEncodedText.Encode("total_in_bytes"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoMemory Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propTotal = default; + LocalJsonValue propTotalInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (propTotalInBytes.TryReadProperty(ref reader, options, PropTotalInBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoMemory(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Total = propTotal.Value, + TotalInBytes = propTotalInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoMemory value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteProperty(options, PropTotalInBytes, value.TotalInBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoMemory.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoMemory.g.cs index 1e6aa6869db..aa0fd22d6d1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoMemory.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoMemory.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoMemoryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - private static readonly System.Text.Json.JsonEncodedText PropTotalInBytes = System.Text.Json.JsonEncodedText.Encode("total_in_bytes"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoMemory Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propTotal = default; - LocalJsonValue propTotalInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (propTotalInBytes.TryReadProperty(ref reader, options, PropTotalInBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoMemory(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Total = propTotal.Value, - TotalInBytes = propTotalInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoMemory value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteProperty(options, PropTotalInBytes, value.TotalInBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoMemoryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoMemoryConverter))] public sealed partial class NodeInfoMemory { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoOSCPU.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoOSCPU.Converters.g.cs new file mode 100644 index 00000000000..adb4962d079 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoOSCPU.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoOSCPUConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCacheSize = System.Text.Json.JsonEncodedText.Encode("cache_size"); + private static readonly System.Text.Json.JsonEncodedText PropCacheSizeInBytes = System.Text.Json.JsonEncodedText.Encode("cache_size_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropCoresPerSocket = System.Text.Json.JsonEncodedText.Encode("cores_per_socket"); + private static readonly System.Text.Json.JsonEncodedText PropMhz = System.Text.Json.JsonEncodedText.Encode("mhz"); + private static readonly System.Text.Json.JsonEncodedText PropModel = System.Text.Json.JsonEncodedText.Encode("model"); + private static readonly System.Text.Json.JsonEncodedText PropTotalCores = System.Text.Json.JsonEncodedText.Encode("total_cores"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSockets = System.Text.Json.JsonEncodedText.Encode("total_sockets"); + private static readonly System.Text.Json.JsonEncodedText PropVendor = System.Text.Json.JsonEncodedText.Encode("vendor"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoOSCPU Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCacheSize = default; + LocalJsonValue propCacheSizeInBytes = default; + LocalJsonValue propCoresPerSocket = default; + LocalJsonValue propMhz = default; + LocalJsonValue propModel = default; + LocalJsonValue propTotalCores = default; + LocalJsonValue propTotalSockets = default; + LocalJsonValue propVendor = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCacheSize.TryReadProperty(ref reader, options, PropCacheSize, null)) + { + continue; + } + + if (propCacheSizeInBytes.TryReadProperty(ref reader, options, PropCacheSizeInBytes, null)) + { + continue; + } + + if (propCoresPerSocket.TryReadProperty(ref reader, options, PropCoresPerSocket, null)) + { + continue; + } + + if (propMhz.TryReadProperty(ref reader, options, PropMhz, null)) + { + continue; + } + + if (propModel.TryReadProperty(ref reader, options, PropModel, null)) + { + continue; + } + + if (propTotalCores.TryReadProperty(ref reader, options, PropTotalCores, null)) + { + continue; + } + + if (propTotalSockets.TryReadProperty(ref reader, options, PropTotalSockets, null)) + { + continue; + } + + if (propVendor.TryReadProperty(ref reader, options, PropVendor, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoOSCPU(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CacheSize = propCacheSize.Value, + CacheSizeInBytes = propCacheSizeInBytes.Value, + CoresPerSocket = propCoresPerSocket.Value, + Mhz = propMhz.Value, + Model = propModel.Value, + TotalCores = propTotalCores.Value, + TotalSockets = propTotalSockets.Value, + Vendor = propVendor.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoOSCPU value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCacheSize, value.CacheSize, null, null); + writer.WriteProperty(options, PropCacheSizeInBytes, value.CacheSizeInBytes, null, null); + writer.WriteProperty(options, PropCoresPerSocket, value.CoresPerSocket, null, null); + writer.WriteProperty(options, PropMhz, value.Mhz, null, null); + writer.WriteProperty(options, PropModel, value.Model, null, null); + writer.WriteProperty(options, PropTotalCores, value.TotalCores, null, null); + writer.WriteProperty(options, PropTotalSockets, value.TotalSockets, null, null); + writer.WriteProperty(options, PropVendor, value.Vendor, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoOSCPU.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoOSCPU.g.cs index 8b547d314d3..b4f26d37643 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoOSCPU.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoOSCPU.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoOSCPUConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCacheSize = System.Text.Json.JsonEncodedText.Encode("cache_size"); - private static readonly System.Text.Json.JsonEncodedText PropCacheSizeInBytes = System.Text.Json.JsonEncodedText.Encode("cache_size_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropCoresPerSocket = System.Text.Json.JsonEncodedText.Encode("cores_per_socket"); - private static readonly System.Text.Json.JsonEncodedText PropMhz = System.Text.Json.JsonEncodedText.Encode("mhz"); - private static readonly System.Text.Json.JsonEncodedText PropModel = System.Text.Json.JsonEncodedText.Encode("model"); - private static readonly System.Text.Json.JsonEncodedText PropTotalCores = System.Text.Json.JsonEncodedText.Encode("total_cores"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSockets = System.Text.Json.JsonEncodedText.Encode("total_sockets"); - private static readonly System.Text.Json.JsonEncodedText PropVendor = System.Text.Json.JsonEncodedText.Encode("vendor"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoOSCPU Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCacheSize = default; - LocalJsonValue propCacheSizeInBytes = default; - LocalJsonValue propCoresPerSocket = default; - LocalJsonValue propMhz = default; - LocalJsonValue propModel = default; - LocalJsonValue propTotalCores = default; - LocalJsonValue propTotalSockets = default; - LocalJsonValue propVendor = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCacheSize.TryReadProperty(ref reader, options, PropCacheSize, null)) - { - continue; - } - - if (propCacheSizeInBytes.TryReadProperty(ref reader, options, PropCacheSizeInBytes, null)) - { - continue; - } - - if (propCoresPerSocket.TryReadProperty(ref reader, options, PropCoresPerSocket, null)) - { - continue; - } - - if (propMhz.TryReadProperty(ref reader, options, PropMhz, null)) - { - continue; - } - - if (propModel.TryReadProperty(ref reader, options, PropModel, null)) - { - continue; - } - - if (propTotalCores.TryReadProperty(ref reader, options, PropTotalCores, null)) - { - continue; - } - - if (propTotalSockets.TryReadProperty(ref reader, options, PropTotalSockets, null)) - { - continue; - } - - if (propVendor.TryReadProperty(ref reader, options, PropVendor, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoOSCPU(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CacheSize = propCacheSize.Value, - CacheSizeInBytes = propCacheSizeInBytes.Value, - CoresPerSocket = propCoresPerSocket.Value, - Mhz = propMhz.Value, - Model = propModel.Value, - TotalCores = propTotalCores.Value, - TotalSockets = propTotalSockets.Value, - Vendor = propVendor.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoOSCPU value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCacheSize, value.CacheSize, null, null); - writer.WriteProperty(options, PropCacheSizeInBytes, value.CacheSizeInBytes, null, null); - writer.WriteProperty(options, PropCoresPerSocket, value.CoresPerSocket, null, null); - writer.WriteProperty(options, PropMhz, value.Mhz, null, null); - writer.WriteProperty(options, PropModel, value.Model, null, null); - writer.WriteProperty(options, PropTotalCores, value.TotalCores, null, null); - writer.WriteProperty(options, PropTotalSockets, value.TotalSockets, null, null); - writer.WriteProperty(options, PropVendor, value.Vendor, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoOSCPUConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoOSCPUConverter))] public sealed partial class NodeInfoOSCPU { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoPath.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoPath.Converters.g.cs new file mode 100644 index 00000000000..68816d7a88e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoPath.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoPathConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropData = System.Text.Json.JsonEncodedText.Encode("data"); + private static readonly System.Text.Json.JsonEncodedText PropHome = System.Text.Json.JsonEncodedText.Encode("home"); + private static readonly System.Text.Json.JsonEncodedText PropLogs = System.Text.Json.JsonEncodedText.Encode("logs"); + private static readonly System.Text.Json.JsonEncodedText PropRepo = System.Text.Json.JsonEncodedText.Encode("repo"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoPath Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propData = default; + LocalJsonValue propHome = default; + LocalJsonValue propLogs = default; + LocalJsonValue?> propRepo = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propData.TryReadProperty(ref reader, options, PropData, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propHome.TryReadProperty(ref reader, options, PropHome, null)) + { + continue; + } + + if (propLogs.TryReadProperty(ref reader, options, PropLogs, null)) + { + continue; + } + + if (propRepo.TryReadProperty(ref reader, options, PropRepo, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoPath(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Data = propData.Value, + Home = propHome.Value, + Logs = propLogs.Value, + Repo = propRepo.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoPath value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropData, value.Data, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropHome, value.Home, null, null); + writer.WriteProperty(options, PropLogs, value.Logs, null, null); + writer.WriteProperty(options, PropRepo, value.Repo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoPath.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoPath.g.cs index 4b2295e3832..1a75afed223 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoPath.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoPath.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoPathConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropData = System.Text.Json.JsonEncodedText.Encode("data"); - private static readonly System.Text.Json.JsonEncodedText PropHome = System.Text.Json.JsonEncodedText.Encode("home"); - private static readonly System.Text.Json.JsonEncodedText PropLogs = System.Text.Json.JsonEncodedText.Encode("logs"); - private static readonly System.Text.Json.JsonEncodedText PropRepo = System.Text.Json.JsonEncodedText.Encode("repo"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoPath Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propData = default; - LocalJsonValue propHome = default; - LocalJsonValue propLogs = default; - LocalJsonValue?> propRepo = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propData.TryReadProperty(ref reader, options, PropData, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propHome.TryReadProperty(ref reader, options, PropHome, null)) - { - continue; - } - - if (propLogs.TryReadProperty(ref reader, options, PropLogs, null)) - { - continue; - } - - if (propRepo.TryReadProperty(ref reader, options, PropRepo, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoPath(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Data = propData.Value, - Home = propHome.Value, - Logs = propLogs.Value, - Repo = propRepo.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoPath value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropData, value.Data, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropHome, value.Home, null, null); - writer.WriteProperty(options, PropLogs, value.Logs, null, null); - writer.WriteProperty(options, PropRepo, value.Repo, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoPathConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoPathConverter))] public sealed partial class NodeInfoPath { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoRepositories.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoRepositories.Converters.g.cs new file mode 100644 index 00000000000..0bf61f27a86 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoRepositories.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoRepositoriesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropUrl = System.Text.Json.JsonEncodedText.Encode("url"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoRepositories Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propUrl = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propUrl.TryReadProperty(ref reader, options, PropUrl, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoRepositories(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Url = propUrl.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoRepositories value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropUrl, value.Url, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoRepositories.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoRepositories.g.cs index 985ef88a8c9..c6764822c6e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoRepositories.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoRepositories.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoRepositoriesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropUrl = System.Text.Json.JsonEncodedText.Encode("url"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoRepositories Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propUrl = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propUrl.TryReadProperty(ref reader, options, PropUrl, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoRepositories(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Url = propUrl.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoRepositories value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropUrl, value.Url, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoRepositoriesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoRepositoriesConverter))] public sealed partial class NodeInfoRepositories { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoRepositoriesUrl.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoRepositoriesUrl.Converters.g.cs new file mode 100644 index 00000000000..e621ee5f935 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoRepositoriesUrl.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoRepositoriesUrlConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowedUrls = System.Text.Json.JsonEncodedText.Encode("allowed_urls"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoRepositoriesUrl Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowedUrls = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowedUrls.TryReadProperty(ref reader, options, PropAllowedUrls, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoRepositoriesUrl(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowedUrls = propAllowedUrls.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoRepositoriesUrl value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowedUrls, value.AllowedUrls, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoRepositoriesUrl.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoRepositoriesUrl.g.cs index 1d1c5f3c24e..1431eac1ed5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoRepositoriesUrl.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoRepositoriesUrl.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoRepositoriesUrlConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowedUrls = System.Text.Json.JsonEncodedText.Encode("allowed_urls"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoRepositoriesUrl Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowedUrls = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowedUrls.TryReadProperty(ref reader, options, PropAllowedUrls, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoRepositoriesUrl(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowedUrls = propAllowedUrls.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoRepositoriesUrl value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowedUrls, value.AllowedUrls, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoRepositoriesUrlConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoRepositoriesUrlConverter))] public sealed partial class NodeInfoRepositoriesUrl { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoScript.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoScript.Converters.g.cs new file mode 100644 index 00000000000..46815c3fdb4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoScript.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoScriptConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowedTypes = System.Text.Json.JsonEncodedText.Encode("allowed_types"); + private static readonly System.Text.Json.JsonEncodedText PropDisableMaxCompilationsRate = System.Text.Json.JsonEncodedText.Encode("disable_max_compilations_rate"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoScript Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowedTypes = default; + LocalJsonValue propDisableMaxCompilationsRate = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowedTypes.TryReadProperty(ref reader, options, PropAllowedTypes, null)) + { + continue; + } + + if (propDisableMaxCompilationsRate.TryReadProperty(ref reader, options, PropDisableMaxCompilationsRate, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoScript(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowedTypes = propAllowedTypes.Value, + DisableMaxCompilationsRate = propDisableMaxCompilationsRate.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoScript value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowedTypes, value.AllowedTypes, null, null); + writer.WriteProperty(options, PropDisableMaxCompilationsRate, value.DisableMaxCompilationsRate, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoScript.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoScript.g.cs index b2760463c7c..a2b1571e1ec 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoScript.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoScript.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoScriptConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowedTypes = System.Text.Json.JsonEncodedText.Encode("allowed_types"); - private static readonly System.Text.Json.JsonEncodedText PropDisableMaxCompilationsRate = System.Text.Json.JsonEncodedText.Encode("disable_max_compilations_rate"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoScript Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowedTypes = default; - LocalJsonValue propDisableMaxCompilationsRate = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowedTypes.TryReadProperty(ref reader, options, PropAllowedTypes, null)) - { - continue; - } - - if (propDisableMaxCompilationsRate.TryReadProperty(ref reader, options, PropDisableMaxCompilationsRate, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoScript(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowedTypes = propAllowedTypes.Value, - DisableMaxCompilationsRate = propDisableMaxCompilationsRate.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoScript value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowedTypes, value.AllowedTypes, null, null); - writer.WriteProperty(options, PropDisableMaxCompilationsRate, value.DisableMaxCompilationsRate, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoScriptConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoScriptConverter))] public sealed partial class NodeInfoScript { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSearch.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSearch.Converters.g.cs new file mode 100644 index 00000000000..4612e9e72e8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSearch.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoSearchConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRemote = System.Text.Json.JsonEncodedText.Encode("remote"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoSearch Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propRemote = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRemote.TryReadProperty(ref reader, options, PropRemote, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSearch(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Remote = propRemote.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoSearch value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRemote, value.Remote, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSearch.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSearch.g.cs index dcb60b62647..7390e374ec2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSearch.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSearch.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoSearchConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRemote = System.Text.Json.JsonEncodedText.Encode("remote"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoSearch Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propRemote = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRemote.TryReadProperty(ref reader, options, PropRemote, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSearch(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Remote = propRemote.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoSearch value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRemote, value.Remote, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoSearchConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoSearchConverter))] public sealed partial class NodeInfoSearch { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSearchRemote.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSearchRemote.Converters.g.cs new file mode 100644 index 00000000000..a2fe64e00e2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSearchRemote.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoSearchRemoteConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropConnect = System.Text.Json.JsonEncodedText.Encode("connect"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoSearchRemote Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propConnect = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propConnect.TryReadProperty(ref reader, options, PropConnect, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSearchRemote(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Connect = propConnect.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoSearchRemote value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropConnect, value.Connect, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSearchRemote.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSearchRemote.g.cs index 5e7ac51257b..719e420fc10 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSearchRemote.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSearchRemote.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoSearchRemoteConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropConnect = System.Text.Json.JsonEncodedText.Encode("connect"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoSearchRemote Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propConnect = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propConnect.TryReadProperty(ref reader, options, PropConnect, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSearchRemote(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Connect = propConnect.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoSearchRemote value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropConnect, value.Connect, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoSearchRemoteConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoSearchRemoteConverter))] public sealed partial class NodeInfoSearchRemote { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettings.Converters.g.cs new file mode 100644 index 00000000000..e0695f39b4c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettings.Converters.g.cs @@ -0,0 +1,189 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAction = System.Text.Json.JsonEncodedText.Encode("action"); + private static readonly System.Text.Json.JsonEncodedText PropBootstrap = System.Text.Json.JsonEncodedText.Encode("bootstrap"); + private static readonly System.Text.Json.JsonEncodedText PropClient = System.Text.Json.JsonEncodedText.Encode("client"); + private static readonly System.Text.Json.JsonEncodedText PropCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); + private static readonly System.Text.Json.JsonEncodedText PropDiscovery = System.Text.Json.JsonEncodedText.Encode("discovery"); + 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 PropNetwork = System.Text.Json.JsonEncodedText.Encode("network"); + private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); + private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); + private static readonly System.Text.Json.JsonEncodedText PropRepositories = System.Text.Json.JsonEncodedText.Encode("repositories"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropSearch = System.Text.Json.JsonEncodedText.Encode("search"); + private static readonly System.Text.Json.JsonEncodedText PropTransport = System.Text.Json.JsonEncodedText.Encode("transport"); + private static readonly System.Text.Json.JsonEncodedText PropXpack = System.Text.Json.JsonEncodedText.Encode("xpack"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAction = default; + LocalJsonValue propBootstrap = default; + LocalJsonValue propClient = default; + LocalJsonValue propCluster = default; + LocalJsonValue propDiscovery = default; + LocalJsonValue propHttp = default; + LocalJsonValue propIngest = default; + LocalJsonValue propNetwork = default; + LocalJsonValue propNode = default; + LocalJsonValue propPath = default; + LocalJsonValue propRepositories = default; + LocalJsonValue propScript = default; + LocalJsonValue propSearch = default; + LocalJsonValue propTransport = default; + LocalJsonValue propXpack = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAction.TryReadProperty(ref reader, options, PropAction, null)) + { + continue; + } + + if (propBootstrap.TryReadProperty(ref reader, options, PropBootstrap, null)) + { + continue; + } + + if (propClient.TryReadProperty(ref reader, options, PropClient, null)) + { + continue; + } + + if (propCluster.TryReadProperty(ref reader, options, PropCluster, null)) + { + continue; + } + + if (propDiscovery.TryReadProperty(ref reader, options, PropDiscovery, null)) + { + continue; + } + + if (propHttp.TryReadProperty(ref reader, options, PropHttp, null)) + { + continue; + } + + if (propIngest.TryReadProperty(ref reader, options, PropIngest, null)) + { + continue; + } + + if (propNetwork.TryReadProperty(ref reader, options, PropNetwork, null)) + { + continue; + } + + if (propNode.TryReadProperty(ref reader, options, PropNode, null)) + { + continue; + } + + if (propPath.TryReadProperty(ref reader, options, PropPath, null)) + { + continue; + } + + if (propRepositories.TryReadProperty(ref reader, options, PropRepositories, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propSearch.TryReadProperty(ref reader, options, PropSearch, null)) + { + continue; + } + + if (propTransport.TryReadProperty(ref reader, options, PropTransport, null)) + { + continue; + } + + if (propXpack.TryReadProperty(ref reader, options, PropXpack, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Action = propAction.Value, + Bootstrap = propBootstrap.Value, + Client = propClient.Value, + Cluster = propCluster.Value, + Discovery = propDiscovery.Value, + Http = propHttp.Value, + Ingest = propIngest.Value, + Network = propNetwork.Value, + Node = propNode.Value, + Path = propPath.Value, + Repositories = propRepositories.Value, + Script = propScript.Value, + Search = propSearch.Value, + Transport = propTransport.Value, + Xpack = propXpack.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAction, value.Action, null, null); + writer.WriteProperty(options, PropBootstrap, value.Bootstrap, null, null); + writer.WriteProperty(options, PropClient, value.Client, null, null); + writer.WriteProperty(options, PropCluster, value.Cluster, null, null); + writer.WriteProperty(options, PropDiscovery, value.Discovery, null, null); + writer.WriteProperty(options, PropHttp, value.Http, null, null); + writer.WriteProperty(options, PropIngest, value.Ingest, null, null); + writer.WriteProperty(options, PropNetwork, value.Network, null, null); + writer.WriteProperty(options, PropNode, value.Node, null, null); + writer.WriteProperty(options, PropPath, value.Path, null, null); + writer.WriteProperty(options, PropRepositories, value.Repositories, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropSearch, value.Search, null, null); + writer.WriteProperty(options, PropTransport, value.Transport, null, null); + writer.WriteProperty(options, PropXpack, value.Xpack, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettings.g.cs index 91d78036381..71123958c76 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettings.g.cs @@ -23,172 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoSettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAction = System.Text.Json.JsonEncodedText.Encode("action"); - private static readonly System.Text.Json.JsonEncodedText PropBootstrap = System.Text.Json.JsonEncodedText.Encode("bootstrap"); - private static readonly System.Text.Json.JsonEncodedText PropClient = System.Text.Json.JsonEncodedText.Encode("client"); - private static readonly System.Text.Json.JsonEncodedText PropCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); - private static readonly System.Text.Json.JsonEncodedText PropDiscovery = System.Text.Json.JsonEncodedText.Encode("discovery"); - 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 PropNetwork = System.Text.Json.JsonEncodedText.Encode("network"); - private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); - private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); - private static readonly System.Text.Json.JsonEncodedText PropRepositories = System.Text.Json.JsonEncodedText.Encode("repositories"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropSearch = System.Text.Json.JsonEncodedText.Encode("search"); - private static readonly System.Text.Json.JsonEncodedText PropTransport = System.Text.Json.JsonEncodedText.Encode("transport"); - private static readonly System.Text.Json.JsonEncodedText PropXpack = System.Text.Json.JsonEncodedText.Encode("xpack"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAction = default; - LocalJsonValue propBootstrap = default; - LocalJsonValue propClient = default; - LocalJsonValue propCluster = default; - LocalJsonValue propDiscovery = default; - LocalJsonValue propHttp = default; - LocalJsonValue propIngest = default; - LocalJsonValue propNetwork = default; - LocalJsonValue propNode = default; - LocalJsonValue propPath = default; - LocalJsonValue propRepositories = default; - LocalJsonValue propScript = default; - LocalJsonValue propSearch = default; - LocalJsonValue propTransport = default; - LocalJsonValue propXpack = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAction.TryReadProperty(ref reader, options, PropAction, null)) - { - continue; - } - - if (propBootstrap.TryReadProperty(ref reader, options, PropBootstrap, null)) - { - continue; - } - - if (propClient.TryReadProperty(ref reader, options, PropClient, null)) - { - continue; - } - - if (propCluster.TryReadProperty(ref reader, options, PropCluster, null)) - { - continue; - } - - if (propDiscovery.TryReadProperty(ref reader, options, PropDiscovery, null)) - { - continue; - } - - if (propHttp.TryReadProperty(ref reader, options, PropHttp, null)) - { - continue; - } - - if (propIngest.TryReadProperty(ref reader, options, PropIngest, null)) - { - continue; - } - - if (propNetwork.TryReadProperty(ref reader, options, PropNetwork, null)) - { - continue; - } - - if (propNode.TryReadProperty(ref reader, options, PropNode, null)) - { - continue; - } - - if (propPath.TryReadProperty(ref reader, options, PropPath, null)) - { - continue; - } - - if (propRepositories.TryReadProperty(ref reader, options, PropRepositories, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propSearch.TryReadProperty(ref reader, options, PropSearch, null)) - { - continue; - } - - if (propTransport.TryReadProperty(ref reader, options, PropTransport, null)) - { - continue; - } - - if (propXpack.TryReadProperty(ref reader, options, PropXpack, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Action = propAction.Value, - Bootstrap = propBootstrap.Value, - Client = propClient.Value, - Cluster = propCluster.Value, - Discovery = propDiscovery.Value, - Http = propHttp.Value, - Ingest = propIngest.Value, - Network = propNetwork.Value, - Node = propNode.Value, - Path = propPath.Value, - Repositories = propRepositories.Value, - Script = propScript.Value, - Search = propSearch.Value, - Transport = propTransport.Value, - Xpack = propXpack.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAction, value.Action, null, null); - writer.WriteProperty(options, PropBootstrap, value.Bootstrap, null, null); - writer.WriteProperty(options, PropClient, value.Client, null, null); - writer.WriteProperty(options, PropCluster, value.Cluster, null, null); - writer.WriteProperty(options, PropDiscovery, value.Discovery, null, null); - writer.WriteProperty(options, PropHttp, value.Http, null, null); - writer.WriteProperty(options, PropIngest, value.Ingest, null, null); - writer.WriteProperty(options, PropNetwork, value.Network, null, null); - writer.WriteProperty(options, PropNode, value.Node, null, null); - writer.WriteProperty(options, PropPath, value.Path, null, null); - writer.WriteProperty(options, PropRepositories, value.Repositories, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropSearch, value.Search, null, null); - writer.WriteProperty(options, PropTransport, value.Transport, null, null); - writer.WriteProperty(options, PropXpack, value.Xpack, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoSettingsConverter))] public sealed partial class NodeInfoSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsCluster.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsCluster.Converters.g.cs new file mode 100644 index 00000000000..93f31e73d1b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsCluster.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoSettingsClusterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDeprecationIndexing = System.Text.Json.JsonEncodedText.Encode("deprecation_indexing"); + private static readonly System.Text.Json.JsonEncodedText PropElection = System.Text.Json.JsonEncodedText.Encode("election"); + private static readonly System.Text.Json.JsonEncodedText PropInitialMasterNodes = System.Text.Json.JsonEncodedText.Encode("initial_master_nodes"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsCluster Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDeprecationIndexing = default; + LocalJsonValue propElection = default; + LocalJsonValue?> propInitialMasterNodes = default; + LocalJsonValue propName = default; + LocalJsonValue propRouting = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDeprecationIndexing.TryReadProperty(ref reader, options, PropDeprecationIndexing, null)) + { + continue; + } + + if (propElection.TryReadProperty(ref reader, options, PropElection, null)) + { + continue; + } + + if (propInitialMasterNodes.TryReadProperty(ref reader, options, PropInitialMasterNodes, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsCluster(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DeprecationIndexing = propDeprecationIndexing.Value, + Election = propElection.Value, + InitialMasterNodes = propInitialMasterNodes.Value, + Name = propName.Value, + Routing = propRouting.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsCluster value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDeprecationIndexing, value.DeprecationIndexing, null, null); + writer.WriteProperty(options, PropElection, value.Election, null, null); + writer.WriteProperty(options, PropInitialMasterNodes, value.InitialMasterNodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsCluster.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsCluster.g.cs index 5ef13fa94db..5a24c46a1ef 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsCluster.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsCluster.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoSettingsClusterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDeprecationIndexing = System.Text.Json.JsonEncodedText.Encode("deprecation_indexing"); - private static readonly System.Text.Json.JsonEncodedText PropElection = System.Text.Json.JsonEncodedText.Encode("election"); - private static readonly System.Text.Json.JsonEncodedText PropInitialMasterNodes = System.Text.Json.JsonEncodedText.Encode("initial_master_nodes"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsCluster Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDeprecationIndexing = default; - LocalJsonValue propElection = default; - LocalJsonValue?> propInitialMasterNodes = default; - LocalJsonValue propName = default; - LocalJsonValue propRouting = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDeprecationIndexing.TryReadProperty(ref reader, options, PropDeprecationIndexing, null)) - { - continue; - } - - if (propElection.TryReadProperty(ref reader, options, PropElection, null)) - { - continue; - } - - if (propInitialMasterNodes.TryReadProperty(ref reader, options, PropInitialMasterNodes, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsCluster(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DeprecationIndexing = propDeprecationIndexing.Value, - Election = propElection.Value, - InitialMasterNodes = propInitialMasterNodes.Value, - Name = propName.Value, - Routing = propRouting.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsCluster value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDeprecationIndexing, value.DeprecationIndexing, null, null); - writer.WriteProperty(options, PropElection, value.Election, null, null); - writer.WriteProperty(options, PropInitialMasterNodes, value.InitialMasterNodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsClusterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoSettingsClusterConverter))] public sealed partial class NodeInfoSettingsCluster { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsClusterElection.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsClusterElection.Converters.g.cs new file mode 100644 index 00000000000..a13f318e979 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsClusterElection.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoSettingsClusterElectionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStrategy = System.Text.Json.JsonEncodedText.Encode("strategy"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsClusterElection Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propStrategy = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStrategy.TryReadProperty(ref reader, options, PropStrategy, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsClusterElection(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Strategy = propStrategy.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsClusterElection value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStrategy, value.Strategy, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsClusterElection.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsClusterElection.g.cs index 3036f61e73a..f0ab1f7233d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsClusterElection.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsClusterElection.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoSettingsClusterElectionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStrategy = System.Text.Json.JsonEncodedText.Encode("strategy"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsClusterElection Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propStrategy = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStrategy.TryReadProperty(ref reader, options, PropStrategy, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsClusterElection(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Strategy = propStrategy.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsClusterElection value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStrategy, value.Strategy, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsClusterElectionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoSettingsClusterElectionConverter))] public sealed partial class NodeInfoSettingsClusterElection { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsHttp.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsHttp.Converters.g.cs new file mode 100644 index 00000000000..30a2921e869 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsHttp.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoSettingsHttpConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCompression = System.Text.Json.JsonEncodedText.Encode("compression"); + private static readonly System.Text.Json.JsonEncodedText PropPort = System.Text.Json.JsonEncodedText.Encode("port"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropTypeDefault = System.Text.Json.JsonEncodedText.Encode("type.default"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsHttp Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propCompression = default; + LocalJsonValue?> propPort = default; + LocalJsonValue propType = default; + LocalJsonValue propTypeDefault = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCompression.TryReadProperty(ref reader, options, PropCompression, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) + { + continue; + } + + if (propPort.TryReadProperty(ref reader, options, PropPort, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (propTypeDefault.TryReadProperty(ref reader, options, PropTypeDefault, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsHttp(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Compression = propCompression.Value, + Port = propPort.Value, + Type = propType.Value, + TypeDefault = propTypeDefault.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsHttp value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCompression, value.Compression, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); + writer.WriteProperty(options, PropPort, value.Port, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropTypeDefault, value.TypeDefault, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsHttp.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsHttp.g.cs index e89a5404168..44f2c94a2d9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsHttp.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsHttp.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoSettingsHttpConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCompression = System.Text.Json.JsonEncodedText.Encode("compression"); - private static readonly System.Text.Json.JsonEncodedText PropPort = System.Text.Json.JsonEncodedText.Encode("port"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropTypeDefault = System.Text.Json.JsonEncodedText.Encode("type.default"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsHttp Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propCompression = default; - LocalJsonValue?> propPort = default; - LocalJsonValue propType = default; - LocalJsonValue propTypeDefault = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCompression.TryReadProperty(ref reader, options, PropCompression, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) - { - continue; - } - - if (propPort.TryReadProperty(ref reader, options, PropPort, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (propTypeDefault.TryReadProperty(ref reader, options, PropTypeDefault, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsHttp(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Compression = propCompression.Value, - Port = propPort.Value, - Type = propType.Value, - TypeDefault = propTypeDefault.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsHttp value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCompression, value.Compression, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); - writer.WriteProperty(options, PropPort, value.Port, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropTypeDefault, value.TypeDefault, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsHttpConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoSettingsHttpConverter))] public sealed partial class NodeInfoSettingsHttp { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsHttpType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsHttpType.Converters.g.cs new file mode 100644 index 00000000000..c075f2c6640 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsHttpType.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoSettingsHttpTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDefault = System.Text.Json.JsonEncodedText.Encode("default"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsHttpType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) + { + var value = reader.ReadValue(options, null); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsHttpType(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Default = value + }; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDefault = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDefault.TryReadProperty(ref reader, options, PropDefault, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsHttpType(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Default = propDefault.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsHttpType value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDefault, value.Default, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsHttpType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsHttpType.g.cs index a7e521ff4b5..9f81b39f733 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsHttpType.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsHttpType.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoSettingsHttpTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDefault = System.Text.Json.JsonEncodedText.Encode("default"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsHttpType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) - { - var value = reader.ReadValue(options, null); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsHttpType(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Default = value - }; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDefault = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDefault.TryReadProperty(ref reader, options, PropDefault, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsHttpType(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Default = propDefault.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsHttpType value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDefault, value.Default, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsHttpTypeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoSettingsHttpTypeConverter))] public sealed partial class NodeInfoSettingsHttpType { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsIngest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsIngest.Converters.g.cs new file mode 100644 index 00000000000..6e6813752b0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsIngest.Converters.g.cs @@ -0,0 +1,360 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoSettingsIngestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAppend = System.Text.Json.JsonEncodedText.Encode("append"); + private static readonly System.Text.Json.JsonEncodedText PropAttachment = System.Text.Json.JsonEncodedText.Encode("attachment"); + private static readonly System.Text.Json.JsonEncodedText PropBytes = System.Text.Json.JsonEncodedText.Encode("bytes"); + private static readonly System.Text.Json.JsonEncodedText PropCircle = System.Text.Json.JsonEncodedText.Encode("circle"); + private static readonly System.Text.Json.JsonEncodedText PropConvert = System.Text.Json.JsonEncodedText.Encode("convert"); + private static readonly System.Text.Json.JsonEncodedText PropCsv = System.Text.Json.JsonEncodedText.Encode("csv"); + private static readonly System.Text.Json.JsonEncodedText PropDate = System.Text.Json.JsonEncodedText.Encode("date"); + private static readonly System.Text.Json.JsonEncodedText PropDateIndexName = System.Text.Json.JsonEncodedText.Encode("date_index_name"); + private static readonly System.Text.Json.JsonEncodedText PropDissect = System.Text.Json.JsonEncodedText.Encode("dissect"); + private static readonly System.Text.Json.JsonEncodedText PropDotExpander = System.Text.Json.JsonEncodedText.Encode("dot_expander"); + private static readonly System.Text.Json.JsonEncodedText PropDrop = System.Text.Json.JsonEncodedText.Encode("drop"); + private static readonly System.Text.Json.JsonEncodedText PropEnrich = System.Text.Json.JsonEncodedText.Encode("enrich"); + private static readonly System.Text.Json.JsonEncodedText PropFail = System.Text.Json.JsonEncodedText.Encode("fail"); + private static readonly System.Text.Json.JsonEncodedText PropForeach = System.Text.Json.JsonEncodedText.Encode("foreach"); + private static readonly System.Text.Json.JsonEncodedText PropGeoip = System.Text.Json.JsonEncodedText.Encode("geoip"); + private static readonly System.Text.Json.JsonEncodedText PropGrok = System.Text.Json.JsonEncodedText.Encode("grok"); + private static readonly System.Text.Json.JsonEncodedText PropGsub = System.Text.Json.JsonEncodedText.Encode("gsub"); + private static readonly System.Text.Json.JsonEncodedText PropInference = System.Text.Json.JsonEncodedText.Encode("inference"); + private static readonly System.Text.Json.JsonEncodedText PropJoin = System.Text.Json.JsonEncodedText.Encode("join"); + private static readonly System.Text.Json.JsonEncodedText PropJson = System.Text.Json.JsonEncodedText.Encode("json"); + private static readonly System.Text.Json.JsonEncodedText PropKv = System.Text.Json.JsonEncodedText.Encode("kv"); + private static readonly System.Text.Json.JsonEncodedText PropLowercase = System.Text.Json.JsonEncodedText.Encode("lowercase"); + private static readonly System.Text.Json.JsonEncodedText PropPipeline = System.Text.Json.JsonEncodedText.Encode("pipeline"); + private static readonly System.Text.Json.JsonEncodedText PropRemove = System.Text.Json.JsonEncodedText.Encode("remove"); + private static readonly System.Text.Json.JsonEncodedText PropRename = System.Text.Json.JsonEncodedText.Encode("rename"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropSet = System.Text.Json.JsonEncodedText.Encode("set"); + private static readonly System.Text.Json.JsonEncodedText PropSetSecurityUser = System.Text.Json.JsonEncodedText.Encode("set_security_user"); + private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); + private static readonly System.Text.Json.JsonEncodedText PropSplit = System.Text.Json.JsonEncodedText.Encode("split"); + private static readonly System.Text.Json.JsonEncodedText PropTrim = System.Text.Json.JsonEncodedText.Encode("trim"); + private static readonly System.Text.Json.JsonEncodedText PropUppercase = System.Text.Json.JsonEncodedText.Encode("uppercase"); + private static readonly System.Text.Json.JsonEncodedText PropUrlDecode = System.Text.Json.JsonEncodedText.Encode("urldecode"); + private static readonly System.Text.Json.JsonEncodedText PropUserAgent = System.Text.Json.JsonEncodedText.Encode("user_agent"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsIngest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAppend = default; + LocalJsonValue propAttachment = default; + LocalJsonValue propBytes = default; + LocalJsonValue propCircle = default; + LocalJsonValue propConvert = default; + LocalJsonValue propCsv = default; + LocalJsonValue propDate = default; + LocalJsonValue propDateIndexName = default; + LocalJsonValue propDissect = default; + LocalJsonValue propDotExpander = default; + LocalJsonValue propDrop = default; + LocalJsonValue propEnrich = default; + LocalJsonValue propFail = default; + LocalJsonValue propForeach = default; + LocalJsonValue propGeoip = default; + LocalJsonValue propGrok = default; + LocalJsonValue propGsub = default; + LocalJsonValue propInference = default; + LocalJsonValue propJoin = default; + LocalJsonValue propJson = default; + LocalJsonValue propKv = default; + LocalJsonValue propLowercase = default; + LocalJsonValue propPipeline = default; + LocalJsonValue propRemove = default; + LocalJsonValue propRename = default; + LocalJsonValue propScript = default; + LocalJsonValue propSet = default; + LocalJsonValue propSetSecurityUser = default; + LocalJsonValue propSort = default; + LocalJsonValue propSplit = default; + LocalJsonValue propTrim = default; + LocalJsonValue propUppercase = default; + LocalJsonValue propUrlDecode = default; + LocalJsonValue propUserAgent = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAppend.TryReadProperty(ref reader, options, PropAppend, null)) + { + continue; + } + + if (propAttachment.TryReadProperty(ref reader, options, PropAttachment, null)) + { + continue; + } + + if (propBytes.TryReadProperty(ref reader, options, PropBytes, null)) + { + continue; + } + + if (propCircle.TryReadProperty(ref reader, options, PropCircle, null)) + { + continue; + } + + if (propConvert.TryReadProperty(ref reader, options, PropConvert, null)) + { + continue; + } + + if (propCsv.TryReadProperty(ref reader, options, PropCsv, null)) + { + continue; + } + + if (propDate.TryReadProperty(ref reader, options, PropDate, null)) + { + continue; + } + + if (propDateIndexName.TryReadProperty(ref reader, options, PropDateIndexName, null)) + { + continue; + } + + if (propDissect.TryReadProperty(ref reader, options, PropDissect, null)) + { + continue; + } + + if (propDotExpander.TryReadProperty(ref reader, options, PropDotExpander, null)) + { + continue; + } + + if (propDrop.TryReadProperty(ref reader, options, PropDrop, null)) + { + continue; + } + + if (propEnrich.TryReadProperty(ref reader, options, PropEnrich, null)) + { + continue; + } + + if (propFail.TryReadProperty(ref reader, options, PropFail, null)) + { + continue; + } + + if (propForeach.TryReadProperty(ref reader, options, PropForeach, null)) + { + continue; + } + + if (propGeoip.TryReadProperty(ref reader, options, PropGeoip, null)) + { + continue; + } + + if (propGrok.TryReadProperty(ref reader, options, PropGrok, null)) + { + continue; + } + + if (propGsub.TryReadProperty(ref reader, options, PropGsub, null)) + { + continue; + } + + if (propInference.TryReadProperty(ref reader, options, PropInference, null)) + { + continue; + } + + if (propJoin.TryReadProperty(ref reader, options, PropJoin, null)) + { + continue; + } + + if (propJson.TryReadProperty(ref reader, options, PropJson, null)) + { + continue; + } + + if (propKv.TryReadProperty(ref reader, options, PropKv, null)) + { + continue; + } + + if (propLowercase.TryReadProperty(ref reader, options, PropLowercase, null)) + { + continue; + } + + if (propPipeline.TryReadProperty(ref reader, options, PropPipeline, null)) + { + continue; + } + + if (propRemove.TryReadProperty(ref reader, options, PropRemove, null)) + { + continue; + } + + if (propRename.TryReadProperty(ref reader, options, PropRename, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propSet.TryReadProperty(ref reader, options, PropSet, null)) + { + continue; + } + + if (propSetSecurityUser.TryReadProperty(ref reader, options, PropSetSecurityUser, null)) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, null)) + { + continue; + } + + if (propSplit.TryReadProperty(ref reader, options, PropSplit, null)) + { + continue; + } + + if (propTrim.TryReadProperty(ref reader, options, PropTrim, null)) + { + continue; + } + + if (propUppercase.TryReadProperty(ref reader, options, PropUppercase, null)) + { + continue; + } + + if (propUrlDecode.TryReadProperty(ref reader, options, PropUrlDecode, null)) + { + continue; + } + + if (propUserAgent.TryReadProperty(ref reader, options, PropUserAgent, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsIngest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Append = propAppend.Value, + Attachment = propAttachment.Value, + Bytes = propBytes.Value, + Circle = propCircle.Value, + Convert = propConvert.Value, + Csv = propCsv.Value, + Date = propDate.Value, + DateIndexName = propDateIndexName.Value, + Dissect = propDissect.Value, + DotExpander = propDotExpander.Value, + Drop = propDrop.Value, + Enrich = propEnrich.Value, + Fail = propFail.Value, + Foreach = propForeach.Value, + Geoip = propGeoip.Value, + Grok = propGrok.Value, + Gsub = propGsub.Value, + Inference = propInference.Value, + Join = propJoin.Value, + Json = propJson.Value, + Kv = propKv.Value, + Lowercase = propLowercase.Value, + Pipeline = propPipeline.Value, + Remove = propRemove.Value, + Rename = propRename.Value, + Script = propScript.Value, + Set = propSet.Value, + SetSecurityUser = propSetSecurityUser.Value, + Sort = propSort.Value, + Split = propSplit.Value, + Trim = propTrim.Value, + Uppercase = propUppercase.Value, + UrlDecode = propUrlDecode.Value, + UserAgent = propUserAgent.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsIngest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAppend, value.Append, null, null); + writer.WriteProperty(options, PropAttachment, value.Attachment, null, null); + writer.WriteProperty(options, PropBytes, value.Bytes, null, null); + writer.WriteProperty(options, PropCircle, value.Circle, null, null); + writer.WriteProperty(options, PropConvert, value.Convert, null, null); + writer.WriteProperty(options, PropCsv, value.Csv, null, null); + writer.WriteProperty(options, PropDate, value.Date, null, null); + writer.WriteProperty(options, PropDateIndexName, value.DateIndexName, null, null); + writer.WriteProperty(options, PropDissect, value.Dissect, null, null); + writer.WriteProperty(options, PropDotExpander, value.DotExpander, null, null); + writer.WriteProperty(options, PropDrop, value.Drop, null, null); + writer.WriteProperty(options, PropEnrich, value.Enrich, null, null); + writer.WriteProperty(options, PropFail, value.Fail, null, null); + writer.WriteProperty(options, PropForeach, value.Foreach, null, null); + writer.WriteProperty(options, PropGeoip, value.Geoip, null, null); + writer.WriteProperty(options, PropGrok, value.Grok, null, null); + writer.WriteProperty(options, PropGsub, value.Gsub, null, null); + writer.WriteProperty(options, PropInference, value.Inference, null, null); + writer.WriteProperty(options, PropJoin, value.Join, null, null); + writer.WriteProperty(options, PropJson, value.Json, null, null); + writer.WriteProperty(options, PropKv, value.Kv, null, null); + writer.WriteProperty(options, PropLowercase, value.Lowercase, null, null); + writer.WriteProperty(options, PropPipeline, value.Pipeline, null, null); + writer.WriteProperty(options, PropRemove, value.Remove, null, null); + writer.WriteProperty(options, PropRename, value.Rename, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropSet, value.Set, null, null); + writer.WriteProperty(options, PropSetSecurityUser, value.SetSecurityUser, null, null); + writer.WriteProperty(options, PropSort, value.Sort, null, null); + writer.WriteProperty(options, PropSplit, value.Split, null, null); + writer.WriteProperty(options, PropTrim, value.Trim, null, null); + writer.WriteProperty(options, PropUppercase, value.Uppercase, null, null); + writer.WriteProperty(options, PropUrlDecode, value.UrlDecode, null, null); + writer.WriteProperty(options, PropUserAgent, value.UserAgent, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsIngest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsIngest.g.cs index 7a7331023a4..47e7f83ce37 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsIngest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsIngest.g.cs @@ -23,343 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoSettingsIngestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAppend = System.Text.Json.JsonEncodedText.Encode("append"); - private static readonly System.Text.Json.JsonEncodedText PropAttachment = System.Text.Json.JsonEncodedText.Encode("attachment"); - private static readonly System.Text.Json.JsonEncodedText PropBytes = System.Text.Json.JsonEncodedText.Encode("bytes"); - private static readonly System.Text.Json.JsonEncodedText PropCircle = System.Text.Json.JsonEncodedText.Encode("circle"); - private static readonly System.Text.Json.JsonEncodedText PropConvert = System.Text.Json.JsonEncodedText.Encode("convert"); - private static readonly System.Text.Json.JsonEncodedText PropCsv = System.Text.Json.JsonEncodedText.Encode("csv"); - private static readonly System.Text.Json.JsonEncodedText PropDate = System.Text.Json.JsonEncodedText.Encode("date"); - private static readonly System.Text.Json.JsonEncodedText PropDateIndexName = System.Text.Json.JsonEncodedText.Encode("date_index_name"); - private static readonly System.Text.Json.JsonEncodedText PropDissect = System.Text.Json.JsonEncodedText.Encode("dissect"); - private static readonly System.Text.Json.JsonEncodedText PropDotExpander = System.Text.Json.JsonEncodedText.Encode("dot_expander"); - private static readonly System.Text.Json.JsonEncodedText PropDrop = System.Text.Json.JsonEncodedText.Encode("drop"); - private static readonly System.Text.Json.JsonEncodedText PropEnrich = System.Text.Json.JsonEncodedText.Encode("enrich"); - private static readonly System.Text.Json.JsonEncodedText PropFail = System.Text.Json.JsonEncodedText.Encode("fail"); - private static readonly System.Text.Json.JsonEncodedText PropForeach = System.Text.Json.JsonEncodedText.Encode("foreach"); - private static readonly System.Text.Json.JsonEncodedText PropGeoip = System.Text.Json.JsonEncodedText.Encode("geoip"); - private static readonly System.Text.Json.JsonEncodedText PropGrok = System.Text.Json.JsonEncodedText.Encode("grok"); - private static readonly System.Text.Json.JsonEncodedText PropGsub = System.Text.Json.JsonEncodedText.Encode("gsub"); - private static readonly System.Text.Json.JsonEncodedText PropInference = System.Text.Json.JsonEncodedText.Encode("inference"); - private static readonly System.Text.Json.JsonEncodedText PropJoin = System.Text.Json.JsonEncodedText.Encode("join"); - private static readonly System.Text.Json.JsonEncodedText PropJson = System.Text.Json.JsonEncodedText.Encode("json"); - private static readonly System.Text.Json.JsonEncodedText PropKv = System.Text.Json.JsonEncodedText.Encode("kv"); - private static readonly System.Text.Json.JsonEncodedText PropLowercase = System.Text.Json.JsonEncodedText.Encode("lowercase"); - private static readonly System.Text.Json.JsonEncodedText PropPipeline = System.Text.Json.JsonEncodedText.Encode("pipeline"); - private static readonly System.Text.Json.JsonEncodedText PropRemove = System.Text.Json.JsonEncodedText.Encode("remove"); - private static readonly System.Text.Json.JsonEncodedText PropRename = System.Text.Json.JsonEncodedText.Encode("rename"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropSet = System.Text.Json.JsonEncodedText.Encode("set"); - private static readonly System.Text.Json.JsonEncodedText PropSetSecurityUser = System.Text.Json.JsonEncodedText.Encode("set_security_user"); - private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); - private static readonly System.Text.Json.JsonEncodedText PropSplit = System.Text.Json.JsonEncodedText.Encode("split"); - private static readonly System.Text.Json.JsonEncodedText PropTrim = System.Text.Json.JsonEncodedText.Encode("trim"); - private static readonly System.Text.Json.JsonEncodedText PropUppercase = System.Text.Json.JsonEncodedText.Encode("uppercase"); - private static readonly System.Text.Json.JsonEncodedText PropUrlDecode = System.Text.Json.JsonEncodedText.Encode("urldecode"); - private static readonly System.Text.Json.JsonEncodedText PropUserAgent = System.Text.Json.JsonEncodedText.Encode("user_agent"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsIngest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAppend = default; - LocalJsonValue propAttachment = default; - LocalJsonValue propBytes = default; - LocalJsonValue propCircle = default; - LocalJsonValue propConvert = default; - LocalJsonValue propCsv = default; - LocalJsonValue propDate = default; - LocalJsonValue propDateIndexName = default; - LocalJsonValue propDissect = default; - LocalJsonValue propDotExpander = default; - LocalJsonValue propDrop = default; - LocalJsonValue propEnrich = default; - LocalJsonValue propFail = default; - LocalJsonValue propForeach = default; - LocalJsonValue propGeoip = default; - LocalJsonValue propGrok = default; - LocalJsonValue propGsub = default; - LocalJsonValue propInference = default; - LocalJsonValue propJoin = default; - LocalJsonValue propJson = default; - LocalJsonValue propKv = default; - LocalJsonValue propLowercase = default; - LocalJsonValue propPipeline = default; - LocalJsonValue propRemove = default; - LocalJsonValue propRename = default; - LocalJsonValue propScript = default; - LocalJsonValue propSet = default; - LocalJsonValue propSetSecurityUser = default; - LocalJsonValue propSort = default; - LocalJsonValue propSplit = default; - LocalJsonValue propTrim = default; - LocalJsonValue propUppercase = default; - LocalJsonValue propUrlDecode = default; - LocalJsonValue propUserAgent = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAppend.TryReadProperty(ref reader, options, PropAppend, null)) - { - continue; - } - - if (propAttachment.TryReadProperty(ref reader, options, PropAttachment, null)) - { - continue; - } - - if (propBytes.TryReadProperty(ref reader, options, PropBytes, null)) - { - continue; - } - - if (propCircle.TryReadProperty(ref reader, options, PropCircle, null)) - { - continue; - } - - if (propConvert.TryReadProperty(ref reader, options, PropConvert, null)) - { - continue; - } - - if (propCsv.TryReadProperty(ref reader, options, PropCsv, null)) - { - continue; - } - - if (propDate.TryReadProperty(ref reader, options, PropDate, null)) - { - continue; - } - - if (propDateIndexName.TryReadProperty(ref reader, options, PropDateIndexName, null)) - { - continue; - } - - if (propDissect.TryReadProperty(ref reader, options, PropDissect, null)) - { - continue; - } - - if (propDotExpander.TryReadProperty(ref reader, options, PropDotExpander, null)) - { - continue; - } - - if (propDrop.TryReadProperty(ref reader, options, PropDrop, null)) - { - continue; - } - - if (propEnrich.TryReadProperty(ref reader, options, PropEnrich, null)) - { - continue; - } - - if (propFail.TryReadProperty(ref reader, options, PropFail, null)) - { - continue; - } - - if (propForeach.TryReadProperty(ref reader, options, PropForeach, null)) - { - continue; - } - - if (propGeoip.TryReadProperty(ref reader, options, PropGeoip, null)) - { - continue; - } - - if (propGrok.TryReadProperty(ref reader, options, PropGrok, null)) - { - continue; - } - - if (propGsub.TryReadProperty(ref reader, options, PropGsub, null)) - { - continue; - } - - if (propInference.TryReadProperty(ref reader, options, PropInference, null)) - { - continue; - } - - if (propJoin.TryReadProperty(ref reader, options, PropJoin, null)) - { - continue; - } - - if (propJson.TryReadProperty(ref reader, options, PropJson, null)) - { - continue; - } - - if (propKv.TryReadProperty(ref reader, options, PropKv, null)) - { - continue; - } - - if (propLowercase.TryReadProperty(ref reader, options, PropLowercase, null)) - { - continue; - } - - if (propPipeline.TryReadProperty(ref reader, options, PropPipeline, null)) - { - continue; - } - - if (propRemove.TryReadProperty(ref reader, options, PropRemove, null)) - { - continue; - } - - if (propRename.TryReadProperty(ref reader, options, PropRename, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propSet.TryReadProperty(ref reader, options, PropSet, null)) - { - continue; - } - - if (propSetSecurityUser.TryReadProperty(ref reader, options, PropSetSecurityUser, null)) - { - continue; - } - - if (propSort.TryReadProperty(ref reader, options, PropSort, null)) - { - continue; - } - - if (propSplit.TryReadProperty(ref reader, options, PropSplit, null)) - { - continue; - } - - if (propTrim.TryReadProperty(ref reader, options, PropTrim, null)) - { - continue; - } - - if (propUppercase.TryReadProperty(ref reader, options, PropUppercase, null)) - { - continue; - } - - if (propUrlDecode.TryReadProperty(ref reader, options, PropUrlDecode, null)) - { - continue; - } - - if (propUserAgent.TryReadProperty(ref reader, options, PropUserAgent, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsIngest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Append = propAppend.Value, - Attachment = propAttachment.Value, - Bytes = propBytes.Value, - Circle = propCircle.Value, - Convert = propConvert.Value, - Csv = propCsv.Value, - Date = propDate.Value, - DateIndexName = propDateIndexName.Value, - Dissect = propDissect.Value, - DotExpander = propDotExpander.Value, - Drop = propDrop.Value, - Enrich = propEnrich.Value, - Fail = propFail.Value, - Foreach = propForeach.Value, - Geoip = propGeoip.Value, - Grok = propGrok.Value, - Gsub = propGsub.Value, - Inference = propInference.Value, - Join = propJoin.Value, - Json = propJson.Value, - Kv = propKv.Value, - Lowercase = propLowercase.Value, - Pipeline = propPipeline.Value, - Remove = propRemove.Value, - Rename = propRename.Value, - Script = propScript.Value, - Set = propSet.Value, - SetSecurityUser = propSetSecurityUser.Value, - Sort = propSort.Value, - Split = propSplit.Value, - Trim = propTrim.Value, - Uppercase = propUppercase.Value, - UrlDecode = propUrlDecode.Value, - UserAgent = propUserAgent.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsIngest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAppend, value.Append, null, null); - writer.WriteProperty(options, PropAttachment, value.Attachment, null, null); - writer.WriteProperty(options, PropBytes, value.Bytes, null, null); - writer.WriteProperty(options, PropCircle, value.Circle, null, null); - writer.WriteProperty(options, PropConvert, value.Convert, null, null); - writer.WriteProperty(options, PropCsv, value.Csv, null, null); - writer.WriteProperty(options, PropDate, value.Date, null, null); - writer.WriteProperty(options, PropDateIndexName, value.DateIndexName, null, null); - writer.WriteProperty(options, PropDissect, value.Dissect, null, null); - writer.WriteProperty(options, PropDotExpander, value.DotExpander, null, null); - writer.WriteProperty(options, PropDrop, value.Drop, null, null); - writer.WriteProperty(options, PropEnrich, value.Enrich, null, null); - writer.WriteProperty(options, PropFail, value.Fail, null, null); - writer.WriteProperty(options, PropForeach, value.Foreach, null, null); - writer.WriteProperty(options, PropGeoip, value.Geoip, null, null); - writer.WriteProperty(options, PropGrok, value.Grok, null, null); - writer.WriteProperty(options, PropGsub, value.Gsub, null, null); - writer.WriteProperty(options, PropInference, value.Inference, null, null); - writer.WriteProperty(options, PropJoin, value.Join, null, null); - writer.WriteProperty(options, PropJson, value.Json, null, null); - writer.WriteProperty(options, PropKv, value.Kv, null, null); - writer.WriteProperty(options, PropLowercase, value.Lowercase, null, null); - writer.WriteProperty(options, PropPipeline, value.Pipeline, null, null); - writer.WriteProperty(options, PropRemove, value.Remove, null, null); - writer.WriteProperty(options, PropRename, value.Rename, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropSet, value.Set, null, null); - writer.WriteProperty(options, PropSetSecurityUser, value.SetSecurityUser, null, null); - writer.WriteProperty(options, PropSort, value.Sort, null, null); - writer.WriteProperty(options, PropSplit, value.Split, null, null); - writer.WriteProperty(options, PropTrim, value.Trim, null, null); - writer.WriteProperty(options, PropUppercase, value.Uppercase, null, null); - writer.WriteProperty(options, PropUrlDecode, value.UrlDecode, null, null); - writer.WriteProperty(options, PropUserAgent, value.UserAgent, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsIngestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoSettingsIngestConverter))] public sealed partial class NodeInfoSettingsIngest { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsNetwork.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsNetwork.Converters.g.cs new file mode 100644 index 00000000000..d41c59bb1aa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsNetwork.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoSettingsNetworkConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropHost = System.Text.Json.JsonEncodedText.Encode("host"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsNetwork Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propHost = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propHost.TryReadProperty(ref reader, options, PropHost, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsNetwork(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Host = propHost.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsNetwork value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropHost, value.Host, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsNetwork.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsNetwork.g.cs index 9a80686d650..9317e123978 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsNetwork.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsNetwork.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoSettingsNetworkConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropHost = System.Text.Json.JsonEncodedText.Encode("host"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsNetwork Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propHost = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propHost.TryReadProperty(ref reader, options, PropHost, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsNetwork(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Host = propHost.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsNetwork value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropHost, value.Host, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsNetworkConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoSettingsNetworkConverter))] public sealed partial class NodeInfoSettingsNetwork { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsNode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsNode.Converters.g.cs new file mode 100644 index 00000000000..b306940676d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsNode.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoSettingsNodeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAttr = System.Text.Json.JsonEncodedText.Encode("attr"); + private static readonly System.Text.Json.JsonEncodedText PropMaxLocalStorageNodes = System.Text.Json.JsonEncodedText.Encode("max_local_storage_nodes"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsNode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propAttr = default; + LocalJsonValue propMaxLocalStorageNodes = default; + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAttr.TryReadProperty(ref reader, options, PropAttr, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (propMaxLocalStorageNodes.TryReadProperty(ref reader, options, PropMaxLocalStorageNodes, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsNode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Attr = propAttr.Value, + MaxLocalStorageNodes = propMaxLocalStorageNodes.Value, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsNode value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAttr, value.Attr, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropMaxLocalStorageNodes, value.MaxLocalStorageNodes, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsNode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsNode.g.cs index d68bcc71cb4..c282658b3e8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsNode.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsNode.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoSettingsNodeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAttr = System.Text.Json.JsonEncodedText.Encode("attr"); - private static readonly System.Text.Json.JsonEncodedText PropMaxLocalStorageNodes = System.Text.Json.JsonEncodedText.Encode("max_local_storage_nodes"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsNode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propAttr = default; - LocalJsonValue propMaxLocalStorageNodes = default; - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAttr.TryReadProperty(ref reader, options, PropAttr, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (propMaxLocalStorageNodes.TryReadProperty(ref reader, options, PropMaxLocalStorageNodes, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsNode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Attr = propAttr.Value, - MaxLocalStorageNodes = propMaxLocalStorageNodes.Value, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsNode value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAttr, value.Attr, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropMaxLocalStorageNodes, value.MaxLocalStorageNodes, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsNodeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoSettingsNodeConverter))] public sealed partial class NodeInfoSettingsNode { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransport.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransport.Converters.g.cs new file mode 100644 index 00000000000..7e4776edf05 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransport.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoSettingsTransportConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFeatures = System.Text.Json.JsonEncodedText.Encode("features"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreDeserializationErrors = System.Text.Json.JsonEncodedText.Encode("ignore_deserialization_errors"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropTypeDefault = System.Text.Json.JsonEncodedText.Encode("type.default"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsTransport Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFeatures = default; + LocalJsonValue propIgnoreDeserializationErrors = default; + LocalJsonValue propType = default; + LocalJsonValue propTypeDefault = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFeatures.TryReadProperty(ref reader, options, PropFeatures, null)) + { + continue; + } + + if (propIgnoreDeserializationErrors.TryReadProperty(ref reader, options, PropIgnoreDeserializationErrors, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (propTypeDefault.TryReadProperty(ref reader, options, PropTypeDefault, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsTransport(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Features = propFeatures.Value, + IgnoreDeserializationErrors = propIgnoreDeserializationErrors.Value, + Type = propType.Value, + TypeDefault = propTypeDefault.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsTransport value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFeatures, value.Features, null, null); + writer.WriteProperty(options, PropIgnoreDeserializationErrors, value.IgnoreDeserializationErrors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropTypeDefault, value.TypeDefault, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransport.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransport.g.cs index d1982b8628f..134372c3e40 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransport.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransport.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoSettingsTransportConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFeatures = System.Text.Json.JsonEncodedText.Encode("features"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreDeserializationErrors = System.Text.Json.JsonEncodedText.Encode("ignore_deserialization_errors"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropTypeDefault = System.Text.Json.JsonEncodedText.Encode("type.default"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsTransport Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFeatures = default; - LocalJsonValue propIgnoreDeserializationErrors = default; - LocalJsonValue propType = default; - LocalJsonValue propTypeDefault = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFeatures.TryReadProperty(ref reader, options, PropFeatures, null)) - { - continue; - } - - if (propIgnoreDeserializationErrors.TryReadProperty(ref reader, options, PropIgnoreDeserializationErrors, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (propTypeDefault.TryReadProperty(ref reader, options, PropTypeDefault, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsTransport(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Features = propFeatures.Value, - IgnoreDeserializationErrors = propIgnoreDeserializationErrors.Value, - Type = propType.Value, - TypeDefault = propTypeDefault.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsTransport value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFeatures, value.Features, null, null); - writer.WriteProperty(options, PropIgnoreDeserializationErrors, value.IgnoreDeserializationErrors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropTypeDefault, value.TypeDefault, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsTransportConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoSettingsTransportConverter))] public sealed partial class NodeInfoSettingsTransport { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransportFeatures.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransportFeatures.Converters.g.cs new file mode 100644 index 00000000000..87df9ed0eff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransportFeatures.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoSettingsTransportFeaturesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropXPack = System.Text.Json.JsonEncodedText.Encode("x-pack"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsTransportFeatures Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propXPack = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propXPack.TryReadProperty(ref reader, options, PropXPack, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsTransportFeatures(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + XPack = propXPack.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsTransportFeatures value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropXPack, value.XPack, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransportFeatures.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransportFeatures.g.cs index bd7d494e12d..8f242d40c7b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransportFeatures.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransportFeatures.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoSettingsTransportFeaturesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropXPack = System.Text.Json.JsonEncodedText.Encode("x-pack"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsTransportFeatures Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propXPack = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propXPack.TryReadProperty(ref reader, options, PropXPack, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsTransportFeatures(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - XPack = propXPack.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsTransportFeatures value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropXPack, value.XPack, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsTransportFeaturesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoSettingsTransportFeaturesConverter))] public sealed partial class NodeInfoSettingsTransportFeatures { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransportType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransportType.Converters.g.cs new file mode 100644 index 00000000000..83bf7864b85 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransportType.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoSettingsTransportTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDefault = System.Text.Json.JsonEncodedText.Encode("default"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsTransportType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) + { + var value = reader.ReadValue(options, null); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsTransportType(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Default = value + }; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDefault = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDefault.TryReadProperty(ref reader, options, PropDefault, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsTransportType(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Default = propDefault.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsTransportType value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDefault, value.Default, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransportType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransportType.g.cs index 0636c5dec13..df4dfff77cb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransportType.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoSettingsTransportType.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoSettingsTransportTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDefault = System.Text.Json.JsonEncodedText.Encode("default"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsTransportType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) - { - var value = reader.ReadValue(options, null); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsTransportType(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Default = value - }; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDefault = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDefault.TryReadProperty(ref reader, options, PropDefault, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsTransportType(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Default = propDefault.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsTransportType value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDefault, value.Default, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoSettingsTransportTypeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoSettingsTransportTypeConverter))] public sealed partial class NodeInfoSettingsTransportType { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoTransport.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoTransport.Converters.g.cs new file mode 100644 index 00000000000..96897dbd2a2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoTransport.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoTransportConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoundAddress = System.Text.Json.JsonEncodedText.Encode("bound_address"); + private static readonly System.Text.Json.JsonEncodedText PropProfiles = System.Text.Json.JsonEncodedText.Encode("profiles"); + private static readonly System.Text.Json.JsonEncodedText PropPublishAddress = System.Text.Json.JsonEncodedText.Encode("publish_address"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoTransport Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBoundAddress = default; + LocalJsonValue> propProfiles = default; + LocalJsonValue propPublishAddress = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoundAddress.TryReadProperty(ref reader, options, PropBoundAddress, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propProfiles.TryReadProperty(ref reader, options, PropProfiles, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propPublishAddress.TryReadProperty(ref reader, options, PropPublishAddress, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoTransport(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BoundAddress = propBoundAddress.Value, + Profiles = propProfiles.Value, + PublishAddress = propPublishAddress.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoTransport value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoundAddress, value.BoundAddress, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropProfiles, value.Profiles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropPublishAddress, value.PublishAddress, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoTransport.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoTransport.g.cs index ad0ef21b011..17d71da4731 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoTransport.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoTransport.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoTransportConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoundAddress = System.Text.Json.JsonEncodedText.Encode("bound_address"); - private static readonly System.Text.Json.JsonEncodedText PropProfiles = System.Text.Json.JsonEncodedText.Encode("profiles"); - private static readonly System.Text.Json.JsonEncodedText PropPublishAddress = System.Text.Json.JsonEncodedText.Encode("publish_address"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoTransport Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBoundAddress = default; - LocalJsonValue> propProfiles = default; - LocalJsonValue propPublishAddress = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoundAddress.TryReadProperty(ref reader, options, PropBoundAddress, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propProfiles.TryReadProperty(ref reader, options, PropProfiles, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propPublishAddress.TryReadProperty(ref reader, options, PropPublishAddress, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoTransport(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BoundAddress = propBoundAddress.Value, - Profiles = propProfiles.Value, - PublishAddress = propPublishAddress.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoTransport value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoundAddress, value.BoundAddress, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropProfiles, value.Profiles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropPublishAddress, value.PublishAddress, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoTransportConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoTransportConverter))] public sealed partial class NodeInfoTransport { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpack.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpack.Converters.g.cs new file mode 100644 index 00000000000..c5198ad2079 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpack.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoXpackConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLicense = System.Text.Json.JsonEncodedText.Encode("license"); + private static readonly System.Text.Json.JsonEncodedText PropMl = System.Text.Json.JsonEncodedText.Encode("ml"); + private static readonly System.Text.Json.JsonEncodedText PropNotification = System.Text.Json.JsonEncodedText.Encode("notification"); + private static readonly System.Text.Json.JsonEncodedText PropSecurity = System.Text.Json.JsonEncodedText.Encode("security"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpack Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLicense = default; + LocalJsonValue propMl = default; + LocalJsonValue?> propNotification = default; + LocalJsonValue propSecurity = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLicense.TryReadProperty(ref reader, options, PropLicense, null)) + { + continue; + } + + if (propMl.TryReadProperty(ref reader, options, PropMl, null)) + { + continue; + } + + if (propNotification.TryReadProperty(ref reader, options, PropNotification, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propSecurity.TryReadProperty(ref reader, options, PropSecurity, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpack(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + License = propLicense.Value, + Ml = propMl.Value, + Notification = propNotification.Value, + Security = propSecurity.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpack value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLicense, value.License, null, null); + writer.WriteProperty(options, PropMl, value.Ml, null, null); + writer.WriteProperty(options, PropNotification, value.Notification, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropSecurity, value.Security, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpack.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpack.g.cs index 7f248805ae2..6a853985d4f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpack.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpack.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoXpackConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLicense = System.Text.Json.JsonEncodedText.Encode("license"); - private static readonly System.Text.Json.JsonEncodedText PropMl = System.Text.Json.JsonEncodedText.Encode("ml"); - private static readonly System.Text.Json.JsonEncodedText PropNotification = System.Text.Json.JsonEncodedText.Encode("notification"); - private static readonly System.Text.Json.JsonEncodedText PropSecurity = System.Text.Json.JsonEncodedText.Encode("security"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpack Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLicense = default; - LocalJsonValue propMl = default; - LocalJsonValue?> propNotification = default; - LocalJsonValue propSecurity = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLicense.TryReadProperty(ref reader, options, PropLicense, null)) - { - continue; - } - - if (propMl.TryReadProperty(ref reader, options, PropMl, null)) - { - continue; - } - - if (propNotification.TryReadProperty(ref reader, options, PropNotification, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propSecurity.TryReadProperty(ref reader, options, PropSecurity, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpack(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - License = propLicense.Value, - Ml = propMl.Value, - Notification = propNotification.Value, - Security = propSecurity.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpack value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLicense, value.License, null, null); - writer.WriteProperty(options, PropMl, value.Ml, null, null); - writer.WriteProperty(options, PropNotification, value.Notification, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropSecurity, value.Security, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoXpackConverter))] public sealed partial class NodeInfoXpack { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackLicense.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackLicense.Converters.g.cs new file mode 100644 index 00000000000..01c3e9a7ff7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackLicense.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoXpackLicenseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSelfGenerated = System.Text.Json.JsonEncodedText.Encode("self_generated"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackLicense Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propSelfGenerated = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSelfGenerated.TryReadProperty(ref reader, options, PropSelfGenerated, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackLicense(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + SelfGenerated = propSelfGenerated.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackLicense value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSelfGenerated, value.SelfGenerated, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackLicense.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackLicense.g.cs index c8e61f343b0..8a38b1f90c4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackLicense.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackLicense.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoXpackLicenseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSelfGenerated = System.Text.Json.JsonEncodedText.Encode("self_generated"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackLicense Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propSelfGenerated = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSelfGenerated.TryReadProperty(ref reader, options, PropSelfGenerated, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackLicense(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - SelfGenerated = propSelfGenerated.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackLicense value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSelfGenerated, value.SelfGenerated, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackLicenseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoXpackLicenseConverter))] public sealed partial class NodeInfoXpackLicense { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackLicenseType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackLicenseType.Converters.g.cs new file mode 100644 index 00000000000..9d047711c7f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackLicenseType.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoXpackLicenseTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackLicenseType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackLicenseType(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackLicenseType value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackLicenseType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackLicenseType.g.cs index 24ed5753f22..5077b70f5c1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackLicenseType.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackLicenseType.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoXpackLicenseTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackLicenseType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackLicenseType(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackLicenseType value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackLicenseTypeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoXpackLicenseTypeConverter))] public sealed partial class NodeInfoXpackLicenseType { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackMl.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackMl.Converters.g.cs new file mode 100644 index 00000000000..fce290beb16 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackMl.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoXpackMlConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropUseAutoMachineMemoryPercent = System.Text.Json.JsonEncodedText.Encode("use_auto_machine_memory_percent"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackMl Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propUseAutoMachineMemoryPercent = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propUseAutoMachineMemoryPercent.TryReadProperty(ref reader, options, PropUseAutoMachineMemoryPercent, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackMl(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + UseAutoMachineMemoryPercent = propUseAutoMachineMemoryPercent.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackMl value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropUseAutoMachineMemoryPercent, value.UseAutoMachineMemoryPercent, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackMl.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackMl.g.cs index 5fce2ad57b5..1bd39cf739b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackMl.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackMl.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoXpackMlConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropUseAutoMachineMemoryPercent = System.Text.Json.JsonEncodedText.Encode("use_auto_machine_memory_percent"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackMl Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propUseAutoMachineMemoryPercent = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propUseAutoMachineMemoryPercent.TryReadProperty(ref reader, options, PropUseAutoMachineMemoryPercent, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackMl(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - UseAutoMachineMemoryPercent = propUseAutoMachineMemoryPercent.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackMl value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropUseAutoMachineMemoryPercent, value.UseAutoMachineMemoryPercent, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackMlConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoXpackMlConverter))] public sealed partial class NodeInfoXpackMl { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurity.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurity.Converters.g.cs new file mode 100644 index 00000000000..926cbf38e76 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurity.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoXpackSecurityConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAuthc = System.Text.Json.JsonEncodedText.Encode("authc"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropHttp = System.Text.Json.JsonEncodedText.Encode("http"); + private static readonly System.Text.Json.JsonEncodedText PropTransport = System.Text.Json.JsonEncodedText.Encode("transport"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurity Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAuthc = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propHttp = default; + LocalJsonValue propTransport = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAuthc.TryReadProperty(ref reader, options, PropAuthc, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propHttp.TryReadProperty(ref reader, options, PropHttp, null)) + { + continue; + } + + if (propTransport.TryReadProperty(ref reader, options, PropTransport, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurity(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Authc = propAuthc.Value, + Enabled = propEnabled.Value, + Http = propHttp.Value, + Transport = propTransport.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurity value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAuthc, value.Authc, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropHttp, value.Http, null, null); + writer.WriteProperty(options, PropTransport, value.Transport, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurity.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurity.g.cs index e01f8bb74c1..2b10602e146 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurity.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurity.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoXpackSecurityConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAuthc = System.Text.Json.JsonEncodedText.Encode("authc"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropHttp = System.Text.Json.JsonEncodedText.Encode("http"); - private static readonly System.Text.Json.JsonEncodedText PropTransport = System.Text.Json.JsonEncodedText.Encode("transport"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurity Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAuthc = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propHttp = default; - LocalJsonValue propTransport = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAuthc.TryReadProperty(ref reader, options, PropAuthc, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propHttp.TryReadProperty(ref reader, options, PropHttp, null)) - { - continue; - } - - if (propTransport.TryReadProperty(ref reader, options, PropTransport, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurity(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Authc = propAuthc.Value, - Enabled = propEnabled.Value, - Http = propHttp.Value, - Transport = propTransport.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurity value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAuthc, value.Authc, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropHttp, value.Http, null, null); - writer.WriteProperty(options, PropTransport, value.Transport, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoXpackSecurityConverter))] public sealed partial class NodeInfoXpackSecurity { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthc.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthc.Converters.g.cs new file mode 100644 index 00000000000..1b78db86ef4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthc.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoXpackSecurityAuthcConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRealms = System.Text.Json.JsonEncodedText.Encode("realms"); + private static readonly System.Text.Json.JsonEncodedText PropToken = System.Text.Json.JsonEncodedText.Encode("token"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthc Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propRealms = default; + LocalJsonValue propToken = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRealms.TryReadProperty(ref reader, options, PropRealms, null)) + { + continue; + } + + if (propToken.TryReadProperty(ref reader, options, PropToken, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthc(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Realms = propRealms.Value, + Token = propToken.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthc value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRealms, value.Realms, null, null); + writer.WriteProperty(options, PropToken, value.Token, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthc.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthc.g.cs index 0a97cdeee5b..01883342d8f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthc.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthc.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoXpackSecurityAuthcConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRealms = System.Text.Json.JsonEncodedText.Encode("realms"); - private static readonly System.Text.Json.JsonEncodedText PropToken = System.Text.Json.JsonEncodedText.Encode("token"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthc Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propRealms = default; - LocalJsonValue propToken = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRealms.TryReadProperty(ref reader, options, PropRealms, null)) - { - continue; - } - - if (propToken.TryReadProperty(ref reader, options, PropToken, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthc(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Realms = propRealms.Value, - Token = propToken.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthc value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRealms, value.Realms, null, null); - writer.WriteProperty(options, PropToken, value.Token, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoXpackSecurityAuthcConverter))] public sealed partial class NodeInfoXpackSecurityAuthc { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealms.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealms.Converters.g.cs new file mode 100644 index 00000000000..47cfb6518f6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealms.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoXpackSecurityAuthcRealmsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFile = System.Text.Json.JsonEncodedText.Encode("file"); + private static readonly System.Text.Json.JsonEncodedText PropNative = System.Text.Json.JsonEncodedText.Encode("native"); + private static readonly System.Text.Json.JsonEncodedText PropPki = System.Text.Json.JsonEncodedText.Encode("pki"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcRealms Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propFile = default; + LocalJsonValue?> propNative = default; + LocalJsonValue?> propPki = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFile.TryReadProperty(ref reader, options, PropFile, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propNative.TryReadProperty(ref reader, options, PropNative, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propPki.TryReadProperty(ref reader, options, PropPki, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcRealms(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + File = propFile.Value, + Native = propNative.Value, + Pki = propPki.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcRealms value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFile, value.File, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNative, value.Native, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropPki, value.Pki, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealms.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealms.g.cs index 6a996f2b0f2..418fcf4a4b5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealms.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealms.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoXpackSecurityAuthcRealmsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFile = System.Text.Json.JsonEncodedText.Encode("file"); - private static readonly System.Text.Json.JsonEncodedText PropNative = System.Text.Json.JsonEncodedText.Encode("native"); - private static readonly System.Text.Json.JsonEncodedText PropPki = System.Text.Json.JsonEncodedText.Encode("pki"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcRealms Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propFile = default; - LocalJsonValue?> propNative = default; - LocalJsonValue?> propPki = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFile.TryReadProperty(ref reader, options, PropFile, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propNative.TryReadProperty(ref reader, options, PropNative, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propPki.TryReadProperty(ref reader, options, PropPki, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcRealms(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - File = propFile.Value, - Native = propNative.Value, - Pki = propPki.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcRealms value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFile, value.File, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNative, value.Native, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropPki, value.Pki, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcRealmsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoXpackSecurityAuthcRealmsConverter))] public sealed partial class NodeInfoXpackSecurityAuthcRealms { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealmsStatus.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealmsStatus.Converters.g.cs new file mode 100644 index 00000000000..fbcb1e0ee40 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealmsStatus.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoXpackSecurityAuthcRealmsStatusConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcRealmsStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEnabled = default; + LocalJsonValue propOrder = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propOrder.TryReadProperty(ref reader, options, PropOrder, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcRealmsStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Enabled = propEnabled.Value, + Order = propOrder.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcRealmsStatus value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropOrder, value.Order, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealmsStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealmsStatus.g.cs index f00739c3567..0b8583f7176 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealmsStatus.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcRealmsStatus.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoXpackSecurityAuthcRealmsStatusConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcRealmsStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEnabled = default; - LocalJsonValue propOrder = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propOrder.TryReadProperty(ref reader, options, PropOrder, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcRealmsStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Enabled = propEnabled.Value, - Order = propOrder.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcRealmsStatus value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropOrder, value.Order, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcRealmsStatusConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoXpackSecurityAuthcRealmsStatusConverter))] public sealed partial class NodeInfoXpackSecurityAuthcRealmsStatus { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcToken.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcToken.Converters.g.cs new file mode 100644 index 00000000000..0250cc688b1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcToken.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoXpackSecurityAuthcTokenConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcToken Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEnabled = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcToken(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Enabled = propEnabled.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcToken value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcToken.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcToken.g.cs index f0fc59b6f99..f540a74a68e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcToken.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecurityAuthcToken.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoXpackSecurityAuthcTokenConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcToken Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEnabled = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcToken(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Enabled = propEnabled.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcToken value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecurityAuthcTokenConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoXpackSecurityAuthcTokenConverter))] public sealed partial class NodeInfoXpackSecurityAuthcToken { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecuritySsl.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecuritySsl.Converters.g.cs new file mode 100644 index 00000000000..ce5677c2547 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecuritySsl.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeInfoXpackSecuritySslConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSsl = System.Text.Json.JsonEncodedText.Encode("ssl"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecuritySsl Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propSsl = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSsl.TryReadProperty(ref reader, options, PropSsl, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecuritySsl(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Ssl = propSsl.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecuritySsl value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSsl, value.Ssl, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecuritySsl.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecuritySsl.g.cs index 8ccad76c892..120d6da3b28 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecuritySsl.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeInfoXpackSecuritySsl.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeInfoXpackSecuritySslConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSsl = System.Text.Json.JsonEncodedText.Encode("ssl"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecuritySsl Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propSsl = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSsl.TryReadProperty(ref reader, options, PropSsl, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecuritySsl(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Ssl = propSsl.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecuritySsl value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSsl, value.Ssl, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeInfoXpackSecuritySslConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeInfoXpackSecuritySslConverter))] public sealed partial class NodeInfoXpackSecuritySsl { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeJvmInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeJvmInfo.Converters.g.cs new file mode 100644 index 00000000000..c0d9c7dc616 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeJvmInfo.Converters.g.cs @@ -0,0 +1,162 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeJvmInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropGcCollectors = System.Text.Json.JsonEncodedText.Encode("gc_collectors"); + private static readonly System.Text.Json.JsonEncodedText PropInputArguments = System.Text.Json.JsonEncodedText.Encode("input_arguments"); + private static readonly System.Text.Json.JsonEncodedText PropMem = System.Text.Json.JsonEncodedText.Encode("mem"); + private static readonly System.Text.Json.JsonEncodedText PropMemoryPools = System.Text.Json.JsonEncodedText.Encode("memory_pools"); + private static readonly System.Text.Json.JsonEncodedText PropPid = System.Text.Json.JsonEncodedText.Encode("pid"); + private static readonly System.Text.Json.JsonEncodedText PropStartTimeInMillis = System.Text.Json.JsonEncodedText.Encode("start_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropUsingBundledJdk = System.Text.Json.JsonEncodedText.Encode("using_bundled_jdk"); + private static readonly System.Text.Json.JsonEncodedText PropUsingCompressedOrdinaryObjectPointers = System.Text.Json.JsonEncodedText.Encode("using_compressed_ordinary_object_pointers"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + private static readonly System.Text.Json.JsonEncodedText PropVmName = System.Text.Json.JsonEncodedText.Encode("vm_name"); + private static readonly System.Text.Json.JsonEncodedText PropVmVendor = System.Text.Json.JsonEncodedText.Encode("vm_vendor"); + private static readonly System.Text.Json.JsonEncodedText PropVmVersion = System.Text.Json.JsonEncodedText.Encode("vm_version"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeJvmInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propGcCollectors = default; + LocalJsonValue> propInputArguments = default; + LocalJsonValue propMem = default; + LocalJsonValue> propMemoryPools = default; + LocalJsonValue propPid = default; + LocalJsonValue propStartTimeInMillis = default; + LocalJsonValue propUsingBundledJdk = default; + LocalJsonValue?> propUsingCompressedOrdinaryObjectPointers = default; + LocalJsonValue propVersion = default; + LocalJsonValue propVmName = default; + LocalJsonValue propVmVendor = default; + LocalJsonValue propVmVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propGcCollectors.TryReadProperty(ref reader, options, PropGcCollectors, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propInputArguments.TryReadProperty(ref reader, options, PropInputArguments, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMem.TryReadProperty(ref reader, options, PropMem, null)) + { + continue; + } + + if (propMemoryPools.TryReadProperty(ref reader, options, PropMemoryPools, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propPid.TryReadProperty(ref reader, options, PropPid, null)) + { + continue; + } + + if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propUsingBundledJdk.TryReadProperty(ref reader, options, PropUsingBundledJdk, null)) + { + continue; + } + + if (propUsingCompressedOrdinaryObjectPointers.TryReadProperty(ref reader, options, PropUsingCompressedOrdinaryObjectPointers, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (propVmName.TryReadProperty(ref reader, options, PropVmName, null)) + { + continue; + } + + if (propVmVendor.TryReadProperty(ref reader, options, PropVmVendor, null)) + { + continue; + } + + if (propVmVersion.TryReadProperty(ref reader, options, PropVmVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeJvmInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + GcCollectors = propGcCollectors.Value, + InputArguments = propInputArguments.Value, + Mem = propMem.Value, + MemoryPools = propMemoryPools.Value, + Pid = propPid.Value, + StartTimeInMillis = propStartTimeInMillis.Value, + UsingBundledJdk = propUsingBundledJdk.Value, + UsingCompressedOrdinaryObjectPointers = propUsingCompressedOrdinaryObjectPointers.Value, + Version = propVersion.Value, + VmName = propVmName.Value, + VmVendor = propVmVendor.Value, + VmVersion = propVmVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeJvmInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropGcCollectors, value.GcCollectors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropInputArguments, value.InputArguments, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMem, value.Mem, null, null); + writer.WriteProperty(options, PropMemoryPools, value.MemoryPools, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPid, value.Pid, null, null); + writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropUsingBundledJdk, value.UsingBundledJdk, null, null); + writer.WriteProperty(options, PropUsingCompressedOrdinaryObjectPointers, value.UsingCompressedOrdinaryObjectPointers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteProperty(options, PropVmName, value.VmName, null, null); + writer.WriteProperty(options, PropVmVendor, value.VmVendor, null, null); + writer.WriteProperty(options, PropVmVersion, value.VmVersion, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeJvmInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeJvmInfo.g.cs index 3b6ca5b8d46..114155aeaf9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeJvmInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeJvmInfo.g.cs @@ -23,145 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeJvmInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropGcCollectors = System.Text.Json.JsonEncodedText.Encode("gc_collectors"); - private static readonly System.Text.Json.JsonEncodedText PropInputArguments = System.Text.Json.JsonEncodedText.Encode("input_arguments"); - private static readonly System.Text.Json.JsonEncodedText PropMem = System.Text.Json.JsonEncodedText.Encode("mem"); - private static readonly System.Text.Json.JsonEncodedText PropMemoryPools = System.Text.Json.JsonEncodedText.Encode("memory_pools"); - private static readonly System.Text.Json.JsonEncodedText PropPid = System.Text.Json.JsonEncodedText.Encode("pid"); - private static readonly System.Text.Json.JsonEncodedText PropStartTimeInMillis = System.Text.Json.JsonEncodedText.Encode("start_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropUsingBundledJdk = System.Text.Json.JsonEncodedText.Encode("using_bundled_jdk"); - private static readonly System.Text.Json.JsonEncodedText PropUsingCompressedOrdinaryObjectPointers = System.Text.Json.JsonEncodedText.Encode("using_compressed_ordinary_object_pointers"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - private static readonly System.Text.Json.JsonEncodedText PropVmName = System.Text.Json.JsonEncodedText.Encode("vm_name"); - private static readonly System.Text.Json.JsonEncodedText PropVmVendor = System.Text.Json.JsonEncodedText.Encode("vm_vendor"); - private static readonly System.Text.Json.JsonEncodedText PropVmVersion = System.Text.Json.JsonEncodedText.Encode("vm_version"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeJvmInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propGcCollectors = default; - LocalJsonValue> propInputArguments = default; - LocalJsonValue propMem = default; - LocalJsonValue> propMemoryPools = default; - LocalJsonValue propPid = default; - LocalJsonValue propStartTimeInMillis = default; - LocalJsonValue propUsingBundledJdk = default; - LocalJsonValue?> propUsingCompressedOrdinaryObjectPointers = default; - LocalJsonValue propVersion = default; - LocalJsonValue propVmName = default; - LocalJsonValue propVmVendor = default; - LocalJsonValue propVmVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propGcCollectors.TryReadProperty(ref reader, options, PropGcCollectors, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propInputArguments.TryReadProperty(ref reader, options, PropInputArguments, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMem.TryReadProperty(ref reader, options, PropMem, null)) - { - continue; - } - - if (propMemoryPools.TryReadProperty(ref reader, options, PropMemoryPools, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propPid.TryReadProperty(ref reader, options, PropPid, null)) - { - continue; - } - - if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propUsingBundledJdk.TryReadProperty(ref reader, options, PropUsingBundledJdk, null)) - { - continue; - } - - if (propUsingCompressedOrdinaryObjectPointers.TryReadProperty(ref reader, options, PropUsingCompressedOrdinaryObjectPointers, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.True | Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.False, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (propVmName.TryReadProperty(ref reader, options, PropVmName, null)) - { - continue; - } - - if (propVmVendor.TryReadProperty(ref reader, options, PropVmVendor, null)) - { - continue; - } - - if (propVmVersion.TryReadProperty(ref reader, options, PropVmVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeJvmInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - GcCollectors = propGcCollectors.Value, - InputArguments = propInputArguments.Value, - Mem = propMem.Value, - MemoryPools = propMemoryPools.Value, - Pid = propPid.Value, - StartTimeInMillis = propStartTimeInMillis.Value, - UsingBundledJdk = propUsingBundledJdk.Value, - UsingCompressedOrdinaryObjectPointers = propUsingCompressedOrdinaryObjectPointers.Value, - Version = propVersion.Value, - VmName = propVmName.Value, - VmVendor = propVmVendor.Value, - VmVersion = propVmVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeJvmInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropGcCollectors, value.GcCollectors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropInputArguments, value.InputArguments, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMem, value.Mem, null, null); - writer.WriteProperty(options, PropMemoryPools, value.MemoryPools, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPid, value.Pid, null, null); - writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropUsingBundledJdk, value.UsingBundledJdk, null, null); - writer.WriteProperty(options, PropUsingCompressedOrdinaryObjectPointers, value.UsingCompressedOrdinaryObjectPointers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteProperty(options, PropVmName, value.VmName, null, null); - writer.WriteProperty(options, PropVmVendor, value.VmVendor, null, null); - writer.WriteProperty(options, PropVmVersion, value.VmVersion, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeJvmInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeJvmInfoConverter))] public sealed partial class NodeJvmInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeOperatingSystemInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeOperatingSystemInfo.Converters.g.cs new file mode 100644 index 00000000000..b27a31afe52 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeOperatingSystemInfo.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeOperatingSystemInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllocatedProcessors = System.Text.Json.JsonEncodedText.Encode("allocated_processors"); + private static readonly System.Text.Json.JsonEncodedText PropArch = System.Text.Json.JsonEncodedText.Encode("arch"); + private static readonly System.Text.Json.JsonEncodedText PropAvailableProcessors = System.Text.Json.JsonEncodedText.Encode("available_processors"); + private static readonly System.Text.Json.JsonEncodedText PropCpu = System.Text.Json.JsonEncodedText.Encode("cpu"); + private static readonly System.Text.Json.JsonEncodedText PropMem = System.Text.Json.JsonEncodedText.Encode("mem"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropPrettyName = System.Text.Json.JsonEncodedText.Encode("pretty_name"); + private static readonly System.Text.Json.JsonEncodedText PropRefreshIntervalInMillis = System.Text.Json.JsonEncodedText.Encode("refresh_interval_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropSwap = System.Text.Json.JsonEncodedText.Encode("swap"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeOperatingSystemInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllocatedProcessors = default; + LocalJsonValue propArch = default; + LocalJsonValue propAvailableProcessors = default; + LocalJsonValue propCpu = default; + LocalJsonValue propMem = default; + LocalJsonValue propName = default; + LocalJsonValue propPrettyName = default; + LocalJsonValue propRefreshIntervalInMillis = default; + LocalJsonValue propSwap = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllocatedProcessors.TryReadProperty(ref reader, options, PropAllocatedProcessors, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propArch.TryReadProperty(ref reader, options, PropArch, null)) + { + continue; + } + + if (propAvailableProcessors.TryReadProperty(ref reader, options, PropAvailableProcessors, null)) + { + continue; + } + + if (propCpu.TryReadProperty(ref reader, options, PropCpu, null)) + { + continue; + } + + if (propMem.TryReadProperty(ref reader, options, PropMem, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propPrettyName.TryReadProperty(ref reader, options, PropPrettyName, null)) + { + continue; + } + + if (propRefreshIntervalInMillis.TryReadProperty(ref reader, options, PropRefreshIntervalInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propSwap.TryReadProperty(ref reader, options, PropSwap, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeOperatingSystemInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllocatedProcessors = propAllocatedProcessors.Value, + Arch = propArch.Value, + AvailableProcessors = propAvailableProcessors.Value, + Cpu = propCpu.Value, + Mem = propMem.Value, + Name = propName.Value, + PrettyName = propPrettyName.Value, + RefreshIntervalInMillis = propRefreshIntervalInMillis.Value, + Swap = propSwap.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeOperatingSystemInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllocatedProcessors, value.AllocatedProcessors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropArch, value.Arch, null, null); + writer.WriteProperty(options, PropAvailableProcessors, value.AvailableProcessors, null, null); + writer.WriteProperty(options, PropCpu, value.Cpu, null, null); + writer.WriteProperty(options, PropMem, value.Mem, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropPrettyName, value.PrettyName, null, null); + writer.WriteProperty(options, PropRefreshIntervalInMillis, value.RefreshIntervalInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropSwap, value.Swap, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeOperatingSystemInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeOperatingSystemInfo.g.cs index 6ae5f7a40fb..a3c0def216d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeOperatingSystemInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeOperatingSystemInfo.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeOperatingSystemInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllocatedProcessors = System.Text.Json.JsonEncodedText.Encode("allocated_processors"); - private static readonly System.Text.Json.JsonEncodedText PropArch = System.Text.Json.JsonEncodedText.Encode("arch"); - private static readonly System.Text.Json.JsonEncodedText PropAvailableProcessors = System.Text.Json.JsonEncodedText.Encode("available_processors"); - private static readonly System.Text.Json.JsonEncodedText PropCpu = System.Text.Json.JsonEncodedText.Encode("cpu"); - private static readonly System.Text.Json.JsonEncodedText PropMem = System.Text.Json.JsonEncodedText.Encode("mem"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropPrettyName = System.Text.Json.JsonEncodedText.Encode("pretty_name"); - private static readonly System.Text.Json.JsonEncodedText PropRefreshIntervalInMillis = System.Text.Json.JsonEncodedText.Encode("refresh_interval_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropSwap = System.Text.Json.JsonEncodedText.Encode("swap"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeOperatingSystemInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllocatedProcessors = default; - LocalJsonValue propArch = default; - LocalJsonValue propAvailableProcessors = default; - LocalJsonValue propCpu = default; - LocalJsonValue propMem = default; - LocalJsonValue propName = default; - LocalJsonValue propPrettyName = default; - LocalJsonValue propRefreshIntervalInMillis = default; - LocalJsonValue propSwap = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllocatedProcessors.TryReadProperty(ref reader, options, PropAllocatedProcessors, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propArch.TryReadProperty(ref reader, options, PropArch, null)) - { - continue; - } - - if (propAvailableProcessors.TryReadProperty(ref reader, options, PropAvailableProcessors, null)) - { - continue; - } - - if (propCpu.TryReadProperty(ref reader, options, PropCpu, null)) - { - continue; - } - - if (propMem.TryReadProperty(ref reader, options, PropMem, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propPrettyName.TryReadProperty(ref reader, options, PropPrettyName, null)) - { - continue; - } - - if (propRefreshIntervalInMillis.TryReadProperty(ref reader, options, PropRefreshIntervalInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propSwap.TryReadProperty(ref reader, options, PropSwap, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeOperatingSystemInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllocatedProcessors = propAllocatedProcessors.Value, - Arch = propArch.Value, - AvailableProcessors = propAvailableProcessors.Value, - Cpu = propCpu.Value, - Mem = propMem.Value, - Name = propName.Value, - PrettyName = propPrettyName.Value, - RefreshIntervalInMillis = propRefreshIntervalInMillis.Value, - Swap = propSwap.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeOperatingSystemInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllocatedProcessors, value.AllocatedProcessors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropArch, value.Arch, null, null); - writer.WriteProperty(options, PropAvailableProcessors, value.AvailableProcessors, null, null); - writer.WriteProperty(options, PropCpu, value.Cpu, null, null); - writer.WriteProperty(options, PropMem, value.Mem, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropPrettyName, value.PrettyName, null, null); - writer.WriteProperty(options, PropRefreshIntervalInMillis, value.RefreshIntervalInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropSwap, value.Swap, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeOperatingSystemInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeOperatingSystemInfoConverter))] public sealed partial class NodeOperatingSystemInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeProcessInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeProcessInfo.Converters.g.cs new file mode 100644 index 00000000000..22e0f5d9a77 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeProcessInfo.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeProcessInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropMlockall = System.Text.Json.JsonEncodedText.Encode("mlockall"); + private static readonly System.Text.Json.JsonEncodedText PropRefreshIntervalInMillis = System.Text.Json.JsonEncodedText.Encode("refresh_interval_in_millis"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeProcessInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propMlockall = default; + LocalJsonValue propRefreshIntervalInMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propMlockall.TryReadProperty(ref reader, options, PropMlockall, null)) + { + continue; + } + + if (propRefreshIntervalInMillis.TryReadProperty(ref reader, options, PropRefreshIntervalInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeProcessInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + Mlockall = propMlockall.Value, + RefreshIntervalInMillis = propRefreshIntervalInMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeProcessInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropMlockall, value.Mlockall, null, null); + writer.WriteProperty(options, PropRefreshIntervalInMillis, value.RefreshIntervalInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeProcessInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeProcessInfo.g.cs index 02ee3d90233..be3e54292ee 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeProcessInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeProcessInfo.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeProcessInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropMlockall = System.Text.Json.JsonEncodedText.Encode("mlockall"); - private static readonly System.Text.Json.JsonEncodedText PropRefreshIntervalInMillis = System.Text.Json.JsonEncodedText.Encode("refresh_interval_in_millis"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeProcessInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue propMlockall = default; - LocalJsonValue propRefreshIntervalInMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propMlockall.TryReadProperty(ref reader, options, PropMlockall, null)) - { - continue; - } - - if (propRefreshIntervalInMillis.TryReadProperty(ref reader, options, PropRefreshIntervalInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeProcessInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - Mlockall = propMlockall.Value, - RefreshIntervalInMillis = propRefreshIntervalInMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeProcessInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropMlockall, value.Mlockall, null, null); - writer.WriteProperty(options, PropRefreshIntervalInMillis, value.RefreshIntervalInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeProcessInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeProcessInfoConverter))] public sealed partial class NodeProcessInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeReloadResult.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeReloadResult.Converters.g.cs new file mode 100644 index 00000000000..c96939ea7be --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeReloadResult.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeReloadResultConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropReloadException = System.Text.Json.JsonEncodedText.Encode("reload_exception"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeReloadResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + LocalJsonValue propReloadException = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propReloadException.TryReadProperty(ref reader, options, PropReloadException, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeReloadResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value, + ReloadException = propReloadException.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeReloadResult value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropReloadException, value.ReloadException, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeReloadResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeReloadResult.g.cs index 257c3323d3c..be0251af9c6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeReloadResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeReloadResult.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeReloadResultConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropReloadException = System.Text.Json.JsonEncodedText.Encode("reload_exception"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeReloadResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - LocalJsonValue propReloadException = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propReloadException.TryReadProperty(ref reader, options, PropReloadException, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeReloadResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value, - ReloadException = propReloadException.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeReloadResult value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropReloadException, value.ReloadException, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeReloadResultConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeReloadResultConverter))] public sealed partial class NodeReloadResult { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeThreadPoolInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeThreadPoolInfo.Converters.g.cs new file mode 100644 index 00000000000..2fd13d789db --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeThreadPoolInfo.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeThreadPoolInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCore = System.Text.Json.JsonEncodedText.Encode("core"); + private static readonly System.Text.Json.JsonEncodedText PropKeepAlive = System.Text.Json.JsonEncodedText.Encode("keep_alive"); + private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText PropQueueSize = System.Text.Json.JsonEncodedText.Encode("queue_size"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeThreadPoolInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCore = default; + LocalJsonValue propKeepAlive = default; + LocalJsonValue propMax = default; + LocalJsonValue propQueueSize = default; + LocalJsonValue propSize = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCore.TryReadProperty(ref reader, options, PropCore, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propKeepAlive.TryReadProperty(ref reader, options, PropKeepAlive, null)) + { + continue; + } + + if (propMax.TryReadProperty(ref reader, options, PropMax, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueueSize.TryReadProperty(ref reader, options, PropQueueSize, null)) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeThreadPoolInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Core = propCore.Value, + KeepAlive = propKeepAlive.Value, + Max = propMax.Value, + QueueSize = propQueueSize.Value, + Size = propSize.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeThreadPoolInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCore, value.Core, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropKeepAlive, value.KeepAlive, null, null); + writer.WriteProperty(options, PropMax, value.Max, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueueSize, value.QueueSize, null, null); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeThreadPoolInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeThreadPoolInfo.g.cs index d059f8888db..d14b5c36e4e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeThreadPoolInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeThreadPoolInfo.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeThreadPoolInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCore = System.Text.Json.JsonEncodedText.Encode("core"); - private static readonly System.Text.Json.JsonEncodedText PropKeepAlive = System.Text.Json.JsonEncodedText.Encode("keep_alive"); - private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); - private static readonly System.Text.Json.JsonEncodedText PropQueueSize = System.Text.Json.JsonEncodedText.Encode("queue_size"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeThreadPoolInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCore = default; - LocalJsonValue propKeepAlive = default; - LocalJsonValue propMax = default; - LocalJsonValue propQueueSize = default; - LocalJsonValue propSize = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCore.TryReadProperty(ref reader, options, PropCore, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propKeepAlive.TryReadProperty(ref reader, options, PropKeepAlive, null)) - { - continue; - } - - if (propMax.TryReadProperty(ref reader, options, PropMax, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueueSize.TryReadProperty(ref reader, options, PropQueueSize, null)) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeThreadPoolInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Core = propCore.Value, - KeepAlive = propKeepAlive.Value, - Max = propMax.Value, - QueueSize = propQueueSize.Value, - Size = propSize.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeThreadPoolInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCore, value.Core, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropKeepAlive, value.KeepAlive, null, null); - writer.WriteProperty(options, PropMax, value.Max, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueueSize, value.QueueSize, null, null); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeThreadPoolInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeThreadPoolInfoConverter))] public sealed partial class NodeThreadPoolInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeUsage.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeUsage.Converters.g.cs new file mode 100644 index 00000000000..2b0e2bb8809 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeUsage.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class NodeUsageConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); + private static readonly System.Text.Json.JsonEncodedText PropRestActions = System.Text.Json.JsonEncodedText.Encode("rest_actions"); + private static readonly System.Text.Json.JsonEncodedText PropSince = System.Text.Json.JsonEncodedText.Encode("since"); + private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); + + public override Elastic.Clients.Elasticsearch.Nodes.NodeUsage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propAggregations = default; + LocalJsonValue> propRestActions = default; + LocalJsonValue propSince = default; + LocalJsonValue propTimestamp = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (propRestActions.TryReadProperty(ref reader, options, PropRestActions, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propSince.TryReadProperty(ref reader, options, PropSince, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.NodeUsage(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = propAggregations.Value, + RestActions = propRestActions.Value, + Since = propSince.Value, + Timestamp = propTimestamp.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeUsage value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropRestActions, value.RestActions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropSince, value.Since, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeUsage.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeUsage.g.cs index 2f39832429b..ae86560b6c4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeUsage.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/NodeUsage.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class NodeUsageConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations"); - private static readonly System.Text.Json.JsonEncodedText PropRestActions = System.Text.Json.JsonEncodedText.Encode("rest_actions"); - private static readonly System.Text.Json.JsonEncodedText PropSince = System.Text.Json.JsonEncodedText.Encode("since"); - private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); - - public override Elastic.Clients.Elasticsearch.Nodes.NodeUsage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propAggregations = default; - LocalJsonValue> propRestActions = default; - LocalJsonValue propSince = default; - LocalJsonValue propTimestamp = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (propRestActions.TryReadProperty(ref reader, options, PropRestActions, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propSince.TryReadProperty(ref reader, options, PropSince, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.NodeUsage(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = propAggregations.Value, - RestActions = propRestActions.Value, - Since = propSince.Value, - Timestamp = propTimestamp.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.NodeUsage value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropRestActions, value.RestActions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropSince, value.Since, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.NodeUsageConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.NodeUsageConverter))] public sealed partial class NodeUsage { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/OperatingSystem.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/OperatingSystem.Converters.g.cs new file mode 100644 index 00000000000..658bb341388 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/OperatingSystem.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class OperatingSystemConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCgroup = System.Text.Json.JsonEncodedText.Encode("cgroup"); + private static readonly System.Text.Json.JsonEncodedText PropCpu = System.Text.Json.JsonEncodedText.Encode("cpu"); + private static readonly System.Text.Json.JsonEncodedText PropMem = System.Text.Json.JsonEncodedText.Encode("mem"); + private static readonly System.Text.Json.JsonEncodedText PropSwap = System.Text.Json.JsonEncodedText.Encode("swap"); + private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); + + public override Elastic.Clients.Elasticsearch.Nodes.OperatingSystem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCgroup = default; + LocalJsonValue propCpu = default; + LocalJsonValue propMem = default; + LocalJsonValue propSwap = default; + LocalJsonValue propTimestamp = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCgroup.TryReadProperty(ref reader, options, PropCgroup, null)) + { + continue; + } + + if (propCpu.TryReadProperty(ref reader, options, PropCpu, null)) + { + continue; + } + + if (propMem.TryReadProperty(ref reader, options, PropMem, null)) + { + continue; + } + + if (propSwap.TryReadProperty(ref reader, options, PropSwap, null)) + { + continue; + } + + if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.OperatingSystem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Cgroup = propCgroup.Value, + Cpu = propCpu.Value, + Mem = propMem.Value, + Swap = propSwap.Value, + Timestamp = propTimestamp.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.OperatingSystem value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCgroup, value.Cgroup, null, null); + writer.WriteProperty(options, PropCpu, value.Cpu, null, null); + writer.WriteProperty(options, PropMem, value.Mem, null, null); + writer.WriteProperty(options, PropSwap, value.Swap, null, null); + writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/OperatingSystem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/OperatingSystem.g.cs index 21ca652ff65..f220ade2606 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/OperatingSystem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/OperatingSystem.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class OperatingSystemConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCgroup = System.Text.Json.JsonEncodedText.Encode("cgroup"); - private static readonly System.Text.Json.JsonEncodedText PropCpu = System.Text.Json.JsonEncodedText.Encode("cpu"); - private static readonly System.Text.Json.JsonEncodedText PropMem = System.Text.Json.JsonEncodedText.Encode("mem"); - private static readonly System.Text.Json.JsonEncodedText PropSwap = System.Text.Json.JsonEncodedText.Encode("swap"); - private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); - - public override Elastic.Clients.Elasticsearch.Nodes.OperatingSystem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCgroup = default; - LocalJsonValue propCpu = default; - LocalJsonValue propMem = default; - LocalJsonValue propSwap = default; - LocalJsonValue propTimestamp = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCgroup.TryReadProperty(ref reader, options, PropCgroup, null)) - { - continue; - } - - if (propCpu.TryReadProperty(ref reader, options, PropCpu, null)) - { - continue; - } - - if (propMem.TryReadProperty(ref reader, options, PropMem, null)) - { - continue; - } - - if (propSwap.TryReadProperty(ref reader, options, PropSwap, null)) - { - continue; - } - - if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.OperatingSystem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Cgroup = propCgroup.Value, - Cpu = propCpu.Value, - Mem = propMem.Value, - Swap = propSwap.Value, - Timestamp = propTimestamp.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.OperatingSystem value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCgroup, value.Cgroup, null, null); - writer.WriteProperty(options, PropCpu, value.Cpu, null, null); - writer.WriteProperty(options, PropMem, value.Mem, null, null); - writer.WriteProperty(options, PropSwap, value.Swap, null, null); - writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.OperatingSystemConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.OperatingSystemConverter))] public sealed partial class OperatingSystem { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Pool.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Pool.Converters.g.cs new file mode 100644 index 00000000000..03679c7e065 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Pool.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class PoolConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxInBytes = System.Text.Json.JsonEncodedText.Encode("max_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropPeakMaxInBytes = System.Text.Json.JsonEncodedText.Encode("peak_max_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropPeakUsedInBytes = System.Text.Json.JsonEncodedText.Encode("peak_used_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropUsedInBytes = System.Text.Json.JsonEncodedText.Encode("used_in_bytes"); + + public override Elastic.Clients.Elasticsearch.Nodes.Pool Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxInBytes = default; + LocalJsonValue propPeakMaxInBytes = default; + LocalJsonValue propPeakUsedInBytes = default; + LocalJsonValue propUsedInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxInBytes.TryReadProperty(ref reader, options, PropMaxInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPeakMaxInBytes.TryReadProperty(ref reader, options, PropPeakMaxInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPeakUsedInBytes.TryReadProperty(ref reader, options, PropPeakUsedInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propUsedInBytes.TryReadProperty(ref reader, options, PropUsedInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.Pool(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxInBytes = propMaxInBytes.Value, + PeakMaxInBytes = propPeakMaxInBytes.Value, + PeakUsedInBytes = propPeakUsedInBytes.Value, + UsedInBytes = propUsedInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Pool value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxInBytes, value.MaxInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPeakMaxInBytes, value.PeakMaxInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPeakUsedInBytes, value.PeakUsedInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropUsedInBytes, value.UsedInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Pool.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Pool.g.cs index 216a8136394..7da2e613348 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Pool.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Pool.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class PoolConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxInBytes = System.Text.Json.JsonEncodedText.Encode("max_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropPeakMaxInBytes = System.Text.Json.JsonEncodedText.Encode("peak_max_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropPeakUsedInBytes = System.Text.Json.JsonEncodedText.Encode("peak_used_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropUsedInBytes = System.Text.Json.JsonEncodedText.Encode("used_in_bytes"); - - public override Elastic.Clients.Elasticsearch.Nodes.Pool Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxInBytes = default; - LocalJsonValue propPeakMaxInBytes = default; - LocalJsonValue propPeakUsedInBytes = default; - LocalJsonValue propUsedInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxInBytes.TryReadProperty(ref reader, options, PropMaxInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPeakMaxInBytes.TryReadProperty(ref reader, options, PropPeakMaxInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPeakUsedInBytes.TryReadProperty(ref reader, options, PropPeakUsedInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propUsedInBytes.TryReadProperty(ref reader, options, PropUsedInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.Pool(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxInBytes = propMaxInBytes.Value, - PeakMaxInBytes = propPeakMaxInBytes.Value, - PeakUsedInBytes = propPeakUsedInBytes.Value, - UsedInBytes = propUsedInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Pool value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxInBytes, value.MaxInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPeakMaxInBytes, value.PeakMaxInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPeakUsedInBytes, value.PeakUsedInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropUsedInBytes, value.UsedInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.PoolConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.PoolConverter))] public sealed partial class Pool { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/PressureMemory.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/PressureMemory.Converters.g.cs new file mode 100644 index 00000000000..05f0947c5d7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/PressureMemory.Converters.g.cs @@ -0,0 +1,189 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class PressureMemoryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAll = System.Text.Json.JsonEncodedText.Encode("all"); + private static readonly System.Text.Json.JsonEncodedText PropAllInBytes = System.Text.Json.JsonEncodedText.Encode("all_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropCombinedCoordinatingAndPrimary = System.Text.Json.JsonEncodedText.Encode("combined_coordinating_and_primary"); + private static readonly System.Text.Json.JsonEncodedText PropCombinedCoordinatingAndPrimaryInBytes = System.Text.Json.JsonEncodedText.Encode("combined_coordinating_and_primary_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropCoordinating = System.Text.Json.JsonEncodedText.Encode("coordinating"); + private static readonly System.Text.Json.JsonEncodedText PropCoordinatingInBytes = System.Text.Json.JsonEncodedText.Encode("coordinating_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropCoordinatingRejections = System.Text.Json.JsonEncodedText.Encode("coordinating_rejections"); + private static readonly System.Text.Json.JsonEncodedText PropLargeOperationRejections = System.Text.Json.JsonEncodedText.Encode("large_operation_rejections"); + private static readonly System.Text.Json.JsonEncodedText PropPrimary = System.Text.Json.JsonEncodedText.Encode("primary"); + private static readonly System.Text.Json.JsonEncodedText PropPrimaryDocumentRejections = System.Text.Json.JsonEncodedText.Encode("primary_document_rejections"); + private static readonly System.Text.Json.JsonEncodedText PropPrimaryInBytes = System.Text.Json.JsonEncodedText.Encode("primary_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropPrimaryRejections = System.Text.Json.JsonEncodedText.Encode("primary_rejections"); + private static readonly System.Text.Json.JsonEncodedText PropReplica = System.Text.Json.JsonEncodedText.Encode("replica"); + private static readonly System.Text.Json.JsonEncodedText PropReplicaInBytes = System.Text.Json.JsonEncodedText.Encode("replica_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropReplicaRejections = System.Text.Json.JsonEncodedText.Encode("replica_rejections"); + + public override Elastic.Clients.Elasticsearch.Nodes.PressureMemory Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAll = default; + LocalJsonValue propAllInBytes = default; + LocalJsonValue propCombinedCoordinatingAndPrimary = default; + LocalJsonValue propCombinedCoordinatingAndPrimaryInBytes = default; + LocalJsonValue propCoordinating = default; + LocalJsonValue propCoordinatingInBytes = default; + LocalJsonValue propCoordinatingRejections = default; + LocalJsonValue propLargeOperationRejections = default; + LocalJsonValue propPrimary = default; + LocalJsonValue propPrimaryDocumentRejections = default; + LocalJsonValue propPrimaryInBytes = default; + LocalJsonValue propPrimaryRejections = default; + LocalJsonValue propReplica = default; + LocalJsonValue propReplicaInBytes = default; + LocalJsonValue propReplicaRejections = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAll.TryReadProperty(ref reader, options, PropAll, null)) + { + continue; + } + + if (propAllInBytes.TryReadProperty(ref reader, options, PropAllInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCombinedCoordinatingAndPrimary.TryReadProperty(ref reader, options, PropCombinedCoordinatingAndPrimary, null)) + { + continue; + } + + if (propCombinedCoordinatingAndPrimaryInBytes.TryReadProperty(ref reader, options, PropCombinedCoordinatingAndPrimaryInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCoordinating.TryReadProperty(ref reader, options, PropCoordinating, null)) + { + continue; + } + + if (propCoordinatingInBytes.TryReadProperty(ref reader, options, PropCoordinatingInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCoordinatingRejections.TryReadProperty(ref reader, options, PropCoordinatingRejections, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLargeOperationRejections.TryReadProperty(ref reader, options, PropLargeOperationRejections, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPrimary.TryReadProperty(ref reader, options, PropPrimary, null)) + { + continue; + } + + if (propPrimaryDocumentRejections.TryReadProperty(ref reader, options, PropPrimaryDocumentRejections, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPrimaryInBytes.TryReadProperty(ref reader, options, PropPrimaryInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPrimaryRejections.TryReadProperty(ref reader, options, PropPrimaryRejections, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propReplica.TryReadProperty(ref reader, options, PropReplica, null)) + { + continue; + } + + if (propReplicaInBytes.TryReadProperty(ref reader, options, PropReplicaInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propReplicaRejections.TryReadProperty(ref reader, options, PropReplicaRejections, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.PressureMemory(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + All = propAll.Value, + AllInBytes = propAllInBytes.Value, + CombinedCoordinatingAndPrimary = propCombinedCoordinatingAndPrimary.Value, + CombinedCoordinatingAndPrimaryInBytes = propCombinedCoordinatingAndPrimaryInBytes.Value, + Coordinating = propCoordinating.Value, + CoordinatingInBytes = propCoordinatingInBytes.Value, + CoordinatingRejections = propCoordinatingRejections.Value, + LargeOperationRejections = propLargeOperationRejections.Value, + Primary = propPrimary.Value, + PrimaryDocumentRejections = propPrimaryDocumentRejections.Value, + PrimaryInBytes = propPrimaryInBytes.Value, + PrimaryRejections = propPrimaryRejections.Value, + Replica = propReplica.Value, + ReplicaInBytes = propReplicaInBytes.Value, + ReplicaRejections = propReplicaRejections.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.PressureMemory value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAll, value.All, null, null); + writer.WriteProperty(options, PropAllInBytes, value.AllInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCombinedCoordinatingAndPrimary, value.CombinedCoordinatingAndPrimary, null, null); + writer.WriteProperty(options, PropCombinedCoordinatingAndPrimaryInBytes, value.CombinedCoordinatingAndPrimaryInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCoordinating, value.Coordinating, null, null); + writer.WriteProperty(options, PropCoordinatingInBytes, value.CoordinatingInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCoordinatingRejections, value.CoordinatingRejections, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLargeOperationRejections, value.LargeOperationRejections, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPrimary, value.Primary, null, null); + writer.WriteProperty(options, PropPrimaryDocumentRejections, value.PrimaryDocumentRejections, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPrimaryInBytes, value.PrimaryInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPrimaryRejections, value.PrimaryRejections, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropReplica, value.Replica, null, null); + writer.WriteProperty(options, PropReplicaInBytes, value.ReplicaInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropReplicaRejections, value.ReplicaRejections, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/PressureMemory.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/PressureMemory.g.cs index 2aa2286d86b..3c97ec63fc4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/PressureMemory.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/PressureMemory.g.cs @@ -23,172 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class PressureMemoryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAll = System.Text.Json.JsonEncodedText.Encode("all"); - private static readonly System.Text.Json.JsonEncodedText PropAllInBytes = System.Text.Json.JsonEncodedText.Encode("all_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropCombinedCoordinatingAndPrimary = System.Text.Json.JsonEncodedText.Encode("combined_coordinating_and_primary"); - private static readonly System.Text.Json.JsonEncodedText PropCombinedCoordinatingAndPrimaryInBytes = System.Text.Json.JsonEncodedText.Encode("combined_coordinating_and_primary_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropCoordinating = System.Text.Json.JsonEncodedText.Encode("coordinating"); - private static readonly System.Text.Json.JsonEncodedText PropCoordinatingInBytes = System.Text.Json.JsonEncodedText.Encode("coordinating_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropCoordinatingRejections = System.Text.Json.JsonEncodedText.Encode("coordinating_rejections"); - private static readonly System.Text.Json.JsonEncodedText PropLargeOperationRejections = System.Text.Json.JsonEncodedText.Encode("large_operation_rejections"); - private static readonly System.Text.Json.JsonEncodedText PropPrimary = System.Text.Json.JsonEncodedText.Encode("primary"); - private static readonly System.Text.Json.JsonEncodedText PropPrimaryDocumentRejections = System.Text.Json.JsonEncodedText.Encode("primary_document_rejections"); - private static readonly System.Text.Json.JsonEncodedText PropPrimaryInBytes = System.Text.Json.JsonEncodedText.Encode("primary_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropPrimaryRejections = System.Text.Json.JsonEncodedText.Encode("primary_rejections"); - private static readonly System.Text.Json.JsonEncodedText PropReplica = System.Text.Json.JsonEncodedText.Encode("replica"); - private static readonly System.Text.Json.JsonEncodedText PropReplicaInBytes = System.Text.Json.JsonEncodedText.Encode("replica_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropReplicaRejections = System.Text.Json.JsonEncodedText.Encode("replica_rejections"); - - public override Elastic.Clients.Elasticsearch.Nodes.PressureMemory Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAll = default; - LocalJsonValue propAllInBytes = default; - LocalJsonValue propCombinedCoordinatingAndPrimary = default; - LocalJsonValue propCombinedCoordinatingAndPrimaryInBytes = default; - LocalJsonValue propCoordinating = default; - LocalJsonValue propCoordinatingInBytes = default; - LocalJsonValue propCoordinatingRejections = default; - LocalJsonValue propLargeOperationRejections = default; - LocalJsonValue propPrimary = default; - LocalJsonValue propPrimaryDocumentRejections = default; - LocalJsonValue propPrimaryInBytes = default; - LocalJsonValue propPrimaryRejections = default; - LocalJsonValue propReplica = default; - LocalJsonValue propReplicaInBytes = default; - LocalJsonValue propReplicaRejections = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAll.TryReadProperty(ref reader, options, PropAll, null)) - { - continue; - } - - if (propAllInBytes.TryReadProperty(ref reader, options, PropAllInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCombinedCoordinatingAndPrimary.TryReadProperty(ref reader, options, PropCombinedCoordinatingAndPrimary, null)) - { - continue; - } - - if (propCombinedCoordinatingAndPrimaryInBytes.TryReadProperty(ref reader, options, PropCombinedCoordinatingAndPrimaryInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCoordinating.TryReadProperty(ref reader, options, PropCoordinating, null)) - { - continue; - } - - if (propCoordinatingInBytes.TryReadProperty(ref reader, options, PropCoordinatingInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCoordinatingRejections.TryReadProperty(ref reader, options, PropCoordinatingRejections, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLargeOperationRejections.TryReadProperty(ref reader, options, PropLargeOperationRejections, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPrimary.TryReadProperty(ref reader, options, PropPrimary, null)) - { - continue; - } - - if (propPrimaryDocumentRejections.TryReadProperty(ref reader, options, PropPrimaryDocumentRejections, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPrimaryInBytes.TryReadProperty(ref reader, options, PropPrimaryInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPrimaryRejections.TryReadProperty(ref reader, options, PropPrimaryRejections, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propReplica.TryReadProperty(ref reader, options, PropReplica, null)) - { - continue; - } - - if (propReplicaInBytes.TryReadProperty(ref reader, options, PropReplicaInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propReplicaRejections.TryReadProperty(ref reader, options, PropReplicaRejections, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.PressureMemory(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - All = propAll.Value, - AllInBytes = propAllInBytes.Value, - CombinedCoordinatingAndPrimary = propCombinedCoordinatingAndPrimary.Value, - CombinedCoordinatingAndPrimaryInBytes = propCombinedCoordinatingAndPrimaryInBytes.Value, - Coordinating = propCoordinating.Value, - CoordinatingInBytes = propCoordinatingInBytes.Value, - CoordinatingRejections = propCoordinatingRejections.Value, - LargeOperationRejections = propLargeOperationRejections.Value, - Primary = propPrimary.Value, - PrimaryDocumentRejections = propPrimaryDocumentRejections.Value, - PrimaryInBytes = propPrimaryInBytes.Value, - PrimaryRejections = propPrimaryRejections.Value, - Replica = propReplica.Value, - ReplicaInBytes = propReplicaInBytes.Value, - ReplicaRejections = propReplicaRejections.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.PressureMemory value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAll, value.All, null, null); - writer.WriteProperty(options, PropAllInBytes, value.AllInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCombinedCoordinatingAndPrimary, value.CombinedCoordinatingAndPrimary, null, null); - writer.WriteProperty(options, PropCombinedCoordinatingAndPrimaryInBytes, value.CombinedCoordinatingAndPrimaryInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCoordinating, value.Coordinating, null, null); - writer.WriteProperty(options, PropCoordinatingInBytes, value.CoordinatingInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCoordinatingRejections, value.CoordinatingRejections, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLargeOperationRejections, value.LargeOperationRejections, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPrimary, value.Primary, null, null); - writer.WriteProperty(options, PropPrimaryDocumentRejections, value.PrimaryDocumentRejections, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPrimaryInBytes, value.PrimaryInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPrimaryRejections, value.PrimaryRejections, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropReplica, value.Replica, null, null); - writer.WriteProperty(options, PropReplicaInBytes, value.ReplicaInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropReplicaRejections, value.ReplicaRejections, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.PressureMemoryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.PressureMemoryConverter))] public sealed partial class PressureMemory { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Process.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Process.Converters.g.cs new file mode 100644 index 00000000000..c51ca3da116 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Process.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class ProcessConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCpu = System.Text.Json.JsonEncodedText.Encode("cpu"); + private static readonly System.Text.Json.JsonEncodedText PropMaxFileDescriptors = System.Text.Json.JsonEncodedText.Encode("max_file_descriptors"); + private static readonly System.Text.Json.JsonEncodedText PropMem = System.Text.Json.JsonEncodedText.Encode("mem"); + private static readonly System.Text.Json.JsonEncodedText PropOpenFileDescriptors = System.Text.Json.JsonEncodedText.Encode("open_file_descriptors"); + private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); + + public override Elastic.Clients.Elasticsearch.Nodes.Process Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCpu = default; + LocalJsonValue propMaxFileDescriptors = default; + LocalJsonValue propMem = default; + LocalJsonValue propOpenFileDescriptors = default; + LocalJsonValue propTimestamp = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCpu.TryReadProperty(ref reader, options, PropCpu, null)) + { + continue; + } + + if (propMaxFileDescriptors.TryReadProperty(ref reader, options, PropMaxFileDescriptors, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMem.TryReadProperty(ref reader, options, PropMem, null)) + { + continue; + } + + if (propOpenFileDescriptors.TryReadProperty(ref reader, options, PropOpenFileDescriptors, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.Process(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Cpu = propCpu.Value, + MaxFileDescriptors = propMaxFileDescriptors.Value, + Mem = propMem.Value, + OpenFileDescriptors = propOpenFileDescriptors.Value, + Timestamp = propTimestamp.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Process value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCpu, value.Cpu, null, null); + writer.WriteProperty(options, PropMaxFileDescriptors, value.MaxFileDescriptors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMem, value.Mem, null, null); + writer.WriteProperty(options, PropOpenFileDescriptors, value.OpenFileDescriptors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Process.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Process.g.cs index e1a447b98c5..0f68377837b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Process.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Process.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class ProcessConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCpu = System.Text.Json.JsonEncodedText.Encode("cpu"); - private static readonly System.Text.Json.JsonEncodedText PropMaxFileDescriptors = System.Text.Json.JsonEncodedText.Encode("max_file_descriptors"); - private static readonly System.Text.Json.JsonEncodedText PropMem = System.Text.Json.JsonEncodedText.Encode("mem"); - private static readonly System.Text.Json.JsonEncodedText PropOpenFileDescriptors = System.Text.Json.JsonEncodedText.Encode("open_file_descriptors"); - private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); - - public override Elastic.Clients.Elasticsearch.Nodes.Process Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCpu = default; - LocalJsonValue propMaxFileDescriptors = default; - LocalJsonValue propMem = default; - LocalJsonValue propOpenFileDescriptors = default; - LocalJsonValue propTimestamp = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCpu.TryReadProperty(ref reader, options, PropCpu, null)) - { - continue; - } - - if (propMaxFileDescriptors.TryReadProperty(ref reader, options, PropMaxFileDescriptors, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMem.TryReadProperty(ref reader, options, PropMem, null)) - { - continue; - } - - if (propOpenFileDescriptors.TryReadProperty(ref reader, options, PropOpenFileDescriptors, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.Process(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Cpu = propCpu.Value, - MaxFileDescriptors = propMaxFileDescriptors.Value, - Mem = propMem.Value, - OpenFileDescriptors = propOpenFileDescriptors.Value, - Timestamp = propTimestamp.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Process value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCpu, value.Cpu, null, null); - writer.WriteProperty(options, PropMaxFileDescriptors, value.MaxFileDescriptors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMem, value.Mem, null, null); - writer.WriteProperty(options, PropOpenFileDescriptors, value.OpenFileDescriptors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.ProcessConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.ProcessConverter))] public sealed partial class Process { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Processor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Processor.Converters.g.cs new file mode 100644 index 00000000000..d6227887298 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Processor.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class ProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropCurrent = System.Text.Json.JsonEncodedText.Encode("current"); + private static readonly System.Text.Json.JsonEncodedText PropFailed = System.Text.Json.JsonEncodedText.Encode("failed"); + private static readonly System.Text.Json.JsonEncodedText PropTimeInMillis = System.Text.Json.JsonEncodedText.Encode("time_in_millis"); + + public override Elastic.Clients.Elasticsearch.Nodes.Processor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propCurrent = default; + LocalJsonValue propFailed = default; + LocalJsonValue propTimeInMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCurrent.TryReadProperty(ref reader, options, PropCurrent, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFailed.TryReadProperty(ref reader, options, PropFailed, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeInMillis.TryReadProperty(ref reader, options, PropTimeInMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.Processor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Current = propCurrent.Value, + Failed = propFailed.Value, + TimeInMillis = propTimeInMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Processor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCurrent, value.Current, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFailed, value.Failed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeInMillis, value.TimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Processor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Processor.g.cs index 693a0706f4c..a99f889e830 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Processor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Processor.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class ProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropCurrent = System.Text.Json.JsonEncodedText.Encode("current"); - private static readonly System.Text.Json.JsonEncodedText PropFailed = System.Text.Json.JsonEncodedText.Encode("failed"); - private static readonly System.Text.Json.JsonEncodedText PropTimeInMillis = System.Text.Json.JsonEncodedText.Encode("time_in_millis"); - - public override Elastic.Clients.Elasticsearch.Nodes.Processor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propCurrent = default; - LocalJsonValue propFailed = default; - LocalJsonValue propTimeInMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCurrent.TryReadProperty(ref reader, options, PropCurrent, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFailed.TryReadProperty(ref reader, options, PropFailed, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeInMillis.TryReadProperty(ref reader, options, PropTimeInMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.Processor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Current = propCurrent.Value, - Failed = propFailed.Value, - TimeInMillis = propTimeInMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Processor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCurrent, value.Current, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFailed, value.Failed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeInMillis, value.TimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.ProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.ProcessorConverter))] public sealed partial class Processor { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/PublishedClusterStates.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/PublishedClusterStates.Converters.g.cs new file mode 100644 index 00000000000..814712d1814 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/PublishedClusterStates.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class PublishedClusterStatesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCompatibleDiffs = System.Text.Json.JsonEncodedText.Encode("compatible_diffs"); + private static readonly System.Text.Json.JsonEncodedText PropFullStates = System.Text.Json.JsonEncodedText.Encode("full_states"); + private static readonly System.Text.Json.JsonEncodedText PropIncompatibleDiffs = System.Text.Json.JsonEncodedText.Encode("incompatible_diffs"); + + public override Elastic.Clients.Elasticsearch.Nodes.PublishedClusterStates Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCompatibleDiffs = default; + LocalJsonValue propFullStates = default; + LocalJsonValue propIncompatibleDiffs = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCompatibleDiffs.TryReadProperty(ref reader, options, PropCompatibleDiffs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFullStates.TryReadProperty(ref reader, options, PropFullStates, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIncompatibleDiffs.TryReadProperty(ref reader, options, PropIncompatibleDiffs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.PublishedClusterStates(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CompatibleDiffs = propCompatibleDiffs.Value, + FullStates = propFullStates.Value, + IncompatibleDiffs = propIncompatibleDiffs.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.PublishedClusterStates value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCompatibleDiffs, value.CompatibleDiffs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFullStates, value.FullStates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIncompatibleDiffs, value.IncompatibleDiffs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/PublishedClusterStates.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/PublishedClusterStates.g.cs index ba93613e746..c64be652293 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/PublishedClusterStates.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/PublishedClusterStates.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class PublishedClusterStatesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCompatibleDiffs = System.Text.Json.JsonEncodedText.Encode("compatible_diffs"); - private static readonly System.Text.Json.JsonEncodedText PropFullStates = System.Text.Json.JsonEncodedText.Encode("full_states"); - private static readonly System.Text.Json.JsonEncodedText PropIncompatibleDiffs = System.Text.Json.JsonEncodedText.Encode("incompatible_diffs"); - - public override Elastic.Clients.Elasticsearch.Nodes.PublishedClusterStates Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCompatibleDiffs = default; - LocalJsonValue propFullStates = default; - LocalJsonValue propIncompatibleDiffs = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCompatibleDiffs.TryReadProperty(ref reader, options, PropCompatibleDiffs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFullStates.TryReadProperty(ref reader, options, PropFullStates, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIncompatibleDiffs.TryReadProperty(ref reader, options, PropIncompatibleDiffs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.PublishedClusterStates(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CompatibleDiffs = propCompatibleDiffs.Value, - FullStates = propFullStates.Value, - IncompatibleDiffs = propIncompatibleDiffs.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.PublishedClusterStates value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCompatibleDiffs, value.CompatibleDiffs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFullStates, value.FullStates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIncompatibleDiffs, value.IncompatibleDiffs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.PublishedClusterStatesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.PublishedClusterStatesConverter))] public sealed partial class PublishedClusterStates { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Recording.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Recording.Converters.g.cs new file mode 100644 index 00000000000..06931ae42e6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Recording.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class RecordingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCumulativeExecutionCount = System.Text.Json.JsonEncodedText.Encode("cumulative_execution_count"); + private static readonly System.Text.Json.JsonEncodedText PropCumulativeExecutionTime = System.Text.Json.JsonEncodedText.Encode("cumulative_execution_time"); + private static readonly System.Text.Json.JsonEncodedText PropCumulativeExecutionTimeMillis = System.Text.Json.JsonEncodedText.Encode("cumulative_execution_time_millis"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.Nodes.Recording Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCumulativeExecutionCount = default; + LocalJsonValue propCumulativeExecutionTime = default; + LocalJsonValue propCumulativeExecutionTimeMillis = default; + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCumulativeExecutionCount.TryReadProperty(ref reader, options, PropCumulativeExecutionCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCumulativeExecutionTime.TryReadProperty(ref reader, options, PropCumulativeExecutionTime, null)) + { + continue; + } + + if (propCumulativeExecutionTimeMillis.TryReadProperty(ref reader, options, PropCumulativeExecutionTimeMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.Recording(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CumulativeExecutionCount = propCumulativeExecutionCount.Value, + CumulativeExecutionTime = propCumulativeExecutionTime.Value, + CumulativeExecutionTimeMillis = propCumulativeExecutionTimeMillis.Value, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Recording value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCumulativeExecutionCount, value.CumulativeExecutionCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCumulativeExecutionTime, value.CumulativeExecutionTime, null, null); + writer.WriteProperty(options, PropCumulativeExecutionTimeMillis, value.CumulativeExecutionTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Recording.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Recording.g.cs index f03f394d653..3dc75c340cd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Recording.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Recording.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class RecordingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCumulativeExecutionCount = System.Text.Json.JsonEncodedText.Encode("cumulative_execution_count"); - private static readonly System.Text.Json.JsonEncodedText PropCumulativeExecutionTime = System.Text.Json.JsonEncodedText.Encode("cumulative_execution_time"); - private static readonly System.Text.Json.JsonEncodedText PropCumulativeExecutionTimeMillis = System.Text.Json.JsonEncodedText.Encode("cumulative_execution_time_millis"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.Nodes.Recording Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCumulativeExecutionCount = default; - LocalJsonValue propCumulativeExecutionTime = default; - LocalJsonValue propCumulativeExecutionTimeMillis = default; - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCumulativeExecutionCount.TryReadProperty(ref reader, options, PropCumulativeExecutionCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCumulativeExecutionTime.TryReadProperty(ref reader, options, PropCumulativeExecutionTime, null)) - { - continue; - } - - if (propCumulativeExecutionTimeMillis.TryReadProperty(ref reader, options, PropCumulativeExecutionTimeMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.Recording(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CumulativeExecutionCount = propCumulativeExecutionCount.Value, - CumulativeExecutionTime = propCumulativeExecutionTime.Value, - CumulativeExecutionTimeMillis = propCumulativeExecutionTimeMillis.Value, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Recording value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCumulativeExecutionCount, value.CumulativeExecutionCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCumulativeExecutionTime, value.CumulativeExecutionTime, null, null); - writer.WriteProperty(options, PropCumulativeExecutionTimeMillis, value.CumulativeExecutionTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.RecordingConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.RecordingConverter))] public sealed partial class Recording { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RemoveClusterServer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RemoveClusterServer.Converters.g.cs new file mode 100644 index 00000000000..07b8e9543bf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RemoveClusterServer.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class RemoveClusterServerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoundAddress = System.Text.Json.JsonEncodedText.Encode("bound_address"); + private static readonly System.Text.Json.JsonEncodedText PropPublishAddress = System.Text.Json.JsonEncodedText.Encode("publish_address"); + + public override Elastic.Clients.Elasticsearch.Nodes.RemoveClusterServer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propBoundAddress = default; + LocalJsonValue propPublishAddress = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoundAddress.TryReadProperty(ref reader, options, PropBoundAddress, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propPublishAddress.TryReadProperty(ref reader, options, PropPublishAddress, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.RemoveClusterServer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BoundAddress = propBoundAddress.Value, + PublishAddress = propPublishAddress.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.RemoveClusterServer value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoundAddress, value.BoundAddress, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPublishAddress, value.PublishAddress, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RemoveClusterServer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RemoveClusterServer.g.cs index 7a24aebcc98..b1567e0e470 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RemoveClusterServer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RemoveClusterServer.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class RemoveClusterServerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoundAddress = System.Text.Json.JsonEncodedText.Encode("bound_address"); - private static readonly System.Text.Json.JsonEncodedText PropPublishAddress = System.Text.Json.JsonEncodedText.Encode("publish_address"); - - public override Elastic.Clients.Elasticsearch.Nodes.RemoveClusterServer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propBoundAddress = default; - LocalJsonValue propPublishAddress = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoundAddress.TryReadProperty(ref reader, options, PropBoundAddress, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propPublishAddress.TryReadProperty(ref reader, options, PropPublishAddress, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.RemoveClusterServer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BoundAddress = propBoundAddress.Value, - PublishAddress = propPublishAddress.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.RemoveClusterServer value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoundAddress, value.BoundAddress, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPublishAddress, value.PublishAddress, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.RemoveClusterServerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.RemoveClusterServerConverter))] public sealed partial class RemoveClusterServer { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RepositoryLocation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RepositoryLocation.Converters.g.cs new file mode 100644 index 00000000000..83c3bf62e1a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RepositoryLocation.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class RepositoryLocationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBasePath = System.Text.Json.JsonEncodedText.Encode("base_path"); + private static readonly System.Text.Json.JsonEncodedText PropBucket = System.Text.Json.JsonEncodedText.Encode("bucket"); + private static readonly System.Text.Json.JsonEncodedText PropContainer = System.Text.Json.JsonEncodedText.Encode("container"); + + public override Elastic.Clients.Elasticsearch.Nodes.RepositoryLocation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBasePath = default; + LocalJsonValue propBucket = default; + LocalJsonValue propContainer = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBasePath.TryReadProperty(ref reader, options, PropBasePath, null)) + { + continue; + } + + if (propBucket.TryReadProperty(ref reader, options, PropBucket, null)) + { + continue; + } + + if (propContainer.TryReadProperty(ref reader, options, PropContainer, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.RepositoryLocation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BasePath = propBasePath.Value, + Bucket = propBucket.Value, + Container = propContainer.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.RepositoryLocation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBasePath, value.BasePath, null, null); + writer.WriteProperty(options, PropBucket, value.Bucket, null, null); + writer.WriteProperty(options, PropContainer, value.Container, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RepositoryLocation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RepositoryLocation.g.cs index db3aea96be2..010b7cea73d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RepositoryLocation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RepositoryLocation.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class RepositoryLocationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBasePath = System.Text.Json.JsonEncodedText.Encode("base_path"); - private static readonly System.Text.Json.JsonEncodedText PropBucket = System.Text.Json.JsonEncodedText.Encode("bucket"); - private static readonly System.Text.Json.JsonEncodedText PropContainer = System.Text.Json.JsonEncodedText.Encode("container"); - - public override Elastic.Clients.Elasticsearch.Nodes.RepositoryLocation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBasePath = default; - LocalJsonValue propBucket = default; - LocalJsonValue propContainer = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBasePath.TryReadProperty(ref reader, options, PropBasePath, null)) - { - continue; - } - - if (propBucket.TryReadProperty(ref reader, options, PropBucket, null)) - { - continue; - } - - if (propContainer.TryReadProperty(ref reader, options, PropContainer, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.RepositoryLocation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BasePath = propBasePath.Value, - Bucket = propBucket.Value, - Container = propContainer.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.RepositoryLocation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBasePath, value.BasePath, null, null); - writer.WriteProperty(options, PropBucket, value.Bucket, null, null); - writer.WriteProperty(options, PropContainer, value.Container, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.RepositoryLocationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.RepositoryLocationConverter))] public sealed partial class RepositoryLocation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RepositoryMeteringInformation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RepositoryMeteringInformation.Converters.g.cs new file mode 100644 index 00000000000..1ca9c827162 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RepositoryMeteringInformation.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class RepositoryMeteringInformationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropArchived = System.Text.Json.JsonEncodedText.Encode("archived"); + private static readonly System.Text.Json.JsonEncodedText PropClusterVersion = System.Text.Json.JsonEncodedText.Encode("cluster_version"); + private static readonly System.Text.Json.JsonEncodedText PropRepositoryEphemeralId = System.Text.Json.JsonEncodedText.Encode("repository_ephemeral_id"); + private static readonly System.Text.Json.JsonEncodedText PropRepositoryLocation = System.Text.Json.JsonEncodedText.Encode("repository_location"); + private static readonly System.Text.Json.JsonEncodedText PropRepositoryName = System.Text.Json.JsonEncodedText.Encode("repository_name"); + private static readonly System.Text.Json.JsonEncodedText PropRepositoryStartedAt = System.Text.Json.JsonEncodedText.Encode("repository_started_at"); + private static readonly System.Text.Json.JsonEncodedText PropRepositoryStoppedAt = System.Text.Json.JsonEncodedText.Encode("repository_stopped_at"); + private static readonly System.Text.Json.JsonEncodedText PropRepositoryType = System.Text.Json.JsonEncodedText.Encode("repository_type"); + private static readonly System.Text.Json.JsonEncodedText PropRequestCounts = System.Text.Json.JsonEncodedText.Encode("request_counts"); + + public override Elastic.Clients.Elasticsearch.Nodes.RepositoryMeteringInformation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propArchived = default; + LocalJsonValue propClusterVersion = default; + LocalJsonValue propRepositoryEphemeralId = default; + LocalJsonValue propRepositoryLocation = default; + LocalJsonValue propRepositoryName = default; + LocalJsonValue propRepositoryStartedAt = default; + LocalJsonValue propRepositoryStoppedAt = default; + LocalJsonValue propRepositoryType = default; + LocalJsonValue propRequestCounts = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propArchived.TryReadProperty(ref reader, options, PropArchived, null)) + { + continue; + } + + if (propClusterVersion.TryReadProperty(ref reader, options, PropClusterVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRepositoryEphemeralId.TryReadProperty(ref reader, options, PropRepositoryEphemeralId, null)) + { + continue; + } + + if (propRepositoryLocation.TryReadProperty(ref reader, options, PropRepositoryLocation, null)) + { + continue; + } + + if (propRepositoryName.TryReadProperty(ref reader, options, PropRepositoryName, null)) + { + continue; + } + + if (propRepositoryStartedAt.TryReadProperty(ref reader, options, PropRepositoryStartedAt, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propRepositoryStoppedAt.TryReadProperty(ref reader, options, PropRepositoryStoppedAt, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propRepositoryType.TryReadProperty(ref reader, options, PropRepositoryType, null)) + { + continue; + } + + if (propRequestCounts.TryReadProperty(ref reader, options, PropRequestCounts, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.RepositoryMeteringInformation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Archived = propArchived.Value, + ClusterVersion = propClusterVersion.Value, + RepositoryEphemeralId = propRepositoryEphemeralId.Value, + RepositoryLocation = propRepositoryLocation.Value, + RepositoryName = propRepositoryName.Value, + RepositoryStartedAt = propRepositoryStartedAt.Value, + RepositoryStoppedAt = propRepositoryStoppedAt.Value, + RepositoryType = propRepositoryType.Value, + RequestCounts = propRequestCounts.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.RepositoryMeteringInformation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropArchived, value.Archived, null, null); + writer.WriteProperty(options, PropClusterVersion, value.ClusterVersion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRepositoryEphemeralId, value.RepositoryEphemeralId, null, null); + writer.WriteProperty(options, PropRepositoryLocation, value.RepositoryLocation, null, null); + writer.WriteProperty(options, PropRepositoryName, value.RepositoryName, null, null); + writer.WriteProperty(options, PropRepositoryStartedAt, value.RepositoryStartedAt, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropRepositoryStoppedAt, value.RepositoryStoppedAt, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropRepositoryType, value.RepositoryType, null, null); + writer.WriteProperty(options, PropRequestCounts, value.RequestCounts, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RepositoryMeteringInformation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RepositoryMeteringInformation.g.cs index a62bda17cbf..1951ec4d202 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RepositoryMeteringInformation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RepositoryMeteringInformation.g.cs @@ -23,118 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class RepositoryMeteringInformationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropArchived = System.Text.Json.JsonEncodedText.Encode("archived"); - private static readonly System.Text.Json.JsonEncodedText PropClusterVersion = System.Text.Json.JsonEncodedText.Encode("cluster_version"); - private static readonly System.Text.Json.JsonEncodedText PropRepositoryEphemeralId = System.Text.Json.JsonEncodedText.Encode("repository_ephemeral_id"); - private static readonly System.Text.Json.JsonEncodedText PropRepositoryLocation = System.Text.Json.JsonEncodedText.Encode("repository_location"); - private static readonly System.Text.Json.JsonEncodedText PropRepositoryName = System.Text.Json.JsonEncodedText.Encode("repository_name"); - private static readonly System.Text.Json.JsonEncodedText PropRepositoryStartedAt = System.Text.Json.JsonEncodedText.Encode("repository_started_at"); - private static readonly System.Text.Json.JsonEncodedText PropRepositoryStoppedAt = System.Text.Json.JsonEncodedText.Encode("repository_stopped_at"); - private static readonly System.Text.Json.JsonEncodedText PropRepositoryType = System.Text.Json.JsonEncodedText.Encode("repository_type"); - private static readonly System.Text.Json.JsonEncodedText PropRequestCounts = System.Text.Json.JsonEncodedText.Encode("request_counts"); - - public override Elastic.Clients.Elasticsearch.Nodes.RepositoryMeteringInformation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propArchived = default; - LocalJsonValue propClusterVersion = default; - LocalJsonValue propRepositoryEphemeralId = default; - LocalJsonValue propRepositoryLocation = default; - LocalJsonValue propRepositoryName = default; - LocalJsonValue propRepositoryStartedAt = default; - LocalJsonValue propRepositoryStoppedAt = default; - LocalJsonValue propRepositoryType = default; - LocalJsonValue propRequestCounts = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propArchived.TryReadProperty(ref reader, options, PropArchived, null)) - { - continue; - } - - if (propClusterVersion.TryReadProperty(ref reader, options, PropClusterVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRepositoryEphemeralId.TryReadProperty(ref reader, options, PropRepositoryEphemeralId, null)) - { - continue; - } - - if (propRepositoryLocation.TryReadProperty(ref reader, options, PropRepositoryLocation, null)) - { - continue; - } - - if (propRepositoryName.TryReadProperty(ref reader, options, PropRepositoryName, null)) - { - continue; - } - - if (propRepositoryStartedAt.TryReadProperty(ref reader, options, PropRepositoryStartedAt, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propRepositoryStoppedAt.TryReadProperty(ref reader, options, PropRepositoryStoppedAt, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propRepositoryType.TryReadProperty(ref reader, options, PropRepositoryType, null)) - { - continue; - } - - if (propRequestCounts.TryReadProperty(ref reader, options, PropRequestCounts, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.RepositoryMeteringInformation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Archived = propArchived.Value, - ClusterVersion = propClusterVersion.Value, - RepositoryEphemeralId = propRepositoryEphemeralId.Value, - RepositoryLocation = propRepositoryLocation.Value, - RepositoryName = propRepositoryName.Value, - RepositoryStartedAt = propRepositoryStartedAt.Value, - RepositoryStoppedAt = propRepositoryStoppedAt.Value, - RepositoryType = propRepositoryType.Value, - RequestCounts = propRequestCounts.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.RepositoryMeteringInformation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropArchived, value.Archived, null, null); - writer.WriteProperty(options, PropClusterVersion, value.ClusterVersion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRepositoryEphemeralId, value.RepositoryEphemeralId, null, null); - writer.WriteProperty(options, PropRepositoryLocation, value.RepositoryLocation, null, null); - writer.WriteProperty(options, PropRepositoryName, value.RepositoryName, null, null); - writer.WriteProperty(options, PropRepositoryStartedAt, value.RepositoryStartedAt, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropRepositoryStoppedAt, value.RepositoryStoppedAt, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropRepositoryType, value.RepositoryType, null, null); - writer.WriteProperty(options, PropRequestCounts, value.RequestCounts, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.RepositoryMeteringInformationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.RepositoryMeteringInformationConverter))] public sealed partial class RepositoryMeteringInformation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RequestCounts.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RequestCounts.Converters.g.cs new file mode 100644 index 00000000000..0a7e0ea0748 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RequestCounts.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class RequestCountsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropGetBlob = System.Text.Json.JsonEncodedText.Encode("GetBlob"); + private static readonly System.Text.Json.JsonEncodedText PropGetBlobProperties = System.Text.Json.JsonEncodedText.Encode("GetBlobProperties"); + private static readonly System.Text.Json.JsonEncodedText PropGetObject = System.Text.Json.JsonEncodedText.Encode("GetObject"); + private static readonly System.Text.Json.JsonEncodedText PropInsertObject = System.Text.Json.JsonEncodedText.Encode("InsertObject"); + private static readonly System.Text.Json.JsonEncodedText PropListBlobs = System.Text.Json.JsonEncodedText.Encode("ListBlobs"); + private static readonly System.Text.Json.JsonEncodedText PropListObjects = System.Text.Json.JsonEncodedText.Encode("ListObjects"); + private static readonly System.Text.Json.JsonEncodedText PropPutBlob = System.Text.Json.JsonEncodedText.Encode("PutBlob"); + private static readonly System.Text.Json.JsonEncodedText PropPutBlock = System.Text.Json.JsonEncodedText.Encode("PutBlock"); + private static readonly System.Text.Json.JsonEncodedText PropPutBlockList = System.Text.Json.JsonEncodedText.Encode("PutBlockList"); + private static readonly System.Text.Json.JsonEncodedText PropPutMultipartObject = System.Text.Json.JsonEncodedText.Encode("PutMultipartObject"); + private static readonly System.Text.Json.JsonEncodedText PropPutObject = System.Text.Json.JsonEncodedText.Encode("PutObject"); + + public override Elastic.Clients.Elasticsearch.Nodes.RequestCounts Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propGetBlob = default; + LocalJsonValue propGetBlobProperties = default; + LocalJsonValue propGetObject = default; + LocalJsonValue propInsertObject = default; + LocalJsonValue propListBlobs = default; + LocalJsonValue propListObjects = default; + LocalJsonValue propPutBlob = default; + LocalJsonValue propPutBlock = default; + LocalJsonValue propPutBlockList = default; + LocalJsonValue propPutMultipartObject = default; + LocalJsonValue propPutObject = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propGetBlob.TryReadProperty(ref reader, options, PropGetBlob, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propGetBlobProperties.TryReadProperty(ref reader, options, PropGetBlobProperties, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propGetObject.TryReadProperty(ref reader, options, PropGetObject, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propInsertObject.TryReadProperty(ref reader, options, PropInsertObject, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propListBlobs.TryReadProperty(ref reader, options, PropListBlobs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propListObjects.TryReadProperty(ref reader, options, PropListObjects, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPutBlob.TryReadProperty(ref reader, options, PropPutBlob, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPutBlock.TryReadProperty(ref reader, options, PropPutBlock, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPutBlockList.TryReadProperty(ref reader, options, PropPutBlockList, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPutMultipartObject.TryReadProperty(ref reader, options, PropPutMultipartObject, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPutObject.TryReadProperty(ref reader, options, PropPutObject, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.RequestCounts(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + GetBlob = propGetBlob.Value, + GetBlobProperties = propGetBlobProperties.Value, + GetObject = propGetObject.Value, + InsertObject = propInsertObject.Value, + ListBlobs = propListBlobs.Value, + ListObjects = propListObjects.Value, + PutBlob = propPutBlob.Value, + PutBlock = propPutBlock.Value, + PutBlockList = propPutBlockList.Value, + PutMultipartObject = propPutMultipartObject.Value, + PutObject = propPutObject.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.RequestCounts value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropGetBlob, value.GetBlob, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropGetBlobProperties, value.GetBlobProperties, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropGetObject, value.GetObject, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropInsertObject, value.InsertObject, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropListBlobs, value.ListBlobs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropListObjects, value.ListObjects, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPutBlob, value.PutBlob, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPutBlock, value.PutBlock, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPutBlockList, value.PutBlockList, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPutMultipartObject, value.PutMultipartObject, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPutObject, value.PutObject, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RequestCounts.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RequestCounts.g.cs index da050da3403..f866d1dbccf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RequestCounts.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/RequestCounts.g.cs @@ -23,136 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class RequestCountsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropGetBlob = System.Text.Json.JsonEncodedText.Encode("GetBlob"); - private static readonly System.Text.Json.JsonEncodedText PropGetBlobProperties = System.Text.Json.JsonEncodedText.Encode("GetBlobProperties"); - private static readonly System.Text.Json.JsonEncodedText PropGetObject = System.Text.Json.JsonEncodedText.Encode("GetObject"); - private static readonly System.Text.Json.JsonEncodedText PropInsertObject = System.Text.Json.JsonEncodedText.Encode("InsertObject"); - private static readonly System.Text.Json.JsonEncodedText PropListBlobs = System.Text.Json.JsonEncodedText.Encode("ListBlobs"); - private static readonly System.Text.Json.JsonEncodedText PropListObjects = System.Text.Json.JsonEncodedText.Encode("ListObjects"); - private static readonly System.Text.Json.JsonEncodedText PropPutBlob = System.Text.Json.JsonEncodedText.Encode("PutBlob"); - private static readonly System.Text.Json.JsonEncodedText PropPutBlock = System.Text.Json.JsonEncodedText.Encode("PutBlock"); - private static readonly System.Text.Json.JsonEncodedText PropPutBlockList = System.Text.Json.JsonEncodedText.Encode("PutBlockList"); - private static readonly System.Text.Json.JsonEncodedText PropPutMultipartObject = System.Text.Json.JsonEncodedText.Encode("PutMultipartObject"); - private static readonly System.Text.Json.JsonEncodedText PropPutObject = System.Text.Json.JsonEncodedText.Encode("PutObject"); - - public override Elastic.Clients.Elasticsearch.Nodes.RequestCounts Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propGetBlob = default; - LocalJsonValue propGetBlobProperties = default; - LocalJsonValue propGetObject = default; - LocalJsonValue propInsertObject = default; - LocalJsonValue propListBlobs = default; - LocalJsonValue propListObjects = default; - LocalJsonValue propPutBlob = default; - LocalJsonValue propPutBlock = default; - LocalJsonValue propPutBlockList = default; - LocalJsonValue propPutMultipartObject = default; - LocalJsonValue propPutObject = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propGetBlob.TryReadProperty(ref reader, options, PropGetBlob, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propGetBlobProperties.TryReadProperty(ref reader, options, PropGetBlobProperties, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propGetObject.TryReadProperty(ref reader, options, PropGetObject, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propInsertObject.TryReadProperty(ref reader, options, PropInsertObject, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propListBlobs.TryReadProperty(ref reader, options, PropListBlobs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propListObjects.TryReadProperty(ref reader, options, PropListObjects, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPutBlob.TryReadProperty(ref reader, options, PropPutBlob, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPutBlock.TryReadProperty(ref reader, options, PropPutBlock, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPutBlockList.TryReadProperty(ref reader, options, PropPutBlockList, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPutMultipartObject.TryReadProperty(ref reader, options, PropPutMultipartObject, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPutObject.TryReadProperty(ref reader, options, PropPutObject, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.RequestCounts(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - GetBlob = propGetBlob.Value, - GetBlobProperties = propGetBlobProperties.Value, - GetObject = propGetObject.Value, - InsertObject = propInsertObject.Value, - ListBlobs = propListBlobs.Value, - ListObjects = propListObjects.Value, - PutBlob = propPutBlob.Value, - PutBlock = propPutBlock.Value, - PutBlockList = propPutBlockList.Value, - PutMultipartObject = propPutMultipartObject.Value, - PutObject = propPutObject.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.RequestCounts value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropGetBlob, value.GetBlob, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropGetBlobProperties, value.GetBlobProperties, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropGetObject, value.GetObject, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropInsertObject, value.InsertObject, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropListBlobs, value.ListBlobs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropListObjects, value.ListObjects, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPutBlob, value.PutBlob, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPutBlock, value.PutBlock, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPutBlockList, value.PutBlockList, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPutMultipartObject, value.PutMultipartObject, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPutObject, value.PutObject, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.RequestCountsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.RequestCountsConverter))] public sealed partial class RequestCounts { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ScriptCache.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ScriptCache.Converters.g.cs new file mode 100644 index 00000000000..9600713f970 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ScriptCache.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class ScriptCacheConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCacheEvictions = System.Text.Json.JsonEncodedText.Encode("cache_evictions"); + private static readonly System.Text.Json.JsonEncodedText PropCompilationLimitTriggered = System.Text.Json.JsonEncodedText.Encode("compilation_limit_triggered"); + private static readonly System.Text.Json.JsonEncodedText PropCompilations = System.Text.Json.JsonEncodedText.Encode("compilations"); + private static readonly System.Text.Json.JsonEncodedText PropContext = System.Text.Json.JsonEncodedText.Encode("context"); + + public override Elastic.Clients.Elasticsearch.Nodes.ScriptCache Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCacheEvictions = default; + LocalJsonValue propCompilationLimitTriggered = default; + LocalJsonValue propCompilations = default; + LocalJsonValue propContext = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCacheEvictions.TryReadProperty(ref reader, options, PropCacheEvictions, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCompilationLimitTriggered.TryReadProperty(ref reader, options, PropCompilationLimitTriggered, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCompilations.TryReadProperty(ref reader, options, PropCompilations, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propContext.TryReadProperty(ref reader, options, PropContext, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.ScriptCache(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CacheEvictions = propCacheEvictions.Value, + CompilationLimitTriggered = propCompilationLimitTriggered.Value, + Compilations = propCompilations.Value, + Context = propContext.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.ScriptCache value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCacheEvictions, value.CacheEvictions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCompilationLimitTriggered, value.CompilationLimitTriggered, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCompilations, value.Compilations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropContext, value.Context, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ScriptCache.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ScriptCache.g.cs index 19fcd1980e8..b0dd4ee9261 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ScriptCache.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ScriptCache.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class ScriptCacheConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCacheEvictions = System.Text.Json.JsonEncodedText.Encode("cache_evictions"); - private static readonly System.Text.Json.JsonEncodedText PropCompilationLimitTriggered = System.Text.Json.JsonEncodedText.Encode("compilation_limit_triggered"); - private static readonly System.Text.Json.JsonEncodedText PropCompilations = System.Text.Json.JsonEncodedText.Encode("compilations"); - private static readonly System.Text.Json.JsonEncodedText PropContext = System.Text.Json.JsonEncodedText.Encode("context"); - - public override Elastic.Clients.Elasticsearch.Nodes.ScriptCache Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCacheEvictions = default; - LocalJsonValue propCompilationLimitTriggered = default; - LocalJsonValue propCompilations = default; - LocalJsonValue propContext = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCacheEvictions.TryReadProperty(ref reader, options, PropCacheEvictions, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCompilationLimitTriggered.TryReadProperty(ref reader, options, PropCompilationLimitTriggered, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCompilations.TryReadProperty(ref reader, options, PropCompilations, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propContext.TryReadProperty(ref reader, options, PropContext, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.ScriptCache(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CacheEvictions = propCacheEvictions.Value, - CompilationLimitTriggered = propCompilationLimitTriggered.Value, - Compilations = propCompilations.Value, - Context = propContext.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.ScriptCache value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCacheEvictions, value.CacheEvictions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCompilationLimitTriggered, value.CompilationLimitTriggered, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCompilations, value.Compilations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropContext, value.Context, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.ScriptCacheConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.ScriptCacheConverter))] public sealed partial class ScriptCache { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Scripting.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Scripting.Converters.g.cs new file mode 100644 index 00000000000..178e5a522fe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Scripting.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class ScriptingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCacheEvictions = System.Text.Json.JsonEncodedText.Encode("cache_evictions"); + private static readonly System.Text.Json.JsonEncodedText PropCompilationLimitTriggered = System.Text.Json.JsonEncodedText.Encode("compilation_limit_triggered"); + private static readonly System.Text.Json.JsonEncodedText PropCompilations = System.Text.Json.JsonEncodedText.Encode("compilations"); + private static readonly System.Text.Json.JsonEncodedText PropCompilationsHistory = System.Text.Json.JsonEncodedText.Encode("compilations_history"); + private static readonly System.Text.Json.JsonEncodedText PropContexts = System.Text.Json.JsonEncodedText.Encode("contexts"); + + public override Elastic.Clients.Elasticsearch.Nodes.Scripting Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCacheEvictions = default; + LocalJsonValue propCompilationLimitTriggered = default; + LocalJsonValue propCompilations = default; + LocalJsonValue?> propCompilationsHistory = default; + LocalJsonValue?> propContexts = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCacheEvictions.TryReadProperty(ref reader, options, PropCacheEvictions, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCompilationLimitTriggered.TryReadProperty(ref reader, options, PropCompilationLimitTriggered, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCompilations.TryReadProperty(ref reader, options, PropCompilations, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCompilationsHistory.TryReadProperty(ref reader, options, PropCompilationsHistory, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propContexts.TryReadProperty(ref reader, options, PropContexts, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.Scripting(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CacheEvictions = propCacheEvictions.Value, + CompilationLimitTriggered = propCompilationLimitTriggered.Value, + Compilations = propCompilations.Value, + CompilationsHistory = propCompilationsHistory.Value, + Contexts = propContexts.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Scripting value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCacheEvictions, value.CacheEvictions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCompilationLimitTriggered, value.CompilationLimitTriggered, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCompilations, value.Compilations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCompilationsHistory, value.CompilationsHistory, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropContexts, value.Contexts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Scripting.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Scripting.g.cs index ed7ad48bff9..36f5a24b7a6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Scripting.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Scripting.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class ScriptingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCacheEvictions = System.Text.Json.JsonEncodedText.Encode("cache_evictions"); - private static readonly System.Text.Json.JsonEncodedText PropCompilationLimitTriggered = System.Text.Json.JsonEncodedText.Encode("compilation_limit_triggered"); - private static readonly System.Text.Json.JsonEncodedText PropCompilations = System.Text.Json.JsonEncodedText.Encode("compilations"); - private static readonly System.Text.Json.JsonEncodedText PropCompilationsHistory = System.Text.Json.JsonEncodedText.Encode("compilations_history"); - private static readonly System.Text.Json.JsonEncodedText PropContexts = System.Text.Json.JsonEncodedText.Encode("contexts"); - - public override Elastic.Clients.Elasticsearch.Nodes.Scripting Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCacheEvictions = default; - LocalJsonValue propCompilationLimitTriggered = default; - LocalJsonValue propCompilations = default; - LocalJsonValue?> propCompilationsHistory = default; - LocalJsonValue?> propContexts = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCacheEvictions.TryReadProperty(ref reader, options, PropCacheEvictions, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCompilationLimitTriggered.TryReadProperty(ref reader, options, PropCompilationLimitTriggered, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCompilations.TryReadProperty(ref reader, options, PropCompilations, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCompilationsHistory.TryReadProperty(ref reader, options, PropCompilationsHistory, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propContexts.TryReadProperty(ref reader, options, PropContexts, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.Scripting(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CacheEvictions = propCacheEvictions.Value, - CompilationLimitTriggered = propCompilationLimitTriggered.Value, - Compilations = propCompilations.Value, - CompilationsHistory = propCompilationsHistory.Value, - Contexts = propContexts.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Scripting value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCacheEvictions, value.CacheEvictions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCompilationLimitTriggered, value.CompilationLimitTriggered, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCompilations, value.Compilations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCompilationsHistory, value.CompilationsHistory, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropContexts, value.Contexts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.ScriptingConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.ScriptingConverter))] public sealed partial class Scripting { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SerializedClusterState.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SerializedClusterState.Converters.g.cs new file mode 100644 index 00000000000..19e25b8d9f2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SerializedClusterState.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class SerializedClusterStateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDiffs = System.Text.Json.JsonEncodedText.Encode("diffs"); + private static readonly System.Text.Json.JsonEncodedText PropFullStates = System.Text.Json.JsonEncodedText.Encode("full_states"); + + public override Elastic.Clients.Elasticsearch.Nodes.SerializedClusterState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDiffs = default; + LocalJsonValue propFullStates = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDiffs.TryReadProperty(ref reader, options, PropDiffs, null)) + { + continue; + } + + if (propFullStates.TryReadProperty(ref reader, options, PropFullStates, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.SerializedClusterState(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Diffs = propDiffs.Value, + FullStates = propFullStates.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.SerializedClusterState value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDiffs, value.Diffs, null, null); + writer.WriteProperty(options, PropFullStates, value.FullStates, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SerializedClusterState.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SerializedClusterState.g.cs index c2db84c06e1..b8aeefacb7f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SerializedClusterState.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SerializedClusterState.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class SerializedClusterStateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDiffs = System.Text.Json.JsonEncodedText.Encode("diffs"); - private static readonly System.Text.Json.JsonEncodedText PropFullStates = System.Text.Json.JsonEncodedText.Encode("full_states"); - - public override Elastic.Clients.Elasticsearch.Nodes.SerializedClusterState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDiffs = default; - LocalJsonValue propFullStates = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDiffs.TryReadProperty(ref reader, options, PropDiffs, null)) - { - continue; - } - - if (propFullStates.TryReadProperty(ref reader, options, PropFullStates, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.SerializedClusterState(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Diffs = propDiffs.Value, - FullStates = propFullStates.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.SerializedClusterState value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDiffs, value.Diffs, null, null); - writer.WriteProperty(options, PropFullStates, value.FullStates, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.SerializedClusterStateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.SerializedClusterStateConverter))] public sealed partial class SerializedClusterState { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SerializedClusterStateDetail.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SerializedClusterStateDetail.Converters.g.cs new file mode 100644 index 00000000000..e1c8d09e138 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SerializedClusterStateDetail.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class SerializedClusterStateDetailConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCompressedSize = System.Text.Json.JsonEncodedText.Encode("compressed_size"); + private static readonly System.Text.Json.JsonEncodedText PropCompressedSizeInBytes = System.Text.Json.JsonEncodedText.Encode("compressed_size_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropUncompressedSize = System.Text.Json.JsonEncodedText.Encode("uncompressed_size"); + private static readonly System.Text.Json.JsonEncodedText PropUncompressedSizeInBytes = System.Text.Json.JsonEncodedText.Encode("uncompressed_size_in_bytes"); + + public override Elastic.Clients.Elasticsearch.Nodes.SerializedClusterStateDetail Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCompressedSize = default; + LocalJsonValue propCompressedSizeInBytes = default; + LocalJsonValue propCount = default; + LocalJsonValue propUncompressedSize = default; + LocalJsonValue propUncompressedSizeInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCompressedSize.TryReadProperty(ref reader, options, PropCompressedSize, null)) + { + continue; + } + + if (propCompressedSizeInBytes.TryReadProperty(ref reader, options, PropCompressedSizeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCount.TryReadProperty(ref reader, options, PropCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propUncompressedSize.TryReadProperty(ref reader, options, PropUncompressedSize, null)) + { + continue; + } + + if (propUncompressedSizeInBytes.TryReadProperty(ref reader, options, PropUncompressedSizeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.SerializedClusterStateDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CompressedSize = propCompressedSize.Value, + CompressedSizeInBytes = propCompressedSizeInBytes.Value, + Count = propCount.Value, + UncompressedSize = propUncompressedSize.Value, + UncompressedSizeInBytes = propUncompressedSizeInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.SerializedClusterStateDetail value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCompressedSize, value.CompressedSize, null, null); + writer.WriteProperty(options, PropCompressedSizeInBytes, value.CompressedSizeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCount, value.Count, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropUncompressedSize, value.UncompressedSize, null, null); + writer.WriteProperty(options, PropUncompressedSizeInBytes, value.UncompressedSizeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SerializedClusterStateDetail.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SerializedClusterStateDetail.g.cs index 9738e5ea98c..cd9e8c8b593 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SerializedClusterStateDetail.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SerializedClusterStateDetail.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class SerializedClusterStateDetailConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCompressedSize = System.Text.Json.JsonEncodedText.Encode("compressed_size"); - private static readonly System.Text.Json.JsonEncodedText PropCompressedSizeInBytes = System.Text.Json.JsonEncodedText.Encode("compressed_size_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropUncompressedSize = System.Text.Json.JsonEncodedText.Encode("uncompressed_size"); - private static readonly System.Text.Json.JsonEncodedText PropUncompressedSizeInBytes = System.Text.Json.JsonEncodedText.Encode("uncompressed_size_in_bytes"); - - public override Elastic.Clients.Elasticsearch.Nodes.SerializedClusterStateDetail Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCompressedSize = default; - LocalJsonValue propCompressedSizeInBytes = default; - LocalJsonValue propCount = default; - LocalJsonValue propUncompressedSize = default; - LocalJsonValue propUncompressedSizeInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCompressedSize.TryReadProperty(ref reader, options, PropCompressedSize, null)) - { - continue; - } - - if (propCompressedSizeInBytes.TryReadProperty(ref reader, options, PropCompressedSizeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCount.TryReadProperty(ref reader, options, PropCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propUncompressedSize.TryReadProperty(ref reader, options, PropUncompressedSize, null)) - { - continue; - } - - if (propUncompressedSizeInBytes.TryReadProperty(ref reader, options, PropUncompressedSizeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.SerializedClusterStateDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CompressedSize = propCompressedSize.Value, - CompressedSizeInBytes = propCompressedSizeInBytes.Value, - Count = propCount.Value, - UncompressedSize = propUncompressedSize.Value, - UncompressedSizeInBytes = propUncompressedSizeInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.SerializedClusterStateDetail value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCompressedSize, value.CompressedSize, null, null); - writer.WriteProperty(options, PropCompressedSizeInBytes, value.CompressedSizeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCount, value.Count, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropUncompressedSize, value.UncompressedSize, null, null); - writer.WriteProperty(options, PropUncompressedSizeInBytes, value.UncompressedSizeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.SerializedClusterStateDetailConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.SerializedClusterStateDetailConverter))] public sealed partial class SerializedClusterStateDetail { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SizeHttpHistogram.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SizeHttpHistogram.Converters.g.cs new file mode 100644 index 00000000000..9cb775cf0af --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SizeHttpHistogram.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class SizeHttpHistogramConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropGeBytes = System.Text.Json.JsonEncodedText.Encode("ge_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropLtBytes = System.Text.Json.JsonEncodedText.Encode("lt_bytes"); + + public override Elastic.Clients.Elasticsearch.Nodes.SizeHttpHistogram Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propGeBytes = default; + LocalJsonValue propLtBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propGeBytes.TryReadProperty(ref reader, options, PropGeBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLtBytes.TryReadProperty(ref reader, options, PropLtBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.SizeHttpHistogram(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + GeBytes = propGeBytes.Value, + LtBytes = propLtBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.SizeHttpHistogram value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropGeBytes, value.GeBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLtBytes, value.LtBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SizeHttpHistogram.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SizeHttpHistogram.g.cs index 551b0fef31d..65c91679dc6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SizeHttpHistogram.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/SizeHttpHistogram.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class SizeHttpHistogramConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropGeBytes = System.Text.Json.JsonEncodedText.Encode("ge_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropLtBytes = System.Text.Json.JsonEncodedText.Encode("lt_bytes"); - - public override Elastic.Clients.Elasticsearch.Nodes.SizeHttpHistogram Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propGeBytes = default; - LocalJsonValue propLtBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propGeBytes.TryReadProperty(ref reader, options, PropGeBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLtBytes.TryReadProperty(ref reader, options, PropLtBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.SizeHttpHistogram(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - GeBytes = propGeBytes.Value, - LtBytes = propLtBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.SizeHttpHistogram value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropGeBytes, value.GeBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLtBytes, value.LtBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.SizeHttpHistogramConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.SizeHttpHistogramConverter))] public sealed partial class SizeHttpHistogram { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Stats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Stats.Converters.g.cs new file mode 100644 index 00000000000..eea3683229b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Stats.Converters.g.cs @@ -0,0 +1,252 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class StatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAdaptiveSelection = System.Text.Json.JsonEncodedText.Encode("adaptive_selection"); + private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); + private static readonly System.Text.Json.JsonEncodedText PropBreakers = System.Text.Json.JsonEncodedText.Encode("breakers"); + private static readonly System.Text.Json.JsonEncodedText PropDiscovery = System.Text.Json.JsonEncodedText.Encode("discovery"); + private static readonly System.Text.Json.JsonEncodedText PropFs = System.Text.Json.JsonEncodedText.Encode("fs"); + private static readonly System.Text.Json.JsonEncodedText PropHost = System.Text.Json.JsonEncodedText.Encode("host"); + private static readonly System.Text.Json.JsonEncodedText PropHttp = System.Text.Json.JsonEncodedText.Encode("http"); + private static readonly System.Text.Json.JsonEncodedText PropIndexingPressure = System.Text.Json.JsonEncodedText.Encode("indexing_pressure"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropIngest = System.Text.Json.JsonEncodedText.Encode("ingest"); + private static readonly System.Text.Json.JsonEncodedText PropIp = System.Text.Json.JsonEncodedText.Encode("ip"); + private static readonly System.Text.Json.JsonEncodedText PropJvm = System.Text.Json.JsonEncodedText.Encode("jvm"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropOs = System.Text.Json.JsonEncodedText.Encode("os"); + private static readonly System.Text.Json.JsonEncodedText PropProcess = System.Text.Json.JsonEncodedText.Encode("process"); + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropScriptCache = System.Text.Json.JsonEncodedText.Encode("script_cache"); + private static readonly System.Text.Json.JsonEncodedText PropThreadPool = System.Text.Json.JsonEncodedText.Encode("thread_pool"); + private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); + private static readonly System.Text.Json.JsonEncodedText PropTransport = System.Text.Json.JsonEncodedText.Encode("transport"); + private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); + + public override Elastic.Clients.Elasticsearch.Nodes.Stats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAdaptiveSelection = default; + LocalJsonValue?> propAttributes = default; + LocalJsonValue?> propBreakers = default; + LocalJsonValue propDiscovery = default; + LocalJsonValue propFs = default; + LocalJsonValue propHost = default; + LocalJsonValue propHttp = default; + LocalJsonValue propIndexingPressure = default; + LocalJsonValue propIndices = default; + LocalJsonValue propIngest = default; + LocalJsonValue?> propIp = default; + LocalJsonValue propJvm = default; + LocalJsonValue propName = default; + LocalJsonValue propOs = default; + LocalJsonValue propProcess = default; + LocalJsonValue?> propRoles = default; + LocalJsonValue propScript = default; + LocalJsonValue>?> propScriptCache = default; + LocalJsonValue?> propThreadPool = default; + LocalJsonValue propTimestamp = default; + LocalJsonValue propTransport = default; + LocalJsonValue propTransportAddress = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAdaptiveSelection.TryReadProperty(ref reader, options, PropAdaptiveSelection, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propBreakers.TryReadProperty(ref reader, options, PropBreakers, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propDiscovery.TryReadProperty(ref reader, options, PropDiscovery, null)) + { + continue; + } + + if (propFs.TryReadProperty(ref reader, options, PropFs, null)) + { + continue; + } + + if (propHost.TryReadProperty(ref reader, options, PropHost, null)) + { + continue; + } + + if (propHttp.TryReadProperty(ref reader, options, PropHttp, null)) + { + continue; + } + + if (propIndexingPressure.TryReadProperty(ref reader, options, PropIndexingPressure, null)) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) + { + continue; + } + + if (propIngest.TryReadProperty(ref reader, options, PropIngest, null)) + { + continue; + } + + if (propIp.TryReadProperty(ref reader, options, PropIp, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propJvm.TryReadProperty(ref reader, options, PropJvm, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propOs.TryReadProperty(ref reader, options, PropOs, null)) + { + continue; + } + + if (propProcess.TryReadProperty(ref reader, options, PropProcess, null)) + { + continue; + } + + if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propScriptCache.TryReadProperty(ref reader, options, PropScriptCache, static System.Collections.Generic.IReadOnlyDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!))) + { + continue; + } + + if (propThreadPool.TryReadProperty(ref reader, options, PropThreadPool, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTransport.TryReadProperty(ref reader, options, PropTransport, null)) + { + continue; + } + + if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.Stats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AdaptiveSelection = propAdaptiveSelection.Value, + Attributes = propAttributes.Value, + Breakers = propBreakers.Value, + Discovery = propDiscovery.Value, + Fs = propFs.Value, + Host = propHost.Value, + Http = propHttp.Value, + IndexingPressure = propIndexingPressure.Value, + Indices = propIndices.Value, + Ingest = propIngest.Value, + Ip = propIp.Value, + Jvm = propJvm.Value, + Name = propName.Value, + Os = propOs.Value, + Process = propProcess.Value, + Roles = propRoles.Value, + Script = propScript.Value, + ScriptCache = propScriptCache.Value, + ThreadPool = propThreadPool.Value, + Timestamp = propTimestamp.Value, + Transport = propTransport.Value, + TransportAddress = propTransportAddress.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Stats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAdaptiveSelection, value.AdaptiveSelection, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropBreakers, value.Breakers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropDiscovery, value.Discovery, null, null); + writer.WriteProperty(options, PropFs, value.Fs, null, null); + writer.WriteProperty(options, PropHost, value.Host, null, null); + writer.WriteProperty(options, PropHttp, value.Http, null, null); + writer.WriteProperty(options, PropIndexingPressure, value.IndexingPressure, null, null); + writer.WriteProperty(options, PropIndices, value.Indices, null, null); + writer.WriteProperty(options, PropIngest, value.Ingest, null, null); + writer.WriteProperty(options, PropIp, value.Ip, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropJvm, value.Jvm, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropOs, value.Os, null, null); + writer.WriteProperty(options, PropProcess, value.Process, null, null); + writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropScriptCache, value.ScriptCache, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); + writer.WriteProperty(options, PropThreadPool, value.ThreadPool, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTransport, value.Transport, null, null); + writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Stats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Stats.g.cs index e60d4e8ca94..488e9f3b4ac 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Stats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Stats.g.cs @@ -23,235 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class StatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAdaptiveSelection = System.Text.Json.JsonEncodedText.Encode("adaptive_selection"); - private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); - private static readonly System.Text.Json.JsonEncodedText PropBreakers = System.Text.Json.JsonEncodedText.Encode("breakers"); - private static readonly System.Text.Json.JsonEncodedText PropDiscovery = System.Text.Json.JsonEncodedText.Encode("discovery"); - private static readonly System.Text.Json.JsonEncodedText PropFs = System.Text.Json.JsonEncodedText.Encode("fs"); - private static readonly System.Text.Json.JsonEncodedText PropHost = System.Text.Json.JsonEncodedText.Encode("host"); - private static readonly System.Text.Json.JsonEncodedText PropHttp = System.Text.Json.JsonEncodedText.Encode("http"); - private static readonly System.Text.Json.JsonEncodedText PropIndexingPressure = System.Text.Json.JsonEncodedText.Encode("indexing_pressure"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropIngest = System.Text.Json.JsonEncodedText.Encode("ingest"); - private static readonly System.Text.Json.JsonEncodedText PropIp = System.Text.Json.JsonEncodedText.Encode("ip"); - private static readonly System.Text.Json.JsonEncodedText PropJvm = System.Text.Json.JsonEncodedText.Encode("jvm"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropOs = System.Text.Json.JsonEncodedText.Encode("os"); - private static readonly System.Text.Json.JsonEncodedText PropProcess = System.Text.Json.JsonEncodedText.Encode("process"); - private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropScriptCache = System.Text.Json.JsonEncodedText.Encode("script_cache"); - private static readonly System.Text.Json.JsonEncodedText PropThreadPool = System.Text.Json.JsonEncodedText.Encode("thread_pool"); - private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); - private static readonly System.Text.Json.JsonEncodedText PropTransport = System.Text.Json.JsonEncodedText.Encode("transport"); - private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); - - public override Elastic.Clients.Elasticsearch.Nodes.Stats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAdaptiveSelection = default; - LocalJsonValue?> propAttributes = default; - LocalJsonValue?> propBreakers = default; - LocalJsonValue propDiscovery = default; - LocalJsonValue propFs = default; - LocalJsonValue propHost = default; - LocalJsonValue propHttp = default; - LocalJsonValue propIndexingPressure = default; - LocalJsonValue propIndices = default; - LocalJsonValue propIngest = default; - LocalJsonValue?> propIp = default; - LocalJsonValue propJvm = default; - LocalJsonValue propName = default; - LocalJsonValue propOs = default; - LocalJsonValue propProcess = default; - LocalJsonValue?> propRoles = default; - LocalJsonValue propScript = default; - LocalJsonValue>?> propScriptCache = default; - LocalJsonValue?> propThreadPool = default; - LocalJsonValue propTimestamp = default; - LocalJsonValue propTransport = default; - LocalJsonValue propTransportAddress = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAdaptiveSelection.TryReadProperty(ref reader, options, PropAdaptiveSelection, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propBreakers.TryReadProperty(ref reader, options, PropBreakers, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propDiscovery.TryReadProperty(ref reader, options, PropDiscovery, null)) - { - continue; - } - - if (propFs.TryReadProperty(ref reader, options, PropFs, null)) - { - continue; - } - - if (propHost.TryReadProperty(ref reader, options, PropHost, null)) - { - continue; - } - - if (propHttp.TryReadProperty(ref reader, options, PropHttp, null)) - { - continue; - } - - if (propIndexingPressure.TryReadProperty(ref reader, options, PropIndexingPressure, null)) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) - { - continue; - } - - if (propIngest.TryReadProperty(ref reader, options, PropIngest, null)) - { - continue; - } - - if (propIp.TryReadProperty(ref reader, options, PropIp, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propJvm.TryReadProperty(ref reader, options, PropJvm, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propOs.TryReadProperty(ref reader, options, PropOs, null)) - { - continue; - } - - if (propProcess.TryReadProperty(ref reader, options, PropProcess, null)) - { - continue; - } - - if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propScriptCache.TryReadProperty(ref reader, options, PropScriptCache, static System.Collections.Generic.IReadOnlyDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!))) - { - continue; - } - - if (propThreadPool.TryReadProperty(ref reader, options, PropThreadPool, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTransport.TryReadProperty(ref reader, options, PropTransport, null)) - { - continue; - } - - if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.Stats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AdaptiveSelection = propAdaptiveSelection.Value, - Attributes = propAttributes.Value, - Breakers = propBreakers.Value, - Discovery = propDiscovery.Value, - Fs = propFs.Value, - Host = propHost.Value, - Http = propHttp.Value, - IndexingPressure = propIndexingPressure.Value, - Indices = propIndices.Value, - Ingest = propIngest.Value, - Ip = propIp.Value, - Jvm = propJvm.Value, - Name = propName.Value, - Os = propOs.Value, - Process = propProcess.Value, - Roles = propRoles.Value, - Script = propScript.Value, - ScriptCache = propScriptCache.Value, - ThreadPool = propThreadPool.Value, - Timestamp = propTimestamp.Value, - Transport = propTransport.Value, - TransportAddress = propTransportAddress.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Stats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAdaptiveSelection, value.AdaptiveSelection, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropBreakers, value.Breakers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropDiscovery, value.Discovery, null, null); - writer.WriteProperty(options, PropFs, value.Fs, null, null); - writer.WriteProperty(options, PropHost, value.Host, null, null); - writer.WriteProperty(options, PropHttp, value.Http, null, null); - writer.WriteProperty(options, PropIndexingPressure, value.IndexingPressure, null, null); - writer.WriteProperty(options, PropIndices, value.Indices, null, null); - writer.WriteProperty(options, PropIngest, value.Ingest, null, null); - writer.WriteProperty(options, PropIp, value.Ip, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropJvm, value.Jvm, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropOs, value.Os, null, null); - writer.WriteProperty(options, PropProcess, value.Process, null, null); - writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropScriptCache, value.ScriptCache, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); - writer.WriteProperty(options, PropThreadPool, value.ThreadPool, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTransport, value.Transport, null, null); - writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.StatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.StatsConverter))] public sealed partial class Stats { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ThreadCount.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ThreadCount.Converters.g.cs new file mode 100644 index 00000000000..e1913ab9d65 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ThreadCount.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class ThreadCountConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropActive = System.Text.Json.JsonEncodedText.Encode("active"); + private static readonly System.Text.Json.JsonEncodedText PropCompleted = System.Text.Json.JsonEncodedText.Encode("completed"); + private static readonly System.Text.Json.JsonEncodedText PropLargest = System.Text.Json.JsonEncodedText.Encode("largest"); + private static readonly System.Text.Json.JsonEncodedText PropQueue = System.Text.Json.JsonEncodedText.Encode("queue"); + private static readonly System.Text.Json.JsonEncodedText PropRejected = System.Text.Json.JsonEncodedText.Encode("rejected"); + private static readonly System.Text.Json.JsonEncodedText PropThreads = System.Text.Json.JsonEncodedText.Encode("threads"); + + public override Elastic.Clients.Elasticsearch.Nodes.ThreadCount Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propActive = default; + LocalJsonValue propCompleted = default; + LocalJsonValue propLargest = default; + LocalJsonValue propQueue = default; + LocalJsonValue propRejected = default; + LocalJsonValue propThreads = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propActive.TryReadProperty(ref reader, options, PropActive, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCompleted.TryReadProperty(ref reader, options, PropCompleted, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLargest.TryReadProperty(ref reader, options, PropLargest, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueue.TryReadProperty(ref reader, options, PropQueue, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRejected.TryReadProperty(ref reader, options, PropRejected, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propThreads.TryReadProperty(ref reader, options, PropThreads, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.ThreadCount(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Active = propActive.Value, + Completed = propCompleted.Value, + Largest = propLargest.Value, + Queue = propQueue.Value, + Rejected = propRejected.Value, + Threads = propThreads.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.ThreadCount value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropActive, value.Active, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCompleted, value.Completed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLargest, value.Largest, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueue, value.Queue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRejected, value.Rejected, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropThreads, value.Threads, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ThreadCount.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ThreadCount.g.cs index 625dfed042d..c1350f543ad 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ThreadCount.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/ThreadCount.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class ThreadCountConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropActive = System.Text.Json.JsonEncodedText.Encode("active"); - private static readonly System.Text.Json.JsonEncodedText PropCompleted = System.Text.Json.JsonEncodedText.Encode("completed"); - private static readonly System.Text.Json.JsonEncodedText PropLargest = System.Text.Json.JsonEncodedText.Encode("largest"); - private static readonly System.Text.Json.JsonEncodedText PropQueue = System.Text.Json.JsonEncodedText.Encode("queue"); - private static readonly System.Text.Json.JsonEncodedText PropRejected = System.Text.Json.JsonEncodedText.Encode("rejected"); - private static readonly System.Text.Json.JsonEncodedText PropThreads = System.Text.Json.JsonEncodedText.Encode("threads"); - - public override Elastic.Clients.Elasticsearch.Nodes.ThreadCount Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propActive = default; - LocalJsonValue propCompleted = default; - LocalJsonValue propLargest = default; - LocalJsonValue propQueue = default; - LocalJsonValue propRejected = default; - LocalJsonValue propThreads = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propActive.TryReadProperty(ref reader, options, PropActive, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCompleted.TryReadProperty(ref reader, options, PropCompleted, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLargest.TryReadProperty(ref reader, options, PropLargest, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueue.TryReadProperty(ref reader, options, PropQueue, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRejected.TryReadProperty(ref reader, options, PropRejected, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propThreads.TryReadProperty(ref reader, options, PropThreads, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.ThreadCount(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Active = propActive.Value, - Completed = propCompleted.Value, - Largest = propLargest.Value, - Queue = propQueue.Value, - Rejected = propRejected.Value, - Threads = propThreads.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.ThreadCount value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropActive, value.Active, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCompleted, value.Completed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLargest, value.Largest, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueue, value.Queue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRejected, value.Rejected, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropThreads, value.Threads, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.ThreadCountConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.ThreadCountConverter))] public sealed partial class ThreadCount { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/TimeHttpHistogram.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/TimeHttpHistogram.Converters.g.cs new file mode 100644 index 00000000000..9e529f85d52 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/TimeHttpHistogram.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class TimeHttpHistogramConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropGeMillis = System.Text.Json.JsonEncodedText.Encode("ge_millis"); + private static readonly System.Text.Json.JsonEncodedText PropLtMillis = System.Text.Json.JsonEncodedText.Encode("lt_millis"); + + public override Elastic.Clients.Elasticsearch.Nodes.TimeHttpHistogram Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propGeMillis = default; + LocalJsonValue propLtMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propGeMillis.TryReadProperty(ref reader, options, PropGeMillis, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLtMillis.TryReadProperty(ref reader, options, PropLtMillis, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.TimeHttpHistogram(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + GeMillis = propGeMillis.Value, + LtMillis = propLtMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.TimeHttpHistogram value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropGeMillis, value.GeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLtMillis, value.LtMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/TimeHttpHistogram.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/TimeHttpHistogram.g.cs index 45de580dc9d..e825c4ede72 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/TimeHttpHistogram.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/TimeHttpHistogram.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class TimeHttpHistogramConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropGeMillis = System.Text.Json.JsonEncodedText.Encode("ge_millis"); - private static readonly System.Text.Json.JsonEncodedText PropLtMillis = System.Text.Json.JsonEncodedText.Encode("lt_millis"); - - public override Elastic.Clients.Elasticsearch.Nodes.TimeHttpHistogram Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propGeMillis = default; - LocalJsonValue propLtMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propGeMillis.TryReadProperty(ref reader, options, PropGeMillis, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLtMillis.TryReadProperty(ref reader, options, PropLtMillis, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.TimeHttpHistogram(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - GeMillis = propGeMillis.Value, - LtMillis = propLtMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.TimeHttpHistogram value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropGeMillis, value.GeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLtMillis, value.LtMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.TimeHttpHistogramConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.TimeHttpHistogramConverter))] public sealed partial class TimeHttpHistogram { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Transport.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Transport.Converters.g.cs new file mode 100644 index 00000000000..c44ac12c4ba --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Transport.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class TransportConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropInboundHandlingTimeHistogram = System.Text.Json.JsonEncodedText.Encode("inbound_handling_time_histogram"); + private static readonly System.Text.Json.JsonEncodedText PropOutboundHandlingTimeHistogram = System.Text.Json.JsonEncodedText.Encode("outbound_handling_time_histogram"); + private static readonly System.Text.Json.JsonEncodedText PropRxCount = System.Text.Json.JsonEncodedText.Encode("rx_count"); + private static readonly System.Text.Json.JsonEncodedText PropRxSize = System.Text.Json.JsonEncodedText.Encode("rx_size"); + private static readonly System.Text.Json.JsonEncodedText PropRxSizeInBytes = System.Text.Json.JsonEncodedText.Encode("rx_size_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropServerOpen = System.Text.Json.JsonEncodedText.Encode("server_open"); + private static readonly System.Text.Json.JsonEncodedText PropTotalOutboundConnections = System.Text.Json.JsonEncodedText.Encode("total_outbound_connections"); + private static readonly System.Text.Json.JsonEncodedText PropTxCount = System.Text.Json.JsonEncodedText.Encode("tx_count"); + private static readonly System.Text.Json.JsonEncodedText PropTxSize = System.Text.Json.JsonEncodedText.Encode("tx_size"); + private static readonly System.Text.Json.JsonEncodedText PropTxSizeInBytes = System.Text.Json.JsonEncodedText.Encode("tx_size_in_bytes"); + + public override Elastic.Clients.Elasticsearch.Nodes.Transport Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propInboundHandlingTimeHistogram = default; + LocalJsonValue?> propOutboundHandlingTimeHistogram = default; + LocalJsonValue propRxCount = default; + LocalJsonValue propRxSize = default; + LocalJsonValue propRxSizeInBytes = default; + LocalJsonValue propServerOpen = default; + LocalJsonValue propTotalOutboundConnections = default; + LocalJsonValue propTxCount = default; + LocalJsonValue propTxSize = default; + LocalJsonValue propTxSizeInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propInboundHandlingTimeHistogram.TryReadProperty(ref reader, options, PropInboundHandlingTimeHistogram, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propOutboundHandlingTimeHistogram.TryReadProperty(ref reader, options, PropOutboundHandlingTimeHistogram, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propRxCount.TryReadProperty(ref reader, options, PropRxCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRxSize.TryReadProperty(ref reader, options, PropRxSize, null)) + { + continue; + } + + if (propRxSizeInBytes.TryReadProperty(ref reader, options, PropRxSizeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propServerOpen.TryReadProperty(ref reader, options, PropServerOpen, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotalOutboundConnections.TryReadProperty(ref reader, options, PropTotalOutboundConnections, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTxCount.TryReadProperty(ref reader, options, PropTxCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTxSize.TryReadProperty(ref reader, options, PropTxSize, null)) + { + continue; + } + + if (propTxSizeInBytes.TryReadProperty(ref reader, options, PropTxSizeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.Transport(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + InboundHandlingTimeHistogram = propInboundHandlingTimeHistogram.Value, + OutboundHandlingTimeHistogram = propOutboundHandlingTimeHistogram.Value, + RxCount = propRxCount.Value, + RxSize = propRxSize.Value, + RxSizeInBytes = propRxSizeInBytes.Value, + ServerOpen = propServerOpen.Value, + TotalOutboundConnections = propTotalOutboundConnections.Value, + TxCount = propTxCount.Value, + TxSize = propTxSize.Value, + TxSizeInBytes = propTxSizeInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Transport value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropInboundHandlingTimeHistogram, value.InboundHandlingTimeHistogram, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropOutboundHandlingTimeHistogram, value.OutboundHandlingTimeHistogram, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRxCount, value.RxCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRxSize, value.RxSize, null, null); + writer.WriteProperty(options, PropRxSizeInBytes, value.RxSizeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropServerOpen, value.ServerOpen, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotalOutboundConnections, value.TotalOutboundConnections, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTxCount, value.TxCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTxSize, value.TxSize, null, null); + writer.WriteProperty(options, PropTxSizeInBytes, value.TxSizeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Transport.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Transport.g.cs index bfc005aa806..aecf36c8a12 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Transport.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/Transport.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class TransportConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropInboundHandlingTimeHistogram = System.Text.Json.JsonEncodedText.Encode("inbound_handling_time_histogram"); - private static readonly System.Text.Json.JsonEncodedText PropOutboundHandlingTimeHistogram = System.Text.Json.JsonEncodedText.Encode("outbound_handling_time_histogram"); - private static readonly System.Text.Json.JsonEncodedText PropRxCount = System.Text.Json.JsonEncodedText.Encode("rx_count"); - private static readonly System.Text.Json.JsonEncodedText PropRxSize = System.Text.Json.JsonEncodedText.Encode("rx_size"); - private static readonly System.Text.Json.JsonEncodedText PropRxSizeInBytes = System.Text.Json.JsonEncodedText.Encode("rx_size_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropServerOpen = System.Text.Json.JsonEncodedText.Encode("server_open"); - private static readonly System.Text.Json.JsonEncodedText PropTotalOutboundConnections = System.Text.Json.JsonEncodedText.Encode("total_outbound_connections"); - private static readonly System.Text.Json.JsonEncodedText PropTxCount = System.Text.Json.JsonEncodedText.Encode("tx_count"); - private static readonly System.Text.Json.JsonEncodedText PropTxSize = System.Text.Json.JsonEncodedText.Encode("tx_size"); - private static readonly System.Text.Json.JsonEncodedText PropTxSizeInBytes = System.Text.Json.JsonEncodedText.Encode("tx_size_in_bytes"); - - public override Elastic.Clients.Elasticsearch.Nodes.Transport Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propInboundHandlingTimeHistogram = default; - LocalJsonValue?> propOutboundHandlingTimeHistogram = default; - LocalJsonValue propRxCount = default; - LocalJsonValue propRxSize = default; - LocalJsonValue propRxSizeInBytes = default; - LocalJsonValue propServerOpen = default; - LocalJsonValue propTotalOutboundConnections = default; - LocalJsonValue propTxCount = default; - LocalJsonValue propTxSize = default; - LocalJsonValue propTxSizeInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propInboundHandlingTimeHistogram.TryReadProperty(ref reader, options, PropInboundHandlingTimeHistogram, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propOutboundHandlingTimeHistogram.TryReadProperty(ref reader, options, PropOutboundHandlingTimeHistogram, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propRxCount.TryReadProperty(ref reader, options, PropRxCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRxSize.TryReadProperty(ref reader, options, PropRxSize, null)) - { - continue; - } - - if (propRxSizeInBytes.TryReadProperty(ref reader, options, PropRxSizeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propServerOpen.TryReadProperty(ref reader, options, PropServerOpen, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotalOutboundConnections.TryReadProperty(ref reader, options, PropTotalOutboundConnections, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTxCount.TryReadProperty(ref reader, options, PropTxCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTxSize.TryReadProperty(ref reader, options, PropTxSize, null)) - { - continue; - } - - if (propTxSizeInBytes.TryReadProperty(ref reader, options, PropTxSizeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.Transport(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - InboundHandlingTimeHistogram = propInboundHandlingTimeHistogram.Value, - OutboundHandlingTimeHistogram = propOutboundHandlingTimeHistogram.Value, - RxCount = propRxCount.Value, - RxSize = propRxSize.Value, - RxSizeInBytes = propRxSizeInBytes.Value, - ServerOpen = propServerOpen.Value, - TotalOutboundConnections = propTotalOutboundConnections.Value, - TxCount = propTxCount.Value, - TxSize = propTxSize.Value, - TxSizeInBytes = propTxSizeInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.Transport value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropInboundHandlingTimeHistogram, value.InboundHandlingTimeHistogram, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropOutboundHandlingTimeHistogram, value.OutboundHandlingTimeHistogram, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRxCount, value.RxCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRxSize, value.RxSize, null, null); - writer.WriteProperty(options, PropRxSizeInBytes, value.RxSizeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropServerOpen, value.ServerOpen, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotalOutboundConnections, value.TotalOutboundConnections, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTxCount, value.TxCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTxSize, value.TxSize, null, null); - writer.WriteProperty(options, PropTxSizeInBytes, value.TxSizeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.TransportConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.TransportConverter))] public sealed partial class Transport { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/TransportHistogram.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/TransportHistogram.Converters.g.cs new file mode 100644 index 00000000000..d99acde26cb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/TransportHistogram.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Nodes.Json; + +public sealed partial class TransportHistogramConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropGeMillis = System.Text.Json.JsonEncodedText.Encode("ge_millis"); + private static readonly System.Text.Json.JsonEncodedText PropLtMillis = System.Text.Json.JsonEncodedText.Encode("lt_millis"); + + public override Elastic.Clients.Elasticsearch.Nodes.TransportHistogram Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propGeMillis = default; + LocalJsonValue propLtMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propGeMillis.TryReadProperty(ref reader, options, PropGeMillis, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLtMillis.TryReadProperty(ref reader, options, PropLtMillis, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Nodes.TransportHistogram(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + GeMillis = propGeMillis.Value, + LtMillis = propLtMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.TransportHistogram value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropGeMillis, value.GeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLtMillis, value.LtMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/TransportHistogram.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/TransportHistogram.g.cs index 37a75605f59..71fdfd48160 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/TransportHistogram.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Nodes/TransportHistogram.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Nodes; -internal sealed partial class TransportHistogramConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropGeMillis = System.Text.Json.JsonEncodedText.Encode("ge_millis"); - private static readonly System.Text.Json.JsonEncodedText PropLtMillis = System.Text.Json.JsonEncodedText.Encode("lt_millis"); - - public override Elastic.Clients.Elasticsearch.Nodes.TransportHistogram Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propGeMillis = default; - LocalJsonValue propLtMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propGeMillis.TryReadProperty(ref reader, options, PropGeMillis, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLtMillis.TryReadProperty(ref reader, options, PropLtMillis, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Nodes.TransportHistogram(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - GeMillis = propGeMillis.Value, - LtMillis = propLtMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Nodes.TransportHistogram value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropGeMillis, value.GeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLtMillis, value.LtMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.TransportHistogramConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Nodes.Json.TransportHistogramConverter))] public sealed partial class TransportHistogram { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Normalization.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Normalization.Converters.g.cs new file mode 100644 index 00000000000..969222605f6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Normalization.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class NormalizationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberH1 = System.Text.Json.JsonEncodedText.Encode("h1"); + private static readonly System.Text.Json.JsonEncodedText MemberH2 = System.Text.Json.JsonEncodedText.Encode("h2"); + private static readonly System.Text.Json.JsonEncodedText MemberH3 = System.Text.Json.JsonEncodedText.Encode("h3"); + private static readonly System.Text.Json.JsonEncodedText MemberNo = System.Text.Json.JsonEncodedText.Encode("no"); + private static readonly System.Text.Json.JsonEncodedText MemberZ = System.Text.Json.JsonEncodedText.Encode("z"); + + public override Elastic.Clients.Elasticsearch.Normalization Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberH1)) + { + return Elastic.Clients.Elasticsearch.Normalization.H1; + } + + if (reader.ValueTextEquals(MemberH2)) + { + return Elastic.Clients.Elasticsearch.Normalization.H2; + } + + if (reader.ValueTextEquals(MemberH3)) + { + return Elastic.Clients.Elasticsearch.Normalization.H3; + } + + if (reader.ValueTextEquals(MemberNo)) + { + return Elastic.Clients.Elasticsearch.Normalization.No; + } + + if (reader.ValueTextEquals(MemberZ)) + { + return Elastic.Clients.Elasticsearch.Normalization.Z; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberH1.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Normalization.H1; + } + + if (string.Equals(value, MemberH2.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Normalization.H2; + } + + if (string.Equals(value, MemberH3.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Normalization.H3; + } + + if (string.Equals(value, MemberNo.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Normalization.No; + } + + if (string.Equals(value, MemberZ.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Normalization.Z; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Normalization)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Normalization value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Normalization.H1: + writer.WriteStringValue(MemberH1); + break; + case Elastic.Clients.Elasticsearch.Normalization.H2: + writer.WriteStringValue(MemberH2); + break; + case Elastic.Clients.Elasticsearch.Normalization.H3: + writer.WriteStringValue(MemberH3); + break; + case Elastic.Clients.Elasticsearch.Normalization.No: + writer.WriteStringValue(MemberNo); + break; + case Elastic.Clients.Elasticsearch.Normalization.Z: + writer.WriteStringValue(MemberZ); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Normalization)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Normalization ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Normalization value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Normalization.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Normalization.g.cs new file mode 100644 index 00000000000..8e0810155ba --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Normalization.g.cs @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.NormalizationConverter))] +public enum Normalization +{ + [System.Runtime.Serialization.EnumMember(Value = "h1")] + H1, + [System.Runtime.Serialization.EnumMember(Value = "h2")] + H2, + [System.Runtime.Serialization.EnumMember(Value = "h3")] + H3, + [System.Runtime.Serialization.EnumMember(Value = "no")] + No, + [System.Runtime.Serialization.EnumMember(Value = "z")] + Z +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/OpType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/OpType.Converters.g.cs new file mode 100644 index 00000000000..b82a8d6c459 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/OpType.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class OpTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCreate = System.Text.Json.JsonEncodedText.Encode("create"); + private static readonly System.Text.Json.JsonEncodedText MemberIndex = System.Text.Json.JsonEncodedText.Encode("index"); + + public override Elastic.Clients.Elasticsearch.OpType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCreate)) + { + return Elastic.Clients.Elasticsearch.OpType.Create; + } + + if (reader.ValueTextEquals(MemberIndex)) + { + return Elastic.Clients.Elasticsearch.OpType.Index; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCreate.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.OpType.Create; + } + + if (string.Equals(value, MemberIndex.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.OpType.Index; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.OpType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.OpType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.OpType.Create: + writer.WriteStringValue(MemberCreate); + break; + case Elastic.Clients.Elasticsearch.OpType.Index: + writer.WriteStringValue(MemberIndex); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.OpType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.OpType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.OpType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/OpType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/OpType.g.cs new file mode 100644 index 00000000000..c32b7a0e83f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/OpType.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.OpTypeConverter))] +public enum OpType +{ + /// + /// + /// Only index documents that do not already exist. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "create")] + Create, + /// + /// + /// Overwrite any documents that already exist. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "index")] + Index +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Percentage.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Percentage.Converters.g.cs new file mode 100644 index 00000000000..8c9a1fc4660 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Percentage.Converters.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class PercentageConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Percentage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number); + return selector(ref reader, options) switch + { + Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Percentage(reader.ReadValue(options, null)), + Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Percentage(reader.ReadValue(options, null)), + _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Percentage)}") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Percentage value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Tag) + { + case Elastic.Clients.Elasticsearch.UnionTag.T1: + { + writer.WriteValue(options, value.Value1, null); + break; + } + + case Elastic.Clients.Elasticsearch.UnionTag.T2: + { + writer.WriteValue(options, value.Value2, null); + break; + } + + default: + throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Percentage.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Percentage.g.cs index 303dd050b02..6db41c4d4d1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Percentage.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Percentage.g.cs @@ -23,42 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class PercentageConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Percentage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number); - return selector(ref reader, options) switch - { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Percentage(reader.ReadValue(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Percentage(reader.ReadValue(options, null)), - _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Percentage)}") - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Percentage value, System.Text.Json.JsonSerializerOptions options) - { - switch (value.Tag) - { - case Elastic.Clients.Elasticsearch.UnionTag.T1: - { - writer.WriteValue(options, value.Value1, null); - break; - } - - case Elastic.Clients.Elasticsearch.UnionTag.T2: - { - writer.WriteValue(options, value.Value2, null); - break; - } - - default: - throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); - } - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.PercentageConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.PercentageConverter))] public sealed partial class Percentage : Elastic.Clients.Elasticsearch.Union { public Percentage(string value) : base(value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/PinnedRetriever.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/PinnedRetriever.Converters.g.cs new file mode 100644 index 00000000000..ba11ffc9543 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/PinnedRetriever.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class PinnedRetrieverConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropIds = System.Text.Json.JsonEncodedText.Encode("ids"); + private static readonly System.Text.Json.JsonEncodedText PropMinScore = System.Text.Json.JsonEncodedText.Encode("min_score"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropRankWindowSize = System.Text.Json.JsonEncodedText.Encode("rank_window_size"); + private static readonly System.Text.Json.JsonEncodedText PropRetriever = System.Text.Json.JsonEncodedText.Encode("retriever"); + + public override Elastic.Clients.Elasticsearch.PinnedRetriever Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propDocs = default; + LocalJsonValue?> propFilter = default; + LocalJsonValue?> propIds = default; + LocalJsonValue propMinScore = default; + LocalJsonValue propName = default; + LocalJsonValue propRankWindowSize = default; + LocalJsonValue propRetriever = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocs.TryReadProperty(ref reader, options, PropDocs, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propIds.TryReadProperty(ref reader, options, PropIds, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propRankWindowSize.TryReadProperty(ref reader, options, PropRankWindowSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRetriever.TryReadProperty(ref reader, options, PropRetriever, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.PinnedRetriever(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Docs = propDocs.Value, + Filter = propFilter.Value, + Ids = propIds.Value, + MinScore = propMinScore.Value, + Name = propName.Value, + RankWindowSize = propRankWindowSize.Value, + Retriever = propRetriever.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.PinnedRetriever value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocs, value.Docs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIds, value.Ids, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropRankWindowSize, value.RankWindowSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRetriever, value.Retriever, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/PinnedRetriever.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/PinnedRetriever.g.cs index 45d863a46e9..81f475324a9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/PinnedRetriever.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/PinnedRetriever.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class PinnedRetrieverConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropIds = System.Text.Json.JsonEncodedText.Encode("ids"); - private static readonly System.Text.Json.JsonEncodedText PropMinScore = System.Text.Json.JsonEncodedText.Encode("min_score"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropRankWindowSize = System.Text.Json.JsonEncodedText.Encode("rank_window_size"); - private static readonly System.Text.Json.JsonEncodedText PropRetriever = System.Text.Json.JsonEncodedText.Encode("retriever"); - - public override Elastic.Clients.Elasticsearch.PinnedRetriever Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propDocs = default; - LocalJsonValue?> propFilter = default; - LocalJsonValue?> propIds = default; - LocalJsonValue propMinScore = default; - LocalJsonValue propName = default; - LocalJsonValue propRankWindowSize = default; - LocalJsonValue propRetriever = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocs.TryReadProperty(ref reader, options, PropDocs, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propIds.TryReadProperty(ref reader, options, PropIds, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propRankWindowSize.TryReadProperty(ref reader, options, PropRankWindowSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRetriever.TryReadProperty(ref reader, options, PropRetriever, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.PinnedRetriever(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Docs = propDocs.Value, - Filter = propFilter.Value, - Ids = propIds.Value, - MinScore = propMinScore.Value, - Name = propName.Value, - RankWindowSize = propRankWindowSize.Value, - Retriever = propRetriever.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.PinnedRetriever value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocs, value.Docs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIds, value.Ids, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropRankWindowSize, value.RankWindowSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRetriever, value.Retriever, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.PinnedRetrieverConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.PinnedRetrieverConverter))] public sealed partial class PinnedRetriever { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/PluginStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/PluginStats.Converters.g.cs new file mode 100644 index 00000000000..8de206ed564 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/PluginStats.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class PluginStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClassname = System.Text.Json.JsonEncodedText.Encode("classname"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropElasticsearchVersion = System.Text.Json.JsonEncodedText.Encode("elasticsearch_version"); + private static readonly System.Text.Json.JsonEncodedText PropExtendedPlugins = System.Text.Json.JsonEncodedText.Encode("extended_plugins"); + private static readonly System.Text.Json.JsonEncodedText PropHasNativeController = System.Text.Json.JsonEncodedText.Encode("has_native_controller"); + private static readonly System.Text.Json.JsonEncodedText PropJavaVersion = System.Text.Json.JsonEncodedText.Encode("java_version"); + private static readonly System.Text.Json.JsonEncodedText PropLicensed = System.Text.Json.JsonEncodedText.Encode("licensed"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.PluginStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClassname = default; + LocalJsonValue propDescription = default; + LocalJsonValue propElasticsearchVersion = default; + LocalJsonValue> propExtendedPlugins = default; + LocalJsonValue propHasNativeController = default; + LocalJsonValue propJavaVersion = default; + LocalJsonValue propLicensed = default; + LocalJsonValue propName = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClassname.TryReadProperty(ref reader, options, PropClassname, null)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propElasticsearchVersion.TryReadProperty(ref reader, options, PropElasticsearchVersion, null)) + { + continue; + } + + if (propExtendedPlugins.TryReadProperty(ref reader, options, PropExtendedPlugins, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propHasNativeController.TryReadProperty(ref reader, options, PropHasNativeController, null)) + { + continue; + } + + if (propJavaVersion.TryReadProperty(ref reader, options, PropJavaVersion, null)) + { + continue; + } + + if (propLicensed.TryReadProperty(ref reader, options, PropLicensed, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.PluginStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Classname = propClassname.Value, + Description = propDescription.Value, + ElasticsearchVersion = propElasticsearchVersion.Value, + ExtendedPlugins = propExtendedPlugins.Value, + HasNativeController = propHasNativeController.Value, + JavaVersion = propJavaVersion.Value, + Licensed = propLicensed.Value, + Name = propName.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.PluginStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClassname, value.Classname, null, null); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropElasticsearchVersion, value.ElasticsearchVersion, null, null); + writer.WriteProperty(options, PropExtendedPlugins, value.ExtendedPlugins, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropHasNativeController, value.HasNativeController, null, null); + writer.WriteProperty(options, PropJavaVersion, value.JavaVersion, null, null); + writer.WriteProperty(options, PropLicensed, value.Licensed, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/PluginStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/PluginStats.g.cs index 80ea451895f..6bd3963273f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/PluginStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/PluginStats.g.cs @@ -23,118 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class PluginStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClassname = System.Text.Json.JsonEncodedText.Encode("classname"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropElasticsearchVersion = System.Text.Json.JsonEncodedText.Encode("elasticsearch_version"); - private static readonly System.Text.Json.JsonEncodedText PropExtendedPlugins = System.Text.Json.JsonEncodedText.Encode("extended_plugins"); - private static readonly System.Text.Json.JsonEncodedText PropHasNativeController = System.Text.Json.JsonEncodedText.Encode("has_native_controller"); - private static readonly System.Text.Json.JsonEncodedText PropJavaVersion = System.Text.Json.JsonEncodedText.Encode("java_version"); - private static readonly System.Text.Json.JsonEncodedText PropLicensed = System.Text.Json.JsonEncodedText.Encode("licensed"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.PluginStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClassname = default; - LocalJsonValue propDescription = default; - LocalJsonValue propElasticsearchVersion = default; - LocalJsonValue> propExtendedPlugins = default; - LocalJsonValue propHasNativeController = default; - LocalJsonValue propJavaVersion = default; - LocalJsonValue propLicensed = default; - LocalJsonValue propName = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClassname.TryReadProperty(ref reader, options, PropClassname, null)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propElasticsearchVersion.TryReadProperty(ref reader, options, PropElasticsearchVersion, null)) - { - continue; - } - - if (propExtendedPlugins.TryReadProperty(ref reader, options, PropExtendedPlugins, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propHasNativeController.TryReadProperty(ref reader, options, PropHasNativeController, null)) - { - continue; - } - - if (propJavaVersion.TryReadProperty(ref reader, options, PropJavaVersion, null)) - { - continue; - } - - if (propLicensed.TryReadProperty(ref reader, options, PropLicensed, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.PluginStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Classname = propClassname.Value, - Description = propDescription.Value, - ElasticsearchVersion = propElasticsearchVersion.Value, - ExtendedPlugins = propExtendedPlugins.Value, - HasNativeController = propHasNativeController.Value, - JavaVersion = propJavaVersion.Value, - Licensed = propLicensed.Value, - Name = propName.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.PluginStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClassname, value.Classname, null, null); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropElasticsearchVersion, value.ElasticsearchVersion, null, null); - writer.WriteProperty(options, PropExtendedPlugins, value.ExtendedPlugins, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropHasNativeController, value.HasNativeController, null, null); - writer.WriteProperty(options, PropJavaVersion, value.JavaVersion, null, null); - writer.WriteProperty(options, PropLicensed, value.Licensed, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.PluginStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.PluginStatsConverter))] public sealed partial class PluginStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryCacheStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryCacheStats.Converters.g.cs new file mode 100644 index 00000000000..307eaf352b0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryCacheStats.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class QueryCacheStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCacheCount = System.Text.Json.JsonEncodedText.Encode("cache_count"); + private static readonly System.Text.Json.JsonEncodedText PropCacheSize = System.Text.Json.JsonEncodedText.Encode("cache_size"); + private static readonly System.Text.Json.JsonEncodedText PropEvictions = System.Text.Json.JsonEncodedText.Encode("evictions"); + private static readonly System.Text.Json.JsonEncodedText PropHitCount = System.Text.Json.JsonEncodedText.Encode("hit_count"); + private static readonly System.Text.Json.JsonEncodedText PropMemorySize = System.Text.Json.JsonEncodedText.Encode("memory_size"); + private static readonly System.Text.Json.JsonEncodedText PropMemorySizeInBytes = System.Text.Json.JsonEncodedText.Encode("memory_size_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropMissCount = System.Text.Json.JsonEncodedText.Encode("miss_count"); + private static readonly System.Text.Json.JsonEncodedText PropTotalCount = System.Text.Json.JsonEncodedText.Encode("total_count"); + + public override Elastic.Clients.Elasticsearch.QueryCacheStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCacheCount = default; + LocalJsonValue propCacheSize = default; + LocalJsonValue propEvictions = default; + LocalJsonValue propHitCount = default; + LocalJsonValue propMemorySize = default; + LocalJsonValue propMemorySizeInBytes = default; + LocalJsonValue propMissCount = default; + LocalJsonValue propTotalCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCacheCount.TryReadProperty(ref reader, options, PropCacheCount, null)) + { + continue; + } + + if (propCacheSize.TryReadProperty(ref reader, options, PropCacheSize, null)) + { + continue; + } + + if (propEvictions.TryReadProperty(ref reader, options, PropEvictions, null)) + { + continue; + } + + if (propHitCount.TryReadProperty(ref reader, options, PropHitCount, null)) + { + continue; + } + + if (propMemorySize.TryReadProperty(ref reader, options, PropMemorySize, null)) + { + continue; + } + + if (propMemorySizeInBytes.TryReadProperty(ref reader, options, PropMemorySizeInBytes, null)) + { + continue; + } + + if (propMissCount.TryReadProperty(ref reader, options, PropMissCount, null)) + { + continue; + } + + if (propTotalCount.TryReadProperty(ref reader, options, PropTotalCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryCacheStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CacheCount = propCacheCount.Value, + CacheSize = propCacheSize.Value, + Evictions = propEvictions.Value, + HitCount = propHitCount.Value, + MemorySize = propMemorySize.Value, + MemorySizeInBytes = propMemorySizeInBytes.Value, + MissCount = propMissCount.Value, + TotalCount = propTotalCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryCacheStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCacheCount, value.CacheCount, null, null); + writer.WriteProperty(options, PropCacheSize, value.CacheSize, null, null); + writer.WriteProperty(options, PropEvictions, value.Evictions, null, null); + writer.WriteProperty(options, PropHitCount, value.HitCount, null, null); + writer.WriteProperty(options, PropMemorySize, value.MemorySize, null, null); + writer.WriteProperty(options, PropMemorySizeInBytes, value.MemorySizeInBytes, null, null); + writer.WriteProperty(options, PropMissCount, value.MissCount, null, null); + writer.WriteProperty(options, PropTotalCount, value.TotalCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryCacheStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryCacheStats.g.cs index b9e21f3120d..eaf06aa3beb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryCacheStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryCacheStats.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class QueryCacheStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCacheCount = System.Text.Json.JsonEncodedText.Encode("cache_count"); - private static readonly System.Text.Json.JsonEncodedText PropCacheSize = System.Text.Json.JsonEncodedText.Encode("cache_size"); - private static readonly System.Text.Json.JsonEncodedText PropEvictions = System.Text.Json.JsonEncodedText.Encode("evictions"); - private static readonly System.Text.Json.JsonEncodedText PropHitCount = System.Text.Json.JsonEncodedText.Encode("hit_count"); - private static readonly System.Text.Json.JsonEncodedText PropMemorySize = System.Text.Json.JsonEncodedText.Encode("memory_size"); - private static readonly System.Text.Json.JsonEncodedText PropMemorySizeInBytes = System.Text.Json.JsonEncodedText.Encode("memory_size_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropMissCount = System.Text.Json.JsonEncodedText.Encode("miss_count"); - private static readonly System.Text.Json.JsonEncodedText PropTotalCount = System.Text.Json.JsonEncodedText.Encode("total_count"); - - public override Elastic.Clients.Elasticsearch.QueryCacheStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCacheCount = default; - LocalJsonValue propCacheSize = default; - LocalJsonValue propEvictions = default; - LocalJsonValue propHitCount = default; - LocalJsonValue propMemorySize = default; - LocalJsonValue propMemorySizeInBytes = default; - LocalJsonValue propMissCount = default; - LocalJsonValue propTotalCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCacheCount.TryReadProperty(ref reader, options, PropCacheCount, null)) - { - continue; - } - - if (propCacheSize.TryReadProperty(ref reader, options, PropCacheSize, null)) - { - continue; - } - - if (propEvictions.TryReadProperty(ref reader, options, PropEvictions, null)) - { - continue; - } - - if (propHitCount.TryReadProperty(ref reader, options, PropHitCount, null)) - { - continue; - } - - if (propMemorySize.TryReadProperty(ref reader, options, PropMemorySize, null)) - { - continue; - } - - if (propMemorySizeInBytes.TryReadProperty(ref reader, options, PropMemorySizeInBytes, null)) - { - continue; - } - - if (propMissCount.TryReadProperty(ref reader, options, PropMissCount, null)) - { - continue; - } - - if (propTotalCount.TryReadProperty(ref reader, options, PropTotalCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryCacheStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CacheCount = propCacheCount.Value, - CacheSize = propCacheSize.Value, - Evictions = propEvictions.Value, - HitCount = propHitCount.Value, - MemorySize = propMemorySize.Value, - MemorySizeInBytes = propMemorySizeInBytes.Value, - MissCount = propMissCount.Value, - TotalCount = propTotalCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryCacheStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCacheCount, value.CacheCount, null, null); - writer.WriteProperty(options, PropCacheSize, value.CacheSize, null, null); - writer.WriteProperty(options, PropEvictions, value.Evictions, null, null); - writer.WriteProperty(options, PropHitCount, value.HitCount, null, null); - writer.WriteProperty(options, PropMemorySize, value.MemorySize, null, null); - writer.WriteProperty(options, PropMemorySizeInBytes, value.MemorySizeInBytes, null, null); - writer.WriteProperty(options, PropMissCount, value.MissCount, null, null); - writer.WriteProperty(options, PropTotalCount, value.TotalCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryCacheStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.QueryCacheStatsConverter))] public sealed partial class QueryCacheStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/BoolQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/BoolQuery.Converters.g.cs new file mode 100644 index 00000000000..9f7c04f29c4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/BoolQuery.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class BoolQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropMinimumShouldMatch = System.Text.Json.JsonEncodedText.Encode("minimum_should_match"); + private static readonly System.Text.Json.JsonEncodedText PropMust = System.Text.Json.JsonEncodedText.Encode("must"); + private static readonly System.Text.Json.JsonEncodedText PropMustNot = System.Text.Json.JsonEncodedText.Encode("must_not"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropShould = System.Text.Json.JsonEncodedText.Encode("should"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.BoolQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue?> propFilter = default; + LocalJsonValue propMinimumShouldMatch = default; + LocalJsonValue?> propMust = default; + LocalJsonValue?> propMustNot = default; + LocalJsonValue propQueryName = default; + LocalJsonValue?> propShould = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propMinimumShouldMatch.TryReadProperty(ref reader, options, PropMinimumShouldMatch, null)) + { + continue; + } + + if (propMust.TryReadProperty(ref reader, options, PropMust, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propMustNot.TryReadProperty(ref reader, options, PropMustNot, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propShould.TryReadProperty(ref reader, options, PropShould, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.BoolQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Filter = propFilter.Value, + MinimumShouldMatch = propMinimumShouldMatch.Value, + Must = propMust.Value, + MustNot = propMustNot.Value, + QueryName = propQueryName.Value, + Should = propShould.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.BoolQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMinimumShouldMatch, value.MinimumShouldMatch, null, null); + writer.WriteProperty(options, PropMust, value.Must, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMustNot, value.MustNot, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropShould, value.Should, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/BoolQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/BoolQuery.g.cs index e0e7a056521..491546ef6d0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/BoolQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/BoolQuery.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class BoolQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropMinimumShouldMatch = System.Text.Json.JsonEncodedText.Encode("minimum_should_match"); - private static readonly System.Text.Json.JsonEncodedText PropMust = System.Text.Json.JsonEncodedText.Encode("must"); - private static readonly System.Text.Json.JsonEncodedText PropMustNot = System.Text.Json.JsonEncodedText.Encode("must_not"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropShould = System.Text.Json.JsonEncodedText.Encode("should"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.BoolQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue?> propFilter = default; - LocalJsonValue propMinimumShouldMatch = default; - LocalJsonValue?> propMust = default; - LocalJsonValue?> propMustNot = default; - LocalJsonValue propQueryName = default; - LocalJsonValue?> propShould = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propMinimumShouldMatch.TryReadProperty(ref reader, options, PropMinimumShouldMatch, null)) - { - continue; - } - - if (propMust.TryReadProperty(ref reader, options, PropMust, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propMustNot.TryReadProperty(ref reader, options, PropMustNot, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propShould.TryReadProperty(ref reader, options, PropShould, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.BoolQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Filter = propFilter.Value, - MinimumShouldMatch = propMinimumShouldMatch.Value, - Must = propMust.Value, - MustNot = propMustNot.Value, - QueryName = propQueryName.Value, - Should = propShould.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.BoolQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMinimumShouldMatch, value.MinimumShouldMatch, null, null); - writer.WriteProperty(options, PropMust, value.Must, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMustNot, value.MustNot, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropShould, value.Should, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.BoolQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.BoolQueryConverter))] public partial class BoolQuery { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/BoostingQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/BoostingQuery.Converters.g.cs new file mode 100644 index 00000000000..a9a54db46fd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/BoostingQuery.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class BoostingQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropNegative = System.Text.Json.JsonEncodedText.Encode("negative"); + private static readonly System.Text.Json.JsonEncodedText PropNegativeBoost = System.Text.Json.JsonEncodedText.Encode("negative_boost"); + private static readonly System.Text.Json.JsonEncodedText PropPositive = System.Text.Json.JsonEncodedText.Encode("positive"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.BoostingQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propNegative = default; + LocalJsonValue propNegativeBoost = default; + LocalJsonValue propPositive = default; + LocalJsonValue propQueryName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNegative.TryReadProperty(ref reader, options, PropNegative, null)) + { + continue; + } + + if (propNegativeBoost.TryReadProperty(ref reader, options, PropNegativeBoost, null)) + { + continue; + } + + if (propPositive.TryReadProperty(ref reader, options, PropPositive, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.BoostingQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Negative = propNegative.Value, + NegativeBoost = propNegativeBoost.Value, + Positive = propPositive.Value, + QueryName = propQueryName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.BoostingQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNegative, value.Negative, null, null); + writer.WriteProperty(options, PropNegativeBoost, value.NegativeBoost, null, null); + writer.WriteProperty(options, PropPositive, value.Positive, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/BoostingQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/BoostingQuery.g.cs index 67bb4c61875..aafb49303b5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/BoostingQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/BoostingQuery.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class BoostingQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropNegative = System.Text.Json.JsonEncodedText.Encode("negative"); - private static readonly System.Text.Json.JsonEncodedText PropNegativeBoost = System.Text.Json.JsonEncodedText.Encode("negative_boost"); - private static readonly System.Text.Json.JsonEncodedText PropPositive = System.Text.Json.JsonEncodedText.Encode("positive"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.BoostingQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propNegative = default; - LocalJsonValue propNegativeBoost = default; - LocalJsonValue propPositive = default; - LocalJsonValue propQueryName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNegative.TryReadProperty(ref reader, options, PropNegative, null)) - { - continue; - } - - if (propNegativeBoost.TryReadProperty(ref reader, options, PropNegativeBoost, null)) - { - continue; - } - - if (propPositive.TryReadProperty(ref reader, options, PropPositive, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.BoostingQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Negative = propNegative.Value, - NegativeBoost = propNegativeBoost.Value, - Positive = propPositive.Value, - QueryName = propQueryName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.BoostingQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNegative, value.Negative, null, null); - writer.WriteProperty(options, PropNegativeBoost, value.NegativeBoost, null, null); - writer.WriteProperty(options, PropPositive, value.Positive, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.BoostingQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.BoostingQueryConverter))] public sealed partial class BoostingQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ChildScoreMode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ChildScoreMode.Converters.g.cs new file mode 100644 index 00000000000..7662999d3d8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ChildScoreMode.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class ChildScoreModeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAvg = System.Text.Json.JsonEncodedText.Encode("avg"); + private static readonly System.Text.Json.JsonEncodedText MemberMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText MemberMin = System.Text.Json.JsonEncodedText.Encode("min"); + private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); + private static readonly System.Text.Json.JsonEncodedText MemberSum = System.Text.Json.JsonEncodedText.Encode("sum"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAvg)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.Avg; + } + + if (reader.ValueTextEquals(MemberMax)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.Max; + } + + if (reader.ValueTextEquals(MemberMin)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.Min; + } + + if (reader.ValueTextEquals(MemberNone)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.None; + } + + if (reader.ValueTextEquals(MemberSum)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.Sum; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAvg.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.Avg; + } + + if (string.Equals(value, MemberMax.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.Max; + } + + if (string.Equals(value, MemberMin.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.Min; + } + + if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.None; + } + + if (string.Equals(value, MemberSum.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.Sum; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.Avg: + writer.WriteStringValue(MemberAvg); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.Max: + writer.WriteStringValue(MemberMax); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.Min: + writer.WriteStringValue(MemberMin); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.None: + writer.WriteStringValue(MemberNone); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode.Sum: + writer.WriteStringValue(MemberSum); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ChildScoreMode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ChildScoreMode.g.cs new file mode 100644 index 00000000000..c148fcba9c1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ChildScoreMode.g.cs @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.ChildScoreModeConverter))] +public enum ChildScoreMode +{ + [System.Runtime.Serialization.EnumMember(Value = "avg")] + Avg, + [System.Runtime.Serialization.EnumMember(Value = "max")] + Max, + [System.Runtime.Serialization.EnumMember(Value = "min")] + Min, + [System.Runtime.Serialization.EnumMember(Value = "none")] + None, + [System.Runtime.Serialization.EnumMember(Value = "sum")] + Sum +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CombinedFieldsOperator.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CombinedFieldsOperator.Converters.g.cs new file mode 100644 index 00000000000..1d1e01cf5aa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CombinedFieldsOperator.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class CombinedFieldsOperatorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAnd = System.Text.Json.JsonEncodedText.Encode("and"); + private static readonly System.Text.Json.JsonEncodedText MemberOr = System.Text.Json.JsonEncodedText.Encode("or"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAnd)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator.And; + } + + if (reader.ValueTextEquals(MemberOr)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator.Or; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAnd.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator.And; + } + + if (string.Equals(value, MemberOr.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator.Or; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator.And: + writer.WriteStringValue(MemberAnd); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator.Or: + writer.WriteStringValue(MemberOr); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CombinedFieldsOperator.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CombinedFieldsOperator.g.cs new file mode 100644 index 00000000000..3a03d782e2e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CombinedFieldsOperator.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.CombinedFieldsOperatorConverter))] +public enum CombinedFieldsOperator +{ + [System.Runtime.Serialization.EnumMember(Value = "and")] + And, + [System.Runtime.Serialization.EnumMember(Value = "or")] + Or +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CombinedFieldsQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CombinedFieldsQuery.Converters.g.cs new file mode 100644 index 00000000000..08464eadd42 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CombinedFieldsQuery.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class CombinedFieldsQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAutoGenerateSynonymsPhraseQuery = System.Text.Json.JsonEncodedText.Encode("auto_generate_synonyms_phrase_query"); + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropMinimumShouldMatch = System.Text.Json.JsonEncodedText.Encode("minimum_should_match"); + private static readonly System.Text.Json.JsonEncodedText PropOperator = System.Text.Json.JsonEncodedText.Encode("operator"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropZeroTermsQuery = System.Text.Json.JsonEncodedText.Encode("zero_terms_query"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAutoGenerateSynonymsPhraseQuery = default; + LocalJsonValue propBoost = default; + LocalJsonValue propFields = default; + LocalJsonValue propMinimumShouldMatch = default; + LocalJsonValue propOperator = default; + LocalJsonValue propQuery = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propZeroTermsQuery = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAutoGenerateSynonymsPhraseQuery.TryReadProperty(ref reader, options, PropAutoGenerateSynonymsPhraseQuery, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propMinimumShouldMatch.TryReadProperty(ref reader, options, PropMinimumShouldMatch, null)) + { + continue; + } + + if (propOperator.TryReadProperty(ref reader, options, PropOperator, static Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propZeroTermsQuery.TryReadProperty(ref reader, options, PropZeroTermsQuery, static Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AutoGenerateSynonymsPhraseQuery = propAutoGenerateSynonymsPhraseQuery.Value, + Boost = propBoost.Value, + Fields = propFields.Value, + MinimumShouldMatch = propMinimumShouldMatch.Value, + Operator = propOperator.Value, + Query = propQuery.Value, + QueryName = propQueryName.Value, + ZeroTermsQuery = propZeroTermsQuery.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAutoGenerateSynonymsPhraseQuery, value.AutoGenerateSynonymsPhraseQuery, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropMinimumShouldMatch, value.MinimumShouldMatch, null, null); + writer.WriteProperty(options, PropOperator, value.Operator, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropZeroTermsQuery, value.ZeroTermsQuery, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CombinedFieldsQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CombinedFieldsQuery.g.cs index 2f572c51fb7..02fdbd3dc98 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CombinedFieldsQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CombinedFieldsQuery.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class CombinedFieldsQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAutoGenerateSynonymsPhraseQuery = System.Text.Json.JsonEncodedText.Encode("auto_generate_synonyms_phrase_query"); - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropMinimumShouldMatch = System.Text.Json.JsonEncodedText.Encode("minimum_should_match"); - private static readonly System.Text.Json.JsonEncodedText PropOperator = System.Text.Json.JsonEncodedText.Encode("operator"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropZeroTermsQuery = System.Text.Json.JsonEncodedText.Encode("zero_terms_query"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAutoGenerateSynonymsPhraseQuery = default; - LocalJsonValue propBoost = default; - LocalJsonValue propFields = default; - LocalJsonValue propMinimumShouldMatch = default; - LocalJsonValue propOperator = default; - LocalJsonValue propQuery = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propZeroTermsQuery = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAutoGenerateSynonymsPhraseQuery.TryReadProperty(ref reader, options, PropAutoGenerateSynonymsPhraseQuery, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propMinimumShouldMatch.TryReadProperty(ref reader, options, PropMinimumShouldMatch, null)) - { - continue; - } - - if (propOperator.TryReadProperty(ref reader, options, PropOperator, static Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propZeroTermsQuery.TryReadProperty(ref reader, options, PropZeroTermsQuery, static Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AutoGenerateSynonymsPhraseQuery = propAutoGenerateSynonymsPhraseQuery.Value, - Boost = propBoost.Value, - Fields = propFields.Value, - MinimumShouldMatch = propMinimumShouldMatch.Value, - Operator = propOperator.Value, - Query = propQuery.Value, - QueryName = propQueryName.Value, - ZeroTermsQuery = propZeroTermsQuery.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAutoGenerateSynonymsPhraseQuery, value.AutoGenerateSynonymsPhraseQuery, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropMinimumShouldMatch, value.MinimumShouldMatch, null, null); - writer.WriteProperty(options, PropOperator, value.Operator, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsOperator? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropZeroTermsQuery, value.ZeroTermsQuery, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.CombinedFieldsQueryConverter))] public sealed partial class CombinedFieldsQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CombinedFieldsZeroTerms.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CombinedFieldsZeroTerms.Converters.g.cs new file mode 100644 index 00000000000..77fc6779853 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CombinedFieldsZeroTerms.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class CombinedFieldsZeroTermsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAll = System.Text.Json.JsonEncodedText.Encode("all"); + private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAll)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms.All; + } + + if (reader.ValueTextEquals(MemberNone)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms.None; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAll.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms.All; + } + + if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms.None; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms.All: + writer.WriteStringValue(MemberAll); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms.None: + writer.WriteStringValue(MemberNone); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsZeroTerms value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CombinedFieldsZeroTerms.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CombinedFieldsZeroTerms.g.cs new file mode 100644 index 00000000000..6ac0f12f397 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CombinedFieldsZeroTerms.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.CombinedFieldsZeroTermsConverter))] +public enum CombinedFieldsZeroTerms +{ + /// + /// + /// Returns all documents, similar to a match_all query. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "all")] + All, + /// + /// + /// No documents are returned if the analyzer removes all tokens. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "none")] + None +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CommonTermsQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CommonTermsQuery.Converters.g.cs new file mode 100644 index 00000000000..301b90a557a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CommonTermsQuery.Converters.g.cs @@ -0,0 +1,148 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class CommonTermsQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCutoffFrequency = System.Text.Json.JsonEncodedText.Encode("cutoff_frequency"); + private static readonly System.Text.Json.JsonEncodedText PropHighFreqOperator = System.Text.Json.JsonEncodedText.Encode("high_freq_operator"); + private static readonly System.Text.Json.JsonEncodedText PropLowFreqOperator = System.Text.Json.JsonEncodedText.Encode("low_freq_operator"); + private static readonly System.Text.Json.JsonEncodedText PropMinimumShouldMatch = System.Text.Json.JsonEncodedText.Encode("minimum_should_match"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.CommonTermsQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + reader.Read(); + propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); + reader.Read(); + if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) + { + var value = reader.ReadValue(options, null); + reader.Read(); + return new Elastic.Clients.Elasticsearch.QueryDsl.CommonTermsQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Query = value + }; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzer = default; + LocalJsonValue propBoost = default; + LocalJsonValue propCutoffFrequency = default; + LocalJsonValue propHighFreqOperator = default; + LocalJsonValue propLowFreqOperator = default; + LocalJsonValue propMinimumShouldMatch = default; + LocalJsonValue propQuery = default; + LocalJsonValue propQueryName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) + { + continue; + } + + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCutoffFrequency.TryReadProperty(ref reader, options, PropCutoffFrequency, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propHighFreqOperator.TryReadProperty(ref reader, options, PropHighFreqOperator, static Elastic.Clients.Elasticsearch.QueryDsl.Operator? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLowFreqOperator.TryReadProperty(ref reader, options, PropLowFreqOperator, static Elastic.Clients.Elasticsearch.QueryDsl.Operator? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinimumShouldMatch.TryReadProperty(ref reader, options, PropMinimumShouldMatch, null)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.CommonTermsQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analyzer = propAnalyzer.Value, + Boost = propBoost.Value, + CutoffFrequency = propCutoffFrequency.Value, + Field = propField.Value, + HighFreqOperator = propHighFreqOperator.Value, + LowFreqOperator = propLowFreqOperator.Value, + MinimumShouldMatch = propMinimumShouldMatch.Value, + Query = propQuery.Value, + QueryName = propQueryName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.CommonTermsQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCutoffFrequency, value.CutoffFrequency, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropHighFreqOperator, value.HighFreqOperator, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.Operator? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLowFreqOperator, value.LowFreqOperator, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.Operator? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinimumShouldMatch, value.MinimumShouldMatch, null, null); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CommonTermsQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CommonTermsQuery.g.cs index a77381fb3ac..db7e355a40c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CommonTermsQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/CommonTermsQuery.g.cs @@ -23,131 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class CommonTermsQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCutoffFrequency = System.Text.Json.JsonEncodedText.Encode("cutoff_frequency"); - private static readonly System.Text.Json.JsonEncodedText PropHighFreqOperator = System.Text.Json.JsonEncodedText.Encode("high_freq_operator"); - private static readonly System.Text.Json.JsonEncodedText PropLowFreqOperator = System.Text.Json.JsonEncodedText.Encode("low_freq_operator"); - private static readonly System.Text.Json.JsonEncodedText PropMinimumShouldMatch = System.Text.Json.JsonEncodedText.Encode("minimum_should_match"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.CommonTermsQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - reader.Read(); - propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); - reader.Read(); - if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) - { - var value = reader.ReadValue(options, null); - reader.Read(); - return new Elastic.Clients.Elasticsearch.QueryDsl.CommonTermsQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Query = value - }; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyzer = default; - LocalJsonValue propBoost = default; - LocalJsonValue propCutoffFrequency = default; - LocalJsonValue propHighFreqOperator = default; - LocalJsonValue propLowFreqOperator = default; - LocalJsonValue propMinimumShouldMatch = default; - LocalJsonValue propQuery = default; - LocalJsonValue propQueryName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) - { - continue; - } - - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCutoffFrequency.TryReadProperty(ref reader, options, PropCutoffFrequency, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propHighFreqOperator.TryReadProperty(ref reader, options, PropHighFreqOperator, static Elastic.Clients.Elasticsearch.QueryDsl.Operator? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLowFreqOperator.TryReadProperty(ref reader, options, PropLowFreqOperator, static Elastic.Clients.Elasticsearch.QueryDsl.Operator? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinimumShouldMatch.TryReadProperty(ref reader, options, PropMinimumShouldMatch, null)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.CommonTermsQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analyzer = propAnalyzer.Value, - Boost = propBoost.Value, - CutoffFrequency = propCutoffFrequency.Value, - Field = propField.Value, - HighFreqOperator = propHighFreqOperator.Value, - LowFreqOperator = propLowFreqOperator.Value, - MinimumShouldMatch = propMinimumShouldMatch.Value, - Query = propQuery.Value, - QueryName = propQueryName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.CommonTermsQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCutoffFrequency, value.CutoffFrequency, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropHighFreqOperator, value.HighFreqOperator, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.Operator? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLowFreqOperator, value.LowFreqOperator, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.Operator? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinimumShouldMatch, value.MinimumShouldMatch, null, null); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteEndObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.CommonTermsQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.CommonTermsQueryConverter))] public sealed partial class CommonTermsQuery { [System.Obsolete("The type contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ConstantScoreQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ConstantScoreQuery.Converters.g.cs new file mode 100644 index 00000000000..ef2dbae8952 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ConstantScoreQuery.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class ConstantScoreQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.ConstantScoreQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propFilter = default; + LocalJsonValue propQueryName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.ConstantScoreQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Filter = propFilter.Value, + QueryName = propQueryName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.ConstantScoreQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFilter, value.Filter, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ConstantScoreQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ConstantScoreQuery.g.cs index b06657d7a0b..0701ab8906b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ConstantScoreQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ConstantScoreQuery.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class ConstantScoreQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.ConstantScoreQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propFilter = default; - LocalJsonValue propQueryName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.ConstantScoreQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Filter = propFilter.Value, - QueryName = propQueryName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.ConstantScoreQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFilter, value.Filter, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.ConstantScoreQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.ConstantScoreQueryConverter))] public sealed partial class ConstantScoreQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateDecayFunction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateDecayFunction.Converters.g.cs new file mode 100644 index 00000000000..642922b02e7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateDecayFunction.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class DateDecayFunctionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMultiValueMode = System.Text.Json.JsonEncodedText.Encode("multi_value_mode"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.DateDecayFunction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propMultiValueMode = default; + LocalJsonValue> propPlacement = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMultiValueMode.TryReadProperty(ref reader, options, PropMultiValueMode, static Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + propField.Initialized = propPlacement.Initialized = true; + reader.ReadProperty(options, out propField.Value, out propPlacement.Value, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o), null); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.DateDecayFunction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + MultiValueMode = propMultiValueMode.Value, + Placement = propPlacement.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.DateDecayFunction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMultiValueMode, value.MultiValueMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, value.Field, value.Placement, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v), null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateDecayFunction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateDecayFunction.g.cs index 125aa2752de..cb5721b5a24 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateDecayFunction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateDecayFunction.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class DateDecayFunctionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMultiValueMode = System.Text.Json.JsonEncodedText.Encode("multi_value_mode"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.DateDecayFunction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propMultiValueMode = default; - LocalJsonValue> propPlacement = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMultiValueMode.TryReadProperty(ref reader, options, PropMultiValueMode, static Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - propField.Initialized = propPlacement.Initialized = true; - reader.ReadProperty(options, out propField.Value, out propPlacement.Value, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o), null); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.DateDecayFunction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - MultiValueMode = propMultiValueMode.Value, - Placement = propPlacement.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.DateDecayFunction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMultiValueMode, value.MultiValueMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, value.Field, value.Placement, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v), null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.DateDecayFunctionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.DateDecayFunctionConverter))] public sealed partial class DateDecayFunction : Elastic.Clients.Elasticsearch.QueryDsl.IDecayFunction { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateDistanceFeatureQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateDistanceFeatureQuery.Converters.g.cs new file mode 100644 index 00000000000..3ec2ee28c33 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateDistanceFeatureQuery.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class DateDistanceFeatureQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropOrigin = System.Text.Json.JsonEncodedText.Encode("origin"); + private static readonly System.Text.Json.JsonEncodedText PropPivot = System.Text.Json.JsonEncodedText.Encode("pivot"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.DateDistanceFeatureQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propField = default; + LocalJsonValue propOrigin = default; + LocalJsonValue propPivot = default; + LocalJsonValue propQueryName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propOrigin.TryReadProperty(ref reader, options, PropOrigin, null)) + { + continue; + } + + if (propPivot.TryReadProperty(ref reader, options, PropPivot, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.DateDistanceFeatureQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Field = propField.Value, + Origin = propOrigin.Value, + Pivot = propPivot.Value, + QueryName = propQueryName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.DateDistanceFeatureQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropOrigin, value.Origin, null, null); + writer.WriteProperty(options, PropPivot, value.Pivot, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateDistanceFeatureQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateDistanceFeatureQuery.g.cs index 68a013d6b0a..5fe66c24b18 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateDistanceFeatureQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateDistanceFeatureQuery.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class DateDistanceFeatureQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropOrigin = System.Text.Json.JsonEncodedText.Encode("origin"); - private static readonly System.Text.Json.JsonEncodedText PropPivot = System.Text.Json.JsonEncodedText.Encode("pivot"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.DateDistanceFeatureQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propField = default; - LocalJsonValue propOrigin = default; - LocalJsonValue propPivot = default; - LocalJsonValue propQueryName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propOrigin.TryReadProperty(ref reader, options, PropOrigin, null)) - { - continue; - } - - if (propPivot.TryReadProperty(ref reader, options, PropPivot, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.DateDistanceFeatureQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Field = propField.Value, - Origin = propOrigin.Value, - Pivot = propPivot.Value, - QueryName = propQueryName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.DateDistanceFeatureQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropOrigin, value.Origin, null, null); - writer.WriteProperty(options, PropPivot, value.Pivot, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.DateDistanceFeatureQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.DateDistanceFeatureQueryConverter))] public sealed partial class DateDistanceFeatureQuery : Elastic.Clients.Elasticsearch.QueryDsl.IDistanceFeatureQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateRangeQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateRangeQuery.Converters.g.cs new file mode 100644 index 00000000000..8e2cfbe1522 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateRangeQuery.Converters.g.cs @@ -0,0 +1,146 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class DateRangeQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropGt = System.Text.Json.JsonEncodedText.Encode("gt"); + private static readonly System.Text.Json.JsonEncodedText PropGte = System.Text.Json.JsonEncodedText.Encode("gte"); + private static readonly System.Text.Json.JsonEncodedText PropLt = System.Text.Json.JsonEncodedText.Encode("lt"); + private static readonly System.Text.Json.JsonEncodedText PropLte = System.Text.Json.JsonEncodedText.Encode("lte"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropRelation = System.Text.Json.JsonEncodedText.Encode("relation"); + private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + reader.Read(); + propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propFormat = default; + LocalJsonValue propGt = default; + LocalJsonValue propGte = default; + LocalJsonValue propLt = default; + LocalJsonValue propLte = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propRelation = default; + LocalJsonValue propTimeZone = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propGt.TryReadProperty(ref reader, options, PropGt, null)) + { + continue; + } + + if (propGte.TryReadProperty(ref reader, options, PropGte, null)) + { + continue; + } + + if (propLt.TryReadProperty(ref reader, options, PropLt, null)) + { + continue; + } + + if (propLte.TryReadProperty(ref reader, options, PropLte, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propRelation.TryReadProperty(ref reader, options, PropRelation, static Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeZone.TryReadProperty(ref reader, options, PropTimeZone, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Field = propField.Value, + Format = propFormat.Value, + Gt = propGt.Value, + Gte = propGte.Value, + Lt = propLt.Value, + Lte = propLte.Value, + QueryName = propQueryName.Value, + Relation = propRelation.Value, + TimeZone = propTimeZone.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropGt, value.Gt, null, null); + writer.WriteProperty(options, PropGte, value.Gte, null, null); + writer.WriteProperty(options, PropLt, value.Lt, null, null); + writer.WriteProperty(options, PropLte, value.Lte, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropRelation, value.Relation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateRangeQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateRangeQuery.g.cs index 1afe947ae6a..d4e20a107f0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateRangeQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DateRangeQuery.g.cs @@ -23,129 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class DateRangeQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropGt = System.Text.Json.JsonEncodedText.Encode("gt"); - private static readonly System.Text.Json.JsonEncodedText PropGte = System.Text.Json.JsonEncodedText.Encode("gte"); - private static readonly System.Text.Json.JsonEncodedText PropLt = System.Text.Json.JsonEncodedText.Encode("lt"); - private static readonly System.Text.Json.JsonEncodedText PropLte = System.Text.Json.JsonEncodedText.Encode("lte"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropRelation = System.Text.Json.JsonEncodedText.Encode("relation"); - private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - reader.Read(); - propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propFormat = default; - LocalJsonValue propGt = default; - LocalJsonValue propGte = default; - LocalJsonValue propLt = default; - LocalJsonValue propLte = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propRelation = default; - LocalJsonValue propTimeZone = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propGt.TryReadProperty(ref reader, options, PropGt, null)) - { - continue; - } - - if (propGte.TryReadProperty(ref reader, options, PropGte, null)) - { - continue; - } - - if (propLt.TryReadProperty(ref reader, options, PropLt, null)) - { - continue; - } - - if (propLte.TryReadProperty(ref reader, options, PropLte, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propRelation.TryReadProperty(ref reader, options, PropRelation, static Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeZone.TryReadProperty(ref reader, options, PropTimeZone, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Field = propField.Value, - Format = propFormat.Value, - Gt = propGt.Value, - Gte = propGte.Value, - Lt = propLt.Value, - Lte = propLte.Value, - QueryName = propQueryName.Value, - Relation = propRelation.Value, - TimeZone = propTimeZone.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropGt, value.Gt, null, null); - writer.WriteProperty(options, PropGte, value.Gte, null, null); - writer.WriteProperty(options, PropLt, value.Lt, null, null); - writer.WriteProperty(options, PropLte, value.Lte, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropRelation, value.Relation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); - writer.WriteEndObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.DateRangeQueryConverter))] public sealed partial class DateRangeQuery : Elastic.Clients.Elasticsearch.QueryDsl.IRangeQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DecayFunction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DecayFunction.Converters.g.cs new file mode 100644 index 00000000000..21332856ca9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DecayFunction.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class IDecayFunctionConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.QueryDsl.IDecayFunction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return reader.ReadValue(options, null); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IDecayFunction value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.QueryDsl.DateDecayFunction v: + writer.WriteValue(options, v, null); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.GeoDecayFunction v: + writer.WriteValue(options, v, null); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.NumericDecayFunction v: + writer.WriteValue(options, v, null); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.UntypedDecayFunction v: + writer.WriteValue(options, v, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.Type}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.IDecayFunction)}'."); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DecayFunction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DecayFunction.g.cs index ffe3b7efa1d..1a63b0d89a2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DecayFunction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DecayFunction.g.cs @@ -23,36 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class IDecayFunctionConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.QueryDsl.IDecayFunction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return reader.ReadValue(options, null); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IDecayFunction value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.QueryDsl.DateDecayFunction v: - writer.WriteValue(options, v, null); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.GeoDecayFunction v: - writer.WriteValue(options, v, null); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.NumericDecayFunction v: - writer.WriteValue(options, v, null); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.UntypedDecayFunction v: - writer.WriteValue(options, v, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.Type}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.IDecayFunction)}'."); - } - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.IDecayFunctionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.IDecayFunctionConverter))] public partial interface IDecayFunction { public string Type { get; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DecayPlacement.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DecayPlacement.Converters.g.cs new file mode 100644 index 00000000000..541dd29b7d9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DecayPlacement.Converters.g.cs @@ -0,0 +1,106 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class DecayPlacementConverter : System.Text.Json.Serialization.JsonConverter> +{ + private static readonly System.Text.Json.JsonEncodedText PropDecay = System.Text.Json.JsonEncodedText.Encode("decay"); + private static readonly System.Text.Json.JsonEncodedText PropOffset = System.Text.Json.JsonEncodedText.Encode("offset"); + private static readonly System.Text.Json.JsonEncodedText PropOrigin = System.Text.Json.JsonEncodedText.Encode("origin"); + private static readonly System.Text.Json.JsonEncodedText PropScale = System.Text.Json.JsonEncodedText.Encode("scale"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.DecayPlacement Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDecay = default; + LocalJsonValue propOffset = default; + LocalJsonValue propOrigin = default; + LocalJsonValue propScale = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDecay.TryReadProperty(ref reader, options, PropDecay, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOffset.TryReadProperty(ref reader, options, PropOffset, null)) + { + continue; + } + + if (propOrigin.TryReadProperty(ref reader, options, PropOrigin, null)) + { + continue; + } + + if (propScale.TryReadProperty(ref reader, options, PropScale, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.DecayPlacement(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Decay = propDecay.Value, + Offset = propOffset.Value, + Origin = propOrigin.Value, + Scale = propScale.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.DecayPlacement value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDecay, value.Decay, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOffset, value.Offset, null, null); + writer.WriteProperty(options, PropOrigin, value.Origin, null, null); + writer.WriteProperty(options, PropScale, value.Scale, null, null); + writer.WriteEndObject(); + } +} + +public sealed partial class DecayPlacementConverterFactory : System.Text.Json.Serialization.JsonConverterFactory +{ + public override bool CanConvert(System.Type typeToConvert) + { + return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(DecayPlacement<,>); + } + + [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] + public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var args = typeToConvert.GetGenericArguments(); + var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(DecayPlacementConverter<,>).MakeGenericType(args[0], args[1]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; + return converter; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DecayPlacement.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DecayPlacement.g.cs index f6ac424ad21..ca3724b98b6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DecayPlacement.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DecayPlacement.g.cs @@ -23,89 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class DecayPlacementConverter : System.Text.Json.Serialization.JsonConverter> -{ - private static readonly System.Text.Json.JsonEncodedText PropDecay = System.Text.Json.JsonEncodedText.Encode("decay"); - private static readonly System.Text.Json.JsonEncodedText PropOffset = System.Text.Json.JsonEncodedText.Encode("offset"); - private static readonly System.Text.Json.JsonEncodedText PropOrigin = System.Text.Json.JsonEncodedText.Encode("origin"); - private static readonly System.Text.Json.JsonEncodedText PropScale = System.Text.Json.JsonEncodedText.Encode("scale"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.DecayPlacement Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDecay = default; - LocalJsonValue propOffset = default; - LocalJsonValue propOrigin = default; - LocalJsonValue propScale = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDecay.TryReadProperty(ref reader, options, PropDecay, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOffset.TryReadProperty(ref reader, options, PropOffset, null)) - { - continue; - } - - if (propOrigin.TryReadProperty(ref reader, options, PropOrigin, null)) - { - continue; - } - - if (propScale.TryReadProperty(ref reader, options, PropScale, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.DecayPlacement(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Decay = propDecay.Value, - Offset = propOffset.Value, - Origin = propOrigin.Value, - Scale = propScale.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.DecayPlacement value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDecay, value.Decay, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOffset, value.Offset, null, null); - writer.WriteProperty(options, PropOrigin, value.Origin, null, null); - writer.WriteProperty(options, PropScale, value.Scale, null, null); - writer.WriteEndObject(); - } -} - -internal sealed partial class DecayPlacementConverterFactory : System.Text.Json.Serialization.JsonConverterFactory -{ - public override bool CanConvert(System.Type typeToConvert) - { - return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(DecayPlacement<,>); - } - - [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'")] - public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var args = typeToConvert.GetGenericArguments(); - var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(DecayPlacementConverter<,>).MakeGenericType(args[0], args[1]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!; - return converter; - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.DecayPlacementConverterFactory))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.DecayPlacementConverterFactory))] public sealed partial class DecayPlacement { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DisMaxQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DisMaxQuery.Converters.g.cs new file mode 100644 index 00000000000..35bb95c8459 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DisMaxQuery.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class DisMaxQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropQueries = System.Text.Json.JsonEncodedText.Encode("queries"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropTieBreaker = System.Text.Json.JsonEncodedText.Encode("tie_breaker"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.DisMaxQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue> propQueries = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propTieBreaker = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueries.TryReadProperty(ref reader, options, PropQueries, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propTieBreaker.TryReadProperty(ref reader, options, PropTieBreaker, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.DisMaxQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Queries = propQueries.Value, + QueryName = propQueryName.Value, + TieBreaker = propTieBreaker.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.DisMaxQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueries, value.Queries, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropTieBreaker, value.TieBreaker, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DisMaxQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DisMaxQuery.g.cs index 2848148f7f5..c7500f310ae 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DisMaxQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DisMaxQuery.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class DisMaxQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropQueries = System.Text.Json.JsonEncodedText.Encode("queries"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropTieBreaker = System.Text.Json.JsonEncodedText.Encode("tie_breaker"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.DisMaxQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue> propQueries = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propTieBreaker = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueries.TryReadProperty(ref reader, options, PropQueries, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propTieBreaker.TryReadProperty(ref reader, options, PropTieBreaker, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.DisMaxQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Queries = propQueries.Value, - QueryName = propQueryName.Value, - TieBreaker = propTieBreaker.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.DisMaxQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueries, value.Queries, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropTieBreaker, value.TieBreaker, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.DisMaxQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.DisMaxQueryConverter))] public sealed partial class DisMaxQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DistanceFeatureQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DistanceFeatureQuery.Converters.g.cs new file mode 100644 index 00000000000..5e50eaa3c8e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DistanceFeatureQuery.Converters.g.cs @@ -0,0 +1,50 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class IDistanceFeatureQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.QueryDsl.IDistanceFeatureQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return reader.ReadValue(options, null); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IDistanceFeatureQuery value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.QueryDsl.DateDistanceFeatureQuery v: + writer.WriteValue(options, v, null); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceFeatureQuery v: + writer.WriteValue(options, v, null); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.UntypedDistanceFeatureQuery v: + writer.WriteValue(options, v, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.Type}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.IDistanceFeatureQuery)}'."); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DistanceFeatureQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DistanceFeatureQuery.g.cs index e1f2b3fbef0..75af7fe752d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DistanceFeatureQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/DistanceFeatureQuery.g.cs @@ -23,33 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class IDistanceFeatureQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.QueryDsl.IDistanceFeatureQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return reader.ReadValue(options, null); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IDistanceFeatureQuery value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.QueryDsl.DateDistanceFeatureQuery v: - writer.WriteValue(options, v, null); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceFeatureQuery v: - writer.WriteValue(options, v, null); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.UntypedDistanceFeatureQuery v: - writer.WriteValue(options, v, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.Type}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.IDistanceFeatureQuery)}'."); - } - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.IDistanceFeatureQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.IDistanceFeatureQueryConverter))] public partial interface IDistanceFeatureQuery { public string Type { get; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ExistsQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ExistsQuery.Converters.g.cs new file mode 100644 index 00000000000..24ed0c53b8e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ExistsQuery.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class ExistsQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.ExistsQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propField = default; + LocalJsonValue propQueryName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.ExistsQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Field = propField.Value, + QueryName = propQueryName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.ExistsQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ExistsQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ExistsQuery.g.cs index 219b773ecc9..ec4dcfc8edc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ExistsQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ExistsQuery.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class ExistsQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.ExistsQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propField = default; - LocalJsonValue propQueryName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.ExistsQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Field = propField.Value, - QueryName = propQueryName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.ExistsQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.ExistsQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.ExistsQueryConverter))] public sealed partial class ExistsQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldAndFormat.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldAndFormat.Converters.g.cs new file mode 100644 index 00000000000..81062330aa4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldAndFormat.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class FieldAndFormatConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropIncludeUnmapped = System.Text.Json.JsonEncodedText.Encode("include_unmapped"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormat Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) + { + var value = reader.ReadValue(options, null); + return new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormat(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = value + }; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propFormat = default; + LocalJsonValue propIncludeUnmapped = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propIncludeUnmapped.TryReadProperty(ref reader, options, PropIncludeUnmapped, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormat(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Format = propFormat.Value, + IncludeUnmapped = propIncludeUnmapped.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormat value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropIncludeUnmapped, value.IncludeUnmapped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldAndFormat.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldAndFormat.g.cs index a7fe4e55f5d..131f6b78f06 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldAndFormat.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldAndFormat.g.cs @@ -23,78 +23,12 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class FieldAndFormatConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropIncludeUnmapped = System.Text.Json.JsonEncodedText.Encode("include_unmapped"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormat Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) - { - var value = reader.ReadValue(options, null); - return new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormat(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = value - }; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propFormat = default; - LocalJsonValue propIncludeUnmapped = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propIncludeUnmapped.TryReadProperty(ref reader, options, PropIncludeUnmapped, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormat(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Format = propFormat.Value, - IncludeUnmapped = propIncludeUnmapped.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormat value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropIncludeUnmapped, value.IncludeUnmapped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// A reference to a field with formatting instructions on how to return the value /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.FieldAndFormatConverter))] public sealed partial class FieldAndFormat { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldLookup.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldLookup.Converters.g.cs new file mode 100644 index 00000000000..3d9d32f50d8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldLookup.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class FieldLookupConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.FieldLookup Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + LocalJsonValue propPath = default; + LocalJsonValue propRouting = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propPath.TryReadProperty(ref reader, options, PropPath, null)) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.FieldLookup(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + Index = propIndex.Value, + Path = propPath.Value, + Routing = propRouting.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.FieldLookup value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropPath, value.Path, null, null); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldLookup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldLookup.g.cs index d601e11c33d..d7ea492670b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldLookup.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldLookup.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class FieldLookupConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.FieldLookup Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - LocalJsonValue propPath = default; - LocalJsonValue propRouting = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propPath.TryReadProperty(ref reader, options, PropPath, null)) - { - continue; - } - - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.FieldLookup(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - Index = propIndex.Value, - Path = propPath.Value, - Routing = propRouting.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.FieldLookup value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropPath, value.Path, null, null); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.FieldLookupConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.FieldLookupConverter))] public sealed partial class FieldLookup { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldValueFactorModifier.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldValueFactorModifier.Converters.g.cs new file mode 100644 index 00000000000..cacbc9912cf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldValueFactorModifier.Converters.g.cs @@ -0,0 +1,193 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class FieldValueFactorModifierConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberLn = System.Text.Json.JsonEncodedText.Encode("ln"); + private static readonly System.Text.Json.JsonEncodedText MemberLn1p = System.Text.Json.JsonEncodedText.Encode("ln1p"); + private static readonly System.Text.Json.JsonEncodedText MemberLn2p = System.Text.Json.JsonEncodedText.Encode("ln2p"); + private static readonly System.Text.Json.JsonEncodedText MemberLog = System.Text.Json.JsonEncodedText.Encode("log"); + private static readonly System.Text.Json.JsonEncodedText MemberLog1p = System.Text.Json.JsonEncodedText.Encode("log1p"); + private static readonly System.Text.Json.JsonEncodedText MemberLog2p = System.Text.Json.JsonEncodedText.Encode("log2p"); + private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); + private static readonly System.Text.Json.JsonEncodedText MemberReciprocal = System.Text.Json.JsonEncodedText.Encode("reciprocal"); + private static readonly System.Text.Json.JsonEncodedText MemberSqrt = System.Text.Json.JsonEncodedText.Encode("sqrt"); + private static readonly System.Text.Json.JsonEncodedText MemberSquare = System.Text.Json.JsonEncodedText.Encode("square"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberLn)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Ln; + } + + if (reader.ValueTextEquals(MemberLn1p)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Ln1p; + } + + if (reader.ValueTextEquals(MemberLn2p)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Ln2p; + } + + if (reader.ValueTextEquals(MemberLog)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Log; + } + + if (reader.ValueTextEquals(MemberLog1p)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Log1p; + } + + if (reader.ValueTextEquals(MemberLog2p)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Log2p; + } + + if (reader.ValueTextEquals(MemberNone)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.None; + } + + if (reader.ValueTextEquals(MemberReciprocal)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Reciprocal; + } + + if (reader.ValueTextEquals(MemberSqrt)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Sqrt; + } + + if (reader.ValueTextEquals(MemberSquare)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Square; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberLn.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Ln; + } + + if (string.Equals(value, MemberLn1p.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Ln1p; + } + + if (string.Equals(value, MemberLn2p.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Ln2p; + } + + if (string.Equals(value, MemberLog.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Log; + } + + if (string.Equals(value, MemberLog1p.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Log1p; + } + + if (string.Equals(value, MemberLog2p.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Log2p; + } + + if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.None; + } + + if (string.Equals(value, MemberReciprocal.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Reciprocal; + } + + if (string.Equals(value, MemberSqrt.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Sqrt; + } + + if (string.Equals(value, MemberSquare.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Square; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Ln: + writer.WriteStringValue(MemberLn); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Ln1p: + writer.WriteStringValue(MemberLn1p); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Ln2p: + writer.WriteStringValue(MemberLn2p); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Log: + writer.WriteStringValue(MemberLog); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Log1p: + writer.WriteStringValue(MemberLog1p); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Log2p: + writer.WriteStringValue(MemberLog2p); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.None: + writer.WriteStringValue(MemberNone); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Reciprocal: + writer.WriteStringValue(MemberReciprocal); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Sqrt: + writer.WriteStringValue(MemberSqrt); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier.Square: + writer.WriteStringValue(MemberSquare); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldValueFactorModifier.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldValueFactorModifier.g.cs new file mode 100644 index 00000000000..d46cbc26809 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldValueFactorModifier.g.cs @@ -0,0 +1,101 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.FieldValueFactorModifierConverter))] +public enum FieldValueFactorModifier +{ + /// + /// + /// Take the natural logarithm of the field value. + /// Because this function will return a negative value and cause an error if used on values between 0 and 1, it is recommended to use ln1p instead. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "ln")] + Ln, + /// + /// + /// Add 1 to the field value and take the natural logarithm. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "ln1p")] + Ln1p, + /// + /// + /// Add 2 to the field value and take the natural logarithm. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "ln2p")] + Ln2p, + /// + /// + /// Take the common logarithm of the field value. + /// Because this function will return a negative value and cause an error if used on values between 0 and 1, it is recommended to use log1p instead. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "log")] + Log, + /// + /// + /// Add 1 to the field value and take the common logarithm. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "log1p")] + Log1p, + /// + /// + /// Add 2 to the field value and take the common logarithm. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "log2p")] + Log2p, + /// + /// + /// Do not apply any multiplier to the field value. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "none")] + None, + /// + /// + /// Reciprocate the field value, same as 1/x where x is the field’s value. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "reciprocal")] + Reciprocal, + /// + /// + /// Take the square root of the field value. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "sqrt")] + Sqrt, + /// + /// + /// Square the field value (multiply it by itself). + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "square")] + Square +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldValueFactorScoreFunction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldValueFactorScoreFunction.Converters.g.cs new file mode 100644 index 00000000000..6ec946ebe5c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldValueFactorScoreFunction.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class FieldValueFactorScoreFunctionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFactor = System.Text.Json.JsonEncodedText.Encode("factor"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropModifier = System.Text.Json.JsonEncodedText.Encode("modifier"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorScoreFunction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFactor = default; + LocalJsonValue propField = default; + LocalJsonValue propMissing = default; + LocalJsonValue propModifier = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFactor.TryReadProperty(ref reader, options, PropFactor, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propModifier.TryReadProperty(ref reader, options, PropModifier, static Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorScoreFunction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Factor = propFactor.Value, + Field = propField.Value, + Missing = propMissing.Value, + Modifier = propModifier.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorScoreFunction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFactor, value.Factor, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropMissing, value.Missing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropModifier, value.Modifier, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldValueFactorScoreFunction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldValueFactorScoreFunction.g.cs index 0e528752056..5470b950368 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldValueFactorScoreFunction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FieldValueFactorScoreFunction.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class FieldValueFactorScoreFunctionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFactor = System.Text.Json.JsonEncodedText.Encode("factor"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText PropModifier = System.Text.Json.JsonEncodedText.Encode("modifier"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorScoreFunction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFactor = default; - LocalJsonValue propField = default; - LocalJsonValue propMissing = default; - LocalJsonValue propModifier = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFactor.TryReadProperty(ref reader, options, PropFactor, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propMissing.TryReadProperty(ref reader, options, PropMissing, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propModifier.TryReadProperty(ref reader, options, PropModifier, static Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorScoreFunction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Factor = propFactor.Value, - Field = propField.Value, - Missing = propMissing.Value, - Modifier = propModifier.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorScoreFunction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFactor, value.Factor, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropMissing, value.Missing, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropModifier, value.Modifier, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorModifier? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorScoreFunctionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.FieldValueFactorScoreFunctionConverter))] public sealed partial class FieldValueFactorScoreFunction { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionBoostMode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionBoostMode.Converters.g.cs new file mode 100644 index 00000000000..85dcb5fa97c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionBoostMode.Converters.g.cs @@ -0,0 +1,137 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class FunctionBoostModeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAvg = System.Text.Json.JsonEncodedText.Encode("avg"); + private static readonly System.Text.Json.JsonEncodedText MemberMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText MemberMin = System.Text.Json.JsonEncodedText.Encode("min"); + private static readonly System.Text.Json.JsonEncodedText MemberMultiply = System.Text.Json.JsonEncodedText.Encode("multiply"); + private static readonly System.Text.Json.JsonEncodedText MemberReplace = System.Text.Json.JsonEncodedText.Encode("replace"); + private static readonly System.Text.Json.JsonEncodedText MemberSum = System.Text.Json.JsonEncodedText.Encode("sum"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAvg)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Avg; + } + + if (reader.ValueTextEquals(MemberMax)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Max; + } + + if (reader.ValueTextEquals(MemberMin)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Min; + } + + if (reader.ValueTextEquals(MemberMultiply)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Multiply; + } + + if (reader.ValueTextEquals(MemberReplace)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Replace; + } + + if (reader.ValueTextEquals(MemberSum)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Sum; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAvg.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Avg; + } + + if (string.Equals(value, MemberMax.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Max; + } + + if (string.Equals(value, MemberMin.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Min; + } + + if (string.Equals(value, MemberMultiply.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Multiply; + } + + if (string.Equals(value, MemberReplace.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Replace; + } + + if (string.Equals(value, MemberSum.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Sum; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Avg: + writer.WriteStringValue(MemberAvg); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Max: + writer.WriteStringValue(MemberMax); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Min: + writer.WriteStringValue(MemberMin); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Multiply: + writer.WriteStringValue(MemberMultiply); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Replace: + writer.WriteStringValue(MemberReplace); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode.Sum: + writer.WriteStringValue(MemberSum); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionBoostMode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionBoostMode.g.cs new file mode 100644 index 00000000000..8bc287c6184 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionBoostMode.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.FunctionBoostModeConverter))] +public enum FunctionBoostMode +{ + /// + /// + /// Query score and function score are averaged + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "avg")] + Avg, + /// + /// + /// Max of query score and function score + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "max")] + Max, + /// + /// + /// Min of query score and function score + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "min")] + Min, + /// + /// + /// Query score and function score are multiplied + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "multiply")] + Multiply, + /// + /// + /// Only the function score is used. + /// The query score is ignored. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "replace")] + Replace, + /// + /// + /// Query score and function score are added + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "sum")] + Sum +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScore.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScore.Converters.g.cs new file mode 100644 index 00000000000..f624f61f339 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScore.Converters.g.cs @@ -0,0 +1,156 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class FunctionScoreConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropWeight = System.Text.Json.JsonEncodedText.Encode("weight"); + private static readonly System.Text.Json.JsonEncodedText VariantExp = System.Text.Json.JsonEncodedText.Encode("exp"); + private static readonly System.Text.Json.JsonEncodedText VariantFieldValueFactor = System.Text.Json.JsonEncodedText.Encode("field_value_factor"); + private static readonly System.Text.Json.JsonEncodedText VariantGauss = System.Text.Json.JsonEncodedText.Encode("gauss"); + private static readonly System.Text.Json.JsonEncodedText VariantLinear = System.Text.Json.JsonEncodedText.Encode("linear"); + private static readonly System.Text.Json.JsonEncodedText VariantRandomScore = System.Text.Json.JsonEncodedText.Encode("random_score"); + private static readonly System.Text.Json.JsonEncodedText VariantScriptScore = System.Text.Json.JsonEncodedText.Encode("script_score"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.FunctionScore Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFilter = default; + LocalJsonValue propWeight = default; + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) + { + continue; + } + + if (propWeight.TryReadProperty(ref reader, options, PropWeight, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(VariantExp)) + { + variantType = VariantExp.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantFieldValueFactor)) + { + variantType = VariantFieldValueFactor.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantGauss)) + { + variantType = VariantGauss.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantLinear)) + { + variantType = VariantLinear.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRandomScore)) + { + variantType = VariantRandomScore.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantScriptScore)) + { + variantType = VariantScriptScore.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.FunctionScore(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant, + Filter = propFilter.Value, + Weight = propWeight.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.FunctionScore value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "exp": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IDecayFunction)value.Variant, null, null); + break; + case "field_value_factor": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorScoreFunction)value.Variant, null, null); + break; + case "gauss": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IDecayFunction)value.Variant, null, null); + break; + case "linear": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IDecayFunction)value.Variant, null, null); + break; + case "random_score": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.RandomScoreFunction)value.Variant, null, null); + break; + case "script_score": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreFunction)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.FunctionScore)}'."); + } + + writer.WriteProperty(options, PropFilter, value.Filter, null, null); + writer.WriteProperty(options, PropWeight, value.Weight, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScore.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScore.g.cs index b99f5e030a5..00ee283d5fd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScore.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScore.g.cs @@ -23,140 +23,8 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class FunctionScoreConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropWeight = System.Text.Json.JsonEncodedText.Encode("weight"); - private static readonly System.Text.Json.JsonEncodedText VariantExp = System.Text.Json.JsonEncodedText.Encode("exp"); - private static readonly System.Text.Json.JsonEncodedText VariantFieldValueFactor = System.Text.Json.JsonEncodedText.Encode("field_value_factor"); - private static readonly System.Text.Json.JsonEncodedText VariantGauss = System.Text.Json.JsonEncodedText.Encode("gauss"); - private static readonly System.Text.Json.JsonEncodedText VariantLinear = System.Text.Json.JsonEncodedText.Encode("linear"); - private static readonly System.Text.Json.JsonEncodedText VariantRandomScore = System.Text.Json.JsonEncodedText.Encode("random_score"); - private static readonly System.Text.Json.JsonEncodedText VariantScriptScore = System.Text.Json.JsonEncodedText.Encode("script_score"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.FunctionScore Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFilter = default; - LocalJsonValue propWeight = default; - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) - { - continue; - } - - if (propWeight.TryReadProperty(ref reader, options, PropWeight, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (reader.ValueTextEquals(VariantExp)) - { - variantType = VariantExp.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantFieldValueFactor)) - { - variantType = VariantFieldValueFactor.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantGauss)) - { - variantType = VariantGauss.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantLinear)) - { - variantType = VariantLinear.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRandomScore)) - { - variantType = VariantRandomScore.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantScriptScore)) - { - variantType = VariantScriptScore.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.FunctionScore(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant, - Filter = propFilter.Value, - Weight = propWeight.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.FunctionScore value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "exp": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IDecayFunction)value.Variant, null, null); - break; - case "field_value_factor": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.FieldValueFactorScoreFunction)value.Variant, null, null); - break; - case "gauss": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IDecayFunction)value.Variant, null, null); - break; - case "linear": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IDecayFunction)value.Variant, null, null); - break; - case "random_score": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.RandomScoreFunction)value.Variant, null, null); - break; - case "script_score": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreFunction)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.FunctionScore)}'."); - } - - writer.WriteProperty(options, PropFilter, value.Filter, null, null); - writer.WriteProperty(options, PropWeight, value.Weight, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreConverter))] -public sealed partial class FunctionScore +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.FunctionScoreConverter))] +public partial class FunctionScore { internal string? VariantType { get; set; } internal object? Variant { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScoreMode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScoreMode.Converters.g.cs new file mode 100644 index 00000000000..b70a7fd2ded --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScoreMode.Converters.g.cs @@ -0,0 +1,137 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class FunctionScoreModeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAvg = System.Text.Json.JsonEncodedText.Encode("avg"); + private static readonly System.Text.Json.JsonEncodedText MemberFirst = System.Text.Json.JsonEncodedText.Encode("first"); + private static readonly System.Text.Json.JsonEncodedText MemberMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText MemberMin = System.Text.Json.JsonEncodedText.Encode("min"); + private static readonly System.Text.Json.JsonEncodedText MemberMultiply = System.Text.Json.JsonEncodedText.Encode("multiply"); + private static readonly System.Text.Json.JsonEncodedText MemberSum = System.Text.Json.JsonEncodedText.Encode("sum"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAvg)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Avg; + } + + if (reader.ValueTextEquals(MemberFirst)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.First; + } + + if (reader.ValueTextEquals(MemberMax)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Max; + } + + if (reader.ValueTextEquals(MemberMin)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Min; + } + + if (reader.ValueTextEquals(MemberMultiply)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Multiply; + } + + if (reader.ValueTextEquals(MemberSum)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Sum; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAvg.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Avg; + } + + if (string.Equals(value, MemberFirst.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.First; + } + + if (string.Equals(value, MemberMax.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Max; + } + + if (string.Equals(value, MemberMin.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Min; + } + + if (string.Equals(value, MemberMultiply.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Multiply; + } + + if (string.Equals(value, MemberSum.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Sum; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Avg: + writer.WriteStringValue(MemberAvg); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.First: + writer.WriteStringValue(MemberFirst); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Max: + writer.WriteStringValue(MemberMax); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Min: + writer.WriteStringValue(MemberMin); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Multiply: + writer.WriteStringValue(MemberMultiply); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode.Sum: + writer.WriteStringValue(MemberSum); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScoreMode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScoreMode.g.cs new file mode 100644 index 00000000000..791da7cdcc9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScoreMode.g.cs @@ -0,0 +1,71 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.FunctionScoreModeConverter))] +public enum FunctionScoreMode +{ + /// + /// + /// Scores are averaged. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "avg")] + Avg, + /// + /// + /// The first function that has a matching filter is applied. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "first")] + First, + /// + /// + /// Maximum score is used. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "max")] + Max, + /// + /// + /// Minimum score is used. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "min")] + Min, + /// + /// + /// Scores are multiplied. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "multiply")] + Multiply, + /// + /// + /// Scores are summed. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "sum")] + Sum +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScoreQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScoreQuery.Converters.g.cs new file mode 100644 index 00000000000..4b90f80d7fe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScoreQuery.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class FunctionScoreQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropBoostMode = System.Text.Json.JsonEncodedText.Encode("boost_mode"); + private static readonly System.Text.Json.JsonEncodedText PropFunctions = System.Text.Json.JsonEncodedText.Encode("functions"); + private static readonly System.Text.Json.JsonEncodedText PropMaxBoost = System.Text.Json.JsonEncodedText.Encode("max_boost"); + private static readonly System.Text.Json.JsonEncodedText PropMinScore = System.Text.Json.JsonEncodedText.Encode("min_score"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropScoreMode = System.Text.Json.JsonEncodedText.Encode("score_mode"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) + { + var value = reader.ReadValue?>(options, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)); + return new Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Functions = value + }; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propBoostMode = default; + LocalJsonValue?> propFunctions = default; + LocalJsonValue propMaxBoost = default; + LocalJsonValue propMinScore = default; + LocalJsonValue propQuery = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propScoreMode = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propBoostMode.TryReadProperty(ref reader, options, PropBoostMode, static Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFunctions.TryReadProperty(ref reader, options, PropFunctions, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propMaxBoost.TryReadProperty(ref reader, options, PropMaxBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propScoreMode.TryReadProperty(ref reader, options, PropScoreMode, static Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + BoostMode = propBoostMode.Value, + Functions = propFunctions.Value, + MaxBoost = propMaxBoost.Value, + MinScore = propMinScore.Value, + Query = propQuery.Value, + QueryName = propQueryName.Value, + ScoreMode = propScoreMode.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropBoostMode, value.BoostMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFunctions, value.Functions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMaxBoost, value.MaxBoost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropScoreMode, value.ScoreMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScoreQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScoreQuery.g.cs index b13b0aa8f2d..b801ed0aca5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScoreQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FunctionScoreQuery.g.cs @@ -23,118 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class FunctionScoreQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropBoostMode = System.Text.Json.JsonEncodedText.Encode("boost_mode"); - private static readonly System.Text.Json.JsonEncodedText PropFunctions = System.Text.Json.JsonEncodedText.Encode("functions"); - private static readonly System.Text.Json.JsonEncodedText PropMaxBoost = System.Text.Json.JsonEncodedText.Encode("max_boost"); - private static readonly System.Text.Json.JsonEncodedText PropMinScore = System.Text.Json.JsonEncodedText.Encode("min_score"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropScoreMode = System.Text.Json.JsonEncodedText.Encode("score_mode"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) - { - var value = reader.ReadValue?>(options, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)); - return new Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Functions = value - }; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propBoostMode = default; - LocalJsonValue?> propFunctions = default; - LocalJsonValue propMaxBoost = default; - LocalJsonValue propMinScore = default; - LocalJsonValue propQuery = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propScoreMode = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propBoostMode.TryReadProperty(ref reader, options, PropBoostMode, static Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFunctions.TryReadProperty(ref reader, options, PropFunctions, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propMaxBoost.TryReadProperty(ref reader, options, PropMaxBoost, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propScoreMode.TryReadProperty(ref reader, options, PropScoreMode, static Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - BoostMode = propBoostMode.Value, - Functions = propFunctions.Value, - MaxBoost = propMaxBoost.Value, - MinScore = propMinScore.Value, - Query = propQuery.Value, - QueryName = propQueryName.Value, - ScoreMode = propScoreMode.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropBoostMode, value.BoostMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.FunctionBoostMode? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFunctions, value.Functions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMaxBoost, value.MaxBoost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropScoreMode, value.ScoreMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreMode? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.FunctionScoreQueryConverter))] public sealed partial class FunctionScoreQuery { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FuzzyQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FuzzyQuery.Converters.g.cs new file mode 100644 index 00000000000..0e9a6af70ef --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FuzzyQuery.Converters.g.cs @@ -0,0 +1,148 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class FuzzyQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropFuzziness = System.Text.Json.JsonEncodedText.Encode("fuzziness"); + private static readonly System.Text.Json.JsonEncodedText PropMaxExpansions = System.Text.Json.JsonEncodedText.Encode("max_expansions"); + private static readonly System.Text.Json.JsonEncodedText PropPrefixLength = System.Text.Json.JsonEncodedText.Encode("prefix_length"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropRewrite = System.Text.Json.JsonEncodedText.Encode("rewrite"); + private static readonly System.Text.Json.JsonEncodedText PropTranspositions = System.Text.Json.JsonEncodedText.Encode("transpositions"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.FuzzyQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + reader.Read(); + propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); + reader.Read(); + if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) + { + var value = reader.ReadValue(options, null); + reader.Read(); + return new Elastic.Clients.Elasticsearch.QueryDsl.FuzzyQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Value = value + }; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propFuzziness = default; + LocalJsonValue propMaxExpansions = default; + LocalJsonValue propPrefixLength = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propRewrite = default; + LocalJsonValue propTranspositions = default; + LocalJsonValue propValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFuzziness.TryReadProperty(ref reader, options, PropFuzziness, null)) + { + continue; + } + + if (propMaxExpansions.TryReadProperty(ref reader, options, PropMaxExpansions, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPrefixLength.TryReadProperty(ref reader, options, PropPrefixLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propRewrite.TryReadProperty(ref reader, options, PropRewrite, null)) + { + continue; + } + + if (propTranspositions.TryReadProperty(ref reader, options, PropTranspositions, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.FuzzyQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Field = propField.Value, + Fuzziness = propFuzziness.Value, + MaxExpansions = propMaxExpansions.Value, + PrefixLength = propPrefixLength.Value, + QueryName = propQueryName.Value, + Rewrite = propRewrite.Value, + Transpositions = propTranspositions.Value, + Value = propValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.FuzzyQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFuzziness, value.Fuzziness, null, null); + writer.WriteProperty(options, PropMaxExpansions, value.MaxExpansions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPrefixLength, value.PrefixLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropRewrite, value.Rewrite, null, null); + writer.WriteProperty(options, PropTranspositions, value.Transpositions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropValue, value.Value, null, null); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FuzzyQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FuzzyQuery.g.cs index 0b948e3f06b..cf31dc1a741 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FuzzyQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/FuzzyQuery.g.cs @@ -23,131 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class FuzzyQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropFuzziness = System.Text.Json.JsonEncodedText.Encode("fuzziness"); - private static readonly System.Text.Json.JsonEncodedText PropMaxExpansions = System.Text.Json.JsonEncodedText.Encode("max_expansions"); - private static readonly System.Text.Json.JsonEncodedText PropPrefixLength = System.Text.Json.JsonEncodedText.Encode("prefix_length"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropRewrite = System.Text.Json.JsonEncodedText.Encode("rewrite"); - private static readonly System.Text.Json.JsonEncodedText PropTranspositions = System.Text.Json.JsonEncodedText.Encode("transpositions"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.FuzzyQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - reader.Read(); - propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); - reader.Read(); - if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) - { - var value = reader.ReadValue(options, null); - reader.Read(); - return new Elastic.Clients.Elasticsearch.QueryDsl.FuzzyQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Value = value - }; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propFuzziness = default; - LocalJsonValue propMaxExpansions = default; - LocalJsonValue propPrefixLength = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propRewrite = default; - LocalJsonValue propTranspositions = default; - LocalJsonValue propValue = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFuzziness.TryReadProperty(ref reader, options, PropFuzziness, null)) - { - continue; - } - - if (propMaxExpansions.TryReadProperty(ref reader, options, PropMaxExpansions, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPrefixLength.TryReadProperty(ref reader, options, PropPrefixLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propRewrite.TryReadProperty(ref reader, options, PropRewrite, null)) - { - continue; - } - - if (propTranspositions.TryReadProperty(ref reader, options, PropTranspositions, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.FuzzyQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Field = propField.Value, - Fuzziness = propFuzziness.Value, - MaxExpansions = propMaxExpansions.Value, - PrefixLength = propPrefixLength.Value, - QueryName = propQueryName.Value, - Rewrite = propRewrite.Value, - Transpositions = propTranspositions.Value, - Value = propValue.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.FuzzyQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFuzziness, value.Fuzziness, null, null); - writer.WriteProperty(options, PropMaxExpansions, value.MaxExpansions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPrefixLength, value.PrefixLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropRewrite, value.Rewrite, null, null); - writer.WriteProperty(options, PropTranspositions, value.Transpositions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropValue, value.Value, null, null); - writer.WriteEndObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.FuzzyQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.FuzzyQueryConverter))] public sealed partial class FuzzyQuery { [System.Obsolete("The type contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoBoundingBoxQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoBoundingBoxQuery.Converters.g.cs new file mode 100644 index 00000000000..c6a025a7227 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoBoundingBoxQuery.Converters.g.cs @@ -0,0 +1,105 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class GeoBoundingBoxQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnmapped = System.Text.Json.JsonEncodedText.Encode("ignore_unmapped"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropValidationMethod = System.Text.Json.JsonEncodedText.Encode("validation_method"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.GeoBoundingBoxQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propBoundingBox = default; + LocalJsonValue propField = default; + LocalJsonValue propIgnoreUnmapped = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propType = default; + LocalJsonValue propValidationMethod = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreUnmapped.TryReadProperty(ref reader, options, PropIgnoreUnmapped, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, static Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propValidationMethod.TryReadProperty(ref reader, options, PropValidationMethod, static Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + propField.Initialized = propBoundingBox.Initialized = true; + reader.ReadProperty(options, out propField.Value, out propBoundingBox.Value, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o), null); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.GeoBoundingBoxQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + BoundingBox = propBoundingBox.Value, + Field = propField.Value, + IgnoreUnmapped = propIgnoreUnmapped.Value, + QueryName = propQueryName.Value, +#pragma warning disable CS0618 + Type = propType.Value +#pragma warning restore CS0618 +, + ValidationMethod = propValidationMethod.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.GeoBoundingBoxQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreUnmapped, value.IgnoreUnmapped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); +#pragma warning disable CS0618 + writer.WriteProperty(options, PropType, value.Type, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution? v) => w.WriteNullableValue(o, v)) +#pragma warning restore CS0618 + ; + writer.WriteProperty(options, PropValidationMethod, value.ValidationMethod, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, value.Field, value.BoundingBox, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v), null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoBoundingBoxQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoBoundingBoxQuery.g.cs index 2f48cc2e270..3b69593860c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoBoundingBoxQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoBoundingBoxQuery.g.cs @@ -23,88 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class GeoBoundingBoxQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnmapped = System.Text.Json.JsonEncodedText.Encode("ignore_unmapped"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropValidationMethod = System.Text.Json.JsonEncodedText.Encode("validation_method"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.GeoBoundingBoxQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propBoundingBox = default; - LocalJsonValue propField = default; - LocalJsonValue propIgnoreUnmapped = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propType = default; - LocalJsonValue propValidationMethod = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreUnmapped.TryReadProperty(ref reader, options, PropIgnoreUnmapped, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, static Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propValidationMethod.TryReadProperty(ref reader, options, PropValidationMethod, static Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - propField.Initialized = propBoundingBox.Initialized = true; - reader.ReadProperty(options, out propField.Value, out propBoundingBox.Value, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o), null); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.GeoBoundingBoxQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - BoundingBox = propBoundingBox.Value, - Field = propField.Value, - IgnoreUnmapped = propIgnoreUnmapped.Value, - QueryName = propQueryName.Value, -#pragma warning disable CS0618 - Type = propType.Value -#pragma warning restore CS0618 -, - ValidationMethod = propValidationMethod.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.GeoBoundingBoxQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreUnmapped, value.IgnoreUnmapped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); -#pragma warning disable CS0618 - writer.WriteProperty(options, PropType, value.Type, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution? v) => w.WriteNullableValue(o, v)) -#pragma warning restore CS0618 - ; - writer.WriteProperty(options, PropValidationMethod, value.ValidationMethod, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, value.Field, value.BoundingBox, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v), null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.GeoBoundingBoxQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.GeoBoundingBoxQueryConverter))] public sealed partial class GeoBoundingBoxQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDecayFunction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDecayFunction.Converters.g.cs new file mode 100644 index 00000000000..6d03c441b47 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDecayFunction.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class GeoDecayFunctionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMultiValueMode = System.Text.Json.JsonEncodedText.Encode("multi_value_mode"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.GeoDecayFunction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propMultiValueMode = default; + LocalJsonValue> propPlacement = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMultiValueMode.TryReadProperty(ref reader, options, PropMultiValueMode, static Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + propField.Initialized = propPlacement.Initialized = true; + reader.ReadProperty(options, out propField.Value, out propPlacement.Value, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o), null); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.GeoDecayFunction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + MultiValueMode = propMultiValueMode.Value, + Placement = propPlacement.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.GeoDecayFunction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMultiValueMode, value.MultiValueMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, value.Field, value.Placement, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v), null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDecayFunction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDecayFunction.g.cs index 15f01f80bc5..8ddb4107292 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDecayFunction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDecayFunction.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class GeoDecayFunctionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMultiValueMode = System.Text.Json.JsonEncodedText.Encode("multi_value_mode"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.GeoDecayFunction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propMultiValueMode = default; - LocalJsonValue> propPlacement = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMultiValueMode.TryReadProperty(ref reader, options, PropMultiValueMode, static Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - propField.Initialized = propPlacement.Initialized = true; - reader.ReadProperty(options, out propField.Value, out propPlacement.Value, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o), null); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.GeoDecayFunction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - MultiValueMode = propMultiValueMode.Value, - Placement = propPlacement.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.GeoDecayFunction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMultiValueMode, value.MultiValueMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, value.Field, value.Placement, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v), null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.GeoDecayFunctionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.GeoDecayFunctionConverter))] public sealed partial class GeoDecayFunction : Elastic.Clients.Elasticsearch.QueryDsl.IDecayFunction { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDistanceFeatureQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDistanceFeatureQuery.Converters.g.cs new file mode 100644 index 00000000000..ddb86a516fa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDistanceFeatureQuery.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class GeoDistanceFeatureQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropOrigin = System.Text.Json.JsonEncodedText.Encode("origin"); + private static readonly System.Text.Json.JsonEncodedText PropPivot = System.Text.Json.JsonEncodedText.Encode("pivot"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceFeatureQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propField = default; + LocalJsonValue propOrigin = default; + LocalJsonValue propPivot = default; + LocalJsonValue propQueryName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propOrigin.TryReadProperty(ref reader, options, PropOrigin, null)) + { + continue; + } + + if (propPivot.TryReadProperty(ref reader, options, PropPivot, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceFeatureQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Field = propField.Value, + Origin = propOrigin.Value, + Pivot = propPivot.Value, + QueryName = propQueryName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceFeatureQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropOrigin, value.Origin, null, null); + writer.WriteProperty(options, PropPivot, value.Pivot, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDistanceFeatureQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDistanceFeatureQuery.g.cs index 212498d56e9..395a6fc4907 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDistanceFeatureQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDistanceFeatureQuery.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class GeoDistanceFeatureQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropOrigin = System.Text.Json.JsonEncodedText.Encode("origin"); - private static readonly System.Text.Json.JsonEncodedText PropPivot = System.Text.Json.JsonEncodedText.Encode("pivot"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceFeatureQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propField = default; - LocalJsonValue propOrigin = default; - LocalJsonValue propPivot = default; - LocalJsonValue propQueryName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propOrigin.TryReadProperty(ref reader, options, PropOrigin, null)) - { - continue; - } - - if (propPivot.TryReadProperty(ref reader, options, PropPivot, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceFeatureQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Field = propField.Value, - Origin = propOrigin.Value, - Pivot = propPivot.Value, - QueryName = propQueryName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceFeatureQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropOrigin, value.Origin, null, null); - writer.WriteProperty(options, PropPivot, value.Pivot, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceFeatureQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.GeoDistanceFeatureQueryConverter))] public sealed partial class GeoDistanceFeatureQuery : Elastic.Clients.Elasticsearch.QueryDsl.IDistanceFeatureQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDistanceQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDistanceQuery.Converters.g.cs new file mode 100644 index 00000000000..5c5809fda60 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDistanceQuery.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class GeoDistanceQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropDistance = System.Text.Json.JsonEncodedText.Encode("distance"); + private static readonly System.Text.Json.JsonEncodedText PropDistanceType = System.Text.Json.JsonEncodedText.Encode("distance_type"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnmapped = System.Text.Json.JsonEncodedText.Encode("ignore_unmapped"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropValidationMethod = System.Text.Json.JsonEncodedText.Encode("validation_method"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propDistance = default; + LocalJsonValue propDistanceType = default; + LocalJsonValue propField = default; + LocalJsonValue propIgnoreUnmapped = default; + LocalJsonValue propLocation = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propValidationMethod = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDistance.TryReadProperty(ref reader, options, PropDistance, null)) + { + continue; + } + + if (propDistanceType.TryReadProperty(ref reader, options, PropDistanceType, static Elastic.Clients.Elasticsearch.GeoDistanceType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreUnmapped.TryReadProperty(ref reader, options, PropIgnoreUnmapped, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propValidationMethod.TryReadProperty(ref reader, options, PropValidationMethod, static Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + propField.Initialized = propLocation.Initialized = true; + reader.ReadProperty(options, out propField.Value, out propLocation.Value, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o), null); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Distance = propDistance.Value, + DistanceType = propDistanceType.Value, + Field = propField.Value, + IgnoreUnmapped = propIgnoreUnmapped.Value, + Location = propLocation.Value, + QueryName = propQueryName.Value, + ValidationMethod = propValidationMethod.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDistance, value.Distance, null, null); + writer.WriteProperty(options, PropDistanceType, value.DistanceType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.GeoDistanceType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreUnmapped, value.IgnoreUnmapped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropValidationMethod, value.ValidationMethod, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, value.Field, value.Location, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v), null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDistanceQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDistanceQuery.g.cs index 274237a9002..98d9e9039cb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDistanceQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDistanceQuery.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class GeoDistanceQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropDistance = System.Text.Json.JsonEncodedText.Encode("distance"); - private static readonly System.Text.Json.JsonEncodedText PropDistanceType = System.Text.Json.JsonEncodedText.Encode("distance_type"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnmapped = System.Text.Json.JsonEncodedText.Encode("ignore_unmapped"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropValidationMethod = System.Text.Json.JsonEncodedText.Encode("validation_method"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propDistance = default; - LocalJsonValue propDistanceType = default; - LocalJsonValue propField = default; - LocalJsonValue propIgnoreUnmapped = default; - LocalJsonValue propLocation = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propValidationMethod = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDistance.TryReadProperty(ref reader, options, PropDistance, null)) - { - continue; - } - - if (propDistanceType.TryReadProperty(ref reader, options, PropDistanceType, static Elastic.Clients.Elasticsearch.GeoDistanceType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreUnmapped.TryReadProperty(ref reader, options, PropIgnoreUnmapped, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propValidationMethod.TryReadProperty(ref reader, options, PropValidationMethod, static Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - propField.Initialized = propLocation.Initialized = true; - reader.ReadProperty(options, out propField.Value, out propLocation.Value, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o), null); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Distance = propDistance.Value, - DistanceType = propDistanceType.Value, - Field = propField.Value, - IgnoreUnmapped = propIgnoreUnmapped.Value, - Location = propLocation.Value, - QueryName = propQueryName.Value, - ValidationMethod = propValidationMethod.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDistance, value.Distance, null, null); - writer.WriteProperty(options, PropDistanceType, value.DistanceType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.GeoDistanceType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreUnmapped, value.IgnoreUnmapped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropValidationMethod, value.ValidationMethod, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, value.Field, value.Location, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v), null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.GeoDistanceQueryConverter))] public sealed partial class GeoDistanceQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoExecution.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoExecution.Converters.g.cs new file mode 100644 index 00000000000..500cd3002ab --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoExecution.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class GeoExecutionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberIndexed = System.Text.Json.JsonEncodedText.Encode("indexed"); + private static readonly System.Text.Json.JsonEncodedText MemberMemory = System.Text.Json.JsonEncodedText.Encode("memory"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberIndexed)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution.Indexed; + } + + if (reader.ValueTextEquals(MemberMemory)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution.Memory; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberIndexed.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution.Indexed; + } + + if (string.Equals(value, MemberMemory.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution.Memory; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution.Indexed: + writer.WriteStringValue(MemberIndexed); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution.Memory: + writer.WriteStringValue(MemberMemory); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.GeoExecution value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoExecution.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoExecution.g.cs new file mode 100644 index 00000000000..b9dd892e99c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoExecution.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.GeoExecutionConverter))] +public enum GeoExecution +{ + [System.Runtime.Serialization.EnumMember(Value = "indexed")] + Indexed, + [System.Runtime.Serialization.EnumMember(Value = "memory")] + Memory +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoGridQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoGridQuery.Converters.g.cs new file mode 100644 index 00000000000..ae1f56b4bc4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoGridQuery.Converters.g.cs @@ -0,0 +1,131 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class GeoGridQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText VariantGeohash = System.Text.Json.JsonEncodedText.Encode("geohash"); + private static readonly System.Text.Json.JsonEncodedText VariantGeohex = System.Text.Json.JsonEncodedText.Encode("geohex"); + private static readonly System.Text.Json.JsonEncodedText VariantGeotile = System.Text.Json.JsonEncodedText.Encode("geotile"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.GeoGridQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + reader.Read(); + propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propQueryName = default; + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (reader.ValueTextEquals(VariantGeohash)) + { + variantType = VariantGeohash.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantGeohex)) + { + variantType = VariantGeohex.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantGeotile)) + { + variantType = VariantGeotile.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.GeoGridQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant, + Boost = propBoost.Value, + Field = propField.Value, + QueryName = propQueryName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.GeoGridQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "geohash": + writer.WriteProperty(options, value.VariantType, (string)value.Variant, null, null); + break; + case "geohex": + writer.WriteProperty(options, value.VariantType, (string)value.Variant, null, null); + break; + case "geotile": + writer.WriteProperty(options, value.VariantType, (string)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.GeoGridQuery)}'."); + } + + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoGridQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoGridQuery.g.cs index dd0ff42e2fc..af62975b0dd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoGridQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoGridQuery.g.cs @@ -23,114 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class GeoGridQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText VariantGeohash = System.Text.Json.JsonEncodedText.Encode("geohash"); - private static readonly System.Text.Json.JsonEncodedText VariantGeohex = System.Text.Json.JsonEncodedText.Encode("geohex"); - private static readonly System.Text.Json.JsonEncodedText VariantGeotile = System.Text.Json.JsonEncodedText.Encode("geotile"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.GeoGridQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - reader.Read(); - propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propQueryName = default; - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (reader.ValueTextEquals(VariantGeohash)) - { - variantType = VariantGeohash.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantGeohex)) - { - variantType = VariantGeohex.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantGeotile)) - { - variantType = VariantGeotile.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.GeoGridQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant, - Boost = propBoost.Value, - Field = propField.Value, - QueryName = propQueryName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.GeoGridQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "geohash": - writer.WriteProperty(options, value.VariantType, (string)value.Variant, null, null); - break; - case "geohex": - writer.WriteProperty(options, value.VariantType, (string)value.Variant, null, null); - break; - case "geotile": - writer.WriteProperty(options, value.VariantType, (string)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.GeoGridQuery)}'."); - } - - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteEndObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.GeoGridQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.GeoGridQueryConverter))] public sealed partial class GeoGridQuery { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonPoints.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonPoints.Converters.g.cs new file mode 100644 index 00000000000..1b715621a2c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonPoints.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class GeoPolygonPointsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPoints = System.Text.Json.JsonEncodedText.Encode("points"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPoints Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propPoints = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPoints.TryReadProperty(ref reader, options, PropPoints, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPoints(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Points = propPoints.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPoints value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPoints, value.Points, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonPoints.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonPoints.g.cs index 17cca22679c..103044327bf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonPoints.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonPoints.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class GeoPolygonPointsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPoints = System.Text.Json.JsonEncodedText.Encode("points"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPoints Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propPoints = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPoints.TryReadProperty(ref reader, options, PropPoints, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPoints(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Points = propPoints.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPoints value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPoints, value.Points, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPointsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.GeoPolygonPointsConverter))] public sealed partial class GeoPolygonPoints { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonQuery.Converters.g.cs new file mode 100644 index 00000000000..8f9f9564276 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonQuery.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class GeoPolygonQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnmapped = System.Text.Json.JsonEncodedText.Encode("ignore_unmapped"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropValidationMethod = System.Text.Json.JsonEncodedText.Encode("validation_method"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propField = default; + LocalJsonValue propIgnoreUnmapped = default; + LocalJsonValue propPolygon = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propValidationMethod = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreUnmapped.TryReadProperty(ref reader, options, PropIgnoreUnmapped, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propValidationMethod.TryReadProperty(ref reader, options, PropValidationMethod, static Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + propField.Initialized = propPolygon.Initialized = true; + reader.ReadProperty(options, out propField.Value, out propPolygon.Value, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o), null); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Field = propField.Value, + IgnoreUnmapped = propIgnoreUnmapped.Value, + Polygon = propPolygon.Value, + QueryName = propQueryName.Value, + ValidationMethod = propValidationMethod.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreUnmapped, value.IgnoreUnmapped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropValidationMethod, value.ValidationMethod, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, value.Field, value.Polygon, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v), null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonQuery.g.cs index e12525ae916..8209ea22466 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonQuery.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class GeoPolygonQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnmapped = System.Text.Json.JsonEncodedText.Encode("ignore_unmapped"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropValidationMethod = System.Text.Json.JsonEncodedText.Encode("validation_method"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propField = default; - LocalJsonValue propIgnoreUnmapped = default; - LocalJsonValue propPolygon = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propValidationMethod = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreUnmapped.TryReadProperty(ref reader, options, PropIgnoreUnmapped, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propValidationMethod.TryReadProperty(ref reader, options, PropValidationMethod, static Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - propField.Initialized = propPolygon.Initialized = true; - reader.ReadProperty(options, out propField.Value, out propPolygon.Value, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o), null); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Field = propField.Value, - IgnoreUnmapped = propIgnoreUnmapped.Value, - Polygon = propPolygon.Value, - QueryName = propQueryName.Value, - ValidationMethod = propValidationMethod.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreUnmapped, value.IgnoreUnmapped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropValidationMethod, value.ValidationMethod, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, value.Field, value.Polygon, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v), null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.GeoPolygonQueryConverter))] public sealed partial class GeoPolygonQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoShapeFieldQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoShapeFieldQuery.Converters.g.cs new file mode 100644 index 00000000000..bff9f922e81 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoShapeFieldQuery.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class GeoShapeFieldQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndexedShape = System.Text.Json.JsonEncodedText.Encode("indexed_shape"); + private static readonly System.Text.Json.JsonEncodedText PropRelation = System.Text.Json.JsonEncodedText.Encode("relation"); + private static readonly System.Text.Json.JsonEncodedText PropShape = System.Text.Json.JsonEncodedText.Encode("shape"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.GeoShapeFieldQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndexedShape = default; + LocalJsonValue propRelation = default; + LocalJsonValue propShape = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndexedShape.TryReadProperty(ref reader, options, PropIndexedShape, null)) + { + continue; + } + + if (propRelation.TryReadProperty(ref reader, options, PropRelation, static Elastic.Clients.Elasticsearch.GeoShapeRelation? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propShape.TryReadProperty(ref reader, options, PropShape, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.GeoShapeFieldQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + IndexedShape = propIndexedShape.Value, + Relation = propRelation.Value, + Shape = propShape.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.GeoShapeFieldQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndexedShape, value.IndexedShape, null, null); + writer.WriteProperty(options, PropRelation, value.Relation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.GeoShapeRelation? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropShape, value.Shape, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoShapeFieldQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoShapeFieldQuery.g.cs index d405bc3d7e6..e9eeda42a5a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoShapeFieldQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoShapeFieldQuery.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class GeoShapeFieldQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndexedShape = System.Text.Json.JsonEncodedText.Encode("indexed_shape"); - private static readonly System.Text.Json.JsonEncodedText PropRelation = System.Text.Json.JsonEncodedText.Encode("relation"); - private static readonly System.Text.Json.JsonEncodedText PropShape = System.Text.Json.JsonEncodedText.Encode("shape"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.GeoShapeFieldQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndexedShape = default; - LocalJsonValue propRelation = default; - LocalJsonValue propShape = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndexedShape.TryReadProperty(ref reader, options, PropIndexedShape, null)) - { - continue; - } - - if (propRelation.TryReadProperty(ref reader, options, PropRelation, static Elastic.Clients.Elasticsearch.GeoShapeRelation? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propShape.TryReadProperty(ref reader, options, PropShape, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.GeoShapeFieldQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - IndexedShape = propIndexedShape.Value, - Relation = propRelation.Value, - Shape = propShape.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.GeoShapeFieldQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndexedShape, value.IndexedShape, null, null); - writer.WriteProperty(options, PropRelation, value.Relation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.GeoShapeRelation? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropShape, value.Shape, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.GeoShapeFieldQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.GeoShapeFieldQueryConverter))] public sealed partial class GeoShapeFieldQuery { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoShapeQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoShapeQuery.Converters.g.cs new file mode 100644 index 00000000000..ef4717db013 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoShapeQuery.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class GeoShapeQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnmapped = System.Text.Json.JsonEncodedText.Encode("ignore_unmapped"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.GeoShapeQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propField = default; + LocalJsonValue propIgnoreUnmapped = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propShape = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreUnmapped.TryReadProperty(ref reader, options, PropIgnoreUnmapped, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + propField.Initialized = propShape.Initialized = true; + reader.ReadProperty(options, out propField.Value, out propShape.Value, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o), null); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.GeoShapeQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Field = propField.Value, + IgnoreUnmapped = propIgnoreUnmapped.Value, + QueryName = propQueryName.Value, + Shape = propShape.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.GeoShapeQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreUnmapped, value.IgnoreUnmapped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, value.Field, value.Shape, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v), null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoShapeQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoShapeQuery.g.cs index 50463b4fba6..395b4e0b90f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoShapeQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoShapeQuery.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class GeoShapeQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnmapped = System.Text.Json.JsonEncodedText.Encode("ignore_unmapped"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.GeoShapeQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propField = default; - LocalJsonValue propIgnoreUnmapped = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propShape = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreUnmapped.TryReadProperty(ref reader, options, PropIgnoreUnmapped, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - propField.Initialized = propShape.Initialized = true; - reader.ReadProperty(options, out propField.Value, out propShape.Value, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o), null); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.GeoShapeQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Field = propField.Value, - IgnoreUnmapped = propIgnoreUnmapped.Value, - QueryName = propQueryName.Value, - Shape = propShape.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.GeoShapeQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreUnmapped, value.IgnoreUnmapped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, value.Field, value.Shape, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v), null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.GeoShapeQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.GeoShapeQueryConverter))] public sealed partial class GeoShapeQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoValidationMethod.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoValidationMethod.Converters.g.cs new file mode 100644 index 00000000000..ed5279cd768 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoValidationMethod.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class GeoValidationMethodConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCoerce = System.Text.Json.JsonEncodedText.Encode("coerce"); + private static readonly System.Text.Json.JsonEncodedText MemberIgnoreMalformed = System.Text.Json.JsonEncodedText.Encode("ignore_malformed"); + private static readonly System.Text.Json.JsonEncodedText MemberStrict = System.Text.Json.JsonEncodedText.Encode("strict"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCoerce)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod.Coerce; + } + + if (reader.ValueTextEquals(MemberIgnoreMalformed)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod.IgnoreMalformed; + } + + if (reader.ValueTextEquals(MemberStrict)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod.Strict; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCoerce.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod.Coerce; + } + + if (string.Equals(value, MemberIgnoreMalformed.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod.IgnoreMalformed; + } + + if (string.Equals(value, MemberStrict.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod.Strict; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod.Coerce: + writer.WriteStringValue(MemberCoerce); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod.IgnoreMalformed: + writer.WriteStringValue(MemberIgnoreMalformed); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod.Strict: + writer.WriteStringValue(MemberStrict); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoValidationMethod.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoValidationMethod.g.cs new file mode 100644 index 00000000000..afb16bcacfa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoValidationMethod.g.cs @@ -0,0 +1,45 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.GeoValidationMethodConverter))] +public enum GeoValidationMethod +{ + /// + /// + /// Accept geo points with invalid latitude or longitude and additionally try and infer correct coordinates. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "coerce")] + Coerce, + /// + /// + /// Accept geo points with invalid latitude or longitude. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "ignore_malformed")] + IgnoreMalformed, + [System.Runtime.Serialization.EnumMember(Value = "strict")] + Strict +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/HasChildQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/HasChildQuery.Converters.g.cs new file mode 100644 index 00000000000..d6e4ee70bf6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/HasChildQuery.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class HasChildQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnmapped = System.Text.Json.JsonEncodedText.Encode("ignore_unmapped"); + private static readonly System.Text.Json.JsonEncodedText PropInnerHits = System.Text.Json.JsonEncodedText.Encode("inner_hits"); + private static readonly System.Text.Json.JsonEncodedText PropMaxChildren = System.Text.Json.JsonEncodedText.Encode("max_children"); + private static readonly System.Text.Json.JsonEncodedText PropMinChildren = System.Text.Json.JsonEncodedText.Encode("min_children"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropScoreMode = System.Text.Json.JsonEncodedText.Encode("score_mode"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.HasChildQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propIgnoreUnmapped = default; + LocalJsonValue propInnerHits = default; + LocalJsonValue propMaxChildren = default; + LocalJsonValue propMinChildren = default; + LocalJsonValue propQuery = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propScoreMode = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreUnmapped.TryReadProperty(ref reader, options, PropIgnoreUnmapped, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propInnerHits.TryReadProperty(ref reader, options, PropInnerHits, null)) + { + continue; + } + + if (propMaxChildren.TryReadProperty(ref reader, options, PropMaxChildren, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinChildren.TryReadProperty(ref reader, options, PropMinChildren, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propScoreMode.TryReadProperty(ref reader, options, PropScoreMode, static Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.HasChildQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + IgnoreUnmapped = propIgnoreUnmapped.Value, + InnerHits = propInnerHits.Value, + MaxChildren = propMaxChildren.Value, + MinChildren = propMinChildren.Value, + Query = propQuery.Value, + QueryName = propQueryName.Value, + ScoreMode = propScoreMode.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.HasChildQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreUnmapped, value.IgnoreUnmapped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropInnerHits, value.InnerHits, null, null); + writer.WriteProperty(options, PropMaxChildren, value.MaxChildren, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinChildren, value.MinChildren, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropScoreMode, value.ScoreMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/HasChildQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/HasChildQuery.g.cs index bc096a2aad6..3fdee95b67d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/HasChildQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/HasChildQuery.g.cs @@ -23,118 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class HasChildQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnmapped = System.Text.Json.JsonEncodedText.Encode("ignore_unmapped"); - private static readonly System.Text.Json.JsonEncodedText PropInnerHits = System.Text.Json.JsonEncodedText.Encode("inner_hits"); - private static readonly System.Text.Json.JsonEncodedText PropMaxChildren = System.Text.Json.JsonEncodedText.Encode("max_children"); - private static readonly System.Text.Json.JsonEncodedText PropMinChildren = System.Text.Json.JsonEncodedText.Encode("min_children"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropScoreMode = System.Text.Json.JsonEncodedText.Encode("score_mode"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.HasChildQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propIgnoreUnmapped = default; - LocalJsonValue propInnerHits = default; - LocalJsonValue propMaxChildren = default; - LocalJsonValue propMinChildren = default; - LocalJsonValue propQuery = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propScoreMode = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreUnmapped.TryReadProperty(ref reader, options, PropIgnoreUnmapped, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propInnerHits.TryReadProperty(ref reader, options, PropInnerHits, null)) - { - continue; - } - - if (propMaxChildren.TryReadProperty(ref reader, options, PropMaxChildren, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinChildren.TryReadProperty(ref reader, options, PropMinChildren, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propScoreMode.TryReadProperty(ref reader, options, PropScoreMode, static Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.HasChildQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - IgnoreUnmapped = propIgnoreUnmapped.Value, - InnerHits = propInnerHits.Value, - MaxChildren = propMaxChildren.Value, - MinChildren = propMinChildren.Value, - Query = propQuery.Value, - QueryName = propQueryName.Value, - ScoreMode = propScoreMode.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.HasChildQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreUnmapped, value.IgnoreUnmapped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropInnerHits, value.InnerHits, null, null); - writer.WriteProperty(options, PropMaxChildren, value.MaxChildren, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinChildren, value.MinChildren, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropScoreMode, value.ScoreMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.HasChildQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.HasChildQueryConverter))] public sealed partial class HasChildQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/HasParentQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/HasParentQuery.Converters.g.cs new file mode 100644 index 00000000000..2b36c6181c6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/HasParentQuery.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class HasParentQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnmapped = System.Text.Json.JsonEncodedText.Encode("ignore_unmapped"); + private static readonly System.Text.Json.JsonEncodedText PropInnerHits = System.Text.Json.JsonEncodedText.Encode("inner_hits"); + private static readonly System.Text.Json.JsonEncodedText PropParentType = System.Text.Json.JsonEncodedText.Encode("parent_type"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropScore = System.Text.Json.JsonEncodedText.Encode("score"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.HasParentQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propIgnoreUnmapped = default; + LocalJsonValue propInnerHits = default; + LocalJsonValue propParentType = default; + LocalJsonValue propQuery = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propScore = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreUnmapped.TryReadProperty(ref reader, options, PropIgnoreUnmapped, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propInnerHits.TryReadProperty(ref reader, options, PropInnerHits, null)) + { + continue; + } + + if (propParentType.TryReadProperty(ref reader, options, PropParentType, null)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propScore.TryReadProperty(ref reader, options, PropScore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.HasParentQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + IgnoreUnmapped = propIgnoreUnmapped.Value, + InnerHits = propInnerHits.Value, + ParentType = propParentType.Value, + Query = propQuery.Value, + QueryName = propQueryName.Value, + Score = propScore.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.HasParentQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreUnmapped, value.IgnoreUnmapped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropInnerHits, value.InnerHits, null, null); + writer.WriteProperty(options, PropParentType, value.ParentType, null, null); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropScore, value.Score, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/HasParentQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/HasParentQuery.g.cs index 221211aac73..32bf154574f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/HasParentQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/HasParentQuery.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class HasParentQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnmapped = System.Text.Json.JsonEncodedText.Encode("ignore_unmapped"); - private static readonly System.Text.Json.JsonEncodedText PropInnerHits = System.Text.Json.JsonEncodedText.Encode("inner_hits"); - private static readonly System.Text.Json.JsonEncodedText PropParentType = System.Text.Json.JsonEncodedText.Encode("parent_type"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropScore = System.Text.Json.JsonEncodedText.Encode("score"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.HasParentQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propIgnoreUnmapped = default; - LocalJsonValue propInnerHits = default; - LocalJsonValue propParentType = default; - LocalJsonValue propQuery = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propScore = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreUnmapped.TryReadProperty(ref reader, options, PropIgnoreUnmapped, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propInnerHits.TryReadProperty(ref reader, options, PropInnerHits, null)) - { - continue; - } - - if (propParentType.TryReadProperty(ref reader, options, PropParentType, null)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propScore.TryReadProperty(ref reader, options, PropScore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.HasParentQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - IgnoreUnmapped = propIgnoreUnmapped.Value, - InnerHits = propInnerHits.Value, - ParentType = propParentType.Value, - Query = propQuery.Value, - QueryName = propQueryName.Value, - Score = propScore.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.HasParentQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreUnmapped, value.IgnoreUnmapped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropInnerHits, value.InnerHits, null, null); - writer.WriteProperty(options, PropParentType, value.ParentType, null, null); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropScore, value.Score, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.HasParentQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.HasParentQueryConverter))] public sealed partial class HasParentQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IdsQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IdsQuery.Converters.g.cs new file mode 100644 index 00000000000..a396e0da32d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IdsQuery.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class IdsQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropValues = System.Text.Json.JsonEncodedText.Encode("values"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.IdsQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propValues = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propValues.TryReadProperty(ref reader, options, PropValues, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.IdsQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + QueryName = propQueryName.Value, + Values = propValues.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IdsQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropValues, value.Values, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IdsQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IdsQuery.g.cs index dd835401562..d8c2f3cd205 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IdsQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IdsQuery.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class IdsQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropValues = System.Text.Json.JsonEncodedText.Encode("values"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.IdsQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propValues = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propValues.TryReadProperty(ref reader, options, PropValues, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.IdsQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - QueryName = propQueryName.Value, - Values = propValues.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IdsQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropValues, value.Values, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.IdsQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.IdsQueryConverter))] public sealed partial class IdsQuery { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Intervals.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Intervals.Converters.g.cs new file mode 100644 index 00000000000..7e79880cf00 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Intervals.Converters.g.cs @@ -0,0 +1,162 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class IntervalsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantAllOf = System.Text.Json.JsonEncodedText.Encode("all_of"); + private static readonly System.Text.Json.JsonEncodedText VariantAnyOf = System.Text.Json.JsonEncodedText.Encode("any_of"); + private static readonly System.Text.Json.JsonEncodedText VariantFuzzy = System.Text.Json.JsonEncodedText.Encode("fuzzy"); + private static readonly System.Text.Json.JsonEncodedText VariantMatch = System.Text.Json.JsonEncodedText.Encode("match"); + private static readonly System.Text.Json.JsonEncodedText VariantPrefix = System.Text.Json.JsonEncodedText.Encode("prefix"); + private static readonly System.Text.Json.JsonEncodedText VariantRange = System.Text.Json.JsonEncodedText.Encode("range"); + private static readonly System.Text.Json.JsonEncodedText VariantRegexp = System.Text.Json.JsonEncodedText.Encode("regexp"); + private static readonly System.Text.Json.JsonEncodedText VariantWildcard = System.Text.Json.JsonEncodedText.Encode("wildcard"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.Intervals Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantAllOf)) + { + variantType = VariantAllOf.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantAnyOf)) + { + variantType = VariantAnyOf.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantFuzzy)) + { + variantType = VariantFuzzy.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMatch)) + { + variantType = VariantMatch.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantPrefix)) + { + variantType = VariantPrefix.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRange)) + { + variantType = VariantRange.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRegexp)) + { + variantType = VariantRegexp.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantWildcard)) + { + variantType = VariantWildcard.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.Intervals(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.Intervals value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "all_of": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAllOf)value.Variant, null, null); + break; + case "any_of": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAnyOf)value.Variant, null, null); + break; + case "fuzzy": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFuzzy)value.Variant, null, null); + break; + case "match": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsMatch)value.Variant, null, null); + break; + case "prefix": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsPrefix)value.Variant, null, null); + break; + case "range": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsRange)value.Variant, null, null); + break; + case "regexp": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsRegexp)value.Variant, null, null); + break; + case "wildcard": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsWildcard)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.Intervals)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Intervals.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Intervals.g.cs index a41ca652cd0..7f1c8fd92a9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Intervals.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Intervals.g.cs @@ -23,145 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class IntervalsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantAllOf = System.Text.Json.JsonEncodedText.Encode("all_of"); - private static readonly System.Text.Json.JsonEncodedText VariantAnyOf = System.Text.Json.JsonEncodedText.Encode("any_of"); - private static readonly System.Text.Json.JsonEncodedText VariantFuzzy = System.Text.Json.JsonEncodedText.Encode("fuzzy"); - private static readonly System.Text.Json.JsonEncodedText VariantMatch = System.Text.Json.JsonEncodedText.Encode("match"); - private static readonly System.Text.Json.JsonEncodedText VariantPrefix = System.Text.Json.JsonEncodedText.Encode("prefix"); - private static readonly System.Text.Json.JsonEncodedText VariantRange = System.Text.Json.JsonEncodedText.Encode("range"); - private static readonly System.Text.Json.JsonEncodedText VariantRegexp = System.Text.Json.JsonEncodedText.Encode("regexp"); - private static readonly System.Text.Json.JsonEncodedText VariantWildcard = System.Text.Json.JsonEncodedText.Encode("wildcard"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.Intervals Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantAllOf)) - { - variantType = VariantAllOf.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantAnyOf)) - { - variantType = VariantAnyOf.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantFuzzy)) - { - variantType = VariantFuzzy.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMatch)) - { - variantType = VariantMatch.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantPrefix)) - { - variantType = VariantPrefix.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRange)) - { - variantType = VariantRange.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRegexp)) - { - variantType = VariantRegexp.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantWildcard)) - { - variantType = VariantWildcard.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.Intervals(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.Intervals value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "all_of": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAllOf)value.Variant, null, null); - break; - case "any_of": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAnyOf)value.Variant, null, null); - break; - case "fuzzy": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFuzzy)value.Variant, null, null); - break; - case "match": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsMatch)value.Variant, null, null); - break; - case "prefix": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsPrefix)value.Variant, null, null); - break; - case "range": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsRange)value.Variant, null, null); - break; - case "regexp": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsRegexp)value.Variant, null, null); - break; - case "wildcard": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsWildcard)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.Intervals)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.IntervalsConverter))] public sealed partial class Intervals { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsAllOf.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsAllOf.Converters.g.cs new file mode 100644 index 00000000000..4d04462c030 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsAllOf.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class IntervalsAllOfConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropIntervals = System.Text.Json.JsonEncodedText.Encode("intervals"); + private static readonly System.Text.Json.JsonEncodedText PropMaxGaps = System.Text.Json.JsonEncodedText.Encode("max_gaps"); + private static readonly System.Text.Json.JsonEncodedText PropOrdered = System.Text.Json.JsonEncodedText.Encode("ordered"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAllOf Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFilter = default; + LocalJsonValue> propIntervals = default; + LocalJsonValue propMaxGaps = default; + LocalJsonValue propOrdered = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) + { + continue; + } + + if (propIntervals.TryReadProperty(ref reader, options, PropIntervals, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMaxGaps.TryReadProperty(ref reader, options, PropMaxGaps, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOrdered.TryReadProperty(ref reader, options, PropOrdered, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAllOf(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Filter = propFilter.Value, + Intervals = propIntervals.Value, + MaxGaps = propMaxGaps.Value, + Ordered = propOrdered.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAllOf value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFilter, value.Filter, null, null); + writer.WriteProperty(options, PropIntervals, value.Intervals, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMaxGaps, value.MaxGaps, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOrdered, value.Ordered, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsAllOf.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsAllOf.g.cs index f1dc1fb023f..4391055909e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsAllOf.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsAllOf.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class IntervalsAllOfConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropIntervals = System.Text.Json.JsonEncodedText.Encode("intervals"); - private static readonly System.Text.Json.JsonEncodedText PropMaxGaps = System.Text.Json.JsonEncodedText.Encode("max_gaps"); - private static readonly System.Text.Json.JsonEncodedText PropOrdered = System.Text.Json.JsonEncodedText.Encode("ordered"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAllOf Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFilter = default; - LocalJsonValue> propIntervals = default; - LocalJsonValue propMaxGaps = default; - LocalJsonValue propOrdered = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) - { - continue; - } - - if (propIntervals.TryReadProperty(ref reader, options, PropIntervals, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMaxGaps.TryReadProperty(ref reader, options, PropMaxGaps, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOrdered.TryReadProperty(ref reader, options, PropOrdered, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAllOf(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Filter = propFilter.Value, - Intervals = propIntervals.Value, - MaxGaps = propMaxGaps.Value, - Ordered = propOrdered.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAllOf value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFilter, value.Filter, null, null); - writer.WriteProperty(options, PropIntervals, value.Intervals, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMaxGaps, value.MaxGaps, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOrdered, value.Ordered, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAllOfConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.IntervalsAllOfConverter))] public sealed partial class IntervalsAllOf { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsAnyOf.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsAnyOf.Converters.g.cs new file mode 100644 index 00000000000..8fa4149bdb1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsAnyOf.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class IntervalsAnyOfConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropIntervals = System.Text.Json.JsonEncodedText.Encode("intervals"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAnyOf Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFilter = default; + LocalJsonValue> propIntervals = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) + { + continue; + } + + if (propIntervals.TryReadProperty(ref reader, options, PropIntervals, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAnyOf(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Filter = propFilter.Value, + Intervals = propIntervals.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAnyOf value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFilter, value.Filter, null, null); + writer.WriteProperty(options, PropIntervals, value.Intervals, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsAnyOf.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsAnyOf.g.cs index 7c2662dc30d..c5c4fc679af 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsAnyOf.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsAnyOf.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class IntervalsAnyOfConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropIntervals = System.Text.Json.JsonEncodedText.Encode("intervals"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAnyOf Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFilter = default; - LocalJsonValue> propIntervals = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) - { - continue; - } - - if (propIntervals.TryReadProperty(ref reader, options, PropIntervals, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAnyOf(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Filter = propFilter.Value, - Intervals = propIntervals.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAnyOf value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFilter, value.Filter, null, null); - writer.WriteProperty(options, PropIntervals, value.Intervals, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAnyOfConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.IntervalsAnyOfConverter))] public sealed partial class IntervalsAnyOf { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsFilter.Converters.g.cs new file mode 100644 index 00000000000..cb6f96f6d01 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsFilter.Converters.g.cs @@ -0,0 +1,174 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class IntervalsFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantAfter = System.Text.Json.JsonEncodedText.Encode("after"); + private static readonly System.Text.Json.JsonEncodedText VariantBefore = System.Text.Json.JsonEncodedText.Encode("before"); + private static readonly System.Text.Json.JsonEncodedText VariantContainedBy = System.Text.Json.JsonEncodedText.Encode("contained_by"); + private static readonly System.Text.Json.JsonEncodedText VariantContaining = System.Text.Json.JsonEncodedText.Encode("containing"); + private static readonly System.Text.Json.JsonEncodedText VariantNotContainedBy = System.Text.Json.JsonEncodedText.Encode("not_contained_by"); + private static readonly System.Text.Json.JsonEncodedText VariantNotContaining = System.Text.Json.JsonEncodedText.Encode("not_containing"); + private static readonly System.Text.Json.JsonEncodedText VariantNotOverlapping = System.Text.Json.JsonEncodedText.Encode("not_overlapping"); + private static readonly System.Text.Json.JsonEncodedText VariantOverlapping = System.Text.Json.JsonEncodedText.Encode("overlapping"); + private static readonly System.Text.Json.JsonEncodedText VariantScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantAfter)) + { + variantType = VariantAfter.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantBefore)) + { + variantType = VariantBefore.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantContainedBy)) + { + variantType = VariantContainedBy.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantContaining)) + { + variantType = VariantContaining.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantNotContainedBy)) + { + variantType = VariantNotContainedBy.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantNotContaining)) + { + variantType = VariantNotContaining.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantNotOverlapping)) + { + variantType = VariantNotOverlapping.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantOverlapping)) + { + variantType = VariantOverlapping.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantScript)) + { + variantType = VariantScript.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "after": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.Intervals)value.Variant, null, null); + break; + case "before": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.Intervals)value.Variant, null, null); + break; + case "contained_by": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.Intervals)value.Variant, null, null); + break; + case "containing": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.Intervals)value.Variant, null, null); + break; + case "not_contained_by": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.Intervals)value.Variant, null, null); + break; + case "not_containing": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.Intervals)value.Variant, null, null); + break; + case "not_overlapping": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.Intervals)value.Variant, null, null); + break; + case "overlapping": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.Intervals)value.Variant, null, null); + break; + case "script": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Script)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilter)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsFilter.g.cs index 47db45df36b..7ae8b963cbe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsFilter.g.cs @@ -23,157 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class IntervalsFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantAfter = System.Text.Json.JsonEncodedText.Encode("after"); - private static readonly System.Text.Json.JsonEncodedText VariantBefore = System.Text.Json.JsonEncodedText.Encode("before"); - private static readonly System.Text.Json.JsonEncodedText VariantContainedBy = System.Text.Json.JsonEncodedText.Encode("contained_by"); - private static readonly System.Text.Json.JsonEncodedText VariantContaining = System.Text.Json.JsonEncodedText.Encode("containing"); - private static readonly System.Text.Json.JsonEncodedText VariantNotContainedBy = System.Text.Json.JsonEncodedText.Encode("not_contained_by"); - private static readonly System.Text.Json.JsonEncodedText VariantNotContaining = System.Text.Json.JsonEncodedText.Encode("not_containing"); - private static readonly System.Text.Json.JsonEncodedText VariantNotOverlapping = System.Text.Json.JsonEncodedText.Encode("not_overlapping"); - private static readonly System.Text.Json.JsonEncodedText VariantOverlapping = System.Text.Json.JsonEncodedText.Encode("overlapping"); - private static readonly System.Text.Json.JsonEncodedText VariantScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantAfter)) - { - variantType = VariantAfter.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantBefore)) - { - variantType = VariantBefore.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantContainedBy)) - { - variantType = VariantContainedBy.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantContaining)) - { - variantType = VariantContaining.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantNotContainedBy)) - { - variantType = VariantNotContainedBy.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantNotContaining)) - { - variantType = VariantNotContaining.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantNotOverlapping)) - { - variantType = VariantNotOverlapping.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantOverlapping)) - { - variantType = VariantOverlapping.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantScript)) - { - variantType = VariantScript.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "after": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.Intervals)value.Variant, null, null); - break; - case "before": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.Intervals)value.Variant, null, null); - break; - case "contained_by": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.Intervals)value.Variant, null, null); - break; - case "containing": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.Intervals)value.Variant, null, null); - break; - case "not_contained_by": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.Intervals)value.Variant, null, null); - break; - case "not_containing": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.Intervals)value.Variant, null, null); - break; - case "not_overlapping": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.Intervals)value.Variant, null, null); - break; - case "overlapping": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.Intervals)value.Variant, null, null); - break; - case "script": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Script)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilter)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.IntervalsFilterConverter))] public sealed partial class IntervalsFilter { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsFuzzy.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsFuzzy.Converters.g.cs new file mode 100644 index 00000000000..b0c922b77cd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsFuzzy.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class IntervalsFuzzyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropFuzziness = System.Text.Json.JsonEncodedText.Encode("fuzziness"); + private static readonly System.Text.Json.JsonEncodedText PropPrefixLength = System.Text.Json.JsonEncodedText.Encode("prefix_length"); + private static readonly System.Text.Json.JsonEncodedText PropTerm = System.Text.Json.JsonEncodedText.Encode("term"); + private static readonly System.Text.Json.JsonEncodedText PropTranspositions = System.Text.Json.JsonEncodedText.Encode("transpositions"); + private static readonly System.Text.Json.JsonEncodedText PropUseField = System.Text.Json.JsonEncodedText.Encode("use_field"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFuzzy Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzer = default; + LocalJsonValue propFuzziness = default; + LocalJsonValue propPrefixLength = default; + LocalJsonValue propTerm = default; + LocalJsonValue propTranspositions = default; + LocalJsonValue propUseField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) + { + continue; + } + + if (propFuzziness.TryReadProperty(ref reader, options, PropFuzziness, null)) + { + continue; + } + + if (propPrefixLength.TryReadProperty(ref reader, options, PropPrefixLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTerm.TryReadProperty(ref reader, options, PropTerm, null)) + { + continue; + } + + if (propTranspositions.TryReadProperty(ref reader, options, PropTranspositions, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propUseField.TryReadProperty(ref reader, options, PropUseField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFuzzy(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analyzer = propAnalyzer.Value, + Fuzziness = propFuzziness.Value, + PrefixLength = propPrefixLength.Value, + Term = propTerm.Value, + Transpositions = propTranspositions.Value, + UseField = propUseField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFuzzy value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); + writer.WriteProperty(options, PropFuzziness, value.Fuzziness, null, null); + writer.WriteProperty(options, PropPrefixLength, value.PrefixLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTerm, value.Term, null, null); + writer.WriteProperty(options, PropTranspositions, value.Transpositions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropUseField, value.UseField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsFuzzy.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsFuzzy.g.cs index 72a3f510a05..def68ef46f5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsFuzzy.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsFuzzy.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class IntervalsFuzzyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropFuzziness = System.Text.Json.JsonEncodedText.Encode("fuzziness"); - private static readonly System.Text.Json.JsonEncodedText PropPrefixLength = System.Text.Json.JsonEncodedText.Encode("prefix_length"); - private static readonly System.Text.Json.JsonEncodedText PropTerm = System.Text.Json.JsonEncodedText.Encode("term"); - private static readonly System.Text.Json.JsonEncodedText PropTranspositions = System.Text.Json.JsonEncodedText.Encode("transpositions"); - private static readonly System.Text.Json.JsonEncodedText PropUseField = System.Text.Json.JsonEncodedText.Encode("use_field"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFuzzy Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyzer = default; - LocalJsonValue propFuzziness = default; - LocalJsonValue propPrefixLength = default; - LocalJsonValue propTerm = default; - LocalJsonValue propTranspositions = default; - LocalJsonValue propUseField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) - { - continue; - } - - if (propFuzziness.TryReadProperty(ref reader, options, PropFuzziness, null)) - { - continue; - } - - if (propPrefixLength.TryReadProperty(ref reader, options, PropPrefixLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTerm.TryReadProperty(ref reader, options, PropTerm, null)) - { - continue; - } - - if (propTranspositions.TryReadProperty(ref reader, options, PropTranspositions, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propUseField.TryReadProperty(ref reader, options, PropUseField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFuzzy(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analyzer = propAnalyzer.Value, - Fuzziness = propFuzziness.Value, - PrefixLength = propPrefixLength.Value, - Term = propTerm.Value, - Transpositions = propTranspositions.Value, - UseField = propUseField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFuzzy value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); - writer.WriteProperty(options, PropFuzziness, value.Fuzziness, null, null); - writer.WriteProperty(options, PropPrefixLength, value.PrefixLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTerm, value.Term, null, null); - writer.WriteProperty(options, PropTranspositions, value.Transpositions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropUseField, value.UseField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFuzzyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.IntervalsFuzzyConverter))] public sealed partial class IntervalsFuzzy { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsMatch.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsMatch.Converters.g.cs new file mode 100644 index 00000000000..2549888e788 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsMatch.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class IntervalsMatchConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropMaxGaps = System.Text.Json.JsonEncodedText.Encode("max_gaps"); + private static readonly System.Text.Json.JsonEncodedText PropOrdered = System.Text.Json.JsonEncodedText.Encode("ordered"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropUseField = System.Text.Json.JsonEncodedText.Encode("use_field"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.IntervalsMatch Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzer = default; + LocalJsonValue propFilter = default; + LocalJsonValue propMaxGaps = default; + LocalJsonValue propOrdered = default; + LocalJsonValue propQuery = default; + LocalJsonValue propUseField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) + { + continue; + } + + if (propMaxGaps.TryReadProperty(ref reader, options, PropMaxGaps, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOrdered.TryReadProperty(ref reader, options, PropOrdered, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propUseField.TryReadProperty(ref reader, options, PropUseField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsMatch(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analyzer = propAnalyzer.Value, + Filter = propFilter.Value, + MaxGaps = propMaxGaps.Value, + Ordered = propOrdered.Value, + Query = propQuery.Value, + UseField = propUseField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IntervalsMatch value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); + writer.WriteProperty(options, PropFilter, value.Filter, null, null); + writer.WriteProperty(options, PropMaxGaps, value.MaxGaps, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOrdered, value.Ordered, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropUseField, value.UseField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsMatch.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsMatch.g.cs index d7f656a56f3..afcb658cab2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsMatch.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsMatch.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class IntervalsMatchConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropMaxGaps = System.Text.Json.JsonEncodedText.Encode("max_gaps"); - private static readonly System.Text.Json.JsonEncodedText PropOrdered = System.Text.Json.JsonEncodedText.Encode("ordered"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropUseField = System.Text.Json.JsonEncodedText.Encode("use_field"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.IntervalsMatch Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyzer = default; - LocalJsonValue propFilter = default; - LocalJsonValue propMaxGaps = default; - LocalJsonValue propOrdered = default; - LocalJsonValue propQuery = default; - LocalJsonValue propUseField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, null)) - { - continue; - } - - if (propMaxGaps.TryReadProperty(ref reader, options, PropMaxGaps, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOrdered.TryReadProperty(ref reader, options, PropOrdered, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propUseField.TryReadProperty(ref reader, options, PropUseField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsMatch(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analyzer = propAnalyzer.Value, - Filter = propFilter.Value, - MaxGaps = propMaxGaps.Value, - Ordered = propOrdered.Value, - Query = propQuery.Value, - UseField = propUseField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IntervalsMatch value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); - writer.WriteProperty(options, PropFilter, value.Filter, null, null); - writer.WriteProperty(options, PropMaxGaps, value.MaxGaps, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOrdered, value.Ordered, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropUseField, value.UseField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsMatchConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.IntervalsMatchConverter))] public sealed partial class IntervalsMatch { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsPrefix.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsPrefix.Converters.g.cs new file mode 100644 index 00000000000..571ea6a7515 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsPrefix.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class IntervalsPrefixConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropPrefix = System.Text.Json.JsonEncodedText.Encode("prefix"); + private static readonly System.Text.Json.JsonEncodedText PropUseField = System.Text.Json.JsonEncodedText.Encode("use_field"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.IntervalsPrefix Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzer = default; + LocalJsonValue propPrefix = default; + LocalJsonValue propUseField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) + { + continue; + } + + if (propPrefix.TryReadProperty(ref reader, options, PropPrefix, null)) + { + continue; + } + + if (propUseField.TryReadProperty(ref reader, options, PropUseField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsPrefix(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analyzer = propAnalyzer.Value, + Prefix = propPrefix.Value, + UseField = propUseField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IntervalsPrefix value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); + writer.WriteProperty(options, PropPrefix, value.Prefix, null, null); + writer.WriteProperty(options, PropUseField, value.UseField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsPrefix.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsPrefix.g.cs index d353c7cdc98..5ab48750adb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsPrefix.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsPrefix.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class IntervalsPrefixConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropPrefix = System.Text.Json.JsonEncodedText.Encode("prefix"); - private static readonly System.Text.Json.JsonEncodedText PropUseField = System.Text.Json.JsonEncodedText.Encode("use_field"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.IntervalsPrefix Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyzer = default; - LocalJsonValue propPrefix = default; - LocalJsonValue propUseField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) - { - continue; - } - - if (propPrefix.TryReadProperty(ref reader, options, PropPrefix, null)) - { - continue; - } - - if (propUseField.TryReadProperty(ref reader, options, PropUseField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsPrefix(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analyzer = propAnalyzer.Value, - Prefix = propPrefix.Value, - UseField = propUseField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IntervalsPrefix value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); - writer.WriteProperty(options, PropPrefix, value.Prefix, null, null); - writer.WriteProperty(options, PropUseField, value.UseField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsPrefixConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.IntervalsPrefixConverter))] public sealed partial class IntervalsPrefix { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsQuery.Converters.g.cs new file mode 100644 index 00000000000..de6c7a8482f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsQuery.Converters.g.cs @@ -0,0 +1,191 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class IntervalsQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText VariantAllOf = System.Text.Json.JsonEncodedText.Encode("all_of"); + private static readonly System.Text.Json.JsonEncodedText VariantAnyOf = System.Text.Json.JsonEncodedText.Encode("any_of"); + private static readonly System.Text.Json.JsonEncodedText VariantFuzzy = System.Text.Json.JsonEncodedText.Encode("fuzzy"); + private static readonly System.Text.Json.JsonEncodedText VariantMatch = System.Text.Json.JsonEncodedText.Encode("match"); + private static readonly System.Text.Json.JsonEncodedText VariantPrefix = System.Text.Json.JsonEncodedText.Encode("prefix"); + private static readonly System.Text.Json.JsonEncodedText VariantRange = System.Text.Json.JsonEncodedText.Encode("range"); + private static readonly System.Text.Json.JsonEncodedText VariantRegexp = System.Text.Json.JsonEncodedText.Encode("regexp"); + private static readonly System.Text.Json.JsonEncodedText VariantWildcard = System.Text.Json.JsonEncodedText.Encode("wildcard"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.IntervalsQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + reader.Read(); + propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propQueryName = default; + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (reader.ValueTextEquals(VariantAllOf)) + { + variantType = VariantAllOf.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantAnyOf)) + { + variantType = VariantAnyOf.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantFuzzy)) + { + variantType = VariantFuzzy.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMatch)) + { + variantType = VariantMatch.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantPrefix)) + { + variantType = VariantPrefix.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRange)) + { + variantType = VariantRange.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRegexp)) + { + variantType = VariantRegexp.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantWildcard)) + { + variantType = VariantWildcard.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant, + Boost = propBoost.Value, + Field = propField.Value, + QueryName = propQueryName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IntervalsQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "all_of": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAllOf)value.Variant, null, null); + break; + case "any_of": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAnyOf)value.Variant, null, null); + break; + case "fuzzy": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFuzzy)value.Variant, null, null); + break; + case "match": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsMatch)value.Variant, null, null); + break; + case "prefix": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsPrefix)value.Variant, null, null); + break; + case "range": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsRange)value.Variant, null, null); + break; + case "regexp": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsRegexp)value.Variant, null, null); + break; + case "wildcard": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsWildcard)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsQuery)}'."); + } + + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsQuery.g.cs index 61eac390441..0fc4de2cebf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsQuery.g.cs @@ -23,174 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class IntervalsQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText VariantAllOf = System.Text.Json.JsonEncodedText.Encode("all_of"); - private static readonly System.Text.Json.JsonEncodedText VariantAnyOf = System.Text.Json.JsonEncodedText.Encode("any_of"); - private static readonly System.Text.Json.JsonEncodedText VariantFuzzy = System.Text.Json.JsonEncodedText.Encode("fuzzy"); - private static readonly System.Text.Json.JsonEncodedText VariantMatch = System.Text.Json.JsonEncodedText.Encode("match"); - private static readonly System.Text.Json.JsonEncodedText VariantPrefix = System.Text.Json.JsonEncodedText.Encode("prefix"); - private static readonly System.Text.Json.JsonEncodedText VariantRange = System.Text.Json.JsonEncodedText.Encode("range"); - private static readonly System.Text.Json.JsonEncodedText VariantRegexp = System.Text.Json.JsonEncodedText.Encode("regexp"); - private static readonly System.Text.Json.JsonEncodedText VariantWildcard = System.Text.Json.JsonEncodedText.Encode("wildcard"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.IntervalsQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - reader.Read(); - propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propQueryName = default; - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (reader.ValueTextEquals(VariantAllOf)) - { - variantType = VariantAllOf.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantAnyOf)) - { - variantType = VariantAnyOf.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantFuzzy)) - { - variantType = VariantFuzzy.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMatch)) - { - variantType = VariantMatch.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantPrefix)) - { - variantType = VariantPrefix.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRange)) - { - variantType = VariantRange.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRegexp)) - { - variantType = VariantRegexp.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantWildcard)) - { - variantType = VariantWildcard.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant, - Boost = propBoost.Value, - Field = propField.Value, - QueryName = propQueryName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IntervalsQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "all_of": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAllOf)value.Variant, null, null); - break; - case "any_of": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsAnyOf)value.Variant, null, null); - break; - case "fuzzy": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsFuzzy)value.Variant, null, null); - break; - case "match": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsMatch)value.Variant, null, null); - break; - case "prefix": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsPrefix)value.Variant, null, null); - break; - case "range": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsRange)value.Variant, null, null); - break; - case "regexp": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsRegexp)value.Variant, null, null); - break; - case "wildcard": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsWildcard)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsQuery)}'."); - } - - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteEndObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.IntervalsQueryConverter))] public sealed partial class IntervalsQuery { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsRange.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsRange.Converters.g.cs new file mode 100644 index 00000000000..bd1531538e7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsRange.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class IntervalsRangeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropGt = System.Text.Json.JsonEncodedText.Encode("gt"); + private static readonly System.Text.Json.JsonEncodedText PropGte = System.Text.Json.JsonEncodedText.Encode("gte"); + private static readonly System.Text.Json.JsonEncodedText PropLt = System.Text.Json.JsonEncodedText.Encode("lt"); + private static readonly System.Text.Json.JsonEncodedText PropLte = System.Text.Json.JsonEncodedText.Encode("lte"); + private static readonly System.Text.Json.JsonEncodedText PropUseField = System.Text.Json.JsonEncodedText.Encode("use_field"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.IntervalsRange Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzer = default; + LocalJsonValue propGt = default; + LocalJsonValue propGte = default; + LocalJsonValue propLt = default; + LocalJsonValue propLte = default; + LocalJsonValue propUseField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) + { + continue; + } + + if (propGt.TryReadProperty(ref reader, options, PropGt, null)) + { + continue; + } + + if (propGte.TryReadProperty(ref reader, options, PropGte, null)) + { + continue; + } + + if (propLt.TryReadProperty(ref reader, options, PropLt, null)) + { + continue; + } + + if (propLte.TryReadProperty(ref reader, options, PropLte, null)) + { + continue; + } + + if (propUseField.TryReadProperty(ref reader, options, PropUseField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsRange(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analyzer = propAnalyzer.Value, + Gt = propGt.Value, + Gte = propGte.Value, + Lt = propLt.Value, + Lte = propLte.Value, + UseField = propUseField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IntervalsRange value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); + writer.WriteProperty(options, PropGt, value.Gt, null, null); + writer.WriteProperty(options, PropGte, value.Gte, null, null); + writer.WriteProperty(options, PropLt, value.Lt, null, null); + writer.WriteProperty(options, PropLte, value.Lte, null, null); + writer.WriteProperty(options, PropUseField, value.UseField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsRange.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsRange.g.cs index cc4dce9a79d..73350bdc880 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsRange.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsRange.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class IntervalsRangeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropGt = System.Text.Json.JsonEncodedText.Encode("gt"); - private static readonly System.Text.Json.JsonEncodedText PropGte = System.Text.Json.JsonEncodedText.Encode("gte"); - private static readonly System.Text.Json.JsonEncodedText PropLt = System.Text.Json.JsonEncodedText.Encode("lt"); - private static readonly System.Text.Json.JsonEncodedText PropLte = System.Text.Json.JsonEncodedText.Encode("lte"); - private static readonly System.Text.Json.JsonEncodedText PropUseField = System.Text.Json.JsonEncodedText.Encode("use_field"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.IntervalsRange Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyzer = default; - LocalJsonValue propGt = default; - LocalJsonValue propGte = default; - LocalJsonValue propLt = default; - LocalJsonValue propLte = default; - LocalJsonValue propUseField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) - { - continue; - } - - if (propGt.TryReadProperty(ref reader, options, PropGt, null)) - { - continue; - } - - if (propGte.TryReadProperty(ref reader, options, PropGte, null)) - { - continue; - } - - if (propLt.TryReadProperty(ref reader, options, PropLt, null)) - { - continue; - } - - if (propLte.TryReadProperty(ref reader, options, PropLte, null)) - { - continue; - } - - if (propUseField.TryReadProperty(ref reader, options, PropUseField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsRange(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analyzer = propAnalyzer.Value, - Gt = propGt.Value, - Gte = propGte.Value, - Lt = propLt.Value, - Lte = propLte.Value, - UseField = propUseField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IntervalsRange value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); - writer.WriteProperty(options, PropGt, value.Gt, null, null); - writer.WriteProperty(options, PropGte, value.Gte, null, null); - writer.WriteProperty(options, PropLt, value.Lt, null, null); - writer.WriteProperty(options, PropLte, value.Lte, null, null); - writer.WriteProperty(options, PropUseField, value.UseField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsRangeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.IntervalsRangeConverter))] public sealed partial class IntervalsRange { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsRegexp.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsRegexp.Converters.g.cs new file mode 100644 index 00000000000..a452ed1a2fc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsRegexp.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class IntervalsRegexpConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropPattern = System.Text.Json.JsonEncodedText.Encode("pattern"); + private static readonly System.Text.Json.JsonEncodedText PropUseField = System.Text.Json.JsonEncodedText.Encode("use_field"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.IntervalsRegexp Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzer = default; + LocalJsonValue propPattern = default; + LocalJsonValue propUseField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) + { + continue; + } + + if (propPattern.TryReadProperty(ref reader, options, PropPattern, null)) + { + continue; + } + + if (propUseField.TryReadProperty(ref reader, options, PropUseField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsRegexp(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analyzer = propAnalyzer.Value, + Pattern = propPattern.Value, + UseField = propUseField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IntervalsRegexp value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); + writer.WriteProperty(options, PropPattern, value.Pattern, null, null); + writer.WriteProperty(options, PropUseField, value.UseField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsRegexp.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsRegexp.g.cs index e80b18399bd..d83c92e7cdd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsRegexp.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsRegexp.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class IntervalsRegexpConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropPattern = System.Text.Json.JsonEncodedText.Encode("pattern"); - private static readonly System.Text.Json.JsonEncodedText PropUseField = System.Text.Json.JsonEncodedText.Encode("use_field"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.IntervalsRegexp Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyzer = default; - LocalJsonValue propPattern = default; - LocalJsonValue propUseField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) - { - continue; - } - - if (propPattern.TryReadProperty(ref reader, options, PropPattern, null)) - { - continue; - } - - if (propUseField.TryReadProperty(ref reader, options, PropUseField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsRegexp(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analyzer = propAnalyzer.Value, - Pattern = propPattern.Value, - UseField = propUseField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IntervalsRegexp value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); - writer.WriteProperty(options, PropPattern, value.Pattern, null, null); - writer.WriteProperty(options, PropUseField, value.UseField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsRegexpConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.IntervalsRegexpConverter))] public sealed partial class IntervalsRegexp { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsWildcard.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsWildcard.Converters.g.cs new file mode 100644 index 00000000000..c8895b67f02 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsWildcard.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class IntervalsWildcardConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropPattern = System.Text.Json.JsonEncodedText.Encode("pattern"); + private static readonly System.Text.Json.JsonEncodedText PropUseField = System.Text.Json.JsonEncodedText.Encode("use_field"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.IntervalsWildcard Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzer = default; + LocalJsonValue propPattern = default; + LocalJsonValue propUseField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) + { + continue; + } + + if (propPattern.TryReadProperty(ref reader, options, PropPattern, null)) + { + continue; + } + + if (propUseField.TryReadProperty(ref reader, options, PropUseField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsWildcard(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analyzer = propAnalyzer.Value, + Pattern = propPattern.Value, + UseField = propUseField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IntervalsWildcard value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); + writer.WriteProperty(options, PropPattern, value.Pattern, null, null); + writer.WriteProperty(options, PropUseField, value.UseField, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsWildcard.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsWildcard.g.cs index d15bccb1e00..077b33427de 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsWildcard.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/IntervalsWildcard.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class IntervalsWildcardConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropPattern = System.Text.Json.JsonEncodedText.Encode("pattern"); - private static readonly System.Text.Json.JsonEncodedText PropUseField = System.Text.Json.JsonEncodedText.Encode("use_field"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.IntervalsWildcard Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyzer = default; - LocalJsonValue propPattern = default; - LocalJsonValue propUseField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) - { - continue; - } - - if (propPattern.TryReadProperty(ref reader, options, PropPattern, null)) - { - continue; - } - - if (propUseField.TryReadProperty(ref reader, options, PropUseField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.IntervalsWildcard(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analyzer = propAnalyzer.Value, - Pattern = propPattern.Value, - UseField = propUseField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IntervalsWildcard value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); - writer.WriteProperty(options, PropPattern, value.Pattern, null, null); - writer.WriteProperty(options, PropUseField, value.UseField, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.IntervalsWildcardConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.IntervalsWildcardConverter))] public sealed partial class IntervalsWildcard { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Like.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Like.Converters.g.cs new file mode 100644 index 00000000000..424a4114ad0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Like.Converters.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class LikeConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.QueryDsl.Like Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject); + return selector(ref reader, options) switch + { + Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.QueryDsl.Like(reader.ReadValue(options, null)), + Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.QueryDsl.Like(reader.ReadValue(options, null)), + _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.Like)}") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.Like value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Tag) + { + case Elastic.Clients.Elasticsearch.UnionTag.T1: + { + writer.WriteValue(options, value.Value1, null); + break; + } + + case Elastic.Clients.Elasticsearch.UnionTag.T2: + { + writer.WriteValue(options, value.Value2, null); + break; + } + + default: + throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Like.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Like.g.cs index ad70553788e..342a2cf83e8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Like.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Like.g.cs @@ -23,48 +23,13 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class LikeConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.QueryDsl.Like Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject); - return selector(ref reader, options) switch - { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.QueryDsl.Like(reader.ReadValue(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.QueryDsl.Like(reader.ReadValue(options, null)), - _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.Like)}") - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.Like value, System.Text.Json.JsonSerializerOptions options) - { - switch (value.Tag) - { - case Elastic.Clients.Elasticsearch.UnionTag.T1: - { - writer.WriteValue(options, value.Value1, null); - break; - } - - case Elastic.Clients.Elasticsearch.UnionTag.T2: - { - writer.WriteValue(options, value.Value2, null); - break; - } - - default: - throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); - } - } -} - /// /// /// Text that we want similar documents for or a lookup to a document's field for the text. /// /// Learn more about this API in the Elasticsearch documentation. /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.LikeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.LikeConverter))] public sealed partial class Like : Elastic.Clients.Elasticsearch.Union { public Like(string value) : base(value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/LikeDocument.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/LikeDocument.Converters.g.cs new file mode 100644 index 00000000000..241d6d8a4b1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/LikeDocument.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class LikeDocumentConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDoc = System.Text.Json.JsonEncodedText.Encode("doc"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); + private static readonly System.Text.Json.JsonEncodedText PropPerFieldAnalyzer = System.Text.Json.JsonEncodedText.Encode("per_field_analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + private static readonly System.Text.Json.JsonEncodedText PropVersionType = System.Text.Json.JsonEncodedText.Encode("version_type"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.LikeDocument Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDoc = default; + LocalJsonValue propFields = default; + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + LocalJsonValue?> propPerFieldAnalyzer = default; + LocalJsonValue propRouting = default; + LocalJsonValue propVersion = default; + LocalJsonValue propVersionType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDoc.TryReadProperty(ref reader, options, PropDoc, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propPerFieldAnalyzer.TryReadProperty(ref reader, options, PropPerFieldAnalyzer, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propVersionType.TryReadProperty(ref reader, options, PropVersionType, static Elastic.Clients.Elasticsearch.VersionType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.LikeDocument(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Doc = propDoc.Value, + Fields = propFields.Value, + Id = propId.Value, + Index = propIndex.Value, + PerFieldAnalyzer = propPerFieldAnalyzer.Value, + Routing = propRouting.Value, + Version = propVersion.Value, + VersionType = propVersionType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.LikeDocument value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDoc, value.Doc, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropPerFieldAnalyzer, value.PerFieldAnalyzer, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVersionType, value.VersionType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.VersionType? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/LikeDocument.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/LikeDocument.g.cs index 73e7bcdb99a..047f4850a55 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/LikeDocument.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/LikeDocument.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class LikeDocumentConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDoc = System.Text.Json.JsonEncodedText.Encode("doc"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); - private static readonly System.Text.Json.JsonEncodedText PropPerFieldAnalyzer = System.Text.Json.JsonEncodedText.Encode("per_field_analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - private static readonly System.Text.Json.JsonEncodedText PropVersionType = System.Text.Json.JsonEncodedText.Encode("version_type"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.LikeDocument Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDoc = default; - LocalJsonValue propFields = default; - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - LocalJsonValue?> propPerFieldAnalyzer = default; - LocalJsonValue propRouting = default; - LocalJsonValue propVersion = default; - LocalJsonValue propVersionType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDoc.TryReadProperty(ref reader, options, PropDoc, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propPerFieldAnalyzer.TryReadProperty(ref reader, options, PropPerFieldAnalyzer, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propVersionType.TryReadProperty(ref reader, options, PropVersionType, static Elastic.Clients.Elasticsearch.VersionType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.LikeDocument(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Doc = propDoc.Value, - Fields = propFields.Value, - Id = propId.Value, - Index = propIndex.Value, - PerFieldAnalyzer = propPerFieldAnalyzer.Value, - Routing = propRouting.Value, - Version = propVersion.Value, - VersionType = propVersionType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.LikeDocument value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDoc, value.Doc, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropPerFieldAnalyzer, value.PerFieldAnalyzer, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropVersionType, value.VersionType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.VersionType? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.LikeDocumentConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.LikeDocumentConverter))] public sealed partial class LikeDocument { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchAllQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchAllQuery.Converters.g.cs new file mode 100644 index 00000000000..1cff8a7e2ff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchAllQuery.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class MatchAllQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.MatchAllQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propQueryName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.MatchAllQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + QueryName = propQueryName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.MatchAllQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchAllQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchAllQuery.g.cs index ff7dff9f253..de03f41e090 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchAllQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchAllQuery.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class MatchAllQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.MatchAllQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propQueryName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.MatchAllQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - QueryName = propQueryName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.MatchAllQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.MatchAllQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.MatchAllQueryConverter))] public sealed partial class MatchAllQuery { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchBoolPrefixQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchBoolPrefixQuery.Converters.g.cs new file mode 100644 index 00000000000..30b8b197dda --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchBoolPrefixQuery.Converters.g.cs @@ -0,0 +1,175 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class MatchBoolPrefixQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropFuzziness = System.Text.Json.JsonEncodedText.Encode("fuzziness"); + private static readonly System.Text.Json.JsonEncodedText PropFuzzyRewrite = System.Text.Json.JsonEncodedText.Encode("fuzzy_rewrite"); + private static readonly System.Text.Json.JsonEncodedText PropFuzzyTranspositions = System.Text.Json.JsonEncodedText.Encode("fuzzy_transpositions"); + private static readonly System.Text.Json.JsonEncodedText PropMaxExpansions = System.Text.Json.JsonEncodedText.Encode("max_expansions"); + private static readonly System.Text.Json.JsonEncodedText PropMinimumShouldMatch = System.Text.Json.JsonEncodedText.Encode("minimum_should_match"); + private static readonly System.Text.Json.JsonEncodedText PropOperator = System.Text.Json.JsonEncodedText.Encode("operator"); + private static readonly System.Text.Json.JsonEncodedText PropPrefixLength = System.Text.Json.JsonEncodedText.Encode("prefix_length"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.MatchBoolPrefixQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + reader.Read(); + propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); + reader.Read(); + if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) + { + var value = reader.ReadValue(options, null); + reader.Read(); + return new Elastic.Clients.Elasticsearch.QueryDsl.MatchBoolPrefixQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Query = value + }; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzer = default; + LocalJsonValue propBoost = default; + LocalJsonValue propFuzziness = default; + LocalJsonValue propFuzzyRewrite = default; + LocalJsonValue propFuzzyTranspositions = default; + LocalJsonValue propMaxExpansions = default; + LocalJsonValue propMinimumShouldMatch = default; + LocalJsonValue propOperator = default; + LocalJsonValue propPrefixLength = default; + LocalJsonValue propQuery = default; + LocalJsonValue propQueryName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) + { + continue; + } + + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFuzziness.TryReadProperty(ref reader, options, PropFuzziness, null)) + { + continue; + } + + if (propFuzzyRewrite.TryReadProperty(ref reader, options, PropFuzzyRewrite, null)) + { + continue; + } + + if (propFuzzyTranspositions.TryReadProperty(ref reader, options, PropFuzzyTranspositions, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxExpansions.TryReadProperty(ref reader, options, PropMaxExpansions, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinimumShouldMatch.TryReadProperty(ref reader, options, PropMinimumShouldMatch, null)) + { + continue; + } + + if (propOperator.TryReadProperty(ref reader, options, PropOperator, static Elastic.Clients.Elasticsearch.QueryDsl.Operator? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPrefixLength.TryReadProperty(ref reader, options, PropPrefixLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.MatchBoolPrefixQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analyzer = propAnalyzer.Value, + Boost = propBoost.Value, + Field = propField.Value, + Fuzziness = propFuzziness.Value, + FuzzyRewrite = propFuzzyRewrite.Value, + FuzzyTranspositions = propFuzzyTranspositions.Value, + MaxExpansions = propMaxExpansions.Value, + MinimumShouldMatch = propMinimumShouldMatch.Value, + Operator = propOperator.Value, + PrefixLength = propPrefixLength.Value, + Query = propQuery.Value, + QueryName = propQueryName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.MatchBoolPrefixQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFuzziness, value.Fuzziness, null, null); + writer.WriteProperty(options, PropFuzzyRewrite, value.FuzzyRewrite, null, null); + writer.WriteProperty(options, PropFuzzyTranspositions, value.FuzzyTranspositions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxExpansions, value.MaxExpansions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinimumShouldMatch, value.MinimumShouldMatch, null, null); + writer.WriteProperty(options, PropOperator, value.Operator, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.Operator? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPrefixLength, value.PrefixLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchBoolPrefixQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchBoolPrefixQuery.g.cs index b4ef31aaecd..5eca227a015 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchBoolPrefixQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchBoolPrefixQuery.g.cs @@ -23,158 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class MatchBoolPrefixQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropFuzziness = System.Text.Json.JsonEncodedText.Encode("fuzziness"); - private static readonly System.Text.Json.JsonEncodedText PropFuzzyRewrite = System.Text.Json.JsonEncodedText.Encode("fuzzy_rewrite"); - private static readonly System.Text.Json.JsonEncodedText PropFuzzyTranspositions = System.Text.Json.JsonEncodedText.Encode("fuzzy_transpositions"); - private static readonly System.Text.Json.JsonEncodedText PropMaxExpansions = System.Text.Json.JsonEncodedText.Encode("max_expansions"); - private static readonly System.Text.Json.JsonEncodedText PropMinimumShouldMatch = System.Text.Json.JsonEncodedText.Encode("minimum_should_match"); - private static readonly System.Text.Json.JsonEncodedText PropOperator = System.Text.Json.JsonEncodedText.Encode("operator"); - private static readonly System.Text.Json.JsonEncodedText PropPrefixLength = System.Text.Json.JsonEncodedText.Encode("prefix_length"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.MatchBoolPrefixQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - reader.Read(); - propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); - reader.Read(); - if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) - { - var value = reader.ReadValue(options, null); - reader.Read(); - return new Elastic.Clients.Elasticsearch.QueryDsl.MatchBoolPrefixQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Query = value - }; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyzer = default; - LocalJsonValue propBoost = default; - LocalJsonValue propFuzziness = default; - LocalJsonValue propFuzzyRewrite = default; - LocalJsonValue propFuzzyTranspositions = default; - LocalJsonValue propMaxExpansions = default; - LocalJsonValue propMinimumShouldMatch = default; - LocalJsonValue propOperator = default; - LocalJsonValue propPrefixLength = default; - LocalJsonValue propQuery = default; - LocalJsonValue propQueryName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) - { - continue; - } - - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFuzziness.TryReadProperty(ref reader, options, PropFuzziness, null)) - { - continue; - } - - if (propFuzzyRewrite.TryReadProperty(ref reader, options, PropFuzzyRewrite, null)) - { - continue; - } - - if (propFuzzyTranspositions.TryReadProperty(ref reader, options, PropFuzzyTranspositions, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxExpansions.TryReadProperty(ref reader, options, PropMaxExpansions, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinimumShouldMatch.TryReadProperty(ref reader, options, PropMinimumShouldMatch, null)) - { - continue; - } - - if (propOperator.TryReadProperty(ref reader, options, PropOperator, static Elastic.Clients.Elasticsearch.QueryDsl.Operator? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPrefixLength.TryReadProperty(ref reader, options, PropPrefixLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.MatchBoolPrefixQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analyzer = propAnalyzer.Value, - Boost = propBoost.Value, - Field = propField.Value, - Fuzziness = propFuzziness.Value, - FuzzyRewrite = propFuzzyRewrite.Value, - FuzzyTranspositions = propFuzzyTranspositions.Value, - MaxExpansions = propMaxExpansions.Value, - MinimumShouldMatch = propMinimumShouldMatch.Value, - Operator = propOperator.Value, - PrefixLength = propPrefixLength.Value, - Query = propQuery.Value, - QueryName = propQueryName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.MatchBoolPrefixQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFuzziness, value.Fuzziness, null, null); - writer.WriteProperty(options, PropFuzzyRewrite, value.FuzzyRewrite, null, null); - writer.WriteProperty(options, PropFuzzyTranspositions, value.FuzzyTranspositions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxExpansions, value.MaxExpansions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinimumShouldMatch, value.MinimumShouldMatch, null, null); - writer.WriteProperty(options, PropOperator, value.Operator, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.Operator? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPrefixLength, value.PrefixLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteEndObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.MatchBoolPrefixQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.MatchBoolPrefixQueryConverter))] public sealed partial class MatchBoolPrefixQuery { [System.Obsolete("The type contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchNoneQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchNoneQuery.Converters.g.cs new file mode 100644 index 00000000000..42d04b4ff4d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchNoneQuery.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class MatchNoneQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.MatchNoneQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propQueryName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.MatchNoneQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + QueryName = propQueryName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.MatchNoneQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchNoneQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchNoneQuery.g.cs index 0d65ccc58c8..d2d7e4bd6cd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchNoneQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchNoneQuery.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class MatchNoneQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.MatchNoneQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propQueryName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.MatchNoneQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - QueryName = propQueryName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.MatchNoneQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.MatchNoneQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.MatchNoneQueryConverter))] public sealed partial class MatchNoneQuery { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchPhrasePrefixQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchPhrasePrefixQuery.Converters.g.cs new file mode 100644 index 00000000000..9bcd81a6fa4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchPhrasePrefixQuery.Converters.g.cs @@ -0,0 +1,139 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class MatchPhrasePrefixQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropMaxExpansions = System.Text.Json.JsonEncodedText.Encode("max_expansions"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropSlop = System.Text.Json.JsonEncodedText.Encode("slop"); + private static readonly System.Text.Json.JsonEncodedText PropZeroTermsQuery = System.Text.Json.JsonEncodedText.Encode("zero_terms_query"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.MatchPhrasePrefixQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + reader.Read(); + propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); + reader.Read(); + if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) + { + var value = reader.ReadValue(options, null); + reader.Read(); + return new Elastic.Clients.Elasticsearch.QueryDsl.MatchPhrasePrefixQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Query = value + }; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzer = default; + LocalJsonValue propBoost = default; + LocalJsonValue propMaxExpansions = default; + LocalJsonValue propQuery = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propSlop = default; + LocalJsonValue propZeroTermsQuery = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) + { + continue; + } + + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxExpansions.TryReadProperty(ref reader, options, PropMaxExpansions, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propSlop.TryReadProperty(ref reader, options, PropSlop, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propZeroTermsQuery.TryReadProperty(ref reader, options, PropZeroTermsQuery, static Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.MatchPhrasePrefixQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analyzer = propAnalyzer.Value, + Boost = propBoost.Value, + Field = propField.Value, + MaxExpansions = propMaxExpansions.Value, + Query = propQuery.Value, + QueryName = propQueryName.Value, + Slop = propSlop.Value, + ZeroTermsQuery = propZeroTermsQuery.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.MatchPhrasePrefixQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxExpansions, value.MaxExpansions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropSlop, value.Slop, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropZeroTermsQuery, value.ZeroTermsQuery, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchPhrasePrefixQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchPhrasePrefixQuery.g.cs index cce84a4dacb..087e7099f35 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchPhrasePrefixQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchPhrasePrefixQuery.g.cs @@ -23,122 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class MatchPhrasePrefixQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropMaxExpansions = System.Text.Json.JsonEncodedText.Encode("max_expansions"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropSlop = System.Text.Json.JsonEncodedText.Encode("slop"); - private static readonly System.Text.Json.JsonEncodedText PropZeroTermsQuery = System.Text.Json.JsonEncodedText.Encode("zero_terms_query"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.MatchPhrasePrefixQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - reader.Read(); - propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); - reader.Read(); - if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) - { - var value = reader.ReadValue(options, null); - reader.Read(); - return new Elastic.Clients.Elasticsearch.QueryDsl.MatchPhrasePrefixQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Query = value - }; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyzer = default; - LocalJsonValue propBoost = default; - LocalJsonValue propMaxExpansions = default; - LocalJsonValue propQuery = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propSlop = default; - LocalJsonValue propZeroTermsQuery = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) - { - continue; - } - - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxExpansions.TryReadProperty(ref reader, options, PropMaxExpansions, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propSlop.TryReadProperty(ref reader, options, PropSlop, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propZeroTermsQuery.TryReadProperty(ref reader, options, PropZeroTermsQuery, static Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.MatchPhrasePrefixQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analyzer = propAnalyzer.Value, - Boost = propBoost.Value, - Field = propField.Value, - MaxExpansions = propMaxExpansions.Value, - Query = propQuery.Value, - QueryName = propQueryName.Value, - Slop = propSlop.Value, - ZeroTermsQuery = propZeroTermsQuery.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.MatchPhrasePrefixQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxExpansions, value.MaxExpansions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropSlop, value.Slop, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropZeroTermsQuery, value.ZeroTermsQuery, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.MatchPhrasePrefixQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.MatchPhrasePrefixQueryConverter))] public sealed partial class MatchPhrasePrefixQuery { [System.Obsolete("The type contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchPhraseQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchPhraseQuery.Converters.g.cs new file mode 100644 index 00000000000..4e729e534ae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchPhraseQuery.Converters.g.cs @@ -0,0 +1,130 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class MatchPhraseQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropSlop = System.Text.Json.JsonEncodedText.Encode("slop"); + private static readonly System.Text.Json.JsonEncodedText PropZeroTermsQuery = System.Text.Json.JsonEncodedText.Encode("zero_terms_query"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.MatchPhraseQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + reader.Read(); + propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); + reader.Read(); + if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) + { + var value = reader.ReadValue(options, null); + reader.Read(); + return new Elastic.Clients.Elasticsearch.QueryDsl.MatchPhraseQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Query = value + }; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzer = default; + LocalJsonValue propBoost = default; + LocalJsonValue propQuery = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propSlop = default; + LocalJsonValue propZeroTermsQuery = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) + { + continue; + } + + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propSlop.TryReadProperty(ref reader, options, PropSlop, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propZeroTermsQuery.TryReadProperty(ref reader, options, PropZeroTermsQuery, static Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.MatchPhraseQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analyzer = propAnalyzer.Value, + Boost = propBoost.Value, + Field = propField.Value, + Query = propQuery.Value, + QueryName = propQueryName.Value, + Slop = propSlop.Value, + ZeroTermsQuery = propZeroTermsQuery.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.MatchPhraseQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropSlop, value.Slop, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropZeroTermsQuery, value.ZeroTermsQuery, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchPhraseQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchPhraseQuery.g.cs index 01cf8f6abfe..8ecf96406b1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchPhraseQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchPhraseQuery.g.cs @@ -23,113 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class MatchPhraseQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropSlop = System.Text.Json.JsonEncodedText.Encode("slop"); - private static readonly System.Text.Json.JsonEncodedText PropZeroTermsQuery = System.Text.Json.JsonEncodedText.Encode("zero_terms_query"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.MatchPhraseQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - reader.Read(); - propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); - reader.Read(); - if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) - { - var value = reader.ReadValue(options, null); - reader.Read(); - return new Elastic.Clients.Elasticsearch.QueryDsl.MatchPhraseQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Query = value - }; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyzer = default; - LocalJsonValue propBoost = default; - LocalJsonValue propQuery = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propSlop = default; - LocalJsonValue propZeroTermsQuery = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) - { - continue; - } - - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propSlop.TryReadProperty(ref reader, options, PropSlop, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propZeroTermsQuery.TryReadProperty(ref reader, options, PropZeroTermsQuery, static Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.MatchPhraseQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analyzer = propAnalyzer.Value, - Boost = propBoost.Value, - Field = propField.Value, - Query = propQuery.Value, - QueryName = propQueryName.Value, - Slop = propSlop.Value, - ZeroTermsQuery = propZeroTermsQuery.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.MatchPhraseQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropSlop, value.Slop, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropZeroTermsQuery, value.ZeroTermsQuery, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.MatchPhraseQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.MatchPhraseQueryConverter))] public sealed partial class MatchPhraseQuery { [System.Obsolete("The type contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchQuery.Converters.g.cs new file mode 100644 index 00000000000..8ec71dfa95b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchQuery.Converters.g.cs @@ -0,0 +1,217 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class MatchQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropAutoGenerateSynonymsPhraseQuery = System.Text.Json.JsonEncodedText.Encode("auto_generate_synonyms_phrase_query"); + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCutoffFrequency = System.Text.Json.JsonEncodedText.Encode("cutoff_frequency"); + private static readonly System.Text.Json.JsonEncodedText PropFuzziness = System.Text.Json.JsonEncodedText.Encode("fuzziness"); + private static readonly System.Text.Json.JsonEncodedText PropFuzzyRewrite = System.Text.Json.JsonEncodedText.Encode("fuzzy_rewrite"); + private static readonly System.Text.Json.JsonEncodedText PropFuzzyTranspositions = System.Text.Json.JsonEncodedText.Encode("fuzzy_transpositions"); + private static readonly System.Text.Json.JsonEncodedText PropLenient = System.Text.Json.JsonEncodedText.Encode("lenient"); + private static readonly System.Text.Json.JsonEncodedText PropMaxExpansions = System.Text.Json.JsonEncodedText.Encode("max_expansions"); + private static readonly System.Text.Json.JsonEncodedText PropMinimumShouldMatch = System.Text.Json.JsonEncodedText.Encode("minimum_should_match"); + private static readonly System.Text.Json.JsonEncodedText PropOperator = System.Text.Json.JsonEncodedText.Encode("operator"); + private static readonly System.Text.Json.JsonEncodedText PropPrefixLength = System.Text.Json.JsonEncodedText.Encode("prefix_length"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropZeroTermsQuery = System.Text.Json.JsonEncodedText.Encode("zero_terms_query"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.MatchQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + reader.Read(); + propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); + reader.Read(); + if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) + { + var value = reader.ReadValue(options, null); + reader.Read(); + return new Elastic.Clients.Elasticsearch.QueryDsl.MatchQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Query = value + }; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzer = default; + LocalJsonValue propAutoGenerateSynonymsPhraseQuery = default; + LocalJsonValue propBoost = default; + LocalJsonValue propCutoffFrequency = default; + LocalJsonValue propFuzziness = default; + LocalJsonValue propFuzzyRewrite = default; + LocalJsonValue propFuzzyTranspositions = default; + LocalJsonValue propLenient = default; + LocalJsonValue propMaxExpansions = default; + LocalJsonValue propMinimumShouldMatch = default; + LocalJsonValue propOperator = default; + LocalJsonValue propPrefixLength = default; + LocalJsonValue propQuery = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propZeroTermsQuery = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) + { + continue; + } + + if (propAutoGenerateSynonymsPhraseQuery.TryReadProperty(ref reader, options, PropAutoGenerateSynonymsPhraseQuery, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCutoffFrequency.TryReadProperty(ref reader, options, PropCutoffFrequency, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFuzziness.TryReadProperty(ref reader, options, PropFuzziness, null)) + { + continue; + } + + if (propFuzzyRewrite.TryReadProperty(ref reader, options, PropFuzzyRewrite, null)) + { + continue; + } + + if (propFuzzyTranspositions.TryReadProperty(ref reader, options, PropFuzzyTranspositions, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLenient.TryReadProperty(ref reader, options, PropLenient, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxExpansions.TryReadProperty(ref reader, options, PropMaxExpansions, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinimumShouldMatch.TryReadProperty(ref reader, options, PropMinimumShouldMatch, null)) + { + continue; + } + + if (propOperator.TryReadProperty(ref reader, options, PropOperator, static Elastic.Clients.Elasticsearch.QueryDsl.Operator? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPrefixLength.TryReadProperty(ref reader, options, PropPrefixLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propZeroTermsQuery.TryReadProperty(ref reader, options, PropZeroTermsQuery, static Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.MatchQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analyzer = propAnalyzer.Value, + AutoGenerateSynonymsPhraseQuery = propAutoGenerateSynonymsPhraseQuery.Value, + Boost = propBoost.Value, +#pragma warning disable CS0618 + CutoffFrequency = propCutoffFrequency.Value +#pragma warning restore CS0618 + , + Field = propField.Value, + Fuzziness = propFuzziness.Value, + FuzzyRewrite = propFuzzyRewrite.Value, + FuzzyTranspositions = propFuzzyTranspositions.Value, + Lenient = propLenient.Value, + MaxExpansions = propMaxExpansions.Value, + MinimumShouldMatch = propMinimumShouldMatch.Value, + Operator = propOperator.Value, + PrefixLength = propPrefixLength.Value, + Query = propQuery.Value, + QueryName = propQueryName.Value, + ZeroTermsQuery = propZeroTermsQuery.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.MatchQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); + writer.WriteProperty(options, PropAutoGenerateSynonymsPhraseQuery, value.AutoGenerateSynonymsPhraseQuery, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); +#pragma warning disable CS0618 + writer.WriteProperty(options, PropCutoffFrequency, value.CutoffFrequency, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)) +#pragma warning restore CS0618 + ; + writer.WriteProperty(options, PropFuzziness, value.Fuzziness, null, null); + writer.WriteProperty(options, PropFuzzyRewrite, value.FuzzyRewrite, null, null); + writer.WriteProperty(options, PropFuzzyTranspositions, value.FuzzyTranspositions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLenient, value.Lenient, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxExpansions, value.MaxExpansions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinimumShouldMatch, value.MinimumShouldMatch, null, null); + writer.WriteProperty(options, PropOperator, value.Operator, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.Operator? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPrefixLength, value.PrefixLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropZeroTermsQuery, value.ZeroTermsQuery, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchQuery.g.cs index 114be26107e..4d243f037d5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MatchQuery.g.cs @@ -23,200 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class MatchQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropAutoGenerateSynonymsPhraseQuery = System.Text.Json.JsonEncodedText.Encode("auto_generate_synonyms_phrase_query"); - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCutoffFrequency = System.Text.Json.JsonEncodedText.Encode("cutoff_frequency"); - private static readonly System.Text.Json.JsonEncodedText PropFuzziness = System.Text.Json.JsonEncodedText.Encode("fuzziness"); - private static readonly System.Text.Json.JsonEncodedText PropFuzzyRewrite = System.Text.Json.JsonEncodedText.Encode("fuzzy_rewrite"); - private static readonly System.Text.Json.JsonEncodedText PropFuzzyTranspositions = System.Text.Json.JsonEncodedText.Encode("fuzzy_transpositions"); - private static readonly System.Text.Json.JsonEncodedText PropLenient = System.Text.Json.JsonEncodedText.Encode("lenient"); - private static readonly System.Text.Json.JsonEncodedText PropMaxExpansions = System.Text.Json.JsonEncodedText.Encode("max_expansions"); - private static readonly System.Text.Json.JsonEncodedText PropMinimumShouldMatch = System.Text.Json.JsonEncodedText.Encode("minimum_should_match"); - private static readonly System.Text.Json.JsonEncodedText PropOperator = System.Text.Json.JsonEncodedText.Encode("operator"); - private static readonly System.Text.Json.JsonEncodedText PropPrefixLength = System.Text.Json.JsonEncodedText.Encode("prefix_length"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropZeroTermsQuery = System.Text.Json.JsonEncodedText.Encode("zero_terms_query"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.MatchQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - reader.Read(); - propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); - reader.Read(); - if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) - { - var value = reader.ReadValue(options, null); - reader.Read(); - return new Elastic.Clients.Elasticsearch.QueryDsl.MatchQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Query = value - }; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyzer = default; - LocalJsonValue propAutoGenerateSynonymsPhraseQuery = default; - LocalJsonValue propBoost = default; - LocalJsonValue propCutoffFrequency = default; - LocalJsonValue propFuzziness = default; - LocalJsonValue propFuzzyRewrite = default; - LocalJsonValue propFuzzyTranspositions = default; - LocalJsonValue propLenient = default; - LocalJsonValue propMaxExpansions = default; - LocalJsonValue propMinimumShouldMatch = default; - LocalJsonValue propOperator = default; - LocalJsonValue propPrefixLength = default; - LocalJsonValue propQuery = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propZeroTermsQuery = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) - { - continue; - } - - if (propAutoGenerateSynonymsPhraseQuery.TryReadProperty(ref reader, options, PropAutoGenerateSynonymsPhraseQuery, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCutoffFrequency.TryReadProperty(ref reader, options, PropCutoffFrequency, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFuzziness.TryReadProperty(ref reader, options, PropFuzziness, null)) - { - continue; - } - - if (propFuzzyRewrite.TryReadProperty(ref reader, options, PropFuzzyRewrite, null)) - { - continue; - } - - if (propFuzzyTranspositions.TryReadProperty(ref reader, options, PropFuzzyTranspositions, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLenient.TryReadProperty(ref reader, options, PropLenient, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxExpansions.TryReadProperty(ref reader, options, PropMaxExpansions, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinimumShouldMatch.TryReadProperty(ref reader, options, PropMinimumShouldMatch, null)) - { - continue; - } - - if (propOperator.TryReadProperty(ref reader, options, PropOperator, static Elastic.Clients.Elasticsearch.QueryDsl.Operator? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPrefixLength.TryReadProperty(ref reader, options, PropPrefixLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propZeroTermsQuery.TryReadProperty(ref reader, options, PropZeroTermsQuery, static Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.MatchQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analyzer = propAnalyzer.Value, - AutoGenerateSynonymsPhraseQuery = propAutoGenerateSynonymsPhraseQuery.Value, - Boost = propBoost.Value, -#pragma warning disable CS0618 - CutoffFrequency = propCutoffFrequency.Value -#pragma warning restore CS0618 - , - Field = propField.Value, - Fuzziness = propFuzziness.Value, - FuzzyRewrite = propFuzzyRewrite.Value, - FuzzyTranspositions = propFuzzyTranspositions.Value, - Lenient = propLenient.Value, - MaxExpansions = propMaxExpansions.Value, - MinimumShouldMatch = propMinimumShouldMatch.Value, - Operator = propOperator.Value, - PrefixLength = propPrefixLength.Value, - Query = propQuery.Value, - QueryName = propQueryName.Value, - ZeroTermsQuery = propZeroTermsQuery.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.MatchQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); - writer.WriteProperty(options, PropAutoGenerateSynonymsPhraseQuery, value.AutoGenerateSynonymsPhraseQuery, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); -#pragma warning disable CS0618 - writer.WriteProperty(options, PropCutoffFrequency, value.CutoffFrequency, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)) -#pragma warning restore CS0618 - ; - writer.WriteProperty(options, PropFuzziness, value.Fuzziness, null, null); - writer.WriteProperty(options, PropFuzzyRewrite, value.FuzzyRewrite, null, null); - writer.WriteProperty(options, PropFuzzyTranspositions, value.FuzzyTranspositions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLenient, value.Lenient, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxExpansions, value.MaxExpansions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinimumShouldMatch, value.MinimumShouldMatch, null, null); - writer.WriteProperty(options, PropOperator, value.Operator, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.Operator? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPrefixLength, value.PrefixLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropZeroTermsQuery, value.ZeroTermsQuery, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.MatchQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.MatchQueryConverter))] public sealed partial class MatchQuery { [System.Obsolete("The type contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MoreLikeThisQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MoreLikeThisQuery.Converters.g.cs new file mode 100644 index 00000000000..e460b9005df --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MoreLikeThisQuery.Converters.g.cs @@ -0,0 +1,234 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class MoreLikeThisQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropBoostTerms = System.Text.Json.JsonEncodedText.Encode("boost_terms"); + private static readonly System.Text.Json.JsonEncodedText PropFailOnUnsupportedField = System.Text.Json.JsonEncodedText.Encode("fail_on_unsupported_field"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropInclude = System.Text.Json.JsonEncodedText.Encode("include"); + private static readonly System.Text.Json.JsonEncodedText PropLike = System.Text.Json.JsonEncodedText.Encode("like"); + private static readonly System.Text.Json.JsonEncodedText PropMaxDocFreq = System.Text.Json.JsonEncodedText.Encode("max_doc_freq"); + private static readonly System.Text.Json.JsonEncodedText PropMaxQueryTerms = System.Text.Json.JsonEncodedText.Encode("max_query_terms"); + private static readonly System.Text.Json.JsonEncodedText PropMaxWordLength = System.Text.Json.JsonEncodedText.Encode("max_word_length"); + private static readonly System.Text.Json.JsonEncodedText PropMinDocFreq = System.Text.Json.JsonEncodedText.Encode("min_doc_freq"); + private static readonly System.Text.Json.JsonEncodedText PropMinimumShouldMatch = System.Text.Json.JsonEncodedText.Encode("minimum_should_match"); + private static readonly System.Text.Json.JsonEncodedText PropMinTermFreq = System.Text.Json.JsonEncodedText.Encode("min_term_freq"); + private static readonly System.Text.Json.JsonEncodedText PropMinWordLength = System.Text.Json.JsonEncodedText.Encode("min_word_length"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); + private static readonly System.Text.Json.JsonEncodedText PropStopWords = System.Text.Json.JsonEncodedText.Encode("stop_words"); + private static readonly System.Text.Json.JsonEncodedText PropUnlike = System.Text.Json.JsonEncodedText.Encode("unlike"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + private static readonly System.Text.Json.JsonEncodedText PropVersionType = System.Text.Json.JsonEncodedText.Encode("version_type"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzer = default; + LocalJsonValue propBoost = default; + LocalJsonValue propBoostTerms = default; + LocalJsonValue propFailOnUnsupportedField = default; + LocalJsonValue propFields = default; + LocalJsonValue propInclude = default; + LocalJsonValue> propLike = default; + LocalJsonValue propMaxDocFreq = default; + LocalJsonValue propMaxQueryTerms = default; + LocalJsonValue propMaxWordLength = default; + LocalJsonValue propMinDocFreq = default; + LocalJsonValue propMinimumShouldMatch = default; + LocalJsonValue propMinTermFreq = default; + LocalJsonValue propMinWordLength = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propRouting = default; + LocalJsonValue>?> propStopWords = default; + LocalJsonValue?> propUnlike = default; + LocalJsonValue propVersion = default; + LocalJsonValue propVersionType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) + { + continue; + } + + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propBoostTerms.TryReadProperty(ref reader, options, PropBoostTerms, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFailOnUnsupportedField.TryReadProperty(ref reader, options, PropFailOnUnsupportedField, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propInclude.TryReadProperty(ref reader, options, PropInclude, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLike.TryReadProperty(ref reader, options, PropLike, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propMaxDocFreq.TryReadProperty(ref reader, options, PropMaxDocFreq, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxQueryTerms.TryReadProperty(ref reader, options, PropMaxQueryTerms, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxWordLength.TryReadProperty(ref reader, options, PropMaxWordLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinDocFreq.TryReadProperty(ref reader, options, PropMinDocFreq, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinimumShouldMatch.TryReadProperty(ref reader, options, PropMinimumShouldMatch, null)) + { + continue; + } + + if (propMinTermFreq.TryReadProperty(ref reader, options, PropMinTermFreq, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinWordLength.TryReadProperty(ref reader, options, PropMinWordLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (propStopWords.TryReadProperty(ref reader, options, PropStopWords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propUnlike.TryReadProperty(ref reader, options, PropUnlike, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propVersionType.TryReadProperty(ref reader, options, PropVersionType, static Elastic.Clients.Elasticsearch.VersionType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analyzer = propAnalyzer.Value, + Boost = propBoost.Value, + BoostTerms = propBoostTerms.Value, + FailOnUnsupportedField = propFailOnUnsupportedField.Value, + Fields = propFields.Value, + Include = propInclude.Value, + Like = propLike.Value, + MaxDocFreq = propMaxDocFreq.Value, + MaxQueryTerms = propMaxQueryTerms.Value, + MaxWordLength = propMaxWordLength.Value, + MinDocFreq = propMinDocFreq.Value, + MinimumShouldMatch = propMinimumShouldMatch.Value, + MinTermFreq = propMinTermFreq.Value, + MinWordLength = propMinWordLength.Value, + QueryName = propQueryName.Value, + Routing = propRouting.Value, + StopWords = propStopWords.Value, + Unlike = propUnlike.Value, + Version = propVersion.Value, + VersionType = propVersionType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropBoostTerms, value.BoostTerms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFailOnUnsupportedField, value.FailOnUnsupportedField, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropInclude, value.Include, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLike, value.Like, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMaxDocFreq, value.MaxDocFreq, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxQueryTerms, value.MaxQueryTerms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxWordLength, value.MaxWordLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinDocFreq, value.MinDocFreq, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinimumShouldMatch, value.MinimumShouldMatch, null, null); + writer.WriteProperty(options, PropMinTermFreq, value.MinTermFreq, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinWordLength, value.MinWordLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteProperty(options, PropStopWords, value.StopWords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropUnlike, value.Unlike, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVersionType, value.VersionType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.VersionType? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MoreLikeThisQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MoreLikeThisQuery.g.cs index 807e8458960..c3feb83efb3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MoreLikeThisQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MoreLikeThisQuery.g.cs @@ -23,217 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class MoreLikeThisQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropBoostTerms = System.Text.Json.JsonEncodedText.Encode("boost_terms"); - private static readonly System.Text.Json.JsonEncodedText PropFailOnUnsupportedField = System.Text.Json.JsonEncodedText.Encode("fail_on_unsupported_field"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropInclude = System.Text.Json.JsonEncodedText.Encode("include"); - private static readonly System.Text.Json.JsonEncodedText PropLike = System.Text.Json.JsonEncodedText.Encode("like"); - private static readonly System.Text.Json.JsonEncodedText PropMaxDocFreq = System.Text.Json.JsonEncodedText.Encode("max_doc_freq"); - private static readonly System.Text.Json.JsonEncodedText PropMaxQueryTerms = System.Text.Json.JsonEncodedText.Encode("max_query_terms"); - private static readonly System.Text.Json.JsonEncodedText PropMaxWordLength = System.Text.Json.JsonEncodedText.Encode("max_word_length"); - private static readonly System.Text.Json.JsonEncodedText PropMinDocFreq = System.Text.Json.JsonEncodedText.Encode("min_doc_freq"); - private static readonly System.Text.Json.JsonEncodedText PropMinimumShouldMatch = System.Text.Json.JsonEncodedText.Encode("minimum_should_match"); - private static readonly System.Text.Json.JsonEncodedText PropMinTermFreq = System.Text.Json.JsonEncodedText.Encode("min_term_freq"); - private static readonly System.Text.Json.JsonEncodedText PropMinWordLength = System.Text.Json.JsonEncodedText.Encode("min_word_length"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); - private static readonly System.Text.Json.JsonEncodedText PropStopWords = System.Text.Json.JsonEncodedText.Encode("stop_words"); - private static readonly System.Text.Json.JsonEncodedText PropUnlike = System.Text.Json.JsonEncodedText.Encode("unlike"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - private static readonly System.Text.Json.JsonEncodedText PropVersionType = System.Text.Json.JsonEncodedText.Encode("version_type"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyzer = default; - LocalJsonValue propBoost = default; - LocalJsonValue propBoostTerms = default; - LocalJsonValue propFailOnUnsupportedField = default; - LocalJsonValue propFields = default; - LocalJsonValue propInclude = default; - LocalJsonValue> propLike = default; - LocalJsonValue propMaxDocFreq = default; - LocalJsonValue propMaxQueryTerms = default; - LocalJsonValue propMaxWordLength = default; - LocalJsonValue propMinDocFreq = default; - LocalJsonValue propMinimumShouldMatch = default; - LocalJsonValue propMinTermFreq = default; - LocalJsonValue propMinWordLength = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propRouting = default; - LocalJsonValue>?> propStopWords = default; - LocalJsonValue?> propUnlike = default; - LocalJsonValue propVersion = default; - LocalJsonValue propVersionType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) - { - continue; - } - - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propBoostTerms.TryReadProperty(ref reader, options, PropBoostTerms, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFailOnUnsupportedField.TryReadProperty(ref reader, options, PropFailOnUnsupportedField, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propInclude.TryReadProperty(ref reader, options, PropInclude, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLike.TryReadProperty(ref reader, options, PropLike, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (propMaxDocFreq.TryReadProperty(ref reader, options, PropMaxDocFreq, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxQueryTerms.TryReadProperty(ref reader, options, PropMaxQueryTerms, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxWordLength.TryReadProperty(ref reader, options, PropMaxWordLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinDocFreq.TryReadProperty(ref reader, options, PropMinDocFreq, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinimumShouldMatch.TryReadProperty(ref reader, options, PropMinimumShouldMatch, null)) - { - continue; - } - - if (propMinTermFreq.TryReadProperty(ref reader, options, PropMinTermFreq, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinWordLength.TryReadProperty(ref reader, options, PropMinWordLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (propStopWords.TryReadProperty(ref reader, options, PropStopWords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propUnlike.TryReadProperty(ref reader, options, PropUnlike, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propVersionType.TryReadProperty(ref reader, options, PropVersionType, static Elastic.Clients.Elasticsearch.VersionType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analyzer = propAnalyzer.Value, - Boost = propBoost.Value, - BoostTerms = propBoostTerms.Value, - FailOnUnsupportedField = propFailOnUnsupportedField.Value, - Fields = propFields.Value, - Include = propInclude.Value, - Like = propLike.Value, - MaxDocFreq = propMaxDocFreq.Value, - MaxQueryTerms = propMaxQueryTerms.Value, - MaxWordLength = propMaxWordLength.Value, - MinDocFreq = propMinDocFreq.Value, - MinimumShouldMatch = propMinimumShouldMatch.Value, - MinTermFreq = propMinTermFreq.Value, - MinWordLength = propMinWordLength.Value, - QueryName = propQueryName.Value, - Routing = propRouting.Value, - StopWords = propStopWords.Value, - Unlike = propUnlike.Value, - Version = propVersion.Value, - VersionType = propVersionType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropBoostTerms, value.BoostTerms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFailOnUnsupportedField, value.FailOnUnsupportedField, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropInclude, value.Include, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLike, value.Like, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMaxDocFreq, value.MaxDocFreq, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxQueryTerms, value.MaxQueryTerms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxWordLength, value.MaxWordLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinDocFreq, value.MinDocFreq, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinimumShouldMatch, value.MinimumShouldMatch, null, null); - writer.WriteProperty(options, PropMinTermFreq, value.MinTermFreq, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinWordLength, value.MinWordLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteProperty(options, PropStopWords, value.StopWords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropUnlike, value.Unlike, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropVersionType, value.VersionType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.VersionType? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.MoreLikeThisQueryConverter))] public sealed partial class MoreLikeThisQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MultiMatchQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MultiMatchQuery.Converters.g.cs new file mode 100644 index 00000000000..8fc03222834 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MultiMatchQuery.Converters.g.cs @@ -0,0 +1,231 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class MultiMatchQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropAutoGenerateSynonymsPhraseQuery = System.Text.Json.JsonEncodedText.Encode("auto_generate_synonyms_phrase_query"); + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCutoffFrequency = System.Text.Json.JsonEncodedText.Encode("cutoff_frequency"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropFuzziness = System.Text.Json.JsonEncodedText.Encode("fuzziness"); + private static readonly System.Text.Json.JsonEncodedText PropFuzzyRewrite = System.Text.Json.JsonEncodedText.Encode("fuzzy_rewrite"); + private static readonly System.Text.Json.JsonEncodedText PropFuzzyTranspositions = System.Text.Json.JsonEncodedText.Encode("fuzzy_transpositions"); + private static readonly System.Text.Json.JsonEncodedText PropLenient = System.Text.Json.JsonEncodedText.Encode("lenient"); + private static readonly System.Text.Json.JsonEncodedText PropMaxExpansions = System.Text.Json.JsonEncodedText.Encode("max_expansions"); + private static readonly System.Text.Json.JsonEncodedText PropMinimumShouldMatch = System.Text.Json.JsonEncodedText.Encode("minimum_should_match"); + private static readonly System.Text.Json.JsonEncodedText PropOperator = System.Text.Json.JsonEncodedText.Encode("operator"); + private static readonly System.Text.Json.JsonEncodedText PropPrefixLength = System.Text.Json.JsonEncodedText.Encode("prefix_length"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropSlop = System.Text.Json.JsonEncodedText.Encode("slop"); + private static readonly System.Text.Json.JsonEncodedText PropTieBreaker = System.Text.Json.JsonEncodedText.Encode("tie_breaker"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropZeroTermsQuery = System.Text.Json.JsonEncodedText.Encode("zero_terms_query"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.MultiMatchQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzer = default; + LocalJsonValue propAutoGenerateSynonymsPhraseQuery = default; + LocalJsonValue propBoost = default; + LocalJsonValue propCutoffFrequency = default; + LocalJsonValue propFields = default; + LocalJsonValue propFuzziness = default; + LocalJsonValue propFuzzyRewrite = default; + LocalJsonValue propFuzzyTranspositions = default; + LocalJsonValue propLenient = default; + LocalJsonValue propMaxExpansions = default; + LocalJsonValue propMinimumShouldMatch = default; + LocalJsonValue propOperator = default; + LocalJsonValue propPrefixLength = default; + LocalJsonValue propQuery = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propSlop = default; + LocalJsonValue propTieBreaker = default; + LocalJsonValue propType = default; + LocalJsonValue propZeroTermsQuery = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) + { + continue; + } + + if (propAutoGenerateSynonymsPhraseQuery.TryReadProperty(ref reader, options, PropAutoGenerateSynonymsPhraseQuery, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCutoffFrequency.TryReadProperty(ref reader, options, PropCutoffFrequency, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propFuzziness.TryReadProperty(ref reader, options, PropFuzziness, null)) + { + continue; + } + + if (propFuzzyRewrite.TryReadProperty(ref reader, options, PropFuzzyRewrite, null)) + { + continue; + } + + if (propFuzzyTranspositions.TryReadProperty(ref reader, options, PropFuzzyTranspositions, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLenient.TryReadProperty(ref reader, options, PropLenient, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxExpansions.TryReadProperty(ref reader, options, PropMaxExpansions, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinimumShouldMatch.TryReadProperty(ref reader, options, PropMinimumShouldMatch, null)) + { + continue; + } + + if (propOperator.TryReadProperty(ref reader, options, PropOperator, static Elastic.Clients.Elasticsearch.QueryDsl.Operator? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPrefixLength.TryReadProperty(ref reader, options, PropPrefixLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propSlop.TryReadProperty(ref reader, options, PropSlop, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTieBreaker.TryReadProperty(ref reader, options, PropTieBreaker, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, static Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propZeroTermsQuery.TryReadProperty(ref reader, options, PropZeroTermsQuery, static Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.MultiMatchQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analyzer = propAnalyzer.Value, + AutoGenerateSynonymsPhraseQuery = propAutoGenerateSynonymsPhraseQuery.Value, + Boost = propBoost.Value, +#pragma warning disable CS0618 + CutoffFrequency = propCutoffFrequency.Value +#pragma warning restore CS0618 +, + Fields = propFields.Value, + Fuzziness = propFuzziness.Value, + FuzzyRewrite = propFuzzyRewrite.Value, + FuzzyTranspositions = propFuzzyTranspositions.Value, + Lenient = propLenient.Value, + MaxExpansions = propMaxExpansions.Value, + MinimumShouldMatch = propMinimumShouldMatch.Value, + Operator = propOperator.Value, + PrefixLength = propPrefixLength.Value, + Query = propQuery.Value, + QueryName = propQueryName.Value, + Slop = propSlop.Value, + TieBreaker = propTieBreaker.Value, + Type = propType.Value, + ZeroTermsQuery = propZeroTermsQuery.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.MultiMatchQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); + writer.WriteProperty(options, PropAutoGenerateSynonymsPhraseQuery, value.AutoGenerateSynonymsPhraseQuery, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); +#pragma warning disable CS0618 + writer.WriteProperty(options, PropCutoffFrequency, value.CutoffFrequency, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)) +#pragma warning restore CS0618 + ; + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropFuzziness, value.Fuzziness, null, null); + writer.WriteProperty(options, PropFuzzyRewrite, value.FuzzyRewrite, null, null); + writer.WriteProperty(options, PropFuzzyTranspositions, value.FuzzyTranspositions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLenient, value.Lenient, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxExpansions, value.MaxExpansions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinimumShouldMatch, value.MinimumShouldMatch, null, null); + writer.WriteProperty(options, PropOperator, value.Operator, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.Operator? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPrefixLength, value.PrefixLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropSlop, value.Slop, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTieBreaker, value.TieBreaker, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropZeroTermsQuery, value.ZeroTermsQuery, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MultiMatchQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MultiMatchQuery.g.cs index b1e385c7ad3..c0a1c9981b1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MultiMatchQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MultiMatchQuery.g.cs @@ -23,214 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class MultiMatchQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropAutoGenerateSynonymsPhraseQuery = System.Text.Json.JsonEncodedText.Encode("auto_generate_synonyms_phrase_query"); - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCutoffFrequency = System.Text.Json.JsonEncodedText.Encode("cutoff_frequency"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropFuzziness = System.Text.Json.JsonEncodedText.Encode("fuzziness"); - private static readonly System.Text.Json.JsonEncodedText PropFuzzyRewrite = System.Text.Json.JsonEncodedText.Encode("fuzzy_rewrite"); - private static readonly System.Text.Json.JsonEncodedText PropFuzzyTranspositions = System.Text.Json.JsonEncodedText.Encode("fuzzy_transpositions"); - private static readonly System.Text.Json.JsonEncodedText PropLenient = System.Text.Json.JsonEncodedText.Encode("lenient"); - private static readonly System.Text.Json.JsonEncodedText PropMaxExpansions = System.Text.Json.JsonEncodedText.Encode("max_expansions"); - private static readonly System.Text.Json.JsonEncodedText PropMinimumShouldMatch = System.Text.Json.JsonEncodedText.Encode("minimum_should_match"); - private static readonly System.Text.Json.JsonEncodedText PropOperator = System.Text.Json.JsonEncodedText.Encode("operator"); - private static readonly System.Text.Json.JsonEncodedText PropPrefixLength = System.Text.Json.JsonEncodedText.Encode("prefix_length"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropSlop = System.Text.Json.JsonEncodedText.Encode("slop"); - private static readonly System.Text.Json.JsonEncodedText PropTieBreaker = System.Text.Json.JsonEncodedText.Encode("tie_breaker"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropZeroTermsQuery = System.Text.Json.JsonEncodedText.Encode("zero_terms_query"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.MultiMatchQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyzer = default; - LocalJsonValue propAutoGenerateSynonymsPhraseQuery = default; - LocalJsonValue propBoost = default; - LocalJsonValue propCutoffFrequency = default; - LocalJsonValue propFields = default; - LocalJsonValue propFuzziness = default; - LocalJsonValue propFuzzyRewrite = default; - LocalJsonValue propFuzzyTranspositions = default; - LocalJsonValue propLenient = default; - LocalJsonValue propMaxExpansions = default; - LocalJsonValue propMinimumShouldMatch = default; - LocalJsonValue propOperator = default; - LocalJsonValue propPrefixLength = default; - LocalJsonValue propQuery = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propSlop = default; - LocalJsonValue propTieBreaker = default; - LocalJsonValue propType = default; - LocalJsonValue propZeroTermsQuery = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) - { - continue; - } - - if (propAutoGenerateSynonymsPhraseQuery.TryReadProperty(ref reader, options, PropAutoGenerateSynonymsPhraseQuery, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCutoffFrequency.TryReadProperty(ref reader, options, PropCutoffFrequency, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propFuzziness.TryReadProperty(ref reader, options, PropFuzziness, null)) - { - continue; - } - - if (propFuzzyRewrite.TryReadProperty(ref reader, options, PropFuzzyRewrite, null)) - { - continue; - } - - if (propFuzzyTranspositions.TryReadProperty(ref reader, options, PropFuzzyTranspositions, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLenient.TryReadProperty(ref reader, options, PropLenient, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxExpansions.TryReadProperty(ref reader, options, PropMaxExpansions, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinimumShouldMatch.TryReadProperty(ref reader, options, PropMinimumShouldMatch, null)) - { - continue; - } - - if (propOperator.TryReadProperty(ref reader, options, PropOperator, static Elastic.Clients.Elasticsearch.QueryDsl.Operator? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPrefixLength.TryReadProperty(ref reader, options, PropPrefixLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propSlop.TryReadProperty(ref reader, options, PropSlop, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTieBreaker.TryReadProperty(ref reader, options, PropTieBreaker, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, static Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propZeroTermsQuery.TryReadProperty(ref reader, options, PropZeroTermsQuery, static Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.MultiMatchQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analyzer = propAnalyzer.Value, - AutoGenerateSynonymsPhraseQuery = propAutoGenerateSynonymsPhraseQuery.Value, - Boost = propBoost.Value, -#pragma warning disable CS0618 - CutoffFrequency = propCutoffFrequency.Value -#pragma warning restore CS0618 -, - Fields = propFields.Value, - Fuzziness = propFuzziness.Value, - FuzzyRewrite = propFuzzyRewrite.Value, - FuzzyTranspositions = propFuzzyTranspositions.Value, - Lenient = propLenient.Value, - MaxExpansions = propMaxExpansions.Value, - MinimumShouldMatch = propMinimumShouldMatch.Value, - Operator = propOperator.Value, - PrefixLength = propPrefixLength.Value, - Query = propQuery.Value, - QueryName = propQueryName.Value, - Slop = propSlop.Value, - TieBreaker = propTieBreaker.Value, - Type = propType.Value, - ZeroTermsQuery = propZeroTermsQuery.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.MultiMatchQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); - writer.WriteProperty(options, PropAutoGenerateSynonymsPhraseQuery, value.AutoGenerateSynonymsPhraseQuery, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); -#pragma warning disable CS0618 - writer.WriteProperty(options, PropCutoffFrequency, value.CutoffFrequency, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)) -#pragma warning restore CS0618 - ; - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropFuzziness, value.Fuzziness, null, null); - writer.WriteProperty(options, PropFuzzyRewrite, value.FuzzyRewrite, null, null); - writer.WriteProperty(options, PropFuzzyTranspositions, value.FuzzyTranspositions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLenient, value.Lenient, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxExpansions, value.MaxExpansions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinimumShouldMatch, value.MinimumShouldMatch, null, null); - writer.WriteProperty(options, PropOperator, value.Operator, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.Operator? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPrefixLength, value.PrefixLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropSlop, value.Slop, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTieBreaker, value.TieBreaker, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropType, value.Type, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropZeroTermsQuery, value.ZeroTermsQuery, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.MultiMatchQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.MultiMatchQueryConverter))] public sealed partial class MultiMatchQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MultiValueMode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MultiValueMode.Converters.g.cs new file mode 100644 index 00000000000..1e27a1cd010 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MultiValueMode.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class MultiValueModeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAvg = System.Text.Json.JsonEncodedText.Encode("avg"); + private static readonly System.Text.Json.JsonEncodedText MemberMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText MemberMin = System.Text.Json.JsonEncodedText.Encode("min"); + private static readonly System.Text.Json.JsonEncodedText MemberSum = System.Text.Json.JsonEncodedText.Encode("sum"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAvg)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode.Avg; + } + + if (reader.ValueTextEquals(MemberMax)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode.Max; + } + + if (reader.ValueTextEquals(MemberMin)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode.Min; + } + + if (reader.ValueTextEquals(MemberSum)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode.Sum; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAvg.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode.Avg; + } + + if (string.Equals(value, MemberMax.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode.Max; + } + + if (string.Equals(value, MemberMin.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode.Min; + } + + if (string.Equals(value, MemberSum.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode.Sum; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode.Avg: + writer.WriteStringValue(MemberAvg); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode.Max: + writer.WriteStringValue(MemberMax); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode.Min: + writer.WriteStringValue(MemberMin); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode.Sum: + writer.WriteStringValue(MemberSum); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MultiValueMode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MultiValueMode.g.cs new file mode 100644 index 00000000000..72511dc7623 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MultiValueMode.g.cs @@ -0,0 +1,57 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.MultiValueModeConverter))] +public enum MultiValueMode +{ + /// + /// + /// Distance is the average distance. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "avg")] + Avg, + /// + /// + /// Distance is the maximum distance. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "max")] + Max, + /// + /// + /// Distance is the minimum distance. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "min")] + Min, + /// + /// + /// Distance is the sum of all distances. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "sum")] + Sum +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NestedQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NestedQuery.Converters.g.cs new file mode 100644 index 00000000000..835501b8df3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NestedQuery.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class NestedQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnmapped = System.Text.Json.JsonEncodedText.Encode("ignore_unmapped"); + private static readonly System.Text.Json.JsonEncodedText PropInnerHits = System.Text.Json.JsonEncodedText.Encode("inner_hits"); + private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropScoreMode = System.Text.Json.JsonEncodedText.Encode("score_mode"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.NestedQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propIgnoreUnmapped = default; + LocalJsonValue propInnerHits = default; + LocalJsonValue propPath = default; + LocalJsonValue propQuery = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propScoreMode = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreUnmapped.TryReadProperty(ref reader, options, PropIgnoreUnmapped, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propInnerHits.TryReadProperty(ref reader, options, PropInnerHits, null)) + { + continue; + } + + if (propPath.TryReadProperty(ref reader, options, PropPath, null)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propScoreMode.TryReadProperty(ref reader, options, PropScoreMode, static Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.NestedQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + IgnoreUnmapped = propIgnoreUnmapped.Value, + InnerHits = propInnerHits.Value, + Path = propPath.Value, + Query = propQuery.Value, + QueryName = propQueryName.Value, + ScoreMode = propScoreMode.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.NestedQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreUnmapped, value.IgnoreUnmapped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropInnerHits, value.InnerHits, null, null); + writer.WriteProperty(options, PropPath, value.Path, null, null); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropScoreMode, value.ScoreMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NestedQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NestedQuery.g.cs index 840560e882a..cb5bc7bcfe0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NestedQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NestedQuery.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class NestedQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnmapped = System.Text.Json.JsonEncodedText.Encode("ignore_unmapped"); - private static readonly System.Text.Json.JsonEncodedText PropInnerHits = System.Text.Json.JsonEncodedText.Encode("inner_hits"); - private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropScoreMode = System.Text.Json.JsonEncodedText.Encode("score_mode"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.NestedQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propIgnoreUnmapped = default; - LocalJsonValue propInnerHits = default; - LocalJsonValue propPath = default; - LocalJsonValue propQuery = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propScoreMode = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreUnmapped.TryReadProperty(ref reader, options, PropIgnoreUnmapped, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propInnerHits.TryReadProperty(ref reader, options, PropInnerHits, null)) - { - continue; - } - - if (propPath.TryReadProperty(ref reader, options, PropPath, null)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propScoreMode.TryReadProperty(ref reader, options, PropScoreMode, static Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.NestedQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - IgnoreUnmapped = propIgnoreUnmapped.Value, - InnerHits = propInnerHits.Value, - Path = propPath.Value, - Query = propQuery.Value, - QueryName = propQueryName.Value, - ScoreMode = propScoreMode.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.NestedQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreUnmapped, value.IgnoreUnmapped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropInnerHits, value.InnerHits, null, null); - writer.WriteProperty(options, PropPath, value.Path, null, null); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropScoreMode, value.ScoreMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.ChildScoreMode? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.NestedQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.NestedQueryConverter))] public sealed partial class NestedQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumberRangeQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumberRangeQuery.Converters.g.cs new file mode 100644 index 00000000000..be35f076786 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumberRangeQuery.Converters.g.cs @@ -0,0 +1,128 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class NumberRangeQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropGt = System.Text.Json.JsonEncodedText.Encode("gt"); + private static readonly System.Text.Json.JsonEncodedText PropGte = System.Text.Json.JsonEncodedText.Encode("gte"); + private static readonly System.Text.Json.JsonEncodedText PropLt = System.Text.Json.JsonEncodedText.Encode("lt"); + private static readonly System.Text.Json.JsonEncodedText PropLte = System.Text.Json.JsonEncodedText.Encode("lte"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropRelation = System.Text.Json.JsonEncodedText.Encode("relation"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + reader.Read(); + propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propGt = default; + LocalJsonValue propGte = default; + LocalJsonValue propLt = default; + LocalJsonValue propLte = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propRelation = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propGt.TryReadProperty(ref reader, options, PropGt, null)) + { + continue; + } + + if (propGte.TryReadProperty(ref reader, options, PropGte, null)) + { + continue; + } + + if (propLt.TryReadProperty(ref reader, options, PropLt, null)) + { + continue; + } + + if (propLte.TryReadProperty(ref reader, options, PropLte, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propRelation.TryReadProperty(ref reader, options, PropRelation, static Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Field = propField.Value, + Gt = propGt.Value, + Gte = propGte.Value, + Lt = propLt.Value, + Lte = propLte.Value, + QueryName = propQueryName.Value, + Relation = propRelation.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropGt, value.Gt, null, null); + writer.WriteProperty(options, PropGte, value.Gte, null, null); + writer.WriteProperty(options, PropLt, value.Lt, null, null); + writer.WriteProperty(options, PropLte, value.Lte, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropRelation, value.Relation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumberRangeQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumberRangeQuery.g.cs index 8a77610fece..24a5c87ba8c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumberRangeQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumberRangeQuery.g.cs @@ -23,111 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class NumberRangeQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropGt = System.Text.Json.JsonEncodedText.Encode("gt"); - private static readonly System.Text.Json.JsonEncodedText PropGte = System.Text.Json.JsonEncodedText.Encode("gte"); - private static readonly System.Text.Json.JsonEncodedText PropLt = System.Text.Json.JsonEncodedText.Encode("lt"); - private static readonly System.Text.Json.JsonEncodedText PropLte = System.Text.Json.JsonEncodedText.Encode("lte"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropRelation = System.Text.Json.JsonEncodedText.Encode("relation"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - reader.Read(); - propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propGt = default; - LocalJsonValue propGte = default; - LocalJsonValue propLt = default; - LocalJsonValue propLte = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propRelation = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propGt.TryReadProperty(ref reader, options, PropGt, null)) - { - continue; - } - - if (propGte.TryReadProperty(ref reader, options, PropGte, null)) - { - continue; - } - - if (propLt.TryReadProperty(ref reader, options, PropLt, null)) - { - continue; - } - - if (propLte.TryReadProperty(ref reader, options, PropLte, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propRelation.TryReadProperty(ref reader, options, PropRelation, static Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Field = propField.Value, - Gt = propGt.Value, - Gte = propGte.Value, - Lt = propLt.Value, - Lte = propLte.Value, - QueryName = propQueryName.Value, - Relation = propRelation.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropGt, value.Gt, null, null); - writer.WriteProperty(options, PropGte, value.Gte, null, null); - writer.WriteProperty(options, PropLt, value.Lt, null, null); - writer.WriteProperty(options, PropLte, value.Lte, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropRelation, value.Relation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.NumberRangeQueryConverter))] public sealed partial class NumberRangeQuery : Elastic.Clients.Elasticsearch.QueryDsl.IRangeQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumericDecayFunction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumericDecayFunction.Converters.g.cs new file mode 100644 index 00000000000..afd87b4ecf6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumericDecayFunction.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class NumericDecayFunctionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMultiValueMode = System.Text.Json.JsonEncodedText.Encode("multi_value_mode"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.NumericDecayFunction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propMultiValueMode = default; + LocalJsonValue> propPlacement = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMultiValueMode.TryReadProperty(ref reader, options, PropMultiValueMode, static Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + propField.Initialized = propPlacement.Initialized = true; + reader.ReadProperty(options, out propField.Value, out propPlacement.Value, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o), null); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.NumericDecayFunction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + MultiValueMode = propMultiValueMode.Value, + Placement = propPlacement.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.NumericDecayFunction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMultiValueMode, value.MultiValueMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, value.Field, value.Placement, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v), null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumericDecayFunction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumericDecayFunction.g.cs index 9d287da02a0..026125a6342 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumericDecayFunction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/NumericDecayFunction.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class NumericDecayFunctionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMultiValueMode = System.Text.Json.JsonEncodedText.Encode("multi_value_mode"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.NumericDecayFunction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propMultiValueMode = default; - LocalJsonValue> propPlacement = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMultiValueMode.TryReadProperty(ref reader, options, PropMultiValueMode, static Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - propField.Initialized = propPlacement.Initialized = true; - reader.ReadProperty(options, out propField.Value, out propPlacement.Value, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o), null); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.NumericDecayFunction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - MultiValueMode = propMultiValueMode.Value, - Placement = propPlacement.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.NumericDecayFunction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMultiValueMode, value.MultiValueMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, value.Field, value.Placement, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v), null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.NumericDecayFunctionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.NumericDecayFunctionConverter))] public sealed partial class NumericDecayFunction : Elastic.Clients.Elasticsearch.QueryDsl.IDecayFunction { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Operator.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Operator.Converters.g.cs new file mode 100644 index 00000000000..de12b5319b7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Operator.Converters.g.cs @@ -0,0 +1,83 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class OperatorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAnd = System.Text.Json.JsonEncodedText.Encode("and"); + private static readonly System.Text.Json.JsonEncodedText MemberAnd1 = System.Text.Json.JsonEncodedText.Encode("AND"); + private static readonly System.Text.Json.JsonEncodedText MemberOr = System.Text.Json.JsonEncodedText.Encode("or"); + private static readonly System.Text.Json.JsonEncodedText MemberOr1 = System.Text.Json.JsonEncodedText.Encode("OR"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.Operator Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAnd) || reader.ValueTextEquals(MemberAnd1)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.Operator.And; + } + + if (reader.ValueTextEquals(MemberOr) || reader.ValueTextEquals(MemberOr1)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.Operator.Or; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAnd.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberAnd1.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.Operator.And; + } + + if (string.Equals(value, MemberOr.Value, System.StringComparison.OrdinalIgnoreCase) || string.Equals(value, MemberOr1.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.Operator.Or; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.Operator)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.Operator value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.QueryDsl.Operator.And: + writer.WriteStringValue(MemberAnd); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.Operator.Or: + writer.WriteStringValue(MemberOr); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.Operator)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.QueryDsl.Operator ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.Operator value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Operator.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Operator.g.cs new file mode 100644 index 00000000000..dcc25334fc9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Operator.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.OperatorConverter))] +public enum Operator +{ + [System.Runtime.Serialization.EnumMember(Value = "and")] + And, + [System.Runtime.Serialization.EnumMember(Value = "or")] + Or +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ParentIdQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ParentIdQuery.Converters.g.cs new file mode 100644 index 00000000000..6167eb397ec --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ParentIdQuery.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class ParentIdQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnmapped = System.Text.Json.JsonEncodedText.Encode("ignore_unmapped"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.ParentIdQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propId = default; + LocalJsonValue propIgnoreUnmapped = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIgnoreUnmapped.TryReadProperty(ref reader, options, PropIgnoreUnmapped, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.ParentIdQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Id = propId.Value, + IgnoreUnmapped = propIgnoreUnmapped.Value, + QueryName = propQueryName.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.ParentIdQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIgnoreUnmapped, value.IgnoreUnmapped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ParentIdQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ParentIdQuery.g.cs index 37b96ccb17b..74a88cdb3e2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ParentIdQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ParentIdQuery.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class ParentIdQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnmapped = System.Text.Json.JsonEncodedText.Encode("ignore_unmapped"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.ParentIdQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propId = default; - LocalJsonValue propIgnoreUnmapped = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIgnoreUnmapped.TryReadProperty(ref reader, options, PropIgnoreUnmapped, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.ParentIdQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Id = propId.Value, - IgnoreUnmapped = propIgnoreUnmapped.Value, - QueryName = propQueryName.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.ParentIdQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIgnoreUnmapped, value.IgnoreUnmapped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.ParentIdQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.ParentIdQueryConverter))] public sealed partial class ParentIdQuery { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PercolateQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PercolateQuery.Converters.g.cs new file mode 100644 index 00000000000..25466ee0d61 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PercolateQuery.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class PercolateQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropDocument = System.Text.Json.JsonEncodedText.Encode("document"); + private static readonly System.Text.Json.JsonEncodedText PropDocuments = System.Text.Json.JsonEncodedText.Encode("documents"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropPreference = System.Text.Json.JsonEncodedText.Encode("preference"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.PercolateQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propDocument = default; + LocalJsonValue?> propDocuments = default; + LocalJsonValue propField = default; + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + LocalJsonValue propName = default; + LocalJsonValue propPreference = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propRouting = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDocument.TryReadProperty(ref reader, options, PropDocument, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propDocuments.TryReadProperty(ref reader, options, PropDocuments, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propPreference.TryReadProperty(ref reader, options, PropPreference, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.PercolateQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Document = propDocument.Value, + Documents = propDocuments.Value, + Field = propField.Value, + Id = propId.Value, + Index = propIndex.Value, + Name = propName.Value, + Preference = propPreference.Value, + QueryName = propQueryName.Value, + Routing = propRouting.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.PercolateQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDocument, value.Document, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropDocuments, value.Documents, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropPreference, value.Preference, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PercolateQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PercolateQuery.g.cs index fe90c5dd879..e9951208f3c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PercolateQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PercolateQuery.g.cs @@ -23,136 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class PercolateQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropDocument = System.Text.Json.JsonEncodedText.Encode("document"); - private static readonly System.Text.Json.JsonEncodedText PropDocuments = System.Text.Json.JsonEncodedText.Encode("documents"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropPreference = System.Text.Json.JsonEncodedText.Encode("preference"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.PercolateQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propDocument = default; - LocalJsonValue?> propDocuments = default; - LocalJsonValue propField = default; - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - LocalJsonValue propName = default; - LocalJsonValue propPreference = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propRouting = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDocument.TryReadProperty(ref reader, options, PropDocument, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propDocuments.TryReadProperty(ref reader, options, PropDocuments, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propPreference.TryReadProperty(ref reader, options, PropPreference, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.PercolateQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Document = propDocument.Value, - Documents = propDocuments.Value, - Field = propField.Value, - Id = propId.Value, - Index = propIndex.Value, - Name = propName.Value, - Preference = propPreference.Value, - QueryName = propQueryName.Value, - Routing = propRouting.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.PercolateQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDocument, value.Document, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropDocuments, value.Documents, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropPreference, value.Preference, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.PercolateQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.PercolateQueryConverter))] public sealed partial class PercolateQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PinnedDoc.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PinnedDoc.Converters.g.cs new file mode 100644 index 00000000000..e4c6bcc8efc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PinnedDoc.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class PinnedDocConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.PinnedDoc Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.PinnedDoc(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + Index = propIndex.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.PinnedDoc value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PinnedDoc.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PinnedDoc.g.cs index a068e6c3a29..9ed2cbcf468 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PinnedDoc.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PinnedDoc.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class PinnedDocConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.PinnedDoc Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.PinnedDoc(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - Index = propIndex.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.PinnedDoc value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.PinnedDocConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.PinnedDocConverter))] public sealed partial class PinnedDoc { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PinnedQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PinnedQuery.Converters.g.cs new file mode 100644 index 00000000000..eb69368d993 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PinnedQuery.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class PinnedQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropOrganic = System.Text.Json.JsonEncodedText.Encode("organic"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText VariantDocs = System.Text.Json.JsonEncodedText.Encode("docs"); + private static readonly System.Text.Json.JsonEncodedText VariantIds = System.Text.Json.JsonEncodedText.Encode("ids"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.PinnedQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propOrganic = default; + LocalJsonValue propQueryName = default; + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOrganic.TryReadProperty(ref reader, options, PropOrganic, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (reader.ValueTextEquals(VariantDocs)) + { + variantType = VariantDocs.Value; + reader.Read(); + variant = reader.ReadValue>(options, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); + continue; + } + + if (reader.ValueTextEquals(VariantIds)) + { + variantType = VariantIds.Value; + reader.Read(); + variant = reader.ReadValue>(options, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.PinnedQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant, + Boost = propBoost.Value, + Organic = propOrganic.Value, + QueryName = propQueryName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.PinnedQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "docs": + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.ICollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + break; + case "ids": + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.ICollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.PinnedQuery)}'."); + } + + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOrganic, value.Organic, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PinnedQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PinnedQuery.g.cs index 11213aeb9ef..65e39ccd4f8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PinnedQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PinnedQuery.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class PinnedQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropOrganic = System.Text.Json.JsonEncodedText.Encode("organic"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText VariantDocs = System.Text.Json.JsonEncodedText.Encode("docs"); - private static readonly System.Text.Json.JsonEncodedText VariantIds = System.Text.Json.JsonEncodedText.Encode("ids"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.PinnedQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propOrganic = default; - LocalJsonValue propQueryName = default; - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOrganic.TryReadProperty(ref reader, options, PropOrganic, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (reader.ValueTextEquals(VariantDocs)) - { - variantType = VariantDocs.Value; - reader.Read(); - variant = reader.ReadValue>(options, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); - continue; - } - - if (reader.ValueTextEquals(VariantIds)) - { - variantType = VariantIds.Value; - reader.Read(); - variant = reader.ReadValue>(options, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.PinnedQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant, - Boost = propBoost.Value, - Organic = propOrganic.Value, - QueryName = propQueryName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.PinnedQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "docs": - writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.ICollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - break; - case "ids": - writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.ICollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.PinnedQuery)}'."); - } - - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOrganic, value.Organic, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.PinnedQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.PinnedQueryConverter))] public sealed partial class PinnedQuery { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PrefixQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PrefixQuery.Converters.g.cs new file mode 100644 index 00000000000..203009d90c4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PrefixQuery.Converters.g.cs @@ -0,0 +1,121 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class PrefixQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCaseInsensitive = System.Text.Json.JsonEncodedText.Encode("case_insensitive"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropRewrite = System.Text.Json.JsonEncodedText.Encode("rewrite"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.PrefixQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + reader.Read(); + propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); + reader.Read(); + if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) + { + var value = reader.ReadValue(options, null); + reader.Read(); + return new Elastic.Clients.Elasticsearch.QueryDsl.PrefixQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Value = value + }; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propCaseInsensitive = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propRewrite = default; + LocalJsonValue propValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCaseInsensitive.TryReadProperty(ref reader, options, PropCaseInsensitive, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propRewrite.TryReadProperty(ref reader, options, PropRewrite, null)) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.PrefixQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + CaseInsensitive = propCaseInsensitive.Value, + Field = propField.Value, + QueryName = propQueryName.Value, + Rewrite = propRewrite.Value, + Value = propValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.PrefixQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCaseInsensitive, value.CaseInsensitive, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropRewrite, value.Rewrite, null, null); + writer.WriteProperty(options, PropValue, value.Value, null, null); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PrefixQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PrefixQuery.g.cs index 67094e1feef..e7858f1b7e2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PrefixQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/PrefixQuery.g.cs @@ -23,104 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class PrefixQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCaseInsensitive = System.Text.Json.JsonEncodedText.Encode("case_insensitive"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropRewrite = System.Text.Json.JsonEncodedText.Encode("rewrite"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.PrefixQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - reader.Read(); - propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); - reader.Read(); - if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) - { - var value = reader.ReadValue(options, null); - reader.Read(); - return new Elastic.Clients.Elasticsearch.QueryDsl.PrefixQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Value = value - }; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propCaseInsensitive = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propRewrite = default; - LocalJsonValue propValue = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCaseInsensitive.TryReadProperty(ref reader, options, PropCaseInsensitive, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propRewrite.TryReadProperty(ref reader, options, PropRewrite, null)) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.PrefixQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - CaseInsensitive = propCaseInsensitive.Value, - Field = propField.Value, - QueryName = propQueryName.Value, - Rewrite = propRewrite.Value, - Value = propValue.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.PrefixQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCaseInsensitive, value.CaseInsensitive, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropRewrite, value.Rewrite, null, null); - writer.WriteProperty(options, PropValue, value.Value, null, null); - writer.WriteEndObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.PrefixQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.PrefixQueryConverter))] public sealed partial class PrefixQuery { [System.Obsolete("The type contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Query.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Query.Converters.g.cs new file mode 100644 index 00000000000..f01d83d62d4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Query.Converters.g.cs @@ -0,0 +1,798 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class QueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantBool = System.Text.Json.JsonEncodedText.Encode("bool"); + private static readonly System.Text.Json.JsonEncodedText VariantBoosting = System.Text.Json.JsonEncodedText.Encode("boosting"); + private static readonly System.Text.Json.JsonEncodedText VariantCombinedFields = System.Text.Json.JsonEncodedText.Encode("combined_fields"); + private static readonly System.Text.Json.JsonEncodedText VariantCommon = System.Text.Json.JsonEncodedText.Encode("common"); + private static readonly System.Text.Json.JsonEncodedText VariantConstantScore = System.Text.Json.JsonEncodedText.Encode("constant_score"); + private static readonly System.Text.Json.JsonEncodedText VariantDisMax = System.Text.Json.JsonEncodedText.Encode("dis_max"); + private static readonly System.Text.Json.JsonEncodedText VariantDistanceFeature = System.Text.Json.JsonEncodedText.Encode("distance_feature"); + private static readonly System.Text.Json.JsonEncodedText VariantExists = System.Text.Json.JsonEncodedText.Encode("exists"); + private static readonly System.Text.Json.JsonEncodedText VariantFunctionScore = System.Text.Json.JsonEncodedText.Encode("function_score"); + private static readonly System.Text.Json.JsonEncodedText VariantFuzzy = System.Text.Json.JsonEncodedText.Encode("fuzzy"); + private static readonly System.Text.Json.JsonEncodedText VariantGeoBoundingBox = System.Text.Json.JsonEncodedText.Encode("geo_bounding_box"); + private static readonly System.Text.Json.JsonEncodedText VariantGeoDistance = System.Text.Json.JsonEncodedText.Encode("geo_distance"); + private static readonly System.Text.Json.JsonEncodedText VariantGeoGrid = System.Text.Json.JsonEncodedText.Encode("geo_grid"); + private static readonly System.Text.Json.JsonEncodedText VariantGeoPolygon = System.Text.Json.JsonEncodedText.Encode("geo_polygon"); + private static readonly System.Text.Json.JsonEncodedText VariantGeoShape = System.Text.Json.JsonEncodedText.Encode("geo_shape"); + private static readonly System.Text.Json.JsonEncodedText VariantHasChild = System.Text.Json.JsonEncodedText.Encode("has_child"); + private static readonly System.Text.Json.JsonEncodedText VariantHasParent = System.Text.Json.JsonEncodedText.Encode("has_parent"); + private static readonly System.Text.Json.JsonEncodedText VariantIds = System.Text.Json.JsonEncodedText.Encode("ids"); + private static readonly System.Text.Json.JsonEncodedText VariantIntervals = System.Text.Json.JsonEncodedText.Encode("intervals"); + private static readonly System.Text.Json.JsonEncodedText VariantKnn = System.Text.Json.JsonEncodedText.Encode("knn"); + private static readonly System.Text.Json.JsonEncodedText VariantMatch = System.Text.Json.JsonEncodedText.Encode("match"); + private static readonly System.Text.Json.JsonEncodedText VariantMatchAll = System.Text.Json.JsonEncodedText.Encode("match_all"); + private static readonly System.Text.Json.JsonEncodedText VariantMatchBoolPrefix = System.Text.Json.JsonEncodedText.Encode("match_bool_prefix"); + private static readonly System.Text.Json.JsonEncodedText VariantMatchNone = System.Text.Json.JsonEncodedText.Encode("match_none"); + private static readonly System.Text.Json.JsonEncodedText VariantMatchPhrase = System.Text.Json.JsonEncodedText.Encode("match_phrase"); + private static readonly System.Text.Json.JsonEncodedText VariantMatchPhrasePrefix = System.Text.Json.JsonEncodedText.Encode("match_phrase_prefix"); + private static readonly System.Text.Json.JsonEncodedText VariantMoreLikeThis = System.Text.Json.JsonEncodedText.Encode("more_like_this"); + private static readonly System.Text.Json.JsonEncodedText VariantMultiMatch = System.Text.Json.JsonEncodedText.Encode("multi_match"); + private static readonly System.Text.Json.JsonEncodedText VariantNested = System.Text.Json.JsonEncodedText.Encode("nested"); + private static readonly System.Text.Json.JsonEncodedText VariantParentId = System.Text.Json.JsonEncodedText.Encode("parent_id"); + private static readonly System.Text.Json.JsonEncodedText VariantPercolate = System.Text.Json.JsonEncodedText.Encode("percolate"); + private static readonly System.Text.Json.JsonEncodedText VariantPinned = System.Text.Json.JsonEncodedText.Encode("pinned"); + private static readonly System.Text.Json.JsonEncodedText VariantPrefix = System.Text.Json.JsonEncodedText.Encode("prefix"); + private static readonly System.Text.Json.JsonEncodedText VariantQueryString = System.Text.Json.JsonEncodedText.Encode("query_string"); + private static readonly System.Text.Json.JsonEncodedText VariantRange = System.Text.Json.JsonEncodedText.Encode("range"); + private static readonly System.Text.Json.JsonEncodedText VariantRankFeature = System.Text.Json.JsonEncodedText.Encode("rank_feature"); + private static readonly System.Text.Json.JsonEncodedText VariantRegexp = System.Text.Json.JsonEncodedText.Encode("regexp"); + private static readonly System.Text.Json.JsonEncodedText VariantRule = System.Text.Json.JsonEncodedText.Encode("rule"); + private static readonly System.Text.Json.JsonEncodedText VariantScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText VariantScriptScore = System.Text.Json.JsonEncodedText.Encode("script_score"); + private static readonly System.Text.Json.JsonEncodedText VariantSemantic = System.Text.Json.JsonEncodedText.Encode("semantic"); + private static readonly System.Text.Json.JsonEncodedText VariantShape = System.Text.Json.JsonEncodedText.Encode("shape"); + private static readonly System.Text.Json.JsonEncodedText VariantSimpleQueryString = System.Text.Json.JsonEncodedText.Encode("simple_query_string"); + private static readonly System.Text.Json.JsonEncodedText VariantSpanContaining = System.Text.Json.JsonEncodedText.Encode("span_containing"); + private static readonly System.Text.Json.JsonEncodedText VariantSpanFieldMasking = System.Text.Json.JsonEncodedText.Encode("span_field_masking"); + private static readonly System.Text.Json.JsonEncodedText VariantSpanFirst = System.Text.Json.JsonEncodedText.Encode("span_first"); + private static readonly System.Text.Json.JsonEncodedText VariantSpanMulti = System.Text.Json.JsonEncodedText.Encode("span_multi"); + private static readonly System.Text.Json.JsonEncodedText VariantSpanNear = System.Text.Json.JsonEncodedText.Encode("span_near"); + private static readonly System.Text.Json.JsonEncodedText VariantSpanNot = System.Text.Json.JsonEncodedText.Encode("span_not"); + private static readonly System.Text.Json.JsonEncodedText VariantSpanOr = System.Text.Json.JsonEncodedText.Encode("span_or"); + private static readonly System.Text.Json.JsonEncodedText VariantSpanTerm = System.Text.Json.JsonEncodedText.Encode("span_term"); + private static readonly System.Text.Json.JsonEncodedText VariantSpanWithin = System.Text.Json.JsonEncodedText.Encode("span_within"); + private static readonly System.Text.Json.JsonEncodedText VariantSparseVector = System.Text.Json.JsonEncodedText.Encode("sparse_vector"); + private static readonly System.Text.Json.JsonEncodedText VariantTerm = System.Text.Json.JsonEncodedText.Encode("term"); + private static readonly System.Text.Json.JsonEncodedText VariantTerms = System.Text.Json.JsonEncodedText.Encode("terms"); + private static readonly System.Text.Json.JsonEncodedText VariantTermsSet = System.Text.Json.JsonEncodedText.Encode("terms_set"); + private static readonly System.Text.Json.JsonEncodedText VariantTextExpansion = System.Text.Json.JsonEncodedText.Encode("text_expansion"); + private static readonly System.Text.Json.JsonEncodedText VariantType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText VariantWeightedTokens = System.Text.Json.JsonEncodedText.Encode("weighted_tokens"); + private static readonly System.Text.Json.JsonEncodedText VariantWildcard = System.Text.Json.JsonEncodedText.Encode("wildcard"); + private static readonly System.Text.Json.JsonEncodedText VariantWrapper = System.Text.Json.JsonEncodedText.Encode("wrapper"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.Query Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantBool)) + { + variantType = VariantBool.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantBoosting)) + { + variantType = VariantBoosting.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantCombinedFields)) + { + variantType = VariantCombinedFields.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantCommon)) + { + variantType = VariantCommon.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantConstantScore)) + { + variantType = VariantConstantScore.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantDisMax)) + { + variantType = VariantDisMax.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantDistanceFeature)) + { + variantType = VariantDistanceFeature.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantExists)) + { + variantType = VariantExists.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantFunctionScore)) + { + variantType = VariantFunctionScore.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantFuzzy)) + { + variantType = VariantFuzzy.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantGeoBoundingBox)) + { + variantType = VariantGeoBoundingBox.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantGeoDistance)) + { + variantType = VariantGeoDistance.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantGeoGrid)) + { + variantType = VariantGeoGrid.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantGeoPolygon)) + { + variantType = VariantGeoPolygon.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantGeoShape)) + { + variantType = VariantGeoShape.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantHasChild)) + { + variantType = VariantHasChild.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantHasParent)) + { + variantType = VariantHasParent.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantIds)) + { + variantType = VariantIds.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantIntervals)) + { + variantType = VariantIntervals.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantKnn)) + { + variantType = VariantKnn.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMatch)) + { + variantType = VariantMatch.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMatchAll)) + { + variantType = VariantMatchAll.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMatchBoolPrefix)) + { + variantType = VariantMatchBoolPrefix.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMatchNone)) + { + variantType = VariantMatchNone.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMatchPhrase)) + { + variantType = VariantMatchPhrase.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMatchPhrasePrefix)) + { + variantType = VariantMatchPhrasePrefix.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMoreLikeThis)) + { + variantType = VariantMoreLikeThis.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMultiMatch)) + { + variantType = VariantMultiMatch.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantNested)) + { + variantType = VariantNested.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantParentId)) + { + variantType = VariantParentId.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantPercolate)) + { + variantType = VariantPercolate.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantPinned)) + { + variantType = VariantPinned.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantPrefix)) + { + variantType = VariantPrefix.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantQueryString)) + { + variantType = VariantQueryString.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRange)) + { + variantType = VariantRange.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRankFeature)) + { + variantType = VariantRankFeature.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRegexp)) + { + variantType = VariantRegexp.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRule)) + { + variantType = VariantRule.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantScript)) + { + variantType = VariantScript.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantScriptScore)) + { + variantType = VariantScriptScore.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSemantic)) + { + variantType = VariantSemantic.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantShape)) + { + variantType = VariantShape.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSimpleQueryString)) + { + variantType = VariantSimpleQueryString.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSpanContaining)) + { + variantType = VariantSpanContaining.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSpanFieldMasking)) + { + variantType = VariantSpanFieldMasking.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSpanFirst)) + { + variantType = VariantSpanFirst.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSpanMulti)) + { + variantType = VariantSpanMulti.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSpanNear)) + { + variantType = VariantSpanNear.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSpanNot)) + { + variantType = VariantSpanNot.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSpanOr)) + { + variantType = VariantSpanOr.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSpanTerm)) + { + variantType = VariantSpanTerm.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSpanWithin)) + { + variantType = VariantSpanWithin.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSparseVector)) + { + variantType = VariantSparseVector.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTerm)) + { + variantType = VariantTerm.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTerms)) + { + variantType = VariantTerms.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTermsSet)) + { + variantType = VariantTermsSet.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTextExpansion)) + { + variantType = VariantTextExpansion.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantType)) + { + variantType = VariantType.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantWeightedTokens)) + { + variantType = VariantWeightedTokens.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantWildcard)) + { + variantType = VariantWildcard.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantWrapper)) + { + variantType = VariantWrapper.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.Query(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.Query value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "bool": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.BoolQuery)value.Variant, null, null); + break; + case "boosting": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.BoostingQuery)value.Variant, null, null); + break; + case "combined_fields": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsQuery)value.Variant, null, null); + break; + case "common": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.CommonTermsQuery)value.Variant, null, null); + break; + case "constant_score": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.ConstantScoreQuery)value.Variant, null, null); + break; + case "dis_max": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.DisMaxQuery)value.Variant, null, null); + break; + case "distance_feature": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IDistanceFeatureQuery)value.Variant, null, null); + break; + case "exists": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.ExistsQuery)value.Variant, null, null); + break; + case "function_score": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreQuery)value.Variant, null, null); + break; + case "fuzzy": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.FuzzyQuery)value.Variant, null, null); + break; + case "geo_bounding_box": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.GeoBoundingBoxQuery)value.Variant, null, null); + break; + case "geo_distance": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceQuery)value.Variant, null, null); + break; + case "geo_grid": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.GeoGridQuery)value.Variant, null, null); + break; + case "geo_polygon": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonQuery)value.Variant, null, null); + break; + case "geo_shape": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.GeoShapeQuery)value.Variant, null, null); + break; + case "has_child": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.HasChildQuery)value.Variant, null, null); + break; + case "has_parent": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.HasParentQuery)value.Variant, null, null); + break; + case "ids": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IdsQuery)value.Variant, null, null); + break; + case "intervals": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsQuery)value.Variant, null, null); + break; + case "knn": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.KnnQuery)value.Variant, null, null); + break; + case "match": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MatchQuery)value.Variant, null, null); + break; + case "match_all": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MatchAllQuery)value.Variant, null, null); + break; + case "match_bool_prefix": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MatchBoolPrefixQuery)value.Variant, null, null); + break; + case "match_none": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MatchNoneQuery)value.Variant, null, null); + break; + case "match_phrase": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MatchPhraseQuery)value.Variant, null, null); + break; + case "match_phrase_prefix": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MatchPhrasePrefixQuery)value.Variant, null, null); + break; + case "more_like_this": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQuery)value.Variant, null, null); + break; + case "multi_match": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MultiMatchQuery)value.Variant, null, null); + break; + case "nested": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.NestedQuery)value.Variant, null, null); + break; + case "parent_id": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.ParentIdQuery)value.Variant, null, null); + break; + case "percolate": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.PercolateQuery)value.Variant, null, null); + break; + case "pinned": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.PinnedQuery)value.Variant, null, null); + break; + case "prefix": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.PrefixQuery)value.Variant, null, null); + break; + case "query_string": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.QueryStringQuery)value.Variant, null, null); + break; + case "range": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IRangeQuery)value.Variant, null, null); + break; + case "rank_feature": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureQuery)value.Variant, null, null); + break; + case "regexp": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.RegexpQuery)value.Variant, null, null); + break; + case "rule": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.RuleQuery)value.Variant, null, null); + break; + case "script": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.ScriptQuery)value.Variant, null, null); + break; + case "script_score": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreQuery)value.Variant, null, null); + break; + case "semantic": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SemanticQuery)value.Variant, null, null); + break; + case "shape": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.ShapeQuery)value.Variant, null, null); + break; + case "simple_query_string": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringQuery)value.Variant, null, null); + break; + case "span_containing": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanContainingQuery)value.Variant, null, null); + break; + case "span_field_masking": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanFieldMaskingQuery)value.Variant, null, null); + break; + case "span_first": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanFirstQuery)value.Variant, null, null); + break; + case "span_multi": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanMultiTermQuery)value.Variant, null, null); + break; + case "span_near": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanNearQuery)value.Variant, null, null); + break; + case "span_not": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanNotQuery)value.Variant, null, null); + break; + case "span_or": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanOrQuery)value.Variant, null, null); + break; + case "span_term": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanTermQuery)value.Variant, null, null); + break; + case "span_within": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanWithinQuery)value.Variant, null, null); + break; + case "sparse_vector": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SparseVectorQuery)value.Variant, null, null); + break; + case "term": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.TermQuery)value.Variant, null, null); + break; + case "terms": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.TermsQuery)value.Variant, null, null); + break; + case "terms_set": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.TermsSetQuery)value.Variant, null, null); + break; + case "text_expansion": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.TextExpansionQuery)value.Variant, null, null); + break; + case "type": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.TypeQuery)value.Variant, null, null); + break; + case "weighted_tokens": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.WeightedTokensQuery)value.Variant, null, null); + break; + case "wildcard": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.WildcardQuery)value.Variant, null, null); + break; + case "wrapper": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.WrapperQuery)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.Query)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Query.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Query.g.cs index d39ba7c2663..3c9bee3ebb9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Query.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/Query.g.cs @@ -23,782 +23,8 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class QueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantBool = System.Text.Json.JsonEncodedText.Encode("bool"); - private static readonly System.Text.Json.JsonEncodedText VariantBoosting = System.Text.Json.JsonEncodedText.Encode("boosting"); - private static readonly System.Text.Json.JsonEncodedText VariantCombinedFields = System.Text.Json.JsonEncodedText.Encode("combined_fields"); - private static readonly System.Text.Json.JsonEncodedText VariantCommon = System.Text.Json.JsonEncodedText.Encode("common"); - private static readonly System.Text.Json.JsonEncodedText VariantConstantScore = System.Text.Json.JsonEncodedText.Encode("constant_score"); - private static readonly System.Text.Json.JsonEncodedText VariantDisMax = System.Text.Json.JsonEncodedText.Encode("dis_max"); - private static readonly System.Text.Json.JsonEncodedText VariantDistanceFeature = System.Text.Json.JsonEncodedText.Encode("distance_feature"); - private static readonly System.Text.Json.JsonEncodedText VariantExists = System.Text.Json.JsonEncodedText.Encode("exists"); - private static readonly System.Text.Json.JsonEncodedText VariantFunctionScore = System.Text.Json.JsonEncodedText.Encode("function_score"); - private static readonly System.Text.Json.JsonEncodedText VariantFuzzy = System.Text.Json.JsonEncodedText.Encode("fuzzy"); - private static readonly System.Text.Json.JsonEncodedText VariantGeoBoundingBox = System.Text.Json.JsonEncodedText.Encode("geo_bounding_box"); - private static readonly System.Text.Json.JsonEncodedText VariantGeoDistance = System.Text.Json.JsonEncodedText.Encode("geo_distance"); - private static readonly System.Text.Json.JsonEncodedText VariantGeoGrid = System.Text.Json.JsonEncodedText.Encode("geo_grid"); - private static readonly System.Text.Json.JsonEncodedText VariantGeoPolygon = System.Text.Json.JsonEncodedText.Encode("geo_polygon"); - private static readonly System.Text.Json.JsonEncodedText VariantGeoShape = System.Text.Json.JsonEncodedText.Encode("geo_shape"); - private static readonly System.Text.Json.JsonEncodedText VariantHasChild = System.Text.Json.JsonEncodedText.Encode("has_child"); - private static readonly System.Text.Json.JsonEncodedText VariantHasParent = System.Text.Json.JsonEncodedText.Encode("has_parent"); - private static readonly System.Text.Json.JsonEncodedText VariantIds = System.Text.Json.JsonEncodedText.Encode("ids"); - private static readonly System.Text.Json.JsonEncodedText VariantIntervals = System.Text.Json.JsonEncodedText.Encode("intervals"); - private static readonly System.Text.Json.JsonEncodedText VariantKnn = System.Text.Json.JsonEncodedText.Encode("knn"); - private static readonly System.Text.Json.JsonEncodedText VariantMatch = System.Text.Json.JsonEncodedText.Encode("match"); - private static readonly System.Text.Json.JsonEncodedText VariantMatchAll = System.Text.Json.JsonEncodedText.Encode("match_all"); - private static readonly System.Text.Json.JsonEncodedText VariantMatchBoolPrefix = System.Text.Json.JsonEncodedText.Encode("match_bool_prefix"); - private static readonly System.Text.Json.JsonEncodedText VariantMatchNone = System.Text.Json.JsonEncodedText.Encode("match_none"); - private static readonly System.Text.Json.JsonEncodedText VariantMatchPhrase = System.Text.Json.JsonEncodedText.Encode("match_phrase"); - private static readonly System.Text.Json.JsonEncodedText VariantMatchPhrasePrefix = System.Text.Json.JsonEncodedText.Encode("match_phrase_prefix"); - private static readonly System.Text.Json.JsonEncodedText VariantMoreLikeThis = System.Text.Json.JsonEncodedText.Encode("more_like_this"); - private static readonly System.Text.Json.JsonEncodedText VariantMultiMatch = System.Text.Json.JsonEncodedText.Encode("multi_match"); - private static readonly System.Text.Json.JsonEncodedText VariantNested = System.Text.Json.JsonEncodedText.Encode("nested"); - private static readonly System.Text.Json.JsonEncodedText VariantParentId = System.Text.Json.JsonEncodedText.Encode("parent_id"); - private static readonly System.Text.Json.JsonEncodedText VariantPercolate = System.Text.Json.JsonEncodedText.Encode("percolate"); - private static readonly System.Text.Json.JsonEncodedText VariantPinned = System.Text.Json.JsonEncodedText.Encode("pinned"); - private static readonly System.Text.Json.JsonEncodedText VariantPrefix = System.Text.Json.JsonEncodedText.Encode("prefix"); - private static readonly System.Text.Json.JsonEncodedText VariantQueryString = System.Text.Json.JsonEncodedText.Encode("query_string"); - private static readonly System.Text.Json.JsonEncodedText VariantRange = System.Text.Json.JsonEncodedText.Encode("range"); - private static readonly System.Text.Json.JsonEncodedText VariantRankFeature = System.Text.Json.JsonEncodedText.Encode("rank_feature"); - private static readonly System.Text.Json.JsonEncodedText VariantRegexp = System.Text.Json.JsonEncodedText.Encode("regexp"); - private static readonly System.Text.Json.JsonEncodedText VariantRule = System.Text.Json.JsonEncodedText.Encode("rule"); - private static readonly System.Text.Json.JsonEncodedText VariantScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText VariantScriptScore = System.Text.Json.JsonEncodedText.Encode("script_score"); - private static readonly System.Text.Json.JsonEncodedText VariantSemantic = System.Text.Json.JsonEncodedText.Encode("semantic"); - private static readonly System.Text.Json.JsonEncodedText VariantShape = System.Text.Json.JsonEncodedText.Encode("shape"); - private static readonly System.Text.Json.JsonEncodedText VariantSimpleQueryString = System.Text.Json.JsonEncodedText.Encode("simple_query_string"); - private static readonly System.Text.Json.JsonEncodedText VariantSpanContaining = System.Text.Json.JsonEncodedText.Encode("span_containing"); - private static readonly System.Text.Json.JsonEncodedText VariantSpanFieldMasking = System.Text.Json.JsonEncodedText.Encode("span_field_masking"); - private static readonly System.Text.Json.JsonEncodedText VariantSpanFirst = System.Text.Json.JsonEncodedText.Encode("span_first"); - private static readonly System.Text.Json.JsonEncodedText VariantSpanMulti = System.Text.Json.JsonEncodedText.Encode("span_multi"); - private static readonly System.Text.Json.JsonEncodedText VariantSpanNear = System.Text.Json.JsonEncodedText.Encode("span_near"); - private static readonly System.Text.Json.JsonEncodedText VariantSpanNot = System.Text.Json.JsonEncodedText.Encode("span_not"); - private static readonly System.Text.Json.JsonEncodedText VariantSpanOr = System.Text.Json.JsonEncodedText.Encode("span_or"); - private static readonly System.Text.Json.JsonEncodedText VariantSpanTerm = System.Text.Json.JsonEncodedText.Encode("span_term"); - private static readonly System.Text.Json.JsonEncodedText VariantSpanWithin = System.Text.Json.JsonEncodedText.Encode("span_within"); - private static readonly System.Text.Json.JsonEncodedText VariantSparseVector = System.Text.Json.JsonEncodedText.Encode("sparse_vector"); - private static readonly System.Text.Json.JsonEncodedText VariantTerm = System.Text.Json.JsonEncodedText.Encode("term"); - private static readonly System.Text.Json.JsonEncodedText VariantTerms = System.Text.Json.JsonEncodedText.Encode("terms"); - private static readonly System.Text.Json.JsonEncodedText VariantTermsSet = System.Text.Json.JsonEncodedText.Encode("terms_set"); - private static readonly System.Text.Json.JsonEncodedText VariantTextExpansion = System.Text.Json.JsonEncodedText.Encode("text_expansion"); - private static readonly System.Text.Json.JsonEncodedText VariantType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText VariantWeightedTokens = System.Text.Json.JsonEncodedText.Encode("weighted_tokens"); - private static readonly System.Text.Json.JsonEncodedText VariantWildcard = System.Text.Json.JsonEncodedText.Encode("wildcard"); - private static readonly System.Text.Json.JsonEncodedText VariantWrapper = System.Text.Json.JsonEncodedText.Encode("wrapper"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.Query Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantBool)) - { - variantType = VariantBool.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantBoosting)) - { - variantType = VariantBoosting.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantCombinedFields)) - { - variantType = VariantCombinedFields.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantCommon)) - { - variantType = VariantCommon.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantConstantScore)) - { - variantType = VariantConstantScore.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantDisMax)) - { - variantType = VariantDisMax.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantDistanceFeature)) - { - variantType = VariantDistanceFeature.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantExists)) - { - variantType = VariantExists.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantFunctionScore)) - { - variantType = VariantFunctionScore.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantFuzzy)) - { - variantType = VariantFuzzy.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantGeoBoundingBox)) - { - variantType = VariantGeoBoundingBox.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantGeoDistance)) - { - variantType = VariantGeoDistance.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantGeoGrid)) - { - variantType = VariantGeoGrid.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantGeoPolygon)) - { - variantType = VariantGeoPolygon.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantGeoShape)) - { - variantType = VariantGeoShape.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantHasChild)) - { - variantType = VariantHasChild.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantHasParent)) - { - variantType = VariantHasParent.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantIds)) - { - variantType = VariantIds.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantIntervals)) - { - variantType = VariantIntervals.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantKnn)) - { - variantType = VariantKnn.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMatch)) - { - variantType = VariantMatch.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMatchAll)) - { - variantType = VariantMatchAll.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMatchBoolPrefix)) - { - variantType = VariantMatchBoolPrefix.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMatchNone)) - { - variantType = VariantMatchNone.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMatchPhrase)) - { - variantType = VariantMatchPhrase.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMatchPhrasePrefix)) - { - variantType = VariantMatchPhrasePrefix.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMoreLikeThis)) - { - variantType = VariantMoreLikeThis.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMultiMatch)) - { - variantType = VariantMultiMatch.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantNested)) - { - variantType = VariantNested.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantParentId)) - { - variantType = VariantParentId.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantPercolate)) - { - variantType = VariantPercolate.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantPinned)) - { - variantType = VariantPinned.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantPrefix)) - { - variantType = VariantPrefix.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantQueryString)) - { - variantType = VariantQueryString.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRange)) - { - variantType = VariantRange.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRankFeature)) - { - variantType = VariantRankFeature.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRegexp)) - { - variantType = VariantRegexp.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRule)) - { - variantType = VariantRule.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantScript)) - { - variantType = VariantScript.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantScriptScore)) - { - variantType = VariantScriptScore.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSemantic)) - { - variantType = VariantSemantic.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantShape)) - { - variantType = VariantShape.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSimpleQueryString)) - { - variantType = VariantSimpleQueryString.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSpanContaining)) - { - variantType = VariantSpanContaining.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSpanFieldMasking)) - { - variantType = VariantSpanFieldMasking.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSpanFirst)) - { - variantType = VariantSpanFirst.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSpanMulti)) - { - variantType = VariantSpanMulti.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSpanNear)) - { - variantType = VariantSpanNear.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSpanNot)) - { - variantType = VariantSpanNot.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSpanOr)) - { - variantType = VariantSpanOr.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSpanTerm)) - { - variantType = VariantSpanTerm.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSpanWithin)) - { - variantType = VariantSpanWithin.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSparseVector)) - { - variantType = VariantSparseVector.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTerm)) - { - variantType = VariantTerm.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTerms)) - { - variantType = VariantTerms.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTermsSet)) - { - variantType = VariantTermsSet.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTextExpansion)) - { - variantType = VariantTextExpansion.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantType)) - { - variantType = VariantType.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantWeightedTokens)) - { - variantType = VariantWeightedTokens.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantWildcard)) - { - variantType = VariantWildcard.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantWrapper)) - { - variantType = VariantWrapper.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.Query(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.Query value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "bool": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.BoolQuery)value.Variant, null, null); - break; - case "boosting": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.BoostingQuery)value.Variant, null, null); - break; - case "combined_fields": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.CombinedFieldsQuery)value.Variant, null, null); - break; - case "common": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.CommonTermsQuery)value.Variant, null, null); - break; - case "constant_score": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.ConstantScoreQuery)value.Variant, null, null); - break; - case "dis_max": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.DisMaxQuery)value.Variant, null, null); - break; - case "distance_feature": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IDistanceFeatureQuery)value.Variant, null, null); - break; - case "exists": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.ExistsQuery)value.Variant, null, null); - break; - case "function_score": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreQuery)value.Variant, null, null); - break; - case "fuzzy": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.FuzzyQuery)value.Variant, null, null); - break; - case "geo_bounding_box": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.GeoBoundingBoxQuery)value.Variant, null, null); - break; - case "geo_distance": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceQuery)value.Variant, null, null); - break; - case "geo_grid": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.GeoGridQuery)value.Variant, null, null); - break; - case "geo_polygon": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonQuery)value.Variant, null, null); - break; - case "geo_shape": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.GeoShapeQuery)value.Variant, null, null); - break; - case "has_child": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.HasChildQuery)value.Variant, null, null); - break; - case "has_parent": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.HasParentQuery)value.Variant, null, null); - break; - case "ids": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IdsQuery)value.Variant, null, null); - break; - case "intervals": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IntervalsQuery)value.Variant, null, null); - break; - case "knn": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.KnnQuery)value.Variant, null, null); - break; - case "match": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MatchQuery)value.Variant, null, null); - break; - case "match_all": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MatchAllQuery)value.Variant, null, null); - break; - case "match_bool_prefix": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MatchBoolPrefixQuery)value.Variant, null, null); - break; - case "match_none": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MatchNoneQuery)value.Variant, null, null); - break; - case "match_phrase": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MatchPhraseQuery)value.Variant, null, null); - break; - case "match_phrase_prefix": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MatchPhrasePrefixQuery)value.Variant, null, null); - break; - case "more_like_this": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQuery)value.Variant, null, null); - break; - case "multi_match": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MultiMatchQuery)value.Variant, null, null); - break; - case "nested": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.NestedQuery)value.Variant, null, null); - break; - case "parent_id": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.ParentIdQuery)value.Variant, null, null); - break; - case "percolate": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.PercolateQuery)value.Variant, null, null); - break; - case "pinned": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.PinnedQuery)value.Variant, null, null); - break; - case "prefix": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.PrefixQuery)value.Variant, null, null); - break; - case "query_string": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.QueryStringQuery)value.Variant, null, null); - break; - case "range": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IRangeQuery)value.Variant, null, null); - break; - case "rank_feature": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureQuery)value.Variant, null, null); - break; - case "regexp": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.RegexpQuery)value.Variant, null, null); - break; - case "rule": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.RuleQuery)value.Variant, null, null); - break; - case "script": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.ScriptQuery)value.Variant, null, null); - break; - case "script_score": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreQuery)value.Variant, null, null); - break; - case "semantic": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SemanticQuery)value.Variant, null, null); - break; - case "shape": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.ShapeQuery)value.Variant, null, null); - break; - case "simple_query_string": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringQuery)value.Variant, null, null); - break; - case "span_containing": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanContainingQuery)value.Variant, null, null); - break; - case "span_field_masking": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanFieldMaskingQuery)value.Variant, null, null); - break; - case "span_first": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanFirstQuery)value.Variant, null, null); - break; - case "span_multi": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanMultiTermQuery)value.Variant, null, null); - break; - case "span_near": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanNearQuery)value.Variant, null, null); - break; - case "span_not": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanNotQuery)value.Variant, null, null); - break; - case "span_or": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanOrQuery)value.Variant, null, null); - break; - case "span_term": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanTermQuery)value.Variant, null, null); - break; - case "span_within": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanWithinQuery)value.Variant, null, null); - break; - case "sparse_vector": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SparseVectorQuery)value.Variant, null, null); - break; - case "term": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.TermQuery)value.Variant, null, null); - break; - case "terms": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.TermsQuery)value.Variant, null, null); - break; - case "terms_set": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.TermsSetQuery)value.Variant, null, null); - break; - case "text_expansion": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.TextExpansionQuery)value.Variant, null, null); - break; - case "type": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.TypeQuery)value.Variant, null, null); - break; - case "weighted_tokens": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.WeightedTokensQuery)value.Variant, null, null); - break; - case "wildcard": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.WildcardQuery)value.Variant, null, null); - break; - case "wrapper": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.WrapperQuery)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.Query)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.QueryConverter))] -public sealed partial class Query +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.QueryConverter))] +public partial class Query { internal string? VariantType { get; set; } internal object? Variant { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/QueryStringQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/QueryStringQuery.Converters.g.cs new file mode 100644 index 00000000000..97f8726e0d8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/QueryStringQuery.Converters.g.cs @@ -0,0 +1,297 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class QueryStringQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowLeadingWildcard = System.Text.Json.JsonEncodedText.Encode("allow_leading_wildcard"); + private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropAnalyzeWildcard = System.Text.Json.JsonEncodedText.Encode("analyze_wildcard"); + private static readonly System.Text.Json.JsonEncodedText PropAutoGenerateSynonymsPhraseQuery = System.Text.Json.JsonEncodedText.Encode("auto_generate_synonyms_phrase_query"); + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropDefaultField = System.Text.Json.JsonEncodedText.Encode("default_field"); + private static readonly System.Text.Json.JsonEncodedText PropDefaultOperator = System.Text.Json.JsonEncodedText.Encode("default_operator"); + private static readonly System.Text.Json.JsonEncodedText PropEnablePositionIncrements = System.Text.Json.JsonEncodedText.Encode("enable_position_increments"); + private static readonly System.Text.Json.JsonEncodedText PropEscape = System.Text.Json.JsonEncodedText.Encode("escape"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropFuzziness = System.Text.Json.JsonEncodedText.Encode("fuzziness"); + private static readonly System.Text.Json.JsonEncodedText PropFuzzyMaxExpansions = System.Text.Json.JsonEncodedText.Encode("fuzzy_max_expansions"); + private static readonly System.Text.Json.JsonEncodedText PropFuzzyPrefixLength = System.Text.Json.JsonEncodedText.Encode("fuzzy_prefix_length"); + private static readonly System.Text.Json.JsonEncodedText PropFuzzyRewrite = System.Text.Json.JsonEncodedText.Encode("fuzzy_rewrite"); + private static readonly System.Text.Json.JsonEncodedText PropFuzzyTranspositions = System.Text.Json.JsonEncodedText.Encode("fuzzy_transpositions"); + private static readonly System.Text.Json.JsonEncodedText PropLenient = System.Text.Json.JsonEncodedText.Encode("lenient"); + private static readonly System.Text.Json.JsonEncodedText PropMaxDeterminizedStates = System.Text.Json.JsonEncodedText.Encode("max_determinized_states"); + private static readonly System.Text.Json.JsonEncodedText PropMinimumShouldMatch = System.Text.Json.JsonEncodedText.Encode("minimum_should_match"); + private static readonly System.Text.Json.JsonEncodedText PropPhraseSlop = System.Text.Json.JsonEncodedText.Encode("phrase_slop"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropQuoteAnalyzer = System.Text.Json.JsonEncodedText.Encode("quote_analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropQuoteFieldSuffix = System.Text.Json.JsonEncodedText.Encode("quote_field_suffix"); + private static readonly System.Text.Json.JsonEncodedText PropRewrite = System.Text.Json.JsonEncodedText.Encode("rewrite"); + private static readonly System.Text.Json.JsonEncodedText PropTieBreaker = System.Text.Json.JsonEncodedText.Encode("tie_breaker"); + private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.QueryStringQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowLeadingWildcard = default; + LocalJsonValue propAnalyzer = default; + LocalJsonValue propAnalyzeWildcard = default; + LocalJsonValue propAutoGenerateSynonymsPhraseQuery = default; + LocalJsonValue propBoost = default; + LocalJsonValue propDefaultField = default; + LocalJsonValue propDefaultOperator = default; + LocalJsonValue propEnablePositionIncrements = default; + LocalJsonValue propEscape = default; + LocalJsonValue propFields = default; + LocalJsonValue propFuzziness = default; + LocalJsonValue propFuzzyMaxExpansions = default; + LocalJsonValue propFuzzyPrefixLength = default; + LocalJsonValue propFuzzyRewrite = default; + LocalJsonValue propFuzzyTranspositions = default; + LocalJsonValue propLenient = default; + LocalJsonValue propMaxDeterminizedStates = default; + LocalJsonValue propMinimumShouldMatch = default; + LocalJsonValue propPhraseSlop = default; + LocalJsonValue propQuery = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propQuoteAnalyzer = default; + LocalJsonValue propQuoteFieldSuffix = default; + LocalJsonValue propRewrite = default; + LocalJsonValue propTieBreaker = default; + LocalJsonValue propTimeZone = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowLeadingWildcard.TryReadProperty(ref reader, options, PropAllowLeadingWildcard, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) + { + continue; + } + + if (propAnalyzeWildcard.TryReadProperty(ref reader, options, PropAnalyzeWildcard, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propAutoGenerateSynonymsPhraseQuery.TryReadProperty(ref reader, options, PropAutoGenerateSynonymsPhraseQuery, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDefaultField.TryReadProperty(ref reader, options, PropDefaultField, null)) + { + continue; + } + + if (propDefaultOperator.TryReadProperty(ref reader, options, PropDefaultOperator, static Elastic.Clients.Elasticsearch.QueryDsl.Operator? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEnablePositionIncrements.TryReadProperty(ref reader, options, PropEnablePositionIncrements, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEscape.TryReadProperty(ref reader, options, PropEscape, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propFuzziness.TryReadProperty(ref reader, options, PropFuzziness, null)) + { + continue; + } + + if (propFuzzyMaxExpansions.TryReadProperty(ref reader, options, PropFuzzyMaxExpansions, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFuzzyPrefixLength.TryReadProperty(ref reader, options, PropFuzzyPrefixLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFuzzyRewrite.TryReadProperty(ref reader, options, PropFuzzyRewrite, null)) + { + continue; + } + + if (propFuzzyTranspositions.TryReadProperty(ref reader, options, PropFuzzyTranspositions, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLenient.TryReadProperty(ref reader, options, PropLenient, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxDeterminizedStates.TryReadProperty(ref reader, options, PropMaxDeterminizedStates, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinimumShouldMatch.TryReadProperty(ref reader, options, PropMinimumShouldMatch, null)) + { + continue; + } + + if (propPhraseSlop.TryReadProperty(ref reader, options, PropPhraseSlop, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propQuoteAnalyzer.TryReadProperty(ref reader, options, PropQuoteAnalyzer, null)) + { + continue; + } + + if (propQuoteFieldSuffix.TryReadProperty(ref reader, options, PropQuoteFieldSuffix, null)) + { + continue; + } + + if (propRewrite.TryReadProperty(ref reader, options, PropRewrite, null)) + { + continue; + } + + if (propTieBreaker.TryReadProperty(ref reader, options, PropTieBreaker, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeZone.TryReadProperty(ref reader, options, PropTimeZone, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, static Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.QueryStringQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowLeadingWildcard = propAllowLeadingWildcard.Value, + Analyzer = propAnalyzer.Value, + AnalyzeWildcard = propAnalyzeWildcard.Value, + AutoGenerateSynonymsPhraseQuery = propAutoGenerateSynonymsPhraseQuery.Value, + Boost = propBoost.Value, + DefaultField = propDefaultField.Value, + DefaultOperator = propDefaultOperator.Value, + EnablePositionIncrements = propEnablePositionIncrements.Value, + Escape = propEscape.Value, + Fields = propFields.Value, + Fuzziness = propFuzziness.Value, + FuzzyMaxExpansions = propFuzzyMaxExpansions.Value, + FuzzyPrefixLength = propFuzzyPrefixLength.Value, + FuzzyRewrite = propFuzzyRewrite.Value, + FuzzyTranspositions = propFuzzyTranspositions.Value, + Lenient = propLenient.Value, + MaxDeterminizedStates = propMaxDeterminizedStates.Value, + MinimumShouldMatch = propMinimumShouldMatch.Value, + PhraseSlop = propPhraseSlop.Value, + Query = propQuery.Value, + QueryName = propQueryName.Value, + QuoteAnalyzer = propQuoteAnalyzer.Value, + QuoteFieldSuffix = propQuoteFieldSuffix.Value, + Rewrite = propRewrite.Value, + TieBreaker = propTieBreaker.Value, + TimeZone = propTimeZone.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.QueryStringQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowLeadingWildcard, value.AllowLeadingWildcard, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); + writer.WriteProperty(options, PropAnalyzeWildcard, value.AnalyzeWildcard, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropAutoGenerateSynonymsPhraseQuery, value.AutoGenerateSynonymsPhraseQuery, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDefaultField, value.DefaultField, null, null); + writer.WriteProperty(options, PropDefaultOperator, value.DefaultOperator, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.Operator? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEnablePositionIncrements, value.EnablePositionIncrements, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEscape, value.Escape, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropFuzziness, value.Fuzziness, null, null); + writer.WriteProperty(options, PropFuzzyMaxExpansions, value.FuzzyMaxExpansions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFuzzyPrefixLength, value.FuzzyPrefixLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFuzzyRewrite, value.FuzzyRewrite, null, null); + writer.WriteProperty(options, PropFuzzyTranspositions, value.FuzzyTranspositions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLenient, value.Lenient, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxDeterminizedStates, value.MaxDeterminizedStates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinimumShouldMatch, value.MinimumShouldMatch, null, null); + writer.WriteProperty(options, PropPhraseSlop, value.PhraseSlop, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropQuoteAnalyzer, value.QuoteAnalyzer, null, null); + writer.WriteProperty(options, PropQuoteFieldSuffix, value.QuoteFieldSuffix, null, null); + writer.WriteProperty(options, PropRewrite, value.Rewrite, null, null); + writer.WriteProperty(options, PropTieBreaker, value.TieBreaker, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); + writer.WriteProperty(options, PropType, value.Type, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/QueryStringQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/QueryStringQuery.g.cs index 9c6cfb2546b..272436c5e3a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/QueryStringQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/QueryStringQuery.g.cs @@ -23,280 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class QueryStringQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowLeadingWildcard = System.Text.Json.JsonEncodedText.Encode("allow_leading_wildcard"); - private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropAnalyzeWildcard = System.Text.Json.JsonEncodedText.Encode("analyze_wildcard"); - private static readonly System.Text.Json.JsonEncodedText PropAutoGenerateSynonymsPhraseQuery = System.Text.Json.JsonEncodedText.Encode("auto_generate_synonyms_phrase_query"); - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropDefaultField = System.Text.Json.JsonEncodedText.Encode("default_field"); - private static readonly System.Text.Json.JsonEncodedText PropDefaultOperator = System.Text.Json.JsonEncodedText.Encode("default_operator"); - private static readonly System.Text.Json.JsonEncodedText PropEnablePositionIncrements = System.Text.Json.JsonEncodedText.Encode("enable_position_increments"); - private static readonly System.Text.Json.JsonEncodedText PropEscape = System.Text.Json.JsonEncodedText.Encode("escape"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropFuzziness = System.Text.Json.JsonEncodedText.Encode("fuzziness"); - private static readonly System.Text.Json.JsonEncodedText PropFuzzyMaxExpansions = System.Text.Json.JsonEncodedText.Encode("fuzzy_max_expansions"); - private static readonly System.Text.Json.JsonEncodedText PropFuzzyPrefixLength = System.Text.Json.JsonEncodedText.Encode("fuzzy_prefix_length"); - private static readonly System.Text.Json.JsonEncodedText PropFuzzyRewrite = System.Text.Json.JsonEncodedText.Encode("fuzzy_rewrite"); - private static readonly System.Text.Json.JsonEncodedText PropFuzzyTranspositions = System.Text.Json.JsonEncodedText.Encode("fuzzy_transpositions"); - private static readonly System.Text.Json.JsonEncodedText PropLenient = System.Text.Json.JsonEncodedText.Encode("lenient"); - private static readonly System.Text.Json.JsonEncodedText PropMaxDeterminizedStates = System.Text.Json.JsonEncodedText.Encode("max_determinized_states"); - private static readonly System.Text.Json.JsonEncodedText PropMinimumShouldMatch = System.Text.Json.JsonEncodedText.Encode("minimum_should_match"); - private static readonly System.Text.Json.JsonEncodedText PropPhraseSlop = System.Text.Json.JsonEncodedText.Encode("phrase_slop"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropQuoteAnalyzer = System.Text.Json.JsonEncodedText.Encode("quote_analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropQuoteFieldSuffix = System.Text.Json.JsonEncodedText.Encode("quote_field_suffix"); - private static readonly System.Text.Json.JsonEncodedText PropRewrite = System.Text.Json.JsonEncodedText.Encode("rewrite"); - private static readonly System.Text.Json.JsonEncodedText PropTieBreaker = System.Text.Json.JsonEncodedText.Encode("tie_breaker"); - private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.QueryStringQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowLeadingWildcard = default; - LocalJsonValue propAnalyzer = default; - LocalJsonValue propAnalyzeWildcard = default; - LocalJsonValue propAutoGenerateSynonymsPhraseQuery = default; - LocalJsonValue propBoost = default; - LocalJsonValue propDefaultField = default; - LocalJsonValue propDefaultOperator = default; - LocalJsonValue propEnablePositionIncrements = default; - LocalJsonValue propEscape = default; - LocalJsonValue propFields = default; - LocalJsonValue propFuzziness = default; - LocalJsonValue propFuzzyMaxExpansions = default; - LocalJsonValue propFuzzyPrefixLength = default; - LocalJsonValue propFuzzyRewrite = default; - LocalJsonValue propFuzzyTranspositions = default; - LocalJsonValue propLenient = default; - LocalJsonValue propMaxDeterminizedStates = default; - LocalJsonValue propMinimumShouldMatch = default; - LocalJsonValue propPhraseSlop = default; - LocalJsonValue propQuery = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propQuoteAnalyzer = default; - LocalJsonValue propQuoteFieldSuffix = default; - LocalJsonValue propRewrite = default; - LocalJsonValue propTieBreaker = default; - LocalJsonValue propTimeZone = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowLeadingWildcard.TryReadProperty(ref reader, options, PropAllowLeadingWildcard, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) - { - continue; - } - - if (propAnalyzeWildcard.TryReadProperty(ref reader, options, PropAnalyzeWildcard, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propAutoGenerateSynonymsPhraseQuery.TryReadProperty(ref reader, options, PropAutoGenerateSynonymsPhraseQuery, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDefaultField.TryReadProperty(ref reader, options, PropDefaultField, null)) - { - continue; - } - - if (propDefaultOperator.TryReadProperty(ref reader, options, PropDefaultOperator, static Elastic.Clients.Elasticsearch.QueryDsl.Operator? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEnablePositionIncrements.TryReadProperty(ref reader, options, PropEnablePositionIncrements, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEscape.TryReadProperty(ref reader, options, PropEscape, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propFuzziness.TryReadProperty(ref reader, options, PropFuzziness, null)) - { - continue; - } - - if (propFuzzyMaxExpansions.TryReadProperty(ref reader, options, PropFuzzyMaxExpansions, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFuzzyPrefixLength.TryReadProperty(ref reader, options, PropFuzzyPrefixLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFuzzyRewrite.TryReadProperty(ref reader, options, PropFuzzyRewrite, null)) - { - continue; - } - - if (propFuzzyTranspositions.TryReadProperty(ref reader, options, PropFuzzyTranspositions, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLenient.TryReadProperty(ref reader, options, PropLenient, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxDeterminizedStates.TryReadProperty(ref reader, options, PropMaxDeterminizedStates, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinimumShouldMatch.TryReadProperty(ref reader, options, PropMinimumShouldMatch, null)) - { - continue; - } - - if (propPhraseSlop.TryReadProperty(ref reader, options, PropPhraseSlop, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propQuoteAnalyzer.TryReadProperty(ref reader, options, PropQuoteAnalyzer, null)) - { - continue; - } - - if (propQuoteFieldSuffix.TryReadProperty(ref reader, options, PropQuoteFieldSuffix, null)) - { - continue; - } - - if (propRewrite.TryReadProperty(ref reader, options, PropRewrite, null)) - { - continue; - } - - if (propTieBreaker.TryReadProperty(ref reader, options, PropTieBreaker, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeZone.TryReadProperty(ref reader, options, PropTimeZone, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, static Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.QueryStringQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowLeadingWildcard = propAllowLeadingWildcard.Value, - Analyzer = propAnalyzer.Value, - AnalyzeWildcard = propAnalyzeWildcard.Value, - AutoGenerateSynonymsPhraseQuery = propAutoGenerateSynonymsPhraseQuery.Value, - Boost = propBoost.Value, - DefaultField = propDefaultField.Value, - DefaultOperator = propDefaultOperator.Value, - EnablePositionIncrements = propEnablePositionIncrements.Value, - Escape = propEscape.Value, - Fields = propFields.Value, - Fuzziness = propFuzziness.Value, - FuzzyMaxExpansions = propFuzzyMaxExpansions.Value, - FuzzyPrefixLength = propFuzzyPrefixLength.Value, - FuzzyRewrite = propFuzzyRewrite.Value, - FuzzyTranspositions = propFuzzyTranspositions.Value, - Lenient = propLenient.Value, - MaxDeterminizedStates = propMaxDeterminizedStates.Value, - MinimumShouldMatch = propMinimumShouldMatch.Value, - PhraseSlop = propPhraseSlop.Value, - Query = propQuery.Value, - QueryName = propQueryName.Value, - QuoteAnalyzer = propQuoteAnalyzer.Value, - QuoteFieldSuffix = propQuoteFieldSuffix.Value, - Rewrite = propRewrite.Value, - TieBreaker = propTieBreaker.Value, - TimeZone = propTimeZone.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.QueryStringQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowLeadingWildcard, value.AllowLeadingWildcard, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); - writer.WriteProperty(options, PropAnalyzeWildcard, value.AnalyzeWildcard, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropAutoGenerateSynonymsPhraseQuery, value.AutoGenerateSynonymsPhraseQuery, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDefaultField, value.DefaultField, null, null); - writer.WriteProperty(options, PropDefaultOperator, value.DefaultOperator, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.Operator? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEnablePositionIncrements, value.EnablePositionIncrements, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEscape, value.Escape, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropFuzziness, value.Fuzziness, null, null); - writer.WriteProperty(options, PropFuzzyMaxExpansions, value.FuzzyMaxExpansions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFuzzyPrefixLength, value.FuzzyPrefixLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFuzzyRewrite, value.FuzzyRewrite, null, null); - writer.WriteProperty(options, PropFuzzyTranspositions, value.FuzzyTranspositions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLenient, value.Lenient, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxDeterminizedStates, value.MaxDeterminizedStates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinimumShouldMatch, value.MinimumShouldMatch, null, null); - writer.WriteProperty(options, PropPhraseSlop, value.PhraseSlop, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropQuoteAnalyzer, value.QuoteAnalyzer, null, null); - writer.WriteProperty(options, PropQuoteFieldSuffix, value.QuoteFieldSuffix, null, null); - writer.WriteProperty(options, PropRewrite, value.Rewrite, null, null); - writer.WriteProperty(options, PropTieBreaker, value.TieBreaker, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); - writer.WriteProperty(options, PropType, value.Type, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.QueryStringQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.QueryStringQueryConverter))] public sealed partial class QueryStringQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RandomScoreFunction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RandomScoreFunction.Converters.g.cs new file mode 100644 index 00000000000..966e88c2e22 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RandomScoreFunction.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class RandomScoreFunctionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropSeed = System.Text.Json.JsonEncodedText.Encode("seed"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.RandomScoreFunction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue?> propSeed = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propSeed.TryReadProperty(ref reader, options, PropSeed, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.RandomScoreFunction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Seed = propSeed.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.RandomScoreFunction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropSeed, value.Seed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RandomScoreFunction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RandomScoreFunction.g.cs index 0f11f388f4b..fb0512a1007 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RandomScoreFunction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RandomScoreFunction.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class RandomScoreFunctionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropSeed = System.Text.Json.JsonEncodedText.Encode("seed"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.RandomScoreFunction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue?> propSeed = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propSeed.TryReadProperty(ref reader, options, PropSeed, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.RandomScoreFunction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Seed = propSeed.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.RandomScoreFunction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropSeed, value.Seed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.RandomScoreFunctionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.RandomScoreFunctionConverter))] public sealed partial class RandomScoreFunction { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RangeQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RangeQuery.Converters.g.cs new file mode 100644 index 00000000000..aa885d36cbb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RangeQuery.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class IRangeQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.QueryDsl.IRangeQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return reader.ReadValue(options, null); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IRangeQuery value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQuery v: + writer.WriteValue(options, v, null); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQuery v: + writer.WriteValue(options, v, null); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.TermRangeQuery v: + writer.WriteValue(options, v, null); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQuery v: + writer.WriteValue(options, v, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.Type}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.IRangeQuery)}'."); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RangeQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RangeQuery.g.cs index 203f12cb1b3..ddaa4f5bd2f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RangeQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RangeQuery.g.cs @@ -23,36 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class IRangeQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.QueryDsl.IRangeQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return reader.ReadValue(options, null); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.IRangeQuery value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.QueryDsl.DateRangeQuery v: - writer.WriteValue(options, v, null); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.NumberRangeQuery v: - writer.WriteValue(options, v, null); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.TermRangeQuery v: - writer.WriteValue(options, v, null); - break; - case Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQuery v: - writer.WriteValue(options, v, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.Type}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.IRangeQuery)}'."); - } - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.IRangeQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.IRangeQueryConverter))] public partial interface IRangeQuery { public string Type { get; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RangeRelation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RangeRelation.Converters.g.cs new file mode 100644 index 00000000000..925a90ed2bf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RangeRelation.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class RangeRelationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberContains = System.Text.Json.JsonEncodedText.Encode("contains"); + private static readonly System.Text.Json.JsonEncodedText MemberIntersects = System.Text.Json.JsonEncodedText.Encode("intersects"); + private static readonly System.Text.Json.JsonEncodedText MemberWithin = System.Text.Json.JsonEncodedText.Encode("within"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberContains)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation.Contains; + } + + if (reader.ValueTextEquals(MemberIntersects)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation.Intersects; + } + + if (reader.ValueTextEquals(MemberWithin)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation.Within; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberContains.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation.Contains; + } + + if (string.Equals(value, MemberIntersects.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation.Intersects; + } + + if (string.Equals(value, MemberWithin.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation.Within; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation.Contains: + writer.WriteStringValue(MemberContains); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation.Intersects: + writer.WriteStringValue(MemberIntersects); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation.Within: + writer.WriteStringValue(MemberWithin); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RangeRelation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RangeRelation.g.cs new file mode 100644 index 00000000000..429dadfb326 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RangeRelation.g.cs @@ -0,0 +1,50 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.RangeRelationConverter))] +public enum RangeRelation +{ + /// + /// + /// Matches documents with a range field value that entirely contains the query’s range. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "contains")] + Contains, + /// + /// + /// Matches documents with a range field value that intersects the query’s range. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "intersects")] + Intersects, + /// + /// + /// Matches documents with a range field value entirely within the query’s range. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "within")] + Within +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionLinear.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionLinear.Converters.g.cs new file mode 100644 index 00000000000..0414eec9764 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionLinear.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class RankFeatureFunctionLinearConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLinear Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLinear(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLinear value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionLinear.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionLinear.g.cs index 0e74db7bbfa..f3f60e5a0f3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionLinear.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionLinear.g.cs @@ -23,36 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class RankFeatureFunctionLinearConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLinear Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLinear(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLinear value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLinearConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.RankFeatureFunctionLinearConverter))] public sealed partial class RankFeatureFunctionLinear { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionLogarithm.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionLogarithm.Converters.g.cs new file mode 100644 index 00000000000..617d5add316 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionLogarithm.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class RankFeatureFunctionLogarithmConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropScalingFactor = System.Text.Json.JsonEncodedText.Encode("scaling_factor"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLogarithm Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propScalingFactor = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propScalingFactor.TryReadProperty(ref reader, options, PropScalingFactor, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLogarithm(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ScalingFactor = propScalingFactor.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLogarithm value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropScalingFactor, value.ScalingFactor, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionLogarithm.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionLogarithm.g.cs index 49d3c82b2e9..3373580d6c3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionLogarithm.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionLogarithm.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class RankFeatureFunctionLogarithmConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropScalingFactor = System.Text.Json.JsonEncodedText.Encode("scaling_factor"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLogarithm Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propScalingFactor = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propScalingFactor.TryReadProperty(ref reader, options, PropScalingFactor, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLogarithm(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ScalingFactor = propScalingFactor.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLogarithm value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropScalingFactor, value.ScalingFactor, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionLogarithmConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.RankFeatureFunctionLogarithmConverter))] public sealed partial class RankFeatureFunctionLogarithm { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionSaturation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionSaturation.Converters.g.cs new file mode 100644 index 00000000000..0e0aba19ef3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionSaturation.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class RankFeatureFunctionSaturationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPivot = System.Text.Json.JsonEncodedText.Encode("pivot"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSaturation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPivot = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPivot.TryReadProperty(ref reader, options, PropPivot, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSaturation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Pivot = propPivot.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSaturation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPivot, value.Pivot, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionSaturation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionSaturation.g.cs index 0ae08f26668..a358a097325 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionSaturation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionSaturation.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class RankFeatureFunctionSaturationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPivot = System.Text.Json.JsonEncodedText.Encode("pivot"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSaturation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPivot = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPivot.TryReadProperty(ref reader, options, PropPivot, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSaturation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Pivot = propPivot.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSaturation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPivot, value.Pivot, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSaturationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.RankFeatureFunctionSaturationConverter))] public sealed partial class RankFeatureFunctionSaturation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionSigmoid.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionSigmoid.Converters.g.cs new file mode 100644 index 00000000000..4191c944d86 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionSigmoid.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class RankFeatureFunctionSigmoidConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExponent = System.Text.Json.JsonEncodedText.Encode("exponent"); + private static readonly System.Text.Json.JsonEncodedText PropPivot = System.Text.Json.JsonEncodedText.Encode("pivot"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSigmoid Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExponent = default; + LocalJsonValue propPivot = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExponent.TryReadProperty(ref reader, options, PropExponent, null)) + { + continue; + } + + if (propPivot.TryReadProperty(ref reader, options, PropPivot, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSigmoid(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Exponent = propExponent.Value, + Pivot = propPivot.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSigmoid value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExponent, value.Exponent, null, null); + writer.WriteProperty(options, PropPivot, value.Pivot, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionSigmoid.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionSigmoid.g.cs index bacef49c5ed..db1bfc0adf7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionSigmoid.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureFunctionSigmoid.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class RankFeatureFunctionSigmoidConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExponent = System.Text.Json.JsonEncodedText.Encode("exponent"); - private static readonly System.Text.Json.JsonEncodedText PropPivot = System.Text.Json.JsonEncodedText.Encode("pivot"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSigmoid Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propExponent = default; - LocalJsonValue propPivot = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExponent.TryReadProperty(ref reader, options, PropExponent, null)) - { - continue; - } - - if (propPivot.TryReadProperty(ref reader, options, PropPivot, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSigmoid(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Exponent = propExponent.Value, - Pivot = propPivot.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSigmoid value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExponent, value.Exponent, null, null); - writer.WriteProperty(options, PropPivot, value.Pivot, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureFunctionSigmoidConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.RankFeatureFunctionSigmoidConverter))] public sealed partial class RankFeatureFunctionSigmoid { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureQuery.Converters.g.cs new file mode 100644 index 00000000000..5cd40af2062 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureQuery.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class RankFeatureQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropLinear = System.Text.Json.JsonEncodedText.Encode("linear"); + private static readonly System.Text.Json.JsonEncodedText PropLog = System.Text.Json.JsonEncodedText.Encode("log"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropSaturation = System.Text.Json.JsonEncodedText.Encode("saturation"); + private static readonly System.Text.Json.JsonEncodedText PropSigmoid = System.Text.Json.JsonEncodedText.Encode("sigmoid"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propField = default; + LocalJsonValue propLinear = default; + LocalJsonValue propLog = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propSaturation = default; + LocalJsonValue propSigmoid = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propLinear.TryReadProperty(ref reader, options, PropLinear, null)) + { + continue; + } + + if (propLog.TryReadProperty(ref reader, options, PropLog, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propSaturation.TryReadProperty(ref reader, options, PropSaturation, null)) + { + continue; + } + + if (propSigmoid.TryReadProperty(ref reader, options, PropSigmoid, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Field = propField.Value, + Linear = propLinear.Value, + Log = propLog.Value, + QueryName = propQueryName.Value, + Saturation = propSaturation.Value, + Sigmoid = propSigmoid.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropLinear, value.Linear, null, null); + writer.WriteProperty(options, PropLog, value.Log, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropSaturation, value.Saturation, null, null); + writer.WriteProperty(options, PropSigmoid, value.Sigmoid, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureQuery.g.cs index 1a10c040f69..9c099f7f76d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RankFeatureQuery.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class RankFeatureQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropLinear = System.Text.Json.JsonEncodedText.Encode("linear"); - private static readonly System.Text.Json.JsonEncodedText PropLog = System.Text.Json.JsonEncodedText.Encode("log"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropSaturation = System.Text.Json.JsonEncodedText.Encode("saturation"); - private static readonly System.Text.Json.JsonEncodedText PropSigmoid = System.Text.Json.JsonEncodedText.Encode("sigmoid"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propField = default; - LocalJsonValue propLinear = default; - LocalJsonValue propLog = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propSaturation = default; - LocalJsonValue propSigmoid = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propLinear.TryReadProperty(ref reader, options, PropLinear, null)) - { - continue; - } - - if (propLog.TryReadProperty(ref reader, options, PropLog, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propSaturation.TryReadProperty(ref reader, options, PropSaturation, null)) - { - continue; - } - - if (propSigmoid.TryReadProperty(ref reader, options, PropSigmoid, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Field = propField.Value, - Linear = propLinear.Value, - Log = propLog.Value, - QueryName = propQueryName.Value, - Saturation = propSaturation.Value, - Sigmoid = propSigmoid.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropLinear, value.Linear, null, null); - writer.WriteProperty(options, PropLog, value.Log, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropSaturation, value.Saturation, null, null); - writer.WriteProperty(options, PropSigmoid, value.Sigmoid, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.RankFeatureQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.RankFeatureQueryConverter))] public sealed partial class RankFeatureQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RegexpQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RegexpQuery.Converters.g.cs new file mode 100644 index 00000000000..2cb6b24efcc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RegexpQuery.Converters.g.cs @@ -0,0 +1,139 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class RegexpQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCaseInsensitive = System.Text.Json.JsonEncodedText.Encode("case_insensitive"); + private static readonly System.Text.Json.JsonEncodedText PropFlags = System.Text.Json.JsonEncodedText.Encode("flags"); + private static readonly System.Text.Json.JsonEncodedText PropMaxDeterminizedStates = System.Text.Json.JsonEncodedText.Encode("max_determinized_states"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropRewrite = System.Text.Json.JsonEncodedText.Encode("rewrite"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.RegexpQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + reader.Read(); + propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); + reader.Read(); + if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) + { + var value = reader.ReadValue(options, null); + reader.Read(); + return new Elastic.Clients.Elasticsearch.QueryDsl.RegexpQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Value = value + }; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propCaseInsensitive = default; + LocalJsonValue propFlags = default; + LocalJsonValue propMaxDeterminizedStates = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propRewrite = default; + LocalJsonValue propValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCaseInsensitive.TryReadProperty(ref reader, options, PropCaseInsensitive, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFlags.TryReadProperty(ref reader, options, PropFlags, null)) + { + continue; + } + + if (propMaxDeterminizedStates.TryReadProperty(ref reader, options, PropMaxDeterminizedStates, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propRewrite.TryReadProperty(ref reader, options, PropRewrite, null)) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.RegexpQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + CaseInsensitive = propCaseInsensitive.Value, + Field = propField.Value, + Flags = propFlags.Value, + MaxDeterminizedStates = propMaxDeterminizedStates.Value, + QueryName = propQueryName.Value, + Rewrite = propRewrite.Value, + Value = propValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.RegexpQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCaseInsensitive, value.CaseInsensitive, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFlags, value.Flags, null, null); + writer.WriteProperty(options, PropMaxDeterminizedStates, value.MaxDeterminizedStates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropRewrite, value.Rewrite, null, null); + writer.WriteProperty(options, PropValue, value.Value, null, null); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RegexpQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RegexpQuery.g.cs index 4f98aa2d9ea..f8639ee62eb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RegexpQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RegexpQuery.g.cs @@ -23,122 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class RegexpQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCaseInsensitive = System.Text.Json.JsonEncodedText.Encode("case_insensitive"); - private static readonly System.Text.Json.JsonEncodedText PropFlags = System.Text.Json.JsonEncodedText.Encode("flags"); - private static readonly System.Text.Json.JsonEncodedText PropMaxDeterminizedStates = System.Text.Json.JsonEncodedText.Encode("max_determinized_states"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropRewrite = System.Text.Json.JsonEncodedText.Encode("rewrite"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.RegexpQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - reader.Read(); - propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); - reader.Read(); - if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) - { - var value = reader.ReadValue(options, null); - reader.Read(); - return new Elastic.Clients.Elasticsearch.QueryDsl.RegexpQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Value = value - }; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propCaseInsensitive = default; - LocalJsonValue propFlags = default; - LocalJsonValue propMaxDeterminizedStates = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propRewrite = default; - LocalJsonValue propValue = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCaseInsensitive.TryReadProperty(ref reader, options, PropCaseInsensitive, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFlags.TryReadProperty(ref reader, options, PropFlags, null)) - { - continue; - } - - if (propMaxDeterminizedStates.TryReadProperty(ref reader, options, PropMaxDeterminizedStates, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propRewrite.TryReadProperty(ref reader, options, PropRewrite, null)) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.RegexpQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - CaseInsensitive = propCaseInsensitive.Value, - Field = propField.Value, - Flags = propFlags.Value, - MaxDeterminizedStates = propMaxDeterminizedStates.Value, - QueryName = propQueryName.Value, - Rewrite = propRewrite.Value, - Value = propValue.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.RegexpQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCaseInsensitive, value.CaseInsensitive, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFlags, value.Flags, null, null); - writer.WriteProperty(options, PropMaxDeterminizedStates, value.MaxDeterminizedStates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropRewrite, value.Rewrite, null, null); - writer.WriteProperty(options, PropValue, value.Value, null, null); - writer.WriteEndObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.RegexpQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.RegexpQueryConverter))] public sealed partial class RegexpQuery { [System.Obsolete("The type contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RuleQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RuleQuery.Converters.g.cs new file mode 100644 index 00000000000..59f1ed6ea94 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RuleQuery.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class RuleQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropMatchCriteria = System.Text.Json.JsonEncodedText.Encode("match_criteria"); + private static readonly System.Text.Json.JsonEncodedText PropOrganic = System.Text.Json.JsonEncodedText.Encode("organic"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropRulesetId = System.Text.Json.JsonEncodedText.Encode("ruleset_id"); + private static readonly System.Text.Json.JsonEncodedText PropRulesetIds = System.Text.Json.JsonEncodedText.Encode("ruleset_ids"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.RuleQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propMatchCriteria = default; + LocalJsonValue propOrganic = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propRulesetId = default; + LocalJsonValue?> propRulesetIds = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMatchCriteria.TryReadProperty(ref reader, options, PropMatchCriteria, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propOrganic.TryReadProperty(ref reader, options, PropOrganic, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propRulesetId.TryReadProperty(ref reader, options, PropRulesetId, null)) + { + continue; + } + + if (propRulesetIds.TryReadProperty(ref reader, options, PropRulesetIds, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.RuleQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + MatchCriteria = propMatchCriteria.Value, + Organic = propOrganic.Value, + QueryName = propQueryName.Value, + RulesetId = propRulesetId.Value, + RulesetIds = propRulesetIds.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.RuleQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMatchCriteria, value.MatchCriteria, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropOrganic, value.Organic, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropRulesetId, value.RulesetId, null, null); + writer.WriteProperty(options, PropRulesetIds, value.RulesetIds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RuleQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RuleQuery.g.cs index 37482981663..8579f52e73d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RuleQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/RuleQuery.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class RuleQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropMatchCriteria = System.Text.Json.JsonEncodedText.Encode("match_criteria"); - private static readonly System.Text.Json.JsonEncodedText PropOrganic = System.Text.Json.JsonEncodedText.Encode("organic"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropRulesetId = System.Text.Json.JsonEncodedText.Encode("ruleset_id"); - private static readonly System.Text.Json.JsonEncodedText PropRulesetIds = System.Text.Json.JsonEncodedText.Encode("ruleset_ids"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.RuleQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propMatchCriteria = default; - LocalJsonValue propOrganic = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propRulesetId = default; - LocalJsonValue?> propRulesetIds = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMatchCriteria.TryReadProperty(ref reader, options, PropMatchCriteria, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propOrganic.TryReadProperty(ref reader, options, PropOrganic, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propRulesetId.TryReadProperty(ref reader, options, PropRulesetId, null)) - { - continue; - } - - if (propRulesetIds.TryReadProperty(ref reader, options, PropRulesetIds, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.RuleQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - MatchCriteria = propMatchCriteria.Value, - Organic = propOrganic.Value, - QueryName = propQueryName.Value, - RulesetId = propRulesetId.Value, - RulesetIds = propRulesetIds.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.RuleQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMatchCriteria, value.MatchCriteria, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropOrganic, value.Organic, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropRulesetId, value.RulesetId, null, null); - writer.WriteProperty(options, PropRulesetIds, value.RulesetIds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.RuleQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.RuleQueryConverter))] public sealed partial class RuleQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptQuery.Converters.g.cs new file mode 100644 index 00000000000..0c8ab82a75d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptQuery.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class ScriptQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.ScriptQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.ScriptQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + QueryName = propQueryName.Value, + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.ScriptQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptQuery.g.cs index 03b14ea52d5..6c02c597dae 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptQuery.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class ScriptQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.ScriptQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.ScriptQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - QueryName = propQueryName.Value, - Script = propScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.ScriptQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.ScriptQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.ScriptQueryConverter))] public sealed partial class ScriptQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptScoreFunction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptScoreFunction.Converters.g.cs new file mode 100644 index 00000000000..4f597f430d5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptScoreFunction.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class ScriptScoreFunctionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreFunction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreFunction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreFunction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptScoreFunction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptScoreFunction.g.cs index 3bd5be19dc1..1212e51ecb5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptScoreFunction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptScoreFunction.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class ScriptScoreFunctionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreFunction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreFunction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Script = propScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreFunction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreFunctionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.ScriptScoreFunctionConverter))] public sealed partial class ScriptScoreFunction { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptScoreQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptScoreQuery.Converters.g.cs new file mode 100644 index 00000000000..a38b1b42c15 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptScoreQuery.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class ScriptScoreQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropMinScore = System.Text.Json.JsonEncodedText.Encode("min_score"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propMinScore = default; + LocalJsonValue propQuery = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + MinScore = propMinScore.Value, + Query = propQuery.Value, + QueryName = propQueryName.Value, + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptScoreQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptScoreQuery.g.cs index 4b20194eea5..51bffa42352 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptScoreQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ScriptScoreQuery.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class ScriptScoreQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropMinScore = System.Text.Json.JsonEncodedText.Encode("min_score"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propMinScore = default; - LocalJsonValue propQuery = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - MinScore = propMinScore.Value, - Query = propQuery.Value, - QueryName = propQueryName.Value, - Script = propScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.ScriptScoreQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.ScriptScoreQueryConverter))] public sealed partial class ScriptScoreQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SemanticQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SemanticQuery.Converters.g.cs new file mode 100644 index 00000000000..b13e227f7b7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SemanticQuery.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class SemanticQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.SemanticQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propField = default; + LocalJsonValue propQuery = default; + LocalJsonValue propQueryName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.SemanticQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Field = propField.Value, + Query = propQuery.Value, + QueryName = propQueryName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SemanticQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SemanticQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SemanticQuery.g.cs index 5f52f21f987..66832354a95 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SemanticQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SemanticQuery.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class SemanticQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.SemanticQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propField = default; - LocalJsonValue propQuery = default; - LocalJsonValue propQueryName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.SemanticQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Field = propField.Value, - Query = propQuery.Value, - QueryName = propQueryName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SemanticQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.SemanticQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.SemanticQueryConverter))] public sealed partial class SemanticQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ShapeFieldQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ShapeFieldQuery.Converters.g.cs new file mode 100644 index 00000000000..909e524f9dc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ShapeFieldQuery.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class ShapeFieldQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndexedShape = System.Text.Json.JsonEncodedText.Encode("indexed_shape"); + private static readonly System.Text.Json.JsonEncodedText PropRelation = System.Text.Json.JsonEncodedText.Encode("relation"); + private static readonly System.Text.Json.JsonEncodedText PropShape = System.Text.Json.JsonEncodedText.Encode("shape"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.ShapeFieldQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndexedShape = default; + LocalJsonValue propRelation = default; + LocalJsonValue propShape = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndexedShape.TryReadProperty(ref reader, options, PropIndexedShape, null)) + { + continue; + } + + if (propRelation.TryReadProperty(ref reader, options, PropRelation, static Elastic.Clients.Elasticsearch.GeoShapeRelation? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propShape.TryReadProperty(ref reader, options, PropShape, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.ShapeFieldQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + IndexedShape = propIndexedShape.Value, + Relation = propRelation.Value, + Shape = propShape.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.ShapeFieldQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndexedShape, value.IndexedShape, null, null); + writer.WriteProperty(options, PropRelation, value.Relation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.GeoShapeRelation? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropShape, value.Shape, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ShapeFieldQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ShapeFieldQuery.g.cs index 036a31b2af4..8748b88b3da 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ShapeFieldQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ShapeFieldQuery.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class ShapeFieldQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndexedShape = System.Text.Json.JsonEncodedText.Encode("indexed_shape"); - private static readonly System.Text.Json.JsonEncodedText PropRelation = System.Text.Json.JsonEncodedText.Encode("relation"); - private static readonly System.Text.Json.JsonEncodedText PropShape = System.Text.Json.JsonEncodedText.Encode("shape"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.ShapeFieldQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndexedShape = default; - LocalJsonValue propRelation = default; - LocalJsonValue propShape = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndexedShape.TryReadProperty(ref reader, options, PropIndexedShape, null)) - { - continue; - } - - if (propRelation.TryReadProperty(ref reader, options, PropRelation, static Elastic.Clients.Elasticsearch.GeoShapeRelation? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propShape.TryReadProperty(ref reader, options, PropShape, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.ShapeFieldQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - IndexedShape = propIndexedShape.Value, - Relation = propRelation.Value, - Shape = propShape.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.ShapeFieldQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndexedShape, value.IndexedShape, null, null); - writer.WriteProperty(options, PropRelation, value.Relation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.GeoShapeRelation? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropShape, value.Shape, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.ShapeFieldQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.ShapeFieldQueryConverter))] public sealed partial class ShapeFieldQuery { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ShapeQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ShapeQuery.Converters.g.cs new file mode 100644 index 00000000000..d6f13ef8974 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ShapeQuery.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class ShapeQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnmapped = System.Text.Json.JsonEncodedText.Encode("ignore_unmapped"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.ShapeQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propField = default; + LocalJsonValue propIgnoreUnmapped = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propShape = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreUnmapped.TryReadProperty(ref reader, options, PropIgnoreUnmapped, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + propField.Initialized = propShape.Initialized = true; + reader.ReadProperty(options, out propField.Value, out propShape.Value, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o), null); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.ShapeQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Field = propField.Value, + IgnoreUnmapped = propIgnoreUnmapped.Value, + QueryName = propQueryName.Value, + Shape = propShape.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.ShapeQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreUnmapped, value.IgnoreUnmapped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, value.Field, value.Shape, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v), null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ShapeQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ShapeQuery.g.cs index 4dc1ced7e59..32c2ce138cb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ShapeQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ShapeQuery.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class ShapeQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnmapped = System.Text.Json.JsonEncodedText.Encode("ignore_unmapped"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.ShapeQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propField = default; - LocalJsonValue propIgnoreUnmapped = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propShape = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIgnoreUnmapped.TryReadProperty(ref reader, options, PropIgnoreUnmapped, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - propField.Initialized = propShape.Initialized = true; - reader.ReadProperty(options, out propField.Value, out propShape.Value, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o), null); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.ShapeQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Field = propField.Value, - IgnoreUnmapped = propIgnoreUnmapped.Value, - QueryName = propQueryName.Value, - Shape = propShape.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.ShapeQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIgnoreUnmapped, value.IgnoreUnmapped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, value.Field, value.Shape, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v), null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.ShapeQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.ShapeQueryConverter))] public sealed partial class ShapeQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SimpleQueryStringFlag.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SimpleQueryStringFlag.Converters.g.cs new file mode 100644 index 00000000000..ae921c3939b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SimpleQueryStringFlag.Converters.g.cs @@ -0,0 +1,110 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class SimpleQueryStringFlagsConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + { + var s = reader.GetString(); + if (string.IsNullOrEmpty(s)) + { + return default; + } + + var flags = s.Split('|'); + var result = default(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags); + foreach (var flag in flags) + { + result |= flag switch + { + "ALL" => Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.All, + "AND" => Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.And, + "ESCAPE" => Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Escape, + "FUZZY" => Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Fuzzy, + "NEAR" => Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Near, + "NONE" => Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.None, + "NOT" => Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Not, + "OR" => Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Or, + "PHRASE" => Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Phrase, + "PRECEDENCE" => Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Precedence, + "PREFIX" => Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Prefix, + "SLOP" => Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Slop, + "WHITESPACE" => Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Whitespace, + _ => throw new System.Text.Json.JsonException($"Invalid flag value '{flag}' for type '{typeToConvert.Name}'.") + }; + } + + return result; + } + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags value, System.Text.Json.JsonSerializerOptions options) + { + { + if (value == default) + { + writer.WriteStringValue(string.Empty); + return; + } + + var sb = new System.Text.StringBuilder(); + if (value.HasFlag(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.All)) + sb.Append("ALL|"); + if (value.HasFlag(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.And)) + sb.Append("AND|"); + if (value.HasFlag(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Escape)) + sb.Append("ESCAPE|"); + if (value.HasFlag(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Fuzzy)) + sb.Append("FUZZY|"); + if (value.HasFlag(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Near)) + sb.Append("NEAR|"); + if (value.HasFlag(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.None)) + sb.Append("NONE|"); + if (value.HasFlag(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Not)) + sb.Append("NOT|"); + if (value.HasFlag(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Or)) + sb.Append("OR|"); + if (value.HasFlag(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Phrase)) + sb.Append("PHRASE|"); + if (value.HasFlag(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Precedence)) + sb.Append("PRECEDENCE|"); + if (value.HasFlag(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Prefix)) + sb.Append("PREFIX|"); + if (value.HasFlag(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Slop)) + sb.Append("SLOP|"); + if (value.HasFlag(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags.Whitespace)) + sb.Append("WHITESPACE|"); + if (sb.Length == 0) + { + writer.WriteStringValue(string.Empty); + return; + } + + sb.Remove(sb.Length - 1, 1); + writer.WriteStringValue(sb.ToString()); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SimpleQueryStringFlag.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SimpleQueryStringFlag.g.cs new file mode 100644 index 00000000000..bcec402a494 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SimpleQueryStringFlag.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.SimpleQueryStringFlagsConverter))] +[System.Flags] +public enum SimpleQueryStringFlags +{ + /// + /// + /// Enables all optional operators. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "ALL")] + All = 1 << 0, + /// + /// + /// Enables the + AND operator. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "AND")] + And = 1 << 1, + /// + /// + /// Enables \ as an escape character. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "ESCAPE")] + Escape = 1 << 2, + /// + /// + /// Enables the ~N operator after a word, where N is an integer denoting the allowed edit distance for matching. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "FUZZY")] + Fuzzy = 1 << 3, + /// + /// + /// Enables the ~N operator, after a phrase where N is the maximum number of positions allowed between matching tokens. + /// Synonymous to SLOP. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "NEAR")] + Near = 1 << 4, + /// + /// + /// Disables all operators. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "NONE")] + None = 1 << 5, + /// + /// + /// Enables the - NOT operator. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "NOT")] + Not = 1 << 6, + /// + /// + /// Enables the \| OR operator. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "OR")] + Or = 1 << 7, + /// + /// + /// Enables the " quotes operator used to search for phrases. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "PHRASE")] + Phrase = 1 << 8, + /// + /// + /// Enables the ( and ) operators to control operator precedence. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "PRECEDENCE")] + Precedence = 1 << 9, + /// + /// + /// Enables the * prefix operator. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "PREFIX")] + Prefix = 1 << 10, + /// + /// + /// Enables the ~N operator, after a phrase where N is maximum number of positions allowed between matching tokens. + /// Synonymous to NEAR. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "SLOP")] + Slop = 1 << 11, + /// + /// + /// Enables whitespace as split characters. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "WHITESPACE")] + Whitespace = 1 << 12 +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SimpleQueryStringQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SimpleQueryStringQuery.Converters.g.cs new file mode 100644 index 00000000000..7f6aab4921a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SimpleQueryStringQuery.Converters.g.cs @@ -0,0 +1,189 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class SimpleQueryStringQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); + private static readonly System.Text.Json.JsonEncodedText PropAnalyzeWildcard = System.Text.Json.JsonEncodedText.Encode("analyze_wildcard"); + private static readonly System.Text.Json.JsonEncodedText PropAutoGenerateSynonymsPhraseQuery = System.Text.Json.JsonEncodedText.Encode("auto_generate_synonyms_phrase_query"); + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropDefaultOperator = System.Text.Json.JsonEncodedText.Encode("default_operator"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropFlags = System.Text.Json.JsonEncodedText.Encode("flags"); + private static readonly System.Text.Json.JsonEncodedText PropFuzzyMaxExpansions = System.Text.Json.JsonEncodedText.Encode("fuzzy_max_expansions"); + private static readonly System.Text.Json.JsonEncodedText PropFuzzyPrefixLength = System.Text.Json.JsonEncodedText.Encode("fuzzy_prefix_length"); + private static readonly System.Text.Json.JsonEncodedText PropFuzzyTranspositions = System.Text.Json.JsonEncodedText.Encode("fuzzy_transpositions"); + private static readonly System.Text.Json.JsonEncodedText PropLenient = System.Text.Json.JsonEncodedText.Encode("lenient"); + private static readonly System.Text.Json.JsonEncodedText PropMinimumShouldMatch = System.Text.Json.JsonEncodedText.Encode("minimum_should_match"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropQuoteFieldSuffix = System.Text.Json.JsonEncodedText.Encode("quote_field_suffix"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyzer = default; + LocalJsonValue propAnalyzeWildcard = default; + LocalJsonValue propAutoGenerateSynonymsPhraseQuery = default; + LocalJsonValue propBoost = default; + LocalJsonValue propDefaultOperator = default; + LocalJsonValue propFields = default; + LocalJsonValue propFlags = default; + LocalJsonValue propFuzzyMaxExpansions = default; + LocalJsonValue propFuzzyPrefixLength = default; + LocalJsonValue propFuzzyTranspositions = default; + LocalJsonValue propLenient = default; + LocalJsonValue propMinimumShouldMatch = default; + LocalJsonValue propQuery = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propQuoteFieldSuffix = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) + { + continue; + } + + if (propAnalyzeWildcard.TryReadProperty(ref reader, options, PropAnalyzeWildcard, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propAutoGenerateSynonymsPhraseQuery.TryReadProperty(ref reader, options, PropAutoGenerateSynonymsPhraseQuery, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDefaultOperator.TryReadProperty(ref reader, options, PropDefaultOperator, static Elastic.Clients.Elasticsearch.QueryDsl.Operator? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + + if (propFlags.TryReadProperty(ref reader, options, PropFlags, static Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFuzzyMaxExpansions.TryReadProperty(ref reader, options, PropFuzzyMaxExpansions, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFuzzyPrefixLength.TryReadProperty(ref reader, options, PropFuzzyPrefixLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFuzzyTranspositions.TryReadProperty(ref reader, options, PropFuzzyTranspositions, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLenient.TryReadProperty(ref reader, options, PropLenient, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinimumShouldMatch.TryReadProperty(ref reader, options, PropMinimumShouldMatch, null)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propQuoteFieldSuffix.TryReadProperty(ref reader, options, PropQuoteFieldSuffix, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Analyzer = propAnalyzer.Value, + AnalyzeWildcard = propAnalyzeWildcard.Value, + AutoGenerateSynonymsPhraseQuery = propAutoGenerateSynonymsPhraseQuery.Value, + Boost = propBoost.Value, + DefaultOperator = propDefaultOperator.Value, + Fields = propFields.Value, + Flags = propFlags.Value, + FuzzyMaxExpansions = propFuzzyMaxExpansions.Value, + FuzzyPrefixLength = propFuzzyPrefixLength.Value, + FuzzyTranspositions = propFuzzyTranspositions.Value, + Lenient = propLenient.Value, + MinimumShouldMatch = propMinimumShouldMatch.Value, + Query = propQuery.Value, + QueryName = propQueryName.Value, + QuoteFieldSuffix = propQuoteFieldSuffix.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); + writer.WriteProperty(options, PropAnalyzeWildcard, value.AnalyzeWildcard, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropAutoGenerateSynonymsPhraseQuery, value.AutoGenerateSynonymsPhraseQuery, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDefaultOperator, value.DefaultOperator, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.Operator? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFields, value.Fields, null, null); + writer.WriteProperty(options, PropFlags, value.Flags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFuzzyMaxExpansions, value.FuzzyMaxExpansions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFuzzyPrefixLength, value.FuzzyPrefixLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFuzzyTranspositions, value.FuzzyTranspositions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLenient, value.Lenient, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinimumShouldMatch, value.MinimumShouldMatch, null, null); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropQuoteFieldSuffix, value.QuoteFieldSuffix, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SimpleQueryStringQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SimpleQueryStringQuery.g.cs index 015951a04e2..536aa39db04 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SimpleQueryStringQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SimpleQueryStringQuery.g.cs @@ -23,172 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class SimpleQueryStringQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyzer = System.Text.Json.JsonEncodedText.Encode("analyzer"); - private static readonly System.Text.Json.JsonEncodedText PropAnalyzeWildcard = System.Text.Json.JsonEncodedText.Encode("analyze_wildcard"); - private static readonly System.Text.Json.JsonEncodedText PropAutoGenerateSynonymsPhraseQuery = System.Text.Json.JsonEncodedText.Encode("auto_generate_synonyms_phrase_query"); - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropDefaultOperator = System.Text.Json.JsonEncodedText.Encode("default_operator"); - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropFlags = System.Text.Json.JsonEncodedText.Encode("flags"); - private static readonly System.Text.Json.JsonEncodedText PropFuzzyMaxExpansions = System.Text.Json.JsonEncodedText.Encode("fuzzy_max_expansions"); - private static readonly System.Text.Json.JsonEncodedText PropFuzzyPrefixLength = System.Text.Json.JsonEncodedText.Encode("fuzzy_prefix_length"); - private static readonly System.Text.Json.JsonEncodedText PropFuzzyTranspositions = System.Text.Json.JsonEncodedText.Encode("fuzzy_transpositions"); - private static readonly System.Text.Json.JsonEncodedText PropLenient = System.Text.Json.JsonEncodedText.Encode("lenient"); - private static readonly System.Text.Json.JsonEncodedText PropMinimumShouldMatch = System.Text.Json.JsonEncodedText.Encode("minimum_should_match"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropQuoteFieldSuffix = System.Text.Json.JsonEncodedText.Encode("quote_field_suffix"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyzer = default; - LocalJsonValue propAnalyzeWildcard = default; - LocalJsonValue propAutoGenerateSynonymsPhraseQuery = default; - LocalJsonValue propBoost = default; - LocalJsonValue propDefaultOperator = default; - LocalJsonValue propFields = default; - LocalJsonValue propFlags = default; - LocalJsonValue propFuzzyMaxExpansions = default; - LocalJsonValue propFuzzyPrefixLength = default; - LocalJsonValue propFuzzyTranspositions = default; - LocalJsonValue propLenient = default; - LocalJsonValue propMinimumShouldMatch = default; - LocalJsonValue propQuery = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propQuoteFieldSuffix = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) - { - continue; - } - - if (propAnalyzeWildcard.TryReadProperty(ref reader, options, PropAnalyzeWildcard, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propAutoGenerateSynonymsPhraseQuery.TryReadProperty(ref reader, options, PropAutoGenerateSynonymsPhraseQuery, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDefaultOperator.TryReadProperty(ref reader, options, PropDefaultOperator, static Elastic.Clients.Elasticsearch.QueryDsl.Operator? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFields.TryReadProperty(ref reader, options, PropFields, null)) - { - continue; - } - - if (propFlags.TryReadProperty(ref reader, options, PropFlags, static Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFuzzyMaxExpansions.TryReadProperty(ref reader, options, PropFuzzyMaxExpansions, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFuzzyPrefixLength.TryReadProperty(ref reader, options, PropFuzzyPrefixLength, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFuzzyTranspositions.TryReadProperty(ref reader, options, PropFuzzyTranspositions, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLenient.TryReadProperty(ref reader, options, PropLenient, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinimumShouldMatch.TryReadProperty(ref reader, options, PropMinimumShouldMatch, null)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propQuoteFieldSuffix.TryReadProperty(ref reader, options, PropQuoteFieldSuffix, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Analyzer = propAnalyzer.Value, - AnalyzeWildcard = propAnalyzeWildcard.Value, - AutoGenerateSynonymsPhraseQuery = propAutoGenerateSynonymsPhraseQuery.Value, - Boost = propBoost.Value, - DefaultOperator = propDefaultOperator.Value, - Fields = propFields.Value, - Flags = propFlags.Value, - FuzzyMaxExpansions = propFuzzyMaxExpansions.Value, - FuzzyPrefixLength = propFuzzyPrefixLength.Value, - FuzzyTranspositions = propFuzzyTranspositions.Value, - Lenient = propLenient.Value, - MinimumShouldMatch = propMinimumShouldMatch.Value, - Query = propQuery.Value, - QueryName = propQueryName.Value, - QuoteFieldSuffix = propQuoteFieldSuffix.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyzer, value.Analyzer, null, null); - writer.WriteProperty(options, PropAnalyzeWildcard, value.AnalyzeWildcard, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropAutoGenerateSynonymsPhraseQuery, value.AutoGenerateSynonymsPhraseQuery, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDefaultOperator, value.DefaultOperator, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.Operator? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFields, value.Fields, null, null); - writer.WriteProperty(options, PropFlags, value.Flags, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFuzzyMaxExpansions, value.FuzzyMaxExpansions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFuzzyPrefixLength, value.FuzzyPrefixLength, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFuzzyTranspositions, value.FuzzyTranspositions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLenient, value.Lenient, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinimumShouldMatch, value.MinimumShouldMatch, null, null); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropQuoteFieldSuffix, value.QuoteFieldSuffix, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.SimpleQueryStringQueryConverter))] public sealed partial class SimpleQueryStringQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanContainingQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanContainingQuery.Converters.g.cs new file mode 100644 index 00000000000..98fc85bb541 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanContainingQuery.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class SpanContainingQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBig = System.Text.Json.JsonEncodedText.Encode("big"); + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropLittle = System.Text.Json.JsonEncodedText.Encode("little"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.SpanContainingQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBig = default; + LocalJsonValue propBoost = default; + LocalJsonValue propLittle = default; + LocalJsonValue propQueryName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBig.TryReadProperty(ref reader, options, PropBig, null)) + { + continue; + } + + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLittle.TryReadProperty(ref reader, options, PropLittle, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.SpanContainingQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Big = propBig.Value, + Boost = propBoost.Value, + Little = propLittle.Value, + QueryName = propQueryName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SpanContainingQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBig, value.Big, null, null); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLittle, value.Little, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanContainingQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanContainingQuery.g.cs index a64036b0bb8..241460dedf5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanContainingQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanContainingQuery.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class SpanContainingQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBig = System.Text.Json.JsonEncodedText.Encode("big"); - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropLittle = System.Text.Json.JsonEncodedText.Encode("little"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.SpanContainingQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBig = default; - LocalJsonValue propBoost = default; - LocalJsonValue propLittle = default; - LocalJsonValue propQueryName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBig.TryReadProperty(ref reader, options, PropBig, null)) - { - continue; - } - - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLittle.TryReadProperty(ref reader, options, PropLittle, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.SpanContainingQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Big = propBig.Value, - Boost = propBoost.Value, - Little = propLittle.Value, - QueryName = propQueryName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SpanContainingQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBig, value.Big, null, null); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLittle, value.Little, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.SpanContainingQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.SpanContainingQueryConverter))] public sealed partial class SpanContainingQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanFieldMaskingQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanFieldMaskingQuery.Converters.g.cs new file mode 100644 index 00000000000..75d791529f2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanFieldMaskingQuery.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class SpanFieldMaskingQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.SpanFieldMaskingQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propField = default; + LocalJsonValue propQuery = default; + LocalJsonValue propQueryName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.SpanFieldMaskingQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Field = propField.Value, + Query = propQuery.Value, + QueryName = propQueryName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SpanFieldMaskingQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanFieldMaskingQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanFieldMaskingQuery.g.cs index fe187fffa63..d8d051c26c8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanFieldMaskingQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanFieldMaskingQuery.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class SpanFieldMaskingQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.SpanFieldMaskingQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propField = default; - LocalJsonValue propQuery = default; - LocalJsonValue propQueryName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.SpanFieldMaskingQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Field = propField.Value, - Query = propQuery.Value, - QueryName = propQueryName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SpanFieldMaskingQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.SpanFieldMaskingQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.SpanFieldMaskingQueryConverter))] public sealed partial class SpanFieldMaskingQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanFirstQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanFirstQuery.Converters.g.cs new file mode 100644 index 00000000000..e34ebc600d9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanFirstQuery.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class SpanFirstQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropEnd = System.Text.Json.JsonEncodedText.Encode("end"); + private static readonly System.Text.Json.JsonEncodedText PropMatch = System.Text.Json.JsonEncodedText.Encode("match"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.SpanFirstQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propEnd = default; + LocalJsonValue propMatch = default; + LocalJsonValue propQueryName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEnd.TryReadProperty(ref reader, options, PropEnd, null)) + { + continue; + } + + if (propMatch.TryReadProperty(ref reader, options, PropMatch, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.SpanFirstQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + End = propEnd.Value, + Match = propMatch.Value, + QueryName = propQueryName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SpanFirstQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEnd, value.End, null, null); + writer.WriteProperty(options, PropMatch, value.Match, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanFirstQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanFirstQuery.g.cs index 37de58f2440..8453a5c7980 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanFirstQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanFirstQuery.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class SpanFirstQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropEnd = System.Text.Json.JsonEncodedText.Encode("end"); - private static readonly System.Text.Json.JsonEncodedText PropMatch = System.Text.Json.JsonEncodedText.Encode("match"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.SpanFirstQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propEnd = default; - LocalJsonValue propMatch = default; - LocalJsonValue propQueryName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propEnd.TryReadProperty(ref reader, options, PropEnd, null)) - { - continue; - } - - if (propMatch.TryReadProperty(ref reader, options, PropMatch, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.SpanFirstQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - End = propEnd.Value, - Match = propMatch.Value, - QueryName = propQueryName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SpanFirstQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropEnd, value.End, null, null); - writer.WriteProperty(options, PropMatch, value.Match, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.SpanFirstQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.SpanFirstQueryConverter))] public sealed partial class SpanFirstQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanMultiTermQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanMultiTermQuery.Converters.g.cs new file mode 100644 index 00000000000..d6de0ce91ce --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanMultiTermQuery.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class SpanMultiTermQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropMatch = System.Text.Json.JsonEncodedText.Encode("match"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.SpanMultiTermQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propMatch = default; + LocalJsonValue propQueryName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMatch.TryReadProperty(ref reader, options, PropMatch, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.SpanMultiTermQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Match = propMatch.Value, + QueryName = propQueryName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SpanMultiTermQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMatch, value.Match, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanMultiTermQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanMultiTermQuery.g.cs index 2078e299b65..b348d29452f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanMultiTermQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanMultiTermQuery.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class SpanMultiTermQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropMatch = System.Text.Json.JsonEncodedText.Encode("match"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.SpanMultiTermQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propMatch = default; - LocalJsonValue propQueryName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMatch.TryReadProperty(ref reader, options, PropMatch, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.SpanMultiTermQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Match = propMatch.Value, - QueryName = propQueryName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SpanMultiTermQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMatch, value.Match, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.SpanMultiTermQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.SpanMultiTermQueryConverter))] public sealed partial class SpanMultiTermQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanNearQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanNearQuery.Converters.g.cs new file mode 100644 index 00000000000..65bccb9aeab --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanNearQuery.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class SpanNearQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropClauses = System.Text.Json.JsonEncodedText.Encode("clauses"); + private static readonly System.Text.Json.JsonEncodedText PropInOrder = System.Text.Json.JsonEncodedText.Encode("in_order"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropSlop = System.Text.Json.JsonEncodedText.Encode("slop"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.SpanNearQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue> propClauses = default; + LocalJsonValue propInOrder = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propSlop = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propClauses.TryReadProperty(ref reader, options, PropClauses, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propInOrder.TryReadProperty(ref reader, options, PropInOrder, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propSlop.TryReadProperty(ref reader, options, PropSlop, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.SpanNearQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Clauses = propClauses.Value, + InOrder = propInOrder.Value, + QueryName = propQueryName.Value, + Slop = propSlop.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SpanNearQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropClauses, value.Clauses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropInOrder, value.InOrder, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropSlop, value.Slop, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanNearQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanNearQuery.g.cs index 6466d7a49dc..bdc4c8a3089 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanNearQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanNearQuery.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class SpanNearQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropClauses = System.Text.Json.JsonEncodedText.Encode("clauses"); - private static readonly System.Text.Json.JsonEncodedText PropInOrder = System.Text.Json.JsonEncodedText.Encode("in_order"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropSlop = System.Text.Json.JsonEncodedText.Encode("slop"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.SpanNearQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue> propClauses = default; - LocalJsonValue propInOrder = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propSlop = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propClauses.TryReadProperty(ref reader, options, PropClauses, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propInOrder.TryReadProperty(ref reader, options, PropInOrder, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propSlop.TryReadProperty(ref reader, options, PropSlop, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.SpanNearQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Clauses = propClauses.Value, - InOrder = propInOrder.Value, - QueryName = propQueryName.Value, - Slop = propSlop.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SpanNearQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropClauses, value.Clauses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropInOrder, value.InOrder, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropSlop, value.Slop, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.SpanNearQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.SpanNearQueryConverter))] public sealed partial class SpanNearQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanNotQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanNotQuery.Converters.g.cs new file mode 100644 index 00000000000..5f13b69a4c6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanNotQuery.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class SpanNotQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropDist = System.Text.Json.JsonEncodedText.Encode("dist"); + private static readonly System.Text.Json.JsonEncodedText PropExclude = System.Text.Json.JsonEncodedText.Encode("exclude"); + private static readonly System.Text.Json.JsonEncodedText PropInclude = System.Text.Json.JsonEncodedText.Encode("include"); + private static readonly System.Text.Json.JsonEncodedText PropPost = System.Text.Json.JsonEncodedText.Encode("post"); + private static readonly System.Text.Json.JsonEncodedText PropPre = System.Text.Json.JsonEncodedText.Encode("pre"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.SpanNotQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propDist = default; + LocalJsonValue propExclude = default; + LocalJsonValue propInclude = default; + LocalJsonValue propPost = default; + LocalJsonValue propPre = default; + LocalJsonValue propQueryName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDist.TryReadProperty(ref reader, options, PropDist, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propExclude.TryReadProperty(ref reader, options, PropExclude, null)) + { + continue; + } + + if (propInclude.TryReadProperty(ref reader, options, PropInclude, null)) + { + continue; + } + + if (propPost.TryReadProperty(ref reader, options, PropPost, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPre.TryReadProperty(ref reader, options, PropPre, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.SpanNotQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Dist = propDist.Value, + Exclude = propExclude.Value, + Include = propInclude.Value, + Post = propPost.Value, + Pre = propPre.Value, + QueryName = propQueryName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SpanNotQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDist, value.Dist, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropExclude, value.Exclude, null, null); + writer.WriteProperty(options, PropInclude, value.Include, null, null); + writer.WriteProperty(options, PropPost, value.Post, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPre, value.Pre, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanNotQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanNotQuery.g.cs index e3be13405af..cc348aa4045 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanNotQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanNotQuery.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class SpanNotQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropDist = System.Text.Json.JsonEncodedText.Encode("dist"); - private static readonly System.Text.Json.JsonEncodedText PropExclude = System.Text.Json.JsonEncodedText.Encode("exclude"); - private static readonly System.Text.Json.JsonEncodedText PropInclude = System.Text.Json.JsonEncodedText.Encode("include"); - private static readonly System.Text.Json.JsonEncodedText PropPost = System.Text.Json.JsonEncodedText.Encode("post"); - private static readonly System.Text.Json.JsonEncodedText PropPre = System.Text.Json.JsonEncodedText.Encode("pre"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.SpanNotQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propDist = default; - LocalJsonValue propExclude = default; - LocalJsonValue propInclude = default; - LocalJsonValue propPost = default; - LocalJsonValue propPre = default; - LocalJsonValue propQueryName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDist.TryReadProperty(ref reader, options, PropDist, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propExclude.TryReadProperty(ref reader, options, PropExclude, null)) - { - continue; - } - - if (propInclude.TryReadProperty(ref reader, options, PropInclude, null)) - { - continue; - } - - if (propPost.TryReadProperty(ref reader, options, PropPost, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPre.TryReadProperty(ref reader, options, PropPre, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.SpanNotQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Dist = propDist.Value, - Exclude = propExclude.Value, - Include = propInclude.Value, - Post = propPost.Value, - Pre = propPre.Value, - QueryName = propQueryName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SpanNotQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDist, value.Dist, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropExclude, value.Exclude, null, null); - writer.WriteProperty(options, PropInclude, value.Include, null, null); - writer.WriteProperty(options, PropPost, value.Post, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPre, value.Pre, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.SpanNotQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.SpanNotQueryConverter))] public sealed partial class SpanNotQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanOrQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanOrQuery.Converters.g.cs new file mode 100644 index 00000000000..48a5b0bfff4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanOrQuery.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class SpanOrQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropClauses = System.Text.Json.JsonEncodedText.Encode("clauses"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.SpanOrQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue> propClauses = default; + LocalJsonValue propQueryName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propClauses.TryReadProperty(ref reader, options, PropClauses, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.SpanOrQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Clauses = propClauses.Value, + QueryName = propQueryName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SpanOrQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropClauses, value.Clauses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanOrQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanOrQuery.g.cs index b36393e4a3a..180c62f0dac 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanOrQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanOrQuery.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class SpanOrQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropClauses = System.Text.Json.JsonEncodedText.Encode("clauses"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.SpanOrQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue> propClauses = default; - LocalJsonValue propQueryName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propClauses.TryReadProperty(ref reader, options, PropClauses, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.SpanOrQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Clauses = propClauses.Value, - QueryName = propQueryName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SpanOrQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropClauses, value.Clauses, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.SpanOrQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.SpanOrQueryConverter))] public sealed partial class SpanOrQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanQuery.Converters.g.cs new file mode 100644 index 00000000000..4a46f2fc9da --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanQuery.Converters.g.cs @@ -0,0 +1,186 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class SpanQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantSpanContaining = System.Text.Json.JsonEncodedText.Encode("span_containing"); + private static readonly System.Text.Json.JsonEncodedText VariantSpanFieldMasking = System.Text.Json.JsonEncodedText.Encode("span_field_masking"); + private static readonly System.Text.Json.JsonEncodedText VariantSpanFirst = System.Text.Json.JsonEncodedText.Encode("span_first"); + private static readonly System.Text.Json.JsonEncodedText VariantSpanGap = System.Text.Json.JsonEncodedText.Encode("span_gap"); + private static readonly System.Text.Json.JsonEncodedText VariantSpanMulti = System.Text.Json.JsonEncodedText.Encode("span_multi"); + private static readonly System.Text.Json.JsonEncodedText VariantSpanNear = System.Text.Json.JsonEncodedText.Encode("span_near"); + private static readonly System.Text.Json.JsonEncodedText VariantSpanNot = System.Text.Json.JsonEncodedText.Encode("span_not"); + private static readonly System.Text.Json.JsonEncodedText VariantSpanOr = System.Text.Json.JsonEncodedText.Encode("span_or"); + private static readonly System.Text.Json.JsonEncodedText VariantSpanTerm = System.Text.Json.JsonEncodedText.Encode("span_term"); + private static readonly System.Text.Json.JsonEncodedText VariantSpanWithin = System.Text.Json.JsonEncodedText.Encode("span_within"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantSpanContaining)) + { + variantType = VariantSpanContaining.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSpanFieldMasking)) + { + variantType = VariantSpanFieldMasking.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSpanFirst)) + { + variantType = VariantSpanFirst.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSpanGap)) + { + variantType = VariantSpanGap.Value; + reader.Read(); + variant = reader.ReadValue>(options, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null)); + continue; + } + + if (reader.ValueTextEquals(VariantSpanMulti)) + { + variantType = VariantSpanMulti.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSpanNear)) + { + variantType = VariantSpanNear.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSpanNot)) + { + variantType = VariantSpanNot.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSpanOr)) + { + variantType = VariantSpanOr.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSpanTerm)) + { + variantType = VariantSpanTerm.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSpanWithin)) + { + variantType = VariantSpanWithin.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "span_containing": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanContainingQuery)value.Variant, null, null); + break; + case "span_field_masking": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanFieldMaskingQuery)value.Variant, null, null); + break; + case "span_first": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanFirstQuery)value.Variant, null, null); + break; + case "span_gap": + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.KeyValuePair)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null)); + break; + case "span_multi": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanMultiTermQuery)value.Variant, null, null); + break; + case "span_near": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanNearQuery)value.Variant, null, null); + break; + case "span_not": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanNotQuery)value.Variant, null, null); + break; + case "span_or": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanOrQuery)value.Variant, null, null); + break; + case "span_term": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanTermQuery)value.Variant, null, null); + break; + case "span_within": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanWithinQuery)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanQuery.g.cs index 57b43f3c42a..95c69680276 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanQuery.g.cs @@ -23,169 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class SpanQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantSpanContaining = System.Text.Json.JsonEncodedText.Encode("span_containing"); - private static readonly System.Text.Json.JsonEncodedText VariantSpanFieldMasking = System.Text.Json.JsonEncodedText.Encode("span_field_masking"); - private static readonly System.Text.Json.JsonEncodedText VariantSpanFirst = System.Text.Json.JsonEncodedText.Encode("span_first"); - private static readonly System.Text.Json.JsonEncodedText VariantSpanGap = System.Text.Json.JsonEncodedText.Encode("span_gap"); - private static readonly System.Text.Json.JsonEncodedText VariantSpanMulti = System.Text.Json.JsonEncodedText.Encode("span_multi"); - private static readonly System.Text.Json.JsonEncodedText VariantSpanNear = System.Text.Json.JsonEncodedText.Encode("span_near"); - private static readonly System.Text.Json.JsonEncodedText VariantSpanNot = System.Text.Json.JsonEncodedText.Encode("span_not"); - private static readonly System.Text.Json.JsonEncodedText VariantSpanOr = System.Text.Json.JsonEncodedText.Encode("span_or"); - private static readonly System.Text.Json.JsonEncodedText VariantSpanTerm = System.Text.Json.JsonEncodedText.Encode("span_term"); - private static readonly System.Text.Json.JsonEncodedText VariantSpanWithin = System.Text.Json.JsonEncodedText.Encode("span_within"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantSpanContaining)) - { - variantType = VariantSpanContaining.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSpanFieldMasking)) - { - variantType = VariantSpanFieldMasking.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSpanFirst)) - { - variantType = VariantSpanFirst.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSpanGap)) - { - variantType = VariantSpanGap.Value; - reader.Read(); - variant = reader.ReadValue>(options, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null)); - continue; - } - - if (reader.ValueTextEquals(VariantSpanMulti)) - { - variantType = VariantSpanMulti.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSpanNear)) - { - variantType = VariantSpanNear.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSpanNot)) - { - variantType = VariantSpanNot.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSpanOr)) - { - variantType = VariantSpanOr.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSpanTerm)) - { - variantType = VariantSpanTerm.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSpanWithin)) - { - variantType = VariantSpanWithin.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "span_containing": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanContainingQuery)value.Variant, null, null); - break; - case "span_field_masking": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanFieldMaskingQuery)value.Variant, null, null); - break; - case "span_first": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanFirstQuery)value.Variant, null, null); - break; - case "span_gap": - writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.KeyValuePair)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null)); - break; - case "span_multi": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanMultiTermQuery)value.Variant, null, null); - break; - case "span_near": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanNearQuery)value.Variant, null, null); - break; - case "span_not": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanNotQuery)value.Variant, null, null); - break; - case "span_or": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanOrQuery)value.Variant, null, null); - break; - case "span_term": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanTermQuery)value.Variant, null, null); - break; - case "span_within": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SpanWithinQuery)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.SpanQuery)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.SpanQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.SpanQueryConverter))] public sealed partial class SpanQuery { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanTermQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanTermQuery.Converters.g.cs new file mode 100644 index 00000000000..f5feb5a7e0e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanTermQuery.Converters.g.cs @@ -0,0 +1,104 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class SpanTermQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + private static readonly System.Text.Json.JsonEncodedText PropValue1 = System.Text.Json.JsonEncodedText.Encode("term"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.SpanTermQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + reader.Read(); + propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); + reader.Read(); + if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) + { + var value = reader.ReadValue(options, null); + reader.Read(); + return new Elastic.Clients.Elasticsearch.QueryDsl.SpanTermQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Value = value + }; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, null) || propValue.TryReadProperty(ref reader, options, PropValue1, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.SpanTermQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Field = propField.Value, + QueryName = propQueryName.Value, + Value = propValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SpanTermQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropValue, value.Value, null, null); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanTermQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanTermQuery.g.cs index f75adba08c5..6c18a3593a2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanTermQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanTermQuery.g.cs @@ -23,87 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class SpanTermQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - private static readonly System.Text.Json.JsonEncodedText PropValue1 = System.Text.Json.JsonEncodedText.Encode("term"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.SpanTermQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - reader.Read(); - propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); - reader.Read(); - if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) - { - var value = reader.ReadValue(options, null); - reader.Read(); - return new Elastic.Clients.Elasticsearch.QueryDsl.SpanTermQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Value = value - }; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propValue = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, null) || propValue.TryReadProperty(ref reader, options, PropValue1, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.SpanTermQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Field = propField.Value, - QueryName = propQueryName.Value, - Value = propValue.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SpanTermQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropValue, value.Value, null, null); - writer.WriteEndObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.SpanTermQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.SpanTermQueryConverter))] public sealed partial class SpanTermQuery { [System.Obsolete("The type contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanWithinQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanWithinQuery.Converters.g.cs new file mode 100644 index 00000000000..57f78919893 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanWithinQuery.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class SpanWithinQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBig = System.Text.Json.JsonEncodedText.Encode("big"); + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropLittle = System.Text.Json.JsonEncodedText.Encode("little"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.SpanWithinQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBig = default; + LocalJsonValue propBoost = default; + LocalJsonValue propLittle = default; + LocalJsonValue propQueryName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBig.TryReadProperty(ref reader, options, PropBig, null)) + { + continue; + } + + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLittle.TryReadProperty(ref reader, options, PropLittle, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.SpanWithinQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Big = propBig.Value, + Boost = propBoost.Value, + Little = propLittle.Value, + QueryName = propQueryName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SpanWithinQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBig, value.Big, null, null); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLittle, value.Little, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanWithinQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanWithinQuery.g.cs index 9f75c66a26b..2b115a67fd4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanWithinQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SpanWithinQuery.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class SpanWithinQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBig = System.Text.Json.JsonEncodedText.Encode("big"); - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropLittle = System.Text.Json.JsonEncodedText.Encode("little"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.SpanWithinQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBig = default; - LocalJsonValue propBoost = default; - LocalJsonValue propLittle = default; - LocalJsonValue propQueryName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBig.TryReadProperty(ref reader, options, PropBig, null)) - { - continue; - } - - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLittle.TryReadProperty(ref reader, options, PropLittle, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.SpanWithinQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Big = propBig.Value, - Boost = propBoost.Value, - Little = propLittle.Value, - QueryName = propQueryName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SpanWithinQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBig, value.Big, null, null); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLittle, value.Little, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.SpanWithinQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.SpanWithinQueryConverter))] public sealed partial class SpanWithinQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SparseVectorQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SparseVectorQuery.Converters.g.cs new file mode 100644 index 00000000000..f658d81ce62 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SparseVectorQuery.Converters.g.cs @@ -0,0 +1,132 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class SparseVectorQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropPrune = System.Text.Json.JsonEncodedText.Encode("prune"); + private static readonly System.Text.Json.JsonEncodedText PropPruningConfig = System.Text.Json.JsonEncodedText.Encode("pruning_config"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText VariantInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.SparseVectorQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propField = default; + LocalJsonValue propPrune = default; + LocalJsonValue propPruningConfig = default; + LocalJsonValue propQuery = default; + LocalJsonValue propQueryName = default; + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propPrune.TryReadProperty(ref reader, options, PropPrune, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPruningConfig.TryReadProperty(ref reader, options, PropPruningConfig, null)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (reader.ValueTextEquals(VariantInferenceId)) + { + variantType = VariantInferenceId.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.SparseVectorQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant, + Boost = propBoost.Value, + Field = propField.Value, + Prune = propPrune.Value, + PruningConfig = propPruningConfig.Value, + Query = propQuery.Value, + QueryName = propQueryName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SparseVectorQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "inference_id": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Id)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.SparseVectorQuery)}'."); + } + + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropPrune, value.Prune, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPruningConfig, value.PruningConfig, null, null); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SparseVectorQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SparseVectorQuery.g.cs index fe18a4b0ecc..809b18c5d46 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SparseVectorQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/SparseVectorQuery.g.cs @@ -23,115 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class SparseVectorQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropPrune = System.Text.Json.JsonEncodedText.Encode("prune"); - private static readonly System.Text.Json.JsonEncodedText PropPruningConfig = System.Text.Json.JsonEncodedText.Encode("pruning_config"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText VariantInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.SparseVectorQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propField = default; - LocalJsonValue propPrune = default; - LocalJsonValue propPruningConfig = default; - LocalJsonValue propQuery = default; - LocalJsonValue propQueryName = default; - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propPrune.TryReadProperty(ref reader, options, PropPrune, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPruningConfig.TryReadProperty(ref reader, options, PropPruningConfig, null)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (reader.ValueTextEquals(VariantInferenceId)) - { - variantType = VariantInferenceId.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.SparseVectorQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant, - Boost = propBoost.Value, - Field = propField.Value, - Prune = propPrune.Value, - PruningConfig = propPruningConfig.Value, - Query = propQuery.Value, - QueryName = propQueryName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.SparseVectorQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "inference_id": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Id)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.SparseVectorQuery)}'."); - } - - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropPrune, value.Prune, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPruningConfig, value.PruningConfig, null, null); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.SparseVectorQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.SparseVectorQueryConverter))] public sealed partial class SparseVectorQuery { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermQuery.Converters.g.cs new file mode 100644 index 00000000000..38906d92455 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermQuery.Converters.g.cs @@ -0,0 +1,112 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class TermQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCaseInsensitive = System.Text.Json.JsonEncodedText.Encode("case_insensitive"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.TermQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + reader.Read(); + propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); + reader.Read(); + if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) + { + var value = reader.ReadValue(options, null); + reader.Read(); + return new Elastic.Clients.Elasticsearch.QueryDsl.TermQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Value = value + }; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propCaseInsensitive = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCaseInsensitive.TryReadProperty(ref reader, options, PropCaseInsensitive, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.TermQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + CaseInsensitive = propCaseInsensitive.Value, + Field = propField.Value, + QueryName = propQueryName.Value, + Value = propValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.TermQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCaseInsensitive, value.CaseInsensitive, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropValue, value.Value, null, null); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermQuery.g.cs index fedfe704d21..f7df3b0cd21 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermQuery.g.cs @@ -23,95 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class TermQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCaseInsensitive = System.Text.Json.JsonEncodedText.Encode("case_insensitive"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.TermQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - reader.Read(); - propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); - reader.Read(); - if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) - { - var value = reader.ReadValue(options, null); - reader.Read(); - return new Elastic.Clients.Elasticsearch.QueryDsl.TermQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Value = value - }; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propCaseInsensitive = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propValue = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCaseInsensitive.TryReadProperty(ref reader, options, PropCaseInsensitive, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.TermQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - CaseInsensitive = propCaseInsensitive.Value, - Field = propField.Value, - QueryName = propQueryName.Value, - Value = propValue.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.TermQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCaseInsensitive, value.CaseInsensitive, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropValue, value.Value, null, null); - writer.WriteEndObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.TermQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.TermQueryConverter))] public sealed partial class TermQuery { [System.Obsolete("The type contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermRangeQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermRangeQuery.Converters.g.cs new file mode 100644 index 00000000000..e432cc77a62 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermRangeQuery.Converters.g.cs @@ -0,0 +1,128 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class TermRangeQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropGt = System.Text.Json.JsonEncodedText.Encode("gt"); + private static readonly System.Text.Json.JsonEncodedText PropGte = System.Text.Json.JsonEncodedText.Encode("gte"); + private static readonly System.Text.Json.JsonEncodedText PropLt = System.Text.Json.JsonEncodedText.Encode("lt"); + private static readonly System.Text.Json.JsonEncodedText PropLte = System.Text.Json.JsonEncodedText.Encode("lte"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropRelation = System.Text.Json.JsonEncodedText.Encode("relation"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.TermRangeQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + reader.Read(); + propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propGt = default; + LocalJsonValue propGte = default; + LocalJsonValue propLt = default; + LocalJsonValue propLte = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propRelation = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propGt.TryReadProperty(ref reader, options, PropGt, null)) + { + continue; + } + + if (propGte.TryReadProperty(ref reader, options, PropGte, null)) + { + continue; + } + + if (propLt.TryReadProperty(ref reader, options, PropLt, null)) + { + continue; + } + + if (propLte.TryReadProperty(ref reader, options, PropLte, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propRelation.TryReadProperty(ref reader, options, PropRelation, static Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.TermRangeQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Field = propField.Value, + Gt = propGt.Value, + Gte = propGte.Value, + Lt = propLt.Value, + Lte = propLte.Value, + QueryName = propQueryName.Value, + Relation = propRelation.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.TermRangeQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropGt, value.Gt, null, null); + writer.WriteProperty(options, PropGte, value.Gte, null, null); + writer.WriteProperty(options, PropLt, value.Lt, null, null); + writer.WriteProperty(options, PropLte, value.Lte, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropRelation, value.Relation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermRangeQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermRangeQuery.g.cs index f6343e31e1e..5efbb71eb28 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermRangeQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermRangeQuery.g.cs @@ -23,111 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class TermRangeQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropGt = System.Text.Json.JsonEncodedText.Encode("gt"); - private static readonly System.Text.Json.JsonEncodedText PropGte = System.Text.Json.JsonEncodedText.Encode("gte"); - private static readonly System.Text.Json.JsonEncodedText PropLt = System.Text.Json.JsonEncodedText.Encode("lt"); - private static readonly System.Text.Json.JsonEncodedText PropLte = System.Text.Json.JsonEncodedText.Encode("lte"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropRelation = System.Text.Json.JsonEncodedText.Encode("relation"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.TermRangeQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - reader.Read(); - propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propGt = default; - LocalJsonValue propGte = default; - LocalJsonValue propLt = default; - LocalJsonValue propLte = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propRelation = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propGt.TryReadProperty(ref reader, options, PropGt, null)) - { - continue; - } - - if (propGte.TryReadProperty(ref reader, options, PropGte, null)) - { - continue; - } - - if (propLt.TryReadProperty(ref reader, options, PropLt, null)) - { - continue; - } - - if (propLte.TryReadProperty(ref reader, options, PropLte, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propRelation.TryReadProperty(ref reader, options, PropRelation, static Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.TermRangeQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Field = propField.Value, - Gt = propGt.Value, - Gte = propGte.Value, - Lt = propLt.Value, - Lte = propLte.Value, - QueryName = propQueryName.Value, - Relation = propRelation.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.TermRangeQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropGt, value.Gt, null, null); - writer.WriteProperty(options, PropGte, value.Gte, null, null); - writer.WriteProperty(options, PropLt, value.Lt, null, null); - writer.WriteProperty(options, PropLte, value.Lte, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropRelation, value.Relation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.TermRangeQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.TermRangeQueryConverter))] public sealed partial class TermRangeQuery : Elastic.Clients.Elasticsearch.QueryDsl.IRangeQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsLookup.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsLookup.Converters.g.cs new file mode 100644 index 00000000000..7805c1b43a6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsLookup.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class TermsLookupConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); + private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.TermsLookup Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + LocalJsonValue propPath = default; + LocalJsonValue propRouting = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propPath.TryReadProperty(ref reader, options, PropPath, null)) + { + continue; + } + + if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.TermsLookup(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + Index = propIndex.Value, + Path = propPath.Value, + Routing = propRouting.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.TermsLookup value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropPath, value.Path, null, null); + writer.WriteProperty(options, PropRouting, value.Routing, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsLookup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsLookup.g.cs index f69feabd664..262f87f494c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsLookup.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsLookup.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class TermsLookupConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropPath = System.Text.Json.JsonEncodedText.Encode("path"); - private static readonly System.Text.Json.JsonEncodedText PropRouting = System.Text.Json.JsonEncodedText.Encode("routing"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.TermsLookup Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - LocalJsonValue propPath = default; - LocalJsonValue propRouting = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propPath.TryReadProperty(ref reader, options, PropPath, null)) - { - continue; - } - - if (propRouting.TryReadProperty(ref reader, options, PropRouting, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.TermsLookup(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - Index = propIndex.Value, - Path = propPath.Value, - Routing = propRouting.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.TermsLookup value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropPath, value.Path, null, null); - writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.TermsLookupConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.TermsLookupConverter))] public sealed partial class TermsLookup { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQuery.Converters.g.cs new file mode 100644 index 00000000000..c4dcf6bdea0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQuery.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class TermsQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.TermsQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propField = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propTerms = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + propField.Initialized = propTerms.Initialized = true; + reader.ReadProperty(options, out propField.Value, out propTerms.Value, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o), null); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.TermsQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Field = propField.Value, + QueryName = propQueryName.Value, + Terms = propTerms.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.TermsQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, value.Field, value.Terms, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v), null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQuery.g.cs index 6df7b35d035..4b76c3407bd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQuery.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class TermsQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.TermsQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propField = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propTerms = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - propField.Initialized = propTerms.Initialized = true; - reader.ReadProperty(options, out propField.Value, out propTerms.Value, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o), null); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.TermsQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Field = propField.Value, - QueryName = propQueryName.Value, - Terms = propTerms.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.TermsQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, value.Field, value.Terms, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v), null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.TermsQueryConverter))] public sealed partial class TermsQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQueryField.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQueryField.Converters.g.cs new file mode 100644 index 00000000000..b3278ed18c1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQueryField.Converters.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class TermsQueryFieldConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject); + return selector(ref reader, options) switch + { + Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField(reader.ReadValue>(options, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)), + Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField(reader.ReadValue(options, null)), + _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField)}") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Tag) + { + case Elastic.Clients.Elasticsearch.UnionTag.T1: + { + writer.WriteValue(options, value.Value1, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + break; + } + + case Elastic.Clients.Elasticsearch.UnionTag.T2: + { + writer.WriteValue(options, value.Value2, null); + break; + } + + default: + throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQueryField.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQueryField.g.cs index dc9146ecff1..73362aed14d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQueryField.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQueryField.g.cs @@ -23,42 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class TermsQueryFieldConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject); - return selector(ref reader, options) switch - { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField(reader.ReadValue>(options, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField(reader.ReadValue(options, null)), - _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField)}") - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryField value, System.Text.Json.JsonSerializerOptions options) - { - switch (value.Tag) - { - case Elastic.Clients.Elasticsearch.UnionTag.T1: - { - writer.WriteValue(options, value.Value1, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - break; - } - - case Elastic.Clients.Elasticsearch.UnionTag.T2: - { - writer.WriteValue(options, value.Value2, null); - break; - } - - default: - throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); - } - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.TermsQueryFieldConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.TermsQueryFieldConverter))] public sealed partial class TermsQueryField : Elastic.Clients.Elasticsearch.Union, Elastic.Clients.Elasticsearch.QueryDsl.TermsLookup> { public TermsQueryField(System.Collections.Generic.ICollection value) : base(value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsSetQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsSetQuery.Converters.g.cs new file mode 100644 index 00000000000..8e004a1c015 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsSetQuery.Converters.g.cs @@ -0,0 +1,119 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class TermsSetQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropMinimumShouldMatch = System.Text.Json.JsonEncodedText.Encode("minimum_should_match"); + private static readonly System.Text.Json.JsonEncodedText PropMinimumShouldMatchField = System.Text.Json.JsonEncodedText.Encode("minimum_should_match_field"); + private static readonly System.Text.Json.JsonEncodedText PropMinimumShouldMatchScript = System.Text.Json.JsonEncodedText.Encode("minimum_should_match_script"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropTerms = System.Text.Json.JsonEncodedText.Encode("terms"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.TermsSetQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + reader.Read(); + propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propMinimumShouldMatch = default; + LocalJsonValue propMinimumShouldMatchField = default; + LocalJsonValue propMinimumShouldMatchScript = default; + LocalJsonValue propQueryName = default; + LocalJsonValue> propTerms = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinimumShouldMatch.TryReadProperty(ref reader, options, PropMinimumShouldMatch, null)) + { + continue; + } + + if (propMinimumShouldMatchField.TryReadProperty(ref reader, options, PropMinimumShouldMatchField, null)) + { + continue; + } + + if (propMinimumShouldMatchScript.TryReadProperty(ref reader, options, PropMinimumShouldMatchScript, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propTerms.TryReadProperty(ref reader, options, PropTerms, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.TermsSetQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Field = propField.Value, + MinimumShouldMatch = propMinimumShouldMatch.Value, + MinimumShouldMatchField = propMinimumShouldMatchField.Value, + MinimumShouldMatchScript = propMinimumShouldMatchScript.Value, + QueryName = propQueryName.Value, + Terms = propTerms.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.TermsSetQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinimumShouldMatch, value.MinimumShouldMatch, null, null); + writer.WriteProperty(options, PropMinimumShouldMatchField, value.MinimumShouldMatchField, null, null); + writer.WriteProperty(options, PropMinimumShouldMatchScript, value.MinimumShouldMatchScript, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropTerms, value.Terms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsSetQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsSetQuery.g.cs index 3e6005c5143..1d1af19be58 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsSetQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsSetQuery.g.cs @@ -23,102 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class TermsSetQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropMinimumShouldMatch = System.Text.Json.JsonEncodedText.Encode("minimum_should_match"); - private static readonly System.Text.Json.JsonEncodedText PropMinimumShouldMatchField = System.Text.Json.JsonEncodedText.Encode("minimum_should_match_field"); - private static readonly System.Text.Json.JsonEncodedText PropMinimumShouldMatchScript = System.Text.Json.JsonEncodedText.Encode("minimum_should_match_script"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropTerms = System.Text.Json.JsonEncodedText.Encode("terms"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.TermsSetQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - reader.Read(); - propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propMinimumShouldMatch = default; - LocalJsonValue propMinimumShouldMatchField = default; - LocalJsonValue propMinimumShouldMatchScript = default; - LocalJsonValue propQueryName = default; - LocalJsonValue> propTerms = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinimumShouldMatch.TryReadProperty(ref reader, options, PropMinimumShouldMatch, null)) - { - continue; - } - - if (propMinimumShouldMatchField.TryReadProperty(ref reader, options, PropMinimumShouldMatchField, null)) - { - continue; - } - - if (propMinimumShouldMatchScript.TryReadProperty(ref reader, options, PropMinimumShouldMatchScript, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propTerms.TryReadProperty(ref reader, options, PropTerms, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.TermsSetQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Field = propField.Value, - MinimumShouldMatch = propMinimumShouldMatch.Value, - MinimumShouldMatchField = propMinimumShouldMatchField.Value, - MinimumShouldMatchScript = propMinimumShouldMatchScript.Value, - QueryName = propQueryName.Value, - Terms = propTerms.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.TermsSetQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinimumShouldMatch, value.MinimumShouldMatch, null, null); - writer.WriteProperty(options, PropMinimumShouldMatchField, value.MinimumShouldMatchField, null, null); - writer.WriteProperty(options, PropMinimumShouldMatchScript, value.MinimumShouldMatchScript, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropTerms, value.Terms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.TermsSetQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.TermsSetQueryConverter))] public sealed partial class TermsSetQuery { [System.Obsolete("The type contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TextExpansionQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TextExpansionQuery.Converters.g.cs new file mode 100644 index 00000000000..7fe0f1d785e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TextExpansionQuery.Converters.g.cs @@ -0,0 +1,110 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class TextExpansionQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); + private static readonly System.Text.Json.JsonEncodedText PropModelText = System.Text.Json.JsonEncodedText.Encode("model_text"); + private static readonly System.Text.Json.JsonEncodedText PropPruningConfig = System.Text.Json.JsonEncodedText.Encode("pruning_config"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.TextExpansionQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + reader.Read(); + propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propModelId = default; + LocalJsonValue propModelText = default; + LocalJsonValue propPruningConfig = default; + LocalJsonValue propQueryName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) + { + continue; + } + + if (propModelText.TryReadProperty(ref reader, options, PropModelText, null)) + { + continue; + } + + if (propPruningConfig.TryReadProperty(ref reader, options, PropPruningConfig, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.TextExpansionQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Field = propField.Value, + ModelId = propModelId.Value, + ModelText = propModelText.Value, + PruningConfig = propPruningConfig.Value, + QueryName = propQueryName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.TextExpansionQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropModelId, value.ModelId, null, null); + writer.WriteProperty(options, PropModelText, value.ModelText, null, null); + writer.WriteProperty(options, PropPruningConfig, value.PruningConfig, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TextExpansionQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TextExpansionQuery.g.cs index 1069be14cd5..523a6270bb2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TextExpansionQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TextExpansionQuery.g.cs @@ -23,93 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class TextExpansionQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); - private static readonly System.Text.Json.JsonEncodedText PropModelText = System.Text.Json.JsonEncodedText.Encode("model_text"); - private static readonly System.Text.Json.JsonEncodedText PropPruningConfig = System.Text.Json.JsonEncodedText.Encode("pruning_config"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.TextExpansionQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - reader.Read(); - propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propModelId = default; - LocalJsonValue propModelText = default; - LocalJsonValue propPruningConfig = default; - LocalJsonValue propQueryName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) - { - continue; - } - - if (propModelText.TryReadProperty(ref reader, options, PropModelText, null)) - { - continue; - } - - if (propPruningConfig.TryReadProperty(ref reader, options, PropPruningConfig, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.TextExpansionQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Field = propField.Value, - ModelId = propModelId.Value, - ModelText = propModelText.Value, - PruningConfig = propPruningConfig.Value, - QueryName = propQueryName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.TextExpansionQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropModelId, value.ModelId, null, null); - writer.WriteProperty(options, PropModelText, value.ModelText, null, null); - writer.WriteProperty(options, PropPruningConfig, value.PruningConfig, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteEndObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.TextExpansionQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.TextExpansionQueryConverter))] public sealed partial class TextExpansionQuery { [System.Obsolete("The type contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TextQueryType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TextQueryType.Converters.g.cs new file mode 100644 index 00000000000..3ff5b7c63cd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TextQueryType.Converters.g.cs @@ -0,0 +1,137 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class TextQueryTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberBestFields = System.Text.Json.JsonEncodedText.Encode("best_fields"); + private static readonly System.Text.Json.JsonEncodedText MemberBoolPrefix = System.Text.Json.JsonEncodedText.Encode("bool_prefix"); + private static readonly System.Text.Json.JsonEncodedText MemberCrossFields = System.Text.Json.JsonEncodedText.Encode("cross_fields"); + private static readonly System.Text.Json.JsonEncodedText MemberMostFields = System.Text.Json.JsonEncodedText.Encode("most_fields"); + private static readonly System.Text.Json.JsonEncodedText MemberPhrase = System.Text.Json.JsonEncodedText.Encode("phrase"); + private static readonly System.Text.Json.JsonEncodedText MemberPhrasePrefix = System.Text.Json.JsonEncodedText.Encode("phrase_prefix"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberBestFields)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.BestFields; + } + + if (reader.ValueTextEquals(MemberBoolPrefix)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.BoolPrefix; + } + + if (reader.ValueTextEquals(MemberCrossFields)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.CrossFields; + } + + if (reader.ValueTextEquals(MemberMostFields)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.MostFields; + } + + if (reader.ValueTextEquals(MemberPhrase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.Phrase; + } + + if (reader.ValueTextEquals(MemberPhrasePrefix)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.PhrasePrefix; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberBestFields.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.BestFields; + } + + if (string.Equals(value, MemberBoolPrefix.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.BoolPrefix; + } + + if (string.Equals(value, MemberCrossFields.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.CrossFields; + } + + if (string.Equals(value, MemberMostFields.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.MostFields; + } + + if (string.Equals(value, MemberPhrase.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.Phrase; + } + + if (string.Equals(value, MemberPhrasePrefix.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.PhrasePrefix; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.BestFields: + writer.WriteStringValue(MemberBestFields); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.BoolPrefix: + writer.WriteStringValue(MemberBoolPrefix); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.CrossFields: + writer.WriteStringValue(MemberCrossFields); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.MostFields: + writer.WriteStringValue(MemberMostFields); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.Phrase: + writer.WriteStringValue(MemberPhrase); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType.PhrasePrefix: + writer.WriteStringValue(MemberPhrasePrefix); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.TextQueryType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TextQueryType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TextQueryType.g.cs new file mode 100644 index 00000000000..17562acf876 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TextQueryType.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.TextQueryTypeConverter))] +public enum TextQueryType +{ + /// + /// + /// Finds documents that match any field, but uses the _score from the best field. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "best_fields")] + BestFields, + /// + /// + /// Creates a match_bool_prefix query on each field and combines the _score from each field. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "bool_prefix")] + BoolPrefix, + /// + /// + /// Treats fields with the same analyzer as though they were one big field. + /// Looks for each word in any field. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "cross_fields")] + CrossFields, + /// + /// + /// Finds documents that match any field and combines the _score from each field. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "most_fields")] + MostFields, + /// + /// + /// Runs a match_phrase query on each field and uses the _score from the best field. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "phrase")] + Phrase, + /// + /// + /// Runs a match_phrase_prefix query on each field and uses the _score from the best field. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "phrase_prefix")] + PhrasePrefix +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TypeQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TypeQuery.Converters.g.cs new file mode 100644 index 00000000000..ca9ce4b2530 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TypeQuery.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class TypeQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.TypeQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.TypeQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + QueryName = propQueryName.Value, + Value = propValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.TypeQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropValue, value.Value, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TypeQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TypeQuery.g.cs index 7c8c9b71df8..844da15009c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TypeQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TypeQuery.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class TypeQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.TypeQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propValue = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.TypeQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - QueryName = propQueryName.Value, - Value = propValue.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.TypeQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropValue, value.Value, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.TypeQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.TypeQueryConverter))] public sealed partial class TypeQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedDecayFunction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedDecayFunction.Converters.g.cs new file mode 100644 index 00000000000..7edc289e94a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedDecayFunction.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class UntypedDecayFunctionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMultiValueMode = System.Text.Json.JsonEncodedText.Encode("multi_value_mode"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.UntypedDecayFunction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propMultiValueMode = default; + LocalJsonValue> propPlacement = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMultiValueMode.TryReadProperty(ref reader, options, PropMultiValueMode, static Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + propField.Initialized = propPlacement.Initialized = true; + reader.ReadProperty(options, out propField.Value, out propPlacement.Value, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o), null); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.UntypedDecayFunction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + MultiValueMode = propMultiValueMode.Value, + Placement = propPlacement.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.UntypedDecayFunction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMultiValueMode, value.MultiValueMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, value.Field, value.Placement, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v), null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedDecayFunction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedDecayFunction.g.cs index e2756365268..74abb193b3b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedDecayFunction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedDecayFunction.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class UntypedDecayFunctionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMultiValueMode = System.Text.Json.JsonEncodedText.Encode("multi_value_mode"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.UntypedDecayFunction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propMultiValueMode = default; - LocalJsonValue> propPlacement = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMultiValueMode.TryReadProperty(ref reader, options, PropMultiValueMode, static Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - propField.Initialized = propPlacement.Initialized = true; - reader.ReadProperty(options, out propField.Value, out propPlacement.Value, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o), null); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.UntypedDecayFunction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - MultiValueMode = propMultiValueMode.Value, - Placement = propPlacement.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.UntypedDecayFunction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMultiValueMode, value.MultiValueMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.MultiValueMode? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, value.Field, value.Placement, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v), null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.UntypedDecayFunctionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.UntypedDecayFunctionConverter))] public sealed partial class UntypedDecayFunction : Elastic.Clients.Elasticsearch.QueryDsl.IDecayFunction { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedDistanceFeatureQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedDistanceFeatureQuery.Converters.g.cs new file mode 100644 index 00000000000..daa0e9032fc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedDistanceFeatureQuery.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class UntypedDistanceFeatureQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropOrigin = System.Text.Json.JsonEncodedText.Encode("origin"); + private static readonly System.Text.Json.JsonEncodedText PropPivot = System.Text.Json.JsonEncodedText.Encode("pivot"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.UntypedDistanceFeatureQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propField = default; + LocalJsonValue propOrigin = default; + LocalJsonValue propPivot = default; + LocalJsonValue propQueryName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propOrigin.TryReadProperty(ref reader, options, PropOrigin, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propPivot.TryReadProperty(ref reader, options, PropPivot, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.UntypedDistanceFeatureQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Field = propField.Value, + Origin = propOrigin.Value, + Pivot = propPivot.Value, + QueryName = propQueryName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.UntypedDistanceFeatureQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropOrigin, value.Origin, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropPivot, value.Pivot, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedDistanceFeatureQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedDistanceFeatureQuery.g.cs index d679afdfbf1..5c037b627f6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedDistanceFeatureQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedDistanceFeatureQuery.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class UntypedDistanceFeatureQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropOrigin = System.Text.Json.JsonEncodedText.Encode("origin"); - private static readonly System.Text.Json.JsonEncodedText PropPivot = System.Text.Json.JsonEncodedText.Encode("pivot"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.UntypedDistanceFeatureQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propField = default; - LocalJsonValue propOrigin = default; - LocalJsonValue propPivot = default; - LocalJsonValue propQueryName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propOrigin.TryReadProperty(ref reader, options, PropOrigin, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propPivot.TryReadProperty(ref reader, options, PropPivot, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.UntypedDistanceFeatureQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Field = propField.Value, - Origin = propOrigin.Value, - Pivot = propPivot.Value, - QueryName = propQueryName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.UntypedDistanceFeatureQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropOrigin, value.Origin, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropPivot, value.Pivot, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.UntypedDistanceFeatureQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.UntypedDistanceFeatureQueryConverter))] public sealed partial class UntypedDistanceFeatureQuery : Elastic.Clients.Elasticsearch.QueryDsl.IDistanceFeatureQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedRangeQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedRangeQuery.Converters.g.cs new file mode 100644 index 00000000000..5fd47e1d75c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedRangeQuery.Converters.g.cs @@ -0,0 +1,146 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class UntypedRangeQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropGt = System.Text.Json.JsonEncodedText.Encode("gt"); + private static readonly System.Text.Json.JsonEncodedText PropGte = System.Text.Json.JsonEncodedText.Encode("gte"); + private static readonly System.Text.Json.JsonEncodedText PropLt = System.Text.Json.JsonEncodedText.Encode("lt"); + private static readonly System.Text.Json.JsonEncodedText PropLte = System.Text.Json.JsonEncodedText.Encode("lte"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropRelation = System.Text.Json.JsonEncodedText.Encode("relation"); + private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + reader.Read(); + propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propFormat = default; + LocalJsonValue propGt = default; + LocalJsonValue propGte = default; + LocalJsonValue propLt = default; + LocalJsonValue propLte = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propRelation = default; + LocalJsonValue propTimeZone = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propGt.TryReadProperty(ref reader, options, PropGt, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propGte.TryReadProperty(ref reader, options, PropGte, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propLt.TryReadProperty(ref reader, options, PropLt, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propLte.TryReadProperty(ref reader, options, PropLte, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propRelation.TryReadProperty(ref reader, options, PropRelation, static Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTimeZone.TryReadProperty(ref reader, options, PropTimeZone, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Field = propField.Value, + Format = propFormat.Value, + Gt = propGt.Value, + Gte = propGte.Value, + Lt = propLt.Value, + Lte = propLte.Value, + QueryName = propQueryName.Value, + Relation = propRelation.Value, + TimeZone = propTimeZone.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropGt, value.Gt, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropGte, value.Gte, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropLt, value.Lt, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropLte, value.Lte, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropRelation, value.Relation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedRangeQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedRangeQuery.g.cs index cb193821784..2259aaa98eb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedRangeQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/UntypedRangeQuery.g.cs @@ -23,129 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class UntypedRangeQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropGt = System.Text.Json.JsonEncodedText.Encode("gt"); - private static readonly System.Text.Json.JsonEncodedText PropGte = System.Text.Json.JsonEncodedText.Encode("gte"); - private static readonly System.Text.Json.JsonEncodedText PropLt = System.Text.Json.JsonEncodedText.Encode("lt"); - private static readonly System.Text.Json.JsonEncodedText PropLte = System.Text.Json.JsonEncodedText.Encode("lte"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropRelation = System.Text.Json.JsonEncodedText.Encode("relation"); - private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - reader.Read(); - propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propFormat = default; - LocalJsonValue propGt = default; - LocalJsonValue propGte = default; - LocalJsonValue propLt = default; - LocalJsonValue propLte = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propRelation = default; - LocalJsonValue propTimeZone = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propGt.TryReadProperty(ref reader, options, PropGt, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propGte.TryReadProperty(ref reader, options, PropGte, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propLt.TryReadProperty(ref reader, options, PropLt, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propLte.TryReadProperty(ref reader, options, PropLte, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propRelation.TryReadProperty(ref reader, options, PropRelation, static Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTimeZone.TryReadProperty(ref reader, options, PropTimeZone, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Field = propField.Value, - Format = propFormat.Value, - Gt = propGt.Value, - Gte = propGte.Value, - Lt = propLt.Value, - Lte = propLte.Value, - QueryName = propQueryName.Value, - Relation = propRelation.Value, - TimeZone = propTimeZone.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropGt, value.Gt, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropGte, value.Gte, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropLt, value.Lt, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropLte, value.Lte, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropRelation, value.Relation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.QueryDsl.RangeRelation? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); - writer.WriteEndObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.UntypedRangeQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.UntypedRangeQueryConverter))] public sealed partial class UntypedRangeQuery : Elastic.Clients.Elasticsearch.QueryDsl.IRangeQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WeightedTokensQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WeightedTokensQuery.Converters.g.cs new file mode 100644 index 00000000000..b369cedfbd6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WeightedTokensQuery.Converters.g.cs @@ -0,0 +1,101 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class WeightedTokensQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropPruningConfig = System.Text.Json.JsonEncodedText.Encode("pruning_config"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropTokens = System.Text.Json.JsonEncodedText.Encode("tokens"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.WeightedTokensQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + reader.Read(); + propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propPruningConfig = default; + LocalJsonValue propQueryName = default; + LocalJsonValue>> propTokens = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPruningConfig.TryReadProperty(ref reader, options, PropPruningConfig, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propTokens.TryReadProperty(ref reader, options, PropTokens, static System.Collections.Generic.ICollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue>(o, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.WeightedTokensQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Field = propField.Value, + PruningConfig = propPruningConfig.Value, + QueryName = propQueryName.Value, + Tokens = propTokens.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.WeightedTokensQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPruningConfig, value.PruningConfig, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropTokens, value.Tokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection> v) => w.WriteSingleOrManyCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, null))); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WeightedTokensQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WeightedTokensQuery.g.cs index 31bde63be7d..a0fd01e0fc7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WeightedTokensQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WeightedTokensQuery.g.cs @@ -23,84 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class WeightedTokensQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropPruningConfig = System.Text.Json.JsonEncodedText.Encode("pruning_config"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropTokens = System.Text.Json.JsonEncodedText.Encode("tokens"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.WeightedTokensQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - reader.Read(); - propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propPruningConfig = default; - LocalJsonValue propQueryName = default; - LocalJsonValue>> propTokens = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPruningConfig.TryReadProperty(ref reader, options, PropPruningConfig, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propTokens.TryReadProperty(ref reader, options, PropTokens, static System.Collections.Generic.ICollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue>(o, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.WeightedTokensQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Field = propField.Value, - PruningConfig = propPruningConfig.Value, - QueryName = propQueryName.Value, - Tokens = propTokens.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.WeightedTokensQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPruningConfig, value.PruningConfig, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropTokens, value.Tokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection> v) => w.WriteSingleOrManyCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, null))); - writer.WriteEndObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.WeightedTokensQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.WeightedTokensQueryConverter))] public sealed partial class WeightedTokensQuery { [System.Obsolete("The type contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WildcardQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WildcardQuery.Converters.g.cs new file mode 100644 index 00000000000..b18e81d6353 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WildcardQuery.Converters.g.cs @@ -0,0 +1,130 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class WildcardQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropCaseInsensitive = System.Text.Json.JsonEncodedText.Encode("case_insensitive"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropRewrite = System.Text.Json.JsonEncodedText.Encode("rewrite"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + private static readonly System.Text.Json.JsonEncodedText PropWildcard = System.Text.Json.JsonEncodedText.Encode("wildcard"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.WildcardQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + reader.Read(); + propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); + reader.Read(); + if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) + { + var value = reader.ReadValue(options, null); + reader.Read(); + return new Elastic.Clients.Elasticsearch.QueryDsl.WildcardQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Value = value + }; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propCaseInsensitive = default; + LocalJsonValue propQueryName = default; + LocalJsonValue propRewrite = default; + LocalJsonValue propValue = default; + LocalJsonValue propWildcard = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propCaseInsensitive.TryReadProperty(ref reader, options, PropCaseInsensitive, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (propRewrite.TryReadProperty(ref reader, options, PropRewrite, null)) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, null)) + { + continue; + } + + if (propWildcard.TryReadProperty(ref reader, options, PropWildcard, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + reader.Read(); + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.WildcardQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + CaseInsensitive = propCaseInsensitive.Value, + Field = propField.Value, + QueryName = propQueryName.Value, + Rewrite = propRewrite.Value, + Value = propValue.Value, + Wildcard = propWildcard.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.WildcardQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropCaseInsensitive, value.CaseInsensitive, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteProperty(options, PropRewrite, value.Rewrite, null, null); + writer.WriteProperty(options, PropValue, value.Value, null, null); + writer.WriteProperty(options, PropWildcard, value.Wildcard, null, null); + writer.WriteEndObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WildcardQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WildcardQuery.g.cs index 134be008ca3..4a5e7e77054 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WildcardQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WildcardQuery.g.cs @@ -23,113 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class WildcardQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropCaseInsensitive = System.Text.Json.JsonEncodedText.Encode("case_insensitive"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropRewrite = System.Text.Json.JsonEncodedText.Encode("rewrite"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - private static readonly System.Text.Json.JsonEncodedText PropWildcard = System.Text.Json.JsonEncodedText.Encode("wildcard"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.WildcardQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - reader.Read(); - propField.ReadPropertyName(ref reader, options, static Elastic.Clients.Elasticsearch.Field (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)); - reader.Read(); - if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) - { - var value = reader.ReadValue(options, null); - reader.Read(); - return new Elastic.Clients.Elasticsearch.QueryDsl.WildcardQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Value = value - }; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propCaseInsensitive = default; - LocalJsonValue propQueryName = default; - LocalJsonValue propRewrite = default; - LocalJsonValue propValue = default; - LocalJsonValue propWildcard = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propCaseInsensitive.TryReadProperty(ref reader, options, PropCaseInsensitive, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (propRewrite.TryReadProperty(ref reader, options, PropRewrite, null)) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, null)) - { - continue; - } - - if (propWildcard.TryReadProperty(ref reader, options, PropWildcard, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - reader.Read(); - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.WildcardQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - CaseInsensitive = propCaseInsensitive.Value, - Field = propField.Value, - QueryName = propQueryName.Value, - Rewrite = propRewrite.Value, - Value = propValue.Value, - Wildcard = propWildcard.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.WildcardQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WritePropertyName(options, value.Field, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Field v) => w.WritePropertyName(o, v)); - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropCaseInsensitive, value.CaseInsensitive, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteProperty(options, PropRewrite, value.Rewrite, null, null); - writer.WriteProperty(options, PropValue, value.Value, null, null); - writer.WriteProperty(options, PropWildcard, value.Wildcard, null, null); - writer.WriteEndObject(); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.WildcardQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.WildcardQueryConverter))] public sealed partial class WildcardQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WrapperQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WrapperQuery.Converters.g.cs new file mode 100644 index 00000000000..1e16d88d9a1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WrapperQuery.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class WrapperQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.WrapperQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoost = default; + LocalJsonValue propQuery = default; + LocalJsonValue propQueryName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryDsl.WrapperQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Boost = propBoost.Value, + Query = propQuery.Value, + QueryName = propQueryName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.WrapperQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WrapperQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WrapperQuery.g.cs index 4f16f9a5335..cb3ebc953b8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WrapperQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/WrapperQuery.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed partial class WrapperQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoost = System.Text.Json.JsonEncodedText.Encode("boost"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropQueryName = System.Text.Json.JsonEncodedText.Encode("_name"); - - public override Elastic.Clients.Elasticsearch.QueryDsl.WrapperQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoost = default; - LocalJsonValue propQuery = default; - LocalJsonValue propQueryName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propQueryName.TryReadProperty(ref reader, options, PropQueryName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryDsl.WrapperQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Boost = propBoost.Value, - Query = propQuery.Value, - QueryName = propQueryName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.WrapperQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoost, value.Boost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.WrapperQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.WrapperQueryConverter))] public sealed partial class WrapperQuery { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ZeroTermsQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ZeroTermsQuery.Converters.g.cs new file mode 100644 index 00000000000..6bb4b7d0616 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ZeroTermsQuery.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl.Json; + +public sealed partial class ZeroTermsQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAll = System.Text.Json.JsonEncodedText.Encode("all"); + private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); + + public override Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAll)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery.All; + } + + if (reader.ValueTextEquals(MemberNone)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery.None; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAll.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery.All; + } + + if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery.None; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery.All: + writer.WriteStringValue(MemberAll); + break; + case Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery.None: + writer.WriteStringValue(MemberNone); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryDsl.ZeroTermsQuery value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ZeroTermsQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ZeroTermsQuery.g.cs new file mode 100644 index 00000000000..87d4ad218e6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/ZeroTermsQuery.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryDsl; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryDsl.Json.ZeroTermsQueryConverter))] +public enum ZeroTermsQuery +{ + /// + /// + /// Returns all documents, similar to a match_all query. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "all")] + All, + /// + /// + /// No documents are returned if the analyzer removes all tokens. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "none")] + None +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRule.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRule.Converters.g.cs new file mode 100644 index 00000000000..a290d15edae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRule.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRules.Json; + +public sealed partial class QueryRuleConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropActions = System.Text.Json.JsonEncodedText.Encode("actions"); + private static readonly System.Text.Json.JsonEncodedText PropCriteria = System.Text.Json.JsonEncodedText.Encode("criteria"); + private static readonly System.Text.Json.JsonEncodedText PropPriority = System.Text.Json.JsonEncodedText.Encode("priority"); + private static readonly System.Text.Json.JsonEncodedText PropRuleId = System.Text.Json.JsonEncodedText.Encode("rule_id"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.QueryRules.QueryRule Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propActions = default; + LocalJsonValue> propCriteria = default; + LocalJsonValue propPriority = default; + LocalJsonValue propRuleId = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propActions.TryReadProperty(ref reader, options, PropActions, null)) + { + continue; + } + + if (propCriteria.TryReadProperty(ref reader, options, PropCriteria, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propPriority.TryReadProperty(ref reader, options, PropPriority, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRuleId.TryReadProperty(ref reader, options, PropRuleId, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryRules.QueryRule(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Actions = propActions.Value, + Criteria = propCriteria.Value, + Priority = propPriority.Value, + RuleId = propRuleId.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.QueryRule value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropActions, value.Actions, null, null); + writer.WriteProperty(options, PropCriteria, value.Criteria, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPriority, value.Priority, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRuleId, value.RuleId, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRule.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRule.g.cs index f5fdf9fe241..2da42d462d6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRule.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRule.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryRules; -internal sealed partial class QueryRuleConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropActions = System.Text.Json.JsonEncodedText.Encode("actions"); - private static readonly System.Text.Json.JsonEncodedText PropCriteria = System.Text.Json.JsonEncodedText.Encode("criteria"); - private static readonly System.Text.Json.JsonEncodedText PropPriority = System.Text.Json.JsonEncodedText.Encode("priority"); - private static readonly System.Text.Json.JsonEncodedText PropRuleId = System.Text.Json.JsonEncodedText.Encode("rule_id"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.QueryRules.QueryRule Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propActions = default; - LocalJsonValue> propCriteria = default; - LocalJsonValue propPriority = default; - LocalJsonValue propRuleId = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propActions.TryReadProperty(ref reader, options, PropActions, null)) - { - continue; - } - - if (propCriteria.TryReadProperty(ref reader, options, PropCriteria, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (propPriority.TryReadProperty(ref reader, options, PropPriority, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRuleId.TryReadProperty(ref reader, options, PropRuleId, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryRules.QueryRule(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Actions = propActions.Value, - Criteria = propCriteria.Value, - Priority = propPriority.Value, - RuleId = propRuleId.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.QueryRule value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropActions, value.Actions, null, null); - writer.WriteProperty(options, PropCriteria, value.Criteria, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPriority, value.Priority, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRuleId, value.RuleId, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.QueryRuleConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.Json.QueryRuleConverter))] public sealed partial class QueryRule { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleActions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleActions.Converters.g.cs new file mode 100644 index 00000000000..436fa92963e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleActions.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRules.Json; + +public sealed partial class QueryRuleActionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); + private static readonly System.Text.Json.JsonEncodedText PropIds = System.Text.Json.JsonEncodedText.Encode("ids"); + + public override Elastic.Clients.Elasticsearch.QueryRules.QueryRuleActions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propDocs = default; + LocalJsonValue?> propIds = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocs.TryReadProperty(ref reader, options, PropDocs, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propIds.TryReadProperty(ref reader, options, PropIds, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryRules.QueryRuleActions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Docs = propDocs.Value, + Ids = propIds.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.QueryRuleActions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocs, value.Docs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIds, value.Ids, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleActions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleActions.g.cs index b70f765d0bc..0e00d599438 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleActions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleActions.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryRules; -internal sealed partial class QueryRuleActionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocs = System.Text.Json.JsonEncodedText.Encode("docs"); - private static readonly System.Text.Json.JsonEncodedText PropIds = System.Text.Json.JsonEncodedText.Encode("ids"); - - public override Elastic.Clients.Elasticsearch.QueryRules.QueryRuleActions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propDocs = default; - LocalJsonValue?> propIds = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocs.TryReadProperty(ref reader, options, PropDocs, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propIds.TryReadProperty(ref reader, options, PropIds, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryRules.QueryRuleActions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Docs = propDocs.Value, - Ids = propIds.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.QueryRuleActions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocs, value.Docs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIds, value.Ids, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.QueryRuleActionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.Json.QueryRuleActionsConverter))] public sealed partial class QueryRuleActions { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleCriteria.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleCriteria.Converters.g.cs new file mode 100644 index 00000000000..af9d2a72923 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleCriteria.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRules.Json; + +public sealed partial class QueryRuleCriteriaConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropValues = System.Text.Json.JsonEncodedText.Encode("values"); + + public override Elastic.Clients.Elasticsearch.QueryRules.QueryRuleCriteria Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMetadata = default; + LocalJsonValue propType = default; + LocalJsonValue?> propValues = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (propValues.TryReadProperty(ref reader, options, PropValues, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryRules.QueryRuleCriteria(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Metadata = propMetadata.Value, + Type = propType.Value, + Values = propValues.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.QueryRuleCriteria value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropValues, value.Values, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleCriteria.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleCriteria.g.cs index 447285ed7b0..332a91b5fbc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleCriteria.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleCriteria.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryRules; -internal sealed partial class QueryRuleCriteriaConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropValues = System.Text.Json.JsonEncodedText.Encode("values"); - - public override Elastic.Clients.Elasticsearch.QueryRules.QueryRuleCriteria Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMetadata = default; - LocalJsonValue propType = default; - LocalJsonValue?> propValues = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (propValues.TryReadProperty(ref reader, options, PropValues, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryRules.QueryRuleCriteria(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Metadata = propMetadata.Value, - Type = propType.Value, - Values = propValues.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.QueryRuleCriteria value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropValues, value.Values, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.QueryRuleCriteriaConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.Json.QueryRuleCriteriaConverter))] public sealed partial class QueryRuleCriteria { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryRules.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleCriteriaType.Converters.g.cs similarity index 69% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryRules.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleCriteriaType.Converters.g.cs index e274535bf9a..ead730444c8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryRules.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleCriteriaType.Converters.g.cs @@ -21,66 +21,9 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.QueryRules; +namespace Elastic.Clients.Elasticsearch.QueryRules.Json; -internal sealed partial class QueryRuleTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberExclude = System.Text.Json.JsonEncodedText.Encode("exclude"); - private static readonly System.Text.Json.JsonEncodedText MemberPinned = System.Text.Json.JsonEncodedText.Encode("pinned"); - - public override Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberExclude)) - { - return Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType.Exclude; - } - - if (reader.ValueTextEquals(MemberPinned)) - { - return Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType.Pinned; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberExclude.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType.Exclude; - } - - if (string.Equals(value, MemberPinned.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType.Pinned; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType.Exclude: - writer.WriteStringValue(MemberExclude); - break; - case Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType.Pinned: - writer.WriteStringValue(MemberPinned); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class QueryRuleCriteriaTypeConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class QueryRuleCriteriaTypeConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText MemberAlways = System.Text.Json.JsonEncodedText.Encode("always"); private static readonly System.Text.Json.JsonEncodedText MemberContains = System.Text.Json.JsonEncodedText.Encode("contains"); @@ -275,42 +218,4 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, { Write(writer, value, options); } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.QueryRuleTypeConverter))] -public enum QueryRuleType -{ - [System.Runtime.Serialization.EnumMember(Value = "exclude")] - Exclude, - [System.Runtime.Serialization.EnumMember(Value = "pinned")] - Pinned -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.QueryRuleCriteriaTypeConverter))] -public enum QueryRuleCriteriaType -{ - [System.Runtime.Serialization.EnumMember(Value = "always")] - Always, - [System.Runtime.Serialization.EnumMember(Value = "contains")] - Contains, - [System.Runtime.Serialization.EnumMember(Value = "exact")] - Exact, - [System.Runtime.Serialization.EnumMember(Value = "exact_fuzzy")] - ExactFuzzy, - [System.Runtime.Serialization.EnumMember(Value = "fuzzy")] - Fuzzy, - [System.Runtime.Serialization.EnumMember(Value = "global")] - Global, - [System.Runtime.Serialization.EnumMember(Value = "gt")] - Gt, - [System.Runtime.Serialization.EnumMember(Value = "gte")] - Gte, - [System.Runtime.Serialization.EnumMember(Value = "lt")] - Lt, - [System.Runtime.Serialization.EnumMember(Value = "lte")] - Lte, - [System.Runtime.Serialization.EnumMember(Value = "prefix")] - Prefix, - [System.Runtime.Serialization.EnumMember(Value = "suffix")] - Suffix } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleCriteriaType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleCriteriaType.g.cs new file mode 100644 index 00000000000..32bef61862b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleCriteriaType.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRules; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.Json.QueryRuleCriteriaTypeConverter))] +public enum QueryRuleCriteriaType +{ + [System.Runtime.Serialization.EnumMember(Value = "always")] + Always, + [System.Runtime.Serialization.EnumMember(Value = "contains")] + Contains, + [System.Runtime.Serialization.EnumMember(Value = "exact")] + Exact, + [System.Runtime.Serialization.EnumMember(Value = "exact_fuzzy")] + ExactFuzzy, + [System.Runtime.Serialization.EnumMember(Value = "fuzzy")] + Fuzzy, + [System.Runtime.Serialization.EnumMember(Value = "global")] + Global, + [System.Runtime.Serialization.EnumMember(Value = "gt")] + Gt, + [System.Runtime.Serialization.EnumMember(Value = "gte")] + Gte, + [System.Runtime.Serialization.EnumMember(Value = "lt")] + Lt, + [System.Runtime.Serialization.EnumMember(Value = "lte")] + Lte, + [System.Runtime.Serialization.EnumMember(Value = "prefix")] + Prefix, + [System.Runtime.Serialization.EnumMember(Value = "suffix")] + Suffix +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleType.Converters.g.cs new file mode 100644 index 00000000000..be3ffc090ec --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleType.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRules.Json; + +public sealed partial class QueryRuleTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberExclude = System.Text.Json.JsonEncodedText.Encode("exclude"); + private static readonly System.Text.Json.JsonEncodedText MemberPinned = System.Text.Json.JsonEncodedText.Encode("pinned"); + + public override Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberExclude)) + { + return Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType.Exclude; + } + + if (reader.ValueTextEquals(MemberPinned)) + { + return Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType.Pinned; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberExclude.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType.Exclude; + } + + if (string.Equals(value, MemberPinned.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType.Pinned; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType.Exclude: + writer.WriteStringValue(MemberExclude); + break; + case Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType.Pinned: + writer.WriteStringValue(MemberPinned); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.QueryRuleType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleType.g.cs new file mode 100644 index 00000000000..12b8c7d8769 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRuleType.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRules; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.Json.QueryRuleTypeConverter))] +public enum QueryRuleType +{ + [System.Runtime.Serialization.EnumMember(Value = "exclude")] + Exclude, + [System.Runtime.Serialization.EnumMember(Value = "pinned")] + Pinned +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRulesetListItem.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRulesetListItem.Converters.g.cs new file mode 100644 index 00000000000..4b381a8406c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRulesetListItem.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRules.Json; + +public sealed partial class QueryRulesetListItemConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRuleCriteriaTypesCounts = System.Text.Json.JsonEncodedText.Encode("rule_criteria_types_counts"); + private static readonly System.Text.Json.JsonEncodedText PropRulesetId = System.Text.Json.JsonEncodedText.Encode("ruleset_id"); + private static readonly System.Text.Json.JsonEncodedText PropRuleTotalCount = System.Text.Json.JsonEncodedText.Encode("rule_total_count"); + private static readonly System.Text.Json.JsonEncodedText PropRuleTypeCounts = System.Text.Json.JsonEncodedText.Encode("rule_type_counts"); + + public override Elastic.Clients.Elasticsearch.QueryRules.QueryRulesetListItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propRuleCriteriaTypesCounts = default; + LocalJsonValue propRulesetId = default; + LocalJsonValue propRuleTotalCount = default; + LocalJsonValue> propRuleTypeCounts = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRuleCriteriaTypesCounts.TryReadProperty(ref reader, options, PropRuleCriteriaTypesCounts, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propRulesetId.TryReadProperty(ref reader, options, PropRulesetId, null)) + { + continue; + } + + if (propRuleTotalCount.TryReadProperty(ref reader, options, PropRuleTotalCount, null)) + { + continue; + } + + if (propRuleTypeCounts.TryReadProperty(ref reader, options, PropRuleTypeCounts, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryRules.QueryRulesetListItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + RuleCriteriaTypesCounts = propRuleCriteriaTypesCounts.Value, + RulesetId = propRulesetId.Value, + RuleTotalCount = propRuleTotalCount.Value, + RuleTypeCounts = propRuleTypeCounts.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.QueryRulesetListItem value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRuleCriteriaTypesCounts, value.RuleCriteriaTypesCounts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropRulesetId, value.RulesetId, null, null); + writer.WriteProperty(options, PropRuleTotalCount, value.RuleTotalCount, null, null); + writer.WriteProperty(options, PropRuleTypeCounts, value.RuleTypeCounts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRulesetListItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRulesetListItem.g.cs index 4d737d54b53..92ece0c70bc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRulesetListItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRulesetListItem.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryRules; -internal sealed partial class QueryRulesetListItemConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRuleCriteriaTypesCounts = System.Text.Json.JsonEncodedText.Encode("rule_criteria_types_counts"); - private static readonly System.Text.Json.JsonEncodedText PropRulesetId = System.Text.Json.JsonEncodedText.Encode("ruleset_id"); - private static readonly System.Text.Json.JsonEncodedText PropRuleTotalCount = System.Text.Json.JsonEncodedText.Encode("rule_total_count"); - private static readonly System.Text.Json.JsonEncodedText PropRuleTypeCounts = System.Text.Json.JsonEncodedText.Encode("rule_type_counts"); - - public override Elastic.Clients.Elasticsearch.QueryRules.QueryRulesetListItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propRuleCriteriaTypesCounts = default; - LocalJsonValue propRulesetId = default; - LocalJsonValue propRuleTotalCount = default; - LocalJsonValue> propRuleTypeCounts = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRuleCriteriaTypesCounts.TryReadProperty(ref reader, options, PropRuleCriteriaTypesCounts, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propRulesetId.TryReadProperty(ref reader, options, PropRulesetId, null)) - { - continue; - } - - if (propRuleTotalCount.TryReadProperty(ref reader, options, PropRuleTotalCount, null)) - { - continue; - } - - if (propRuleTypeCounts.TryReadProperty(ref reader, options, PropRuleTypeCounts, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryRules.QueryRulesetListItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - RuleCriteriaTypesCounts = propRuleCriteriaTypesCounts.Value, - RulesetId = propRulesetId.Value, - RuleTotalCount = propRuleTotalCount.Value, - RuleTypeCounts = propRuleTypeCounts.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.QueryRulesetListItem value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRuleCriteriaTypesCounts, value.RuleCriteriaTypesCounts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropRulesetId, value.RulesetId, null, null); - writer.WriteProperty(options, PropRuleTotalCount, value.RuleTotalCount, null, null); - writer.WriteProperty(options, PropRuleTypeCounts, value.RuleTypeCounts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.QueryRulesetListItemConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.Json.QueryRulesetListItemConverter))] public sealed partial class QueryRulesetListItem { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRulesetMatchedRule.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRulesetMatchedRule.Converters.g.cs new file mode 100644 index 00000000000..5356f4b7cce --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRulesetMatchedRule.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.QueryRules.Json; + +public sealed partial class QueryRulesetMatchedRuleConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRuleId = System.Text.Json.JsonEncodedText.Encode("rule_id"); + private static readonly System.Text.Json.JsonEncodedText PropRulesetId = System.Text.Json.JsonEncodedText.Encode("ruleset_id"); + + public override Elastic.Clients.Elasticsearch.QueryRules.QueryRulesetMatchedRule Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propRuleId = default; + LocalJsonValue propRulesetId = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRuleId.TryReadProperty(ref reader, options, PropRuleId, null)) + { + continue; + } + + if (propRulesetId.TryReadProperty(ref reader, options, PropRulesetId, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryRules.QueryRulesetMatchedRule(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + RuleId = propRuleId.Value, + RulesetId = propRulesetId.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.QueryRulesetMatchedRule value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRuleId, value.RuleId, null, null); + writer.WriteProperty(options, PropRulesetId, value.RulesetId, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRulesetMatchedRule.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRulesetMatchedRule.g.cs index 0e35687326e..0d444cd3425 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRulesetMatchedRule.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryRules/QueryRulesetMatchedRule.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.QueryRules; -internal sealed partial class QueryRulesetMatchedRuleConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRuleId = System.Text.Json.JsonEncodedText.Encode("rule_id"); - private static readonly System.Text.Json.JsonEncodedText PropRulesetId = System.Text.Json.JsonEncodedText.Encode("ruleset_id"); - - public override Elastic.Clients.Elasticsearch.QueryRules.QueryRulesetMatchedRule Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propRuleId = default; - LocalJsonValue propRulesetId = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRuleId.TryReadProperty(ref reader, options, PropRuleId, null)) - { - continue; - } - - if (propRulesetId.TryReadProperty(ref reader, options, PropRulesetId, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryRules.QueryRulesetMatchedRule(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - RuleId = propRuleId.Value, - RulesetId = propRulesetId.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryRules.QueryRulesetMatchedRule value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRuleId, value.RuleId, null, null); - writer.WriteProperty(options, PropRulesetId, value.RulesetId, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.QueryRulesetMatchedRuleConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryRules.Json.QueryRulesetMatchedRuleConverter))] public sealed partial class QueryRulesetMatchedRule { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.Converters.g.cs new file mode 100644 index 00000000000..f1f625c7fcf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.Converters.g.cs @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class QueryVectorBuilderConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + + public override Elastic.Clients.Elasticsearch.QueryVectorBuilder Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantTextEmbedding)) + { + variantType = VariantTextEmbedding.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.QueryVectorBuilder(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryVectorBuilder value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "text_embedding": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.TextEmbedding)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryVectorBuilder)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.g.cs index c86fe1ca9b6..ab4e2b04577 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryVectorBuilder.g.cs @@ -23,61 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class QueryVectorBuilderConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - - public override Elastic.Clients.Elasticsearch.QueryVectorBuilder Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantTextEmbedding)) - { - variantType = VariantTextEmbedding.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.QueryVectorBuilder(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.QueryVectorBuilder value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "text_embedding": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.TextEmbedding)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.QueryVectorBuilder)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.QueryVectorBuilderConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.QueryVectorBuilderConverter))] public sealed partial class QueryVectorBuilder { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RRFRetriever.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RRFRetriever.Converters.g.cs new file mode 100644 index 00000000000..01c4e03817d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RRFRetriever.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class RRFRetrieverConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropMinScore = System.Text.Json.JsonEncodedText.Encode("min_score"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropRankConstant = System.Text.Json.JsonEncodedText.Encode("rank_constant"); + private static readonly System.Text.Json.JsonEncodedText PropRankWindowSize = System.Text.Json.JsonEncodedText.Encode("rank_window_size"); + private static readonly System.Text.Json.JsonEncodedText PropRetrievers = System.Text.Json.JsonEncodedText.Encode("retrievers"); + + public override Elastic.Clients.Elasticsearch.RRFRetriever Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propFields = default; + LocalJsonValue?> propFilter = default; + LocalJsonValue propMinScore = default; + LocalJsonValue propName = default; + LocalJsonValue propQuery = default; + LocalJsonValue propRankConstant = default; + LocalJsonValue propRankWindowSize = default; + LocalJsonValue> propRetrievers = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propRankConstant.TryReadProperty(ref reader, options, PropRankConstant, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRankWindowSize.TryReadProperty(ref reader, options, PropRankWindowSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRetrievers.TryReadProperty(ref reader, options, PropRetrievers, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.RRFRetriever(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Fields = propFields.Value, + Filter = propFilter.Value, + MinScore = propMinScore.Value, + Name = propName.Value, + Query = propQuery.Value, + RankConstant = propRankConstant.Value, + RankWindowSize = propRankWindowSize.Value, + Retrievers = propRetrievers.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.RRFRetriever value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropRankConstant, value.RankConstant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRankWindowSize, value.RankWindowSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRetrievers, value.Retrievers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RRFRetriever.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RRFRetriever.g.cs index 3054528f013..5b9285c9567 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RRFRetriever.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RRFRetriever.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class RRFRetrieverConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropMinScore = System.Text.Json.JsonEncodedText.Encode("min_score"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropRankConstant = System.Text.Json.JsonEncodedText.Encode("rank_constant"); - private static readonly System.Text.Json.JsonEncodedText PropRankWindowSize = System.Text.Json.JsonEncodedText.Encode("rank_window_size"); - private static readonly System.Text.Json.JsonEncodedText PropRetrievers = System.Text.Json.JsonEncodedText.Encode("retrievers"); - - public override Elastic.Clients.Elasticsearch.RRFRetriever Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propFields = default; - LocalJsonValue?> propFilter = default; - LocalJsonValue propMinScore = default; - LocalJsonValue propName = default; - LocalJsonValue propQuery = default; - LocalJsonValue propRankConstant = default; - LocalJsonValue propRankWindowSize = default; - LocalJsonValue> propRetrievers = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propRankConstant.TryReadProperty(ref reader, options, PropRankConstant, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRankWindowSize.TryReadProperty(ref reader, options, PropRankWindowSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRetrievers.TryReadProperty(ref reader, options, PropRetrievers, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.RRFRetriever(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Fields = propFields.Value, - Filter = propFilter.Value, - MinScore = propMinScore.Value, - Name = propName.Value, - Query = propQuery.Value, - RankConstant = propRankConstant.Value, - RankWindowSize = propRankWindowSize.Value, - Retrievers = propRetrievers.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.RRFRetriever value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropRankConstant, value.RankConstant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRankWindowSize, value.RankWindowSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRetrievers, value.Retrievers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.RRFRetrieverConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.RRFRetrieverConverter))] public sealed partial class RRFRetriever { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rank.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rank.Converters.g.cs new file mode 100644 index 00000000000..fefcd31fe62 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rank.Converters.g.cs @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class RankConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantRrf = System.Text.Json.JsonEncodedText.Encode("rrf"); + + public override Elastic.Clients.Elasticsearch.Rank Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantRrf)) + { + variantType = VariantRrf.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rank(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rank value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "rrf": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.RrfRank)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Rank)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rank.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rank.g.cs index c0da33d94bb..0d9899e42dd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rank.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rank.g.cs @@ -23,61 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class RankConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantRrf = System.Text.Json.JsonEncodedText.Encode("rrf"); - - public override Elastic.Clients.Elasticsearch.Rank Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantRrf)) - { - variantType = VariantRrf.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rank(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rank value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "rrf": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.RrfRank)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Rank)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.RankConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.RankConverter))] public sealed partial class Rank { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RecoveryStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RecoveryStats.Converters.g.cs new file mode 100644 index 00000000000..d1b236d1ca0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RecoveryStats.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class RecoveryStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCurrentAsSource = System.Text.Json.JsonEncodedText.Encode("current_as_source"); + private static readonly System.Text.Json.JsonEncodedText PropCurrentAsTarget = System.Text.Json.JsonEncodedText.Encode("current_as_target"); + private static readonly System.Text.Json.JsonEncodedText PropThrottleTime = System.Text.Json.JsonEncodedText.Encode("throttle_time"); + private static readonly System.Text.Json.JsonEncodedText PropThrottleTimeInMillis = System.Text.Json.JsonEncodedText.Encode("throttle_time_in_millis"); + + public override Elastic.Clients.Elasticsearch.RecoveryStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCurrentAsSource = default; + LocalJsonValue propCurrentAsTarget = default; + LocalJsonValue propThrottleTime = default; + LocalJsonValue propThrottleTimeInMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCurrentAsSource.TryReadProperty(ref reader, options, PropCurrentAsSource, null)) + { + continue; + } + + if (propCurrentAsTarget.TryReadProperty(ref reader, options, PropCurrentAsTarget, null)) + { + continue; + } + + if (propThrottleTime.TryReadProperty(ref reader, options, PropThrottleTime, null)) + { + continue; + } + + if (propThrottleTimeInMillis.TryReadProperty(ref reader, options, PropThrottleTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.RecoveryStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CurrentAsSource = propCurrentAsSource.Value, + CurrentAsTarget = propCurrentAsTarget.Value, + ThrottleTime = propThrottleTime.Value, + ThrottleTimeInMillis = propThrottleTimeInMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.RecoveryStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCurrentAsSource, value.CurrentAsSource, null, null); + writer.WriteProperty(options, PropCurrentAsTarget, value.CurrentAsTarget, null, null); + writer.WriteProperty(options, PropThrottleTime, value.ThrottleTime, null, null); + writer.WriteProperty(options, PropThrottleTimeInMillis, value.ThrottleTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RecoveryStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RecoveryStats.g.cs index 613c2dfe6f5..cfb8452def4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RecoveryStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RecoveryStats.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class RecoveryStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCurrentAsSource = System.Text.Json.JsonEncodedText.Encode("current_as_source"); - private static readonly System.Text.Json.JsonEncodedText PropCurrentAsTarget = System.Text.Json.JsonEncodedText.Encode("current_as_target"); - private static readonly System.Text.Json.JsonEncodedText PropThrottleTime = System.Text.Json.JsonEncodedText.Encode("throttle_time"); - private static readonly System.Text.Json.JsonEncodedText PropThrottleTimeInMillis = System.Text.Json.JsonEncodedText.Encode("throttle_time_in_millis"); - - public override Elastic.Clients.Elasticsearch.RecoveryStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCurrentAsSource = default; - LocalJsonValue propCurrentAsTarget = default; - LocalJsonValue propThrottleTime = default; - LocalJsonValue propThrottleTimeInMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCurrentAsSource.TryReadProperty(ref reader, options, PropCurrentAsSource, null)) - { - continue; - } - - if (propCurrentAsTarget.TryReadProperty(ref reader, options, PropCurrentAsTarget, null)) - { - continue; - } - - if (propThrottleTime.TryReadProperty(ref reader, options, PropThrottleTime, null)) - { - continue; - } - - if (propThrottleTimeInMillis.TryReadProperty(ref reader, options, PropThrottleTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.RecoveryStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CurrentAsSource = propCurrentAsSource.Value, - CurrentAsTarget = propCurrentAsTarget.Value, - ThrottleTime = propThrottleTime.Value, - ThrottleTimeInMillis = propThrottleTimeInMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.RecoveryStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCurrentAsSource, value.CurrentAsSource, null, null); - writer.WriteProperty(options, PropCurrentAsTarget, value.CurrentAsTarget, null, null); - writer.WriteProperty(options, PropThrottleTime, value.ThrottleTime, null, null); - writer.WriteProperty(options, PropThrottleTimeInMillis, value.ThrottleTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.RecoveryStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.RecoveryStatsConverter))] public sealed partial class RecoveryStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Refresh.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Refresh.Converters.g.cs new file mode 100644 index 00000000000..2008fa1eefe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Refresh.Converters.g.cs @@ -0,0 +1,100 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class RefreshConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberFalse = System.Text.Json.JsonEncodedText.Encode("false"); + private static readonly System.Text.Json.JsonEncodedText MemberTrue = System.Text.Json.JsonEncodedText.Encode("true"); + private static readonly System.Text.Json.JsonEncodedText MemberWaitFor = System.Text.Json.JsonEncodedText.Encode("wait_for"); + + public override Elastic.Clients.Elasticsearch.Refresh Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberFalse)) + { + return Elastic.Clients.Elasticsearch.Refresh.False; + } + + if (reader.ValueTextEquals(MemberTrue)) + { + return Elastic.Clients.Elasticsearch.Refresh.True; + } + + if (reader.ValueTextEquals(MemberWaitFor)) + { + return Elastic.Clients.Elasticsearch.Refresh.WaitFor; + } + + if (reader.TokenType is not System.Text.Json.JsonTokenType.String) + { + throw new System.Text.Json.JsonException($"Unknown member of type '{reader.TokenType}' for enum '{nameof(Elastic.Clients.Elasticsearch.Refresh)}'."); + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberFalse.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Refresh.False; + } + + if (string.Equals(value, MemberTrue.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Refresh.True; + } + + if (string.Equals(value, MemberWaitFor.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Refresh.WaitFor; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Refresh)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Refresh value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Refresh.False: + writer.WriteRawValue(MemberFalse.EncodedUtf8Bytes); + break; + case Elastic.Clients.Elasticsearch.Refresh.True: + writer.WriteRawValue(MemberTrue.EncodedUtf8Bytes); + break; + case Elastic.Clients.Elasticsearch.Refresh.WaitFor: + writer.WriteStringValue(MemberWaitFor); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Refresh)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Refresh ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Refresh value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Refresh.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Refresh.g.cs new file mode 100644 index 00000000000..dffe0a87804 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Refresh.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.RefreshConverter))] +public enum Refresh +{ + [System.Runtime.Serialization.EnumMember(Value = "false")] + False, + [System.Runtime.Serialization.EnumMember(Value = "true")] + True, + [System.Runtime.Serialization.EnumMember(Value = "wait_for")] + WaitFor +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RefreshStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RefreshStats.Converters.g.cs new file mode 100644 index 00000000000..7c3292afea6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RefreshStats.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class RefreshStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExternalTotal = System.Text.Json.JsonEncodedText.Encode("external_total"); + private static readonly System.Text.Json.JsonEncodedText PropExternalTotalTimeInMillis = System.Text.Json.JsonEncodedText.Encode("external_total_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropListeners = System.Text.Json.JsonEncodedText.Encode("listeners"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + private static readonly System.Text.Json.JsonEncodedText PropTotalTime = System.Text.Json.JsonEncodedText.Encode("total_time"); + private static readonly System.Text.Json.JsonEncodedText PropTotalTimeInMillis = System.Text.Json.JsonEncodedText.Encode("total_time_in_millis"); + + public override Elastic.Clients.Elasticsearch.RefreshStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExternalTotal = default; + LocalJsonValue propExternalTotalTimeInMillis = default; + LocalJsonValue propListeners = default; + LocalJsonValue propTotal = default; + LocalJsonValue propTotalTime = default; + LocalJsonValue propTotalTimeInMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExternalTotal.TryReadProperty(ref reader, options, PropExternalTotal, null)) + { + continue; + } + + if (propExternalTotalTimeInMillis.TryReadProperty(ref reader, options, PropExternalTotalTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propListeners.TryReadProperty(ref reader, options, PropListeners, null)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (propTotalTime.TryReadProperty(ref reader, options, PropTotalTime, null)) + { + continue; + } + + if (propTotalTimeInMillis.TryReadProperty(ref reader, options, PropTotalTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.RefreshStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ExternalTotal = propExternalTotal.Value, + ExternalTotalTimeInMillis = propExternalTotalTimeInMillis.Value, + Listeners = propListeners.Value, + Total = propTotal.Value, + TotalTime = propTotalTime.Value, + TotalTimeInMillis = propTotalTimeInMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.RefreshStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExternalTotal, value.ExternalTotal, null, null); + writer.WriteProperty(options, PropExternalTotalTimeInMillis, value.ExternalTotalTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropListeners, value.Listeners, null, null); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteProperty(options, PropTotalTime, value.TotalTime, null, null); + writer.WriteProperty(options, PropTotalTimeInMillis, value.TotalTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RefreshStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RefreshStats.g.cs index 24b1319ae65..a9ffc9173ab 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RefreshStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RefreshStats.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class RefreshStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExternalTotal = System.Text.Json.JsonEncodedText.Encode("external_total"); - private static readonly System.Text.Json.JsonEncodedText PropExternalTotalTimeInMillis = System.Text.Json.JsonEncodedText.Encode("external_total_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropListeners = System.Text.Json.JsonEncodedText.Encode("listeners"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - private static readonly System.Text.Json.JsonEncodedText PropTotalTime = System.Text.Json.JsonEncodedText.Encode("total_time"); - private static readonly System.Text.Json.JsonEncodedText PropTotalTimeInMillis = System.Text.Json.JsonEncodedText.Encode("total_time_in_millis"); - - public override Elastic.Clients.Elasticsearch.RefreshStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propExternalTotal = default; - LocalJsonValue propExternalTotalTimeInMillis = default; - LocalJsonValue propListeners = default; - LocalJsonValue propTotal = default; - LocalJsonValue propTotalTime = default; - LocalJsonValue propTotalTimeInMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExternalTotal.TryReadProperty(ref reader, options, PropExternalTotal, null)) - { - continue; - } - - if (propExternalTotalTimeInMillis.TryReadProperty(ref reader, options, PropExternalTotalTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propListeners.TryReadProperty(ref reader, options, PropListeners, null)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (propTotalTime.TryReadProperty(ref reader, options, PropTotalTime, null)) - { - continue; - } - - if (propTotalTimeInMillis.TryReadProperty(ref reader, options, PropTotalTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.RefreshStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ExternalTotal = propExternalTotal.Value, - ExternalTotalTimeInMillis = propExternalTotalTimeInMillis.Value, - Listeners = propListeners.Value, - Total = propTotal.Value, - TotalTime = propTotalTime.Value, - TotalTimeInMillis = propTotalTimeInMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.RefreshStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExternalTotal, value.ExternalTotal, null, null); - writer.WriteProperty(options, PropExternalTotalTimeInMillis, value.ExternalTotalTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropListeners, value.Listeners, null, null); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteProperty(options, PropTotalTime, value.TotalTime, null, null); - writer.WriteProperty(options, PropTotalTimeInMillis, value.TotalTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.RefreshStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.RefreshStatsConverter))] public sealed partial class RefreshStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RelocationFailureInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RelocationFailureInfo.Converters.g.cs new file mode 100644 index 00000000000..14cbb54ba52 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RelocationFailureInfo.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class RelocationFailureInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFailedAttempts = System.Text.Json.JsonEncodedText.Encode("failed_attempts"); + + public override Elastic.Clients.Elasticsearch.RelocationFailureInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFailedAttempts = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFailedAttempts.TryReadProperty(ref reader, options, PropFailedAttempts, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.RelocationFailureInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FailedAttempts = propFailedAttempts.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.RelocationFailureInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFailedAttempts, value.FailedAttempts, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RelocationFailureInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RelocationFailureInfo.g.cs index 87d5962daef..e9a16a7894d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RelocationFailureInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RelocationFailureInfo.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class RelocationFailureInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFailedAttempts = System.Text.Json.JsonEncodedText.Encode("failed_attempts"); - - public override Elastic.Clients.Elasticsearch.RelocationFailureInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFailedAttempts = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFailedAttempts.TryReadProperty(ref reader, options, PropFailedAttempts, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.RelocationFailureInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FailedAttempts = propFailedAttempts.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.RelocationFailureInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFailedAttempts, value.FailedAttempts, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.RelocationFailureInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.RelocationFailureInfoConverter))] public sealed partial class RelocationFailureInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RequestCacheStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RequestCacheStats.Converters.g.cs new file mode 100644 index 00000000000..13ff386f7bc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RequestCacheStats.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class RequestCacheStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEvictions = System.Text.Json.JsonEncodedText.Encode("evictions"); + private static readonly System.Text.Json.JsonEncodedText PropHitCount = System.Text.Json.JsonEncodedText.Encode("hit_count"); + private static readonly System.Text.Json.JsonEncodedText PropMemorySize = System.Text.Json.JsonEncodedText.Encode("memory_size"); + private static readonly System.Text.Json.JsonEncodedText PropMemorySizeInBytes = System.Text.Json.JsonEncodedText.Encode("memory_size_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropMissCount = System.Text.Json.JsonEncodedText.Encode("miss_count"); + + public override Elastic.Clients.Elasticsearch.RequestCacheStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEvictions = default; + LocalJsonValue propHitCount = default; + LocalJsonValue propMemorySize = default; + LocalJsonValue propMemorySizeInBytes = default; + LocalJsonValue propMissCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEvictions.TryReadProperty(ref reader, options, PropEvictions, null)) + { + continue; + } + + if (propHitCount.TryReadProperty(ref reader, options, PropHitCount, null)) + { + continue; + } + + if (propMemorySize.TryReadProperty(ref reader, options, PropMemorySize, null)) + { + continue; + } + + if (propMemorySizeInBytes.TryReadProperty(ref reader, options, PropMemorySizeInBytes, null)) + { + continue; + } + + if (propMissCount.TryReadProperty(ref reader, options, PropMissCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.RequestCacheStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Evictions = propEvictions.Value, + HitCount = propHitCount.Value, + MemorySize = propMemorySize.Value, + MemorySizeInBytes = propMemorySizeInBytes.Value, + MissCount = propMissCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.RequestCacheStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEvictions, value.Evictions, null, null); + writer.WriteProperty(options, PropHitCount, value.HitCount, null, null); + writer.WriteProperty(options, PropMemorySize, value.MemorySize, null, null); + writer.WriteProperty(options, PropMemorySizeInBytes, value.MemorySizeInBytes, null, null); + writer.WriteProperty(options, PropMissCount, value.MissCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RequestCacheStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RequestCacheStats.g.cs index 81dfb1f18bd..7eb62c566c0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RequestCacheStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RequestCacheStats.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class RequestCacheStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEvictions = System.Text.Json.JsonEncodedText.Encode("evictions"); - private static readonly System.Text.Json.JsonEncodedText PropHitCount = System.Text.Json.JsonEncodedText.Encode("hit_count"); - private static readonly System.Text.Json.JsonEncodedText PropMemorySize = System.Text.Json.JsonEncodedText.Encode("memory_size"); - private static readonly System.Text.Json.JsonEncodedText PropMemorySizeInBytes = System.Text.Json.JsonEncodedText.Encode("memory_size_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropMissCount = System.Text.Json.JsonEncodedText.Encode("miss_count"); - - public override Elastic.Clients.Elasticsearch.RequestCacheStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEvictions = default; - LocalJsonValue propHitCount = default; - LocalJsonValue propMemorySize = default; - LocalJsonValue propMemorySizeInBytes = default; - LocalJsonValue propMissCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEvictions.TryReadProperty(ref reader, options, PropEvictions, null)) - { - continue; - } - - if (propHitCount.TryReadProperty(ref reader, options, PropHitCount, null)) - { - continue; - } - - if (propMemorySize.TryReadProperty(ref reader, options, PropMemorySize, null)) - { - continue; - } - - if (propMemorySizeInBytes.TryReadProperty(ref reader, options, PropMemorySizeInBytes, null)) - { - continue; - } - - if (propMissCount.TryReadProperty(ref reader, options, PropMissCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.RequestCacheStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Evictions = propEvictions.Value, - HitCount = propHitCount.Value, - MemorySize = propMemorySize.Value, - MemorySizeInBytes = propMemorySizeInBytes.Value, - MissCount = propMissCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.RequestCacheStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEvictions, value.Evictions, null, null); - writer.WriteProperty(options, PropHitCount, value.HitCount, null, null); - writer.WriteProperty(options, PropMemorySize, value.MemorySize, null, null); - writer.WriteProperty(options, PropMemorySizeInBytes, value.MemorySizeInBytes, null, null); - writer.WriteProperty(options, PropMissCount, value.MissCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.RequestCacheStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.RequestCacheStatsConverter))] public sealed partial class RequestCacheStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RescoreVector.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RescoreVector.Converters.g.cs new file mode 100644 index 00000000000..a0abd846648 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RescoreVector.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class RescoreVectorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropOversample = System.Text.Json.JsonEncodedText.Encode("oversample"); + + public override Elastic.Clients.Elasticsearch.RescoreVector Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propOversample = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propOversample.TryReadProperty(ref reader, options, PropOversample, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.RescoreVector(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Oversample = propOversample.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.RescoreVector value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropOversample, value.Oversample, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RescoreVector.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RescoreVector.g.cs index baa8c4c6554..4e82de6268d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RescoreVector.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RescoreVector.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class RescoreVectorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropOversample = System.Text.Json.JsonEncodedText.Encode("oversample"); - - public override Elastic.Clients.Elasticsearch.RescoreVector Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propOversample = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propOversample.TryReadProperty(ref reader, options, PropOversample, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.RescoreVector(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Oversample = propOversample.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.RescoreVector value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropOversample, value.Oversample, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.RescoreVectorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.RescoreVectorConverter))] public sealed partial class RescoreVector { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RescorerRetriever.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RescorerRetriever.Converters.g.cs new file mode 100644 index 00000000000..02596dfc4d6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RescorerRetriever.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class RescorerRetrieverConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropMinScore = System.Text.Json.JsonEncodedText.Encode("min_score"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropRescore = System.Text.Json.JsonEncodedText.Encode("rescore"); + private static readonly System.Text.Json.JsonEncodedText PropRetriever = System.Text.Json.JsonEncodedText.Encode("retriever"); + + public override Elastic.Clients.Elasticsearch.RescorerRetriever Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propFilter = default; + LocalJsonValue propMinScore = default; + LocalJsonValue propName = default; + LocalJsonValue> propRescore = default; + LocalJsonValue propRetriever = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propRescore.TryReadProperty(ref reader, options, PropRescore, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propRetriever.TryReadProperty(ref reader, options, PropRetriever, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.RescorerRetriever(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Filter = propFilter.Value, + MinScore = propMinScore.Value, + Name = propName.Value, + Rescore = propRescore.Value, + Retriever = propRetriever.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.RescorerRetriever value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropRescore, value.Rescore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRetriever, value.Retriever, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RescorerRetriever.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RescorerRetriever.g.cs index 9c14a9f9919..4851f518398 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RescorerRetriever.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RescorerRetriever.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class RescorerRetrieverConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropMinScore = System.Text.Json.JsonEncodedText.Encode("min_score"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropRescore = System.Text.Json.JsonEncodedText.Encode("rescore"); - private static readonly System.Text.Json.JsonEncodedText PropRetriever = System.Text.Json.JsonEncodedText.Encode("retriever"); - - public override Elastic.Clients.Elasticsearch.RescorerRetriever Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propFilter = default; - LocalJsonValue propMinScore = default; - LocalJsonValue propName = default; - LocalJsonValue> propRescore = default; - LocalJsonValue propRetriever = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propRescore.TryReadProperty(ref reader, options, PropRescore, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (propRetriever.TryReadProperty(ref reader, options, PropRetriever, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.RescorerRetriever(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Filter = propFilter.Value, - MinScore = propMinScore.Value, - Name = propName.Value, - Rescore = propRescore.Value, - Retriever = propRetriever.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.RescorerRetriever value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropRescore, value.Rescore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRetriever, value.Retriever, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.RescorerRetrieverConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.RescorerRetrieverConverter))] public sealed partial class RescorerRetriever { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Result.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Result.Converters.g.cs new file mode 100644 index 00000000000..38ffcf0c862 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Result.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ResultConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCreated = System.Text.Json.JsonEncodedText.Encode("created"); + private static readonly System.Text.Json.JsonEncodedText MemberDeleted = System.Text.Json.JsonEncodedText.Encode("deleted"); + private static readonly System.Text.Json.JsonEncodedText MemberNoOp = System.Text.Json.JsonEncodedText.Encode("noop"); + private static readonly System.Text.Json.JsonEncodedText MemberNotFound = System.Text.Json.JsonEncodedText.Encode("not_found"); + private static readonly System.Text.Json.JsonEncodedText MemberUpdated = System.Text.Json.JsonEncodedText.Encode("updated"); + + public override Elastic.Clients.Elasticsearch.Result Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCreated)) + { + return Elastic.Clients.Elasticsearch.Result.Created; + } + + if (reader.ValueTextEquals(MemberDeleted)) + { + return Elastic.Clients.Elasticsearch.Result.Deleted; + } + + if (reader.ValueTextEquals(MemberNoOp)) + { + return Elastic.Clients.Elasticsearch.Result.NoOp; + } + + if (reader.ValueTextEquals(MemberNotFound)) + { + return Elastic.Clients.Elasticsearch.Result.NotFound; + } + + if (reader.ValueTextEquals(MemberUpdated)) + { + return Elastic.Clients.Elasticsearch.Result.Updated; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCreated.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Result.Created; + } + + if (string.Equals(value, MemberDeleted.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Result.Deleted; + } + + if (string.Equals(value, MemberNoOp.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Result.NoOp; + } + + if (string.Equals(value, MemberNotFound.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Result.NotFound; + } + + if (string.Equals(value, MemberUpdated.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Result.Updated; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Result)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Result value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Result.Created: + writer.WriteStringValue(MemberCreated); + break; + case Elastic.Clients.Elasticsearch.Result.Deleted: + writer.WriteStringValue(MemberDeleted); + break; + case Elastic.Clients.Elasticsearch.Result.NoOp: + writer.WriteStringValue(MemberNoOp); + break; + case Elastic.Clients.Elasticsearch.Result.NotFound: + writer.WriteStringValue(MemberNotFound); + break; + case Elastic.Clients.Elasticsearch.Result.Updated: + writer.WriteStringValue(MemberUpdated); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Result)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Result ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Result value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Result.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Result.g.cs new file mode 100644 index 00000000000..84d87dc0393 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Result.g.cs @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ResultConverter))] +public enum Result +{ + [System.Runtime.Serialization.EnumMember(Value = "created")] + Created, + [System.Runtime.Serialization.EnumMember(Value = "deleted")] + Deleted, + [System.Runtime.Serialization.EnumMember(Value = "noop")] + NoOp, + [System.Runtime.Serialization.EnumMember(Value = "not_found")] + NotFound, + [System.Runtime.Serialization.EnumMember(Value = "updated")] + Updated +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Retries.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Retries.Converters.g.cs new file mode 100644 index 00000000000..73ee4fd050f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Retries.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class RetriesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBulk = System.Text.Json.JsonEncodedText.Encode("bulk"); + private static readonly System.Text.Json.JsonEncodedText PropSearch = System.Text.Json.JsonEncodedText.Encode("search"); + + public override Elastic.Clients.Elasticsearch.Retries Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBulk = default; + LocalJsonValue propSearch = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBulk.TryReadProperty(ref reader, options, PropBulk, null)) + { + continue; + } + + if (propSearch.TryReadProperty(ref reader, options, PropSearch, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Retries(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Bulk = propBulk.Value, + Search = propSearch.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Retries value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBulk, value.Bulk, null, null); + writer.WriteProperty(options, PropSearch, value.Search, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Retries.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Retries.g.cs index da7d0b3928d..63fef8c5913 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Retries.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Retries.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class RetriesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBulk = System.Text.Json.JsonEncodedText.Encode("bulk"); - private static readonly System.Text.Json.JsonEncodedText PropSearch = System.Text.Json.JsonEncodedText.Encode("search"); - - public override Elastic.Clients.Elasticsearch.Retries Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBulk = default; - LocalJsonValue propSearch = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBulk.TryReadProperty(ref reader, options, PropBulk, null)) - { - continue; - } - - if (propSearch.TryReadProperty(ref reader, options, PropSearch, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Retries(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Bulk = propBulk.Value, - Search = propSearch.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Retries value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBulk, value.Bulk, null, null); - writer.WriteProperty(options, PropSearch, value.Search, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.RetriesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.RetriesConverter))] public sealed partial class Retries { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Retriever.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Retriever.Converters.g.cs new file mode 100644 index 00000000000..e9507410282 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Retriever.Converters.g.cs @@ -0,0 +1,162 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class RetrieverConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantKnn = System.Text.Json.JsonEncodedText.Encode("knn"); + private static readonly System.Text.Json.JsonEncodedText VariantLinear = System.Text.Json.JsonEncodedText.Encode("linear"); + private static readonly System.Text.Json.JsonEncodedText VariantPinned = System.Text.Json.JsonEncodedText.Encode("pinned"); + private static readonly System.Text.Json.JsonEncodedText VariantRescorer = System.Text.Json.JsonEncodedText.Encode("rescorer"); + private static readonly System.Text.Json.JsonEncodedText VariantRrf = System.Text.Json.JsonEncodedText.Encode("rrf"); + private static readonly System.Text.Json.JsonEncodedText VariantRule = System.Text.Json.JsonEncodedText.Encode("rule"); + private static readonly System.Text.Json.JsonEncodedText VariantStandard = System.Text.Json.JsonEncodedText.Encode("standard"); + private static readonly System.Text.Json.JsonEncodedText VariantTextSimilarityReranker = System.Text.Json.JsonEncodedText.Encode("text_similarity_reranker"); + + public override Elastic.Clients.Elasticsearch.Retriever Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantKnn)) + { + variantType = VariantKnn.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantLinear)) + { + variantType = VariantLinear.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantPinned)) + { + variantType = VariantPinned.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRescorer)) + { + variantType = VariantRescorer.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRrf)) + { + variantType = VariantRrf.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRule)) + { + variantType = VariantRule.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantStandard)) + { + variantType = VariantStandard.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTextSimilarityReranker)) + { + variantType = VariantTextSimilarityReranker.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Retriever(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Retriever value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "knn": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.KnnRetriever)value.Variant, null, null); + break; + case "linear": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.LinearRetriever)value.Variant, null, null); + break; + case "pinned": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.PinnedRetriever)value.Variant, null, null); + break; + case "rescorer": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.RescorerRetriever)value.Variant, null, null); + break; + case "rrf": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.RRFRetriever)value.Variant, null, null); + break; + case "rule": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.RuleRetriever)value.Variant, null, null); + break; + case "standard": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.StandardRetriever)value.Variant, null, null); + break; + case "text_similarity_reranker": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.TextSimilarityReranker)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Retriever)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Retriever.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Retriever.g.cs index 72cc7cefadd..f12d2dfdf5c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Retriever.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Retriever.g.cs @@ -23,145 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class RetrieverConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantKnn = System.Text.Json.JsonEncodedText.Encode("knn"); - private static readonly System.Text.Json.JsonEncodedText VariantLinear = System.Text.Json.JsonEncodedText.Encode("linear"); - private static readonly System.Text.Json.JsonEncodedText VariantPinned = System.Text.Json.JsonEncodedText.Encode("pinned"); - private static readonly System.Text.Json.JsonEncodedText VariantRescorer = System.Text.Json.JsonEncodedText.Encode("rescorer"); - private static readonly System.Text.Json.JsonEncodedText VariantRrf = System.Text.Json.JsonEncodedText.Encode("rrf"); - private static readonly System.Text.Json.JsonEncodedText VariantRule = System.Text.Json.JsonEncodedText.Encode("rule"); - private static readonly System.Text.Json.JsonEncodedText VariantStandard = System.Text.Json.JsonEncodedText.Encode("standard"); - private static readonly System.Text.Json.JsonEncodedText VariantTextSimilarityReranker = System.Text.Json.JsonEncodedText.Encode("text_similarity_reranker"); - - public override Elastic.Clients.Elasticsearch.Retriever Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantKnn)) - { - variantType = VariantKnn.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantLinear)) - { - variantType = VariantLinear.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantPinned)) - { - variantType = VariantPinned.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRescorer)) - { - variantType = VariantRescorer.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRrf)) - { - variantType = VariantRrf.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRule)) - { - variantType = VariantRule.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantStandard)) - { - variantType = VariantStandard.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTextSimilarityReranker)) - { - variantType = VariantTextSimilarityReranker.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Retriever(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Retriever value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "knn": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.KnnRetriever)value.Variant, null, null); - break; - case "linear": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.LinearRetriever)value.Variant, null, null); - break; - case "pinned": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.PinnedRetriever)value.Variant, null, null); - break; - case "rescorer": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.RescorerRetriever)value.Variant, null, null); - break; - case "rrf": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.RRFRetriever)value.Variant, null, null); - break; - case "rule": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.RuleRetriever)value.Variant, null, null); - break; - case "standard": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.StandardRetriever)value.Variant, null, null); - break; - case "text_similarity_reranker": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.TextSimilarityReranker)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Retriever)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.RetrieverConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.RetrieverConverter))] public sealed partial class Retriever { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/DateHistogramGrouping.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/DateHistogramGrouping.Converters.g.cs new file mode 100644 index 00000000000..61a7a90a1f6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/DateHistogramGrouping.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class DateHistogramGroupingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCalendarInterval = System.Text.Json.JsonEncodedText.Encode("calendar_interval"); + private static readonly System.Text.Json.JsonEncodedText PropDelay = System.Text.Json.JsonEncodedText.Encode("delay"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFixedInterval = System.Text.Json.JsonEncodedText.Encode("fixed_interval"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropInterval = System.Text.Json.JsonEncodedText.Encode("interval"); + private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"); + + public override Elastic.Clients.Elasticsearch.Rollup.DateHistogramGrouping Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCalendarInterval = default; + LocalJsonValue propDelay = default; + LocalJsonValue propField = default; + LocalJsonValue propFixedInterval = default; + LocalJsonValue propFormat = default; + LocalJsonValue propInterval = default; + LocalJsonValue propTimeZone = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCalendarInterval.TryReadProperty(ref reader, options, PropCalendarInterval, null)) + { + continue; + } + + if (propDelay.TryReadProperty(ref reader, options, PropDelay, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFixedInterval.TryReadProperty(ref reader, options, PropFixedInterval, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propInterval.TryReadProperty(ref reader, options, PropInterval, null)) + { + continue; + } + + if (propTimeZone.TryReadProperty(ref reader, options, PropTimeZone, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.DateHistogramGrouping(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CalendarInterval = propCalendarInterval.Value, + Delay = propDelay.Value, + Field = propField.Value, + FixedInterval = propFixedInterval.Value, + Format = propFormat.Value, + Interval = propInterval.Value, + TimeZone = propTimeZone.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.DateHistogramGrouping value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCalendarInterval, value.CalendarInterval, null, null); + writer.WriteProperty(options, PropDelay, value.Delay, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFixedInterval, value.FixedInterval, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropInterval, value.Interval, null, null); + writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/DateHistogramGrouping.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/DateHistogramGrouping.g.cs index b8abd3c7b62..1eda96fd9f1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/DateHistogramGrouping.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/DateHistogramGrouping.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Rollup; -internal sealed partial class DateHistogramGroupingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCalendarInterval = System.Text.Json.JsonEncodedText.Encode("calendar_interval"); - private static readonly System.Text.Json.JsonEncodedText PropDelay = System.Text.Json.JsonEncodedText.Encode("delay"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFixedInterval = System.Text.Json.JsonEncodedText.Encode("fixed_interval"); - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropInterval = System.Text.Json.JsonEncodedText.Encode("interval"); - private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"); - - public override Elastic.Clients.Elasticsearch.Rollup.DateHistogramGrouping Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCalendarInterval = default; - LocalJsonValue propDelay = default; - LocalJsonValue propField = default; - LocalJsonValue propFixedInterval = default; - LocalJsonValue propFormat = default; - LocalJsonValue propInterval = default; - LocalJsonValue propTimeZone = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCalendarInterval.TryReadProperty(ref reader, options, PropCalendarInterval, null)) - { - continue; - } - - if (propDelay.TryReadProperty(ref reader, options, PropDelay, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFixedInterval.TryReadProperty(ref reader, options, PropFixedInterval, null)) - { - continue; - } - - if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) - { - continue; - } - - if (propInterval.TryReadProperty(ref reader, options, PropInterval, null)) - { - continue; - } - - if (propTimeZone.TryReadProperty(ref reader, options, PropTimeZone, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.DateHistogramGrouping(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CalendarInterval = propCalendarInterval.Value, - Delay = propDelay.Value, - Field = propField.Value, - FixedInterval = propFixedInterval.Value, - Format = propFormat.Value, - Interval = propInterval.Value, - TimeZone = propTimeZone.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.DateHistogramGrouping value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCalendarInterval, value.CalendarInterval, null, null); - writer.WriteProperty(options, PropDelay, value.Delay, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFixedInterval, value.FixedInterval, null, null); - writer.WriteProperty(options, PropFormat, value.Format, null, null); - writer.WriteProperty(options, PropInterval, value.Interval, null, null); - writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.DateHistogramGroupingConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.DateHistogramGroupingConverter))] public sealed partial class DateHistogramGrouping { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/FieldMetric.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/FieldMetric.Converters.g.cs new file mode 100644 index 00000000000..2b3f86f19ce --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/FieldMetric.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class FieldMetricConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropMetrics = System.Text.Json.JsonEncodedText.Encode("metrics"); + + public override Elastic.Clients.Elasticsearch.Rollup.FieldMetric Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue> propMetrics = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propMetrics.TryReadProperty(ref reader, options, PropMetrics, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.FieldMetric(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Metrics = propMetrics.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.FieldMetric value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropMetrics, value.Metrics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/FieldMetric.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/FieldMetric.g.cs index ce3af48be26..58b1b2c9733 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/FieldMetric.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/FieldMetric.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Rollup; -internal sealed partial class FieldMetricConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropMetrics = System.Text.Json.JsonEncodedText.Encode("metrics"); - - public override Elastic.Clients.Elasticsearch.Rollup.FieldMetric Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue> propMetrics = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propMetrics.TryReadProperty(ref reader, options, PropMetrics, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.FieldMetric(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Metrics = propMetrics.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.FieldMetric value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropMetrics, value.Metrics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.FieldMetricConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.FieldMetricConverter))] public sealed partial class FieldMetric { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/Groupings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/Groupings.Converters.g.cs new file mode 100644 index 00000000000..516f27f549d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/Groupings.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class GroupingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDateHistogram = System.Text.Json.JsonEncodedText.Encode("date_histogram"); + private static readonly System.Text.Json.JsonEncodedText PropHistogram = System.Text.Json.JsonEncodedText.Encode("histogram"); + private static readonly System.Text.Json.JsonEncodedText PropTerms = System.Text.Json.JsonEncodedText.Encode("terms"); + + public override Elastic.Clients.Elasticsearch.Rollup.Groupings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDateHistogram = default; + LocalJsonValue propHistogram = default; + LocalJsonValue propTerms = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDateHistogram.TryReadProperty(ref reader, options, PropDateHistogram, null)) + { + continue; + } + + if (propHistogram.TryReadProperty(ref reader, options, PropHistogram, null)) + { + continue; + } + + if (propTerms.TryReadProperty(ref reader, options, PropTerms, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.Groupings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DateHistogram = propDateHistogram.Value, + Histogram = propHistogram.Value, + Terms = propTerms.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.Groupings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDateHistogram, value.DateHistogram, null, null); + writer.WriteProperty(options, PropHistogram, value.Histogram, null, null); + writer.WriteProperty(options, PropTerms, value.Terms, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/Groupings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/Groupings.g.cs index c466c9ef3cd..5dee1da15ca 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/Groupings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/Groupings.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Rollup; -internal sealed partial class GroupingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDateHistogram = System.Text.Json.JsonEncodedText.Encode("date_histogram"); - private static readonly System.Text.Json.JsonEncodedText PropHistogram = System.Text.Json.JsonEncodedText.Encode("histogram"); - private static readonly System.Text.Json.JsonEncodedText PropTerms = System.Text.Json.JsonEncodedText.Encode("terms"); - - public override Elastic.Clients.Elasticsearch.Rollup.Groupings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDateHistogram = default; - LocalJsonValue propHistogram = default; - LocalJsonValue propTerms = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDateHistogram.TryReadProperty(ref reader, options, PropDateHistogram, null)) - { - continue; - } - - if (propHistogram.TryReadProperty(ref reader, options, PropHistogram, null)) - { - continue; - } - - if (propTerms.TryReadProperty(ref reader, options, PropTerms, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.Groupings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DateHistogram = propDateHistogram.Value, - Histogram = propHistogram.Value, - Terms = propTerms.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.Groupings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDateHistogram, value.DateHistogram, null, null); - writer.WriteProperty(options, PropHistogram, value.Histogram, null, null); - writer.WriteProperty(options, PropTerms, value.Terms, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.GroupingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.GroupingsConverter))] public sealed partial class Groupings { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/HistogramGrouping.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/HistogramGrouping.Converters.g.cs new file mode 100644 index 00000000000..f3c550067fc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/HistogramGrouping.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class HistogramGroupingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropInterval = System.Text.Json.JsonEncodedText.Encode("interval"); + + public override Elastic.Clients.Elasticsearch.Rollup.HistogramGrouping Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFields = default; + LocalJsonValue propInterval = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFields.TryReadProperty(ref reader, options, PropFields, static Elastic.Clients.Elasticsearch.Fields (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propInterval.TryReadProperty(ref reader, options, PropInterval, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.HistogramGrouping(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Fields = propFields.Value, + Interval = propInterval.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.HistogramGrouping value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropInterval, value.Interval, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/HistogramGrouping.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/HistogramGrouping.g.cs index 3325dd147ec..5324e8806aa 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/HistogramGrouping.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/HistogramGrouping.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Rollup; -internal sealed partial class HistogramGroupingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropInterval = System.Text.Json.JsonEncodedText.Encode("interval"); - - public override Elastic.Clients.Elasticsearch.Rollup.HistogramGrouping Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFields = default; - LocalJsonValue propInterval = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFields.TryReadProperty(ref reader, options, PropFields, static Elastic.Clients.Elasticsearch.Fields (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propInterval.TryReadProperty(ref reader, options, PropInterval, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.HistogramGrouping(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Fields = propFields.Value, - Interval = propInterval.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.HistogramGrouping value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropInterval, value.Interval, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.HistogramGroupingConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.HistogramGroupingConverter))] public sealed partial class HistogramGrouping { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/IndexCapabilities.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/IndexCapabilities.Converters.g.cs new file mode 100644 index 00000000000..1b238bd8e79 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/IndexCapabilities.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class IndexCapabilitiesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRollupJobs = System.Text.Json.JsonEncodedText.Encode("rollup_jobs"); + + public override Elastic.Clients.Elasticsearch.Rollup.IndexCapabilities Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propRollupJobs = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRollupJobs.TryReadProperty(ref reader, options, PropRollupJobs, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.IndexCapabilities(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + RollupJobs = propRollupJobs.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.IndexCapabilities value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRollupJobs, value.RollupJobs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/IndexCapabilities.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/IndexCapabilities.g.cs index 8fe16299a11..be9cde75aa2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/IndexCapabilities.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/IndexCapabilities.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Rollup; -internal sealed partial class IndexCapabilitiesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRollupJobs = System.Text.Json.JsonEncodedText.Encode("rollup_jobs"); - - public override Elastic.Clients.Elasticsearch.Rollup.IndexCapabilities Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propRollupJobs = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRollupJobs.TryReadProperty(ref reader, options, PropRollupJobs, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.IndexCapabilities(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - RollupJobs = propRollupJobs.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.IndexCapabilities value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRollupJobs, value.RollupJobs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.IndexCapabilitiesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.IndexCapabilitiesConverter))] public sealed partial class IndexCapabilities { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Rollup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/IndexingJobState.Converters.g.cs similarity index 51% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Rollup.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/IndexingJobState.Converters.g.cs index f536de10a6e..09dd89eefd2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Rollup.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/IndexingJobState.Converters.g.cs @@ -21,9 +21,9 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.Rollup; +namespace Elastic.Clients.Elasticsearch.Rollup.Json; -internal sealed partial class IndexingJobStateConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class IndexingJobStateConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText MemberAborting = System.Text.Json.JsonEncodedText.Encode("aborting"); private static readonly System.Text.Json.JsonEncodedText MemberIndexing = System.Text.Json.JsonEncodedText.Encode("indexing"); @@ -120,133 +120,4 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, { Write(writer, value, options); } -} - -internal sealed partial class MetricConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberAvg = System.Text.Json.JsonEncodedText.Encode("avg"); - private static readonly System.Text.Json.JsonEncodedText MemberMax = System.Text.Json.JsonEncodedText.Encode("max"); - private static readonly System.Text.Json.JsonEncodedText MemberMin = System.Text.Json.JsonEncodedText.Encode("min"); - private static readonly System.Text.Json.JsonEncodedText MemberSum = System.Text.Json.JsonEncodedText.Encode("sum"); - private static readonly System.Text.Json.JsonEncodedText MemberValueCount = System.Text.Json.JsonEncodedText.Encode("value_count"); - - public override Elastic.Clients.Elasticsearch.Rollup.Metric Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberAvg)) - { - return Elastic.Clients.Elasticsearch.Rollup.Metric.Avg; - } - - if (reader.ValueTextEquals(MemberMax)) - { - return Elastic.Clients.Elasticsearch.Rollup.Metric.Max; - } - - if (reader.ValueTextEquals(MemberMin)) - { - return Elastic.Clients.Elasticsearch.Rollup.Metric.Min; - } - - if (reader.ValueTextEquals(MemberSum)) - { - return Elastic.Clients.Elasticsearch.Rollup.Metric.Sum; - } - - if (reader.ValueTextEquals(MemberValueCount)) - { - return Elastic.Clients.Elasticsearch.Rollup.Metric.ValueCount; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberAvg.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Rollup.Metric.Avg; - } - - if (string.Equals(value, MemberMax.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Rollup.Metric.Max; - } - - if (string.Equals(value, MemberMin.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Rollup.Metric.Min; - } - - if (string.Equals(value, MemberSum.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Rollup.Metric.Sum; - } - - if (string.Equals(value, MemberValueCount.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Rollup.Metric.ValueCount; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Rollup.Metric)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.Metric value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Rollup.Metric.Avg: - writer.WriteStringValue(MemberAvg); - break; - case Elastic.Clients.Elasticsearch.Rollup.Metric.Max: - writer.WriteStringValue(MemberMax); - break; - case Elastic.Clients.Elasticsearch.Rollup.Metric.Min: - writer.WriteStringValue(MemberMin); - break; - case Elastic.Clients.Elasticsearch.Rollup.Metric.Sum: - writer.WriteStringValue(MemberSum); - break; - case Elastic.Clients.Elasticsearch.Rollup.Metric.ValueCount: - writer.WriteStringValue(MemberValueCount); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Rollup.Metric)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Rollup.Metric ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.Metric value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.IndexingJobStateConverter))] -public enum IndexingJobState -{ - [System.Runtime.Serialization.EnumMember(Value = "aborting")] - Aborting, - [System.Runtime.Serialization.EnumMember(Value = "indexing")] - Indexing, - [System.Runtime.Serialization.EnumMember(Value = "started")] - Started, - [System.Runtime.Serialization.EnumMember(Value = "stopped")] - Stopped, - [System.Runtime.Serialization.EnumMember(Value = "stopping")] - Stopping -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.MetricConverter))] -public enum Metric -{ - [System.Runtime.Serialization.EnumMember(Value = "avg")] - Avg, - [System.Runtime.Serialization.EnumMember(Value = "max")] - Max, - [System.Runtime.Serialization.EnumMember(Value = "min")] - Min, - [System.Runtime.Serialization.EnumMember(Value = "sum")] - Sum, - [System.Runtime.Serialization.EnumMember(Value = "value_count")] - ValueCount } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/IndexingJobState.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/IndexingJobState.g.cs new file mode 100644 index 00000000000..548cea76977 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/IndexingJobState.g.cs @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.IndexingJobStateConverter))] +public enum IndexingJobState +{ + [System.Runtime.Serialization.EnumMember(Value = "aborting")] + Aborting, + [System.Runtime.Serialization.EnumMember(Value = "indexing")] + Indexing, + [System.Runtime.Serialization.EnumMember(Value = "started")] + Started, + [System.Runtime.Serialization.EnumMember(Value = "stopped")] + Stopped, + [System.Runtime.Serialization.EnumMember(Value = "stopping")] + Stopping +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/Metric.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/Metric.Converters.g.cs new file mode 100644 index 00000000000..214edce84fb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/Metric.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class MetricConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAvg = System.Text.Json.JsonEncodedText.Encode("avg"); + private static readonly System.Text.Json.JsonEncodedText MemberMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText MemberMin = System.Text.Json.JsonEncodedText.Encode("min"); + private static readonly System.Text.Json.JsonEncodedText MemberSum = System.Text.Json.JsonEncodedText.Encode("sum"); + private static readonly System.Text.Json.JsonEncodedText MemberValueCount = System.Text.Json.JsonEncodedText.Encode("value_count"); + + public override Elastic.Clients.Elasticsearch.Rollup.Metric Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAvg)) + { + return Elastic.Clients.Elasticsearch.Rollup.Metric.Avg; + } + + if (reader.ValueTextEquals(MemberMax)) + { + return Elastic.Clients.Elasticsearch.Rollup.Metric.Max; + } + + if (reader.ValueTextEquals(MemberMin)) + { + return Elastic.Clients.Elasticsearch.Rollup.Metric.Min; + } + + if (reader.ValueTextEquals(MemberSum)) + { + return Elastic.Clients.Elasticsearch.Rollup.Metric.Sum; + } + + if (reader.ValueTextEquals(MemberValueCount)) + { + return Elastic.Clients.Elasticsearch.Rollup.Metric.ValueCount; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAvg.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Rollup.Metric.Avg; + } + + if (string.Equals(value, MemberMax.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Rollup.Metric.Max; + } + + if (string.Equals(value, MemberMin.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Rollup.Metric.Min; + } + + if (string.Equals(value, MemberSum.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Rollup.Metric.Sum; + } + + if (string.Equals(value, MemberValueCount.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Rollup.Metric.ValueCount; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Rollup.Metric)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.Metric value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Rollup.Metric.Avg: + writer.WriteStringValue(MemberAvg); + break; + case Elastic.Clients.Elasticsearch.Rollup.Metric.Max: + writer.WriteStringValue(MemberMax); + break; + case Elastic.Clients.Elasticsearch.Rollup.Metric.Min: + writer.WriteStringValue(MemberMin); + break; + case Elastic.Clients.Elasticsearch.Rollup.Metric.Sum: + writer.WriteStringValue(MemberSum); + break; + case Elastic.Clients.Elasticsearch.Rollup.Metric.ValueCount: + writer.WriteStringValue(MemberValueCount); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Rollup.Metric)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Rollup.Metric ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.Metric value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/Metric.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/Metric.g.cs new file mode 100644 index 00000000000..b2266767b41 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/Metric.g.cs @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.MetricConverter))] +public enum Metric +{ + [System.Runtime.Serialization.EnumMember(Value = "avg")] + Avg, + [System.Runtime.Serialization.EnumMember(Value = "max")] + Max, + [System.Runtime.Serialization.EnumMember(Value = "min")] + Min, + [System.Runtime.Serialization.EnumMember(Value = "sum")] + Sum, + [System.Runtime.Serialization.EnumMember(Value = "value_count")] + ValueCount +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupCapabilities.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupCapabilities.Converters.g.cs new file mode 100644 index 00000000000..4bce91f56b0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupCapabilities.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class RollupCapabilitiesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRollupJobs = System.Text.Json.JsonEncodedText.Encode("rollup_jobs"); + + public override Elastic.Clients.Elasticsearch.Rollup.RollupCapabilities Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propRollupJobs = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRollupJobs.TryReadProperty(ref reader, options, PropRollupJobs, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.RollupCapabilities(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + RollupJobs = propRollupJobs.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.RollupCapabilities value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRollupJobs, value.RollupJobs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupCapabilities.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupCapabilities.g.cs index 2168132f25f..cf9bf2b12a5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupCapabilities.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupCapabilities.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Rollup; -internal sealed partial class RollupCapabilitiesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRollupJobs = System.Text.Json.JsonEncodedText.Encode("rollup_jobs"); - - public override Elastic.Clients.Elasticsearch.Rollup.RollupCapabilities Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propRollupJobs = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRollupJobs.TryReadProperty(ref reader, options, PropRollupJobs, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.RollupCapabilities(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - RollupJobs = propRollupJobs.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.RollupCapabilities value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRollupJobs, value.RollupJobs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.RollupCapabilitiesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.RollupCapabilitiesConverter))] public sealed partial class RollupCapabilities { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupCapabilitySummary.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupCapabilitySummary.Converters.g.cs new file mode 100644 index 00000000000..02ae559e25c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupCapabilitySummary.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class RollupCapabilitySummaryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIndexPattern = System.Text.Json.JsonEncodedText.Encode("index_pattern"); + private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); + private static readonly System.Text.Json.JsonEncodedText PropRollupIndex = System.Text.Json.JsonEncodedText.Encode("rollup_index"); + + public override Elastic.Clients.Elasticsearch.Rollup.RollupCapabilitySummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>> propFields = default; + LocalJsonValue propIndexPattern = default; + LocalJsonValue propJobId = default; + LocalJsonValue propRollupIndex = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)!)) + { + continue; + } + + if (propIndexPattern.TryReadProperty(ref reader, options, PropIndexPattern, null)) + { + continue; + } + + if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) + { + continue; + } + + if (propRollupIndex.TryReadProperty(ref reader, options, PropRollupIndex, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.RollupCapabilitySummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Fields = propFields.Value, + IndexPattern = propIndexPattern.Value, + JobId = propJobId.Value, + RollupIndex = propRollupIndex.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.RollupCapabilitySummary value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropIndexPattern, value.IndexPattern, null, null); + writer.WriteProperty(options, PropJobId, value.JobId, null, null); + writer.WriteProperty(options, PropRollupIndex, value.RollupIndex, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupCapabilitySummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupCapabilitySummary.g.cs index bda00b0cbcf..38ba5ff54b3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupCapabilitySummary.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupCapabilitySummary.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Rollup; -internal sealed partial class RollupCapabilitySummaryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIndexPattern = System.Text.Json.JsonEncodedText.Encode("index_pattern"); - private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); - private static readonly System.Text.Json.JsonEncodedText PropRollupIndex = System.Text.Json.JsonEncodedText.Encode("rollup_index"); - - public override Elastic.Clients.Elasticsearch.Rollup.RollupCapabilitySummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>> propFields = default; - LocalJsonValue propIndexPattern = default; - LocalJsonValue propJobId = default; - LocalJsonValue propRollupIndex = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)!)) - { - continue; - } - - if (propIndexPattern.TryReadProperty(ref reader, options, PropIndexPattern, null)) - { - continue; - } - - if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) - { - continue; - } - - if (propRollupIndex.TryReadProperty(ref reader, options, PropRollupIndex, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.RollupCapabilitySummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Fields = propFields.Value, - IndexPattern = propIndexPattern.Value, - JobId = propJobId.Value, - RollupIndex = propRollupIndex.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.RollupCapabilitySummary value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropIndexPattern, value.IndexPattern, null, null); - writer.WriteProperty(options, PropJobId, value.JobId, null, null); - writer.WriteProperty(options, PropRollupIndex, value.RollupIndex, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.RollupCapabilitySummaryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.RollupCapabilitySummaryConverter))] public sealed partial class RollupCapabilitySummary { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupFieldSummary.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupFieldSummary.Converters.g.cs new file mode 100644 index 00000000000..25f17e95cbc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupFieldSummary.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class RollupFieldSummaryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAgg = System.Text.Json.JsonEncodedText.Encode("agg"); + private static readonly System.Text.Json.JsonEncodedText PropCalendarInterval = System.Text.Json.JsonEncodedText.Encode("calendar_interval"); + private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"); + + public override Elastic.Clients.Elasticsearch.Rollup.RollupFieldSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAgg = default; + LocalJsonValue propCalendarInterval = default; + LocalJsonValue propTimeZone = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAgg.TryReadProperty(ref reader, options, PropAgg, null)) + { + continue; + } + + if (propCalendarInterval.TryReadProperty(ref reader, options, PropCalendarInterval, null)) + { + continue; + } + + if (propTimeZone.TryReadProperty(ref reader, options, PropTimeZone, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.RollupFieldSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Agg = propAgg.Value, + CalendarInterval = propCalendarInterval.Value, + TimeZone = propTimeZone.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.RollupFieldSummary value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAgg, value.Agg, null, null); + writer.WriteProperty(options, PropCalendarInterval, value.CalendarInterval, null, null); + writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupFieldSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupFieldSummary.g.cs index 52e003d7aa3..ef8ba043fa5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupFieldSummary.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupFieldSummary.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Rollup; -internal sealed partial class RollupFieldSummaryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAgg = System.Text.Json.JsonEncodedText.Encode("agg"); - private static readonly System.Text.Json.JsonEncodedText PropCalendarInterval = System.Text.Json.JsonEncodedText.Encode("calendar_interval"); - private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"); - - public override Elastic.Clients.Elasticsearch.Rollup.RollupFieldSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAgg = default; - LocalJsonValue propCalendarInterval = default; - LocalJsonValue propTimeZone = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAgg.TryReadProperty(ref reader, options, PropAgg, null)) - { - continue; - } - - if (propCalendarInterval.TryReadProperty(ref reader, options, PropCalendarInterval, null)) - { - continue; - } - - if (propTimeZone.TryReadProperty(ref reader, options, PropTimeZone, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.RollupFieldSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Agg = propAgg.Value, - CalendarInterval = propCalendarInterval.Value, - TimeZone = propTimeZone.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.RollupFieldSummary value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAgg, value.Agg, null, null); - writer.WriteProperty(options, PropCalendarInterval, value.CalendarInterval, null, null); - writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.RollupFieldSummaryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.RollupFieldSummaryConverter))] public sealed partial class RollupFieldSummary { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJob.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJob.Converters.g.cs new file mode 100644 index 00000000000..2b0a0259e2c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJob.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class RollupJobConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropConfig = System.Text.Json.JsonEncodedText.Encode("config"); + private static readonly System.Text.Json.JsonEncodedText PropStats = System.Text.Json.JsonEncodedText.Encode("stats"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + + public override Elastic.Clients.Elasticsearch.Rollup.RollupJob Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propConfig = default; + LocalJsonValue propStats = default; + LocalJsonValue propStatus = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propConfig.TryReadProperty(ref reader, options, PropConfig, null)) + { + continue; + } + + if (propStats.TryReadProperty(ref reader, options, PropStats, null)) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.RollupJob(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Config = propConfig.Value, + Stats = propStats.Value, + Status = propStatus.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.RollupJob value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropConfig, value.Config, null, null); + writer.WriteProperty(options, PropStats, value.Stats, null, null); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJob.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJob.g.cs index 748ca80f3f8..574c55cfad1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJob.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJob.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Rollup; -internal sealed partial class RollupJobConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropConfig = System.Text.Json.JsonEncodedText.Encode("config"); - private static readonly System.Text.Json.JsonEncodedText PropStats = System.Text.Json.JsonEncodedText.Encode("stats"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - - public override Elastic.Clients.Elasticsearch.Rollup.RollupJob Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propConfig = default; - LocalJsonValue propStats = default; - LocalJsonValue propStatus = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propConfig.TryReadProperty(ref reader, options, PropConfig, null)) - { - continue; - } - - if (propStats.TryReadProperty(ref reader, options, PropStats, null)) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.RollupJob(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Config = propConfig.Value, - Stats = propStats.Value, - Status = propStatus.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.RollupJob value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropConfig, value.Config, null, null); - writer.WriteProperty(options, PropStats, value.Stats, null, null); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.RollupJobConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.RollupJobConverter))] public sealed partial class RollupJob { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobConfiguration.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobConfiguration.Converters.g.cs new file mode 100644 index 00000000000..ce0e6ab9ff9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobConfiguration.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class RollupJobConfigurationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCron = System.Text.Json.JsonEncodedText.Encode("cron"); + private static readonly System.Text.Json.JsonEncodedText PropGroups = System.Text.Json.JsonEncodedText.Encode("groups"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropIndexPattern = System.Text.Json.JsonEncodedText.Encode("index_pattern"); + private static readonly System.Text.Json.JsonEncodedText PropMetrics = System.Text.Json.JsonEncodedText.Encode("metrics"); + private static readonly System.Text.Json.JsonEncodedText PropPageSize = System.Text.Json.JsonEncodedText.Encode("page_size"); + private static readonly System.Text.Json.JsonEncodedText PropRollupIndex = System.Text.Json.JsonEncodedText.Encode("rollup_index"); + private static readonly System.Text.Json.JsonEncodedText PropTimeout = System.Text.Json.JsonEncodedText.Encode("timeout"); + + public override Elastic.Clients.Elasticsearch.Rollup.RollupJobConfiguration Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCron = default; + LocalJsonValue propGroups = default; + LocalJsonValue propId = default; + LocalJsonValue propIndexPattern = default; + LocalJsonValue> propMetrics = default; + LocalJsonValue propPageSize = default; + LocalJsonValue propRollupIndex = default; + LocalJsonValue propTimeout = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCron.TryReadProperty(ref reader, options, PropCron, null)) + { + continue; + } + + if (propGroups.TryReadProperty(ref reader, options, PropGroups, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndexPattern.TryReadProperty(ref reader, options, PropIndexPattern, null)) + { + continue; + } + + if (propMetrics.TryReadProperty(ref reader, options, PropMetrics, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propPageSize.TryReadProperty(ref reader, options, PropPageSize, null)) + { + continue; + } + + if (propRollupIndex.TryReadProperty(ref reader, options, PropRollupIndex, null)) + { + continue; + } + + if (propTimeout.TryReadProperty(ref reader, options, PropTimeout, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.RollupJobConfiguration(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Cron = propCron.Value, + Groups = propGroups.Value, + Id = propId.Value, + IndexPattern = propIndexPattern.Value, + Metrics = propMetrics.Value, + PageSize = propPageSize.Value, + RollupIndex = propRollupIndex.Value, + Timeout = propTimeout.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.RollupJobConfiguration value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCron, value.Cron, null, null); + writer.WriteProperty(options, PropGroups, value.Groups, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndexPattern, value.IndexPattern, null, null); + writer.WriteProperty(options, PropMetrics, value.Metrics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPageSize, value.PageSize, null, null); + writer.WriteProperty(options, PropRollupIndex, value.RollupIndex, null, null); + writer.WriteProperty(options, PropTimeout, value.Timeout, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobConfiguration.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobConfiguration.g.cs index ef1de6fd02d..774f3be920a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobConfiguration.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobConfiguration.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Rollup; -internal sealed partial class RollupJobConfigurationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCron = System.Text.Json.JsonEncodedText.Encode("cron"); - private static readonly System.Text.Json.JsonEncodedText PropGroups = System.Text.Json.JsonEncodedText.Encode("groups"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropIndexPattern = System.Text.Json.JsonEncodedText.Encode("index_pattern"); - private static readonly System.Text.Json.JsonEncodedText PropMetrics = System.Text.Json.JsonEncodedText.Encode("metrics"); - private static readonly System.Text.Json.JsonEncodedText PropPageSize = System.Text.Json.JsonEncodedText.Encode("page_size"); - private static readonly System.Text.Json.JsonEncodedText PropRollupIndex = System.Text.Json.JsonEncodedText.Encode("rollup_index"); - private static readonly System.Text.Json.JsonEncodedText PropTimeout = System.Text.Json.JsonEncodedText.Encode("timeout"); - - public override Elastic.Clients.Elasticsearch.Rollup.RollupJobConfiguration Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCron = default; - LocalJsonValue propGroups = default; - LocalJsonValue propId = default; - LocalJsonValue propIndexPattern = default; - LocalJsonValue> propMetrics = default; - LocalJsonValue propPageSize = default; - LocalJsonValue propRollupIndex = default; - LocalJsonValue propTimeout = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCron.TryReadProperty(ref reader, options, PropCron, null)) - { - continue; - } - - if (propGroups.TryReadProperty(ref reader, options, PropGroups, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndexPattern.TryReadProperty(ref reader, options, PropIndexPattern, null)) - { - continue; - } - - if (propMetrics.TryReadProperty(ref reader, options, PropMetrics, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propPageSize.TryReadProperty(ref reader, options, PropPageSize, null)) - { - continue; - } - - if (propRollupIndex.TryReadProperty(ref reader, options, PropRollupIndex, null)) - { - continue; - } - - if (propTimeout.TryReadProperty(ref reader, options, PropTimeout, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.RollupJobConfiguration(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Cron = propCron.Value, - Groups = propGroups.Value, - Id = propId.Value, - IndexPattern = propIndexPattern.Value, - Metrics = propMetrics.Value, - PageSize = propPageSize.Value, - RollupIndex = propRollupIndex.Value, - Timeout = propTimeout.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.RollupJobConfiguration value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCron, value.Cron, null, null); - writer.WriteProperty(options, PropGroups, value.Groups, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndexPattern, value.IndexPattern, null, null); - writer.WriteProperty(options, PropMetrics, value.Metrics, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPageSize, value.PageSize, null, null); - writer.WriteProperty(options, PropRollupIndex, value.RollupIndex, null, null); - writer.WriteProperty(options, PropTimeout, value.Timeout, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.RollupJobConfigurationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.RollupJobConfigurationConverter))] public sealed partial class RollupJobConfiguration { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobStats.Converters.g.cs new file mode 100644 index 00000000000..9534778d002 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobStats.Converters.g.cs @@ -0,0 +1,162 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class RollupJobStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocumentsProcessed = System.Text.Json.JsonEncodedText.Encode("documents_processed"); + private static readonly System.Text.Json.JsonEncodedText PropIndexFailures = System.Text.Json.JsonEncodedText.Encode("index_failures"); + private static readonly System.Text.Json.JsonEncodedText PropIndexTimeInMs = System.Text.Json.JsonEncodedText.Encode("index_time_in_ms"); + private static readonly System.Text.Json.JsonEncodedText PropIndexTotal = System.Text.Json.JsonEncodedText.Encode("index_total"); + private static readonly System.Text.Json.JsonEncodedText PropPagesProcessed = System.Text.Json.JsonEncodedText.Encode("pages_processed"); + private static readonly System.Text.Json.JsonEncodedText PropProcessingTimeInMs = System.Text.Json.JsonEncodedText.Encode("processing_time_in_ms"); + private static readonly System.Text.Json.JsonEncodedText PropProcessingTotal = System.Text.Json.JsonEncodedText.Encode("processing_total"); + private static readonly System.Text.Json.JsonEncodedText PropRollupsIndexed = System.Text.Json.JsonEncodedText.Encode("rollups_indexed"); + private static readonly System.Text.Json.JsonEncodedText PropSearchFailures = System.Text.Json.JsonEncodedText.Encode("search_failures"); + private static readonly System.Text.Json.JsonEncodedText PropSearchTimeInMs = System.Text.Json.JsonEncodedText.Encode("search_time_in_ms"); + private static readonly System.Text.Json.JsonEncodedText PropSearchTotal = System.Text.Json.JsonEncodedText.Encode("search_total"); + private static readonly System.Text.Json.JsonEncodedText PropTriggerCount = System.Text.Json.JsonEncodedText.Encode("trigger_count"); + + public override Elastic.Clients.Elasticsearch.Rollup.RollupJobStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDocumentsProcessed = default; + LocalJsonValue propIndexFailures = default; + LocalJsonValue propIndexTimeInMs = default; + LocalJsonValue propIndexTotal = default; + LocalJsonValue propPagesProcessed = default; + LocalJsonValue propProcessingTimeInMs = default; + LocalJsonValue propProcessingTotal = default; + LocalJsonValue propRollupsIndexed = default; + LocalJsonValue propSearchFailures = default; + LocalJsonValue propSearchTimeInMs = default; + LocalJsonValue propSearchTotal = default; + LocalJsonValue propTriggerCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocumentsProcessed.TryReadProperty(ref reader, options, PropDocumentsProcessed, null)) + { + continue; + } + + if (propIndexFailures.TryReadProperty(ref reader, options, PropIndexFailures, null)) + { + continue; + } + + if (propIndexTimeInMs.TryReadProperty(ref reader, options, PropIndexTimeInMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propIndexTotal.TryReadProperty(ref reader, options, PropIndexTotal, null)) + { + continue; + } + + if (propPagesProcessed.TryReadProperty(ref reader, options, PropPagesProcessed, null)) + { + continue; + } + + if (propProcessingTimeInMs.TryReadProperty(ref reader, options, PropProcessingTimeInMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propProcessingTotal.TryReadProperty(ref reader, options, PropProcessingTotal, null)) + { + continue; + } + + if (propRollupsIndexed.TryReadProperty(ref reader, options, PropRollupsIndexed, null)) + { + continue; + } + + if (propSearchFailures.TryReadProperty(ref reader, options, PropSearchFailures, null)) + { + continue; + } + + if (propSearchTimeInMs.TryReadProperty(ref reader, options, PropSearchTimeInMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propSearchTotal.TryReadProperty(ref reader, options, PropSearchTotal, null)) + { + continue; + } + + if (propTriggerCount.TryReadProperty(ref reader, options, PropTriggerCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.RollupJobStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DocumentsProcessed = propDocumentsProcessed.Value, + IndexFailures = propIndexFailures.Value, + IndexTimeInMs = propIndexTimeInMs.Value, + IndexTotal = propIndexTotal.Value, + PagesProcessed = propPagesProcessed.Value, + ProcessingTimeInMs = propProcessingTimeInMs.Value, + ProcessingTotal = propProcessingTotal.Value, + RollupsIndexed = propRollupsIndexed.Value, + SearchFailures = propSearchFailures.Value, + SearchTimeInMs = propSearchTimeInMs.Value, + SearchTotal = propSearchTotal.Value, + TriggerCount = propTriggerCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.RollupJobStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocumentsProcessed, value.DocumentsProcessed, null, null); + writer.WriteProperty(options, PropIndexFailures, value.IndexFailures, null, null); + writer.WriteProperty(options, PropIndexTimeInMs, value.IndexTimeInMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropIndexTotal, value.IndexTotal, null, null); + writer.WriteProperty(options, PropPagesProcessed, value.PagesProcessed, null, null); + writer.WriteProperty(options, PropProcessingTimeInMs, value.ProcessingTimeInMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropProcessingTotal, value.ProcessingTotal, null, null); + writer.WriteProperty(options, PropRollupsIndexed, value.RollupsIndexed, null, null); + writer.WriteProperty(options, PropSearchFailures, value.SearchFailures, null, null); + writer.WriteProperty(options, PropSearchTimeInMs, value.SearchTimeInMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropSearchTotal, value.SearchTotal, null, null); + writer.WriteProperty(options, PropTriggerCount, value.TriggerCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobStats.g.cs index 014b36f37d2..e5c7e6a5ebd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobStats.g.cs @@ -23,145 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Rollup; -internal sealed partial class RollupJobStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocumentsProcessed = System.Text.Json.JsonEncodedText.Encode("documents_processed"); - private static readonly System.Text.Json.JsonEncodedText PropIndexFailures = System.Text.Json.JsonEncodedText.Encode("index_failures"); - private static readonly System.Text.Json.JsonEncodedText PropIndexTimeInMs = System.Text.Json.JsonEncodedText.Encode("index_time_in_ms"); - private static readonly System.Text.Json.JsonEncodedText PropIndexTotal = System.Text.Json.JsonEncodedText.Encode("index_total"); - private static readonly System.Text.Json.JsonEncodedText PropPagesProcessed = System.Text.Json.JsonEncodedText.Encode("pages_processed"); - private static readonly System.Text.Json.JsonEncodedText PropProcessingTimeInMs = System.Text.Json.JsonEncodedText.Encode("processing_time_in_ms"); - private static readonly System.Text.Json.JsonEncodedText PropProcessingTotal = System.Text.Json.JsonEncodedText.Encode("processing_total"); - private static readonly System.Text.Json.JsonEncodedText PropRollupsIndexed = System.Text.Json.JsonEncodedText.Encode("rollups_indexed"); - private static readonly System.Text.Json.JsonEncodedText PropSearchFailures = System.Text.Json.JsonEncodedText.Encode("search_failures"); - private static readonly System.Text.Json.JsonEncodedText PropSearchTimeInMs = System.Text.Json.JsonEncodedText.Encode("search_time_in_ms"); - private static readonly System.Text.Json.JsonEncodedText PropSearchTotal = System.Text.Json.JsonEncodedText.Encode("search_total"); - private static readonly System.Text.Json.JsonEncodedText PropTriggerCount = System.Text.Json.JsonEncodedText.Encode("trigger_count"); - - public override Elastic.Clients.Elasticsearch.Rollup.RollupJobStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDocumentsProcessed = default; - LocalJsonValue propIndexFailures = default; - LocalJsonValue propIndexTimeInMs = default; - LocalJsonValue propIndexTotal = default; - LocalJsonValue propPagesProcessed = default; - LocalJsonValue propProcessingTimeInMs = default; - LocalJsonValue propProcessingTotal = default; - LocalJsonValue propRollupsIndexed = default; - LocalJsonValue propSearchFailures = default; - LocalJsonValue propSearchTimeInMs = default; - LocalJsonValue propSearchTotal = default; - LocalJsonValue propTriggerCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocumentsProcessed.TryReadProperty(ref reader, options, PropDocumentsProcessed, null)) - { - continue; - } - - if (propIndexFailures.TryReadProperty(ref reader, options, PropIndexFailures, null)) - { - continue; - } - - if (propIndexTimeInMs.TryReadProperty(ref reader, options, PropIndexTimeInMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propIndexTotal.TryReadProperty(ref reader, options, PropIndexTotal, null)) - { - continue; - } - - if (propPagesProcessed.TryReadProperty(ref reader, options, PropPagesProcessed, null)) - { - continue; - } - - if (propProcessingTimeInMs.TryReadProperty(ref reader, options, PropProcessingTimeInMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propProcessingTotal.TryReadProperty(ref reader, options, PropProcessingTotal, null)) - { - continue; - } - - if (propRollupsIndexed.TryReadProperty(ref reader, options, PropRollupsIndexed, null)) - { - continue; - } - - if (propSearchFailures.TryReadProperty(ref reader, options, PropSearchFailures, null)) - { - continue; - } - - if (propSearchTimeInMs.TryReadProperty(ref reader, options, PropSearchTimeInMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propSearchTotal.TryReadProperty(ref reader, options, PropSearchTotal, null)) - { - continue; - } - - if (propTriggerCount.TryReadProperty(ref reader, options, PropTriggerCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.RollupJobStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DocumentsProcessed = propDocumentsProcessed.Value, - IndexFailures = propIndexFailures.Value, - IndexTimeInMs = propIndexTimeInMs.Value, - IndexTotal = propIndexTotal.Value, - PagesProcessed = propPagesProcessed.Value, - ProcessingTimeInMs = propProcessingTimeInMs.Value, - ProcessingTotal = propProcessingTotal.Value, - RollupsIndexed = propRollupsIndexed.Value, - SearchFailures = propSearchFailures.Value, - SearchTimeInMs = propSearchTimeInMs.Value, - SearchTotal = propSearchTotal.Value, - TriggerCount = propTriggerCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.RollupJobStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocumentsProcessed, value.DocumentsProcessed, null, null); - writer.WriteProperty(options, PropIndexFailures, value.IndexFailures, null, null); - writer.WriteProperty(options, PropIndexTimeInMs, value.IndexTimeInMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropIndexTotal, value.IndexTotal, null, null); - writer.WriteProperty(options, PropPagesProcessed, value.PagesProcessed, null, null); - writer.WriteProperty(options, PropProcessingTimeInMs, value.ProcessingTimeInMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropProcessingTotal, value.ProcessingTotal, null, null); - writer.WriteProperty(options, PropRollupsIndexed, value.RollupsIndexed, null, null); - writer.WriteProperty(options, PropSearchFailures, value.SearchFailures, null, null); - writer.WriteProperty(options, PropSearchTimeInMs, value.SearchTimeInMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropSearchTotal, value.SearchTotal, null, null); - writer.WriteProperty(options, PropTriggerCount, value.TriggerCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.RollupJobStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.RollupJobStatsConverter))] public sealed partial class RollupJobStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobStatus.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobStatus.Converters.g.cs new file mode 100644 index 00000000000..c2e372ec872 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobStatus.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class RollupJobStatusConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCurrentPosition = System.Text.Json.JsonEncodedText.Encode("current_position"); + private static readonly System.Text.Json.JsonEncodedText PropJobState = System.Text.Json.JsonEncodedText.Encode("job_state"); + private static readonly System.Text.Json.JsonEncodedText PropUpgradedDocId = System.Text.Json.JsonEncodedText.Encode("upgraded_doc_id"); + + public override Elastic.Clients.Elasticsearch.Rollup.RollupJobStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propCurrentPosition = default; + LocalJsonValue propJobState = default; + LocalJsonValue propUpgradedDocId = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCurrentPosition.TryReadProperty(ref reader, options, PropCurrentPosition, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propJobState.TryReadProperty(ref reader, options, PropJobState, null)) + { + continue; + } + + if (propUpgradedDocId.TryReadProperty(ref reader, options, PropUpgradedDocId, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.RollupJobStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CurrentPosition = propCurrentPosition.Value, + JobState = propJobState.Value, + UpgradedDocId = propUpgradedDocId.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.RollupJobStatus value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCurrentPosition, value.CurrentPosition, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropJobState, value.JobState, null, null); + writer.WriteProperty(options, PropUpgradedDocId, value.UpgradedDocId, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobStatus.g.cs index 657fae59efa..fe86e9bc59d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobStatus.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobStatus.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Rollup; -internal sealed partial class RollupJobStatusConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCurrentPosition = System.Text.Json.JsonEncodedText.Encode("current_position"); - private static readonly System.Text.Json.JsonEncodedText PropJobState = System.Text.Json.JsonEncodedText.Encode("job_state"); - private static readonly System.Text.Json.JsonEncodedText PropUpgradedDocId = System.Text.Json.JsonEncodedText.Encode("upgraded_doc_id"); - - public override Elastic.Clients.Elasticsearch.Rollup.RollupJobStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propCurrentPosition = default; - LocalJsonValue propJobState = default; - LocalJsonValue propUpgradedDocId = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCurrentPosition.TryReadProperty(ref reader, options, PropCurrentPosition, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propJobState.TryReadProperty(ref reader, options, PropJobState, null)) - { - continue; - } - - if (propUpgradedDocId.TryReadProperty(ref reader, options, PropUpgradedDocId, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.RollupJobStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CurrentPosition = propCurrentPosition.Value, - JobState = propJobState.Value, - UpgradedDocId = propUpgradedDocId.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.RollupJobStatus value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCurrentPosition, value.CurrentPosition, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropJobState, value.JobState, null, null); - writer.WriteProperty(options, PropUpgradedDocId, value.UpgradedDocId, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.RollupJobStatusConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.RollupJobStatusConverter))] public sealed partial class RollupJobStatus { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobSummary.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobSummary.Converters.g.cs new file mode 100644 index 00000000000..a51ef6270dd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobSummary.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class RollupJobSummaryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropIndexPattern = System.Text.Json.JsonEncodedText.Encode("index_pattern"); + private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); + private static readonly System.Text.Json.JsonEncodedText PropRollupIndex = System.Text.Json.JsonEncodedText.Encode("rollup_index"); + + public override Elastic.Clients.Elasticsearch.Rollup.RollupJobSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>> propFields = default; + LocalJsonValue propIndexPattern = default; + LocalJsonValue propJobId = default; + LocalJsonValue propRollupIndex = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)!)) + { + continue; + } + + if (propIndexPattern.TryReadProperty(ref reader, options, PropIndexPattern, null)) + { + continue; + } + + if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) + { + continue; + } + + if (propRollupIndex.TryReadProperty(ref reader, options, PropRollupIndex, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.RollupJobSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Fields = propFields.Value, + IndexPattern = propIndexPattern.Value, + JobId = propJobId.Value, + RollupIndex = propRollupIndex.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.RollupJobSummary value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropIndexPattern, value.IndexPattern, null, null); + writer.WriteProperty(options, PropJobId, value.JobId, null, null); + writer.WriteProperty(options, PropRollupIndex, value.RollupIndex, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobSummary.g.cs index df3531751b8..782982d379d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobSummary.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobSummary.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Rollup; -internal sealed partial class RollupJobSummaryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropIndexPattern = System.Text.Json.JsonEncodedText.Encode("index_pattern"); - private static readonly System.Text.Json.JsonEncodedText PropJobId = System.Text.Json.JsonEncodedText.Encode("job_id"); - private static readonly System.Text.Json.JsonEncodedText PropRollupIndex = System.Text.Json.JsonEncodedText.Encode("rollup_index"); - - public override Elastic.Clients.Elasticsearch.Rollup.RollupJobSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>> propFields = default; - LocalJsonValue propIndexPattern = default; - LocalJsonValue propJobId = default; - LocalJsonValue propRollupIndex = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)!)) - { - continue; - } - - if (propIndexPattern.TryReadProperty(ref reader, options, PropIndexPattern, null)) - { - continue; - } - - if (propJobId.TryReadProperty(ref reader, options, PropJobId, null)) - { - continue; - } - - if (propRollupIndex.TryReadProperty(ref reader, options, PropRollupIndex, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.RollupJobSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Fields = propFields.Value, - IndexPattern = propIndexPattern.Value, - JobId = propJobId.Value, - RollupIndex = propRollupIndex.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.RollupJobSummary value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropIndexPattern, value.IndexPattern, null, null); - writer.WriteProperty(options, PropJobId, value.JobId, null, null); - writer.WriteProperty(options, PropRollupIndex, value.RollupIndex, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.RollupJobSummaryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.RollupJobSummaryConverter))] public sealed partial class RollupJobSummary { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobSummaryField.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobSummaryField.Converters.g.cs new file mode 100644 index 00000000000..9d69a8a0af0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobSummaryField.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class RollupJobSummaryFieldConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAgg = System.Text.Json.JsonEncodedText.Encode("agg"); + private static readonly System.Text.Json.JsonEncodedText PropCalendarInterval = System.Text.Json.JsonEncodedText.Encode("calendar_interval"); + private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"); + + public override Elastic.Clients.Elasticsearch.Rollup.RollupJobSummaryField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAgg = default; + LocalJsonValue propCalendarInterval = default; + LocalJsonValue propTimeZone = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAgg.TryReadProperty(ref reader, options, PropAgg, null)) + { + continue; + } + + if (propCalendarInterval.TryReadProperty(ref reader, options, PropCalendarInterval, null)) + { + continue; + } + + if (propTimeZone.TryReadProperty(ref reader, options, PropTimeZone, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.RollupJobSummaryField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Agg = propAgg.Value, + CalendarInterval = propCalendarInterval.Value, + TimeZone = propTimeZone.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.RollupJobSummaryField value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAgg, value.Agg, null, null); + writer.WriteProperty(options, PropCalendarInterval, value.CalendarInterval, null, null); + writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobSummaryField.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobSummaryField.g.cs index c700b0d642e..d3806fc95a8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobSummaryField.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/RollupJobSummaryField.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Rollup; -internal sealed partial class RollupJobSummaryFieldConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAgg = System.Text.Json.JsonEncodedText.Encode("agg"); - private static readonly System.Text.Json.JsonEncodedText PropCalendarInterval = System.Text.Json.JsonEncodedText.Encode("calendar_interval"); - private static readonly System.Text.Json.JsonEncodedText PropTimeZone = System.Text.Json.JsonEncodedText.Encode("time_zone"); - - public override Elastic.Clients.Elasticsearch.Rollup.RollupJobSummaryField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAgg = default; - LocalJsonValue propCalendarInterval = default; - LocalJsonValue propTimeZone = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAgg.TryReadProperty(ref reader, options, PropAgg, null)) - { - continue; - } - - if (propCalendarInterval.TryReadProperty(ref reader, options, PropCalendarInterval, null)) - { - continue; - } - - if (propTimeZone.TryReadProperty(ref reader, options, PropTimeZone, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.RollupJobSummaryField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Agg = propAgg.Value, - CalendarInterval = propCalendarInterval.Value, - TimeZone = propTimeZone.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.RollupJobSummaryField value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAgg, value.Agg, null, null); - writer.WriteProperty(options, PropCalendarInterval, value.CalendarInterval, null, null); - writer.WriteProperty(options, PropTimeZone, value.TimeZone, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.RollupJobSummaryFieldConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.RollupJobSummaryFieldConverter))] public sealed partial class RollupJobSummaryField { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/TermsGrouping.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/TermsGrouping.Converters.g.cs new file mode 100644 index 00000000000..7b48e765f4a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/TermsGrouping.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Rollup.Json; + +public sealed partial class TermsGroupingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + + public override Elastic.Clients.Elasticsearch.Rollup.TermsGrouping Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFields = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFields.TryReadProperty(ref reader, options, PropFields, static Elastic.Clients.Elasticsearch.Fields (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Rollup.TermsGrouping(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Fields = propFields.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.TermsGrouping value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/TermsGrouping.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/TermsGrouping.g.cs index 67fe846e222..e547e3a3b21 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/TermsGrouping.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Rollup/TermsGrouping.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Rollup; -internal sealed partial class TermsGroupingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - - public override Elastic.Clients.Elasticsearch.Rollup.TermsGrouping Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFields = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFields.TryReadProperty(ref reader, options, PropFields, static Elastic.Clients.Elasticsearch.Fields (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Rollup.TermsGrouping(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Fields = propFields.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Rollup.TermsGrouping value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.TermsGroupingConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Rollup.Json.TermsGroupingConverter))] public sealed partial class TermsGrouping { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RrfRank.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RrfRank.Converters.g.cs new file mode 100644 index 00000000000..74433ef48c7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RrfRank.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class RrfRankConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRankConstant = System.Text.Json.JsonEncodedText.Encode("rank_constant"); + private static readonly System.Text.Json.JsonEncodedText PropRankWindowSize = System.Text.Json.JsonEncodedText.Encode("rank_window_size"); + + public override Elastic.Clients.Elasticsearch.RrfRank Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propRankConstant = default; + LocalJsonValue propRankWindowSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRankConstant.TryReadProperty(ref reader, options, PropRankConstant, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRankWindowSize.TryReadProperty(ref reader, options, PropRankWindowSize, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.RrfRank(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + RankConstant = propRankConstant.Value, + RankWindowSize = propRankWindowSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.RrfRank value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRankConstant, value.RankConstant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRankWindowSize, value.RankWindowSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RrfRank.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RrfRank.g.cs index be20a9713aa..e40fd96b8bb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RrfRank.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RrfRank.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class RrfRankConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRankConstant = System.Text.Json.JsonEncodedText.Encode("rank_constant"); - private static readonly System.Text.Json.JsonEncodedText PropRankWindowSize = System.Text.Json.JsonEncodedText.Encode("rank_window_size"); - - public override Elastic.Clients.Elasticsearch.RrfRank Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propRankConstant = default; - LocalJsonValue propRankWindowSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRankConstant.TryReadProperty(ref reader, options, PropRankConstant, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRankWindowSize.TryReadProperty(ref reader, options, PropRankWindowSize, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.RrfRank(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - RankConstant = propRankConstant.Value, - RankWindowSize = propRankWindowSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.RrfRank value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRankConstant, value.RankConstant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRankWindowSize, value.RankWindowSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.RrfRankConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.RrfRankConverter))] public sealed partial class RrfRank { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RuleRetriever.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RuleRetriever.Converters.g.cs new file mode 100644 index 00000000000..cda281b5001 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RuleRetriever.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class RuleRetrieverConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropMatchCriteria = System.Text.Json.JsonEncodedText.Encode("match_criteria"); + private static readonly System.Text.Json.JsonEncodedText PropMinScore = System.Text.Json.JsonEncodedText.Encode("min_score"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropRankWindowSize = System.Text.Json.JsonEncodedText.Encode("rank_window_size"); + private static readonly System.Text.Json.JsonEncodedText PropRetriever = System.Text.Json.JsonEncodedText.Encode("retriever"); + private static readonly System.Text.Json.JsonEncodedText PropRulesetIds = System.Text.Json.JsonEncodedText.Encode("ruleset_ids"); + + public override Elastic.Clients.Elasticsearch.RuleRetriever Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propFilter = default; + LocalJsonValue propMatchCriteria = default; + LocalJsonValue propMinScore = default; + LocalJsonValue propName = default; + LocalJsonValue propRankWindowSize = default; + LocalJsonValue propRetriever = default; + LocalJsonValue> propRulesetIds = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propMatchCriteria.TryReadProperty(ref reader, options, PropMatchCriteria, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propRankWindowSize.TryReadProperty(ref reader, options, PropRankWindowSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRetriever.TryReadProperty(ref reader, options, PropRetriever, null)) + { + continue; + } + + if (propRulesetIds.TryReadProperty(ref reader, options, PropRulesetIds, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.RuleRetriever(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Filter = propFilter.Value, + MatchCriteria = propMatchCriteria.Value, + MinScore = propMinScore.Value, + Name = propName.Value, + RankWindowSize = propRankWindowSize.Value, + Retriever = propRetriever.Value, + RulesetIds = propRulesetIds.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.RuleRetriever value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMatchCriteria, value.MatchCriteria, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropRankWindowSize, value.RankWindowSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRetriever, value.Retriever, null, null); + writer.WriteProperty(options, PropRulesetIds, value.RulesetIds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RuleRetriever.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RuleRetriever.g.cs index a8dc04a9810..6d38fbb4f3f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/RuleRetriever.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/RuleRetriever.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class RuleRetrieverConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropMatchCriteria = System.Text.Json.JsonEncodedText.Encode("match_criteria"); - private static readonly System.Text.Json.JsonEncodedText PropMinScore = System.Text.Json.JsonEncodedText.Encode("min_score"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropRankWindowSize = System.Text.Json.JsonEncodedText.Encode("rank_window_size"); - private static readonly System.Text.Json.JsonEncodedText PropRetriever = System.Text.Json.JsonEncodedText.Encode("retriever"); - private static readonly System.Text.Json.JsonEncodedText PropRulesetIds = System.Text.Json.JsonEncodedText.Encode("ruleset_ids"); - - public override Elastic.Clients.Elasticsearch.RuleRetriever Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propFilter = default; - LocalJsonValue propMatchCriteria = default; - LocalJsonValue propMinScore = default; - LocalJsonValue propName = default; - LocalJsonValue propRankWindowSize = default; - LocalJsonValue propRetriever = default; - LocalJsonValue> propRulesetIds = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propMatchCriteria.TryReadProperty(ref reader, options, PropMatchCriteria, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propRankWindowSize.TryReadProperty(ref reader, options, PropRankWindowSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRetriever.TryReadProperty(ref reader, options, PropRetriever, null)) - { - continue; - } - - if (propRulesetIds.TryReadProperty(ref reader, options, PropRulesetIds, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.RuleRetriever(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Filter = propFilter.Value, - MatchCriteria = propMatchCriteria.Value, - MinScore = propMinScore.Value, - Name = propName.Value, - RankWindowSize = propRankWindowSize.Value, - Retriever = propRetriever.Value, - RulesetIds = propRulesetIds.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.RuleRetriever value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMatchCriteria, value.MatchCriteria, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropRankWindowSize, value.RankWindowSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRetriever, value.Retriever, null, null); - writer.WriteProperty(options, PropRulesetIds, value.RulesetIds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.RuleRetrieverConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.RuleRetrieverConverter))] public sealed partial class RuleRetriever { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScoreNormalizer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScoreNormalizer.Converters.g.cs new file mode 100644 index 00000000000..37aa787c529 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScoreNormalizer.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ScoreNormalizerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberL2Norm = System.Text.Json.JsonEncodedText.Encode("l2_norm"); + private static readonly System.Text.Json.JsonEncodedText MemberMinmax = System.Text.Json.JsonEncodedText.Encode("minmax"); + private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); + + public override Elastic.Clients.Elasticsearch.ScoreNormalizer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberL2Norm)) + { + return Elastic.Clients.Elasticsearch.ScoreNormalizer.L2Norm; + } + + if (reader.ValueTextEquals(MemberMinmax)) + { + return Elastic.Clients.Elasticsearch.ScoreNormalizer.Minmax; + } + + if (reader.ValueTextEquals(MemberNone)) + { + return Elastic.Clients.Elasticsearch.ScoreNormalizer.None; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberL2Norm.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.ScoreNormalizer.L2Norm; + } + + if (string.Equals(value, MemberMinmax.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.ScoreNormalizer.Minmax; + } + + if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.ScoreNormalizer.None; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.ScoreNormalizer)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ScoreNormalizer value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.ScoreNormalizer.L2Norm: + writer.WriteStringValue(MemberL2Norm); + break; + case Elastic.Clients.Elasticsearch.ScoreNormalizer.Minmax: + writer.WriteStringValue(MemberMinmax); + break; + case Elastic.Clients.Elasticsearch.ScoreNormalizer.None: + writer.WriteStringValue(MemberNone); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.ScoreNormalizer)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.ScoreNormalizer ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ScoreNormalizer value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScoreNormalizer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScoreNormalizer.g.cs new file mode 100644 index 00000000000..25330c651c0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScoreNormalizer.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ScoreNormalizerConverter))] +public enum ScoreNormalizer +{ + [System.Runtime.Serialization.EnumMember(Value = "l2_norm")] + L2Norm, + [System.Runtime.Serialization.EnumMember(Value = "minmax")] + Minmax, + [System.Runtime.Serialization.EnumMember(Value = "none")] + None +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScoreSort.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScoreSort.Converters.g.cs new file mode 100644 index 00000000000..ac5d28ec5e2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScoreSort.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ScoreSortConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); + + public override Elastic.Clients.Elasticsearch.ScoreSort Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propOrder = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propOrder.TryReadProperty(ref reader, options, PropOrder, static Elastic.Clients.Elasticsearch.SortOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ScoreSort(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Order = propOrder.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ScoreSort value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortOrder? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScoreSort.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScoreSort.g.cs index 366334209c5..c7bbba0f795 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScoreSort.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScoreSort.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class ScoreSortConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); - - public override Elastic.Clients.Elasticsearch.ScoreSort Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propOrder = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propOrder.TryReadProperty(ref reader, options, PropOrder, static Elastic.Clients.Elasticsearch.SortOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ScoreSort(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Order = propOrder.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ScoreSort value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortOrder? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ScoreSortConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ScoreSortConverter))] public sealed partial class ScoreSort { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Script.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Script.Converters.g.cs new file mode 100644 index 00000000000..6f5018d4cd8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Script.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ScriptConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropLang = System.Text.Json.JsonEncodedText.Encode("lang"); + private static readonly System.Text.Json.JsonEncodedText PropOptions = System.Text.Json.JsonEncodedText.Encode("options"); + private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + + public override Elastic.Clients.Elasticsearch.Script Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) + { + var value = reader.ReadValue(options, null); + return new Elastic.Clients.Elasticsearch.Script(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Source = value + }; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propLang = default; + LocalJsonValue?> propOptions = default; + LocalJsonValue?> propParams = default; + LocalJsonValue propSource = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propLang.TryReadProperty(ref reader, options, PropLang, static Elastic.Clients.Elasticsearch.ScriptLanguage? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOptions.TryReadProperty(ref reader, options, PropOptions, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Script(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + Lang = propLang.Value, + Options = propOptions.Value, + Params = propParams.Value, + Source = propSource.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Script value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropLang, value.Lang, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.ScriptLanguage? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOptions, value.Options, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Script.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Script.g.cs index 470bd26e481..efc04e8ed82 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Script.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Script.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class ScriptConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropLang = System.Text.Json.JsonEncodedText.Encode("lang"); - private static readonly System.Text.Json.JsonEncodedText PropOptions = System.Text.Json.JsonEncodedText.Encode("options"); - private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - - public override Elastic.Clients.Elasticsearch.Script Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.TokenType is not System.Text.Json.JsonTokenType.StartObject) - { - var value = reader.ReadValue(options, null); - return new Elastic.Clients.Elasticsearch.Script(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Source = value - }; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue propLang = default; - LocalJsonValue?> propOptions = default; - LocalJsonValue?> propParams = default; - LocalJsonValue propSource = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propLang.TryReadProperty(ref reader, options, PropLang, static Elastic.Clients.Elasticsearch.ScriptLanguage? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOptions.TryReadProperty(ref reader, options, PropOptions, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Script(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - Lang = propLang.Value, - Options = propOptions.Value, - Params = propParams.Value, - Source = propSource.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Script value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropLang, value.Lang, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.ScriptLanguage? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOptions, value.Options, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ScriptConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ScriptConverter))] public sealed partial class Script { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptField.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptField.Converters.g.cs new file mode 100644 index 00000000000..40823beb96c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptField.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ScriptFieldConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.ScriptField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIgnoreFailure = default; + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ScriptField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + IgnoreFailure = propIgnoreFailure.Value, + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ScriptField value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptField.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptField.g.cs index 2aed450990f..c58d489fff9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptField.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptField.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class ScriptFieldConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIgnoreFailure = System.Text.Json.JsonEncodedText.Encode("ignore_failure"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.ScriptField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIgnoreFailure = default; - LocalJsonValue propScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIgnoreFailure.TryReadProperty(ref reader, options, PropIgnoreFailure, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ScriptField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - IgnoreFailure = propIgnoreFailure.Value, - Script = propScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ScriptField value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIgnoreFailure, value.IgnoreFailure, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ScriptFieldConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ScriptFieldConverter))] public sealed partial class ScriptField { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptLanguage.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptLanguage.Converters.g.cs new file mode 100644 index 00000000000..d80ba9cfb5b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptLanguage.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ScriptLanguageConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.ScriptLanguage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.ScriptLanguage(reader.ReadValue(options, null)); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ScriptLanguage value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Value, null); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptLanguage.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptLanguage.g.cs new file mode 100644 index 00000000000..2dfc4d2525f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptLanguage.g.cs @@ -0,0 +1,76 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ScriptLanguageConverter))] +public readonly partial struct ScriptLanguage : Elastic.Clients.Elasticsearch.Serialization.IEnumStruct +{ + public ScriptLanguage(string value) => Value = value; +#if NET7_0_OR_GREATER + static ScriptLanguage IEnumStruct.Create(string value) => value; +#else + ScriptLanguage IEnumStruct.Create(string value) => value; +#endif + public readonly string Value { get; } + + /// + /// + /// Lucene’s expressions language, compiles a JavaScript expression to bytecode. + /// + /// + public static ScriptLanguage Expression { get; } = new ScriptLanguage("expression"); + + /// + /// + /// Expert Java API + /// + /// + public static ScriptLanguage Java { get; } = new ScriptLanguage("java"); + + /// + /// + /// Mustache templated, used for templates. + /// + /// + public static ScriptLanguage Mustache { get; } = new ScriptLanguage("mustache"); + + /// + /// + /// Painless scripting language, purpose-built for Elasticsearch. + /// + /// + public static ScriptLanguage Painless { get; } = new ScriptLanguage("painless"); + + public override string ToString() => Value ?? string.Empty; + + public static implicit operator string(ScriptLanguage @enum) => @enum.Value; + public static implicit operator ScriptLanguage(string value) => new(value); + + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals(object obj) => obj is ScriptLanguage other && this.Equals(other); + public bool Equals(ScriptLanguage other) => Value == other.Value; + + public static bool operator ==(ScriptLanguage a, ScriptLanguage b) => a.Equals(b); + public static bool operator !=(ScriptLanguage a, ScriptLanguage b) => !(a == b); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptSort.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptSort.Converters.g.cs new file mode 100644 index 00000000000..8342b7082c8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptSort.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ScriptSortConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); + private static readonly System.Text.Json.JsonEncodedText PropNested = System.Text.Json.JsonEncodedText.Encode("nested"); + private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.ScriptSort Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMode = default; + LocalJsonValue propNested = default; + LocalJsonValue propOrder = default; + LocalJsonValue propScript = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMode.TryReadProperty(ref reader, options, PropMode, static Elastic.Clients.Elasticsearch.SortMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNested.TryReadProperty(ref reader, options, PropNested, null)) + { + continue; + } + + if (propOrder.TryReadProperty(ref reader, options, PropOrder, static Elastic.Clients.Elasticsearch.SortOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, static Elastic.Clients.Elasticsearch.ScriptSortType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ScriptSort(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Mode = propMode.Value, + Nested = propNested.Value, + Order = propOrder.Value, + Script = propScript.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ScriptSort value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMode, value.Mode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortMode? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNested, value.Nested, null, null); + writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortOrder? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteProperty(options, PropType, value.Type, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.ScriptSortType? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptSort.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptSort.g.cs index 90041477fd7..24f62171b29 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptSort.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptSort.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class ScriptSortConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); - private static readonly System.Text.Json.JsonEncodedText PropNested = System.Text.Json.JsonEncodedText.Encode("nested"); - private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.ScriptSort Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMode = default; - LocalJsonValue propNested = default; - LocalJsonValue propOrder = default; - LocalJsonValue propScript = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMode.TryReadProperty(ref reader, options, PropMode, static Elastic.Clients.Elasticsearch.SortMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNested.TryReadProperty(ref reader, options, PropNested, null)) - { - continue; - } - - if (propOrder.TryReadProperty(ref reader, options, PropOrder, static Elastic.Clients.Elasticsearch.SortOrder? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, static Elastic.Clients.Elasticsearch.ScriptSortType? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ScriptSort(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Mode = propMode.Value, - Nested = propNested.Value, - Order = propOrder.Value, - Script = propScript.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ScriptSort value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMode, value.Mode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortMode? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNested, value.Nested, null, null); - writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SortOrder? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropType, value.Type, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.ScriptSortType? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ScriptSortConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ScriptSortConverter))] public sealed partial class ScriptSort { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptSortType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptSortType.Converters.g.cs new file mode 100644 index 00000000000..f7496ebb762 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptSortType.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ScriptSortTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberNumber = System.Text.Json.JsonEncodedText.Encode("number"); + private static readonly System.Text.Json.JsonEncodedText MemberString = System.Text.Json.JsonEncodedText.Encode("string"); + private static readonly System.Text.Json.JsonEncodedText MemberVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.ScriptSortType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberNumber)) + { + return Elastic.Clients.Elasticsearch.ScriptSortType.Number; + } + + if (reader.ValueTextEquals(MemberString)) + { + return Elastic.Clients.Elasticsearch.ScriptSortType.String; + } + + if (reader.ValueTextEquals(MemberVersion)) + { + return Elastic.Clients.Elasticsearch.ScriptSortType.Version; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberNumber.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.ScriptSortType.Number; + } + + if (string.Equals(value, MemberString.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.ScriptSortType.String; + } + + if (string.Equals(value, MemberVersion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.ScriptSortType.Version; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.ScriptSortType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ScriptSortType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.ScriptSortType.Number: + writer.WriteStringValue(MemberNumber); + break; + case Elastic.Clients.Elasticsearch.ScriptSortType.String: + writer.WriteStringValue(MemberString); + break; + case Elastic.Clients.Elasticsearch.ScriptSortType.Version: + writer.WriteStringValue(MemberVersion); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.ScriptSortType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.ScriptSortType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ScriptSortType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptSortType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptSortType.g.cs new file mode 100644 index 00000000000..5afc2d7d8f9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ScriptSortType.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ScriptSortTypeConverter))] +public enum ScriptSortType +{ + [System.Runtime.Serialization.EnumMember(Value = "number")] + Number, + [System.Runtime.Serialization.EnumMember(Value = "string")] + String, + [System.Runtime.Serialization.EnumMember(Value = "version")] + Version +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/AnalyticsCollection.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/AnalyticsCollection.Converters.g.cs new file mode 100644 index 00000000000..228c03ada74 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/AnalyticsCollection.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication.Json; + +public sealed partial class AnalyticsCollectionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEventDataStream = System.Text.Json.JsonEncodedText.Encode("event_data_stream"); + + public override Elastic.Clients.Elasticsearch.SearchApplication.AnalyticsCollection Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEventDataStream = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEventDataStream.TryReadProperty(ref reader, options, PropEventDataStream, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchApplication.AnalyticsCollection(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + EventDataStream = propEventDataStream.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.AnalyticsCollection value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEventDataStream, value.EventDataStream, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/AnalyticsCollection.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/AnalyticsCollection.g.cs index 2bea9437c0c..f4336c25c56 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/AnalyticsCollection.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/AnalyticsCollection.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SearchApplication; -internal sealed partial class AnalyticsCollectionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEventDataStream = System.Text.Json.JsonEncodedText.Encode("event_data_stream"); - - public override Elastic.Clients.Elasticsearch.SearchApplication.AnalyticsCollection Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEventDataStream = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEventDataStream.TryReadProperty(ref reader, options, PropEventDataStream, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchApplication.AnalyticsCollection(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - EventDataStream = propEventDataStream.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.AnalyticsCollection value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEventDataStream, value.EventDataStream, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.AnalyticsCollectionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.Json.AnalyticsCollectionConverter))] public sealed partial class AnalyticsCollection { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/EventDataStream.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/EventDataStream.Converters.g.cs new file mode 100644 index 00000000000..f07281e1298 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/EventDataStream.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication.Json; + +public sealed partial class EventDataStreamConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.SearchApplication.EventDataStream Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchApplication.EventDataStream(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.EventDataStream value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/EventDataStream.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/EventDataStream.g.cs index fc79283a65d..0da0c089497 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/EventDataStream.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/EventDataStream.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SearchApplication; -internal sealed partial class EventDataStreamConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.SearchApplication.EventDataStream Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchApplication.EventDataStream(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.EventDataStream value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.EventDataStreamConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.Json.EventDataStreamConverter))] public sealed partial class EventDataStream { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.SearchApplication.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/EventType.Converters.g.cs similarity index 87% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.SearchApplication.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/EventType.Converters.g.cs index c19bc96d1c2..cee70634327 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.SearchApplication.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/EventType.Converters.g.cs @@ -21,9 +21,9 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.SearchApplication; +namespace Elastic.Clients.Elasticsearch.SearchApplication.Json; -internal sealed partial class EventTypeConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class EventTypeConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText MemberPageView = System.Text.Json.JsonEncodedText.Encode("page_view"); private static readonly System.Text.Json.JsonEncodedText MemberSearch = System.Text.Json.JsonEncodedText.Encode("search"); @@ -92,15 +92,4 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, { Write(writer, value, options); } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.EventTypeConverter))] -public enum EventType -{ - [System.Runtime.Serialization.EnumMember(Value = "page_view")] - PageView, - [System.Runtime.Serialization.EnumMember(Value = "search")] - Search, - [System.Runtime.Serialization.EnumMember(Value = "search_click")] - SearchClick } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/EventType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/EventType.g.cs new file mode 100644 index 00000000000..f6739cddca5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/EventType.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.Json.EventTypeConverter))] +public enum EventType +{ + [System.Runtime.Serialization.EnumMember(Value = "page_view")] + PageView, + [System.Runtime.Serialization.EnumMember(Value = "search")] + Search, + [System.Runtime.Serialization.EnumMember(Value = "search_click")] + SearchClick +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplication.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplication.Converters.g.cs new file mode 100644 index 00000000000..89f4ec51a4b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplication.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication.Json; + +public sealed partial class SearchApplicationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyticsCollectionName = System.Text.Json.JsonEncodedText.Encode("analytics_collection_name"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"); + private static readonly System.Text.Json.JsonEncodedText PropUpdatedAtMillis = System.Text.Json.JsonEncodedText.Encode("updated_at_millis"); + + public override Elastic.Clients.Elasticsearch.SearchApplication.SearchApplication Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyticsCollectionName = default; + LocalJsonValue> propIndices = default; + LocalJsonValue propName = default; + LocalJsonValue propTemplate = default; + LocalJsonValue propUpdatedAtMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyticsCollectionName.TryReadProperty(ref reader, options, PropAnalyticsCollectionName, null)) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, null)) + { + continue; + } + + if (propUpdatedAtMillis.TryReadProperty(ref reader, options, PropUpdatedAtMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchApplication.SearchApplication(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AnalyticsCollectionName = propAnalyticsCollectionName.Value, + Indices = propIndices.Value, + Name = propName.Value, + Template = propTemplate.Value, + UpdatedAtMillis = propUpdatedAtMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.SearchApplication value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyticsCollectionName, value.AnalyticsCollectionName, null, null); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropTemplate, value.Template, null, null); + writer.WriteProperty(options, PropUpdatedAtMillis, value.UpdatedAtMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplication.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplication.g.cs index 6ee41e7ffd3..7f392518216 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplication.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplication.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SearchApplication; -internal sealed partial class SearchApplicationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyticsCollectionName = System.Text.Json.JsonEncodedText.Encode("analytics_collection_name"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"); - private static readonly System.Text.Json.JsonEncodedText PropUpdatedAtMillis = System.Text.Json.JsonEncodedText.Encode("updated_at_millis"); - - public override Elastic.Clients.Elasticsearch.SearchApplication.SearchApplication Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyticsCollectionName = default; - LocalJsonValue> propIndices = default; - LocalJsonValue propName = default; - LocalJsonValue propTemplate = default; - LocalJsonValue propUpdatedAtMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyticsCollectionName.TryReadProperty(ref reader, options, PropAnalyticsCollectionName, null)) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, null)) - { - continue; - } - - if (propUpdatedAtMillis.TryReadProperty(ref reader, options, PropUpdatedAtMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchApplication.SearchApplication(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AnalyticsCollectionName = propAnalyticsCollectionName.Value, - Indices = propIndices.Value, - Name = propName.Value, - Template = propTemplate.Value, - UpdatedAtMillis = propUpdatedAtMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.SearchApplication value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyticsCollectionName, value.AnalyticsCollectionName, null, null); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropTemplate, value.Template, null, null); - writer.WriteProperty(options, PropUpdatedAtMillis, value.UpdatedAtMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.Json.SearchApplicationConverter))] public sealed partial class SearchApplication { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplicationParameters.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplicationParameters.Converters.g.cs new file mode 100644 index 00000000000..9fe18b4e1c7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplicationParameters.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication.Json; + +public sealed partial class SearchApplicationParametersConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnalyticsCollectionName = System.Text.Json.JsonEncodedText.Encode("analytics_collection_name"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"); + + public override Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationParameters Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnalyticsCollectionName = default; + LocalJsonValue> propIndices = default; + LocalJsonValue propTemplate = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnalyticsCollectionName.TryReadProperty(ref reader, options, PropAnalyticsCollectionName, null)) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationParameters(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AnalyticsCollectionName = propAnalyticsCollectionName.Value, + Indices = propIndices.Value, + Template = propTemplate.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationParameters value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnalyticsCollectionName, value.AnalyticsCollectionName, null, null); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTemplate, value.Template, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplicationParameters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplicationParameters.g.cs index 0017694dc95..77b37899274 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplicationParameters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplicationParameters.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SearchApplication; -internal sealed partial class SearchApplicationParametersConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnalyticsCollectionName = System.Text.Json.JsonEncodedText.Encode("analytics_collection_name"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"); - - public override Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationParameters Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnalyticsCollectionName = default; - LocalJsonValue> propIndices = default; - LocalJsonValue propTemplate = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnalyticsCollectionName.TryReadProperty(ref reader, options, PropAnalyticsCollectionName, null)) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationParameters(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AnalyticsCollectionName = propAnalyticsCollectionName.Value, - Indices = propIndices.Value, - Template = propTemplate.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationParameters value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnalyticsCollectionName, value.AnalyticsCollectionName, null, null); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTemplate, value.Template, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationParametersConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.Json.SearchApplicationParametersConverter))] public sealed partial class SearchApplicationParameters { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplicationTemplate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplicationTemplate.Converters.g.cs new file mode 100644 index 00000000000..73c8bf6a5cd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplicationTemplate.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchApplication.Json; + +public sealed partial class SearchApplicationTemplateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationTemplate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propScript.TryReadProperty(ref reader, options, PropScript, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationTemplate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationTemplate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplicationTemplate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplicationTemplate.g.cs index d7d9767e13b..4f47f8d35b8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplicationTemplate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchApplication/SearchApplicationTemplate.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SearchApplication; -internal sealed partial class SearchApplicationTemplateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - - public override Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationTemplate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propScript = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propScript.TryReadProperty(ref reader, options, PropScript, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationTemplate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Script = propScript.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationTemplate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.SearchApplicationTemplateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchApplication.Json.SearchApplicationTemplateConverter))] public sealed partial class SearchApplicationTemplate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchStats.Converters.g.cs new file mode 100644 index 00000000000..4eeb7afb14a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchStats.Converters.g.cs @@ -0,0 +1,225 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class SearchStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFetchCurrent = System.Text.Json.JsonEncodedText.Encode("fetch_current"); + private static readonly System.Text.Json.JsonEncodedText PropFetchTime = System.Text.Json.JsonEncodedText.Encode("fetch_time"); + private static readonly System.Text.Json.JsonEncodedText PropFetchTimeInMillis = System.Text.Json.JsonEncodedText.Encode("fetch_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropFetchTotal = System.Text.Json.JsonEncodedText.Encode("fetch_total"); + private static readonly System.Text.Json.JsonEncodedText PropGroups = System.Text.Json.JsonEncodedText.Encode("groups"); + private static readonly System.Text.Json.JsonEncodedText PropOpenContexts = System.Text.Json.JsonEncodedText.Encode("open_contexts"); + private static readonly System.Text.Json.JsonEncodedText PropQueryCurrent = System.Text.Json.JsonEncodedText.Encode("query_current"); + private static readonly System.Text.Json.JsonEncodedText PropQueryTime = System.Text.Json.JsonEncodedText.Encode("query_time"); + private static readonly System.Text.Json.JsonEncodedText PropQueryTimeInMillis = System.Text.Json.JsonEncodedText.Encode("query_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropQueryTotal = System.Text.Json.JsonEncodedText.Encode("query_total"); + private static readonly System.Text.Json.JsonEncodedText PropRecentSearchLoad = System.Text.Json.JsonEncodedText.Encode("recent_search_load"); + private static readonly System.Text.Json.JsonEncodedText PropScrollCurrent = System.Text.Json.JsonEncodedText.Encode("scroll_current"); + private static readonly System.Text.Json.JsonEncodedText PropScrollTime = System.Text.Json.JsonEncodedText.Encode("scroll_time"); + private static readonly System.Text.Json.JsonEncodedText PropScrollTimeInMillis = System.Text.Json.JsonEncodedText.Encode("scroll_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropScrollTotal = System.Text.Json.JsonEncodedText.Encode("scroll_total"); + private static readonly System.Text.Json.JsonEncodedText PropSuggestCurrent = System.Text.Json.JsonEncodedText.Encode("suggest_current"); + private static readonly System.Text.Json.JsonEncodedText PropSuggestTime = System.Text.Json.JsonEncodedText.Encode("suggest_time"); + private static readonly System.Text.Json.JsonEncodedText PropSuggestTimeInMillis = System.Text.Json.JsonEncodedText.Encode("suggest_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropSuggestTotal = System.Text.Json.JsonEncodedText.Encode("suggest_total"); + + public override Elastic.Clients.Elasticsearch.SearchStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFetchCurrent = default; + LocalJsonValue propFetchTime = default; + LocalJsonValue propFetchTimeInMillis = default; + LocalJsonValue propFetchTotal = default; + LocalJsonValue?> propGroups = default; + LocalJsonValue propOpenContexts = default; + LocalJsonValue propQueryCurrent = default; + LocalJsonValue propQueryTime = default; + LocalJsonValue propQueryTimeInMillis = default; + LocalJsonValue propQueryTotal = default; + LocalJsonValue propRecentSearchLoad = default; + LocalJsonValue propScrollCurrent = default; + LocalJsonValue propScrollTime = default; + LocalJsonValue propScrollTimeInMillis = default; + LocalJsonValue propScrollTotal = default; + LocalJsonValue propSuggestCurrent = default; + LocalJsonValue propSuggestTime = default; + LocalJsonValue propSuggestTimeInMillis = default; + LocalJsonValue propSuggestTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFetchCurrent.TryReadProperty(ref reader, options, PropFetchCurrent, null)) + { + continue; + } + + if (propFetchTime.TryReadProperty(ref reader, options, PropFetchTime, null)) + { + continue; + } + + if (propFetchTimeInMillis.TryReadProperty(ref reader, options, PropFetchTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propFetchTotal.TryReadProperty(ref reader, options, PropFetchTotal, null)) + { + continue; + } + + if (propGroups.TryReadProperty(ref reader, options, PropGroups, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propOpenContexts.TryReadProperty(ref reader, options, PropOpenContexts, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propQueryCurrent.TryReadProperty(ref reader, options, PropQueryCurrent, null)) + { + continue; + } + + if (propQueryTime.TryReadProperty(ref reader, options, PropQueryTime, null)) + { + continue; + } + + if (propQueryTimeInMillis.TryReadProperty(ref reader, options, PropQueryTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propQueryTotal.TryReadProperty(ref reader, options, PropQueryTotal, null)) + { + continue; + } + + if (propRecentSearchLoad.TryReadProperty(ref reader, options, PropRecentSearchLoad, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propScrollCurrent.TryReadProperty(ref reader, options, PropScrollCurrent, null)) + { + continue; + } + + if (propScrollTime.TryReadProperty(ref reader, options, PropScrollTime, null)) + { + continue; + } + + if (propScrollTimeInMillis.TryReadProperty(ref reader, options, PropScrollTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propScrollTotal.TryReadProperty(ref reader, options, PropScrollTotal, null)) + { + continue; + } + + if (propSuggestCurrent.TryReadProperty(ref reader, options, PropSuggestCurrent, null)) + { + continue; + } + + if (propSuggestTime.TryReadProperty(ref reader, options, PropSuggestTime, null)) + { + continue; + } + + if (propSuggestTimeInMillis.TryReadProperty(ref reader, options, PropSuggestTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propSuggestTotal.TryReadProperty(ref reader, options, PropSuggestTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FetchCurrent = propFetchCurrent.Value, + FetchTime = propFetchTime.Value, + FetchTimeInMillis = propFetchTimeInMillis.Value, + FetchTotal = propFetchTotal.Value, + Groups = propGroups.Value, + OpenContexts = propOpenContexts.Value, + QueryCurrent = propQueryCurrent.Value, + QueryTime = propQueryTime.Value, + QueryTimeInMillis = propQueryTimeInMillis.Value, + QueryTotal = propQueryTotal.Value, + RecentSearchLoad = propRecentSearchLoad.Value, + ScrollCurrent = propScrollCurrent.Value, + ScrollTime = propScrollTime.Value, + ScrollTimeInMillis = propScrollTimeInMillis.Value, + ScrollTotal = propScrollTotal.Value, + SuggestCurrent = propSuggestCurrent.Value, + SuggestTime = propSuggestTime.Value, + SuggestTimeInMillis = propSuggestTimeInMillis.Value, + SuggestTotal = propSuggestTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFetchCurrent, value.FetchCurrent, null, null); + writer.WriteProperty(options, PropFetchTime, value.FetchTime, null, null); + writer.WriteProperty(options, PropFetchTimeInMillis, value.FetchTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropFetchTotal, value.FetchTotal, null, null); + writer.WriteProperty(options, PropGroups, value.Groups, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropOpenContexts, value.OpenContexts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropQueryCurrent, value.QueryCurrent, null, null); + writer.WriteProperty(options, PropQueryTime, value.QueryTime, null, null); + writer.WriteProperty(options, PropQueryTimeInMillis, value.QueryTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropQueryTotal, value.QueryTotal, null, null); + writer.WriteProperty(options, PropRecentSearchLoad, value.RecentSearchLoad, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropScrollCurrent, value.ScrollCurrent, null, null); + writer.WriteProperty(options, PropScrollTime, value.ScrollTime, null, null); + writer.WriteProperty(options, PropScrollTimeInMillis, value.ScrollTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropScrollTotal, value.ScrollTotal, null, null); + writer.WriteProperty(options, PropSuggestCurrent, value.SuggestCurrent, null, null); + writer.WriteProperty(options, PropSuggestTime, value.SuggestTime, null, null); + writer.WriteProperty(options, PropSuggestTimeInMillis, value.SuggestTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropSuggestTotal, value.SuggestTotal, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchStats.g.cs index 87d270cf56a..d301e6309a2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchStats.g.cs @@ -23,208 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class SearchStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFetchCurrent = System.Text.Json.JsonEncodedText.Encode("fetch_current"); - private static readonly System.Text.Json.JsonEncodedText PropFetchTime = System.Text.Json.JsonEncodedText.Encode("fetch_time"); - private static readonly System.Text.Json.JsonEncodedText PropFetchTimeInMillis = System.Text.Json.JsonEncodedText.Encode("fetch_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropFetchTotal = System.Text.Json.JsonEncodedText.Encode("fetch_total"); - private static readonly System.Text.Json.JsonEncodedText PropGroups = System.Text.Json.JsonEncodedText.Encode("groups"); - private static readonly System.Text.Json.JsonEncodedText PropOpenContexts = System.Text.Json.JsonEncodedText.Encode("open_contexts"); - private static readonly System.Text.Json.JsonEncodedText PropQueryCurrent = System.Text.Json.JsonEncodedText.Encode("query_current"); - private static readonly System.Text.Json.JsonEncodedText PropQueryTime = System.Text.Json.JsonEncodedText.Encode("query_time"); - private static readonly System.Text.Json.JsonEncodedText PropQueryTimeInMillis = System.Text.Json.JsonEncodedText.Encode("query_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropQueryTotal = System.Text.Json.JsonEncodedText.Encode("query_total"); - private static readonly System.Text.Json.JsonEncodedText PropRecentSearchLoad = System.Text.Json.JsonEncodedText.Encode("recent_search_load"); - private static readonly System.Text.Json.JsonEncodedText PropScrollCurrent = System.Text.Json.JsonEncodedText.Encode("scroll_current"); - private static readonly System.Text.Json.JsonEncodedText PropScrollTime = System.Text.Json.JsonEncodedText.Encode("scroll_time"); - private static readonly System.Text.Json.JsonEncodedText PropScrollTimeInMillis = System.Text.Json.JsonEncodedText.Encode("scroll_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropScrollTotal = System.Text.Json.JsonEncodedText.Encode("scroll_total"); - private static readonly System.Text.Json.JsonEncodedText PropSuggestCurrent = System.Text.Json.JsonEncodedText.Encode("suggest_current"); - private static readonly System.Text.Json.JsonEncodedText PropSuggestTime = System.Text.Json.JsonEncodedText.Encode("suggest_time"); - private static readonly System.Text.Json.JsonEncodedText PropSuggestTimeInMillis = System.Text.Json.JsonEncodedText.Encode("suggest_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropSuggestTotal = System.Text.Json.JsonEncodedText.Encode("suggest_total"); - - public override Elastic.Clients.Elasticsearch.SearchStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFetchCurrent = default; - LocalJsonValue propFetchTime = default; - LocalJsonValue propFetchTimeInMillis = default; - LocalJsonValue propFetchTotal = default; - LocalJsonValue?> propGroups = default; - LocalJsonValue propOpenContexts = default; - LocalJsonValue propQueryCurrent = default; - LocalJsonValue propQueryTime = default; - LocalJsonValue propQueryTimeInMillis = default; - LocalJsonValue propQueryTotal = default; - LocalJsonValue propRecentSearchLoad = default; - LocalJsonValue propScrollCurrent = default; - LocalJsonValue propScrollTime = default; - LocalJsonValue propScrollTimeInMillis = default; - LocalJsonValue propScrollTotal = default; - LocalJsonValue propSuggestCurrent = default; - LocalJsonValue propSuggestTime = default; - LocalJsonValue propSuggestTimeInMillis = default; - LocalJsonValue propSuggestTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFetchCurrent.TryReadProperty(ref reader, options, PropFetchCurrent, null)) - { - continue; - } - - if (propFetchTime.TryReadProperty(ref reader, options, PropFetchTime, null)) - { - continue; - } - - if (propFetchTimeInMillis.TryReadProperty(ref reader, options, PropFetchTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propFetchTotal.TryReadProperty(ref reader, options, PropFetchTotal, null)) - { - continue; - } - - if (propGroups.TryReadProperty(ref reader, options, PropGroups, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propOpenContexts.TryReadProperty(ref reader, options, PropOpenContexts, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propQueryCurrent.TryReadProperty(ref reader, options, PropQueryCurrent, null)) - { - continue; - } - - if (propQueryTime.TryReadProperty(ref reader, options, PropQueryTime, null)) - { - continue; - } - - if (propQueryTimeInMillis.TryReadProperty(ref reader, options, PropQueryTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propQueryTotal.TryReadProperty(ref reader, options, PropQueryTotal, null)) - { - continue; - } - - if (propRecentSearchLoad.TryReadProperty(ref reader, options, PropRecentSearchLoad, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propScrollCurrent.TryReadProperty(ref reader, options, PropScrollCurrent, null)) - { - continue; - } - - if (propScrollTime.TryReadProperty(ref reader, options, PropScrollTime, null)) - { - continue; - } - - if (propScrollTimeInMillis.TryReadProperty(ref reader, options, PropScrollTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propScrollTotal.TryReadProperty(ref reader, options, PropScrollTotal, null)) - { - continue; - } - - if (propSuggestCurrent.TryReadProperty(ref reader, options, PropSuggestCurrent, null)) - { - continue; - } - - if (propSuggestTime.TryReadProperty(ref reader, options, PropSuggestTime, null)) - { - continue; - } - - if (propSuggestTimeInMillis.TryReadProperty(ref reader, options, PropSuggestTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propSuggestTotal.TryReadProperty(ref reader, options, PropSuggestTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FetchCurrent = propFetchCurrent.Value, - FetchTime = propFetchTime.Value, - FetchTimeInMillis = propFetchTimeInMillis.Value, - FetchTotal = propFetchTotal.Value, - Groups = propGroups.Value, - OpenContexts = propOpenContexts.Value, - QueryCurrent = propQueryCurrent.Value, - QueryTime = propQueryTime.Value, - QueryTimeInMillis = propQueryTimeInMillis.Value, - QueryTotal = propQueryTotal.Value, - RecentSearchLoad = propRecentSearchLoad.Value, - ScrollCurrent = propScrollCurrent.Value, - ScrollTime = propScrollTime.Value, - ScrollTimeInMillis = propScrollTimeInMillis.Value, - ScrollTotal = propScrollTotal.Value, - SuggestCurrent = propSuggestCurrent.Value, - SuggestTime = propSuggestTime.Value, - SuggestTimeInMillis = propSuggestTimeInMillis.Value, - SuggestTotal = propSuggestTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFetchCurrent, value.FetchCurrent, null, null); - writer.WriteProperty(options, PropFetchTime, value.FetchTime, null, null); - writer.WriteProperty(options, PropFetchTimeInMillis, value.FetchTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropFetchTotal, value.FetchTotal, null, null); - writer.WriteProperty(options, PropGroups, value.Groups, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropOpenContexts, value.OpenContexts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropQueryCurrent, value.QueryCurrent, null, null); - writer.WriteProperty(options, PropQueryTime, value.QueryTime, null, null); - writer.WriteProperty(options, PropQueryTimeInMillis, value.QueryTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropQueryTotal, value.QueryTotal, null, null); - writer.WriteProperty(options, PropRecentSearchLoad, value.RecentSearchLoad, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropScrollCurrent, value.ScrollCurrent, null, null); - writer.WriteProperty(options, PropScrollTime, value.ScrollTime, null, null); - writer.WriteProperty(options, PropScrollTimeInMillis, value.ScrollTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropScrollTotal, value.ScrollTotal, null, null); - writer.WriteProperty(options, PropSuggestCurrent, value.SuggestCurrent, null, null); - writer.WriteProperty(options, PropSuggestTime, value.SuggestTime, null, null); - writer.WriteProperty(options, PropSuggestTimeInMillis, value.SuggestTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropSuggestTotal, value.SuggestTotal, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.SearchStatsConverter))] public sealed partial class SearchStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchType.Converters.g.cs new file mode 100644 index 00000000000..104f08540f6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchType.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class SearchTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberDfsQueryThenFetch = System.Text.Json.JsonEncodedText.Encode("dfs_query_then_fetch"); + private static readonly System.Text.Json.JsonEncodedText MemberQueryThenFetch = System.Text.Json.JsonEncodedText.Encode("query_then_fetch"); + + public override Elastic.Clients.Elasticsearch.SearchType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberDfsQueryThenFetch)) + { + return Elastic.Clients.Elasticsearch.SearchType.DfsQueryThenFetch; + } + + if (reader.ValueTextEquals(MemberQueryThenFetch)) + { + return Elastic.Clients.Elasticsearch.SearchType.QueryThenFetch; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberDfsQueryThenFetch.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.SearchType.DfsQueryThenFetch; + } + + if (string.Equals(value, MemberQueryThenFetch.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.SearchType.QueryThenFetch; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.SearchType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.SearchType.DfsQueryThenFetch: + writer.WriteStringValue(MemberDfsQueryThenFetch); + break; + case Elastic.Clients.Elasticsearch.SearchType.QueryThenFetch: + writer.WriteStringValue(MemberQueryThenFetch); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.SearchType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.SearchType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchType.g.cs new file mode 100644 index 00000000000..78c26b65efe --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchType.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.SearchTypeConverter))] +public enum SearchType +{ + /// + /// + /// Documents are scored using global term and document frequencies across all shards. This is usually slower but more accurate. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "dfs_query_then_fetch")] + DfsQueryThenFetch, + /// + /// + /// Documents are scored using local term and document frequencies for the shard. This is usually faster but less accurate. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "query_then_fetch")] + QueryThenFetch +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/MountedSnapshot.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/MountedSnapshot.Converters.g.cs new file mode 100644 index 00000000000..5286131f6d0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/MountedSnapshot.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchableSnapshots.Json; + +public sealed partial class MountedSnapshotConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); + private static readonly System.Text.Json.JsonEncodedText PropSnapshot = System.Text.Json.JsonEncodedText.Encode("snapshot"); + + public override Elastic.Clients.Elasticsearch.SearchableSnapshots.MountedSnapshot Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propIndices = default; + LocalJsonValue propShards = default; + LocalJsonValue propSnapshot = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (propSnapshot.TryReadProperty(ref reader, options, PropSnapshot, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchableSnapshots.MountedSnapshot(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Indices = propIndices.Value, + Shards = propShards.Value, + Snapshot = propSnapshot.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchableSnapshots.MountedSnapshot value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteProperty(options, PropSnapshot, value.Snapshot, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/MountedSnapshot.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/MountedSnapshot.g.cs index a511c2063d8..6230b13f927 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/MountedSnapshot.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/MountedSnapshot.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SearchableSnapshots; -internal sealed partial class MountedSnapshotConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); - private static readonly System.Text.Json.JsonEncodedText PropSnapshot = System.Text.Json.JsonEncodedText.Encode("snapshot"); - - public override Elastic.Clients.Elasticsearch.SearchableSnapshots.MountedSnapshot Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propIndices = default; - LocalJsonValue propShards = default; - LocalJsonValue propSnapshot = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (propSnapshot.TryReadProperty(ref reader, options, PropSnapshot, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchableSnapshots.MountedSnapshot(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Indices = propIndices.Value, - Shards = propShards.Value, - Snapshot = propSnapshot.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchableSnapshots.MountedSnapshot value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteProperty(options, PropSnapshot, value.Snapshot, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchableSnapshots.MountedSnapshotConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchableSnapshots.Json.MountedSnapshotConverter))] public sealed partial class MountedSnapshot { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/Node.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/Node.Converters.g.cs new file mode 100644 index 00000000000..019d5a0b64f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/Node.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchableSnapshots.Json; + +public sealed partial class NodeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSharedCache = System.Text.Json.JsonEncodedText.Encode("shared_cache"); + + public override Elastic.Clients.Elasticsearch.SearchableSnapshots.Node Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propSharedCache = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSharedCache.TryReadProperty(ref reader, options, PropSharedCache, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchableSnapshots.Node(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + SharedCache = propSharedCache.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchableSnapshots.Node value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSharedCache, value.SharedCache, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/Node.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/Node.g.cs index 57c379a8934..82c449ba879 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/Node.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/Node.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SearchableSnapshots; -internal sealed partial class NodeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSharedCache = System.Text.Json.JsonEncodedText.Encode("shared_cache"); - - public override Elastic.Clients.Elasticsearch.SearchableSnapshots.Node Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propSharedCache = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSharedCache.TryReadProperty(ref reader, options, PropSharedCache, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchableSnapshots.Node(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - SharedCache = propSharedCache.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchableSnapshots.Node value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSharedCache, value.SharedCache, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchableSnapshots.NodeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchableSnapshots.Json.NodeConverter))] public sealed partial class Node { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/Shared.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/Shared.Converters.g.cs new file mode 100644 index 00000000000..47e26df07c4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/Shared.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchableSnapshots.Json; + +public sealed partial class SharedConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBytesReadInBytes = System.Text.Json.JsonEncodedText.Encode("bytes_read_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropBytesWrittenInBytes = System.Text.Json.JsonEncodedText.Encode("bytes_written_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropEvictions = System.Text.Json.JsonEncodedText.Encode("evictions"); + private static readonly System.Text.Json.JsonEncodedText PropNumRegions = System.Text.Json.JsonEncodedText.Encode("num_regions"); + private static readonly System.Text.Json.JsonEncodedText PropReads = System.Text.Json.JsonEncodedText.Encode("reads"); + private static readonly System.Text.Json.JsonEncodedText PropRegionSizeInBytes = System.Text.Json.JsonEncodedText.Encode("region_size_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropSizeInBytes = System.Text.Json.JsonEncodedText.Encode("size_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropWrites = System.Text.Json.JsonEncodedText.Encode("writes"); + + public override Elastic.Clients.Elasticsearch.SearchableSnapshots.Shared Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBytesReadInBytes = default; + LocalJsonValue propBytesWrittenInBytes = default; + LocalJsonValue propEvictions = default; + LocalJsonValue propNumRegions = default; + LocalJsonValue propReads = default; + LocalJsonValue propRegionSizeInBytes = default; + LocalJsonValue propSizeInBytes = default; + LocalJsonValue propWrites = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBytesReadInBytes.TryReadProperty(ref reader, options, PropBytesReadInBytes, null)) + { + continue; + } + + if (propBytesWrittenInBytes.TryReadProperty(ref reader, options, PropBytesWrittenInBytes, null)) + { + continue; + } + + if (propEvictions.TryReadProperty(ref reader, options, PropEvictions, null)) + { + continue; + } + + if (propNumRegions.TryReadProperty(ref reader, options, PropNumRegions, null)) + { + continue; + } + + if (propReads.TryReadProperty(ref reader, options, PropReads, null)) + { + continue; + } + + if (propRegionSizeInBytes.TryReadProperty(ref reader, options, PropRegionSizeInBytes, null)) + { + continue; + } + + if (propSizeInBytes.TryReadProperty(ref reader, options, PropSizeInBytes, null)) + { + continue; + } + + if (propWrites.TryReadProperty(ref reader, options, PropWrites, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SearchableSnapshots.Shared(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BytesReadInBytes = propBytesReadInBytes.Value, + BytesWrittenInBytes = propBytesWrittenInBytes.Value, + Evictions = propEvictions.Value, + NumRegions = propNumRegions.Value, + Reads = propReads.Value, + RegionSizeInBytes = propRegionSizeInBytes.Value, + SizeInBytes = propSizeInBytes.Value, + Writes = propWrites.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchableSnapshots.Shared value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBytesReadInBytes, value.BytesReadInBytes, null, null); + writer.WriteProperty(options, PropBytesWrittenInBytes, value.BytesWrittenInBytes, null, null); + writer.WriteProperty(options, PropEvictions, value.Evictions, null, null); + writer.WriteProperty(options, PropNumRegions, value.NumRegions, null, null); + writer.WriteProperty(options, PropReads, value.Reads, null, null); + writer.WriteProperty(options, PropRegionSizeInBytes, value.RegionSizeInBytes, null, null); + writer.WriteProperty(options, PropSizeInBytes, value.SizeInBytes, null, null); + writer.WriteProperty(options, PropWrites, value.Writes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/Shared.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/Shared.g.cs index e4c293d10b9..52b26572e61 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/Shared.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/Shared.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SearchableSnapshots; -internal sealed partial class SharedConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBytesReadInBytes = System.Text.Json.JsonEncodedText.Encode("bytes_read_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropBytesWrittenInBytes = System.Text.Json.JsonEncodedText.Encode("bytes_written_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropEvictions = System.Text.Json.JsonEncodedText.Encode("evictions"); - private static readonly System.Text.Json.JsonEncodedText PropNumRegions = System.Text.Json.JsonEncodedText.Encode("num_regions"); - private static readonly System.Text.Json.JsonEncodedText PropReads = System.Text.Json.JsonEncodedText.Encode("reads"); - private static readonly System.Text.Json.JsonEncodedText PropRegionSizeInBytes = System.Text.Json.JsonEncodedText.Encode("region_size_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropSizeInBytes = System.Text.Json.JsonEncodedText.Encode("size_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropWrites = System.Text.Json.JsonEncodedText.Encode("writes"); - - public override Elastic.Clients.Elasticsearch.SearchableSnapshots.Shared Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBytesReadInBytes = default; - LocalJsonValue propBytesWrittenInBytes = default; - LocalJsonValue propEvictions = default; - LocalJsonValue propNumRegions = default; - LocalJsonValue propReads = default; - LocalJsonValue propRegionSizeInBytes = default; - LocalJsonValue propSizeInBytes = default; - LocalJsonValue propWrites = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBytesReadInBytes.TryReadProperty(ref reader, options, PropBytesReadInBytes, null)) - { - continue; - } - - if (propBytesWrittenInBytes.TryReadProperty(ref reader, options, PropBytesWrittenInBytes, null)) - { - continue; - } - - if (propEvictions.TryReadProperty(ref reader, options, PropEvictions, null)) - { - continue; - } - - if (propNumRegions.TryReadProperty(ref reader, options, PropNumRegions, null)) - { - continue; - } - - if (propReads.TryReadProperty(ref reader, options, PropReads, null)) - { - continue; - } - - if (propRegionSizeInBytes.TryReadProperty(ref reader, options, PropRegionSizeInBytes, null)) - { - continue; - } - - if (propSizeInBytes.TryReadProperty(ref reader, options, PropSizeInBytes, null)) - { - continue; - } - - if (propWrites.TryReadProperty(ref reader, options, PropWrites, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SearchableSnapshots.Shared(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BytesReadInBytes = propBytesReadInBytes.Value, - BytesWrittenInBytes = propBytesWrittenInBytes.Value, - Evictions = propEvictions.Value, - NumRegions = propNumRegions.Value, - Reads = propReads.Value, - RegionSizeInBytes = propRegionSizeInBytes.Value, - SizeInBytes = propSizeInBytes.Value, - Writes = propWrites.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SearchableSnapshots.Shared value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBytesReadInBytes, value.BytesReadInBytes, null, null); - writer.WriteProperty(options, PropBytesWrittenInBytes, value.BytesWrittenInBytes, null, null); - writer.WriteProperty(options, PropEvictions, value.Evictions, null, null); - writer.WriteProperty(options, PropNumRegions, value.NumRegions, null, null); - writer.WriteProperty(options, PropReads, value.Reads, null, null); - writer.WriteProperty(options, PropRegionSizeInBytes, value.RegionSizeInBytes, null, null); - writer.WriteProperty(options, PropSizeInBytes, value.SizeInBytes, null, null); - writer.WriteProperty(options, PropWrites, value.Writes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchableSnapshots.SharedConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchableSnapshots.Json.SharedConverter))] public sealed partial class Shared { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.SearchableSnapshots.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/StatsLevel.Converters.g.cs similarity index 87% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.SearchableSnapshots.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/StatsLevel.Converters.g.cs index fc12f17cf13..c0c0471fa2d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.SearchableSnapshots.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/StatsLevel.Converters.g.cs @@ -21,9 +21,9 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.SearchableSnapshots; +namespace Elastic.Clients.Elasticsearch.SearchableSnapshots.Json; -internal sealed partial class StatsLevelConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class StatsLevelConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText MemberCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); private static readonly System.Text.Json.JsonEncodedText MemberIndices = System.Text.Json.JsonEncodedText.Encode("indices"); @@ -92,15 +92,4 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, { Write(writer, value, options); } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchableSnapshots.StatsLevelConverter))] -public enum StatsLevel -{ - [System.Runtime.Serialization.EnumMember(Value = "cluster")] - Cluster, - [System.Runtime.Serialization.EnumMember(Value = "indices")] - Indices, - [System.Runtime.Serialization.EnumMember(Value = "shards")] - Shards } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/StatsLevel.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/StatsLevel.g.cs new file mode 100644 index 00000000000..7481c0b0c1d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SearchableSnapshots/StatsLevel.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SearchableSnapshots; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SearchableSnapshots.Json.StatsLevelConverter))] +public enum StatsLevel +{ + [System.Runtime.Serialization.EnumMember(Value = "cluster")] + Cluster, + [System.Runtime.Serialization.EnumMember(Value = "indices")] + Indices, + [System.Runtime.Serialization.EnumMember(Value = "shards")] + Shards +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Access.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Access.Converters.g.cs new file mode 100644 index 00000000000..489f6b86c0c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Access.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class AccessConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropReplication = System.Text.Json.JsonEncodedText.Encode("replication"); + private static readonly System.Text.Json.JsonEncodedText PropSearch = System.Text.Json.JsonEncodedText.Encode("search"); + + public override Elastic.Clients.Elasticsearch.Security.Access Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propReplication = default; + LocalJsonValue?> propSearch = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propReplication.TryReadProperty(ref reader, options, PropReplication, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propSearch.TryReadProperty(ref reader, options, PropSearch, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.Access(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Replication = propReplication.Value, + Search = propSearch.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.Access value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropReplication, value.Replication, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSearch, value.Search, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Access.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Access.g.cs index ca774fa543a..ea057073111 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Access.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Access.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class AccessConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropReplication = System.Text.Json.JsonEncodedText.Encode("replication"); - private static readonly System.Text.Json.JsonEncodedText PropSearch = System.Text.Json.JsonEncodedText.Encode("search"); - - public override Elastic.Clients.Elasticsearch.Security.Access Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propReplication = default; - LocalJsonValue?> propSearch = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propReplication.TryReadProperty(ref reader, options, PropReplication, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propSearch.TryReadProperty(ref reader, options, PropSearch, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.Access(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Replication = propReplication.Value, - Search = propSearch.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.Access value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropReplication, value.Replication, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSearch, value.Search, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.AccessConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.AccessConverter))] public sealed partial class Access { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AccessTokenGrantType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AccessTokenGrantType.Converters.g.cs new file mode 100644 index 00000000000..8c669056701 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AccessTokenGrantType.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class AccessTokenGrantTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberKerberos = System.Text.Json.JsonEncodedText.Encode("_kerberos"); + private static readonly System.Text.Json.JsonEncodedText MemberClientCredentials = System.Text.Json.JsonEncodedText.Encode("client_credentials"); + private static readonly System.Text.Json.JsonEncodedText MemberPassword = System.Text.Json.JsonEncodedText.Encode("password"); + private static readonly System.Text.Json.JsonEncodedText MemberRefreshToken = System.Text.Json.JsonEncodedText.Encode("refresh_token"); + + public override Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberKerberos)) + { + return Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType.Kerberos; + } + + if (reader.ValueTextEquals(MemberClientCredentials)) + { + return Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType.ClientCredentials; + } + + if (reader.ValueTextEquals(MemberPassword)) + { + return Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType.Password; + } + + if (reader.ValueTextEquals(MemberRefreshToken)) + { + return Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType.RefreshToken; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberKerberos.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType.Kerberos; + } + + if (string.Equals(value, MemberClientCredentials.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType.ClientCredentials; + } + + if (string.Equals(value, MemberPassword.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType.Password; + } + + if (string.Equals(value, MemberRefreshToken.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType.RefreshToken; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType.Kerberos: + writer.WriteStringValue(MemberKerberos); + break; + case Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType.ClientCredentials: + writer.WriteStringValue(MemberClientCredentials); + break; + case Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType.Password: + writer.WriteStringValue(MemberPassword); + break; + case Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType.RefreshToken: + writer.WriteStringValue(MemberRefreshToken); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.AccessTokenGrantType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AccessTokenGrantType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AccessTokenGrantType.g.cs new file mode 100644 index 00000000000..fd75133f7b4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AccessTokenGrantType.g.cs @@ -0,0 +1,65 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.AccessTokenGrantTypeConverter))] +public enum AccessTokenGrantType +{ + /// + /// + /// This grant type is supported internally and implements SPNEGO based Kerberos support. + /// The _kerberos grant type may change from version to version. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "_kerberos")] + Kerberos, + /// + /// + /// This grant type implements the Client Credentials Grant of OAuth2. + /// It is geared for machine to machine communication and is not suitable or designed for the self-service user creation of tokens. + /// It generates only access tokens that cannot be refreshed. + /// The premise is that the entity that uses client_credentials has constant access to a set of (client, not end-user) credentials and can authenticate itself at will. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "client_credentials")] + ClientCredentials, + /// + /// + /// This grant type implements the Resource Owner Password Credentials Grant of OAuth2. + /// In this grant, a trusted client exchanges the end user's credentials for an access token and (possibly) a refresh token. + /// The request needs to be made by an authenticated user but happens on behalf of another authenticated user (the one whose credentials are passed as request parameters). + /// This grant type is not suitable or designed for the self-service user creation of tokens. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "password")] + Password, + /// + /// + /// This grant type implements the Refresh Token Grant of OAuth2. + /// In this grant a user exchanges a previously issued refresh token for a new access token and a new refresh token. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "refresh_token")] + RefreshToken +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKey.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKey.Converters.g.cs new file mode 100644 index 00000000000..55d36a39fed --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKey.Converters.g.cs @@ -0,0 +1,198 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ApiKeyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAccess = System.Text.Json.JsonEncodedText.Encode("access"); + private static readonly System.Text.Json.JsonEncodedText PropCreation = System.Text.Json.JsonEncodedText.Encode("creation"); + private static readonly System.Text.Json.JsonEncodedText PropExpiration = System.Text.Json.JsonEncodedText.Encode("expiration"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropInvalidated = System.Text.Json.JsonEncodedText.Encode("invalidated"); + private static readonly System.Text.Json.JsonEncodedText PropInvalidation = System.Text.Json.JsonEncodedText.Encode("invalidation"); + private static readonly System.Text.Json.JsonEncodedText PropLimitedBy = System.Text.Json.JsonEncodedText.Encode("limited_by"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropProfileUid = System.Text.Json.JsonEncodedText.Encode("profile_uid"); + private static readonly System.Text.Json.JsonEncodedText PropRealm = System.Text.Json.JsonEncodedText.Encode("realm"); + private static readonly System.Text.Json.JsonEncodedText PropRealmType = System.Text.Json.JsonEncodedText.Encode("realm_type"); + private static readonly System.Text.Json.JsonEncodedText PropRoleDescriptors = System.Text.Json.JsonEncodedText.Encode("role_descriptors"); + private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("_sort"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); + + public override Elastic.Clients.Elasticsearch.Security.ApiKey Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAccess = default; + LocalJsonValue propCreation = default; + LocalJsonValue propExpiration = default; + LocalJsonValue propId = default; + LocalJsonValue propInvalidated = default; + LocalJsonValue propInvalidation = default; + LocalJsonValue>?> propLimitedBy = default; + LocalJsonValue> propMetadata = default; + LocalJsonValue propName = default; + LocalJsonValue propProfileUid = default; + LocalJsonValue propRealm = default; + LocalJsonValue propRealmType = default; + LocalJsonValue?> propRoleDescriptors = default; + LocalJsonValue?> propSort = default; + LocalJsonValue propType = default; + LocalJsonValue propUsername = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAccess.TryReadProperty(ref reader, options, PropAccess, null)) + { + continue; + } + + if (propCreation.TryReadProperty(ref reader, options, PropCreation, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propExpiration.TryReadProperty(ref reader, options, PropExpiration, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propInvalidated.TryReadProperty(ref reader, options, PropInvalidated, null)) + { + continue; + } + + if (propInvalidation.TryReadProperty(ref reader, options, PropInvalidation, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propLimitedBy.TryReadProperty(ref reader, options, PropLimitedBy, static System.Collections.Generic.IReadOnlyCollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!))) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propProfileUid.TryReadProperty(ref reader, options, PropProfileUid, null)) + { + continue; + } + + if (propRealm.TryReadProperty(ref reader, options, PropRealm, null)) + { + continue; + } + + if (propRealmType.TryReadProperty(ref reader, options, PropRealmType, null)) + { + continue; + } + + if (propRoleDescriptors.TryReadProperty(ref reader, options, PropRoleDescriptors, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.ApiKey(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Access = propAccess.Value, + Creation = propCreation.Value, + Expiration = propExpiration.Value, + Id = propId.Value, + Invalidated = propInvalidated.Value, + Invalidation = propInvalidation.Value, + LimitedBy = propLimitedBy.Value, + Metadata = propMetadata.Value, + Name = propName.Value, + ProfileUid = propProfileUid.Value, + Realm = propRealm.Value, + RealmType = propRealmType.Value, + RoleDescriptors = propRoleDescriptors.Value, + Sort = propSort.Value, + Type = propType.Value, + Username = propUsername.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ApiKey value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAccess, value.Access, null, null); + writer.WriteProperty(options, PropCreation, value.Creation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropExpiration, value.Expiration, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropInvalidated, value.Invalidated, null, null); + writer.WriteProperty(options, PropInvalidation, value.Invalidation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropLimitedBy, value.LimitedBy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection>? v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null))); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropProfileUid, value.ProfileUid, null, null); + writer.WriteProperty(options, PropRealm, value.Realm, null, null); + writer.WriteProperty(options, PropRealmType, value.RealmType, null, null); + writer.WriteProperty(options, PropRoleDescriptors, value.RoleDescriptors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropUsername, value.Username, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKey.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKey.g.cs index ad2ef9b186e..84c94412c42 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKey.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKey.g.cs @@ -23,181 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class ApiKeyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAccess = System.Text.Json.JsonEncodedText.Encode("access"); - private static readonly System.Text.Json.JsonEncodedText PropCreation = System.Text.Json.JsonEncodedText.Encode("creation"); - private static readonly System.Text.Json.JsonEncodedText PropExpiration = System.Text.Json.JsonEncodedText.Encode("expiration"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropInvalidated = System.Text.Json.JsonEncodedText.Encode("invalidated"); - private static readonly System.Text.Json.JsonEncodedText PropInvalidation = System.Text.Json.JsonEncodedText.Encode("invalidation"); - private static readonly System.Text.Json.JsonEncodedText PropLimitedBy = System.Text.Json.JsonEncodedText.Encode("limited_by"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropProfileUid = System.Text.Json.JsonEncodedText.Encode("profile_uid"); - private static readonly System.Text.Json.JsonEncodedText PropRealm = System.Text.Json.JsonEncodedText.Encode("realm"); - private static readonly System.Text.Json.JsonEncodedText PropRealmType = System.Text.Json.JsonEncodedText.Encode("realm_type"); - private static readonly System.Text.Json.JsonEncodedText PropRoleDescriptors = System.Text.Json.JsonEncodedText.Encode("role_descriptors"); - private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("_sort"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); - - public override Elastic.Clients.Elasticsearch.Security.ApiKey Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAccess = default; - LocalJsonValue propCreation = default; - LocalJsonValue propExpiration = default; - LocalJsonValue propId = default; - LocalJsonValue propInvalidated = default; - LocalJsonValue propInvalidation = default; - LocalJsonValue>?> propLimitedBy = default; - LocalJsonValue> propMetadata = default; - LocalJsonValue propName = default; - LocalJsonValue propProfileUid = default; - LocalJsonValue propRealm = default; - LocalJsonValue propRealmType = default; - LocalJsonValue?> propRoleDescriptors = default; - LocalJsonValue?> propSort = default; - LocalJsonValue propType = default; - LocalJsonValue propUsername = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAccess.TryReadProperty(ref reader, options, PropAccess, null)) - { - continue; - } - - if (propCreation.TryReadProperty(ref reader, options, PropCreation, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propExpiration.TryReadProperty(ref reader, options, PropExpiration, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propInvalidated.TryReadProperty(ref reader, options, PropInvalidated, null)) - { - continue; - } - - if (propInvalidation.TryReadProperty(ref reader, options, PropInvalidation, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propLimitedBy.TryReadProperty(ref reader, options, PropLimitedBy, static System.Collections.Generic.IReadOnlyCollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!))) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propProfileUid.TryReadProperty(ref reader, options, PropProfileUid, null)) - { - continue; - } - - if (propRealm.TryReadProperty(ref reader, options, PropRealm, null)) - { - continue; - } - - if (propRealmType.TryReadProperty(ref reader, options, PropRealmType, null)) - { - continue; - } - - if (propRoleDescriptors.TryReadProperty(ref reader, options, PropRoleDescriptors, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.ApiKey(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Access = propAccess.Value, - Creation = propCreation.Value, - Expiration = propExpiration.Value, - Id = propId.Value, - Invalidated = propInvalidated.Value, - Invalidation = propInvalidation.Value, - LimitedBy = propLimitedBy.Value, - Metadata = propMetadata.Value, - Name = propName.Value, - ProfileUid = propProfileUid.Value, - Realm = propRealm.Value, - RealmType = propRealmType.Value, - RoleDescriptors = propRoleDescriptors.Value, - Sort = propSort.Value, - Type = propType.Value, - Username = propUsername.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ApiKey value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAccess, value.Access, null, null); - writer.WriteProperty(options, PropCreation, value.Creation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropExpiration, value.Expiration, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropInvalidated, value.Invalidated, null, null); - writer.WriteProperty(options, PropInvalidation, value.Invalidation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropLimitedBy, value.LimitedBy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection>? v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null))); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropProfileUid, value.ProfileUid, null, null); - writer.WriteProperty(options, PropRealm, value.Realm, null, null); - writer.WriteProperty(options, PropRealmType, value.RealmType, null, null); - writer.WriteProperty(options, PropRoleDescriptors, value.RoleDescriptors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropUsername, value.Username, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ApiKeyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ApiKeyConverter))] public sealed partial class ApiKey { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyAggregation.Converters.g.cs new file mode 100644 index 00000000000..c65f0ea8ddb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyAggregation.Converters.g.cs @@ -0,0 +1,193 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ApiKeyAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + 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 PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText VariantCardinality = System.Text.Json.JsonEncodedText.Encode("cardinality"); + private static readonly System.Text.Json.JsonEncodedText VariantComposite = System.Text.Json.JsonEncodedText.Encode("composite"); + private static readonly System.Text.Json.JsonEncodedText VariantDateRange = System.Text.Json.JsonEncodedText.Encode("date_range"); + private static readonly System.Text.Json.JsonEncodedText VariantFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText VariantFilters = System.Text.Json.JsonEncodedText.Encode("filters"); + private static readonly System.Text.Json.JsonEncodedText VariantMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText VariantRange = System.Text.Json.JsonEncodedText.Encode("range"); + private static readonly System.Text.Json.JsonEncodedText VariantTerms = System.Text.Json.JsonEncodedText.Encode("terms"); + private static readonly System.Text.Json.JsonEncodedText VariantValueCount = System.Text.Json.JsonEncodedText.Encode("value_count"); + + public override Elastic.Clients.Elasticsearch.Security.ApiKeyAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAggregations = default; + LocalJsonValue?> propMeta = default; + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)) || propAggregations.TryReadProperty(ref reader, options, PropAggregations1, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (reader.ValueTextEquals(VariantCardinality)) + { + variantType = VariantCardinality.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantComposite)) + { + variantType = VariantComposite.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantDateRange)) + { + variantType = VariantDateRange.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantFilter)) + { + variantType = VariantFilter.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantFilters)) + { + variantType = VariantFilters.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMissing)) + { + variantType = VariantMissing.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRange)) + { + variantType = VariantRange.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTerms)) + { + variantType = VariantTerms.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantValueCount)) + { + variantType = VariantValueCount.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.ApiKeyAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant, + Aggregations = propAggregations.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ApiKeyAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "cardinality": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregation)value.Variant, null, null); + break; + case "composite": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregation)value.Variant, null, null); + break; + case "date_range": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregation)value.Variant, null, null); + break; + case "filter": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Security.ApiKeyQuery)value.Variant, null, null); + break; + case "filters": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Security.ApiKeyFiltersAggregation)value.Variant, null, null); + break; + case "missing": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.MissingAggregation)value.Variant, null, null); + break; + case "range": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.RangeAggregation)value.Variant, null, null); + break; + case "terms": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.TermsAggregation)value.Variant, null, null); + break; + case "value_count": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregation)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Security.ApiKeyAggregation)}'."); + } + + writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyAggregation.g.cs index a35712909ad..538953d9235 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyAggregation.g.cs @@ -23,176 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class ApiKeyAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - 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 PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); - private static readonly System.Text.Json.JsonEncodedText VariantCardinality = System.Text.Json.JsonEncodedText.Encode("cardinality"); - private static readonly System.Text.Json.JsonEncodedText VariantComposite = System.Text.Json.JsonEncodedText.Encode("composite"); - private static readonly System.Text.Json.JsonEncodedText VariantDateRange = System.Text.Json.JsonEncodedText.Encode("date_range"); - private static readonly System.Text.Json.JsonEncodedText VariantFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText VariantFilters = System.Text.Json.JsonEncodedText.Encode("filters"); - private static readonly System.Text.Json.JsonEncodedText VariantMissing = System.Text.Json.JsonEncodedText.Encode("missing"); - private static readonly System.Text.Json.JsonEncodedText VariantRange = System.Text.Json.JsonEncodedText.Encode("range"); - private static readonly System.Text.Json.JsonEncodedText VariantTerms = System.Text.Json.JsonEncodedText.Encode("terms"); - private static readonly System.Text.Json.JsonEncodedText VariantValueCount = System.Text.Json.JsonEncodedText.Encode("value_count"); - - public override Elastic.Clients.Elasticsearch.Security.ApiKeyAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAggregations = default; - LocalJsonValue?> propMeta = default; - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)) || propAggregations.TryReadProperty(ref reader, options, PropAggregations1, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (reader.ValueTextEquals(VariantCardinality)) - { - variantType = VariantCardinality.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantComposite)) - { - variantType = VariantComposite.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantDateRange)) - { - variantType = VariantDateRange.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantFilter)) - { - variantType = VariantFilter.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantFilters)) - { - variantType = VariantFilters.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMissing)) - { - variantType = VariantMissing.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRange)) - { - variantType = VariantRange.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTerms)) - { - variantType = VariantTerms.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantValueCount)) - { - variantType = VariantValueCount.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.ApiKeyAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant, - Aggregations = propAggregations.Value, - Meta = propMeta.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ApiKeyAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "cardinality": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregation)value.Variant, null, null); - break; - case "composite": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregation)value.Variant, null, null); - break; - case "date_range": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.DateRangeAggregation)value.Variant, null, null); - break; - case "filter": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Security.ApiKeyQuery)value.Variant, null, null); - break; - case "filters": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Security.ApiKeyFiltersAggregation)value.Variant, null, null); - break; - case "missing": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.MissingAggregation)value.Variant, null, null); - break; - case "range": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.RangeAggregation)value.Variant, null, null); - break; - case "terms": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.TermsAggregation)value.Variant, null, null); - break; - case "value_count": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.ValueCountAggregation)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Security.ApiKeyAggregation)}'."); - } - - writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ApiKeyAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ApiKeyAggregationConverter))] public sealed partial class ApiKeyAggregation { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyFiltersAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyFiltersAggregation.Converters.g.cs new file mode 100644 index 00000000000..8ab461b2d72 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyFiltersAggregation.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ApiKeyFiltersAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFilters = System.Text.Json.JsonEncodedText.Encode("filters"); + private static readonly System.Text.Json.JsonEncodedText PropKeyed = System.Text.Json.JsonEncodedText.Encode("keyed"); + private static readonly System.Text.Json.JsonEncodedText PropOtherBucket = System.Text.Json.JsonEncodedText.Encode("other_bucket"); + private static readonly System.Text.Json.JsonEncodedText PropOtherBucketKey = System.Text.Json.JsonEncodedText.Encode("other_bucket_key"); + + public override Elastic.Clients.Elasticsearch.Security.ApiKeyFiltersAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propFilters = default; + LocalJsonValue propKeyed = default; + LocalJsonValue propOtherBucket = default; + LocalJsonValue propOtherBucketKey = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFilters.TryReadProperty(ref reader, options, PropFilters, null)) + { + continue; + } + + if (propKeyed.TryReadProperty(ref reader, options, PropKeyed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOtherBucket.TryReadProperty(ref reader, options, PropOtherBucket, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOtherBucketKey.TryReadProperty(ref reader, options, PropOtherBucketKey, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.ApiKeyFiltersAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Filters = propFilters.Value, + Keyed = propKeyed.Value, + OtherBucket = propOtherBucket.Value, + OtherBucketKey = propOtherBucketKey.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ApiKeyFiltersAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFilters, value.Filters, null, null); + writer.WriteProperty(options, PropKeyed, value.Keyed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOtherBucket, value.OtherBucket, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOtherBucketKey, value.OtherBucketKey, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyFiltersAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyFiltersAggregation.g.cs index de4f121fb88..be7cbe4cf3b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyFiltersAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyFiltersAggregation.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class ApiKeyFiltersAggregationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFilters = System.Text.Json.JsonEncodedText.Encode("filters"); - private static readonly System.Text.Json.JsonEncodedText PropKeyed = System.Text.Json.JsonEncodedText.Encode("keyed"); - private static readonly System.Text.Json.JsonEncodedText PropOtherBucket = System.Text.Json.JsonEncodedText.Encode("other_bucket"); - private static readonly System.Text.Json.JsonEncodedText PropOtherBucketKey = System.Text.Json.JsonEncodedText.Encode("other_bucket_key"); - - public override Elastic.Clients.Elasticsearch.Security.ApiKeyFiltersAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propFilters = default; - LocalJsonValue propKeyed = default; - LocalJsonValue propOtherBucket = default; - LocalJsonValue propOtherBucketKey = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFilters.TryReadProperty(ref reader, options, PropFilters, null)) - { - continue; - } - - if (propKeyed.TryReadProperty(ref reader, options, PropKeyed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOtherBucket.TryReadProperty(ref reader, options, PropOtherBucket, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOtherBucketKey.TryReadProperty(ref reader, options, PropOtherBucketKey, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.ApiKeyFiltersAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Filters = propFilters.Value, - Keyed = propKeyed.Value, - OtherBucket = propOtherBucket.Value, - OtherBucketKey = propOtherBucketKey.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ApiKeyFiltersAggregation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFilters, value.Filters, null, null); - writer.WriteProperty(options, PropKeyed, value.Keyed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOtherBucket, value.OtherBucket, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOtherBucketKey, value.OtherBucketKey, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ApiKeyFiltersAggregationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ApiKeyFiltersAggregationConverter))] public sealed partial class ApiKeyFiltersAggregation { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyGrantType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyGrantType.Converters.g.cs new file mode 100644 index 00000000000..28e39f8bd5c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyGrantType.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ApiKeyGrantTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAccessToken = System.Text.Json.JsonEncodedText.Encode("access_token"); + private static readonly System.Text.Json.JsonEncodedText MemberPassword = System.Text.Json.JsonEncodedText.Encode("password"); + + public override Elastic.Clients.Elasticsearch.Security.ApiKeyGrantType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAccessToken)) + { + return Elastic.Clients.Elasticsearch.Security.ApiKeyGrantType.AccessToken; + } + + if (reader.ValueTextEquals(MemberPassword)) + { + return Elastic.Clients.Elasticsearch.Security.ApiKeyGrantType.Password; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAccessToken.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Security.ApiKeyGrantType.AccessToken; + } + + if (string.Equals(value, MemberPassword.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Security.ApiKeyGrantType.Password; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Security.ApiKeyGrantType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ApiKeyGrantType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Security.ApiKeyGrantType.AccessToken: + writer.WriteStringValue(MemberAccessToken); + break; + case Elastic.Clients.Elasticsearch.Security.ApiKeyGrantType.Password: + writer.WriteStringValue(MemberPassword); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Security.ApiKeyGrantType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Security.ApiKeyGrantType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ApiKeyGrantType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyGrantType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyGrantType.g.cs new file mode 100644 index 00000000000..10561dec44a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyGrantType.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ApiKeyGrantTypeConverter))] +public enum ApiKeyGrantType +{ + [System.Runtime.Serialization.EnumMember(Value = "access_token")] + AccessToken, + [System.Runtime.Serialization.EnumMember(Value = "password")] + Password +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyQuery.Converters.g.cs new file mode 100644 index 00000000000..b77cb3d5d6d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyQuery.Converters.g.cs @@ -0,0 +1,198 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ApiKeyQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantBool = System.Text.Json.JsonEncodedText.Encode("bool"); + private static readonly System.Text.Json.JsonEncodedText VariantExists = System.Text.Json.JsonEncodedText.Encode("exists"); + private static readonly System.Text.Json.JsonEncodedText VariantIds = System.Text.Json.JsonEncodedText.Encode("ids"); + private static readonly System.Text.Json.JsonEncodedText VariantMatch = System.Text.Json.JsonEncodedText.Encode("match"); + private static readonly System.Text.Json.JsonEncodedText VariantMatchAll = System.Text.Json.JsonEncodedText.Encode("match_all"); + private static readonly System.Text.Json.JsonEncodedText VariantPrefix = System.Text.Json.JsonEncodedText.Encode("prefix"); + private static readonly System.Text.Json.JsonEncodedText VariantRange = System.Text.Json.JsonEncodedText.Encode("range"); + private static readonly System.Text.Json.JsonEncodedText VariantSimpleQueryString = System.Text.Json.JsonEncodedText.Encode("simple_query_string"); + private static readonly System.Text.Json.JsonEncodedText VariantTerm = System.Text.Json.JsonEncodedText.Encode("term"); + private static readonly System.Text.Json.JsonEncodedText VariantTerms = System.Text.Json.JsonEncodedText.Encode("terms"); + private static readonly System.Text.Json.JsonEncodedText VariantWildcard = System.Text.Json.JsonEncodedText.Encode("wildcard"); + + public override Elastic.Clients.Elasticsearch.Security.ApiKeyQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantBool)) + { + variantType = VariantBool.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantExists)) + { + variantType = VariantExists.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantIds)) + { + variantType = VariantIds.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMatch)) + { + variantType = VariantMatch.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMatchAll)) + { + variantType = VariantMatchAll.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantPrefix)) + { + variantType = VariantPrefix.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRange)) + { + variantType = VariantRange.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSimpleQueryString)) + { + variantType = VariantSimpleQueryString.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTerm)) + { + variantType = VariantTerm.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTerms)) + { + variantType = VariantTerms.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantWildcard)) + { + variantType = VariantWildcard.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.ApiKeyQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ApiKeyQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "bool": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.BoolQuery)value.Variant, null, null); + break; + case "exists": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.ExistsQuery)value.Variant, null, null); + break; + case "ids": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IdsQuery)value.Variant, null, null); + break; + case "match": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MatchQuery)value.Variant, null, null); + break; + case "match_all": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MatchAllQuery)value.Variant, null, null); + break; + case "prefix": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.PrefixQuery)value.Variant, null, null); + break; + case "range": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IRangeQuery)value.Variant, null, null); + break; + case "simple_query_string": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringQuery)value.Variant, null, null); + break; + case "term": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.TermQuery)value.Variant, null, null); + break; + case "terms": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.TermsQuery)value.Variant, null, null); + break; + case "wildcard": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.WildcardQuery)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Security.ApiKeyQuery)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyQuery.g.cs index ade74684396..3904bb87a41 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyQuery.g.cs @@ -23,181 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class ApiKeyQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantBool = System.Text.Json.JsonEncodedText.Encode("bool"); - private static readonly System.Text.Json.JsonEncodedText VariantExists = System.Text.Json.JsonEncodedText.Encode("exists"); - private static readonly System.Text.Json.JsonEncodedText VariantIds = System.Text.Json.JsonEncodedText.Encode("ids"); - private static readonly System.Text.Json.JsonEncodedText VariantMatch = System.Text.Json.JsonEncodedText.Encode("match"); - private static readonly System.Text.Json.JsonEncodedText VariantMatchAll = System.Text.Json.JsonEncodedText.Encode("match_all"); - private static readonly System.Text.Json.JsonEncodedText VariantPrefix = System.Text.Json.JsonEncodedText.Encode("prefix"); - private static readonly System.Text.Json.JsonEncodedText VariantRange = System.Text.Json.JsonEncodedText.Encode("range"); - private static readonly System.Text.Json.JsonEncodedText VariantSimpleQueryString = System.Text.Json.JsonEncodedText.Encode("simple_query_string"); - private static readonly System.Text.Json.JsonEncodedText VariantTerm = System.Text.Json.JsonEncodedText.Encode("term"); - private static readonly System.Text.Json.JsonEncodedText VariantTerms = System.Text.Json.JsonEncodedText.Encode("terms"); - private static readonly System.Text.Json.JsonEncodedText VariantWildcard = System.Text.Json.JsonEncodedText.Encode("wildcard"); - - public override Elastic.Clients.Elasticsearch.Security.ApiKeyQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantBool)) - { - variantType = VariantBool.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantExists)) - { - variantType = VariantExists.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantIds)) - { - variantType = VariantIds.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMatch)) - { - variantType = VariantMatch.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMatchAll)) - { - variantType = VariantMatchAll.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantPrefix)) - { - variantType = VariantPrefix.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRange)) - { - variantType = VariantRange.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSimpleQueryString)) - { - variantType = VariantSimpleQueryString.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTerm)) - { - variantType = VariantTerm.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTerms)) - { - variantType = VariantTerms.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantWildcard)) - { - variantType = VariantWildcard.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.ApiKeyQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ApiKeyQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "bool": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.BoolQuery)value.Variant, null, null); - break; - case "exists": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.ExistsQuery)value.Variant, null, null); - break; - case "ids": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IdsQuery)value.Variant, null, null); - break; - case "match": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MatchQuery)value.Variant, null, null); - break; - case "match_all": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MatchAllQuery)value.Variant, null, null); - break; - case "prefix": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.PrefixQuery)value.Variant, null, null); - break; - case "range": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IRangeQuery)value.Variant, null, null); - break; - case "simple_query_string": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringQuery)value.Variant, null, null); - break; - case "term": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.TermQuery)value.Variant, null, null); - break; - case "terms": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.TermsQuery)value.Variant, null, null); - break; - case "wildcard": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.WildcardQuery)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Security.ApiKeyQuery)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ApiKeyQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ApiKeyQueryConverter))] public sealed partial class ApiKeyQuery { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyType.Converters.g.cs new file mode 100644 index 00000000000..430db4a2157 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyType.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ApiKeyTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberCrossCluster = System.Text.Json.JsonEncodedText.Encode("cross_cluster"); + private static readonly System.Text.Json.JsonEncodedText MemberRest = System.Text.Json.JsonEncodedText.Encode("rest"); + + public override Elastic.Clients.Elasticsearch.Security.ApiKeyType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberCrossCluster)) + { + return Elastic.Clients.Elasticsearch.Security.ApiKeyType.CrossCluster; + } + + if (reader.ValueTextEquals(MemberRest)) + { + return Elastic.Clients.Elasticsearch.Security.ApiKeyType.Rest; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberCrossCluster.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Security.ApiKeyType.CrossCluster; + } + + if (string.Equals(value, MemberRest.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Security.ApiKeyType.Rest; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Security.ApiKeyType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ApiKeyType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Security.ApiKeyType.CrossCluster: + writer.WriteStringValue(MemberCrossCluster); + break; + case Elastic.Clients.Elasticsearch.Security.ApiKeyType.Rest: + writer.WriteStringValue(MemberRest); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Security.ApiKeyType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Security.ApiKeyType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ApiKeyType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyType.g.cs new file mode 100644 index 00000000000..47cd731a9f0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyType.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ApiKeyTypeConverter))] +public enum ApiKeyType +{ + [System.Runtime.Serialization.EnumMember(Value = "cross_cluster")] + CrossCluster, + [System.Runtime.Serialization.EnumMember(Value = "rest")] + Rest +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApplicationGlobalUserPrivileges.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApplicationGlobalUserPrivileges.Converters.g.cs new file mode 100644 index 00000000000..ac832526187 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApplicationGlobalUserPrivileges.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ApplicationGlobalUserPrivilegesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropManage = System.Text.Json.JsonEncodedText.Encode("manage"); + + public override Elastic.Clients.Elasticsearch.Security.ApplicationGlobalUserPrivileges Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propManage = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propManage.TryReadProperty(ref reader, options, PropManage, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.ApplicationGlobalUserPrivileges(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Manage = propManage.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ApplicationGlobalUserPrivileges value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropManage, value.Manage, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApplicationGlobalUserPrivileges.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApplicationGlobalUserPrivileges.g.cs index a8d22f6c94b..5865a93be21 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApplicationGlobalUserPrivileges.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApplicationGlobalUserPrivileges.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class ApplicationGlobalUserPrivilegesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropManage = System.Text.Json.JsonEncodedText.Encode("manage"); - - public override Elastic.Clients.Elasticsearch.Security.ApplicationGlobalUserPrivileges Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propManage = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propManage.TryReadProperty(ref reader, options, PropManage, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.ApplicationGlobalUserPrivileges(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Manage = propManage.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ApplicationGlobalUserPrivileges value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropManage, value.Manage, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ApplicationGlobalUserPrivilegesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ApplicationGlobalUserPrivilegesConverter))] public sealed partial class ApplicationGlobalUserPrivileges { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApplicationPrivileges.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApplicationPrivileges.Converters.g.cs new file mode 100644 index 00000000000..410b08d4bed --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApplicationPrivileges.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ApplicationPrivilegesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApplication = System.Text.Json.JsonEncodedText.Encode("application"); + private static readonly System.Text.Json.JsonEncodedText PropPrivileges = System.Text.Json.JsonEncodedText.Encode("privileges"); + private static readonly System.Text.Json.JsonEncodedText PropResources = System.Text.Json.JsonEncodedText.Encode("resources"); + + public override Elastic.Clients.Elasticsearch.Security.ApplicationPrivileges Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApplication = default; + LocalJsonValue> propPrivileges = default; + LocalJsonValue> propResources = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApplication.TryReadProperty(ref reader, options, PropApplication, null)) + { + continue; + } + + if (propPrivileges.TryReadProperty(ref reader, options, PropPrivileges, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propResources.TryReadProperty(ref reader, options, PropResources, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.ApplicationPrivileges(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Application = propApplication.Value, + Privileges = propPrivileges.Value, + Resources = propResources.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ApplicationPrivileges value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApplication, value.Application, null, null); + writer.WriteProperty(options, PropPrivileges, value.Privileges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropResources, value.Resources, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApplicationPrivileges.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApplicationPrivileges.g.cs index 25d66cf282c..f2c3b843bc9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApplicationPrivileges.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApplicationPrivileges.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class ApplicationPrivilegesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApplication = System.Text.Json.JsonEncodedText.Encode("application"); - private static readonly System.Text.Json.JsonEncodedText PropPrivileges = System.Text.Json.JsonEncodedText.Encode("privileges"); - private static readonly System.Text.Json.JsonEncodedText PropResources = System.Text.Json.JsonEncodedText.Encode("resources"); - - public override Elastic.Clients.Elasticsearch.Security.ApplicationPrivileges Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propApplication = default; - LocalJsonValue> propPrivileges = default; - LocalJsonValue> propResources = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApplication.TryReadProperty(ref reader, options, PropApplication, null)) - { - continue; - } - - if (propPrivileges.TryReadProperty(ref reader, options, PropPrivileges, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propResources.TryReadProperty(ref reader, options, PropResources, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.ApplicationPrivileges(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Application = propApplication.Value, - Privileges = propPrivileges.Value, - Resources = propResources.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ApplicationPrivileges value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApplication, value.Application, null, null); - writer.WriteProperty(options, PropPrivileges, value.Privileges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropResources, value.Resources, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ApplicationPrivilegesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ApplicationPrivilegesConverter))] public sealed partial class ApplicationPrivileges { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApplicationPrivilegesCheck.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApplicationPrivilegesCheck.Converters.g.cs new file mode 100644 index 00000000000..3ad43340537 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApplicationPrivilegesCheck.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ApplicationPrivilegesCheckConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApplication = System.Text.Json.JsonEncodedText.Encode("application"); + private static readonly System.Text.Json.JsonEncodedText PropPrivileges = System.Text.Json.JsonEncodedText.Encode("privileges"); + private static readonly System.Text.Json.JsonEncodedText PropResources = System.Text.Json.JsonEncodedText.Encode("resources"); + + public override Elastic.Clients.Elasticsearch.Security.ApplicationPrivilegesCheck Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApplication = default; + LocalJsonValue> propPrivileges = default; + LocalJsonValue> propResources = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApplication.TryReadProperty(ref reader, options, PropApplication, null)) + { + continue; + } + + if (propPrivileges.TryReadProperty(ref reader, options, PropPrivileges, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propResources.TryReadProperty(ref reader, options, PropResources, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.ApplicationPrivilegesCheck(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Application = propApplication.Value, + Privileges = propPrivileges.Value, + Resources = propResources.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ApplicationPrivilegesCheck value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApplication, value.Application, null, null); + writer.WriteProperty(options, PropPrivileges, value.Privileges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropResources, value.Resources, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApplicationPrivilegesCheck.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApplicationPrivilegesCheck.g.cs index 3bfa7fa5acf..08022914aec 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApplicationPrivilegesCheck.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApplicationPrivilegesCheck.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class ApplicationPrivilegesCheckConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApplication = System.Text.Json.JsonEncodedText.Encode("application"); - private static readonly System.Text.Json.JsonEncodedText PropPrivileges = System.Text.Json.JsonEncodedText.Encode("privileges"); - private static readonly System.Text.Json.JsonEncodedText PropResources = System.Text.Json.JsonEncodedText.Encode("resources"); - - public override Elastic.Clients.Elasticsearch.Security.ApplicationPrivilegesCheck Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propApplication = default; - LocalJsonValue> propPrivileges = default; - LocalJsonValue> propResources = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApplication.TryReadProperty(ref reader, options, PropApplication, null)) - { - continue; - } - - if (propPrivileges.TryReadProperty(ref reader, options, PropPrivileges, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propResources.TryReadProperty(ref reader, options, PropResources, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.ApplicationPrivilegesCheck(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Application = propApplication.Value, - Privileges = propPrivileges.Value, - Resources = propResources.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ApplicationPrivilegesCheck value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApplication, value.Application, null, null); - writer.WriteProperty(options, PropPrivileges, value.Privileges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropResources, value.Resources, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ApplicationPrivilegesCheckConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ApplicationPrivilegesCheckConverter))] public sealed partial class ApplicationPrivilegesCheck { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticateApiKey.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticateApiKey.Converters.g.cs new file mode 100644 index 00000000000..269551b051f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticateApiKey.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class AuthenticateApiKeyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.Security.AuthenticateApiKey Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.AuthenticateApiKey(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.AuthenticateApiKey value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticateApiKey.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticateApiKey.g.cs index 3ad51c742d5..bd0f245bbcb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticateApiKey.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticateApiKey.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class AuthenticateApiKeyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.Security.AuthenticateApiKey Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.AuthenticateApiKey(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.AuthenticateApiKey value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.AuthenticateApiKeyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.AuthenticateApiKeyConverter))] public sealed partial class AuthenticateApiKey { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticateToken.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticateToken.Converters.g.cs new file mode 100644 index 00000000000..32672f477e3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticateToken.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class AuthenticateTokenConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Security.AuthenticateToken Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.AuthenticateToken(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.AuthenticateToken value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticateToken.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticateToken.g.cs index 2c0737f7b90..a0f8524bd8d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticateToken.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticateToken.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class AuthenticateTokenConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Security.AuthenticateToken Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.AuthenticateToken(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.AuthenticateToken value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.AuthenticateTokenConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.AuthenticateTokenConverter))] public sealed partial class AuthenticateToken { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticatedUser.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticatedUser.Converters.g.cs new file mode 100644 index 00000000000..6fc14f6cdc5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticatedUser.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class AuthenticatedUserConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAuthenticationProvider = System.Text.Json.JsonEncodedText.Encode("authentication_provider"); + private static readonly System.Text.Json.JsonEncodedText PropAuthenticationRealm = System.Text.Json.JsonEncodedText.Encode("authentication_realm"); + private static readonly System.Text.Json.JsonEncodedText PropAuthenticationType = System.Text.Json.JsonEncodedText.Encode("authentication_type"); + private static readonly System.Text.Json.JsonEncodedText PropEmail = System.Text.Json.JsonEncodedText.Encode("email"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropFullName = System.Text.Json.JsonEncodedText.Encode("full_name"); + private static readonly System.Text.Json.JsonEncodedText PropLookupRealm = System.Text.Json.JsonEncodedText.Encode("lookup_realm"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropProfileUid = System.Text.Json.JsonEncodedText.Encode("profile_uid"); + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); + + public override Elastic.Clients.Elasticsearch.Security.AuthenticatedUser Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAuthenticationProvider = default; + LocalJsonValue propAuthenticationRealm = default; + LocalJsonValue propAuthenticationType = default; + LocalJsonValue propEmail = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propFullName = default; + LocalJsonValue propLookupRealm = default; + LocalJsonValue> propMetadata = default; + LocalJsonValue propProfileUid = default; + LocalJsonValue> propRoles = default; + LocalJsonValue propUsername = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAuthenticationProvider.TryReadProperty(ref reader, options, PropAuthenticationProvider, null)) + { + continue; + } + + if (propAuthenticationRealm.TryReadProperty(ref reader, options, PropAuthenticationRealm, null)) + { + continue; + } + + if (propAuthenticationType.TryReadProperty(ref reader, options, PropAuthenticationType, null)) + { + continue; + } + + if (propEmail.TryReadProperty(ref reader, options, PropEmail, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propFullName.TryReadProperty(ref reader, options, PropFullName, null)) + { + continue; + } + + if (propLookupRealm.TryReadProperty(ref reader, options, PropLookupRealm, null)) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (propProfileUid.TryReadProperty(ref reader, options, PropProfileUid, null)) + { + continue; + } + + if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.AuthenticatedUser(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AuthenticationProvider = propAuthenticationProvider.Value, + AuthenticationRealm = propAuthenticationRealm.Value, + AuthenticationType = propAuthenticationType.Value, + Email = propEmail.Value, + Enabled = propEnabled.Value, + FullName = propFullName.Value, + LookupRealm = propLookupRealm.Value, + Metadata = propMetadata.Value, + ProfileUid = propProfileUid.Value, + Roles = propRoles.Value, + Username = propUsername.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.AuthenticatedUser value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAuthenticationProvider, value.AuthenticationProvider, null, null); + writer.WriteProperty(options, PropAuthenticationRealm, value.AuthenticationRealm, null, null); + writer.WriteProperty(options, PropAuthenticationType, value.AuthenticationType, null, null); + writer.WriteProperty(options, PropEmail, value.Email, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropFullName, value.FullName, null, null); + writer.WriteProperty(options, PropLookupRealm, value.LookupRealm, null, null); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropProfileUid, value.ProfileUid, null, null); + writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropUsername, value.Username, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticatedUser.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticatedUser.g.cs index 2c88bd3e331..d8e2a047ae9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticatedUser.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticatedUser.g.cs @@ -23,136 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class AuthenticatedUserConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAuthenticationProvider = System.Text.Json.JsonEncodedText.Encode("authentication_provider"); - private static readonly System.Text.Json.JsonEncodedText PropAuthenticationRealm = System.Text.Json.JsonEncodedText.Encode("authentication_realm"); - private static readonly System.Text.Json.JsonEncodedText PropAuthenticationType = System.Text.Json.JsonEncodedText.Encode("authentication_type"); - private static readonly System.Text.Json.JsonEncodedText PropEmail = System.Text.Json.JsonEncodedText.Encode("email"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropFullName = System.Text.Json.JsonEncodedText.Encode("full_name"); - private static readonly System.Text.Json.JsonEncodedText PropLookupRealm = System.Text.Json.JsonEncodedText.Encode("lookup_realm"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropProfileUid = System.Text.Json.JsonEncodedText.Encode("profile_uid"); - private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); - private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); - - public override Elastic.Clients.Elasticsearch.Security.AuthenticatedUser Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAuthenticationProvider = default; - LocalJsonValue propAuthenticationRealm = default; - LocalJsonValue propAuthenticationType = default; - LocalJsonValue propEmail = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propFullName = default; - LocalJsonValue propLookupRealm = default; - LocalJsonValue> propMetadata = default; - LocalJsonValue propProfileUid = default; - LocalJsonValue> propRoles = default; - LocalJsonValue propUsername = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAuthenticationProvider.TryReadProperty(ref reader, options, PropAuthenticationProvider, null)) - { - continue; - } - - if (propAuthenticationRealm.TryReadProperty(ref reader, options, PropAuthenticationRealm, null)) - { - continue; - } - - if (propAuthenticationType.TryReadProperty(ref reader, options, PropAuthenticationType, null)) - { - continue; - } - - if (propEmail.TryReadProperty(ref reader, options, PropEmail, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propFullName.TryReadProperty(ref reader, options, PropFullName, null)) - { - continue; - } - - if (propLookupRealm.TryReadProperty(ref reader, options, PropLookupRealm, null)) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (propProfileUid.TryReadProperty(ref reader, options, PropProfileUid, null)) - { - continue; - } - - if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.AuthenticatedUser(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AuthenticationProvider = propAuthenticationProvider.Value, - AuthenticationRealm = propAuthenticationRealm.Value, - AuthenticationType = propAuthenticationType.Value, - Email = propEmail.Value, - Enabled = propEnabled.Value, - FullName = propFullName.Value, - LookupRealm = propLookupRealm.Value, - Metadata = propMetadata.Value, - ProfileUid = propProfileUid.Value, - Roles = propRoles.Value, - Username = propUsername.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.AuthenticatedUser value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAuthenticationProvider, value.AuthenticationProvider, null, null); - writer.WriteProperty(options, PropAuthenticationRealm, value.AuthenticationRealm, null, null); - writer.WriteProperty(options, PropAuthenticationType, value.AuthenticationType, null, null); - writer.WriteProperty(options, PropEmail, value.Email, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropFullName, value.FullName, null, null); - writer.WriteProperty(options, PropLookupRealm, value.LookupRealm, null, null); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropProfileUid, value.ProfileUid, null, null); - writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropUsername, value.Username, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.AuthenticatedUserConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.AuthenticatedUserConverter))] public sealed partial class AuthenticatedUser { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Authentication.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Authentication.Converters.g.cs new file mode 100644 index 00000000000..d40d04d17be --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Authentication.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class AuthenticationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); + private static readonly System.Text.Json.JsonEncodedText PropAuthenticationRealm = System.Text.Json.JsonEncodedText.Encode("authentication_realm"); + private static readonly System.Text.Json.JsonEncodedText PropAuthenticationType = System.Text.Json.JsonEncodedText.Encode("authentication_type"); + private static readonly System.Text.Json.JsonEncodedText PropEmail = System.Text.Json.JsonEncodedText.Encode("email"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropFullName = System.Text.Json.JsonEncodedText.Encode("full_name"); + private static readonly System.Text.Json.JsonEncodedText PropLookupRealm = System.Text.Json.JsonEncodedText.Encode("lookup_realm"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + private static readonly System.Text.Json.JsonEncodedText PropToken = System.Text.Json.JsonEncodedText.Encode("token"); + private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); + + public override Elastic.Clients.Elasticsearch.Security.Authentication Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propApiKey = default; + LocalJsonValue propAuthenticationRealm = default; + LocalJsonValue propAuthenticationType = default; + LocalJsonValue propEmail = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propFullName = default; + LocalJsonValue propLookupRealm = default; + LocalJsonValue> propMetadata = default; + LocalJsonValue> propRoles = default; + LocalJsonValue?> propToken = default; + LocalJsonValue propUsername = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propAuthenticationRealm.TryReadProperty(ref reader, options, PropAuthenticationRealm, null)) + { + continue; + } + + if (propAuthenticationType.TryReadProperty(ref reader, options, PropAuthenticationType, null)) + { + continue; + } + + if (propEmail.TryReadProperty(ref reader, options, PropEmail, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propFullName.TryReadProperty(ref reader, options, PropFullName, null)) + { + continue; + } + + if (propLookupRealm.TryReadProperty(ref reader, options, PropLookupRealm, null)) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propToken.TryReadProperty(ref reader, options, PropToken, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.Authentication(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ApiKey = propApiKey.Value, + AuthenticationRealm = propAuthenticationRealm.Value, + AuthenticationType = propAuthenticationType.Value, + Email = propEmail.Value, + Enabled = propEnabled.Value, + FullName = propFullName.Value, + LookupRealm = propLookupRealm.Value, + Metadata = propMetadata.Value, + Roles = propRoles.Value, + Token = propToken.Value, + Username = propUsername.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.Authentication value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApiKey, value.ApiKey, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropAuthenticationRealm, value.AuthenticationRealm, null, null); + writer.WriteProperty(options, PropAuthenticationType, value.AuthenticationType, null, null); + writer.WriteProperty(options, PropEmail, value.Email, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropFullName, value.FullName, null, null); + writer.WriteProperty(options, PropLookupRealm, value.LookupRealm, null, null); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropToken, value.Token, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropUsername, value.Username, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Authentication.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Authentication.g.cs index 714dd1b9961..f6d901fd6bc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Authentication.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Authentication.g.cs @@ -23,136 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class AuthenticationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); - private static readonly System.Text.Json.JsonEncodedText PropAuthenticationRealm = System.Text.Json.JsonEncodedText.Encode("authentication_realm"); - private static readonly System.Text.Json.JsonEncodedText PropAuthenticationType = System.Text.Json.JsonEncodedText.Encode("authentication_type"); - private static readonly System.Text.Json.JsonEncodedText PropEmail = System.Text.Json.JsonEncodedText.Encode("email"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropFullName = System.Text.Json.JsonEncodedText.Encode("full_name"); - private static readonly System.Text.Json.JsonEncodedText PropLookupRealm = System.Text.Json.JsonEncodedText.Encode("lookup_realm"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); - private static readonly System.Text.Json.JsonEncodedText PropToken = System.Text.Json.JsonEncodedText.Encode("token"); - private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); - - public override Elastic.Clients.Elasticsearch.Security.Authentication Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propApiKey = default; - LocalJsonValue propAuthenticationRealm = default; - LocalJsonValue propAuthenticationType = default; - LocalJsonValue propEmail = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propFullName = default; - LocalJsonValue propLookupRealm = default; - LocalJsonValue> propMetadata = default; - LocalJsonValue> propRoles = default; - LocalJsonValue?> propToken = default; - LocalJsonValue propUsername = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propAuthenticationRealm.TryReadProperty(ref reader, options, PropAuthenticationRealm, null)) - { - continue; - } - - if (propAuthenticationType.TryReadProperty(ref reader, options, PropAuthenticationType, null)) - { - continue; - } - - if (propEmail.TryReadProperty(ref reader, options, PropEmail, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propFullName.TryReadProperty(ref reader, options, PropFullName, null)) - { - continue; - } - - if (propLookupRealm.TryReadProperty(ref reader, options, PropLookupRealm, null)) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propToken.TryReadProperty(ref reader, options, PropToken, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.Authentication(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ApiKey = propApiKey.Value, - AuthenticationRealm = propAuthenticationRealm.Value, - AuthenticationType = propAuthenticationType.Value, - Email = propEmail.Value, - Enabled = propEnabled.Value, - FullName = propFullName.Value, - LookupRealm = propLookupRealm.Value, - Metadata = propMetadata.Value, - Roles = propRoles.Value, - Token = propToken.Value, - Username = propUsername.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.Authentication value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApiKey, value.ApiKey, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropAuthenticationRealm, value.AuthenticationRealm, null, null); - writer.WriteProperty(options, PropAuthenticationType, value.AuthenticationType, null, null); - writer.WriteProperty(options, PropEmail, value.Email, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropFullName, value.FullName, null, null); - writer.WriteProperty(options, PropLookupRealm, value.LookupRealm, null, null); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropToken, value.Token, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropUsername, value.Username, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.AuthenticationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.AuthenticationConverter))] public sealed partial class Authentication { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticationProvider.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticationProvider.Converters.g.cs new file mode 100644 index 00000000000..78479a44904 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticationProvider.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class AuthenticationProviderConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Security.AuthenticationProvider Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.AuthenticationProvider(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.AuthenticationProvider value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticationProvider.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticationProvider.g.cs index b30bbc4d87d..610b3df83bc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticationProvider.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticationProvider.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class AuthenticationProviderConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Security.AuthenticationProvider Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.AuthenticationProvider(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.AuthenticationProvider value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.AuthenticationProviderConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.AuthenticationProviderConverter))] public sealed partial class AuthenticationProvider { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticationRealm.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticationRealm.Converters.g.cs new file mode 100644 index 00000000000..1bc1284174b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticationRealm.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class AuthenticationRealmConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDomain = System.Text.Json.JsonEncodedText.Encode("domain"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Security.AuthenticationRealm Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDomain = default; + LocalJsonValue propName = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDomain.TryReadProperty(ref reader, options, PropDomain, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.AuthenticationRealm(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Domain = propDomain.Value, + Name = propName.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.AuthenticationRealm value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDomain, value.Domain, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticationRealm.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticationRealm.g.cs index b0e9baa99fa..041a9eee5f4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticationRealm.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticationRealm.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class AuthenticationRealmConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDomain = System.Text.Json.JsonEncodedText.Encode("domain"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Security.AuthenticationRealm Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDomain = default; - LocalJsonValue propName = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDomain.TryReadProperty(ref reader, options, PropDomain, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.AuthenticationRealm(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Domain = propDomain.Value, - Name = propName.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.AuthenticationRealm value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDomain, value.Domain, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.AuthenticationRealmConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.AuthenticationRealmConverter))] public sealed partial class AuthenticationRealm { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/BulkError.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/BulkError.Converters.g.cs new file mode 100644 index 00000000000..56970e94025 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/BulkError.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class BulkErrorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); + + public override Elastic.Clients.Elasticsearch.Security.BulkError Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propDetails = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propDetails.TryReadProperty(ref reader, options, PropDetails, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.BulkError(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Details = propDetails.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.BulkError value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropDetails, value.Details, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/BulkError.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/BulkError.g.cs index ba7d3822ebe..3693391e235 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/BulkError.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/BulkError.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class BulkErrorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); - - public override Elastic.Clients.Elasticsearch.Security.BulkError Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propDetails = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propDetails.TryReadProperty(ref reader, options, PropDetails, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.BulkError(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Details = propDetails.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.BulkError value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropDetails, value.Details, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.BulkErrorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.BulkErrorConverter))] public sealed partial class BulkError { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ClusterNode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ClusterNode.Converters.g.cs new file mode 100644 index 00000000000..cca9eadb002 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ClusterNode.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ClusterNodeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.Security.ClusterNode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.ClusterNode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ClusterNode value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ClusterNode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ClusterNode.g.cs index 0196013fbf0..2d1a9b68839 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ClusterNode.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ClusterNode.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class ClusterNodeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.Security.ClusterNode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.ClusterNode(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ClusterNode value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ClusterNodeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ClusterNodeConverter))] public sealed partial class ClusterNode { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ClusterPrivilege.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ClusterPrivilege.Converters.g.cs new file mode 100644 index 00000000000..b94490952bf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ClusterPrivilege.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ClusterPrivilegeConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.ClusterPrivilege Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Security.ClusterPrivilege(reader.ReadValue(options, null)); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ClusterPrivilege value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Value, null); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ClusterPrivilege.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ClusterPrivilege.g.cs new file mode 100644 index 00000000000..3bba278f411 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ClusterPrivilege.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ClusterPrivilegeConverter))] +public readonly partial struct ClusterPrivilege : Elastic.Clients.Elasticsearch.Serialization.IEnumStruct +{ + public ClusterPrivilege(string value) => Value = value; +#if NET7_0_OR_GREATER + static ClusterPrivilege IEnumStruct.Create(string value) => value; +#else + ClusterPrivilege IEnumStruct.Create(string value) => value; +#endif + public readonly string Value { get; } + public static ClusterPrivilege All { get; } = new ClusterPrivilege("all"); + public static ClusterPrivilege CancelTask { get; } = new ClusterPrivilege("cancel_task"); + public static ClusterPrivilege CreateSnapshot { get; } = new ClusterPrivilege("create_snapshot"); + public static ClusterPrivilege CrossClusterReplication { get; } = new ClusterPrivilege("cross_cluster_replication"); + public static ClusterPrivilege CrossClusterSearch { get; } = new ClusterPrivilege("cross_cluster_search"); + public static ClusterPrivilege DelegatePki { get; } = new ClusterPrivilege("delegate_pki"); + public static ClusterPrivilege GrantApiKey { get; } = new ClusterPrivilege("grant_api_key"); + public static ClusterPrivilege Manage { get; } = new ClusterPrivilege("manage"); + public static ClusterPrivilege ManageApiKey { get; } = new ClusterPrivilege("manage_api_key"); + public static ClusterPrivilege ManageAutoscaling { get; } = new ClusterPrivilege("manage_autoscaling"); + public static ClusterPrivilege ManageBehavioralAnalytics { get; } = new ClusterPrivilege("manage_behavioral_analytics"); + public static ClusterPrivilege ManageCcr { get; } = new ClusterPrivilege("manage_ccr"); + public static ClusterPrivilege ManageDataFrameTransforms { get; } = new ClusterPrivilege("manage_data_frame_transforms"); + public static ClusterPrivilege ManageDataStreamGlobalRetention { get; } = new ClusterPrivilege("manage_data_stream_global_retention"); + public static ClusterPrivilege ManageEnrich { get; } = new ClusterPrivilege("manage_enrich"); + public static ClusterPrivilege ManageEsql { get; } = new ClusterPrivilege("manage_esql"); + public static ClusterPrivilege ManageIlm { get; } = new ClusterPrivilege("manage_ilm"); + public static ClusterPrivilege ManageIndexTemplates { get; } = new ClusterPrivilege("manage_index_templates"); + public static ClusterPrivilege ManageInference { get; } = new ClusterPrivilege("manage_inference"); + public static ClusterPrivilege ManageIngestPipelines { get; } = new ClusterPrivilege("manage_ingest_pipelines"); + public static ClusterPrivilege ManageLogstashPipelines { get; } = new ClusterPrivilege("manage_logstash_pipelines"); + public static ClusterPrivilege ManageMl { get; } = new ClusterPrivilege("manage_ml"); + public static ClusterPrivilege ManageOidc { get; } = new ClusterPrivilege("manage_oidc"); + public static ClusterPrivilege ManageOwnApiKey { get; } = new ClusterPrivilege("manage_own_api_key"); + public static ClusterPrivilege ManagePipeline { get; } = new ClusterPrivilege("manage_pipeline"); + public static ClusterPrivilege ManageRollup { get; } = new ClusterPrivilege("manage_rollup"); + public static ClusterPrivilege ManageSaml { get; } = new ClusterPrivilege("manage_saml"); + public static ClusterPrivilege ManageSearchApplication { get; } = new ClusterPrivilege("manage_search_application"); + public static ClusterPrivilege ManageSearchQueryRules { get; } = new ClusterPrivilege("manage_search_query_rules"); + public static ClusterPrivilege ManageSearchSynonyms { get; } = new ClusterPrivilege("manage_search_synonyms"); + public static ClusterPrivilege ManageSecurity { get; } = new ClusterPrivilege("manage_security"); + public static ClusterPrivilege ManageServiceAccount { get; } = new ClusterPrivilege("manage_service_account"); + public static ClusterPrivilege ManageSlm { get; } = new ClusterPrivilege("manage_slm"); + public static ClusterPrivilege ManageToken { get; } = new ClusterPrivilege("manage_token"); + public static ClusterPrivilege ManageTransform { get; } = new ClusterPrivilege("manage_transform"); + public static ClusterPrivilege ManageUserProfile { get; } = new ClusterPrivilege("manage_user_profile"); + public static ClusterPrivilege ManageWatcher { get; } = new ClusterPrivilege("manage_watcher"); + public static ClusterPrivilege Monitor { get; } = new ClusterPrivilege("monitor"); + public static ClusterPrivilege MonitorDataFrameTransforms { get; } = new ClusterPrivilege("monitor_data_frame_transforms"); + public static ClusterPrivilege MonitorDataStreamGlobalRetention { get; } = new ClusterPrivilege("monitor_data_stream_global_retention"); + public static ClusterPrivilege MonitorEnrich { get; } = new ClusterPrivilege("monitor_enrich"); + public static ClusterPrivilege MonitorEsql { get; } = new ClusterPrivilege("monitor_esql"); + public static ClusterPrivilege MonitorInference { get; } = new ClusterPrivilege("monitor_inference"); + public static ClusterPrivilege MonitorMl { get; } = new ClusterPrivilege("monitor_ml"); + public static ClusterPrivilege MonitorRollup { get; } = new ClusterPrivilege("monitor_rollup"); + public static ClusterPrivilege MonitorSnapshot { get; } = new ClusterPrivilege("monitor_snapshot"); + public static ClusterPrivilege MonitorStats { get; } = new ClusterPrivilege("monitor_stats"); + public static ClusterPrivilege MonitorTextStructure { get; } = new ClusterPrivilege("monitor_text_structure"); + public static ClusterPrivilege MonitorTransform { get; } = new ClusterPrivilege("monitor_transform"); + public static ClusterPrivilege MonitorWatcher { get; } = new ClusterPrivilege("monitor_watcher"); + public static ClusterPrivilege None { get; } = new ClusterPrivilege("none"); + public static ClusterPrivilege PostBehavioralAnalyticsEvent { get; } = new ClusterPrivilege("post_behavioral_analytics_event"); + public static ClusterPrivilege ReadCcr { get; } = new ClusterPrivilege("read_ccr"); + public static ClusterPrivilege ReadFleetSecrets { get; } = new ClusterPrivilege("read_fleet_secrets"); + public static ClusterPrivilege ReadIlm { get; } = new ClusterPrivilege("read_ilm"); + public static ClusterPrivilege ReadPipeline { get; } = new ClusterPrivilege("read_pipeline"); + public static ClusterPrivilege ReadSecurity { get; } = new ClusterPrivilege("read_security"); + public static ClusterPrivilege ReadSlm { get; } = new ClusterPrivilege("read_slm"); + public static ClusterPrivilege TransportClient { get; } = new ClusterPrivilege("transport_client"); + public static ClusterPrivilege WriteConnectorSecrets { get; } = new ClusterPrivilege("write_connector_secrets"); + public static ClusterPrivilege WriteFleetSecrets { get; } = new ClusterPrivilege("write_fleet_secrets"); + + public override string ToString() => Value ?? string.Empty; + + public static implicit operator string(ClusterPrivilege @enum) => @enum.Value; + public static implicit operator ClusterPrivilege(string value) => new(value); + + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals(object obj) => obj is ClusterPrivilege other && this.Equals(other); + public bool Equals(ClusterPrivilege other) => Value == other.Value; + + public static bool operator ==(ClusterPrivilege a, ClusterPrivilege b) => a.Equals(b); + public static bool operator !=(ClusterPrivilege a, ClusterPrivilege b) => !(a == b); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/CreatedStatus.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/CreatedStatus.Converters.g.cs new file mode 100644 index 00000000000..432d62b235c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/CreatedStatus.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class CreatedStatusConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCreated = System.Text.Json.JsonEncodedText.Encode("created"); + + public override Elastic.Clients.Elasticsearch.Security.CreatedStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCreated = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCreated.TryReadProperty(ref reader, options, PropCreated, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.CreatedStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Created = propCreated.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.CreatedStatus value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCreated, value.Created, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/CreatedStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/CreatedStatus.g.cs index 5a170549f45..e63ac8d6050 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/CreatedStatus.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/CreatedStatus.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class CreatedStatusConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCreated = System.Text.Json.JsonEncodedText.Encode("created"); - - public override Elastic.Clients.Elasticsearch.Security.CreatedStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCreated = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCreated.TryReadProperty(ref reader, options, PropCreated, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.CreatedStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Created = propCreated.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.CreatedStatus value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCreated, value.Created, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.CreatedStatusConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.CreatedStatusConverter))] public sealed partial class CreatedStatus { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/FieldSecurity.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/FieldSecurity.Converters.g.cs new file mode 100644 index 00000000000..28d47a7bba3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/FieldSecurity.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class FieldSecurityConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExcept = System.Text.Json.JsonEncodedText.Encode("except"); + private static readonly System.Text.Json.JsonEncodedText PropGrant = System.Text.Json.JsonEncodedText.Encode("grant"); + + public override Elastic.Clients.Elasticsearch.Security.FieldSecurity Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExcept = default; + LocalJsonValue propGrant = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExcept.TryReadProperty(ref reader, options, PropExcept, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (propGrant.TryReadProperty(ref reader, options, PropGrant, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.FieldSecurity(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Except = propExcept.Value, + Grant = propGrant.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.FieldSecurity value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExcept, value.Except, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropGrant, value.Grant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/FieldSecurity.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/FieldSecurity.g.cs index b8e709a65d8..25f4a8e8d2a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/FieldSecurity.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/FieldSecurity.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class FieldSecurityConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExcept = System.Text.Json.JsonEncodedText.Encode("except"); - private static readonly System.Text.Json.JsonEncodedText PropGrant = System.Text.Json.JsonEncodedText.Encode("grant"); - - public override Elastic.Clients.Elasticsearch.Security.FieldSecurity Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propExcept = default; - LocalJsonValue propGrant = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExcept.TryReadProperty(ref reader, options, PropExcept, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (propGrant.TryReadProperty(ref reader, options, PropGrant, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.FieldSecurity(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Except = propExcept.Value, - Grant = propGrant.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.FieldSecurity value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExcept, value.Except, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteProperty(options, PropGrant, value.Grant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.FieldSecurityConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.FieldSecurityConverter))] public sealed partial class FieldSecurity { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/FoundStatus.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/FoundStatus.Converters.g.cs new file mode 100644 index 00000000000..748a31b9297 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/FoundStatus.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class FoundStatusConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFound = System.Text.Json.JsonEncodedText.Encode("found"); + + public override Elastic.Clients.Elasticsearch.Security.FoundStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFound = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFound.TryReadProperty(ref reader, options, PropFound, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.FoundStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Found = propFound.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.FoundStatus value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFound, value.Found, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/FoundStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/FoundStatus.g.cs index 0f41eecbc24..4f852662cbd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/FoundStatus.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/FoundStatus.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class FoundStatusConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFound = System.Text.Json.JsonEncodedText.Encode("found"); - - public override Elastic.Clients.Elasticsearch.Security.FoundStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFound = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFound.TryReadProperty(ref reader, options, PropFound, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.FoundStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Found = propFound.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.FoundStatus value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFound, value.Found, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.FoundStatusConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.FoundStatusConverter))] public sealed partial class FoundStatus { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GetUserProfileErrors.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GetUserProfileErrors.Converters.g.cs new file mode 100644 index 00000000000..f3e415144dc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GetUserProfileErrors.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GetUserProfileErrorsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); + + public override Elastic.Clients.Elasticsearch.Security.GetUserProfileErrors Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propDetails = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propDetails.TryReadProperty(ref reader, options, PropDetails, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.GetUserProfileErrors(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Details = propDetails.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetUserProfileErrors value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropDetails, value.Details, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GetUserProfileErrors.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GetUserProfileErrors.g.cs index 8f74322a932..187c988d7d3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GetUserProfileErrors.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GetUserProfileErrors.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class GetUserProfileErrorsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); - - public override Elastic.Clients.Elasticsearch.Security.GetUserProfileErrors Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propDetails = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propDetails.TryReadProperty(ref reader, options, PropDetails, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.GetUserProfileErrors(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Details = propDetails.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetUserProfileErrors value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropDetails, value.Details, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GetUserProfileErrorsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetUserProfileErrorsConverter))] public sealed partial class GetUserProfileErrors { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GlobalPrivilege.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GlobalPrivilege.Converters.g.cs new file mode 100644 index 00000000000..74898f74471 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GlobalPrivilege.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GlobalPrivilegeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApplication = System.Text.Json.JsonEncodedText.Encode("application"); + + public override Elastic.Clients.Elasticsearch.Security.GlobalPrivilege Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApplication = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApplication.TryReadProperty(ref reader, options, PropApplication, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.GlobalPrivilege(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Application = propApplication.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GlobalPrivilege value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApplication, value.Application, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GlobalPrivilege.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GlobalPrivilege.g.cs index 64f907bb683..a58e9a95426 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GlobalPrivilege.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GlobalPrivilege.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class GlobalPrivilegeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApplication = System.Text.Json.JsonEncodedText.Encode("application"); - - public override Elastic.Clients.Elasticsearch.Security.GlobalPrivilege Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propApplication = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApplication.TryReadProperty(ref reader, options, PropApplication, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.GlobalPrivilege(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Application = propApplication.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GlobalPrivilege value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApplication, value.Application, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GlobalPrivilegeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GlobalPrivilegeConverter))] public sealed partial class GlobalPrivilege { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GrantApiKey.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GrantApiKey.Converters.g.cs new file mode 100644 index 00000000000..60d55fb1ed4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GrantApiKey.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GrantApiKeyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExpiration = System.Text.Json.JsonEncodedText.Encode("expiration"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropRoleDescriptors = System.Text.Json.JsonEncodedText.Encode("role_descriptors"); + + public override Elastic.Clients.Elasticsearch.Security.GrantApiKey Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExpiration = default; + LocalJsonValue?> propMetadata = default; + LocalJsonValue propName = default; + LocalJsonValue>?> propRoleDescriptors = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExpiration.TryReadProperty(ref reader, options, PropExpiration, null)) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propRoleDescriptors.TryReadProperty(ref reader, options, PropRoleDescriptors, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue>(o, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.GrantApiKey(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Expiration = propExpiration.Value, + Metadata = propMetadata.Value, + Name = propName.Value, + RoleDescriptors = propRoleDescriptors.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GrantApiKey value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExpiration, value.Expiration, null, null); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropRoleDescriptors, value.RoleDescriptors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteSingleOrManyCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, null))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GrantApiKey.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GrantApiKey.g.cs index f01e5467ba0..2853acb23e4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GrantApiKey.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GrantApiKey.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class GrantApiKeyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExpiration = System.Text.Json.JsonEncodedText.Encode("expiration"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropRoleDescriptors = System.Text.Json.JsonEncodedText.Encode("role_descriptors"); - - public override Elastic.Clients.Elasticsearch.Security.GrantApiKey Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propExpiration = default; - LocalJsonValue?> propMetadata = default; - LocalJsonValue propName = default; - LocalJsonValue>?> propRoleDescriptors = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExpiration.TryReadProperty(ref reader, options, PropExpiration, null)) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propRoleDescriptors.TryReadProperty(ref reader, options, PropRoleDescriptors, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue>(o, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.GrantApiKey(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Expiration = propExpiration.Value, - Metadata = propMetadata.Value, - Name = propName.Value, - RoleDescriptors = propRoleDescriptors.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GrantApiKey value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExpiration, value.Expiration, null, null); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropRoleDescriptors, value.RoleDescriptors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteSingleOrManyCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, null))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.GrantApiKeyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GrantApiKeyConverter))] public sealed partial class GrantApiKey { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GrantType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GrantType.Converters.g.cs new file mode 100644 index 00000000000..3e6cb34f42d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GrantType.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GrantTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAccessToken = System.Text.Json.JsonEncodedText.Encode("access_token"); + private static readonly System.Text.Json.JsonEncodedText MemberPassword = System.Text.Json.JsonEncodedText.Encode("password"); + + public override Elastic.Clients.Elasticsearch.Security.GrantType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAccessToken)) + { + return Elastic.Clients.Elasticsearch.Security.GrantType.AccessToken; + } + + if (reader.ValueTextEquals(MemberPassword)) + { + return Elastic.Clients.Elasticsearch.Security.GrantType.Password; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAccessToken.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Security.GrantType.AccessToken; + } + + if (string.Equals(value, MemberPassword.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Security.GrantType.Password; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Security.GrantType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GrantType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Security.GrantType.AccessToken: + writer.WriteStringValue(MemberAccessToken); + break; + case Elastic.Clients.Elasticsearch.Security.GrantType.Password: + writer.WriteStringValue(MemberPassword); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Security.GrantType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Security.GrantType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GrantType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GrantType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GrantType.g.cs new file mode 100644 index 00000000000..2143f23d6e7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/GrantType.g.cs @@ -0,0 +1,44 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GrantTypeConverter))] +public enum GrantType +{ + /// + /// + /// In this type of grant, you must supply an access token that was created by the Elasticsearch token service. + /// If you are activating a user profile, you can alternatively supply a JWT (either a JWT access_token or a JWT id_token). + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "access_token")] + AccessToken, + /// + /// + /// In this type of grant, you must supply the user ID and password for which you want to create the API key. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "password")] + Password +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/HasPrivilegesUserProfileErrors.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/HasPrivilegesUserProfileErrors.Converters.g.cs new file mode 100644 index 00000000000..0ad1f5b9e85 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/HasPrivilegesUserProfileErrors.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class HasPrivilegesUserProfileErrorsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); + + public override Elastic.Clients.Elasticsearch.Security.HasPrivilegesUserProfileErrors Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propDetails = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propDetails.TryReadProperty(ref reader, options, PropDetails, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.HasPrivilegesUserProfileErrors(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Details = propDetails.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.HasPrivilegesUserProfileErrors value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropDetails, value.Details, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/HasPrivilegesUserProfileErrors.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/HasPrivilegesUserProfileErrors.g.cs index 80fa4daea18..b94b92d0550 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/HasPrivilegesUserProfileErrors.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/HasPrivilegesUserProfileErrors.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class HasPrivilegesUserProfileErrorsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); - - public override Elastic.Clients.Elasticsearch.Security.HasPrivilegesUserProfileErrors Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propDetails = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propDetails.TryReadProperty(ref reader, options, PropDetails, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.HasPrivilegesUserProfileErrors(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Details = propDetails.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.HasPrivilegesUserProfileErrors value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropDetails, value.Details, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.HasPrivilegesUserProfileErrorsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.HasPrivilegesUserProfileErrorsConverter))] public sealed partial class HasPrivilegesUserProfileErrors { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Hint.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Hint.Converters.g.cs new file mode 100644 index 00000000000..9c3c5421c53 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Hint.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class HintConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLabels = System.Text.Json.JsonEncodedText.Encode("labels"); + private static readonly System.Text.Json.JsonEncodedText PropUids = System.Text.Json.JsonEncodedText.Encode("uids"); + + public override Elastic.Clients.Elasticsearch.Security.Hint Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>?> propLabels = default; + LocalJsonValue?> propUids = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLabels.TryReadProperty(ref reader, options, PropLabels, static System.Collections.Generic.IDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!))) + { + continue; + } + + if (propUids.TryReadProperty(ref reader, options, PropUids, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.Hint(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Labels = propLabels.Value, + Uids = propUids.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.Hint value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLabels, value.Labels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); + writer.WriteProperty(options, PropUids, value.Uids, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Hint.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Hint.g.cs index 1a0c6ff1265..5940b6700c8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Hint.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Hint.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class HintConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLabels = System.Text.Json.JsonEncodedText.Encode("labels"); - private static readonly System.Text.Json.JsonEncodedText PropUids = System.Text.Json.JsonEncodedText.Encode("uids"); - - public override Elastic.Clients.Elasticsearch.Security.Hint Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>?> propLabels = default; - LocalJsonValue?> propUids = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLabels.TryReadProperty(ref reader, options, PropLabels, static System.Collections.Generic.IDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!))) - { - continue; - } - - if (propUids.TryReadProperty(ref reader, options, PropUids, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.Hint(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Labels = propLabels.Value, - Uids = propUids.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.Hint value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLabels, value.Labels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); - writer.WriteProperty(options, PropUids, value.Uids, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.HintConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.HintConverter))] public sealed partial class Hint { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndexPrivilege.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndexPrivilege.Converters.g.cs new file mode 100644 index 00000000000..6de3ab9054f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndexPrivilege.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class IndexPrivilegeConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.IndexPrivilege Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Security.IndexPrivilege(reader.ReadValue(options, null)); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.IndexPrivilege value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Value, null); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndexPrivilege.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndexPrivilege.g.cs new file mode 100644 index 00000000000..e52fbd5946b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndexPrivilege.g.cs @@ -0,0 +1,70 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.IndexPrivilegeConverter))] +public readonly partial struct IndexPrivilege : Elastic.Clients.Elasticsearch.Serialization.IEnumStruct +{ + public IndexPrivilege(string value) => Value = value; +#if NET7_0_OR_GREATER + static IndexPrivilege IEnumStruct.Create(string value) => value; +#else + IndexPrivilege IEnumStruct.Create(string value) => value; +#endif + public readonly string Value { get; } + public static IndexPrivilege All { get; } = new IndexPrivilege("all"); + public static IndexPrivilege AutoConfigure { get; } = new IndexPrivilege("auto_configure"); + public static IndexPrivilege Create { get; } = new IndexPrivilege("create"); + public static IndexPrivilege CreateDoc { get; } = new IndexPrivilege("create_doc"); + public static IndexPrivilege CreateIndex { get; } = new IndexPrivilege("create_index"); + public static IndexPrivilege CrossClusterReplication { get; } = new IndexPrivilege("cross_cluster_replication"); + public static IndexPrivilege CrossClusterReplicationInternal { get; } = new IndexPrivilege("cross_cluster_replication_internal"); + public static IndexPrivilege Delete { get; } = new IndexPrivilege("delete"); + public static IndexPrivilege DeleteIndex { get; } = new IndexPrivilege("delete_index"); + public static IndexPrivilege Index { get; } = new IndexPrivilege("index"); + public static IndexPrivilege Maintenance { get; } = new IndexPrivilege("maintenance"); + public static IndexPrivilege Manage { get; } = new IndexPrivilege("manage"); + public static IndexPrivilege ManageDataStreamLifecycle { get; } = new IndexPrivilege("manage_data_stream_lifecycle"); + public static IndexPrivilege ManageFollowIndex { get; } = new IndexPrivilege("manage_follow_index"); + public static IndexPrivilege ManageIlm { get; } = new IndexPrivilege("manage_ilm"); + public static IndexPrivilege ManageLeaderIndex { get; } = new IndexPrivilege("manage_leader_index"); + public static IndexPrivilege Monitor { get; } = new IndexPrivilege("monitor"); + public static IndexPrivilege None { get; } = new IndexPrivilege("none"); + public static IndexPrivilege Read { get; } = new IndexPrivilege("read"); + public static IndexPrivilege ReadCrossCluster { get; } = new IndexPrivilege("read_cross_cluster"); + public static IndexPrivilege ViewIndexMetadata { get; } = new IndexPrivilege("view_index_metadata"); + public static IndexPrivilege Write { get; } = new IndexPrivilege("write"); + + public override string ToString() => Value ?? string.Empty; + + public static implicit operator string(IndexPrivilege @enum) => @enum.Value; + public static implicit operator IndexPrivilege(string value) => new(value); + + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals(object obj) => obj is IndexPrivilege other && this.Equals(other); + public bool Equals(IndexPrivilege other) => Value == other.Value; + + public static bool operator ==(IndexPrivilege a, IndexPrivilege b) => a.Equals(b); + public static bool operator !=(IndexPrivilege a, IndexPrivilege b) => !(a == b); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndexPrivilegesCheck.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndexPrivilegesCheck.Converters.g.cs new file mode 100644 index 00000000000..3613d6fc3d4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndexPrivilegesCheck.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class IndexPrivilegesCheckConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowRestrictedIndices = System.Text.Json.JsonEncodedText.Encode("allow_restricted_indices"); + private static readonly System.Text.Json.JsonEncodedText PropNames = System.Text.Json.JsonEncodedText.Encode("names"); + private static readonly System.Text.Json.JsonEncodedText PropPrivileges = System.Text.Json.JsonEncodedText.Encode("privileges"); + + public override Elastic.Clients.Elasticsearch.Security.IndexPrivilegesCheck Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowRestrictedIndices = default; + LocalJsonValue propNames = default; + LocalJsonValue> propPrivileges = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowRestrictedIndices.TryReadProperty(ref reader, options, PropAllowRestrictedIndices, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNames.TryReadProperty(ref reader, options, PropNames, null)) + { + continue; + } + + if (propPrivileges.TryReadProperty(ref reader, options, PropPrivileges, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.IndexPrivilegesCheck(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowRestrictedIndices = propAllowRestrictedIndices.Value, + Names = propNames.Value, + Privileges = propPrivileges.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.IndexPrivilegesCheck value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowRestrictedIndices, value.AllowRestrictedIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNames, value.Names, null, null); + writer.WriteProperty(options, PropPrivileges, value.Privileges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndexPrivilegesCheck.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndexPrivilegesCheck.g.cs index 53238be937a..df70ae9565d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndexPrivilegesCheck.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndexPrivilegesCheck.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class IndexPrivilegesCheckConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowRestrictedIndices = System.Text.Json.JsonEncodedText.Encode("allow_restricted_indices"); - private static readonly System.Text.Json.JsonEncodedText PropNames = System.Text.Json.JsonEncodedText.Encode("names"); - private static readonly System.Text.Json.JsonEncodedText PropPrivileges = System.Text.Json.JsonEncodedText.Encode("privileges"); - - public override Elastic.Clients.Elasticsearch.Security.IndexPrivilegesCheck Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowRestrictedIndices = default; - LocalJsonValue propNames = default; - LocalJsonValue> propPrivileges = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowRestrictedIndices.TryReadProperty(ref reader, options, PropAllowRestrictedIndices, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNames.TryReadProperty(ref reader, options, PropNames, null)) - { - continue; - } - - if (propPrivileges.TryReadProperty(ref reader, options, PropPrivileges, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.IndexPrivilegesCheck(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowRestrictedIndices = propAllowRestrictedIndices.Value, - Names = propNames.Value, - Privileges = propPrivileges.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.IndexPrivilegesCheck value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowRestrictedIndices, value.AllowRestrictedIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNames, value.Names, null, null); - writer.WriteProperty(options, PropPrivileges, value.Privileges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.IndexPrivilegesCheckConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.IndexPrivilegesCheckConverter))] public sealed partial class IndexPrivilegesCheck { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndicesPrivileges.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndicesPrivileges.Converters.g.cs new file mode 100644 index 00000000000..54db90b448b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndicesPrivileges.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class IndicesPrivilegesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowRestrictedIndices = System.Text.Json.JsonEncodedText.Encode("allow_restricted_indices"); + private static readonly System.Text.Json.JsonEncodedText PropFieldSecurity = System.Text.Json.JsonEncodedText.Encode("field_security"); + private static readonly System.Text.Json.JsonEncodedText PropNames = System.Text.Json.JsonEncodedText.Encode("names"); + private static readonly System.Text.Json.JsonEncodedText PropPrivileges = System.Text.Json.JsonEncodedText.Encode("privileges"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + + public override Elastic.Clients.Elasticsearch.Security.IndicesPrivileges Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowRestrictedIndices = default; + LocalJsonValue propFieldSecurity = default; + LocalJsonValue> propNames = default; + LocalJsonValue> propPrivileges = default; + LocalJsonValue propQuery = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowRestrictedIndices.TryReadProperty(ref reader, options, PropAllowRestrictedIndices, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFieldSecurity.TryReadProperty(ref reader, options, PropFieldSecurity, null)) + { + continue; + } + + if (propNames.TryReadProperty(ref reader, options, PropNames, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propPrivileges.TryReadProperty(ref reader, options, PropPrivileges, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.IndicesPrivileges(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowRestrictedIndices = propAllowRestrictedIndices.Value, + FieldSecurity = propFieldSecurity.Value, + Names = propNames.Value, + Privileges = propPrivileges.Value, + Query = propQuery.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.IndicesPrivileges value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowRestrictedIndices, value.AllowRestrictedIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFieldSecurity, value.FieldSecurity, null, null); + writer.WriteProperty(options, PropNames, value.Names, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPrivileges, value.Privileges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropQuery, value.Query, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndicesPrivileges.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndicesPrivileges.g.cs index 7c5b7f6cc46..34d4f6ddb1c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndicesPrivileges.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndicesPrivileges.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class IndicesPrivilegesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowRestrictedIndices = System.Text.Json.JsonEncodedText.Encode("allow_restricted_indices"); - private static readonly System.Text.Json.JsonEncodedText PropFieldSecurity = System.Text.Json.JsonEncodedText.Encode("field_security"); - private static readonly System.Text.Json.JsonEncodedText PropNames = System.Text.Json.JsonEncodedText.Encode("names"); - private static readonly System.Text.Json.JsonEncodedText PropPrivileges = System.Text.Json.JsonEncodedText.Encode("privileges"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - - public override Elastic.Clients.Elasticsearch.Security.IndicesPrivileges Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowRestrictedIndices = default; - LocalJsonValue propFieldSecurity = default; - LocalJsonValue> propNames = default; - LocalJsonValue> propPrivileges = default; - LocalJsonValue propQuery = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowRestrictedIndices.TryReadProperty(ref reader, options, PropAllowRestrictedIndices, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFieldSecurity.TryReadProperty(ref reader, options, PropFieldSecurity, null)) - { - continue; - } - - if (propNames.TryReadProperty(ref reader, options, PropNames, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (propPrivileges.TryReadProperty(ref reader, options, PropPrivileges, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.IndicesPrivileges(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowRestrictedIndices = propAllowRestrictedIndices.Value, - FieldSecurity = propFieldSecurity.Value, - Names = propNames.Value, - Privileges = propPrivileges.Value, - Query = propQuery.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.IndicesPrivileges value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowRestrictedIndices, value.AllowRestrictedIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFieldSecurity, value.FieldSecurity, null, null); - writer.WriteProperty(options, PropNames, value.Names, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPrivileges, value.Privileges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropQuery, value.Query, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.IndicesPrivilegesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.IndicesPrivilegesConverter))] public sealed partial class IndicesPrivileges { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/KibanaToken.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/KibanaToken.Converters.g.cs new file mode 100644 index 00000000000..69675b40164 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/KibanaToken.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class KibanaTokenConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + + public override Elastic.Clients.Elasticsearch.Security.KibanaToken Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + LocalJsonValue propValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.KibanaToken(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value, + Value = propValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.KibanaToken value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropValue, value.Value, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/KibanaToken.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/KibanaToken.g.cs index c77defe9da9..4e29b8f52df 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/KibanaToken.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/KibanaToken.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class KibanaTokenConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - - public override Elastic.Clients.Elasticsearch.Security.KibanaToken Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - LocalJsonValue propValue = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.KibanaToken(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value, - Value = propValue.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.KibanaToken value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropValue, value.Value, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.KibanaTokenConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.KibanaTokenConverter))] public sealed partial class KibanaToken { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ManageUserPrivileges.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ManageUserPrivileges.Converters.g.cs new file mode 100644 index 00000000000..b920bf853b4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ManageUserPrivileges.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ManageUserPrivilegesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApplications = System.Text.Json.JsonEncodedText.Encode("applications"); + + public override Elastic.Clients.Elasticsearch.Security.ManageUserPrivileges Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propApplications = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApplications.TryReadProperty(ref reader, options, PropApplications, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.ManageUserPrivileges(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Applications = propApplications.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ManageUserPrivileges value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApplications, value.Applications, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ManageUserPrivileges.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ManageUserPrivileges.g.cs index 7320ca241f2..1ca30ed2867 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ManageUserPrivileges.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ManageUserPrivileges.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class ManageUserPrivilegesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApplications = System.Text.Json.JsonEncodedText.Encode("applications"); - - public override Elastic.Clients.Elasticsearch.Security.ManageUserPrivileges Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propApplications = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApplications.TryReadProperty(ref reader, options, PropApplications, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.ManageUserPrivileges(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Applications = propApplications.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ManageUserPrivileges value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApplications, value.Applications, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ManageUserPrivilegesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ManageUserPrivilegesConverter))] public sealed partial class ManageUserPrivileges { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/NodesCredentials.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/NodesCredentials.Converters.g.cs new file mode 100644 index 00000000000..f41f465507a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/NodesCredentials.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class NodesCredentialsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFileTokens = System.Text.Json.JsonEncodedText.Encode("file_tokens"); + private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("_nodes"); + + public override Elastic.Clients.Elasticsearch.Security.NodesCredentials Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propFileTokens = default; + LocalJsonValue propNodes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFileTokens.TryReadProperty(ref reader, options, PropFileTokens, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propNodes.TryReadProperty(ref reader, options, PropNodes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.NodesCredentials(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FileTokens = propFileTokens.Value, + Nodes = propNodes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.NodesCredentials value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFileTokens, value.FileTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNodes, value.Nodes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/NodesCredentials.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/NodesCredentials.g.cs index a164f7a1fc0..67eaf7d91d4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/NodesCredentials.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/NodesCredentials.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class NodesCredentialsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFileTokens = System.Text.Json.JsonEncodedText.Encode("file_tokens"); - private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("_nodes"); - - public override Elastic.Clients.Elasticsearch.Security.NodesCredentials Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propFileTokens = default; - LocalJsonValue propNodes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFileTokens.TryReadProperty(ref reader, options, PropFileTokens, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propNodes.TryReadProperty(ref reader, options, PropNodes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.NodesCredentials(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FileTokens = propFileTokens.Value, - Nodes = propNodes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.NodesCredentials value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFileTokens, value.FileTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNodes, value.Nodes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.NodesCredentialsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.NodesCredentialsConverter))] public sealed partial class NodesCredentials { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/NodesCredentialsFileToken.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/NodesCredentialsFileToken.Converters.g.cs new file mode 100644 index 00000000000..b29d5d51e5a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/NodesCredentialsFileToken.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class NodesCredentialsFileTokenConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); + + public override Elastic.Clients.Elasticsearch.Security.NodesCredentialsFileToken Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propNodes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.NodesCredentialsFileToken(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Nodes = propNodes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.NodesCredentialsFileToken value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/NodesCredentialsFileToken.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/NodesCredentialsFileToken.g.cs index 6eab7703bd0..e8763bbb7dc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/NodesCredentialsFileToken.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/NodesCredentialsFileToken.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class NodesCredentialsFileTokenConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); - - public override Elastic.Clients.Elasticsearch.Security.NodesCredentialsFileToken Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propNodes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.NodesCredentialsFileToken(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Nodes = propNodes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.NodesCredentialsFileToken value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.NodesCredentialsFileTokenConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.NodesCredentialsFileTokenConverter))] public sealed partial class NodesCredentialsFileToken { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/PrivilegeActions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/PrivilegeActions.Converters.g.cs new file mode 100644 index 00000000000..ad46826f4e4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/PrivilegeActions.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class PrivilegeActionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropActions = System.Text.Json.JsonEncodedText.Encode("actions"); + private static readonly System.Text.Json.JsonEncodedText PropApplication = System.Text.Json.JsonEncodedText.Encode("application"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.Security.PrivilegeActions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propActions = default; + LocalJsonValue propApplication = default; + LocalJsonValue?> propMetadata = default; + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propActions.TryReadProperty(ref reader, options, PropActions, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propApplication.TryReadProperty(ref reader, options, PropApplication, null)) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.PrivilegeActions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Actions = propActions.Value, + Application = propApplication.Value, + Metadata = propMetadata.Value, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.PrivilegeActions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropActions, value.Actions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropApplication, value.Application, null, null); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/PrivilegeActions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/PrivilegeActions.g.cs index 71f9db27ebd..f9d93fe4957 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/PrivilegeActions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/PrivilegeActions.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class PrivilegeActionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropActions = System.Text.Json.JsonEncodedText.Encode("actions"); - private static readonly System.Text.Json.JsonEncodedText PropApplication = System.Text.Json.JsonEncodedText.Encode("application"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.Security.PrivilegeActions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propActions = default; - LocalJsonValue propApplication = default; - LocalJsonValue?> propMetadata = default; - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propActions.TryReadProperty(ref reader, options, PropActions, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propApplication.TryReadProperty(ref reader, options, PropApplication, null)) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.PrivilegeActions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Actions = propActions.Value, - Application = propApplication.Value, - Metadata = propMetadata.Value, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.PrivilegeActions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropActions, value.Actions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropApplication, value.Application, null, null); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.PrivilegeActionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.PrivilegeActionsConverter))] public sealed partial class PrivilegeActions { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/PrivilegesCheck.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/PrivilegesCheck.Converters.g.cs new file mode 100644 index 00000000000..d2341752da4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/PrivilegesCheck.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class PrivilegesCheckConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApplication = System.Text.Json.JsonEncodedText.Encode("application"); + private static readonly System.Text.Json.JsonEncodedText PropCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + + public override Elastic.Clients.Elasticsearch.Security.PrivilegesCheck Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propApplication = default; + LocalJsonValue?> propCluster = default; + LocalJsonValue?> propIndex = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApplication.TryReadProperty(ref reader, options, PropApplication, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propCluster.TryReadProperty(ref reader, options, PropCluster, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.PrivilegesCheck(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Application = propApplication.Value, + Cluster = propCluster.Value, + Index = propIndex.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.PrivilegesCheck value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApplication, value.Application, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCluster, value.Cluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/PrivilegesCheck.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/PrivilegesCheck.g.cs index e9231390de1..7d52ab2ab1b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/PrivilegesCheck.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/PrivilegesCheck.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class PrivilegesCheckConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApplication = System.Text.Json.JsonEncodedText.Encode("application"); - private static readonly System.Text.Json.JsonEncodedText PropCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - - public override Elastic.Clients.Elasticsearch.Security.PrivilegesCheck Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propApplication = default; - LocalJsonValue?> propCluster = default; - LocalJsonValue?> propIndex = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApplication.TryReadProperty(ref reader, options, PropApplication, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propCluster.TryReadProperty(ref reader, options, PropCluster, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.PrivilegesCheck(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Application = propApplication.Value, - Cluster = propCluster.Value, - Index = propIndex.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.PrivilegesCheck value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApplication, value.Application, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCluster, value.Cluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.PrivilegesCheckConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.PrivilegesCheckConverter))] public sealed partial class PrivilegesCheck { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/QueryRole.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/QueryRole.Converters.g.cs new file mode 100644 index 00000000000..20edbb5ad7b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/QueryRole.Converters.g.cs @@ -0,0 +1,172 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class QueryRoleConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApplications = System.Text.Json.JsonEncodedText.Encode("applications"); + private static readonly System.Text.Json.JsonEncodedText PropCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropGlobal = System.Text.Json.JsonEncodedText.Encode("global"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropIndices1 = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropRemoteCluster = System.Text.Json.JsonEncodedText.Encode("remote_cluster"); + private static readonly System.Text.Json.JsonEncodedText PropRemoteIndices = System.Text.Json.JsonEncodedText.Encode("remote_indices"); + private static readonly System.Text.Json.JsonEncodedText PropRestriction = System.Text.Json.JsonEncodedText.Encode("restriction"); + private static readonly System.Text.Json.JsonEncodedText PropRunAs = System.Text.Json.JsonEncodedText.Encode("run_as"); + private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("_sort"); + private static readonly System.Text.Json.JsonEncodedText PropTransientMetadata = System.Text.Json.JsonEncodedText.Encode("transient_metadata"); + + public override Elastic.Clients.Elasticsearch.Security.QueryRole Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propApplications = default; + LocalJsonValue?> propCluster = default; + LocalJsonValue propDescription = default; + LocalJsonValue?> propGlobal = default; + LocalJsonValue?> propIndices = default; + LocalJsonValue?> propMetadata = default; + LocalJsonValue propName = default; + LocalJsonValue?> propRemoteCluster = default; + LocalJsonValue?> propRemoteIndices = default; + LocalJsonValue propRestriction = default; + LocalJsonValue?> propRunAs = default; + LocalJsonValue?> propSort = default; + LocalJsonValue?> propTransientMetadata = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApplications.TryReadProperty(ref reader, options, PropApplications, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propCluster.TryReadProperty(ref reader, options, PropCluster, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propGlobal.TryReadProperty(ref reader, options, PropGlobal, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)) || propIndices.TryReadProperty(ref reader, options, PropIndices1, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propRemoteCluster.TryReadProperty(ref reader, options, PropRemoteCluster, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propRemoteIndices.TryReadProperty(ref reader, options, PropRemoteIndices, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propRestriction.TryReadProperty(ref reader, options, PropRestriction, null)) + { + continue; + } + + if (propRunAs.TryReadProperty(ref reader, options, PropRunAs, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTransientMetadata.TryReadProperty(ref reader, options, PropTransientMetadata, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.QueryRole(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Applications = propApplications.Value, + Cluster = propCluster.Value, + Description = propDescription.Value, + Global = propGlobal.Value, + Indices = propIndices.Value, + Metadata = propMetadata.Value, + Name = propName.Value, + RemoteCluster = propRemoteCluster.Value, + RemoteIndices = propRemoteIndices.Value, + Restriction = propRestriction.Value, + RunAs = propRunAs.Value, + Sort = propSort.Value, + TransientMetadata = propTransientMetadata.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.QueryRole value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApplications, value.Applications, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCluster, value.Cluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropGlobal, value.Global, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropRemoteCluster, value.RemoteCluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRemoteIndices, value.RemoteIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRestriction, value.Restriction, null, null); + writer.WriteProperty(options, PropRunAs, value.RunAs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTransientMetadata, value.TransientMetadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/QueryRole.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/QueryRole.g.cs index c6507a71ff7..ada7eee887f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/QueryRole.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/QueryRole.g.cs @@ -23,155 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class QueryRoleConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApplications = System.Text.Json.JsonEncodedText.Encode("applications"); - private static readonly System.Text.Json.JsonEncodedText PropCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropGlobal = System.Text.Json.JsonEncodedText.Encode("global"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropIndices1 = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropRemoteCluster = System.Text.Json.JsonEncodedText.Encode("remote_cluster"); - private static readonly System.Text.Json.JsonEncodedText PropRemoteIndices = System.Text.Json.JsonEncodedText.Encode("remote_indices"); - private static readonly System.Text.Json.JsonEncodedText PropRestriction = System.Text.Json.JsonEncodedText.Encode("restriction"); - private static readonly System.Text.Json.JsonEncodedText PropRunAs = System.Text.Json.JsonEncodedText.Encode("run_as"); - private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("_sort"); - private static readonly System.Text.Json.JsonEncodedText PropTransientMetadata = System.Text.Json.JsonEncodedText.Encode("transient_metadata"); - - public override Elastic.Clients.Elasticsearch.Security.QueryRole Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propApplications = default; - LocalJsonValue?> propCluster = default; - LocalJsonValue propDescription = default; - LocalJsonValue?> propGlobal = default; - LocalJsonValue?> propIndices = default; - LocalJsonValue?> propMetadata = default; - LocalJsonValue propName = default; - LocalJsonValue?> propRemoteCluster = default; - LocalJsonValue?> propRemoteIndices = default; - LocalJsonValue propRestriction = default; - LocalJsonValue?> propRunAs = default; - LocalJsonValue?> propSort = default; - LocalJsonValue?> propTransientMetadata = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApplications.TryReadProperty(ref reader, options, PropApplications, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propCluster.TryReadProperty(ref reader, options, PropCluster, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propGlobal.TryReadProperty(ref reader, options, PropGlobal, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)) || propIndices.TryReadProperty(ref reader, options, PropIndices1, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propRemoteCluster.TryReadProperty(ref reader, options, PropRemoteCluster, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propRemoteIndices.TryReadProperty(ref reader, options, PropRemoteIndices, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propRestriction.TryReadProperty(ref reader, options, PropRestriction, null)) - { - continue; - } - - if (propRunAs.TryReadProperty(ref reader, options, PropRunAs, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTransientMetadata.TryReadProperty(ref reader, options, PropTransientMetadata, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.QueryRole(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Applications = propApplications.Value, - Cluster = propCluster.Value, - Description = propDescription.Value, - Global = propGlobal.Value, - Indices = propIndices.Value, - Metadata = propMetadata.Value, - Name = propName.Value, - RemoteCluster = propRemoteCluster.Value, - RemoteIndices = propRemoteIndices.Value, - Restriction = propRestriction.Value, - RunAs = propRunAs.Value, - Sort = propSort.Value, - TransientMetadata = propTransientMetadata.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.QueryRole value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApplications, value.Applications, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCluster, value.Cluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropGlobal, value.Global, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropRemoteCluster, value.RemoteCluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRemoteIndices, value.RemoteIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRestriction, value.Restriction, null, null); - writer.WriteProperty(options, PropRunAs, value.RunAs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTransientMetadata, value.TransientMetadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.QueryRoleConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.QueryRoleConverter))] public sealed partial class QueryRole { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/QueryUser.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/QueryUser.Converters.g.cs new file mode 100644 index 00000000000..2a2e7b2bb98 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/QueryUser.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class QueryUserConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEmail = System.Text.Json.JsonEncodedText.Encode("email"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropFullName = System.Text.Json.JsonEncodedText.Encode("full_name"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropProfileUid = System.Text.Json.JsonEncodedText.Encode("profile_uid"); + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("_sort"); + private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); + + public override Elastic.Clients.Elasticsearch.Security.QueryUser Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEmail = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propFullName = default; + LocalJsonValue> propMetadata = default; + LocalJsonValue propProfileUid = default; + LocalJsonValue> propRoles = default; + LocalJsonValue?> propSort = default; + LocalJsonValue propUsername = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEmail.TryReadProperty(ref reader, options, PropEmail, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propFullName.TryReadProperty(ref reader, options, PropFullName, null)) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (propProfileUid.TryReadProperty(ref reader, options, PropProfileUid, null)) + { + continue; + } + + if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.QueryUser(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Email = propEmail.Value, + Enabled = propEnabled.Value, + FullName = propFullName.Value, + Metadata = propMetadata.Value, + ProfileUid = propProfileUid.Value, + Roles = propRoles.Value, + Sort = propSort.Value, + Username = propUsername.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.QueryUser value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEmail, value.Email, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropFullName, value.FullName, null, null); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropProfileUid, value.ProfileUid, null, null); + writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropUsername, value.Username, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/QueryUser.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/QueryUser.g.cs index 1b5cf1187bf..ed8f2e14b35 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/QueryUser.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/QueryUser.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class QueryUserConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEmail = System.Text.Json.JsonEncodedText.Encode("email"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropFullName = System.Text.Json.JsonEncodedText.Encode("full_name"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropProfileUid = System.Text.Json.JsonEncodedText.Encode("profile_uid"); - private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); - private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("_sort"); - private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); - - public override Elastic.Clients.Elasticsearch.Security.QueryUser Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEmail = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propFullName = default; - LocalJsonValue> propMetadata = default; - LocalJsonValue propProfileUid = default; - LocalJsonValue> propRoles = default; - LocalJsonValue?> propSort = default; - LocalJsonValue propUsername = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEmail.TryReadProperty(ref reader, options, PropEmail, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propFullName.TryReadProperty(ref reader, options, PropFullName, null)) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (propProfileUid.TryReadProperty(ref reader, options, PropProfileUid, null)) - { - continue; - } - - if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.QueryUser(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Email = propEmail.Value, - Enabled = propEnabled.Value, - FullName = propFullName.Value, - Metadata = propMetadata.Value, - ProfileUid = propProfileUid.Value, - Roles = propRoles.Value, - Sort = propSort.Value, - Username = propUsername.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.QueryUser value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEmail, value.Email, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropFullName, value.FullName, null, null); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropProfileUid, value.ProfileUid, null, null); - writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropUsername, value.Username, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.QueryUserConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.QueryUserConverter))] public sealed partial class QueryUser { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RealmInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RealmInfo.Converters.g.cs new file mode 100644 index 00000000000..78e29c7dd9a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RealmInfo.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class RealmInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Security.RealmInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.RealmInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RealmInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RealmInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RealmInfo.g.cs index 0e82871f4dc..5627dfa0d08 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RealmInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RealmInfo.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class RealmInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Security.RealmInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.RealmInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RealmInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.RealmInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.RealmInfoConverter))] public sealed partial class RealmInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteClusterPrivilege.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteClusterPrivilege.Converters.g.cs new file mode 100644 index 00000000000..6ec2a2cc7bd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteClusterPrivilege.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class RemoteClusterPrivilegeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberMonitorEnrich = System.Text.Json.JsonEncodedText.Encode("monitor_enrich"); + private static readonly System.Text.Json.JsonEncodedText MemberMonitorStats = System.Text.Json.JsonEncodedText.Encode("monitor_stats"); + + public override Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivilege Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberMonitorEnrich)) + { + return Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivilege.MonitorEnrich; + } + + if (reader.ValueTextEquals(MemberMonitorStats)) + { + return Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivilege.MonitorStats; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberMonitorEnrich.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivilege.MonitorEnrich; + } + + if (string.Equals(value, MemberMonitorStats.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivilege.MonitorStats; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivilege)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivilege value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivilege.MonitorEnrich: + writer.WriteStringValue(MemberMonitorEnrich); + break; + case Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivilege.MonitorStats: + writer.WriteStringValue(MemberMonitorStats); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivilege)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivilege ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivilege value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteClusterPrivilege.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteClusterPrivilege.g.cs new file mode 100644 index 00000000000..6ab906f4cbb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteClusterPrivilege.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.RemoteClusterPrivilegeConverter))] +public enum RemoteClusterPrivilege +{ + [System.Runtime.Serialization.EnumMember(Value = "monitor_enrich")] + MonitorEnrich, + [System.Runtime.Serialization.EnumMember(Value = "monitor_stats")] + MonitorStats +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteClusterPrivileges.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteClusterPrivileges.Converters.g.cs new file mode 100644 index 00000000000..6c4aea8a078 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteClusterPrivileges.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class RemoteClusterPrivilegesConverter : 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 PropPrivileges = System.Text.Json.JsonEncodedText.Encode("privileges"); + + public override Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivileges Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClusters = default; + LocalJsonValue> propPrivileges = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClusters.TryReadProperty(ref reader, options, PropClusters, null)) + { + continue; + } + + if (propPrivileges.TryReadProperty(ref reader, options, PropPrivileges, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivileges(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Clusters = propClusters.Value, + Privileges = propPrivileges.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivileges value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClusters, value.Clusters, null, null); + writer.WriteProperty(options, PropPrivileges, value.Privileges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteClusterPrivileges.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteClusterPrivileges.g.cs index 2d4c502d1b6..3666ddf1460 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteClusterPrivileges.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteClusterPrivileges.g.cs @@ -23,60 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class RemoteClusterPrivilegesConverter : 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 PropPrivileges = System.Text.Json.JsonEncodedText.Encode("privileges"); - - public override Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivileges Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClusters = default; - LocalJsonValue> propPrivileges = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClusters.TryReadProperty(ref reader, options, PropClusters, null)) - { - continue; - } - - if (propPrivileges.TryReadProperty(ref reader, options, PropPrivileges, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivileges(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Clusters = propClusters.Value, - Privileges = propPrivileges.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivileges value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClusters, value.Clusters, null, null); - writer.WriteProperty(options, PropPrivileges, value.Privileges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - /// /// /// The subset of cluster level privileges that can be defined for remote clusters. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.RemoteClusterPrivilegesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.RemoteClusterPrivilegesConverter))] public sealed partial class RemoteClusterPrivileges { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteIndicesPrivileges.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteIndicesPrivileges.Converters.g.cs new file mode 100644 index 00000000000..f2879cf0e99 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteIndicesPrivileges.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class RemoteIndicesPrivilegesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowRestrictedIndices = System.Text.Json.JsonEncodedText.Encode("allow_restricted_indices"); + private static readonly System.Text.Json.JsonEncodedText PropClusters = System.Text.Json.JsonEncodedText.Encode("clusters"); + private static readonly System.Text.Json.JsonEncodedText PropFieldSecurity = System.Text.Json.JsonEncodedText.Encode("field_security"); + private static readonly System.Text.Json.JsonEncodedText PropNames = System.Text.Json.JsonEncodedText.Encode("names"); + private static readonly System.Text.Json.JsonEncodedText PropPrivileges = System.Text.Json.JsonEncodedText.Encode("privileges"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + + public override Elastic.Clients.Elasticsearch.Security.RemoteIndicesPrivileges Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowRestrictedIndices = default; + LocalJsonValue propClusters = default; + LocalJsonValue propFieldSecurity = default; + LocalJsonValue> propNames = default; + LocalJsonValue> propPrivileges = default; + LocalJsonValue propQuery = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowRestrictedIndices.TryReadProperty(ref reader, options, PropAllowRestrictedIndices, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propClusters.TryReadProperty(ref reader, options, PropClusters, null)) + { + continue; + } + + if (propFieldSecurity.TryReadProperty(ref reader, options, PropFieldSecurity, null)) + { + continue; + } + + if (propNames.TryReadProperty(ref reader, options, PropNames, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propPrivileges.TryReadProperty(ref reader, options, PropPrivileges, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.RemoteIndicesPrivileges(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowRestrictedIndices = propAllowRestrictedIndices.Value, + Clusters = propClusters.Value, + FieldSecurity = propFieldSecurity.Value, + Names = propNames.Value, + Privileges = propPrivileges.Value, + Query = propQuery.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RemoteIndicesPrivileges value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowRestrictedIndices, value.AllowRestrictedIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropClusters, value.Clusters, null, null); + writer.WriteProperty(options, PropFieldSecurity, value.FieldSecurity, null, null); + writer.WriteProperty(options, PropNames, value.Names, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPrivileges, value.Privileges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropQuery, value.Query, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteIndicesPrivileges.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteIndicesPrivileges.g.cs index 824b21ee81d..2f552fa7d1e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteIndicesPrivileges.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteIndicesPrivileges.g.cs @@ -23,96 +23,12 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class RemoteIndicesPrivilegesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowRestrictedIndices = System.Text.Json.JsonEncodedText.Encode("allow_restricted_indices"); - private static readonly System.Text.Json.JsonEncodedText PropClusters = System.Text.Json.JsonEncodedText.Encode("clusters"); - private static readonly System.Text.Json.JsonEncodedText PropFieldSecurity = System.Text.Json.JsonEncodedText.Encode("field_security"); - private static readonly System.Text.Json.JsonEncodedText PropNames = System.Text.Json.JsonEncodedText.Encode("names"); - private static readonly System.Text.Json.JsonEncodedText PropPrivileges = System.Text.Json.JsonEncodedText.Encode("privileges"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - - public override Elastic.Clients.Elasticsearch.Security.RemoteIndicesPrivileges Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowRestrictedIndices = default; - LocalJsonValue propClusters = default; - LocalJsonValue propFieldSecurity = default; - LocalJsonValue> propNames = default; - LocalJsonValue> propPrivileges = default; - LocalJsonValue propQuery = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowRestrictedIndices.TryReadProperty(ref reader, options, PropAllowRestrictedIndices, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propClusters.TryReadProperty(ref reader, options, PropClusters, null)) - { - continue; - } - - if (propFieldSecurity.TryReadProperty(ref reader, options, PropFieldSecurity, null)) - { - continue; - } - - if (propNames.TryReadProperty(ref reader, options, PropNames, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (propPrivileges.TryReadProperty(ref reader, options, PropPrivileges, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.RemoteIndicesPrivileges(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowRestrictedIndices = propAllowRestrictedIndices.Value, - Clusters = propClusters.Value, - FieldSecurity = propFieldSecurity.Value, - Names = propNames.Value, - Privileges = propPrivileges.Value, - Query = propQuery.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RemoteIndicesPrivileges value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowRestrictedIndices, value.AllowRestrictedIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropClusters, value.Clusters, null, null); - writer.WriteProperty(options, PropFieldSecurity, value.FieldSecurity, null, null); - writer.WriteProperty(options, PropNames, value.Names, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPrivileges, value.Privileges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropQuery, value.Query, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteEndObject(); - } -} - /// /// /// The subset of index level privileges that can be defined for remote clusters. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.RemoteIndicesPrivilegesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.RemoteIndicesPrivilegesConverter))] public sealed partial class RemoteIndicesPrivileges { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteUserIndicesPrivileges.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteUserIndicesPrivileges.Converters.g.cs new file mode 100644 index 00000000000..cad164e854b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteUserIndicesPrivileges.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class RemoteUserIndicesPrivilegesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowRestrictedIndices = System.Text.Json.JsonEncodedText.Encode("allow_restricted_indices"); + private static readonly System.Text.Json.JsonEncodedText PropClusters = System.Text.Json.JsonEncodedText.Encode("clusters"); + private static readonly System.Text.Json.JsonEncodedText PropFieldSecurity = System.Text.Json.JsonEncodedText.Encode("field_security"); + private static readonly System.Text.Json.JsonEncodedText PropNames = System.Text.Json.JsonEncodedText.Encode("names"); + private static readonly System.Text.Json.JsonEncodedText PropPrivileges = System.Text.Json.JsonEncodedText.Encode("privileges"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + + public override Elastic.Clients.Elasticsearch.Security.RemoteUserIndicesPrivileges Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowRestrictedIndices = default; + LocalJsonValue> propClusters = default; + LocalJsonValue?> propFieldSecurity = default; + LocalJsonValue> propNames = default; + LocalJsonValue> propPrivileges = default; + LocalJsonValue propQuery = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowRestrictedIndices.TryReadProperty(ref reader, options, PropAllowRestrictedIndices, null)) + { + continue; + } + + if (propClusters.TryReadProperty(ref reader, options, PropClusters, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propFieldSecurity.TryReadProperty(ref reader, options, PropFieldSecurity, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propNames.TryReadProperty(ref reader, options, PropNames, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propPrivileges.TryReadProperty(ref reader, options, PropPrivileges, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.RemoteUserIndicesPrivileges(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowRestrictedIndices = propAllowRestrictedIndices.Value, + Clusters = propClusters.Value, + FieldSecurity = propFieldSecurity.Value, + Names = propNames.Value, + Privileges = propPrivileges.Value, + Query = propQuery.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RemoteUserIndicesPrivileges value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowRestrictedIndices, value.AllowRestrictedIndices, null, null); + writer.WriteProperty(options, PropClusters, value.Clusters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFieldSecurity, value.FieldSecurity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropNames, value.Names, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPrivileges, value.Privileges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropQuery, value.Query, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteUserIndicesPrivileges.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteUserIndicesPrivileges.g.cs index 3e1c8c523c6..0f4264c01d5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteUserIndicesPrivileges.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RemoteUserIndicesPrivileges.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class RemoteUserIndicesPrivilegesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowRestrictedIndices = System.Text.Json.JsonEncodedText.Encode("allow_restricted_indices"); - private static readonly System.Text.Json.JsonEncodedText PropClusters = System.Text.Json.JsonEncodedText.Encode("clusters"); - private static readonly System.Text.Json.JsonEncodedText PropFieldSecurity = System.Text.Json.JsonEncodedText.Encode("field_security"); - private static readonly System.Text.Json.JsonEncodedText PropNames = System.Text.Json.JsonEncodedText.Encode("names"); - private static readonly System.Text.Json.JsonEncodedText PropPrivileges = System.Text.Json.JsonEncodedText.Encode("privileges"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - - public override Elastic.Clients.Elasticsearch.Security.RemoteUserIndicesPrivileges Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowRestrictedIndices = default; - LocalJsonValue> propClusters = default; - LocalJsonValue?> propFieldSecurity = default; - LocalJsonValue> propNames = default; - LocalJsonValue> propPrivileges = default; - LocalJsonValue propQuery = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowRestrictedIndices.TryReadProperty(ref reader, options, PropAllowRestrictedIndices, null)) - { - continue; - } - - if (propClusters.TryReadProperty(ref reader, options, PropClusters, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propFieldSecurity.TryReadProperty(ref reader, options, PropFieldSecurity, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propNames.TryReadProperty(ref reader, options, PropNames, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (propPrivileges.TryReadProperty(ref reader, options, PropPrivileges, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.RemoteUserIndicesPrivileges(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowRestrictedIndices = propAllowRestrictedIndices.Value, - Clusters = propClusters.Value, - FieldSecurity = propFieldSecurity.Value, - Names = propNames.Value, - Privileges = propPrivileges.Value, - Query = propQuery.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RemoteUserIndicesPrivileges value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowRestrictedIndices, value.AllowRestrictedIndices, null, null); - writer.WriteProperty(options, PropClusters, value.Clusters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFieldSecurity, value.FieldSecurity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropNames, value.Names, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPrivileges, value.Privileges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropQuery, value.Query, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.RemoteUserIndicesPrivilegesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.RemoteUserIndicesPrivilegesConverter))] public sealed partial class RemoteUserIndicesPrivileges { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ReplicationAccess.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ReplicationAccess.Converters.g.cs new file mode 100644 index 00000000000..2a3bf12cf08 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ReplicationAccess.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ReplicationAccessConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowRestrictedIndices = System.Text.Json.JsonEncodedText.Encode("allow_restricted_indices"); + private static readonly System.Text.Json.JsonEncodedText PropNames = System.Text.Json.JsonEncodedText.Encode("names"); + + public override Elastic.Clients.Elasticsearch.Security.ReplicationAccess Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowRestrictedIndices = default; + LocalJsonValue> propNames = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowRestrictedIndices.TryReadProperty(ref reader, options, PropAllowRestrictedIndices, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNames.TryReadProperty(ref reader, options, PropNames, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.ReplicationAccess(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowRestrictedIndices = propAllowRestrictedIndices.Value, + Names = propNames.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ReplicationAccess value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowRestrictedIndices, value.AllowRestrictedIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNames, value.Names, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ReplicationAccess.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ReplicationAccess.g.cs index 03458bc56b7..7b53b1fc55f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ReplicationAccess.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ReplicationAccess.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class ReplicationAccessConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowRestrictedIndices = System.Text.Json.JsonEncodedText.Encode("allow_restricted_indices"); - private static readonly System.Text.Json.JsonEncodedText PropNames = System.Text.Json.JsonEncodedText.Encode("names"); - - public override Elastic.Clients.Elasticsearch.Security.ReplicationAccess Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowRestrictedIndices = default; - LocalJsonValue> propNames = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowRestrictedIndices.TryReadProperty(ref reader, options, PropAllowRestrictedIndices, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNames.TryReadProperty(ref reader, options, PropNames, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.ReplicationAccess(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowRestrictedIndices = propAllowRestrictedIndices.Value, - Names = propNames.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ReplicationAccess value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowRestrictedIndices, value.AllowRestrictedIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNames, value.Names, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ReplicationAccessConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ReplicationAccessConverter))] public sealed partial class ReplicationAccess { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Restriction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Restriction.Converters.g.cs new file mode 100644 index 00000000000..732f94661e2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Restriction.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class RestrictionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropWorkflows = System.Text.Json.JsonEncodedText.Encode("workflows"); + + public override Elastic.Clients.Elasticsearch.Security.Restriction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propWorkflows = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propWorkflows.TryReadProperty(ref reader, options, PropWorkflows, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.Restriction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Workflows = propWorkflows.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.Restriction value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropWorkflows, value.Workflows, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Restriction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Restriction.g.cs index 2196d55500b..a1fa523860a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Restriction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/Restriction.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class RestrictionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropWorkflows = System.Text.Json.JsonEncodedText.Encode("workflows"); - - public override Elastic.Clients.Elasticsearch.Security.Restriction Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propWorkflows = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propWorkflows.TryReadProperty(ref reader, options, PropWorkflows, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.Restriction(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Workflows = propWorkflows.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.Restriction value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropWorkflows, value.Workflows, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.RestrictionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.RestrictionConverter))] public sealed partial class Restriction { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RestrictionWorkflow.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RestrictionWorkflow.Converters.g.cs new file mode 100644 index 00000000000..c03a769442d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RestrictionWorkflow.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class RestrictionWorkflowConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.RestrictionWorkflow Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Security.RestrictionWorkflow(reader.ReadValue(options, null)); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RestrictionWorkflow value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.Value, null); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RestrictionWorkflow.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RestrictionWorkflow.g.cs new file mode 100644 index 00000000000..bc0ff01cb23 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RestrictionWorkflow.g.cs @@ -0,0 +1,49 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.RestrictionWorkflowConverter))] +public readonly partial struct RestrictionWorkflow : Elastic.Clients.Elasticsearch.Serialization.IEnumStruct +{ + public RestrictionWorkflow(string value) => Value = value; +#if NET7_0_OR_GREATER + static RestrictionWorkflow IEnumStruct.Create(string value) => value; +#else + RestrictionWorkflow IEnumStruct.Create(string value) => value; +#endif + public readonly string Value { get; } + public static RestrictionWorkflow SearchApplicationQuery { get; } = new RestrictionWorkflow("search_application_query"); + + public override string ToString() => Value ?? string.Empty; + + public static implicit operator string(RestrictionWorkflow @enum) => @enum.Value; + public static implicit operator RestrictionWorkflow(string value) => new(value); + + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals(object obj) => obj is RestrictionWorkflow other && this.Equals(other); + public bool Equals(RestrictionWorkflow other) => Value == other.Value; + + public static bool operator ==(RestrictionWorkflow a, RestrictionWorkflow b) => a.Equals(b); + public static bool operator !=(RestrictionWorkflow a, RestrictionWorkflow b) => !(a == b); +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleDescriptor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleDescriptor.Converters.g.cs new file mode 100644 index 00000000000..bf37deb9d8d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleDescriptor.Converters.g.cs @@ -0,0 +1,154 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class RoleDescriptorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApplications = System.Text.Json.JsonEncodedText.Encode("applications"); + private static readonly System.Text.Json.JsonEncodedText PropCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropGlobal = System.Text.Json.JsonEncodedText.Encode("global"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropIndices1 = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropRemoteCluster = System.Text.Json.JsonEncodedText.Encode("remote_cluster"); + private static readonly System.Text.Json.JsonEncodedText PropRemoteIndices = System.Text.Json.JsonEncodedText.Encode("remote_indices"); + private static readonly System.Text.Json.JsonEncodedText PropRestriction = System.Text.Json.JsonEncodedText.Encode("restriction"); + private static readonly System.Text.Json.JsonEncodedText PropRunAs = System.Text.Json.JsonEncodedText.Encode("run_as"); + private static readonly System.Text.Json.JsonEncodedText PropTransientMetadata = System.Text.Json.JsonEncodedText.Encode("transient_metadata"); + + public override Elastic.Clients.Elasticsearch.Security.RoleDescriptor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propApplications = default; + LocalJsonValue?> propCluster = default; + LocalJsonValue propDescription = default; + LocalJsonValue?> propGlobal = default; + LocalJsonValue?> propIndices = default; + LocalJsonValue?> propMetadata = default; + LocalJsonValue?> propRemoteCluster = default; + LocalJsonValue?> propRemoteIndices = default; + LocalJsonValue propRestriction = default; + LocalJsonValue?> propRunAs = default; + LocalJsonValue?> propTransientMetadata = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApplications.TryReadProperty(ref reader, options, PropApplications, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propCluster.TryReadProperty(ref reader, options, PropCluster, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propGlobal.TryReadProperty(ref reader, options, PropGlobal, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)) || propIndices.TryReadProperty(ref reader, options, PropIndices1, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propRemoteCluster.TryReadProperty(ref reader, options, PropRemoteCluster, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propRemoteIndices.TryReadProperty(ref reader, options, PropRemoteIndices, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propRestriction.TryReadProperty(ref reader, options, PropRestriction, null)) + { + continue; + } + + if (propRunAs.TryReadProperty(ref reader, options, PropRunAs, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTransientMetadata.TryReadProperty(ref reader, options, PropTransientMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.RoleDescriptor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Applications = propApplications.Value, + Cluster = propCluster.Value, + Description = propDescription.Value, + Global = propGlobal.Value, + Indices = propIndices.Value, + Metadata = propMetadata.Value, + RemoteCluster = propRemoteCluster.Value, + RemoteIndices = propRemoteIndices.Value, + Restriction = propRestriction.Value, + RunAs = propRunAs.Value, + TransientMetadata = propTransientMetadata.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RoleDescriptor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApplications, value.Applications, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCluster, value.Cluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropGlobal, value.Global, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropRemoteCluster, value.RemoteCluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRemoteIndices, value.RemoteIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRestriction, value.Restriction, null, null); + writer.WriteProperty(options, PropRunAs, value.RunAs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTransientMetadata, value.TransientMetadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleDescriptor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleDescriptor.g.cs index 1e6e15ac20c..1eacebba2f2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleDescriptor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleDescriptor.g.cs @@ -23,137 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class RoleDescriptorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApplications = System.Text.Json.JsonEncodedText.Encode("applications"); - private static readonly System.Text.Json.JsonEncodedText PropCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropGlobal = System.Text.Json.JsonEncodedText.Encode("global"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropIndices1 = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropRemoteCluster = System.Text.Json.JsonEncodedText.Encode("remote_cluster"); - private static readonly System.Text.Json.JsonEncodedText PropRemoteIndices = System.Text.Json.JsonEncodedText.Encode("remote_indices"); - private static readonly System.Text.Json.JsonEncodedText PropRestriction = System.Text.Json.JsonEncodedText.Encode("restriction"); - private static readonly System.Text.Json.JsonEncodedText PropRunAs = System.Text.Json.JsonEncodedText.Encode("run_as"); - private static readonly System.Text.Json.JsonEncodedText PropTransientMetadata = System.Text.Json.JsonEncodedText.Encode("transient_metadata"); - - public override Elastic.Clients.Elasticsearch.Security.RoleDescriptor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propApplications = default; - LocalJsonValue?> propCluster = default; - LocalJsonValue propDescription = default; - LocalJsonValue?> propGlobal = default; - LocalJsonValue?> propIndices = default; - LocalJsonValue?> propMetadata = default; - LocalJsonValue?> propRemoteCluster = default; - LocalJsonValue?> propRemoteIndices = default; - LocalJsonValue propRestriction = default; - LocalJsonValue?> propRunAs = default; - LocalJsonValue?> propTransientMetadata = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApplications.TryReadProperty(ref reader, options, PropApplications, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propCluster.TryReadProperty(ref reader, options, PropCluster, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propGlobal.TryReadProperty(ref reader, options, PropGlobal, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)) || propIndices.TryReadProperty(ref reader, options, PropIndices1, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propRemoteCluster.TryReadProperty(ref reader, options, PropRemoteCluster, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propRemoteIndices.TryReadProperty(ref reader, options, PropRemoteIndices, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propRestriction.TryReadProperty(ref reader, options, PropRestriction, null)) - { - continue; - } - - if (propRunAs.TryReadProperty(ref reader, options, PropRunAs, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTransientMetadata.TryReadProperty(ref reader, options, PropTransientMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.RoleDescriptor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Applications = propApplications.Value, - Cluster = propCluster.Value, - Description = propDescription.Value, - Global = propGlobal.Value, - Indices = propIndices.Value, - Metadata = propMetadata.Value, - RemoteCluster = propRemoteCluster.Value, - RemoteIndices = propRemoteIndices.Value, - Restriction = propRestriction.Value, - RunAs = propRunAs.Value, - TransientMetadata = propTransientMetadata.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RoleDescriptor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApplications, value.Applications, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCluster, value.Cluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropGlobal, value.Global, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropRemoteCluster, value.RemoteCluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRemoteIndices, value.RemoteIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRestriction, value.Restriction, null, null); - writer.WriteProperty(options, PropRunAs, value.RunAs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTransientMetadata, value.TransientMetadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.RoleDescriptorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.RoleDescriptorConverter))] public sealed partial class RoleDescriptor { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleDescriptorRead.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleDescriptorRead.Converters.g.cs new file mode 100644 index 00000000000..0d2b6c8e378 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleDescriptorRead.Converters.g.cs @@ -0,0 +1,154 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class RoleDescriptorReadConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApplications = System.Text.Json.JsonEncodedText.Encode("applications"); + private static readonly System.Text.Json.JsonEncodedText PropCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropGlobal = System.Text.Json.JsonEncodedText.Encode("global"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropIndices1 = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropRemoteCluster = System.Text.Json.JsonEncodedText.Encode("remote_cluster"); + private static readonly System.Text.Json.JsonEncodedText PropRemoteIndices = System.Text.Json.JsonEncodedText.Encode("remote_indices"); + private static readonly System.Text.Json.JsonEncodedText PropRestriction = System.Text.Json.JsonEncodedText.Encode("restriction"); + private static readonly System.Text.Json.JsonEncodedText PropRunAs = System.Text.Json.JsonEncodedText.Encode("run_as"); + private static readonly System.Text.Json.JsonEncodedText PropTransientMetadata = System.Text.Json.JsonEncodedText.Encode("transient_metadata"); + + public override Elastic.Clients.Elasticsearch.Security.RoleDescriptorRead Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propApplications = default; + LocalJsonValue> propCluster = default; + LocalJsonValue propDescription = default; + LocalJsonValue?> propGlobal = default; + LocalJsonValue> propIndices = default; + LocalJsonValue?> propMetadata = default; + LocalJsonValue?> propRemoteCluster = default; + LocalJsonValue?> propRemoteIndices = default; + LocalJsonValue propRestriction = default; + LocalJsonValue?> propRunAs = default; + LocalJsonValue?> propTransientMetadata = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApplications.TryReadProperty(ref reader, options, PropApplications, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propCluster.TryReadProperty(ref reader, options, PropCluster, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propGlobal.TryReadProperty(ref reader, options, PropGlobal, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!) || propIndices.TryReadProperty(ref reader, options, PropIndices1, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propRemoteCluster.TryReadProperty(ref reader, options, PropRemoteCluster, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propRemoteIndices.TryReadProperty(ref reader, options, PropRemoteIndices, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propRestriction.TryReadProperty(ref reader, options, PropRestriction, null)) + { + continue; + } + + if (propRunAs.TryReadProperty(ref reader, options, PropRunAs, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTransientMetadata.TryReadProperty(ref reader, options, PropTransientMetadata, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.RoleDescriptorRead(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Applications = propApplications.Value, + Cluster = propCluster.Value, + Description = propDescription.Value, + Global = propGlobal.Value, + Indices = propIndices.Value, + Metadata = propMetadata.Value, + RemoteCluster = propRemoteCluster.Value, + RemoteIndices = propRemoteIndices.Value, + Restriction = propRestriction.Value, + RunAs = propRunAs.Value, + TransientMetadata = propTransientMetadata.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RoleDescriptorRead value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApplications, value.Applications, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCluster, value.Cluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropGlobal, value.Global, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropRemoteCluster, value.RemoteCluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRemoteIndices, value.RemoteIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRestriction, value.Restriction, null, null); + writer.WriteProperty(options, PropRunAs, value.RunAs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTransientMetadata, value.TransientMetadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleDescriptorRead.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleDescriptorRead.g.cs index 75404c08034..2a48f080c66 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleDescriptorRead.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleDescriptorRead.g.cs @@ -23,137 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class RoleDescriptorReadConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApplications = System.Text.Json.JsonEncodedText.Encode("applications"); - private static readonly System.Text.Json.JsonEncodedText PropCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropGlobal = System.Text.Json.JsonEncodedText.Encode("global"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropIndices1 = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropRemoteCluster = System.Text.Json.JsonEncodedText.Encode("remote_cluster"); - private static readonly System.Text.Json.JsonEncodedText PropRemoteIndices = System.Text.Json.JsonEncodedText.Encode("remote_indices"); - private static readonly System.Text.Json.JsonEncodedText PropRestriction = System.Text.Json.JsonEncodedText.Encode("restriction"); - private static readonly System.Text.Json.JsonEncodedText PropRunAs = System.Text.Json.JsonEncodedText.Encode("run_as"); - private static readonly System.Text.Json.JsonEncodedText PropTransientMetadata = System.Text.Json.JsonEncodedText.Encode("transient_metadata"); - - public override Elastic.Clients.Elasticsearch.Security.RoleDescriptorRead Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propApplications = default; - LocalJsonValue> propCluster = default; - LocalJsonValue propDescription = default; - LocalJsonValue?> propGlobal = default; - LocalJsonValue> propIndices = default; - LocalJsonValue?> propMetadata = default; - LocalJsonValue?> propRemoteCluster = default; - LocalJsonValue?> propRemoteIndices = default; - LocalJsonValue propRestriction = default; - LocalJsonValue?> propRunAs = default; - LocalJsonValue?> propTransientMetadata = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApplications.TryReadProperty(ref reader, options, PropApplications, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propCluster.TryReadProperty(ref reader, options, PropCluster, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propGlobal.TryReadProperty(ref reader, options, PropGlobal, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!) || propIndices.TryReadProperty(ref reader, options, PropIndices1, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propRemoteCluster.TryReadProperty(ref reader, options, PropRemoteCluster, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propRemoteIndices.TryReadProperty(ref reader, options, PropRemoteIndices, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propRestriction.TryReadProperty(ref reader, options, PropRestriction, null)) - { - continue; - } - - if (propRunAs.TryReadProperty(ref reader, options, PropRunAs, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTransientMetadata.TryReadProperty(ref reader, options, PropTransientMetadata, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.RoleDescriptorRead(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Applications = propApplications.Value, - Cluster = propCluster.Value, - Description = propDescription.Value, - Global = propGlobal.Value, - Indices = propIndices.Value, - Metadata = propMetadata.Value, - RemoteCluster = propRemoteCluster.Value, - RemoteIndices = propRemoteIndices.Value, - Restriction = propRestriction.Value, - RunAs = propRunAs.Value, - TransientMetadata = propTransientMetadata.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RoleDescriptorRead value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApplications, value.Applications, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCluster, value.Cluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropGlobal, value.Global, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropRemoteCluster, value.RemoteCluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRemoteIndices, value.RemoteIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRestriction, value.Restriction, null, null); - writer.WriteProperty(options, PropRunAs, value.RunAs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTransientMetadata, value.TransientMetadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.RoleDescriptorReadConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.RoleDescriptorReadConverter))] public sealed partial class RoleDescriptorRead { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleDescriptorWrapper.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleDescriptorWrapper.Converters.g.cs new file mode 100644 index 00000000000..32dda77f5a5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleDescriptorWrapper.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class RoleDescriptorWrapperConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRoleDescriptor = System.Text.Json.JsonEncodedText.Encode("role_descriptor"); + + public override Elastic.Clients.Elasticsearch.Security.RoleDescriptorWrapper Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propRoleDescriptor = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRoleDescriptor.TryReadProperty(ref reader, options, PropRoleDescriptor, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.RoleDescriptorWrapper(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + RoleDescriptor = propRoleDescriptor.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RoleDescriptorWrapper value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRoleDescriptor, value.RoleDescriptor, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleDescriptorWrapper.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleDescriptorWrapper.g.cs index a5ac0649fda..fd5fe2bd974 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleDescriptorWrapper.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleDescriptorWrapper.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class RoleDescriptorWrapperConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRoleDescriptor = System.Text.Json.JsonEncodedText.Encode("role_descriptor"); - - public override Elastic.Clients.Elasticsearch.Security.RoleDescriptorWrapper Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propRoleDescriptor = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRoleDescriptor.TryReadProperty(ref reader, options, PropRoleDescriptor, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.RoleDescriptorWrapper(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - RoleDescriptor = propRoleDescriptor.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RoleDescriptorWrapper value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRoleDescriptor, value.RoleDescriptor, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.RoleDescriptorWrapperConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.RoleDescriptorWrapperConverter))] public sealed partial class RoleDescriptorWrapper { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleInfo.Converters.g.cs new file mode 100644 index 00000000000..10788503dff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleInfo.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class RoleInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApplications = System.Text.Json.JsonEncodedText.Encode("applications"); + private static readonly System.Text.Json.JsonEncodedText PropCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropGlobal = System.Text.Json.JsonEncodedText.Encode("global"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropRemoteCluster = System.Text.Json.JsonEncodedText.Encode("remote_cluster"); + private static readonly System.Text.Json.JsonEncodedText PropRemoteIndices = System.Text.Json.JsonEncodedText.Encode("remote_indices"); + private static readonly System.Text.Json.JsonEncodedText PropRoleTemplates = System.Text.Json.JsonEncodedText.Encode("role_templates"); + private static readonly System.Text.Json.JsonEncodedText PropRunAs = System.Text.Json.JsonEncodedText.Encode("run_as"); + private static readonly System.Text.Json.JsonEncodedText PropTransientMetadata = System.Text.Json.JsonEncodedText.Encode("transient_metadata"); + + public override Elastic.Clients.Elasticsearch.Security.RoleInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propApplications = default; + LocalJsonValue> propCluster = default; + LocalJsonValue propDescription = default; + LocalJsonValue>>>?> propGlobal = default; + LocalJsonValue> propIndices = default; + LocalJsonValue> propMetadata = default; + LocalJsonValue?> propRemoteCluster = default; + LocalJsonValue?> propRemoteIndices = default; + LocalJsonValue?> propRoleTemplates = default; + LocalJsonValue?> propRunAs = default; + LocalJsonValue?> propTransientMetadata = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApplications.TryReadProperty(ref reader, options, PropApplications, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propCluster.TryReadProperty(ref reader, options, PropCluster, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propGlobal.TryReadProperty(ref reader, options, PropGlobal, static System.Collections.Generic.IReadOnlyDictionary>>>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>>>(o, null, static System.Collections.Generic.IReadOnlyDictionary>> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>>(o, null, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)!)!))) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (propRemoteCluster.TryReadProperty(ref reader, options, PropRemoteCluster, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propRemoteIndices.TryReadProperty(ref reader, options, PropRemoteIndices, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propRoleTemplates.TryReadProperty(ref reader, options, PropRoleTemplates, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propRunAs.TryReadProperty(ref reader, options, PropRunAs, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTransientMetadata.TryReadProperty(ref reader, options, PropTransientMetadata, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.RoleInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Applications = propApplications.Value, + Cluster = propCluster.Value, + Description = propDescription.Value, + Global = propGlobal.Value, + Indices = propIndices.Value, + Metadata = propMetadata.Value, + RemoteCluster = propRemoteCluster.Value, + RemoteIndices = propRemoteIndices.Value, + RoleTemplates = propRoleTemplates.Value, + RunAs = propRunAs.Value, + TransientMetadata = propTransientMetadata.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RoleInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApplications, value.Applications, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCluster, value.Cluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropGlobal, value.Global, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>>>? v) => w.WriteDictionaryValue>>>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>> v) => w.WriteDictionaryValue>>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null))))); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropRemoteCluster, value.RemoteCluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRemoteIndices, value.RemoteIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRoleTemplates, value.RoleTemplates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRunAs, value.RunAs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTransientMetadata, value.TransientMetadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleInfo.g.cs index b57365a326d..3da2cf84ec9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleInfo.g.cs @@ -23,136 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class RoleInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApplications = System.Text.Json.JsonEncodedText.Encode("applications"); - private static readonly System.Text.Json.JsonEncodedText PropCluster = System.Text.Json.JsonEncodedText.Encode("cluster"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropGlobal = System.Text.Json.JsonEncodedText.Encode("global"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropRemoteCluster = System.Text.Json.JsonEncodedText.Encode("remote_cluster"); - private static readonly System.Text.Json.JsonEncodedText PropRemoteIndices = System.Text.Json.JsonEncodedText.Encode("remote_indices"); - private static readonly System.Text.Json.JsonEncodedText PropRoleTemplates = System.Text.Json.JsonEncodedText.Encode("role_templates"); - private static readonly System.Text.Json.JsonEncodedText PropRunAs = System.Text.Json.JsonEncodedText.Encode("run_as"); - private static readonly System.Text.Json.JsonEncodedText PropTransientMetadata = System.Text.Json.JsonEncodedText.Encode("transient_metadata"); - - public override Elastic.Clients.Elasticsearch.Security.RoleInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propApplications = default; - LocalJsonValue> propCluster = default; - LocalJsonValue propDescription = default; - LocalJsonValue>>>?> propGlobal = default; - LocalJsonValue> propIndices = default; - LocalJsonValue> propMetadata = default; - LocalJsonValue?> propRemoteCluster = default; - LocalJsonValue?> propRemoteIndices = default; - LocalJsonValue?> propRoleTemplates = default; - LocalJsonValue?> propRunAs = default; - LocalJsonValue?> propTransientMetadata = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApplications.TryReadProperty(ref reader, options, PropApplications, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propCluster.TryReadProperty(ref reader, options, PropCluster, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propGlobal.TryReadProperty(ref reader, options, PropGlobal, static System.Collections.Generic.IReadOnlyDictionary>>>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>>>(o, null, static System.Collections.Generic.IReadOnlyDictionary>> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>>(o, null, static System.Collections.Generic.IReadOnlyDictionary> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)!)!))) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (propRemoteCluster.TryReadProperty(ref reader, options, PropRemoteCluster, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propRemoteIndices.TryReadProperty(ref reader, options, PropRemoteIndices, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propRoleTemplates.TryReadProperty(ref reader, options, PropRoleTemplates, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propRunAs.TryReadProperty(ref reader, options, PropRunAs, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTransientMetadata.TryReadProperty(ref reader, options, PropTransientMetadata, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.RoleInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Applications = propApplications.Value, - Cluster = propCluster.Value, - Description = propDescription.Value, - Global = propGlobal.Value, - Indices = propIndices.Value, - Metadata = propMetadata.Value, - RemoteCluster = propRemoteCluster.Value, - RemoteIndices = propRemoteIndices.Value, - RoleTemplates = propRoleTemplates.Value, - RunAs = propRunAs.Value, - TransientMetadata = propTransientMetadata.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RoleInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropApplications, value.Applications, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropCluster, value.Cluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropGlobal, value.Global, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>>>? v) => w.WriteDictionaryValue>>>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>> v) => w.WriteDictionaryValue>>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary> v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null))))); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropRemoteCluster, value.RemoteCluster, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRemoteIndices, value.RemoteIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRoleTemplates, value.RoleTemplates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRunAs, value.RunAs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTransientMetadata, value.TransientMetadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.RoleInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.RoleInfoConverter))] public sealed partial class RoleInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleMapping.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleMapping.Converters.g.cs new file mode 100644 index 00000000000..d6961d4b7dc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleMapping.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class RoleMappingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + private static readonly System.Text.Json.JsonEncodedText PropRoleTemplates = System.Text.Json.JsonEncodedText.Encode("role_templates"); + private static readonly System.Text.Json.JsonEncodedText PropRules = System.Text.Json.JsonEncodedText.Encode("rules"); + + public override Elastic.Clients.Elasticsearch.Security.RoleMapping Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEnabled = default; + LocalJsonValue> propMetadata = default; + LocalJsonValue?> propRoles = default; + LocalJsonValue?> propRoleTemplates = default; + LocalJsonValue propRules = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propRoleTemplates.TryReadProperty(ref reader, options, PropRoleTemplates, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propRules.TryReadProperty(ref reader, options, PropRules, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.RoleMapping(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Enabled = propEnabled.Value, + Metadata = propMetadata.Value, + Roles = propRoles.Value, + RoleTemplates = propRoleTemplates.Value, + Rules = propRules.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RoleMapping value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRoleTemplates, value.RoleTemplates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropRules, value.Rules, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleMapping.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleMapping.g.cs index 31e7f742f00..5adaa1a4067 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleMapping.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleMapping.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class RoleMappingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); - private static readonly System.Text.Json.JsonEncodedText PropRoleTemplates = System.Text.Json.JsonEncodedText.Encode("role_templates"); - private static readonly System.Text.Json.JsonEncodedText PropRules = System.Text.Json.JsonEncodedText.Encode("rules"); - - public override Elastic.Clients.Elasticsearch.Security.RoleMapping Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEnabled = default; - LocalJsonValue> propMetadata = default; - LocalJsonValue?> propRoles = default; - LocalJsonValue?> propRoleTemplates = default; - LocalJsonValue propRules = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propRoleTemplates.TryReadProperty(ref reader, options, PropRoleTemplates, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propRules.TryReadProperty(ref reader, options, PropRules, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.RoleMapping(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Enabled = propEnabled.Value, - Metadata = propMetadata.Value, - Roles = propRoles.Value, - RoleTemplates = propRoleTemplates.Value, - Rules = propRules.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RoleMapping value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRoleTemplates, value.RoleTemplates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropRules, value.Rules, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.RoleMappingConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.RoleMappingConverter))] public sealed partial class RoleMapping { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleMappingRule.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleMappingRule.Converters.g.cs new file mode 100644 index 00000000000..080c8a475c1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleMappingRule.Converters.g.cs @@ -0,0 +1,114 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class RoleMappingRuleConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantAll = System.Text.Json.JsonEncodedText.Encode("all"); + private static readonly System.Text.Json.JsonEncodedText VariantAny = System.Text.Json.JsonEncodedText.Encode("any"); + private static readonly System.Text.Json.JsonEncodedText VariantExcept = System.Text.Json.JsonEncodedText.Encode("except"); + private static readonly System.Text.Json.JsonEncodedText VariantField = System.Text.Json.JsonEncodedText.Encode("field"); + + public override Elastic.Clients.Elasticsearch.Security.RoleMappingRule Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantAll)) + { + variantType = VariantAll.Value; + reader.Read(); + variant = reader.ReadValue>(options, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); + continue; + } + + if (reader.ValueTextEquals(VariantAny)) + { + variantType = VariantAny.Value; + reader.Read(); + variant = reader.ReadValue>(options, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); + continue; + } + + if (reader.ValueTextEquals(VariantExcept)) + { + variantType = VariantExcept.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantField)) + { + variantType = VariantField.Value; + reader.Read(); + variant = reader.ReadValue>>(options, static System.Collections.Generic.KeyValuePair> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.RoleMappingRule(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RoleMappingRule value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "all": + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.ICollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + break; + case "any": + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.ICollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + break; + case "except": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Security.RoleMappingRule)value.Variant, null, null); + break; + case "field": + writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.KeyValuePair>)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair> v) => w.WriteKeyValuePairValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Security.RoleMappingRule)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleMappingRule.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleMappingRule.g.cs index 8b591a871b7..f03082dd85c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleMappingRule.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleMappingRule.g.cs @@ -23,97 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class RoleMappingRuleConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantAll = System.Text.Json.JsonEncodedText.Encode("all"); - private static readonly System.Text.Json.JsonEncodedText VariantAny = System.Text.Json.JsonEncodedText.Encode("any"); - private static readonly System.Text.Json.JsonEncodedText VariantExcept = System.Text.Json.JsonEncodedText.Encode("except"); - private static readonly System.Text.Json.JsonEncodedText VariantField = System.Text.Json.JsonEncodedText.Encode("field"); - - public override Elastic.Clients.Elasticsearch.Security.RoleMappingRule Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantAll)) - { - variantType = VariantAll.Value; - reader.Read(); - variant = reader.ReadValue>(options, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); - continue; - } - - if (reader.ValueTextEquals(VariantAny)) - { - variantType = VariantAny.Value; - reader.Read(); - variant = reader.ReadValue>(options, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!); - continue; - } - - if (reader.ValueTextEquals(VariantExcept)) - { - variantType = VariantExcept.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantField)) - { - variantType = VariantField.Value; - reader.Read(); - variant = reader.ReadValue>>(options, static System.Collections.Generic.KeyValuePair> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.RoleMappingRule(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RoleMappingRule value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "all": - writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.ICollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - break; - case "any": - writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.ICollection)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); - break; - case "except": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Security.RoleMappingRule)value.Variant, null, null); - break; - case "field": - writer.WriteProperty(options, value.VariantType, (System.Collections.Generic.KeyValuePair>)value.Variant, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair> v) => w.WriteKeyValuePairValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Security.RoleMappingRule)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.RoleMappingRuleConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.RoleMappingRuleConverter))] public sealed partial class RoleMappingRule { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleQuery.Converters.g.cs new file mode 100644 index 00000000000..4c408259037 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleQuery.Converters.g.cs @@ -0,0 +1,198 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class RoleQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantBool = System.Text.Json.JsonEncodedText.Encode("bool"); + private static readonly System.Text.Json.JsonEncodedText VariantExists = System.Text.Json.JsonEncodedText.Encode("exists"); + private static readonly System.Text.Json.JsonEncodedText VariantIds = System.Text.Json.JsonEncodedText.Encode("ids"); + private static readonly System.Text.Json.JsonEncodedText VariantMatch = System.Text.Json.JsonEncodedText.Encode("match"); + private static readonly System.Text.Json.JsonEncodedText VariantMatchAll = System.Text.Json.JsonEncodedText.Encode("match_all"); + private static readonly System.Text.Json.JsonEncodedText VariantPrefix = System.Text.Json.JsonEncodedText.Encode("prefix"); + private static readonly System.Text.Json.JsonEncodedText VariantRange = System.Text.Json.JsonEncodedText.Encode("range"); + private static readonly System.Text.Json.JsonEncodedText VariantSimpleQueryString = System.Text.Json.JsonEncodedText.Encode("simple_query_string"); + private static readonly System.Text.Json.JsonEncodedText VariantTerm = System.Text.Json.JsonEncodedText.Encode("term"); + private static readonly System.Text.Json.JsonEncodedText VariantTerms = System.Text.Json.JsonEncodedText.Encode("terms"); + private static readonly System.Text.Json.JsonEncodedText VariantWildcard = System.Text.Json.JsonEncodedText.Encode("wildcard"); + + public override Elastic.Clients.Elasticsearch.Security.RoleQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantBool)) + { + variantType = VariantBool.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantExists)) + { + variantType = VariantExists.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantIds)) + { + variantType = VariantIds.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMatch)) + { + variantType = VariantMatch.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMatchAll)) + { + variantType = VariantMatchAll.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantPrefix)) + { + variantType = VariantPrefix.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRange)) + { + variantType = VariantRange.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSimpleQueryString)) + { + variantType = VariantSimpleQueryString.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTerm)) + { + variantType = VariantTerm.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTerms)) + { + variantType = VariantTerms.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantWildcard)) + { + variantType = VariantWildcard.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.RoleQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RoleQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "bool": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.BoolQuery)value.Variant, null, null); + break; + case "exists": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.ExistsQuery)value.Variant, null, null); + break; + case "ids": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IdsQuery)value.Variant, null, null); + break; + case "match": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MatchQuery)value.Variant, null, null); + break; + case "match_all": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MatchAllQuery)value.Variant, null, null); + break; + case "prefix": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.PrefixQuery)value.Variant, null, null); + break; + case "range": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IRangeQuery)value.Variant, null, null); + break; + case "simple_query_string": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringQuery)value.Variant, null, null); + break; + case "term": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.TermQuery)value.Variant, null, null); + break; + case "terms": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.TermsQuery)value.Variant, null, null); + break; + case "wildcard": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.WildcardQuery)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Security.RoleQuery)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleQuery.g.cs index 4668387e54f..41235ad2169 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleQuery.g.cs @@ -23,181 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class RoleQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantBool = System.Text.Json.JsonEncodedText.Encode("bool"); - private static readonly System.Text.Json.JsonEncodedText VariantExists = System.Text.Json.JsonEncodedText.Encode("exists"); - private static readonly System.Text.Json.JsonEncodedText VariantIds = System.Text.Json.JsonEncodedText.Encode("ids"); - private static readonly System.Text.Json.JsonEncodedText VariantMatch = System.Text.Json.JsonEncodedText.Encode("match"); - private static readonly System.Text.Json.JsonEncodedText VariantMatchAll = System.Text.Json.JsonEncodedText.Encode("match_all"); - private static readonly System.Text.Json.JsonEncodedText VariantPrefix = System.Text.Json.JsonEncodedText.Encode("prefix"); - private static readonly System.Text.Json.JsonEncodedText VariantRange = System.Text.Json.JsonEncodedText.Encode("range"); - private static readonly System.Text.Json.JsonEncodedText VariantSimpleQueryString = System.Text.Json.JsonEncodedText.Encode("simple_query_string"); - private static readonly System.Text.Json.JsonEncodedText VariantTerm = System.Text.Json.JsonEncodedText.Encode("term"); - private static readonly System.Text.Json.JsonEncodedText VariantTerms = System.Text.Json.JsonEncodedText.Encode("terms"); - private static readonly System.Text.Json.JsonEncodedText VariantWildcard = System.Text.Json.JsonEncodedText.Encode("wildcard"); - - public override Elastic.Clients.Elasticsearch.Security.RoleQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantBool)) - { - variantType = VariantBool.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantExists)) - { - variantType = VariantExists.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantIds)) - { - variantType = VariantIds.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMatch)) - { - variantType = VariantMatch.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMatchAll)) - { - variantType = VariantMatchAll.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantPrefix)) - { - variantType = VariantPrefix.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRange)) - { - variantType = VariantRange.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSimpleQueryString)) - { - variantType = VariantSimpleQueryString.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTerm)) - { - variantType = VariantTerm.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTerms)) - { - variantType = VariantTerms.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantWildcard)) - { - variantType = VariantWildcard.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.RoleQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RoleQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "bool": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.BoolQuery)value.Variant, null, null); - break; - case "exists": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.ExistsQuery)value.Variant, null, null); - break; - case "ids": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IdsQuery)value.Variant, null, null); - break; - case "match": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MatchQuery)value.Variant, null, null); - break; - case "match_all": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MatchAllQuery)value.Variant, null, null); - break; - case "prefix": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.PrefixQuery)value.Variant, null, null); - break; - case "range": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IRangeQuery)value.Variant, null, null); - break; - case "simple_query_string": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringQuery)value.Variant, null, null); - break; - case "term": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.TermQuery)value.Variant, null, null); - break; - case "terms": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.TermsQuery)value.Variant, null, null); - break; - case "wildcard": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.WildcardQuery)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Security.RoleQuery)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.RoleQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.RoleQueryConverter))] public sealed partial class RoleQuery { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleTemplate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleTemplate.Converters.g.cs new file mode 100644 index 00000000000..c6b7455358a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleTemplate.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class RoleTemplateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"); + + public override Elastic.Clients.Elasticsearch.Security.RoleTemplate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFormat = default; + LocalJsonValue propTemplate = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFormat.TryReadProperty(ref reader, options, PropFormat, static Elastic.Clients.Elasticsearch.Security.TemplateFormat? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.RoleTemplate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Format = propFormat.Value, + Template = propTemplate.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RoleTemplate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFormat, value.Format, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Security.TemplateFormat? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTemplate, value.Template, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleTemplate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleTemplate.g.cs index c1cc0c08b05..f1612235e7c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleTemplate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleTemplate.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class RoleTemplateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); - private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"); - - public override Elastic.Clients.Elasticsearch.Security.RoleTemplate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFormat = default; - LocalJsonValue propTemplate = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFormat.TryReadProperty(ref reader, options, PropFormat, static Elastic.Clients.Elasticsearch.Security.TemplateFormat? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.RoleTemplate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Format = propFormat.Value, - Template = propTemplate.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RoleTemplate value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFormat, value.Format, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Security.TemplateFormat? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTemplate, value.Template, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.RoleTemplateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.RoleTemplateConverter))] public sealed partial class RoleTemplate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/SearchAccess.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/SearchAccess.Converters.g.cs new file mode 100644 index 00000000000..eb4d14eb98c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/SearchAccess.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class SearchAccessConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowRestrictedIndices = System.Text.Json.JsonEncodedText.Encode("allow_restricted_indices"); + private static readonly System.Text.Json.JsonEncodedText PropFieldSecurity = System.Text.Json.JsonEncodedText.Encode("field_security"); + private static readonly System.Text.Json.JsonEncodedText PropNames = System.Text.Json.JsonEncodedText.Encode("names"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + + public override Elastic.Clients.Elasticsearch.Security.SearchAccess Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowRestrictedIndices = default; + LocalJsonValue propFieldSecurity = default; + LocalJsonValue> propNames = default; + LocalJsonValue propQuery = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowRestrictedIndices.TryReadProperty(ref reader, options, PropAllowRestrictedIndices, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFieldSecurity.TryReadProperty(ref reader, options, PropFieldSecurity, null)) + { + continue; + } + + if (propNames.TryReadProperty(ref reader, options, PropNames, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.SearchAccess(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowRestrictedIndices = propAllowRestrictedIndices.Value, + FieldSecurity = propFieldSecurity.Value, + Names = propNames.Value, + Query = propQuery.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SearchAccess value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowRestrictedIndices, value.AllowRestrictedIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFieldSecurity, value.FieldSecurity, null, null); + writer.WriteProperty(options, PropNames, value.Names, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropQuery, value.Query, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/SearchAccess.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/SearchAccess.g.cs index 47d5317f7d0..e3a97122924 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/SearchAccess.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/SearchAccess.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class SearchAccessConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowRestrictedIndices = System.Text.Json.JsonEncodedText.Encode("allow_restricted_indices"); - private static readonly System.Text.Json.JsonEncodedText PropFieldSecurity = System.Text.Json.JsonEncodedText.Encode("field_security"); - private static readonly System.Text.Json.JsonEncodedText PropNames = System.Text.Json.JsonEncodedText.Encode("names"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - - public override Elastic.Clients.Elasticsearch.Security.SearchAccess Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowRestrictedIndices = default; - LocalJsonValue propFieldSecurity = default; - LocalJsonValue> propNames = default; - LocalJsonValue propQuery = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowRestrictedIndices.TryReadProperty(ref reader, options, PropAllowRestrictedIndices, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFieldSecurity.TryReadProperty(ref reader, options, PropFieldSecurity, null)) - { - continue; - } - - if (propNames.TryReadProperty(ref reader, options, PropNames, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.SearchAccess(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowRestrictedIndices = propAllowRestrictedIndices.Value, - FieldSecurity = propFieldSecurity.Value, - Names = propNames.Value, - Query = propQuery.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SearchAccess value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowRestrictedIndices, value.AllowRestrictedIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFieldSecurity, value.FieldSecurity, null, null); - writer.WriteProperty(options, PropNames, value.Names, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropQuery, value.Query, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.SearchAccessConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.SearchAccessConverter))] public sealed partial class SearchAccess { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/SecuritySettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/SecuritySettings.Converters.g.cs new file mode 100644 index 00000000000..0847e9a610d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/SecuritySettings.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class SecuritySettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + + public override Elastic.Clients.Elasticsearch.Security.SecuritySettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndex = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.SecuritySettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Index = propIndex.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SecuritySettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/SecuritySettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/SecuritySettings.g.cs index 26f4f51d28c..c68b87e683c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/SecuritySettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/SecuritySettings.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class SecuritySettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - - public override Elastic.Clients.Elasticsearch.Security.SecuritySettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndex = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.SecuritySettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Index = propIndex.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.SecuritySettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.SecuritySettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.SecuritySettingsConverter))] public sealed partial class SecuritySettings { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ServiceToken.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ServiceToken.Converters.g.cs new file mode 100644 index 00000000000..5e00e9bf418 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ServiceToken.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class ServiceTokenConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + + public override Elastic.Clients.Elasticsearch.Security.ServiceToken Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + LocalJsonValue propValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.ServiceToken(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value, + Value = propValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ServiceToken value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropValue, value.Value, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ServiceToken.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ServiceToken.g.cs index 1b39401c81f..e1f8974928a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ServiceToken.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ServiceToken.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class ServiceTokenConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - - public override Elastic.Clients.Elasticsearch.Security.ServiceToken Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - LocalJsonValue propValue = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.ServiceToken(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value, - Value = propValue.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.ServiceToken value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropValue, value.Value, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.ServiceTokenConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.ServiceTokenConverter))] public sealed partial class ServiceToken { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/TemplateFormat.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/TemplateFormat.Converters.g.cs new file mode 100644 index 00000000000..7ea5bac5e0b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/TemplateFormat.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class TemplateFormatConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberJson = System.Text.Json.JsonEncodedText.Encode("json"); + private static readonly System.Text.Json.JsonEncodedText MemberString = System.Text.Json.JsonEncodedText.Encode("string"); + + public override Elastic.Clients.Elasticsearch.Security.TemplateFormat Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberJson)) + { + return Elastic.Clients.Elasticsearch.Security.TemplateFormat.Json; + } + + if (reader.ValueTextEquals(MemberString)) + { + return Elastic.Clients.Elasticsearch.Security.TemplateFormat.String; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberJson.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Security.TemplateFormat.Json; + } + + if (string.Equals(value, MemberString.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Security.TemplateFormat.String; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Security.TemplateFormat)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.TemplateFormat value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Security.TemplateFormat.Json: + writer.WriteStringValue(MemberJson); + break; + case Elastic.Clients.Elasticsearch.Security.TemplateFormat.String: + writer.WriteStringValue(MemberString); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Security.TemplateFormat)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Security.TemplateFormat ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.TemplateFormat value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/TemplateFormat.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/TemplateFormat.g.cs new file mode 100644 index 00000000000..46e4bb34a52 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/TemplateFormat.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.TemplateFormatConverter))] +public enum TemplateFormat +{ + [System.Runtime.Serialization.EnumMember(Value = "json")] + Json, + [System.Runtime.Serialization.EnumMember(Value = "string")] + String +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/TotalUserProfiles.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/TotalUserProfiles.Converters.g.cs new file mode 100644 index 00000000000..26b6c6293e7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/TotalUserProfiles.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class TotalUserProfilesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRelation = System.Text.Json.JsonEncodedText.Encode("relation"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + + public override Elastic.Clients.Elasticsearch.Security.TotalUserProfiles Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propRelation = default; + LocalJsonValue propValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRelation.TryReadProperty(ref reader, options, PropRelation, null)) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.TotalUserProfiles(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Relation = propRelation.Value, + Value = propValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.TotalUserProfiles value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRelation, value.Relation, null, null); + writer.WriteProperty(options, PropValue, value.Value, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/TotalUserProfiles.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/TotalUserProfiles.g.cs index 7e6ed4fd743..c4ccac81b80 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/TotalUserProfiles.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/TotalUserProfiles.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class TotalUserProfilesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRelation = System.Text.Json.JsonEncodedText.Encode("relation"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - - public override Elastic.Clients.Elasticsearch.Security.TotalUserProfiles Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propRelation = default; - LocalJsonValue propValue = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRelation.TryReadProperty(ref reader, options, PropRelation, null)) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.TotalUserProfiles(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Relation = propRelation.Value, - Value = propValue.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.TotalUserProfiles value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRelation, value.Relation, null, null); - writer.WriteProperty(options, PropValue, value.Value, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.TotalUserProfilesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.TotalUserProfilesConverter))] public sealed partial class TotalUserProfiles { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/User.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/User.Converters.g.cs new file mode 100644 index 00000000000..7654a1cd8cb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/User.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class UserConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEmail = System.Text.Json.JsonEncodedText.Encode("email"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropFullName = System.Text.Json.JsonEncodedText.Encode("full_name"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropProfileUid = System.Text.Json.JsonEncodedText.Encode("profile_uid"); + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); + + public override Elastic.Clients.Elasticsearch.Security.User Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEmail = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propFullName = default; + LocalJsonValue> propMetadata = default; + LocalJsonValue propProfileUid = default; + LocalJsonValue> propRoles = default; + LocalJsonValue propUsername = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEmail.TryReadProperty(ref reader, options, PropEmail, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propFullName.TryReadProperty(ref reader, options, PropFullName, null)) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (propProfileUid.TryReadProperty(ref reader, options, PropProfileUid, null)) + { + continue; + } + + if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.User(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Email = propEmail.Value, + Enabled = propEnabled.Value, + FullName = propFullName.Value, + Metadata = propMetadata.Value, + ProfileUid = propProfileUid.Value, + Roles = propRoles.Value, + Username = propUsername.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.User value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEmail, value.Email, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropFullName, value.FullName, null, null); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropProfileUid, value.ProfileUid, null, null); + writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropUsername, value.Username, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/User.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/User.g.cs index 0c92a526c9c..9e91fa79203 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/User.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/User.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class UserConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEmail = System.Text.Json.JsonEncodedText.Encode("email"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropFullName = System.Text.Json.JsonEncodedText.Encode("full_name"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropProfileUid = System.Text.Json.JsonEncodedText.Encode("profile_uid"); - private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); - private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); - - public override Elastic.Clients.Elasticsearch.Security.User Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEmail = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propFullName = default; - LocalJsonValue> propMetadata = default; - LocalJsonValue propProfileUid = default; - LocalJsonValue> propRoles = default; - LocalJsonValue propUsername = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEmail.TryReadProperty(ref reader, options, PropEmail, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propFullName.TryReadProperty(ref reader, options, PropFullName, null)) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (propProfileUid.TryReadProperty(ref reader, options, PropProfileUid, null)) - { - continue; - } - - if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.User(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Email = propEmail.Value, - Enabled = propEnabled.Value, - FullName = propFullName.Value, - Metadata = propMetadata.Value, - ProfileUid = propProfileUid.Value, - Roles = propRoles.Value, - Username = propUsername.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.User value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEmail, value.Email, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropFullName, value.FullName, null, null); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropProfileUid, value.ProfileUid, null, null); - writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropUsername, value.Username, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.UserConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.UserConverter))] public sealed partial class User { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivileges.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivileges.Converters.g.cs new file mode 100644 index 00000000000..cfb23fb1f9e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivileges.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class UserIndicesPrivilegesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowRestrictedIndices = System.Text.Json.JsonEncodedText.Encode("allow_restricted_indices"); + private static readonly System.Text.Json.JsonEncodedText PropFieldSecurity = System.Text.Json.JsonEncodedText.Encode("field_security"); + private static readonly System.Text.Json.JsonEncodedText PropNames = System.Text.Json.JsonEncodedText.Encode("names"); + private static readonly System.Text.Json.JsonEncodedText PropPrivileges = System.Text.Json.JsonEncodedText.Encode("privileges"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + + public override Elastic.Clients.Elasticsearch.Security.UserIndicesPrivileges Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowRestrictedIndices = default; + LocalJsonValue?> propFieldSecurity = default; + LocalJsonValue> propNames = default; + LocalJsonValue> propPrivileges = default; + LocalJsonValue propQuery = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowRestrictedIndices.TryReadProperty(ref reader, options, PropAllowRestrictedIndices, null)) + { + continue; + } + + if (propFieldSecurity.TryReadProperty(ref reader, options, PropFieldSecurity, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propNames.TryReadProperty(ref reader, options, PropNames, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propPrivileges.TryReadProperty(ref reader, options, PropPrivileges, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.UserIndicesPrivileges(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowRestrictedIndices = propAllowRestrictedIndices.Value, + FieldSecurity = propFieldSecurity.Value, + Names = propNames.Value, + Privileges = propPrivileges.Value, + Query = propQuery.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UserIndicesPrivileges value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowRestrictedIndices, value.AllowRestrictedIndices, null, null); + writer.WriteProperty(options, PropFieldSecurity, value.FieldSecurity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropNames, value.Names, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPrivileges, value.Privileges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropQuery, value.Query, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivileges.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivileges.g.cs index f10fc0ecfb3..9f69f053dad 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivileges.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivileges.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class UserIndicesPrivilegesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAllowRestrictedIndices = System.Text.Json.JsonEncodedText.Encode("allow_restricted_indices"); - private static readonly System.Text.Json.JsonEncodedText PropFieldSecurity = System.Text.Json.JsonEncodedText.Encode("field_security"); - private static readonly System.Text.Json.JsonEncodedText PropNames = System.Text.Json.JsonEncodedText.Encode("names"); - private static readonly System.Text.Json.JsonEncodedText PropPrivileges = System.Text.Json.JsonEncodedText.Encode("privileges"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - - public override Elastic.Clients.Elasticsearch.Security.UserIndicesPrivileges Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAllowRestrictedIndices = default; - LocalJsonValue?> propFieldSecurity = default; - LocalJsonValue> propNames = default; - LocalJsonValue> propPrivileges = default; - LocalJsonValue propQuery = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAllowRestrictedIndices.TryReadProperty(ref reader, options, PropAllowRestrictedIndices, null)) - { - continue; - } - - if (propFieldSecurity.TryReadProperty(ref reader, options, PropFieldSecurity, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propNames.TryReadProperty(ref reader, options, PropNames, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (propPrivileges.TryReadProperty(ref reader, options, PropPrivileges, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.UserIndicesPrivileges(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AllowRestrictedIndices = propAllowRestrictedIndices.Value, - FieldSecurity = propFieldSecurity.Value, - Names = propNames.Value, - Privileges = propPrivileges.Value, - Query = propQuery.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UserIndicesPrivileges value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAllowRestrictedIndices, value.AllowRestrictedIndices, null, null); - writer.WriteProperty(options, PropFieldSecurity, value.FieldSecurity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropNames, value.Names, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropPrivileges, value.Privileges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropQuery, value.Query, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.UserIndicesPrivilegesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.UserIndicesPrivilegesConverter))] public sealed partial class UserIndicesPrivileges { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfile.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfile.Converters.g.cs new file mode 100644 index 00000000000..3441ce4dfec --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfile.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class UserProfileConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropData = System.Text.Json.JsonEncodedText.Encode("data"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropLabels = System.Text.Json.JsonEncodedText.Encode("labels"); + private static readonly System.Text.Json.JsonEncodedText PropUid = System.Text.Json.JsonEncodedText.Encode("uid"); + private static readonly System.Text.Json.JsonEncodedText PropUser = System.Text.Json.JsonEncodedText.Encode("user"); + + public override Elastic.Clients.Elasticsearch.Security.UserProfile Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propData = default; + LocalJsonValue propEnabled = default; + LocalJsonValue> propLabels = default; + LocalJsonValue propUid = default; + LocalJsonValue propUser = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propData.TryReadProperty(ref reader, options, PropData, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLabels.TryReadProperty(ref reader, options, PropLabels, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (propUid.TryReadProperty(ref reader, options, PropUid, null)) + { + continue; + } + + if (propUser.TryReadProperty(ref reader, options, PropUser, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.UserProfile(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Data = propData.Value, + Enabled = propEnabled.Value, + Labels = propLabels.Value, + Uid = propUid.Value, + User = propUser.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UserProfile value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropData, value.Data, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLabels, value.Labels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropUid, value.Uid, null, null); + writer.WriteProperty(options, PropUser, value.User, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfile.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfile.g.cs index 1226f2a9259..7081a403616 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfile.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfile.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class UserProfileConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropData = System.Text.Json.JsonEncodedText.Encode("data"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropLabels = System.Text.Json.JsonEncodedText.Encode("labels"); - private static readonly System.Text.Json.JsonEncodedText PropUid = System.Text.Json.JsonEncodedText.Encode("uid"); - private static readonly System.Text.Json.JsonEncodedText PropUser = System.Text.Json.JsonEncodedText.Encode("user"); - - public override Elastic.Clients.Elasticsearch.Security.UserProfile Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propData = default; - LocalJsonValue propEnabled = default; - LocalJsonValue> propLabels = default; - LocalJsonValue propUid = default; - LocalJsonValue propUser = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propData.TryReadProperty(ref reader, options, PropData, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLabels.TryReadProperty(ref reader, options, PropLabels, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (propUid.TryReadProperty(ref reader, options, PropUid, null)) - { - continue; - } - - if (propUser.TryReadProperty(ref reader, options, PropUser, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.UserProfile(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Data = propData.Value, - Enabled = propEnabled.Value, - Labels = propLabels.Value, - Uid = propUid.Value, - User = propUser.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UserProfile value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropData, value.Data, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLabels, value.Labels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropUid, value.Uid, null, null); - writer.WriteProperty(options, PropUser, value.User, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.UserProfileConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.UserProfileConverter))] public sealed partial class UserProfile { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfileHitMetadata.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfileHitMetadata.Converters.g.cs new file mode 100644 index 00000000000..ab3f3a33d1b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfileHitMetadata.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class UserProfileHitMetadataConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPrimaryTerm = System.Text.Json.JsonEncodedText.Encode("_primary_term"); + private static readonly System.Text.Json.JsonEncodedText PropSeqNo = System.Text.Json.JsonEncodedText.Encode("_seq_no"); + + public override Elastic.Clients.Elasticsearch.Security.UserProfileHitMetadata Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPrimaryTerm = default; + LocalJsonValue propSeqNo = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPrimaryTerm.TryReadProperty(ref reader, options, PropPrimaryTerm, null)) + { + continue; + } + + if (propSeqNo.TryReadProperty(ref reader, options, PropSeqNo, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.UserProfileHitMetadata(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + PrimaryTerm = propPrimaryTerm.Value, + SeqNo = propSeqNo.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UserProfileHitMetadata value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPrimaryTerm, value.PrimaryTerm, null, null); + writer.WriteProperty(options, PropSeqNo, value.SeqNo, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfileHitMetadata.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfileHitMetadata.g.cs index 61437eb17cc..067ea362739 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfileHitMetadata.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfileHitMetadata.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class UserProfileHitMetadataConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPrimaryTerm = System.Text.Json.JsonEncodedText.Encode("_primary_term"); - private static readonly System.Text.Json.JsonEncodedText PropSeqNo = System.Text.Json.JsonEncodedText.Encode("_seq_no"); - - public override Elastic.Clients.Elasticsearch.Security.UserProfileHitMetadata Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPrimaryTerm = default; - LocalJsonValue propSeqNo = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPrimaryTerm.TryReadProperty(ref reader, options, PropPrimaryTerm, null)) - { - continue; - } - - if (propSeqNo.TryReadProperty(ref reader, options, PropSeqNo, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.UserProfileHitMetadata(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - PrimaryTerm = propPrimaryTerm.Value, - SeqNo = propSeqNo.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UserProfileHitMetadata value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPrimaryTerm, value.PrimaryTerm, null, null); - writer.WriteProperty(options, PropSeqNo, value.SeqNo, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.UserProfileHitMetadataConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.UserProfileHitMetadataConverter))] public sealed partial class UserProfileHitMetadata { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfileUser.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfileUser.Converters.g.cs new file mode 100644 index 00000000000..01eb19dd5bb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfileUser.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class UserProfileUserConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEmail = System.Text.Json.JsonEncodedText.Encode("email"); + private static readonly System.Text.Json.JsonEncodedText PropFullName = System.Text.Json.JsonEncodedText.Encode("full_name"); + private static readonly System.Text.Json.JsonEncodedText PropRealmDomain = System.Text.Json.JsonEncodedText.Encode("realm_domain"); + private static readonly System.Text.Json.JsonEncodedText PropRealmName = System.Text.Json.JsonEncodedText.Encode("realm_name"); + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); + + public override Elastic.Clients.Elasticsearch.Security.UserProfileUser Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEmail = default; + LocalJsonValue propFullName = default; + LocalJsonValue propRealmDomain = default; + LocalJsonValue propRealmName = default; + LocalJsonValue> propRoles = default; + LocalJsonValue propUsername = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEmail.TryReadProperty(ref reader, options, PropEmail, null)) + { + continue; + } + + if (propFullName.TryReadProperty(ref reader, options, PropFullName, null)) + { + continue; + } + + if (propRealmDomain.TryReadProperty(ref reader, options, PropRealmDomain, null)) + { + continue; + } + + if (propRealmName.TryReadProperty(ref reader, options, PropRealmName, null)) + { + continue; + } + + if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.UserProfileUser(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Email = propEmail.Value, + FullName = propFullName.Value, + RealmDomain = propRealmDomain.Value, + RealmName = propRealmName.Value, + Roles = propRoles.Value, + Username = propUsername.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UserProfileUser value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEmail, value.Email, null, null); + writer.WriteProperty(options, PropFullName, value.FullName, null, null); + writer.WriteProperty(options, PropRealmDomain, value.RealmDomain, null, null); + writer.WriteProperty(options, PropRealmName, value.RealmName, null, null); + writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropUsername, value.Username, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfileUser.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfileUser.g.cs index a600aa19269..5e44710da72 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfileUser.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfileUser.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class UserProfileUserConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEmail = System.Text.Json.JsonEncodedText.Encode("email"); - private static readonly System.Text.Json.JsonEncodedText PropFullName = System.Text.Json.JsonEncodedText.Encode("full_name"); - private static readonly System.Text.Json.JsonEncodedText PropRealmDomain = System.Text.Json.JsonEncodedText.Encode("realm_domain"); - private static readonly System.Text.Json.JsonEncodedText PropRealmName = System.Text.Json.JsonEncodedText.Encode("realm_name"); - private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); - private static readonly System.Text.Json.JsonEncodedText PropUsername = System.Text.Json.JsonEncodedText.Encode("username"); - - public override Elastic.Clients.Elasticsearch.Security.UserProfileUser Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEmail = default; - LocalJsonValue propFullName = default; - LocalJsonValue propRealmDomain = default; - LocalJsonValue propRealmName = default; - LocalJsonValue> propRoles = default; - LocalJsonValue propUsername = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEmail.TryReadProperty(ref reader, options, PropEmail, null)) - { - continue; - } - - if (propFullName.TryReadProperty(ref reader, options, PropFullName, null)) - { - continue; - } - - if (propRealmDomain.TryReadProperty(ref reader, options, PropRealmDomain, null)) - { - continue; - } - - if (propRealmName.TryReadProperty(ref reader, options, PropRealmName, null)) - { - continue; - } - - if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propUsername.TryReadProperty(ref reader, options, PropUsername, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.UserProfileUser(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Email = propEmail.Value, - FullName = propFullName.Value, - RealmDomain = propRealmDomain.Value, - RealmName = propRealmName.Value, - Roles = propRoles.Value, - Username = propUsername.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UserProfileUser value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEmail, value.Email, null, null); - writer.WriteProperty(options, PropFullName, value.FullName, null, null); - writer.WriteProperty(options, PropRealmDomain, value.RealmDomain, null, null); - writer.WriteProperty(options, PropRealmName, value.RealmName, null, null); - writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropUsername, value.Username, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.UserProfileUserConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.UserProfileUserConverter))] public sealed partial class UserProfileUser { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfileWithMetadata.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfileWithMetadata.Converters.g.cs new file mode 100644 index 00000000000..0800207d366 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfileWithMetadata.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class UserProfileWithMetadataConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropData = System.Text.Json.JsonEncodedText.Encode("data"); + private static readonly System.Text.Json.JsonEncodedText PropDoc = System.Text.Json.JsonEncodedText.Encode("_doc"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropLabels = System.Text.Json.JsonEncodedText.Encode("labels"); + private static readonly System.Text.Json.JsonEncodedText PropLastSynchronized = System.Text.Json.JsonEncodedText.Encode("last_synchronized"); + private static readonly System.Text.Json.JsonEncodedText PropUid = System.Text.Json.JsonEncodedText.Encode("uid"); + private static readonly System.Text.Json.JsonEncodedText PropUser = System.Text.Json.JsonEncodedText.Encode("user"); + + public override Elastic.Clients.Elasticsearch.Security.UserProfileWithMetadata Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propData = default; + LocalJsonValue propDoc = default; + LocalJsonValue propEnabled = default; + LocalJsonValue> propLabels = default; + LocalJsonValue propLastSynchronized = default; + LocalJsonValue propUid = default; + LocalJsonValue propUser = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propData.TryReadProperty(ref reader, options, PropData, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (propDoc.TryReadProperty(ref reader, options, PropDoc, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLabels.TryReadProperty(ref reader, options, PropLabels, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (propLastSynchronized.TryReadProperty(ref reader, options, PropLastSynchronized, null)) + { + continue; + } + + if (propUid.TryReadProperty(ref reader, options, PropUid, null)) + { + continue; + } + + if (propUser.TryReadProperty(ref reader, options, PropUser, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.UserProfileWithMetadata(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Data = propData.Value, + Doc = propDoc.Value, + Enabled = propEnabled.Value, + Labels = propLabels.Value, + LastSynchronized = propLastSynchronized.Value, + Uid = propUid.Value, + User = propUser.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UserProfileWithMetadata value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropData, value.Data, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropDoc, value.Doc, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLabels, value.Labels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropLastSynchronized, value.LastSynchronized, null, null); + writer.WriteProperty(options, PropUid, value.Uid, null, null); + writer.WriteProperty(options, PropUser, value.User, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfileWithMetadata.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfileWithMetadata.g.cs index 1edcbac64ae..f5b5fe7b4b1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfileWithMetadata.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserProfileWithMetadata.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class UserProfileWithMetadataConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropData = System.Text.Json.JsonEncodedText.Encode("data"); - private static readonly System.Text.Json.JsonEncodedText PropDoc = System.Text.Json.JsonEncodedText.Encode("_doc"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropLabels = System.Text.Json.JsonEncodedText.Encode("labels"); - private static readonly System.Text.Json.JsonEncodedText PropLastSynchronized = System.Text.Json.JsonEncodedText.Encode("last_synchronized"); - private static readonly System.Text.Json.JsonEncodedText PropUid = System.Text.Json.JsonEncodedText.Encode("uid"); - private static readonly System.Text.Json.JsonEncodedText PropUser = System.Text.Json.JsonEncodedText.Encode("user"); - - public override Elastic.Clients.Elasticsearch.Security.UserProfileWithMetadata Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propData = default; - LocalJsonValue propDoc = default; - LocalJsonValue propEnabled = default; - LocalJsonValue> propLabels = default; - LocalJsonValue propLastSynchronized = default; - LocalJsonValue propUid = default; - LocalJsonValue propUser = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propData.TryReadProperty(ref reader, options, PropData, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (propDoc.TryReadProperty(ref reader, options, PropDoc, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLabels.TryReadProperty(ref reader, options, PropLabels, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (propLastSynchronized.TryReadProperty(ref reader, options, PropLastSynchronized, null)) - { - continue; - } - - if (propUid.TryReadProperty(ref reader, options, PropUid, null)) - { - continue; - } - - if (propUser.TryReadProperty(ref reader, options, PropUser, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.UserProfileWithMetadata(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Data = propData.Value, - Doc = propDoc.Value, - Enabled = propEnabled.Value, - Labels = propLabels.Value, - LastSynchronized = propLastSynchronized.Value, - Uid = propUid.Value, - User = propUser.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UserProfileWithMetadata value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropData, value.Data, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropDoc, value.Doc, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLabels, value.Labels, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropLastSynchronized, value.LastSynchronized, null, null); - writer.WriteProperty(options, PropUid, value.Uid, null, null); - writer.WriteProperty(options, PropUser, value.User, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.UserProfileWithMetadataConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.UserProfileWithMetadataConverter))] public sealed partial class UserProfileWithMetadata { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserQuery.Converters.g.cs new file mode 100644 index 00000000000..053d94742ca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserQuery.Converters.g.cs @@ -0,0 +1,198 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class UserQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantBool = System.Text.Json.JsonEncodedText.Encode("bool"); + private static readonly System.Text.Json.JsonEncodedText VariantExists = System.Text.Json.JsonEncodedText.Encode("exists"); + private static readonly System.Text.Json.JsonEncodedText VariantIds = System.Text.Json.JsonEncodedText.Encode("ids"); + private static readonly System.Text.Json.JsonEncodedText VariantMatch = System.Text.Json.JsonEncodedText.Encode("match"); + private static readonly System.Text.Json.JsonEncodedText VariantMatchAll = System.Text.Json.JsonEncodedText.Encode("match_all"); + private static readonly System.Text.Json.JsonEncodedText VariantPrefix = System.Text.Json.JsonEncodedText.Encode("prefix"); + private static readonly System.Text.Json.JsonEncodedText VariantRange = System.Text.Json.JsonEncodedText.Encode("range"); + private static readonly System.Text.Json.JsonEncodedText VariantSimpleQueryString = System.Text.Json.JsonEncodedText.Encode("simple_query_string"); + private static readonly System.Text.Json.JsonEncodedText VariantTerm = System.Text.Json.JsonEncodedText.Encode("term"); + private static readonly System.Text.Json.JsonEncodedText VariantTerms = System.Text.Json.JsonEncodedText.Encode("terms"); + private static readonly System.Text.Json.JsonEncodedText VariantWildcard = System.Text.Json.JsonEncodedText.Encode("wildcard"); + + public override Elastic.Clients.Elasticsearch.Security.UserQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantBool)) + { + variantType = VariantBool.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantExists)) + { + variantType = VariantExists.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantIds)) + { + variantType = VariantIds.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMatch)) + { + variantType = VariantMatch.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantMatchAll)) + { + variantType = VariantMatchAll.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantPrefix)) + { + variantType = VariantPrefix.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantRange)) + { + variantType = VariantRange.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSimpleQueryString)) + { + variantType = VariantSimpleQueryString.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTerm)) + { + variantType = VariantTerm.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTerms)) + { + variantType = VariantTerms.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantWildcard)) + { + variantType = VariantWildcard.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.UserQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UserQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "bool": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.BoolQuery)value.Variant, null, null); + break; + case "exists": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.ExistsQuery)value.Variant, null, null); + break; + case "ids": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IdsQuery)value.Variant, null, null); + break; + case "match": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MatchQuery)value.Variant, null, null); + break; + case "match_all": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MatchAllQuery)value.Variant, null, null); + break; + case "prefix": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.PrefixQuery)value.Variant, null, null); + break; + case "range": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IRangeQuery)value.Variant, null, null); + break; + case "simple_query_string": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringQuery)value.Variant, null, null); + break; + case "term": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.TermQuery)value.Variant, null, null); + break; + case "terms": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.TermsQuery)value.Variant, null, null); + break; + case "wildcard": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.WildcardQuery)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Security.UserQuery)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserQuery.g.cs index 0c9eaeabaf6..090062634ac 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserQuery.g.cs @@ -23,181 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class UserQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantBool = System.Text.Json.JsonEncodedText.Encode("bool"); - private static readonly System.Text.Json.JsonEncodedText VariantExists = System.Text.Json.JsonEncodedText.Encode("exists"); - private static readonly System.Text.Json.JsonEncodedText VariantIds = System.Text.Json.JsonEncodedText.Encode("ids"); - private static readonly System.Text.Json.JsonEncodedText VariantMatch = System.Text.Json.JsonEncodedText.Encode("match"); - private static readonly System.Text.Json.JsonEncodedText VariantMatchAll = System.Text.Json.JsonEncodedText.Encode("match_all"); - private static readonly System.Text.Json.JsonEncodedText VariantPrefix = System.Text.Json.JsonEncodedText.Encode("prefix"); - private static readonly System.Text.Json.JsonEncodedText VariantRange = System.Text.Json.JsonEncodedText.Encode("range"); - private static readonly System.Text.Json.JsonEncodedText VariantSimpleQueryString = System.Text.Json.JsonEncodedText.Encode("simple_query_string"); - private static readonly System.Text.Json.JsonEncodedText VariantTerm = System.Text.Json.JsonEncodedText.Encode("term"); - private static readonly System.Text.Json.JsonEncodedText VariantTerms = System.Text.Json.JsonEncodedText.Encode("terms"); - private static readonly System.Text.Json.JsonEncodedText VariantWildcard = System.Text.Json.JsonEncodedText.Encode("wildcard"); - - public override Elastic.Clients.Elasticsearch.Security.UserQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantBool)) - { - variantType = VariantBool.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantExists)) - { - variantType = VariantExists.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantIds)) - { - variantType = VariantIds.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMatch)) - { - variantType = VariantMatch.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantMatchAll)) - { - variantType = VariantMatchAll.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantPrefix)) - { - variantType = VariantPrefix.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantRange)) - { - variantType = VariantRange.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantSimpleQueryString)) - { - variantType = VariantSimpleQueryString.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTerm)) - { - variantType = VariantTerm.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTerms)) - { - variantType = VariantTerms.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantWildcard)) - { - variantType = VariantWildcard.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.UserQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UserQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "bool": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.BoolQuery)value.Variant, null, null); - break; - case "exists": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.ExistsQuery)value.Variant, null, null); - break; - case "ids": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IdsQuery)value.Variant, null, null); - break; - case "match": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MatchQuery)value.Variant, null, null); - break; - case "match_all": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.MatchAllQuery)value.Variant, null, null); - break; - case "prefix": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.PrefixQuery)value.Variant, null, null); - break; - case "range": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.IRangeQuery)value.Variant, null, null); - break; - case "simple_query_string": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringQuery)value.Variant, null, null); - break; - case "term": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.TermQuery)value.Variant, null, null); - break; - case "terms": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.TermsQuery)value.Variant, null, null); - break; - case "wildcard": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.QueryDsl.WildcardQuery)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Security.UserQuery)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.UserQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.UserQueryConverter))] public sealed partial class UserQuery { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserRealm.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserRealm.Converters.g.cs new file mode 100644 index 00000000000..8b22235bac6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserRealm.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class UserRealmConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Security.UserRealm Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.UserRealm(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UserRealm value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserRealm.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserRealm.g.cs index d94d532b2c1..f3da588efd7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserRealm.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserRealm.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Security; -internal sealed partial class UserRealmConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Security.UserRealm Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Security.UserRealm(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UserRealm value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.UserRealmConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.UserRealmConverter))] public sealed partial class UserRealm { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SegmentsStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SegmentsStats.Converters.g.cs new file mode 100644 index 00000000000..401ad1c4154 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SegmentsStats.Converters.g.cs @@ -0,0 +1,261 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class SegmentsStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropDocValuesMemory = System.Text.Json.JsonEncodedText.Encode("doc_values_memory"); + private static readonly System.Text.Json.JsonEncodedText PropDocValuesMemoryInBytes = System.Text.Json.JsonEncodedText.Encode("doc_values_memory_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropFileSizes = System.Text.Json.JsonEncodedText.Encode("file_sizes"); + private static readonly System.Text.Json.JsonEncodedText PropFixedBitSet = System.Text.Json.JsonEncodedText.Encode("fixed_bit_set"); + private static readonly System.Text.Json.JsonEncodedText PropFixedBitSetMemoryInBytes = System.Text.Json.JsonEncodedText.Encode("fixed_bit_set_memory_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropIndexWriterMemory = System.Text.Json.JsonEncodedText.Encode("index_writer_memory"); + private static readonly System.Text.Json.JsonEncodedText PropIndexWriterMemoryInBytes = System.Text.Json.JsonEncodedText.Encode("index_writer_memory_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropMaxUnsafeAutoIdTimestamp = System.Text.Json.JsonEncodedText.Encode("max_unsafe_auto_id_timestamp"); + private static readonly System.Text.Json.JsonEncodedText PropMemory = System.Text.Json.JsonEncodedText.Encode("memory"); + private static readonly System.Text.Json.JsonEncodedText PropMemoryInBytes = System.Text.Json.JsonEncodedText.Encode("memory_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropNormsMemory = System.Text.Json.JsonEncodedText.Encode("norms_memory"); + private static readonly System.Text.Json.JsonEncodedText PropNormsMemoryInBytes = System.Text.Json.JsonEncodedText.Encode("norms_memory_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropPointsMemory = System.Text.Json.JsonEncodedText.Encode("points_memory"); + private static readonly System.Text.Json.JsonEncodedText PropPointsMemoryInBytes = System.Text.Json.JsonEncodedText.Encode("points_memory_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropStoredFieldsMemory = System.Text.Json.JsonEncodedText.Encode("stored_fields_memory"); + private static readonly System.Text.Json.JsonEncodedText PropStoredFieldsMemoryInBytes = System.Text.Json.JsonEncodedText.Encode("stored_fields_memory_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTermsMemory = System.Text.Json.JsonEncodedText.Encode("terms_memory"); + private static readonly System.Text.Json.JsonEncodedText PropTermsMemoryInBytes = System.Text.Json.JsonEncodedText.Encode("terms_memory_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTermVectorsMemory = System.Text.Json.JsonEncodedText.Encode("term_vectors_memory"); + private static readonly System.Text.Json.JsonEncodedText PropTermVectorsMemoryInBytes = System.Text.Json.JsonEncodedText.Encode("term_vectors_memory_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropVersionMapMemory = System.Text.Json.JsonEncodedText.Encode("version_map_memory"); + private static readonly System.Text.Json.JsonEncodedText PropVersionMapMemoryInBytes = System.Text.Json.JsonEncodedText.Encode("version_map_memory_in_bytes"); + + public override Elastic.Clients.Elasticsearch.SegmentsStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propDocValuesMemory = default; + LocalJsonValue propDocValuesMemoryInBytes = default; + LocalJsonValue> propFileSizes = default; + LocalJsonValue propFixedBitSet = default; + LocalJsonValue propFixedBitSetMemoryInBytes = default; + LocalJsonValue propIndexWriterMemory = default; + LocalJsonValue propIndexWriterMemoryInBytes = default; + LocalJsonValue propMaxUnsafeAutoIdTimestamp = default; + LocalJsonValue propMemory = default; + LocalJsonValue propMemoryInBytes = default; + LocalJsonValue propNormsMemory = default; + LocalJsonValue propNormsMemoryInBytes = default; + LocalJsonValue propPointsMemory = default; + LocalJsonValue propPointsMemoryInBytes = default; + LocalJsonValue propStoredFieldsMemory = default; + LocalJsonValue propStoredFieldsMemoryInBytes = default; + LocalJsonValue propTermsMemory = default; + LocalJsonValue propTermsMemoryInBytes = default; + LocalJsonValue propTermVectorsMemory = default; + LocalJsonValue propTermVectorsMemoryInBytes = default; + LocalJsonValue propVersionMapMemory = default; + LocalJsonValue propVersionMapMemoryInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propDocValuesMemory.TryReadProperty(ref reader, options, PropDocValuesMemory, null)) + { + continue; + } + + if (propDocValuesMemoryInBytes.TryReadProperty(ref reader, options, PropDocValuesMemoryInBytes, null)) + { + continue; + } + + if (propFileSizes.TryReadProperty(ref reader, options, PropFileSizes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propFixedBitSet.TryReadProperty(ref reader, options, PropFixedBitSet, null)) + { + continue; + } + + if (propFixedBitSetMemoryInBytes.TryReadProperty(ref reader, options, PropFixedBitSetMemoryInBytes, null)) + { + continue; + } + + if (propIndexWriterMemory.TryReadProperty(ref reader, options, PropIndexWriterMemory, null)) + { + continue; + } + + if (propIndexWriterMemoryInBytes.TryReadProperty(ref reader, options, PropIndexWriterMemoryInBytes, null)) + { + continue; + } + + if (propMaxUnsafeAutoIdTimestamp.TryReadProperty(ref reader, options, PropMaxUnsafeAutoIdTimestamp, null)) + { + continue; + } + + if (propMemory.TryReadProperty(ref reader, options, PropMemory, null)) + { + continue; + } + + if (propMemoryInBytes.TryReadProperty(ref reader, options, PropMemoryInBytes, null)) + { + continue; + } + + if (propNormsMemory.TryReadProperty(ref reader, options, PropNormsMemory, null)) + { + continue; + } + + if (propNormsMemoryInBytes.TryReadProperty(ref reader, options, PropNormsMemoryInBytes, null)) + { + continue; + } + + if (propPointsMemory.TryReadProperty(ref reader, options, PropPointsMemory, null)) + { + continue; + } + + if (propPointsMemoryInBytes.TryReadProperty(ref reader, options, PropPointsMemoryInBytes, null)) + { + continue; + } + + if (propStoredFieldsMemory.TryReadProperty(ref reader, options, PropStoredFieldsMemory, null)) + { + continue; + } + + if (propStoredFieldsMemoryInBytes.TryReadProperty(ref reader, options, PropStoredFieldsMemoryInBytes, null)) + { + continue; + } + + if (propTermsMemory.TryReadProperty(ref reader, options, PropTermsMemory, null)) + { + continue; + } + + if (propTermsMemoryInBytes.TryReadProperty(ref reader, options, PropTermsMemoryInBytes, null)) + { + continue; + } + + if (propTermVectorsMemory.TryReadProperty(ref reader, options, PropTermVectorsMemory, null)) + { + continue; + } + + if (propTermVectorsMemoryInBytes.TryReadProperty(ref reader, options, PropTermVectorsMemoryInBytes, null)) + { + continue; + } + + if (propVersionMapMemory.TryReadProperty(ref reader, options, PropVersionMapMemory, null)) + { + continue; + } + + if (propVersionMapMemoryInBytes.TryReadProperty(ref reader, options, PropVersionMapMemoryInBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SegmentsStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + DocValuesMemory = propDocValuesMemory.Value, + DocValuesMemoryInBytes = propDocValuesMemoryInBytes.Value, + FileSizes = propFileSizes.Value, + FixedBitSet = propFixedBitSet.Value, + FixedBitSetMemoryInBytes = propFixedBitSetMemoryInBytes.Value, + IndexWriterMemory = propIndexWriterMemory.Value, + IndexWriterMemoryInBytes = propIndexWriterMemoryInBytes.Value, + MaxUnsafeAutoIdTimestamp = propMaxUnsafeAutoIdTimestamp.Value, + Memory = propMemory.Value, + MemoryInBytes = propMemoryInBytes.Value, + NormsMemory = propNormsMemory.Value, + NormsMemoryInBytes = propNormsMemoryInBytes.Value, + PointsMemory = propPointsMemory.Value, + PointsMemoryInBytes = propPointsMemoryInBytes.Value, + StoredFieldsMemory = propStoredFieldsMemory.Value, + StoredFieldsMemoryInBytes = propStoredFieldsMemoryInBytes.Value, + TermsMemory = propTermsMemory.Value, + TermsMemoryInBytes = propTermsMemoryInBytes.Value, + TermVectorsMemory = propTermVectorsMemory.Value, + TermVectorsMemoryInBytes = propTermVectorsMemoryInBytes.Value, + VersionMapMemory = propVersionMapMemory.Value, + VersionMapMemoryInBytes = propVersionMapMemoryInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SegmentsStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropDocValuesMemory, value.DocValuesMemory, null, null); + writer.WriteProperty(options, PropDocValuesMemoryInBytes, value.DocValuesMemoryInBytes, null, null); + writer.WriteProperty(options, PropFileSizes, value.FileSizes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropFixedBitSet, value.FixedBitSet, null, null); + writer.WriteProperty(options, PropFixedBitSetMemoryInBytes, value.FixedBitSetMemoryInBytes, null, null); + writer.WriteProperty(options, PropIndexWriterMemory, value.IndexWriterMemory, null, null); + writer.WriteProperty(options, PropIndexWriterMemoryInBytes, value.IndexWriterMemoryInBytes, null, null); + writer.WriteProperty(options, PropMaxUnsafeAutoIdTimestamp, value.MaxUnsafeAutoIdTimestamp, null, null); + writer.WriteProperty(options, PropMemory, value.Memory, null, null); + writer.WriteProperty(options, PropMemoryInBytes, value.MemoryInBytes, null, null); + writer.WriteProperty(options, PropNormsMemory, value.NormsMemory, null, null); + writer.WriteProperty(options, PropNormsMemoryInBytes, value.NormsMemoryInBytes, null, null); + writer.WriteProperty(options, PropPointsMemory, value.PointsMemory, null, null); + writer.WriteProperty(options, PropPointsMemoryInBytes, value.PointsMemoryInBytes, null, null); + writer.WriteProperty(options, PropStoredFieldsMemory, value.StoredFieldsMemory, null, null); + writer.WriteProperty(options, PropStoredFieldsMemoryInBytes, value.StoredFieldsMemoryInBytes, null, null); + writer.WriteProperty(options, PropTermsMemory, value.TermsMemory, null, null); + writer.WriteProperty(options, PropTermsMemoryInBytes, value.TermsMemoryInBytes, null, null); + writer.WriteProperty(options, PropTermVectorsMemory, value.TermVectorsMemory, null, null); + writer.WriteProperty(options, PropTermVectorsMemoryInBytes, value.TermVectorsMemoryInBytes, null, null); + writer.WriteProperty(options, PropVersionMapMemory, value.VersionMapMemory, null, null); + writer.WriteProperty(options, PropVersionMapMemoryInBytes, value.VersionMapMemoryInBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SegmentsStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SegmentsStats.g.cs index 710b4dfa4c7..b6440256065 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SegmentsStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SegmentsStats.g.cs @@ -23,244 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class SegmentsStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropDocValuesMemory = System.Text.Json.JsonEncodedText.Encode("doc_values_memory"); - private static readonly System.Text.Json.JsonEncodedText PropDocValuesMemoryInBytes = System.Text.Json.JsonEncodedText.Encode("doc_values_memory_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropFileSizes = System.Text.Json.JsonEncodedText.Encode("file_sizes"); - private static readonly System.Text.Json.JsonEncodedText PropFixedBitSet = System.Text.Json.JsonEncodedText.Encode("fixed_bit_set"); - private static readonly System.Text.Json.JsonEncodedText PropFixedBitSetMemoryInBytes = System.Text.Json.JsonEncodedText.Encode("fixed_bit_set_memory_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropIndexWriterMemory = System.Text.Json.JsonEncodedText.Encode("index_writer_memory"); - private static readonly System.Text.Json.JsonEncodedText PropIndexWriterMemoryInBytes = System.Text.Json.JsonEncodedText.Encode("index_writer_memory_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropMaxUnsafeAutoIdTimestamp = System.Text.Json.JsonEncodedText.Encode("max_unsafe_auto_id_timestamp"); - private static readonly System.Text.Json.JsonEncodedText PropMemory = System.Text.Json.JsonEncodedText.Encode("memory"); - private static readonly System.Text.Json.JsonEncodedText PropMemoryInBytes = System.Text.Json.JsonEncodedText.Encode("memory_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropNormsMemory = System.Text.Json.JsonEncodedText.Encode("norms_memory"); - private static readonly System.Text.Json.JsonEncodedText PropNormsMemoryInBytes = System.Text.Json.JsonEncodedText.Encode("norms_memory_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropPointsMemory = System.Text.Json.JsonEncodedText.Encode("points_memory"); - private static readonly System.Text.Json.JsonEncodedText PropPointsMemoryInBytes = System.Text.Json.JsonEncodedText.Encode("points_memory_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropStoredFieldsMemory = System.Text.Json.JsonEncodedText.Encode("stored_fields_memory"); - private static readonly System.Text.Json.JsonEncodedText PropStoredFieldsMemoryInBytes = System.Text.Json.JsonEncodedText.Encode("stored_fields_memory_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTermsMemory = System.Text.Json.JsonEncodedText.Encode("terms_memory"); - private static readonly System.Text.Json.JsonEncodedText PropTermsMemoryInBytes = System.Text.Json.JsonEncodedText.Encode("terms_memory_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTermVectorsMemory = System.Text.Json.JsonEncodedText.Encode("term_vectors_memory"); - private static readonly System.Text.Json.JsonEncodedText PropTermVectorsMemoryInBytes = System.Text.Json.JsonEncodedText.Encode("term_vectors_memory_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropVersionMapMemory = System.Text.Json.JsonEncodedText.Encode("version_map_memory"); - private static readonly System.Text.Json.JsonEncodedText PropVersionMapMemoryInBytes = System.Text.Json.JsonEncodedText.Encode("version_map_memory_in_bytes"); - - public override Elastic.Clients.Elasticsearch.SegmentsStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propDocValuesMemory = default; - LocalJsonValue propDocValuesMemoryInBytes = default; - LocalJsonValue> propFileSizes = default; - LocalJsonValue propFixedBitSet = default; - LocalJsonValue propFixedBitSetMemoryInBytes = default; - LocalJsonValue propIndexWriterMemory = default; - LocalJsonValue propIndexWriterMemoryInBytes = default; - LocalJsonValue propMaxUnsafeAutoIdTimestamp = default; - LocalJsonValue propMemory = default; - LocalJsonValue propMemoryInBytes = default; - LocalJsonValue propNormsMemory = default; - LocalJsonValue propNormsMemoryInBytes = default; - LocalJsonValue propPointsMemory = default; - LocalJsonValue propPointsMemoryInBytes = default; - LocalJsonValue propStoredFieldsMemory = default; - LocalJsonValue propStoredFieldsMemoryInBytes = default; - LocalJsonValue propTermsMemory = default; - LocalJsonValue propTermsMemoryInBytes = default; - LocalJsonValue propTermVectorsMemory = default; - LocalJsonValue propTermVectorsMemoryInBytes = default; - LocalJsonValue propVersionMapMemory = default; - LocalJsonValue propVersionMapMemoryInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propDocValuesMemory.TryReadProperty(ref reader, options, PropDocValuesMemory, null)) - { - continue; - } - - if (propDocValuesMemoryInBytes.TryReadProperty(ref reader, options, PropDocValuesMemoryInBytes, null)) - { - continue; - } - - if (propFileSizes.TryReadProperty(ref reader, options, PropFileSizes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propFixedBitSet.TryReadProperty(ref reader, options, PropFixedBitSet, null)) - { - continue; - } - - if (propFixedBitSetMemoryInBytes.TryReadProperty(ref reader, options, PropFixedBitSetMemoryInBytes, null)) - { - continue; - } - - if (propIndexWriterMemory.TryReadProperty(ref reader, options, PropIndexWriterMemory, null)) - { - continue; - } - - if (propIndexWriterMemoryInBytes.TryReadProperty(ref reader, options, PropIndexWriterMemoryInBytes, null)) - { - continue; - } - - if (propMaxUnsafeAutoIdTimestamp.TryReadProperty(ref reader, options, PropMaxUnsafeAutoIdTimestamp, null)) - { - continue; - } - - if (propMemory.TryReadProperty(ref reader, options, PropMemory, null)) - { - continue; - } - - if (propMemoryInBytes.TryReadProperty(ref reader, options, PropMemoryInBytes, null)) - { - continue; - } - - if (propNormsMemory.TryReadProperty(ref reader, options, PropNormsMemory, null)) - { - continue; - } - - if (propNormsMemoryInBytes.TryReadProperty(ref reader, options, PropNormsMemoryInBytes, null)) - { - continue; - } - - if (propPointsMemory.TryReadProperty(ref reader, options, PropPointsMemory, null)) - { - continue; - } - - if (propPointsMemoryInBytes.TryReadProperty(ref reader, options, PropPointsMemoryInBytes, null)) - { - continue; - } - - if (propStoredFieldsMemory.TryReadProperty(ref reader, options, PropStoredFieldsMemory, null)) - { - continue; - } - - if (propStoredFieldsMemoryInBytes.TryReadProperty(ref reader, options, PropStoredFieldsMemoryInBytes, null)) - { - continue; - } - - if (propTermsMemory.TryReadProperty(ref reader, options, PropTermsMemory, null)) - { - continue; - } - - if (propTermsMemoryInBytes.TryReadProperty(ref reader, options, PropTermsMemoryInBytes, null)) - { - continue; - } - - if (propTermVectorsMemory.TryReadProperty(ref reader, options, PropTermVectorsMemory, null)) - { - continue; - } - - if (propTermVectorsMemoryInBytes.TryReadProperty(ref reader, options, PropTermVectorsMemoryInBytes, null)) - { - continue; - } - - if (propVersionMapMemory.TryReadProperty(ref reader, options, PropVersionMapMemory, null)) - { - continue; - } - - if (propVersionMapMemoryInBytes.TryReadProperty(ref reader, options, PropVersionMapMemoryInBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SegmentsStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - DocValuesMemory = propDocValuesMemory.Value, - DocValuesMemoryInBytes = propDocValuesMemoryInBytes.Value, - FileSizes = propFileSizes.Value, - FixedBitSet = propFixedBitSet.Value, - FixedBitSetMemoryInBytes = propFixedBitSetMemoryInBytes.Value, - IndexWriterMemory = propIndexWriterMemory.Value, - IndexWriterMemoryInBytes = propIndexWriterMemoryInBytes.Value, - MaxUnsafeAutoIdTimestamp = propMaxUnsafeAutoIdTimestamp.Value, - Memory = propMemory.Value, - MemoryInBytes = propMemoryInBytes.Value, - NormsMemory = propNormsMemory.Value, - NormsMemoryInBytes = propNormsMemoryInBytes.Value, - PointsMemory = propPointsMemory.Value, - PointsMemoryInBytes = propPointsMemoryInBytes.Value, - StoredFieldsMemory = propStoredFieldsMemory.Value, - StoredFieldsMemoryInBytes = propStoredFieldsMemoryInBytes.Value, - TermsMemory = propTermsMemory.Value, - TermsMemoryInBytes = propTermsMemoryInBytes.Value, - TermVectorsMemory = propTermVectorsMemory.Value, - TermVectorsMemoryInBytes = propTermVectorsMemoryInBytes.Value, - VersionMapMemory = propVersionMapMemory.Value, - VersionMapMemoryInBytes = propVersionMapMemoryInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SegmentsStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropDocValuesMemory, value.DocValuesMemory, null, null); - writer.WriteProperty(options, PropDocValuesMemoryInBytes, value.DocValuesMemoryInBytes, null, null); - writer.WriteProperty(options, PropFileSizes, value.FileSizes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropFixedBitSet, value.FixedBitSet, null, null); - writer.WriteProperty(options, PropFixedBitSetMemoryInBytes, value.FixedBitSetMemoryInBytes, null, null); - writer.WriteProperty(options, PropIndexWriterMemory, value.IndexWriterMemory, null, null); - writer.WriteProperty(options, PropIndexWriterMemoryInBytes, value.IndexWriterMemoryInBytes, null, null); - writer.WriteProperty(options, PropMaxUnsafeAutoIdTimestamp, value.MaxUnsafeAutoIdTimestamp, null, null); - writer.WriteProperty(options, PropMemory, value.Memory, null, null); - writer.WriteProperty(options, PropMemoryInBytes, value.MemoryInBytes, null, null); - writer.WriteProperty(options, PropNormsMemory, value.NormsMemory, null, null); - writer.WriteProperty(options, PropNormsMemoryInBytes, value.NormsMemoryInBytes, null, null); - writer.WriteProperty(options, PropPointsMemory, value.PointsMemory, null, null); - writer.WriteProperty(options, PropPointsMemoryInBytes, value.PointsMemoryInBytes, null, null); - writer.WriteProperty(options, PropStoredFieldsMemory, value.StoredFieldsMemory, null, null); - writer.WriteProperty(options, PropStoredFieldsMemoryInBytes, value.StoredFieldsMemoryInBytes, null, null); - writer.WriteProperty(options, PropTermsMemory, value.TermsMemory, null, null); - writer.WriteProperty(options, PropTermsMemoryInBytes, value.TermsMemoryInBytes, null, null); - writer.WriteProperty(options, PropTermVectorsMemory, value.TermVectorsMemory, null, null); - writer.WriteProperty(options, PropTermVectorsMemoryInBytes, value.TermVectorsMemoryInBytes, null, null); - writer.WriteProperty(options, PropVersionMapMemory, value.VersionMapMemory, null, null); - writer.WriteProperty(options, PropVersionMapMemoryInBytes, value.VersionMapMemoryInBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SegmentsStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.SegmentsStatsConverter))] public sealed partial class SegmentsStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ShardFailure.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ShardFailure.Converters.g.cs new file mode 100644 index 00000000000..ae3546141b7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ShardFailure.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ShardFailureConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); + private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); + private static readonly System.Text.Json.JsonEncodedText PropShard = System.Text.Json.JsonEncodedText.Encode("shard"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + + public override Elastic.Clients.Elasticsearch.ShardFailure Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndex = default; + LocalJsonValue propNode = default; + LocalJsonValue propReason = default; + LocalJsonValue propShard = default; + LocalJsonValue propStatus = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propNode.TryReadProperty(ref reader, options, PropNode, null)) + { + continue; + } + + if (propReason.TryReadProperty(ref reader, options, PropReason, null)) + { + continue; + } + + if (propShard.TryReadProperty(ref reader, options, PropShard, null)) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ShardFailure(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Index = propIndex.Value, + Node = propNode.Value, + Reason = propReason.Value, + Shard = propShard.Value, + Status = propStatus.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ShardFailure value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropNode, value.Node, null, null); + writer.WriteProperty(options, PropReason, value.Reason, null, null); + writer.WriteProperty(options, PropShard, value.Shard, null, null); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ShardFailure.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ShardFailure.g.cs index 4d9eeff6c25..0a0f08410bf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ShardFailure.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ShardFailure.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class ShardFailureConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); - private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); - private static readonly System.Text.Json.JsonEncodedText PropShard = System.Text.Json.JsonEncodedText.Encode("shard"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - - public override Elastic.Clients.Elasticsearch.ShardFailure Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndex = default; - LocalJsonValue propNode = default; - LocalJsonValue propReason = default; - LocalJsonValue propShard = default; - LocalJsonValue propStatus = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propNode.TryReadProperty(ref reader, options, PropNode, null)) - { - continue; - } - - if (propReason.TryReadProperty(ref reader, options, PropReason, null)) - { - continue; - } - - if (propShard.TryReadProperty(ref reader, options, PropShard, null)) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ShardFailure(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Index = propIndex.Value, - Node = propNode.Value, - Reason = propReason.Value, - Shard = propShard.Value, - Status = propStatus.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ShardFailure value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropNode, value.Node, null, null); - writer.WriteProperty(options, PropReason, value.Reason, null, null); - writer.WriteProperty(options, PropShard, value.Shard, null, null); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ShardFailureConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ShardFailureConverter))] public sealed partial class ShardFailure { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ShardStatistics.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ShardStatistics.Converters.g.cs new file mode 100644 index 00000000000..facfcd2b0d7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ShardStatistics.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ShardStatisticsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFailed = System.Text.Json.JsonEncodedText.Encode("failed"); + private static readonly System.Text.Json.JsonEncodedText PropFailures = System.Text.Json.JsonEncodedText.Encode("failures"); + private static readonly System.Text.Json.JsonEncodedText PropSkipped = System.Text.Json.JsonEncodedText.Encode("skipped"); + private static readonly System.Text.Json.JsonEncodedText PropSuccessful = System.Text.Json.JsonEncodedText.Encode("successful"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.ShardStatistics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFailed = default; + LocalJsonValue?> propFailures = default; + LocalJsonValue propSkipped = default; + LocalJsonValue propSuccessful = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFailed.TryReadProperty(ref reader, options, PropFailed, null)) + { + continue; + } + + if (propFailures.TryReadProperty(ref reader, options, PropFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propSkipped.TryReadProperty(ref reader, options, PropSkipped, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSuccessful.TryReadProperty(ref reader, options, PropSuccessful, null)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.ShardStatistics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Failed = propFailed.Value, + Failures = propFailures.Value, + Skipped = propSkipped.Value, + Successful = propSuccessful.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ShardStatistics value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFailed, value.Failed, null, null); + writer.WriteProperty(options, PropFailures, value.Failures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSkipped, value.Skipped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSuccessful, value.Successful, null, null); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ShardStatistics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ShardStatistics.g.cs index c2554ee2d28..3e659526bd1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ShardStatistics.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ShardStatistics.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class ShardStatisticsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFailed = System.Text.Json.JsonEncodedText.Encode("failed"); - private static readonly System.Text.Json.JsonEncodedText PropFailures = System.Text.Json.JsonEncodedText.Encode("failures"); - private static readonly System.Text.Json.JsonEncodedText PropSkipped = System.Text.Json.JsonEncodedText.Encode("skipped"); - private static readonly System.Text.Json.JsonEncodedText PropSuccessful = System.Text.Json.JsonEncodedText.Encode("successful"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.ShardStatistics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFailed = default; - LocalJsonValue?> propFailures = default; - LocalJsonValue propSkipped = default; - LocalJsonValue propSuccessful = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFailed.TryReadProperty(ref reader, options, PropFailed, null)) - { - continue; - } - - if (propFailures.TryReadProperty(ref reader, options, PropFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propSkipped.TryReadProperty(ref reader, options, PropSkipped, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propSuccessful.TryReadProperty(ref reader, options, PropSuccessful, null)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.ShardStatistics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Failed = propFailed.Value, - Failures = propFailures.Value, - Skipped = propSkipped.Value, - Successful = propSuccessful.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ShardStatistics value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFailed, value.Failed, null, null); - writer.WriteProperty(options, PropFailures, value.Failures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSkipped, value.Skipped, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropSuccessful, value.Successful, null, null); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.ShardStatisticsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ShardStatisticsConverter))] public sealed partial class ShardStatistics { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Simulate/IngestDocumentSimulation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Simulate/IngestDocumentSimulation.Converters.g.cs new file mode 100644 index 00000000000..c9243781373 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Simulate/IngestDocumentSimulation.Converters.g.cs @@ -0,0 +1,132 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Simulate.Json; + +public sealed partial class IngestDocumentSimulationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEffectiveMapping = System.Text.Json.JsonEncodedText.Encode("effective_mapping"); + private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); + private static readonly System.Text.Json.JsonEncodedText PropExecutedPipelines = System.Text.Json.JsonEncodedText.Encode("executed_pipelines"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoredFields = System.Text.Json.JsonEncodedText.Encode("ignored_fields"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("_version"); + + public override Elastic.Clients.Elasticsearch.Simulate.IngestDocumentSimulation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEffectiveMapping = default; + LocalJsonValue propError = default; + LocalJsonValue> propExecutedPipelines = default; + LocalJsonValue propId = default; + LocalJsonValue>?> propIgnoredFields = default; + LocalJsonValue propIndex = default; + System.Collections.Generic.Dictionary? propMetadata = default; + LocalJsonValue> propSource = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEffectiveMapping.TryReadProperty(ref reader, options, PropEffectiveMapping, null)) + { + continue; + } + + if (propError.TryReadProperty(ref reader, options, PropError, null)) + { + continue; + } + + if (propExecutedPipelines.TryReadProperty(ref reader, options, PropExecutedPipelines, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIgnoredFields.TryReadProperty(ref reader, options, PropIgnoredFields, static System.Collections.Generic.IReadOnlyCollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!))) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + propMetadata ??= new System.Collections.Generic.Dictionary(); + reader.ReadProperty(options, out string key, out string value, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!, null); + propMetadata[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Simulate.IngestDocumentSimulation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + EffectiveMapping = propEffectiveMapping.Value, + Error = propError.Value, + ExecutedPipelines = propExecutedPipelines.Value, + Id = propId.Value, + IgnoredFields = propIgnoredFields.Value, + Index = propIndex.Value, + Metadata = propMetadata, + Source = propSource.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Simulate.IngestDocumentSimulation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEffectiveMapping, value.EffectiveMapping, null, null); + writer.WriteProperty(options, PropError, value.Error, null, null); + writer.WriteProperty(options, PropExecutedPipelines, value.ExecutedPipelines, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIgnoredFields, value.IgnoredFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection>? v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null))); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropSource, value.Source, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + if (value.Metadata is not null) + { + foreach (var item in value.Metadata) + { + writer.WriteProperty(options, item.Key, item.Value, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), null); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Simulate/IngestDocumentSimulation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Simulate/IngestDocumentSimulation.g.cs index acdff0fa1ef..b4bc548abc1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Simulate/IngestDocumentSimulation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Simulate/IngestDocumentSimulation.g.cs @@ -23,105 +23,6 @@ namespace Elastic.Clients.Elasticsearch.Simulate; -internal sealed partial class IngestDocumentSimulationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); - private static readonly System.Text.Json.JsonEncodedText PropExecutedPipelines = System.Text.Json.JsonEncodedText.Encode("executed_pipelines"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoredFields = System.Text.Json.JsonEncodedText.Encode("ignored_fields"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("_index"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("_version"); - - public override Elastic.Clients.Elasticsearch.Simulate.IngestDocumentSimulation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propError = default; - LocalJsonValue> propExecutedPipelines = default; - LocalJsonValue propId = default; - LocalJsonValue>?> propIgnoredFields = default; - LocalJsonValue propIndex = default; - System.Collections.Generic.Dictionary? propMetadata = default; - LocalJsonValue> propSource = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propError.TryReadProperty(ref reader, options, PropError, null)) - { - continue; - } - - if (propExecutedPipelines.TryReadProperty(ref reader, options, PropExecutedPipelines, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIgnoredFields.TryReadProperty(ref reader, options, PropIgnoredFields, static System.Collections.Generic.IReadOnlyCollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!))) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - propMetadata ??= new System.Collections.Generic.Dictionary(); - reader.ReadProperty(options, out string key, out string value, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!, null); - propMetadata[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Simulate.IngestDocumentSimulation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Error = propError.Value, - ExecutedPipelines = propExecutedPipelines.Value, - Id = propId.Value, - IgnoredFields = propIgnoredFields.Value, - Index = propIndex.Value, - Metadata = propMetadata, - Source = propSource.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Simulate.IngestDocumentSimulation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropError, value.Error, null, null); - writer.WriteProperty(options, PropExecutedPipelines, value.ExecutedPipelines, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIgnoredFields, value.IgnoredFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection>? v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null))); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropSource, value.Source, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - if (value.Metadata is not null) - { - foreach (var item in value.Metadata) - { - writer.WriteProperty(options, item.Key, item.Value, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), null); - } - } - - writer.WriteEndObject(); - } -} - /// /// /// The results of ingest simulation on a single document. The _source of the document contains @@ -130,7 +31,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// document had been ingested into _index. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Simulate.IngestDocumentSimulationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Simulate.Json.IngestDocumentSimulationConverter))] public sealed partial class IngestDocumentSimulation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -159,6 +60,8 @@ internal IngestDocumentSimulation(Elastic.Clients.Elasticsearch.Serialization.Js _ = sentinel; } + public Elastic.Clients.Elasticsearch.Mapping.TypeMapping? EffectiveMapping { get; set; } + /// /// /// Any error resulting from simulatng ingest on this doc. This can be an error generated by diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Simulate/MergeType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Simulate/MergeType.Converters.g.cs new file mode 100644 index 00000000000..638e2d65bed --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Simulate/MergeType.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Simulate.Json; + +public sealed partial class MergeTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText MemberTemplate = System.Text.Json.JsonEncodedText.Encode("template"); + + public override Elastic.Clients.Elasticsearch.Simulate.MergeType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberIndex)) + { + return Elastic.Clients.Elasticsearch.Simulate.MergeType.Index; + } + + if (reader.ValueTextEquals(MemberTemplate)) + { + return Elastic.Clients.Elasticsearch.Simulate.MergeType.Template; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberIndex.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Simulate.MergeType.Index; + } + + if (string.Equals(value, MemberTemplate.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Simulate.MergeType.Template; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Simulate.MergeType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Simulate.MergeType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Simulate.MergeType.Index: + writer.WriteStringValue(MemberIndex); + break; + case Elastic.Clients.Elasticsearch.Simulate.MergeType.Template: + writer.WriteStringValue(MemberTemplate); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Simulate.MergeType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Simulate.MergeType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Simulate.MergeType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Simulate/MergeType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Simulate/MergeType.g.cs new file mode 100644 index 00000000000..76136b8c932 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Simulate/MergeType.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Simulate; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Simulate.Json.MergeTypeConverter))] +public enum MergeType +{ + [System.Runtime.Serialization.EnumMember(Value = "index")] + Index, + [System.Runtime.Serialization.EnumMember(Value = "template")] + Template +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Simulate/SimulateIngestDocumentResult.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Simulate/SimulateIngestDocumentResult.Converters.g.cs new file mode 100644 index 00000000000..c4d632f03ad --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Simulate/SimulateIngestDocumentResult.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Simulate.Json; + +public sealed partial class SimulateIngestDocumentResultConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDoc = System.Text.Json.JsonEncodedText.Encode("doc"); + + public override Elastic.Clients.Elasticsearch.Simulate.SimulateIngestDocumentResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDoc = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDoc.TryReadProperty(ref reader, options, PropDoc, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Simulate.SimulateIngestDocumentResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Doc = propDoc.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Simulate.SimulateIngestDocumentResult value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDoc, value.Doc, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Simulate/SimulateIngestDocumentResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Simulate/SimulateIngestDocumentResult.g.cs index b746565fdf4..3b689ff96a0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Simulate/SimulateIngestDocumentResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Simulate/SimulateIngestDocumentResult.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Simulate; -internal sealed partial class SimulateIngestDocumentResultConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDoc = System.Text.Json.JsonEncodedText.Encode("doc"); - - public override Elastic.Clients.Elasticsearch.Simulate.SimulateIngestDocumentResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDoc = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDoc.TryReadProperty(ref reader, options, PropDoc, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Simulate.SimulateIngestDocumentResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Doc = propDoc.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Simulate.SimulateIngestDocumentResult value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDoc, value.Doc, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Simulate.SimulateIngestDocumentResultConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Simulate.Json.SimulateIngestDocumentResultConverter))] public sealed partial class SimulateIngestDocumentResult { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SlicedScroll.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SlicedScroll.Converters.g.cs new file mode 100644 index 00000000000..9736a593bd6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SlicedScroll.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class SlicedScrollConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); + + public override Elastic.Clients.Elasticsearch.SlicedScroll Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propId = default; + LocalJsonValue propMax = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propMax.TryReadProperty(ref reader, options, PropMax, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SlicedScroll(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Id = propId.Value, + Max = propMax.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SlicedScroll value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropMax, value.Max, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SlicedScroll.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SlicedScroll.g.cs index 66e4c3d76a7..39fe6abd24b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SlicedScroll.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SlicedScroll.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class SlicedScrollConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); - - public override Elastic.Clients.Elasticsearch.SlicedScroll Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propId = default; - LocalJsonValue propMax = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propMax.TryReadProperty(ref reader, options, PropMax, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SlicedScroll(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Id = propId.Value, - Max = propMax.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SlicedScroll value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropMax, value.Max, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SlicedScrollConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.SlicedScrollConverter))] public sealed partial class SlicedScroll { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Slices.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Slices.Converters.g.cs new file mode 100644 index 00000000000..79de16bbae3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Slices.Converters.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class SlicesConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Slices Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String); + return selector(ref reader, options) switch + { + Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Slices(reader.ReadValue(options, null)), + Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Slices(reader.ReadValue(options, null)), + _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Slices)}") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Slices value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Tag) + { + case Elastic.Clients.Elasticsearch.UnionTag.T1: + { + writer.WriteValue(options, value.Value1, null); + break; + } + + case Elastic.Clients.Elasticsearch.UnionTag.T2: + { + writer.WriteValue(options, value.Value2, null); + break; + } + + default: + throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Slices.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Slices.g.cs index e3418183568..e90e3ef5828 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Slices.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Slices.g.cs @@ -23,47 +23,12 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class SlicesConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Slices Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String); - return selector(ref reader, options) switch - { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Slices(reader.ReadValue(options, null)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Slices(reader.ReadValue(options, null)), - _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Slices)}") - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Slices value, System.Text.Json.JsonSerializerOptions options) - { - switch (value.Tag) - { - case Elastic.Clients.Elasticsearch.UnionTag.T1: - { - writer.WriteValue(options, value.Value1, null); - break; - } - - case Elastic.Clients.Elasticsearch.UnionTag.T2: - { - writer.WriteValue(options, value.Value2, null); - break; - } - - default: - throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); - } - } -} - /// /// /// Slices configuration used to parallelize a process. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SlicesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.SlicesConverter))] public sealed partial class Slices : Elastic.Clients.Elasticsearch.Union { public Slices(int value) : base(value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SlicesCalculation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SlicesCalculation.Converters.g.cs new file mode 100644 index 00000000000..439e0bf7bc1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SlicesCalculation.Converters.g.cs @@ -0,0 +1,67 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class SlicesCalculationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAuto = System.Text.Json.JsonEncodedText.Encode("auto"); + + public override Elastic.Clients.Elasticsearch.SlicesCalculation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAuto)) + { + return Elastic.Clients.Elasticsearch.SlicesCalculation.Auto; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAuto.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.SlicesCalculation.Auto; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.SlicesCalculation)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SlicesCalculation value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.SlicesCalculation.Auto: + writer.WriteStringValue(MemberAuto); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.SlicesCalculation)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.SlicesCalculation ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SlicesCalculation value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SlicesCalculation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SlicesCalculation.g.cs new file mode 100644 index 00000000000..d598ab9b2a8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SlicesCalculation.g.cs @@ -0,0 +1,36 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.SlicesCalculationConverter))] +public enum SlicesCalculation +{ + /// + /// + /// Let Elasticsearch choose a reasonable number for most data streams and indices. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "auto")] + Auto +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/AzureRepository.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/AzureRepository.Converters.g.cs new file mode 100644 index 00000000000..9ec5c7b056e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/AzureRepository.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class AzureRepositoryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropUuid = System.Text.Json.JsonEncodedText.Encode("uuid"); + + public override Elastic.Clients.Elasticsearch.Snapshot.AzureRepository Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propSettings = default; + LocalJsonValue propUuid = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propUuid.TryReadProperty(ref reader, options, PropUuid, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.AzureRepository(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Settings = propSettings.Value, + Uuid = propUuid.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.AzureRepository value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSettings, value.Settings, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropUuid, value.Uuid, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/AzureRepository.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/AzureRepository.g.cs index 6cf9b18bcc7..553e3379d0b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/AzureRepository.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/AzureRepository.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class AzureRepositoryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropUuid = System.Text.Json.JsonEncodedText.Encode("uuid"); - - public override Elastic.Clients.Elasticsearch.Snapshot.AzureRepository Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propSettings = default; - LocalJsonValue propUuid = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propUuid.TryReadProperty(ref reader, options, PropUuid, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.AzureRepository(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Settings = propSettings.Value, - Uuid = propUuid.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.AzureRepository value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSettings, value.Settings, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropUuid, value.Uuid, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.AzureRepositoryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.AzureRepositoryConverter))] public sealed partial class AzureRepository : Elastic.Clients.Elasticsearch.Snapshot.IRepository { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/AzureRepositorySettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/AzureRepositorySettings.Converters.g.cs new file mode 100644 index 00000000000..e6c6987073f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/AzureRepositorySettings.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class AzureRepositorySettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBasePath = System.Text.Json.JsonEncodedText.Encode("base_path"); + private static readonly System.Text.Json.JsonEncodedText PropChunkSize = System.Text.Json.JsonEncodedText.Encode("chunk_size"); + private static readonly System.Text.Json.JsonEncodedText PropClient = System.Text.Json.JsonEncodedText.Encode("client"); + private static readonly System.Text.Json.JsonEncodedText PropCompress = System.Text.Json.JsonEncodedText.Encode("compress"); + private static readonly System.Text.Json.JsonEncodedText PropContainer = System.Text.Json.JsonEncodedText.Encode("container"); + private static readonly System.Text.Json.JsonEncodedText PropDeleteObjectsMaxSize = System.Text.Json.JsonEncodedText.Encode("delete_objects_max_size"); + private static readonly System.Text.Json.JsonEncodedText PropLocationMode = System.Text.Json.JsonEncodedText.Encode("location_mode"); + private static readonly System.Text.Json.JsonEncodedText PropMaxConcurrentBatchDeletes = System.Text.Json.JsonEncodedText.Encode("max_concurrent_batch_deletes"); + private static readonly System.Text.Json.JsonEncodedText PropMaxRestoreBytesPerSec = System.Text.Json.JsonEncodedText.Encode("max_restore_bytes_per_sec"); + private static readonly System.Text.Json.JsonEncodedText PropMaxSnapshotBytesPerSec = System.Text.Json.JsonEncodedText.Encode("max_snapshot_bytes_per_sec"); + private static readonly System.Text.Json.JsonEncodedText PropReadonly = System.Text.Json.JsonEncodedText.Encode("readonly"); + + public override Elastic.Clients.Elasticsearch.Snapshot.AzureRepositorySettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBasePath = default; + LocalJsonValue propChunkSize = default; + LocalJsonValue propClient = default; + LocalJsonValue propCompress = default; + LocalJsonValue propContainer = default; + LocalJsonValue propDeleteObjectsMaxSize = default; + LocalJsonValue propLocationMode = default; + LocalJsonValue propMaxConcurrentBatchDeletes = default; + LocalJsonValue propMaxRestoreBytesPerSec = default; + LocalJsonValue propMaxSnapshotBytesPerSec = default; + LocalJsonValue propReadonly = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBasePath.TryReadProperty(ref reader, options, PropBasePath, null)) + { + continue; + } + + if (propChunkSize.TryReadProperty(ref reader, options, PropChunkSize, null)) + { + continue; + } + + if (propClient.TryReadProperty(ref reader, options, PropClient, null)) + { + continue; + } + + if (propCompress.TryReadProperty(ref reader, options, PropCompress, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propContainer.TryReadProperty(ref reader, options, PropContainer, null)) + { + continue; + } + + if (propDeleteObjectsMaxSize.TryReadProperty(ref reader, options, PropDeleteObjectsMaxSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLocationMode.TryReadProperty(ref reader, options, PropLocationMode, null)) + { + continue; + } + + if (propMaxConcurrentBatchDeletes.TryReadProperty(ref reader, options, PropMaxConcurrentBatchDeletes, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxRestoreBytesPerSec.TryReadProperty(ref reader, options, PropMaxRestoreBytesPerSec, null)) + { + continue; + } + + if (propMaxSnapshotBytesPerSec.TryReadProperty(ref reader, options, PropMaxSnapshotBytesPerSec, null)) + { + continue; + } + + if (propReadonly.TryReadProperty(ref reader, options, PropReadonly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.AzureRepositorySettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BasePath = propBasePath.Value, + ChunkSize = propChunkSize.Value, + Client = propClient.Value, + Compress = propCompress.Value, + Container = propContainer.Value, + DeleteObjectsMaxSize = propDeleteObjectsMaxSize.Value, + LocationMode = propLocationMode.Value, + MaxConcurrentBatchDeletes = propMaxConcurrentBatchDeletes.Value, + MaxRestoreBytesPerSec = propMaxRestoreBytesPerSec.Value, + MaxSnapshotBytesPerSec = propMaxSnapshotBytesPerSec.Value, + Readonly = propReadonly.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.AzureRepositorySettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBasePath, value.BasePath, null, null); + writer.WriteProperty(options, PropChunkSize, value.ChunkSize, null, null); + writer.WriteProperty(options, PropClient, value.Client, null, null); + writer.WriteProperty(options, PropCompress, value.Compress, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropContainer, value.Container, null, null); + writer.WriteProperty(options, PropDeleteObjectsMaxSize, value.DeleteObjectsMaxSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLocationMode, value.LocationMode, null, null); + writer.WriteProperty(options, PropMaxConcurrentBatchDeletes, value.MaxConcurrentBatchDeletes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxRestoreBytesPerSec, value.MaxRestoreBytesPerSec, null, null); + writer.WriteProperty(options, PropMaxSnapshotBytesPerSec, value.MaxSnapshotBytesPerSec, null, null); + writer.WriteProperty(options, PropReadonly, value.Readonly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/AzureRepositorySettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/AzureRepositorySettings.g.cs index 8da721b9620..0dc3c79eb39 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/AzureRepositorySettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/AzureRepositorySettings.g.cs @@ -23,136 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class AzureRepositorySettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBasePath = System.Text.Json.JsonEncodedText.Encode("base_path"); - private static readonly System.Text.Json.JsonEncodedText PropChunkSize = System.Text.Json.JsonEncodedText.Encode("chunk_size"); - private static readonly System.Text.Json.JsonEncodedText PropClient = System.Text.Json.JsonEncodedText.Encode("client"); - private static readonly System.Text.Json.JsonEncodedText PropCompress = System.Text.Json.JsonEncodedText.Encode("compress"); - private static readonly System.Text.Json.JsonEncodedText PropContainer = System.Text.Json.JsonEncodedText.Encode("container"); - private static readonly System.Text.Json.JsonEncodedText PropDeleteObjectsMaxSize = System.Text.Json.JsonEncodedText.Encode("delete_objects_max_size"); - private static readonly System.Text.Json.JsonEncodedText PropLocationMode = System.Text.Json.JsonEncodedText.Encode("location_mode"); - private static readonly System.Text.Json.JsonEncodedText PropMaxConcurrentBatchDeletes = System.Text.Json.JsonEncodedText.Encode("max_concurrent_batch_deletes"); - private static readonly System.Text.Json.JsonEncodedText PropMaxRestoreBytesPerSec = System.Text.Json.JsonEncodedText.Encode("max_restore_bytes_per_sec"); - private static readonly System.Text.Json.JsonEncodedText PropMaxSnapshotBytesPerSec = System.Text.Json.JsonEncodedText.Encode("max_snapshot_bytes_per_sec"); - private static readonly System.Text.Json.JsonEncodedText PropReadonly = System.Text.Json.JsonEncodedText.Encode("readonly"); - - public override Elastic.Clients.Elasticsearch.Snapshot.AzureRepositorySettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBasePath = default; - LocalJsonValue propChunkSize = default; - LocalJsonValue propClient = default; - LocalJsonValue propCompress = default; - LocalJsonValue propContainer = default; - LocalJsonValue propDeleteObjectsMaxSize = default; - LocalJsonValue propLocationMode = default; - LocalJsonValue propMaxConcurrentBatchDeletes = default; - LocalJsonValue propMaxRestoreBytesPerSec = default; - LocalJsonValue propMaxSnapshotBytesPerSec = default; - LocalJsonValue propReadonly = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBasePath.TryReadProperty(ref reader, options, PropBasePath, null)) - { - continue; - } - - if (propChunkSize.TryReadProperty(ref reader, options, PropChunkSize, null)) - { - continue; - } - - if (propClient.TryReadProperty(ref reader, options, PropClient, null)) - { - continue; - } - - if (propCompress.TryReadProperty(ref reader, options, PropCompress, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propContainer.TryReadProperty(ref reader, options, PropContainer, null)) - { - continue; - } - - if (propDeleteObjectsMaxSize.TryReadProperty(ref reader, options, PropDeleteObjectsMaxSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLocationMode.TryReadProperty(ref reader, options, PropLocationMode, null)) - { - continue; - } - - if (propMaxConcurrentBatchDeletes.TryReadProperty(ref reader, options, PropMaxConcurrentBatchDeletes, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxRestoreBytesPerSec.TryReadProperty(ref reader, options, PropMaxRestoreBytesPerSec, null)) - { - continue; - } - - if (propMaxSnapshotBytesPerSec.TryReadProperty(ref reader, options, PropMaxSnapshotBytesPerSec, null)) - { - continue; - } - - if (propReadonly.TryReadProperty(ref reader, options, PropReadonly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.AzureRepositorySettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BasePath = propBasePath.Value, - ChunkSize = propChunkSize.Value, - Client = propClient.Value, - Compress = propCompress.Value, - Container = propContainer.Value, - DeleteObjectsMaxSize = propDeleteObjectsMaxSize.Value, - LocationMode = propLocationMode.Value, - MaxConcurrentBatchDeletes = propMaxConcurrentBatchDeletes.Value, - MaxRestoreBytesPerSec = propMaxRestoreBytesPerSec.Value, - MaxSnapshotBytesPerSec = propMaxSnapshotBytesPerSec.Value, - Readonly = propReadonly.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.AzureRepositorySettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBasePath, value.BasePath, null, null); - writer.WriteProperty(options, PropChunkSize, value.ChunkSize, null, null); - writer.WriteProperty(options, PropClient, value.Client, null, null); - writer.WriteProperty(options, PropCompress, value.Compress, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropContainer, value.Container, null, null); - writer.WriteProperty(options, PropDeleteObjectsMaxSize, value.DeleteObjectsMaxSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLocationMode, value.LocationMode, null, null); - writer.WriteProperty(options, PropMaxConcurrentBatchDeletes, value.MaxConcurrentBatchDeletes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxRestoreBytesPerSec, value.MaxRestoreBytesPerSec, null, null); - writer.WriteProperty(options, PropMaxSnapshotBytesPerSec, value.MaxSnapshotBytesPerSec, null, null); - writer.WriteProperty(options, PropReadonly, value.Readonly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.AzureRepositorySettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.AzureRepositorySettingsConverter))] public sealed partial class AzureRepositorySettings { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/BlobDetails.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/BlobDetails.Converters.g.cs new file mode 100644 index 00000000000..179cfacdf2b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/BlobDetails.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class BlobDetailsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropOverwritten = System.Text.Json.JsonEncodedText.Encode("overwritten"); + private static readonly System.Text.Json.JsonEncodedText PropReadEarly = System.Text.Json.JsonEncodedText.Encode("read_early"); + private static readonly System.Text.Json.JsonEncodedText PropReadEnd = System.Text.Json.JsonEncodedText.Encode("read_end"); + private static readonly System.Text.Json.JsonEncodedText PropReads = System.Text.Json.JsonEncodedText.Encode("reads"); + private static readonly System.Text.Json.JsonEncodedText PropReadStart = System.Text.Json.JsonEncodedText.Encode("read_start"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropSizeBytes = System.Text.Json.JsonEncodedText.Encode("size_bytes"); + + public override Elastic.Clients.Elasticsearch.Snapshot.BlobDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + LocalJsonValue propOverwritten = default; + LocalJsonValue propReadEarly = default; + LocalJsonValue propReadEnd = default; + LocalJsonValue propReads = default; + LocalJsonValue propReadStart = default; + LocalJsonValue propSize = default; + LocalJsonValue propSizeBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propOverwritten.TryReadProperty(ref reader, options, PropOverwritten, null)) + { + continue; + } + + if (propReadEarly.TryReadProperty(ref reader, options, PropReadEarly, null)) + { + continue; + } + + if (propReadEnd.TryReadProperty(ref reader, options, PropReadEnd, null)) + { + continue; + } + + if (propReads.TryReadProperty(ref reader, options, PropReads, null)) + { + continue; + } + + if (propReadStart.TryReadProperty(ref reader, options, PropReadStart, null)) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, null)) + { + continue; + } + + if (propSizeBytes.TryReadProperty(ref reader, options, PropSizeBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.BlobDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value, + Overwritten = propOverwritten.Value, + ReadEarly = propReadEarly.Value, + ReadEnd = propReadEnd.Value, + Reads = propReads.Value, + ReadStart = propReadStart.Value, + Size = propSize.Value, + SizeBytes = propSizeBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.BlobDetails value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropOverwritten, value.Overwritten, null, null); + writer.WriteProperty(options, PropReadEarly, value.ReadEarly, null, null); + writer.WriteProperty(options, PropReadEnd, value.ReadEnd, null, null); + writer.WriteProperty(options, PropReads, value.Reads, null, null); + writer.WriteProperty(options, PropReadStart, value.ReadStart, null, null); + writer.WriteProperty(options, PropSize, value.Size, null, null); + writer.WriteProperty(options, PropSizeBytes, value.SizeBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/BlobDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/BlobDetails.g.cs index b9d5dc548dc..45d337d3fe7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/BlobDetails.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/BlobDetails.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class BlobDetailsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropOverwritten = System.Text.Json.JsonEncodedText.Encode("overwritten"); - private static readonly System.Text.Json.JsonEncodedText PropReadEarly = System.Text.Json.JsonEncodedText.Encode("read_early"); - private static readonly System.Text.Json.JsonEncodedText PropReadEnd = System.Text.Json.JsonEncodedText.Encode("read_end"); - private static readonly System.Text.Json.JsonEncodedText PropReads = System.Text.Json.JsonEncodedText.Encode("reads"); - private static readonly System.Text.Json.JsonEncodedText PropReadStart = System.Text.Json.JsonEncodedText.Encode("read_start"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropSizeBytes = System.Text.Json.JsonEncodedText.Encode("size_bytes"); - - public override Elastic.Clients.Elasticsearch.Snapshot.BlobDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - LocalJsonValue propOverwritten = default; - LocalJsonValue propReadEarly = default; - LocalJsonValue propReadEnd = default; - LocalJsonValue propReads = default; - LocalJsonValue propReadStart = default; - LocalJsonValue propSize = default; - LocalJsonValue propSizeBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propOverwritten.TryReadProperty(ref reader, options, PropOverwritten, null)) - { - continue; - } - - if (propReadEarly.TryReadProperty(ref reader, options, PropReadEarly, null)) - { - continue; - } - - if (propReadEnd.TryReadProperty(ref reader, options, PropReadEnd, null)) - { - continue; - } - - if (propReads.TryReadProperty(ref reader, options, PropReads, null)) - { - continue; - } - - if (propReadStart.TryReadProperty(ref reader, options, PropReadStart, null)) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, null)) - { - continue; - } - - if (propSizeBytes.TryReadProperty(ref reader, options, PropSizeBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.BlobDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value, - Overwritten = propOverwritten.Value, - ReadEarly = propReadEarly.Value, - ReadEnd = propReadEnd.Value, - Reads = propReads.Value, - ReadStart = propReadStart.Value, - Size = propSize.Value, - SizeBytes = propSizeBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.BlobDetails value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropOverwritten, value.Overwritten, null, null); - writer.WriteProperty(options, PropReadEarly, value.ReadEarly, null, null); - writer.WriteProperty(options, PropReadEnd, value.ReadEnd, null, null); - writer.WriteProperty(options, PropReads, value.Reads, null, null); - writer.WriteProperty(options, PropReadStart, value.ReadStart, null, null); - writer.WriteProperty(options, PropSize, value.Size, null, null); - writer.WriteProperty(options, PropSizeBytes, value.SizeBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.BlobDetailsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.BlobDetailsConverter))] public sealed partial class BlobDetails { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/CleanupRepositoryResults.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/CleanupRepositoryResults.Converters.g.cs new file mode 100644 index 00000000000..44bc4e966bd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/CleanupRepositoryResults.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class CleanupRepositoryResultsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDeletedBlobs = System.Text.Json.JsonEncodedText.Encode("deleted_blobs"); + private static readonly System.Text.Json.JsonEncodedText PropDeletedBytes = System.Text.Json.JsonEncodedText.Encode("deleted_bytes"); + + public override Elastic.Clients.Elasticsearch.Snapshot.CleanupRepositoryResults Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDeletedBlobs = default; + LocalJsonValue propDeletedBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDeletedBlobs.TryReadProperty(ref reader, options, PropDeletedBlobs, null)) + { + continue; + } + + if (propDeletedBytes.TryReadProperty(ref reader, options, PropDeletedBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.CleanupRepositoryResults(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DeletedBlobs = propDeletedBlobs.Value, + DeletedBytes = propDeletedBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.CleanupRepositoryResults value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDeletedBlobs, value.DeletedBlobs, null, null); + writer.WriteProperty(options, PropDeletedBytes, value.DeletedBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/CleanupRepositoryResults.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/CleanupRepositoryResults.g.cs index c4a4c4f8259..081dd56b421 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/CleanupRepositoryResults.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/CleanupRepositoryResults.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class CleanupRepositoryResultsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDeletedBlobs = System.Text.Json.JsonEncodedText.Encode("deleted_blobs"); - private static readonly System.Text.Json.JsonEncodedText PropDeletedBytes = System.Text.Json.JsonEncodedText.Encode("deleted_bytes"); - - public override Elastic.Clients.Elasticsearch.Snapshot.CleanupRepositoryResults Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDeletedBlobs = default; - LocalJsonValue propDeletedBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDeletedBlobs.TryReadProperty(ref reader, options, PropDeletedBlobs, null)) - { - continue; - } - - if (propDeletedBytes.TryReadProperty(ref reader, options, PropDeletedBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.CleanupRepositoryResults(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DeletedBlobs = propDeletedBlobs.Value, - DeletedBytes = propDeletedBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.CleanupRepositoryResults value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDeletedBlobs, value.DeletedBlobs, null, null); - writer.WriteProperty(options, PropDeletedBytes, value.DeletedBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.CleanupRepositoryResultsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.CleanupRepositoryResultsConverter))] public sealed partial class CleanupRepositoryResults { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/CompactNodeInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/CompactNodeInfo.Converters.g.cs new file mode 100644 index 00000000000..6702e19a979 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/CompactNodeInfo.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class CompactNodeInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.Snapshot.CompactNodeInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.CompactNodeInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.CompactNodeInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/CompactNodeInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/CompactNodeInfo.g.cs index 1857a0795b8..48b95d25da8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/CompactNodeInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/CompactNodeInfo.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class CompactNodeInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.Snapshot.CompactNodeInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.CompactNodeInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.CompactNodeInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.CompactNodeInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.CompactNodeInfoConverter))] public sealed partial class CompactNodeInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/DetailsInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/DetailsInfo.Converters.g.cs new file mode 100644 index 00000000000..3e7505ae98f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/DetailsInfo.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class DetailsInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBlob = System.Text.Json.JsonEncodedText.Encode("blob"); + private static readonly System.Text.Json.JsonEncodedText PropOverwriteElapsed = System.Text.Json.JsonEncodedText.Encode("overwrite_elapsed"); + private static readonly System.Text.Json.JsonEncodedText PropOverwriteElapsedNanos = System.Text.Json.JsonEncodedText.Encode("overwrite_elapsed_nanos"); + private static readonly System.Text.Json.JsonEncodedText PropWriteElapsed = System.Text.Json.JsonEncodedText.Encode("write_elapsed"); + private static readonly System.Text.Json.JsonEncodedText PropWriteElapsedNanos = System.Text.Json.JsonEncodedText.Encode("write_elapsed_nanos"); + private static readonly System.Text.Json.JsonEncodedText PropWriterNode = System.Text.Json.JsonEncodedText.Encode("writer_node"); + private static readonly System.Text.Json.JsonEncodedText PropWriteThrottled = System.Text.Json.JsonEncodedText.Encode("write_throttled"); + private static readonly System.Text.Json.JsonEncodedText PropWriteThrottledNanos = System.Text.Json.JsonEncodedText.Encode("write_throttled_nanos"); + + public override Elastic.Clients.Elasticsearch.Snapshot.DetailsInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBlob = default; + LocalJsonValue propOverwriteElapsed = default; + LocalJsonValue propOverwriteElapsedNanos = default; + LocalJsonValue propWriteElapsed = default; + LocalJsonValue propWriteElapsedNanos = default; + LocalJsonValue propWriterNode = default; + LocalJsonValue propWriteThrottled = default; + LocalJsonValue propWriteThrottledNanos = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBlob.TryReadProperty(ref reader, options, PropBlob, null)) + { + continue; + } + + if (propOverwriteElapsed.TryReadProperty(ref reader, options, PropOverwriteElapsed, null)) + { + continue; + } + + if (propOverwriteElapsedNanos.TryReadProperty(ref reader, options, PropOverwriteElapsedNanos, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) + { + continue; + } + + if (propWriteElapsed.TryReadProperty(ref reader, options, PropWriteElapsed, null)) + { + continue; + } + + if (propWriteElapsedNanos.TryReadProperty(ref reader, options, PropWriteElapsedNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) + { + continue; + } + + if (propWriterNode.TryReadProperty(ref reader, options, PropWriterNode, null)) + { + continue; + } + + if (propWriteThrottled.TryReadProperty(ref reader, options, PropWriteThrottled, null)) + { + continue; + } + + if (propWriteThrottledNanos.TryReadProperty(ref reader, options, PropWriteThrottledNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.DetailsInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Blob = propBlob.Value, + OverwriteElapsed = propOverwriteElapsed.Value, + OverwriteElapsedNanos = propOverwriteElapsedNanos.Value, + WriteElapsed = propWriteElapsed.Value, + WriteElapsedNanos = propWriteElapsedNanos.Value, + WriterNode = propWriterNode.Value, + WriteThrottled = propWriteThrottled.Value, + WriteThrottledNanos = propWriteThrottledNanos.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.DetailsInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBlob, value.Blob, null, null); + writer.WriteProperty(options, PropOverwriteElapsed, value.OverwriteElapsed, null, null); + writer.WriteProperty(options, PropOverwriteElapsedNanos, value.OverwriteElapsedNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); + writer.WriteProperty(options, PropWriteElapsed, value.WriteElapsed, null, null); + writer.WriteProperty(options, PropWriteElapsedNanos, value.WriteElapsedNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); + writer.WriteProperty(options, PropWriterNode, value.WriterNode, null, null); + writer.WriteProperty(options, PropWriteThrottled, value.WriteThrottled, null, null); + writer.WriteProperty(options, PropWriteThrottledNanos, value.WriteThrottledNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/DetailsInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/DetailsInfo.g.cs index ca8dbdd3b32..a6a04a38136 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/DetailsInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/DetailsInfo.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class DetailsInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBlob = System.Text.Json.JsonEncodedText.Encode("blob"); - private static readonly System.Text.Json.JsonEncodedText PropOverwriteElapsed = System.Text.Json.JsonEncodedText.Encode("overwrite_elapsed"); - private static readonly System.Text.Json.JsonEncodedText PropOverwriteElapsedNanos = System.Text.Json.JsonEncodedText.Encode("overwrite_elapsed_nanos"); - private static readonly System.Text.Json.JsonEncodedText PropWriteElapsed = System.Text.Json.JsonEncodedText.Encode("write_elapsed"); - private static readonly System.Text.Json.JsonEncodedText PropWriteElapsedNanos = System.Text.Json.JsonEncodedText.Encode("write_elapsed_nanos"); - private static readonly System.Text.Json.JsonEncodedText PropWriterNode = System.Text.Json.JsonEncodedText.Encode("writer_node"); - private static readonly System.Text.Json.JsonEncodedText PropWriteThrottled = System.Text.Json.JsonEncodedText.Encode("write_throttled"); - private static readonly System.Text.Json.JsonEncodedText PropWriteThrottledNanos = System.Text.Json.JsonEncodedText.Encode("write_throttled_nanos"); - - public override Elastic.Clients.Elasticsearch.Snapshot.DetailsInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBlob = default; - LocalJsonValue propOverwriteElapsed = default; - LocalJsonValue propOverwriteElapsedNanos = default; - LocalJsonValue propWriteElapsed = default; - LocalJsonValue propWriteElapsedNanos = default; - LocalJsonValue propWriterNode = default; - LocalJsonValue propWriteThrottled = default; - LocalJsonValue propWriteThrottledNanos = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBlob.TryReadProperty(ref reader, options, PropBlob, null)) - { - continue; - } - - if (propOverwriteElapsed.TryReadProperty(ref reader, options, PropOverwriteElapsed, null)) - { - continue; - } - - if (propOverwriteElapsedNanos.TryReadProperty(ref reader, options, PropOverwriteElapsedNanos, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) - { - continue; - } - - if (propWriteElapsed.TryReadProperty(ref reader, options, PropWriteElapsed, null)) - { - continue; - } - - if (propWriteElapsedNanos.TryReadProperty(ref reader, options, PropWriteElapsedNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) - { - continue; - } - - if (propWriterNode.TryReadProperty(ref reader, options, PropWriterNode, null)) - { - continue; - } - - if (propWriteThrottled.TryReadProperty(ref reader, options, PropWriteThrottled, null)) - { - continue; - } - - if (propWriteThrottledNanos.TryReadProperty(ref reader, options, PropWriteThrottledNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.DetailsInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Blob = propBlob.Value, - OverwriteElapsed = propOverwriteElapsed.Value, - OverwriteElapsedNanos = propOverwriteElapsedNanos.Value, - WriteElapsed = propWriteElapsed.Value, - WriteElapsedNanos = propWriteElapsedNanos.Value, - WriterNode = propWriterNode.Value, - WriteThrottled = propWriteThrottled.Value, - WriteThrottledNanos = propWriteThrottledNanos.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.DetailsInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBlob, value.Blob, null, null); - writer.WriteProperty(options, PropOverwriteElapsed, value.OverwriteElapsed, null, null); - writer.WriteProperty(options, PropOverwriteElapsedNanos, value.OverwriteElapsedNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); - writer.WriteProperty(options, PropWriteElapsed, value.WriteElapsed, null, null); - writer.WriteProperty(options, PropWriteElapsedNanos, value.WriteElapsedNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); - writer.WriteProperty(options, PropWriterNode, value.WriterNode, null, null); - writer.WriteProperty(options, PropWriteThrottled, value.WriteThrottled, null, null); - writer.WriteProperty(options, PropWriteThrottledNanos, value.WriteThrottledNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.DetailsInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.DetailsInfoConverter))] public sealed partial class DetailsInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/FileCountSnapshotStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/FileCountSnapshotStats.Converters.g.cs new file mode 100644 index 00000000000..628ef73391b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/FileCountSnapshotStats.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class FileCountSnapshotStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFileCount = System.Text.Json.JsonEncodedText.Encode("file_count"); + private static readonly System.Text.Json.JsonEncodedText PropSizeInBytes = System.Text.Json.JsonEncodedText.Encode("size_in_bytes"); + + public override Elastic.Clients.Elasticsearch.Snapshot.FileCountSnapshotStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFileCount = default; + LocalJsonValue propSizeInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFileCount.TryReadProperty(ref reader, options, PropFileCount, null)) + { + continue; + } + + if (propSizeInBytes.TryReadProperty(ref reader, options, PropSizeInBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.FileCountSnapshotStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FileCount = propFileCount.Value, + SizeInBytes = propSizeInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.FileCountSnapshotStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFileCount, value.FileCount, null, null); + writer.WriteProperty(options, PropSizeInBytes, value.SizeInBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/FileCountSnapshotStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/FileCountSnapshotStats.g.cs index 3fdec44cb69..1e1646697ff 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/FileCountSnapshotStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/FileCountSnapshotStats.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class FileCountSnapshotStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFileCount = System.Text.Json.JsonEncodedText.Encode("file_count"); - private static readonly System.Text.Json.JsonEncodedText PropSizeInBytes = System.Text.Json.JsonEncodedText.Encode("size_in_bytes"); - - public override Elastic.Clients.Elasticsearch.Snapshot.FileCountSnapshotStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFileCount = default; - LocalJsonValue propSizeInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFileCount.TryReadProperty(ref reader, options, PropFileCount, null)) - { - continue; - } - - if (propSizeInBytes.TryReadProperty(ref reader, options, PropSizeInBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.FileCountSnapshotStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FileCount = propFileCount.Value, - SizeInBytes = propSizeInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.FileCountSnapshotStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFileCount, value.FileCount, null, null); - writer.WriteProperty(options, PropSizeInBytes, value.SizeInBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.FileCountSnapshotStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.FileCountSnapshotStatsConverter))] public sealed partial class FileCountSnapshotStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/GcsRepository.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/GcsRepository.Converters.g.cs new file mode 100644 index 00000000000..c306da9c367 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/GcsRepository.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class GcsRepositoryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropUuid = System.Text.Json.JsonEncodedText.Encode("uuid"); + + public override Elastic.Clients.Elasticsearch.Snapshot.GcsRepository Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propSettings = default; + LocalJsonValue propUuid = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propUuid.TryReadProperty(ref reader, options, PropUuid, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.GcsRepository(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Settings = propSettings.Value, + Uuid = propUuid.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.GcsRepository value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSettings, value.Settings, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropUuid, value.Uuid, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/GcsRepository.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/GcsRepository.g.cs index 64480c2e6bf..a23b971c7b1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/GcsRepository.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/GcsRepository.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class GcsRepositoryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropUuid = System.Text.Json.JsonEncodedText.Encode("uuid"); - - public override Elastic.Clients.Elasticsearch.Snapshot.GcsRepository Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propSettings = default; - LocalJsonValue propUuid = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propUuid.TryReadProperty(ref reader, options, PropUuid, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.GcsRepository(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Settings = propSettings.Value, - Uuid = propUuid.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.GcsRepository value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSettings, value.Settings, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropUuid, value.Uuid, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.GcsRepositoryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.GcsRepositoryConverter))] public sealed partial class GcsRepository : Elastic.Clients.Elasticsearch.Snapshot.IRepository { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/GcsRepositorySettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/GcsRepositorySettings.Converters.g.cs new file mode 100644 index 00000000000..bdb6def30ce --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/GcsRepositorySettings.Converters.g.cs @@ -0,0 +1,141 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class GcsRepositorySettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApplicationName = System.Text.Json.JsonEncodedText.Encode("application_name"); + private static readonly System.Text.Json.JsonEncodedText PropBasePath = System.Text.Json.JsonEncodedText.Encode("base_path"); + private static readonly System.Text.Json.JsonEncodedText PropBucket = System.Text.Json.JsonEncodedText.Encode("bucket"); + private static readonly System.Text.Json.JsonEncodedText PropChunkSize = System.Text.Json.JsonEncodedText.Encode("chunk_size"); + private static readonly System.Text.Json.JsonEncodedText PropClient = System.Text.Json.JsonEncodedText.Encode("client"); + private static readonly System.Text.Json.JsonEncodedText PropCompress = System.Text.Json.JsonEncodedText.Encode("compress"); + private static readonly System.Text.Json.JsonEncodedText PropMaxRestoreBytesPerSec = System.Text.Json.JsonEncodedText.Encode("max_restore_bytes_per_sec"); + private static readonly System.Text.Json.JsonEncodedText PropMaxSnapshotBytesPerSec = System.Text.Json.JsonEncodedText.Encode("max_snapshot_bytes_per_sec"); + private static readonly System.Text.Json.JsonEncodedText PropReadonly = System.Text.Json.JsonEncodedText.Encode("readonly"); + + public override Elastic.Clients.Elasticsearch.Snapshot.GcsRepositorySettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApplicationName = default; + LocalJsonValue propBasePath = default; + LocalJsonValue propBucket = default; + LocalJsonValue propChunkSize = default; + LocalJsonValue propClient = default; + LocalJsonValue propCompress = default; + LocalJsonValue propMaxRestoreBytesPerSec = default; + LocalJsonValue propMaxSnapshotBytesPerSec = default; + LocalJsonValue propReadonly = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApplicationName.TryReadProperty(ref reader, options, PropApplicationName, null)) + { + continue; + } + + if (propBasePath.TryReadProperty(ref reader, options, PropBasePath, null)) + { + continue; + } + + if (propBucket.TryReadProperty(ref reader, options, PropBucket, null)) + { + continue; + } + + if (propChunkSize.TryReadProperty(ref reader, options, PropChunkSize, null)) + { + continue; + } + + if (propClient.TryReadProperty(ref reader, options, PropClient, null)) + { + continue; + } + + if (propCompress.TryReadProperty(ref reader, options, PropCompress, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxRestoreBytesPerSec.TryReadProperty(ref reader, options, PropMaxRestoreBytesPerSec, null)) + { + continue; + } + + if (propMaxSnapshotBytesPerSec.TryReadProperty(ref reader, options, PropMaxSnapshotBytesPerSec, null)) + { + continue; + } + + if (propReadonly.TryReadProperty(ref reader, options, PropReadonly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.GcsRepositorySettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { +#pragma warning disable CS0618 + ApplicationName = propApplicationName.Value +#pragma warning restore CS0618 +, + BasePath = propBasePath.Value, + Bucket = propBucket.Value, + ChunkSize = propChunkSize.Value, + Client = propClient.Value, + Compress = propCompress.Value, + MaxRestoreBytesPerSec = propMaxRestoreBytesPerSec.Value, + MaxSnapshotBytesPerSec = propMaxSnapshotBytesPerSec.Value, + Readonly = propReadonly.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.GcsRepositorySettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); +#pragma warning disable CS0618 + writer.WriteProperty(options, PropApplicationName, value.ApplicationName, null, null) +#pragma warning restore CS0618 + ; + writer.WriteProperty(options, PropBasePath, value.BasePath, null, null); + writer.WriteProperty(options, PropBucket, value.Bucket, null, null); + writer.WriteProperty(options, PropChunkSize, value.ChunkSize, null, null); + writer.WriteProperty(options, PropClient, value.Client, null, null); + writer.WriteProperty(options, PropCompress, value.Compress, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxRestoreBytesPerSec, value.MaxRestoreBytesPerSec, null, null); + writer.WriteProperty(options, PropMaxSnapshotBytesPerSec, value.MaxSnapshotBytesPerSec, null, null); + writer.WriteProperty(options, PropReadonly, value.Readonly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/GcsRepositorySettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/GcsRepositorySettings.g.cs index a96e5661560..14f70c824bf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/GcsRepositorySettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/GcsRepositorySettings.g.cs @@ -23,124 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class GcsRepositorySettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropApplicationName = System.Text.Json.JsonEncodedText.Encode("application_name"); - private static readonly System.Text.Json.JsonEncodedText PropBasePath = System.Text.Json.JsonEncodedText.Encode("base_path"); - private static readonly System.Text.Json.JsonEncodedText PropBucket = System.Text.Json.JsonEncodedText.Encode("bucket"); - private static readonly System.Text.Json.JsonEncodedText PropChunkSize = System.Text.Json.JsonEncodedText.Encode("chunk_size"); - private static readonly System.Text.Json.JsonEncodedText PropClient = System.Text.Json.JsonEncodedText.Encode("client"); - private static readonly System.Text.Json.JsonEncodedText PropCompress = System.Text.Json.JsonEncodedText.Encode("compress"); - private static readonly System.Text.Json.JsonEncodedText PropMaxRestoreBytesPerSec = System.Text.Json.JsonEncodedText.Encode("max_restore_bytes_per_sec"); - private static readonly System.Text.Json.JsonEncodedText PropMaxSnapshotBytesPerSec = System.Text.Json.JsonEncodedText.Encode("max_snapshot_bytes_per_sec"); - private static readonly System.Text.Json.JsonEncodedText PropReadonly = System.Text.Json.JsonEncodedText.Encode("readonly"); - - public override Elastic.Clients.Elasticsearch.Snapshot.GcsRepositorySettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propApplicationName = default; - LocalJsonValue propBasePath = default; - LocalJsonValue propBucket = default; - LocalJsonValue propChunkSize = default; - LocalJsonValue propClient = default; - LocalJsonValue propCompress = default; - LocalJsonValue propMaxRestoreBytesPerSec = default; - LocalJsonValue propMaxSnapshotBytesPerSec = default; - LocalJsonValue propReadonly = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propApplicationName.TryReadProperty(ref reader, options, PropApplicationName, null)) - { - continue; - } - - if (propBasePath.TryReadProperty(ref reader, options, PropBasePath, null)) - { - continue; - } - - if (propBucket.TryReadProperty(ref reader, options, PropBucket, null)) - { - continue; - } - - if (propChunkSize.TryReadProperty(ref reader, options, PropChunkSize, null)) - { - continue; - } - - if (propClient.TryReadProperty(ref reader, options, PropClient, null)) - { - continue; - } - - if (propCompress.TryReadProperty(ref reader, options, PropCompress, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxRestoreBytesPerSec.TryReadProperty(ref reader, options, PropMaxRestoreBytesPerSec, null)) - { - continue; - } - - if (propMaxSnapshotBytesPerSec.TryReadProperty(ref reader, options, PropMaxSnapshotBytesPerSec, null)) - { - continue; - } - - if (propReadonly.TryReadProperty(ref reader, options, PropReadonly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.GcsRepositorySettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { -#pragma warning disable CS0618 - ApplicationName = propApplicationName.Value -#pragma warning restore CS0618 -, - BasePath = propBasePath.Value, - Bucket = propBucket.Value, - ChunkSize = propChunkSize.Value, - Client = propClient.Value, - Compress = propCompress.Value, - MaxRestoreBytesPerSec = propMaxRestoreBytesPerSec.Value, - MaxSnapshotBytesPerSec = propMaxSnapshotBytesPerSec.Value, - Readonly = propReadonly.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.GcsRepositorySettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); -#pragma warning disable CS0618 - writer.WriteProperty(options, PropApplicationName, value.ApplicationName, null, null) -#pragma warning restore CS0618 - ; - writer.WriteProperty(options, PropBasePath, value.BasePath, null, null); - writer.WriteProperty(options, PropBucket, value.Bucket, null, null); - writer.WriteProperty(options, PropChunkSize, value.ChunkSize, null, null); - writer.WriteProperty(options, PropClient, value.Client, null, null); - writer.WriteProperty(options, PropCompress, value.Compress, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxRestoreBytesPerSec, value.MaxRestoreBytesPerSec, null, null); - writer.WriteProperty(options, PropMaxSnapshotBytesPerSec, value.MaxSnapshotBytesPerSec, null, null); - writer.WriteProperty(options, PropReadonly, value.Readonly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.GcsRepositorySettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.GcsRepositorySettingsConverter))] public sealed partial class GcsRepositorySettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/IndexDetails.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/IndexDetails.Converters.g.cs new file mode 100644 index 00000000000..ae2ac02ffec --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/IndexDetails.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class IndexDetailsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMaxSegmentsPerShard = System.Text.Json.JsonEncodedText.Encode("max_segments_per_shard"); + private static readonly System.Text.Json.JsonEncodedText PropShardCount = System.Text.Json.JsonEncodedText.Encode("shard_count"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropSizeInBytes = System.Text.Json.JsonEncodedText.Encode("size_in_bytes"); + + public override Elastic.Clients.Elasticsearch.Snapshot.IndexDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMaxSegmentsPerShard = default; + LocalJsonValue propShardCount = default; + LocalJsonValue propSize = default; + LocalJsonValue propSizeInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMaxSegmentsPerShard.TryReadProperty(ref reader, options, PropMaxSegmentsPerShard, null)) + { + continue; + } + + if (propShardCount.TryReadProperty(ref reader, options, PropShardCount, null)) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, null)) + { + continue; + } + + if (propSizeInBytes.TryReadProperty(ref reader, options, PropSizeInBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.IndexDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + MaxSegmentsPerShard = propMaxSegmentsPerShard.Value, + ShardCount = propShardCount.Value, + Size = propSize.Value, + SizeInBytes = propSizeInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.IndexDetails value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMaxSegmentsPerShard, value.MaxSegmentsPerShard, null, null); + writer.WriteProperty(options, PropShardCount, value.ShardCount, null, null); + writer.WriteProperty(options, PropSize, value.Size, null, null); + writer.WriteProperty(options, PropSizeInBytes, value.SizeInBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/IndexDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/IndexDetails.g.cs index 98c8dc4804b..7d561a53547 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/IndexDetails.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/IndexDetails.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class IndexDetailsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMaxSegmentsPerShard = System.Text.Json.JsonEncodedText.Encode("max_segments_per_shard"); - private static readonly System.Text.Json.JsonEncodedText PropShardCount = System.Text.Json.JsonEncodedText.Encode("shard_count"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropSizeInBytes = System.Text.Json.JsonEncodedText.Encode("size_in_bytes"); - - public override Elastic.Clients.Elasticsearch.Snapshot.IndexDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMaxSegmentsPerShard = default; - LocalJsonValue propShardCount = default; - LocalJsonValue propSize = default; - LocalJsonValue propSizeInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMaxSegmentsPerShard.TryReadProperty(ref reader, options, PropMaxSegmentsPerShard, null)) - { - continue; - } - - if (propShardCount.TryReadProperty(ref reader, options, PropShardCount, null)) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, null)) - { - continue; - } - - if (propSizeInBytes.TryReadProperty(ref reader, options, PropSizeInBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.IndexDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - MaxSegmentsPerShard = propMaxSegmentsPerShard.Value, - ShardCount = propShardCount.Value, - Size = propSize.Value, - SizeInBytes = propSizeInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.IndexDetails value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMaxSegmentsPerShard, value.MaxSegmentsPerShard, null, null); - writer.WriteProperty(options, PropShardCount, value.ShardCount, null, null); - writer.WriteProperty(options, PropSize, value.Size, null, null); - writer.WriteProperty(options, PropSizeInBytes, value.SizeInBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.IndexDetailsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.IndexDetailsConverter))] public sealed partial class IndexDetails { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/InfoFeatureState.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/InfoFeatureState.Converters.g.cs new file mode 100644 index 00000000000..330c82686db --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/InfoFeatureState.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class InfoFeatureStateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFeatureName = System.Text.Json.JsonEncodedText.Encode("feature_name"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + + public override Elastic.Clients.Elasticsearch.Snapshot.InfoFeatureState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFeatureName = default; + LocalJsonValue> propIndices = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFeatureName.TryReadProperty(ref reader, options, PropFeatureName, null)) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.InfoFeatureState(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FeatureName = propFeatureName.Value, + Indices = propIndices.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.InfoFeatureState value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFeatureName, value.FeatureName, null, null); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/InfoFeatureState.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/InfoFeatureState.g.cs index b5cb21af75c..b8d2058e190 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/InfoFeatureState.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/InfoFeatureState.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class InfoFeatureStateConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFeatureName = System.Text.Json.JsonEncodedText.Encode("feature_name"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - - public override Elastic.Clients.Elasticsearch.Snapshot.InfoFeatureState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFeatureName = default; - LocalJsonValue> propIndices = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFeatureName.TryReadProperty(ref reader, options, PropFeatureName, null)) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.InfoFeatureState(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FeatureName = propFeatureName.Value, - Indices = propIndices.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.InfoFeatureState value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFeatureName, value.FeatureName, null, null); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.InfoFeatureStateConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.InfoFeatureStateConverter))] public sealed partial class InfoFeatureState { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadBlobDetails.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadBlobDetails.Converters.g.cs new file mode 100644 index 00000000000..1a8a0e4ab91 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadBlobDetails.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class ReadBlobDetailsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBeforeWriteComplete = System.Text.Json.JsonEncodedText.Encode("before_write_complete"); + private static readonly System.Text.Json.JsonEncodedText PropElapsed = System.Text.Json.JsonEncodedText.Encode("elapsed"); + private static readonly System.Text.Json.JsonEncodedText PropElapsedNanos = System.Text.Json.JsonEncodedText.Encode("elapsed_nanos"); + private static readonly System.Text.Json.JsonEncodedText PropFirstByteTime = System.Text.Json.JsonEncodedText.Encode("first_byte_time"); + private static readonly System.Text.Json.JsonEncodedText PropFirstByteTimeNanos = System.Text.Json.JsonEncodedText.Encode("first_byte_time_nanos"); + private static readonly System.Text.Json.JsonEncodedText PropFound = System.Text.Json.JsonEncodedText.Encode("found"); + private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); + private static readonly System.Text.Json.JsonEncodedText PropThrottled = System.Text.Json.JsonEncodedText.Encode("throttled"); + private static readonly System.Text.Json.JsonEncodedText PropThrottledNanos = System.Text.Json.JsonEncodedText.Encode("throttled_nanos"); + + public override Elastic.Clients.Elasticsearch.Snapshot.ReadBlobDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBeforeWriteComplete = default; + LocalJsonValue propElapsed = default; + LocalJsonValue propElapsedNanos = default; + LocalJsonValue propFirstByteTime = default; + LocalJsonValue propFirstByteTimeNanos = default; + LocalJsonValue propFound = default; + LocalJsonValue propNode = default; + LocalJsonValue propThrottled = default; + LocalJsonValue propThrottledNanos = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBeforeWriteComplete.TryReadProperty(ref reader, options, PropBeforeWriteComplete, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propElapsed.TryReadProperty(ref reader, options, PropElapsed, null)) + { + continue; + } + + if (propElapsedNanos.TryReadProperty(ref reader, options, PropElapsedNanos, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) + { + continue; + } + + if (propFirstByteTime.TryReadProperty(ref reader, options, PropFirstByteTime, null)) + { + continue; + } + + if (propFirstByteTimeNanos.TryReadProperty(ref reader, options, PropFirstByteTimeNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) + { + continue; + } + + if (propFound.TryReadProperty(ref reader, options, PropFound, null)) + { + continue; + } + + if (propNode.TryReadProperty(ref reader, options, PropNode, null)) + { + continue; + } + + if (propThrottled.TryReadProperty(ref reader, options, PropThrottled, null)) + { + continue; + } + + if (propThrottledNanos.TryReadProperty(ref reader, options, PropThrottledNanos, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.ReadBlobDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BeforeWriteComplete = propBeforeWriteComplete.Value, + Elapsed = propElapsed.Value, + ElapsedNanos = propElapsedNanos.Value, + FirstByteTime = propFirstByteTime.Value, + FirstByteTimeNanos = propFirstByteTimeNanos.Value, + Found = propFound.Value, + Node = propNode.Value, + Throttled = propThrottled.Value, + ThrottledNanos = propThrottledNanos.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.ReadBlobDetails value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBeforeWriteComplete, value.BeforeWriteComplete, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropElapsed, value.Elapsed, null, null); + writer.WriteProperty(options, PropElapsedNanos, value.ElapsedNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); + writer.WriteProperty(options, PropFirstByteTime, value.FirstByteTime, null, null); + writer.WriteProperty(options, PropFirstByteTimeNanos, value.FirstByteTimeNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); + writer.WriteProperty(options, PropFound, value.Found, null, null); + writer.WriteProperty(options, PropNode, value.Node, null, null); + writer.WriteProperty(options, PropThrottled, value.Throttled, null, null); + writer.WriteProperty(options, PropThrottledNanos, value.ThrottledNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadBlobDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadBlobDetails.g.cs index c2c57a4d9f3..3cb5bc3bf25 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadBlobDetails.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadBlobDetails.g.cs @@ -23,118 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class ReadBlobDetailsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBeforeWriteComplete = System.Text.Json.JsonEncodedText.Encode("before_write_complete"); - private static readonly System.Text.Json.JsonEncodedText PropElapsed = System.Text.Json.JsonEncodedText.Encode("elapsed"); - private static readonly System.Text.Json.JsonEncodedText PropElapsedNanos = System.Text.Json.JsonEncodedText.Encode("elapsed_nanos"); - private static readonly System.Text.Json.JsonEncodedText PropFirstByteTime = System.Text.Json.JsonEncodedText.Encode("first_byte_time"); - private static readonly System.Text.Json.JsonEncodedText PropFirstByteTimeNanos = System.Text.Json.JsonEncodedText.Encode("first_byte_time_nanos"); - private static readonly System.Text.Json.JsonEncodedText PropFound = System.Text.Json.JsonEncodedText.Encode("found"); - private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); - private static readonly System.Text.Json.JsonEncodedText PropThrottled = System.Text.Json.JsonEncodedText.Encode("throttled"); - private static readonly System.Text.Json.JsonEncodedText PropThrottledNanos = System.Text.Json.JsonEncodedText.Encode("throttled_nanos"); - - public override Elastic.Clients.Elasticsearch.Snapshot.ReadBlobDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBeforeWriteComplete = default; - LocalJsonValue propElapsed = default; - LocalJsonValue propElapsedNanos = default; - LocalJsonValue propFirstByteTime = default; - LocalJsonValue propFirstByteTimeNanos = default; - LocalJsonValue propFound = default; - LocalJsonValue propNode = default; - LocalJsonValue propThrottled = default; - LocalJsonValue propThrottledNanos = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBeforeWriteComplete.TryReadProperty(ref reader, options, PropBeforeWriteComplete, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propElapsed.TryReadProperty(ref reader, options, PropElapsed, null)) - { - continue; - } - - if (propElapsedNanos.TryReadProperty(ref reader, options, PropElapsedNanos, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) - { - continue; - } - - if (propFirstByteTime.TryReadProperty(ref reader, options, PropFirstByteTime, null)) - { - continue; - } - - if (propFirstByteTimeNanos.TryReadProperty(ref reader, options, PropFirstByteTimeNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) - { - continue; - } - - if (propFound.TryReadProperty(ref reader, options, PropFound, null)) - { - continue; - } - - if (propNode.TryReadProperty(ref reader, options, PropNode, null)) - { - continue; - } - - if (propThrottled.TryReadProperty(ref reader, options, PropThrottled, null)) - { - continue; - } - - if (propThrottledNanos.TryReadProperty(ref reader, options, PropThrottledNanos, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.ReadBlobDetails(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BeforeWriteComplete = propBeforeWriteComplete.Value, - Elapsed = propElapsed.Value, - ElapsedNanos = propElapsedNanos.Value, - FirstByteTime = propFirstByteTime.Value, - FirstByteTimeNanos = propFirstByteTimeNanos.Value, - Found = propFound.Value, - Node = propNode.Value, - Throttled = propThrottled.Value, - ThrottledNanos = propThrottledNanos.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.ReadBlobDetails value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBeforeWriteComplete, value.BeforeWriteComplete, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropElapsed, value.Elapsed, null, null); - writer.WriteProperty(options, PropElapsedNanos, value.ElapsedNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); - writer.WriteProperty(options, PropFirstByteTime, value.FirstByteTime, null, null); - writer.WriteProperty(options, PropFirstByteTimeNanos, value.FirstByteTimeNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); - writer.WriteProperty(options, PropFound, value.Found, null, null); - writer.WriteProperty(options, PropNode, value.Node, null, null); - writer.WriteProperty(options, PropThrottled, value.Throttled, null, null); - writer.WriteProperty(options, PropThrottledNanos, value.ThrottledNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.ReadBlobDetailsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.ReadBlobDetailsConverter))] public sealed partial class ReadBlobDetails { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadOnlyUrlRepository.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadOnlyUrlRepository.Converters.g.cs new file mode 100644 index 00000000000..c62f7ed91dc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadOnlyUrlRepository.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class ReadOnlyUrlRepositoryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropUuid = System.Text.Json.JsonEncodedText.Encode("uuid"); + + public override Elastic.Clients.Elasticsearch.Snapshot.ReadOnlyUrlRepository Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propSettings = default; + LocalJsonValue propUuid = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propUuid.TryReadProperty(ref reader, options, PropUuid, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.ReadOnlyUrlRepository(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Settings = propSettings.Value, + Uuid = propUuid.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.ReadOnlyUrlRepository value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSettings, value.Settings, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropUuid, value.Uuid, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadOnlyUrlRepository.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadOnlyUrlRepository.g.cs index e8f41f8f1f3..51d393abf33 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadOnlyUrlRepository.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadOnlyUrlRepository.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class ReadOnlyUrlRepositoryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropUuid = System.Text.Json.JsonEncodedText.Encode("uuid"); - - public override Elastic.Clients.Elasticsearch.Snapshot.ReadOnlyUrlRepository Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propSettings = default; - LocalJsonValue propUuid = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propUuid.TryReadProperty(ref reader, options, PropUuid, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.ReadOnlyUrlRepository(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Settings = propSettings.Value, - Uuid = propUuid.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.ReadOnlyUrlRepository value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSettings, value.Settings, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropUuid, value.Uuid, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.ReadOnlyUrlRepositoryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.ReadOnlyUrlRepositoryConverter))] public sealed partial class ReadOnlyUrlRepository : Elastic.Clients.Elasticsearch.Snapshot.IRepository { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadOnlyUrlRepositorySettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadOnlyUrlRepositorySettings.Converters.g.cs new file mode 100644 index 00000000000..dea93abb425 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadOnlyUrlRepositorySettings.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class ReadOnlyUrlRepositorySettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkSize = System.Text.Json.JsonEncodedText.Encode("chunk_size"); + private static readonly System.Text.Json.JsonEncodedText PropCompress = System.Text.Json.JsonEncodedText.Encode("compress"); + private static readonly System.Text.Json.JsonEncodedText PropHttpMaxRetries = System.Text.Json.JsonEncodedText.Encode("http_max_retries"); + private static readonly System.Text.Json.JsonEncodedText PropHttpSocketTimeout = System.Text.Json.JsonEncodedText.Encode("http_socket_timeout"); + private static readonly System.Text.Json.JsonEncodedText PropMaxNumberOfSnapshots = System.Text.Json.JsonEncodedText.Encode("max_number_of_snapshots"); + private static readonly System.Text.Json.JsonEncodedText PropMaxRestoreBytesPerSec = System.Text.Json.JsonEncodedText.Encode("max_restore_bytes_per_sec"); + private static readonly System.Text.Json.JsonEncodedText PropMaxSnapshotBytesPerSec = System.Text.Json.JsonEncodedText.Encode("max_snapshot_bytes_per_sec"); + private static readonly System.Text.Json.JsonEncodedText PropUrl = System.Text.Json.JsonEncodedText.Encode("url"); + + public override Elastic.Clients.Elasticsearch.Snapshot.ReadOnlyUrlRepositorySettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkSize = default; + LocalJsonValue propCompress = default; + LocalJsonValue propHttpMaxRetries = default; + LocalJsonValue propHttpSocketTimeout = default; + LocalJsonValue propMaxNumberOfSnapshots = default; + LocalJsonValue propMaxRestoreBytesPerSec = default; + LocalJsonValue propMaxSnapshotBytesPerSec = default; + LocalJsonValue propUrl = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkSize.TryReadProperty(ref reader, options, PropChunkSize, null)) + { + continue; + } + + if (propCompress.TryReadProperty(ref reader, options, PropCompress, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propHttpMaxRetries.TryReadProperty(ref reader, options, PropHttpMaxRetries, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propHttpSocketTimeout.TryReadProperty(ref reader, options, PropHttpSocketTimeout, null)) + { + continue; + } + + if (propMaxNumberOfSnapshots.TryReadProperty(ref reader, options, PropMaxNumberOfSnapshots, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxRestoreBytesPerSec.TryReadProperty(ref reader, options, PropMaxRestoreBytesPerSec, null)) + { + continue; + } + + if (propMaxSnapshotBytesPerSec.TryReadProperty(ref reader, options, PropMaxSnapshotBytesPerSec, null)) + { + continue; + } + + if (propUrl.TryReadProperty(ref reader, options, PropUrl, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.ReadOnlyUrlRepositorySettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkSize = propChunkSize.Value, + Compress = propCompress.Value, + HttpMaxRetries = propHttpMaxRetries.Value, + HttpSocketTimeout = propHttpSocketTimeout.Value, + MaxNumberOfSnapshots = propMaxNumberOfSnapshots.Value, + MaxRestoreBytesPerSec = propMaxRestoreBytesPerSec.Value, + MaxSnapshotBytesPerSec = propMaxSnapshotBytesPerSec.Value, + Url = propUrl.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.ReadOnlyUrlRepositorySettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkSize, value.ChunkSize, null, null); + writer.WriteProperty(options, PropCompress, value.Compress, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropHttpMaxRetries, value.HttpMaxRetries, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropHttpSocketTimeout, value.HttpSocketTimeout, null, null); + writer.WriteProperty(options, PropMaxNumberOfSnapshots, value.MaxNumberOfSnapshots, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxRestoreBytesPerSec, value.MaxRestoreBytesPerSec, null, null); + writer.WriteProperty(options, PropMaxSnapshotBytesPerSec, value.MaxSnapshotBytesPerSec, null, null); + writer.WriteProperty(options, PropUrl, value.Url, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadOnlyUrlRepositorySettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadOnlyUrlRepositorySettings.g.cs index 00b6fa3f0f1..7f09e1cb1a4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadOnlyUrlRepositorySettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadOnlyUrlRepositorySettings.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class ReadOnlyUrlRepositorySettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkSize = System.Text.Json.JsonEncodedText.Encode("chunk_size"); - private static readonly System.Text.Json.JsonEncodedText PropCompress = System.Text.Json.JsonEncodedText.Encode("compress"); - private static readonly System.Text.Json.JsonEncodedText PropHttpMaxRetries = System.Text.Json.JsonEncodedText.Encode("http_max_retries"); - private static readonly System.Text.Json.JsonEncodedText PropHttpSocketTimeout = System.Text.Json.JsonEncodedText.Encode("http_socket_timeout"); - private static readonly System.Text.Json.JsonEncodedText PropMaxNumberOfSnapshots = System.Text.Json.JsonEncodedText.Encode("max_number_of_snapshots"); - private static readonly System.Text.Json.JsonEncodedText PropMaxRestoreBytesPerSec = System.Text.Json.JsonEncodedText.Encode("max_restore_bytes_per_sec"); - private static readonly System.Text.Json.JsonEncodedText PropMaxSnapshotBytesPerSec = System.Text.Json.JsonEncodedText.Encode("max_snapshot_bytes_per_sec"); - private static readonly System.Text.Json.JsonEncodedText PropUrl = System.Text.Json.JsonEncodedText.Encode("url"); - - public override Elastic.Clients.Elasticsearch.Snapshot.ReadOnlyUrlRepositorySettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkSize = default; - LocalJsonValue propCompress = default; - LocalJsonValue propHttpMaxRetries = default; - LocalJsonValue propHttpSocketTimeout = default; - LocalJsonValue propMaxNumberOfSnapshots = default; - LocalJsonValue propMaxRestoreBytesPerSec = default; - LocalJsonValue propMaxSnapshotBytesPerSec = default; - LocalJsonValue propUrl = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkSize.TryReadProperty(ref reader, options, PropChunkSize, null)) - { - continue; - } - - if (propCompress.TryReadProperty(ref reader, options, PropCompress, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propHttpMaxRetries.TryReadProperty(ref reader, options, PropHttpMaxRetries, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propHttpSocketTimeout.TryReadProperty(ref reader, options, PropHttpSocketTimeout, null)) - { - continue; - } - - if (propMaxNumberOfSnapshots.TryReadProperty(ref reader, options, PropMaxNumberOfSnapshots, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxRestoreBytesPerSec.TryReadProperty(ref reader, options, PropMaxRestoreBytesPerSec, null)) - { - continue; - } - - if (propMaxSnapshotBytesPerSec.TryReadProperty(ref reader, options, PropMaxSnapshotBytesPerSec, null)) - { - continue; - } - - if (propUrl.TryReadProperty(ref reader, options, PropUrl, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.ReadOnlyUrlRepositorySettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkSize = propChunkSize.Value, - Compress = propCompress.Value, - HttpMaxRetries = propHttpMaxRetries.Value, - HttpSocketTimeout = propHttpSocketTimeout.Value, - MaxNumberOfSnapshots = propMaxNumberOfSnapshots.Value, - MaxRestoreBytesPerSec = propMaxRestoreBytesPerSec.Value, - MaxSnapshotBytesPerSec = propMaxSnapshotBytesPerSec.Value, - Url = propUrl.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.ReadOnlyUrlRepositorySettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkSize, value.ChunkSize, null, null); - writer.WriteProperty(options, PropCompress, value.Compress, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropHttpMaxRetries, value.HttpMaxRetries, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropHttpSocketTimeout, value.HttpSocketTimeout, null, null); - writer.WriteProperty(options, PropMaxNumberOfSnapshots, value.MaxNumberOfSnapshots, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxRestoreBytesPerSec, value.MaxRestoreBytesPerSec, null, null); - writer.WriteProperty(options, PropMaxSnapshotBytesPerSec, value.MaxSnapshotBytesPerSec, null, null); - writer.WriteProperty(options, PropUrl, value.Url, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.ReadOnlyUrlRepositorySettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.ReadOnlyUrlRepositorySettingsConverter))] public sealed partial class ReadOnlyUrlRepositorySettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadSummaryInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadSummaryInfo.Converters.g.cs new file mode 100644 index 00000000000..1abb8534915 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadSummaryInfo.Converters.g.cs @@ -0,0 +1,153 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class ReadSummaryInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropMaxWait = System.Text.Json.JsonEncodedText.Encode("max_wait"); + private static readonly System.Text.Json.JsonEncodedText PropMaxWaitNanos = System.Text.Json.JsonEncodedText.Encode("max_wait_nanos"); + private static readonly System.Text.Json.JsonEncodedText PropTotalElapsed = System.Text.Json.JsonEncodedText.Encode("total_elapsed"); + private static readonly System.Text.Json.JsonEncodedText PropTotalElapsedNanos = System.Text.Json.JsonEncodedText.Encode("total_elapsed_nanos"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSize = System.Text.Json.JsonEncodedText.Encode("total_size"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSizeBytes = System.Text.Json.JsonEncodedText.Encode("total_size_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTotalThrottled = System.Text.Json.JsonEncodedText.Encode("total_throttled"); + private static readonly System.Text.Json.JsonEncodedText PropTotalThrottledNanos = System.Text.Json.JsonEncodedText.Encode("total_throttled_nanos"); + private static readonly System.Text.Json.JsonEncodedText PropTotalWait = System.Text.Json.JsonEncodedText.Encode("total_wait"); + private static readonly System.Text.Json.JsonEncodedText PropTotalWaitNanos = System.Text.Json.JsonEncodedText.Encode("total_wait_nanos"); + + public override Elastic.Clients.Elasticsearch.Snapshot.ReadSummaryInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propMaxWait = default; + LocalJsonValue propMaxWaitNanos = default; + LocalJsonValue propTotalElapsed = default; + LocalJsonValue propTotalElapsedNanos = default; + LocalJsonValue propTotalSize = default; + LocalJsonValue propTotalSizeBytes = default; + LocalJsonValue propTotalThrottled = default; + LocalJsonValue propTotalThrottledNanos = default; + LocalJsonValue propTotalWait = default; + LocalJsonValue propTotalWaitNanos = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propMaxWait.TryReadProperty(ref reader, options, PropMaxWait, null)) + { + continue; + } + + if (propMaxWaitNanos.TryReadProperty(ref reader, options, PropMaxWaitNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) + { + continue; + } + + if (propTotalElapsed.TryReadProperty(ref reader, options, PropTotalElapsed, null)) + { + continue; + } + + if (propTotalElapsedNanos.TryReadProperty(ref reader, options, PropTotalElapsedNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) + { + continue; + } + + if (propTotalSize.TryReadProperty(ref reader, options, PropTotalSize, null)) + { + continue; + } + + if (propTotalSizeBytes.TryReadProperty(ref reader, options, PropTotalSizeBytes, null)) + { + continue; + } + + if (propTotalThrottled.TryReadProperty(ref reader, options, PropTotalThrottled, null)) + { + continue; + } + + if (propTotalThrottledNanos.TryReadProperty(ref reader, options, PropTotalThrottledNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) + { + continue; + } + + if (propTotalWait.TryReadProperty(ref reader, options, PropTotalWait, null)) + { + continue; + } + + if (propTotalWaitNanos.TryReadProperty(ref reader, options, PropTotalWaitNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.ReadSummaryInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + MaxWait = propMaxWait.Value, + MaxWaitNanos = propMaxWaitNanos.Value, + TotalElapsed = propTotalElapsed.Value, + TotalElapsedNanos = propTotalElapsedNanos.Value, + TotalSize = propTotalSize.Value, + TotalSizeBytes = propTotalSizeBytes.Value, + TotalThrottled = propTotalThrottled.Value, + TotalThrottledNanos = propTotalThrottledNanos.Value, + TotalWait = propTotalWait.Value, + TotalWaitNanos = propTotalWaitNanos.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.ReadSummaryInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropMaxWait, value.MaxWait, null, null); + writer.WriteProperty(options, PropMaxWaitNanos, value.MaxWaitNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); + writer.WriteProperty(options, PropTotalElapsed, value.TotalElapsed, null, null); + writer.WriteProperty(options, PropTotalElapsedNanos, value.TotalElapsedNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); + writer.WriteProperty(options, PropTotalSize, value.TotalSize, null, null); + writer.WriteProperty(options, PropTotalSizeBytes, value.TotalSizeBytes, null, null); + writer.WriteProperty(options, PropTotalThrottled, value.TotalThrottled, null, null); + writer.WriteProperty(options, PropTotalThrottledNanos, value.TotalThrottledNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); + writer.WriteProperty(options, PropTotalWait, value.TotalWait, null, null); + writer.WriteProperty(options, PropTotalWaitNanos, value.TotalWaitNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadSummaryInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadSummaryInfo.g.cs index 9bbc62e7a19..1d0270f4e08 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadSummaryInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ReadSummaryInfo.g.cs @@ -23,136 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class ReadSummaryInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropMaxWait = System.Text.Json.JsonEncodedText.Encode("max_wait"); - private static readonly System.Text.Json.JsonEncodedText PropMaxWaitNanos = System.Text.Json.JsonEncodedText.Encode("max_wait_nanos"); - private static readonly System.Text.Json.JsonEncodedText PropTotalElapsed = System.Text.Json.JsonEncodedText.Encode("total_elapsed"); - private static readonly System.Text.Json.JsonEncodedText PropTotalElapsedNanos = System.Text.Json.JsonEncodedText.Encode("total_elapsed_nanos"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSize = System.Text.Json.JsonEncodedText.Encode("total_size"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSizeBytes = System.Text.Json.JsonEncodedText.Encode("total_size_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTotalThrottled = System.Text.Json.JsonEncodedText.Encode("total_throttled"); - private static readonly System.Text.Json.JsonEncodedText PropTotalThrottledNanos = System.Text.Json.JsonEncodedText.Encode("total_throttled_nanos"); - private static readonly System.Text.Json.JsonEncodedText PropTotalWait = System.Text.Json.JsonEncodedText.Encode("total_wait"); - private static readonly System.Text.Json.JsonEncodedText PropTotalWaitNanos = System.Text.Json.JsonEncodedText.Encode("total_wait_nanos"); - - public override Elastic.Clients.Elasticsearch.Snapshot.ReadSummaryInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propMaxWait = default; - LocalJsonValue propMaxWaitNanos = default; - LocalJsonValue propTotalElapsed = default; - LocalJsonValue propTotalElapsedNanos = default; - LocalJsonValue propTotalSize = default; - LocalJsonValue propTotalSizeBytes = default; - LocalJsonValue propTotalThrottled = default; - LocalJsonValue propTotalThrottledNanos = default; - LocalJsonValue propTotalWait = default; - LocalJsonValue propTotalWaitNanos = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propMaxWait.TryReadProperty(ref reader, options, PropMaxWait, null)) - { - continue; - } - - if (propMaxWaitNanos.TryReadProperty(ref reader, options, PropMaxWaitNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) - { - continue; - } - - if (propTotalElapsed.TryReadProperty(ref reader, options, PropTotalElapsed, null)) - { - continue; - } - - if (propTotalElapsedNanos.TryReadProperty(ref reader, options, PropTotalElapsedNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) - { - continue; - } - - if (propTotalSize.TryReadProperty(ref reader, options, PropTotalSize, null)) - { - continue; - } - - if (propTotalSizeBytes.TryReadProperty(ref reader, options, PropTotalSizeBytes, null)) - { - continue; - } - - if (propTotalThrottled.TryReadProperty(ref reader, options, PropTotalThrottled, null)) - { - continue; - } - - if (propTotalThrottledNanos.TryReadProperty(ref reader, options, PropTotalThrottledNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) - { - continue; - } - - if (propTotalWait.TryReadProperty(ref reader, options, PropTotalWait, null)) - { - continue; - } - - if (propTotalWaitNanos.TryReadProperty(ref reader, options, PropTotalWaitNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.ReadSummaryInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - MaxWait = propMaxWait.Value, - MaxWaitNanos = propMaxWaitNanos.Value, - TotalElapsed = propTotalElapsed.Value, - TotalElapsedNanos = propTotalElapsedNanos.Value, - TotalSize = propTotalSize.Value, - TotalSizeBytes = propTotalSizeBytes.Value, - TotalThrottled = propTotalThrottled.Value, - TotalThrottledNanos = propTotalThrottledNanos.Value, - TotalWait = propTotalWait.Value, - TotalWaitNanos = propTotalWaitNanos.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.ReadSummaryInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropMaxWait, value.MaxWait, null, null); - writer.WriteProperty(options, PropMaxWaitNanos, value.MaxWaitNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); - writer.WriteProperty(options, PropTotalElapsed, value.TotalElapsed, null, null); - writer.WriteProperty(options, PropTotalElapsedNanos, value.TotalElapsedNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); - writer.WriteProperty(options, PropTotalSize, value.TotalSize, null, null); - writer.WriteProperty(options, PropTotalSizeBytes, value.TotalSizeBytes, null, null); - writer.WriteProperty(options, PropTotalThrottled, value.TotalThrottled, null, null); - writer.WriteProperty(options, PropTotalThrottledNanos, value.TotalThrottledNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); - writer.WriteProperty(options, PropTotalWait, value.TotalWait, null, null); - writer.WriteProperty(options, PropTotalWaitNanos, value.TotalWaitNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.ReadSummaryInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.ReadSummaryInfoConverter))] public sealed partial class ReadSummaryInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Repositories.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Repositories.Converters.g.cs new file mode 100644 index 00000000000..694f3d22af2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Repositories.Converters.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class RepositoriesConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Snapshot.Repositories Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Snapshot.Repositories(reader.ReadValue?>(options, static System.Collections.Generic.Dictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.Repositories value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.BackingDictionary, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.Dictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Repositories.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Repositories.g.cs index b5cb718d7f8..272d68276b4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Repositories.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Repositories.g.cs @@ -23,20 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class RepositoriesConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Snapshot.Repositories Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return new Elastic.Clients.Elasticsearch.Snapshot.Repositories(reader.ReadValue?>(options, static System.Collections.Generic.Dictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.Repositories value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteValue(options, value.BackingDictionary, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.Dictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.RepositoriesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.RepositoriesConverter))] public sealed partial class Repositories : Elastic.Clients.Elasticsearch.IsADictionary { public Repositories() diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Repository.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Repository.Converters.g.cs new file mode 100644 index 00000000000..fe552af5653 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Repository.Converters.g.cs @@ -0,0 +1,84 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class IRepositoryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDiscriminator = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Snapshot.IRepository Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + var readerSnapshot = reader; + string? discriminator = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.TryReadProperty(options, PropDiscriminator, ref discriminator, null)) + { + break; + } + + reader.Skip(); + } + + reader = readerSnapshot; + return discriminator switch + { + "azure" => reader.ReadValue(options, null), + "fs" => reader.ReadValue(options, null), + "gcs" => reader.ReadValue(options, null), + "s3" => reader.ReadValue(options, null), + "source" => reader.ReadValue(options, null), + "url" => reader.ReadValue(options, null), + _ => throw new System.Text.Json.JsonException($"Variant '{discriminator}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Snapshot.IRepository)}'.") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.IRepository value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Type) + { + case "azure": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Snapshot.AzureRepository)value, null); + break; + case "fs": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Snapshot.SharedFileSystemRepository)value, null); + break; + case "gcs": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Snapshot.GcsRepository)value, null); + break; + case "s3": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Snapshot.S3Repository)value, null); + break; + case "source": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Snapshot.SourceOnlyRepository)value, null); + break; + case "url": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Snapshot.ReadOnlyUrlRepository)value, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.Type}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Snapshot.IRepository)}'."); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Repository.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Repository.g.cs index 7aa9a5f6df3..f998610fea4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Repository.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Repository.g.cs @@ -23,67 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class IRepositoryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDiscriminator = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Snapshot.IRepository Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - var readerSnapshot = reader; - string? discriminator = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.TryReadProperty(options, PropDiscriminator, ref discriminator, null)) - { - break; - } - - reader.Skip(); - } - - reader = readerSnapshot; - return discriminator switch - { - "azure" => reader.ReadValue(options, null), - "fs" => reader.ReadValue(options, null), - "gcs" => reader.ReadValue(options, null), - "s3" => reader.ReadValue(options, null), - "source" => reader.ReadValue(options, null), - "url" => reader.ReadValue(options, null), - _ => throw new System.Text.Json.JsonException($"Variant '{discriminator}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Snapshot.IRepository)}'.") - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.IRepository value, System.Text.Json.JsonSerializerOptions options) - { - switch (value.Type) - { - case "azure": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Snapshot.AzureRepository)value, null); - break; - case "fs": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Snapshot.SharedFileSystemRepository)value, null); - break; - case "gcs": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Snapshot.GcsRepository)value, null); - break; - case "s3": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Snapshot.S3Repository)value, null); - break; - case "source": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Snapshot.SourceOnlyRepository)value, null); - break; - case "url": - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Snapshot.ReadOnlyUrlRepository)value, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.Type}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Snapshot.IRepository)}'."); - } - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.IRepositoryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.IRepositoryConverter))] public partial interface IRepository { public string Type { get; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/S3Repository.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/S3Repository.Converters.g.cs new file mode 100644 index 00000000000..0960e1ffb13 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/S3Repository.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class S3RepositoryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropUuid = System.Text.Json.JsonEncodedText.Encode("uuid"); + + public override Elastic.Clients.Elasticsearch.Snapshot.S3Repository Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propSettings = default; + LocalJsonValue propUuid = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propUuid.TryReadProperty(ref reader, options, PropUuid, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.S3Repository(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Settings = propSettings.Value, + Uuid = propUuid.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.S3Repository value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSettings, value.Settings, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropUuid, value.Uuid, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/S3Repository.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/S3Repository.g.cs index 971a5957cc6..3993fd5f945 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/S3Repository.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/S3Repository.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class S3RepositoryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropUuid = System.Text.Json.JsonEncodedText.Encode("uuid"); - - public override Elastic.Clients.Elasticsearch.Snapshot.S3Repository Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propSettings = default; - LocalJsonValue propUuid = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propUuid.TryReadProperty(ref reader, options, PropUuid, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.S3Repository(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Settings = propSettings.Value, - Uuid = propUuid.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.S3Repository value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSettings, value.Settings, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropUuid, value.Uuid, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.S3RepositoryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.S3RepositoryConverter))] public sealed partial class S3Repository : Elastic.Clients.Elasticsearch.Snapshot.IRepository { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/S3RepositorySettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/S3RepositorySettings.Converters.g.cs new file mode 100644 index 00000000000..ad8f5bd9205 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/S3RepositorySettings.Converters.g.cs @@ -0,0 +1,225 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class S3RepositorySettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBasePath = System.Text.Json.JsonEncodedText.Encode("base_path"); + private static readonly System.Text.Json.JsonEncodedText PropBucket = System.Text.Json.JsonEncodedText.Encode("bucket"); + private static readonly System.Text.Json.JsonEncodedText PropBufferSize = System.Text.Json.JsonEncodedText.Encode("buffer_size"); + private static readonly System.Text.Json.JsonEncodedText PropCannedAcl = System.Text.Json.JsonEncodedText.Encode("canned_acl"); + private static readonly System.Text.Json.JsonEncodedText PropChunkSize = System.Text.Json.JsonEncodedText.Encode("chunk_size"); + private static readonly System.Text.Json.JsonEncodedText PropClient = System.Text.Json.JsonEncodedText.Encode("client"); + private static readonly System.Text.Json.JsonEncodedText PropCompress = System.Text.Json.JsonEncodedText.Encode("compress"); + private static readonly System.Text.Json.JsonEncodedText PropDeleteObjectsMaxSize = System.Text.Json.JsonEncodedText.Encode("delete_objects_max_size"); + private static readonly System.Text.Json.JsonEncodedText PropGetRegisterRetryDelay = System.Text.Json.JsonEncodedText.Encode("get_register_retry_delay"); + private static readonly System.Text.Json.JsonEncodedText PropMaxMultipartParts = System.Text.Json.JsonEncodedText.Encode("max_multipart_parts"); + private static readonly System.Text.Json.JsonEncodedText PropMaxMultipartUploadCleanupSize = System.Text.Json.JsonEncodedText.Encode("max_multipart_upload_cleanup_size"); + private static readonly System.Text.Json.JsonEncodedText PropMaxRestoreBytesPerSec = System.Text.Json.JsonEncodedText.Encode("max_restore_bytes_per_sec"); + private static readonly System.Text.Json.JsonEncodedText PropMaxSnapshotBytesPerSec = System.Text.Json.JsonEncodedText.Encode("max_snapshot_bytes_per_sec"); + private static readonly System.Text.Json.JsonEncodedText PropReadonly = System.Text.Json.JsonEncodedText.Encode("readonly"); + private static readonly System.Text.Json.JsonEncodedText PropServerSideEncryption = System.Text.Json.JsonEncodedText.Encode("server_side_encryption"); + private static readonly System.Text.Json.JsonEncodedText PropStorageClass = System.Text.Json.JsonEncodedText.Encode("storage_class"); + private static readonly System.Text.Json.JsonEncodedText PropThrottledDeleteRetryDelayIncrement = System.Text.Json.JsonEncodedText.Encode("throttled_delete_retry.delay_increment"); + private static readonly System.Text.Json.JsonEncodedText PropThrottledDeleteRetryMaximumDelay = System.Text.Json.JsonEncodedText.Encode("throttled_delete_retry.maximum_delay"); + private static readonly System.Text.Json.JsonEncodedText PropThrottledDeleteRetryMaximumNumberOfRetries = System.Text.Json.JsonEncodedText.Encode("throttled_delete_retry.maximum_number_of_retries"); + + public override Elastic.Clients.Elasticsearch.Snapshot.S3RepositorySettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBasePath = default; + LocalJsonValue propBucket = default; + LocalJsonValue propBufferSize = default; + LocalJsonValue propCannedAcl = default; + LocalJsonValue propChunkSize = default; + LocalJsonValue propClient = default; + LocalJsonValue propCompress = default; + LocalJsonValue propDeleteObjectsMaxSize = default; + LocalJsonValue propGetRegisterRetryDelay = default; + LocalJsonValue propMaxMultipartParts = default; + LocalJsonValue propMaxMultipartUploadCleanupSize = default; + LocalJsonValue propMaxRestoreBytesPerSec = default; + LocalJsonValue propMaxSnapshotBytesPerSec = default; + LocalJsonValue propReadonly = default; + LocalJsonValue propServerSideEncryption = default; + LocalJsonValue propStorageClass = default; + LocalJsonValue propThrottledDeleteRetryDelayIncrement = default; + LocalJsonValue propThrottledDeleteRetryMaximumDelay = default; + LocalJsonValue propThrottledDeleteRetryMaximumNumberOfRetries = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBasePath.TryReadProperty(ref reader, options, PropBasePath, null)) + { + continue; + } + + if (propBucket.TryReadProperty(ref reader, options, PropBucket, null)) + { + continue; + } + + if (propBufferSize.TryReadProperty(ref reader, options, PropBufferSize, null)) + { + continue; + } + + if (propCannedAcl.TryReadProperty(ref reader, options, PropCannedAcl, null)) + { + continue; + } + + if (propChunkSize.TryReadProperty(ref reader, options, PropChunkSize, null)) + { + continue; + } + + if (propClient.TryReadProperty(ref reader, options, PropClient, null)) + { + continue; + } + + if (propCompress.TryReadProperty(ref reader, options, PropCompress, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDeleteObjectsMaxSize.TryReadProperty(ref reader, options, PropDeleteObjectsMaxSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propGetRegisterRetryDelay.TryReadProperty(ref reader, options, PropGetRegisterRetryDelay, null)) + { + continue; + } + + if (propMaxMultipartParts.TryReadProperty(ref reader, options, PropMaxMultipartParts, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxMultipartUploadCleanupSize.TryReadProperty(ref reader, options, PropMaxMultipartUploadCleanupSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxRestoreBytesPerSec.TryReadProperty(ref reader, options, PropMaxRestoreBytesPerSec, null)) + { + continue; + } + + if (propMaxSnapshotBytesPerSec.TryReadProperty(ref reader, options, PropMaxSnapshotBytesPerSec, null)) + { + continue; + } + + if (propReadonly.TryReadProperty(ref reader, options, PropReadonly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propServerSideEncryption.TryReadProperty(ref reader, options, PropServerSideEncryption, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propStorageClass.TryReadProperty(ref reader, options, PropStorageClass, null)) + { + continue; + } + + if (propThrottledDeleteRetryDelayIncrement.TryReadProperty(ref reader, options, PropThrottledDeleteRetryDelayIncrement, null)) + { + continue; + } + + if (propThrottledDeleteRetryMaximumDelay.TryReadProperty(ref reader, options, PropThrottledDeleteRetryMaximumDelay, null)) + { + continue; + } + + if (propThrottledDeleteRetryMaximumNumberOfRetries.TryReadProperty(ref reader, options, PropThrottledDeleteRetryMaximumNumberOfRetries, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.S3RepositorySettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BasePath = propBasePath.Value, + Bucket = propBucket.Value, + BufferSize = propBufferSize.Value, + CannedAcl = propCannedAcl.Value, + ChunkSize = propChunkSize.Value, + Client = propClient.Value, + Compress = propCompress.Value, + DeleteObjectsMaxSize = propDeleteObjectsMaxSize.Value, + GetRegisterRetryDelay = propGetRegisterRetryDelay.Value, + MaxMultipartParts = propMaxMultipartParts.Value, + MaxMultipartUploadCleanupSize = propMaxMultipartUploadCleanupSize.Value, + MaxRestoreBytesPerSec = propMaxRestoreBytesPerSec.Value, + MaxSnapshotBytesPerSec = propMaxSnapshotBytesPerSec.Value, + Readonly = propReadonly.Value, + ServerSideEncryption = propServerSideEncryption.Value, + StorageClass = propStorageClass.Value, + ThrottledDeleteRetryDelayIncrement = propThrottledDeleteRetryDelayIncrement.Value, + ThrottledDeleteRetryMaximumDelay = propThrottledDeleteRetryMaximumDelay.Value, + ThrottledDeleteRetryMaximumNumberOfRetries = propThrottledDeleteRetryMaximumNumberOfRetries.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.S3RepositorySettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBasePath, value.BasePath, null, null); + writer.WriteProperty(options, PropBucket, value.Bucket, null, null); + writer.WriteProperty(options, PropBufferSize, value.BufferSize, null, null); + writer.WriteProperty(options, PropCannedAcl, value.CannedAcl, null, null); + writer.WriteProperty(options, PropChunkSize, value.ChunkSize, null, null); + writer.WriteProperty(options, PropClient, value.Client, null, null); + writer.WriteProperty(options, PropCompress, value.Compress, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDeleteObjectsMaxSize, value.DeleteObjectsMaxSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropGetRegisterRetryDelay, value.GetRegisterRetryDelay, null, null); + writer.WriteProperty(options, PropMaxMultipartParts, value.MaxMultipartParts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxMultipartUploadCleanupSize, value.MaxMultipartUploadCleanupSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxRestoreBytesPerSec, value.MaxRestoreBytesPerSec, null, null); + writer.WriteProperty(options, PropMaxSnapshotBytesPerSec, value.MaxSnapshotBytesPerSec, null, null); + writer.WriteProperty(options, PropReadonly, value.Readonly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropServerSideEncryption, value.ServerSideEncryption, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropStorageClass, value.StorageClass, null, null); + writer.WriteProperty(options, PropThrottledDeleteRetryDelayIncrement, value.ThrottledDeleteRetryDelayIncrement, null, null); + writer.WriteProperty(options, PropThrottledDeleteRetryMaximumDelay, value.ThrottledDeleteRetryMaximumDelay, null, null); + writer.WriteProperty(options, PropThrottledDeleteRetryMaximumNumberOfRetries, value.ThrottledDeleteRetryMaximumNumberOfRetries, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/S3RepositorySettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/S3RepositorySettings.g.cs index d0e0d057000..82ddf0cc0f0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/S3RepositorySettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/S3RepositorySettings.g.cs @@ -23,208 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class S3RepositorySettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBasePath = System.Text.Json.JsonEncodedText.Encode("base_path"); - private static readonly System.Text.Json.JsonEncodedText PropBucket = System.Text.Json.JsonEncodedText.Encode("bucket"); - private static readonly System.Text.Json.JsonEncodedText PropBufferSize = System.Text.Json.JsonEncodedText.Encode("buffer_size"); - private static readonly System.Text.Json.JsonEncodedText PropCannedAcl = System.Text.Json.JsonEncodedText.Encode("canned_acl"); - private static readonly System.Text.Json.JsonEncodedText PropChunkSize = System.Text.Json.JsonEncodedText.Encode("chunk_size"); - private static readonly System.Text.Json.JsonEncodedText PropClient = System.Text.Json.JsonEncodedText.Encode("client"); - private static readonly System.Text.Json.JsonEncodedText PropCompress = System.Text.Json.JsonEncodedText.Encode("compress"); - private static readonly System.Text.Json.JsonEncodedText PropDeleteObjectsMaxSize = System.Text.Json.JsonEncodedText.Encode("delete_objects_max_size"); - private static readonly System.Text.Json.JsonEncodedText PropGetRegisterRetryDelay = System.Text.Json.JsonEncodedText.Encode("get_register_retry_delay"); - private static readonly System.Text.Json.JsonEncodedText PropMaxMultipartParts = System.Text.Json.JsonEncodedText.Encode("max_multipart_parts"); - private static readonly System.Text.Json.JsonEncodedText PropMaxMultipartUploadCleanupSize = System.Text.Json.JsonEncodedText.Encode("max_multipart_upload_cleanup_size"); - private static readonly System.Text.Json.JsonEncodedText PropMaxRestoreBytesPerSec = System.Text.Json.JsonEncodedText.Encode("max_restore_bytes_per_sec"); - private static readonly System.Text.Json.JsonEncodedText PropMaxSnapshotBytesPerSec = System.Text.Json.JsonEncodedText.Encode("max_snapshot_bytes_per_sec"); - private static readonly System.Text.Json.JsonEncodedText PropReadonly = System.Text.Json.JsonEncodedText.Encode("readonly"); - private static readonly System.Text.Json.JsonEncodedText PropServerSideEncryption = System.Text.Json.JsonEncodedText.Encode("server_side_encryption"); - private static readonly System.Text.Json.JsonEncodedText PropStorageClass = System.Text.Json.JsonEncodedText.Encode("storage_class"); - private static readonly System.Text.Json.JsonEncodedText PropThrottledDeleteRetryDelayIncrement = System.Text.Json.JsonEncodedText.Encode("throttled_delete_retry.delay_increment"); - private static readonly System.Text.Json.JsonEncodedText PropThrottledDeleteRetryMaximumDelay = System.Text.Json.JsonEncodedText.Encode("throttled_delete_retry.maximum_delay"); - private static readonly System.Text.Json.JsonEncodedText PropThrottledDeleteRetryMaximumNumberOfRetries = System.Text.Json.JsonEncodedText.Encode("throttled_delete_retry.maximum_number_of_retries"); - - public override Elastic.Clients.Elasticsearch.Snapshot.S3RepositorySettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBasePath = default; - LocalJsonValue propBucket = default; - LocalJsonValue propBufferSize = default; - LocalJsonValue propCannedAcl = default; - LocalJsonValue propChunkSize = default; - LocalJsonValue propClient = default; - LocalJsonValue propCompress = default; - LocalJsonValue propDeleteObjectsMaxSize = default; - LocalJsonValue propGetRegisterRetryDelay = default; - LocalJsonValue propMaxMultipartParts = default; - LocalJsonValue propMaxMultipartUploadCleanupSize = default; - LocalJsonValue propMaxRestoreBytesPerSec = default; - LocalJsonValue propMaxSnapshotBytesPerSec = default; - LocalJsonValue propReadonly = default; - LocalJsonValue propServerSideEncryption = default; - LocalJsonValue propStorageClass = default; - LocalJsonValue propThrottledDeleteRetryDelayIncrement = default; - LocalJsonValue propThrottledDeleteRetryMaximumDelay = default; - LocalJsonValue propThrottledDeleteRetryMaximumNumberOfRetries = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBasePath.TryReadProperty(ref reader, options, PropBasePath, null)) - { - continue; - } - - if (propBucket.TryReadProperty(ref reader, options, PropBucket, null)) - { - continue; - } - - if (propBufferSize.TryReadProperty(ref reader, options, PropBufferSize, null)) - { - continue; - } - - if (propCannedAcl.TryReadProperty(ref reader, options, PropCannedAcl, null)) - { - continue; - } - - if (propChunkSize.TryReadProperty(ref reader, options, PropChunkSize, null)) - { - continue; - } - - if (propClient.TryReadProperty(ref reader, options, PropClient, null)) - { - continue; - } - - if (propCompress.TryReadProperty(ref reader, options, PropCompress, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDeleteObjectsMaxSize.TryReadProperty(ref reader, options, PropDeleteObjectsMaxSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propGetRegisterRetryDelay.TryReadProperty(ref reader, options, PropGetRegisterRetryDelay, null)) - { - continue; - } - - if (propMaxMultipartParts.TryReadProperty(ref reader, options, PropMaxMultipartParts, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxMultipartUploadCleanupSize.TryReadProperty(ref reader, options, PropMaxMultipartUploadCleanupSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxRestoreBytesPerSec.TryReadProperty(ref reader, options, PropMaxRestoreBytesPerSec, null)) - { - continue; - } - - if (propMaxSnapshotBytesPerSec.TryReadProperty(ref reader, options, PropMaxSnapshotBytesPerSec, null)) - { - continue; - } - - if (propReadonly.TryReadProperty(ref reader, options, PropReadonly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propServerSideEncryption.TryReadProperty(ref reader, options, PropServerSideEncryption, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propStorageClass.TryReadProperty(ref reader, options, PropStorageClass, null)) - { - continue; - } - - if (propThrottledDeleteRetryDelayIncrement.TryReadProperty(ref reader, options, PropThrottledDeleteRetryDelayIncrement, null)) - { - continue; - } - - if (propThrottledDeleteRetryMaximumDelay.TryReadProperty(ref reader, options, PropThrottledDeleteRetryMaximumDelay, null)) - { - continue; - } - - if (propThrottledDeleteRetryMaximumNumberOfRetries.TryReadProperty(ref reader, options, PropThrottledDeleteRetryMaximumNumberOfRetries, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.S3RepositorySettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BasePath = propBasePath.Value, - Bucket = propBucket.Value, - BufferSize = propBufferSize.Value, - CannedAcl = propCannedAcl.Value, - ChunkSize = propChunkSize.Value, - Client = propClient.Value, - Compress = propCompress.Value, - DeleteObjectsMaxSize = propDeleteObjectsMaxSize.Value, - GetRegisterRetryDelay = propGetRegisterRetryDelay.Value, - MaxMultipartParts = propMaxMultipartParts.Value, - MaxMultipartUploadCleanupSize = propMaxMultipartUploadCleanupSize.Value, - MaxRestoreBytesPerSec = propMaxRestoreBytesPerSec.Value, - MaxSnapshotBytesPerSec = propMaxSnapshotBytesPerSec.Value, - Readonly = propReadonly.Value, - ServerSideEncryption = propServerSideEncryption.Value, - StorageClass = propStorageClass.Value, - ThrottledDeleteRetryDelayIncrement = propThrottledDeleteRetryDelayIncrement.Value, - ThrottledDeleteRetryMaximumDelay = propThrottledDeleteRetryMaximumDelay.Value, - ThrottledDeleteRetryMaximumNumberOfRetries = propThrottledDeleteRetryMaximumNumberOfRetries.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.S3RepositorySettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBasePath, value.BasePath, null, null); - writer.WriteProperty(options, PropBucket, value.Bucket, null, null); - writer.WriteProperty(options, PropBufferSize, value.BufferSize, null, null); - writer.WriteProperty(options, PropCannedAcl, value.CannedAcl, null, null); - writer.WriteProperty(options, PropChunkSize, value.ChunkSize, null, null); - writer.WriteProperty(options, PropClient, value.Client, null, null); - writer.WriteProperty(options, PropCompress, value.Compress, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDeleteObjectsMaxSize, value.DeleteObjectsMaxSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropGetRegisterRetryDelay, value.GetRegisterRetryDelay, null, null); - writer.WriteProperty(options, PropMaxMultipartParts, value.MaxMultipartParts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxMultipartUploadCleanupSize, value.MaxMultipartUploadCleanupSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxRestoreBytesPerSec, value.MaxRestoreBytesPerSec, null, null); - writer.WriteProperty(options, PropMaxSnapshotBytesPerSec, value.MaxSnapshotBytesPerSec, null, null); - writer.WriteProperty(options, PropReadonly, value.Readonly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropServerSideEncryption, value.ServerSideEncryption, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropStorageClass, value.StorageClass, null, null); - writer.WriteProperty(options, PropThrottledDeleteRetryDelayIncrement, value.ThrottledDeleteRetryDelayIncrement, null, null); - writer.WriteProperty(options, PropThrottledDeleteRetryMaximumDelay, value.ThrottledDeleteRetryMaximumDelay, null, null); - writer.WriteProperty(options, PropThrottledDeleteRetryMaximumNumberOfRetries, value.ThrottledDeleteRetryMaximumNumberOfRetries, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.S3RepositorySettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.S3RepositorySettingsConverter))] public sealed partial class S3RepositorySettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStats.Converters.g.cs new file mode 100644 index 00000000000..a4059020c77 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStats.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class ShardsStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDone = System.Text.Json.JsonEncodedText.Encode("done"); + private static readonly System.Text.Json.JsonEncodedText PropFailed = System.Text.Json.JsonEncodedText.Encode("failed"); + private static readonly System.Text.Json.JsonEncodedText PropFinalizing = System.Text.Json.JsonEncodedText.Encode("finalizing"); + private static readonly System.Text.Json.JsonEncodedText PropInitializing = System.Text.Json.JsonEncodedText.Encode("initializing"); + private static readonly System.Text.Json.JsonEncodedText PropStarted = System.Text.Json.JsonEncodedText.Encode("started"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Snapshot.ShardsStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDone = default; + LocalJsonValue propFailed = default; + LocalJsonValue propFinalizing = default; + LocalJsonValue propInitializing = default; + LocalJsonValue propStarted = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDone.TryReadProperty(ref reader, options, PropDone, null)) + { + continue; + } + + if (propFailed.TryReadProperty(ref reader, options, PropFailed, null)) + { + continue; + } + + if (propFinalizing.TryReadProperty(ref reader, options, PropFinalizing, null)) + { + continue; + } + + if (propInitializing.TryReadProperty(ref reader, options, PropInitializing, null)) + { + continue; + } + + if (propStarted.TryReadProperty(ref reader, options, PropStarted, null)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.ShardsStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Done = propDone.Value, + Failed = propFailed.Value, + Finalizing = propFinalizing.Value, + Initializing = propInitializing.Value, + Started = propStarted.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.ShardsStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDone, value.Done, null, null); + writer.WriteProperty(options, PropFailed, value.Failed, null, null); + writer.WriteProperty(options, PropFinalizing, value.Finalizing, null, null); + writer.WriteProperty(options, PropInitializing, value.Initializing, null, null); + writer.WriteProperty(options, PropStarted, value.Started, null, null); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStats.g.cs index 3f7d6582972..e33452fd0b7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStats.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class ShardsStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDone = System.Text.Json.JsonEncodedText.Encode("done"); - private static readonly System.Text.Json.JsonEncodedText PropFailed = System.Text.Json.JsonEncodedText.Encode("failed"); - private static readonly System.Text.Json.JsonEncodedText PropFinalizing = System.Text.Json.JsonEncodedText.Encode("finalizing"); - private static readonly System.Text.Json.JsonEncodedText PropInitializing = System.Text.Json.JsonEncodedText.Encode("initializing"); - private static readonly System.Text.Json.JsonEncodedText PropStarted = System.Text.Json.JsonEncodedText.Encode("started"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Snapshot.ShardsStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDone = default; - LocalJsonValue propFailed = default; - LocalJsonValue propFinalizing = default; - LocalJsonValue propInitializing = default; - LocalJsonValue propStarted = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDone.TryReadProperty(ref reader, options, PropDone, null)) - { - continue; - } - - if (propFailed.TryReadProperty(ref reader, options, PropFailed, null)) - { - continue; - } - - if (propFinalizing.TryReadProperty(ref reader, options, PropFinalizing, null)) - { - continue; - } - - if (propInitializing.TryReadProperty(ref reader, options, PropInitializing, null)) - { - continue; - } - - if (propStarted.TryReadProperty(ref reader, options, PropStarted, null)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.ShardsStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Done = propDone.Value, - Failed = propFailed.Value, - Finalizing = propFinalizing.Value, - Initializing = propInitializing.Value, - Started = propStarted.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.ShardsStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDone, value.Done, null, null); - writer.WriteProperty(options, PropFailed, value.Failed, null, null); - writer.WriteProperty(options, PropFinalizing, value.Finalizing, null, null); - writer.WriteProperty(options, PropInitializing, value.Initializing, null, null); - writer.WriteProperty(options, PropStarted, value.Started, null, null); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.ShardsStatsConverter))] public sealed partial class ShardsStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsStage.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsStage.Converters.g.cs new file mode 100644 index 00000000000..85bf7128ab6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsStage.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class ShardsStatsStageConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberDone = System.Text.Json.JsonEncodedText.Encode("DONE"); + private static readonly System.Text.Json.JsonEncodedText MemberFailure = System.Text.Json.JsonEncodedText.Encode("FAILURE"); + private static readonly System.Text.Json.JsonEncodedText MemberFinalize = System.Text.Json.JsonEncodedText.Encode("FINALIZE"); + private static readonly System.Text.Json.JsonEncodedText MemberInit = System.Text.Json.JsonEncodedText.Encode("INIT"); + private static readonly System.Text.Json.JsonEncodedText MemberStarted = System.Text.Json.JsonEncodedText.Encode("STARTED"); + + public override Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberDone)) + { + return Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Done; + } + + if (reader.ValueTextEquals(MemberFailure)) + { + return Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Failure; + } + + if (reader.ValueTextEquals(MemberFinalize)) + { + return Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Finalize; + } + + if (reader.ValueTextEquals(MemberInit)) + { + return Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Init; + } + + if (reader.ValueTextEquals(MemberStarted)) + { + return Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Started; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberDone.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Done; + } + + if (string.Equals(value, MemberFailure.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Failure; + } + + if (string.Equals(value, MemberFinalize.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Finalize; + } + + if (string.Equals(value, MemberInit.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Init; + } + + if (string.Equals(value, MemberStarted.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Started; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Done: + writer.WriteStringValue(MemberDone); + break; + case Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Failure: + writer.WriteStringValue(MemberFailure); + break; + case Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Finalize: + writer.WriteStringValue(MemberFinalize); + break; + case Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Init: + writer.WriteStringValue(MemberInit); + break; + case Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage.Started: + writer.WriteStringValue(MemberStarted); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsStage value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsStage.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsStage.g.cs new file mode 100644 index 00000000000..1b9ef952eb4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsStage.g.cs @@ -0,0 +1,64 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.ShardsStatsStageConverter))] +public enum ShardsStatsStage +{ + /// + /// + /// The number of shards in the snapshot that were successfully stored in the repository. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "DONE")] + Done, + /// + /// + /// The number of shards in the snapshot that were not successfully stored in the repository. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "FAILURE")] + Failure, + /// + /// + /// The number of shards in the snapshot that are in the finalizing stage of being stored in the repository. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "FINALIZE")] + Finalize, + /// + /// + /// The number of shards in the snapshot that are in the initializing stage of being stored in the repository. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "INIT")] + Init, + /// + /// + /// The number of shards in the snapshot that are in the started stage of being stored in the repository. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "STARTED")] + Started +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsSummary.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsSummary.Converters.g.cs new file mode 100644 index 00000000000..72a43855dc6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsSummary.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class ShardsStatsSummaryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIncremental = System.Text.Json.JsonEncodedText.Encode("incremental"); + private static readonly System.Text.Json.JsonEncodedText PropStartTimeInMillis = System.Text.Json.JsonEncodedText.Encode("start_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTime = System.Text.Json.JsonEncodedText.Encode("time"); + private static readonly System.Text.Json.JsonEncodedText PropTimeInMillis = System.Text.Json.JsonEncodedText.Encode("time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIncremental = default; + LocalJsonValue propStartTimeInMillis = default; + LocalJsonValue propTime = default; + LocalJsonValue propTimeInMillis = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIncremental.TryReadProperty(ref reader, options, PropIncremental, null)) + { + continue; + } + + if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propTime.TryReadProperty(ref reader, options, PropTime, null)) + { + continue; + } + + if (propTimeInMillis.TryReadProperty(ref reader, options, PropTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Incremental = propIncremental.Value, + StartTimeInMillis = propStartTimeInMillis.Value, + Time = propTime.Value, + TimeInMillis = propTimeInMillis.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsSummary value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIncremental, value.Incremental, null, null); + writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropTime, value.Time, null, null); + writer.WriteProperty(options, PropTimeInMillis, value.TimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsSummary.g.cs index a5594cfc862..516f946b824 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsSummary.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsSummary.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class ShardsStatsSummaryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIncremental = System.Text.Json.JsonEncodedText.Encode("incremental"); - private static readonly System.Text.Json.JsonEncodedText PropStartTimeInMillis = System.Text.Json.JsonEncodedText.Encode("start_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTime = System.Text.Json.JsonEncodedText.Encode("time"); - private static readonly System.Text.Json.JsonEncodedText PropTimeInMillis = System.Text.Json.JsonEncodedText.Encode("time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIncremental = default; - LocalJsonValue propStartTimeInMillis = default; - LocalJsonValue propTime = default; - LocalJsonValue propTimeInMillis = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIncremental.TryReadProperty(ref reader, options, PropIncremental, null)) - { - continue; - } - - if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propTime.TryReadProperty(ref reader, options, PropTime, null)) - { - continue; - } - - if (propTimeInMillis.TryReadProperty(ref reader, options, PropTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Incremental = propIncremental.Value, - StartTimeInMillis = propStartTimeInMillis.Value, - Time = propTime.Value, - TimeInMillis = propTimeInMillis.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsSummary value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIncremental, value.Incremental, null, null); - writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropTime, value.Time, null, null); - writer.WriteProperty(options, PropTimeInMillis, value.TimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsSummaryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.ShardsStatsSummaryConverter))] public sealed partial class ShardsStatsSummary { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsSummaryItem.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsSummaryItem.Converters.g.cs new file mode 100644 index 00000000000..80f099321f1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsSummaryItem.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class ShardsStatsSummaryItemConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFileCount = System.Text.Json.JsonEncodedText.Encode("file_count"); + private static readonly System.Text.Json.JsonEncodedText PropSizeInBytes = System.Text.Json.JsonEncodedText.Encode("size_in_bytes"); + + public override Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsSummaryItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFileCount = default; + LocalJsonValue propSizeInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFileCount.TryReadProperty(ref reader, options, PropFileCount, null)) + { + continue; + } + + if (propSizeInBytes.TryReadProperty(ref reader, options, PropSizeInBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsSummaryItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FileCount = propFileCount.Value, + SizeInBytes = propSizeInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsSummaryItem value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFileCount, value.FileCount, null, null); + writer.WriteProperty(options, PropSizeInBytes, value.SizeInBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsSummaryItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsSummaryItem.g.cs index 44f2a5c4c81..cf6b124cd2f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsSummaryItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/ShardsStatsSummaryItem.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class ShardsStatsSummaryItemConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFileCount = System.Text.Json.JsonEncodedText.Encode("file_count"); - private static readonly System.Text.Json.JsonEncodedText PropSizeInBytes = System.Text.Json.JsonEncodedText.Encode("size_in_bytes"); - - public override Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsSummaryItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propFileCount = default; - LocalJsonValue propSizeInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFileCount.TryReadProperty(ref reader, options, PropFileCount, null)) - { - continue; - } - - if (propSizeInBytes.TryReadProperty(ref reader, options, PropSizeInBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsSummaryItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FileCount = propFileCount.Value, - SizeInBytes = propSizeInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsSummaryItem value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFileCount, value.FileCount, null, null); - writer.WriteProperty(options, PropSizeInBytes, value.SizeInBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.ShardsStatsSummaryItemConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.ShardsStatsSummaryItemConverter))] public sealed partial class ShardsStatsSummaryItem { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SharedFileSystemRepository.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SharedFileSystemRepository.Converters.g.cs new file mode 100644 index 00000000000..7028dd3a7ef --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SharedFileSystemRepository.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class SharedFileSystemRepositoryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropUuid = System.Text.Json.JsonEncodedText.Encode("uuid"); + + public override Elastic.Clients.Elasticsearch.Snapshot.SharedFileSystemRepository Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propSettings = default; + LocalJsonValue propUuid = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propUuid.TryReadProperty(ref reader, options, PropUuid, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.SharedFileSystemRepository(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Settings = propSettings.Value, + Uuid = propUuid.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SharedFileSystemRepository value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSettings, value.Settings, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropUuid, value.Uuid, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SharedFileSystemRepository.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SharedFileSystemRepository.g.cs index 05ae927b64b..8f49838ce93 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SharedFileSystemRepository.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SharedFileSystemRepository.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class SharedFileSystemRepositoryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropUuid = System.Text.Json.JsonEncodedText.Encode("uuid"); - - public override Elastic.Clients.Elasticsearch.Snapshot.SharedFileSystemRepository Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propSettings = default; - LocalJsonValue propUuid = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propUuid.TryReadProperty(ref reader, options, PropUuid, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.SharedFileSystemRepository(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Settings = propSettings.Value, - Uuid = propUuid.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SharedFileSystemRepository value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSettings, value.Settings, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropUuid, value.Uuid, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.SharedFileSystemRepositoryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.SharedFileSystemRepositoryConverter))] public sealed partial class SharedFileSystemRepository : Elastic.Clients.Elasticsearch.Snapshot.IRepository { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SharedFileSystemRepositorySettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SharedFileSystemRepositorySettings.Converters.g.cs new file mode 100644 index 00000000000..32cdafb23e7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SharedFileSystemRepositorySettings.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class SharedFileSystemRepositorySettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkSize = System.Text.Json.JsonEncodedText.Encode("chunk_size"); + private static readonly System.Text.Json.JsonEncodedText PropCompress = System.Text.Json.JsonEncodedText.Encode("compress"); + private static readonly System.Text.Json.JsonEncodedText PropLocation = System.Text.Json.JsonEncodedText.Encode("location"); + private static readonly System.Text.Json.JsonEncodedText PropMaxNumberOfSnapshots = System.Text.Json.JsonEncodedText.Encode("max_number_of_snapshots"); + private static readonly System.Text.Json.JsonEncodedText PropMaxRestoreBytesPerSec = System.Text.Json.JsonEncodedText.Encode("max_restore_bytes_per_sec"); + private static readonly System.Text.Json.JsonEncodedText PropMaxSnapshotBytesPerSec = System.Text.Json.JsonEncodedText.Encode("max_snapshot_bytes_per_sec"); + private static readonly System.Text.Json.JsonEncodedText PropReadonly = System.Text.Json.JsonEncodedText.Encode("readonly"); + + public override Elastic.Clients.Elasticsearch.Snapshot.SharedFileSystemRepositorySettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkSize = default; + LocalJsonValue propCompress = default; + LocalJsonValue propLocation = default; + LocalJsonValue propMaxNumberOfSnapshots = default; + LocalJsonValue propMaxRestoreBytesPerSec = default; + LocalJsonValue propMaxSnapshotBytesPerSec = default; + LocalJsonValue propReadonly = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkSize.TryReadProperty(ref reader, options, PropChunkSize, null)) + { + continue; + } + + if (propCompress.TryReadProperty(ref reader, options, PropCompress, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLocation.TryReadProperty(ref reader, options, PropLocation, null)) + { + continue; + } + + if (propMaxNumberOfSnapshots.TryReadProperty(ref reader, options, PropMaxNumberOfSnapshots, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxRestoreBytesPerSec.TryReadProperty(ref reader, options, PropMaxRestoreBytesPerSec, null)) + { + continue; + } + + if (propMaxSnapshotBytesPerSec.TryReadProperty(ref reader, options, PropMaxSnapshotBytesPerSec, null)) + { + continue; + } + + if (propReadonly.TryReadProperty(ref reader, options, PropReadonly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.SharedFileSystemRepositorySettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkSize = propChunkSize.Value, + Compress = propCompress.Value, + Location = propLocation.Value, + MaxNumberOfSnapshots = propMaxNumberOfSnapshots.Value, + MaxRestoreBytesPerSec = propMaxRestoreBytesPerSec.Value, + MaxSnapshotBytesPerSec = propMaxSnapshotBytesPerSec.Value, + Readonly = propReadonly.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SharedFileSystemRepositorySettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkSize, value.ChunkSize, null, null); + writer.WriteProperty(options, PropCompress, value.Compress, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLocation, value.Location, null, null); + writer.WriteProperty(options, PropMaxNumberOfSnapshots, value.MaxNumberOfSnapshots, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxRestoreBytesPerSec, value.MaxRestoreBytesPerSec, null, null); + writer.WriteProperty(options, PropMaxSnapshotBytesPerSec, value.MaxSnapshotBytesPerSec, null, null); + writer.WriteProperty(options, PropReadonly, value.Readonly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SharedFileSystemRepositorySettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SharedFileSystemRepositorySettings.g.cs index 25f7bd6e4da..a6879cac397 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SharedFileSystemRepositorySettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SharedFileSystemRepositorySettings.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class SharedFileSystemRepositorySettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkSize = System.Text.Json.JsonEncodedText.Encode("chunk_size"); - private static readonly System.Text.Json.JsonEncodedText PropCompress = System.Text.Json.JsonEncodedText.Encode("compress"); - private static readonly System.Text.Json.JsonEncodedText PropLocation = System.Text.Json.JsonEncodedText.Encode("location"); - private static readonly System.Text.Json.JsonEncodedText PropMaxNumberOfSnapshots = System.Text.Json.JsonEncodedText.Encode("max_number_of_snapshots"); - private static readonly System.Text.Json.JsonEncodedText PropMaxRestoreBytesPerSec = System.Text.Json.JsonEncodedText.Encode("max_restore_bytes_per_sec"); - private static readonly System.Text.Json.JsonEncodedText PropMaxSnapshotBytesPerSec = System.Text.Json.JsonEncodedText.Encode("max_snapshot_bytes_per_sec"); - private static readonly System.Text.Json.JsonEncodedText PropReadonly = System.Text.Json.JsonEncodedText.Encode("readonly"); - - public override Elastic.Clients.Elasticsearch.Snapshot.SharedFileSystemRepositorySettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkSize = default; - LocalJsonValue propCompress = default; - LocalJsonValue propLocation = default; - LocalJsonValue propMaxNumberOfSnapshots = default; - LocalJsonValue propMaxRestoreBytesPerSec = default; - LocalJsonValue propMaxSnapshotBytesPerSec = default; - LocalJsonValue propReadonly = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkSize.TryReadProperty(ref reader, options, PropChunkSize, null)) - { - continue; - } - - if (propCompress.TryReadProperty(ref reader, options, PropCompress, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLocation.TryReadProperty(ref reader, options, PropLocation, null)) - { - continue; - } - - if (propMaxNumberOfSnapshots.TryReadProperty(ref reader, options, PropMaxNumberOfSnapshots, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxRestoreBytesPerSec.TryReadProperty(ref reader, options, PropMaxRestoreBytesPerSec, null)) - { - continue; - } - - if (propMaxSnapshotBytesPerSec.TryReadProperty(ref reader, options, PropMaxSnapshotBytesPerSec, null)) - { - continue; - } - - if (propReadonly.TryReadProperty(ref reader, options, PropReadonly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.SharedFileSystemRepositorySettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkSize = propChunkSize.Value, - Compress = propCompress.Value, - Location = propLocation.Value, - MaxNumberOfSnapshots = propMaxNumberOfSnapshots.Value, - MaxRestoreBytesPerSec = propMaxRestoreBytesPerSec.Value, - MaxSnapshotBytesPerSec = propMaxSnapshotBytesPerSec.Value, - Readonly = propReadonly.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SharedFileSystemRepositorySettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkSize, value.ChunkSize, null, null); - writer.WriteProperty(options, PropCompress, value.Compress, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLocation, value.Location, null, null); - writer.WriteProperty(options, PropMaxNumberOfSnapshots, value.MaxNumberOfSnapshots, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxRestoreBytesPerSec, value.MaxRestoreBytesPerSec, null, null); - writer.WriteProperty(options, PropMaxSnapshotBytesPerSec, value.MaxSnapshotBytesPerSec, null, null); - writer.WriteProperty(options, PropReadonly, value.Readonly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.SharedFileSystemRepositorySettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.SharedFileSystemRepositorySettingsConverter))] public sealed partial class SharedFileSystemRepositorySettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotIndexStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotIndexStats.Converters.g.cs new file mode 100644 index 00000000000..3e58a535ab0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotIndexStats.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class SnapshotIndexStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); + private static readonly System.Text.Json.JsonEncodedText PropShardsStats = System.Text.Json.JsonEncodedText.Encode("shards_stats"); + private static readonly System.Text.Json.JsonEncodedText PropStats = System.Text.Json.JsonEncodedText.Encode("stats"); + + public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotIndexStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propShards = default; + LocalJsonValue propShardsStats = default; + LocalJsonValue propStats = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propShards.TryReadProperty(ref reader, options, PropShards, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propShardsStats.TryReadProperty(ref reader, options, PropShardsStats, null)) + { + continue; + } + + if (propStats.TryReadProperty(ref reader, options, PropStats, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.SnapshotIndexStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Shards = propShards.Value, + ShardsStats = propShardsStats.Value, + Stats = propStats.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotIndexStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropShards, value.Shards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropShardsStats, value.ShardsStats, null, null); + writer.WriteProperty(options, PropStats, value.Stats, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotIndexStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotIndexStats.g.cs index c24c3c70d16..f03f3278286 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotIndexStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotIndexStats.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class SnapshotIndexStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); - private static readonly System.Text.Json.JsonEncodedText PropShardsStats = System.Text.Json.JsonEncodedText.Encode("shards_stats"); - private static readonly System.Text.Json.JsonEncodedText PropStats = System.Text.Json.JsonEncodedText.Encode("stats"); - - public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotIndexStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propShards = default; - LocalJsonValue propShardsStats = default; - LocalJsonValue propStats = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propShards.TryReadProperty(ref reader, options, PropShards, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propShardsStats.TryReadProperty(ref reader, options, PropShardsStats, null)) - { - continue; - } - - if (propStats.TryReadProperty(ref reader, options, PropStats, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.SnapshotIndexStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Shards = propShards.Value, - ShardsStats = propShardsStats.Value, - Stats = propStats.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotIndexStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropShards, value.Shards, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropShardsStats, value.ShardsStats, null, null); - writer.WriteProperty(options, PropStats, value.Stats, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.SnapshotIndexStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.SnapshotIndexStatsConverter))] public sealed partial class SnapshotIndexStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotInfo.Converters.g.cs new file mode 100644 index 00000000000..cf913c77710 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotInfo.Converters.g.cs @@ -0,0 +1,243 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class SnapshotInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"); + private static readonly System.Text.Json.JsonEncodedText PropDuration = System.Text.Json.JsonEncodedText.Encode("duration"); + private static readonly System.Text.Json.JsonEncodedText PropDurationInMillis = System.Text.Json.JsonEncodedText.Encode("duration_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropEndTime = System.Text.Json.JsonEncodedText.Encode("end_time"); + private static readonly System.Text.Json.JsonEncodedText PropEndTimeInMillis = System.Text.Json.JsonEncodedText.Encode("end_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropFailures = System.Text.Json.JsonEncodedText.Encode("failures"); + private static readonly System.Text.Json.JsonEncodedText PropFeatureStates = System.Text.Json.JsonEncodedText.Encode("feature_states"); + private static readonly System.Text.Json.JsonEncodedText PropIncludeGlobalState = System.Text.Json.JsonEncodedText.Encode("include_global_state"); + private static readonly System.Text.Json.JsonEncodedText PropIndexDetails = System.Text.Json.JsonEncodedText.Encode("index_details"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); + private static readonly System.Text.Json.JsonEncodedText PropRepository = System.Text.Json.JsonEncodedText.Encode("repository"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); + private static readonly System.Text.Json.JsonEncodedText PropSnapshot = System.Text.Json.JsonEncodedText.Encode("snapshot"); + 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"); + private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); + private static readonly System.Text.Json.JsonEncodedText PropUuid = System.Text.Json.JsonEncodedText.Encode("uuid"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + private static readonly System.Text.Json.JsonEncodedText PropVersionId = System.Text.Json.JsonEncodedText.Encode("version_id"); + + public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propDataStreams = default; + LocalJsonValue propDuration = default; + LocalJsonValue propDurationInMillis = default; + LocalJsonValue propEndTime = default; + LocalJsonValue propEndTimeInMillis = default; + LocalJsonValue?> propFailures = default; + LocalJsonValue?> propFeatureStates = default; + LocalJsonValue propIncludeGlobalState = default; + LocalJsonValue?> propIndexDetails = default; + LocalJsonValue?> propIndices = default; + LocalJsonValue?> propMetadata = default; + LocalJsonValue propReason = default; + LocalJsonValue propRepository = default; + LocalJsonValue propShards = default; + LocalJsonValue propSnapshot = default; + LocalJsonValue propStartTime = default; + LocalJsonValue propStartTimeInMillis = default; + LocalJsonValue propState = default; + LocalJsonValue propUuid = default; + LocalJsonValue propVersion = default; + LocalJsonValue propVersionId = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propDuration.TryReadProperty(ref reader, options, PropDuration, null)) + { + continue; + } + + if (propDurationInMillis.TryReadProperty(ref reader, options, PropDurationInMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propEndTime.TryReadProperty(ref reader, options, PropEndTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propEndTimeInMillis.TryReadProperty(ref reader, options, PropEndTimeInMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propFailures.TryReadProperty(ref reader, options, PropFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propFeatureStates.TryReadProperty(ref reader, options, PropFeatureStates, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propIncludeGlobalState.TryReadProperty(ref reader, options, PropIncludeGlobalState, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndexDetails.TryReadProperty(ref reader, options, PropIndexDetails, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propReason.TryReadProperty(ref reader, options, PropReason, null)) + { + continue; + } + + if (propRepository.TryReadProperty(ref reader, options, PropRepository, null)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (propSnapshot.TryReadProperty(ref reader, options, PropSnapshot, null)) + { + continue; + } + + if (propStartTime.TryReadProperty(ref reader, options, PropStartTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propState.TryReadProperty(ref reader, options, PropState, null)) + { + continue; + } + + if (propUuid.TryReadProperty(ref reader, options, PropUuid, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (propVersionId.TryReadProperty(ref reader, options, PropVersionId, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.SnapshotInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DataStreams = propDataStreams.Value, + Duration = propDuration.Value, + DurationInMillis = propDurationInMillis.Value, + EndTime = propEndTime.Value, + EndTimeInMillis = propEndTimeInMillis.Value, + Failures = propFailures.Value, + FeatureStates = propFeatureStates.Value, + IncludeGlobalState = propIncludeGlobalState.Value, + IndexDetails = propIndexDetails.Value, + Indices = propIndices.Value, + Metadata = propMetadata.Value, + Reason = propReason.Value, + Repository = propRepository.Value, + Shards = propShards.Value, + Snapshot = propSnapshot.Value, + StartTime = propStartTime.Value, + StartTimeInMillis = propStartTimeInMillis.Value, + State = propState.Value, + Uuid = propUuid.Value, + Version = propVersion.Value, + VersionId = propVersionId.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDuration, value.Duration, null, null); + writer.WriteProperty(options, PropDurationInMillis, value.DurationInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropEndTime, value.EndTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropEndTimeInMillis, value.EndTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropFailures, value.Failures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropFeatureStates, value.FeatureStates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIncludeGlobalState, value.IncludeGlobalState, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndexDetails, value.IndexDetails, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropReason, value.Reason, null, null); + writer.WriteProperty(options, PropRepository, value.Repository, null, null); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteProperty(options, PropSnapshot, value.Snapshot, null, null); + writer.WriteProperty(options, PropStartTime, value.StartTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropState, value.State, null, null); + writer.WriteProperty(options, PropUuid, value.Uuid, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteProperty(options, PropVersionId, value.VersionId, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotInfo.g.cs index 305a76e7e40..05ab09e1b5a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotInfo.g.cs @@ -23,226 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class SnapshotInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"); - private static readonly System.Text.Json.JsonEncodedText PropDuration = System.Text.Json.JsonEncodedText.Encode("duration"); - private static readonly System.Text.Json.JsonEncodedText PropDurationInMillis = System.Text.Json.JsonEncodedText.Encode("duration_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropEndTime = System.Text.Json.JsonEncodedText.Encode("end_time"); - private static readonly System.Text.Json.JsonEncodedText PropEndTimeInMillis = System.Text.Json.JsonEncodedText.Encode("end_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropFailures = System.Text.Json.JsonEncodedText.Encode("failures"); - private static readonly System.Text.Json.JsonEncodedText PropFeatureStates = System.Text.Json.JsonEncodedText.Encode("feature_states"); - private static readonly System.Text.Json.JsonEncodedText PropIncludeGlobalState = System.Text.Json.JsonEncodedText.Encode("include_global_state"); - private static readonly System.Text.Json.JsonEncodedText PropIndexDetails = System.Text.Json.JsonEncodedText.Encode("index_details"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); - private static readonly System.Text.Json.JsonEncodedText PropRepository = System.Text.Json.JsonEncodedText.Encode("repository"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); - private static readonly System.Text.Json.JsonEncodedText PropSnapshot = System.Text.Json.JsonEncodedText.Encode("snapshot"); - 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"); - private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); - private static readonly System.Text.Json.JsonEncodedText PropUuid = System.Text.Json.JsonEncodedText.Encode("uuid"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - private static readonly System.Text.Json.JsonEncodedText PropVersionId = System.Text.Json.JsonEncodedText.Encode("version_id"); - - public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propDataStreams = default; - LocalJsonValue propDuration = default; - LocalJsonValue propDurationInMillis = default; - LocalJsonValue propEndTime = default; - LocalJsonValue propEndTimeInMillis = default; - LocalJsonValue?> propFailures = default; - LocalJsonValue?> propFeatureStates = default; - LocalJsonValue propIncludeGlobalState = default; - LocalJsonValue?> propIndexDetails = default; - LocalJsonValue?> propIndices = default; - LocalJsonValue?> propMetadata = default; - LocalJsonValue propReason = default; - LocalJsonValue propRepository = default; - LocalJsonValue propShards = default; - LocalJsonValue propSnapshot = default; - LocalJsonValue propStartTime = default; - LocalJsonValue propStartTimeInMillis = default; - LocalJsonValue propState = default; - LocalJsonValue propUuid = default; - LocalJsonValue propVersion = default; - LocalJsonValue propVersionId = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propDuration.TryReadProperty(ref reader, options, PropDuration, null)) - { - continue; - } - - if (propDurationInMillis.TryReadProperty(ref reader, options, PropDurationInMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propEndTime.TryReadProperty(ref reader, options, PropEndTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propEndTimeInMillis.TryReadProperty(ref reader, options, PropEndTimeInMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propFailures.TryReadProperty(ref reader, options, PropFailures, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propFeatureStates.TryReadProperty(ref reader, options, PropFeatureStates, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propIncludeGlobalState.TryReadProperty(ref reader, options, PropIncludeGlobalState, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndexDetails.TryReadProperty(ref reader, options, PropIndexDetails, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propReason.TryReadProperty(ref reader, options, PropReason, null)) - { - continue; - } - - if (propRepository.TryReadProperty(ref reader, options, PropRepository, null)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (propSnapshot.TryReadProperty(ref reader, options, PropSnapshot, null)) - { - continue; - } - - if (propStartTime.TryReadProperty(ref reader, options, PropStartTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propState.TryReadProperty(ref reader, options, PropState, null)) - { - continue; - } - - if (propUuid.TryReadProperty(ref reader, options, PropUuid, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (propVersionId.TryReadProperty(ref reader, options, PropVersionId, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.SnapshotInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DataStreams = propDataStreams.Value, - Duration = propDuration.Value, - DurationInMillis = propDurationInMillis.Value, - EndTime = propEndTime.Value, - EndTimeInMillis = propEndTimeInMillis.Value, - Failures = propFailures.Value, - FeatureStates = propFeatureStates.Value, - IncludeGlobalState = propIncludeGlobalState.Value, - IndexDetails = propIndexDetails.Value, - Indices = propIndices.Value, - Metadata = propMetadata.Value, - Reason = propReason.Value, - Repository = propRepository.Value, - Shards = propShards.Value, - Snapshot = propSnapshot.Value, - StartTime = propStartTime.Value, - StartTimeInMillis = propStartTimeInMillis.Value, - State = propState.Value, - Uuid = propUuid.Value, - Version = propVersion.Value, - VersionId = propVersionId.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDuration, value.Duration, null, null); - writer.WriteProperty(options, PropDurationInMillis, value.DurationInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropEndTime, value.EndTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropEndTimeInMillis, value.EndTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropFailures, value.Failures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropFeatureStates, value.FeatureStates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIncludeGlobalState, value.IncludeGlobalState, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndexDetails, value.IndexDetails, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropReason, value.Reason, null, null); - writer.WriteProperty(options, PropRepository, value.Repository, null, null); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteProperty(options, PropSnapshot, value.Snapshot, null, null); - writer.WriteProperty(options, PropStartTime, value.StartTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropState, value.State, null, null); - writer.WriteProperty(options, PropUuid, value.Uuid, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteProperty(options, PropVersionId, value.VersionId, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.SnapshotInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.SnapshotInfoConverter))] public sealed partial class SnapshotInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotNodeInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotNodeInfo.Converters.g.cs new file mode 100644 index 00000000000..56bfcd06b1c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotNodeInfo.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class SnapshotNodeInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + + public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotNodeInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propName = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.SnapshotNodeInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + Name = propName.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotNodeInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotNodeInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotNodeInfo.g.cs index df2ec293084..3dda907c92d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotNodeInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotNodeInfo.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class SnapshotNodeInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - - public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotNodeInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue propName = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.SnapshotNodeInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - Name = propName.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotNodeInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.SnapshotNodeInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.SnapshotNodeInfoConverter))] public sealed partial class SnapshotNodeInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotResponseItem.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotResponseItem.Converters.g.cs new file mode 100644 index 00000000000..0ed3fd988f2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotResponseItem.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class SnapshotResponseItemConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); + private static readonly System.Text.Json.JsonEncodedText PropRepository = System.Text.Json.JsonEncodedText.Encode("repository"); + private static readonly System.Text.Json.JsonEncodedText PropSnapshots = System.Text.Json.JsonEncodedText.Encode("snapshots"); + + public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotResponseItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propError = default; + LocalJsonValue propRepository = default; + LocalJsonValue?> propSnapshots = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propError.TryReadProperty(ref reader, options, PropError, null)) + { + continue; + } + + if (propRepository.TryReadProperty(ref reader, options, PropRepository, null)) + { + continue; + } + + if (propSnapshots.TryReadProperty(ref reader, options, PropSnapshots, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.SnapshotResponseItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Error = propError.Value, + Repository = propRepository.Value, + Snapshots = propSnapshots.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotResponseItem value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropError, value.Error, null, null); + writer.WriteProperty(options, PropRepository, value.Repository, null, null); + writer.WriteProperty(options, PropSnapshots, value.Snapshots, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotResponseItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotResponseItem.g.cs index 0a9bf8bcd5a..c56d6f4e5d3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotResponseItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotResponseItem.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class SnapshotResponseItemConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropError = System.Text.Json.JsonEncodedText.Encode("error"); - private static readonly System.Text.Json.JsonEncodedText PropRepository = System.Text.Json.JsonEncodedText.Encode("repository"); - private static readonly System.Text.Json.JsonEncodedText PropSnapshots = System.Text.Json.JsonEncodedText.Encode("snapshots"); - - public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotResponseItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propError = default; - LocalJsonValue propRepository = default; - LocalJsonValue?> propSnapshots = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propError.TryReadProperty(ref reader, options, PropError, null)) - { - continue; - } - - if (propRepository.TryReadProperty(ref reader, options, PropRepository, null)) - { - continue; - } - - if (propSnapshots.TryReadProperty(ref reader, options, PropSnapshots, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.SnapshotResponseItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Error = propError.Value, - Repository = propRepository.Value, - Snapshots = propSnapshots.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotResponseItem value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropError, value.Error, null, null); - writer.WriteProperty(options, PropRepository, value.Repository, null, null); - writer.WriteProperty(options, PropSnapshots, value.Snapshots, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.SnapshotResponseItemConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.SnapshotResponseItemConverter))] public sealed partial class SnapshotResponseItem { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotRestore.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotRestore.Converters.g.cs new file mode 100644 index 00000000000..6445338226d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotRestore.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class SnapshotRestoreConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); + private static readonly System.Text.Json.JsonEncodedText PropSnapshot = System.Text.Json.JsonEncodedText.Encode("snapshot"); + + public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotRestore Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propIndices = default; + LocalJsonValue propShards = default; + LocalJsonValue propSnapshot = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propShards.TryReadProperty(ref reader, options, PropShards, null)) + { + continue; + } + + if (propSnapshot.TryReadProperty(ref reader, options, PropSnapshot, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.SnapshotRestore(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Indices = propIndices.Value, + Shards = propShards.Value, + Snapshot = propSnapshot.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotRestore value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropShards, value.Shards, null, null); + writer.WriteProperty(options, PropSnapshot, value.Snapshot, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotRestore.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotRestore.g.cs index 364546172bd..581b7e01d3e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotRestore.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotRestore.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class SnapshotRestoreConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("shards"); - private static readonly System.Text.Json.JsonEncodedText PropSnapshot = System.Text.Json.JsonEncodedText.Encode("snapshot"); - - public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotRestore Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propIndices = default; - LocalJsonValue propShards = default; - LocalJsonValue propSnapshot = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propShards.TryReadProperty(ref reader, options, PropShards, null)) - { - continue; - } - - if (propSnapshot.TryReadProperty(ref reader, options, PropSnapshot, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.SnapshotRestore(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Indices = propIndices.Value, - Shards = propShards.Value, - Snapshot = propSnapshot.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotRestore value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropShards, value.Shards, null, null); - writer.WriteProperty(options, PropSnapshot, value.Snapshot, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.SnapshotRestoreConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.SnapshotRestoreConverter))] public sealed partial class SnapshotRestore { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotShardFailure.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotShardFailure.Converters.g.cs new file mode 100644 index 00000000000..b923633927c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotShardFailure.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class SnapshotShardFailureConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropIndexUuid = System.Text.Json.JsonEncodedText.Encode("index_uuid"); + private static readonly System.Text.Json.JsonEncodedText PropNodeId = System.Text.Json.JsonEncodedText.Encode("node_id"); + private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); + private static readonly System.Text.Json.JsonEncodedText PropShardId = System.Text.Json.JsonEncodedText.Encode("shard_id"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + + public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotShardFailure Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndex = default; + LocalJsonValue propIndexUuid = default; + LocalJsonValue propNodeId = default; + LocalJsonValue propReason = default; + LocalJsonValue propShardId = default; + LocalJsonValue propStatus = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propIndexUuid.TryReadProperty(ref reader, options, PropIndexUuid, null)) + { + continue; + } + + if (propNodeId.TryReadProperty(ref reader, options, PropNodeId, null)) + { + continue; + } + + if (propReason.TryReadProperty(ref reader, options, PropReason, null)) + { + continue; + } + + if (propShardId.TryReadProperty(ref reader, options, PropShardId, null)) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.SnapshotShardFailure(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Index = propIndex.Value, + IndexUuid = propIndexUuid.Value, + NodeId = propNodeId.Value, + Reason = propReason.Value, + ShardId = propShardId.Value, + Status = propStatus.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotShardFailure value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropIndexUuid, value.IndexUuid, null, null); + writer.WriteProperty(options, PropNodeId, value.NodeId, null, null); + writer.WriteProperty(options, PropReason, value.Reason, null, null); + writer.WriteProperty(options, PropShardId, value.ShardId, null, null); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotShardFailure.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotShardFailure.g.cs index e228dfc5b6f..a937fd9bfab 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotShardFailure.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotShardFailure.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class SnapshotShardFailureConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropIndexUuid = System.Text.Json.JsonEncodedText.Encode("index_uuid"); - private static readonly System.Text.Json.JsonEncodedText PropNodeId = System.Text.Json.JsonEncodedText.Encode("node_id"); - private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); - private static readonly System.Text.Json.JsonEncodedText PropShardId = System.Text.Json.JsonEncodedText.Encode("shard_id"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - - public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotShardFailure Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndex = default; - LocalJsonValue propIndexUuid = default; - LocalJsonValue propNodeId = default; - LocalJsonValue propReason = default; - LocalJsonValue propShardId = default; - LocalJsonValue propStatus = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propIndexUuid.TryReadProperty(ref reader, options, PropIndexUuid, null)) - { - continue; - } - - if (propNodeId.TryReadProperty(ref reader, options, PropNodeId, null)) - { - continue; - } - - if (propReason.TryReadProperty(ref reader, options, PropReason, null)) - { - continue; - } - - if (propShardId.TryReadProperty(ref reader, options, PropShardId, null)) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.SnapshotShardFailure(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Index = propIndex.Value, - IndexUuid = propIndexUuid.Value, - NodeId = propNodeId.Value, - Reason = propReason.Value, - ShardId = propShardId.Value, - Status = propStatus.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotShardFailure value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropIndexUuid, value.IndexUuid, null, null); - writer.WriteProperty(options, PropNodeId, value.NodeId, null, null); - writer.WriteProperty(options, PropReason, value.Reason, null, null); - writer.WriteProperty(options, PropShardId, value.ShardId, null, null); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.SnapshotShardFailureConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.SnapshotShardFailureConverter))] public sealed partial class SnapshotShardFailure { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotShardsStatus.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotShardsStatus.Converters.g.cs new file mode 100644 index 00000000000..ff464b73da6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotShardsStatus.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class SnapshotShardsStatusConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStage = System.Text.Json.JsonEncodedText.Encode("stage"); + private static readonly System.Text.Json.JsonEncodedText PropStats = System.Text.Json.JsonEncodedText.Encode("stats"); + + public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotShardsStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propStage = default; + LocalJsonValue propStats = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStage.TryReadProperty(ref reader, options, PropStage, null)) + { + continue; + } + + if (propStats.TryReadProperty(ref reader, options, PropStats, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.SnapshotShardsStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Stage = propStage.Value, + Stats = propStats.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotShardsStatus value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStage, value.Stage, null, null); + writer.WriteProperty(options, PropStats, value.Stats, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotShardsStatus.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotShardsStatus.g.cs index eb973b1a399..94ae413a4d1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotShardsStatus.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotShardsStatus.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class SnapshotShardsStatusConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropStage = System.Text.Json.JsonEncodedText.Encode("stage"); - private static readonly System.Text.Json.JsonEncodedText PropStats = System.Text.Json.JsonEncodedText.Encode("stats"); - - public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotShardsStatus Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propStage = default; - LocalJsonValue propStats = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propStage.TryReadProperty(ref reader, options, PropStage, null)) - { - continue; - } - - if (propStats.TryReadProperty(ref reader, options, PropStats, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.SnapshotShardsStatus(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Stage = propStage.Value, - Stats = propStats.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotShardsStatus value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropStage, value.Stage, null, null); - writer.WriteProperty(options, PropStats, value.Stats, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.SnapshotShardsStatusConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.SnapshotShardsStatusConverter))] public sealed partial class SnapshotShardsStatus { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotSort.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotSort.Converters.g.cs new file mode 100644 index 00000000000..b7320d57b11 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotSort.Converters.g.cs @@ -0,0 +1,151 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class SnapshotSortConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberDuration = System.Text.Json.JsonEncodedText.Encode("duration"); + private static readonly System.Text.Json.JsonEncodedText MemberFailedShardCount = System.Text.Json.JsonEncodedText.Encode("failed_shard_count"); + private static readonly System.Text.Json.JsonEncodedText MemberIndexCount = System.Text.Json.JsonEncodedText.Encode("index_count"); + private static readonly System.Text.Json.JsonEncodedText MemberName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText MemberRepository = System.Text.Json.JsonEncodedText.Encode("repository"); + private static readonly System.Text.Json.JsonEncodedText MemberShardCount = System.Text.Json.JsonEncodedText.Encode("shard_count"); + private static readonly System.Text.Json.JsonEncodedText MemberStartTime = System.Text.Json.JsonEncodedText.Encode("start_time"); + + public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberDuration)) + { + return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.Duration; + } + + if (reader.ValueTextEquals(MemberFailedShardCount)) + { + return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.FailedShardCount; + } + + if (reader.ValueTextEquals(MemberIndexCount)) + { + return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.IndexCount; + } + + if (reader.ValueTextEquals(MemberName)) + { + return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.Name; + } + + if (reader.ValueTextEquals(MemberRepository)) + { + return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.Repository; + } + + if (reader.ValueTextEquals(MemberShardCount)) + { + return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.ShardCount; + } + + if (reader.ValueTextEquals(MemberStartTime)) + { + return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.StartTime; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberDuration.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.Duration; + } + + if (string.Equals(value, MemberFailedShardCount.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.FailedShardCount; + } + + if (string.Equals(value, MemberIndexCount.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.IndexCount; + } + + if (string.Equals(value, MemberName.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.Name; + } + + if (string.Equals(value, MemberRepository.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.Repository; + } + + if (string.Equals(value, MemberShardCount.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.ShardCount; + } + + if (string.Equals(value, MemberStartTime.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.StartTime; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.Duration: + writer.WriteStringValue(MemberDuration); + break; + case Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.FailedShardCount: + writer.WriteStringValue(MemberFailedShardCount); + break; + case Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.IndexCount: + writer.WriteStringValue(MemberIndexCount); + break; + case Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.Name: + writer.WriteStringValue(MemberName); + break; + case Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.Repository: + writer.WriteStringValue(MemberRepository); + break; + case Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.ShardCount: + writer.WriteStringValue(MemberShardCount); + break; + case Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort.StartTime: + writer.WriteStringValue(MemberStartTime); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotSort value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotSort.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotSort.g.cs new file mode 100644 index 00000000000..44206dc04d3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotSort.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.SnapshotSortConverter))] +public enum SnapshotSort +{ + [System.Runtime.Serialization.EnumMember(Value = "duration")] + Duration, + [System.Runtime.Serialization.EnumMember(Value = "failed_shard_count")] + FailedShardCount, + [System.Runtime.Serialization.EnumMember(Value = "index_count")] + IndexCount, + [System.Runtime.Serialization.EnumMember(Value = "name")] + Name, + [System.Runtime.Serialization.EnumMember(Value = "repository")] + Repository, + [System.Runtime.Serialization.EnumMember(Value = "shard_count")] + ShardCount, + [System.Runtime.Serialization.EnumMember(Value = "start_time")] + StartTime +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotState.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotState.Converters.g.cs new file mode 100644 index 00000000000..348f67f760a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotState.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class SnapshotStateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberFailed = System.Text.Json.JsonEncodedText.Encode("FAILED"); + private static readonly System.Text.Json.JsonEncodedText MemberInProgress = System.Text.Json.JsonEncodedText.Encode("IN_PROGRESS"); + private static readonly System.Text.Json.JsonEncodedText MemberIncompatible = System.Text.Json.JsonEncodedText.Encode("INCOMPATIBLE"); + private static readonly System.Text.Json.JsonEncodedText MemberPartial = System.Text.Json.JsonEncodedText.Encode("PARTIAL"); + private static readonly System.Text.Json.JsonEncodedText MemberSuccess = System.Text.Json.JsonEncodedText.Encode("SUCCESS"); + + public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotState Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberFailed)) + { + return Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.Failed; + } + + if (reader.ValueTextEquals(MemberInProgress)) + { + return Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.InProgress; + } + + if (reader.ValueTextEquals(MemberIncompatible)) + { + return Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.Incompatible; + } + + if (reader.ValueTextEquals(MemberPartial)) + { + return Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.Partial; + } + + if (reader.ValueTextEquals(MemberSuccess)) + { + return Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.Success; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberFailed.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.Failed; + } + + if (string.Equals(value, MemberInProgress.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.InProgress; + } + + if (string.Equals(value, MemberIncompatible.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.Incompatible; + } + + if (string.Equals(value, MemberPartial.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.Partial; + } + + if (string.Equals(value, MemberSuccess.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.Success; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Snapshot.SnapshotState)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotState value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.Failed: + writer.WriteStringValue(MemberFailed); + break; + case Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.InProgress: + writer.WriteStringValue(MemberInProgress); + break; + case Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.Incompatible: + writer.WriteStringValue(MemberIncompatible); + break; + case Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.Partial: + writer.WriteStringValue(MemberPartial); + break; + case Elastic.Clients.Elasticsearch.Snapshot.SnapshotState.Success: + writer.WriteStringValue(MemberSuccess); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Snapshot.SnapshotState)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotState ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotState value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotState.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotState.g.cs new file mode 100644 index 00000000000..8e151855164 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotState.g.cs @@ -0,0 +1,64 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.SnapshotStateConverter))] +public enum SnapshotState +{ + /// + /// + /// The snapshot failed. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "FAILED")] + Failed, + /// + /// + /// The snapshot process has started. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "IN_PROGRESS")] + InProgress, + /// + /// + /// The snapshot is incompatible with the current version of the cluster. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "INCOMPATIBLE")] + Incompatible, + /// + /// + /// The snapshot was partially successful. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "PARTIAL")] + Partial, + /// + /// + /// The snapshot process completed successfully. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "SUCCESS")] + Success +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotStats.Converters.g.cs new file mode 100644 index 00000000000..7a3f21a85f5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotStats.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class SnapshotStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIncremental = System.Text.Json.JsonEncodedText.Encode("incremental"); + private static readonly System.Text.Json.JsonEncodedText PropStartTimeInMillis = System.Text.Json.JsonEncodedText.Encode("start_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTime = System.Text.Json.JsonEncodedText.Encode("time"); + private static readonly System.Text.Json.JsonEncodedText PropTimeInMillis = System.Text.Json.JsonEncodedText.Encode("time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIncremental = default; + LocalJsonValue propStartTimeInMillis = default; + LocalJsonValue propTime = default; + LocalJsonValue propTimeInMillis = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIncremental.TryReadProperty(ref reader, options, PropIncremental, null)) + { + continue; + } + + if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propTime.TryReadProperty(ref reader, options, PropTime, null)) + { + continue; + } + + if (propTimeInMillis.TryReadProperty(ref reader, options, PropTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.SnapshotStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Incremental = propIncremental.Value, + StartTimeInMillis = propStartTimeInMillis.Value, + Time = propTime.Value, + TimeInMillis = propTimeInMillis.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIncremental, value.Incremental, null, null); + writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropTime, value.Time, null, null); + writer.WriteProperty(options, PropTimeInMillis, value.TimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotStats.g.cs index 38c2ea0e401..a0f067289a1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SnapshotStats.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class SnapshotStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIncremental = System.Text.Json.JsonEncodedText.Encode("incremental"); - private static readonly System.Text.Json.JsonEncodedText PropStartTimeInMillis = System.Text.Json.JsonEncodedText.Encode("start_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTime = System.Text.Json.JsonEncodedText.Encode("time"); - private static readonly System.Text.Json.JsonEncodedText PropTimeInMillis = System.Text.Json.JsonEncodedText.Encode("time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Snapshot.SnapshotStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIncremental = default; - LocalJsonValue propStartTimeInMillis = default; - LocalJsonValue propTime = default; - LocalJsonValue propTimeInMillis = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIncremental.TryReadProperty(ref reader, options, PropIncremental, null)) - { - continue; - } - - if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propTime.TryReadProperty(ref reader, options, PropTime, null)) - { - continue; - } - - if (propTimeInMillis.TryReadProperty(ref reader, options, PropTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.SnapshotStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Incremental = propIncremental.Value, - StartTimeInMillis = propStartTimeInMillis.Value, - Time = propTime.Value, - TimeInMillis = propTimeInMillis.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SnapshotStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIncremental, value.Incremental, null, null); - writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropTime, value.Time, null, null); - writer.WriteProperty(options, PropTimeInMillis, value.TimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.SnapshotStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.SnapshotStatsConverter))] public sealed partial class SnapshotStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SourceOnlyRepository.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SourceOnlyRepository.Converters.g.cs new file mode 100644 index 00000000000..7eaaebc6a18 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SourceOnlyRepository.Converters.g.cs @@ -0,0 +1,80 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class SourceOnlyRepositoryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropUuid = System.Text.Json.JsonEncodedText.Encode("uuid"); + + public override Elastic.Clients.Elasticsearch.Snapshot.SourceOnlyRepository Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propSettings = default; + LocalJsonValue propUuid = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propUuid.TryReadProperty(ref reader, options, PropUuid, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.SourceOnlyRepository(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Settings = propSettings.Value, + Uuid = propUuid.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SourceOnlyRepository value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSettings, value.Settings, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropUuid, value.Uuid, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SourceOnlyRepository.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SourceOnlyRepository.g.cs index e658bdab278..c7fbc270e8d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SourceOnlyRepository.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SourceOnlyRepository.g.cs @@ -23,63 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class SourceOnlyRepositoryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropUuid = System.Text.Json.JsonEncodedText.Encode("uuid"); - - public override Elastic.Clients.Elasticsearch.Snapshot.SourceOnlyRepository Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propSettings = default; - LocalJsonValue propUuid = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) - { - continue; - } - - if (reader.ValueTextEquals(PropType)) - { - reader.Skip(); - continue; - } - - if (propUuid.TryReadProperty(ref reader, options, PropUuid, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.SourceOnlyRepository(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Settings = propSettings.Value, - Uuid = propUuid.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SourceOnlyRepository value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSettings, value.Settings, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropUuid, value.Uuid, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.SourceOnlyRepositoryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.SourceOnlyRepositoryConverter))] public sealed partial class SourceOnlyRepository : Elastic.Clients.Elasticsearch.Snapshot.IRepository { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SourceOnlyRepositorySettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SourceOnlyRepositorySettings.Converters.g.cs new file mode 100644 index 00000000000..0844d7270ed --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SourceOnlyRepositorySettings.Converters.g.cs @@ -0,0 +1,118 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class SourceOnlyRepositorySettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkSize = System.Text.Json.JsonEncodedText.Encode("chunk_size"); + private static readonly System.Text.Json.JsonEncodedText PropCompress = System.Text.Json.JsonEncodedText.Encode("compress"); + private static readonly System.Text.Json.JsonEncodedText PropDelegateType = System.Text.Json.JsonEncodedText.Encode("delegate_type"); + private static readonly System.Text.Json.JsonEncodedText PropMaxNumberOfSnapshots = System.Text.Json.JsonEncodedText.Encode("max_number_of_snapshots"); + private static readonly System.Text.Json.JsonEncodedText PropMaxRestoreBytesPerSec = System.Text.Json.JsonEncodedText.Encode("max_restore_bytes_per_sec"); + private static readonly System.Text.Json.JsonEncodedText PropMaxSnapshotBytesPerSec = System.Text.Json.JsonEncodedText.Encode("max_snapshot_bytes_per_sec"); + private static readonly System.Text.Json.JsonEncodedText PropReadOnly = System.Text.Json.JsonEncodedText.Encode("read_only"); + private static readonly System.Text.Json.JsonEncodedText PropReadOnly1 = System.Text.Json.JsonEncodedText.Encode("readonly"); + + public override Elastic.Clients.Elasticsearch.Snapshot.SourceOnlyRepositorySettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkSize = default; + LocalJsonValue propCompress = default; + LocalJsonValue propDelegateType = default; + LocalJsonValue propMaxNumberOfSnapshots = default; + LocalJsonValue propMaxRestoreBytesPerSec = default; + LocalJsonValue propMaxSnapshotBytesPerSec = default; + LocalJsonValue propReadOnly = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkSize.TryReadProperty(ref reader, options, PropChunkSize, null)) + { + continue; + } + + if (propCompress.TryReadProperty(ref reader, options, PropCompress, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDelegateType.TryReadProperty(ref reader, options, PropDelegateType, null)) + { + continue; + } + + if (propMaxNumberOfSnapshots.TryReadProperty(ref reader, options, PropMaxNumberOfSnapshots, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxRestoreBytesPerSec.TryReadProperty(ref reader, options, PropMaxRestoreBytesPerSec, null)) + { + continue; + } + + if (propMaxSnapshotBytesPerSec.TryReadProperty(ref reader, options, PropMaxSnapshotBytesPerSec, null)) + { + continue; + } + + if (propReadOnly.TryReadProperty(ref reader, options, PropReadOnly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o)) || propReadOnly.TryReadProperty(ref reader, options, PropReadOnly1, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.SourceOnlyRepositorySettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkSize = propChunkSize.Value, + Compress = propCompress.Value, + DelegateType = propDelegateType.Value, + MaxNumberOfSnapshots = propMaxNumberOfSnapshots.Value, + MaxRestoreBytesPerSec = propMaxRestoreBytesPerSec.Value, + MaxSnapshotBytesPerSec = propMaxSnapshotBytesPerSec.Value, + ReadOnly = propReadOnly.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SourceOnlyRepositorySettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkSize, value.ChunkSize, null, null); + writer.WriteProperty(options, PropCompress, value.Compress, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDelegateType, value.DelegateType, null, null); + writer.WriteProperty(options, PropMaxNumberOfSnapshots, value.MaxNumberOfSnapshots, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxRestoreBytesPerSec, value.MaxRestoreBytesPerSec, null, null); + writer.WriteProperty(options, PropMaxSnapshotBytesPerSec, value.MaxSnapshotBytesPerSec, null, null); + writer.WriteProperty(options, PropReadOnly, value.ReadOnly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SourceOnlyRepositorySettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SourceOnlyRepositorySettings.g.cs index 214e93e3ded..89efcc68ff6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SourceOnlyRepositorySettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SourceOnlyRepositorySettings.g.cs @@ -23,101 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class SourceOnlyRepositorySettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChunkSize = System.Text.Json.JsonEncodedText.Encode("chunk_size"); - private static readonly System.Text.Json.JsonEncodedText PropCompress = System.Text.Json.JsonEncodedText.Encode("compress"); - private static readonly System.Text.Json.JsonEncodedText PropDelegateType = System.Text.Json.JsonEncodedText.Encode("delegate_type"); - private static readonly System.Text.Json.JsonEncodedText PropMaxNumberOfSnapshots = System.Text.Json.JsonEncodedText.Encode("max_number_of_snapshots"); - private static readonly System.Text.Json.JsonEncodedText PropMaxRestoreBytesPerSec = System.Text.Json.JsonEncodedText.Encode("max_restore_bytes_per_sec"); - private static readonly System.Text.Json.JsonEncodedText PropMaxSnapshotBytesPerSec = System.Text.Json.JsonEncodedText.Encode("max_snapshot_bytes_per_sec"); - private static readonly System.Text.Json.JsonEncodedText PropReadOnly = System.Text.Json.JsonEncodedText.Encode("read_only"); - private static readonly System.Text.Json.JsonEncodedText PropReadOnly1 = System.Text.Json.JsonEncodedText.Encode("readonly"); - - public override Elastic.Clients.Elasticsearch.Snapshot.SourceOnlyRepositorySettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChunkSize = default; - LocalJsonValue propCompress = default; - LocalJsonValue propDelegateType = default; - LocalJsonValue propMaxNumberOfSnapshots = default; - LocalJsonValue propMaxRestoreBytesPerSec = default; - LocalJsonValue propMaxSnapshotBytesPerSec = default; - LocalJsonValue propReadOnly = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChunkSize.TryReadProperty(ref reader, options, PropChunkSize, null)) - { - continue; - } - - if (propCompress.TryReadProperty(ref reader, options, PropCompress, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDelegateType.TryReadProperty(ref reader, options, PropDelegateType, null)) - { - continue; - } - - if (propMaxNumberOfSnapshots.TryReadProperty(ref reader, options, PropMaxNumberOfSnapshots, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxRestoreBytesPerSec.TryReadProperty(ref reader, options, PropMaxRestoreBytesPerSec, null)) - { - continue; - } - - if (propMaxSnapshotBytesPerSec.TryReadProperty(ref reader, options, PropMaxSnapshotBytesPerSec, null)) - { - continue; - } - - if (propReadOnly.TryReadProperty(ref reader, options, PropReadOnly, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o)) || propReadOnly.TryReadProperty(ref reader, options, PropReadOnly1, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.SourceOnlyRepositorySettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChunkSize = propChunkSize.Value, - Compress = propCompress.Value, - DelegateType = propDelegateType.Value, - MaxNumberOfSnapshots = propMaxNumberOfSnapshots.Value, - MaxRestoreBytesPerSec = propMaxRestoreBytesPerSec.Value, - MaxSnapshotBytesPerSec = propMaxSnapshotBytesPerSec.Value, - ReadOnly = propReadOnly.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SourceOnlyRepositorySettings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChunkSize, value.ChunkSize, null, null); - writer.WriteProperty(options, PropCompress, value.Compress, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDelegateType, value.DelegateType, null, null); - writer.WriteProperty(options, PropMaxNumberOfSnapshots, value.MaxNumberOfSnapshots, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxRestoreBytesPerSec, value.MaxRestoreBytesPerSec, null, null); - writer.WriteProperty(options, PropMaxSnapshotBytesPerSec, value.MaxSnapshotBytesPerSec, null, null); - writer.WriteProperty(options, PropReadOnly, value.ReadOnly, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.SourceOnlyRepositorySettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.SourceOnlyRepositorySettingsConverter))] public sealed partial class SourceOnlyRepositorySettings { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Status.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Status.Converters.g.cs new file mode 100644 index 00000000000..d6c64e2aec8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Status.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class StatusConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIncludeGlobalState = System.Text.Json.JsonEncodedText.Encode("include_global_state"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropRepository = System.Text.Json.JsonEncodedText.Encode("repository"); + private static readonly System.Text.Json.JsonEncodedText PropShardsStats = System.Text.Json.JsonEncodedText.Encode("shards_stats"); + private static readonly System.Text.Json.JsonEncodedText PropSnapshot = System.Text.Json.JsonEncodedText.Encode("snapshot"); + private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); + private static readonly System.Text.Json.JsonEncodedText PropStats = System.Text.Json.JsonEncodedText.Encode("stats"); + private static readonly System.Text.Json.JsonEncodedText PropUuid = System.Text.Json.JsonEncodedText.Encode("uuid"); + + public override Elastic.Clients.Elasticsearch.Snapshot.Status Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIncludeGlobalState = default; + LocalJsonValue> propIndices = default; + LocalJsonValue propRepository = default; + LocalJsonValue propShardsStats = default; + LocalJsonValue propSnapshot = default; + LocalJsonValue propState = default; + LocalJsonValue propStats = default; + LocalJsonValue propUuid = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIncludeGlobalState.TryReadProperty(ref reader, options, PropIncludeGlobalState, null)) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propRepository.TryReadProperty(ref reader, options, PropRepository, null)) + { + continue; + } + + if (propShardsStats.TryReadProperty(ref reader, options, PropShardsStats, null)) + { + continue; + } + + if (propSnapshot.TryReadProperty(ref reader, options, PropSnapshot, null)) + { + continue; + } + + if (propState.TryReadProperty(ref reader, options, PropState, null)) + { + continue; + } + + if (propStats.TryReadProperty(ref reader, options, PropStats, null)) + { + continue; + } + + if (propUuid.TryReadProperty(ref reader, options, PropUuid, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.Status(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + IncludeGlobalState = propIncludeGlobalState.Value, + Indices = propIndices.Value, + Repository = propRepository.Value, + ShardsStats = propShardsStats.Value, + Snapshot = propSnapshot.Value, + State = propState.Value, + Stats = propStats.Value, + Uuid = propUuid.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.Status value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIncludeGlobalState, value.IncludeGlobalState, null, null); + writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropRepository, value.Repository, null, null); + writer.WriteProperty(options, PropShardsStats, value.ShardsStats, null, null); + writer.WriteProperty(options, PropSnapshot, value.Snapshot, null, null); + writer.WriteProperty(options, PropState, value.State, null, null); + writer.WriteProperty(options, PropStats, value.Stats, null, null); + writer.WriteProperty(options, PropUuid, value.Uuid, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Status.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Status.g.cs index 8ab6ad5b3ae..f44ec675000 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Status.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/Status.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class StatusConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIncludeGlobalState = System.Text.Json.JsonEncodedText.Encode("include_global_state"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropRepository = System.Text.Json.JsonEncodedText.Encode("repository"); - private static readonly System.Text.Json.JsonEncodedText PropShardsStats = System.Text.Json.JsonEncodedText.Encode("shards_stats"); - private static readonly System.Text.Json.JsonEncodedText PropSnapshot = System.Text.Json.JsonEncodedText.Encode("snapshot"); - private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); - private static readonly System.Text.Json.JsonEncodedText PropStats = System.Text.Json.JsonEncodedText.Encode("stats"); - private static readonly System.Text.Json.JsonEncodedText PropUuid = System.Text.Json.JsonEncodedText.Encode("uuid"); - - public override Elastic.Clients.Elasticsearch.Snapshot.Status Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIncludeGlobalState = default; - LocalJsonValue> propIndices = default; - LocalJsonValue propRepository = default; - LocalJsonValue propShardsStats = default; - LocalJsonValue propSnapshot = default; - LocalJsonValue propState = default; - LocalJsonValue propStats = default; - LocalJsonValue propUuid = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIncludeGlobalState.TryReadProperty(ref reader, options, PropIncludeGlobalState, null)) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propRepository.TryReadProperty(ref reader, options, PropRepository, null)) - { - continue; - } - - if (propShardsStats.TryReadProperty(ref reader, options, PropShardsStats, null)) - { - continue; - } - - if (propSnapshot.TryReadProperty(ref reader, options, PropSnapshot, null)) - { - continue; - } - - if (propState.TryReadProperty(ref reader, options, PropState, null)) - { - continue; - } - - if (propStats.TryReadProperty(ref reader, options, PropStats, null)) - { - continue; - } - - if (propUuid.TryReadProperty(ref reader, options, PropUuid, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.Status(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - IncludeGlobalState = propIncludeGlobalState.Value, - Indices = propIndices.Value, - Repository = propRepository.Value, - ShardsStats = propShardsStats.Value, - Snapshot = propSnapshot.Value, - State = propState.Value, - Stats = propStats.Value, - Uuid = propUuid.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.Status value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIncludeGlobalState, value.IncludeGlobalState, null, null); - writer.WriteProperty(options, PropIndices, value.Indices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropRepository, value.Repository, null, null); - writer.WriteProperty(options, PropShardsStats, value.ShardsStats, null, null); - writer.WriteProperty(options, PropSnapshot, value.Snapshot, null, null); - writer.WriteProperty(options, PropState, value.State, null, null); - writer.WriteProperty(options, PropStats, value.Stats, null, null); - writer.WriteProperty(options, PropUuid, value.Uuid, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.StatusConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.StatusConverter))] public sealed partial class Status { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SummaryInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SummaryInfo.Converters.g.cs new file mode 100644 index 00000000000..115f6ba7b73 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SummaryInfo.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class SummaryInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRead = System.Text.Json.JsonEncodedText.Encode("read"); + private static readonly System.Text.Json.JsonEncodedText PropWrite = System.Text.Json.JsonEncodedText.Encode("write"); + + public override Elastic.Clients.Elasticsearch.Snapshot.SummaryInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propRead = default; + LocalJsonValue propWrite = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRead.TryReadProperty(ref reader, options, PropRead, null)) + { + continue; + } + + if (propWrite.TryReadProperty(ref reader, options, PropWrite, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.SummaryInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Read = propRead.Value, + Write = propWrite.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SummaryInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRead, value.Read, null, null); + writer.WriteProperty(options, PropWrite, value.Write, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SummaryInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SummaryInfo.g.cs index 92f1c112266..7267ed2f54a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SummaryInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/SummaryInfo.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class SummaryInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropRead = System.Text.Json.JsonEncodedText.Encode("read"); - private static readonly System.Text.Json.JsonEncodedText PropWrite = System.Text.Json.JsonEncodedText.Encode("write"); - - public override Elastic.Clients.Elasticsearch.Snapshot.SummaryInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propRead = default; - LocalJsonValue propWrite = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propRead.TryReadProperty(ref reader, options, PropRead, null)) - { - continue; - } - - if (propWrite.TryReadProperty(ref reader, options, PropWrite, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.SummaryInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Read = propRead.Value, - Write = propWrite.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.SummaryInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropRead, value.Read, null, null); - writer.WriteProperty(options, PropWrite, value.Write, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.SummaryInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.SummaryInfoConverter))] public sealed partial class SummaryInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/WriteSummaryInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/WriteSummaryInfo.Converters.g.cs new file mode 100644 index 00000000000..94c5543b3cf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/WriteSummaryInfo.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Snapshot.Json; + +public sealed partial class WriteSummaryInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropTotalElapsed = System.Text.Json.JsonEncodedText.Encode("total_elapsed"); + private static readonly System.Text.Json.JsonEncodedText PropTotalElapsedNanos = System.Text.Json.JsonEncodedText.Encode("total_elapsed_nanos"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSize = System.Text.Json.JsonEncodedText.Encode("total_size"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSizeBytes = System.Text.Json.JsonEncodedText.Encode("total_size_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTotalThrottled = System.Text.Json.JsonEncodedText.Encode("total_throttled"); + private static readonly System.Text.Json.JsonEncodedText PropTotalThrottledNanos = System.Text.Json.JsonEncodedText.Encode("total_throttled_nanos"); + + public override Elastic.Clients.Elasticsearch.Snapshot.WriteSummaryInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propTotalElapsed = default; + LocalJsonValue propTotalElapsedNanos = default; + LocalJsonValue propTotalSize = default; + LocalJsonValue propTotalSizeBytes = default; + LocalJsonValue propTotalThrottled = default; + LocalJsonValue propTotalThrottledNanos = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propTotalElapsed.TryReadProperty(ref reader, options, PropTotalElapsed, null)) + { + continue; + } + + if (propTotalElapsedNanos.TryReadProperty(ref reader, options, PropTotalElapsedNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) + { + continue; + } + + if (propTotalSize.TryReadProperty(ref reader, options, PropTotalSize, null)) + { + continue; + } + + if (propTotalSizeBytes.TryReadProperty(ref reader, options, PropTotalSizeBytes, null)) + { + continue; + } + + if (propTotalThrottled.TryReadProperty(ref reader, options, PropTotalThrottled, null)) + { + continue; + } + + if (propTotalThrottledNanos.TryReadProperty(ref reader, options, PropTotalThrottledNanos, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Snapshot.WriteSummaryInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + TotalElapsed = propTotalElapsed.Value, + TotalElapsedNanos = propTotalElapsedNanos.Value, + TotalSize = propTotalSize.Value, + TotalSizeBytes = propTotalSizeBytes.Value, + TotalThrottled = propTotalThrottled.Value, + TotalThrottledNanos = propTotalThrottledNanos.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.WriteSummaryInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropTotalElapsed, value.TotalElapsed, null, null); + writer.WriteProperty(options, PropTotalElapsedNanos, value.TotalElapsedNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); + writer.WriteProperty(options, PropTotalSize, value.TotalSize, null, null); + writer.WriteProperty(options, PropTotalSizeBytes, value.TotalSizeBytes, null, null); + writer.WriteProperty(options, PropTotalThrottled, value.TotalThrottled, null, null); + writer.WriteProperty(options, PropTotalThrottledNanos, value.TotalThrottledNanos, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/WriteSummaryInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/WriteSummaryInfo.g.cs index d55f114338c..74caa781c20 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/WriteSummaryInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Snapshot/WriteSummaryInfo.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Snapshot; -internal sealed partial class WriteSummaryInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropTotalElapsed = System.Text.Json.JsonEncodedText.Encode("total_elapsed"); - private static readonly System.Text.Json.JsonEncodedText PropTotalElapsedNanos = System.Text.Json.JsonEncodedText.Encode("total_elapsed_nanos"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSize = System.Text.Json.JsonEncodedText.Encode("total_size"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSizeBytes = System.Text.Json.JsonEncodedText.Encode("total_size_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTotalThrottled = System.Text.Json.JsonEncodedText.Encode("total_throttled"); - private static readonly System.Text.Json.JsonEncodedText PropTotalThrottledNanos = System.Text.Json.JsonEncodedText.Encode("total_throttled_nanos"); - - public override Elastic.Clients.Elasticsearch.Snapshot.WriteSummaryInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propTotalElapsed = default; - LocalJsonValue propTotalElapsedNanos = default; - LocalJsonValue propTotalSize = default; - LocalJsonValue propTotalSizeBytes = default; - LocalJsonValue propTotalThrottled = default; - LocalJsonValue propTotalThrottledNanos = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propTotalElapsed.TryReadProperty(ref reader, options, PropTotalElapsed, null)) - { - continue; - } - - if (propTotalElapsedNanos.TryReadProperty(ref reader, options, PropTotalElapsedNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) - { - continue; - } - - if (propTotalSize.TryReadProperty(ref reader, options, PropTotalSize, null)) - { - continue; - } - - if (propTotalSizeBytes.TryReadProperty(ref reader, options, PropTotalSizeBytes, null)) - { - continue; - } - - if (propTotalThrottled.TryReadProperty(ref reader, options, PropTotalThrottled, null)) - { - continue; - } - - if (propTotalThrottledNanos.TryReadProperty(ref reader, options, PropTotalThrottledNanos, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Snapshot.WriteSummaryInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - TotalElapsed = propTotalElapsed.Value, - TotalElapsedNanos = propTotalElapsedNanos.Value, - TotalSize = propTotalSize.Value, - TotalSizeBytes = propTotalSizeBytes.Value, - TotalThrottled = propTotalThrottled.Value, - TotalThrottledNanos = propTotalThrottledNanos.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Snapshot.WriteSummaryInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropTotalElapsed, value.TotalElapsed, null, null); - writer.WriteProperty(options, PropTotalElapsedNanos, value.TotalElapsedNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); - writer.WriteProperty(options, PropTotalSize, value.TotalSize, null, null); - writer.WriteProperty(options, PropTotalSizeBytes, value.TotalSizeBytes, null, null); - writer.WriteProperty(options, PropTotalThrottled, value.TotalThrottled, null, null); - writer.WriteProperty(options, PropTotalThrottledNanos, value.TotalThrottledNanos, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.WriteSummaryInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Snapshot.Json.WriteSummaryInfoConverter))] public sealed partial class WriteSummaryInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/InProgress.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/InProgress.Converters.g.cs new file mode 100644 index 00000000000..4ab22d2918b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/InProgress.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json; + +public sealed partial class InProgressConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropStartTimeMillis = System.Text.Json.JsonEncodedText.Encode("start_time_millis"); + private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); + private static readonly System.Text.Json.JsonEncodedText PropUuid = System.Text.Json.JsonEncodedText.Encode("uuid"); + + public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.InProgress Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + LocalJsonValue propStartTimeMillis = default; + LocalJsonValue propState = default; + LocalJsonValue propUuid = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propStartTimeMillis.TryReadProperty(ref reader, options, PropStartTimeMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propState.TryReadProperty(ref reader, options, PropState, null)) + { + continue; + } + + if (propUuid.TryReadProperty(ref reader, options, PropUuid, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.InProgress(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value, + StartTimeMillis = propStartTimeMillis.Value, + State = propState.Value, + Uuid = propUuid.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.InProgress value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropStartTimeMillis, value.StartTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropState, value.State, null, null); + writer.WriteProperty(options, PropUuid, value.Uuid, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/InProgress.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/InProgress.g.cs index d5b2141ac96..b110df68f3c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/InProgress.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/InProgress.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; -internal sealed partial class InProgressConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropStartTimeMillis = System.Text.Json.JsonEncodedText.Encode("start_time_millis"); - private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); - private static readonly System.Text.Json.JsonEncodedText PropUuid = System.Text.Json.JsonEncodedText.Encode("uuid"); - - public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.InProgress Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - LocalJsonValue propStartTimeMillis = default; - LocalJsonValue propState = default; - LocalJsonValue propUuid = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propStartTimeMillis.TryReadProperty(ref reader, options, PropStartTimeMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propState.TryReadProperty(ref reader, options, PropState, null)) - { - continue; - } - - if (propUuid.TryReadProperty(ref reader, options, PropUuid, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.InProgress(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value, - StartTimeMillis = propStartTimeMillis.Value, - State = propState.Value, - Uuid = propUuid.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.InProgress value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropStartTimeMillis, value.StartTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropState, value.State, null, null); - writer.WriteProperty(options, PropUuid, value.Uuid, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.InProgressConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json.InProgressConverter))] public sealed partial class InProgress { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Invocation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Invocation.Converters.g.cs new file mode 100644 index 00000000000..b360cf83389 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Invocation.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json; + +public sealed partial class InvocationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSnapshotName = System.Text.Json.JsonEncodedText.Encode("snapshot_name"); + private static readonly System.Text.Json.JsonEncodedText PropTime = System.Text.Json.JsonEncodedText.Encode("time"); + + public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Invocation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propSnapshotName = default; + LocalJsonValue propTime = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSnapshotName.TryReadProperty(ref reader, options, PropSnapshotName, null)) + { + continue; + } + + if (propTime.TryReadProperty(ref reader, options, PropTime, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Invocation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + SnapshotName = propSnapshotName.Value, + Time = propTime.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Invocation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSnapshotName, value.SnapshotName, null, null); + writer.WriteProperty(options, PropTime, value.Time, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Invocation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Invocation.g.cs index 82c98e90fc6..777c5356e0e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Invocation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Invocation.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; -internal sealed partial class InvocationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSnapshotName = System.Text.Json.JsonEncodedText.Encode("snapshot_name"); - private static readonly System.Text.Json.JsonEncodedText PropTime = System.Text.Json.JsonEncodedText.Encode("time"); - - public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Invocation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propSnapshotName = default; - LocalJsonValue propTime = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSnapshotName.TryReadProperty(ref reader, options, PropSnapshotName, null)) - { - continue; - } - - if (propTime.TryReadProperty(ref reader, options, PropTime, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Invocation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - SnapshotName = propSnapshotName.Value, - Time = propTime.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Invocation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSnapshotName, value.SnapshotName, null, null); - writer.WriteProperty(options, PropTime, value.Time, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.InvocationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json.InvocationConverter))] public sealed partial class Invocation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Retention.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Retention.Converters.g.cs new file mode 100644 index 00000000000..1e6e2bc1552 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Retention.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json; + +public sealed partial class RetentionConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExpireAfter = System.Text.Json.JsonEncodedText.Encode("expire_after"); + private static readonly System.Text.Json.JsonEncodedText PropMaxCount = System.Text.Json.JsonEncodedText.Encode("max_count"); + private static readonly System.Text.Json.JsonEncodedText PropMinCount = System.Text.Json.JsonEncodedText.Encode("min_count"); + + public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Retention Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExpireAfter = default; + LocalJsonValue propMaxCount = default; + LocalJsonValue propMinCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExpireAfter.TryReadProperty(ref reader, options, PropExpireAfter, null)) + { + continue; + } + + if (propMaxCount.TryReadProperty(ref reader, options, PropMaxCount, null)) + { + continue; + } + + if (propMinCount.TryReadProperty(ref reader, options, PropMinCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Retention(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ExpireAfter = propExpireAfter.Value, + MaxCount = propMaxCount.Value, + MinCount = propMinCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Retention value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExpireAfter, value.ExpireAfter, null, null); + writer.WriteProperty(options, PropMaxCount, value.MaxCount, null, null); + writer.WriteProperty(options, PropMinCount, value.MinCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Retention.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Retention.g.cs index 7cde765e56c..c4f7c814e4b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Retention.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Retention.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; -internal sealed partial class RetentionConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExpireAfter = System.Text.Json.JsonEncodedText.Encode("expire_after"); - private static readonly System.Text.Json.JsonEncodedText PropMaxCount = System.Text.Json.JsonEncodedText.Encode("max_count"); - private static readonly System.Text.Json.JsonEncodedText PropMinCount = System.Text.Json.JsonEncodedText.Encode("min_count"); - - public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Retention Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propExpireAfter = default; - LocalJsonValue propMaxCount = default; - LocalJsonValue propMinCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExpireAfter.TryReadProperty(ref reader, options, PropExpireAfter, null)) - { - continue; - } - - if (propMaxCount.TryReadProperty(ref reader, options, PropMaxCount, null)) - { - continue; - } - - if (propMinCount.TryReadProperty(ref reader, options, PropMinCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Retention(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ExpireAfter = propExpireAfter.Value, - MaxCount = propMaxCount.Value, - MinCount = propMinCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Retention value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExpireAfter, value.ExpireAfter, null, null); - writer.WriteProperty(options, PropMaxCount, value.MaxCount, null, null); - writer.WriteProperty(options, PropMinCount, value.MinCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.RetentionConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json.RetentionConverter))] public sealed partial class Retention { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SlmConfiguration.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SlmConfiguration.Converters.g.cs new file mode 100644 index 00000000000..73e06999d50 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SlmConfiguration.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json; + +public sealed partial class SlmConfigurationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFeatureStates = System.Text.Json.JsonEncodedText.Encode("feature_states"); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnavailable = System.Text.Json.JsonEncodedText.Encode("ignore_unavailable"); + private static readonly System.Text.Json.JsonEncodedText PropIncludeGlobalState = System.Text.Json.JsonEncodedText.Encode("include_global_state"); + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); + private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); + private static readonly System.Text.Json.JsonEncodedText PropPartial = System.Text.Json.JsonEncodedText.Encode("partial"); + + public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SlmConfiguration Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propFeatureStates = default; + LocalJsonValue propIgnoreUnavailable = default; + LocalJsonValue propIncludeGlobalState = default; + LocalJsonValue propIndices = default; + LocalJsonValue?> propMetadata = default; + LocalJsonValue propPartial = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFeatureStates.TryReadProperty(ref reader, options, PropFeatureStates, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propIgnoreUnavailable.TryReadProperty(ref reader, options, PropIgnoreUnavailable, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIncludeGlobalState.TryReadProperty(ref reader, options, PropIncludeGlobalState, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) + { + continue; + } + + if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propPartial.TryReadProperty(ref reader, options, PropPartial, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SlmConfiguration(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FeatureStates = propFeatureStates.Value, + IgnoreUnavailable = propIgnoreUnavailable.Value, + IncludeGlobalState = propIncludeGlobalState.Value, + Indices = propIndices.Value, + Metadata = propMetadata.Value, + Partial = propPartial.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SlmConfiguration value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFeatureStates, value.FeatureStates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIgnoreUnavailable, value.IgnoreUnavailable, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIncludeGlobalState, value.IncludeGlobalState, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndices, value.Indices, null, null); + writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropPartial, value.Partial, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SlmConfiguration.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SlmConfiguration.g.cs index c7802a7332d..61041e6ef74 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SlmConfiguration.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SlmConfiguration.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; -internal sealed partial class SlmConfigurationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFeatureStates = System.Text.Json.JsonEncodedText.Encode("feature_states"); - private static readonly System.Text.Json.JsonEncodedText PropIgnoreUnavailable = System.Text.Json.JsonEncodedText.Encode("ignore_unavailable"); - private static readonly System.Text.Json.JsonEncodedText PropIncludeGlobalState = System.Text.Json.JsonEncodedText.Encode("include_global_state"); - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); - private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); - private static readonly System.Text.Json.JsonEncodedText PropPartial = System.Text.Json.JsonEncodedText.Encode("partial"); - - public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SlmConfiguration Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propFeatureStates = default; - LocalJsonValue propIgnoreUnavailable = default; - LocalJsonValue propIncludeGlobalState = default; - LocalJsonValue propIndices = default; - LocalJsonValue?> propMetadata = default; - LocalJsonValue propPartial = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFeatureStates.TryReadProperty(ref reader, options, PropFeatureStates, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propIgnoreUnavailable.TryReadProperty(ref reader, options, PropIgnoreUnavailable, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIncludeGlobalState.TryReadProperty(ref reader, options, PropIncludeGlobalState, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) - { - continue; - } - - if (propMetadata.TryReadProperty(ref reader, options, PropMetadata, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propPartial.TryReadProperty(ref reader, options, PropPartial, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SlmConfiguration(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - FeatureStates = propFeatureStates.Value, - IgnoreUnavailable = propIgnoreUnavailable.Value, - IncludeGlobalState = propIncludeGlobalState.Value, - Indices = propIndices.Value, - Metadata = propMetadata.Value, - Partial = propPartial.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SlmConfiguration value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFeatureStates, value.FeatureStates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIgnoreUnavailable, value.IgnoreUnavailable, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIncludeGlobalState, value.IncludeGlobalState, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndices, value.Indices, null, null); - writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropPartial, value.Partial, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SlmConfigurationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json.SlmConfigurationConverter))] public sealed partial class SlmConfiguration { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SlmPolicy.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SlmPolicy.Converters.g.cs new file mode 100644 index 00000000000..ace76d7412c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SlmPolicy.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json; + +public sealed partial class SlmPolicyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropConfig = System.Text.Json.JsonEncodedText.Encode("config"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropRepository = System.Text.Json.JsonEncodedText.Encode("repository"); + private static readonly System.Text.Json.JsonEncodedText PropRetention = System.Text.Json.JsonEncodedText.Encode("retention"); + private static readonly System.Text.Json.JsonEncodedText PropSchedule = System.Text.Json.JsonEncodedText.Encode("schedule"); + + public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SlmPolicy Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propConfig = default; + LocalJsonValue propName = default; + LocalJsonValue propRepository = default; + LocalJsonValue propRetention = default; + LocalJsonValue propSchedule = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propConfig.TryReadProperty(ref reader, options, PropConfig, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propRepository.TryReadProperty(ref reader, options, PropRepository, null)) + { + continue; + } + + if (propRetention.TryReadProperty(ref reader, options, PropRetention, null)) + { + continue; + } + + if (propSchedule.TryReadProperty(ref reader, options, PropSchedule, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SlmPolicy(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Config = propConfig.Value, + Name = propName.Value, + Repository = propRepository.Value, + Retention = propRetention.Value, + Schedule = propSchedule.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SlmPolicy value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropConfig, value.Config, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropRepository, value.Repository, null, null); + writer.WriteProperty(options, PropRetention, value.Retention, null, null); + writer.WriteProperty(options, PropSchedule, value.Schedule, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SlmPolicy.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SlmPolicy.g.cs index bb43d0962c7..87dddedf801 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SlmPolicy.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SlmPolicy.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; -internal sealed partial class SlmPolicyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropConfig = System.Text.Json.JsonEncodedText.Encode("config"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropRepository = System.Text.Json.JsonEncodedText.Encode("repository"); - private static readonly System.Text.Json.JsonEncodedText PropRetention = System.Text.Json.JsonEncodedText.Encode("retention"); - private static readonly System.Text.Json.JsonEncodedText PropSchedule = System.Text.Json.JsonEncodedText.Encode("schedule"); - - public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SlmPolicy Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propConfig = default; - LocalJsonValue propName = default; - LocalJsonValue propRepository = default; - LocalJsonValue propRetention = default; - LocalJsonValue propSchedule = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propConfig.TryReadProperty(ref reader, options, PropConfig, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propRepository.TryReadProperty(ref reader, options, PropRepository, null)) - { - continue; - } - - if (propRetention.TryReadProperty(ref reader, options, PropRetention, null)) - { - continue; - } - - if (propSchedule.TryReadProperty(ref reader, options, PropSchedule, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SlmPolicy(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Config = propConfig.Value, - Name = propName.Value, - Repository = propRepository.Value, - Retention = propRetention.Value, - Schedule = propSchedule.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SlmPolicy value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropConfig, value.Config, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropRepository, value.Repository, null, null); - writer.WriteProperty(options, PropRetention, value.Retention, null, null); - writer.WriteProperty(options, PropSchedule, value.Schedule, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SlmPolicyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json.SlmPolicyConverter))] public sealed partial class SlmPolicy { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SnapshotLifecycle.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SnapshotLifecycle.Converters.g.cs new file mode 100644 index 00000000000..2e9c660cb9a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SnapshotLifecycle.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json; + +public sealed partial class SnapshotLifecycleConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropInProgress = System.Text.Json.JsonEncodedText.Encode("in_progress"); + private static readonly System.Text.Json.JsonEncodedText PropLastFailure = System.Text.Json.JsonEncodedText.Encode("last_failure"); + private static readonly System.Text.Json.JsonEncodedText PropLastSuccess = System.Text.Json.JsonEncodedText.Encode("last_success"); + private static readonly System.Text.Json.JsonEncodedText PropModifiedDate = System.Text.Json.JsonEncodedText.Encode("modified_date"); + private static readonly System.Text.Json.JsonEncodedText PropModifiedDateMillis = System.Text.Json.JsonEncodedText.Encode("modified_date_millis"); + private static readonly System.Text.Json.JsonEncodedText PropNextExecution = System.Text.Json.JsonEncodedText.Encode("next_execution"); + private static readonly System.Text.Json.JsonEncodedText PropNextExecutionMillis = System.Text.Json.JsonEncodedText.Encode("next_execution_millis"); + private static readonly System.Text.Json.JsonEncodedText PropPolicy = System.Text.Json.JsonEncodedText.Encode("policy"); + private static readonly System.Text.Json.JsonEncodedText PropStats = System.Text.Json.JsonEncodedText.Encode("stats"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SnapshotLifecycle Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propInProgress = default; + LocalJsonValue propLastFailure = default; + LocalJsonValue propLastSuccess = default; + LocalJsonValue propModifiedDate = default; + LocalJsonValue propModifiedDateMillis = default; + LocalJsonValue propNextExecution = default; + LocalJsonValue propNextExecutionMillis = default; + LocalJsonValue propPolicy = default; + LocalJsonValue propStats = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propInProgress.TryReadProperty(ref reader, options, PropInProgress, null)) + { + continue; + } + + if (propLastFailure.TryReadProperty(ref reader, options, PropLastFailure, null)) + { + continue; + } + + if (propLastSuccess.TryReadProperty(ref reader, options, PropLastSuccess, null)) + { + continue; + } + + if (propModifiedDate.TryReadProperty(ref reader, options, PropModifiedDate, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propModifiedDateMillis.TryReadProperty(ref reader, options, PropModifiedDateMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propNextExecution.TryReadProperty(ref reader, options, PropNextExecution, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propNextExecutionMillis.TryReadProperty(ref reader, options, PropNextExecutionMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propPolicy.TryReadProperty(ref reader, options, PropPolicy, null)) + { + continue; + } + + if (propStats.TryReadProperty(ref reader, options, PropStats, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SnapshotLifecycle(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + InProgress = propInProgress.Value, + LastFailure = propLastFailure.Value, + LastSuccess = propLastSuccess.Value, + ModifiedDate = propModifiedDate.Value, + ModifiedDateMillis = propModifiedDateMillis.Value, + NextExecution = propNextExecution.Value, + NextExecutionMillis = propNextExecutionMillis.Value, + Policy = propPolicy.Value, + Stats = propStats.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SnapshotLifecycle value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropInProgress, value.InProgress, null, null); + writer.WriteProperty(options, PropLastFailure, value.LastFailure, null, null); + writer.WriteProperty(options, PropLastSuccess, value.LastSuccess, null, null); + writer.WriteProperty(options, PropModifiedDate, value.ModifiedDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropModifiedDateMillis, value.ModifiedDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropNextExecution, value.NextExecution, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropNextExecutionMillis, value.NextExecutionMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropPolicy, value.Policy, null, null); + writer.WriteProperty(options, PropStats, value.Stats, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SnapshotLifecycle.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SnapshotLifecycle.g.cs index 8d8c6982e2f..aec78a47b4b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SnapshotLifecycle.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SnapshotLifecycle.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; -internal sealed partial class SnapshotLifecycleConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropInProgress = System.Text.Json.JsonEncodedText.Encode("in_progress"); - private static readonly System.Text.Json.JsonEncodedText PropLastFailure = System.Text.Json.JsonEncodedText.Encode("last_failure"); - private static readonly System.Text.Json.JsonEncodedText PropLastSuccess = System.Text.Json.JsonEncodedText.Encode("last_success"); - private static readonly System.Text.Json.JsonEncodedText PropModifiedDate = System.Text.Json.JsonEncodedText.Encode("modified_date"); - private static readonly System.Text.Json.JsonEncodedText PropModifiedDateMillis = System.Text.Json.JsonEncodedText.Encode("modified_date_millis"); - private static readonly System.Text.Json.JsonEncodedText PropNextExecution = System.Text.Json.JsonEncodedText.Encode("next_execution"); - private static readonly System.Text.Json.JsonEncodedText PropNextExecutionMillis = System.Text.Json.JsonEncodedText.Encode("next_execution_millis"); - private static readonly System.Text.Json.JsonEncodedText PropPolicy = System.Text.Json.JsonEncodedText.Encode("policy"); - private static readonly System.Text.Json.JsonEncodedText PropStats = System.Text.Json.JsonEncodedText.Encode("stats"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SnapshotLifecycle Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propInProgress = default; - LocalJsonValue propLastFailure = default; - LocalJsonValue propLastSuccess = default; - LocalJsonValue propModifiedDate = default; - LocalJsonValue propModifiedDateMillis = default; - LocalJsonValue propNextExecution = default; - LocalJsonValue propNextExecutionMillis = default; - LocalJsonValue propPolicy = default; - LocalJsonValue propStats = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propInProgress.TryReadProperty(ref reader, options, PropInProgress, null)) - { - continue; - } - - if (propLastFailure.TryReadProperty(ref reader, options, PropLastFailure, null)) - { - continue; - } - - if (propLastSuccess.TryReadProperty(ref reader, options, PropLastSuccess, null)) - { - continue; - } - - if (propModifiedDate.TryReadProperty(ref reader, options, PropModifiedDate, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propModifiedDateMillis.TryReadProperty(ref reader, options, PropModifiedDateMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propNextExecution.TryReadProperty(ref reader, options, PropNextExecution, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propNextExecutionMillis.TryReadProperty(ref reader, options, PropNextExecutionMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propPolicy.TryReadProperty(ref reader, options, PropPolicy, null)) - { - continue; - } - - if (propStats.TryReadProperty(ref reader, options, PropStats, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SnapshotLifecycle(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - InProgress = propInProgress.Value, - LastFailure = propLastFailure.Value, - LastSuccess = propLastSuccess.Value, - ModifiedDate = propModifiedDate.Value, - ModifiedDateMillis = propModifiedDateMillis.Value, - NextExecution = propNextExecution.Value, - NextExecutionMillis = propNextExecutionMillis.Value, - Policy = propPolicy.Value, - Stats = propStats.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SnapshotLifecycle value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropInProgress, value.InProgress, null, null); - writer.WriteProperty(options, PropLastFailure, value.LastFailure, null, null); - writer.WriteProperty(options, PropLastSuccess, value.LastSuccess, null, null); - writer.WriteProperty(options, PropModifiedDate, value.ModifiedDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropModifiedDateMillis, value.ModifiedDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropNextExecution, value.NextExecution, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropNextExecutionMillis, value.NextExecutionMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropPolicy, value.Policy, null, null); - writer.WriteProperty(options, PropStats, value.Stats, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SnapshotLifecycleConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json.SnapshotLifecycleConverter))] public sealed partial class SnapshotLifecycle { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SnapshotPolicyStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SnapshotPolicyStats.Converters.g.cs new file mode 100644 index 00000000000..9f0c73a6505 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SnapshotPolicyStats.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json; + +public sealed partial class SnapshotPolicyStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPolicy = System.Text.Json.JsonEncodedText.Encode("policy"); + private static readonly System.Text.Json.JsonEncodedText PropSnapshotDeletionFailures = System.Text.Json.JsonEncodedText.Encode("snapshot_deletion_failures"); + private static readonly System.Text.Json.JsonEncodedText PropSnapshotsDeleted = System.Text.Json.JsonEncodedText.Encode("snapshots_deleted"); + private static readonly System.Text.Json.JsonEncodedText PropSnapshotsFailed = System.Text.Json.JsonEncodedText.Encode("snapshots_failed"); + private static readonly System.Text.Json.JsonEncodedText PropSnapshotsTaken = System.Text.Json.JsonEncodedText.Encode("snapshots_taken"); + + public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SnapshotPolicyStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPolicy = default; + LocalJsonValue propSnapshotDeletionFailures = default; + LocalJsonValue propSnapshotsDeleted = default; + LocalJsonValue propSnapshotsFailed = default; + LocalJsonValue propSnapshotsTaken = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPolicy.TryReadProperty(ref reader, options, PropPolicy, null)) + { + continue; + } + + if (propSnapshotDeletionFailures.TryReadProperty(ref reader, options, PropSnapshotDeletionFailures, null)) + { + continue; + } + + if (propSnapshotsDeleted.TryReadProperty(ref reader, options, PropSnapshotsDeleted, null)) + { + continue; + } + + if (propSnapshotsFailed.TryReadProperty(ref reader, options, PropSnapshotsFailed, null)) + { + continue; + } + + if (propSnapshotsTaken.TryReadProperty(ref reader, options, PropSnapshotsTaken, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SnapshotPolicyStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Policy = propPolicy.Value, + SnapshotDeletionFailures = propSnapshotDeletionFailures.Value, + SnapshotsDeleted = propSnapshotsDeleted.Value, + SnapshotsFailed = propSnapshotsFailed.Value, + SnapshotsTaken = propSnapshotsTaken.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SnapshotPolicyStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPolicy, value.Policy, null, null); + writer.WriteProperty(options, PropSnapshotDeletionFailures, value.SnapshotDeletionFailures, null, null); + writer.WriteProperty(options, PropSnapshotsDeleted, value.SnapshotsDeleted, null, null); + writer.WriteProperty(options, PropSnapshotsFailed, value.SnapshotsFailed, null, null); + writer.WriteProperty(options, PropSnapshotsTaken, value.SnapshotsTaken, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SnapshotPolicyStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SnapshotPolicyStats.g.cs index e0f931fce93..330dbfd6308 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SnapshotPolicyStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/SnapshotPolicyStats.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; -internal sealed partial class SnapshotPolicyStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPolicy = System.Text.Json.JsonEncodedText.Encode("policy"); - private static readonly System.Text.Json.JsonEncodedText PropSnapshotDeletionFailures = System.Text.Json.JsonEncodedText.Encode("snapshot_deletion_failures"); - private static readonly System.Text.Json.JsonEncodedText PropSnapshotsDeleted = System.Text.Json.JsonEncodedText.Encode("snapshots_deleted"); - private static readonly System.Text.Json.JsonEncodedText PropSnapshotsFailed = System.Text.Json.JsonEncodedText.Encode("snapshots_failed"); - private static readonly System.Text.Json.JsonEncodedText PropSnapshotsTaken = System.Text.Json.JsonEncodedText.Encode("snapshots_taken"); - - public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SnapshotPolicyStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPolicy = default; - LocalJsonValue propSnapshotDeletionFailures = default; - LocalJsonValue propSnapshotsDeleted = default; - LocalJsonValue propSnapshotsFailed = default; - LocalJsonValue propSnapshotsTaken = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPolicy.TryReadProperty(ref reader, options, PropPolicy, null)) - { - continue; - } - - if (propSnapshotDeletionFailures.TryReadProperty(ref reader, options, PropSnapshotDeletionFailures, null)) - { - continue; - } - - if (propSnapshotsDeleted.TryReadProperty(ref reader, options, PropSnapshotsDeleted, null)) - { - continue; - } - - if (propSnapshotsFailed.TryReadProperty(ref reader, options, PropSnapshotsFailed, null)) - { - continue; - } - - if (propSnapshotsTaken.TryReadProperty(ref reader, options, PropSnapshotsTaken, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SnapshotPolicyStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Policy = propPolicy.Value, - SnapshotDeletionFailures = propSnapshotDeletionFailures.Value, - SnapshotsDeleted = propSnapshotsDeleted.Value, - SnapshotsFailed = propSnapshotsFailed.Value, - SnapshotsTaken = propSnapshotsTaken.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SnapshotPolicyStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPolicy, value.Policy, null, null); - writer.WriteProperty(options, PropSnapshotDeletionFailures, value.SnapshotDeletionFailures, null, null); - writer.WriteProperty(options, PropSnapshotsDeleted, value.SnapshotsDeleted, null, null); - writer.WriteProperty(options, PropSnapshotsFailed, value.SnapshotsFailed, null, null); - writer.WriteProperty(options, PropSnapshotsTaken, value.SnapshotsTaken, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.SnapshotPolicyStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json.SnapshotPolicyStatsConverter))] public sealed partial class SnapshotPolicyStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Statistics.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Statistics.Converters.g.cs new file mode 100644 index 00000000000..78e5c18ab75 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Statistics.Converters.g.cs @@ -0,0 +1,148 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json; + +public sealed partial class StatisticsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPolicy = System.Text.Json.JsonEncodedText.Encode("policy"); + private static readonly System.Text.Json.JsonEncodedText PropRetentionDeletionTime = System.Text.Json.JsonEncodedText.Encode("retention_deletion_time"); + private static readonly System.Text.Json.JsonEncodedText PropRetentionDeletionTimeMillis = System.Text.Json.JsonEncodedText.Encode("retention_deletion_time_millis"); + private static readonly System.Text.Json.JsonEncodedText PropRetentionFailed = System.Text.Json.JsonEncodedText.Encode("retention_failed"); + private static readonly System.Text.Json.JsonEncodedText PropRetentionRuns = System.Text.Json.JsonEncodedText.Encode("retention_runs"); + private static readonly System.Text.Json.JsonEncodedText PropRetentionTimedOut = System.Text.Json.JsonEncodedText.Encode("retention_timed_out"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSnapshotDeletionFailures = System.Text.Json.JsonEncodedText.Encode("total_snapshot_deletion_failures"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSnapshotDeletionFailures1 = System.Text.Json.JsonEncodedText.Encode("snapshot_deletion_failures"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSnapshotsDeleted = System.Text.Json.JsonEncodedText.Encode("total_snapshots_deleted"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSnapshotsDeleted1 = System.Text.Json.JsonEncodedText.Encode("snapshots_deleted"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSnapshotsFailed = System.Text.Json.JsonEncodedText.Encode("total_snapshots_failed"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSnapshotsFailed1 = System.Text.Json.JsonEncodedText.Encode("snapshots_failed"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSnapshotsTaken = System.Text.Json.JsonEncodedText.Encode("total_snapshots_taken"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSnapshotsTaken1 = System.Text.Json.JsonEncodedText.Encode("snapshots_taken"); + + public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Statistics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPolicy = default; + LocalJsonValue propRetentionDeletionTime = default; + LocalJsonValue propRetentionDeletionTimeMillis = default; + LocalJsonValue propRetentionFailed = default; + LocalJsonValue propRetentionRuns = default; + LocalJsonValue propRetentionTimedOut = default; + LocalJsonValue propTotalSnapshotDeletionFailures = default; + LocalJsonValue propTotalSnapshotsDeleted = default; + LocalJsonValue propTotalSnapshotsFailed = default; + LocalJsonValue propTotalSnapshotsTaken = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPolicy.TryReadProperty(ref reader, options, PropPolicy, null)) + { + continue; + } + + if (propRetentionDeletionTime.TryReadProperty(ref reader, options, PropRetentionDeletionTime, null)) + { + continue; + } + + if (propRetentionDeletionTimeMillis.TryReadProperty(ref reader, options, PropRetentionDeletionTimeMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propRetentionFailed.TryReadProperty(ref reader, options, PropRetentionFailed, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRetentionRuns.TryReadProperty(ref reader, options, PropRetentionRuns, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRetentionTimedOut.TryReadProperty(ref reader, options, PropRetentionTimedOut, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotalSnapshotDeletionFailures.TryReadProperty(ref reader, options, PropTotalSnapshotDeletionFailures, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o)) || propTotalSnapshotDeletionFailures.TryReadProperty(ref reader, options, PropTotalSnapshotDeletionFailures1, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotalSnapshotsDeleted.TryReadProperty(ref reader, options, PropTotalSnapshotsDeleted, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o)) || propTotalSnapshotsDeleted.TryReadProperty(ref reader, options, PropTotalSnapshotsDeleted1, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotalSnapshotsFailed.TryReadProperty(ref reader, options, PropTotalSnapshotsFailed, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o)) || propTotalSnapshotsFailed.TryReadProperty(ref reader, options, PropTotalSnapshotsFailed1, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotalSnapshotsTaken.TryReadProperty(ref reader, options, PropTotalSnapshotsTaken, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o)) || propTotalSnapshotsTaken.TryReadProperty(ref reader, options, PropTotalSnapshotsTaken1, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Statistics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Policy = propPolicy.Value, + RetentionDeletionTime = propRetentionDeletionTime.Value, + RetentionDeletionTimeMillis = propRetentionDeletionTimeMillis.Value, + RetentionFailed = propRetentionFailed.Value, + RetentionRuns = propRetentionRuns.Value, + RetentionTimedOut = propRetentionTimedOut.Value, + TotalSnapshotDeletionFailures = propTotalSnapshotDeletionFailures.Value, + TotalSnapshotsDeleted = propTotalSnapshotsDeleted.Value, + TotalSnapshotsFailed = propTotalSnapshotsFailed.Value, + TotalSnapshotsTaken = propTotalSnapshotsTaken.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Statistics value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPolicy, value.Policy, null, null); + writer.WriteProperty(options, PropRetentionDeletionTime, value.RetentionDeletionTime, null, null); + writer.WriteProperty(options, PropRetentionDeletionTimeMillis, value.RetentionDeletionTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropRetentionFailed, value.RetentionFailed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRetentionRuns, value.RetentionRuns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRetentionTimedOut, value.RetentionTimedOut, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotalSnapshotDeletionFailures, value.TotalSnapshotDeletionFailures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotalSnapshotsDeleted, value.TotalSnapshotsDeleted, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotalSnapshotsFailed, value.TotalSnapshotsFailed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotalSnapshotsTaken, value.TotalSnapshotsTaken, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Statistics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Statistics.g.cs index f9eb24c1db6..04c5b268555 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Statistics.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SnapshotLifecycleManagement/Statistics.g.cs @@ -23,131 +23,7 @@ namespace Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement; -internal sealed partial class StatisticsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPolicy = System.Text.Json.JsonEncodedText.Encode("policy"); - private static readonly System.Text.Json.JsonEncodedText PropRetentionDeletionTime = System.Text.Json.JsonEncodedText.Encode("retention_deletion_time"); - private static readonly System.Text.Json.JsonEncodedText PropRetentionDeletionTimeMillis = System.Text.Json.JsonEncodedText.Encode("retention_deletion_time_millis"); - private static readonly System.Text.Json.JsonEncodedText PropRetentionFailed = System.Text.Json.JsonEncodedText.Encode("retention_failed"); - private static readonly System.Text.Json.JsonEncodedText PropRetentionRuns = System.Text.Json.JsonEncodedText.Encode("retention_runs"); - private static readonly System.Text.Json.JsonEncodedText PropRetentionTimedOut = System.Text.Json.JsonEncodedText.Encode("retention_timed_out"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSnapshotDeletionFailures = System.Text.Json.JsonEncodedText.Encode("total_snapshot_deletion_failures"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSnapshotDeletionFailures1 = System.Text.Json.JsonEncodedText.Encode("snapshot_deletion_failures"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSnapshotsDeleted = System.Text.Json.JsonEncodedText.Encode("total_snapshots_deleted"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSnapshotsDeleted1 = System.Text.Json.JsonEncodedText.Encode("snapshots_deleted"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSnapshotsFailed = System.Text.Json.JsonEncodedText.Encode("total_snapshots_failed"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSnapshotsFailed1 = System.Text.Json.JsonEncodedText.Encode("snapshots_failed"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSnapshotsTaken = System.Text.Json.JsonEncodedText.Encode("total_snapshots_taken"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSnapshotsTaken1 = System.Text.Json.JsonEncodedText.Encode("snapshots_taken"); - - public override Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Statistics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPolicy = default; - LocalJsonValue propRetentionDeletionTime = default; - LocalJsonValue propRetentionDeletionTimeMillis = default; - LocalJsonValue propRetentionFailed = default; - LocalJsonValue propRetentionRuns = default; - LocalJsonValue propRetentionTimedOut = default; - LocalJsonValue propTotalSnapshotDeletionFailures = default; - LocalJsonValue propTotalSnapshotsDeleted = default; - LocalJsonValue propTotalSnapshotsFailed = default; - LocalJsonValue propTotalSnapshotsTaken = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPolicy.TryReadProperty(ref reader, options, PropPolicy, null)) - { - continue; - } - - if (propRetentionDeletionTime.TryReadProperty(ref reader, options, PropRetentionDeletionTime, null)) - { - continue; - } - - if (propRetentionDeletionTimeMillis.TryReadProperty(ref reader, options, PropRetentionDeletionTimeMillis, static System.TimeSpan? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propRetentionFailed.TryReadProperty(ref reader, options, PropRetentionFailed, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRetentionRuns.TryReadProperty(ref reader, options, PropRetentionRuns, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRetentionTimedOut.TryReadProperty(ref reader, options, PropRetentionTimedOut, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotalSnapshotDeletionFailures.TryReadProperty(ref reader, options, PropTotalSnapshotDeletionFailures, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o)) || propTotalSnapshotDeletionFailures.TryReadProperty(ref reader, options, PropTotalSnapshotDeletionFailures1, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotalSnapshotsDeleted.TryReadProperty(ref reader, options, PropTotalSnapshotsDeleted, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o)) || propTotalSnapshotsDeleted.TryReadProperty(ref reader, options, PropTotalSnapshotsDeleted1, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotalSnapshotsFailed.TryReadProperty(ref reader, options, PropTotalSnapshotsFailed, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o)) || propTotalSnapshotsFailed.TryReadProperty(ref reader, options, PropTotalSnapshotsFailed1, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotalSnapshotsTaken.TryReadProperty(ref reader, options, PropTotalSnapshotsTaken, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o)) || propTotalSnapshotsTaken.TryReadProperty(ref reader, options, PropTotalSnapshotsTaken1, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Statistics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Policy = propPolicy.Value, - RetentionDeletionTime = propRetentionDeletionTime.Value, - RetentionDeletionTimeMillis = propRetentionDeletionTimeMillis.Value, - RetentionFailed = propRetentionFailed.Value, - RetentionRuns = propRetentionRuns.Value, - RetentionTimedOut = propRetentionTimedOut.Value, - TotalSnapshotDeletionFailures = propTotalSnapshotDeletionFailures.Value, - TotalSnapshotsDeleted = propTotalSnapshotsDeleted.Value, - TotalSnapshotsFailed = propTotalSnapshotsFailed.Value, - TotalSnapshotsTaken = propTotalSnapshotsTaken.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Statistics value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPolicy, value.Policy, null, null); - writer.WriteProperty(options, PropRetentionDeletionTime, value.RetentionDeletionTime, null, null); - writer.WriteProperty(options, PropRetentionDeletionTimeMillis, value.RetentionDeletionTimeMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropRetentionFailed, value.RetentionFailed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRetentionRuns, value.RetentionRuns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRetentionTimedOut, value.RetentionTimedOut, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotalSnapshotDeletionFailures, value.TotalSnapshotDeletionFailures, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotalSnapshotsDeleted, value.TotalSnapshotsDeleted, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotalSnapshotsFailed, value.TotalSnapshotsFailed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotalSnapshotsTaken, value.TotalSnapshotsTaken, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.StatisticsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SnapshotLifecycleManagement.Json.StatisticsConverter))] public sealed partial class Statistics { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortMode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortMode.Converters.g.cs new file mode 100644 index 00000000000..815c3563ec7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortMode.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class SortModeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAvg = System.Text.Json.JsonEncodedText.Encode("avg"); + private static readonly System.Text.Json.JsonEncodedText MemberMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText MemberMedian = System.Text.Json.JsonEncodedText.Encode("median"); + private static readonly System.Text.Json.JsonEncodedText MemberMin = System.Text.Json.JsonEncodedText.Encode("min"); + private static readonly System.Text.Json.JsonEncodedText MemberSum = System.Text.Json.JsonEncodedText.Encode("sum"); + + public override Elastic.Clients.Elasticsearch.SortMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAvg)) + { + return Elastic.Clients.Elasticsearch.SortMode.Avg; + } + + if (reader.ValueTextEquals(MemberMax)) + { + return Elastic.Clients.Elasticsearch.SortMode.Max; + } + + if (reader.ValueTextEquals(MemberMedian)) + { + return Elastic.Clients.Elasticsearch.SortMode.Median; + } + + if (reader.ValueTextEquals(MemberMin)) + { + return Elastic.Clients.Elasticsearch.SortMode.Min; + } + + if (reader.ValueTextEquals(MemberSum)) + { + return Elastic.Clients.Elasticsearch.SortMode.Sum; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAvg.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.SortMode.Avg; + } + + if (string.Equals(value, MemberMax.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.SortMode.Max; + } + + if (string.Equals(value, MemberMedian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.SortMode.Median; + } + + if (string.Equals(value, MemberMin.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.SortMode.Min; + } + + if (string.Equals(value, MemberSum.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.SortMode.Sum; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.SortMode)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SortMode value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.SortMode.Avg: + writer.WriteStringValue(MemberAvg); + break; + case Elastic.Clients.Elasticsearch.SortMode.Max: + writer.WriteStringValue(MemberMax); + break; + case Elastic.Clients.Elasticsearch.SortMode.Median: + writer.WriteStringValue(MemberMedian); + break; + case Elastic.Clients.Elasticsearch.SortMode.Min: + writer.WriteStringValue(MemberMin); + break; + case Elastic.Clients.Elasticsearch.SortMode.Sum: + writer.WriteStringValue(MemberSum); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.SortMode)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.SortMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SortMode value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortMode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortMode.g.cs new file mode 100644 index 00000000000..f280713b29a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortMode.g.cs @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.SortModeConverter))] +public enum SortMode +{ + [System.Runtime.Serialization.EnumMember(Value = "avg")] + Avg, + [System.Runtime.Serialization.EnumMember(Value = "max")] + Max, + [System.Runtime.Serialization.EnumMember(Value = "median")] + Median, + [System.Runtime.Serialization.EnumMember(Value = "min")] + Min, + [System.Runtime.Serialization.EnumMember(Value = "sum")] + Sum +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortOptions.Converters.g.cs new file mode 100644 index 00000000000..c10daef56b7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortOptions.Converters.g.cs @@ -0,0 +1,130 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class SortOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantDoc = System.Text.Json.JsonEncodedText.Encode("_doc"); + private static readonly System.Text.Json.JsonEncodedText VariantGeoDistance = System.Text.Json.JsonEncodedText.Encode("_geo_distance"); + private static readonly System.Text.Json.JsonEncodedText VariantScore = System.Text.Json.JsonEncodedText.Encode("_score"); + private static readonly System.Text.Json.JsonEncodedText VariantScript = System.Text.Json.JsonEncodedText.Encode("_script"); + + public override Elastic.Clients.Elasticsearch.SortOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.TokenType is System.Text.Json.JsonTokenType.String) + { + return new Elastic.Clients.Elasticsearch.SortOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = "", + Variant = new Elastic.Clients.Elasticsearch.FieldSort(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = reader.ReadValue(options, null) + } + }; + } + + var readerSnapshot = reader; + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantDoc)) + { + variantType = VariantDoc.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantGeoDistance)) + { + variantType = VariantGeoDistance.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantScore)) + { + variantType = VariantScore.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantScript)) + { + variantType = VariantScript.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + reader = readerSnapshot; + variantType = ""; + variant = reader.ReadValue(options, null); + break; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SortOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SortOptions value, System.Text.Json.JsonSerializerOptions options) + { + if (value.VariantType is "" && value.Variant is not null) + { + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.FieldSort)value.Variant, null); + return; + } + + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "_doc": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.ScoreSort)value.Variant, null, null); + break; + case "_geo_distance": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.GeoDistanceSort)value.Variant, null, null); + break; + case "_score": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.ScoreSort)value.Variant, null, null); + break; + case "_script": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.ScriptSort)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.SortOptions)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortOptions.g.cs index 716ca9f53dc..a0b40581575 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortOptions.g.cs @@ -23,113 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class SortOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantDoc = System.Text.Json.JsonEncodedText.Encode("_doc"); - private static readonly System.Text.Json.JsonEncodedText VariantGeoDistance = System.Text.Json.JsonEncodedText.Encode("_geo_distance"); - private static readonly System.Text.Json.JsonEncodedText VariantScore = System.Text.Json.JsonEncodedText.Encode("_score"); - private static readonly System.Text.Json.JsonEncodedText VariantScript = System.Text.Json.JsonEncodedText.Encode("_script"); - - public override Elastic.Clients.Elasticsearch.SortOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.TokenType is System.Text.Json.JsonTokenType.String) - { - return new Elastic.Clients.Elasticsearch.SortOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = "", - Variant = new Elastic.Clients.Elasticsearch.FieldSort(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = reader.ReadValue(options, null) - } - }; - } - - var readerSnapshot = reader; - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantDoc)) - { - variantType = VariantDoc.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantGeoDistance)) - { - variantType = VariantGeoDistance.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantScore)) - { - variantType = VariantScore.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantScript)) - { - variantType = VariantScript.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - reader = readerSnapshot; - variantType = ""; - variant = reader.ReadValue(options, null); - break; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SortOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SortOptions value, System.Text.Json.JsonSerializerOptions options) - { - if (value.VariantType is "" && value.Variant is not null) - { - writer.WriteValue(options, (Elastic.Clients.Elasticsearch.FieldSort)value.Variant, null); - return; - } - - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "_doc": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.ScoreSort)value.Variant, null, null); - break; - case "_geo_distance": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.GeoDistanceSort)value.Variant, null, null); - break; - case "_score": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.ScoreSort)value.Variant, null, null); - break; - case "_script": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.ScriptSort)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.SortOptions)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SortOptionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.SortOptionsConverter))] public sealed partial class SortOptions { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortOrder.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortOrder.Converters.g.cs new file mode 100644 index 00000000000..7f511045f33 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortOrder.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class SortOrderConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAsc = System.Text.Json.JsonEncodedText.Encode("asc"); + private static readonly System.Text.Json.JsonEncodedText MemberDesc = System.Text.Json.JsonEncodedText.Encode("desc"); + + public override Elastic.Clients.Elasticsearch.SortOrder Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAsc)) + { + return Elastic.Clients.Elasticsearch.SortOrder.Asc; + } + + if (reader.ValueTextEquals(MemberDesc)) + { + return Elastic.Clients.Elasticsearch.SortOrder.Desc; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAsc.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.SortOrder.Asc; + } + + if (string.Equals(value, MemberDesc.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.SortOrder.Desc; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.SortOrder)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SortOrder value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.SortOrder.Asc: + writer.WriteStringValue(MemberAsc); + break; + case Elastic.Clients.Elasticsearch.SortOrder.Desc: + writer.WriteStringValue(MemberDesc); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.SortOrder)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.SortOrder ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SortOrder value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortOrder.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortOrder.g.cs new file mode 100644 index 00000000000..6d11c32d73b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortOrder.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.SortOrderConverter))] +public enum SortOrder +{ + /// + /// + /// Ascending (smallest to largest) + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "asc")] + Asc, + /// + /// + /// Descending (largest to smallest) + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "desc")] + Desc +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SpecifiedDocument.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SpecifiedDocument.Converters.g.cs new file mode 100644 index 00000000000..fefe09ca84a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SpecifiedDocument.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class SpecifiedDocumentConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + + public override Elastic.Clients.Elasticsearch.SpecifiedDocument Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.SpecifiedDocument(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + Index = propIndex.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SpecifiedDocument value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SpecifiedDocument.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SpecifiedDocument.g.cs index 985dc03f097..14e7cc59eba 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SpecifiedDocument.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SpecifiedDocument.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class SpecifiedDocumentConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - - public override Elastic.Clients.Elasticsearch.SpecifiedDocument Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue propIndex = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.SpecifiedDocument(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - Index = propIndex.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SpecifiedDocument value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.SpecifiedDocumentConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.SpecifiedDocumentConverter))] public sealed partial class SpecifiedDocument { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Sql/Column.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Sql/Column.Converters.g.cs new file mode 100644 index 00000000000..ee28f8e0f40 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Sql/Column.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Sql.Json; + +public sealed partial class ColumnConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Sql.Column Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propName = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Sql.Column(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Name = propName.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Sql.Column value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Sql/Column.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Sql/Column.g.cs index baa1777c8da..eddc5021f3d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Sql/Column.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Sql/Column.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Sql; -internal sealed partial class ColumnConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Sql.Column Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propName = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Sql.Column(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Name = propName.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Sql.Column value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.ColumnConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.Json.ColumnConverter))] public sealed partial class Column { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Sql.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Sql/SqlFormat.Converters.g.cs similarity index 88% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Sql.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Sql/SqlFormat.Converters.g.cs index 62743d6613d..3fde7a9c2d0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Sql.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Sql/SqlFormat.Converters.g.cs @@ -21,9 +21,9 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.Sql; +namespace Elastic.Clients.Elasticsearch.Sql.Json; -internal sealed partial class SqlFormatConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class SqlFormatConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText MemberCbor = System.Text.Json.JsonEncodedText.Encode("cbor"); private static readonly System.Text.Json.JsonEncodedText MemberCsv = System.Text.Json.JsonEncodedText.Encode("csv"); @@ -148,23 +148,4 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, { Write(writer, value, options); } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.SqlFormatConverter))] -public enum SqlFormat -{ - [System.Runtime.Serialization.EnumMember(Value = "cbor")] - Cbor, - [System.Runtime.Serialization.EnumMember(Value = "csv")] - Csv, - [System.Runtime.Serialization.EnumMember(Value = "json")] - Json, - [System.Runtime.Serialization.EnumMember(Value = "smile")] - Smile, - [System.Runtime.Serialization.EnumMember(Value = "tsv")] - Tsv, - [System.Runtime.Serialization.EnumMember(Value = "txt")] - Txt, - [System.Runtime.Serialization.EnumMember(Value = "yaml")] - Yaml } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Sql/SqlFormat.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Sql/SqlFormat.g.cs new file mode 100644 index 00000000000..17b0c887007 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Sql/SqlFormat.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Sql; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Sql.Json.SqlFormatConverter))] +public enum SqlFormat +{ + [System.Runtime.Serialization.EnumMember(Value = "cbor")] + Cbor, + [System.Runtime.Serialization.EnumMember(Value = "csv")] + Csv, + [System.Runtime.Serialization.EnumMember(Value = "json")] + Json, + [System.Runtime.Serialization.EnumMember(Value = "smile")] + Smile, + [System.Runtime.Serialization.EnumMember(Value = "tsv")] + Tsv, + [System.Runtime.Serialization.EnumMember(Value = "txt")] + Txt, + [System.Runtime.Serialization.EnumMember(Value = "yaml")] + Yaml +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/StandardRetriever.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/StandardRetriever.Converters.g.cs new file mode 100644 index 00000000000..a74f721d6fa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/StandardRetriever.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class StandardRetrieverConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCollapse = System.Text.Json.JsonEncodedText.Encode("collapse"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropMinScore = System.Text.Json.JsonEncodedText.Encode("min_score"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropSearchAfter = System.Text.Json.JsonEncodedText.Encode("search_after"); + private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); + private static readonly System.Text.Json.JsonEncodedText PropTerminateAfter = System.Text.Json.JsonEncodedText.Encode("terminate_after"); + + public override Elastic.Clients.Elasticsearch.StandardRetriever Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCollapse = default; + LocalJsonValue?> propFilter = default; + LocalJsonValue propMinScore = default; + LocalJsonValue propName = default; + LocalJsonValue propQuery = default; + LocalJsonValue?> propSearchAfter = default; + LocalJsonValue?> propSort = default; + LocalJsonValue propTerminateAfter = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCollapse.TryReadProperty(ref reader, options, PropCollapse, null)) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propSearchAfter.TryReadProperty(ref reader, options, PropSearchAfter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propTerminateAfter.TryReadProperty(ref reader, options, PropTerminateAfter, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.StandardRetriever(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Collapse = propCollapse.Value, + Filter = propFilter.Value, + MinScore = propMinScore.Value, + Name = propName.Value, + Query = propQuery.Value, + SearchAfter = propSearchAfter.Value, + Sort = propSort.Value, + TerminateAfter = propTerminateAfter.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.StandardRetriever value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCollapse, value.Collapse, null, null); + writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropSearchAfter, value.SearchAfter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTerminateAfter, value.TerminateAfter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/StandardRetriever.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/StandardRetriever.g.cs index d8653cfcb36..90892b91eaf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/StandardRetriever.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/StandardRetriever.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class StandardRetrieverConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCollapse = System.Text.Json.JsonEncodedText.Encode("collapse"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropMinScore = System.Text.Json.JsonEncodedText.Encode("min_score"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropSearchAfter = System.Text.Json.JsonEncodedText.Encode("search_after"); - private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); - private static readonly System.Text.Json.JsonEncodedText PropTerminateAfter = System.Text.Json.JsonEncodedText.Encode("terminate_after"); - - public override Elastic.Clients.Elasticsearch.StandardRetriever Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCollapse = default; - LocalJsonValue?> propFilter = default; - LocalJsonValue propMinScore = default; - LocalJsonValue propName = default; - LocalJsonValue propQuery = default; - LocalJsonValue?> propSearchAfter = default; - LocalJsonValue?> propSort = default; - LocalJsonValue propTerminateAfter = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCollapse.TryReadProperty(ref reader, options, PropCollapse, null)) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propSearchAfter.TryReadProperty(ref reader, options, PropSearchAfter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propTerminateAfter.TryReadProperty(ref reader, options, PropTerminateAfter, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.StandardRetriever(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Collapse = propCollapse.Value, - Filter = propFilter.Value, - MinScore = propMinScore.Value, - Name = propName.Value, - Query = propQuery.Value, - SearchAfter = propSearchAfter.Value, - Sort = propSort.Value, - TerminateAfter = propTerminateAfter.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.StandardRetriever value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCollapse, value.Collapse, null, null); - writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropSearchAfter, value.SearchAfter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTerminateAfter, value.TerminateAfter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.StandardRetrieverConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.StandardRetrieverConverter))] public sealed partial class StandardRetriever { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/StoreStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/StoreStats.Converters.g.cs new file mode 100644 index 00000000000..8596cca9085 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/StoreStats.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class StoreStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropReserved = System.Text.Json.JsonEncodedText.Encode("reserved"); + private static readonly System.Text.Json.JsonEncodedText PropReservedInBytes = System.Text.Json.JsonEncodedText.Encode("reserved_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropSizeInBytes = System.Text.Json.JsonEncodedText.Encode("size_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTotalDataSetSize = System.Text.Json.JsonEncodedText.Encode("total_data_set_size"); + private static readonly System.Text.Json.JsonEncodedText PropTotalDataSetSizeInBytes = System.Text.Json.JsonEncodedText.Encode("total_data_set_size_in_bytes"); + + public override Elastic.Clients.Elasticsearch.StoreStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propReserved = default; + LocalJsonValue propReservedInBytes = default; + LocalJsonValue propSize = default; + LocalJsonValue propSizeInBytes = default; + LocalJsonValue propTotalDataSetSize = default; + LocalJsonValue propTotalDataSetSizeInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propReserved.TryReadProperty(ref reader, options, PropReserved, null)) + { + continue; + } + + if (propReservedInBytes.TryReadProperty(ref reader, options, PropReservedInBytes, null)) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, null)) + { + continue; + } + + if (propSizeInBytes.TryReadProperty(ref reader, options, PropSizeInBytes, null)) + { + continue; + } + + if (propTotalDataSetSize.TryReadProperty(ref reader, options, PropTotalDataSetSize, null)) + { + continue; + } + + if (propTotalDataSetSizeInBytes.TryReadProperty(ref reader, options, PropTotalDataSetSizeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.StoreStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Reserved = propReserved.Value, + ReservedInBytes = propReservedInBytes.Value, + Size = propSize.Value, + SizeInBytes = propSizeInBytes.Value, + TotalDataSetSize = propTotalDataSetSize.Value, + TotalDataSetSizeInBytes = propTotalDataSetSizeInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.StoreStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropReserved, value.Reserved, null, null); + writer.WriteProperty(options, PropReservedInBytes, value.ReservedInBytes, null, null); + writer.WriteProperty(options, PropSize, value.Size, null, null); + writer.WriteProperty(options, PropSizeInBytes, value.SizeInBytes, null, null); + writer.WriteProperty(options, PropTotalDataSetSize, value.TotalDataSetSize, null, null); + writer.WriteProperty(options, PropTotalDataSetSizeInBytes, value.TotalDataSetSizeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/StoreStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/StoreStats.g.cs index 4e324ed688b..46131b6f2d1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/StoreStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/StoreStats.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class StoreStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropReserved = System.Text.Json.JsonEncodedText.Encode("reserved"); - private static readonly System.Text.Json.JsonEncodedText PropReservedInBytes = System.Text.Json.JsonEncodedText.Encode("reserved_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropSizeInBytes = System.Text.Json.JsonEncodedText.Encode("size_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTotalDataSetSize = System.Text.Json.JsonEncodedText.Encode("total_data_set_size"); - private static readonly System.Text.Json.JsonEncodedText PropTotalDataSetSizeInBytes = System.Text.Json.JsonEncodedText.Encode("total_data_set_size_in_bytes"); - - public override Elastic.Clients.Elasticsearch.StoreStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propReserved = default; - LocalJsonValue propReservedInBytes = default; - LocalJsonValue propSize = default; - LocalJsonValue propSizeInBytes = default; - LocalJsonValue propTotalDataSetSize = default; - LocalJsonValue propTotalDataSetSizeInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propReserved.TryReadProperty(ref reader, options, PropReserved, null)) - { - continue; - } - - if (propReservedInBytes.TryReadProperty(ref reader, options, PropReservedInBytes, null)) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, null)) - { - continue; - } - - if (propSizeInBytes.TryReadProperty(ref reader, options, PropSizeInBytes, null)) - { - continue; - } - - if (propTotalDataSetSize.TryReadProperty(ref reader, options, PropTotalDataSetSize, null)) - { - continue; - } - - if (propTotalDataSetSizeInBytes.TryReadProperty(ref reader, options, PropTotalDataSetSizeInBytes, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.StoreStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Reserved = propReserved.Value, - ReservedInBytes = propReservedInBytes.Value, - Size = propSize.Value, - SizeInBytes = propSizeInBytes.Value, - TotalDataSetSize = propTotalDataSetSize.Value, - TotalDataSetSizeInBytes = propTotalDataSetSizeInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.StoreStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropReserved, value.Reserved, null, null); - writer.WriteProperty(options, PropReservedInBytes, value.ReservedInBytes, null, null); - writer.WriteProperty(options, PropSize, value.Size, null, null); - writer.WriteProperty(options, PropSizeInBytes, value.SizeInBytes, null, null); - writer.WriteProperty(options, PropTotalDataSetSize, value.TotalDataSetSize, null, null); - writer.WriteProperty(options, PropTotalDataSetSizeInBytes, value.TotalDataSetSizeInBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.StoreStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.StoreStatsConverter))] public sealed partial class StoreStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/StoredScript.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/StoredScript.Converters.g.cs new file mode 100644 index 00000000000..cd21d82ab0e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/StoredScript.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class StoredScriptConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLanguage = System.Text.Json.JsonEncodedText.Encode("lang"); + private static readonly System.Text.Json.JsonEncodedText PropOptions = System.Text.Json.JsonEncodedText.Encode("options"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + + public override Elastic.Clients.Elasticsearch.StoredScript Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLanguage = default; + LocalJsonValue?> propOptions = default; + LocalJsonValue propSource = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLanguage.TryReadProperty(ref reader, options, PropLanguage, null)) + { + continue; + } + + if (propOptions.TryReadProperty(ref reader, options, PropOptions, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.StoredScript(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Language = propLanguage.Value, + Options = propOptions.Value, + Source = propSource.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.StoredScript value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLanguage, value.Language, null, null); + writer.WriteProperty(options, PropOptions, value.Options, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/StoredScript.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/StoredScript.g.cs index 757643f3610..9647c41fe32 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/StoredScript.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/StoredScript.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class StoredScriptConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLanguage = System.Text.Json.JsonEncodedText.Encode("lang"); - private static readonly System.Text.Json.JsonEncodedText PropOptions = System.Text.Json.JsonEncodedText.Encode("options"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - - public override Elastic.Clients.Elasticsearch.StoredScript Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLanguage = default; - LocalJsonValue?> propOptions = default; - LocalJsonValue propSource = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLanguage.TryReadProperty(ref reader, options, PropLanguage, null)) - { - continue; - } - - if (propOptions.TryReadProperty(ref reader, options, PropOptions, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.StoredScript(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Language = propLanguage.Value, - Options = propOptions.Value, - Source = propSource.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.StoredScript value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLanguage, value.Language, null, null); - writer.WriteProperty(options, PropOptions, value.Options, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.StoredScriptConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.StoredScriptConverter))] public sealed partial class StoredScript { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SuggestMode.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SuggestMode.Converters.g.cs new file mode 100644 index 00000000000..37e5f5947a2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SuggestMode.Converters.g.cs @@ -0,0 +1,95 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class SuggestModeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAlways = System.Text.Json.JsonEncodedText.Encode("always"); + private static readonly System.Text.Json.JsonEncodedText MemberMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText MemberPopular = System.Text.Json.JsonEncodedText.Encode("popular"); + + public override Elastic.Clients.Elasticsearch.SuggestMode Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAlways)) + { + return Elastic.Clients.Elasticsearch.SuggestMode.Always; + } + + if (reader.ValueTextEquals(MemberMissing)) + { + return Elastic.Clients.Elasticsearch.SuggestMode.Missing; + } + + if (reader.ValueTextEquals(MemberPopular)) + { + return Elastic.Clients.Elasticsearch.SuggestMode.Popular; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAlways.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.SuggestMode.Always; + } + + if (string.Equals(value, MemberMissing.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.SuggestMode.Missing; + } + + if (string.Equals(value, MemberPopular.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.SuggestMode.Popular; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.SuggestMode)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SuggestMode value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.SuggestMode.Always: + writer.WriteStringValue(MemberAlways); + break; + case Elastic.Clients.Elasticsearch.SuggestMode.Missing: + writer.WriteStringValue(MemberMissing); + break; + case Elastic.Clients.Elasticsearch.SuggestMode.Popular: + writer.WriteStringValue(MemberPopular); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.SuggestMode)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.SuggestMode ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.SuggestMode value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SuggestMode.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SuggestMode.g.cs new file mode 100644 index 00000000000..641c9a3c982 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SuggestMode.g.cs @@ -0,0 +1,50 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.SuggestModeConverter))] +public enum SuggestMode +{ + /// + /// + /// Suggest any matching suggestions based on terms in the suggest text. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "always")] + Always, + /// + /// + /// Only generate suggestions for terms that are not in the shard. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "missing")] + Missing, + /// + /// + /// Only suggest terms that occur in more docs on the shard than the original term. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "popular")] + Popular +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymRule.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymRule.Converters.g.cs new file mode 100644 index 00000000000..97ee0de7cff --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymRule.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms.Json; + +public sealed partial class SynonymRuleConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropSynonyms = System.Text.Json.JsonEncodedText.Encode("synonyms"); + + public override Elastic.Clients.Elasticsearch.Synonyms.SynonymRule Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propSynonyms = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propSynonyms.TryReadProperty(ref reader, options, PropSynonyms, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Synonyms.SynonymRule(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + Synonyms = propSynonyms.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.SynonymRule value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropSynonyms, value.Synonyms, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymRule.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymRule.g.cs index a92480be02e..595d4626530 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymRule.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymRule.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Synonyms; -internal sealed partial class SynonymRuleConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropSynonyms = System.Text.Json.JsonEncodedText.Encode("synonyms"); - - public override Elastic.Clients.Elasticsearch.Synonyms.SynonymRule Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue propSynonyms = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propSynonyms.TryReadProperty(ref reader, options, PropSynonyms, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Synonyms.SynonymRule(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - Synonyms = propSynonyms.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.SynonymRule value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropSynonyms, value.Synonyms, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.SynonymRuleConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.Json.SynonymRuleConverter))] public sealed partial class SynonymRule { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymRuleRead.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymRuleRead.Converters.g.cs new file mode 100644 index 00000000000..8c501e2b6b9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymRuleRead.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms.Json; + +public sealed partial class SynonymRuleReadConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropSynonyms = System.Text.Json.JsonEncodedText.Encode("synonyms"); + + public override Elastic.Clients.Elasticsearch.Synonyms.SynonymRuleRead Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propSynonyms = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propSynonyms.TryReadProperty(ref reader, options, PropSynonyms, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Synonyms.SynonymRuleRead(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + Synonyms = propSynonyms.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.SynonymRuleRead value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropSynonyms, value.Synonyms, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymRuleRead.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymRuleRead.g.cs index 3cab7540eba..82ed624d149 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymRuleRead.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymRuleRead.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Synonyms; -internal sealed partial class SynonymRuleReadConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropSynonyms = System.Text.Json.JsonEncodedText.Encode("synonyms"); - - public override Elastic.Clients.Elasticsearch.Synonyms.SynonymRuleRead Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propId = default; - LocalJsonValue propSynonyms = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propSynonyms.TryReadProperty(ref reader, options, PropSynonyms, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Synonyms.SynonymRuleRead(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Id = propId.Value, - Synonyms = propSynonyms.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.SynonymRuleRead value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropSynonyms, value.Synonyms, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.SynonymRuleReadConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.Json.SynonymRuleReadConverter))] public sealed partial class SynonymRuleRead { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymsSetItem.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymsSetItem.Converters.g.cs new file mode 100644 index 00000000000..29db62a33a5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymsSetItem.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Synonyms.Json; + +public sealed partial class SynonymsSetItemConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropSynonymsSet = System.Text.Json.JsonEncodedText.Encode("synonyms_set"); + + public override Elastic.Clients.Elasticsearch.Synonyms.SynonymsSetItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propSynonymsSet = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propSynonymsSet.TryReadProperty(ref reader, options, PropSynonymsSet, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Synonyms.SynonymsSetItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + SynonymsSet = propSynonymsSet.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.SynonymsSetItem value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropSynonymsSet, value.SynonymsSet, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymsSetItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymsSetItem.g.cs index 01fd43c2345..8b320f3c709 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymsSetItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymsSetItem.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Synonyms; -internal sealed partial class SynonymsSetItemConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropSynonymsSet = System.Text.Json.JsonEncodedText.Encode("synonyms_set"); - - public override Elastic.Clients.Elasticsearch.Synonyms.SynonymsSetItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propSynonymsSet = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propSynonymsSet.TryReadProperty(ref reader, options, PropSynonymsSet, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Synonyms.SynonymsSetItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - SynonymsSet = propSynonymsSet.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Synonyms.SynonymsSetItem value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropSynonymsSet, value.SynonymsSet, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.SynonymsSetItemConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Synonyms.Json.SynonymsSetItemConverter))] public sealed partial class SynonymsSetItem { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TaskFailure.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TaskFailure.Converters.g.cs new file mode 100644 index 00000000000..e97d77d92ac --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TaskFailure.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class TaskFailureConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNodeId = System.Text.Json.JsonEncodedText.Encode("node_id"); + private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + private static readonly System.Text.Json.JsonEncodedText PropTaskId = System.Text.Json.JsonEncodedText.Encode("task_id"); + + public override Elastic.Clients.Elasticsearch.TaskFailure Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propNodeId = default; + LocalJsonValue propReason = default; + LocalJsonValue propStatus = default; + LocalJsonValue propTaskId = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNodeId.TryReadProperty(ref reader, options, PropNodeId, null)) + { + continue; + } + + if (propReason.TryReadProperty(ref reader, options, PropReason, null)) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (propTaskId.TryReadProperty(ref reader, options, PropTaskId, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TaskFailure(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + NodeId = propNodeId.Value, + Reason = propReason.Value, + Status = propStatus.Value, + TaskId = propTaskId.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TaskFailure value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNodeId, value.NodeId, null, null); + writer.WriteProperty(options, PropReason, value.Reason, null, null); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteProperty(options, PropTaskId, value.TaskId, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TaskFailure.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TaskFailure.g.cs index e7ba59e7be4..be1232903a6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TaskFailure.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TaskFailure.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class TaskFailureConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNodeId = System.Text.Json.JsonEncodedText.Encode("node_id"); - private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - private static readonly System.Text.Json.JsonEncodedText PropTaskId = System.Text.Json.JsonEncodedText.Encode("task_id"); - - public override Elastic.Clients.Elasticsearch.TaskFailure Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propNodeId = default; - LocalJsonValue propReason = default; - LocalJsonValue propStatus = default; - LocalJsonValue propTaskId = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNodeId.TryReadProperty(ref reader, options, PropNodeId, null)) - { - continue; - } - - if (propReason.TryReadProperty(ref reader, options, PropReason, null)) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (propTaskId.TryReadProperty(ref reader, options, PropTaskId, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TaskFailure(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - NodeId = propNodeId.Value, - Reason = propReason.Value, - Status = propStatus.Value, - TaskId = propTaskId.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TaskFailure value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNodeId, value.NodeId, null, null); - writer.WriteProperty(options, PropReason, value.Reason, null, null); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteProperty(options, PropTaskId, value.TaskId, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TaskFailureConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.TaskFailureConverter))] public sealed partial class TaskFailure { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Tasks.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/GroupBy.Converters.g.cs similarity index 83% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Tasks.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/GroupBy.Converters.g.cs index 1ba6e1f0887..9c52607fed4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Tasks.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/GroupBy.Converters.g.cs @@ -21,9 +21,9 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.Tasks; +namespace Elastic.Clients.Elasticsearch.Tasks.Json; -internal sealed partial class GroupByConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class GroupByConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText MemberNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"); @@ -92,30 +92,4 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, { Write(writer, value, options); } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Tasks.GroupByConverter))] -public enum GroupBy -{ - /// - /// - /// Group tasks by node ID. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "nodes")] - Nodes, - /// - /// - /// Do not group tasks. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "none")] - None, - /// - /// - /// Group tasks by parent task ID. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "parents")] - Parents } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/GroupBy.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/GroupBy.g.cs new file mode 100644 index 00000000000..94c462fedc1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/GroupBy.g.cs @@ -0,0 +1,50 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Tasks; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Tasks.Json.GroupByConverter))] +public enum GroupBy +{ + /// + /// + /// Group tasks by node ID. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "nodes")] + Nodes, + /// + /// + /// Do not group tasks. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "none")] + None, + /// + /// + /// Group tasks by parent task ID. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "parents")] + Parents +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/NodeTasks.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/NodeTasks.Converters.g.cs new file mode 100644 index 00000000000..5b65336963d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/NodeTasks.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Tasks.Json; + +public sealed partial class NodeTasksConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); + private static readonly System.Text.Json.JsonEncodedText PropHost = System.Text.Json.JsonEncodedText.Encode("host"); + private static readonly System.Text.Json.JsonEncodedText PropIp = System.Text.Json.JsonEncodedText.Encode("ip"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + private static readonly System.Text.Json.JsonEncodedText PropTasks = System.Text.Json.JsonEncodedText.Encode("tasks"); + private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); + + public override Elastic.Clients.Elasticsearch.Tasks.NodeTasks Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAttributes = default; + LocalJsonValue propHost = default; + LocalJsonValue propIp = default; + LocalJsonValue propName = default; + LocalJsonValue?> propRoles = default; + LocalJsonValue> propTasks = default; + LocalJsonValue propTransportAddress = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propHost.TryReadProperty(ref reader, options, PropHost, null)) + { + continue; + } + + if (propIp.TryReadProperty(ref reader, options, PropIp, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propTasks.TryReadProperty(ref reader, options, PropTasks, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Tasks.NodeTasks(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Attributes = propAttributes.Value, + Host = propHost.Value, + Ip = propIp.Value, + Name = propName.Value, + Roles = propRoles.Value, + Tasks = propTasks.Value, + TransportAddress = propTransportAddress.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Tasks.NodeTasks value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropHost, value.Host, null, null); + writer.WriteProperty(options, PropIp, value.Ip, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTasks, value.Tasks, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/NodeTasks.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/NodeTasks.g.cs index 016ef62d1e9..a9b04b44d5c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/NodeTasks.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/NodeTasks.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Tasks; -internal sealed partial class NodeTasksConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAttributes = System.Text.Json.JsonEncodedText.Encode("attributes"); - private static readonly System.Text.Json.JsonEncodedText PropHost = System.Text.Json.JsonEncodedText.Encode("host"); - private static readonly System.Text.Json.JsonEncodedText PropIp = System.Text.Json.JsonEncodedText.Encode("ip"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); - private static readonly System.Text.Json.JsonEncodedText PropTasks = System.Text.Json.JsonEncodedText.Encode("tasks"); - private static readonly System.Text.Json.JsonEncodedText PropTransportAddress = System.Text.Json.JsonEncodedText.Encode("transport_address"); - - public override Elastic.Clients.Elasticsearch.Tasks.NodeTasks Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAttributes = default; - LocalJsonValue propHost = default; - LocalJsonValue propIp = default; - LocalJsonValue propName = default; - LocalJsonValue?> propRoles = default; - LocalJsonValue> propTasks = default; - LocalJsonValue propTransportAddress = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAttributes.TryReadProperty(ref reader, options, PropAttributes, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propHost.TryReadProperty(ref reader, options, PropHost, null)) - { - continue; - } - - if (propIp.TryReadProperty(ref reader, options, PropIp, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propRoles.TryReadProperty(ref reader, options, PropRoles, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propTasks.TryReadProperty(ref reader, options, PropTasks, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propTransportAddress.TryReadProperty(ref reader, options, PropTransportAddress, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Tasks.NodeTasks(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Attributes = propAttributes.Value, - Host = propHost.Value, - Ip = propIp.Value, - Name = propName.Value, - Roles = propRoles.Value, - Tasks = propTasks.Value, - TransportAddress = propTransportAddress.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Tasks.NodeTasks value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAttributes, value.Attributes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropHost, value.Host, null, null); - writer.WriteProperty(options, PropIp, value.Ip, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropRoles, value.Roles, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropTasks, value.Tasks, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropTransportAddress, value.TransportAddress, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Tasks.NodeTasksConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Tasks.Json.NodeTasksConverter))] public sealed partial class NodeTasks { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/ParentTaskInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/ParentTaskInfo.Converters.g.cs new file mode 100644 index 00000000000..012e746d4ea --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/ParentTaskInfo.Converters.g.cs @@ -0,0 +1,180 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Tasks.Json; + +public sealed partial class ParentTaskInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAction = System.Text.Json.JsonEncodedText.Encode("action"); + private static readonly System.Text.Json.JsonEncodedText PropCancellable = System.Text.Json.JsonEncodedText.Encode("cancellable"); + private static readonly System.Text.Json.JsonEncodedText PropCancelled = System.Text.Json.JsonEncodedText.Encode("cancelled"); + private static readonly System.Text.Json.JsonEncodedText PropChildren = System.Text.Json.JsonEncodedText.Encode("children"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropHeaders = System.Text.Json.JsonEncodedText.Encode("headers"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); + private static readonly System.Text.Json.JsonEncodedText PropParentTaskId = System.Text.Json.JsonEncodedText.Encode("parent_task_id"); + private static readonly System.Text.Json.JsonEncodedText PropRunningTime = System.Text.Json.JsonEncodedText.Encode("running_time"); + private static readonly System.Text.Json.JsonEncodedText PropRunningTimeInNanos = System.Text.Json.JsonEncodedText.Encode("running_time_in_nanos"); + private static readonly System.Text.Json.JsonEncodedText PropStartTimeInMillis = System.Text.Json.JsonEncodedText.Encode("start_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Tasks.ParentTaskInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAction = default; + LocalJsonValue propCancellable = default; + LocalJsonValue propCancelled = default; + LocalJsonValue?> propChildren = default; + LocalJsonValue propDescription = default; + LocalJsonValue> propHeaders = default; + LocalJsonValue propId = default; + LocalJsonValue propNode = default; + LocalJsonValue propParentTaskId = default; + LocalJsonValue propRunningTime = default; + LocalJsonValue propRunningTimeInNanos = default; + LocalJsonValue propStartTimeInMillis = default; + LocalJsonValue propStatus = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAction.TryReadProperty(ref reader, options, PropAction, null)) + { + continue; + } + + if (propCancellable.TryReadProperty(ref reader, options, PropCancellable, null)) + { + continue; + } + + if (propCancelled.TryReadProperty(ref reader, options, PropCancelled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propChildren.TryReadProperty(ref reader, options, PropChildren, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propHeaders.TryReadProperty(ref reader, options, PropHeaders, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propNode.TryReadProperty(ref reader, options, PropNode, null)) + { + continue; + } + + if (propParentTaskId.TryReadProperty(ref reader, options, PropParentTaskId, null)) + { + continue; + } + + if (propRunningTime.TryReadProperty(ref reader, options, PropRunningTime, null)) + { + continue; + } + + if (propRunningTimeInNanos.TryReadProperty(ref reader, options, PropRunningTimeInNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) + { + continue; + } + + if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Tasks.ParentTaskInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Action = propAction.Value, + Cancellable = propCancellable.Value, + Cancelled = propCancelled.Value, + Children = propChildren.Value, + Description = propDescription.Value, + Headers = propHeaders.Value, + Id = propId.Value, + Node = propNode.Value, + ParentTaskId = propParentTaskId.Value, + RunningTime = propRunningTime.Value, + RunningTimeInNanos = propRunningTimeInNanos.Value, + StartTimeInMillis = propStartTimeInMillis.Value, + Status = propStatus.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Tasks.ParentTaskInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAction, value.Action, null, null); + writer.WriteProperty(options, PropCancellable, value.Cancellable, null, null); + writer.WriteProperty(options, PropCancelled, value.Cancelled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropChildren, value.Children, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropHeaders, value.Headers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropNode, value.Node, null, null); + writer.WriteProperty(options, PropParentTaskId, value.ParentTaskId, null, null); + writer.WriteProperty(options, PropRunningTime, value.RunningTime, null, null); + writer.WriteProperty(options, PropRunningTimeInNanos, value.RunningTimeInNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); + writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropStatus, value.Status, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/ParentTaskInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/ParentTaskInfo.g.cs index 16869b8382d..8acd3766d88 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/ParentTaskInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/ParentTaskInfo.g.cs @@ -23,163 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Tasks; -internal sealed partial class ParentTaskInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAction = System.Text.Json.JsonEncodedText.Encode("action"); - private static readonly System.Text.Json.JsonEncodedText PropCancellable = System.Text.Json.JsonEncodedText.Encode("cancellable"); - private static readonly System.Text.Json.JsonEncodedText PropCancelled = System.Text.Json.JsonEncodedText.Encode("cancelled"); - private static readonly System.Text.Json.JsonEncodedText PropChildren = System.Text.Json.JsonEncodedText.Encode("children"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropHeaders = System.Text.Json.JsonEncodedText.Encode("headers"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); - private static readonly System.Text.Json.JsonEncodedText PropParentTaskId = System.Text.Json.JsonEncodedText.Encode("parent_task_id"); - private static readonly System.Text.Json.JsonEncodedText PropRunningTime = System.Text.Json.JsonEncodedText.Encode("running_time"); - private static readonly System.Text.Json.JsonEncodedText PropRunningTimeInNanos = System.Text.Json.JsonEncodedText.Encode("running_time_in_nanos"); - private static readonly System.Text.Json.JsonEncodedText PropStartTimeInMillis = System.Text.Json.JsonEncodedText.Encode("start_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Tasks.ParentTaskInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAction = default; - LocalJsonValue propCancellable = default; - LocalJsonValue propCancelled = default; - LocalJsonValue?> propChildren = default; - LocalJsonValue propDescription = default; - LocalJsonValue> propHeaders = default; - LocalJsonValue propId = default; - LocalJsonValue propNode = default; - LocalJsonValue propParentTaskId = default; - LocalJsonValue propRunningTime = default; - LocalJsonValue propRunningTimeInNanos = default; - LocalJsonValue propStartTimeInMillis = default; - LocalJsonValue propStatus = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAction.TryReadProperty(ref reader, options, PropAction, null)) - { - continue; - } - - if (propCancellable.TryReadProperty(ref reader, options, PropCancellable, null)) - { - continue; - } - - if (propCancelled.TryReadProperty(ref reader, options, PropCancelled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propChildren.TryReadProperty(ref reader, options, PropChildren, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propHeaders.TryReadProperty(ref reader, options, PropHeaders, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propNode.TryReadProperty(ref reader, options, PropNode, null)) - { - continue; - } - - if (propParentTaskId.TryReadProperty(ref reader, options, PropParentTaskId, null)) - { - continue; - } - - if (propRunningTime.TryReadProperty(ref reader, options, PropRunningTime, null)) - { - continue; - } - - if (propRunningTimeInNanos.TryReadProperty(ref reader, options, PropRunningTimeInNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) - { - continue; - } - - if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Tasks.ParentTaskInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Action = propAction.Value, - Cancellable = propCancellable.Value, - Cancelled = propCancelled.Value, - Children = propChildren.Value, - Description = propDescription.Value, - Headers = propHeaders.Value, - Id = propId.Value, - Node = propNode.Value, - ParentTaskId = propParentTaskId.Value, - RunningTime = propRunningTime.Value, - RunningTimeInNanos = propRunningTimeInNanos.Value, - StartTimeInMillis = propStartTimeInMillis.Value, - Status = propStatus.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Tasks.ParentTaskInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAction, value.Action, null, null); - writer.WriteProperty(options, PropCancellable, value.Cancellable, null, null); - writer.WriteProperty(options, PropCancelled, value.Cancelled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropChildren, value.Children, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropHeaders, value.Headers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropNode, value.Node, null, null); - writer.WriteProperty(options, PropParentTaskId, value.ParentTaskId, null, null); - writer.WriteProperty(options, PropRunningTime, value.RunningTime, null, null); - writer.WriteProperty(options, PropRunningTimeInNanos, value.RunningTimeInNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); - writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropStatus, value.Status, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Tasks.ParentTaskInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Tasks.Json.ParentTaskInfoConverter))] public sealed partial class ParentTaskInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/TaskInfo.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/TaskInfo.Converters.g.cs new file mode 100644 index 00000000000..0f81d4a0e71 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/TaskInfo.Converters.g.cs @@ -0,0 +1,171 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Tasks.Json; + +public sealed partial class TaskInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAction = System.Text.Json.JsonEncodedText.Encode("action"); + private static readonly System.Text.Json.JsonEncodedText PropCancellable = System.Text.Json.JsonEncodedText.Encode("cancellable"); + private static readonly System.Text.Json.JsonEncodedText PropCancelled = System.Text.Json.JsonEncodedText.Encode("cancelled"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropHeaders = System.Text.Json.JsonEncodedText.Encode("headers"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); + private static readonly System.Text.Json.JsonEncodedText PropParentTaskId = System.Text.Json.JsonEncodedText.Encode("parent_task_id"); + private static readonly System.Text.Json.JsonEncodedText PropRunningTime = System.Text.Json.JsonEncodedText.Encode("running_time"); + private static readonly System.Text.Json.JsonEncodedText PropRunningTimeInNanos = System.Text.Json.JsonEncodedText.Encode("running_time_in_nanos"); + private static readonly System.Text.Json.JsonEncodedText PropStartTimeInMillis = System.Text.Json.JsonEncodedText.Encode("start_time_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Tasks.TaskInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAction = default; + LocalJsonValue propCancellable = default; + LocalJsonValue propCancelled = default; + LocalJsonValue propDescription = default; + LocalJsonValue> propHeaders = default; + LocalJsonValue propId = default; + LocalJsonValue propNode = default; + LocalJsonValue propParentTaskId = default; + LocalJsonValue propRunningTime = default; + LocalJsonValue propRunningTimeInNanos = default; + LocalJsonValue propStartTimeInMillis = default; + LocalJsonValue propStatus = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAction.TryReadProperty(ref reader, options, PropAction, null)) + { + continue; + } + + if (propCancellable.TryReadProperty(ref reader, options, PropCancellable, null)) + { + continue; + } + + if (propCancelled.TryReadProperty(ref reader, options, PropCancelled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propHeaders.TryReadProperty(ref reader, options, PropHeaders, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propNode.TryReadProperty(ref reader, options, PropNode, null)) + { + continue; + } + + if (propParentTaskId.TryReadProperty(ref reader, options, PropParentTaskId, null)) + { + continue; + } + + if (propRunningTime.TryReadProperty(ref reader, options, PropRunningTime, null)) + { + continue; + } + + if (propRunningTimeInNanos.TryReadProperty(ref reader, options, PropRunningTimeInNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) + { + continue; + } + + if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Tasks.TaskInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Action = propAction.Value, + Cancellable = propCancellable.Value, + Cancelled = propCancelled.Value, + Description = propDescription.Value, + Headers = propHeaders.Value, + Id = propId.Value, + Node = propNode.Value, + ParentTaskId = propParentTaskId.Value, + RunningTime = propRunningTime.Value, + RunningTimeInNanos = propRunningTimeInNanos.Value, + StartTimeInMillis = propStartTimeInMillis.Value, + Status = propStatus.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Tasks.TaskInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAction, value.Action, null, null); + writer.WriteProperty(options, PropCancellable, value.Cancellable, null, null); + writer.WriteProperty(options, PropCancelled, value.Cancelled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropHeaders, value.Headers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropNode, value.Node, null, null); + writer.WriteProperty(options, PropParentTaskId, value.ParentTaskId, null, null); + writer.WriteProperty(options, PropRunningTime, value.RunningTime, null, null); + writer.WriteProperty(options, PropRunningTimeInNanos, value.RunningTimeInNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); + writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropStatus, value.Status, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/TaskInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/TaskInfo.g.cs index 21e956e32b3..081782689f3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/TaskInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/TaskInfo.g.cs @@ -23,154 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Tasks; -internal sealed partial class TaskInfoConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAction = System.Text.Json.JsonEncodedText.Encode("action"); - private static readonly System.Text.Json.JsonEncodedText PropCancellable = System.Text.Json.JsonEncodedText.Encode("cancellable"); - private static readonly System.Text.Json.JsonEncodedText PropCancelled = System.Text.Json.JsonEncodedText.Encode("cancelled"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropHeaders = System.Text.Json.JsonEncodedText.Encode("headers"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); - private static readonly System.Text.Json.JsonEncodedText PropParentTaskId = System.Text.Json.JsonEncodedText.Encode("parent_task_id"); - private static readonly System.Text.Json.JsonEncodedText PropRunningTime = System.Text.Json.JsonEncodedText.Encode("running_time"); - private static readonly System.Text.Json.JsonEncodedText PropRunningTimeInNanos = System.Text.Json.JsonEncodedText.Encode("running_time_in_nanos"); - private static readonly System.Text.Json.JsonEncodedText PropStartTimeInMillis = System.Text.Json.JsonEncodedText.Encode("start_time_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.Tasks.TaskInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAction = default; - LocalJsonValue propCancellable = default; - LocalJsonValue propCancelled = default; - LocalJsonValue propDescription = default; - LocalJsonValue> propHeaders = default; - LocalJsonValue propId = default; - LocalJsonValue propNode = default; - LocalJsonValue propParentTaskId = default; - LocalJsonValue propRunningTime = default; - LocalJsonValue propRunningTimeInNanos = default; - LocalJsonValue propStartTimeInMillis = default; - LocalJsonValue propStatus = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAction.TryReadProperty(ref reader, options, PropAction, null)) - { - continue; - } - - if (propCancellable.TryReadProperty(ref reader, options, PropCancellable, null)) - { - continue; - } - - if (propCancelled.TryReadProperty(ref reader, options, PropCancelled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propHeaders.TryReadProperty(ref reader, options, PropHeaders, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propNode.TryReadProperty(ref reader, options, PropNode, null)) - { - continue; - } - - if (propParentTaskId.TryReadProperty(ref reader, options, PropParentTaskId, null)) - { - continue; - } - - if (propRunningTime.TryReadProperty(ref reader, options, PropRunningTime, null)) - { - continue; - } - - if (propRunningTimeInNanos.TryReadProperty(ref reader, options, PropRunningTimeInNanos, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker)))) - { - continue; - } - - if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Tasks.TaskInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Action = propAction.Value, - Cancellable = propCancellable.Value, - Cancelled = propCancelled.Value, - Description = propDescription.Value, - Headers = propHeaders.Value, - Id = propId.Value, - Node = propNode.Value, - ParentTaskId = propParentTaskId.Value, - RunningTime = propRunningTime.Value, - RunningTimeInNanos = propRunningTimeInNanos.Value, - StartTimeInMillis = propStartTimeInMillis.Value, - Status = propStatus.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Tasks.TaskInfo value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAction, value.Action, null, null); - writer.WriteProperty(options, PropCancellable, value.Cancellable, null, null); - writer.WriteProperty(options, PropCancelled, value.Cancelled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropHeaders, value.Headers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropNode, value.Node, null, null); - writer.WriteProperty(options, PropParentTaskId, value.ParentTaskId, null, null); - writer.WriteProperty(options, PropRunningTime, value.RunningTime, null, null); - writer.WriteProperty(options, PropRunningTimeInNanos, value.RunningTimeInNanos, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanNanosMarker))); - writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropStatus, value.Status, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Tasks.TaskInfoConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Tasks.Json.TaskInfoConverter))] public sealed partial class TaskInfo { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/TaskInfos.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/TaskInfos.Converters.g.cs new file mode 100644 index 00000000000..67c8ea40ee1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/TaskInfos.Converters.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Tasks.Json; + +public sealed partial class TaskInfosConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Tasks.TaskInfos Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject); + return selector(ref reader, options) switch + { + Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Tasks.TaskInfos(reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)), + Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Tasks.TaskInfos(reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)), + _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Tasks.TaskInfos)}") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Tasks.TaskInfos value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Tag) + { + case Elastic.Clients.Elasticsearch.UnionTag.T1: + { + writer.WriteValue(options, value.Value1, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + break; + } + + case Elastic.Clients.Elasticsearch.UnionTag.T2: + { + writer.WriteValue(options, value.Value2, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + break; + } + + default: + throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/TaskInfos.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/TaskInfos.g.cs index 337cbc3d1e0..ecb1057b5e5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/TaskInfos.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/TaskInfos.g.cs @@ -23,42 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Tasks; -internal sealed partial class TaskInfosConverter : System.Text.Json.Serialization.JsonConverter -{ - public override Elastic.Clients.Elasticsearch.Tasks.TaskInfos Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - var selector = static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject); - return selector(ref reader, options) switch - { - Elastic.Clients.Elasticsearch.UnionTag.T1 => new Elastic.Clients.Elasticsearch.Tasks.TaskInfos(reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)), - Elastic.Clients.Elasticsearch.UnionTag.T2 => new Elastic.Clients.Elasticsearch.Tasks.TaskInfos(reader.ReadValue>(options, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)), - _ => throw new System.InvalidOperationException($"Failed to select a union variant for type '{nameof(Elastic.Clients.Elasticsearch.Tasks.TaskInfos)}") - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Tasks.TaskInfos value, System.Text.Json.JsonSerializerOptions options) - { - switch (value.Tag) - { - case Elastic.Clients.Elasticsearch.UnionTag.T1: - { - writer.WriteValue(options, value.Value1, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - break; - } - - case Elastic.Clients.Elasticsearch.UnionTag.T2: - { - writer.WriteValue(options, value.Value2, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - break; - } - - default: - throw new System.InvalidOperationException($"Unrecognized tag value: {value.Tag}"); - } - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Tasks.TaskInfosConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Tasks.Json.TaskInfosConverter))] public sealed partial class TaskInfos : Elastic.Clients.Elasticsearch.Union, System.Collections.Generic.IReadOnlyDictionary> { public TaskInfos(System.Collections.Generic.IReadOnlyCollection value) : base(value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.Converters.g.cs new file mode 100644 index 00000000000..20cd851b34b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class TextEmbeddingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); + private static readonly System.Text.Json.JsonEncodedText PropModelText = System.Text.Json.JsonEncodedText.Encode("model_text"); + + public override Elastic.Clients.Elasticsearch.TextEmbedding Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propModelId = default; + LocalJsonValue propModelText = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) + { + continue; + } + + if (propModelText.TryReadProperty(ref reader, options, PropModelText, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TextEmbedding(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ModelId = propModelId.Value, + ModelText = propModelText.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextEmbedding value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropModelId, value.ModelId, null, null); + writer.WriteProperty(options, PropModelText, value.ModelText, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.g.cs index 3e5bba2a877..1bc9cc5ad77 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class TextEmbeddingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); - private static readonly System.Text.Json.JsonEncodedText PropModelText = System.Text.Json.JsonEncodedText.Encode("model_text"); - - public override Elastic.Clients.Elasticsearch.TextEmbedding Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propModelId = default; - LocalJsonValue propModelText = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) - { - continue; - } - - if (propModelText.TryReadProperty(ref reader, options, PropModelText, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TextEmbedding(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ModelId = propModelId.Value, - ModelText = propModelText.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextEmbedding value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropModelId, value.ModelId, null, null); - writer.WriteProperty(options, PropModelText, value.ModelText, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TextEmbeddingConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.TextEmbeddingConverter))] public sealed partial class TextEmbedding { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextSimilarityReranker.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextSimilarityReranker.Converters.g.cs new file mode 100644 index 00000000000..e410c8f0ec9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextSimilarityReranker.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class TextSimilarityRerankerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceText = System.Text.Json.JsonEncodedText.Encode("inference_text"); + private static readonly System.Text.Json.JsonEncodedText PropMinScore = System.Text.Json.JsonEncodedText.Encode("min_score"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("_name"); + private static readonly System.Text.Json.JsonEncodedText PropRankWindowSize = System.Text.Json.JsonEncodedText.Encode("rank_window_size"); + private static readonly System.Text.Json.JsonEncodedText PropRetriever = System.Text.Json.JsonEncodedText.Encode("retriever"); + + public override Elastic.Clients.Elasticsearch.TextSimilarityReranker Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue?> propFilter = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propInferenceText = default; + LocalJsonValue propMinScore = default; + LocalJsonValue propName = default; + LocalJsonValue propRankWindowSize = default; + LocalJsonValue propRetriever = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propInferenceText.TryReadProperty(ref reader, options, PropInferenceText, null)) + { + continue; + } + + if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propRankWindowSize.TryReadProperty(ref reader, options, PropRankWindowSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRetriever.TryReadProperty(ref reader, options, PropRetriever, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TextSimilarityReranker(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Filter = propFilter.Value, + InferenceId = propInferenceId.Value, + InferenceText = propInferenceText.Value, + MinScore = propMinScore.Value, + Name = propName.Value, + RankWindowSize = propRankWindowSize.Value, + Retriever = propRetriever.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextSimilarityReranker value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropInferenceText, value.InferenceText, null, null); + writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropRankWindowSize, value.RankWindowSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRetriever, value.Retriever, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextSimilarityReranker.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextSimilarityReranker.g.cs index 9670587c810..343e51ffa54 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextSimilarityReranker.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextSimilarityReranker.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class TextSimilarityRerankerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropFilter = System.Text.Json.JsonEncodedText.Encode("filter"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceText = System.Text.Json.JsonEncodedText.Encode("inference_text"); - private static readonly System.Text.Json.JsonEncodedText PropMinScore = System.Text.Json.JsonEncodedText.Encode("min_score"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("_name"); - private static readonly System.Text.Json.JsonEncodedText PropRankWindowSize = System.Text.Json.JsonEncodedText.Encode("rank_window_size"); - private static readonly System.Text.Json.JsonEncodedText PropRetriever = System.Text.Json.JsonEncodedText.Encode("retriever"); - - public override Elastic.Clients.Elasticsearch.TextSimilarityReranker Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue?> propFilter = default; - LocalJsonValue propInferenceId = default; - LocalJsonValue propInferenceText = default; - LocalJsonValue propMinScore = default; - LocalJsonValue propName = default; - LocalJsonValue propRankWindowSize = default; - LocalJsonValue propRetriever = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propFilter.TryReadProperty(ref reader, options, PropFilter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) - { - continue; - } - - if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) - { - continue; - } - - if (propInferenceText.TryReadProperty(ref reader, options, PropInferenceText, null)) - { - continue; - } - - if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propRankWindowSize.TryReadProperty(ref reader, options, PropRankWindowSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRetriever.TryReadProperty(ref reader, options, PropRetriever, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TextSimilarityReranker(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - Filter = propFilter.Value, - InferenceId = propInferenceId.Value, - InferenceText = propInferenceText.Value, - MinScore = propMinScore.Value, - Name = propName.Value, - RankWindowSize = propRankWindowSize.Value, - Retriever = propRetriever.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextSimilarityReranker value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropFilter, value.Filter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); - writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); - writer.WriteProperty(options, PropInferenceText, value.InferenceText, null, null); - writer.WriteProperty(options, PropMinScore, value.MinScore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropRankWindowSize, value.RankWindowSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRetriever, value.Retriever, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TextSimilarityRerankerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.TextSimilarityRerankerConverter))] public sealed partial class TextSimilarityReranker { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/EcsCompatibilityType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/EcsCompatibilityType.Converters.g.cs new file mode 100644 index 00000000000..12d29f490cc --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/EcsCompatibilityType.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TextStructure.Json; + +public sealed partial class EcsCompatibilityTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberDisabled = System.Text.Json.JsonEncodedText.Encode("disabled"); + private static readonly System.Text.Json.JsonEncodedText MemberV1 = System.Text.Json.JsonEncodedText.Encode("v1"); + + public override Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberDisabled)) + { + return Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType.Disabled; + } + + if (reader.ValueTextEquals(MemberV1)) + { + return Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType.V1; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberDisabled.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType.Disabled; + } + + if (string.Equals(value, MemberV1.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType.V1; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType.Disabled: + writer.WriteStringValue(MemberDisabled); + break; + case Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType.V1: + writer.WriteStringValue(MemberV1); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/EcsCompatibilityType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/EcsCompatibilityType.g.cs new file mode 100644 index 00000000000..5027c1c0847 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/EcsCompatibilityType.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TextStructure; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TextStructure.Json.EcsCompatibilityTypeConverter))] +public enum EcsCompatibilityType +{ + [System.Runtime.Serialization.EnumMember(Value = "disabled")] + Disabled, + [System.Runtime.Serialization.EnumMember(Value = "v1")] + V1 +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/FieldStat.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/FieldStat.Converters.g.cs new file mode 100644 index 00000000000..58cb65b0737 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/FieldStat.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TextStructure.Json; + +public sealed partial class FieldStatConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCardinality = System.Text.Json.JsonEncodedText.Encode("cardinality"); + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropEarliest = System.Text.Json.JsonEncodedText.Encode("earliest"); + private static readonly System.Text.Json.JsonEncodedText PropLatest = System.Text.Json.JsonEncodedText.Encode("latest"); + private static readonly System.Text.Json.JsonEncodedText PropMaxValue = System.Text.Json.JsonEncodedText.Encode("max_value"); + private static readonly System.Text.Json.JsonEncodedText PropMeanValue = System.Text.Json.JsonEncodedText.Encode("mean_value"); + private static readonly System.Text.Json.JsonEncodedText PropMedianValue = System.Text.Json.JsonEncodedText.Encode("median_value"); + private static readonly System.Text.Json.JsonEncodedText PropMinValue = System.Text.Json.JsonEncodedText.Encode("min_value"); + private static readonly System.Text.Json.JsonEncodedText PropTopHits = System.Text.Json.JsonEncodedText.Encode("top_hits"); + + public override Elastic.Clients.Elasticsearch.TextStructure.FieldStat Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCardinality = default; + LocalJsonValue propCount = default; + LocalJsonValue propEarliest = default; + LocalJsonValue propLatest = default; + LocalJsonValue propMaxValue = default; + LocalJsonValue propMeanValue = default; + LocalJsonValue propMedianValue = default; + LocalJsonValue propMinValue = default; + LocalJsonValue> propTopHits = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCardinality.TryReadProperty(ref reader, options, PropCardinality, null)) + { + continue; + } + + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propEarliest.TryReadProperty(ref reader, options, PropEarliest, null)) + { + continue; + } + + if (propLatest.TryReadProperty(ref reader, options, PropLatest, null)) + { + continue; + } + + if (propMaxValue.TryReadProperty(ref reader, options, PropMaxValue, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeanValue.TryReadProperty(ref reader, options, PropMeanValue, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMedianValue.TryReadProperty(ref reader, options, PropMedianValue, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMinValue.TryReadProperty(ref reader, options, PropMinValue, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTopHits.TryReadProperty(ref reader, options, PropTopHits, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TextStructure.FieldStat(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Cardinality = propCardinality.Value, + Count = propCount.Value, + Earliest = propEarliest.Value, + Latest = propLatest.Value, + MaxValue = propMaxValue.Value, + MeanValue = propMeanValue.Value, + MedianValue = propMedianValue.Value, + MinValue = propMinValue.Value, + TopHits = propTopHits.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextStructure.FieldStat value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCardinality, value.Cardinality, null, null); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropEarliest, value.Earliest, null, null); + writer.WriteProperty(options, PropLatest, value.Latest, null, null); + writer.WriteProperty(options, PropMaxValue, value.MaxValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeanValue, value.MeanValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMedianValue, value.MedianValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMinValue, value.MinValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTopHits, value.TopHits, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/FieldStat.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/FieldStat.g.cs index 9cf5488b3d9..67faaa5b86e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/FieldStat.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/FieldStat.g.cs @@ -23,118 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TextStructure; -internal sealed partial class FieldStatConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCardinality = System.Text.Json.JsonEncodedText.Encode("cardinality"); - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropEarliest = System.Text.Json.JsonEncodedText.Encode("earliest"); - private static readonly System.Text.Json.JsonEncodedText PropLatest = System.Text.Json.JsonEncodedText.Encode("latest"); - private static readonly System.Text.Json.JsonEncodedText PropMaxValue = System.Text.Json.JsonEncodedText.Encode("max_value"); - private static readonly System.Text.Json.JsonEncodedText PropMeanValue = System.Text.Json.JsonEncodedText.Encode("mean_value"); - private static readonly System.Text.Json.JsonEncodedText PropMedianValue = System.Text.Json.JsonEncodedText.Encode("median_value"); - private static readonly System.Text.Json.JsonEncodedText PropMinValue = System.Text.Json.JsonEncodedText.Encode("min_value"); - private static readonly System.Text.Json.JsonEncodedText PropTopHits = System.Text.Json.JsonEncodedText.Encode("top_hits"); - - public override Elastic.Clients.Elasticsearch.TextStructure.FieldStat Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCardinality = default; - LocalJsonValue propCount = default; - LocalJsonValue propEarliest = default; - LocalJsonValue propLatest = default; - LocalJsonValue propMaxValue = default; - LocalJsonValue propMeanValue = default; - LocalJsonValue propMedianValue = default; - LocalJsonValue propMinValue = default; - LocalJsonValue> propTopHits = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCardinality.TryReadProperty(ref reader, options, PropCardinality, null)) - { - continue; - } - - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propEarliest.TryReadProperty(ref reader, options, PropEarliest, null)) - { - continue; - } - - if (propLatest.TryReadProperty(ref reader, options, PropLatest, null)) - { - continue; - } - - if (propMaxValue.TryReadProperty(ref reader, options, PropMaxValue, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMeanValue.TryReadProperty(ref reader, options, PropMeanValue, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMedianValue.TryReadProperty(ref reader, options, PropMedianValue, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMinValue.TryReadProperty(ref reader, options, PropMinValue, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTopHits.TryReadProperty(ref reader, options, PropTopHits, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TextStructure.FieldStat(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Cardinality = propCardinality.Value, - Count = propCount.Value, - Earliest = propEarliest.Value, - Latest = propLatest.Value, - MaxValue = propMaxValue.Value, - MeanValue = propMeanValue.Value, - MedianValue = propMedianValue.Value, - MinValue = propMinValue.Value, - TopHits = propTopHits.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextStructure.FieldStat value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCardinality, value.Cardinality, null, null); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropEarliest, value.Earliest, null, null); - writer.WriteProperty(options, PropLatest, value.Latest, null, null); - writer.WriteProperty(options, PropMaxValue, value.MaxValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMeanValue, value.MeanValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMedianValue, value.MedianValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMinValue, value.MinValue, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTopHits, value.TopHits, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TextStructure.FieldStatConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TextStructure.Json.FieldStatConverter))] public sealed partial class FieldStat { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.TextStructure.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/FormatType.Converters.g.cs similarity index 57% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.TextStructure.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/FormatType.Converters.g.cs index c6b1d05e3d7..57855f6d230 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.TextStructure.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/FormatType.Converters.g.cs @@ -21,66 +21,9 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.TextStructure; +namespace Elastic.Clients.Elasticsearch.TextStructure.Json; -internal sealed partial class EcsCompatibilityTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberDisabled = System.Text.Json.JsonEncodedText.Encode("disabled"); - private static readonly System.Text.Json.JsonEncodedText MemberV1 = System.Text.Json.JsonEncodedText.Encode("v1"); - - public override Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberDisabled)) - { - return Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType.Disabled; - } - - if (reader.ValueTextEquals(MemberV1)) - { - return Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType.V1; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberDisabled.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType.Disabled; - } - - if (string.Equals(value, MemberV1.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType.V1; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType.Disabled: - writer.WriteStringValue(MemberDisabled); - break; - case Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType.V1: - writer.WriteStringValue(MemberV1); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityType value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -internal sealed partial class FormatTypeConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class FormatTypeConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText MemberDelimited = System.Text.Json.JsonEncodedText.Encode("delimited"); private static readonly System.Text.Json.JsonEncodedText MemberNdjson = System.Text.Json.JsonEncodedText.Encode("ndjson"); @@ -163,26 +106,4 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, { Write(writer, value, options); } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TextStructure.EcsCompatibilityTypeConverter))] -public enum EcsCompatibilityType -{ - [System.Runtime.Serialization.EnumMember(Value = "disabled")] - Disabled, - [System.Runtime.Serialization.EnumMember(Value = "v1")] - V1 -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TextStructure.FormatTypeConverter))] -public enum FormatType -{ - [System.Runtime.Serialization.EnumMember(Value = "delimited")] - Delimited, - [System.Runtime.Serialization.EnumMember(Value = "ndjson")] - Ndjson, - [System.Runtime.Serialization.EnumMember(Value = "semi_structured_text")] - SemiStructuredText, - [System.Runtime.Serialization.EnumMember(Value = "xml")] - Xml } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/FormatType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/FormatType.g.cs new file mode 100644 index 00000000000..4f14d5f0883 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/FormatType.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TextStructure; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TextStructure.Json.FormatTypeConverter))] +public enum FormatType +{ + [System.Runtime.Serialization.EnumMember(Value = "delimited")] + Delimited, + [System.Runtime.Serialization.EnumMember(Value = "ndjson")] + Ndjson, + [System.Runtime.Serialization.EnumMember(Value = "semi_structured_text")] + SemiStructuredText, + [System.Runtime.Serialization.EnumMember(Value = "xml")] + Xml +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/MatchedField.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/MatchedField.Converters.g.cs new file mode 100644 index 00000000000..319ecdc05d3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/MatchedField.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TextStructure.Json; + +public sealed partial class MatchedFieldConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLength = System.Text.Json.JsonEncodedText.Encode("length"); + private static readonly System.Text.Json.JsonEncodedText PropMatch = System.Text.Json.JsonEncodedText.Encode("match"); + private static readonly System.Text.Json.JsonEncodedText PropOffset = System.Text.Json.JsonEncodedText.Encode("offset"); + + public override Elastic.Clients.Elasticsearch.TextStructure.MatchedField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLength = default; + LocalJsonValue propMatch = default; + LocalJsonValue propOffset = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLength.TryReadProperty(ref reader, options, PropLength, null)) + { + continue; + } + + if (propMatch.TryReadProperty(ref reader, options, PropMatch, null)) + { + continue; + } + + if (propOffset.TryReadProperty(ref reader, options, PropOffset, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TextStructure.MatchedField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Length = propLength.Value, + Match = propMatch.Value, + Offset = propOffset.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextStructure.MatchedField value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLength, value.Length, null, null); + writer.WriteProperty(options, PropMatch, value.Match, null, null); + writer.WriteProperty(options, PropOffset, value.Offset, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/MatchedField.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/MatchedField.g.cs index 1a176428607..7994eda1e38 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/MatchedField.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/MatchedField.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TextStructure; -internal sealed partial class MatchedFieldConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLength = System.Text.Json.JsonEncodedText.Encode("length"); - private static readonly System.Text.Json.JsonEncodedText PropMatch = System.Text.Json.JsonEncodedText.Encode("match"); - private static readonly System.Text.Json.JsonEncodedText PropOffset = System.Text.Json.JsonEncodedText.Encode("offset"); - - public override Elastic.Clients.Elasticsearch.TextStructure.MatchedField Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLength = default; - LocalJsonValue propMatch = default; - LocalJsonValue propOffset = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLength.TryReadProperty(ref reader, options, PropLength, null)) - { - continue; - } - - if (propMatch.TryReadProperty(ref reader, options, PropMatch, null)) - { - continue; - } - - if (propOffset.TryReadProperty(ref reader, options, PropOffset, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TextStructure.MatchedField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Length = propLength.Value, - Match = propMatch.Value, - Offset = propOffset.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextStructure.MatchedField value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLength, value.Length, null, null); - writer.WriteProperty(options, PropMatch, value.Match, null, null); - writer.WriteProperty(options, PropOffset, value.Offset, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TextStructure.MatchedFieldConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TextStructure.Json.MatchedFieldConverter))] public sealed partial class MatchedField { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/MatchedText.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/MatchedText.Converters.g.cs new file mode 100644 index 00000000000..afbd527829e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/MatchedText.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TextStructure.Json; + +public sealed partial class MatchedTextConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); + private static readonly System.Text.Json.JsonEncodedText PropMatched = System.Text.Json.JsonEncodedText.Encode("matched"); + + public override Elastic.Clients.Elasticsearch.TextStructure.MatchedText Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>?> propFields = default; + LocalJsonValue propMatched = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (propMatched.TryReadProperty(ref reader, options, PropMatched, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TextStructure.MatchedText(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Fields = propFields.Value, + Matched = propMatched.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextStructure.MatchedText value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropMatched, value.Matched, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/MatchedText.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/MatchedText.g.cs index 5149634fdc0..b06c307ee36 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/MatchedText.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/MatchedText.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TextStructure; -internal sealed partial class MatchedTextConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); - private static readonly System.Text.Json.JsonEncodedText PropMatched = System.Text.Json.JsonEncodedText.Encode("matched"); - - public override Elastic.Clients.Elasticsearch.TextStructure.MatchedText Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue>?> propFields = default; - LocalJsonValue propMatched = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.IReadOnlyDictionary>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue>(o, null, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) - { - continue; - } - - if (propMatched.TryReadProperty(ref reader, options, PropMatched, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TextStructure.MatchedText(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Fields = propFields.Value, - Matched = propMatched.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextStructure.MatchedText value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary>? v) => w.WriteDictionaryValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null))); - writer.WriteProperty(options, PropMatched, value.Matched, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TextStructure.MatchedTextConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TextStructure.Json.MatchedTextConverter))] public sealed partial class MatchedText { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/TopHit.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/TopHit.Converters.g.cs new file mode 100644 index 00000000000..8fd39594981 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/TopHit.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TextStructure.Json; + +public sealed partial class TopHitConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); + + public override Elastic.Clients.Elasticsearch.TextStructure.TopHit Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propValue.TryReadProperty(ref reader, options, PropValue, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TextStructure.TopHit(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Value = propValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextStructure.TopHit value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/TopHit.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/TopHit.g.cs index 9d80019d91b..2363f47b212 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/TopHit.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextStructure/TopHit.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TextStructure; -internal sealed partial class TopHitConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropValue = System.Text.Json.JsonEncodedText.Encode("value"); - - public override Elastic.Clients.Elasticsearch.TextStructure.TopHit Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propValue = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propValue.TryReadProperty(ref reader, options, PropValue, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TextStructure.TopHit(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Value = propValue.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TextStructure.TopHit value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropValue, value.Value, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TextStructure.TopHitConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TextStructure.Json.TopHitConverter))] public sealed partial class TopHit { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ThreadType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ThreadType.Converters.g.cs new file mode 100644 index 00000000000..c3e688c660f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ThreadType.Converters.g.cs @@ -0,0 +1,123 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class ThreadTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberBlock = System.Text.Json.JsonEncodedText.Encode("block"); + private static readonly System.Text.Json.JsonEncodedText MemberCpu = System.Text.Json.JsonEncodedText.Encode("cpu"); + private static readonly System.Text.Json.JsonEncodedText MemberGpu = System.Text.Json.JsonEncodedText.Encode("gpu"); + private static readonly System.Text.Json.JsonEncodedText MemberMem = System.Text.Json.JsonEncodedText.Encode("mem"); + private static readonly System.Text.Json.JsonEncodedText MemberWait = System.Text.Json.JsonEncodedText.Encode("wait"); + + public override Elastic.Clients.Elasticsearch.ThreadType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberBlock)) + { + return Elastic.Clients.Elasticsearch.ThreadType.Block; + } + + if (reader.ValueTextEquals(MemberCpu)) + { + return Elastic.Clients.Elasticsearch.ThreadType.Cpu; + } + + if (reader.ValueTextEquals(MemberGpu)) + { + return Elastic.Clients.Elasticsearch.ThreadType.Gpu; + } + + if (reader.ValueTextEquals(MemberMem)) + { + return Elastic.Clients.Elasticsearch.ThreadType.Mem; + } + + if (reader.ValueTextEquals(MemberWait)) + { + return Elastic.Clients.Elasticsearch.ThreadType.Wait; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberBlock.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.ThreadType.Block; + } + + if (string.Equals(value, MemberCpu.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.ThreadType.Cpu; + } + + if (string.Equals(value, MemberGpu.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.ThreadType.Gpu; + } + + if (string.Equals(value, MemberMem.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.ThreadType.Mem; + } + + if (string.Equals(value, MemberWait.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.ThreadType.Wait; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.ThreadType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ThreadType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.ThreadType.Block: + writer.WriteStringValue(MemberBlock); + break; + case Elastic.Clients.Elasticsearch.ThreadType.Cpu: + writer.WriteStringValue(MemberCpu); + break; + case Elastic.Clients.Elasticsearch.ThreadType.Gpu: + writer.WriteStringValue(MemberGpu); + break; + case Elastic.Clients.Elasticsearch.ThreadType.Mem: + writer.WriteStringValue(MemberMem); + break; + case Elastic.Clients.Elasticsearch.ThreadType.Wait: + writer.WriteStringValue(MemberWait); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.ThreadType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.ThreadType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.ThreadType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/ThreadType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ThreadType.g.cs new file mode 100644 index 00000000000..b3d504c0ba1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/ThreadType.g.cs @@ -0,0 +1,39 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.ThreadTypeConverter))] +public enum ThreadType +{ + [System.Runtime.Serialization.EnumMember(Value = "block")] + Block, + [System.Runtime.Serialization.EnumMember(Value = "cpu")] + Cpu, + [System.Runtime.Serialization.EnumMember(Value = "gpu")] + Gpu, + [System.Runtime.Serialization.EnumMember(Value = "mem")] + Mem, + [System.Runtime.Serialization.EnumMember(Value = "wait")] + Wait +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TimeUnit.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TimeUnit.Converters.g.cs new file mode 100644 index 00000000000..dc87cbabc75 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TimeUnit.Converters.g.cs @@ -0,0 +1,151 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class TimeUnitConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberDays = System.Text.Json.JsonEncodedText.Encode("d"); + private static readonly System.Text.Json.JsonEncodedText MemberHours = System.Text.Json.JsonEncodedText.Encode("h"); + private static readonly System.Text.Json.JsonEncodedText MemberMinutes = System.Text.Json.JsonEncodedText.Encode("m"); + private static readonly System.Text.Json.JsonEncodedText MemberMicroseconds = System.Text.Json.JsonEncodedText.Encode("micros"); + private static readonly System.Text.Json.JsonEncodedText MemberMilliseconds = System.Text.Json.JsonEncodedText.Encode("ms"); + private static readonly System.Text.Json.JsonEncodedText MemberNanoseconds = System.Text.Json.JsonEncodedText.Encode("nanos"); + private static readonly System.Text.Json.JsonEncodedText MemberSeconds = System.Text.Json.JsonEncodedText.Encode("s"); + + public override Elastic.Clients.Elasticsearch.TimeUnit Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberDays)) + { + return Elastic.Clients.Elasticsearch.TimeUnit.Days; + } + + if (reader.ValueTextEquals(MemberHours)) + { + return Elastic.Clients.Elasticsearch.TimeUnit.Hours; + } + + if (reader.ValueTextEquals(MemberMinutes)) + { + return Elastic.Clients.Elasticsearch.TimeUnit.Minutes; + } + + if (reader.ValueTextEquals(MemberMicroseconds)) + { + return Elastic.Clients.Elasticsearch.TimeUnit.Microseconds; + } + + if (reader.ValueTextEquals(MemberMilliseconds)) + { + return Elastic.Clients.Elasticsearch.TimeUnit.Milliseconds; + } + + if (reader.ValueTextEquals(MemberNanoseconds)) + { + return Elastic.Clients.Elasticsearch.TimeUnit.Nanoseconds; + } + + if (reader.ValueTextEquals(MemberSeconds)) + { + return Elastic.Clients.Elasticsearch.TimeUnit.Seconds; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberDays.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.TimeUnit.Days; + } + + if (string.Equals(value, MemberHours.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.TimeUnit.Hours; + } + + if (string.Equals(value, MemberMinutes.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.TimeUnit.Minutes; + } + + if (string.Equals(value, MemberMicroseconds.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.TimeUnit.Microseconds; + } + + if (string.Equals(value, MemberMilliseconds.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.TimeUnit.Milliseconds; + } + + if (string.Equals(value, MemberNanoseconds.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.TimeUnit.Nanoseconds; + } + + if (string.Equals(value, MemberSeconds.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.TimeUnit.Seconds; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.TimeUnit)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TimeUnit value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.TimeUnit.Days: + writer.WriteStringValue(MemberDays); + break; + case Elastic.Clients.Elasticsearch.TimeUnit.Hours: + writer.WriteStringValue(MemberHours); + break; + case Elastic.Clients.Elasticsearch.TimeUnit.Minutes: + writer.WriteStringValue(MemberMinutes); + break; + case Elastic.Clients.Elasticsearch.TimeUnit.Microseconds: + writer.WriteStringValue(MemberMicroseconds); + break; + case Elastic.Clients.Elasticsearch.TimeUnit.Milliseconds: + writer.WriteStringValue(MemberMilliseconds); + break; + case Elastic.Clients.Elasticsearch.TimeUnit.Nanoseconds: + writer.WriteStringValue(MemberNanoseconds); + break; + case Elastic.Clients.Elasticsearch.TimeUnit.Seconds: + writer.WriteStringValue(MemberSeconds); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.TimeUnit)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.TimeUnit ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TimeUnit value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TimeUnit.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TimeUnit.g.cs new file mode 100644 index 00000000000..83da36ce31b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TimeUnit.g.cs @@ -0,0 +1,43 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.TimeUnitConverter))] +public enum TimeUnit +{ + [System.Runtime.Serialization.EnumMember(Value = "d")] + Days, + [System.Runtime.Serialization.EnumMember(Value = "h")] + Hours, + [System.Runtime.Serialization.EnumMember(Value = "m")] + Minutes, + [System.Runtime.Serialization.EnumMember(Value = "micros")] + Microseconds, + [System.Runtime.Serialization.EnumMember(Value = "ms")] + Milliseconds, + [System.Runtime.Serialization.EnumMember(Value = "nanos")] + Nanoseconds, + [System.Runtime.Serialization.EnumMember(Value = "s")] + Seconds +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TokenPruningConfig.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TokenPruningConfig.Converters.g.cs new file mode 100644 index 00000000000..b3bbdaa3ce5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TokenPruningConfig.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class TokenPruningConfigConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropOnlyScorePrunedTokens = System.Text.Json.JsonEncodedText.Encode("only_score_pruned_tokens"); + private static readonly System.Text.Json.JsonEncodedText PropTokensFreqRatioThreshold = System.Text.Json.JsonEncodedText.Encode("tokens_freq_ratio_threshold"); + private static readonly System.Text.Json.JsonEncodedText PropTokensWeightThreshold = System.Text.Json.JsonEncodedText.Encode("tokens_weight_threshold"); + + public override Elastic.Clients.Elasticsearch.TokenPruningConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propOnlyScorePrunedTokens = default; + LocalJsonValue propTokensFreqRatioThreshold = default; + LocalJsonValue propTokensWeightThreshold = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propOnlyScorePrunedTokens.TryReadProperty(ref reader, options, PropOnlyScorePrunedTokens, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTokensFreqRatioThreshold.TryReadProperty(ref reader, options, PropTokensFreqRatioThreshold, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTokensWeightThreshold.TryReadProperty(ref reader, options, PropTokensWeightThreshold, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TokenPruningConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + OnlyScorePrunedTokens = propOnlyScorePrunedTokens.Value, + TokensFreqRatioThreshold = propTokensFreqRatioThreshold.Value, + TokensWeightThreshold = propTokensWeightThreshold.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TokenPruningConfig value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropOnlyScorePrunedTokens, value.OnlyScorePrunedTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTokensFreqRatioThreshold, value.TokensFreqRatioThreshold, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTokensWeightThreshold, value.TokensWeightThreshold, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TokenPruningConfig.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TokenPruningConfig.g.cs index c464284ece3..68e7c025713 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TokenPruningConfig.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TokenPruningConfig.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class TokenPruningConfigConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropOnlyScorePrunedTokens = System.Text.Json.JsonEncodedText.Encode("only_score_pruned_tokens"); - private static readonly System.Text.Json.JsonEncodedText PropTokensFreqRatioThreshold = System.Text.Json.JsonEncodedText.Encode("tokens_freq_ratio_threshold"); - private static readonly System.Text.Json.JsonEncodedText PropTokensWeightThreshold = System.Text.Json.JsonEncodedText.Encode("tokens_weight_threshold"); - - public override Elastic.Clients.Elasticsearch.TokenPruningConfig Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propOnlyScorePrunedTokens = default; - LocalJsonValue propTokensFreqRatioThreshold = default; - LocalJsonValue propTokensWeightThreshold = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propOnlyScorePrunedTokens.TryReadProperty(ref reader, options, PropOnlyScorePrunedTokens, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTokensFreqRatioThreshold.TryReadProperty(ref reader, options, PropTokensFreqRatioThreshold, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTokensWeightThreshold.TryReadProperty(ref reader, options, PropTokensWeightThreshold, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TokenPruningConfig(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - OnlyScorePrunedTokens = propOnlyScorePrunedTokens.Value, - TokensFreqRatioThreshold = propTokensFreqRatioThreshold.Value, - TokensWeightThreshold = propTokensWeightThreshold.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TokenPruningConfig value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropOnlyScorePrunedTokens, value.OnlyScorePrunedTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTokensFreqRatioThreshold, value.TokensFreqRatioThreshold, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTokensWeightThreshold, value.TokensWeightThreshold, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TokenPruningConfigConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.TokenPruningConfigConverter))] public sealed partial class TokenPruningConfig { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TopLeftBottomRightGeoBounds.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TopLeftBottomRightGeoBounds.Converters.g.cs new file mode 100644 index 00000000000..31416ae8b64 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TopLeftBottomRightGeoBounds.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class TopLeftBottomRightGeoBoundsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBottomRight = System.Text.Json.JsonEncodedText.Encode("bottom_right"); + private static readonly System.Text.Json.JsonEncodedText PropTopLeft = System.Text.Json.JsonEncodedText.Encode("top_left"); + + public override Elastic.Clients.Elasticsearch.TopLeftBottomRightGeoBounds Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBottomRight = default; + LocalJsonValue propTopLeft = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBottomRight.TryReadProperty(ref reader, options, PropBottomRight, null)) + { + continue; + } + + if (propTopLeft.TryReadProperty(ref reader, options, PropTopLeft, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TopLeftBottomRightGeoBounds(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BottomRight = propBottomRight.Value, + TopLeft = propTopLeft.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TopLeftBottomRightGeoBounds value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBottomRight, value.BottomRight, null, null); + writer.WriteProperty(options, PropTopLeft, value.TopLeft, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TopLeftBottomRightGeoBounds.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TopLeftBottomRightGeoBounds.g.cs index cfa83af44b8..016cbf29c7b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TopLeftBottomRightGeoBounds.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TopLeftBottomRightGeoBounds.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class TopLeftBottomRightGeoBoundsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBottomRight = System.Text.Json.JsonEncodedText.Encode("bottom_right"); - private static readonly System.Text.Json.JsonEncodedText PropTopLeft = System.Text.Json.JsonEncodedText.Encode("top_left"); - - public override Elastic.Clients.Elasticsearch.TopLeftBottomRightGeoBounds Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBottomRight = default; - LocalJsonValue propTopLeft = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBottomRight.TryReadProperty(ref reader, options, PropBottomRight, null)) - { - continue; - } - - if (propTopLeft.TryReadProperty(ref reader, options, PropTopLeft, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TopLeftBottomRightGeoBounds(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BottomRight = propBottomRight.Value, - TopLeft = propTopLeft.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TopLeftBottomRightGeoBounds value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBottomRight, value.BottomRight, null, null); - writer.WriteProperty(options, PropTopLeft, value.TopLeft, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TopLeftBottomRightGeoBoundsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.TopLeftBottomRightGeoBoundsConverter))] public sealed partial class TopLeftBottomRightGeoBounds { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TopRightBottomLeftGeoBounds.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TopRightBottomLeftGeoBounds.Converters.g.cs new file mode 100644 index 00000000000..32caccf0720 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TopRightBottomLeftGeoBounds.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class TopRightBottomLeftGeoBoundsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBottomLeft = System.Text.Json.JsonEncodedText.Encode("bottom_left"); + private static readonly System.Text.Json.JsonEncodedText PropTopRight = System.Text.Json.JsonEncodedText.Encode("top_right"); + + public override Elastic.Clients.Elasticsearch.TopRightBottomLeftGeoBounds Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBottomLeft = default; + LocalJsonValue propTopRight = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBottomLeft.TryReadProperty(ref reader, options, PropBottomLeft, null)) + { + continue; + } + + if (propTopRight.TryReadProperty(ref reader, options, PropTopRight, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TopRightBottomLeftGeoBounds(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BottomLeft = propBottomLeft.Value, + TopRight = propTopRight.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TopRightBottomLeftGeoBounds value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBottomLeft, value.BottomLeft, null, null); + writer.WriteProperty(options, PropTopRight, value.TopRight, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TopRightBottomLeftGeoBounds.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TopRightBottomLeftGeoBounds.g.cs index 750d71e2b07..242dd8f3d49 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TopRightBottomLeftGeoBounds.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TopRightBottomLeftGeoBounds.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class TopRightBottomLeftGeoBoundsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBottomLeft = System.Text.Json.JsonEncodedText.Encode("bottom_left"); - private static readonly System.Text.Json.JsonEncodedText PropTopRight = System.Text.Json.JsonEncodedText.Encode("top_right"); - - public override Elastic.Clients.Elasticsearch.TopRightBottomLeftGeoBounds Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBottomLeft = default; - LocalJsonValue propTopRight = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBottomLeft.TryReadProperty(ref reader, options, PropBottomLeft, null)) - { - continue; - } - - if (propTopRight.TryReadProperty(ref reader, options, PropTopRight, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TopRightBottomLeftGeoBounds(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BottomLeft = propBottomLeft.Value, - TopRight = propTopRight.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TopRightBottomLeftGeoBounds value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBottomLeft, value.BottomLeft, null, null); - writer.WriteProperty(options, PropTopRight, value.TopRight, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TopRightBottomLeftGeoBoundsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.TopRightBottomLeftGeoBoundsConverter))] public sealed partial class TopRightBottomLeftGeoBounds { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/CheckpointStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/CheckpointStats.Converters.g.cs new file mode 100644 index 00000000000..e95d60443cb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/CheckpointStats.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class CheckpointStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCheckpoint = System.Text.Json.JsonEncodedText.Encode("checkpoint"); + private static readonly System.Text.Json.JsonEncodedText PropCheckpointProgress = System.Text.Json.JsonEncodedText.Encode("checkpoint_progress"); + private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); + private static readonly System.Text.Json.JsonEncodedText PropTimestampMillis = System.Text.Json.JsonEncodedText.Encode("timestamp_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTimeUpperBound = System.Text.Json.JsonEncodedText.Encode("time_upper_bound"); + private static readonly System.Text.Json.JsonEncodedText PropTimeUpperBoundMillis = System.Text.Json.JsonEncodedText.Encode("time_upper_bound_millis"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.CheckpointStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCheckpoint = default; + LocalJsonValue propCheckpointProgress = default; + LocalJsonValue propTimestamp = default; + LocalJsonValue propTimestampMillis = default; + LocalJsonValue propTimeUpperBound = default; + LocalJsonValue propTimeUpperBoundMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCheckpoint.TryReadProperty(ref reader, options, PropCheckpoint, null)) + { + continue; + } + + if (propCheckpointProgress.TryReadProperty(ref reader, options, PropCheckpointProgress, null)) + { + continue; + } + + if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propTimestampMillis.TryReadProperty(ref reader, options, PropTimestampMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propTimeUpperBound.TryReadProperty(ref reader, options, PropTimeUpperBound, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propTimeUpperBoundMillis.TryReadProperty(ref reader, options, PropTimeUpperBoundMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.CheckpointStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Checkpoint = propCheckpoint.Value, + CheckpointProgress = propCheckpointProgress.Value, + Timestamp = propTimestamp.Value, + TimestampMillis = propTimestampMillis.Value, + TimeUpperBound = propTimeUpperBound.Value, + TimeUpperBoundMillis = propTimeUpperBoundMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.CheckpointStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCheckpoint, value.Checkpoint, null, null); + writer.WriteProperty(options, PropCheckpointProgress, value.CheckpointProgress, null, null); + writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropTimestampMillis, value.TimestampMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropTimeUpperBound, value.TimeUpperBound, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropTimeUpperBoundMillis, value.TimeUpperBoundMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/CheckpointStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/CheckpointStats.g.cs index 35c259d0c87..742ae71a695 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/CheckpointStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/CheckpointStats.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class CheckpointStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCheckpoint = System.Text.Json.JsonEncodedText.Encode("checkpoint"); - private static readonly System.Text.Json.JsonEncodedText PropCheckpointProgress = System.Text.Json.JsonEncodedText.Encode("checkpoint_progress"); - private static readonly System.Text.Json.JsonEncodedText PropTimestamp = System.Text.Json.JsonEncodedText.Encode("timestamp"); - private static readonly System.Text.Json.JsonEncodedText PropTimestampMillis = System.Text.Json.JsonEncodedText.Encode("timestamp_millis"); - private static readonly System.Text.Json.JsonEncodedText PropTimeUpperBound = System.Text.Json.JsonEncodedText.Encode("time_upper_bound"); - private static readonly System.Text.Json.JsonEncodedText PropTimeUpperBoundMillis = System.Text.Json.JsonEncodedText.Encode("time_upper_bound_millis"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.CheckpointStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCheckpoint = default; - LocalJsonValue propCheckpointProgress = default; - LocalJsonValue propTimestamp = default; - LocalJsonValue propTimestampMillis = default; - LocalJsonValue propTimeUpperBound = default; - LocalJsonValue propTimeUpperBoundMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCheckpoint.TryReadProperty(ref reader, options, PropCheckpoint, null)) - { - continue; - } - - if (propCheckpointProgress.TryReadProperty(ref reader, options, PropCheckpointProgress, null)) - { - continue; - } - - if (propTimestamp.TryReadProperty(ref reader, options, PropTimestamp, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propTimestampMillis.TryReadProperty(ref reader, options, PropTimestampMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propTimeUpperBound.TryReadProperty(ref reader, options, PropTimeUpperBound, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propTimeUpperBoundMillis.TryReadProperty(ref reader, options, PropTimeUpperBoundMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.CheckpointStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Checkpoint = propCheckpoint.Value, - CheckpointProgress = propCheckpointProgress.Value, - Timestamp = propTimestamp.Value, - TimestampMillis = propTimestampMillis.Value, - TimeUpperBound = propTimeUpperBound.Value, - TimeUpperBoundMillis = propTimeUpperBoundMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.CheckpointStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCheckpoint, value.Checkpoint, null, null); - writer.WriteProperty(options, PropCheckpointProgress, value.CheckpointProgress, null, null); - writer.WriteProperty(options, PropTimestamp, value.Timestamp, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropTimestampMillis, value.TimestampMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropTimeUpperBound, value.TimeUpperBound, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropTimeUpperBoundMillis, value.TimeUpperBoundMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.CheckpointStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.CheckpointStatsConverter))] public sealed partial class CheckpointStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Checkpointing.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Checkpointing.Converters.g.cs new file mode 100644 index 00000000000..78ead729260 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Checkpointing.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class CheckpointingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChangesLastDetectedAt = System.Text.Json.JsonEncodedText.Encode("changes_last_detected_at"); + private static readonly System.Text.Json.JsonEncodedText PropChangesLastDetectedAtString = System.Text.Json.JsonEncodedText.Encode("changes_last_detected_at_string"); + private static readonly System.Text.Json.JsonEncodedText PropLast = System.Text.Json.JsonEncodedText.Encode("last"); + private static readonly System.Text.Json.JsonEncodedText PropLastSearchTime = System.Text.Json.JsonEncodedText.Encode("last_search_time"); + private static readonly System.Text.Json.JsonEncodedText PropLastSearchTimeString = System.Text.Json.JsonEncodedText.Encode("last_search_time_string"); + private static readonly System.Text.Json.JsonEncodedText PropNext = System.Text.Json.JsonEncodedText.Encode("next"); + private static readonly System.Text.Json.JsonEncodedText PropOperationsBehind = System.Text.Json.JsonEncodedText.Encode("operations_behind"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.Checkpointing Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChangesLastDetectedAt = default; + LocalJsonValue propChangesLastDetectedAtString = default; + LocalJsonValue propLast = default; + LocalJsonValue propLastSearchTime = default; + LocalJsonValue propLastSearchTimeString = default; + LocalJsonValue propNext = default; + LocalJsonValue propOperationsBehind = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChangesLastDetectedAt.TryReadProperty(ref reader, options, PropChangesLastDetectedAt, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propChangesLastDetectedAtString.TryReadProperty(ref reader, options, PropChangesLastDetectedAtString, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propLast.TryReadProperty(ref reader, options, PropLast, null)) + { + continue; + } + + if (propLastSearchTime.TryReadProperty(ref reader, options, PropLastSearchTime, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propLastSearchTimeString.TryReadProperty(ref reader, options, PropLastSearchTimeString, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propNext.TryReadProperty(ref reader, options, PropNext, null)) + { + continue; + } + + if (propOperationsBehind.TryReadProperty(ref reader, options, PropOperationsBehind, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.Checkpointing(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChangesLastDetectedAt = propChangesLastDetectedAt.Value, + ChangesLastDetectedAtString = propChangesLastDetectedAtString.Value, + Last = propLast.Value, + LastSearchTime = propLastSearchTime.Value, + LastSearchTimeString = propLastSearchTimeString.Value, + Next = propNext.Value, + OperationsBehind = propOperationsBehind.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.Checkpointing value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChangesLastDetectedAt, value.ChangesLastDetectedAt, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropChangesLastDetectedAtString, value.ChangesLastDetectedAtString, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropLast, value.Last, null, null); + writer.WriteProperty(options, PropLastSearchTime, value.LastSearchTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropLastSearchTimeString, value.LastSearchTimeString, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropNext, value.Next, null, null); + writer.WriteProperty(options, PropOperationsBehind, value.OperationsBehind, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Checkpointing.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Checkpointing.g.cs index b3854e24e57..3b602f5ce51 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Checkpointing.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Checkpointing.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class CheckpointingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropChangesLastDetectedAt = System.Text.Json.JsonEncodedText.Encode("changes_last_detected_at"); - private static readonly System.Text.Json.JsonEncodedText PropChangesLastDetectedAtString = System.Text.Json.JsonEncodedText.Encode("changes_last_detected_at_string"); - private static readonly System.Text.Json.JsonEncodedText PropLast = System.Text.Json.JsonEncodedText.Encode("last"); - private static readonly System.Text.Json.JsonEncodedText PropLastSearchTime = System.Text.Json.JsonEncodedText.Encode("last_search_time"); - private static readonly System.Text.Json.JsonEncodedText PropLastSearchTimeString = System.Text.Json.JsonEncodedText.Encode("last_search_time_string"); - private static readonly System.Text.Json.JsonEncodedText PropNext = System.Text.Json.JsonEncodedText.Encode("next"); - private static readonly System.Text.Json.JsonEncodedText PropOperationsBehind = System.Text.Json.JsonEncodedText.Encode("operations_behind"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.Checkpointing Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propChangesLastDetectedAt = default; - LocalJsonValue propChangesLastDetectedAtString = default; - LocalJsonValue propLast = default; - LocalJsonValue propLastSearchTime = default; - LocalJsonValue propLastSearchTimeString = default; - LocalJsonValue propNext = default; - LocalJsonValue propOperationsBehind = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propChangesLastDetectedAt.TryReadProperty(ref reader, options, PropChangesLastDetectedAt, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propChangesLastDetectedAtString.TryReadProperty(ref reader, options, PropChangesLastDetectedAtString, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propLast.TryReadProperty(ref reader, options, PropLast, null)) - { - continue; - } - - if (propLastSearchTime.TryReadProperty(ref reader, options, PropLastSearchTime, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propLastSearchTimeString.TryReadProperty(ref reader, options, PropLastSearchTimeString, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propNext.TryReadProperty(ref reader, options, PropNext, null)) - { - continue; - } - - if (propOperationsBehind.TryReadProperty(ref reader, options, PropOperationsBehind, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.Checkpointing(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ChangesLastDetectedAt = propChangesLastDetectedAt.Value, - ChangesLastDetectedAtString = propChangesLastDetectedAtString.Value, - Last = propLast.Value, - LastSearchTime = propLastSearchTime.Value, - LastSearchTimeString = propLastSearchTimeString.Value, - Next = propNext.Value, - OperationsBehind = propOperationsBehind.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.Checkpointing value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropChangesLastDetectedAt, value.ChangesLastDetectedAt, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropChangesLastDetectedAtString, value.ChangesLastDetectedAtString, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropLast, value.Last, null, null); - writer.WriteProperty(options, PropLastSearchTime, value.LastSearchTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropLastSearchTimeString, value.LastSearchTimeString, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropNext, value.Next, null, null); - writer.WriteProperty(options, PropOperationsBehind, value.OperationsBehind, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.CheckpointingConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.CheckpointingConverter))] public sealed partial class Checkpointing { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Destination.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Destination.Converters.g.cs new file mode 100644 index 00000000000..9dbad705c50 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Destination.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class DestinationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropPipeline = System.Text.Json.JsonEncodedText.Encode("pipeline"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.Destination Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndex = default; + LocalJsonValue propPipeline = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propPipeline.TryReadProperty(ref reader, options, PropPipeline, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.Destination(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Index = propIndex.Value, + Pipeline = propPipeline.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.Destination value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropPipeline, value.Pipeline, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Destination.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Destination.g.cs index a43feda4ecc..099b8244924 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Destination.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Destination.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class DestinationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropPipeline = System.Text.Json.JsonEncodedText.Encode("pipeline"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.Destination Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndex = default; - LocalJsonValue propPipeline = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) - { - continue; - } - - if (propPipeline.TryReadProperty(ref reader, options, PropPipeline, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.Destination(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Index = propIndex.Value, - Pipeline = propPipeline.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.Destination value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndex, value.Index, null, null); - writer.WriteProperty(options, PropPipeline, value.Pipeline, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.DestinationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.DestinationConverter))] public sealed partial class Destination { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Latest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Latest.Converters.g.cs new file mode 100644 index 00000000000..b96807cad59 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Latest.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class LatestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); + private static readonly System.Text.Json.JsonEncodedText PropUniqueKey = System.Text.Json.JsonEncodedText.Encode("unique_key"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.Latest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propSort = default; + LocalJsonValue propUniqueKey = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSort.TryReadProperty(ref reader, options, PropSort, null)) + { + continue; + } + + if (propUniqueKey.TryReadProperty(ref reader, options, PropUniqueKey, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.Latest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Sort = propSort.Value, + UniqueKey = propUniqueKey.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.Latest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSort, value.Sort, null, null); + writer.WriteProperty(options, PropUniqueKey, value.UniqueKey, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Latest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Latest.g.cs index 72c8bce9bbf..4ed92032185 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Latest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Latest.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class LatestConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); - private static readonly System.Text.Json.JsonEncodedText PropUniqueKey = System.Text.Json.JsonEncodedText.Encode("unique_key"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.Latest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propSort = default; - LocalJsonValue propUniqueKey = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSort.TryReadProperty(ref reader, options, PropSort, null)) - { - continue; - } - - if (propUniqueKey.TryReadProperty(ref reader, options, PropUniqueKey, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.Latest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Sort = propSort.Value, - UniqueKey = propUniqueKey.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.Latest value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSort, value.Sort, null, null); - writer.WriteProperty(options, PropUniqueKey, value.UniqueKey, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.LatestConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.LatestConverter))] public sealed partial class Latest { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Pivot.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Pivot.Converters.g.cs new file mode 100644 index 00000000000..379b4583594 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Pivot.Converters.g.cs @@ -0,0 +1,73 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class PivotConverter : System.Text.Json.Serialization.JsonConverter +{ + 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 PropGroupBy = System.Text.Json.JsonEncodedText.Encode("group_by"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.Pivot Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAggregations = default; + LocalJsonValue?> propGroupBy = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)) || propAggregations.TryReadProperty(ref reader, options, PropAggregations1, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propGroupBy.TryReadProperty(ref reader, options, PropGroupBy, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.Pivot(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = propAggregations.Value, + GroupBy = propGroupBy.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.Pivot value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropGroupBy, value.GroupBy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Pivot.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Pivot.g.cs index 0939c57ab1f..43358501090 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Pivot.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Pivot.g.cs @@ -23,56 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class PivotConverter : System.Text.Json.Serialization.JsonConverter -{ - 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 PropGroupBy = System.Text.Json.JsonEncodedText.Encode("group_by"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.Pivot Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAggregations = default; - LocalJsonValue?> propGroupBy = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)) || propAggregations.TryReadProperty(ref reader, options, PropAggregations1, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propGroupBy.TryReadProperty(ref reader, options, PropGroupBy, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.Pivot(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Aggregations = propAggregations.Value, - GroupBy = propGroupBy.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.Pivot value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropGroupBy, value.GroupBy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.PivotConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.PivotConverter))] public sealed partial class Pivot { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/PivotGroupBy.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/PivotGroupBy.Converters.g.cs new file mode 100644 index 00000000000..2ea3d04a656 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/PivotGroupBy.Converters.g.cs @@ -0,0 +1,114 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class PivotGroupByConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantDateHistogram = System.Text.Json.JsonEncodedText.Encode("date_histogram"); + private static readonly System.Text.Json.JsonEncodedText VariantGeotileGrid = System.Text.Json.JsonEncodedText.Encode("geotile_grid"); + private static readonly System.Text.Json.JsonEncodedText VariantHistogram = System.Text.Json.JsonEncodedText.Encode("histogram"); + private static readonly System.Text.Json.JsonEncodedText VariantTerms = System.Text.Json.JsonEncodedText.Encode("terms"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.PivotGroupBy Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantDateHistogram)) + { + variantType = VariantDateHistogram.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantGeotileGrid)) + { + variantType = VariantGeotileGrid.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantHistogram)) + { + variantType = VariantHistogram.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTerms)) + { + variantType = VariantTerms.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.PivotGroupBy(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.PivotGroupBy value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "date_histogram": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregation)value.Variant, null, null); + break; + case "geotile_grid": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregation)value.Variant, null, null); + break; + case "histogram": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregation)value.Variant, null, null); + break; + case "terms": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.TermsAggregation)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.TransformManagement.PivotGroupBy)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/PivotGroupBy.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/PivotGroupBy.g.cs index eb1c2904315..97dc5402aee 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/PivotGroupBy.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/PivotGroupBy.g.cs @@ -23,97 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class PivotGroupByConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantDateHistogram = System.Text.Json.JsonEncodedText.Encode("date_histogram"); - private static readonly System.Text.Json.JsonEncodedText VariantGeotileGrid = System.Text.Json.JsonEncodedText.Encode("geotile_grid"); - private static readonly System.Text.Json.JsonEncodedText VariantHistogram = System.Text.Json.JsonEncodedText.Encode("histogram"); - private static readonly System.Text.Json.JsonEncodedText VariantTerms = System.Text.Json.JsonEncodedText.Encode("terms"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.PivotGroupBy Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantDateHistogram)) - { - variantType = VariantDateHistogram.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantGeotileGrid)) - { - variantType = VariantGeotileGrid.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantHistogram)) - { - variantType = VariantHistogram.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (reader.ValueTextEquals(VariantTerms)) - { - variantType = VariantTerms.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.PivotGroupBy(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.PivotGroupBy value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "date_histogram": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregation)value.Variant, null, null); - break; - case "geotile_grid": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.GeotileGridAggregation)value.Variant, null, null); - break; - case "histogram": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.HistogramAggregation)value.Variant, null, null); - break; - case "terms": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.TermsAggregation)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.TransformManagement.PivotGroupBy)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.PivotGroupByConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.PivotGroupByConverter))] public sealed partial class PivotGroupBy { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/RetentionPolicy.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/RetentionPolicy.Converters.g.cs new file mode 100644 index 00000000000..aba2ef05e85 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/RetentionPolicy.Converters.g.cs @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class RetentionPolicyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantTime = System.Text.Json.JsonEncodedText.Encode("time"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantTime)) + { + variantType = VariantTime.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "time": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.TransformManagement.TimeRetentionPolicy)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/RetentionPolicy.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/RetentionPolicy.g.cs index 17714bb5070..2e6a238c11d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/RetentionPolicy.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/RetentionPolicy.g.cs @@ -23,61 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class RetentionPolicyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantTime = System.Text.Json.JsonEncodedText.Encode("time"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantTime)) - { - variantType = VariantTime.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "time": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.TransformManagement.TimeRetentionPolicy)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicy)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.RetentionPolicyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.RetentionPolicyConverter))] public sealed partial class RetentionPolicy { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Settings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Settings.Converters.g.cs new file mode 100644 index 00000000000..bf5e5ef46ac --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Settings.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class SettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAlignCheckpoints = System.Text.Json.JsonEncodedText.Encode("align_checkpoints"); + private static readonly System.Text.Json.JsonEncodedText PropDatesAsEpochMillis = System.Text.Json.JsonEncodedText.Encode("dates_as_epoch_millis"); + private static readonly System.Text.Json.JsonEncodedText PropDeduceMappings = System.Text.Json.JsonEncodedText.Encode("deduce_mappings"); + private static readonly System.Text.Json.JsonEncodedText PropDocsPerSecond = System.Text.Json.JsonEncodedText.Encode("docs_per_second"); + private static readonly System.Text.Json.JsonEncodedText PropMaxPageSearchSize = System.Text.Json.JsonEncodedText.Encode("max_page_search_size"); + private static readonly System.Text.Json.JsonEncodedText PropUnattended = System.Text.Json.JsonEncodedText.Encode("unattended"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.Settings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAlignCheckpoints = default; + LocalJsonValue propDatesAsEpochMillis = default; + LocalJsonValue propDeduceMappings = default; + LocalJsonValue propDocsPerSecond = default; + LocalJsonValue propMaxPageSearchSize = default; + LocalJsonValue propUnattended = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAlignCheckpoints.TryReadProperty(ref reader, options, PropAlignCheckpoints, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDatesAsEpochMillis.TryReadProperty(ref reader, options, PropDatesAsEpochMillis, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDeduceMappings.TryReadProperty(ref reader, options, PropDeduceMappings, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDocsPerSecond.TryReadProperty(ref reader, options, PropDocsPerSecond, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMaxPageSearchSize.TryReadProperty(ref reader, options, PropMaxPageSearchSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propUnattended.TryReadProperty(ref reader, options, PropUnattended, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.Settings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AlignCheckpoints = propAlignCheckpoints.Value, + DatesAsEpochMillis = propDatesAsEpochMillis.Value, + DeduceMappings = propDeduceMappings.Value, + DocsPerSecond = propDocsPerSecond.Value, + MaxPageSearchSize = propMaxPageSearchSize.Value, + Unattended = propUnattended.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.Settings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAlignCheckpoints, value.AlignCheckpoints, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDatesAsEpochMillis, value.DatesAsEpochMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDeduceMappings, value.DeduceMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDocsPerSecond, value.DocsPerSecond, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxPageSearchSize, value.MaxPageSearchSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropUnattended, value.Unattended, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Settings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Settings.g.cs index b56d4c54394..6b85ef89116 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Settings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Settings.g.cs @@ -23,96 +23,12 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class SettingsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAlignCheckpoints = System.Text.Json.JsonEncodedText.Encode("align_checkpoints"); - private static readonly System.Text.Json.JsonEncodedText PropDatesAsEpochMillis = System.Text.Json.JsonEncodedText.Encode("dates_as_epoch_millis"); - private static readonly System.Text.Json.JsonEncodedText PropDeduceMappings = System.Text.Json.JsonEncodedText.Encode("deduce_mappings"); - private static readonly System.Text.Json.JsonEncodedText PropDocsPerSecond = System.Text.Json.JsonEncodedText.Encode("docs_per_second"); - private static readonly System.Text.Json.JsonEncodedText PropMaxPageSearchSize = System.Text.Json.JsonEncodedText.Encode("max_page_search_size"); - private static readonly System.Text.Json.JsonEncodedText PropUnattended = System.Text.Json.JsonEncodedText.Encode("unattended"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.Settings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAlignCheckpoints = default; - LocalJsonValue propDatesAsEpochMillis = default; - LocalJsonValue propDeduceMappings = default; - LocalJsonValue propDocsPerSecond = default; - LocalJsonValue propMaxPageSearchSize = default; - LocalJsonValue propUnattended = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAlignCheckpoints.TryReadProperty(ref reader, options, PropAlignCheckpoints, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDatesAsEpochMillis.TryReadProperty(ref reader, options, PropDatesAsEpochMillis, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDeduceMappings.TryReadProperty(ref reader, options, PropDeduceMappings, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDocsPerSecond.TryReadProperty(ref reader, options, PropDocsPerSecond, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propMaxPageSearchSize.TryReadProperty(ref reader, options, PropMaxPageSearchSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propUnattended.TryReadProperty(ref reader, options, PropUnattended, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.Settings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AlignCheckpoints = propAlignCheckpoints.Value, - DatesAsEpochMillis = propDatesAsEpochMillis.Value, - DeduceMappings = propDeduceMappings.Value, - DocsPerSecond = propDocsPerSecond.Value, - MaxPageSearchSize = propMaxPageSearchSize.Value, - Unattended = propUnattended.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.Settings value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAlignCheckpoints, value.AlignCheckpoints, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDatesAsEpochMillis, value.DatesAsEpochMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDeduceMappings, value.DeduceMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDocsPerSecond, value.DocsPerSecond, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxPageSearchSize, value.MaxPageSearchSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropUnattended, value.Unattended, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - /// /// /// The source of the data for the transform. /// /// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.SettingsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.SettingsConverter))] public sealed partial class Settings { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Source.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Source.Converters.g.cs new file mode 100644 index 00000000000..cd54568f432 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Source.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class SourceConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropRuntimeMappings = System.Text.Json.JsonEncodedText.Encode("runtime_mappings"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.Source Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndices = default; + LocalJsonValue propQuery = default; + LocalJsonValue?> propRuntimeMappings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) + { + continue; + } + + if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.Source(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Indices = propIndices.Value, + Query = propQuery.Value, + RuntimeMappings = propRuntimeMappings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.Source value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndices, value.Indices, null, null); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Source.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Source.g.cs index f51deef51e6..670b0147418 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Source.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Source.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class SourceConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("index"); - private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); - private static readonly System.Text.Json.JsonEncodedText PropRuntimeMappings = System.Text.Json.JsonEncodedText.Encode("runtime_mappings"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.Source Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndices = default; - LocalJsonValue propQuery = default; - LocalJsonValue?> propRuntimeMappings = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) - { - continue; - } - - if (propQuery.TryReadProperty(ref reader, options, PropQuery, null)) - { - continue; - } - - if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.Source(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Indices = propIndices.Value, - Query = propQuery.Value, - RuntimeMappings = propRuntimeMappings.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.Source value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndices, value.Indices, null, null); - writer.WriteProperty(options, PropQuery, value.Query, null, null); - writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.SourceConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.SourceConverter))] public sealed partial class Source { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Sync.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Sync.Converters.g.cs new file mode 100644 index 00000000000..a0dca164527 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Sync.Converters.g.cs @@ -0,0 +1,78 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class SyncConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantTime = System.Text.Json.JsonEncodedText.Encode("time"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.Sync Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantTime)) + { + variantType = VariantTime.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.Sync(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.Sync value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "time": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.TransformManagement.TimeSync)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.TransformManagement.Sync)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Sync.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Sync.g.cs index 8280d0c4774..7b375a6d52c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Sync.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Sync.g.cs @@ -23,61 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class SyncConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText VariantTime = System.Text.Json.JsonEncodedText.Encode("time"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.Sync Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - string? variantType = null; - object? variant = null; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (reader.ValueTextEquals(VariantTime)) - { - variantType = VariantTime.Value; - reader.Read(); - variant = reader.ReadValue(options, null); - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.Sync(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - VariantType = variantType, - Variant = variant - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.Sync value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - switch (value.VariantType) - { - case null: - break; - case "time": - writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.TransformManagement.TimeSync)value.Variant, null, null); - break; - default: - throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.TransformManagement.Sync)}'."); - } - - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.SyncConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.SyncConverter))] public sealed partial class Sync { internal string? VariantType { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TimeRetentionPolicy.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TimeRetentionPolicy.Converters.g.cs new file mode 100644 index 00000000000..da3a26b8fd3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TimeRetentionPolicy.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class TimeRetentionPolicyConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropMaxAge = System.Text.Json.JsonEncodedText.Encode("max_age"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.TimeRetentionPolicy Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propMaxAge = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propMaxAge.TryReadProperty(ref reader, options, PropMaxAge, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.TimeRetentionPolicy(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + MaxAge = propMaxAge.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.TimeRetentionPolicy value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropMaxAge, value.MaxAge, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TimeRetentionPolicy.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TimeRetentionPolicy.g.cs index f7bfed1a5b7..e74e15b4e81 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TimeRetentionPolicy.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TimeRetentionPolicy.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class TimeRetentionPolicyConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - private static readonly System.Text.Json.JsonEncodedText PropMaxAge = System.Text.Json.JsonEncodedText.Encode("max_age"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.TimeRetentionPolicy Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propField = default; - LocalJsonValue propMaxAge = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (propMaxAge.TryReadProperty(ref reader, options, PropMaxAge, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.TimeRetentionPolicy(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Field = propField.Value, - MaxAge = propMaxAge.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.TimeRetentionPolicy value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteProperty(options, PropMaxAge, value.MaxAge, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.TimeRetentionPolicyConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.TimeRetentionPolicyConverter))] public sealed partial class TimeRetentionPolicy { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TimeSync.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TimeSync.Converters.g.cs new file mode 100644 index 00000000000..95251029bc5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TimeSync.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class TimeSyncConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDelay = System.Text.Json.JsonEncodedText.Encode("delay"); + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.TimeSync Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDelay = default; + LocalJsonValue propField = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDelay.TryReadProperty(ref reader, options, PropDelay, null)) + { + continue; + } + + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.TimeSync(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Delay = propDelay.Value, + Field = propField.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.TimeSync value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDelay, value.Delay, null, null); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TimeSync.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TimeSync.g.cs index 12692ee1dfb..a0870960550 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TimeSync.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TimeSync.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class TimeSyncConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDelay = System.Text.Json.JsonEncodedText.Encode("delay"); - private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.TimeSync Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDelay = default; - LocalJsonValue propField = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDelay.TryReadProperty(ref reader, options, PropDelay, null)) - { - continue; - } - - if (propField.TryReadProperty(ref reader, options, PropField, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.TimeSync(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Delay = propDelay.Value, - Field = propField.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.TimeSync value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDelay, value.Delay, null, null); - writer.WriteProperty(options, PropField, value.Field, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.TimeSyncConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.TimeSyncConverter))] public sealed partial class TimeSync { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformHealthIssue.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformHealthIssue.Converters.g.cs new file mode 100644 index 00000000000..1167d555944 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformHealthIssue.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class TransformHealthIssueConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); + private static readonly System.Text.Json.JsonEncodedText PropFirstOccurenceString = System.Text.Json.JsonEncodedText.Encode("first_occurence_string"); + private static readonly System.Text.Json.JsonEncodedText PropFirstOccurrence = System.Text.Json.JsonEncodedText.Encode("first_occurrence"); + private static readonly System.Text.Json.JsonEncodedText PropIssue = System.Text.Json.JsonEncodedText.Encode("issue"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.TransformHealthIssue Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propDetails = default; + LocalJsonValue propFirstOccurenceString = default; + LocalJsonValue propFirstOccurrence = default; + LocalJsonValue propIssue = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propDetails.TryReadProperty(ref reader, options, PropDetails, null)) + { + continue; + } + + if (propFirstOccurenceString.TryReadProperty(ref reader, options, PropFirstOccurenceString, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propFirstOccurrence.TryReadProperty(ref reader, options, PropFirstOccurrence, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propIssue.TryReadProperty(ref reader, options, PropIssue, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.TransformHealthIssue(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Details = propDetails.Value, + FirstOccurenceString = propFirstOccurenceString.Value, + FirstOccurrence = propFirstOccurrence.Value, + Issue = propIssue.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.TransformHealthIssue value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropDetails, value.Details, null, null); + writer.WriteProperty(options, PropFirstOccurenceString, value.FirstOccurenceString, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropFirstOccurrence, value.FirstOccurrence, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropIssue, value.Issue, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformHealthIssue.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformHealthIssue.g.cs index 5204bfb64fe..54b1421db66 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformHealthIssue.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformHealthIssue.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class TransformHealthIssueConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropDetails = System.Text.Json.JsonEncodedText.Encode("details"); - private static readonly System.Text.Json.JsonEncodedText PropFirstOccurenceString = System.Text.Json.JsonEncodedText.Encode("first_occurence_string"); - private static readonly System.Text.Json.JsonEncodedText PropFirstOccurrence = System.Text.Json.JsonEncodedText.Encode("first_occurrence"); - private static readonly System.Text.Json.JsonEncodedText PropIssue = System.Text.Json.JsonEncodedText.Encode("issue"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.TransformHealthIssue Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propDetails = default; - LocalJsonValue propFirstOccurenceString = default; - LocalJsonValue propFirstOccurrence = default; - LocalJsonValue propIssue = default; - LocalJsonValue propType = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propDetails.TryReadProperty(ref reader, options, PropDetails, null)) - { - continue; - } - - if (propFirstOccurenceString.TryReadProperty(ref reader, options, PropFirstOccurenceString, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propFirstOccurrence.TryReadProperty(ref reader, options, PropFirstOccurrence, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propIssue.TryReadProperty(ref reader, options, PropIssue, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.TransformHealthIssue(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Details = propDetails.Value, - FirstOccurenceString = propFirstOccurenceString.Value, - FirstOccurrence = propFirstOccurrence.Value, - Issue = propIssue.Value, - Type = propType.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.TransformHealthIssue value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropDetails, value.Details, null, null); - writer.WriteProperty(options, PropFirstOccurenceString, value.FirstOccurenceString, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropFirstOccurrence, value.FirstOccurrence, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropIssue, value.Issue, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.TransformHealthIssueConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.TransformHealthIssueConverter))] public sealed partial class TransformHealthIssue { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformIndexerStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformIndexerStats.Converters.g.cs new file mode 100644 index 00000000000..99ba73b6419 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformIndexerStats.Converters.g.cs @@ -0,0 +1,207 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class TransformIndexerStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDeleteTimeInMs = System.Text.Json.JsonEncodedText.Encode("delete_time_in_ms"); + private static readonly System.Text.Json.JsonEncodedText PropDocumentsDeleted = System.Text.Json.JsonEncodedText.Encode("documents_deleted"); + private static readonly System.Text.Json.JsonEncodedText PropDocumentsIndexed = System.Text.Json.JsonEncodedText.Encode("documents_indexed"); + private static readonly System.Text.Json.JsonEncodedText PropDocumentsProcessed = System.Text.Json.JsonEncodedText.Encode("documents_processed"); + private static readonly System.Text.Json.JsonEncodedText PropExponentialAvgCheckpointDurationMs = System.Text.Json.JsonEncodedText.Encode("exponential_avg_checkpoint_duration_ms"); + private static readonly System.Text.Json.JsonEncodedText PropExponentialAvgDocumentsIndexed = System.Text.Json.JsonEncodedText.Encode("exponential_avg_documents_indexed"); + private static readonly System.Text.Json.JsonEncodedText PropExponentialAvgDocumentsProcessed = System.Text.Json.JsonEncodedText.Encode("exponential_avg_documents_processed"); + private static readonly System.Text.Json.JsonEncodedText PropIndexFailures = System.Text.Json.JsonEncodedText.Encode("index_failures"); + private static readonly System.Text.Json.JsonEncodedText PropIndexTimeInMs = System.Text.Json.JsonEncodedText.Encode("index_time_in_ms"); + private static readonly System.Text.Json.JsonEncodedText PropIndexTotal = System.Text.Json.JsonEncodedText.Encode("index_total"); + private static readonly System.Text.Json.JsonEncodedText PropPagesProcessed = System.Text.Json.JsonEncodedText.Encode("pages_processed"); + private static readonly System.Text.Json.JsonEncodedText PropProcessingTimeInMs = System.Text.Json.JsonEncodedText.Encode("processing_time_in_ms"); + private static readonly System.Text.Json.JsonEncodedText PropProcessingTotal = System.Text.Json.JsonEncodedText.Encode("processing_total"); + private static readonly System.Text.Json.JsonEncodedText PropSearchFailures = System.Text.Json.JsonEncodedText.Encode("search_failures"); + private static readonly System.Text.Json.JsonEncodedText PropSearchTimeInMs = System.Text.Json.JsonEncodedText.Encode("search_time_in_ms"); + private static readonly System.Text.Json.JsonEncodedText PropSearchTotal = System.Text.Json.JsonEncodedText.Encode("search_total"); + private static readonly System.Text.Json.JsonEncodedText PropTriggerCount = System.Text.Json.JsonEncodedText.Encode("trigger_count"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.TransformIndexerStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDeleteTimeInMs = default; + LocalJsonValue propDocumentsDeleted = default; + LocalJsonValue propDocumentsIndexed = default; + LocalJsonValue propDocumentsProcessed = default; + LocalJsonValue propExponentialAvgCheckpointDurationMs = default; + LocalJsonValue propExponentialAvgDocumentsIndexed = default; + LocalJsonValue propExponentialAvgDocumentsProcessed = default; + LocalJsonValue propIndexFailures = default; + LocalJsonValue propIndexTimeInMs = default; + LocalJsonValue propIndexTotal = default; + LocalJsonValue propPagesProcessed = default; + LocalJsonValue propProcessingTimeInMs = default; + LocalJsonValue propProcessingTotal = default; + LocalJsonValue propSearchFailures = default; + LocalJsonValue propSearchTimeInMs = default; + LocalJsonValue propSearchTotal = default; + LocalJsonValue propTriggerCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDeleteTimeInMs.TryReadProperty(ref reader, options, PropDeleteTimeInMs, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propDocumentsDeleted.TryReadProperty(ref reader, options, PropDocumentsDeleted, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propDocumentsIndexed.TryReadProperty(ref reader, options, PropDocumentsIndexed, null)) + { + continue; + } + + if (propDocumentsProcessed.TryReadProperty(ref reader, options, PropDocumentsProcessed, null)) + { + continue; + } + + if (propExponentialAvgCheckpointDurationMs.TryReadProperty(ref reader, options, PropExponentialAvgCheckpointDurationMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propExponentialAvgDocumentsIndexed.TryReadProperty(ref reader, options, PropExponentialAvgDocumentsIndexed, null)) + { + continue; + } + + if (propExponentialAvgDocumentsProcessed.TryReadProperty(ref reader, options, PropExponentialAvgDocumentsProcessed, null)) + { + continue; + } + + if (propIndexFailures.TryReadProperty(ref reader, options, PropIndexFailures, null)) + { + continue; + } + + if (propIndexTimeInMs.TryReadProperty(ref reader, options, PropIndexTimeInMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propIndexTotal.TryReadProperty(ref reader, options, PropIndexTotal, null)) + { + continue; + } + + if (propPagesProcessed.TryReadProperty(ref reader, options, PropPagesProcessed, null)) + { + continue; + } + + if (propProcessingTimeInMs.TryReadProperty(ref reader, options, PropProcessingTimeInMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propProcessingTotal.TryReadProperty(ref reader, options, PropProcessingTotal, null)) + { + continue; + } + + if (propSearchFailures.TryReadProperty(ref reader, options, PropSearchFailures, null)) + { + continue; + } + + if (propSearchTimeInMs.TryReadProperty(ref reader, options, PropSearchTimeInMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propSearchTotal.TryReadProperty(ref reader, options, PropSearchTotal, null)) + { + continue; + } + + if (propTriggerCount.TryReadProperty(ref reader, options, PropTriggerCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.TransformIndexerStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DeleteTimeInMs = propDeleteTimeInMs.Value, + DocumentsDeleted = propDocumentsDeleted.Value, + DocumentsIndexed = propDocumentsIndexed.Value, + DocumentsProcessed = propDocumentsProcessed.Value, + ExponentialAvgCheckpointDurationMs = propExponentialAvgCheckpointDurationMs.Value, + ExponentialAvgDocumentsIndexed = propExponentialAvgDocumentsIndexed.Value, + ExponentialAvgDocumentsProcessed = propExponentialAvgDocumentsProcessed.Value, + IndexFailures = propIndexFailures.Value, + IndexTimeInMs = propIndexTimeInMs.Value, + IndexTotal = propIndexTotal.Value, + PagesProcessed = propPagesProcessed.Value, + ProcessingTimeInMs = propProcessingTimeInMs.Value, + ProcessingTotal = propProcessingTotal.Value, + SearchFailures = propSearchFailures.Value, + SearchTimeInMs = propSearchTimeInMs.Value, + SearchTotal = propSearchTotal.Value, + TriggerCount = propTriggerCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.TransformIndexerStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDeleteTimeInMs, value.DeleteTimeInMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropDocumentsDeleted, value.DocumentsDeleted, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropDocumentsIndexed, value.DocumentsIndexed, null, null); + writer.WriteProperty(options, PropDocumentsProcessed, value.DocumentsProcessed, null, null); + writer.WriteProperty(options, PropExponentialAvgCheckpointDurationMs, value.ExponentialAvgCheckpointDurationMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropExponentialAvgDocumentsIndexed, value.ExponentialAvgDocumentsIndexed, null, null); + writer.WriteProperty(options, PropExponentialAvgDocumentsProcessed, value.ExponentialAvgDocumentsProcessed, null, null); + writer.WriteProperty(options, PropIndexFailures, value.IndexFailures, null, null); + writer.WriteProperty(options, PropIndexTimeInMs, value.IndexTimeInMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropIndexTotal, value.IndexTotal, null, null); + writer.WriteProperty(options, PropPagesProcessed, value.PagesProcessed, null, null); + writer.WriteProperty(options, PropProcessingTimeInMs, value.ProcessingTimeInMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropProcessingTotal, value.ProcessingTotal, null, null); + writer.WriteProperty(options, PropSearchFailures, value.SearchFailures, null, null); + writer.WriteProperty(options, PropSearchTimeInMs, value.SearchTimeInMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropSearchTotal, value.SearchTotal, null, null); + writer.WriteProperty(options, PropTriggerCount, value.TriggerCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformIndexerStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformIndexerStats.g.cs index 1feebb61d6b..bbd6d33e7e6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformIndexerStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformIndexerStats.g.cs @@ -23,190 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class TransformIndexerStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDeleteTimeInMs = System.Text.Json.JsonEncodedText.Encode("delete_time_in_ms"); - private static readonly System.Text.Json.JsonEncodedText PropDocumentsDeleted = System.Text.Json.JsonEncodedText.Encode("documents_deleted"); - private static readonly System.Text.Json.JsonEncodedText PropDocumentsIndexed = System.Text.Json.JsonEncodedText.Encode("documents_indexed"); - private static readonly System.Text.Json.JsonEncodedText PropDocumentsProcessed = System.Text.Json.JsonEncodedText.Encode("documents_processed"); - private static readonly System.Text.Json.JsonEncodedText PropExponentialAvgCheckpointDurationMs = System.Text.Json.JsonEncodedText.Encode("exponential_avg_checkpoint_duration_ms"); - private static readonly System.Text.Json.JsonEncodedText PropExponentialAvgDocumentsIndexed = System.Text.Json.JsonEncodedText.Encode("exponential_avg_documents_indexed"); - private static readonly System.Text.Json.JsonEncodedText PropExponentialAvgDocumentsProcessed = System.Text.Json.JsonEncodedText.Encode("exponential_avg_documents_processed"); - private static readonly System.Text.Json.JsonEncodedText PropIndexFailures = System.Text.Json.JsonEncodedText.Encode("index_failures"); - private static readonly System.Text.Json.JsonEncodedText PropIndexTimeInMs = System.Text.Json.JsonEncodedText.Encode("index_time_in_ms"); - private static readonly System.Text.Json.JsonEncodedText PropIndexTotal = System.Text.Json.JsonEncodedText.Encode("index_total"); - private static readonly System.Text.Json.JsonEncodedText PropPagesProcessed = System.Text.Json.JsonEncodedText.Encode("pages_processed"); - private static readonly System.Text.Json.JsonEncodedText PropProcessingTimeInMs = System.Text.Json.JsonEncodedText.Encode("processing_time_in_ms"); - private static readonly System.Text.Json.JsonEncodedText PropProcessingTotal = System.Text.Json.JsonEncodedText.Encode("processing_total"); - private static readonly System.Text.Json.JsonEncodedText PropSearchFailures = System.Text.Json.JsonEncodedText.Encode("search_failures"); - private static readonly System.Text.Json.JsonEncodedText PropSearchTimeInMs = System.Text.Json.JsonEncodedText.Encode("search_time_in_ms"); - private static readonly System.Text.Json.JsonEncodedText PropSearchTotal = System.Text.Json.JsonEncodedText.Encode("search_total"); - private static readonly System.Text.Json.JsonEncodedText PropTriggerCount = System.Text.Json.JsonEncodedText.Encode("trigger_count"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.TransformIndexerStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDeleteTimeInMs = default; - LocalJsonValue propDocumentsDeleted = default; - LocalJsonValue propDocumentsIndexed = default; - LocalJsonValue propDocumentsProcessed = default; - LocalJsonValue propExponentialAvgCheckpointDurationMs = default; - LocalJsonValue propExponentialAvgDocumentsIndexed = default; - LocalJsonValue propExponentialAvgDocumentsProcessed = default; - LocalJsonValue propIndexFailures = default; - LocalJsonValue propIndexTimeInMs = default; - LocalJsonValue propIndexTotal = default; - LocalJsonValue propPagesProcessed = default; - LocalJsonValue propProcessingTimeInMs = default; - LocalJsonValue propProcessingTotal = default; - LocalJsonValue propSearchFailures = default; - LocalJsonValue propSearchTimeInMs = default; - LocalJsonValue propSearchTotal = default; - LocalJsonValue propTriggerCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDeleteTimeInMs.TryReadProperty(ref reader, options, PropDeleteTimeInMs, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propDocumentsDeleted.TryReadProperty(ref reader, options, PropDocumentsDeleted, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propDocumentsIndexed.TryReadProperty(ref reader, options, PropDocumentsIndexed, null)) - { - continue; - } - - if (propDocumentsProcessed.TryReadProperty(ref reader, options, PropDocumentsProcessed, null)) - { - continue; - } - - if (propExponentialAvgCheckpointDurationMs.TryReadProperty(ref reader, options, PropExponentialAvgCheckpointDurationMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propExponentialAvgDocumentsIndexed.TryReadProperty(ref reader, options, PropExponentialAvgDocumentsIndexed, null)) - { - continue; - } - - if (propExponentialAvgDocumentsProcessed.TryReadProperty(ref reader, options, PropExponentialAvgDocumentsProcessed, null)) - { - continue; - } - - if (propIndexFailures.TryReadProperty(ref reader, options, PropIndexFailures, null)) - { - continue; - } - - if (propIndexTimeInMs.TryReadProperty(ref reader, options, PropIndexTimeInMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propIndexTotal.TryReadProperty(ref reader, options, PropIndexTotal, null)) - { - continue; - } - - if (propPagesProcessed.TryReadProperty(ref reader, options, PropPagesProcessed, null)) - { - continue; - } - - if (propProcessingTimeInMs.TryReadProperty(ref reader, options, PropProcessingTimeInMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propProcessingTotal.TryReadProperty(ref reader, options, PropProcessingTotal, null)) - { - continue; - } - - if (propSearchFailures.TryReadProperty(ref reader, options, PropSearchFailures, null)) - { - continue; - } - - if (propSearchTimeInMs.TryReadProperty(ref reader, options, PropSearchTimeInMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (propSearchTotal.TryReadProperty(ref reader, options, PropSearchTotal, null)) - { - continue; - } - - if (propTriggerCount.TryReadProperty(ref reader, options, PropTriggerCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.TransformIndexerStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DeleteTimeInMs = propDeleteTimeInMs.Value, - DocumentsDeleted = propDocumentsDeleted.Value, - DocumentsIndexed = propDocumentsIndexed.Value, - DocumentsProcessed = propDocumentsProcessed.Value, - ExponentialAvgCheckpointDurationMs = propExponentialAvgCheckpointDurationMs.Value, - ExponentialAvgDocumentsIndexed = propExponentialAvgDocumentsIndexed.Value, - ExponentialAvgDocumentsProcessed = propExponentialAvgDocumentsProcessed.Value, - IndexFailures = propIndexFailures.Value, - IndexTimeInMs = propIndexTimeInMs.Value, - IndexTotal = propIndexTotal.Value, - PagesProcessed = propPagesProcessed.Value, - ProcessingTimeInMs = propProcessingTimeInMs.Value, - ProcessingTotal = propProcessingTotal.Value, - SearchFailures = propSearchFailures.Value, - SearchTimeInMs = propSearchTimeInMs.Value, - SearchTotal = propSearchTotal.Value, - TriggerCount = propTriggerCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.TransformIndexerStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDeleteTimeInMs, value.DeleteTimeInMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropDocumentsDeleted, value.DocumentsDeleted, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropDocumentsIndexed, value.DocumentsIndexed, null, null); - writer.WriteProperty(options, PropDocumentsProcessed, value.DocumentsProcessed, null, null); - writer.WriteProperty(options, PropExponentialAvgCheckpointDurationMs, value.ExponentialAvgCheckpointDurationMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropExponentialAvgDocumentsIndexed, value.ExponentialAvgDocumentsIndexed, null, null); - writer.WriteProperty(options, PropExponentialAvgDocumentsProcessed, value.ExponentialAvgDocumentsProcessed, null, null); - writer.WriteProperty(options, PropIndexFailures, value.IndexFailures, null, null); - writer.WriteProperty(options, PropIndexTimeInMs, value.IndexTimeInMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropIndexTotal, value.IndexTotal, null, null); - writer.WriteProperty(options, PropPagesProcessed, value.PagesProcessed, null, null); - writer.WriteProperty(options, PropProcessingTimeInMs, value.ProcessingTimeInMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropProcessingTotal, value.ProcessingTotal, null, null); - writer.WriteProperty(options, PropSearchFailures, value.SearchFailures, null, null); - writer.WriteProperty(options, PropSearchTimeInMs, value.SearchTimeInMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteProperty(options, PropSearchTotal, value.SearchTotal, null, null); - writer.WriteProperty(options, PropTriggerCount, value.TriggerCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.TransformIndexerStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.TransformIndexerStatsConverter))] public sealed partial class TransformIndexerStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformProgress.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformProgress.Converters.g.cs new file mode 100644 index 00000000000..1e8647cf70a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformProgress.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class TransformProgressConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocsIndexed = System.Text.Json.JsonEncodedText.Encode("docs_indexed"); + private static readonly System.Text.Json.JsonEncodedText PropDocsProcessed = System.Text.Json.JsonEncodedText.Encode("docs_processed"); + private static readonly System.Text.Json.JsonEncodedText PropDocsRemaining = System.Text.Json.JsonEncodedText.Encode("docs_remaining"); + private static readonly System.Text.Json.JsonEncodedText PropPercentComplete = System.Text.Json.JsonEncodedText.Encode("percent_complete"); + private static readonly System.Text.Json.JsonEncodedText PropTotalDocs = System.Text.Json.JsonEncodedText.Encode("total_docs"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.TransformProgress Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDocsIndexed = default; + LocalJsonValue propDocsProcessed = default; + LocalJsonValue propDocsRemaining = default; + LocalJsonValue propPercentComplete = default; + LocalJsonValue propTotalDocs = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocsIndexed.TryReadProperty(ref reader, options, PropDocsIndexed, null)) + { + continue; + } + + if (propDocsProcessed.TryReadProperty(ref reader, options, PropDocsProcessed, null)) + { + continue; + } + + if (propDocsRemaining.TryReadProperty(ref reader, options, PropDocsRemaining, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPercentComplete.TryReadProperty(ref reader, options, PropPercentComplete, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotalDocs.TryReadProperty(ref reader, options, PropTotalDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.TransformProgress(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DocsIndexed = propDocsIndexed.Value, + DocsProcessed = propDocsProcessed.Value, + DocsRemaining = propDocsRemaining.Value, + PercentComplete = propPercentComplete.Value, + TotalDocs = propTotalDocs.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.TransformProgress value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocsIndexed, value.DocsIndexed, null, null); + writer.WriteProperty(options, PropDocsProcessed, value.DocsProcessed, null, null); + writer.WriteProperty(options, PropDocsRemaining, value.DocsRemaining, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPercentComplete, value.PercentComplete, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotalDocs, value.TotalDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformProgress.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformProgress.g.cs index 722cdc1551a..f8eeac8aada 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformProgress.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformProgress.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class TransformProgressConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocsIndexed = System.Text.Json.JsonEncodedText.Encode("docs_indexed"); - private static readonly System.Text.Json.JsonEncodedText PropDocsProcessed = System.Text.Json.JsonEncodedText.Encode("docs_processed"); - private static readonly System.Text.Json.JsonEncodedText PropDocsRemaining = System.Text.Json.JsonEncodedText.Encode("docs_remaining"); - private static readonly System.Text.Json.JsonEncodedText PropPercentComplete = System.Text.Json.JsonEncodedText.Encode("percent_complete"); - private static readonly System.Text.Json.JsonEncodedText PropTotalDocs = System.Text.Json.JsonEncodedText.Encode("total_docs"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.TransformProgress Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDocsIndexed = default; - LocalJsonValue propDocsProcessed = default; - LocalJsonValue propDocsRemaining = default; - LocalJsonValue propPercentComplete = default; - LocalJsonValue propTotalDocs = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocsIndexed.TryReadProperty(ref reader, options, PropDocsIndexed, null)) - { - continue; - } - - if (propDocsProcessed.TryReadProperty(ref reader, options, PropDocsProcessed, null)) - { - continue; - } - - if (propDocsRemaining.TryReadProperty(ref reader, options, PropDocsRemaining, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPercentComplete.TryReadProperty(ref reader, options, PropPercentComplete, static double? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotalDocs.TryReadProperty(ref reader, options, PropTotalDocs, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.TransformProgress(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DocsIndexed = propDocsIndexed.Value, - DocsProcessed = propDocsProcessed.Value, - DocsRemaining = propDocsRemaining.Value, - PercentComplete = propPercentComplete.Value, - TotalDocs = propTotalDocs.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.TransformProgress value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocsIndexed, value.DocsIndexed, null, null); - writer.WriteProperty(options, PropDocsProcessed, value.DocsProcessed, null, null); - writer.WriteProperty(options, PropDocsRemaining, value.DocsRemaining, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPercentComplete, value.PercentComplete, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, double? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotalDocs, value.TotalDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.TransformProgressConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.TransformProgressConverter))] public sealed partial class TransformProgress { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformStats.Converters.g.cs new file mode 100644 index 00000000000..d7bcef3da95 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformStats.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class TransformStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCheckpointing = System.Text.Json.JsonEncodedText.Encode("checkpointing"); + private static readonly System.Text.Json.JsonEncodedText PropHealth = System.Text.Json.JsonEncodedText.Encode("health"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); + private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); + private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); + private static readonly System.Text.Json.JsonEncodedText PropStats = System.Text.Json.JsonEncodedText.Encode("stats"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.TransformStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCheckpointing = default; + LocalJsonValue propHealth = default; + LocalJsonValue propId = default; + LocalJsonValue propNode = default; + LocalJsonValue propReason = default; + LocalJsonValue propState = default; + LocalJsonValue propStats = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCheckpointing.TryReadProperty(ref reader, options, PropCheckpointing, null)) + { + continue; + } + + if (propHealth.TryReadProperty(ref reader, options, PropHealth, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propNode.TryReadProperty(ref reader, options, PropNode, null)) + { + continue; + } + + if (propReason.TryReadProperty(ref reader, options, PropReason, null)) + { + continue; + } + + if (propState.TryReadProperty(ref reader, options, PropState, null)) + { + continue; + } + + if (propStats.TryReadProperty(ref reader, options, PropStats, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.TransformStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Checkpointing = propCheckpointing.Value, + Health = propHealth.Value, + Id = propId.Value, + Node = propNode.Value, + Reason = propReason.Value, + State = propState.Value, + Stats = propStats.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.TransformStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCheckpointing, value.Checkpointing, null, null); + writer.WriteProperty(options, PropHealth, value.Health, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropNode, value.Node, null, null); + writer.WriteProperty(options, PropReason, value.Reason, null, null); + writer.WriteProperty(options, PropState, value.State, null, null); + writer.WriteProperty(options, PropStats, value.Stats, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformStats.g.cs index fcb82953cb7..a90b2575fa9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformStats.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class TransformStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCheckpointing = System.Text.Json.JsonEncodedText.Encode("checkpointing"); - private static readonly System.Text.Json.JsonEncodedText PropHealth = System.Text.Json.JsonEncodedText.Encode("health"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropNode = System.Text.Json.JsonEncodedText.Encode("node"); - private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); - private static readonly System.Text.Json.JsonEncodedText PropState = System.Text.Json.JsonEncodedText.Encode("state"); - private static readonly System.Text.Json.JsonEncodedText PropStats = System.Text.Json.JsonEncodedText.Encode("stats"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.TransformStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCheckpointing = default; - LocalJsonValue propHealth = default; - LocalJsonValue propId = default; - LocalJsonValue propNode = default; - LocalJsonValue propReason = default; - LocalJsonValue propState = default; - LocalJsonValue propStats = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCheckpointing.TryReadProperty(ref reader, options, PropCheckpointing, null)) - { - continue; - } - - if (propHealth.TryReadProperty(ref reader, options, PropHealth, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propNode.TryReadProperty(ref reader, options, PropNode, null)) - { - continue; - } - - if (propReason.TryReadProperty(ref reader, options, PropReason, null)) - { - continue; - } - - if (propState.TryReadProperty(ref reader, options, PropState, null)) - { - continue; - } - - if (propStats.TryReadProperty(ref reader, options, PropStats, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.TransformStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Checkpointing = propCheckpointing.Value, - Health = propHealth.Value, - Id = propId.Value, - Node = propNode.Value, - Reason = propReason.Value, - State = propState.Value, - Stats = propStats.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.TransformStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCheckpointing, value.Checkpointing, null, null); - writer.WriteProperty(options, PropHealth, value.Health, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropNode, value.Node, null, null); - writer.WriteProperty(options, PropReason, value.Reason, null, null); - writer.WriteProperty(options, PropState, value.State, null, null); - writer.WriteProperty(options, PropStats, value.Stats, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.TransformStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.TransformStatsConverter))] public sealed partial class TransformStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformStatsHealth.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformStatsHealth.Converters.g.cs new file mode 100644 index 00000000000..0efde840646 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformStatsHealth.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class TransformStatsHealthConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIssues = System.Text.Json.JsonEncodedText.Encode("issues"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.TransformStatsHealth Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propIssues = default; + LocalJsonValue propStatus = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIssues.TryReadProperty(ref reader, options, PropIssues, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.TransformStatsHealth(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Issues = propIssues.Value, + Status = propStatus.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.TransformStatsHealth value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIssues, value.Issues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformStatsHealth.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformStatsHealth.g.cs index 9a6d16cb5a6..0c48be0428b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformStatsHealth.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformStatsHealth.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class TransformStatsHealthConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIssues = System.Text.Json.JsonEncodedText.Encode("issues"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.TransformStatsHealth Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propIssues = default; - LocalJsonValue propStatus = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIssues.TryReadProperty(ref reader, options, PropIssues, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.TransformStatsHealth(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Issues = propIssues.Value, - Status = propStatus.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.TransformStatsHealth value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIssues, value.Issues, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.TransformStatsHealthConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.TransformStatsHealthConverter))] public sealed partial class TransformStatsHealth { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformSummary.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformSummary.Converters.g.cs new file mode 100644 index 00000000000..797aac017d4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformSummary.Converters.g.cs @@ -0,0 +1,189 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.TransformManagement.Json; + +public sealed partial class TransformSummaryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAuthorization = System.Text.Json.JsonEncodedText.Encode("authorization"); + private static readonly System.Text.Json.JsonEncodedText PropCreateTime = System.Text.Json.JsonEncodedText.Encode("create_time"); + private static readonly System.Text.Json.JsonEncodedText PropCreateTimeString = System.Text.Json.JsonEncodedText.Encode("create_time_string"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropDest = System.Text.Json.JsonEncodedText.Encode("dest"); + private static readonly System.Text.Json.JsonEncodedText PropFrequency = System.Text.Json.JsonEncodedText.Encode("frequency"); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); + private static readonly System.Text.Json.JsonEncodedText PropLatest = System.Text.Json.JsonEncodedText.Encode("latest"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); + private static readonly System.Text.Json.JsonEncodedText PropPivot = System.Text.Json.JsonEncodedText.Encode("pivot"); + private static readonly System.Text.Json.JsonEncodedText PropRetentionPolicy = System.Text.Json.JsonEncodedText.Encode("retention_policy"); + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + private static readonly System.Text.Json.JsonEncodedText PropSync = System.Text.Json.JsonEncodedText.Encode("sync"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.TransformManagement.TransformSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAuthorization = default; + LocalJsonValue propCreateTime = default; + LocalJsonValue propCreateTimeString = default; + LocalJsonValue propDescription = default; + LocalJsonValue propDest = default; + LocalJsonValue propFrequency = default; + LocalJsonValue propId = default; + LocalJsonValue propLatest = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propPivot = default; + LocalJsonValue propRetentionPolicy = default; + LocalJsonValue propSettings = default; + LocalJsonValue propSource = default; + LocalJsonValue propSync = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAuthorization.TryReadProperty(ref reader, options, PropAuthorization, null)) + { + continue; + } + + if (propCreateTime.TryReadProperty(ref reader, options, PropCreateTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propCreateTimeString.TryReadProperty(ref reader, options, PropCreateTimeString, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propDest.TryReadProperty(ref reader, options, PropDest, null)) + { + continue; + } + + if (propFrequency.TryReadProperty(ref reader, options, PropFrequency, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propLatest.TryReadProperty(ref reader, options, PropLatest, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propPivot.TryReadProperty(ref reader, options, PropPivot, null)) + { + continue; + } + + if (propRetentionPolicy.TryReadProperty(ref reader, options, PropRetentionPolicy, null)) + { + continue; + } + + if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (propSync.TryReadProperty(ref reader, options, PropSync, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TransformManagement.TransformSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Authorization = propAuthorization.Value, + CreateTime = propCreateTime.Value, + CreateTimeString = propCreateTimeString.Value, + Description = propDescription.Value, + Dest = propDest.Value, + Frequency = propFrequency.Value, + Id = propId.Value, + Latest = propLatest.Value, + Meta = propMeta.Value, + Pivot = propPivot.Value, + RetentionPolicy = propRetentionPolicy.Value, + Settings = propSettings.Value, + Source = propSource.Value, + Sync = propSync.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.TransformSummary value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAuthorization, value.Authorization, null, null); + writer.WriteProperty(options, PropCreateTime, value.CreateTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropCreateTimeString, value.CreateTimeString, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropDest, value.Dest, null, null); + writer.WriteProperty(options, PropFrequency, value.Frequency, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropLatest, value.Latest, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropPivot, value.Pivot, null, null); + writer.WriteProperty(options, PropRetentionPolicy, value.RetentionPolicy, null, null); + writer.WriteProperty(options, PropSettings, value.Settings, null, null); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteProperty(options, PropSync, value.Sync, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformSummary.g.cs index 75868cfc2cb..ed5f702e6c9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformSummary.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/TransformSummary.g.cs @@ -23,172 +23,7 @@ namespace Elastic.Clients.Elasticsearch.TransformManagement; -internal sealed partial class TransformSummaryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAuthorization = System.Text.Json.JsonEncodedText.Encode("authorization"); - private static readonly System.Text.Json.JsonEncodedText PropCreateTime = System.Text.Json.JsonEncodedText.Encode("create_time"); - private static readonly System.Text.Json.JsonEncodedText PropCreateTimeString = System.Text.Json.JsonEncodedText.Encode("create_time_string"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropDest = System.Text.Json.JsonEncodedText.Encode("dest"); - private static readonly System.Text.Json.JsonEncodedText PropFrequency = System.Text.Json.JsonEncodedText.Encode("frequency"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); - private static readonly System.Text.Json.JsonEncodedText PropLatest = System.Text.Json.JsonEncodedText.Encode("latest"); - private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"); - private static readonly System.Text.Json.JsonEncodedText PropPivot = System.Text.Json.JsonEncodedText.Encode("pivot"); - private static readonly System.Text.Json.JsonEncodedText PropRetentionPolicy = System.Text.Json.JsonEncodedText.Encode("retention_policy"); - private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"); - private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); - private static readonly System.Text.Json.JsonEncodedText PropSync = System.Text.Json.JsonEncodedText.Encode("sync"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.TransformManagement.TransformSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAuthorization = default; - LocalJsonValue propCreateTime = default; - LocalJsonValue propCreateTimeString = default; - LocalJsonValue propDescription = default; - LocalJsonValue propDest = default; - LocalJsonValue propFrequency = default; - LocalJsonValue propId = default; - LocalJsonValue propLatest = default; - LocalJsonValue?> propMeta = default; - LocalJsonValue propPivot = default; - LocalJsonValue propRetentionPolicy = default; - LocalJsonValue propSettings = default; - LocalJsonValue propSource = default; - LocalJsonValue propSync = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAuthorization.TryReadProperty(ref reader, options, PropAuthorization, null)) - { - continue; - } - - if (propCreateTime.TryReadProperty(ref reader, options, PropCreateTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propCreateTimeString.TryReadProperty(ref reader, options, PropCreateTimeString, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propDest.TryReadProperty(ref reader, options, PropDest, null)) - { - continue; - } - - if (propFrequency.TryReadProperty(ref reader, options, PropFrequency, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propLatest.TryReadProperty(ref reader, options, PropLatest, null)) - { - continue; - } - - if (propMeta.TryReadProperty(ref reader, options, PropMeta, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) - { - continue; - } - - if (propPivot.TryReadProperty(ref reader, options, PropPivot, null)) - { - continue; - } - - if (propRetentionPolicy.TryReadProperty(ref reader, options, PropRetentionPolicy, null)) - { - continue; - } - - if (propSettings.TryReadProperty(ref reader, options, PropSettings, null)) - { - continue; - } - - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) - { - continue; - } - - if (propSync.TryReadProperty(ref reader, options, PropSync, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TransformManagement.TransformSummary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Authorization = propAuthorization.Value, - CreateTime = propCreateTime.Value, - CreateTimeString = propCreateTimeString.Value, - Description = propDescription.Value, - Dest = propDest.Value, - Frequency = propFrequency.Value, - Id = propId.Value, - Latest = propLatest.Value, - Meta = propMeta.Value, - Pivot = propPivot.Value, - RetentionPolicy = propRetentionPolicy.Value, - Settings = propSettings.Value, - Source = propSource.Value, - Sync = propSync.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TransformManagement.TransformSummary value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAuthorization, value.Authorization, null, null); - writer.WriteProperty(options, PropCreateTime, value.CreateTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropCreateTimeString, value.CreateTimeString, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropDest, value.Dest, null, null); - writer.WriteProperty(options, PropFrequency, value.Frequency, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropLatest, value.Latest, null, null); - writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); - writer.WriteProperty(options, PropPivot, value.Pivot, null, null); - writer.WriteProperty(options, PropRetentionPolicy, value.RetentionPolicy, null, null); - writer.WriteProperty(options, PropSettings, value.Settings, null, null); - writer.WriteProperty(options, PropSource, value.Source, null, null); - writer.WriteProperty(options, PropSync, value.Sync, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.TransformSummaryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TransformManagement.Json.TransformSummaryConverter))] public sealed partial class TransformSummary { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TranslogStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TranslogStats.Converters.g.cs new file mode 100644 index 00000000000..a4a816e86ad --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TranslogStats.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class TranslogStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEarliestLastModifiedAge = System.Text.Json.JsonEncodedText.Encode("earliest_last_modified_age"); + private static readonly System.Text.Json.JsonEncodedText PropOperations = System.Text.Json.JsonEncodedText.Encode("operations"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + private static readonly System.Text.Json.JsonEncodedText PropSizeInBytes = System.Text.Json.JsonEncodedText.Encode("size_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropUncommittedOperations = System.Text.Json.JsonEncodedText.Encode("uncommitted_operations"); + private static readonly System.Text.Json.JsonEncodedText PropUncommittedSize = System.Text.Json.JsonEncodedText.Encode("uncommitted_size"); + private static readonly System.Text.Json.JsonEncodedText PropUncommittedSizeInBytes = System.Text.Json.JsonEncodedText.Encode("uncommitted_size_in_bytes"); + + public override Elastic.Clients.Elasticsearch.TranslogStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEarliestLastModifiedAge = default; + LocalJsonValue propOperations = default; + LocalJsonValue propSize = default; + LocalJsonValue propSizeInBytes = default; + LocalJsonValue propUncommittedOperations = default; + LocalJsonValue propUncommittedSize = default; + LocalJsonValue propUncommittedSizeInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEarliestLastModifiedAge.TryReadProperty(ref reader, options, PropEarliestLastModifiedAge, null)) + { + continue; + } + + if (propOperations.TryReadProperty(ref reader, options, PropOperations, null)) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, null)) + { + continue; + } + + if (propSizeInBytes.TryReadProperty(ref reader, options, PropSizeInBytes, null)) + { + continue; + } + + if (propUncommittedOperations.TryReadProperty(ref reader, options, PropUncommittedOperations, null)) + { + continue; + } + + if (propUncommittedSize.TryReadProperty(ref reader, options, PropUncommittedSize, null)) + { + continue; + } + + if (propUncommittedSizeInBytes.TryReadProperty(ref reader, options, PropUncommittedSizeInBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.TranslogStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + EarliestLastModifiedAge = propEarliestLastModifiedAge.Value, + Operations = propOperations.Value, + Size = propSize.Value, + SizeInBytes = propSizeInBytes.Value, + UncommittedOperations = propUncommittedOperations.Value, + UncommittedSize = propUncommittedSize.Value, + UncommittedSizeInBytes = propUncommittedSizeInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TranslogStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEarliestLastModifiedAge, value.EarliestLastModifiedAge, null, null); + writer.WriteProperty(options, PropOperations, value.Operations, null, null); + writer.WriteProperty(options, PropSize, value.Size, null, null); + writer.WriteProperty(options, PropSizeInBytes, value.SizeInBytes, null, null); + writer.WriteProperty(options, PropUncommittedOperations, value.UncommittedOperations, null, null); + writer.WriteProperty(options, PropUncommittedSize, value.UncommittedSize, null, null); + writer.WriteProperty(options, PropUncommittedSizeInBytes, value.UncommittedSizeInBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TranslogStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TranslogStats.g.cs index c7c8756614e..a2c349933ec 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TranslogStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TranslogStats.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class TranslogStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEarliestLastModifiedAge = System.Text.Json.JsonEncodedText.Encode("earliest_last_modified_age"); - private static readonly System.Text.Json.JsonEncodedText PropOperations = System.Text.Json.JsonEncodedText.Encode("operations"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - private static readonly System.Text.Json.JsonEncodedText PropSizeInBytes = System.Text.Json.JsonEncodedText.Encode("size_in_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropUncommittedOperations = System.Text.Json.JsonEncodedText.Encode("uncommitted_operations"); - private static readonly System.Text.Json.JsonEncodedText PropUncommittedSize = System.Text.Json.JsonEncodedText.Encode("uncommitted_size"); - private static readonly System.Text.Json.JsonEncodedText PropUncommittedSizeInBytes = System.Text.Json.JsonEncodedText.Encode("uncommitted_size_in_bytes"); - - public override Elastic.Clients.Elasticsearch.TranslogStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEarliestLastModifiedAge = default; - LocalJsonValue propOperations = default; - LocalJsonValue propSize = default; - LocalJsonValue propSizeInBytes = default; - LocalJsonValue propUncommittedOperations = default; - LocalJsonValue propUncommittedSize = default; - LocalJsonValue propUncommittedSizeInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEarliestLastModifiedAge.TryReadProperty(ref reader, options, PropEarliestLastModifiedAge, null)) - { - continue; - } - - if (propOperations.TryReadProperty(ref reader, options, PropOperations, null)) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, null)) - { - continue; - } - - if (propSizeInBytes.TryReadProperty(ref reader, options, PropSizeInBytes, null)) - { - continue; - } - - if (propUncommittedOperations.TryReadProperty(ref reader, options, PropUncommittedOperations, null)) - { - continue; - } - - if (propUncommittedSize.TryReadProperty(ref reader, options, PropUncommittedSize, null)) - { - continue; - } - - if (propUncommittedSizeInBytes.TryReadProperty(ref reader, options, PropUncommittedSizeInBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.TranslogStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - EarliestLastModifiedAge = propEarliestLastModifiedAge.Value, - Operations = propOperations.Value, - Size = propSize.Value, - SizeInBytes = propSizeInBytes.Value, - UncommittedOperations = propUncommittedOperations.Value, - UncommittedSize = propUncommittedSize.Value, - UncommittedSizeInBytes = propUncommittedSizeInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.TranslogStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEarliestLastModifiedAge, value.EarliestLastModifiedAge, null, null); - writer.WriteProperty(options, PropOperations, value.Operations, null, null); - writer.WriteProperty(options, PropSize, value.Size, null, null); - writer.WriteProperty(options, PropSizeInBytes, value.SizeInBytes, null, null); - writer.WriteProperty(options, PropUncommittedOperations, value.UncommittedOperations, null, null); - writer.WriteProperty(options, PropUncommittedSize, value.UncommittedSize, null, null); - writer.WriteProperty(options, PropUncommittedSizeInBytes, value.UncommittedSizeInBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.TranslogStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.TranslogStatsConverter))] public sealed partial class TranslogStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/VersionType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/VersionType.Converters.g.cs new file mode 100644 index 00000000000..396a066c3ef --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/VersionType.Converters.g.cs @@ -0,0 +1,109 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class VersionTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberExternal = System.Text.Json.JsonEncodedText.Encode("external"); + private static readonly System.Text.Json.JsonEncodedText MemberExternalGte = System.Text.Json.JsonEncodedText.Encode("external_gte"); + private static readonly System.Text.Json.JsonEncodedText MemberForce = System.Text.Json.JsonEncodedText.Encode("force"); + private static readonly System.Text.Json.JsonEncodedText MemberInternal = System.Text.Json.JsonEncodedText.Encode("internal"); + + public override Elastic.Clients.Elasticsearch.VersionType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberExternal)) + { + return Elastic.Clients.Elasticsearch.VersionType.External; + } + + if (reader.ValueTextEquals(MemberExternalGte)) + { + return Elastic.Clients.Elasticsearch.VersionType.ExternalGte; + } + + if (reader.ValueTextEquals(MemberForce)) + { + return Elastic.Clients.Elasticsearch.VersionType.Force; + } + + if (reader.ValueTextEquals(MemberInternal)) + { + return Elastic.Clients.Elasticsearch.VersionType.Internal; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberExternal.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.VersionType.External; + } + + if (string.Equals(value, MemberExternalGte.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.VersionType.ExternalGte; + } + + if (string.Equals(value, MemberForce.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.VersionType.Force; + } + + if (string.Equals(value, MemberInternal.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.VersionType.Internal; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.VersionType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.VersionType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.VersionType.External: + writer.WriteStringValue(MemberExternal); + break; + case Elastic.Clients.Elasticsearch.VersionType.ExternalGte: + writer.WriteStringValue(MemberExternalGte); + break; + case Elastic.Clients.Elasticsearch.VersionType.Force: + writer.WriteStringValue(MemberForce); + break; + case Elastic.Clients.Elasticsearch.VersionType.Internal: + writer.WriteStringValue(MemberInternal); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.VersionType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.VersionType ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.VersionType value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/VersionType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/VersionType.g.cs new file mode 100644 index 00000000000..155de681001 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/VersionType.g.cs @@ -0,0 +1,59 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.VersionTypeConverter))] +public enum VersionType +{ + /// + /// + /// Only index the document if the specified version is strictly higher than the version of the stored document or if there is no existing document. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "external")] + External, + /// + /// + /// Only index the document if the specified version is equal or higher than the version of the stored document or if there is no existing document. + /// NOTE: The external_gte version type is meant for special use cases and should be used with care. + /// If used incorrectly, it can result in loss of data. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "external_gte")] + ExternalGte, + /// + /// + /// This option is deprecated because it can cause primary and replica shards to diverge. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "force")] + Force, + /// + /// + /// Use internal versioning that starts at 1 and increments with each update or delete. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "internal")] + Internal +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/WaitForActiveShardOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/WaitForActiveShardOptions.Converters.g.cs new file mode 100644 index 00000000000..c1c1761346d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/WaitForActiveShardOptions.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class WaitForActiveShardOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAll = System.Text.Json.JsonEncodedText.Encode("all"); + private static readonly System.Text.Json.JsonEncodedText MemberIndexSetting = System.Text.Json.JsonEncodedText.Encode("index-setting"); + + public override Elastic.Clients.Elasticsearch.WaitForActiveShardOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAll)) + { + return Elastic.Clients.Elasticsearch.WaitForActiveShardOptions.All; + } + + if (reader.ValueTextEquals(MemberIndexSetting)) + { + return Elastic.Clients.Elasticsearch.WaitForActiveShardOptions.IndexSetting; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAll.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.WaitForActiveShardOptions.All; + } + + if (string.Equals(value, MemberIndexSetting.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.WaitForActiveShardOptions.IndexSetting; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.WaitForActiveShardOptions)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.WaitForActiveShardOptions value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.WaitForActiveShardOptions.All: + writer.WriteStringValue(MemberAll); + break; + case Elastic.Clients.Elasticsearch.WaitForActiveShardOptions.IndexSetting: + writer.WriteStringValue(MemberIndexSetting); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.WaitForActiveShardOptions)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.WaitForActiveShardOptions ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.WaitForActiveShardOptions value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/WaitForActiveShardOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/WaitForActiveShardOptions.g.cs new file mode 100644 index 00000000000..b4b9190661e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/WaitForActiveShardOptions.g.cs @@ -0,0 +1,33 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.WaitForActiveShardOptionsConverter))] +public enum WaitForActiveShardOptions +{ + [System.Runtime.Serialization.EnumMember(Value = "all")] + All, + [System.Runtime.Serialization.EnumMember(Value = "index-setting")] + IndexSetting +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/WaitForEvents.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/WaitForEvents.Converters.g.cs new file mode 100644 index 00000000000..a776234738a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/WaitForEvents.Converters.g.cs @@ -0,0 +1,137 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class WaitForEventsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberHigh = System.Text.Json.JsonEncodedText.Encode("high"); + private static readonly System.Text.Json.JsonEncodedText MemberImmediate = System.Text.Json.JsonEncodedText.Encode("immediate"); + private static readonly System.Text.Json.JsonEncodedText MemberLanguid = System.Text.Json.JsonEncodedText.Encode("languid"); + private static readonly System.Text.Json.JsonEncodedText MemberLow = System.Text.Json.JsonEncodedText.Encode("low"); + private static readonly System.Text.Json.JsonEncodedText MemberNormal = System.Text.Json.JsonEncodedText.Encode("normal"); + private static readonly System.Text.Json.JsonEncodedText MemberUrgent = System.Text.Json.JsonEncodedText.Encode("urgent"); + + public override Elastic.Clients.Elasticsearch.WaitForEvents Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberHigh)) + { + return Elastic.Clients.Elasticsearch.WaitForEvents.High; + } + + if (reader.ValueTextEquals(MemberImmediate)) + { + return Elastic.Clients.Elasticsearch.WaitForEvents.Immediate; + } + + if (reader.ValueTextEquals(MemberLanguid)) + { + return Elastic.Clients.Elasticsearch.WaitForEvents.Languid; + } + + if (reader.ValueTextEquals(MemberLow)) + { + return Elastic.Clients.Elasticsearch.WaitForEvents.Low; + } + + if (reader.ValueTextEquals(MemberNormal)) + { + return Elastic.Clients.Elasticsearch.WaitForEvents.Normal; + } + + if (reader.ValueTextEquals(MemberUrgent)) + { + return Elastic.Clients.Elasticsearch.WaitForEvents.Urgent; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberHigh.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.WaitForEvents.High; + } + + if (string.Equals(value, MemberImmediate.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.WaitForEvents.Immediate; + } + + if (string.Equals(value, MemberLanguid.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.WaitForEvents.Languid; + } + + if (string.Equals(value, MemberLow.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.WaitForEvents.Low; + } + + if (string.Equals(value, MemberNormal.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.WaitForEvents.Normal; + } + + if (string.Equals(value, MemberUrgent.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.WaitForEvents.Urgent; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.WaitForEvents)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.WaitForEvents value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.WaitForEvents.High: + writer.WriteStringValue(MemberHigh); + break; + case Elastic.Clients.Elasticsearch.WaitForEvents.Immediate: + writer.WriteStringValue(MemberImmediate); + break; + case Elastic.Clients.Elasticsearch.WaitForEvents.Languid: + writer.WriteStringValue(MemberLanguid); + break; + case Elastic.Clients.Elasticsearch.WaitForEvents.Low: + writer.WriteStringValue(MemberLow); + break; + case Elastic.Clients.Elasticsearch.WaitForEvents.Normal: + writer.WriteStringValue(MemberNormal); + break; + case Elastic.Clients.Elasticsearch.WaitForEvents.Urgent: + writer.WriteStringValue(MemberUrgent); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.WaitForEvents)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.WaitForEvents ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.WaitForEvents value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/WaitForEvents.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/WaitForEvents.g.cs new file mode 100644 index 00000000000..493e312c75e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/WaitForEvents.g.cs @@ -0,0 +1,41 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.WaitForEventsConverter))] +public enum WaitForEvents +{ + [System.Runtime.Serialization.EnumMember(Value = "high")] + High, + [System.Runtime.Serialization.EnumMember(Value = "immediate")] + Immediate, + [System.Runtime.Serialization.EnumMember(Value = "languid")] + Languid, + [System.Runtime.Serialization.EnumMember(Value = "low")] + Low, + [System.Runtime.Serialization.EnumMember(Value = "normal")] + Normal, + [System.Runtime.Serialization.EnumMember(Value = "urgent")] + Urgent +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/WarmerStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/WarmerStats.Converters.g.cs new file mode 100644 index 00000000000..3ee37be8eb1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/WarmerStats.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class WarmerStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCurrent = System.Text.Json.JsonEncodedText.Encode("current"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + private static readonly System.Text.Json.JsonEncodedText PropTotalTime = System.Text.Json.JsonEncodedText.Encode("total_time"); + private static readonly System.Text.Json.JsonEncodedText PropTotalTimeInMillis = System.Text.Json.JsonEncodedText.Encode("total_time_in_millis"); + + public override Elastic.Clients.Elasticsearch.WarmerStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCurrent = default; + LocalJsonValue propTotal = default; + LocalJsonValue propTotalTime = default; + LocalJsonValue propTotalTimeInMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCurrent.TryReadProperty(ref reader, options, PropCurrent, null)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (propTotalTime.TryReadProperty(ref reader, options, PropTotalTime, null)) + { + continue; + } + + if (propTotalTimeInMillis.TryReadProperty(ref reader, options, PropTotalTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.WarmerStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Current = propCurrent.Value, + Total = propTotal.Value, + TotalTime = propTotalTime.Value, + TotalTimeInMillis = propTotalTimeInMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.WarmerStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCurrent, value.Current, null, null); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteProperty(options, PropTotalTime, value.TotalTime, null, null); + writer.WriteProperty(options, PropTotalTimeInMillis, value.TotalTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/WarmerStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/WarmerStats.g.cs index 422f1555416..720f1905d96 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/WarmerStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/WarmerStats.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class WarmerStatsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCurrent = System.Text.Json.JsonEncodedText.Encode("current"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - private static readonly System.Text.Json.JsonEncodedText PropTotalTime = System.Text.Json.JsonEncodedText.Encode("total_time"); - private static readonly System.Text.Json.JsonEncodedText PropTotalTimeInMillis = System.Text.Json.JsonEncodedText.Encode("total_time_in_millis"); - - public override Elastic.Clients.Elasticsearch.WarmerStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCurrent = default; - LocalJsonValue propTotal = default; - LocalJsonValue propTotalTime = default; - LocalJsonValue propTotalTimeInMillis = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCurrent.TryReadProperty(ref reader, options, PropCurrent, null)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (propTotalTime.TryReadProperty(ref reader, options, PropTotalTime, null)) - { - continue; - } - - if (propTotalTimeInMillis.TryReadProperty(ref reader, options, PropTotalTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.WarmerStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Current = propCurrent.Value, - Total = propTotal.Value, - TotalTime = propTotalTime.Value, - TotalTimeInMillis = propTotalTimeInMillis.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.WarmerStats value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCurrent, value.Current, null, null); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteProperty(options, PropTotalTime, value.TotalTime, null, null); - writer.WriteProperty(options, PropTotalTimeInMillis, value.TotalTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.WarmerStatsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.WarmerStatsConverter))] public sealed partial class WarmerStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/WktGeoBounds.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/WktGeoBounds.Converters.g.cs new file mode 100644 index 00000000000..3f96a1e6b21 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/WktGeoBounds.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Json; + +public sealed partial class WktGeoBoundsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropWkt = System.Text.Json.JsonEncodedText.Encode("wkt"); + + public override Elastic.Clients.Elasticsearch.WktGeoBounds Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propWkt = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propWkt.TryReadProperty(ref reader, options, PropWkt, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.WktGeoBounds(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Wkt = propWkt.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.WktGeoBounds value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropWkt, value.Wkt, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/WktGeoBounds.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/WktGeoBounds.g.cs index 137ace316df..3096a012443 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/WktGeoBounds.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/WktGeoBounds.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch; -internal sealed partial class WktGeoBoundsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropWkt = System.Text.Json.JsonEncodedText.Encode("wkt"); - - public override Elastic.Clients.Elasticsearch.WktGeoBounds Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propWkt = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propWkt.TryReadProperty(ref reader, options, PropWkt, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.WktGeoBounds(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Wkt = propWkt.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.WktGeoBounds value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropWkt, value.Wkt, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.WktGeoBoundsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.WktGeoBoundsConverter))] public sealed partial class WktGeoBounds { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Analytics.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Analytics.Converters.g.cs new file mode 100644 index 00000000000..e0346dba43b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Analytics.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class AnalyticsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropStats = System.Text.Json.JsonEncodedText.Encode("stats"); + + public override Elastic.Clients.Elasticsearch.Xpack.Analytics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvailable = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propStats = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propStats.TryReadProperty(ref reader, options, PropStats, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.Analytics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Available = propAvailable.Value, + Enabled = propEnabled.Value, + Stats = propStats.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Analytics value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvailable, value.Available, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropStats, value.Stats, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Analytics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Analytics.g.cs index 0d9fdee8a57..3fa9a49cb5b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Analytics.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Analytics.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class AnalyticsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropStats = System.Text.Json.JsonEncodedText.Encode("stats"); - - public override Elastic.Clients.Elasticsearch.Xpack.Analytics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvailable = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propStats = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propStats.TryReadProperty(ref reader, options, PropStats, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.Analytics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Available = propAvailable.Value, - Enabled = propEnabled.Value, - Stats = propStats.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Analytics value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvailable, value.Available, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropStats, value.Stats, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.AnalyticsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.AnalyticsConverter))] public sealed partial class Analytics { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/AnalyticsStatistics.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/AnalyticsStatistics.Converters.g.cs new file mode 100644 index 00000000000..15b30a2f324 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/AnalyticsStatistics.Converters.g.cs @@ -0,0 +1,135 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class AnalyticsStatisticsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBoxplotUsage = System.Text.Json.JsonEncodedText.Encode("boxplot_usage"); + private static readonly System.Text.Json.JsonEncodedText PropCumulativeCardinalityUsage = System.Text.Json.JsonEncodedText.Encode("cumulative_cardinality_usage"); + private static readonly System.Text.Json.JsonEncodedText PropMovingPercentilesUsage = System.Text.Json.JsonEncodedText.Encode("moving_percentiles_usage"); + private static readonly System.Text.Json.JsonEncodedText PropMultiTermsUsage = System.Text.Json.JsonEncodedText.Encode("multi_terms_usage"); + private static readonly System.Text.Json.JsonEncodedText PropNormalizeUsage = System.Text.Json.JsonEncodedText.Encode("normalize_usage"); + private static readonly System.Text.Json.JsonEncodedText PropRateUsage = System.Text.Json.JsonEncodedText.Encode("rate_usage"); + private static readonly System.Text.Json.JsonEncodedText PropStringStatsUsage = System.Text.Json.JsonEncodedText.Encode("string_stats_usage"); + private static readonly System.Text.Json.JsonEncodedText PropTopMetricsUsage = System.Text.Json.JsonEncodedText.Encode("top_metrics_usage"); + private static readonly System.Text.Json.JsonEncodedText PropTTestUsage = System.Text.Json.JsonEncodedText.Encode("t_test_usage"); + + public override Elastic.Clients.Elasticsearch.Xpack.AnalyticsStatistics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBoxplotUsage = default; + LocalJsonValue propCumulativeCardinalityUsage = default; + LocalJsonValue propMovingPercentilesUsage = default; + LocalJsonValue propMultiTermsUsage = default; + LocalJsonValue propNormalizeUsage = default; + LocalJsonValue propRateUsage = default; + LocalJsonValue propStringStatsUsage = default; + LocalJsonValue propTopMetricsUsage = default; + LocalJsonValue propTTestUsage = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBoxplotUsage.TryReadProperty(ref reader, options, PropBoxplotUsage, null)) + { + continue; + } + + if (propCumulativeCardinalityUsage.TryReadProperty(ref reader, options, PropCumulativeCardinalityUsage, null)) + { + continue; + } + + if (propMovingPercentilesUsage.TryReadProperty(ref reader, options, PropMovingPercentilesUsage, null)) + { + continue; + } + + if (propMultiTermsUsage.TryReadProperty(ref reader, options, PropMultiTermsUsage, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNormalizeUsage.TryReadProperty(ref reader, options, PropNormalizeUsage, null)) + { + continue; + } + + if (propRateUsage.TryReadProperty(ref reader, options, PropRateUsage, null)) + { + continue; + } + + if (propStringStatsUsage.TryReadProperty(ref reader, options, PropStringStatsUsage, null)) + { + continue; + } + + if (propTopMetricsUsage.TryReadProperty(ref reader, options, PropTopMetricsUsage, null)) + { + continue; + } + + if (propTTestUsage.TryReadProperty(ref reader, options, PropTTestUsage, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.AnalyticsStatistics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BoxplotUsage = propBoxplotUsage.Value, + CumulativeCardinalityUsage = propCumulativeCardinalityUsage.Value, + MovingPercentilesUsage = propMovingPercentilesUsage.Value, + MultiTermsUsage = propMultiTermsUsage.Value, + NormalizeUsage = propNormalizeUsage.Value, + RateUsage = propRateUsage.Value, + StringStatsUsage = propStringStatsUsage.Value, + TopMetricsUsage = propTopMetricsUsage.Value, + TTestUsage = propTTestUsage.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.AnalyticsStatistics value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBoxplotUsage, value.BoxplotUsage, null, null); + writer.WriteProperty(options, PropCumulativeCardinalityUsage, value.CumulativeCardinalityUsage, null, null); + writer.WriteProperty(options, PropMovingPercentilesUsage, value.MovingPercentilesUsage, null, null); + writer.WriteProperty(options, PropMultiTermsUsage, value.MultiTermsUsage, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNormalizeUsage, value.NormalizeUsage, null, null); + writer.WriteProperty(options, PropRateUsage, value.RateUsage, null, null); + writer.WriteProperty(options, PropStringStatsUsage, value.StringStatsUsage, null, null); + writer.WriteProperty(options, PropTopMetricsUsage, value.TopMetricsUsage, null, null); + writer.WriteProperty(options, PropTTestUsage, value.TTestUsage, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/AnalyticsStatistics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/AnalyticsStatistics.g.cs index ace85cd9744..0ac8e29ec35 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/AnalyticsStatistics.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/AnalyticsStatistics.g.cs @@ -23,118 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class AnalyticsStatisticsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBoxplotUsage = System.Text.Json.JsonEncodedText.Encode("boxplot_usage"); - private static readonly System.Text.Json.JsonEncodedText PropCumulativeCardinalityUsage = System.Text.Json.JsonEncodedText.Encode("cumulative_cardinality_usage"); - private static readonly System.Text.Json.JsonEncodedText PropMovingPercentilesUsage = System.Text.Json.JsonEncodedText.Encode("moving_percentiles_usage"); - private static readonly System.Text.Json.JsonEncodedText PropMultiTermsUsage = System.Text.Json.JsonEncodedText.Encode("multi_terms_usage"); - private static readonly System.Text.Json.JsonEncodedText PropNormalizeUsage = System.Text.Json.JsonEncodedText.Encode("normalize_usage"); - private static readonly System.Text.Json.JsonEncodedText PropRateUsage = System.Text.Json.JsonEncodedText.Encode("rate_usage"); - private static readonly System.Text.Json.JsonEncodedText PropStringStatsUsage = System.Text.Json.JsonEncodedText.Encode("string_stats_usage"); - private static readonly System.Text.Json.JsonEncodedText PropTopMetricsUsage = System.Text.Json.JsonEncodedText.Encode("top_metrics_usage"); - private static readonly System.Text.Json.JsonEncodedText PropTTestUsage = System.Text.Json.JsonEncodedText.Encode("t_test_usage"); - - public override Elastic.Clients.Elasticsearch.Xpack.AnalyticsStatistics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBoxplotUsage = default; - LocalJsonValue propCumulativeCardinalityUsage = default; - LocalJsonValue propMovingPercentilesUsage = default; - LocalJsonValue propMultiTermsUsage = default; - LocalJsonValue propNormalizeUsage = default; - LocalJsonValue propRateUsage = default; - LocalJsonValue propStringStatsUsage = default; - LocalJsonValue propTopMetricsUsage = default; - LocalJsonValue propTTestUsage = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBoxplotUsage.TryReadProperty(ref reader, options, PropBoxplotUsage, null)) - { - continue; - } - - if (propCumulativeCardinalityUsage.TryReadProperty(ref reader, options, PropCumulativeCardinalityUsage, null)) - { - continue; - } - - if (propMovingPercentilesUsage.TryReadProperty(ref reader, options, PropMovingPercentilesUsage, null)) - { - continue; - } - - if (propMultiTermsUsage.TryReadProperty(ref reader, options, PropMultiTermsUsage, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNormalizeUsage.TryReadProperty(ref reader, options, PropNormalizeUsage, null)) - { - continue; - } - - if (propRateUsage.TryReadProperty(ref reader, options, PropRateUsage, null)) - { - continue; - } - - if (propStringStatsUsage.TryReadProperty(ref reader, options, PropStringStatsUsage, null)) - { - continue; - } - - if (propTopMetricsUsage.TryReadProperty(ref reader, options, PropTopMetricsUsage, null)) - { - continue; - } - - if (propTTestUsage.TryReadProperty(ref reader, options, PropTTestUsage, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.AnalyticsStatistics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BoxplotUsage = propBoxplotUsage.Value, - CumulativeCardinalityUsage = propCumulativeCardinalityUsage.Value, - MovingPercentilesUsage = propMovingPercentilesUsage.Value, - MultiTermsUsage = propMultiTermsUsage.Value, - NormalizeUsage = propNormalizeUsage.Value, - RateUsage = propRateUsage.Value, - StringStatsUsage = propStringStatsUsage.Value, - TopMetricsUsage = propTopMetricsUsage.Value, - TTestUsage = propTTestUsage.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.AnalyticsStatistics value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBoxplotUsage, value.BoxplotUsage, null, null); - writer.WriteProperty(options, PropCumulativeCardinalityUsage, value.CumulativeCardinalityUsage, null, null); - writer.WriteProperty(options, PropMovingPercentilesUsage, value.MovingPercentilesUsage, null, null); - writer.WriteProperty(options, PropMultiTermsUsage, value.MultiTermsUsage, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNormalizeUsage, value.NormalizeUsage, null, null); - writer.WriteProperty(options, PropRateUsage, value.RateUsage, null, null); - writer.WriteProperty(options, PropStringStatsUsage, value.StringStatsUsage, null, null); - writer.WriteProperty(options, PropTopMetricsUsage, value.TopMetricsUsage, null, null); - writer.WriteProperty(options, PropTTestUsage, value.TTestUsage, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.AnalyticsStatisticsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.AnalyticsStatisticsConverter))] public sealed partial class AnalyticsStatistics { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Archive.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Archive.Converters.g.cs new file mode 100644 index 00000000000..7f2415a9a34 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Archive.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class ArchiveConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropIndicesCount = System.Text.Json.JsonEncodedText.Encode("indices_count"); + + public override Elastic.Clients.Elasticsearch.Xpack.Archive Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvailable = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propIndicesCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propIndicesCount.TryReadProperty(ref reader, options, PropIndicesCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.Archive(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Available = propAvailable.Value, + Enabled = propEnabled.Value, + IndicesCount = propIndicesCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Archive value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvailable, value.Available, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropIndicesCount, value.IndicesCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Archive.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Archive.g.cs index 6beea570a3d..0c7570174f9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Archive.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Archive.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class ArchiveConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropIndicesCount = System.Text.Json.JsonEncodedText.Encode("indices_count"); - - public override Elastic.Clients.Elasticsearch.Xpack.Archive Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvailable = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propIndicesCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propIndicesCount.TryReadProperty(ref reader, options, PropIndicesCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.Archive(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Available = propAvailable.Value, - Enabled = propEnabled.Value, - IndicesCount = propIndicesCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Archive value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvailable, value.Available, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropIndicesCount, value.IndicesCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.ArchiveConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.ArchiveConverter))] public sealed partial class Archive { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Audit.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Audit.Converters.g.cs new file mode 100644 index 00000000000..239f06cdc6c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Audit.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class AuditConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropOutputs = System.Text.Json.JsonEncodedText.Encode("outputs"); + + public override Elastic.Clients.Elasticsearch.Xpack.Audit Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEnabled = default; + LocalJsonValue?> propOutputs = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propOutputs.TryReadProperty(ref reader, options, PropOutputs, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.Audit(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Enabled = propEnabled.Value, + Outputs = propOutputs.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Audit value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropOutputs, value.Outputs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Audit.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Audit.g.cs index 9c6d766d973..e162139f7c9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Audit.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Audit.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class AuditConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropOutputs = System.Text.Json.JsonEncodedText.Encode("outputs"); - - public override Elastic.Clients.Elasticsearch.Xpack.Audit Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEnabled = default; - LocalJsonValue?> propOutputs = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propOutputs.TryReadProperty(ref reader, options, PropOutputs, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.Audit(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Enabled = propEnabled.Value, - Outputs = propOutputs.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Audit value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropOutputs, value.Outputs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.AuditConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.AuditConverter))] public sealed partial class Audit { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Base.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Base.Converters.g.cs new file mode 100644 index 00000000000..135186002f7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Base.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class BaseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + + public override Elastic.Clients.Elasticsearch.Xpack.Base Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvailable = default; + LocalJsonValue propEnabled = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.Base(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Available = propAvailable.Value, + Enabled = propEnabled.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Base value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvailable, value.Available, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Base.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Base.g.cs index 79ec67994da..be30b18cc2c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Base.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Base.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class BaseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - - public override Elastic.Clients.Elasticsearch.Xpack.Base Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvailable = default; - LocalJsonValue propEnabled = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.Base(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Available = propAvailable.Value, - Enabled = propEnabled.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Base value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvailable, value.Available, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.BaseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.BaseConverter))] public sealed partial class Base { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/BuildInformation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/BuildInformation.Converters.g.cs new file mode 100644 index 00000000000..c9b4637df38 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/BuildInformation.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class BuildInformationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDate = System.Text.Json.JsonEncodedText.Encode("date"); + private static readonly System.Text.Json.JsonEncodedText PropHash = System.Text.Json.JsonEncodedText.Encode("hash"); + + public override Elastic.Clients.Elasticsearch.Xpack.BuildInformation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDate = default; + LocalJsonValue propHash = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDate.TryReadProperty(ref reader, options, PropDate, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propHash.TryReadProperty(ref reader, options, PropHash, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.BuildInformation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Date = propDate.Value, + Hash = propHash.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.BuildInformation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDate, value.Date, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropHash, value.Hash, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/BuildInformation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/BuildInformation.g.cs index ba02104dac6..f42e0c831c9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/BuildInformation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/BuildInformation.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class BuildInformationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDate = System.Text.Json.JsonEncodedText.Encode("date"); - private static readonly System.Text.Json.JsonEncodedText PropHash = System.Text.Json.JsonEncodedText.Encode("hash"); - - public override Elastic.Clients.Elasticsearch.Xpack.BuildInformation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDate = default; - LocalJsonValue propHash = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDate.TryReadProperty(ref reader, options, PropDate, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) - { - continue; - } - - if (propHash.TryReadProperty(ref reader, options, PropHash, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.BuildInformation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Date = propDate.Value, - Hash = propHash.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.BuildInformation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDate, value.Date, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); - writer.WriteProperty(options, PropHash, value.Hash, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.BuildInformationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.BuildInformationConverter))] public sealed partial class BuildInformation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ccr.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ccr.Converters.g.cs new file mode 100644 index 00000000000..99740bb4660 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ccr.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class CcrConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAutoFollowPatternsCount = System.Text.Json.JsonEncodedText.Encode("auto_follow_patterns_count"); + private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropFollowerIndicesCount = System.Text.Json.JsonEncodedText.Encode("follower_indices_count"); + + public override Elastic.Clients.Elasticsearch.Xpack.Ccr Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAutoFollowPatternsCount = default; + LocalJsonValue propAvailable = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propFollowerIndicesCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAutoFollowPatternsCount.TryReadProperty(ref reader, options, PropAutoFollowPatternsCount, null)) + { + continue; + } + + if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propFollowerIndicesCount.TryReadProperty(ref reader, options, PropFollowerIndicesCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.Ccr(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AutoFollowPatternsCount = propAutoFollowPatternsCount.Value, + Available = propAvailable.Value, + Enabled = propEnabled.Value, + FollowerIndicesCount = propFollowerIndicesCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Ccr value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAutoFollowPatternsCount, value.AutoFollowPatternsCount, null, null); + writer.WriteProperty(options, PropAvailable, value.Available, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropFollowerIndicesCount, value.FollowerIndicesCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ccr.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ccr.g.cs index 4e6d4251610..6233b3201c9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ccr.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ccr.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class CcrConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAutoFollowPatternsCount = System.Text.Json.JsonEncodedText.Encode("auto_follow_patterns_count"); - private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropFollowerIndicesCount = System.Text.Json.JsonEncodedText.Encode("follower_indices_count"); - - public override Elastic.Clients.Elasticsearch.Xpack.Ccr Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAutoFollowPatternsCount = default; - LocalJsonValue propAvailable = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propFollowerIndicesCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAutoFollowPatternsCount.TryReadProperty(ref reader, options, PropAutoFollowPatternsCount, null)) - { - continue; - } - - if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propFollowerIndicesCount.TryReadProperty(ref reader, options, PropFollowerIndicesCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.Ccr(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AutoFollowPatternsCount = propAutoFollowPatternsCount.Value, - Available = propAvailable.Value, - Enabled = propEnabled.Value, - FollowerIndicesCount = propFollowerIndicesCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Ccr value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAutoFollowPatternsCount, value.AutoFollowPatternsCount, null, null); - writer.WriteProperty(options, PropAvailable, value.Available, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropFollowerIndicesCount, value.FollowerIndicesCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.CcrConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.CcrConverter))] public sealed partial class Ccr { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Counter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Counter.Converters.g.cs new file mode 100644 index 00000000000..2e8c89f8b85 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Counter.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class CounterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropActive = System.Text.Json.JsonEncodedText.Encode("active"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Xpack.Counter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propActive = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propActive.TryReadProperty(ref reader, options, PropActive, null)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.Counter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Active = propActive.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Counter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropActive, value.Active, null, null); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Counter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Counter.g.cs index 75ff09fecfd..da07ee488af 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Counter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Counter.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class CounterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropActive = System.Text.Json.JsonEncodedText.Encode("active"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Xpack.Counter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propActive = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propActive.TryReadProperty(ref reader, options, PropActive, null)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.Counter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Active = propActive.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Counter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropActive, value.Active, null, null); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.CounterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.CounterConverter))] public sealed partial class Counter { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataStreams.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataStreams.Converters.g.cs new file mode 100644 index 00000000000..bf7915f9dab --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataStreams.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class DataStreamsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); + private static readonly System.Text.Json.JsonEncodedText PropDataStreams2 = System.Text.Json.JsonEncodedText.Encode("data_streams"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropIndicesCount = System.Text.Json.JsonEncodedText.Encode("indices_count"); + + public override Elastic.Clients.Elasticsearch.Xpack.DataStreams Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvailable = default; + LocalJsonValue propDataStreams2 = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propIndicesCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) + { + continue; + } + + if (propDataStreams2.TryReadProperty(ref reader, options, PropDataStreams2, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propIndicesCount.TryReadProperty(ref reader, options, PropIndicesCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.DataStreams(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Available = propAvailable.Value, + DataStreams2 = propDataStreams2.Value, + Enabled = propEnabled.Value, + IndicesCount = propIndicesCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.DataStreams value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvailable, value.Available, null, null); + writer.WriteProperty(options, PropDataStreams2, value.DataStreams2, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropIndicesCount, value.IndicesCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataStreams.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataStreams.g.cs index cf55327a80f..3a3ecc816fd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataStreams.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataStreams.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class DataStreamsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); - private static readonly System.Text.Json.JsonEncodedText PropDataStreams2 = System.Text.Json.JsonEncodedText.Encode("data_streams"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropIndicesCount = System.Text.Json.JsonEncodedText.Encode("indices_count"); - - public override Elastic.Clients.Elasticsearch.Xpack.DataStreams Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvailable = default; - LocalJsonValue propDataStreams2 = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propIndicesCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) - { - continue; - } - - if (propDataStreams2.TryReadProperty(ref reader, options, PropDataStreams2, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propIndicesCount.TryReadProperty(ref reader, options, PropIndicesCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.DataStreams(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Available = propAvailable.Value, - DataStreams2 = propDataStreams2.Value, - Enabled = propEnabled.Value, - IndicesCount = propIndicesCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.DataStreams value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvailable, value.Available, null, null); - writer.WriteProperty(options, PropDataStreams2, value.DataStreams2, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropIndicesCount, value.IndicesCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.DataStreamsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.DataStreamsConverter))] public sealed partial class DataStreams { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataTierPhaseStatistics.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataTierPhaseStatistics.Converters.g.cs new file mode 100644 index 00000000000..192f7251638 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataTierPhaseStatistics.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class DataTierPhaseStatisticsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropIndexCount = System.Text.Json.JsonEncodedText.Encode("index_count"); + private static readonly System.Text.Json.JsonEncodedText PropNodeCount = System.Text.Json.JsonEncodedText.Encode("node_count"); + private static readonly System.Text.Json.JsonEncodedText PropPrimaryShardCount = System.Text.Json.JsonEncodedText.Encode("primary_shard_count"); + private static readonly System.Text.Json.JsonEncodedText PropPrimaryShardSizeAvgBytes = System.Text.Json.JsonEncodedText.Encode("primary_shard_size_avg_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropPrimaryShardSizeMadBytes = System.Text.Json.JsonEncodedText.Encode("primary_shard_size_mad_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropPrimaryShardSizeMedianBytes = System.Text.Json.JsonEncodedText.Encode("primary_shard_size_median_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropPrimarySizeBytes = System.Text.Json.JsonEncodedText.Encode("primary_size_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTotalShardCount = System.Text.Json.JsonEncodedText.Encode("total_shard_count"); + private static readonly System.Text.Json.JsonEncodedText PropTotalSizeBytes = System.Text.Json.JsonEncodedText.Encode("total_size_bytes"); + + public override Elastic.Clients.Elasticsearch.Xpack.DataTierPhaseStatistics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDocCount = default; + LocalJsonValue propIndexCount = default; + LocalJsonValue propNodeCount = default; + LocalJsonValue propPrimaryShardCount = default; + LocalJsonValue propPrimaryShardSizeAvgBytes = default; + LocalJsonValue propPrimaryShardSizeMadBytes = default; + LocalJsonValue propPrimaryShardSizeMedianBytes = default; + LocalJsonValue propPrimarySizeBytes = default; + LocalJsonValue propTotalShardCount = default; + LocalJsonValue propTotalSizeBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propIndexCount.TryReadProperty(ref reader, options, PropIndexCount, null)) + { + continue; + } + + if (propNodeCount.TryReadProperty(ref reader, options, PropNodeCount, null)) + { + continue; + } + + if (propPrimaryShardCount.TryReadProperty(ref reader, options, PropPrimaryShardCount, null)) + { + continue; + } + + if (propPrimaryShardSizeAvgBytes.TryReadProperty(ref reader, options, PropPrimaryShardSizeAvgBytes, null)) + { + continue; + } + + if (propPrimaryShardSizeMadBytes.TryReadProperty(ref reader, options, PropPrimaryShardSizeMadBytes, null)) + { + continue; + } + + if (propPrimaryShardSizeMedianBytes.TryReadProperty(ref reader, options, PropPrimaryShardSizeMedianBytes, null)) + { + continue; + } + + if (propPrimarySizeBytes.TryReadProperty(ref reader, options, PropPrimarySizeBytes, null)) + { + continue; + } + + if (propTotalShardCount.TryReadProperty(ref reader, options, PropTotalShardCount, null)) + { + continue; + } + + if (propTotalSizeBytes.TryReadProperty(ref reader, options, PropTotalSizeBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.DataTierPhaseStatistics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + DocCount = propDocCount.Value, + IndexCount = propIndexCount.Value, + NodeCount = propNodeCount.Value, + PrimaryShardCount = propPrimaryShardCount.Value, + PrimaryShardSizeAvgBytes = propPrimaryShardSizeAvgBytes.Value, + PrimaryShardSizeMadBytes = propPrimaryShardSizeMadBytes.Value, + PrimaryShardSizeMedianBytes = propPrimaryShardSizeMedianBytes.Value, + PrimarySizeBytes = propPrimarySizeBytes.Value, + TotalShardCount = propTotalShardCount.Value, + TotalSizeBytes = propTotalSizeBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.DataTierPhaseStatistics value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropIndexCount, value.IndexCount, null, null); + writer.WriteProperty(options, PropNodeCount, value.NodeCount, null, null); + writer.WriteProperty(options, PropPrimaryShardCount, value.PrimaryShardCount, null, null); + writer.WriteProperty(options, PropPrimaryShardSizeAvgBytes, value.PrimaryShardSizeAvgBytes, null, null); + writer.WriteProperty(options, PropPrimaryShardSizeMadBytes, value.PrimaryShardSizeMadBytes, null, null); + writer.WriteProperty(options, PropPrimaryShardSizeMedianBytes, value.PrimaryShardSizeMedianBytes, null, null); + writer.WriteProperty(options, PropPrimarySizeBytes, value.PrimarySizeBytes, null, null); + writer.WriteProperty(options, PropTotalShardCount, value.TotalShardCount, null, null); + writer.WriteProperty(options, PropTotalSizeBytes, value.TotalSizeBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataTierPhaseStatistics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataTierPhaseStatistics.g.cs index 217d00368c9..c038f1ff8ef 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataTierPhaseStatistics.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataTierPhaseStatistics.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class DataTierPhaseStatisticsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); - private static readonly System.Text.Json.JsonEncodedText PropIndexCount = System.Text.Json.JsonEncodedText.Encode("index_count"); - private static readonly System.Text.Json.JsonEncodedText PropNodeCount = System.Text.Json.JsonEncodedText.Encode("node_count"); - private static readonly System.Text.Json.JsonEncodedText PropPrimaryShardCount = System.Text.Json.JsonEncodedText.Encode("primary_shard_count"); - private static readonly System.Text.Json.JsonEncodedText PropPrimaryShardSizeAvgBytes = System.Text.Json.JsonEncodedText.Encode("primary_shard_size_avg_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropPrimaryShardSizeMadBytes = System.Text.Json.JsonEncodedText.Encode("primary_shard_size_mad_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropPrimaryShardSizeMedianBytes = System.Text.Json.JsonEncodedText.Encode("primary_shard_size_median_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropPrimarySizeBytes = System.Text.Json.JsonEncodedText.Encode("primary_size_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTotalShardCount = System.Text.Json.JsonEncodedText.Encode("total_shard_count"); - private static readonly System.Text.Json.JsonEncodedText PropTotalSizeBytes = System.Text.Json.JsonEncodedText.Encode("total_size_bytes"); - - public override Elastic.Clients.Elasticsearch.Xpack.DataTierPhaseStatistics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDocCount = default; - LocalJsonValue propIndexCount = default; - LocalJsonValue propNodeCount = default; - LocalJsonValue propPrimaryShardCount = default; - LocalJsonValue propPrimaryShardSizeAvgBytes = default; - LocalJsonValue propPrimaryShardSizeMadBytes = default; - LocalJsonValue propPrimaryShardSizeMedianBytes = default; - LocalJsonValue propPrimarySizeBytes = default; - LocalJsonValue propTotalShardCount = default; - LocalJsonValue propTotalSizeBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) - { - continue; - } - - if (propIndexCount.TryReadProperty(ref reader, options, PropIndexCount, null)) - { - continue; - } - - if (propNodeCount.TryReadProperty(ref reader, options, PropNodeCount, null)) - { - continue; - } - - if (propPrimaryShardCount.TryReadProperty(ref reader, options, PropPrimaryShardCount, null)) - { - continue; - } - - if (propPrimaryShardSizeAvgBytes.TryReadProperty(ref reader, options, PropPrimaryShardSizeAvgBytes, null)) - { - continue; - } - - if (propPrimaryShardSizeMadBytes.TryReadProperty(ref reader, options, PropPrimaryShardSizeMadBytes, null)) - { - continue; - } - - if (propPrimaryShardSizeMedianBytes.TryReadProperty(ref reader, options, PropPrimaryShardSizeMedianBytes, null)) - { - continue; - } - - if (propPrimarySizeBytes.TryReadProperty(ref reader, options, PropPrimarySizeBytes, null)) - { - continue; - } - - if (propTotalShardCount.TryReadProperty(ref reader, options, PropTotalShardCount, null)) - { - continue; - } - - if (propTotalSizeBytes.TryReadProperty(ref reader, options, PropTotalSizeBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.DataTierPhaseStatistics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - DocCount = propDocCount.Value, - IndexCount = propIndexCount.Value, - NodeCount = propNodeCount.Value, - PrimaryShardCount = propPrimaryShardCount.Value, - PrimaryShardSizeAvgBytes = propPrimaryShardSizeAvgBytes.Value, - PrimaryShardSizeMadBytes = propPrimaryShardSizeMadBytes.Value, - PrimaryShardSizeMedianBytes = propPrimaryShardSizeMedianBytes.Value, - PrimarySizeBytes = propPrimarySizeBytes.Value, - TotalShardCount = propTotalShardCount.Value, - TotalSizeBytes = propTotalSizeBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.DataTierPhaseStatistics value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); - writer.WriteProperty(options, PropIndexCount, value.IndexCount, null, null); - writer.WriteProperty(options, PropNodeCount, value.NodeCount, null, null); - writer.WriteProperty(options, PropPrimaryShardCount, value.PrimaryShardCount, null, null); - writer.WriteProperty(options, PropPrimaryShardSizeAvgBytes, value.PrimaryShardSizeAvgBytes, null, null); - writer.WriteProperty(options, PropPrimaryShardSizeMadBytes, value.PrimaryShardSizeMadBytes, null, null); - writer.WriteProperty(options, PropPrimaryShardSizeMedianBytes, value.PrimaryShardSizeMedianBytes, null, null); - writer.WriteProperty(options, PropPrimarySizeBytes, value.PrimarySizeBytes, null, null); - writer.WriteProperty(options, PropTotalShardCount, value.TotalShardCount, null, null); - writer.WriteProperty(options, PropTotalSizeBytes, value.TotalSizeBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.DataTierPhaseStatisticsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.DataTierPhaseStatisticsConverter))] public sealed partial class DataTierPhaseStatistics { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataTiers.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataTiers.Converters.g.cs new file mode 100644 index 00000000000..00609f829ca --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataTiers.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class DataTiersConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); + private static readonly System.Text.Json.JsonEncodedText PropDataCold = System.Text.Json.JsonEncodedText.Encode("data_cold"); + private static readonly System.Text.Json.JsonEncodedText PropDataContent = System.Text.Json.JsonEncodedText.Encode("data_content"); + private static readonly System.Text.Json.JsonEncodedText PropDataFrozen = System.Text.Json.JsonEncodedText.Encode("data_frozen"); + private static readonly System.Text.Json.JsonEncodedText PropDataHot = System.Text.Json.JsonEncodedText.Encode("data_hot"); + private static readonly System.Text.Json.JsonEncodedText PropDataWarm = System.Text.Json.JsonEncodedText.Encode("data_warm"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + + public override Elastic.Clients.Elasticsearch.Xpack.DataTiers Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvailable = default; + LocalJsonValue propDataCold = default; + LocalJsonValue propDataContent = default; + LocalJsonValue propDataFrozen = default; + LocalJsonValue propDataHot = default; + LocalJsonValue propDataWarm = default; + LocalJsonValue propEnabled = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) + { + continue; + } + + if (propDataCold.TryReadProperty(ref reader, options, PropDataCold, null)) + { + continue; + } + + if (propDataContent.TryReadProperty(ref reader, options, PropDataContent, null)) + { + continue; + } + + if (propDataFrozen.TryReadProperty(ref reader, options, PropDataFrozen, null)) + { + continue; + } + + if (propDataHot.TryReadProperty(ref reader, options, PropDataHot, null)) + { + continue; + } + + if (propDataWarm.TryReadProperty(ref reader, options, PropDataWarm, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.DataTiers(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Available = propAvailable.Value, + DataCold = propDataCold.Value, + DataContent = propDataContent.Value, + DataFrozen = propDataFrozen.Value, + DataHot = propDataHot.Value, + DataWarm = propDataWarm.Value, + Enabled = propEnabled.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.DataTiers value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvailable, value.Available, null, null); + writer.WriteProperty(options, PropDataCold, value.DataCold, null, null); + writer.WriteProperty(options, PropDataContent, value.DataContent, null, null); + writer.WriteProperty(options, PropDataFrozen, value.DataFrozen, null, null); + writer.WriteProperty(options, PropDataHot, value.DataHot, null, null); + writer.WriteProperty(options, PropDataWarm, value.DataWarm, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataTiers.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataTiers.g.cs index 8741ebf9cbf..eff9ef69278 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataTiers.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/DataTiers.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class DataTiersConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); - private static readonly System.Text.Json.JsonEncodedText PropDataCold = System.Text.Json.JsonEncodedText.Encode("data_cold"); - private static readonly System.Text.Json.JsonEncodedText PropDataContent = System.Text.Json.JsonEncodedText.Encode("data_content"); - private static readonly System.Text.Json.JsonEncodedText PropDataFrozen = System.Text.Json.JsonEncodedText.Encode("data_frozen"); - private static readonly System.Text.Json.JsonEncodedText PropDataHot = System.Text.Json.JsonEncodedText.Encode("data_hot"); - private static readonly System.Text.Json.JsonEncodedText PropDataWarm = System.Text.Json.JsonEncodedText.Encode("data_warm"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - - public override Elastic.Clients.Elasticsearch.Xpack.DataTiers Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvailable = default; - LocalJsonValue propDataCold = default; - LocalJsonValue propDataContent = default; - LocalJsonValue propDataFrozen = default; - LocalJsonValue propDataHot = default; - LocalJsonValue propDataWarm = default; - LocalJsonValue propEnabled = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) - { - continue; - } - - if (propDataCold.TryReadProperty(ref reader, options, PropDataCold, null)) - { - continue; - } - - if (propDataContent.TryReadProperty(ref reader, options, PropDataContent, null)) - { - continue; - } - - if (propDataFrozen.TryReadProperty(ref reader, options, PropDataFrozen, null)) - { - continue; - } - - if (propDataHot.TryReadProperty(ref reader, options, PropDataHot, null)) - { - continue; - } - - if (propDataWarm.TryReadProperty(ref reader, options, PropDataWarm, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.DataTiers(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Available = propAvailable.Value, - DataCold = propDataCold.Value, - DataContent = propDataContent.Value, - DataFrozen = propDataFrozen.Value, - DataHot = propDataHot.Value, - DataWarm = propDataWarm.Value, - Enabled = propEnabled.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.DataTiers value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvailable, value.Available, null, null); - writer.WriteProperty(options, PropDataCold, value.DataCold, null, null); - writer.WriteProperty(options, PropDataContent, value.DataContent, null, null); - writer.WriteProperty(options, PropDataFrozen, value.DataFrozen, null, null); - writer.WriteProperty(options, PropDataHot, value.DataHot, null, null); - writer.WriteProperty(options, PropDataWarm, value.DataWarm, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.DataTiersConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.DataTiersConverter))] public sealed partial class DataTiers { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Datafeed.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Datafeed.Converters.g.cs new file mode 100644 index 00000000000..2e44037e3df --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Datafeed.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class DatafeedConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + + public override Elastic.Clients.Elasticsearch.Xpack.Datafeed Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.Datafeed(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Datafeed value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Datafeed.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Datafeed.g.cs index 53fbc5b2211..4426b5a3d61 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Datafeed.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Datafeed.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class DatafeedConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - - public override Elastic.Clients.Elasticsearch.Xpack.Datafeed Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.Datafeed(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Datafeed value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.DatafeedConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.DatafeedConverter))] public sealed partial class Datafeed { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Eql.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Eql.Converters.g.cs new file mode 100644 index 00000000000..adf21683db2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Eql.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class EqlConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropFeatures = System.Text.Json.JsonEncodedText.Encode("features"); + private static readonly System.Text.Json.JsonEncodedText PropQueries = System.Text.Json.JsonEncodedText.Encode("queries"); + + public override Elastic.Clients.Elasticsearch.Xpack.Eql Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvailable = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propFeatures = default; + LocalJsonValue> propQueries = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propFeatures.TryReadProperty(ref reader, options, PropFeatures, null)) + { + continue; + } + + if (propQueries.TryReadProperty(ref reader, options, PropQueries, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.Eql(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Available = propAvailable.Value, + Enabled = propEnabled.Value, + Features = propFeatures.Value, + Queries = propQueries.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Eql value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvailable, value.Available, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropFeatures, value.Features, null, null); + writer.WriteProperty(options, PropQueries, value.Queries, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Eql.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Eql.g.cs index bd1b9e90372..934c4452d3d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Eql.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Eql.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class EqlConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropFeatures = System.Text.Json.JsonEncodedText.Encode("features"); - private static readonly System.Text.Json.JsonEncodedText PropQueries = System.Text.Json.JsonEncodedText.Encode("queries"); - - public override Elastic.Clients.Elasticsearch.Xpack.Eql Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvailable = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propFeatures = default; - LocalJsonValue> propQueries = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propFeatures.TryReadProperty(ref reader, options, PropFeatures, null)) - { - continue; - } - - if (propQueries.TryReadProperty(ref reader, options, PropQueries, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.Eql(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Available = propAvailable.Value, - Enabled = propEnabled.Value, - Features = propFeatures.Value, - Queries = propQueries.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Eql value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvailable, value.Available, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropFeatures, value.Features, null, null); - writer.WriteProperty(options, PropQueries, value.Queries, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.EqlConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.EqlConverter))] public sealed partial class Eql { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeatures.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeatures.Converters.g.cs new file mode 100644 index 00000000000..95c08bee182 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeatures.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class EqlFeaturesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEvent = System.Text.Json.JsonEncodedText.Encode("event"); + private static readonly System.Text.Json.JsonEncodedText PropJoin = System.Text.Json.JsonEncodedText.Encode("join"); + private static readonly System.Text.Json.JsonEncodedText PropJoins = System.Text.Json.JsonEncodedText.Encode("joins"); + private static readonly System.Text.Json.JsonEncodedText PropKeys = System.Text.Json.JsonEncodedText.Encode("keys"); + private static readonly System.Text.Json.JsonEncodedText PropPipes = System.Text.Json.JsonEncodedText.Encode("pipes"); + private static readonly System.Text.Json.JsonEncodedText PropSequence = System.Text.Json.JsonEncodedText.Encode("sequence"); + private static readonly System.Text.Json.JsonEncodedText PropSequences = System.Text.Json.JsonEncodedText.Encode("sequences"); + + public override Elastic.Clients.Elasticsearch.Xpack.EqlFeatures Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEvent = default; + LocalJsonValue propJoin = default; + LocalJsonValue propJoins = default; + LocalJsonValue propKeys = default; + LocalJsonValue propPipes = default; + LocalJsonValue propSequence = default; + LocalJsonValue propSequences = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEvent.TryReadProperty(ref reader, options, PropEvent, null)) + { + continue; + } + + if (propJoin.TryReadProperty(ref reader, options, PropJoin, null)) + { + continue; + } + + if (propJoins.TryReadProperty(ref reader, options, PropJoins, null)) + { + continue; + } + + if (propKeys.TryReadProperty(ref reader, options, PropKeys, null)) + { + continue; + } + + if (propPipes.TryReadProperty(ref reader, options, PropPipes, null)) + { + continue; + } + + if (propSequence.TryReadProperty(ref reader, options, PropSequence, null)) + { + continue; + } + + if (propSequences.TryReadProperty(ref reader, options, PropSequences, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.EqlFeatures(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Event = propEvent.Value, + Join = propJoin.Value, + Joins = propJoins.Value, + Keys = propKeys.Value, + Pipes = propPipes.Value, + Sequence = propSequence.Value, + Sequences = propSequences.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.EqlFeatures value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEvent, value.Event, null, null); + writer.WriteProperty(options, PropJoin, value.Join, null, null); + writer.WriteProperty(options, PropJoins, value.Joins, null, null); + writer.WriteProperty(options, PropKeys, value.Keys, null, null); + writer.WriteProperty(options, PropPipes, value.Pipes, null, null); + writer.WriteProperty(options, PropSequence, value.Sequence, null, null); + writer.WriteProperty(options, PropSequences, value.Sequences, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeatures.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeatures.g.cs index 09f122ef007..5ca67c9f935 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeatures.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeatures.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class EqlFeaturesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEvent = System.Text.Json.JsonEncodedText.Encode("event"); - private static readonly System.Text.Json.JsonEncodedText PropJoin = System.Text.Json.JsonEncodedText.Encode("join"); - private static readonly System.Text.Json.JsonEncodedText PropJoins = System.Text.Json.JsonEncodedText.Encode("joins"); - private static readonly System.Text.Json.JsonEncodedText PropKeys = System.Text.Json.JsonEncodedText.Encode("keys"); - private static readonly System.Text.Json.JsonEncodedText PropPipes = System.Text.Json.JsonEncodedText.Encode("pipes"); - private static readonly System.Text.Json.JsonEncodedText PropSequence = System.Text.Json.JsonEncodedText.Encode("sequence"); - private static readonly System.Text.Json.JsonEncodedText PropSequences = System.Text.Json.JsonEncodedText.Encode("sequences"); - - public override Elastic.Clients.Elasticsearch.Xpack.EqlFeatures Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEvent = default; - LocalJsonValue propJoin = default; - LocalJsonValue propJoins = default; - LocalJsonValue propKeys = default; - LocalJsonValue propPipes = default; - LocalJsonValue propSequence = default; - LocalJsonValue propSequences = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEvent.TryReadProperty(ref reader, options, PropEvent, null)) - { - continue; - } - - if (propJoin.TryReadProperty(ref reader, options, PropJoin, null)) - { - continue; - } - - if (propJoins.TryReadProperty(ref reader, options, PropJoins, null)) - { - continue; - } - - if (propKeys.TryReadProperty(ref reader, options, PropKeys, null)) - { - continue; - } - - if (propPipes.TryReadProperty(ref reader, options, PropPipes, null)) - { - continue; - } - - if (propSequence.TryReadProperty(ref reader, options, PropSequence, null)) - { - continue; - } - - if (propSequences.TryReadProperty(ref reader, options, PropSequences, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.EqlFeatures(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Event = propEvent.Value, - Join = propJoin.Value, - Joins = propJoins.Value, - Keys = propKeys.Value, - Pipes = propPipes.Value, - Sequence = propSequence.Value, - Sequences = propSequences.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.EqlFeatures value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEvent, value.Event, null, null); - writer.WriteProperty(options, PropJoin, value.Join, null, null); - writer.WriteProperty(options, PropJoins, value.Joins, null, null); - writer.WriteProperty(options, PropKeys, value.Keys, null, null); - writer.WriteProperty(options, PropPipes, value.Pipes, null, null); - writer.WriteProperty(options, PropSequence, value.Sequence, null, null); - writer.WriteProperty(options, PropSequences, value.Sequences, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.EqlFeaturesConverter))] public sealed partial class EqlFeatures { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesJoin.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesJoin.Converters.g.cs new file mode 100644 index 00000000000..0af29ff3323 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesJoin.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class EqlFeaturesJoinConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropJoinQueriesFiveOrMore = System.Text.Json.JsonEncodedText.Encode("join_queries_five_or_more"); + private static readonly System.Text.Json.JsonEncodedText PropJoinQueriesFour = System.Text.Json.JsonEncodedText.Encode("join_queries_four"); + private static readonly System.Text.Json.JsonEncodedText PropJoinQueriesThree = System.Text.Json.JsonEncodedText.Encode("join_queries_three"); + private static readonly System.Text.Json.JsonEncodedText PropJoinQueriesTwo = System.Text.Json.JsonEncodedText.Encode("join_queries_two"); + private static readonly System.Text.Json.JsonEncodedText PropJoinUntil = System.Text.Json.JsonEncodedText.Encode("join_until"); + + public override Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesJoin Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propJoinQueriesFiveOrMore = default; + LocalJsonValue propJoinQueriesFour = default; + LocalJsonValue propJoinQueriesThree = default; + LocalJsonValue propJoinQueriesTwo = default; + LocalJsonValue propJoinUntil = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propJoinQueriesFiveOrMore.TryReadProperty(ref reader, options, PropJoinQueriesFiveOrMore, null)) + { + continue; + } + + if (propJoinQueriesFour.TryReadProperty(ref reader, options, PropJoinQueriesFour, null)) + { + continue; + } + + if (propJoinQueriesThree.TryReadProperty(ref reader, options, PropJoinQueriesThree, null)) + { + continue; + } + + if (propJoinQueriesTwo.TryReadProperty(ref reader, options, PropJoinQueriesTwo, null)) + { + continue; + } + + if (propJoinUntil.TryReadProperty(ref reader, options, PropJoinUntil, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesJoin(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + JoinQueriesFiveOrMore = propJoinQueriesFiveOrMore.Value, + JoinQueriesFour = propJoinQueriesFour.Value, + JoinQueriesThree = propJoinQueriesThree.Value, + JoinQueriesTwo = propJoinQueriesTwo.Value, + JoinUntil = propJoinUntil.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesJoin value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropJoinQueriesFiveOrMore, value.JoinQueriesFiveOrMore, null, null); + writer.WriteProperty(options, PropJoinQueriesFour, value.JoinQueriesFour, null, null); + writer.WriteProperty(options, PropJoinQueriesThree, value.JoinQueriesThree, null, null); + writer.WriteProperty(options, PropJoinQueriesTwo, value.JoinQueriesTwo, null, null); + writer.WriteProperty(options, PropJoinUntil, value.JoinUntil, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesJoin.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesJoin.g.cs index c783eb6b40c..c445e385645 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesJoin.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesJoin.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class EqlFeaturesJoinConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropJoinQueriesFiveOrMore = System.Text.Json.JsonEncodedText.Encode("join_queries_five_or_more"); - private static readonly System.Text.Json.JsonEncodedText PropJoinQueriesFour = System.Text.Json.JsonEncodedText.Encode("join_queries_four"); - private static readonly System.Text.Json.JsonEncodedText PropJoinQueriesThree = System.Text.Json.JsonEncodedText.Encode("join_queries_three"); - private static readonly System.Text.Json.JsonEncodedText PropJoinQueriesTwo = System.Text.Json.JsonEncodedText.Encode("join_queries_two"); - private static readonly System.Text.Json.JsonEncodedText PropJoinUntil = System.Text.Json.JsonEncodedText.Encode("join_until"); - - public override Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesJoin Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propJoinQueriesFiveOrMore = default; - LocalJsonValue propJoinQueriesFour = default; - LocalJsonValue propJoinQueriesThree = default; - LocalJsonValue propJoinQueriesTwo = default; - LocalJsonValue propJoinUntil = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propJoinQueriesFiveOrMore.TryReadProperty(ref reader, options, PropJoinQueriesFiveOrMore, null)) - { - continue; - } - - if (propJoinQueriesFour.TryReadProperty(ref reader, options, PropJoinQueriesFour, null)) - { - continue; - } - - if (propJoinQueriesThree.TryReadProperty(ref reader, options, PropJoinQueriesThree, null)) - { - continue; - } - - if (propJoinQueriesTwo.TryReadProperty(ref reader, options, PropJoinQueriesTwo, null)) - { - continue; - } - - if (propJoinUntil.TryReadProperty(ref reader, options, PropJoinUntil, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesJoin(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - JoinQueriesFiveOrMore = propJoinQueriesFiveOrMore.Value, - JoinQueriesFour = propJoinQueriesFour.Value, - JoinQueriesThree = propJoinQueriesThree.Value, - JoinQueriesTwo = propJoinQueriesTwo.Value, - JoinUntil = propJoinUntil.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesJoin value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropJoinQueriesFiveOrMore, value.JoinQueriesFiveOrMore, null, null); - writer.WriteProperty(options, PropJoinQueriesFour, value.JoinQueriesFour, null, null); - writer.WriteProperty(options, PropJoinQueriesThree, value.JoinQueriesThree, null, null); - writer.WriteProperty(options, PropJoinQueriesTwo, value.JoinQueriesTwo, null, null); - writer.WriteProperty(options, PropJoinUntil, value.JoinUntil, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesJoinConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.EqlFeaturesJoinConverter))] public sealed partial class EqlFeaturesJoin { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesKeys.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesKeys.Converters.g.cs new file mode 100644 index 00000000000..937e5588c82 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesKeys.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class EqlFeaturesKeysConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropJoinKeysFiveOrMore = System.Text.Json.JsonEncodedText.Encode("join_keys_five_or_more"); + private static readonly System.Text.Json.JsonEncodedText PropJoinKeysFour = System.Text.Json.JsonEncodedText.Encode("join_keys_four"); + private static readonly System.Text.Json.JsonEncodedText PropJoinKeysOne = System.Text.Json.JsonEncodedText.Encode("join_keys_one"); + private static readonly System.Text.Json.JsonEncodedText PropJoinKeysThree = System.Text.Json.JsonEncodedText.Encode("join_keys_three"); + private static readonly System.Text.Json.JsonEncodedText PropJoinKeysTwo = System.Text.Json.JsonEncodedText.Encode("join_keys_two"); + + public override Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesKeys Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propJoinKeysFiveOrMore = default; + LocalJsonValue propJoinKeysFour = default; + LocalJsonValue propJoinKeysOne = default; + LocalJsonValue propJoinKeysThree = default; + LocalJsonValue propJoinKeysTwo = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propJoinKeysFiveOrMore.TryReadProperty(ref reader, options, PropJoinKeysFiveOrMore, null)) + { + continue; + } + + if (propJoinKeysFour.TryReadProperty(ref reader, options, PropJoinKeysFour, null)) + { + continue; + } + + if (propJoinKeysOne.TryReadProperty(ref reader, options, PropJoinKeysOne, null)) + { + continue; + } + + if (propJoinKeysThree.TryReadProperty(ref reader, options, PropJoinKeysThree, null)) + { + continue; + } + + if (propJoinKeysTwo.TryReadProperty(ref reader, options, PropJoinKeysTwo, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesKeys(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + JoinKeysFiveOrMore = propJoinKeysFiveOrMore.Value, + JoinKeysFour = propJoinKeysFour.Value, + JoinKeysOne = propJoinKeysOne.Value, + JoinKeysThree = propJoinKeysThree.Value, + JoinKeysTwo = propJoinKeysTwo.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesKeys value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropJoinKeysFiveOrMore, value.JoinKeysFiveOrMore, null, null); + writer.WriteProperty(options, PropJoinKeysFour, value.JoinKeysFour, null, null); + writer.WriteProperty(options, PropJoinKeysOne, value.JoinKeysOne, null, null); + writer.WriteProperty(options, PropJoinKeysThree, value.JoinKeysThree, null, null); + writer.WriteProperty(options, PropJoinKeysTwo, value.JoinKeysTwo, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesKeys.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesKeys.g.cs index 33d25e376ae..6df20f07b59 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesKeys.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesKeys.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class EqlFeaturesKeysConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropJoinKeysFiveOrMore = System.Text.Json.JsonEncodedText.Encode("join_keys_five_or_more"); - private static readonly System.Text.Json.JsonEncodedText PropJoinKeysFour = System.Text.Json.JsonEncodedText.Encode("join_keys_four"); - private static readonly System.Text.Json.JsonEncodedText PropJoinKeysOne = System.Text.Json.JsonEncodedText.Encode("join_keys_one"); - private static readonly System.Text.Json.JsonEncodedText PropJoinKeysThree = System.Text.Json.JsonEncodedText.Encode("join_keys_three"); - private static readonly System.Text.Json.JsonEncodedText PropJoinKeysTwo = System.Text.Json.JsonEncodedText.Encode("join_keys_two"); - - public override Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesKeys Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propJoinKeysFiveOrMore = default; - LocalJsonValue propJoinKeysFour = default; - LocalJsonValue propJoinKeysOne = default; - LocalJsonValue propJoinKeysThree = default; - LocalJsonValue propJoinKeysTwo = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propJoinKeysFiveOrMore.TryReadProperty(ref reader, options, PropJoinKeysFiveOrMore, null)) - { - continue; - } - - if (propJoinKeysFour.TryReadProperty(ref reader, options, PropJoinKeysFour, null)) - { - continue; - } - - if (propJoinKeysOne.TryReadProperty(ref reader, options, PropJoinKeysOne, null)) - { - continue; - } - - if (propJoinKeysThree.TryReadProperty(ref reader, options, PropJoinKeysThree, null)) - { - continue; - } - - if (propJoinKeysTwo.TryReadProperty(ref reader, options, PropJoinKeysTwo, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesKeys(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - JoinKeysFiveOrMore = propJoinKeysFiveOrMore.Value, - JoinKeysFour = propJoinKeysFour.Value, - JoinKeysOne = propJoinKeysOne.Value, - JoinKeysThree = propJoinKeysThree.Value, - JoinKeysTwo = propJoinKeysTwo.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesKeys value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropJoinKeysFiveOrMore, value.JoinKeysFiveOrMore, null, null); - writer.WriteProperty(options, PropJoinKeysFour, value.JoinKeysFour, null, null); - writer.WriteProperty(options, PropJoinKeysOne, value.JoinKeysOne, null, null); - writer.WriteProperty(options, PropJoinKeysThree, value.JoinKeysThree, null, null); - writer.WriteProperty(options, PropJoinKeysTwo, value.JoinKeysTwo, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesKeysConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.EqlFeaturesKeysConverter))] public sealed partial class EqlFeaturesKeys { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesPipes.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesPipes.Converters.g.cs new file mode 100644 index 00000000000..e7916dc1501 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesPipes.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class EqlFeaturesPipesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPipeHead = System.Text.Json.JsonEncodedText.Encode("pipe_head"); + private static readonly System.Text.Json.JsonEncodedText PropPipeTail = System.Text.Json.JsonEncodedText.Encode("pipe_tail"); + + public override Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesPipes Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPipeHead = default; + LocalJsonValue propPipeTail = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPipeHead.TryReadProperty(ref reader, options, PropPipeHead, null)) + { + continue; + } + + if (propPipeTail.TryReadProperty(ref reader, options, PropPipeTail, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesPipes(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + PipeHead = propPipeHead.Value, + PipeTail = propPipeTail.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesPipes value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPipeHead, value.PipeHead, null, null); + writer.WriteProperty(options, PropPipeTail, value.PipeTail, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesPipes.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesPipes.g.cs index 9ee625fcfdb..4a67f983130 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesPipes.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesPipes.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class EqlFeaturesPipesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPipeHead = System.Text.Json.JsonEncodedText.Encode("pipe_head"); - private static readonly System.Text.Json.JsonEncodedText PropPipeTail = System.Text.Json.JsonEncodedText.Encode("pipe_tail"); - - public override Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesPipes Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPipeHead = default; - LocalJsonValue propPipeTail = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPipeHead.TryReadProperty(ref reader, options, PropPipeHead, null)) - { - continue; - } - - if (propPipeTail.TryReadProperty(ref reader, options, PropPipeTail, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesPipes(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - PipeHead = propPipeHead.Value, - PipeTail = propPipeTail.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesPipes value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPipeHead, value.PipeHead, null, null); - writer.WriteProperty(options, PropPipeTail, value.PipeTail, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesPipesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.EqlFeaturesPipesConverter))] public sealed partial class EqlFeaturesPipes { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesSequences.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesSequences.Converters.g.cs new file mode 100644 index 00000000000..a4845e7fec1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesSequences.Converters.g.cs @@ -0,0 +1,108 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class EqlFeaturesSequencesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSequenceMaxspan = System.Text.Json.JsonEncodedText.Encode("sequence_maxspan"); + private static readonly System.Text.Json.JsonEncodedText PropSequenceQueriesFiveOrMore = System.Text.Json.JsonEncodedText.Encode("sequence_queries_five_or_more"); + private static readonly System.Text.Json.JsonEncodedText PropSequenceQueriesFour = System.Text.Json.JsonEncodedText.Encode("sequence_queries_four"); + private static readonly System.Text.Json.JsonEncodedText PropSequenceQueriesThree = System.Text.Json.JsonEncodedText.Encode("sequence_queries_three"); + private static readonly System.Text.Json.JsonEncodedText PropSequenceQueriesTwo = System.Text.Json.JsonEncodedText.Encode("sequence_queries_two"); + private static readonly System.Text.Json.JsonEncodedText PropSequenceUntil = System.Text.Json.JsonEncodedText.Encode("sequence_until"); + + public override Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesSequences Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propSequenceMaxspan = default; + LocalJsonValue propSequenceQueriesFiveOrMore = default; + LocalJsonValue propSequenceQueriesFour = default; + LocalJsonValue propSequenceQueriesThree = default; + LocalJsonValue propSequenceQueriesTwo = default; + LocalJsonValue propSequenceUntil = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSequenceMaxspan.TryReadProperty(ref reader, options, PropSequenceMaxspan, null)) + { + continue; + } + + if (propSequenceQueriesFiveOrMore.TryReadProperty(ref reader, options, PropSequenceQueriesFiveOrMore, null)) + { + continue; + } + + if (propSequenceQueriesFour.TryReadProperty(ref reader, options, PropSequenceQueriesFour, null)) + { + continue; + } + + if (propSequenceQueriesThree.TryReadProperty(ref reader, options, PropSequenceQueriesThree, null)) + { + continue; + } + + if (propSequenceQueriesTwo.TryReadProperty(ref reader, options, PropSequenceQueriesTwo, null)) + { + continue; + } + + if (propSequenceUntil.TryReadProperty(ref reader, options, PropSequenceUntil, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesSequences(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + SequenceMaxspan = propSequenceMaxspan.Value, + SequenceQueriesFiveOrMore = propSequenceQueriesFiveOrMore.Value, + SequenceQueriesFour = propSequenceQueriesFour.Value, + SequenceQueriesThree = propSequenceQueriesThree.Value, + SequenceQueriesTwo = propSequenceQueriesTwo.Value, + SequenceUntil = propSequenceUntil.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesSequences value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSequenceMaxspan, value.SequenceMaxspan, null, null); + writer.WriteProperty(options, PropSequenceQueriesFiveOrMore, value.SequenceQueriesFiveOrMore, null, null); + writer.WriteProperty(options, PropSequenceQueriesFour, value.SequenceQueriesFour, null, null); + writer.WriteProperty(options, PropSequenceQueriesThree, value.SequenceQueriesThree, null, null); + writer.WriteProperty(options, PropSequenceQueriesTwo, value.SequenceQueriesTwo, null, null); + writer.WriteProperty(options, PropSequenceUntil, value.SequenceUntil, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesSequences.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesSequences.g.cs index 26b79cfac41..eef015f635a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesSequences.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/EqlFeaturesSequences.g.cs @@ -23,91 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class EqlFeaturesSequencesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSequenceMaxspan = System.Text.Json.JsonEncodedText.Encode("sequence_maxspan"); - private static readonly System.Text.Json.JsonEncodedText PropSequenceQueriesFiveOrMore = System.Text.Json.JsonEncodedText.Encode("sequence_queries_five_or_more"); - private static readonly System.Text.Json.JsonEncodedText PropSequenceQueriesFour = System.Text.Json.JsonEncodedText.Encode("sequence_queries_four"); - private static readonly System.Text.Json.JsonEncodedText PropSequenceQueriesThree = System.Text.Json.JsonEncodedText.Encode("sequence_queries_three"); - private static readonly System.Text.Json.JsonEncodedText PropSequenceQueriesTwo = System.Text.Json.JsonEncodedText.Encode("sequence_queries_two"); - private static readonly System.Text.Json.JsonEncodedText PropSequenceUntil = System.Text.Json.JsonEncodedText.Encode("sequence_until"); - - public override Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesSequences Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propSequenceMaxspan = default; - LocalJsonValue propSequenceQueriesFiveOrMore = default; - LocalJsonValue propSequenceQueriesFour = default; - LocalJsonValue propSequenceQueriesThree = default; - LocalJsonValue propSequenceQueriesTwo = default; - LocalJsonValue propSequenceUntil = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSequenceMaxspan.TryReadProperty(ref reader, options, PropSequenceMaxspan, null)) - { - continue; - } - - if (propSequenceQueriesFiveOrMore.TryReadProperty(ref reader, options, PropSequenceQueriesFiveOrMore, null)) - { - continue; - } - - if (propSequenceQueriesFour.TryReadProperty(ref reader, options, PropSequenceQueriesFour, null)) - { - continue; - } - - if (propSequenceQueriesThree.TryReadProperty(ref reader, options, PropSequenceQueriesThree, null)) - { - continue; - } - - if (propSequenceQueriesTwo.TryReadProperty(ref reader, options, PropSequenceQueriesTwo, null)) - { - continue; - } - - if (propSequenceUntil.TryReadProperty(ref reader, options, PropSequenceUntil, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesSequences(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - SequenceMaxspan = propSequenceMaxspan.Value, - SequenceQueriesFiveOrMore = propSequenceQueriesFiveOrMore.Value, - SequenceQueriesFour = propSequenceQueriesFour.Value, - SequenceQueriesThree = propSequenceQueriesThree.Value, - SequenceQueriesTwo = propSequenceQueriesTwo.Value, - SequenceUntil = propSequenceUntil.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesSequences value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSequenceMaxspan, value.SequenceMaxspan, null, null); - writer.WriteProperty(options, PropSequenceQueriesFiveOrMore, value.SequenceQueriesFiveOrMore, null, null); - writer.WriteProperty(options, PropSequenceQueriesFour, value.SequenceQueriesFour, null, null); - writer.WriteProperty(options, PropSequenceQueriesThree, value.SequenceQueriesThree, null, null); - writer.WriteProperty(options, PropSequenceQueriesTwo, value.SequenceQueriesTwo, null, null); - writer.WriteProperty(options, PropSequenceUntil, value.SequenceUntil, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.EqlFeaturesSequencesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.EqlFeaturesSequencesConverter))] public sealed partial class EqlFeaturesSequences { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Feature.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Feature.Converters.g.cs new file mode 100644 index 00000000000..de280e69565 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Feature.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class FeatureConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); + private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropNativeCodeInfo = System.Text.Json.JsonEncodedText.Encode("native_code_info"); + + public override Elastic.Clients.Elasticsearch.Xpack.Feature Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvailable = default; + LocalJsonValue propDescription = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propNativeCodeInfo = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) + { + continue; + } + + if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propNativeCodeInfo.TryReadProperty(ref reader, options, PropNativeCodeInfo, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.Feature(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Available = propAvailable.Value, + Description = propDescription.Value, + Enabled = propEnabled.Value, + NativeCodeInfo = propNativeCodeInfo.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Feature value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvailable, value.Available, null, null); + writer.WriteProperty(options, PropDescription, value.Description, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropNativeCodeInfo, value.NativeCodeInfo, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Feature.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Feature.g.cs index 21a1d1e2128..89f98cdda07 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Feature.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Feature.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class FeatureConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); - private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropNativeCodeInfo = System.Text.Json.JsonEncodedText.Encode("native_code_info"); - - public override Elastic.Clients.Elasticsearch.Xpack.Feature Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvailable = default; - LocalJsonValue propDescription = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propNativeCodeInfo = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) - { - continue; - } - - if (propDescription.TryReadProperty(ref reader, options, PropDescription, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propNativeCodeInfo.TryReadProperty(ref reader, options, PropNativeCodeInfo, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.Feature(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Available = propAvailable.Value, - Description = propDescription.Value, - Enabled = propEnabled.Value, - NativeCodeInfo = propNativeCodeInfo.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Feature value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvailable, value.Available, null, null); - writer.WriteProperty(options, PropDescription, value.Description, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropNativeCodeInfo, value.NativeCodeInfo, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.FeatureConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.FeatureConverter))] public sealed partial class Feature { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/FeatureToggle.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/FeatureToggle.Converters.g.cs new file mode 100644 index 00000000000..84ba3b1ec0a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/FeatureToggle.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class FeatureToggleConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + + public override Elastic.Clients.Elasticsearch.Xpack.FeatureToggle Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEnabled = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.FeatureToggle(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Enabled = propEnabled.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.FeatureToggle value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/FeatureToggle.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/FeatureToggle.g.cs index edd61d95cc8..addab7d001e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/FeatureToggle.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/FeatureToggle.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class FeatureToggleConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - - public override Elastic.Clients.Elasticsearch.Xpack.FeatureToggle Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEnabled = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.FeatureToggle(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Enabled = propEnabled.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.FeatureToggle value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.FeatureToggleConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.FeatureToggleConverter))] public sealed partial class FeatureToggle { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Features.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Features.Converters.g.cs new file mode 100644 index 00000000000..41a4ee31a47 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Features.Converters.g.cs @@ -0,0 +1,297 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class FeaturesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAggregateMetric = System.Text.Json.JsonEncodedText.Encode("aggregate_metric"); + private static readonly System.Text.Json.JsonEncodedText PropAnalytics = System.Text.Json.JsonEncodedText.Encode("analytics"); + private static readonly System.Text.Json.JsonEncodedText PropArchive = System.Text.Json.JsonEncodedText.Encode("archive"); + private static readonly System.Text.Json.JsonEncodedText PropCcr = System.Text.Json.JsonEncodedText.Encode("ccr"); + private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"); + private static readonly System.Text.Json.JsonEncodedText PropDataTiers = System.Text.Json.JsonEncodedText.Encode("data_tiers"); + private static readonly System.Text.Json.JsonEncodedText PropEnrich = System.Text.Json.JsonEncodedText.Encode("enrich"); + private static readonly System.Text.Json.JsonEncodedText PropEnterpriseSearch = System.Text.Json.JsonEncodedText.Encode("enterprise_search"); + private static readonly System.Text.Json.JsonEncodedText PropEql = System.Text.Json.JsonEncodedText.Encode("eql"); + private static readonly System.Text.Json.JsonEncodedText PropEsql = System.Text.Json.JsonEncodedText.Encode("esql"); + private static readonly System.Text.Json.JsonEncodedText PropGraph = System.Text.Json.JsonEncodedText.Encode("graph"); + private static readonly System.Text.Json.JsonEncodedText PropIlm = System.Text.Json.JsonEncodedText.Encode("ilm"); + private static readonly System.Text.Json.JsonEncodedText PropLogsdb = System.Text.Json.JsonEncodedText.Encode("logsdb"); + private static readonly System.Text.Json.JsonEncodedText PropLogstash = System.Text.Json.JsonEncodedText.Encode("logstash"); + private static readonly System.Text.Json.JsonEncodedText PropMl = System.Text.Json.JsonEncodedText.Encode("ml"); + private static readonly System.Text.Json.JsonEncodedText PropMonitoring = System.Text.Json.JsonEncodedText.Encode("monitoring"); + private static readonly System.Text.Json.JsonEncodedText PropRollup = System.Text.Json.JsonEncodedText.Encode("rollup"); + private static readonly System.Text.Json.JsonEncodedText PropRuntimeFields = System.Text.Json.JsonEncodedText.Encode("runtime_fields"); + private static readonly System.Text.Json.JsonEncodedText PropSearchableSnapshots = System.Text.Json.JsonEncodedText.Encode("searchable_snapshots"); + private static readonly System.Text.Json.JsonEncodedText PropSecurity = System.Text.Json.JsonEncodedText.Encode("security"); + private static readonly System.Text.Json.JsonEncodedText PropSlm = System.Text.Json.JsonEncodedText.Encode("slm"); + private static readonly System.Text.Json.JsonEncodedText PropSpatial = System.Text.Json.JsonEncodedText.Encode("spatial"); + private static readonly System.Text.Json.JsonEncodedText PropSql = System.Text.Json.JsonEncodedText.Encode("sql"); + private static readonly System.Text.Json.JsonEncodedText PropTransform = System.Text.Json.JsonEncodedText.Encode("transform"); + private static readonly System.Text.Json.JsonEncodedText PropUniversalProfiling = System.Text.Json.JsonEncodedText.Encode("universal_profiling"); + private static readonly System.Text.Json.JsonEncodedText PropVotingOnly = System.Text.Json.JsonEncodedText.Encode("voting_only"); + private static readonly System.Text.Json.JsonEncodedText PropWatcher = System.Text.Json.JsonEncodedText.Encode("watcher"); + + public override Elastic.Clients.Elasticsearch.Xpack.Features Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAggregateMetric = default; + LocalJsonValue propAnalytics = default; + LocalJsonValue propArchive = default; + LocalJsonValue propCcr = default; + LocalJsonValue propDataStreams = default; + LocalJsonValue propDataTiers = default; + LocalJsonValue propEnrich = default; + LocalJsonValue propEnterpriseSearch = default; + LocalJsonValue propEql = default; + LocalJsonValue propEsql = default; + LocalJsonValue propGraph = default; + LocalJsonValue propIlm = default; + LocalJsonValue propLogsdb = default; + LocalJsonValue propLogstash = default; + LocalJsonValue propMl = default; + LocalJsonValue propMonitoring = default; + LocalJsonValue propRollup = default; + LocalJsonValue propRuntimeFields = default; + LocalJsonValue propSearchableSnapshots = default; + LocalJsonValue propSecurity = default; + LocalJsonValue propSlm = default; + LocalJsonValue propSpatial = default; + LocalJsonValue propSql = default; + LocalJsonValue propTransform = default; + LocalJsonValue propUniversalProfiling = default; + LocalJsonValue propVotingOnly = default; + LocalJsonValue propWatcher = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAggregateMetric.TryReadProperty(ref reader, options, PropAggregateMetric, null)) + { + continue; + } + + if (propAnalytics.TryReadProperty(ref reader, options, PropAnalytics, null)) + { + continue; + } + + if (propArchive.TryReadProperty(ref reader, options, PropArchive, null)) + { + continue; + } + + if (propCcr.TryReadProperty(ref reader, options, PropCcr, null)) + { + continue; + } + + if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, null)) + { + continue; + } + + if (propDataTiers.TryReadProperty(ref reader, options, PropDataTiers, null)) + { + continue; + } + + if (propEnrich.TryReadProperty(ref reader, options, PropEnrich, null)) + { + continue; + } + + if (propEnterpriseSearch.TryReadProperty(ref reader, options, PropEnterpriseSearch, null)) + { + continue; + } + + if (propEql.TryReadProperty(ref reader, options, PropEql, null)) + { + continue; + } + + if (propEsql.TryReadProperty(ref reader, options, PropEsql, null)) + { + continue; + } + + if (propGraph.TryReadProperty(ref reader, options, PropGraph, null)) + { + continue; + } + + if (propIlm.TryReadProperty(ref reader, options, PropIlm, null)) + { + continue; + } + + if (propLogsdb.TryReadProperty(ref reader, options, PropLogsdb, null)) + { + continue; + } + + if (propLogstash.TryReadProperty(ref reader, options, PropLogstash, null)) + { + continue; + } + + if (propMl.TryReadProperty(ref reader, options, PropMl, null)) + { + continue; + } + + if (propMonitoring.TryReadProperty(ref reader, options, PropMonitoring, null)) + { + continue; + } + + if (propRollup.TryReadProperty(ref reader, options, PropRollup, null)) + { + continue; + } + + if (propRuntimeFields.TryReadProperty(ref reader, options, PropRuntimeFields, null)) + { + continue; + } + + if (propSearchableSnapshots.TryReadProperty(ref reader, options, PropSearchableSnapshots, null)) + { + continue; + } + + if (propSecurity.TryReadProperty(ref reader, options, PropSecurity, null)) + { + continue; + } + + if (propSlm.TryReadProperty(ref reader, options, PropSlm, null)) + { + continue; + } + + if (propSpatial.TryReadProperty(ref reader, options, PropSpatial, null)) + { + continue; + } + + if (propSql.TryReadProperty(ref reader, options, PropSql, null)) + { + continue; + } + + if (propTransform.TryReadProperty(ref reader, options, PropTransform, null)) + { + continue; + } + + if (propUniversalProfiling.TryReadProperty(ref reader, options, PropUniversalProfiling, null)) + { + continue; + } + + if (propVotingOnly.TryReadProperty(ref reader, options, PropVotingOnly, null)) + { + continue; + } + + if (propWatcher.TryReadProperty(ref reader, options, PropWatcher, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.Features(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AggregateMetric = propAggregateMetric.Value, + Analytics = propAnalytics.Value, + Archive = propArchive.Value, + Ccr = propCcr.Value, + DataStreams = propDataStreams.Value, + DataTiers = propDataTiers.Value, + Enrich = propEnrich.Value, + EnterpriseSearch = propEnterpriseSearch.Value, + Eql = propEql.Value, + Esql = propEsql.Value, + Graph = propGraph.Value, + Ilm = propIlm.Value, + Logsdb = propLogsdb.Value, + Logstash = propLogstash.Value, + Ml = propMl.Value, + Monitoring = propMonitoring.Value, + Rollup = propRollup.Value, + RuntimeFields = propRuntimeFields.Value, + SearchableSnapshots = propSearchableSnapshots.Value, + Security = propSecurity.Value, + Slm = propSlm.Value, + Spatial = propSpatial.Value, + Sql = propSql.Value, + Transform = propTransform.Value, + UniversalProfiling = propUniversalProfiling.Value, + VotingOnly = propVotingOnly.Value, + Watcher = propWatcher.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Features value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAggregateMetric, value.AggregateMetric, null, null); + writer.WriteProperty(options, PropAnalytics, value.Analytics, null, null); + writer.WriteProperty(options, PropArchive, value.Archive, null, null); + writer.WriteProperty(options, PropCcr, value.Ccr, null, null); + writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, null); + writer.WriteProperty(options, PropDataTiers, value.DataTiers, null, null); + writer.WriteProperty(options, PropEnrich, value.Enrich, null, null); + writer.WriteProperty(options, PropEnterpriseSearch, value.EnterpriseSearch, null, null); + writer.WriteProperty(options, PropEql, value.Eql, null, null); + writer.WriteProperty(options, PropEsql, value.Esql, null, null); + writer.WriteProperty(options, PropGraph, value.Graph, null, null); + writer.WriteProperty(options, PropIlm, value.Ilm, null, null); + writer.WriteProperty(options, PropLogsdb, value.Logsdb, null, null); + writer.WriteProperty(options, PropLogstash, value.Logstash, null, null); + writer.WriteProperty(options, PropMl, value.Ml, null, null); + writer.WriteProperty(options, PropMonitoring, value.Monitoring, null, null); + writer.WriteProperty(options, PropRollup, value.Rollup, null, null); + writer.WriteProperty(options, PropRuntimeFields, value.RuntimeFields, null, null); + writer.WriteProperty(options, PropSearchableSnapshots, value.SearchableSnapshots, null, null); + writer.WriteProperty(options, PropSecurity, value.Security, null, null); + writer.WriteProperty(options, PropSlm, value.Slm, null, null); + writer.WriteProperty(options, PropSpatial, value.Spatial, null, null); + writer.WriteProperty(options, PropSql, value.Sql, null, null); + writer.WriteProperty(options, PropTransform, value.Transform, null, null); + writer.WriteProperty(options, PropUniversalProfiling, value.UniversalProfiling, null, null); + writer.WriteProperty(options, PropVotingOnly, value.VotingOnly, null, null); + writer.WriteProperty(options, PropWatcher, value.Watcher, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Features.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Features.g.cs index 00d2b91c2f5..73be95678c3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Features.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Features.g.cs @@ -23,280 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class FeaturesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAggregateMetric = System.Text.Json.JsonEncodedText.Encode("aggregate_metric"); - private static readonly System.Text.Json.JsonEncodedText PropAnalytics = System.Text.Json.JsonEncodedText.Encode("analytics"); - private static readonly System.Text.Json.JsonEncodedText PropArchive = System.Text.Json.JsonEncodedText.Encode("archive"); - private static readonly System.Text.Json.JsonEncodedText PropCcr = System.Text.Json.JsonEncodedText.Encode("ccr"); - private static readonly System.Text.Json.JsonEncodedText PropDataStreams = System.Text.Json.JsonEncodedText.Encode("data_streams"); - private static readonly System.Text.Json.JsonEncodedText PropDataTiers = System.Text.Json.JsonEncodedText.Encode("data_tiers"); - private static readonly System.Text.Json.JsonEncodedText PropEnrich = System.Text.Json.JsonEncodedText.Encode("enrich"); - private static readonly System.Text.Json.JsonEncodedText PropEnterpriseSearch = System.Text.Json.JsonEncodedText.Encode("enterprise_search"); - private static readonly System.Text.Json.JsonEncodedText PropEql = System.Text.Json.JsonEncodedText.Encode("eql"); - private static readonly System.Text.Json.JsonEncodedText PropEsql = System.Text.Json.JsonEncodedText.Encode("esql"); - private static readonly System.Text.Json.JsonEncodedText PropGraph = System.Text.Json.JsonEncodedText.Encode("graph"); - private static readonly System.Text.Json.JsonEncodedText PropIlm = System.Text.Json.JsonEncodedText.Encode("ilm"); - private static readonly System.Text.Json.JsonEncodedText PropLogsdb = System.Text.Json.JsonEncodedText.Encode("logsdb"); - private static readonly System.Text.Json.JsonEncodedText PropLogstash = System.Text.Json.JsonEncodedText.Encode("logstash"); - private static readonly System.Text.Json.JsonEncodedText PropMl = System.Text.Json.JsonEncodedText.Encode("ml"); - private static readonly System.Text.Json.JsonEncodedText PropMonitoring = System.Text.Json.JsonEncodedText.Encode("monitoring"); - private static readonly System.Text.Json.JsonEncodedText PropRollup = System.Text.Json.JsonEncodedText.Encode("rollup"); - private static readonly System.Text.Json.JsonEncodedText PropRuntimeFields = System.Text.Json.JsonEncodedText.Encode("runtime_fields"); - private static readonly System.Text.Json.JsonEncodedText PropSearchableSnapshots = System.Text.Json.JsonEncodedText.Encode("searchable_snapshots"); - private static readonly System.Text.Json.JsonEncodedText PropSecurity = System.Text.Json.JsonEncodedText.Encode("security"); - private static readonly System.Text.Json.JsonEncodedText PropSlm = System.Text.Json.JsonEncodedText.Encode("slm"); - private static readonly System.Text.Json.JsonEncodedText PropSpatial = System.Text.Json.JsonEncodedText.Encode("spatial"); - private static readonly System.Text.Json.JsonEncodedText PropSql = System.Text.Json.JsonEncodedText.Encode("sql"); - private static readonly System.Text.Json.JsonEncodedText PropTransform = System.Text.Json.JsonEncodedText.Encode("transform"); - private static readonly System.Text.Json.JsonEncodedText PropUniversalProfiling = System.Text.Json.JsonEncodedText.Encode("universal_profiling"); - private static readonly System.Text.Json.JsonEncodedText PropVotingOnly = System.Text.Json.JsonEncodedText.Encode("voting_only"); - private static readonly System.Text.Json.JsonEncodedText PropWatcher = System.Text.Json.JsonEncodedText.Encode("watcher"); - - public override Elastic.Clients.Elasticsearch.Xpack.Features Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAggregateMetric = default; - LocalJsonValue propAnalytics = default; - LocalJsonValue propArchive = default; - LocalJsonValue propCcr = default; - LocalJsonValue propDataStreams = default; - LocalJsonValue propDataTiers = default; - LocalJsonValue propEnrich = default; - LocalJsonValue propEnterpriseSearch = default; - LocalJsonValue propEql = default; - LocalJsonValue propEsql = default; - LocalJsonValue propGraph = default; - LocalJsonValue propIlm = default; - LocalJsonValue propLogsdb = default; - LocalJsonValue propLogstash = default; - LocalJsonValue propMl = default; - LocalJsonValue propMonitoring = default; - LocalJsonValue propRollup = default; - LocalJsonValue propRuntimeFields = default; - LocalJsonValue propSearchableSnapshots = default; - LocalJsonValue propSecurity = default; - LocalJsonValue propSlm = default; - LocalJsonValue propSpatial = default; - LocalJsonValue propSql = default; - LocalJsonValue propTransform = default; - LocalJsonValue propUniversalProfiling = default; - LocalJsonValue propVotingOnly = default; - LocalJsonValue propWatcher = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAggregateMetric.TryReadProperty(ref reader, options, PropAggregateMetric, null)) - { - continue; - } - - if (propAnalytics.TryReadProperty(ref reader, options, PropAnalytics, null)) - { - continue; - } - - if (propArchive.TryReadProperty(ref reader, options, PropArchive, null)) - { - continue; - } - - if (propCcr.TryReadProperty(ref reader, options, PropCcr, null)) - { - continue; - } - - if (propDataStreams.TryReadProperty(ref reader, options, PropDataStreams, null)) - { - continue; - } - - if (propDataTiers.TryReadProperty(ref reader, options, PropDataTiers, null)) - { - continue; - } - - if (propEnrich.TryReadProperty(ref reader, options, PropEnrich, null)) - { - continue; - } - - if (propEnterpriseSearch.TryReadProperty(ref reader, options, PropEnterpriseSearch, null)) - { - continue; - } - - if (propEql.TryReadProperty(ref reader, options, PropEql, null)) - { - continue; - } - - if (propEsql.TryReadProperty(ref reader, options, PropEsql, null)) - { - continue; - } - - if (propGraph.TryReadProperty(ref reader, options, PropGraph, null)) - { - continue; - } - - if (propIlm.TryReadProperty(ref reader, options, PropIlm, null)) - { - continue; - } - - if (propLogsdb.TryReadProperty(ref reader, options, PropLogsdb, null)) - { - continue; - } - - if (propLogstash.TryReadProperty(ref reader, options, PropLogstash, null)) - { - continue; - } - - if (propMl.TryReadProperty(ref reader, options, PropMl, null)) - { - continue; - } - - if (propMonitoring.TryReadProperty(ref reader, options, PropMonitoring, null)) - { - continue; - } - - if (propRollup.TryReadProperty(ref reader, options, PropRollup, null)) - { - continue; - } - - if (propRuntimeFields.TryReadProperty(ref reader, options, PropRuntimeFields, null)) - { - continue; - } - - if (propSearchableSnapshots.TryReadProperty(ref reader, options, PropSearchableSnapshots, null)) - { - continue; - } - - if (propSecurity.TryReadProperty(ref reader, options, PropSecurity, null)) - { - continue; - } - - if (propSlm.TryReadProperty(ref reader, options, PropSlm, null)) - { - continue; - } - - if (propSpatial.TryReadProperty(ref reader, options, PropSpatial, null)) - { - continue; - } - - if (propSql.TryReadProperty(ref reader, options, PropSql, null)) - { - continue; - } - - if (propTransform.TryReadProperty(ref reader, options, PropTransform, null)) - { - continue; - } - - if (propUniversalProfiling.TryReadProperty(ref reader, options, PropUniversalProfiling, null)) - { - continue; - } - - if (propVotingOnly.TryReadProperty(ref reader, options, PropVotingOnly, null)) - { - continue; - } - - if (propWatcher.TryReadProperty(ref reader, options, PropWatcher, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.Features(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - AggregateMetric = propAggregateMetric.Value, - Analytics = propAnalytics.Value, - Archive = propArchive.Value, - Ccr = propCcr.Value, - DataStreams = propDataStreams.Value, - DataTiers = propDataTiers.Value, - Enrich = propEnrich.Value, - EnterpriseSearch = propEnterpriseSearch.Value, - Eql = propEql.Value, - Esql = propEsql.Value, - Graph = propGraph.Value, - Ilm = propIlm.Value, - Logsdb = propLogsdb.Value, - Logstash = propLogstash.Value, - Ml = propMl.Value, - Monitoring = propMonitoring.Value, - Rollup = propRollup.Value, - RuntimeFields = propRuntimeFields.Value, - SearchableSnapshots = propSearchableSnapshots.Value, - Security = propSecurity.Value, - Slm = propSlm.Value, - Spatial = propSpatial.Value, - Sql = propSql.Value, - Transform = propTransform.Value, - UniversalProfiling = propUniversalProfiling.Value, - VotingOnly = propVotingOnly.Value, - Watcher = propWatcher.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Features value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAggregateMetric, value.AggregateMetric, null, null); - writer.WriteProperty(options, PropAnalytics, value.Analytics, null, null); - writer.WriteProperty(options, PropArchive, value.Archive, null, null); - writer.WriteProperty(options, PropCcr, value.Ccr, null, null); - writer.WriteProperty(options, PropDataStreams, value.DataStreams, null, null); - writer.WriteProperty(options, PropDataTiers, value.DataTiers, null, null); - writer.WriteProperty(options, PropEnrich, value.Enrich, null, null); - writer.WriteProperty(options, PropEnterpriseSearch, value.EnterpriseSearch, null, null); - writer.WriteProperty(options, PropEql, value.Eql, null, null); - writer.WriteProperty(options, PropEsql, value.Esql, null, null); - writer.WriteProperty(options, PropGraph, value.Graph, null, null); - writer.WriteProperty(options, PropIlm, value.Ilm, null, null); - writer.WriteProperty(options, PropLogsdb, value.Logsdb, null, null); - writer.WriteProperty(options, PropLogstash, value.Logstash, null, null); - writer.WriteProperty(options, PropMl, value.Ml, null, null); - writer.WriteProperty(options, PropMonitoring, value.Monitoring, null, null); - writer.WriteProperty(options, PropRollup, value.Rollup, null, null); - writer.WriteProperty(options, PropRuntimeFields, value.RuntimeFields, null, null); - writer.WriteProperty(options, PropSearchableSnapshots, value.SearchableSnapshots, null, null); - writer.WriteProperty(options, PropSecurity, value.Security, null, null); - writer.WriteProperty(options, PropSlm, value.Slm, null, null); - writer.WriteProperty(options, PropSpatial, value.Spatial, null, null); - writer.WriteProperty(options, PropSql, value.Sql, null, null); - writer.WriteProperty(options, PropTransform, value.Transform, null, null); - writer.WriteProperty(options, PropUniversalProfiling, value.UniversalProfiling, null, null); - writer.WriteProperty(options, PropVotingOnly, value.VotingOnly, null, null); - writer.WriteProperty(options, PropWatcher, value.Watcher, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.FeaturesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.FeaturesConverter))] public sealed partial class Features { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Flattened.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Flattened.Converters.g.cs new file mode 100644 index 00000000000..bb974def551 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Flattened.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class FlattenedConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropFieldCount = System.Text.Json.JsonEncodedText.Encode("field_count"); + + public override Elastic.Clients.Elasticsearch.Xpack.Flattened Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvailable = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propFieldCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propFieldCount.TryReadProperty(ref reader, options, PropFieldCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.Flattened(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Available = propAvailable.Value, + Enabled = propEnabled.Value, + FieldCount = propFieldCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Flattened value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvailable, value.Available, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropFieldCount, value.FieldCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Flattened.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Flattened.g.cs index beea7377311..1358cda7c1d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Flattened.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Flattened.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class FlattenedConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropFieldCount = System.Text.Json.JsonEncodedText.Encode("field_count"); - - public override Elastic.Clients.Elasticsearch.Xpack.Flattened Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvailable = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propFieldCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propFieldCount.TryReadProperty(ref reader, options, PropFieldCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.Flattened(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Available = propAvailable.Value, - Enabled = propEnabled.Value, - FieldCount = propFieldCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Flattened value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvailable, value.Available, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropFieldCount, value.FieldCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.FlattenedConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.FlattenedConverter))] public sealed partial class Flattened { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/HealthStatistics.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/HealthStatistics.Converters.g.cs new file mode 100644 index 00000000000..035fc3ac1af --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/HealthStatistics.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class HealthStatisticsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropInvocations = System.Text.Json.JsonEncodedText.Encode("invocations"); + + public override Elastic.Clients.Elasticsearch.Xpack.HealthStatistics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvailable = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propInvocations = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propInvocations.TryReadProperty(ref reader, options, PropInvocations, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.HealthStatistics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Available = propAvailable.Value, + Enabled = propEnabled.Value, + Invocations = propInvocations.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.HealthStatistics value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvailable, value.Available, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropInvocations, value.Invocations, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/HealthStatistics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/HealthStatistics.g.cs index 494a0a5b529..274acb9e0d0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/HealthStatistics.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/HealthStatistics.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class HealthStatisticsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropInvocations = System.Text.Json.JsonEncodedText.Encode("invocations"); - - public override Elastic.Clients.Elasticsearch.Xpack.HealthStatistics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvailable = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propInvocations = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propInvocations.TryReadProperty(ref reader, options, PropInvocations, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.HealthStatistics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Available = propAvailable.Value, - Enabled = propEnabled.Value, - Invocations = propInvocations.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.HealthStatistics value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvailable, value.Available, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropInvocations, value.Invocations, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.HealthStatisticsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.HealthStatisticsConverter))] public sealed partial class HealthStatistics { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ilm.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ilm.Converters.g.cs new file mode 100644 index 00000000000..09eb1867821 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ilm.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class IlmConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPolicyCount = System.Text.Json.JsonEncodedText.Encode("policy_count"); + private static readonly System.Text.Json.JsonEncodedText PropPolicyStats = System.Text.Json.JsonEncodedText.Encode("policy_stats"); + + public override Elastic.Clients.Elasticsearch.Xpack.Ilm Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPolicyCount = default; + LocalJsonValue> propPolicyStats = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPolicyCount.TryReadProperty(ref reader, options, PropPolicyCount, null)) + { + continue; + } + + if (propPolicyStats.TryReadProperty(ref reader, options, PropPolicyStats, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.Ilm(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + PolicyCount = propPolicyCount.Value, + PolicyStats = propPolicyStats.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Ilm value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPolicyCount, value.PolicyCount, null, null); + writer.WriteProperty(options, PropPolicyStats, value.PolicyStats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ilm.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ilm.g.cs index c9d7dca702b..b5a003e8b71 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ilm.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ilm.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class IlmConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPolicyCount = System.Text.Json.JsonEncodedText.Encode("policy_count"); - private static readonly System.Text.Json.JsonEncodedText PropPolicyStats = System.Text.Json.JsonEncodedText.Encode("policy_stats"); - - public override Elastic.Clients.Elasticsearch.Xpack.Ilm Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPolicyCount = default; - LocalJsonValue> propPolicyStats = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPolicyCount.TryReadProperty(ref reader, options, PropPolicyCount, null)) - { - continue; - } - - if (propPolicyStats.TryReadProperty(ref reader, options, PropPolicyStats, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.Ilm(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - PolicyCount = propPolicyCount.Value, - PolicyStats = propPolicyStats.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Ilm value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPolicyCount, value.PolicyCount, null, null); - writer.WriteProperty(options, PropPolicyStats, value.PolicyStats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.IlmConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.IlmConverter))] public sealed partial class Ilm { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/IlmPolicyStatistics.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/IlmPolicyStatistics.Converters.g.cs new file mode 100644 index 00000000000..2c676fd0c1b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/IlmPolicyStatistics.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class IlmPolicyStatisticsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndicesManaged = System.Text.Json.JsonEncodedText.Encode("indices_managed"); + private static readonly System.Text.Json.JsonEncodedText PropPhases = System.Text.Json.JsonEncodedText.Encode("phases"); + + public override Elastic.Clients.Elasticsearch.Xpack.IlmPolicyStatistics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndicesManaged = default; + LocalJsonValue propPhases = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndicesManaged.TryReadProperty(ref reader, options, PropIndicesManaged, null)) + { + continue; + } + + if (propPhases.TryReadProperty(ref reader, options, PropPhases, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.IlmPolicyStatistics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + IndicesManaged = propIndicesManaged.Value, + Phases = propPhases.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.IlmPolicyStatistics value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndicesManaged, value.IndicesManaged, null, null); + writer.WriteProperty(options, PropPhases, value.Phases, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/IlmPolicyStatistics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/IlmPolicyStatistics.g.cs index f51d4c70976..038084fdcd4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/IlmPolicyStatistics.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/IlmPolicyStatistics.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class IlmPolicyStatisticsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropIndicesManaged = System.Text.Json.JsonEncodedText.Encode("indices_managed"); - private static readonly System.Text.Json.JsonEncodedText PropPhases = System.Text.Json.JsonEncodedText.Encode("phases"); - - public override Elastic.Clients.Elasticsearch.Xpack.IlmPolicyStatistics Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndicesManaged = default; - LocalJsonValue propPhases = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propIndicesManaged.TryReadProperty(ref reader, options, PropIndicesManaged, null)) - { - continue; - } - - if (propPhases.TryReadProperty(ref reader, options, PropPhases, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.IlmPolicyStatistics(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - IndicesManaged = propIndicesManaged.Value, - Phases = propPhases.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.IlmPolicyStatistics value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropIndicesManaged, value.IndicesManaged, null, null); - writer.WriteProperty(options, PropPhases, value.Phases, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.IlmPolicyStatisticsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.IlmPolicyStatisticsConverter))] public sealed partial class IlmPolicyStatistics { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Invocations.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Invocations.Converters.g.cs new file mode 100644 index 00000000000..28ef636150f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Invocations.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class InvocationsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Xpack.Invocations Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.Invocations(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Invocations value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Invocations.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Invocations.g.cs index cf00013a53d..41fba81c45d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Invocations.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Invocations.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class InvocationsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Xpack.Invocations Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.Invocations(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Invocations value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.InvocationsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.InvocationsConverter))] public sealed partial class Invocations { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/IpFilter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/IpFilter.Converters.g.cs new file mode 100644 index 00000000000..2ccf481f11e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/IpFilter.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class IpFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropHttp = System.Text.Json.JsonEncodedText.Encode("http"); + private static readonly System.Text.Json.JsonEncodedText PropTransport = System.Text.Json.JsonEncodedText.Encode("transport"); + + public override Elastic.Clients.Elasticsearch.Xpack.IpFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propHttp = default; + LocalJsonValue propTransport = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propHttp.TryReadProperty(ref reader, options, PropHttp, null)) + { + continue; + } + + if (propTransport.TryReadProperty(ref reader, options, PropTransport, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.IpFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Http = propHttp.Value, + Transport = propTransport.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.IpFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropHttp, value.Http, null, null); + writer.WriteProperty(options, PropTransport, value.Transport, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/IpFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/IpFilter.g.cs index 7591bdc9b15..efdf2278cd3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/IpFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/IpFilter.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class IpFilterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropHttp = System.Text.Json.JsonEncodedText.Encode("http"); - private static readonly System.Text.Json.JsonEncodedText PropTransport = System.Text.Json.JsonEncodedText.Encode("transport"); - - public override Elastic.Clients.Elasticsearch.Xpack.IpFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propHttp = default; - LocalJsonValue propTransport = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propHttp.TryReadProperty(ref reader, options, PropHttp, null)) - { - continue; - } - - if (propTransport.TryReadProperty(ref reader, options, PropTransport, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.IpFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Http = propHttp.Value, - Transport = propTransport.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.IpFilter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropHttp, value.Http, null, null); - writer.WriteProperty(options, PropTransport, value.Transport, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.IpFilterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.IpFilterConverter))] public sealed partial class IpFilter { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/JobUsage.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/JobUsage.Converters.g.cs new file mode 100644 index 00000000000..1d531cd1016 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/JobUsage.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class JobUsageConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropCreatedBy = System.Text.Json.JsonEncodedText.Encode("created_by"); + private static readonly System.Text.Json.JsonEncodedText PropDetectors = System.Text.Json.JsonEncodedText.Encode("detectors"); + private static readonly System.Text.Json.JsonEncodedText PropForecasts = System.Text.Json.JsonEncodedText.Encode("forecasts"); + private static readonly System.Text.Json.JsonEncodedText PropModelSize = System.Text.Json.JsonEncodedText.Encode("model_size"); + + public override Elastic.Clients.Elasticsearch.Xpack.JobUsage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue> propCreatedBy = default; + LocalJsonValue propDetectors = default; + LocalJsonValue propForecasts = default; + LocalJsonValue propModelSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propCreatedBy.TryReadProperty(ref reader, options, PropCreatedBy, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propDetectors.TryReadProperty(ref reader, options, PropDetectors, null)) + { + continue; + } + + if (propForecasts.TryReadProperty(ref reader, options, PropForecasts, null)) + { + continue; + } + + if (propModelSize.TryReadProperty(ref reader, options, PropModelSize, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.JobUsage(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + CreatedBy = propCreatedBy.Value, + Detectors = propDetectors.Value, + Forecasts = propForecasts.Value, + ModelSize = propModelSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.JobUsage value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropCreatedBy, value.CreatedBy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropDetectors, value.Detectors, null, null); + writer.WriteProperty(options, PropForecasts, value.Forecasts, null, null); + writer.WriteProperty(options, PropModelSize, value.ModelSize, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/JobUsage.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/JobUsage.g.cs index 3a77f4c2077..0a4475d2e44 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/JobUsage.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/JobUsage.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class JobUsageConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropCreatedBy = System.Text.Json.JsonEncodedText.Encode("created_by"); - private static readonly System.Text.Json.JsonEncodedText PropDetectors = System.Text.Json.JsonEncodedText.Encode("detectors"); - private static readonly System.Text.Json.JsonEncodedText PropForecasts = System.Text.Json.JsonEncodedText.Encode("forecasts"); - private static readonly System.Text.Json.JsonEncodedText PropModelSize = System.Text.Json.JsonEncodedText.Encode("model_size"); - - public override Elastic.Clients.Elasticsearch.Xpack.JobUsage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue> propCreatedBy = default; - LocalJsonValue propDetectors = default; - LocalJsonValue propForecasts = default; - LocalJsonValue propModelSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propCreatedBy.TryReadProperty(ref reader, options, PropCreatedBy, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propDetectors.TryReadProperty(ref reader, options, PropDetectors, null)) - { - continue; - } - - if (propForecasts.TryReadProperty(ref reader, options, PropForecasts, null)) - { - continue; - } - - if (propModelSize.TryReadProperty(ref reader, options, PropModelSize, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.JobUsage(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - CreatedBy = propCreatedBy.Value, - Detectors = propDetectors.Value, - Forecasts = propForecasts.Value, - ModelSize = propModelSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.JobUsage value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropCreatedBy, value.CreatedBy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropDetectors, value.Detectors, null, null); - writer.WriteProperty(options, PropForecasts, value.Forecasts, null, null); - writer.WriteProperty(options, PropModelSize, value.ModelSize, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.JobUsageConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.JobUsageConverter))] public sealed partial class JobUsage { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MachineLearning.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MachineLearning.Converters.g.cs new file mode 100644 index 00000000000..97e3656b9b5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MachineLearning.Converters.g.cs @@ -0,0 +1,117 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class MachineLearningConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); + private static readonly System.Text.Json.JsonEncodedText PropDatafeeds = System.Text.Json.JsonEncodedText.Encode("datafeeds"); + private static readonly System.Text.Json.JsonEncodedText PropDataFrameAnalyticsJobs = System.Text.Json.JsonEncodedText.Encode("data_frame_analytics_jobs"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropInference = System.Text.Json.JsonEncodedText.Encode("inference"); + private static readonly System.Text.Json.JsonEncodedText PropJobs = System.Text.Json.JsonEncodedText.Encode("jobs"); + private static readonly System.Text.Json.JsonEncodedText PropNodeCount = System.Text.Json.JsonEncodedText.Encode("node_count"); + + public override Elastic.Clients.Elasticsearch.Xpack.MachineLearning Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvailable = default; + LocalJsonValue> propDatafeeds = default; + LocalJsonValue propDataFrameAnalyticsJobs = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propInference = default; + LocalJsonValue> propJobs = default; + LocalJsonValue propNodeCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) + { + continue; + } + + if (propDatafeeds.TryReadProperty(ref reader, options, PropDatafeeds, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propDataFrameAnalyticsJobs.TryReadProperty(ref reader, options, PropDataFrameAnalyticsJobs, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propInference.TryReadProperty(ref reader, options, PropInference, null)) + { + continue; + } + + if (propJobs.TryReadProperty(ref reader, options, PropJobs, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propNodeCount.TryReadProperty(ref reader, options, PropNodeCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.MachineLearning(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Available = propAvailable.Value, + Datafeeds = propDatafeeds.Value, + DataFrameAnalyticsJobs = propDataFrameAnalyticsJobs.Value, + Enabled = propEnabled.Value, + Inference = propInference.Value, + Jobs = propJobs.Value, + NodeCount = propNodeCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MachineLearning value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvailable, value.Available, null, null); + writer.WriteProperty(options, PropDatafeeds, value.Datafeeds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropDataFrameAnalyticsJobs, value.DataFrameAnalyticsJobs, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropInference, value.Inference, null, null); + writer.WriteProperty(options, PropJobs, value.Jobs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropNodeCount, value.NodeCount, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MachineLearning.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MachineLearning.g.cs index 40f30e25c63..959a7141cea 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MachineLearning.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MachineLearning.g.cs @@ -23,100 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class MachineLearningConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); - private static readonly System.Text.Json.JsonEncodedText PropDatafeeds = System.Text.Json.JsonEncodedText.Encode("datafeeds"); - private static readonly System.Text.Json.JsonEncodedText PropDataFrameAnalyticsJobs = System.Text.Json.JsonEncodedText.Encode("data_frame_analytics_jobs"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropInference = System.Text.Json.JsonEncodedText.Encode("inference"); - private static readonly System.Text.Json.JsonEncodedText PropJobs = System.Text.Json.JsonEncodedText.Encode("jobs"); - private static readonly System.Text.Json.JsonEncodedText PropNodeCount = System.Text.Json.JsonEncodedText.Encode("node_count"); - - public override Elastic.Clients.Elasticsearch.Xpack.MachineLearning Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvailable = default; - LocalJsonValue> propDatafeeds = default; - LocalJsonValue propDataFrameAnalyticsJobs = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propInference = default; - LocalJsonValue> propJobs = default; - LocalJsonValue propNodeCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) - { - continue; - } - - if (propDatafeeds.TryReadProperty(ref reader, options, PropDatafeeds, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propDataFrameAnalyticsJobs.TryReadProperty(ref reader, options, PropDataFrameAnalyticsJobs, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propInference.TryReadProperty(ref reader, options, PropInference, null)) - { - continue; - } - - if (propJobs.TryReadProperty(ref reader, options, PropJobs, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propNodeCount.TryReadProperty(ref reader, options, PropNodeCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.MachineLearning(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Available = propAvailable.Value, - Datafeeds = propDatafeeds.Value, - DataFrameAnalyticsJobs = propDataFrameAnalyticsJobs.Value, - Enabled = propEnabled.Value, - Inference = propInference.Value, - Jobs = propJobs.Value, - NodeCount = propNodeCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MachineLearning value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvailable, value.Available, null, null); - writer.WriteProperty(options, PropDatafeeds, value.Datafeeds, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropDataFrameAnalyticsJobs, value.DataFrameAnalyticsJobs, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropInference, value.Inference, null, null); - writer.WriteProperty(options, PropJobs, value.Jobs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropNodeCount, value.NodeCount, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.MachineLearningConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.MachineLearningConverter))] public sealed partial class MachineLearning { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MinimalLicenseInformation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MinimalLicenseInformation.Converters.g.cs new file mode 100644 index 00000000000..14af98d7012 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MinimalLicenseInformation.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class MinimalLicenseInformationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropExpiryDateInMillis = System.Text.Json.JsonEncodedText.Encode("expiry_date_in_millis"); + private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropUid = System.Text.Json.JsonEncodedText.Encode("uid"); + + public override Elastic.Clients.Elasticsearch.Xpack.MinimalLicenseInformation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExpiryDateInMillis = default; + LocalJsonValue propMode = default; + LocalJsonValue propStatus = default; + LocalJsonValue propType = default; + LocalJsonValue propUid = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propExpiryDateInMillis.TryReadProperty(ref reader, options, PropExpiryDateInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propMode.TryReadProperty(ref reader, options, PropMode, null)) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (propType.TryReadProperty(ref reader, options, PropType, null)) + { + continue; + } + + if (propUid.TryReadProperty(ref reader, options, PropUid, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.MinimalLicenseInformation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ExpiryDateInMillis = propExpiryDateInMillis.Value, + Mode = propMode.Value, + Status = propStatus.Value, + Type = propType.Value, + Uid = propUid.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MinimalLicenseInformation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropExpiryDateInMillis, value.ExpiryDateInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropMode, value.Mode, null, null); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropUid, value.Uid, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MinimalLicenseInformation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MinimalLicenseInformation.g.cs index 5b4c62bc26b..b7e0c9b7b78 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MinimalLicenseInformation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MinimalLicenseInformation.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class MinimalLicenseInformationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropExpiryDateInMillis = System.Text.Json.JsonEncodedText.Encode("expiry_date_in_millis"); - private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); - private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); - private static readonly System.Text.Json.JsonEncodedText PropUid = System.Text.Json.JsonEncodedText.Encode("uid"); - - public override Elastic.Clients.Elasticsearch.Xpack.MinimalLicenseInformation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propExpiryDateInMillis = default; - LocalJsonValue propMode = default; - LocalJsonValue propStatus = default; - LocalJsonValue propType = default; - LocalJsonValue propUid = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propExpiryDateInMillis.TryReadProperty(ref reader, options, PropExpiryDateInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) - { - continue; - } - - if (propMode.TryReadProperty(ref reader, options, PropMode, null)) - { - continue; - } - - if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - if (propUid.TryReadProperty(ref reader, options, PropUid, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.MinimalLicenseInformation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ExpiryDateInMillis = propExpiryDateInMillis.Value, - Mode = propMode.Value, - Status = propStatus.Value, - Type = propType.Value, - Uid = propUid.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MinimalLicenseInformation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropExpiryDateInMillis, value.ExpiryDateInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); - writer.WriteProperty(options, PropMode, value.Mode, null, null); - writer.WriteProperty(options, PropStatus, value.Status, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropUid, value.Uid, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.MinimalLicenseInformationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.MinimalLicenseInformationConverter))] public sealed partial class MinimalLicenseInformation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlCounter.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlCounter.Converters.g.cs new file mode 100644 index 00000000000..86c5f96f8a3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlCounter.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class MlCounterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + + public override Elastic.Clients.Elasticsearch.Xpack.MlCounter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.MlCounter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MlCounter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlCounter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlCounter.g.cs index 121afd122e0..ce02a952417 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlCounter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlCounter.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class MlCounterConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - - public override Elastic.Clients.Elasticsearch.Xpack.MlCounter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.MlCounter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MlCounter value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.MlCounterConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.MlCounterConverter))] public sealed partial class MlCounter { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobs.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobs.Converters.g.cs new file mode 100644 index 00000000000..ada1ced1880 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobs.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class MlDataFrameAnalyticsJobsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAll = System.Text.Json.JsonEncodedText.Encode("_all"); + private static readonly System.Text.Json.JsonEncodedText PropAnalysisCounts = System.Text.Json.JsonEncodedText.Encode("analysis_counts"); + private static readonly System.Text.Json.JsonEncodedText PropMemoryUsage = System.Text.Json.JsonEncodedText.Encode("memory_usage"); + private static readonly System.Text.Json.JsonEncodedText PropStopped = System.Text.Json.JsonEncodedText.Encode("stopped"); + + public override Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobs Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAll = default; + LocalJsonValue propAnalysisCounts = default; + LocalJsonValue propMemoryUsage = default; + LocalJsonValue propStopped = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAll.TryReadProperty(ref reader, options, PropAll, null)) + { + continue; + } + + if (propAnalysisCounts.TryReadProperty(ref reader, options, PropAnalysisCounts, null)) + { + continue; + } + + if (propMemoryUsage.TryReadProperty(ref reader, options, PropMemoryUsage, null)) + { + continue; + } + + if (propStopped.TryReadProperty(ref reader, options, PropStopped, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobs(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + All = propAll.Value, + AnalysisCounts = propAnalysisCounts.Value, + MemoryUsage = propMemoryUsage.Value, + Stopped = propStopped.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobs value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAll, value.All, null, null); + writer.WriteProperty(options, PropAnalysisCounts, value.AnalysisCounts, null, null); + writer.WriteProperty(options, PropMemoryUsage, value.MemoryUsage, null, null); + writer.WriteProperty(options, PropStopped, value.Stopped, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobs.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobs.g.cs index 94fcf70aef3..a0d5da59a5d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobs.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobs.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class MlDataFrameAnalyticsJobsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAll = System.Text.Json.JsonEncodedText.Encode("_all"); - private static readonly System.Text.Json.JsonEncodedText PropAnalysisCounts = System.Text.Json.JsonEncodedText.Encode("analysis_counts"); - private static readonly System.Text.Json.JsonEncodedText PropMemoryUsage = System.Text.Json.JsonEncodedText.Encode("memory_usage"); - private static readonly System.Text.Json.JsonEncodedText PropStopped = System.Text.Json.JsonEncodedText.Encode("stopped"); - - public override Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobs Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAll = default; - LocalJsonValue propAnalysisCounts = default; - LocalJsonValue propMemoryUsage = default; - LocalJsonValue propStopped = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAll.TryReadProperty(ref reader, options, PropAll, null)) - { - continue; - } - - if (propAnalysisCounts.TryReadProperty(ref reader, options, PropAnalysisCounts, null)) - { - continue; - } - - if (propMemoryUsage.TryReadProperty(ref reader, options, PropMemoryUsage, null)) - { - continue; - } - - if (propStopped.TryReadProperty(ref reader, options, PropStopped, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobs(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - All = propAll.Value, - AnalysisCounts = propAnalysisCounts.Value, - MemoryUsage = propMemoryUsage.Value, - Stopped = propStopped.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobs value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAll, value.All, null, null); - writer.WriteProperty(options, PropAnalysisCounts, value.AnalysisCounts, null, null); - writer.WriteProperty(options, PropMemoryUsage, value.MemoryUsage, null, null); - writer.WriteProperty(options, PropStopped, value.Stopped, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.MlDataFrameAnalyticsJobsConverter))] public sealed partial class MlDataFrameAnalyticsJobs { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsAnalysis.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsAnalysis.Converters.g.cs new file mode 100644 index 00000000000..ca75474a33a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsAnalysis.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class MlDataFrameAnalyticsJobsAnalysisConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClassification = System.Text.Json.JsonEncodedText.Encode("classification"); + private static readonly System.Text.Json.JsonEncodedText PropOutlierDetection = System.Text.Json.JsonEncodedText.Encode("outlier_detection"); + private static readonly System.Text.Json.JsonEncodedText PropRegression = System.Text.Json.JsonEncodedText.Encode("regression"); + + public override Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobsAnalysis Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClassification = default; + LocalJsonValue propOutlierDetection = default; + LocalJsonValue propRegression = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClassification.TryReadProperty(ref reader, options, PropClassification, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOutlierDetection.TryReadProperty(ref reader, options, PropOutlierDetection, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propRegression.TryReadProperty(ref reader, options, PropRegression, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobsAnalysis(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Classification = propClassification.Value, + OutlierDetection = propOutlierDetection.Value, + Regression = propRegression.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobsAnalysis value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClassification, value.Classification, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOutlierDetection, value.OutlierDetection, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropRegression, value.Regression, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsAnalysis.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsAnalysis.g.cs index 9d7f26a6056..f361616e135 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsAnalysis.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsAnalysis.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class MlDataFrameAnalyticsJobsAnalysisConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClassification = System.Text.Json.JsonEncodedText.Encode("classification"); - private static readonly System.Text.Json.JsonEncodedText PropOutlierDetection = System.Text.Json.JsonEncodedText.Encode("outlier_detection"); - private static readonly System.Text.Json.JsonEncodedText PropRegression = System.Text.Json.JsonEncodedText.Encode("regression"); - - public override Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobsAnalysis Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClassification = default; - LocalJsonValue propOutlierDetection = default; - LocalJsonValue propRegression = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClassification.TryReadProperty(ref reader, options, PropClassification, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOutlierDetection.TryReadProperty(ref reader, options, PropOutlierDetection, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propRegression.TryReadProperty(ref reader, options, PropRegression, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobsAnalysis(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Classification = propClassification.Value, - OutlierDetection = propOutlierDetection.Value, - Regression = propRegression.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobsAnalysis value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClassification, value.Classification, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOutlierDetection, value.OutlierDetection, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropRegression, value.Regression, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobsAnalysisConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.MlDataFrameAnalyticsJobsAnalysisConverter))] public sealed partial class MlDataFrameAnalyticsJobsAnalysis { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsCount.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsCount.Converters.g.cs new file mode 100644 index 00000000000..fafc085f530 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsCount.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class MlDataFrameAnalyticsJobsCountConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + + public override Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobsCount Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobsCount(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobsCount value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsCount.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsCount.g.cs index 29946c8450f..33e402a21f5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsCount.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsCount.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class MlDataFrameAnalyticsJobsCountConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - - public override Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobsCount Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobsCount(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobsCount value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobsCountConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.MlDataFrameAnalyticsJobsCountConverter))] public sealed partial class MlDataFrameAnalyticsJobsCount { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsMemory.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsMemory.Converters.g.cs new file mode 100644 index 00000000000..c64e130e783 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsMemory.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class MlDataFrameAnalyticsJobsMemoryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPeakUsageBytes = System.Text.Json.JsonEncodedText.Encode("peak_usage_bytes"); + + public override Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobsMemory Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPeakUsageBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPeakUsageBytes.TryReadProperty(ref reader, options, PropPeakUsageBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobsMemory(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + PeakUsageBytes = propPeakUsageBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobsMemory value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPeakUsageBytes, value.PeakUsageBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsMemory.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsMemory.g.cs index 445bc79f2d9..7017f418ea9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsMemory.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlDataFrameAnalyticsJobsMemory.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class MlDataFrameAnalyticsJobsMemoryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropPeakUsageBytes = System.Text.Json.JsonEncodedText.Encode("peak_usage_bytes"); - - public override Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobsMemory Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propPeakUsageBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propPeakUsageBytes.TryReadProperty(ref reader, options, PropPeakUsageBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobsMemory(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - PeakUsageBytes = propPeakUsageBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobsMemory value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropPeakUsageBytes, value.PeakUsageBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.MlDataFrameAnalyticsJobsMemoryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.MlDataFrameAnalyticsJobsMemoryConverter))] public sealed partial class MlDataFrameAnalyticsJobsMemory { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInference.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInference.Converters.g.cs new file mode 100644 index 00000000000..31340d25401 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInference.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class MlInferenceConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDeployments = System.Text.Json.JsonEncodedText.Encode("deployments"); + private static readonly System.Text.Json.JsonEncodedText PropIngestProcessors = System.Text.Json.JsonEncodedText.Encode("ingest_processors"); + private static readonly System.Text.Json.JsonEncodedText PropTrainedModels = System.Text.Json.JsonEncodedText.Encode("trained_models"); + + public override Elastic.Clients.Elasticsearch.Xpack.MlInference Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDeployments = default; + LocalJsonValue> propIngestProcessors = default; + LocalJsonValue propTrainedModels = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDeployments.TryReadProperty(ref reader, options, PropDeployments, null)) + { + continue; + } + + if (propIngestProcessors.TryReadProperty(ref reader, options, PropIngestProcessors, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propTrainedModels.TryReadProperty(ref reader, options, PropTrainedModels, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.MlInference(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Deployments = propDeployments.Value, + IngestProcessors = propIngestProcessors.Value, + TrainedModels = propTrainedModels.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MlInference value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDeployments, value.Deployments, null, null); + writer.WriteProperty(options, PropIngestProcessors, value.IngestProcessors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropTrainedModels, value.TrainedModels, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInference.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInference.g.cs index 8dd504f66f6..b0de385eed8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInference.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInference.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class MlInferenceConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDeployments = System.Text.Json.JsonEncodedText.Encode("deployments"); - private static readonly System.Text.Json.JsonEncodedText PropIngestProcessors = System.Text.Json.JsonEncodedText.Encode("ingest_processors"); - private static readonly System.Text.Json.JsonEncodedText PropTrainedModels = System.Text.Json.JsonEncodedText.Encode("trained_models"); - - public override Elastic.Clients.Elasticsearch.Xpack.MlInference Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDeployments = default; - LocalJsonValue> propIngestProcessors = default; - LocalJsonValue propTrainedModels = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDeployments.TryReadProperty(ref reader, options, PropDeployments, null)) - { - continue; - } - - if (propIngestProcessors.TryReadProperty(ref reader, options, PropIngestProcessors, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propTrainedModels.TryReadProperty(ref reader, options, PropTrainedModels, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.MlInference(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Deployments = propDeployments.Value, - IngestProcessors = propIngestProcessors.Value, - TrainedModels = propTrainedModels.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MlInference value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDeployments, value.Deployments, null, null); - writer.WriteProperty(options, PropIngestProcessors, value.IngestProcessors, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropTrainedModels, value.TrainedModels, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.MlInferenceConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.MlInferenceConverter))] public sealed partial class MlInference { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceDeployments.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceDeployments.Converters.g.cs new file mode 100644 index 00000000000..44014473e7f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceDeployments.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class MlInferenceDeploymentsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceCounts = System.Text.Json.JsonEncodedText.Encode("inference_counts"); + private static readonly System.Text.Json.JsonEncodedText PropModelSizesBytes = System.Text.Json.JsonEncodedText.Encode("model_sizes_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropTimeMs = System.Text.Json.JsonEncodedText.Encode("time_ms"); + + public override Elastic.Clients.Elasticsearch.Xpack.MlInferenceDeployments Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propInferenceCounts = default; + LocalJsonValue propModelSizesBytes = default; + LocalJsonValue propTimeMs = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propInferenceCounts.TryReadProperty(ref reader, options, PropInferenceCounts, null)) + { + continue; + } + + if (propModelSizesBytes.TryReadProperty(ref reader, options, PropModelSizesBytes, null)) + { + continue; + } + + if (propTimeMs.TryReadProperty(ref reader, options, PropTimeMs, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.MlInferenceDeployments(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + InferenceCounts = propInferenceCounts.Value, + ModelSizesBytes = propModelSizesBytes.Value, + TimeMs = propTimeMs.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MlInferenceDeployments value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropInferenceCounts, value.InferenceCounts, null, null); + writer.WriteProperty(options, PropModelSizesBytes, value.ModelSizesBytes, null, null); + writer.WriteProperty(options, PropTimeMs, value.TimeMs, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceDeployments.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceDeployments.g.cs index 5ed3ef1929c..5a90bf95c02 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceDeployments.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceDeployments.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class MlInferenceDeploymentsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropInferenceCounts = System.Text.Json.JsonEncodedText.Encode("inference_counts"); - private static readonly System.Text.Json.JsonEncodedText PropModelSizesBytes = System.Text.Json.JsonEncodedText.Encode("model_sizes_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropTimeMs = System.Text.Json.JsonEncodedText.Encode("time_ms"); - - public override Elastic.Clients.Elasticsearch.Xpack.MlInferenceDeployments Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propInferenceCounts = default; - LocalJsonValue propModelSizesBytes = default; - LocalJsonValue propTimeMs = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propInferenceCounts.TryReadProperty(ref reader, options, PropInferenceCounts, null)) - { - continue; - } - - if (propModelSizesBytes.TryReadProperty(ref reader, options, PropModelSizesBytes, null)) - { - continue; - } - - if (propTimeMs.TryReadProperty(ref reader, options, PropTimeMs, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.MlInferenceDeployments(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - InferenceCounts = propInferenceCounts.Value, - ModelSizesBytes = propModelSizesBytes.Value, - TimeMs = propTimeMs.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MlInferenceDeployments value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropInferenceCounts, value.InferenceCounts, null, null); - writer.WriteProperty(options, PropModelSizesBytes, value.ModelSizesBytes, null, null); - writer.WriteProperty(options, PropTimeMs, value.TimeMs, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.MlInferenceDeploymentsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.MlInferenceDeploymentsConverter))] public sealed partial class MlInferenceDeployments { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceDeploymentsTimeMs.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceDeploymentsTimeMs.Converters.g.cs new file mode 100644 index 00000000000..1965b40d6d9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceDeploymentsTimeMs.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class MlInferenceDeploymentsTimeMsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvg = System.Text.Json.JsonEncodedText.Encode("avg"); + + public override Elastic.Clients.Elasticsearch.Xpack.MlInferenceDeploymentsTimeMs Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvg = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvg.TryReadProperty(ref reader, options, PropAvg, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.MlInferenceDeploymentsTimeMs(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Avg = propAvg.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MlInferenceDeploymentsTimeMs value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvg, value.Avg, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceDeploymentsTimeMs.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceDeploymentsTimeMs.g.cs index 5437e05e256..b673a9c23f1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceDeploymentsTimeMs.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceDeploymentsTimeMs.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class MlInferenceDeploymentsTimeMsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvg = System.Text.Json.JsonEncodedText.Encode("avg"); - - public override Elastic.Clients.Elasticsearch.Xpack.MlInferenceDeploymentsTimeMs Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvg = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvg.TryReadProperty(ref reader, options, PropAvg, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.MlInferenceDeploymentsTimeMs(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Avg = propAvg.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MlInferenceDeploymentsTimeMs value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvg, value.Avg, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.MlInferenceDeploymentsTimeMsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.MlInferenceDeploymentsTimeMsConverter))] public sealed partial class MlInferenceDeploymentsTimeMs { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceIngestProcessor.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceIngestProcessor.Converters.g.cs new file mode 100644 index 00000000000..ea3d1ba991e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceIngestProcessor.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class MlInferenceIngestProcessorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNumDocsProcessed = System.Text.Json.JsonEncodedText.Encode("num_docs_processed"); + private static readonly System.Text.Json.JsonEncodedText PropNumFailures = System.Text.Json.JsonEncodedText.Encode("num_failures"); + private static readonly System.Text.Json.JsonEncodedText PropPipelines = System.Text.Json.JsonEncodedText.Encode("pipelines"); + private static readonly System.Text.Json.JsonEncodedText PropTimeMs = System.Text.Json.JsonEncodedText.Encode("time_ms"); + + public override Elastic.Clients.Elasticsearch.Xpack.MlInferenceIngestProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propNumDocsProcessed = default; + LocalJsonValue propNumFailures = default; + LocalJsonValue propPipelines = default; + LocalJsonValue propTimeMs = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNumDocsProcessed.TryReadProperty(ref reader, options, PropNumDocsProcessed, null)) + { + continue; + } + + if (propNumFailures.TryReadProperty(ref reader, options, PropNumFailures, null)) + { + continue; + } + + if (propPipelines.TryReadProperty(ref reader, options, PropPipelines, null)) + { + continue; + } + + if (propTimeMs.TryReadProperty(ref reader, options, PropTimeMs, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.MlInferenceIngestProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + NumDocsProcessed = propNumDocsProcessed.Value, + NumFailures = propNumFailures.Value, + Pipelines = propPipelines.Value, + TimeMs = propTimeMs.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MlInferenceIngestProcessor value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNumDocsProcessed, value.NumDocsProcessed, null, null); + writer.WriteProperty(options, PropNumFailures, value.NumFailures, null, null); + writer.WriteProperty(options, PropPipelines, value.Pipelines, null, null); + writer.WriteProperty(options, PropTimeMs, value.TimeMs, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceIngestProcessor.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceIngestProcessor.g.cs index 58f43b78332..bf716225ce4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceIngestProcessor.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceIngestProcessor.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class MlInferenceIngestProcessorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropNumDocsProcessed = System.Text.Json.JsonEncodedText.Encode("num_docs_processed"); - private static readonly System.Text.Json.JsonEncodedText PropNumFailures = System.Text.Json.JsonEncodedText.Encode("num_failures"); - private static readonly System.Text.Json.JsonEncodedText PropPipelines = System.Text.Json.JsonEncodedText.Encode("pipelines"); - private static readonly System.Text.Json.JsonEncodedText PropTimeMs = System.Text.Json.JsonEncodedText.Encode("time_ms"); - - public override Elastic.Clients.Elasticsearch.Xpack.MlInferenceIngestProcessor Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propNumDocsProcessed = default; - LocalJsonValue propNumFailures = default; - LocalJsonValue propPipelines = default; - LocalJsonValue propTimeMs = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propNumDocsProcessed.TryReadProperty(ref reader, options, PropNumDocsProcessed, null)) - { - continue; - } - - if (propNumFailures.TryReadProperty(ref reader, options, PropNumFailures, null)) - { - continue; - } - - if (propPipelines.TryReadProperty(ref reader, options, PropPipelines, null)) - { - continue; - } - - if (propTimeMs.TryReadProperty(ref reader, options, PropTimeMs, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.MlInferenceIngestProcessor(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - NumDocsProcessed = propNumDocsProcessed.Value, - NumFailures = propNumFailures.Value, - Pipelines = propPipelines.Value, - TimeMs = propTimeMs.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MlInferenceIngestProcessor value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropNumDocsProcessed, value.NumDocsProcessed, null, null); - writer.WriteProperty(options, PropNumFailures, value.NumFailures, null, null); - writer.WriteProperty(options, PropPipelines, value.Pipelines, null, null); - writer.WriteProperty(options, PropTimeMs, value.TimeMs, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.MlInferenceIngestProcessorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.MlInferenceIngestProcessorConverter))] public sealed partial class MlInferenceIngestProcessor { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceIngestProcessorCount.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceIngestProcessorCount.Converters.g.cs new file mode 100644 index 00000000000..3df7f28455b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceIngestProcessorCount.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class MlInferenceIngestProcessorCountConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); + private static readonly System.Text.Json.JsonEncodedText PropSum = System.Text.Json.JsonEncodedText.Encode("sum"); + + public override Elastic.Clients.Elasticsearch.Xpack.MlInferenceIngestProcessorCount Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propMax = default; + LocalJsonValue propMin = default; + LocalJsonValue propSum = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propMax.TryReadProperty(ref reader, options, PropMax, null)) + { + continue; + } + + if (propMin.TryReadProperty(ref reader, options, PropMin, null)) + { + continue; + } + + if (propSum.TryReadProperty(ref reader, options, PropSum, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.MlInferenceIngestProcessorCount(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Max = propMax.Value, + Min = propMin.Value, + Sum = propSum.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MlInferenceIngestProcessorCount value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropMax, value.Max, null, null); + writer.WriteProperty(options, PropMin, value.Min, null, null); + writer.WriteProperty(options, PropSum, value.Sum, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceIngestProcessorCount.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceIngestProcessorCount.g.cs index dd86b3e7290..f0f2efa99bb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceIngestProcessorCount.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceIngestProcessorCount.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class MlInferenceIngestProcessorCountConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); - private static readonly System.Text.Json.JsonEncodedText PropMin = System.Text.Json.JsonEncodedText.Encode("min"); - private static readonly System.Text.Json.JsonEncodedText PropSum = System.Text.Json.JsonEncodedText.Encode("sum"); - - public override Elastic.Clients.Elasticsearch.Xpack.MlInferenceIngestProcessorCount Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMax = default; - LocalJsonValue propMin = default; - LocalJsonValue propSum = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propMax.TryReadProperty(ref reader, options, PropMax, null)) - { - continue; - } - - if (propMin.TryReadProperty(ref reader, options, PropMin, null)) - { - continue; - } - - if (propSum.TryReadProperty(ref reader, options, PropSum, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.MlInferenceIngestProcessorCount(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Max = propMax.Value, - Min = propMin.Value, - Sum = propSum.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MlInferenceIngestProcessorCount value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropMax, value.Max, null, null); - writer.WriteProperty(options, PropMin, value.Min, null, null); - writer.WriteProperty(options, PropSum, value.Sum, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.MlInferenceIngestProcessorCountConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.MlInferenceIngestProcessorCountConverter))] public sealed partial class MlInferenceIngestProcessorCount { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceTrainedModels.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceTrainedModels.Converters.g.cs new file mode 100644 index 00000000000..0df978f6533 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceTrainedModels.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class MlInferenceTrainedModelsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAll = System.Text.Json.JsonEncodedText.Encode("_all"); + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropEstimatedHeapMemoryUsageBytes = System.Text.Json.JsonEncodedText.Encode("estimated_heap_memory_usage_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropEstimatedOperations = System.Text.Json.JsonEncodedText.Encode("estimated_operations"); + private static readonly System.Text.Json.JsonEncodedText PropModelSizeBytes = System.Text.Json.JsonEncodedText.Encode("model_size_bytes"); + + public override Elastic.Clients.Elasticsearch.Xpack.MlInferenceTrainedModels Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAll = default; + LocalJsonValue propCount = default; + LocalJsonValue propEstimatedHeapMemoryUsageBytes = default; + LocalJsonValue propEstimatedOperations = default; + LocalJsonValue propModelSizeBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAll.TryReadProperty(ref reader, options, PropAll, null)) + { + continue; + } + + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propEstimatedHeapMemoryUsageBytes.TryReadProperty(ref reader, options, PropEstimatedHeapMemoryUsageBytes, null)) + { + continue; + } + + if (propEstimatedOperations.TryReadProperty(ref reader, options, PropEstimatedOperations, null)) + { + continue; + } + + if (propModelSizeBytes.TryReadProperty(ref reader, options, PropModelSizeBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.MlInferenceTrainedModels(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + All = propAll.Value, + Count = propCount.Value, + EstimatedHeapMemoryUsageBytes = propEstimatedHeapMemoryUsageBytes.Value, + EstimatedOperations = propEstimatedOperations.Value, + ModelSizeBytes = propModelSizeBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MlInferenceTrainedModels value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAll, value.All, null, null); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropEstimatedHeapMemoryUsageBytes, value.EstimatedHeapMemoryUsageBytes, null, null); + writer.WriteProperty(options, PropEstimatedOperations, value.EstimatedOperations, null, null); + writer.WriteProperty(options, PropModelSizeBytes, value.ModelSizeBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceTrainedModels.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceTrainedModels.g.cs index d1509eddde8..fd8ed152c87 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceTrainedModels.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceTrainedModels.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class MlInferenceTrainedModelsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAll = System.Text.Json.JsonEncodedText.Encode("_all"); - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropEstimatedHeapMemoryUsageBytes = System.Text.Json.JsonEncodedText.Encode("estimated_heap_memory_usage_bytes"); - private static readonly System.Text.Json.JsonEncodedText PropEstimatedOperations = System.Text.Json.JsonEncodedText.Encode("estimated_operations"); - private static readonly System.Text.Json.JsonEncodedText PropModelSizeBytes = System.Text.Json.JsonEncodedText.Encode("model_size_bytes"); - - public override Elastic.Clients.Elasticsearch.Xpack.MlInferenceTrainedModels Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAll = default; - LocalJsonValue propCount = default; - LocalJsonValue propEstimatedHeapMemoryUsageBytes = default; - LocalJsonValue propEstimatedOperations = default; - LocalJsonValue propModelSizeBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAll.TryReadProperty(ref reader, options, PropAll, null)) - { - continue; - } - - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propEstimatedHeapMemoryUsageBytes.TryReadProperty(ref reader, options, PropEstimatedHeapMemoryUsageBytes, null)) - { - continue; - } - - if (propEstimatedOperations.TryReadProperty(ref reader, options, PropEstimatedOperations, null)) - { - continue; - } - - if (propModelSizeBytes.TryReadProperty(ref reader, options, PropModelSizeBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.MlInferenceTrainedModels(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - All = propAll.Value, - Count = propCount.Value, - EstimatedHeapMemoryUsageBytes = propEstimatedHeapMemoryUsageBytes.Value, - EstimatedOperations = propEstimatedOperations.Value, - ModelSizeBytes = propModelSizeBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MlInferenceTrainedModels value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAll, value.All, null, null); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropEstimatedHeapMemoryUsageBytes, value.EstimatedHeapMemoryUsageBytes, null, null); - writer.WriteProperty(options, PropEstimatedOperations, value.EstimatedOperations, null, null); - writer.WriteProperty(options, PropModelSizeBytes, value.ModelSizeBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.MlInferenceTrainedModelsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.MlInferenceTrainedModelsConverter))] public sealed partial class MlInferenceTrainedModels { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceTrainedModelsCount.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceTrainedModelsCount.Converters.g.cs new file mode 100644 index 00000000000..dd06f1b00d3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceTrainedModelsCount.Converters.g.cs @@ -0,0 +1,126 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class MlInferenceTrainedModelsCountConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClassification = System.Text.Json.JsonEncodedText.Encode("classification"); + private static readonly System.Text.Json.JsonEncodedText PropNer = System.Text.Json.JsonEncodedText.Encode("ner"); + private static readonly System.Text.Json.JsonEncodedText PropOther = System.Text.Json.JsonEncodedText.Encode("other"); + private static readonly System.Text.Json.JsonEncodedText PropPassThrough = System.Text.Json.JsonEncodedText.Encode("pass_through"); + private static readonly System.Text.Json.JsonEncodedText PropPrepackaged = System.Text.Json.JsonEncodedText.Encode("prepackaged"); + private static readonly System.Text.Json.JsonEncodedText PropRegression = System.Text.Json.JsonEncodedText.Encode("regression"); + private static readonly System.Text.Json.JsonEncodedText PropTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Xpack.MlInferenceTrainedModelsCount Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClassification = default; + LocalJsonValue propNer = default; + LocalJsonValue propOther = default; + LocalJsonValue propPassThrough = default; + LocalJsonValue propPrepackaged = default; + LocalJsonValue propRegression = default; + LocalJsonValue propTextEmbedding = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClassification.TryReadProperty(ref reader, options, PropClassification, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propNer.TryReadProperty(ref reader, options, PropNer, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOther.TryReadProperty(ref reader, options, PropOther, null)) + { + continue; + } + + if (propPassThrough.TryReadProperty(ref reader, options, PropPassThrough, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPrepackaged.TryReadProperty(ref reader, options, PropPrepackaged, null)) + { + continue; + } + + if (propRegression.TryReadProperty(ref reader, options, PropRegression, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTextEmbedding.TryReadProperty(ref reader, options, PropTextEmbedding, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.MlInferenceTrainedModelsCount(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Classification = propClassification.Value, + Ner = propNer.Value, + Other = propOther.Value, + PassThrough = propPassThrough.Value, + Prepackaged = propPrepackaged.Value, + Regression = propRegression.Value, + TextEmbedding = propTextEmbedding.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MlInferenceTrainedModelsCount value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClassification, value.Classification, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropNer, value.Ner, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOther, value.Other, null, null); + writer.WriteProperty(options, PropPassThrough, value.PassThrough, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPrepackaged, value.Prepackaged, null, null); + writer.WriteProperty(options, PropRegression, value.Regression, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTextEmbedding, value.TextEmbedding, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceTrainedModelsCount.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceTrainedModelsCount.g.cs index df1d5468283..5cfe856b667 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceTrainedModelsCount.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlInferenceTrainedModelsCount.g.cs @@ -23,109 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class MlInferenceTrainedModelsCountConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropClassification = System.Text.Json.JsonEncodedText.Encode("classification"); - private static readonly System.Text.Json.JsonEncodedText PropNer = System.Text.Json.JsonEncodedText.Encode("ner"); - private static readonly System.Text.Json.JsonEncodedText PropOther = System.Text.Json.JsonEncodedText.Encode("other"); - private static readonly System.Text.Json.JsonEncodedText PropPassThrough = System.Text.Json.JsonEncodedText.Encode("pass_through"); - private static readonly System.Text.Json.JsonEncodedText PropPrepackaged = System.Text.Json.JsonEncodedText.Encode("prepackaged"); - private static readonly System.Text.Json.JsonEncodedText PropRegression = System.Text.Json.JsonEncodedText.Encode("regression"); - private static readonly System.Text.Json.JsonEncodedText PropTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Xpack.MlInferenceTrainedModelsCount Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propClassification = default; - LocalJsonValue propNer = default; - LocalJsonValue propOther = default; - LocalJsonValue propPassThrough = default; - LocalJsonValue propPrepackaged = default; - LocalJsonValue propRegression = default; - LocalJsonValue propTextEmbedding = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propClassification.TryReadProperty(ref reader, options, PropClassification, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propNer.TryReadProperty(ref reader, options, PropNer, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propOther.TryReadProperty(ref reader, options, PropOther, null)) - { - continue; - } - - if (propPassThrough.TryReadProperty(ref reader, options, PropPassThrough, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPrepackaged.TryReadProperty(ref reader, options, PropPrepackaged, null)) - { - continue; - } - - if (propRegression.TryReadProperty(ref reader, options, PropRegression, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTextEmbedding.TryReadProperty(ref reader, options, PropTextEmbedding, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.MlInferenceTrainedModelsCount(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Classification = propClassification.Value, - Ner = propNer.Value, - Other = propOther.Value, - PassThrough = propPassThrough.Value, - Prepackaged = propPrepackaged.Value, - Regression = propRegression.Value, - TextEmbedding = propTextEmbedding.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MlInferenceTrainedModelsCount value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropClassification, value.Classification, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropNer, value.Ner, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropOther, value.Other, null, null); - writer.WriteProperty(options, PropPassThrough, value.PassThrough, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPrepackaged, value.Prepackaged, null, null); - writer.WriteProperty(options, PropRegression, value.Regression, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTextEmbedding, value.TextEmbedding, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.MlInferenceTrainedModelsCountConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.MlInferenceTrainedModelsCountConverter))] public sealed partial class MlInferenceTrainedModelsCount { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlJobForecasts.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlJobForecasts.Converters.g.cs new file mode 100644 index 00000000000..0971c6b7c3b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlJobForecasts.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class MlJobForecastsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropForecastedJobs = System.Text.Json.JsonEncodedText.Encode("forecasted_jobs"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Xpack.MlJobForecasts Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propForecastedJobs = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propForecastedJobs.TryReadProperty(ref reader, options, PropForecastedJobs, null)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.MlJobForecasts(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ForecastedJobs = propForecastedJobs.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MlJobForecasts value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropForecastedJobs, value.ForecastedJobs, null, null); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlJobForecasts.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlJobForecasts.g.cs index a1e7e550f1c..be2581fc9bf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlJobForecasts.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/MlJobForecasts.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class MlJobForecastsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropForecastedJobs = System.Text.Json.JsonEncodedText.Encode("forecasted_jobs"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Xpack.MlJobForecasts Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propForecastedJobs = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propForecastedJobs.TryReadProperty(ref reader, options, PropForecastedJobs, null)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.MlJobForecasts(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - ForecastedJobs = propForecastedJobs.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.MlJobForecasts value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropForecastedJobs, value.ForecastedJobs, null, null); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.MlJobForecastsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.MlJobForecastsConverter))] public sealed partial class MlJobForecasts { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Monitoring.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Monitoring.Converters.g.cs new file mode 100644 index 00000000000..063cd141c20 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Monitoring.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class MonitoringConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); + private static readonly System.Text.Json.JsonEncodedText PropCollectionEnabled = System.Text.Json.JsonEncodedText.Encode("collection_enabled"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropEnabledExporters = System.Text.Json.JsonEncodedText.Encode("enabled_exporters"); + + public override Elastic.Clients.Elasticsearch.Xpack.Monitoring Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvailable = default; + LocalJsonValue propCollectionEnabled = default; + LocalJsonValue propEnabled = default; + LocalJsonValue> propEnabledExporters = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) + { + continue; + } + + if (propCollectionEnabled.TryReadProperty(ref reader, options, PropCollectionEnabled, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propEnabledExporters.TryReadProperty(ref reader, options, PropEnabledExporters, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.Monitoring(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Available = propAvailable.Value, + CollectionEnabled = propCollectionEnabled.Value, + Enabled = propEnabled.Value, + EnabledExporters = propEnabledExporters.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Monitoring value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvailable, value.Available, null, null); + writer.WriteProperty(options, PropCollectionEnabled, value.CollectionEnabled, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropEnabledExporters, value.EnabledExporters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Monitoring.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Monitoring.g.cs index 9e945064d25..f37573290a8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Monitoring.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Monitoring.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class MonitoringConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); - private static readonly System.Text.Json.JsonEncodedText PropCollectionEnabled = System.Text.Json.JsonEncodedText.Encode("collection_enabled"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropEnabledExporters = System.Text.Json.JsonEncodedText.Encode("enabled_exporters"); - - public override Elastic.Clients.Elasticsearch.Xpack.Monitoring Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvailable = default; - LocalJsonValue propCollectionEnabled = default; - LocalJsonValue propEnabled = default; - LocalJsonValue> propEnabledExporters = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) - { - continue; - } - - if (propCollectionEnabled.TryReadProperty(ref reader, options, PropCollectionEnabled, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propEnabledExporters.TryReadProperty(ref reader, options, PropEnabledExporters, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.Monitoring(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Available = propAvailable.Value, - CollectionEnabled = propCollectionEnabled.Value, - Enabled = propEnabled.Value, - EnabledExporters = propEnabledExporters.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Monitoring value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvailable, value.Available, null, null); - writer.WriteProperty(options, PropCollectionEnabled, value.CollectionEnabled, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropEnabledExporters, value.EnabledExporters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.MonitoringConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.MonitoringConverter))] public sealed partial class Monitoring { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/NativeCodeInformation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/NativeCodeInformation.Converters.g.cs new file mode 100644 index 00000000000..6931ea38148 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/NativeCodeInformation.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class NativeCodeInformationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBuildHash = System.Text.Json.JsonEncodedText.Encode("build_hash"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Xpack.NativeCodeInformation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBuildHash = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBuildHash.TryReadProperty(ref reader, options, PropBuildHash, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.NativeCodeInformation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BuildHash = propBuildHash.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.NativeCodeInformation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBuildHash, value.BuildHash, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/NativeCodeInformation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/NativeCodeInformation.g.cs index 2d9fdd2568c..27f9273b517 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/NativeCodeInformation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/NativeCodeInformation.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class NativeCodeInformationConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBuildHash = System.Text.Json.JsonEncodedText.Encode("build_hash"); - private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); - - public override Elastic.Clients.Elasticsearch.Xpack.NativeCodeInformation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBuildHash = default; - LocalJsonValue propVersion = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBuildHash.TryReadProperty(ref reader, options, PropBuildHash, null)) - { - continue; - } - - if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.NativeCodeInformation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BuildHash = propBuildHash.Value, - Version = propVersion.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.NativeCodeInformation value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBuildHash, value.BuildHash, null, null); - writer.WriteProperty(options, PropVersion, value.Version, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.NativeCodeInformationConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.NativeCodeInformationConverter))] public sealed partial class NativeCodeInformation { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Phase.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Phase.Converters.g.cs new file mode 100644 index 00000000000..af29ee44a4c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Phase.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class PhaseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropActions = System.Text.Json.JsonEncodedText.Encode("actions"); + private static readonly System.Text.Json.JsonEncodedText PropMinAge = System.Text.Json.JsonEncodedText.Encode("min_age"); + + public override Elastic.Clients.Elasticsearch.Xpack.Phase Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propActions = default; + LocalJsonValue propMinAge = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propActions.TryReadProperty(ref reader, options, PropActions, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propMinAge.TryReadProperty(ref reader, options, PropMinAge, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.Phase(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Actions = propActions.Value, + MinAge = propMinAge.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Phase value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropActions, value.Actions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMinAge, value.MinAge, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Phase.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Phase.g.cs index d34bf5c1b5b..71d68375729 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Phase.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Phase.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class PhaseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropActions = System.Text.Json.JsonEncodedText.Encode("actions"); - private static readonly System.Text.Json.JsonEncodedText PropMinAge = System.Text.Json.JsonEncodedText.Encode("min_age"); - - public override Elastic.Clients.Elasticsearch.Xpack.Phase Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propActions = default; - LocalJsonValue propMinAge = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propActions.TryReadProperty(ref reader, options, PropActions, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propMinAge.TryReadProperty(ref reader, options, PropMinAge, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.Phase(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Actions = propActions.Value, - MinAge = propMinAge.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Phase value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropActions, value.Actions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropMinAge, value.MinAge, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.PhaseConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.PhaseConverter))] public sealed partial class Phase { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Phases.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Phases.Converters.g.cs new file mode 100644 index 00000000000..c271e620d05 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Phases.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class PhasesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCold = System.Text.Json.JsonEncodedText.Encode("cold"); + private static readonly System.Text.Json.JsonEncodedText PropDelete = System.Text.Json.JsonEncodedText.Encode("delete"); + private static readonly System.Text.Json.JsonEncodedText PropFrozen = System.Text.Json.JsonEncodedText.Encode("frozen"); + private static readonly System.Text.Json.JsonEncodedText PropHot = System.Text.Json.JsonEncodedText.Encode("hot"); + private static readonly System.Text.Json.JsonEncodedText PropWarm = System.Text.Json.JsonEncodedText.Encode("warm"); + + public override Elastic.Clients.Elasticsearch.Xpack.Phases Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCold = default; + LocalJsonValue propDelete = default; + LocalJsonValue propFrozen = default; + LocalJsonValue propHot = default; + LocalJsonValue propWarm = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCold.TryReadProperty(ref reader, options, PropCold, null)) + { + continue; + } + + if (propDelete.TryReadProperty(ref reader, options, PropDelete, null)) + { + continue; + } + + if (propFrozen.TryReadProperty(ref reader, options, PropFrozen, null)) + { + continue; + } + + if (propHot.TryReadProperty(ref reader, options, PropHot, null)) + { + continue; + } + + if (propWarm.TryReadProperty(ref reader, options, PropWarm, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.Phases(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Cold = propCold.Value, + Delete = propDelete.Value, + Frozen = propFrozen.Value, + Hot = propHot.Value, + Warm = propWarm.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Phases value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCold, value.Cold, null, null); + writer.WriteProperty(options, PropDelete, value.Delete, null, null); + writer.WriteProperty(options, PropFrozen, value.Frozen, null, null); + writer.WriteProperty(options, PropHot, value.Hot, null, null); + writer.WriteProperty(options, PropWarm, value.Warm, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Phases.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Phases.g.cs index a48eaf00486..2553e24ed8b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Phases.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Phases.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class PhasesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCold = System.Text.Json.JsonEncodedText.Encode("cold"); - private static readonly System.Text.Json.JsonEncodedText PropDelete = System.Text.Json.JsonEncodedText.Encode("delete"); - private static readonly System.Text.Json.JsonEncodedText PropFrozen = System.Text.Json.JsonEncodedText.Encode("frozen"); - private static readonly System.Text.Json.JsonEncodedText PropHot = System.Text.Json.JsonEncodedText.Encode("hot"); - private static readonly System.Text.Json.JsonEncodedText PropWarm = System.Text.Json.JsonEncodedText.Encode("warm"); - - public override Elastic.Clients.Elasticsearch.Xpack.Phases Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCold = default; - LocalJsonValue propDelete = default; - LocalJsonValue propFrozen = default; - LocalJsonValue propHot = default; - LocalJsonValue propWarm = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCold.TryReadProperty(ref reader, options, PropCold, null)) - { - continue; - } - - if (propDelete.TryReadProperty(ref reader, options, PropDelete, null)) - { - continue; - } - - if (propFrozen.TryReadProperty(ref reader, options, PropFrozen, null)) - { - continue; - } - - if (propHot.TryReadProperty(ref reader, options, PropHot, null)) - { - continue; - } - - if (propWarm.TryReadProperty(ref reader, options, PropWarm, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.Phases(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Cold = propCold.Value, - Delete = propDelete.Value, - Frozen = propFrozen.Value, - Hot = propHot.Value, - Warm = propWarm.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Phases value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCold, value.Cold, null, null); - writer.WriteProperty(options, PropDelete, value.Delete, null, null); - writer.WriteProperty(options, PropFrozen, value.Frozen, null, null); - writer.WriteProperty(options, PropHot, value.Hot, null, null); - writer.WriteProperty(options, PropWarm, value.Warm, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.PhasesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.PhasesConverter))] public sealed partial class Phases { #if NET7_0_OR_GREATER diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Realm.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Realm.Converters.g.cs new file mode 100644 index 00000000000..c7f74008c36 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Realm.Converters.g.cs @@ -0,0 +1,144 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class RealmConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); + private static readonly System.Text.Json.JsonEncodedText PropCache = System.Text.Json.JsonEncodedText.Encode("cache"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropHasAuthorizationRealms = System.Text.Json.JsonEncodedText.Encode("has_authorization_realms"); + private static readonly System.Text.Json.JsonEncodedText PropHasDefaultUsernamePattern = System.Text.Json.JsonEncodedText.Encode("has_default_username_pattern"); + private static readonly System.Text.Json.JsonEncodedText PropHasTruststore = System.Text.Json.JsonEncodedText.Encode("has_truststore"); + private static readonly System.Text.Json.JsonEncodedText PropIsAuthenticationDelegated = System.Text.Json.JsonEncodedText.Encode("is_authentication_delegated"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + + public override Elastic.Clients.Elasticsearch.Xpack.Realm Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvailable = default; + LocalJsonValue?> propCache = default; + LocalJsonValue propEnabled = default; + LocalJsonValue?> propHasAuthorizationRealms = default; + LocalJsonValue?> propHasDefaultUsernamePattern = default; + LocalJsonValue?> propHasTruststore = default; + LocalJsonValue?> propIsAuthenticationDelegated = default; + LocalJsonValue?> propName = default; + LocalJsonValue?> propOrder = default; + LocalJsonValue?> propSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) + { + continue; + } + + if (propCache.TryReadProperty(ref reader, options, PropCache, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propHasAuthorizationRealms.TryReadProperty(ref reader, options, PropHasAuthorizationRealms, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propHasDefaultUsernamePattern.TryReadProperty(ref reader, options, PropHasDefaultUsernamePattern, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propHasTruststore.TryReadProperty(ref reader, options, PropHasTruststore, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propIsAuthenticationDelegated.TryReadProperty(ref reader, options, PropIsAuthenticationDelegated, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propOrder.TryReadProperty(ref reader, options, PropOrder, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.Realm(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Available = propAvailable.Value, + Cache = propCache.Value, + Enabled = propEnabled.Value, + HasAuthorizationRealms = propHasAuthorizationRealms.Value, + HasDefaultUsernamePattern = propHasDefaultUsernamePattern.Value, + HasTruststore = propHasTruststore.Value, + IsAuthenticationDelegated = propIsAuthenticationDelegated.Value, + Name = propName.Value, + Order = propOrder.Value, + Size = propSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Realm value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvailable, value.Available, null, null); + writer.WriteProperty(options, PropCache, value.Cache, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropHasAuthorizationRealms, value.HasAuthorizationRealms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropHasDefaultUsernamePattern, value.HasDefaultUsernamePattern, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropHasTruststore, value.HasTruststore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIsAuthenticationDelegated, value.IsAuthenticationDelegated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropName, value.Name, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Realm.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Realm.g.cs index 7be84030ca5..10761361f44 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Realm.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Realm.g.cs @@ -23,127 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class RealmConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); - private static readonly System.Text.Json.JsonEncodedText PropCache = System.Text.Json.JsonEncodedText.Encode("cache"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropHasAuthorizationRealms = System.Text.Json.JsonEncodedText.Encode("has_authorization_realms"); - private static readonly System.Text.Json.JsonEncodedText PropHasDefaultUsernamePattern = System.Text.Json.JsonEncodedText.Encode("has_default_username_pattern"); - private static readonly System.Text.Json.JsonEncodedText PropHasTruststore = System.Text.Json.JsonEncodedText.Encode("has_truststore"); - private static readonly System.Text.Json.JsonEncodedText PropIsAuthenticationDelegated = System.Text.Json.JsonEncodedText.Encode("is_authentication_delegated"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropOrder = System.Text.Json.JsonEncodedText.Encode("order"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - - public override Elastic.Clients.Elasticsearch.Xpack.Realm Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvailable = default; - LocalJsonValue?> propCache = default; - LocalJsonValue propEnabled = default; - LocalJsonValue?> propHasAuthorizationRealms = default; - LocalJsonValue?> propHasDefaultUsernamePattern = default; - LocalJsonValue?> propHasTruststore = default; - LocalJsonValue?> propIsAuthenticationDelegated = default; - LocalJsonValue?> propName = default; - LocalJsonValue?> propOrder = default; - LocalJsonValue?> propSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) - { - continue; - } - - if (propCache.TryReadProperty(ref reader, options, PropCache, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propHasAuthorizationRealms.TryReadProperty(ref reader, options, PropHasAuthorizationRealms, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propHasDefaultUsernamePattern.TryReadProperty(ref reader, options, PropHasDefaultUsernamePattern, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propHasTruststore.TryReadProperty(ref reader, options, PropHasTruststore, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propIsAuthenticationDelegated.TryReadProperty(ref reader, options, PropIsAuthenticationDelegated, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propOrder.TryReadProperty(ref reader, options, PropOrder, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.Realm(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Available = propAvailable.Value, - Cache = propCache.Value, - Enabled = propEnabled.Value, - HasAuthorizationRealms = propHasAuthorizationRealms.Value, - HasDefaultUsernamePattern = propHasDefaultUsernamePattern.Value, - HasTruststore = propHasTruststore.Value, - IsAuthenticationDelegated = propIsAuthenticationDelegated.Value, - Name = propName.Value, - Order = propOrder.Value, - Size = propSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Realm value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvailable, value.Available, null, null); - writer.WriteProperty(options, PropCache, value.Cache, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropHasAuthorizationRealms, value.HasAuthorizationRealms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropHasDefaultUsernamePattern, value.HasDefaultUsernamePattern, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropHasTruststore, value.HasTruststore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropIsAuthenticationDelegated, value.IsAuthenticationDelegated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropName, value.Name, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropOrder, value.Order, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.RealmConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.RealmConverter))] public sealed partial class Realm { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RealmCache.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RealmCache.Converters.g.cs new file mode 100644 index 00000000000..75a847b7598 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RealmCache.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class RealmCacheConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + + public override Elastic.Clients.Elasticsearch.Xpack.RealmCache Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSize.TryReadProperty(ref reader, options, PropSize, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.RealmCache(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Size = propSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.RealmCache value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSize, value.Size, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RealmCache.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RealmCache.g.cs index a8b36d6ae08..89f0948df05 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RealmCache.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RealmCache.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class RealmCacheConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - - public override Elastic.Clients.Elasticsearch.Xpack.RealmCache Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propSize.TryReadProperty(ref reader, options, PropSize, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.RealmCache(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Size = propSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.RealmCache value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropSize, value.Size, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.RealmCacheConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.RealmCacheConverter))] public sealed partial class RealmCache { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RoleMapping.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RoleMapping.Converters.g.cs new file mode 100644 index 00000000000..945415455e4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RoleMapping.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class RoleMappingConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + + public override Elastic.Clients.Elasticsearch.Xpack.RoleMapping Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEnabled = default; + LocalJsonValue propSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.RoleMapping(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Enabled = propEnabled.Value, + Size = propSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.RoleMapping value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropSize, value.Size, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RoleMapping.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RoleMapping.g.cs index c17052b22d2..e13e6f498fb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RoleMapping.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RoleMapping.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class RoleMappingConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - - public override Elastic.Clients.Elasticsearch.Xpack.RoleMapping Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propEnabled = default; - LocalJsonValue propSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.RoleMapping(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Enabled = propEnabled.Value, - Size = propSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.RoleMapping value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropSize, value.Size, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.RoleMappingConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.RoleMappingConverter))] public sealed partial class RoleMapping { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RuntimeFieldTypes.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RuntimeFieldTypes.Converters.g.cs new file mode 100644 index 00000000000..7bc805fc98b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RuntimeFieldTypes.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class RuntimeFieldTypesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropFieldTypes = System.Text.Json.JsonEncodedText.Encode("field_types"); + + public override Elastic.Clients.Elasticsearch.Xpack.RuntimeFieldTypes Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvailable = default; + LocalJsonValue propEnabled = default; + LocalJsonValue> propFieldTypes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propFieldTypes.TryReadProperty(ref reader, options, PropFieldTypes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.RuntimeFieldTypes(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Available = propAvailable.Value, + Enabled = propEnabled.Value, + FieldTypes = propFieldTypes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.RuntimeFieldTypes value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvailable, value.Available, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropFieldTypes, value.FieldTypes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RuntimeFieldTypes.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RuntimeFieldTypes.g.cs index ed5a977345a..98b3c18f373 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RuntimeFieldTypes.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RuntimeFieldTypes.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class RuntimeFieldTypesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropFieldTypes = System.Text.Json.JsonEncodedText.Encode("field_types"); - - public override Elastic.Clients.Elasticsearch.Xpack.RuntimeFieldTypes Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvailable = default; - LocalJsonValue propEnabled = default; - LocalJsonValue> propFieldTypes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propFieldTypes.TryReadProperty(ref reader, options, PropFieldTypes, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.RuntimeFieldTypes(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Available = propAvailable.Value, - Enabled = propEnabled.Value, - FieldTypes = propFieldTypes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.RuntimeFieldTypes value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvailable, value.Available, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropFieldTypes, value.FieldTypes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.RuntimeFieldTypesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.RuntimeFieldTypesConverter))] public sealed partial class RuntimeFieldTypes { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RuntimeFieldsType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RuntimeFieldsType.Converters.g.cs new file mode 100644 index 00000000000..5c02edf231c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RuntimeFieldsType.Converters.g.cs @@ -0,0 +1,180 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class RuntimeFieldsTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCharsMax = System.Text.Json.JsonEncodedText.Encode("chars_max"); + private static readonly System.Text.Json.JsonEncodedText PropCharsTotal = System.Text.Json.JsonEncodedText.Encode("chars_total"); + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropDocMax = System.Text.Json.JsonEncodedText.Encode("doc_max"); + private static readonly System.Text.Json.JsonEncodedText PropDocTotal = System.Text.Json.JsonEncodedText.Encode("doc_total"); + private static readonly System.Text.Json.JsonEncodedText PropIndexCount = System.Text.Json.JsonEncodedText.Encode("index_count"); + private static readonly System.Text.Json.JsonEncodedText PropLang = System.Text.Json.JsonEncodedText.Encode("lang"); + private static readonly System.Text.Json.JsonEncodedText PropLinesMax = System.Text.Json.JsonEncodedText.Encode("lines_max"); + private static readonly System.Text.Json.JsonEncodedText PropLinesTotal = System.Text.Json.JsonEncodedText.Encode("lines_total"); + private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); + private static readonly System.Text.Json.JsonEncodedText PropScriptlessCount = System.Text.Json.JsonEncodedText.Encode("scriptless_count"); + private static readonly System.Text.Json.JsonEncodedText PropShadowedCount = System.Text.Json.JsonEncodedText.Encode("shadowed_count"); + private static readonly System.Text.Json.JsonEncodedText PropSourceMax = System.Text.Json.JsonEncodedText.Encode("source_max"); + private static readonly System.Text.Json.JsonEncodedText PropSourceTotal = System.Text.Json.JsonEncodedText.Encode("source_total"); + + public override Elastic.Clients.Elasticsearch.Xpack.RuntimeFieldsType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCharsMax = default; + LocalJsonValue propCharsTotal = default; + LocalJsonValue propCount = default; + LocalJsonValue propDocMax = default; + LocalJsonValue propDocTotal = default; + LocalJsonValue propIndexCount = default; + LocalJsonValue> propLang = default; + LocalJsonValue propLinesMax = default; + LocalJsonValue propLinesTotal = default; + LocalJsonValue propName = default; + LocalJsonValue propScriptlessCount = default; + LocalJsonValue propShadowedCount = default; + LocalJsonValue propSourceMax = default; + LocalJsonValue propSourceTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCharsMax.TryReadProperty(ref reader, options, PropCharsMax, null)) + { + continue; + } + + if (propCharsTotal.TryReadProperty(ref reader, options, PropCharsTotal, null)) + { + continue; + } + + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propDocMax.TryReadProperty(ref reader, options, PropDocMax, null)) + { + continue; + } + + if (propDocTotal.TryReadProperty(ref reader, options, PropDocTotal, null)) + { + continue; + } + + if (propIndexCount.TryReadProperty(ref reader, options, PropIndexCount, null)) + { + continue; + } + + if (propLang.TryReadProperty(ref reader, options, PropLang, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propLinesMax.TryReadProperty(ref reader, options, PropLinesMax, null)) + { + continue; + } + + if (propLinesTotal.TryReadProperty(ref reader, options, PropLinesTotal, null)) + { + continue; + } + + if (propName.TryReadProperty(ref reader, options, PropName, null)) + { + continue; + } + + if (propScriptlessCount.TryReadProperty(ref reader, options, PropScriptlessCount, null)) + { + continue; + } + + if (propShadowedCount.TryReadProperty(ref reader, options, PropShadowedCount, null)) + { + continue; + } + + if (propSourceMax.TryReadProperty(ref reader, options, PropSourceMax, null)) + { + continue; + } + + if (propSourceTotal.TryReadProperty(ref reader, options, PropSourceTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.RuntimeFieldsType(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CharsMax = propCharsMax.Value, + CharsTotal = propCharsTotal.Value, + Count = propCount.Value, + DocMax = propDocMax.Value, + DocTotal = propDocTotal.Value, + IndexCount = propIndexCount.Value, + Lang = propLang.Value, + LinesMax = propLinesMax.Value, + LinesTotal = propLinesTotal.Value, + Name = propName.Value, + ScriptlessCount = propScriptlessCount.Value, + ShadowedCount = propShadowedCount.Value, + SourceMax = propSourceMax.Value, + SourceTotal = propSourceTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.RuntimeFieldsType value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCharsMax, value.CharsMax, null, null); + writer.WriteProperty(options, PropCharsTotal, value.CharsTotal, null, null); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropDocMax, value.DocMax, null, null); + writer.WriteProperty(options, PropDocTotal, value.DocTotal, null, null); + writer.WriteProperty(options, PropIndexCount, value.IndexCount, null, null); + writer.WriteProperty(options, PropLang, value.Lang, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropLinesMax, value.LinesMax, null, null); + writer.WriteProperty(options, PropLinesTotal, value.LinesTotal, null, null); + writer.WriteProperty(options, PropName, value.Name, null, null); + writer.WriteProperty(options, PropScriptlessCount, value.ScriptlessCount, null, null); + writer.WriteProperty(options, PropShadowedCount, value.ShadowedCount, null, null); + writer.WriteProperty(options, PropSourceMax, value.SourceMax, null, null); + writer.WriteProperty(options, PropSourceTotal, value.SourceTotal, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RuntimeFieldsType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RuntimeFieldsType.g.cs index f3228c2eddf..ccca14e462f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RuntimeFieldsType.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/RuntimeFieldsType.g.cs @@ -23,163 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class RuntimeFieldsTypeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCharsMax = System.Text.Json.JsonEncodedText.Encode("chars_max"); - private static readonly System.Text.Json.JsonEncodedText PropCharsTotal = System.Text.Json.JsonEncodedText.Encode("chars_total"); - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropDocMax = System.Text.Json.JsonEncodedText.Encode("doc_max"); - private static readonly System.Text.Json.JsonEncodedText PropDocTotal = System.Text.Json.JsonEncodedText.Encode("doc_total"); - private static readonly System.Text.Json.JsonEncodedText PropIndexCount = System.Text.Json.JsonEncodedText.Encode("index_count"); - private static readonly System.Text.Json.JsonEncodedText PropLang = System.Text.Json.JsonEncodedText.Encode("lang"); - private static readonly System.Text.Json.JsonEncodedText PropLinesMax = System.Text.Json.JsonEncodedText.Encode("lines_max"); - private static readonly System.Text.Json.JsonEncodedText PropLinesTotal = System.Text.Json.JsonEncodedText.Encode("lines_total"); - private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); - private static readonly System.Text.Json.JsonEncodedText PropScriptlessCount = System.Text.Json.JsonEncodedText.Encode("scriptless_count"); - private static readonly System.Text.Json.JsonEncodedText PropShadowedCount = System.Text.Json.JsonEncodedText.Encode("shadowed_count"); - private static readonly System.Text.Json.JsonEncodedText PropSourceMax = System.Text.Json.JsonEncodedText.Encode("source_max"); - private static readonly System.Text.Json.JsonEncodedText PropSourceTotal = System.Text.Json.JsonEncodedText.Encode("source_total"); - - public override Elastic.Clients.Elasticsearch.Xpack.RuntimeFieldsType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCharsMax = default; - LocalJsonValue propCharsTotal = default; - LocalJsonValue propCount = default; - LocalJsonValue propDocMax = default; - LocalJsonValue propDocTotal = default; - LocalJsonValue propIndexCount = default; - LocalJsonValue> propLang = default; - LocalJsonValue propLinesMax = default; - LocalJsonValue propLinesTotal = default; - LocalJsonValue propName = default; - LocalJsonValue propScriptlessCount = default; - LocalJsonValue propShadowedCount = default; - LocalJsonValue propSourceMax = default; - LocalJsonValue propSourceTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCharsMax.TryReadProperty(ref reader, options, PropCharsMax, null)) - { - continue; - } - - if (propCharsTotal.TryReadProperty(ref reader, options, PropCharsTotal, null)) - { - continue; - } - - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propDocMax.TryReadProperty(ref reader, options, PropDocMax, null)) - { - continue; - } - - if (propDocTotal.TryReadProperty(ref reader, options, PropDocTotal, null)) - { - continue; - } - - if (propIndexCount.TryReadProperty(ref reader, options, PropIndexCount, null)) - { - continue; - } - - if (propLang.TryReadProperty(ref reader, options, PropLang, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) - { - continue; - } - - if (propLinesMax.TryReadProperty(ref reader, options, PropLinesMax, null)) - { - continue; - } - - if (propLinesTotal.TryReadProperty(ref reader, options, PropLinesTotal, null)) - { - continue; - } - - if (propName.TryReadProperty(ref reader, options, PropName, null)) - { - continue; - } - - if (propScriptlessCount.TryReadProperty(ref reader, options, PropScriptlessCount, null)) - { - continue; - } - - if (propShadowedCount.TryReadProperty(ref reader, options, PropShadowedCount, null)) - { - continue; - } - - if (propSourceMax.TryReadProperty(ref reader, options, PropSourceMax, null)) - { - continue; - } - - if (propSourceTotal.TryReadProperty(ref reader, options, PropSourceTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.RuntimeFieldsType(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - CharsMax = propCharsMax.Value, - CharsTotal = propCharsTotal.Value, - Count = propCount.Value, - DocMax = propDocMax.Value, - DocTotal = propDocTotal.Value, - IndexCount = propIndexCount.Value, - Lang = propLang.Value, - LinesMax = propLinesMax.Value, - LinesTotal = propLinesTotal.Value, - Name = propName.Value, - ScriptlessCount = propScriptlessCount.Value, - ShadowedCount = propShadowedCount.Value, - SourceMax = propSourceMax.Value, - SourceTotal = propSourceTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.RuntimeFieldsType value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCharsMax, value.CharsMax, null, null); - writer.WriteProperty(options, PropCharsTotal, value.CharsTotal, null, null); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropDocMax, value.DocMax, null, null); - writer.WriteProperty(options, PropDocTotal, value.DocTotal, null, null); - writer.WriteProperty(options, PropIndexCount, value.IndexCount, null, null); - writer.WriteProperty(options, PropLang, value.Lang, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropLinesMax, value.LinesMax, null, null); - writer.WriteProperty(options, PropLinesTotal, value.LinesTotal, null, null); - writer.WriteProperty(options, PropName, value.Name, null, null); - writer.WriteProperty(options, PropScriptlessCount, value.ScriptlessCount, null, null); - writer.WriteProperty(options, PropShadowedCount, value.ShadowedCount, null, null); - writer.WriteProperty(options, PropSourceMax, value.SourceMax, null, null); - writer.WriteProperty(options, PropSourceTotal, value.SourceTotal, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.RuntimeFieldsTypeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.RuntimeFieldsTypeConverter))] public sealed partial class RuntimeFieldsType { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SearchableSnapshots.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SearchableSnapshots.Converters.g.cs new file mode 100644 index 00000000000..991cde46abb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SearchableSnapshots.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class SearchableSnapshotsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropFullCopyIndicesCount = System.Text.Json.JsonEncodedText.Encode("full_copy_indices_count"); + private static readonly System.Text.Json.JsonEncodedText PropIndicesCount = System.Text.Json.JsonEncodedText.Encode("indices_count"); + private static readonly System.Text.Json.JsonEncodedText PropSharedCacheIndicesCount = System.Text.Json.JsonEncodedText.Encode("shared_cache_indices_count"); + + public override Elastic.Clients.Elasticsearch.Xpack.SearchableSnapshots Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvailable = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propFullCopyIndicesCount = default; + LocalJsonValue propIndicesCount = default; + LocalJsonValue propSharedCacheIndicesCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propFullCopyIndicesCount.TryReadProperty(ref reader, options, PropFullCopyIndicesCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIndicesCount.TryReadProperty(ref reader, options, PropIndicesCount, null)) + { + continue; + } + + if (propSharedCacheIndicesCount.TryReadProperty(ref reader, options, PropSharedCacheIndicesCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.SearchableSnapshots(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Available = propAvailable.Value, + Enabled = propEnabled.Value, + FullCopyIndicesCount = propFullCopyIndicesCount.Value, + IndicesCount = propIndicesCount.Value, + SharedCacheIndicesCount = propSharedCacheIndicesCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.SearchableSnapshots value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvailable, value.Available, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropFullCopyIndicesCount, value.FullCopyIndicesCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIndicesCount, value.IndicesCount, null, null); + writer.WriteProperty(options, PropSharedCacheIndicesCount, value.SharedCacheIndicesCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SearchableSnapshots.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SearchableSnapshots.g.cs index 633eb8922aa..a6ffc93a712 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SearchableSnapshots.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SearchableSnapshots.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class SearchableSnapshotsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropFullCopyIndicesCount = System.Text.Json.JsonEncodedText.Encode("full_copy_indices_count"); - private static readonly System.Text.Json.JsonEncodedText PropIndicesCount = System.Text.Json.JsonEncodedText.Encode("indices_count"); - private static readonly System.Text.Json.JsonEncodedText PropSharedCacheIndicesCount = System.Text.Json.JsonEncodedText.Encode("shared_cache_indices_count"); - - public override Elastic.Clients.Elasticsearch.Xpack.SearchableSnapshots Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvailable = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propFullCopyIndicesCount = default; - LocalJsonValue propIndicesCount = default; - LocalJsonValue propSharedCacheIndicesCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propFullCopyIndicesCount.TryReadProperty(ref reader, options, PropFullCopyIndicesCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propIndicesCount.TryReadProperty(ref reader, options, PropIndicesCount, null)) - { - continue; - } - - if (propSharedCacheIndicesCount.TryReadProperty(ref reader, options, PropSharedCacheIndicesCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.SearchableSnapshots(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Available = propAvailable.Value, - Enabled = propEnabled.Value, - FullCopyIndicesCount = propFullCopyIndicesCount.Value, - IndicesCount = propIndicesCount.Value, - SharedCacheIndicesCount = propSharedCacheIndicesCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.SearchableSnapshots value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvailable, value.Available, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropFullCopyIndicesCount, value.FullCopyIndicesCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropIndicesCount, value.IndicesCount, null, null); - writer.WriteProperty(options, PropSharedCacheIndicesCount, value.SharedCacheIndicesCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.SearchableSnapshotsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.SearchableSnapshotsConverter))] public sealed partial class SearchableSnapshots { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Security.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Security.Converters.g.cs new file mode 100644 index 00000000000..12e1a56812b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Security.Converters.g.cs @@ -0,0 +1,180 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class SecurityConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAnonymous = System.Text.Json.JsonEncodedText.Encode("anonymous"); + private static readonly System.Text.Json.JsonEncodedText PropApiKeyService = System.Text.Json.JsonEncodedText.Encode("api_key_service"); + private static readonly System.Text.Json.JsonEncodedText PropAudit = System.Text.Json.JsonEncodedText.Encode("audit"); + private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropFips140 = System.Text.Json.JsonEncodedText.Encode("fips_140"); + private static readonly System.Text.Json.JsonEncodedText PropIpfilter = System.Text.Json.JsonEncodedText.Encode("ipfilter"); + private static readonly System.Text.Json.JsonEncodedText PropOperatorPrivileges = System.Text.Json.JsonEncodedText.Encode("operator_privileges"); + private static readonly System.Text.Json.JsonEncodedText PropRealms = System.Text.Json.JsonEncodedText.Encode("realms"); + private static readonly System.Text.Json.JsonEncodedText PropRoleMapping = System.Text.Json.JsonEncodedText.Encode("role_mapping"); + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + private static readonly System.Text.Json.JsonEncodedText PropSsl = System.Text.Json.JsonEncodedText.Encode("ssl"); + private static readonly System.Text.Json.JsonEncodedText PropSystemKey = System.Text.Json.JsonEncodedText.Encode("system_key"); + private static readonly System.Text.Json.JsonEncodedText PropTokenService = System.Text.Json.JsonEncodedText.Encode("token_service"); + + public override Elastic.Clients.Elasticsearch.Xpack.Security Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAnonymous = default; + LocalJsonValue propApiKeyService = default; + LocalJsonValue propAudit = default; + LocalJsonValue propAvailable = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propFips140 = default; + LocalJsonValue propIpfilter = default; + LocalJsonValue propOperatorPrivileges = default; + LocalJsonValue> propRealms = default; + LocalJsonValue> propRoleMapping = default; + LocalJsonValue propRoles = default; + LocalJsonValue propSsl = default; + LocalJsonValue propSystemKey = default; + LocalJsonValue propTokenService = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAnonymous.TryReadProperty(ref reader, options, PropAnonymous, null)) + { + continue; + } + + if (propApiKeyService.TryReadProperty(ref reader, options, PropApiKeyService, null)) + { + continue; + } + + if (propAudit.TryReadProperty(ref reader, options, PropAudit, null)) + { + continue; + } + + if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propFips140.TryReadProperty(ref reader, options, PropFips140, null)) + { + continue; + } + + if (propIpfilter.TryReadProperty(ref reader, options, PropIpfilter, null)) + { + continue; + } + + if (propOperatorPrivileges.TryReadProperty(ref reader, options, PropOperatorPrivileges, null)) + { + continue; + } + + if (propRealms.TryReadProperty(ref reader, options, PropRealms, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propRoleMapping.TryReadProperty(ref reader, options, PropRoleMapping, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propRoles.TryReadProperty(ref reader, options, PropRoles, null)) + { + continue; + } + + if (propSsl.TryReadProperty(ref reader, options, PropSsl, null)) + { + continue; + } + + if (propSystemKey.TryReadProperty(ref reader, options, PropSystemKey, null)) + { + continue; + } + + if (propTokenService.TryReadProperty(ref reader, options, PropTokenService, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.Security(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Anonymous = propAnonymous.Value, + ApiKeyService = propApiKeyService.Value, + Audit = propAudit.Value, + Available = propAvailable.Value, + Enabled = propEnabled.Value, + Fips140 = propFips140.Value, + Ipfilter = propIpfilter.Value, + OperatorPrivileges = propOperatorPrivileges.Value, + Realms = propRealms.Value, + RoleMapping = propRoleMapping.Value, + Roles = propRoles.Value, + Ssl = propSsl.Value, + SystemKey = propSystemKey.Value, + TokenService = propTokenService.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Security value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAnonymous, value.Anonymous, null, null); + writer.WriteProperty(options, PropApiKeyService, value.ApiKeyService, null, null); + writer.WriteProperty(options, PropAudit, value.Audit, null, null); + writer.WriteProperty(options, PropAvailable, value.Available, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropFips140, value.Fips140, null, null); + writer.WriteProperty(options, PropIpfilter, value.Ipfilter, null, null); + writer.WriteProperty(options, PropOperatorPrivileges, value.OperatorPrivileges, null, null); + writer.WriteProperty(options, PropRealms, value.Realms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropRoleMapping, value.RoleMapping, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropRoles, value.Roles, null, null); + writer.WriteProperty(options, PropSsl, value.Ssl, null, null); + writer.WriteProperty(options, PropSystemKey, value.SystemKey, null, null); + writer.WriteProperty(options, PropTokenService, value.TokenService, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Security.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Security.g.cs index 6a4f04a390b..30507d89e9f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Security.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Security.g.cs @@ -23,163 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class SecurityConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAnonymous = System.Text.Json.JsonEncodedText.Encode("anonymous"); - private static readonly System.Text.Json.JsonEncodedText PropApiKeyService = System.Text.Json.JsonEncodedText.Encode("api_key_service"); - private static readonly System.Text.Json.JsonEncodedText PropAudit = System.Text.Json.JsonEncodedText.Encode("audit"); - private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropFips140 = System.Text.Json.JsonEncodedText.Encode("fips_140"); - private static readonly System.Text.Json.JsonEncodedText PropIpfilter = System.Text.Json.JsonEncodedText.Encode("ipfilter"); - private static readonly System.Text.Json.JsonEncodedText PropOperatorPrivileges = System.Text.Json.JsonEncodedText.Encode("operator_privileges"); - private static readonly System.Text.Json.JsonEncodedText PropRealms = System.Text.Json.JsonEncodedText.Encode("realms"); - private static readonly System.Text.Json.JsonEncodedText PropRoleMapping = System.Text.Json.JsonEncodedText.Encode("role_mapping"); - private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); - private static readonly System.Text.Json.JsonEncodedText PropSsl = System.Text.Json.JsonEncodedText.Encode("ssl"); - private static readonly System.Text.Json.JsonEncodedText PropSystemKey = System.Text.Json.JsonEncodedText.Encode("system_key"); - private static readonly System.Text.Json.JsonEncodedText PropTokenService = System.Text.Json.JsonEncodedText.Encode("token_service"); - - public override Elastic.Clients.Elasticsearch.Xpack.Security Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAnonymous = default; - LocalJsonValue propApiKeyService = default; - LocalJsonValue propAudit = default; - LocalJsonValue propAvailable = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propFips140 = default; - LocalJsonValue propIpfilter = default; - LocalJsonValue propOperatorPrivileges = default; - LocalJsonValue> propRealms = default; - LocalJsonValue> propRoleMapping = default; - LocalJsonValue propRoles = default; - LocalJsonValue propSsl = default; - LocalJsonValue propSystemKey = default; - LocalJsonValue propTokenService = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAnonymous.TryReadProperty(ref reader, options, PropAnonymous, null)) - { - continue; - } - - if (propApiKeyService.TryReadProperty(ref reader, options, PropApiKeyService, null)) - { - continue; - } - - if (propAudit.TryReadProperty(ref reader, options, PropAudit, null)) - { - continue; - } - - if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propFips140.TryReadProperty(ref reader, options, PropFips140, null)) - { - continue; - } - - if (propIpfilter.TryReadProperty(ref reader, options, PropIpfilter, null)) - { - continue; - } - - if (propOperatorPrivileges.TryReadProperty(ref reader, options, PropOperatorPrivileges, null)) - { - continue; - } - - if (propRealms.TryReadProperty(ref reader, options, PropRealms, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propRoleMapping.TryReadProperty(ref reader, options, PropRoleMapping, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propRoles.TryReadProperty(ref reader, options, PropRoles, null)) - { - continue; - } - - if (propSsl.TryReadProperty(ref reader, options, PropSsl, null)) - { - continue; - } - - if (propSystemKey.TryReadProperty(ref reader, options, PropSystemKey, null)) - { - continue; - } - - if (propTokenService.TryReadProperty(ref reader, options, PropTokenService, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.Security(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Anonymous = propAnonymous.Value, - ApiKeyService = propApiKeyService.Value, - Audit = propAudit.Value, - Available = propAvailable.Value, - Enabled = propEnabled.Value, - Fips140 = propFips140.Value, - Ipfilter = propIpfilter.Value, - OperatorPrivileges = propOperatorPrivileges.Value, - Realms = propRealms.Value, - RoleMapping = propRoleMapping.Value, - Roles = propRoles.Value, - Ssl = propSsl.Value, - SystemKey = propSystemKey.Value, - TokenService = propTokenService.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Security value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAnonymous, value.Anonymous, null, null); - writer.WriteProperty(options, PropApiKeyService, value.ApiKeyService, null, null); - writer.WriteProperty(options, PropAudit, value.Audit, null, null); - writer.WriteProperty(options, PropAvailable, value.Available, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropFips140, value.Fips140, null, null); - writer.WriteProperty(options, PropIpfilter, value.Ipfilter, null, null); - writer.WriteProperty(options, PropOperatorPrivileges, value.OperatorPrivileges, null, null); - writer.WriteProperty(options, PropRealms, value.Realms, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropRoleMapping, value.RoleMapping, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropRoles, value.Roles, null, null); - writer.WriteProperty(options, PropSsl, value.Ssl, null, null); - writer.WriteProperty(options, PropSystemKey, value.SystemKey, null, null); - writer.WriteProperty(options, PropTokenService, value.TokenService, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.SecurityConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.SecurityConverter))] public sealed partial class Security { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRoles.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRoles.Converters.g.cs new file mode 100644 index 00000000000..ef5faa99371 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRoles.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class SecurityRolesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDls = System.Text.Json.JsonEncodedText.Encode("dls"); + private static readonly System.Text.Json.JsonEncodedText PropFile = System.Text.Json.JsonEncodedText.Encode("file"); + private static readonly System.Text.Json.JsonEncodedText PropNative = System.Text.Json.JsonEncodedText.Encode("native"); + + public override Elastic.Clients.Elasticsearch.Xpack.SecurityRoles Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDls = default; + LocalJsonValue propFile = default; + LocalJsonValue propNative = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDls.TryReadProperty(ref reader, options, PropDls, null)) + { + continue; + } + + if (propFile.TryReadProperty(ref reader, options, PropFile, null)) + { + continue; + } + + if (propNative.TryReadProperty(ref reader, options, PropNative, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.SecurityRoles(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Dls = propDls.Value, + File = propFile.Value, + Native = propNative.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.SecurityRoles value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDls, value.Dls, null, null); + writer.WriteProperty(options, PropFile, value.File, null, null); + writer.WriteProperty(options, PropNative, value.Native, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRoles.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRoles.g.cs index 28551634a3f..31c4459eebb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRoles.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRoles.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class SecurityRolesConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDls = System.Text.Json.JsonEncodedText.Encode("dls"); - private static readonly System.Text.Json.JsonEncodedText PropFile = System.Text.Json.JsonEncodedText.Encode("file"); - private static readonly System.Text.Json.JsonEncodedText PropNative = System.Text.Json.JsonEncodedText.Encode("native"); - - public override Elastic.Clients.Elasticsearch.Xpack.SecurityRoles Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDls = default; - LocalJsonValue propFile = default; - LocalJsonValue propNative = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDls.TryReadProperty(ref reader, options, PropDls, null)) - { - continue; - } - - if (propFile.TryReadProperty(ref reader, options, PropFile, null)) - { - continue; - } - - if (propNative.TryReadProperty(ref reader, options, PropNative, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.SecurityRoles(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Dls = propDls.Value, - File = propFile.Value, - Native = propNative.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.SecurityRoles value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDls, value.Dls, null, null); - writer.WriteProperty(options, PropFile, value.File, null, null); - writer.WriteProperty(options, PropNative, value.Native, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.SecurityRolesConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.SecurityRolesConverter))] public sealed partial class SecurityRoles { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDls.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDls.Converters.g.cs new file mode 100644 index 00000000000..6c12616d18c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDls.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class SecurityRolesDlsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBitSetCache = System.Text.Json.JsonEncodedText.Encode("bit_set_cache"); + + public override Elastic.Clients.Elasticsearch.Xpack.SecurityRolesDls Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBitSetCache = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBitSetCache.TryReadProperty(ref reader, options, PropBitSetCache, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.SecurityRolesDls(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BitSetCache = propBitSetCache.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.SecurityRolesDls value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBitSetCache, value.BitSetCache, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDls.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDls.g.cs index ea791ac5f7d..bc9d6eff402 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDls.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDls.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class SecurityRolesDlsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropBitSetCache = System.Text.Json.JsonEncodedText.Encode("bit_set_cache"); - - public override Elastic.Clients.Elasticsearch.Xpack.SecurityRolesDls Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propBitSetCache = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propBitSetCache.TryReadProperty(ref reader, options, PropBitSetCache, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.SecurityRolesDls(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - BitSetCache = propBitSetCache.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.SecurityRolesDls value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropBitSetCache, value.BitSetCache, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.SecurityRolesDlsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.SecurityRolesDlsConverter))] public sealed partial class SecurityRolesDls { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDlsBitSetCache.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDlsBitSetCache.Converters.g.cs new file mode 100644 index 00000000000..3df6aebc8f3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDlsBitSetCache.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class SecurityRolesDlsBitSetCacheConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropMemory = System.Text.Json.JsonEncodedText.Encode("memory"); + private static readonly System.Text.Json.JsonEncodedText PropMemoryInBytes = System.Text.Json.JsonEncodedText.Encode("memory_in_bytes"); + + public override Elastic.Clients.Elasticsearch.Xpack.SecurityRolesDlsBitSetCache Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propMemory = default; + LocalJsonValue propMemoryInBytes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propMemory.TryReadProperty(ref reader, options, PropMemory, null)) + { + continue; + } + + if (propMemoryInBytes.TryReadProperty(ref reader, options, PropMemoryInBytes, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.SecurityRolesDlsBitSetCache(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Memory = propMemory.Value, + MemoryInBytes = propMemoryInBytes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.SecurityRolesDlsBitSetCache value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropMemory, value.Memory, null, null); + writer.WriteProperty(options, PropMemoryInBytes, value.MemoryInBytes, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDlsBitSetCache.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDlsBitSetCache.g.cs index 9be2b97ae94..eaf3a027d25 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDlsBitSetCache.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDlsBitSetCache.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class SecurityRolesDlsBitSetCacheConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropMemory = System.Text.Json.JsonEncodedText.Encode("memory"); - private static readonly System.Text.Json.JsonEncodedText PropMemoryInBytes = System.Text.Json.JsonEncodedText.Encode("memory_in_bytes"); - - public override Elastic.Clients.Elasticsearch.Xpack.SecurityRolesDlsBitSetCache Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propMemory = default; - LocalJsonValue propMemoryInBytes = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propMemory.TryReadProperty(ref reader, options, PropMemory, null)) - { - continue; - } - - if (propMemoryInBytes.TryReadProperty(ref reader, options, PropMemoryInBytes, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.SecurityRolesDlsBitSetCache(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Memory = propMemory.Value, - MemoryInBytes = propMemoryInBytes.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.SecurityRolesDlsBitSetCache value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropMemory, value.Memory, null, null); - writer.WriteProperty(options, PropMemoryInBytes, value.MemoryInBytes, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.SecurityRolesDlsBitSetCacheConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.SecurityRolesDlsBitSetCacheConverter))] public sealed partial class SecurityRolesDlsBitSetCache { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesFile.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesFile.Converters.g.cs new file mode 100644 index 00000000000..23de47e7536 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesFile.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class SecurityRolesFileConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDls = System.Text.Json.JsonEncodedText.Encode("dls"); + private static readonly System.Text.Json.JsonEncodedText PropFls = System.Text.Json.JsonEncodedText.Encode("fls"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + + public override Elastic.Clients.Elasticsearch.Xpack.SecurityRolesFile Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDls = default; + LocalJsonValue propFls = default; + LocalJsonValue propSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDls.TryReadProperty(ref reader, options, PropDls, null)) + { + continue; + } + + if (propFls.TryReadProperty(ref reader, options, PropFls, null)) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.SecurityRolesFile(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Dls = propDls.Value, + Fls = propFls.Value, + Size = propSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.SecurityRolesFile value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDls, value.Dls, null, null); + writer.WriteProperty(options, PropFls, value.Fls, null, null); + writer.WriteProperty(options, PropSize, value.Size, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesFile.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesFile.g.cs index 4131fcc4a5a..55e8cb3c009 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesFile.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesFile.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class SecurityRolesFileConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDls = System.Text.Json.JsonEncodedText.Encode("dls"); - private static readonly System.Text.Json.JsonEncodedText PropFls = System.Text.Json.JsonEncodedText.Encode("fls"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - - public override Elastic.Clients.Elasticsearch.Xpack.SecurityRolesFile Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDls = default; - LocalJsonValue propFls = default; - LocalJsonValue propSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDls.TryReadProperty(ref reader, options, PropDls, null)) - { - continue; - } - - if (propFls.TryReadProperty(ref reader, options, PropFls, null)) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.SecurityRolesFile(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Dls = propDls.Value, - Fls = propFls.Value, - Size = propSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.SecurityRolesFile value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDls, value.Dls, null, null); - writer.WriteProperty(options, PropFls, value.Fls, null, null); - writer.WriteProperty(options, PropSize, value.Size, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.SecurityRolesFileConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.SecurityRolesFileConverter))] public sealed partial class SecurityRolesFile { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesNative.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesNative.Converters.g.cs new file mode 100644 index 00000000000..ca7e7b3df40 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesNative.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class SecurityRolesNativeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDls = System.Text.Json.JsonEncodedText.Encode("dls"); + private static readonly System.Text.Json.JsonEncodedText PropFls = System.Text.Json.JsonEncodedText.Encode("fls"); + private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); + + public override Elastic.Clients.Elasticsearch.Xpack.SecurityRolesNative Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDls = default; + LocalJsonValue propFls = default; + LocalJsonValue propSize = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDls.TryReadProperty(ref reader, options, PropDls, null)) + { + continue; + } + + if (propFls.TryReadProperty(ref reader, options, PropFls, null)) + { + continue; + } + + if (propSize.TryReadProperty(ref reader, options, PropSize, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.SecurityRolesNative(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Dls = propDls.Value, + Fls = propFls.Value, + Size = propSize.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.SecurityRolesNative value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDls, value.Dls, null, null); + writer.WriteProperty(options, PropFls, value.Fls, null, null); + writer.WriteProperty(options, PropSize, value.Size, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesNative.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesNative.g.cs index 85cf68d5125..6ee57edb7f3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesNative.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesNative.g.cs @@ -23,64 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class SecurityRolesNativeConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropDls = System.Text.Json.JsonEncodedText.Encode("dls"); - private static readonly System.Text.Json.JsonEncodedText PropFls = System.Text.Json.JsonEncodedText.Encode("fls"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); - - public override Elastic.Clients.Elasticsearch.Xpack.SecurityRolesNative Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propDls = default; - LocalJsonValue propFls = default; - LocalJsonValue propSize = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propDls.TryReadProperty(ref reader, options, PropDls, null)) - { - continue; - } - - if (propFls.TryReadProperty(ref reader, options, PropFls, null)) - { - continue; - } - - if (propSize.TryReadProperty(ref reader, options, PropSize, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.SecurityRolesNative(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Dls = propDls.Value, - Fls = propFls.Value, - Size = propSize.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.SecurityRolesNative value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropDls, value.Dls, null, null); - writer.WriteProperty(options, PropFls, value.Fls, null, null); - writer.WriteProperty(options, PropSize, value.Size, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.SecurityRolesNativeConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.SecurityRolesNativeConverter))] public sealed partial class SecurityRolesNative { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Slm.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Slm.Converters.g.cs new file mode 100644 index 00000000000..98ffbe7ad90 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Slm.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class SlmConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropPolicyCount = System.Text.Json.JsonEncodedText.Encode("policy_count"); + private static readonly System.Text.Json.JsonEncodedText PropPolicyStats = System.Text.Json.JsonEncodedText.Encode("policy_stats"); + + public override Elastic.Clients.Elasticsearch.Xpack.Slm Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvailable = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propPolicyCount = default; + LocalJsonValue propPolicyStats = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propPolicyCount.TryReadProperty(ref reader, options, PropPolicyCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPolicyStats.TryReadProperty(ref reader, options, PropPolicyStats, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.Slm(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Available = propAvailable.Value, + Enabled = propEnabled.Value, + PolicyCount = propPolicyCount.Value, + PolicyStats = propPolicyStats.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Slm value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvailable, value.Available, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropPolicyCount, value.PolicyCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPolicyStats, value.PolicyStats, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Slm.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Slm.g.cs index 3ba22abb89e..b8b66af6008 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Slm.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Slm.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class SlmConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropPolicyCount = System.Text.Json.JsonEncodedText.Encode("policy_count"); - private static readonly System.Text.Json.JsonEncodedText PropPolicyStats = System.Text.Json.JsonEncodedText.Encode("policy_stats"); - - public override Elastic.Clients.Elasticsearch.Xpack.Slm Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvailable = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propPolicyCount = default; - LocalJsonValue propPolicyStats = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propPolicyCount.TryReadProperty(ref reader, options, PropPolicyCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPolicyStats.TryReadProperty(ref reader, options, PropPolicyStats, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.Slm(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Available = propAvailable.Value, - Enabled = propEnabled.Value, - PolicyCount = propPolicyCount.Value, - PolicyStats = propPolicyStats.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Slm value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvailable, value.Available, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropPolicyCount, value.PolicyCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPolicyStats, value.PolicyStats, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.SlmConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.SlmConverter))] public sealed partial class Slm { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Sql.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Sql.Converters.g.cs new file mode 100644 index 00000000000..bec732bb612 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Sql.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class SqlConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropFeatures = System.Text.Json.JsonEncodedText.Encode("features"); + private static readonly System.Text.Json.JsonEncodedText PropQueries = System.Text.Json.JsonEncodedText.Encode("queries"); + + public override Elastic.Clients.Elasticsearch.Xpack.Sql Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvailable = default; + LocalJsonValue propEnabled = default; + LocalJsonValue> propFeatures = default; + LocalJsonValue> propQueries = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propFeatures.TryReadProperty(ref reader, options, PropFeatures, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propQueries.TryReadProperty(ref reader, options, PropQueries, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.Sql(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Available = propAvailable.Value, + Enabled = propEnabled.Value, + Features = propFeatures.Value, + Queries = propQueries.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Sql value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvailable, value.Available, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropFeatures, value.Features, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropQueries, value.Queries, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Sql.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Sql.g.cs index 026d24a2f4b..55245b7fa5a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Sql.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Sql.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class SqlConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropFeatures = System.Text.Json.JsonEncodedText.Encode("features"); - private static readonly System.Text.Json.JsonEncodedText PropQueries = System.Text.Json.JsonEncodedText.Encode("queries"); - - public override Elastic.Clients.Elasticsearch.Xpack.Sql Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvailable = default; - LocalJsonValue propEnabled = default; - LocalJsonValue> propFeatures = default; - LocalJsonValue> propQueries = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propFeatures.TryReadProperty(ref reader, options, PropFeatures, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propQueries.TryReadProperty(ref reader, options, PropQueries, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.Sql(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Available = propAvailable.Value, - Enabled = propEnabled.Value, - Features = propFeatures.Value, - Queries = propQueries.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Sql value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvailable, value.Available, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropFeatures, value.Features, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropQueries, value.Queries, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.SqlConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.SqlConverter))] public sealed partial class Sql { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ssl.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ssl.Converters.g.cs new file mode 100644 index 00000000000..4c821e5cf58 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ssl.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class SslConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropHttp = System.Text.Json.JsonEncodedText.Encode("http"); + private static readonly System.Text.Json.JsonEncodedText PropTransport = System.Text.Json.JsonEncodedText.Encode("transport"); + + public override Elastic.Clients.Elasticsearch.Xpack.Ssl Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propHttp = default; + LocalJsonValue propTransport = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propHttp.TryReadProperty(ref reader, options, PropHttp, null)) + { + continue; + } + + if (propTransport.TryReadProperty(ref reader, options, PropTransport, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.Ssl(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Http = propHttp.Value, + Transport = propTransport.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Ssl value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropHttp, value.Http, null, null); + writer.WriteProperty(options, PropTransport, value.Transport, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ssl.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ssl.g.cs index a4c4074d49e..a99ff88fea0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ssl.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Ssl.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class SslConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropHttp = System.Text.Json.JsonEncodedText.Encode("http"); - private static readonly System.Text.Json.JsonEncodedText PropTransport = System.Text.Json.JsonEncodedText.Encode("transport"); - - public override Elastic.Clients.Elasticsearch.Xpack.Ssl Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propHttp = default; - LocalJsonValue propTransport = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propHttp.TryReadProperty(ref reader, options, PropHttp, null)) - { - continue; - } - - if (propTransport.TryReadProperty(ref reader, options, PropTransport, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.Ssl(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Http = propHttp.Value, - Transport = propTransport.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Ssl value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropHttp, value.Http, null, null); - writer.WriteProperty(options, PropTransport, value.Transport, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.SslConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.SslConverter))] public sealed partial class Ssl { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Vector.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Vector.Converters.g.cs new file mode 100644 index 00000000000..ba817a4d983 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Vector.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class VectorConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); + private static readonly System.Text.Json.JsonEncodedText PropDenseVectorDimsAvgCount = System.Text.Json.JsonEncodedText.Encode("dense_vector_dims_avg_count"); + private static readonly System.Text.Json.JsonEncodedText PropDenseVectorFieldsCount = System.Text.Json.JsonEncodedText.Encode("dense_vector_fields_count"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropSparseVectorFieldsCount = System.Text.Json.JsonEncodedText.Encode("sparse_vector_fields_count"); + + public override Elastic.Clients.Elasticsearch.Xpack.Vector Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvailable = default; + LocalJsonValue propDenseVectorDimsAvgCount = default; + LocalJsonValue propDenseVectorFieldsCount = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propSparseVectorFieldsCount = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) + { + continue; + } + + if (propDenseVectorDimsAvgCount.TryReadProperty(ref reader, options, PropDenseVectorDimsAvgCount, null)) + { + continue; + } + + if (propDenseVectorFieldsCount.TryReadProperty(ref reader, options, PropDenseVectorFieldsCount, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propSparseVectorFieldsCount.TryReadProperty(ref reader, options, PropSparseVectorFieldsCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.Vector(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Available = propAvailable.Value, + DenseVectorDimsAvgCount = propDenseVectorDimsAvgCount.Value, + DenseVectorFieldsCount = propDenseVectorFieldsCount.Value, + Enabled = propEnabled.Value, + SparseVectorFieldsCount = propSparseVectorFieldsCount.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Vector value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvailable, value.Available, null, null); + writer.WriteProperty(options, PropDenseVectorDimsAvgCount, value.DenseVectorDimsAvgCount, null, null); + writer.WriteProperty(options, PropDenseVectorFieldsCount, value.DenseVectorFieldsCount, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropSparseVectorFieldsCount, value.SparseVectorFieldsCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Vector.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Vector.g.cs index 035cc0095eb..d2a6f9ddbb2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Vector.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Vector.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class VectorConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); - private static readonly System.Text.Json.JsonEncodedText PropDenseVectorDimsAvgCount = System.Text.Json.JsonEncodedText.Encode("dense_vector_dims_avg_count"); - private static readonly System.Text.Json.JsonEncodedText PropDenseVectorFieldsCount = System.Text.Json.JsonEncodedText.Encode("dense_vector_fields_count"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropSparseVectorFieldsCount = System.Text.Json.JsonEncodedText.Encode("sparse_vector_fields_count"); - - public override Elastic.Clients.Elasticsearch.Xpack.Vector Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvailable = default; - LocalJsonValue propDenseVectorDimsAvgCount = default; - LocalJsonValue propDenseVectorFieldsCount = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propSparseVectorFieldsCount = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) - { - continue; - } - - if (propDenseVectorDimsAvgCount.TryReadProperty(ref reader, options, PropDenseVectorDimsAvgCount, null)) - { - continue; - } - - if (propDenseVectorFieldsCount.TryReadProperty(ref reader, options, PropDenseVectorFieldsCount, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propSparseVectorFieldsCount.TryReadProperty(ref reader, options, PropSparseVectorFieldsCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.Vector(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Available = propAvailable.Value, - DenseVectorDimsAvgCount = propDenseVectorDimsAvgCount.Value, - DenseVectorFieldsCount = propDenseVectorFieldsCount.Value, - Enabled = propEnabled.Value, - SparseVectorFieldsCount = propSparseVectorFieldsCount.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Vector value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvailable, value.Available, null, null); - writer.WriteProperty(options, PropDenseVectorDimsAvgCount, value.DenseVectorDimsAvgCount, null, null); - writer.WriteProperty(options, PropDenseVectorFieldsCount, value.DenseVectorFieldsCount, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropSparseVectorFieldsCount, value.SparseVectorFieldsCount, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.VectorConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.VectorConverter))] public sealed partial class Vector { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Watcher.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Watcher.Converters.g.cs new file mode 100644 index 00000000000..f037f6bdb56 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Watcher.Converters.g.cs @@ -0,0 +1,99 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class WatcherConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); + private static readonly System.Text.Json.JsonEncodedText PropExecution = System.Text.Json.JsonEncodedText.Encode("execution"); + private static readonly System.Text.Json.JsonEncodedText PropWatch = System.Text.Json.JsonEncodedText.Encode("watch"); + + public override Elastic.Clients.Elasticsearch.Xpack.Watcher Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvailable = default; + LocalJsonValue propCount = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propExecution = default; + LocalJsonValue propWatch = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) + { + continue; + } + + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) + { + continue; + } + + if (propExecution.TryReadProperty(ref reader, options, PropExecution, null)) + { + continue; + } + + if (propWatch.TryReadProperty(ref reader, options, PropWatch, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.Watcher(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Available = propAvailable.Value, + Count = propCount.Value, + Enabled = propEnabled.Value, + Execution = propExecution.Value, + Watch = propWatch.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Watcher value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvailable, value.Available, null, null); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); + writer.WriteProperty(options, PropExecution, value.Execution, null, null); + writer.WriteProperty(options, PropWatch, value.Watch, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Watcher.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Watcher.g.cs index 72520a802fa..dbb0fea8cbf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Watcher.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/Watcher.g.cs @@ -23,82 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class WatcherConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAvailable = System.Text.Json.JsonEncodedText.Encode("available"); - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"); - private static readonly System.Text.Json.JsonEncodedText PropExecution = System.Text.Json.JsonEncodedText.Encode("execution"); - private static readonly System.Text.Json.JsonEncodedText PropWatch = System.Text.Json.JsonEncodedText.Encode("watch"); - - public override Elastic.Clients.Elasticsearch.Xpack.Watcher Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAvailable = default; - LocalJsonValue propCount = default; - LocalJsonValue propEnabled = default; - LocalJsonValue propExecution = default; - LocalJsonValue propWatch = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAvailable.TryReadProperty(ref reader, options, PropAvailable, null)) - { - continue; - } - - if (propCount.TryReadProperty(ref reader, options, PropCount, null)) - { - continue; - } - - if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, null)) - { - continue; - } - - if (propExecution.TryReadProperty(ref reader, options, PropExecution, null)) - { - continue; - } - - if (propWatch.TryReadProperty(ref reader, options, PropWatch, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.Watcher(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Available = propAvailable.Value, - Count = propCount.Value, - Enabled = propEnabled.Value, - Execution = propExecution.Value, - Watch = propWatch.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.Watcher value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAvailable, value.Available, null, null); - writer.WriteProperty(options, PropCount, value.Count, null, null); - writer.WriteProperty(options, PropEnabled, value.Enabled, null, null); - writer.WriteProperty(options, PropExecution, value.Execution, null, null); - writer.WriteProperty(options, PropWatch, value.Watch, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.WatcherConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.WatcherConverter))] public sealed partial class Watcher { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherActionTotals.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherActionTotals.Converters.g.cs new file mode 100644 index 00000000000..44aeceeae07 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherActionTotals.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class WatcherActionTotalsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + private static readonly System.Text.Json.JsonEncodedText PropTotalTimeInMs = System.Text.Json.JsonEncodedText.Encode("total_time_in_ms"); + + public override Elastic.Clients.Elasticsearch.Xpack.WatcherActionTotals Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propTotal = default; + LocalJsonValue propTotalTimeInMs = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (propTotalTimeInMs.TryReadProperty(ref reader, options, PropTotalTimeInMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.WatcherActionTotals(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Total = propTotal.Value, + TotalTimeInMs = propTotalTimeInMs.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.WatcherActionTotals value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteProperty(options, PropTotalTimeInMs, value.TotalTimeInMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherActionTotals.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherActionTotals.g.cs index 0c4cdf4a0ff..6bbce079699 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherActionTotals.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherActionTotals.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class WatcherActionTotalsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - private static readonly System.Text.Json.JsonEncodedText PropTotalTimeInMs = System.Text.Json.JsonEncodedText.Encode("total_time_in_ms"); - - public override Elastic.Clients.Elasticsearch.Xpack.WatcherActionTotals Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propTotal = default; - LocalJsonValue propTotalTimeInMs = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (propTotalTimeInMs.TryReadProperty(ref reader, options, PropTotalTimeInMs, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.WatcherActionTotals(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Total = propTotal.Value, - TotalTimeInMs = propTotalTimeInMs.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.WatcherActionTotals value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteProperty(options, PropTotalTimeInMs, value.TotalTimeInMs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.WatcherActionTotalsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.WatcherActionTotalsConverter))] public sealed partial class WatcherActionTotals { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherActions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherActions.Converters.g.cs new file mode 100644 index 00000000000..6009cfa883c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherActions.Converters.g.cs @@ -0,0 +1,63 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class WatcherActionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropActions = System.Text.Json.JsonEncodedText.Encode("actions"); + + public override Elastic.Clients.Elasticsearch.Xpack.WatcherActions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propActions = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propActions.TryReadProperty(ref reader, options, PropActions, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.WatcherActions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Actions = propActions.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.WatcherActions value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropActions, value.Actions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherActions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherActions.g.cs index 803acd1ac3a..6d2c093bb65 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherActions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherActions.g.cs @@ -23,46 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class WatcherActionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropActions = System.Text.Json.JsonEncodedText.Encode("actions"); - - public override Elastic.Clients.Elasticsearch.Xpack.WatcherActions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue> propActions = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propActions.TryReadProperty(ref reader, options, PropActions, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.WatcherActions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Actions = propActions.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.WatcherActions value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropActions, value.Actions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.WatcherActionsConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.WatcherActionsConverter))] public sealed partial class WatcherActions { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatch.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatch.Converters.g.cs new file mode 100644 index 00000000000..7df5028c518 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatch.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class WatcherWatchConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAction = System.Text.Json.JsonEncodedText.Encode("action"); + private static readonly System.Text.Json.JsonEncodedText PropCondition = System.Text.Json.JsonEncodedText.Encode("condition"); + private static readonly System.Text.Json.JsonEncodedText PropInput = System.Text.Json.JsonEncodedText.Encode("input"); + private static readonly System.Text.Json.JsonEncodedText PropTrigger = System.Text.Json.JsonEncodedText.Encode("trigger"); + + public override Elastic.Clients.Elasticsearch.Xpack.WatcherWatch Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAction = default; + LocalJsonValue?> propCondition = default; + LocalJsonValue> propInput = default; + LocalJsonValue propTrigger = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAction.TryReadProperty(ref reader, options, PropAction, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propCondition.TryReadProperty(ref reader, options, PropCondition, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propInput.TryReadProperty(ref reader, options, PropInput, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propTrigger.TryReadProperty(ref reader, options, PropTrigger, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.WatcherWatch(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Action = propAction.Value, + Condition = propCondition.Value, + Input = propInput.Value, + Trigger = propTrigger.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.WatcherWatch value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAction, value.Action, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropCondition, value.Condition, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropInput, value.Input, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropTrigger, value.Trigger, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatch.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatch.g.cs index 6ddf88fad22..ac9928788d8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatch.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatch.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class WatcherWatchConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAction = System.Text.Json.JsonEncodedText.Encode("action"); - private static readonly System.Text.Json.JsonEncodedText PropCondition = System.Text.Json.JsonEncodedText.Encode("condition"); - private static readonly System.Text.Json.JsonEncodedText PropInput = System.Text.Json.JsonEncodedText.Encode("input"); - private static readonly System.Text.Json.JsonEncodedText PropTrigger = System.Text.Json.JsonEncodedText.Encode("trigger"); - - public override Elastic.Clients.Elasticsearch.Xpack.WatcherWatch Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propAction = default; - LocalJsonValue?> propCondition = default; - LocalJsonValue> propInput = default; - LocalJsonValue propTrigger = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAction.TryReadProperty(ref reader, options, PropAction, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propCondition.TryReadProperty(ref reader, options, PropCondition, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propInput.TryReadProperty(ref reader, options, PropInput, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) - { - continue; - } - - if (propTrigger.TryReadProperty(ref reader, options, PropTrigger, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.WatcherWatch(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Action = propAction.Value, - Condition = propCondition.Value, - Input = propInput.Value, - Trigger = propTrigger.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.WatcherWatch value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAction, value.Action, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropCondition, value.Condition, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropInput, value.Input, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); - writer.WriteProperty(options, PropTrigger, value.Trigger, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.WatcherWatchConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.WatcherWatchConverter))] public sealed partial class WatcherWatch { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatchTrigger.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatchTrigger.Converters.g.cs new file mode 100644 index 00000000000..0dc1c32b2f8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatchTrigger.Converters.g.cs @@ -0,0 +1,72 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class WatcherWatchTriggerConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAll = System.Text.Json.JsonEncodedText.Encode("_all"); + private static readonly System.Text.Json.JsonEncodedText PropSchedule = System.Text.Json.JsonEncodedText.Encode("schedule"); + + public override Elastic.Clients.Elasticsearch.Xpack.WatcherWatchTrigger Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAll = default; + LocalJsonValue propSchedule = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAll.TryReadProperty(ref reader, options, PropAll, null)) + { + continue; + } + + if (propSchedule.TryReadProperty(ref reader, options, PropSchedule, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.WatcherWatchTrigger(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + All = propAll.Value, + Schedule = propSchedule.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.WatcherWatchTrigger value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAll, value.All, null, null); + writer.WriteProperty(options, PropSchedule, value.Schedule, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatchTrigger.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatchTrigger.g.cs index 4d2979a4e1c..2c0b13a7f7a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatchTrigger.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatchTrigger.g.cs @@ -23,55 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class WatcherWatchTriggerConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAll = System.Text.Json.JsonEncodedText.Encode("_all"); - private static readonly System.Text.Json.JsonEncodedText PropSchedule = System.Text.Json.JsonEncodedText.Encode("schedule"); - - public override Elastic.Clients.Elasticsearch.Xpack.WatcherWatchTrigger Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAll = default; - LocalJsonValue propSchedule = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAll.TryReadProperty(ref reader, options, PropAll, null)) - { - continue; - } - - if (propSchedule.TryReadProperty(ref reader, options, PropSchedule, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.WatcherWatchTrigger(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - All = propAll.Value, - Schedule = propSchedule.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.WatcherWatchTrigger value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAll, value.All, null, null); - writer.WriteProperty(options, PropSchedule, value.Schedule, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.WatcherWatchTriggerConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.WatcherWatchTriggerConverter))] public sealed partial class WatcherWatchTrigger { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatchTriggerSchedule.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatchTriggerSchedule.Converters.g.cs new file mode 100644 index 00000000000..7780b18fbd4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatchTriggerSchedule.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class WatcherWatchTriggerScheduleConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropActive = System.Text.Json.JsonEncodedText.Encode("active"); + private static readonly System.Text.Json.JsonEncodedText PropAll = System.Text.Json.JsonEncodedText.Encode("_all"); + private static readonly System.Text.Json.JsonEncodedText PropCron = System.Text.Json.JsonEncodedText.Encode("cron"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Xpack.WatcherWatchTriggerSchedule Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propActive = default; + LocalJsonValue propAll = default; + LocalJsonValue propCron = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propActive.TryReadProperty(ref reader, options, PropActive, null)) + { + continue; + } + + if (propAll.TryReadProperty(ref reader, options, PropAll, null)) + { + continue; + } + + if (propCron.TryReadProperty(ref reader, options, PropCron, null)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.WatcherWatchTriggerSchedule(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Active = propActive.Value, + All = propAll.Value, + Cron = propCron.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.WatcherWatchTriggerSchedule value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropActive, value.Active, null, null); + writer.WriteProperty(options, PropAll, value.All, null, null); + writer.WriteProperty(options, PropCron, value.Cron, null, null); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatchTriggerSchedule.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatchTriggerSchedule.g.cs index 4f3d89d533a..72707500c84 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatchTriggerSchedule.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/WatcherWatchTriggerSchedule.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class WatcherWatchTriggerScheduleConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropActive = System.Text.Json.JsonEncodedText.Encode("active"); - private static readonly System.Text.Json.JsonEncodedText PropAll = System.Text.Json.JsonEncodedText.Encode("_all"); - private static readonly System.Text.Json.JsonEncodedText PropCron = System.Text.Json.JsonEncodedText.Encode("cron"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Xpack.WatcherWatchTriggerSchedule Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propActive = default; - LocalJsonValue propAll = default; - LocalJsonValue propCron = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propActive.TryReadProperty(ref reader, options, PropActive, null)) - { - continue; - } - - if (propAll.TryReadProperty(ref reader, options, PropAll, null)) - { - continue; - } - - if (propCron.TryReadProperty(ref reader, options, PropCron, null)) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.WatcherWatchTriggerSchedule(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Active = propActive.Value, - All = propAll.Value, - Cron = propCron.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.WatcherWatchTriggerSchedule value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropActive, value.Active, null, null); - writer.WriteProperty(options, PropAll, value.All, null, null); - writer.WriteProperty(options, PropCron, value.Cron, null, null); - writer.WriteProperty(options, PropTotal, value.Total, null, null); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.WatcherWatchTriggerScheduleConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.WatcherWatchTriggerScheduleConverter))] public sealed partial class WatcherWatchTriggerSchedule { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Xpack.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/XPackCategory.Converters.g.cs similarity index 88% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Xpack.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/XPackCategory.Converters.g.cs index 7ef37d47566..7daf59a2db4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Xpack.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/XPackCategory.Converters.g.cs @@ -21,9 +21,9 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.Xpack; +namespace Elastic.Clients.Elasticsearch.Xpack.Json; -internal sealed partial class XPackCategoryConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class XPackCategoryConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText MemberBuild = System.Text.Json.JsonEncodedText.Encode("build"); private static readonly System.Text.Json.JsonEncodedText MemberFeatures = System.Text.Json.JsonEncodedText.Encode("features"); @@ -92,15 +92,4 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, { Write(writer, value, options); } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.XPackCategoryConverter))] -public enum XPackCategory -{ - [System.Runtime.Serialization.EnumMember(Value = "build")] - Build, - [System.Runtime.Serialization.EnumMember(Value = "features")] - Features, - [System.Runtime.Serialization.EnumMember(Value = "license")] - License } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/XPackCategory.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/XPackCategory.g.cs new file mode 100644 index 00000000000..833c8eb1462 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/XPackCategory.g.cs @@ -0,0 +1,35 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.XPackCategoryConverter))] +public enum XPackCategory +{ + [System.Runtime.Serialization.EnumMember(Value = "build")] + Build, + [System.Runtime.Serialization.EnumMember(Value = "features")] + Features, + [System.Runtime.Serialization.EnumMember(Value = "license")] + License +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/XpackUsageQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/XpackUsageQuery.Converters.g.cs new file mode 100644 index 00000000000..c62ab6692f9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/XpackUsageQuery.Converters.g.cs @@ -0,0 +1,90 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Xpack.Json; + +public sealed partial class XpackUsageQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropFailed = System.Text.Json.JsonEncodedText.Encode("failed"); + private static readonly System.Text.Json.JsonEncodedText PropPaging = System.Text.Json.JsonEncodedText.Encode("paging"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Xpack.XpackUsageQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propFailed = default; + LocalJsonValue propPaging = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFailed.TryReadProperty(ref reader, options, PropFailed, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propPaging.TryReadProperty(ref reader, options, PropPaging, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Xpack.XpackUsageQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Failed = propFailed.Value, + Paging = propPaging.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.XpackUsageQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFailed, value.Failed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropPaging, value.Paging, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTotal, value.Total, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/XpackUsageQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/XpackUsageQuery.g.cs index 4440acd34a9..30621757956 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/XpackUsageQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/XpackUsageQuery.g.cs @@ -23,73 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Xpack; -internal sealed partial class XpackUsageQueryConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); - private static readonly System.Text.Json.JsonEncodedText PropFailed = System.Text.Json.JsonEncodedText.Encode("failed"); - private static readonly System.Text.Json.JsonEncodedText PropPaging = System.Text.Json.JsonEncodedText.Encode("paging"); - private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); - - public override Elastic.Clients.Elasticsearch.Xpack.XpackUsageQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propCount = default; - LocalJsonValue propFailed = default; - LocalJsonValue propPaging = default; - LocalJsonValue propTotal = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propCount.TryReadProperty(ref reader, options, PropCount, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propFailed.TryReadProperty(ref reader, options, PropFailed, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propPaging.TryReadProperty(ref reader, options, PropPaging, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (propTotal.TryReadProperty(ref reader, options, PropTotal, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) - { - reader.Skip(); - continue; - } - - throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Xpack.XpackUsageQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Count = propCount.Value, - Failed = propFailed.Value, - Paging = propPaging.Value, - Total = propTotal.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Xpack.XpackUsageQuery value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropCount, value.Count, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropFailed, value.Failed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropPaging, value.Paging, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropTotal, value.Total, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); - writer.WriteEndObject(); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.XpackUsageQueryConverter))] +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Xpack.Json.XpackUsageQueryConverter))] public sealed partial class XpackUsageQuery { #if NET7_0_OR_GREATER